From d6f80f23237427e7caf64ce58ea7b28c04595c14 Mon Sep 17 00:00:00 2001 From: Sparkle <2705263765@qq.com> Date: Thu, 15 Oct 2026 20:12:03 +0800 Subject: [PATCH 1/3] fix(web): keep long live replies inside the SSE event budget The live message projection bounds text by characters, but CJK text is three UTF-8 bytes per character and `content` repeats the text parts, so an 11,000-character Chinese reply produced a 66 KB message_update. Every later update was replaced with state_invalidated and the client refetched the snapshot and reconnected for the rest of the reply. When a live message event exceeds the limit, publish now shrinks only its reply text to the room this envelope leaves, shares that budget across content, text and thinking parts, cuts on whole code points and marks the projection as a transport-only truncation. Other oversized events keep the fail-closed invalidation. The transcript matches such a live row to its persisted entry by identity and text prefix, so the reply is not shown twice once it settles; the persisted entry keeps the full text and its existing recovery path. Closes #835 Co-Authored-By: Claude Opus 4.8 --- tests/web/live-message-budget.spec.ts | 110 ++++++++ tests/web/live-message-budget.test.ts | 255 ++++++++++++++++++ tests/web/protocol.test.ts | 77 ++++++ web/dist/app.js | 4 +- web/dist/build-info.json | 2 +- web/host/web-host.ts | 34 ++- web/protocol/types.ts | 124 +++++++++ .../features/transcript/transcript-entries.ts | 18 +- 8 files changed, 618 insertions(+), 6 deletions(-) create mode 100644 tests/web/live-message-budget.spec.ts create mode 100644 tests/web/live-message-budget.test.ts diff --git a/tests/web/live-message-budget.spec.ts b/tests/web/live-message-budget.spec.ts new file mode 100644 index 000000000..9af07dfcb --- /dev/null +++ b/tests/web/live-message-budget.spec.ts @@ -0,0 +1,110 @@ +// @vitest-environment jsdom + +import { cleanup, render } from "@testing-library/react"; +import { createElement } from "react"; +import { I18nextProvider } from "react-i18next"; +import { afterEach, expect, it } from "vitest"; +import { + fitLiveMessage, + projectMessage, + WEB_MAX_EVENT_BYTES, + type WebLiveMessage, + type WebSnapshot, +} from "../../web/protocol/types.ts"; +import { Transcript } from "../../web/ui/src/features/transcript/Transcript.tsx"; +import { i18n } from "../../web/ui/src/i18n.ts"; + +afterEach(cleanup); + +const native = { + role: "assistant", + content: [{ type: "text", text: "中".repeat(11_500) }], + stopReason: "stop", + timestamp: 1_792_022_400_000, +}; + +function snapshotWith( + entries: NonNullable["entries"], +): WebSnapshot { + return { + protocolVersion: 1, + generatedAt: "2026-10-15T00:00:00Z", + cursor: 1, + preferences: { theme: "system" }, + currentSessionId: "current", + currentSessionPath: "/tmp/current.jsonl", + workspaces: [], + sessions: [], + models: [], + selectedSession: { + id: "current", + path: "/tmp/current.jsonl", + cwd: "/tmp", + entries, + bytes: 0, + truncation: { + truncated: false, + maxBytes: 2097152, + entriesOmitted: 0, + messagesTruncated: 0, + messagePartsOmitted: 0, + }, + }, + runtime: { status: "idle", capabilities: {} }, + truncation: { + truncated: false, + maxBytes: 4194304, + bytes: 0, + sessionsOmitted: 0, + workspacesOmitted: 0, + modelsOmitted: 0, + }, + }; +} + +function responseRows(snapshot: WebSnapshot, live: WebLiveMessage) { + const { container } = render( + createElement( + I18nextProvider, + { i18n }, + createElement(Transcript, { + snapshot, + liveMessages: [{ key: "live-1", message: live }], + liveRunning: false, + livePhase: "idle" as const, + liveRetry: null, + thinkingStarts: {}, + thinkingDurations: {}, + scrollToBottom: 0, + onResend: async () => true, + }), + ), + ); + return container.querySelectorAll(".message-row.assistant.response").length; +} + +const persisted = projectMessage(native); +const live = fitLiveMessage(persisted, WEB_MAX_EVENT_BYTES - 200); +const persistedEntry = (message: WebLiveMessage) => ({ + id: "reply", + timestamp: "2026-10-15T00:00:00Z", + type: "message" as const, + message, +}); + +it("FAIL: a byte-trimmed live reply is not shown again beside its persisted entry", () => { + expect(live.truncation?.transport).toBe(true); + expect(responseRows(snapshotWith([persistedEntry(persisted)]), live)).toBe(1); +}); + +it("a byte-trimmed live reply still renders before it is persisted", () => { + expect(responseRows(snapshotWith([]), live)).toBe(1); +}); + +it("a byte-trimmed live reply does not hide a different reply that shares its timestamp", () => { + const other = projectMessage({ + ...native, + content: [{ type: "text", text: "另一条回答" }], + }); + expect(responseRows(snapshotWith([persistedEntry(other)]), live)).toBe(2); +}); diff --git a/tests/web/live-message-budget.test.ts b/tests/web/live-message-budget.test.ts new file mode 100644 index 000000000..b596e191c --- /dev/null +++ b/tests/web/live-message-budget.test.ts @@ -0,0 +1,255 @@ +import assert from "node:assert/strict"; +import { mkdir, mkdtemp, rm } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; +import test, { type TestContext } from "node:test"; +import { fauxAssistantMessage, fauxProvider } from "@earendil-works/pi-ai"; +import { + type CreateAgentSessionRuntimeFactory, + createAgentSessionFromServices, + createAgentSessionRuntime, + DefaultResourceLoader, + ModelRuntime, + SessionManager, + SettingsManager, +} from "@earendil-works/pi-coding-agent"; +import { createParser } from "eventsource-parser"; +import { WebHost } from "../../web/host/web-host.ts"; +import { + WEB_MAX_EVENT_BYTES, + type WebEvent, + type WebLiveMessage, + type WebSnapshot, +} from "../../web/protocol/types.ts"; +import { PiWebRuntime } from "../../web/runtime/pi-runtime.ts"; + +const REPLY = "中".repeat(20_000); + +/** One real Pi Session whose faux model streams a long Chinese reply. */ +async function longReplyHost(t: TestContext) { + const directory = await mkdtemp(join(tmpdir(), "openpi-live-budget-")); + const cwd = join(directory, "workspace"); + const agentDir = join(cwd, "agent"); + await mkdir(agentDir, { recursive: true }); + const provider = "live-budget-fixture"; + const faux = fauxProvider({ + api: provider, + provider, + models: [{ id: "fixture", name: "Fixture", reasoning: false }], + // 400 characters per delta, paced like a fast real stream. + tokenSize: { min: 100, max: 100 }, + tokensPerSecond: 4_000, + }); + faux.setResponses([fauxAssistantMessage(REPLY)]); + const modelRuntime = await ModelRuntime.create({ + authPath: join(agentDir, "auth.json"), + modelsPath: join(agentDir, "models.json"), + }); + modelRuntime.registerNativeProvider(faux.provider); + await modelRuntime.setRuntimeApiKey(provider, "fixture-key"); + const settingsManager = SettingsManager.inMemory(undefined, { + projectTrusted: false, + }); + const loader = new DefaultResourceLoader({ + cwd, + agentDir, + settingsManager, + noExtensions: true, + noSkills: true, + noThemes: true, + noPromptTemplates: true, + noContextFiles: true, + }); + await loader.reload(); + const services = { + cwd, + agentDir, + settingsManager, + modelRuntime, + resourceLoader: loader, + diagnostics: [], + }; + const create: CreateAgentSessionRuntimeFactory = async (options) => ({ + ...(await createAgentSessionFromServices({ + services, + sessionManager: options.sessionManager, + model: faux.getModel(), + tools: [], + })), + services, + diagnostics: [], + }); + const sessions = join(directory, "sessions"); + const runtime = await createAgentSessionRuntime(create, { + cwd, + agentDir, + sessionManager: SessionManager.create(cwd, sessions), + }); + const web = Reflect.construct(PiWebRuntime, [ + runtime, + sessions, + { timeoutMs: 10_000, release: async () => {} }, + { release: async () => {} }, + true, + ]) as PiWebRuntime; + await ( + web as unknown as { startRuntimeSession(): Promise } + ).startRuntimeSession(); + const host = new WebHost({ runtime: web }); + await host.start(); + t.after(async () => { + await host.stop(); + await rm(directory, { recursive: true, force: true }); + }); + const launched = new URL(host.url); + const token = new URLSearchParams(launched.hash.slice(1)).get("token"); + assert.ok(token); + return { + web, + origin: launched.origin, + headers: { Authorization: `Bearer ${token}` }, + }; +} + +/** + * Follow the stream with the browser client's rules: a `state_invalidated` + * event or a cursor gap forces a snapshot refetch and a new connection. + */ +function followLikeClient(origin: string, headers: Record) { + const stats = { + connections: 0, + snapshots: 0, + invalidations: 0, + messageUpdates: 0, + largestEventBytes: 0, + lastMessageEnd: undefined as WebLiveMessage | undefined, + }; + const stop = new AbortController(); + const snapshot = async () => { + stats.snapshots++; + const response = await fetch(`${origin}/api/snapshot`, { headers }); + return (await response.json()) as WebSnapshot & { cursor: number }; + }; + const connect = async (cursor: number) => { + stats.connections++; + const response = await fetch(`${origin}/events?cursor=${cursor}`, { + headers, + signal: stop.signal, + }); + assert.ok(response.body); + let resync = false; + const parser = createParser({ + onEvent(record) { + if (resync) return; + stats.largestEventBytes = Math.max( + stats.largestEventBytes, + Buffer.byteLength(record.data), + ); + const event = JSON.parse(record.data) as WebEvent; + if (event.sequence <= cursor) return; + if ( + event.sequence !== cursor + 1 || + event.type === "state_invalidated" + ) { + if (event.type === "state_invalidated") stats.invalidations++; + resync = true; + return; + } + cursor = event.sequence; + if (event.type === "message_update") stats.messageUpdates++; + if (event.type === "message_end") + stats.lastMessageEnd = event.detail?.message as WebLiveMessage; + }, + }); + const reader = response.body.getReader(); + const decoder = new TextDecoder(); + try { + while (!resync) { + const chunk = await reader.read(); + if (chunk.done) return undefined; + parser.feed(decoder.decode(chunk.value, { stream: true })); + } + } finally { + await reader.cancel().catch(() => undefined); + } + return (await snapshot()).cursor; + }; + const done = (async () => { + let cursor: number | undefined = (await snapshot()).cursor; + try { + while (cursor !== undefined && !stop.signal.aborted) + cursor = await connect(cursor); + } catch (error) { + if (!stop.signal.aborted) throw error; + } + })(); + return { + stats, + async close() { + stop.abort(); + await done; + }, + }; +} + +test("FAIL: a long Chinese reply streams without invalidating the SSE stream", { + timeout: 30_000, +}, async (t) => { + const { web, origin, headers } = await longReplyHost(t); + const client = followLikeClient(origin, headers); + // Let the client hold its first connection before the reply starts. + await new Promise((resolve) => setTimeout(resolve, 100)); + const sessionId = web.sessionManager.getSessionId(); + await web.sendPrompt("Answer at length in Chinese", { + commandId: "long-cjk-reply", + expectedSessionId: sessionId, + }); + const deadline = Date.now() + 20_000; + while (!web.isIdle() || web.getActiveTurn()) { + assert.ok(Date.now() < deadline, "the reply settled"); + await new Promise((resolve) => setTimeout(resolve, 25)); + } + await new Promise((resolve) => setTimeout(resolve, 300)); + await client.close(); + const { stats } = client; + t.diagnostic(JSON.stringify({ ...stats, lastMessageEnd: undefined })); + + assert.equal(stats.invalidations, 0, "no update was invalidated"); + assert.equal(stats.connections, 1, "the client never had to reconnect"); + assert.equal(stats.snapshots, 1, "only the initial snapshot was fetched"); + assert.ok(stats.messageUpdates >= 40, `${stats.messageUpdates} updates`); + assert.ok(stats.largestEventBytes <= WEB_MAX_EVENT_BYTES); + // The live projection says it is partial instead of silently ending early. + assert.equal(stats.lastMessageEnd?.truncation?.visibleText, true); + assert.match(stats.lastMessageEnd?.content ?? "", /\[truncated\]$/); + + // The persisted entry still recovers the complete reply. + const settled = (await ( + await fetch(`${origin}/api/snapshot`, { headers }) + ).json()) as WebSnapshot; + const session = settled.selectedSession; + assert.ok(session); + const reply = session.entries + .filter((entry) => entry.message?.role === "assistant") + .at(-1); + assert.ok(reply); + assert.equal(reply.message?.truncation?.visibleText, true); + let text = ""; + let cursor: number | null = 0; + while (cursor !== null) { + const page = (await ( + await fetch( + `${origin}/api/session/item?${new URLSearchParams({ + sessionId: session.id, + sessionPath: session.path, + entryId: reply.id, + cursor: String(cursor), + })}`, + { headers }, + ) + ).json()) as { text: string; nextCursor: number | null }; + text += page.text; + cursor = page.nextCursor; + } + assert.equal(text, REPLY); +}); diff --git a/tests/web/protocol.test.ts b/tests/web/protocol.test.ts index 0df708303..e5690b80f 100644 --- a/tests/web/protocol.test.ts +++ b/tests/web/protocol.test.ts @@ -1,9 +1,12 @@ import assert from "node:assert/strict"; import test from "node:test"; import { + fitLiveMessage, + jsonByteLength, projectEntries, projectEntry, projectMessage, + WEB_MAX_EVENT_BYTES, WEB_MAX_MESSAGE_PARTS, WEB_MAX_SELECTED_TRANSCRIPT_BYTES, } from "../../web/protocol/types.ts"; @@ -691,3 +694,77 @@ test("entry projection rolls retained message truncation into aggregate evidence assert.equal(projected.truncation.messagesTruncated, 1); assert.equal(projected.truncation.truncated, true); }); + +test("FAIL: live messages fit the SSE event budget for ASCII, CJK, emoji, escapes and many parts", () => { + const budget = WEB_MAX_EVENT_BYTES - 200; + const cases = [ + { name: "ascii", content: [{ type: "text", text: "a".repeat(12_000) }] }, + { name: "cjk", content: [{ type: "text", text: "中".repeat(12_000) }] }, + { name: "emoji", content: [{ type: "text", text: "😀".repeat(6_000) }] }, + { + name: "escapes", + content: [{ type: "text", text: "\u0001".repeat(12_000) }], + }, + { + name: "thinking and text", + content: [ + { type: "thinking", thinking: "思".repeat(12_000) }, + { type: "text", text: "中".repeat(12_000) }, + { type: "text", text: "短" }, + ], + }, + ]; + for (const { name, content } of cases) { + const projected = projectMessage({ role: "assistant", content }); + const fitted = fitLiveMessage(projected, budget); + assert.ok(jsonByteLength(fitted) <= budget, `${name} fits`); + if (jsonByteLength(projected) <= budget) { + assert.equal(fitted, projected, `${name} is unchanged when it fits`); + continue; + } + assert.equal(fitted.truncation?.truncated, true, name); + assert.equal(fitted.truncation?.text, true, name); + // Every kept text is a whole-code-point prefix of the original. + for (const [index, part] of (fitted.parts ?? []).entries()) { + const original = projected.parts?.[index]; + if (part.type !== "text" && part.type !== "thinking") continue; + assert.ok(original && "text" in original); + const kept = part.text.replace(/\n\[truncated\]$/, ""); + assert.ok(original.text.startsWith(kept), `${name} part ${index}`); + // No code point was split: re-encoding loses nothing. + assert.equal( + new TextDecoder().decode(new TextEncoder().encode(kept)), + kept, + `${name} part ${index}`, + ); + } + } + + const mixed = fitLiveMessage( + projectMessage({ + role: "assistant", + content: [ + { type: "thinking", thinking: "思".repeat(12_000) }, + { type: "text", text: "中".repeat(12_000) }, + { type: "text", text: "短" }, + ], + }), + budget, + ); + // A short part keeps its full text; the long ones share the remainder. + assert.deepEqual(mixed.parts?.[2], { type: "text", text: "短" }); + assert.equal( + mixed.parts?.[0]?.type === "thinking" && mixed.parts[0].textTruncated, + true, + ); + assert.equal(mixed.truncation?.visibleText, true); +}); + +test("live message fitting leaves metadata-only oversize to publish-time invalidation", () => { + const projected = projectMessage({ + role: "assistant", + content: [{ type: "text", text: "ok" }], + }); + const tooSmall = jsonByteLength({ ...projected, content: "" }) - 1; + assert.equal(fitLiveMessage(projected, tooSmall), projected); +}); diff --git a/web/dist/app.js b/web/dist/app.js index f5f6651d9..1c53f518f 100644 --- a/web/dist/app.js +++ b/web/dist/app.js @@ -97,7 +97,7 @@ Try polyfilling it using "@formatjs/intl-pluralrules" `:``}${t(`fileAttachmentPromptLabel`)}\n${r}`,m.length>12e3){re(t(`fileAttachmentPromptTooLong`));return}l.content=m}if(u=h?await n(m,s.images,i,a,h):a?await n(m,s.images,i,a):i?await n(m,s.images.length>0||r?s.images:void 0,i):r||s.images.length>0?await n(m,s.images):await n(m),u){we(null),i===Oe.current&&(Oe.current=null);let e=o.clear(l.owner.key,l.revision);e&&c.current.key===l.owner.key&&(f.current=e,d(e),re(null))}}catch(e){c.current.key===l.owner.key&&re(e instanceof Error?e.message:t(`fileAttachmentReadFailed`))}finally{p&&c.current.key===l.owner.key&&!G.current&&B(!1),l.pending=!1;let e=o.read(l.owner.key);(u||!e.prompt&&e.images.length===0&&!e.files?.length)&&b.current.get(l.owner.key)===l&&b.current.delete(l.owner.key)}},at=async(n,r=!1)=>{if(n?.preventDefault(),!ze||e.sessionSwitching||e.modelSelectionPending||e.planSelectionPending||e.thinkingPendingLevel!==null||e.promptAdmissionPending||e.promptAdmissionRecovery||e.promptAdmissionResolution||v||!p.trim()&&m.length===0&&h.length===0||G.current)return;let i=We&&(r?!Ke:Ke);if(i&&Oe.current){ae(t(`steerStaleTurn`));return}let a=/^\/([^\s/]+)/u.exec(p.trim())?.[1],o=Je.commands.find(e=>e.name===a);if(o?.availability===`unsupported`){ae(`/${o.name}: ${t(`commandUnavailable_${o.unavailableReason??`not_integrated`}`)}`);return}if(o?.action){if(p.trim()!==`/${o.name}`||m.length>0||h.length>0){ae(t(`commandPanelArguments`));return}if(e.onCommandAction?.(o.action)!==!0){ae(t(`commandPanelUnavailable`));return}Fe({prompt:``,caret:0}),ae(null);return}ae(null),await it(e.actions.sendPrompt,!1,Oe.current??void 0,i&&Ue?{streamingBehavior:`steer`,expectedTurnCommandId:Ue.commandId}:void 0)},ot=()=>{if(!(!Ie||e.sessionSwitching||e.modelSelectionPending||e.thinkingPendingLevel!==null||v))return it(e.actions.sendPromptAsNew,!0)},st=e=>{if(e.availability!==`available`)return;let t=`/${e.name} `;Fe({prompt:t,caret:t.length})&&(ae(null),D(!0),queueMicrotask(()=>{c.current.key===y&&(Te.current?.focus(),Te.current?.setSelectionRange(t.length,t.length))}))},ct=e=>{if(!$e.length)return;let t=O;for(let n=0;n<$e.length;n++)if(t=(t+e+$e.length)%$e.length,$e[t]?.availability===`available`){k(t);return}},lt=e=>{let n=Me.current,r=f.current;if(!n||n.ownerKey!==y||n.ownerKey!==c.current.key||n.revision!==r.revision)return t(`fileReferenceDraftChanged`);let i=r.prompt.slice(0,n.start),a=r.prompt.slice(n.end),o=nk(e),s=i&&!/\s$/u.test(i)?` `:``,l=`${i}${s}${o}${a&&!/^\s/u.test(a)?` `:``}${a}`,u=i.length+s.length+o.length;if(!Fe({prompt:l,caret:u}))return t(`draftLimit`);je.current=!0},ut=()=>{let e=f.current,t=Te.current,n=Math.min(Math.max(t?.selectionStart??e.caret,0),e.prompt.length);Me.current={ownerKey:y,revision:e.revision,start:n,end:Math.min(Math.max(t?.selectionEnd??n,n),e.prompt.length)},j(!0)},dt=[...(e.snapshot?.workspaces??[]).map(t=>({id:t.path,label:t.name,icon:(0,q.jsx)(Vs,{}),endContent:t.path===e.selectedWorkspace?(0,q.jsx)(rs,{}):void 0,onClick:()=>e.actions.setWorkspace(t.path)})),{type:`divider`},{id:`add`,label:t(`addWorkspaceMenu`),icon:(0,q.jsx)(Ae,{}),onClick:()=>void e.actions.chooseWorkspace()}],ft=e.draftModel??e.snapshot?.models.find(e=>e.current),pt=e.snapshot?.workspaces.find(t=>t.path===e.selectedWorkspace)?.name??(e.selectedWorkspace?LD(e.selectedWorkspace):t(`selectWorkspace`)),mt=e.snapshot?.sessions.find(e=>e.path===i),ht=Ie?ID(mt??{},n?.id??t(`untitledSession`)):Le?t(`newSession`):n?ID(mt??{},n.id):t(`newSession`),gt=e.sessionSwitching?e.workspaceDraft?t(`promptTask`):t(`switchingSession`):e.selectedWorkspace?Ie&&e.snapshot?.runtime.planHasPrompt&&[`planning`,`ready`].includes(e.snapshot.runtime.plan??``)?t(`promptPlanMessage`):e.landing?t(`promptTask`):t(Re?`promptMessage`:`promptReadonly`):t(`promptStart`),_t=e.snapshot?.thinking,vt=_t?.level??null,yt=e.thinkingPendingLevel??null,bt=_t?.supported??!1,xt=!!e.selectedWorkspace&&!Ie&&(Le||!n),St=_t?!_t.available.includes(vt??``):!1,Ct=_t?!bt&&!xt?`thinkingUnsupportedHint`:!Ie&&!xt?`thinkingInactiveHint`:Ve?`thinkingLockedRunning`:e.modelSelectionPending?`thinkingModelPendingHint`:null:null,wt=e.snapshot?.selectedExecution,Tt=n&&wt&&wt.sessionId===n.id&&wt.sessionPath===n.path?wt.pendingFollowUps:void 0,Et=Tt??(Ie?e.pendingFollowUpsReceipt:null),Dt=n&&wt?.sessionId===n.id&&wt.sessionPath===n.path?wt.pendingSteering:void 0,Ot=Dt??(Ie?e.pendingSteeringReceipt:null),kt=Dt===void 0?[]:wt?.steeringMessages??[],At=!e.workspaceDraft&&!e.sessionSwitching&&kt.length>0,jt=Tt===void 0?[]:wt?.queuedMessages??[],Mt=new Map,Nt=jt.map(e=>{let t=Mt.get(e)??0;return Mt.set(e,t+1),{message:e,key:`${e}:${t}`}}),Pt=!e.workspaceDraft&&!e.sessionSwitching&&Tt!==void 0&&jt.length>0,Ft=Be?t(`compactionDraftHelp`):e.promptAdmissionPending&&!He?t(`promptPending`):e.modelSelectionPending?t(`thinkingModelPendingHint`):e.thinkingPendingLevel===null?e.workspaceDraft?t(`enterHint`):e.turnCancellationPending?t(`stoppingTurn`):e.turnTerminalStatus===`cancelled`?t(`stoppedTurn`):!At&&(Ot??0)>0?t(`pendingSteeringHint`,{count:Ot}):!Pt&&(Ie&&e.pendingFollowUpsReceipt!==null||(Et??0)>0)?(Et??0)>0?t(`pendingFollowUpsHint`,{count:Et??0}):t(`acceptedHint`):t(ze?Ve?Ke?`steeringHint`:`queuedHint`:`enterHint`:`activeOnlyHint`):t(`thinkingPendingHint`),It=ze&&(Be||e.promptAdmissionPending&&!He||e.modelSelectionPending||e.thinkingPendingLevel!==null||e.turnCancellationPending||e.turnTerminalStatus===`cancelled`||!Pt&&Ie&&e.pendingFollowUpsReceipt!==null||!Pt&&(Et??0)>0||!At&&(Ot??0)>0||Ve&&!!(p.trim()||m.length||h.length)),Lt=P===y,Rt=(e=!1)=>{N(null),e&&R.current?.focus()},zt=e=>()=>{N(null),e()},Bt=async r=>{if(!(!Ie||!n||Lt||e.sessionSwitching)){F(y),ae(null);try{if(r===`compact`)await L.compactSession(n.id,n.path);else if((await L.updatePromptQueue(n.id,n.path,r)).sessionId!==n.id)throw Error(t(`queueUpdateFailed`));!await e.actions.refreshSnapshot()&&r!==`compact`&&c.current.key===y&&ae(t(`queueStatusUnconfirmed`))}catch(e){c.current.key===y&&ae(r===`compact`?e instanceof Error?e.message:t(`commandPanelUnavailable`):t(`queueUpdateFailed`))}finally{F(e=>e===y?null:e)}}},Vt=M===`files`?[{id:`back`,section:t(`composerAdd`),label:t(`composerBack`),icon:(0,q.jsx)(Cs,{}),onClick:()=>N(`main`)},{id:`file-upload`,section:t(`composerAdd`),label:t(`addFiles`),description:t(`fileAttachmentDescription`),icon:(0,q.jsx)(Fs,{}),disabled:z||m.length+h.length>=8,onClick:zt(()=>{ke.current&&(ke.current.accept=``,ke.current.click())})},{id:`image`,section:t(`composerAdd`),label:t(`addImages`),description:t(`imageAttachmentDescription`),icon:(0,q.jsx)(Ks,{}),disabled:z||m.length>=8,onClick:zt(()=>{ke.current&&(ke.current.accept=`image/png,image/jpeg,image/gif,image/webp`,ke.current.click())})},{id:`workspace-file`,section:t(`composerAdd`),label:t(`fileReference`),icon:(0,q.jsx)(Fs,{}),onClick:zt(ut)}]:[{id:`file`,section:t(`composerAdd`),label:t(`composerFile`),alias:`file`,icon:(0,q.jsx)(Fs,{}),onClick:()=>N(`files`)},{id:`plan`,section:t(`composerAdd`),label:t(`composerPlan`),alias:`plan`,description:t(`composerPlanDescription`),icon:(0,q.jsx)($s,{}),disabled:!Ie||Ve||e.planSelectionPending||e.promptAdmissionPending,onClick:zt(()=>void e.actions.selectPlanMode(e.snapshot?.runtime.plan===`inactive`))},{id:`compact`,section:t(`composerCommands`),label:t(`composerCompact`),alias:`compact`,description:t(`composerCompactDescription`),icon:(0,q.jsx)(fc,{}),disabled:!Ie||Ve||Lt||e.promptAdmissionPending||(Et??0)>0,onClick:zt(()=>void Bt(`compact`))},{id:`model`,section:t(`composerCommands`),label:t(`composerModel`),alias:`model`,description:t(`composerModelDescription`),icon:(0,q.jsx)(ws,{}),disabled:!Ie&&!Le||Ve||e.modelSelectionPending,onClick:zt(()=>ee(e=>e+1))}];return(0,q.jsxs)(`div`,{className:`composer-dock`,children:[Ie&&e.snapshot?.runtime.plan===`ready`&&!e.sessionSwitching&&(0,q.jsx)(`div`,{className:`plan-mode-bar`,children:(0,q.jsx)(`button`,{type:`button`,disabled:Ve||z||!!G.current||e.planSelectionPending||e.promptAdmissionPending||!!e.promptAdmissionRecovery,onClick:()=>{if((p.trim()||m.length>0||h.length>0)&&!window.confirm(t(`planImplementationReplaceDraft`)))return;let n=f.current.revision,r=c.current.key;e.actions.preparePlanImplementation().then(e=>{!e||f.current.revision!==n||c.current.key!==r||Fe({prompt:e.prompt,images:[],caret:e.prompt.length},r)&&(Oe.current={sessionId:e.sessionId,sessionPath:e.sessionPath,planRevision:e.planRevision},re(null),Te.current?.focus())})},children:t(`planModeImplement`)})}),!Ie&&!e.workspaceDraft&&!e.sessionSwitching&&n&&r===n.path&&(0,q.jsxs)(`div`,{className:`composer-session-notice`,children:[(0,q.jsx)(`span`,{children:t(`activateViewedSessionHint`)}),(0,q.jsx)(`button`,{type:`button`,className:`secondary`,onClick:()=>void e.actions.selectSession(n.path),children:t(`activateViewedSession`)})]}),e.accessory,e.promptAdmissionRecovery&&(0,q.jsxs)(`section`,{className:`prompt-recovery`,role:`alert`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:t(`promptAdmissionUnknown`)}),(0,q.jsx)(`span`,{children:e.promptAdmissionRecovery.phase===`checking`?t(`promptAdmissionCheckingDetail`):e.promptAdmissionRecovery.phase===`verification-failed`?t(`promptAdmissionVerificationFailedDetail`):t(`promptAdmissionUnknownDetail`)})]}),(0,q.jsxs)(`div`,{className:`prompt-recovery-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:e.promptAdmissionRecovery.phase===`submitting`,onClick:e.actions.abandonPromptAdmission,children:t(`abandonAdmission`)}),e.promptAdmissionRecovery.phase===`verification-failed`&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>void e.actions.checkPromptAdmissionRecovery(),children:t(`retryAdmissionCheck`)}),e.promptAdmissionRecovery.retryable&&(0,q.jsx)(`button`,{type:`button`,disabled:!Ie||e.sessionSwitching||e.modelSelectionPending||e.thinkingPendingLevel!==null||e.promptAdmissionRecovery.phase!==`ready`,onClick:()=>void e.actions.retryPromptAdmission(),children:t(`retryOriginalAdmission`)}),(0,q.jsx)(`button`,{type:`button`,className:`primary`,disabled:z||!Ie||e.sessionSwitching||e.modelSelectionPending||e.thinkingPendingLevel!==null||v||e.promptAdmissionRecovery.phase!==`ready`||!p.trim()&&m.length===0&&h.length===0,onClick:()=>void ot(),children:e.promptAdmissionRecovery.phase===`submitting`?t(`sendingAsNew`):t(`sendAsNew`)})]})]}),(0,q.jsxs)(`div`,{className:`composer-status-strip`,children:[Ie&&(0,q.jsx)(YD,{snapshot:e.snapshot,observed:e.activityObserved,onInspectSubagent:e.onInspectSubagent,expanded:fe===`activity`,onExpandedChange:e=>ue(t=>e?{owner:y,panel:`activity`}:t?.panel===`activity`?null:t)}),(Pt||At)&&(0,q.jsxs)(`section`,{className:`composer-queue`,"data-state":wt?.promptQueueBlocked?`blocked`:`waiting`,"aria-label":Pt?t(`pendingFollowUpsHint`,{count:Tt}):t(`steeringMessagesTitle`),"aria-busy":Lt,children:[(0,q.jsxs)(`div`,{className:`composer-queue-status`,role:`status`,children:[(0,q.jsx)(vs,{"aria-hidden":`true`}),(0,q.jsxs)(`button`,{type:`button`,className:`composer-queue-toggle`,"aria-expanded":pe,"aria-controls":ye,"aria-label":Pt?t(`pendingFollowUpsHint`,{count:Tt}):t(`pendingSteeringHint`,{count:Ot}),onClick:()=>me(`queue`),children:[[Pt?t(`composerQueuedCount`,{count:Tt}):``,At?t(`composerSteeringCount`,{count:Ot}):``].filter(Boolean).join(` · `),(0,q.jsx)(is,{"aria-hidden":`true`})]}),Ie&&(0,q.jsxs)(`span`,{children:[wt?.promptQueueBlocked&&(0,q.jsx)(`button`,{type:`button`,disabled:Lt||Be,onClick:()=>void Bt(`retry`),children:t(`retryPrompt`)}),(0,q.jsx)(`button`,{type:`button`,disabled:Lt,onClick:()=>void Bt(`clear`),children:t(`clearPromptQueue`)})]})]}),(0,q.jsxs)(`div`,{id:ye,className:`composer-queue-details composer-status-details`,hidden:!pe,children:[(wt?.promptQueueBlocked||Be)&&(0,q.jsx)(`p`,{className:`composer-queue-help`,children:t(wt?.promptQueueBlocked?`compactionQueueBlocked`:`compactionQueueWaiting`)}),Pt&&(0,q.jsx)(`ul`,{children:Nt.map(({message:e,key:r})=>{let i=`${n?.id}\0${n?.path}\0${r}`,a=ce===i,o=e||t(`queuedImage`),s=t(a?`queuedMessageCollapse`:`queuedMessageExpand`);return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,className:`composer-queue-row ${a?`expanded`:``}`,"aria-expanded":a,"aria-label":`${s}: ${a?o:zD(o,80)}`,title:s,onClick:()=>le(a?null:i),children:[(0,q.jsx)(Cs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o})]})},r)})}),Tt!==void 0&&Tt>jt.length&&(0,q.jsx)(`small`,{children:t(`queuedMore`,{count:Tt-jt.length})}),At&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`composer-queue-help`,children:t(`pendingSteeringHint`,{count:Ot})}),(0,q.jsx)(`ul`,{children:kt.map((e,r)=>{let i=`${n?.id}\0${n?.path}\0steer:${r}:${e}`,a=ce===i,o=e||t(`queuedImage`),s=t(a?`queuedMessageCollapse`:`queuedMessageExpand`);return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,className:`composer-queue-row ${a?`expanded`:``}`,"aria-expanded":a,"aria-label":`${s}: ${a?o:zD(o,80)}`,title:s,onClick:()=>le(a?null:i),children:[(0,q.jsx)(Cs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o})]})},i)})}),(Ot??0)>kt.length&&(0,q.jsx)(`small`,{children:t(`queuedMore`,{count:(Ot??0)-kt.length})})]})]}),wt?.promptQueueBlocked&&!pe&&(0,q.jsx)(`p`,{className:`composer-queue-blocked`,role:`status`,children:t(`compactionQueueBlocked`)})]})]}),(0,q.jsxs)(`form`,{"data-editor-expanded":_e||void 0,className:`composer composer-m02 ${e.selectedWorkspace?``:`dormant`} ${oe?`is-dragging`:``}`,onSubmit:e=>void at(e),onDragEnter:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),tt&&se(!0))},onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),tt&&(e.dataTransfer.dropEffect=`copy`,se(!0)))},onDragLeave:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||se(!1)},onDrop:e=>{se(!1),e.dataTransfer.files.length!==0&&(e.preventDefault(),tt&&rt(e.dataTransfer.files))},children:[(0,q.jsx)(ik,{open:!!M,viewKey:M??void 0,items:Vt,onClose:Rt},`actions:${y}`),!e.selectedWorkspace&&(0,q.jsxs)(`div`,{className:`composer-dormant-cta`,"aria-hidden":`true`,children:[(0,q.jsx)(Vs,{}),(0,q.jsx)(`span`,{children:gt})]}),!e.selectedWorkspace&&!e.landing&&(0,q.jsx)(`button`,{className:`dormant-overlay`,type:`button`,"aria-label":t(`selectWorkspace`),onClick:()=>void e.actions.chooseWorkspace()}),(0,q.jsx)(`input`,{ref:ke,className:`sr-only`,type:`file`,multiple:!0,tabIndex:-1,"aria-hidden":`true`,onChange:e=>{e.currentTarget.files&&rt(e.currentTarget.files)}}),(0,q.jsxs)(`div`,{className:`composer-attachments`,ref:Ee,children:[(0,q.jsx)(dO,{ownerKey:y,images:m,onRemove:e=>{Fe({images:f.current.images.filter(t=>t.id!==e)})&&re(null)}}),(0,q.jsx)(fO,{ownerKey:y,files:h,onRemove:e=>{Fe({files:(f.current.files??[]).filter(t=>t.id!==e)})&&re(null)}})]}),ne&&(0,q.jsx)(`p`,{className:`composer-attachment-error`,role:`alert`,children:ne}),s.status===`failed`&&(0,q.jsxs)(`p`,{className:`composer-attachment-error`,role:`status`,children:[t(`draftStorageUnavailable`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:()=>{o.retryStorage().then(()=>{let e=o.read(c.current.key);f.current=e,S.current=!0,d(e)})},children:t(`draftStorageRetry`)})]}),s.invalid&&(0,q.jsx)(`p`,{className:`composer-attachment-error`,role:`status`,children:t(`draftStorageInvalid`)}),z&&(0,q.jsx)(`p`,{role:`status`,children:t(`imageAttachmentsLoading`)}),ie&&(0,q.jsx)(`p`,{className:`composer-attachment-error`,role:`alert`,children:ie}),v&&(0,q.jsx)(`p`,{id:`composer-prompt-length-error`,className:`composer-attachment-error`,role:`alert`,children:t(`promptTooLong`,{count:_,limit:12e3})}),oe&&(0,q.jsxs)(`div`,{className:`composer-drop-overlay`,"aria-hidden":`true`,children:[(0,q.jsx)(Ks,{}),(0,q.jsx)(`span`,{children:t(`dropImagesHere`)})]}),(0,q.jsxs)(`div`,{className:`composer-editor`,children:[(0,q.jsx)(`textarea`,{id:ve,ref:Te,value:p,rows:1,disabled:qe,readOnly:!e.selectedWorkspace,"aria-label":t(`describeTask`),"aria-invalid":v||void 0,"aria-describedby":v?`composer-prompt-length-error`:void 0,"aria-autocomplete":`list`,"aria-controls":et?$k:void 0,"aria-activedescendant":et&&$e[O]?eA(O):void 0,placeholder:gt,onChange:e=>{Fe({prompt:e.target.value,caret:e.target.selectionStart})&&(ae(null),D(!1))},onClick:e=>Fe({caret:e.currentTarget.selectionStart}),onSelect:e=>Fe({caret:e.currentTarget.selectionStart}),onFocus:()=>{T(!0),D(!1)},onBlur:()=>T(!1),onPaste:e=>{if(!tt)return;let t=Array.from(e.clipboardData.files);if(t.length===0)for(let n of Array.from(e.clipboardData.items??[])){let e=n.kind===`file`?n.getAsFile():null;e&&t.push(e)}t.length!==0&&(e.clipboardData.getData(`text/plain`)||e.preventDefault(),rt(t))},onKeyDown:e=>{if(!(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)){if(Xe){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),ct(e.key===`ArrowDown`?1:-1);return}if(e.key===`Escape`){e.preventDefault(),D(!0);return}if(e.key===`Tab`){let t=$e[O];!e.shiftKey&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&t?.availability===`available`&&(e.preventDefault(),st(t));return}if(e.key===`Enter`&&!e.shiftKey){let t=$e[O];if(t){e.preventDefault(),st(t);return}if($e.length>0){e.preventDefault();return}}}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),at(void 0,e.metaKey||e.ctrlKey))}}}),e.selectedWorkspace&&(0,q.jsx)(V,{content:t(_e?`collapseInput`:`expandInput`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,className:`composer-expand-button icon-button`,"aria-label":t(_e?`collapseInput`:`expandInput`),"aria-expanded":_e,"aria-controls":ve,disabled:qe,onPointerDown:e=>e.preventDefault(),onClick:()=>{let e=Te.current;if(e){be.current?.owner!==y&&(be.current={owner:y});let t=be.current;t[_e?`expanded`:`compact`]=e.scrollTop,xe.current={start:e.selectionStart,end:e.selectionEnd,direction:e.selectionDirection,scrollTop:t[_e?`compact`:`expanded`]??e.scrollTop}}ge(_e?null:y)},children:_e?(0,q.jsx)(fc,{"aria-hidden":`true`}):(0,q.jsx)(ac,{"aria-hidden":`true`})})})]}),(0,q.jsx)(rA,{open:Xe,activeIndex:O,commandDiscovery:Je,commands:$e,draft:!!e.workspaceDraft,preferBelow:e.landing,onComplete:st,onSelect:k},`commands:${y}`),(0,q.jsxs)(`div`,{className:`composer-toolbar`,children:[(0,q.jsxs)(`div`,{className:`composer-toolbar-context`,children:[tt&&(0,q.jsx)(V,{content:t(`addContext`),placement:`above`,children:(0,q.jsx)(`button`,{ref:R,type:`button`,className:`composer-context-trigger icon-button`,"aria-label":t(`addContext`),"aria-haspopup":`menu`,"aria-expanded":M!==null,"aria-controls":M?`composer-action-menu`:void 0,onClick:()=>{D(!0),N(M?null:`main`)},children:(0,q.jsx)(Ae,{})})}),e.landing?(0,q.jsx)(yo,{className:`workspace-picker-menu`,button:{label:e.selectedWorkspace?LD(e.selectedWorkspace):t(`selectWorkspace`),icon:(0,q.jsx)(Vs,{}),size:`sm`,variant:`ghost`,className:`workspace-picker`},items:dt,menuWidth:240,placement:`above`,alignment:`start`,hasChevron:!0}):(0,q.jsxs)(`span`,{className:`composer-workspace-label`,title:`${pt} / ${ht}`,children:[(0,q.jsx)(Vs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:pt})]}),Ie&&e.snapshot?.runtime.plan&&e.snapshot.runtime.plan!==`inactive`&&(0,q.jsx)(`span`,{className:`composer-plan-chip`,children:t(`planMode_${e.snapshot.runtime.plan}`)})]}),(0,q.jsxs)(`div`,{className:`composer-toolbar-controls`,children:[We&&(0,q.jsx)(yo,{button:{className:`composer-delivery-trigger`,label:t(Ke?`steerCurrentTurn`:`sendNextTurn`),children:(0,q.jsx)(`span`,{className:`composer-delivery-label`,children:t(Ke?`steerCurrentTurn`:`sendNextTurn`)}),"aria-label":t(Ke?`steerCurrentTurn`:`sendNextTurn`),tooltip:t(Ke?`steerCurrentTurn`:`sendNextTurn`),icon:Ke?(0,q.jsx)(Bc,{"aria-hidden":`true`}):(0,q.jsx)(Cs,{"aria-hidden":`true`}),variant:`ghost`,size:`sm`,isDisabled:e.promptAdmissionPending||!!e.promptAdmissionRecovery},items:[{id:`followUp`,label:t(`sendNextTurn`),onClick:()=>{Ue&&(we({ownerKey:y,expectedTurnCommandId:Ue.commandId,mode:`followUp`}),ae(null))}},{id:`steer`,label:t(`steerCurrentTurn`),isDisabled:!We,onClick:()=>{!We||!Ue||(we({ownerKey:y,expectedTurnCommandId:Ue.commandId,mode:`steer`}),ae(null))}}],placement:`above`,alignment:`end`,hasChevron:!0}),(0,q.jsx)(`div`,{className:`model-picker-wrap`,hidden:!!(n&&!Ie&&!e.workspaceDraft),title:Ct?t(Ct):void 0,"data-level":vt??`none`,"data-pending":yt!==null,"data-warning":St,children:(0,q.jsx)(Qk,{snapshot:e.snapshot,openRequest:I,currentModel:ft,draftModel:e.draftModel,modelSearch:C,modelSelectionPending:!!e.modelSelectionPending,promptAdmissionPending:e.promptAdmissionPending,sessionSwitching:e.sessionSwitching,liveRunning:Ve,workspaceDraft:!!e.workspaceDraft,thinkingPendingLevel:yt,thinkingNeedsSession:xt,thinkingDisabledReason:Ct,onOpenProviders:e.onOpenProviders,actions:e.actions})}),He&&(0,q.jsx)(V,{content:t(`stopTurn`),placement:`above`,children:(0,q.jsx)(`button`,{className:`send-button stop-button`,type:`button`,"aria-label":t(`stopTurn`),disabled:e.turnCancellationPending||e.sessionSwitching,onClick:()=>void e.actions.cancelActiveTurn(),children:(0,q.jsx)(Rc,{"aria-hidden":`true`})})}),(!He||!!(p.trim()||m.length||h.length))&&(0,q.jsx)(V,{content:t(Be?`compactionDraftHelp`:`send`),placement:`above`,children:(0,q.jsx)(`button`,{className:`send-button`,type:`submit`,"aria-label":t(`send`),disabled:z||e.sessionSwitching||e.modelSelectionPending||e.thinkingPendingLevel!==null||!ze||!e.selectedWorkspace||e.promptAdmissionPending||v||e.planSelectionPending||!!e.promptAdmissionRecovery||!!e.promptAdmissionResolution||!p.trim()&&m.length===0&&h.length===0,children:e.sessionSwitching&&e.workspaceDraft?(0,q.jsx)(rc,{className:`send-spinner`}):(0,q.jsx)(Xo,{})})})]})]}),(0,q.jsx)(`div`,{className:`composer-hint`,"data-visible":It,"aria-live":`polite`,children:ze?Ft:null})]}),(0,q.jsx)(tk,{open:A,sessionId:Ie?n?.id:void 0,onClose:()=>j(!1),onInsert:lt})]})}function sA({target:e,onClose:t,onOpenProviders:n}){let{t:r}=W(),i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(0),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)(null),p=e=>{f(null),td(e).then(e=>f(e?`copied`:`failed`))};(0,K.useEffect)(()=>{let t=new AbortController;return c(null),u(null),f(null),(async()=>{let n={errors:[]},[a,o]=await Promise.allSettled([i.thinking(e.sessionId,t.signal),i.trust(e.sessionId,t.signal)]);a.status===`fulfilled`&&a.value.sessionId===e.sessionId?n.thinking=a.value:n.errors.push(r(`thinkingUnavailable`)),o.status===`fulfilled`&&(o.value.workspace===void 0||o.value.workspace===e.cwd)?n.trust=o.value:n.errors.push(r(`trustUnavailable`)),!t.signal.aborted&&(c(n),u(new Date().toLocaleTimeString()))})(),()=>t.abort()},[i,e,a,r]);let m=r(`runtimeStatus`);return(0,q.jsx)(Se,{isOpen:!0,onOpenChange:e=>!e&&t(),width:640,"aria-label":m,children:(0,q.jsxs)(`section`,{className:`inspection-panel`,children:[(0,q.jsxs)(`header`,{className:`inspection-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:m}),(0,q.jsx)(`p`,{className:`inspection-subtitle`,children:e.cwd})]}),(0,q.jsxs)(`div`,{className:`inspection-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":r(`refreshStatus`),disabled:!s,onClick:()=>o(e=>e+1),children:(0,q.jsx)(me,{})}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":r(`close`),onClick:t,children:(0,q.jsx)(je,{})})]})]}),d&&(0,q.jsx)(`p`,{role:`status`,children:r(d===`copied`?`copiedMessage`:`copyFailed`)}),s?(0,q.jsxs)(q.Fragment,{children:[s.errors.map(e=>(0,q.jsx)(`p`,{className:`inspection-warning`,role:`alert`,children:e},e)),(0,q.jsxs)(`section`,{className:`inspection-section`,children:[(0,q.jsx)(`h3`,{children:r(`modelAndThinking`)}),(0,q.jsxs)(`dl`,{children:[(0,q.jsx)(`dt`,{children:r(`selectedModel`)}),(0,q.jsx)(`dd`,{children:e.model||r(`noModels`)}),(0,q.jsx)(`dt`,{children:r(`thinkingLevel`)}),(0,q.jsx)(`dd`,{children:s.thinking?.supported===!1?r(`thinkingUnsupported`):s.thinking?.level??r(`unknownState`)}),!!s.thinking?.available.length&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`dt`,{children:r(`availableThinking`)}),(0,q.jsx)(`dd`,{children:s.thinking?.available.join(` · `)})]})]}),s.thinking?.supported===!1&&(0,q.jsx)(`p`,{className:`inspection-note`,children:r(`thinkingUnsupportedHint`)}),s.thinking&&s.thinking.supported!==!1&&!s.thinking.available.includes(s.thinking.level)&&(0,q.jsx)(`p`,{className:`inspection-warning`,role:`status`,children:r(`thinkingLevelMismatch`)})]}),(0,q.jsxs)(`section`,{className:`inspection-section`,children:[(0,q.jsx)(`h3`,{children:r(`projectTrust`)}),(0,q.jsx)(`p`,{children:r(`trust_${s.trust?.state??`unknown`}`)}),(0,q.jsxs)(`dl`,{children:[(0,q.jsx)(`dt`,{children:r(`savedTrustDecision`)}),(0,q.jsx)(`dd`,{children:r(`trustDecision_${s.trust?.decision??`unknown`}`)}),(0,q.jsx)(`dt`,{children:r(`activeSessionTrust`)}),(0,q.jsx)(`dd`,{children:s.trust?.sessionTrusted===!0?r(`trustActiveYes`):s.trust?.sessionTrusted===!1?r(`trustActiveNo`):r(`unknownState`)})]}),s.trust?.refreshRequired===!0&&(0,q.jsx)(`p`,{className:`inspection-warning`,children:r(`trustRefreshNeeded`)})]}),n&&(0,q.jsxs)(`button`,{type:`button`,className:`inspection-provider-link`,"aria-label":r(`openProviderSettings`),onClick:n,children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:r(`providerAvailability`)}),(0,q.jsx)(`small`,{children:r(`authNotVerified`)})]}),r(`openProviderSettings`)]}),(0,q.jsxs)(`div`,{className:`inspection-setup`,children:[(0,q.jsx)(`p`,{className:`inspection-note`,children:r(`configurationViaPi`)}),(0,q.jsx)(`code`,{children:`/openpi-setup`}),(0,q.jsx)(`button`,{type:`button`,className:`inspection-copy`,"aria-label":r(`copySetupCommand`),title:r(`copySetupCommand`),onClick:()=>p(`/openpi-setup`),children:(0,q.jsx)(_s,{"aria-hidden":`true`})})]}),(0,q.jsx)(`p`,{className:`inspection-updated`,children:r(`statusCaptured`,{time:l})})]}):(0,q.jsx)(`p`,{role:`status`,children:r(`inspectionLoading`)})]})})}var cA=32,lA=1048576;function uA(e){return e.drafts.reduce((e,t)=>e+sd(t.custom)+Object.values(t.notes).reduce((e,t)=>e+sd(t),0),0)}function dA(e,t,n){if(!(n.submission||n.drafts.some(e=>e.choice!==null||e.custom||Object.values(e.notes).some(Boolean))))return e.delete(t),!0;let r=e.get(t);if(!r&&e.size>=cA)return!1;let i=r?uA(r):0,a=uA(n),o=Array.from(e.values()).reduce((e,t)=>e+uA(t),0);return a>i&&o-i+a>lA?!1:(e.set(t,n),!0)}function fA(e,t,n,r){for(let[i,a]of e)a.sessionId===t&&a.sessionPath===n&&a.requestId!==r&&e.delete(i)}function pA({request:e,answer:t,onSettled:n,connected:r=!0,sessionPath:i=``,workingCache:a}){let{t:o}=W(),s=(0,K.useId)(),c=(0,K.useMemo)(()=>new Map,[]),l=a??c,u=JSON.stringify([e.sessionId,i,e.requestId]),[d,f]=(0,K.useState)(()=>l.get(u)??{sessionId:e.sessionId,sessionPath:i,requestId:e.requestId,drafts:e.questions.map(()=>({choice:null,custom:``,notes:{}})),index:0,review:!1,submission:null}),p=(0,K.useRef)(d),{drafts:m,index:h,review:g,submission:_}=d,[v,y]=(0,K.useState)(!!d.submission),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(!1),w=(0,K.useRef)(!1),T=!!_,E=(0,K.useRef)(null),D=(0,K.useRef)(null),O=e.questions[h],k=m[h],A=S||T||!r,j=m.some(e=>e.choice===`custom`?!cd(e.custom):typeof e.choice==`number`&&!cd(e.notes[e.choice]??``)),M=m.every(e=>e.choice!==null)&&!j,N=(t,n)=>e.handoff?o(n===0?`handoffDone`:`handoffUnable`):t;(0,K.useEffect)(()=>()=>E.current?.abort(),[]);let P=e=>dA(l,u,e)?(p.current=e,f(e),x(!1),!0):(x(!0),!1),F=(e,t=!1)=>{P({...p.current,index:e,review:t}),requestAnimationFrame(()=>D.current?.focus())},I=e=>{let t=p.current;P({...t,drafts:t.drafts.map((n,r)=>r===t.index?{...n,...e}:n)})},ee=()=>e.questions.map((e,t)=>{let n=m[t];if(n.choice===`custom`)return n.custom.trim()?{id:e.id,custom:n.custom}:{id:e.id,rephrase:!0};let r=typeof n.choice==`number`?e.options[n.choice]?.label:void 0;return{id:e.id,selected:r,...typeof n.choice==`number`&&n.notes[n.choice]?.trim()?{note:n.notes[n.choice]}:{}}}),L=async(i=!1)=>{if(w.current||!r||!i&&!T&&!M)return;let a=p.current.submission??{answers:i?null:ee()};if(!P({...p.current,submission:a}))return;w.current=!0,C(!0),y(!1);let o=new AbortController;E.current=o;try{let r=await t(e,a.answers,o.signal);o.signal.aborted||(l.delete(u),n(r))}catch{o.signal.aborted||y(!0)}finally{o.signal.aborted||(w.current=!1,C(!1))}};return(0,q.jsxs)(`section`,{className:`question-card`,"aria-labelledby":`${s}-title`,"aria-busy":S,children:[(0,q.jsxs)(`header`,{className:`question-card-header`,children:[(0,q.jsxs)(`span`,{className:`question-status`,children:[(0,q.jsx)(lc,{"aria-hidden":`true`}),o(e.handoff?`handoffWaiting`:`questionWaiting`)]}),(0,q.jsx)(`span`,{className:`question-count`,children:g?o(e.handoff?`handoffReview`:`questionReview`):o(`questionProgress`,{current:h+1,total:e.questions.length})}),(0,q.jsx)(`button`,{type:`button`,className:`question-icon`,"aria-label":o(`questionDismiss`),title:o(`questionDismiss`),disabled:A,onClick:()=>void L(!0),children:(0,q.jsx)(je,{})})]}),(0,q.jsxs)(`div`,{className:`question-card-body`,children:[(0,q.jsx)(`h2`,{id:`${s}-title`,ref:D,tabIndex:-1,children:g?o(`questionReviewTitle`):O.question}),e.handoff&&(0,q.jsxs)(`div`,{className:`handoff-instructions`,children:[(0,q.jsx)(`p`,{children:e.handoff.instructions}),(0,q.jsxs)(`p`,{className:`question-help`,children:[o(`handoffSignal`),` `,e.handoff.completionSignal]}),(0,q.jsx)(`p`,{className:`question-help`,children:o(`handoffVerify`)})]}),g?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`question-help`,children:o(`questionReviewHelp`)}),(0,q.jsx)(`ol`,{className:`question-review-list`,children:e.questions.map((e,t)=>{let n=m[t];return(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`question-review-label`,children:e.header}),(0,q.jsx)(`p`,{children:typeof n.choice==`number`?N(e.options[n.choice]?.label,n.choice):n.custom.trim()||o(`questionRephrase`)}),typeof n.choice==`number`&&n.notes[n.choice]?.trim()&&(0,q.jsx)(`p`,{className:`question-help`,children:n.notes[n.choice]})]}),(0,q.jsx)(`button`,{type:`button`,className:`question-icon`,"aria-label":o(`questionEdit`,{question:e.header}),disabled:A,onClick:()=>F(t),children:(0,q.jsx)(yc,{})})]},e.id)})})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`fieldset`,{disabled:A,className:`question-choices`,children:[(0,q.jsx)(`legend`,{className:`sr-only`,children:O.header}),O.options.map((t,n)=>(0,q.jsxs)(`label`,{className:`question-choice ${k.choice===n?`is-selected`:``}`,children:[(0,q.jsx)(`input`,{className:`question-radio`,type:`radio`,name:`${s}-${O.id}`,checked:k.choice===n,onChange:()=>I({choice:n})}),(0,q.jsx)(`span`,{className:`question-choice-number`,"aria-hidden":`true`,children:k.choice===n?(0,q.jsx)(rs,{"aria-hidden":`true`}):n+1}),(0,q.jsxs)(`span`,{className:`question-choice-copy`,children:[(0,q.jsx)(`strong`,{children:N(t.label,n)}),(0,q.jsx)(`span`,{children:e.handoff?o(n===0?`handoffDoneHelp`:`handoffUnableHelp`):t.description})]})]},t.label))]}),typeof k.choice==`number`&&(0,q.jsxs)(`div`,{className:`question-extras`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`question-note-toggle`,disabled:A,"aria-expanded":!!k.notesExpanded,"aria-controls":k.notesExpanded?`${s}-notes`:void 0,onClick:()=>I({notesExpanded:!k.notesExpanded}),children:[(0,q.jsx)(yc,{"aria-hidden":`true`}),o(`questionNotes`)]}),typeof k.choice==`number`&&O.options[k.choice]?.preview&&(0,q.jsxs)(`details`,{className:`question-preview-disclosure`,children:[(0,q.jsx)(`summary`,{children:o(`questionPreview`)}),(0,q.jsx)(`pre`,{className:`question-preview`,children:O.options[k.choice].preview})]},`${O.id}-${k.choice}`)]}),(k.choice===`custom`||typeof k.choice==`number`&&k.notesExpanded)&&(0,q.jsxs)(`label`,{className:`question-notes`,id:`${s}-notes`,children:[(0,q.jsx)(`span`,{className:`sr-only`,id:`${s}-answer-label`,children:k.choice===`custom`?o(`questionYourAnswer`):o(`questionNotes`)}),(0,q.jsx)(`textarea`,{rows:1,disabled:A,value:k.choice===`custom`?k.custom:k.notes[k.choice]??``,onChange:e=>k.choice===`custom`?I({custom:e.target.value}):typeof k.choice==`number`&&I({notes:{...k.notes,[k.choice]:e.target.value}}),"aria-invalid":j,"aria-labelledby":`${s}-answer-label`,"aria-describedby":[j?`${s}-limit`:``,k.choice===`custom`?`${s}-custom-help`:``].filter(Boolean).join(` `)||void 0,placeholder:k.choice===`custom`?o(`questionCustomPlaceholder`):o(`questionNotesPlaceholder`)}),k.choice===`custom`&&(0,q.jsx)(`span`,{className:`question-help`,id:`${s}-custom-help`,children:o(`questionCustomHelp`)})]})]}),j&&(0,q.jsx)(`p`,{className:`question-error`,id:`${s}-limit`,role:`alert`,children:o(`questionLimit`,{count:8e3})}),b&&(0,q.jsx)(`p`,{className:`question-error`,role:`alert`,children:o(`questionDraftLimit`)}),!r&&(0,q.jsx)(`p`,{className:`question-help`,role:`status`,children:o(`questionDisconnected`)}),v&&(0,q.jsx)(`p`,{className:`question-error`,role:`alert`,children:o(`questionUncertain`)})]},`${h}:${g}`),(0,q.jsxs)(`footer`,{className:`question-card-footer`,children:[!g&&!e.handoff&&(0,q.jsxs)(`label`,{className:`question-custom ${k.choice===`custom`?`is-selected`:``} ${A?`is-disabled`:``}`,children:[(0,q.jsx)(`input`,{className:`question-radio`,type:`radio`,name:`${s}-${O.id}`,checked:k.choice===`custom`,disabled:A,onChange:()=>I({choice:`custom`})}),(0,q.jsx)(`span`,{className:`question-choice-number`,"aria-hidden":`true`,children:(0,q.jsx)(yc,{})}),(0,q.jsx)(`span`,{children:o(`questionCustom`)})]}),(0,q.jsxs)(`div`,{className:`question-actions`,children:[(g||h>0)&&(0,q.jsxs)(`button`,{type:`button`,className:`question-secondary`,disabled:A||!g&&h===0,onClick:()=>F(g?e.questions.length-1:h-1),children:[(0,q.jsx)(Ko,{}),o(`questionBack`)]}),!T&&(0,q.jsx)(`button`,{type:`button`,className:`question-secondary question-skip`,disabled:A,title:o(`questionDismiss`),onClick:()=>void L(!0),children:o(`questionSkip`)}),T?(0,q.jsxs)(`button`,{type:`button`,className:`question-primary`,disabled:S||!r,onClick:()=>void L(),children:[(0,q.jsx)(he,{}),o(S?`questionSubmitting`:`questionRetry`)]}):g?(0,q.jsxs)(`button`,{type:`button`,className:`question-primary`,disabled:A||!M,onClick:()=>void L(),children:[(0,q.jsx)(rs,{}),o(e.handoff?`handoffSubmit`:`questionSubmit`)]}):(0,q.jsxs)(`button`,{type:`button`,className:`question-primary`,disabled:A||k.choice===null||j,onClick:()=>F(hnew de,[]),s=(0,K.useMemo)(()=>new Map,[]),c=i??s,[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(0),_=(0,K.useRef)(null),v=(0,K.useRef)(null);return(0,K.useEffect)(()=>{let t=new AbortController;return o.pendingQuestions(e,t.signal).then(({pending:n})=>{if(t.signal.aborted)return;let i=n?.requestId===_.current?null:n;v.current=i?.requestId??null,m(!1),fA(c,e,r,n?.requestId),u(i),n&&n.requestId!==_.current&&f(null)},()=>{t.signal.aborted||m(!0)}),()=>t.abort()},[o,e,r,c,t,h]),!l&&!d&&!p?null:(0,q.jsx)(`div`,{className:`question-panel`,children:l?(0,q.jsx)(pA,{request:l,connected:n,sessionPath:r,workingCache:c,answer:(e,t,n)=>o.answerQuestions(e,t,n),onSettled:e=>{v.current===l.requestId&&(v.current=null,_.current=l.requestId,u(null),f(e.state===`answered`?null:e),g(e=>e+1))}},l.requestId):d?(0,q.jsxs)(`div`,{className:`question-receipt`,role:`status`,children:[(0,q.jsx)(rs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:a(`questionState_${d.state}`)}),(0,q.jsx)(`button`,{type:`button`,className:`question-icon`,"aria-label":a(`questionCloseReceipt`),onClick:()=>f(null),children:(0,q.jsx)(je,{})})]}):(0,q.jsxs)(`div`,{className:`question-receipt`,role:`alert`,children:[(0,q.jsx)(`span`,{children:a(`questionLoadFailed`)}),(0,q.jsx)(`button`,{type:`button`,className:`question-secondary`,onClick:()=>g(e=>e+1),children:a(`questionRetryLoad`)})]})})}function hA(e,t,{active:n=!0,running:r=!1,initialSource:i=`unstaged`,initialBaseRef:a}={}){let{t:o}=W(),s=(0,K.useMemo)(()=>new de,[]),c=(0,K.useRef)(null),l=(0,K.useRef)(null),u=(0,K.useRef)(!1),d=(0,K.useRef)({active:n,running:r});d.current={active:n,running:r};let[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)(null),v=e?.id,y=e?.path,[b,x]=(0,K.useState)({sessionId:v,sessionPath:y,source:i,baseRef:a}),S=b.sessionId===v&&b.sessionPath===y?b.source:i,C=b.sessionId===v&&b.sessionPath===y?b.baseRef:a,w=(0,K.useCallback)(e=>{x({sessionId:v,sessionPath:y,source:e,baseRef:C})},[v,y,C]),T=(0,K.useCallback)(e=>{x({sessionId:v,sessionPath:y,source:`branch`,baseRef:e})},[v,y]);(0,K.useLayoutEffect)(()=>{p(null),_(null),h(!!v)},[v,y,S,C]);let E=(0,K.useCallback)((e,t)=>{if(!(e.signal.aborted||c.current!==e)&&(c.current=null,h(!1),u.current)){u.current=!1;let e=d.current;(e.active||!e.running)&&l.current===null&&(l.current=window.setTimeout(()=>{l.current=null,t()},e.active?200:2e3))}},[]),D=(0,K.useCallback)(async()=>{if(!v||!y||document.visibilityState===`hidden`)return;if(c.current){u.current=!0;return}let e=new AbortController;c.current=e,h(!0),_(null);try{let t=await s.gitReview(v,y,e.signal,{source:S,offset:`0`,...S===`branch`&&C?{baseRef:C}:{}});e.signal.aborted||(t.ok||_(o(t.reason===`not_git_repository`?`gitReviewNotRepository`:t.reason===`baseline_unavailable`?`gitReviewBaselineUnavailable`:t.reason===`base_branch_unavailable`?`gitReviewBaseUnavailable`:t.reason===`invalid_base_branch`?`gitReviewBaseInvalid`:`gitReviewFailed`)),p(e=>!t.ok&&e?.ok?t.branches?{...e,branches:t.branches}:e:t.ok&&e?.ok&&t.snapshot.revision===e.snapshot.revision?JSON.stringify(t.branches)===JSON.stringify(e.branches)?e:{...e,branches:t.branches}:t))}catch(t){e.signal.aborted||_(t instanceof Error?t.message:`Git review unavailable`)}finally{E(e,D)}},[s,v,y,S,C,o,E]),O=(0,K.useCallback)(async()=>{if(!v||!y||!f?.ok||f.snapshot.nextOffset===void 0||c.current)return;let e=f.snapshot,t=new AbortController;c.current=t,h(!0),_(null);try{let n=await s.gitReview(v,y,t.signal,{source:S,offset:String(e.nextOffset),revision:e.revision,...S===`branch`&&C?{baseRef:C}:{}});if(t.signal.aborted)return;if(!n.ok||n.snapshot.revision!==e.revision)throw Error(o(!n.ok&&n.reason===`revision_changed`?`gitReviewChanged`:`gitReviewFailed`));p({...n,snapshot:{...n.snapshot,files:[...e.files,...n.snapshot.files],additions:e.additions+n.snapshot.additions,deletions:e.deletions+n.snapshot.deletions}})}catch(e){t.signal.aborted||_(e instanceof Error?e.message:o(`gitReviewFailed`))}finally{E(t,D)}},[s,v,y,S,C,f,o,E,D]),k=(0,K.useCallback)(async(e,t,n)=>{if(!v||!y)return;let r=await s.gitReview(v,y,t,{source:S,file:e,revision:n,...S===`branch`&&C?{baseRef:C}:{}});if(!r.ok||r.summaryRevision!==n)throw(r.ok||r.reason===`revision_changed`)&&!t.aborted&&D(),Error(o(!r.ok&&r.reason!==`revision_changed`?`gitReviewFailed`:`gitReviewChanged`));return r.snapshot.files.find(t=>t.path===e)},[s,v,y,S,C,D,o]);return(0,K.useEffect)(()=>{if(v)return l.current=window.setTimeout(()=>{l.current=null,D()},200),()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null,u.current=!1,c.current?.abort(),c.current=null}},[D,v]),(0,K.useEffect)(()=>{n&&l.current!==null&&(window.clearTimeout(l.current),l.current=null)},[n]),(0,K.useEffect)(()=>{if(!n&&r){l.current!==null&&window.clearTimeout(l.current),l.current=null,u.current=!1;return}!v||l.current!==null||(l.current=window.setTimeout(()=>{l.current=null,D()},n?200:2e3))},[D,t,n,r,v]),(0,K.useEffect)(()=>{if(!v)return;let e=()=>{let e=d.current;(e.active||!e.running)&&D()};return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,e)}},[D,v]),(0,K.useMemo)(()=>({result:f,loading:m,error:g,refresh:D,source:S,setSource:w,baseRef:C,setBaseRef:T,readFile:k,loadMore:O}),[f,m,g,D,S,w,C,T,k,O])}function gA({notice:e,actions:t}){let{t:n}=W(),r=(0,K.useRef)(!1),[i,a]=(0,K.useState)(null),[o,s]=(0,K.useState)(!1),c=()=>t.dismissArchiveNotice(e.key),l=async n=>{if(!r.current){r.current=!0,a(n),s(!1);try{(n===`undo`?await t.unarchiveSession(e.path):await t.selectSession(e.path,e.sessionId))===!1?s(!0):c()}catch{s(!0)}finally{r.current=!1,a(null)}}};return(0,q.jsx)(`div`,{className:`archive-notification`,"data-session-path":e.path,children:(0,q.jsx)(Gu,{type:`info`,body:n(`archiveNoticeTitle`),isAutoHide:!i&&!o,autoHideDuration:8e3,onDismiss:c,renderContent:()=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Go,{className:`archive-notification-icon`,"aria-hidden":`true`}),(0,q.jsxs)(`div`,{className:`archive-notification-copy`,children:[(0,q.jsx)(`strong`,{children:n(`archiveNoticeTitle`)}),(0,q.jsx)(`span`,{title:e.title,children:e.title}),o&&(0,q.jsx)(`span`,{className:`archive-notification-error`,role:`alert`,children:n(`archiveNoticeFailed`)})]}),(0,q.jsx)(`button`,{type:`button`,disabled:i!==null,onClick:()=>void l(`view`),children:n(`archiveNoticeView`)}),(0,q.jsxs)(`button`,{type:`button`,className:`archive-notification-undo`,disabled:i!==null,onClick:()=>void l(`undo`),children:[i===`undo`&&(0,q.jsx)(rc,{className:`archive-notification-spinner`,"aria-hidden":`true`}),n(`archiveNoticeUndo`)]}),(0,q.jsx)(`button`,{type:`button`,className:`archive-notification-close`,"aria-label":n(`close`),onClick:c,children:(0,q.jsx)(je,{"aria-hidden":`true`})})]})})})}function _A({notices:e,actions:t}){return e.length?(0,q.jsx)(`div`,{className:`archive-notifications`,children:e.map(e=>(0,q.jsx)(gA,{notice:e,actions:t},e.key))}):null}function vA(e){let t=e?.closest(`.session-row, .workspace-group`),n=e?.closest(`.session-sidebar`),r=t?.dataset.sessionKey,i=Array.from(n?.querySelectorAll(`.session, .workspace-label, .workspace-heading-label`)??[]),a=i.findIndex(e=>t?.contains(e)),o=a<0?i:[...i.slice(a+1),...i.slice(0,a).reverse()];return()=>requestAnimationFrame(()=>{!n?.isConnected||document.querySelector(`dialog[open]`)||[e,r==null?null:Array.from(n.querySelectorAll(`.session-row`)).find(e=>e.dataset.sessionKey===r)?.querySelector(`.menu-action-button`),...o,n.querySelector(`.new-session-button`)].find(e=>e?.isConnected&&!e.closest(`[hidden], [inert]`)&&e.checkVisibility?.()!==!1)?.focus({preventScroll:!0})})}function yA({session:e,archived:t,connected:n,pinSaving:r,restoring:i,movementItems:a,client:o,actions:s,onRename:c,onPin:l,onRead:u,onArchive:d,onNotice:f}){let{t:p}=W(),m=(0,K.useRef)(null),h=(0,K.useRef)(!0),g=(0,K.useRef)(0),_=(0,K.useRef)(!1),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(null),[S,C]=(0,K.useState)(!1),[w,T]=(0,K.useState)(!1),[E,D]=(0,K.useState)(null),[O,k]=(0,K.useState)(!1),[A,j]=(0,K.useState)(null),[M,N]=(0,K.useState)(!1),[P,F]=(0,K.useState)(!1),I=e.execution?.status===`running`||e.execution?.waitingForInput,ee=(e.execution?.pendingFollowUps??0)+(e.execution?.pendingSteering??0)>0,L=n?I||ee?p(`sidebarActionRunning`):void 0:p(`sidebarActionDisconnected`),R=t?p(`sidebarForkArchived`):n?E?.local===!1?p(`sidebarForkUnavailable`):void 0:p(`sidebarActionDisconnected`),te=A!==null&&(A.path!==e.path||A.id!==e.id),z=e.pinOrder!==void 0,B=()=>vA(m.current?.querySelector(`button`)??null),ne=()=>{let t=new URL(`/`,window.location.origin);return t.searchParams.set(`sessionPath`,e.path),t.searchParams.set(`sessionId`,e.id),t.href};(0,K.useEffect)(()=>(h.current=!0,()=>{h.current=!1,g.current++}),[]);let re=(0,K.useRef)({id:e.id,path:e.path});(0,K.useEffect)(()=>{(re.current.id!==e.id||re.current.path!==e.path)&&(re.current={id:e.id,path:e.path},y(!1),x(null),D(null))},[e.id,e.path]),(0,K.useEffect)(()=>{if(!v||!e.cwd||!n)return;let t=++g.current;return x(null),C(!1),o.sessionOpenTargets(e.path,e.id).then(e=>{h.current&&g.current===t&&x(e.targets)}).catch(()=>{h.current&&g.current===t&&C(!0)}),()=>{g.current++}},[o,n,v,e.cwd,e.id,e.path]),(0,K.useEffect)(()=>{if(!v||t||!n)return;let r=!1;return D(null),k(!1),Promise.resolve().then(()=>o.sessionForkOptions(e.path,e.id)).then(e=>{r||D(e)}).catch(()=>{r||k(!0)}),()=>{r=!0}},[t,o,n,v,e.id,e.path]);let V=()=>{y(!1),queueMicrotask(c)},ie=()=>{let e=B();l().then(e,e)},ae=()=>{let e=B();d().then(e,e)},oe=async t=>{try{let n=await td(t===`link`?ne():t===`cwd`?e.cwd:(await o.sessionMarkdown(e.path,e.id)).markdown);f(p(n?`sidebarCopied`:`sidebarCopyFailed`),!n)}catch{f(p(`sidebarCopyFailed`),!0)}},se=async(t=`local`)=>{if(!(w||R)&&!(t===`worktree`&&!E?.worktree)){T(!0);try{t===`worktree`?await s.forkConversation(e.path,e.id,t):await s.forkConversation(e.path,e.id)}catch{f(p(`sidebarForkFailed`),!0)}finally{h.current&&T(!1)}}},ce=()=>{if(_.current)return;let e=A?.restoreFocus;j(null),e?.()},le=async()=>{if(!(!A||_.current||L||te)){_.current=!0,N(!0),F(!1);try{await s.deleteSession(A.path,A.id,A.commandId)?(h.current&&j(null),A.restoreFocus()):h.current&&F(!0)}catch{h.current&&F(!0)}finally{_.current=!1,h.current&&N(!1)}}},H=[{id:`rename`,label:p(`sidebarRename`),icon:(0,q.jsx)(yc,{}),isDisabled:!n,onClick:V},...t?[]:[{id:`pin`,label:p(z?`sidebarUnpin`:`sidebarPin`),icon:z?(0,q.jsx)(bc,{}):(0,q.jsx)(xc,{}),isDisabled:r||!n,onClick:ie},{id:`read`,label:p(e.unread?`markConversationRead`:`markConversationUnread`),icon:(0,q.jsx)(As,{}),isDisabled:!e.readRevision||!n,onClick:()=>void u()}],...a.length?[{type:`divider`},...a]:[],...t?[]:[{type:`divider`},{id:`fork`,label:R?(0,q.jsxs)(`span`,{className:`sidebar-menu-unavailable`,children:[(0,q.jsx)(`span`,{children:p(`sidebarFork`)}),(0,q.jsx)(`small`,{children:R})]}):p(`sidebarFork`),icon:(0,q.jsx)(Ws,{}),isDisabled:!!R||w,items:[{id:`fork-local`,label:p(w?`forkSessionPending`:e.worktree?`sidebarForkSameWorktree`:`sidebarForkLocal`),icon:(0,q.jsx)(pc,{}),onClick:()=>void se()},...E?.worktree?[{id:`fork-worktree`,label:p(`sidebarForkWorktree`),icon:(0,q.jsx)(Gc,{className:`sidebar-worktree-icon`}),onClick:()=>void se(`worktree`)}]:E===null?[{id:`fork-worktree-loading`,label:p(O?`sidebarForkOptionsFailed`:`sidebarForkOptionsLoading`),isDisabled:!0}]:[]]}],{type:`divider`},{id:`copy`,label:p(`sidebarCopy`),icon:(0,q.jsx)(Ss,{}),items:[{id:`copy-link`,label:p(`sidebarCopyLink`),onClick:()=>void oe(`link`)},{id:`copy-markdown`,label:p(`sidebarCopyMarkdown`),isDisabled:!n,onClick:()=>void oe(`markdown`)},{id:`copy-cwd`,label:p(`sidebarCopyCwd`),isDisabled:!e.cwd,onClick:()=>void oe(`cwd`)}]},{type:`divider`},{id:`new-window`,label:p(`sidebarNewWindow`),icon:(0,q.jsx)(Fc,{}),onClick:()=>{window.open(ne(),`_blank`,`noopener,noreferrer`)}},...e.cwd&&n&&(b==null||b.length>0)?[{id:`open-in`,label:p(`sidebarOpenIn`),icon:(0,q.jsx)(Yo,{}),items:b?.map(t=>({id:t.id,label:t.label,onClick:()=>{o.openSessionIn(e.path,e.id,t.id).catch(()=>f(p(`sidebarOpenFailed`),!0))}}))??[{id:`open-in-loading`,label:p(S?`sidebarAppsFailed`:`sidebarAppsLoading`),isDisabled:!0}]}]:[],{type:`divider`},{id:t?`restore`:`archive`,label:p(i?`restoringConversation`:t?`sidebarRestore`:`sidebarArchive`),icon:t?(0,q.jsx)(Wo,{}):(0,q.jsx)(Go,{}),isDisabled:i||!!L,description:L,onClick:ae},{id:`delete`,label:p(`sidebarDelete`),icon:(0,q.jsx)(Uc,{}),isDisabled:!!L,description:L,onClick:()=>{let t=B();queueMicrotask(()=>{h.current&&(F(!1),j({commandId:crypto.randomUUID(),path:e.path,id:e.id,name:ID(e,p(`untitledSession`)),restoreFocus:t}))})}}];return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`astryx-menu-trigger`,ref:m,children:(0,q.jsx)(yo,{className:`sidebar-action-menu sidebar-conversation-menu`,button:{label:p(`conversationOptions`),icon:(0,q.jsx)(Ds,{}),isIconOnly:!0,size:`sm`,variant:`ghost`,className:`menu-action-button`},items:v?H:[],menuWidth:248,placement:`below`,alignment:`start`,hasChevron:!1,isMenuOpen:v,onOpenChange:y})}),A&&(0,q.jsx)(Se,{isOpen:A!==null,onOpenChange:e=>{e||ce()},purpose:`form`,width:420,"aria-label":p(`sidebarDeleteTitle`),children:(0,q.jsxs)(`form`,{className:`openpi-dialog sidebar-delete-dialog`,onSubmit:e=>{e.preventDefault(),le()},children:[(0,q.jsx)(`strong`,{children:p(`sidebarDeleteTitle`)}),(0,q.jsx)(`p`,{children:p(`sidebarDeleteDescription`,{name:A?.name})}),(P||te)&&(0,q.jsx)(`p`,{className:`sidebar-dialog-error`,role:`alert`,children:p(te?`sessionLinkUnavailable`:`sidebarDeleteFailed`)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,disabled:M,onClick:ce,children:p(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,className:`danger`,disabled:M||!!L||te,children:p(M?`sidebarDeleting`:`sidebarDeleteConfirm`)})]})]})})]})}var bA=e=>JSON.stringify([`session`,e.id,e.path]),xA=e=>JSON.stringify([`message`,e.sessionId,e.sessionPath,e.messageId,e.source,e.lineOffset]);function SA({open:e,initialQuery:t,initialIncludeArchived:n,sessions:r,workspaces:i,onClose:a,onCreateSession:o,onOpenSession:s,onOpenMessage:c}){let{t:l}=W(),u=(0,K.useMemo)(()=>new de,[]),[d,f]=(0,K.useState)(t),p=n,[m,h]=(0,K.useState)(null),[g,_]=(0,K.useState)(!1),[v,y]=(0,K.useState)(0),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(null),[w,T]=(0,K.useState)(null),[E,D]=(0,K.useState)(null),O=(0,K.useRef)(null),k=(0,K.useId)(),A=(0,K.useRef)(null);(0,K.useEffect)(()=>(e&&(f(t),h(null),x(!1),C(null),T(null)),()=>{A.current?.abort(),A.current=null}),[e,t]);let j=d.trim(),M=(0,K.useMemo)(()=>new Map(i?.map(e=>[e.path,e.name])),[i]),N=(0,K.useMemo)(()=>{if(!e||!s)return[];let t=j.toLocaleLowerCase();return(r??[]).filter(e=>e.archived&&!p?!1:!t||`${ID(e,l(`untitledSession`))} ${e.cwd} ${M.get(e.cwd)??``}`.toLocaleLowerCase().includes(t)).sort((e,t)=>t.modified.localeCompare(e.modified)||e.path.localeCompare(t.path))},[e,r,M,j,p,s,l]),P=j?[{name:`transcriptSearchSessions`,sessions:N.slice(0,9)}]:[{name:`pinnedConversations`,sessions:N.filter(e=>e.pinOrder!==void 0).sort((e,t)=>(e.pinOrder??0)-(t.pinOrder??0))},{name:`transcriptSearchRecent`,sessions:N.filter(e=>e.pinOrder===void 0).slice(0,10)}];(0,K.useLayoutEffect)(()=>{A.current?.abort(),A.current=null,T(null),C(null),D(null)},[e,j,p,v]),(0,K.useEffect)(()=>{if(!e||!j){_(!1),x(!1);return}let t=new AbortController;_(!0),x(!1);let n=window.setTimeout(()=>{u.searchTranscripts(j,{includeArchived:p,signal:t.signal}).then(e=>{t.signal.aborted||h({query:j,revision:v,includeArchived:p,response:e})}).catch(()=>{t.signal.aborted||x(!0)}).finally(()=>{t.signal.aborted||_(!1)})},250);return()=>{window.clearTimeout(n),t.abort()}},[u,e,j,p,v]);let F=m?.query===j&&m.revision===v&&m.includeArchived===p?m.response:null,I=[...P.flatMap(e=>e.sessions.map(bA)),...j?F?.matches.map(xA)??[]:[]],ee=E!==null&&I.includes(E)?E:I[0],L=e=>`${k}-${encodeURIComponent(e)}`,R=ee?L(ee):void 0;(0,K.useLayoutEffect)(()=>{e&&R&&document.getElementById(R)?.scrollIntoView?.({block:`nearest`})},[e,R]);let te=async(e,t,n)=>{if(A.current)return;D(e),O.current?.focus({preventScroll:!0});let r=new AbortController;A.current=r,T(e),C(null);try{let e=await t(r.signal);if(r.signal.aborted)return;e===!1?C(n):a()}catch{r.signal.aborted||C(n)}finally{A.current===r&&(A.current=null,T(null))}};return(0,q.jsx)(Se,{isOpen:e,onOpenChange:e=>!e&&a(),purpose:`info`,width:`min(700px, 92vw)`,maxHeight:`calc(var(--transcript-search-list-height) + 64px)`,padding:0,className:`transcript-search-modal`,"aria-label":l(`transcriptSearch`),children:e&&(0,q.jsxs)(`div`,{className:`transcript-search-dialog`,children:[(0,q.jsx)(`h2`,{className:`transcript-search-sr-only`,children:l(`transcriptSearch`)}),(0,q.jsx)(`input`,{ref:O,className:`transcript-search-input`,"data-autofocus":!0,type:`search`,maxLength:200,value:d,"aria-label":l(`transcriptSearch`),"aria-autocomplete":`list`,"aria-controls":k,"aria-activedescendant":R,placeholder:l(`transcriptSearchPlaceholder`),autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,onChange:e=>f(e.target.value),onKeyDown:e=>{if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||![`ArrowDown`,`ArrowUp`,`Home`,`End`,`Enter`].includes(e.key)||w!==null)return;if(!ee||!R){e.key===`Enter`&&!j&&o&&(e.preventDefault(),a(),o());return}e.preventDefault();let t=I.indexOf(ee);if(e.key===`Enter`){document.getElementById(R)?.click();return}let n=e.key===`Home`?0:e.key===`End`?I.length-1:e.key===`ArrowDown`?Math.min(t+1,I.length-1):Math.max(t-1,0);D(I[n]??null)}}),(0,q.jsx)(`span`,{className:`transcript-search-sr-only`,role:`status`,children:g?l(`transcriptSearching`):null}),(0,q.jsxs)(`div`,{className:`transcript-search-groups`,children:[(0,q.jsx)(`div`,{id:k,role:`listbox`,"aria-label":l(`transcriptSearch`),children:P.filter(e=>e.sessions.length>0||j&&F?.matches.length).map(e=>(0,q.jsxs)(`fieldset`,{"aria-label":l(e.name),children:[(0,q.jsxs)(`h3`,{children:[l(e.name),g&&(0,q.jsx)(rc,{className:`is-spinning`,"aria-hidden":`true`})]}),(0,q.jsxs)(`ul`,{className:`transcript-search-results`,role:`presentation`,children:[s&&e.sessions.map(e=>{let t=ID(e,l(`untitledSession`)),n=bA(e),r=e.ungrouped?l(`ungrouped`):M.get(e.cwd)||LD(e.cwd);return(0,q.jsx)(`li`,{role:`presentation`,children:(0,q.jsxs)(`button`,{id:L(n),role:`option`,"aria-selected":n===ee,tabIndex:-1,type:`button`,disabled:w!==null,"aria-label":l(`transcriptSearchSessionResult`,{session:t}),onPointerMove:()=>D(n),onMouseDown:e=>e.preventDefault(),onClick:()=>void te(n,t=>s(e.path,t),`transcriptSearchSessionOpenFailed`),children:[(0,q.jsx)(`span`,{className:`transcript-search-accessory`,"aria-hidden":`true`,children:w===n?(0,q.jsx)(rc,{className:`is-spinning`}):e.unread?(0,q.jsx)(hs,{className:`transcript-search-unread`}):null}),(0,q.jsx)(`span`,{className:`transcript-search-result-body`,children:(0,q.jsxs)(`span`,{className:`transcript-search-result-line`,children:[(0,q.jsx)(`span`,{className:`transcript-search-title`,title:t,children:t}),(0,q.jsx)(`span`,{className:`transcript-search-project`,title:e.cwd,children:r})]})})]})},n)}),j&&F?.matches.map(e=>{let t=e.sessionName||l(`untitledSession`),n=l(`transcriptSearchSource_${e.source}`),r=xA(e);return(0,q.jsx)(`li`,{role:`presentation`,children:(0,q.jsxs)(`button`,{id:L(r),role:`option`,"aria-selected":r===ee,tabIndex:-1,type:`button`,disabled:w!==null,"aria-label":l(`transcriptSearchResult`,{session:t,source:n}),onPointerMove:()=>D(r),onMouseDown:e=>e.preventDefault(),onClick:()=>void te(r,t=>c({sessionId:e.sessionId,sessionPath:e.sessionPath,entryId:e.messageId},t),`transcriptSearchOpenFailed`),children:[(0,q.jsx)(`span`,{className:`transcript-search-accessory`,"aria-hidden":`true`,children:w===r&&(0,q.jsx)(rc,{className:`is-spinning`})}),(0,q.jsxs)(`span`,{className:`transcript-search-result-body`,children:[(0,q.jsxs)(`span`,{className:`transcript-search-result-line`,children:[(0,q.jsx)(`span`,{className:`transcript-search-title`,title:t,children:t}),(0,q.jsx)(`span`,{className:`transcript-search-project`,title:e.workspace??n,children:e.workspace?M.get(e.workspace)||LD(e.workspace):n})]}),(0,q.jsx)(`span`,{className:`transcript-search-snippet`,children:e.snippet})]})]})},r)})]})]},e.name))}),!j&&!N.length&&(0,q.jsxs)(`div`,{className:`transcript-search-empty-history`,children:[(0,q.jsx)(`p`,{children:l(`noConversations`)}),o&&(0,q.jsx)(`button`,{className:`transcript-search-create`,type:`button`,onClick:()=>{a(),o()},children:l(`newSession`)})]}),j&&!N.length&&!F?.matches.length&&(g?(0,q.jsx)(`div`,{className:`transcript-search-feedback`,"aria-hidden":`true`,children:(0,q.jsx)(rc,{className:`is-spinning`})}):F&&!b?(0,q.jsx)(`div`,{className:`transcript-search-feedback`,role:`status`,children:l(`transcriptSearchEmpty`)}):null),b&&(0,q.jsxs)(`p`,{className:`transcript-search-error`,role:`alert`,children:[l(`transcriptSearchFailed`),(0,q.jsx)(`button`,{type:`button`,onClick:()=>y(e=>e+1),children:l(`transcriptSearchRetry`)})]}),S&&(0,q.jsx)(`p`,{className:`transcript-search-error`,role:`alert`,children:l(S)}),F?.partial&&(0,q.jsx)(`p`,{className:`transcript-search-partial`,children:l(`transcriptSearchPartial`)})]})]})})}function CA({workspace:e,client:t,actions:n,connected:r,onClose:i}){let{t:a}=W(),[o,s]=(0,K.useState)([]),[c,l]=(0,K.useState)(),[u,d]=(0,K.useState)(!1),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(0),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(null),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(!1),w=(0,K.useRef)(0),T=(0,K.useRef)(null),E=(0,K.useRef)(!1),D=(0,K.useRef)(!0),O=(0,K.useCallback)(async n=>{let r=++w.current;d(!0),p(null);try{let i=await t.workspaceWorktrees(e,n);if(!D.current||r!==w.current)return;if(i.truncated&&!i.nextCursor)throw Error(`Missing worktree continuation`);s(e=>{let t=n?[...e]:[];for(let e of i.worktrees)t.some(t=>t.worktreePath===e.worktreePath&&t.sessionId===e.sessionId&&t.sessionPath===e.sessionPath)||t.push(e);return t}),l(i.nextCursor),h(e=>(n?e:0)+i.unavailable)}catch(e){D.current&&r===w.current&&p(e instanceof ge&&e.code===`WORKTREE_LIST_CHANGED`?`changed`:`failed`)}finally{D.current&&r===w.current&&d(!1)}},[t,e]);(0,K.useEffect)(()=>(D.current=!0,O(),()=>{D.current=!1,w.current++}),[O]);let k=async()=>{if(!(!g||E.current||!r)){E.current=!0,C(!0);try{let e=await n.releaseSessionWorktree(g);if(!D.current)return;y(e),x(!1),e.state===`removed`&&s(e=>e.filter(e=>e.worktreePath!==g.worktreePath||e.sessionId!==g.sessionId||e.sessionPath!==g.sessionPath))}catch{D.current&&(x(!0),y(null))}finally{E.current=!1,D.current&&C(!1)}}};(0,K.useEffect)(()=>{g&&!S&&T.current?.focus()},[g,S]);let A=()=>{E.current||i()};return(0,q.jsx)(Se,{isOpen:!0,onOpenChange:e=>{e||A()},purpose:`form`,width:560,"aria-label":a(`managedWorktrees`),children:(0,q.jsxs)(`div`,{className:`openpi-dialog`,children:[(0,q.jsx)(`strong`,{children:a(`managedWorktrees`)}),(0,q.jsx)(`p`,{className:`sidebar-dialog-path`,children:e}),(0,q.jsx)(`p`,{children:a(`managedWorktreesDescription`)}),g?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`sidebar-dialog-path`,children:g.worktreePath}),(0,q.jsx)(`p`,{children:a(`managedWorktreeConfirm`)}),(v||b)&&(0,q.jsxs)(`p`,{role:`status`,className:v?.state===`removed`?void 0:`sidebar-dialog-error`,children:[a(v?.state===`removed`?`managedWorktreeRemoved`:v?.state===`preserved`?`managedWorktreePreserved`:v?.state===`uncertain`?`managedWorktreeUncertainTerminal`:`managedWorktreeUncertain`),v?.reason&&(0,q.jsxs)(q.Fragment,{children:[` `,v.reason]})]}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,ref:T,disabled:S,onClick:()=>{_(null),y(null),x(!1)},children:a(`managedWorktreesBack`)}),v?.state!==`removed`&&v?.state!==`uncertain`&&(0,q.jsx)(`button`,{type:`button`,className:`danger`,disabled:S||!r,onClick:()=>void k(),children:a(S?`managedWorktreeRemoving`:v||b?`managedWorktreesRetry`:`managedWorktreeRemove`)})]})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`managed-worktrees-list`,children:o.map(e=>(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`sidebar-dialog-path`,children:e.worktreePath}),(0,q.jsx)(`button`,{type:`button`,disabled:!r||u||!!f,onClick:()=>{_(e),y(null),x(!1)},children:a(`managedWorktreeReview`)})]},JSON.stringify([e.worktreePath,e.sessionId,e.sessionPath])))}),!u&&!f&&!o.length&&(0,q.jsx)(`p`,{children:a(`managedWorktreesEmpty`)}),m>0&&(0,q.jsx)(`p`,{children:a(`managedWorktreesUnavailable`,{count:m})}),f&&(0,q.jsx)(`p`,{role:`alert`,children:a(f===`changed`?`managedWorktreesChanged`:`managedWorktreesLoadFailed`)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,onClick:A,children:a(`close`)}),f&&(0,q.jsx)(`button`,{type:`button`,disabled:u||!r,onClick:()=>void O(f===`changed`?void 0:c),children:a(f===`changed`?`managedWorktreesRefresh`:`managedWorktreesRetry`)}),c&&!f&&(0,q.jsx)(`button`,{type:`button`,disabled:u||!r,onClick:()=>void O(c),children:a(`managedWorktreesMore`)}),u&&(0,q.jsx)(`span`,{role:`status`,children:a(`loading`)})]})]})]})})}function wA(e){return e.workspacePath??e.cwd}function TA(e,t,n){return e[t+(n?2:-1)]??null}function EA(e,t,n){return e[t+ +!!n]??null}function DA(e,t){return e>t.top+t.height/2}function OA(e){let t=e.execution?.lastTurn;return JSON.stringify(t?[e.path,e.id,t.commandId,t.finishedAt]:[e.path,e.id])}function kA(e){return e.firstUnread?.type===`turn`?e.firstUnread.finishedAt:e.execution?.lastTurn?.finishedAt??Date.parse(e.modified)}function AA(e){return JSON.stringify([e.path,e.id])}function jA(e,t=!0){return t&&e.execution?.waitingForInput?0:e.unread?1:t&&e.execution?.status===`running`?2:3}function MA({items:e,label:t,alignment:n=`start`}){return(0,q.jsx)(`span`,{className:`astryx-menu-trigger`,children:(0,q.jsx)(yo,{className:`sidebar-action-menu`,button:{label:t,icon:(0,q.jsx)(Ds,{}),isIconOnly:!0,size:`sm`,variant:`ghost`,className:`menu-action-button`},items:e,menuWidth:240,placement:`below`,alignment:n,hasChevron:!1})})}function NA(e){let{t,i18n:n}=W(),[r,i]=(0,K.useState)(null),a=(0,K.useRef)(null),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(!1),[f,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(10),[g,_]=(0,K.useState)(!0),[v,y]=(0,K.useState)(new Set),b=(0,K.useRef)(null),[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(new Set),[k,A]=(0,K.useState)(10),[j,M]=(0,K.useState)(!1),[N,P]=(0,K.useState)(null),[F,I]=(0,K.useState)(!1),ee=(0,K.useRef)(new Set),L=(0,K.useRef)(null),R=(0,K.useRef)(null),te=(0,K.useRef)(e.connected),[z,B]=(0,K.useState)(null),[ne,re]=(0,K.useState)(``),[ie,ae]=(0,K.useState)(!1),oe=(0,K.useRef)(null),se=(0,K.useRef)(null),ce=(0,K.useRef)(null),le=(0,K.useRef)(null),H=(0,K.useRef)(null),fe=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!N)return;let e=window.setTimeout(()=>P(null),5e3);return()=>window.clearTimeout(e)},[N]);let pe=e.snapshot,he=pe?.selectedSession?.path===e.selectedPath?e.selectedPath:null,_e=pe?.sessions.find(e=>e.path===pe.selectedSession?.path&&e.id===pe.selectedSession?.id),ve=OA(_e??{id:``,path:``});(0,K.useLayoutEffect)(()=>{e.selectedPath,L.current=null,R.current=null,M(!1)},[ve,e.selectedPath]),(0,K.useEffect)(()=>{let t=te.current===!1&&e.connected!==!1;if(te.current=e.connected,R.current&&_e?.readRevision&&R.current.revision!==_e.readRevision&&(R.current=null,L.current=ve,M(!1)),!e.sessionViewVisible||!_e||e.selectedPath!==_e.path||L.current===ve||e.connected===!1)return;let n=(t=!1)=>{if(document.visibilityState!==`visible`||!document.hasFocus()||document.querySelector(`dialog[open]`)||L.current===ve)return;if(!_e.unread||!_e.readRevision){L.current=ve,R.current=null;return}if(R.current?.state===`pending`||R.current?.state===`failed`&&!t)return;let n={state:`pending`,revision:_e.readRevision};R.current=n,M(!1),e.actions.setSessionRead(_e.path,_e.id,!0,_e.readRevision).then(()=>{!$e.current||R.current!==n||(R.current=null,L.current=ve)}).catch(()=>{!$e.current||R.current!==n||(n.state=`failed`,M(!0))})},r=()=>n(!0);return n(t),document.addEventListener(`visibilitychange`,r),window.addEventListener(`focus`,r),document.addEventListener(`close`,r,!0),()=>{document.removeEventListener(`visibilitychange`,r),window.removeEventListener(`focus`,r),document.removeEventListener(`close`,r,!0)}},[ve,_e,e.sessionViewVisible,e.selectedPath,e.connected,e.actions]);let ye=(0,K.useMemo)(()=>new de,[]),[be,xe]=(0,K.useState)(!1),[Ce,we]=(0,K.useState)(!1),[Te,Ee]=(0,K.useState)(!1),U=(0,K.useRef)(!1),De=(0,K.useRef)(null),Oe=(0,K.useRef)(!1),[ke,G]=(0,K.useState)(!1),Me=(0,K.useRef)(null),[Ne,Pe]=(0,K.useState)(null),[Fe,Ie]=(0,K.useState)(null),[Le,Re]=(0,K.useState)(!1),[ze,Be]=(0,K.useState)(!1),Ve=pe?.preferences.pinnedSort??`manual`,He=pe?.preferences.sidebarGrouping??`project`,Ue=pe?.preferences.chatsSort??`updated`,We=(pe?.sessions??[]).filter(e=>e.pinOrder!==void 0&&!e.archived).sort((e,t)=>(Ve===`updated`?t.modified.localeCompare(e.modified):0)||e.pinOrder-t.pinOrder).filter(n=>{let r=pe?.workspaces.find(e=>e.path===wA(n));return`${ID(n,t(`untitledSession`))} ${n.cwd} ${r?.name??``}`.toLowerCase().includes(e.query.trim().toLowerCase())}),Ge=async e=>{if(!U.current){U.current=!0,Ee(!0),Be(!1);try{await e()}catch{Be(!0)}finally{U.current=!1,Ee(!1)}}},Ke=(t,n,r)=>Ge(()=>e.actions.setSessionPin(t.path,t.id,n,r)),qe=(t,n,r)=>Ge(()=>e.actions.setSidebarPin(t,n,r)),Je=t=>Ge(async()=>{await ye.savePreferences(t),await e.actions.refreshSnapshot()}),Ye=async(t,n)=>{if(!t.readRevision)return;let r=OA(t);if(!ee.current.has(r)){t.path===e.selectedPath&&(R.current=null,L.current=r),ee.current.add(r),M(!1);try{await e.actions.setSessionRead(t.path,t.id,n,t.readRevision)}catch{M(!0)}finally{ee.current.delete(r)}}},Xe=e.query.trim(),Ze=JSON.stringify([be,Xe]),Qe=(0,K.useRef)({key:Ze});Qe.current.key!==Ze&&(Qe.current={key:Ze});let $e=(0,K.useRef)(!1),[et,tt]=(0,K.useState)(null),[nt,rt]=(0,K.useState)(!1),[it,at]=(0,K.useState)(null),ot=(0,K.useRef)(null),st=et?.query===Xe?et:null,ct=it?.query===Xe?it:null,lt=(0,K.useCallback)(async(e,t)=>{if(!be)return;ot.current?.abort();let n=new AbortController;ot.current=n,rt(!0),at(null);try{let r=await ye.listArchivedSessions({query:Xe,...e?{cursor:e}:{},limit:25},n.signal);if(n.signal.aborted||ot.current!==n)return;let i=[...r.sessions];for(;!e&&t!==void 0&&i.length!i.some(t=>t.path===e.path));if(i.push(...e),!e.length)break}tt(t=>({...r,query:Xe,sessions:e&&t?.query===Xe?[...t.sessions,...i.filter(e=>!t.sessions.some(t=>t.path===e.path))]:i}))}catch(r){!n.signal.aborted&&ot.current===n&&at({query:Xe,kind:r instanceof ge&&r.code===`ARCHIVED_SESSION_CURSOR_STALE`?`stale`:`failed`,...e?{cursor:e}:{},...t===void 0?{}:{retainedCount:t}})}finally{ot.current===n&&(ot.current=null,rt(!1))}},[Xe,be,ye]),[ut,dt]=(0,K.useState)(new Set),[ft,pt]=(0,K.useState)(new Set),mt=(0,K.useRef)(new Set),[ht,gt]=(0,K.useState)(!1),[_t,vt]=(0,K.useState)(!1),yt=(0,K.useRef)(!1),[bt,xt]=(0,K.useState)(!1),St=(0,K.useRef)(!1),[Ct,wt]=(0,K.useState)(!1),[Tt,Et]=(0,K.useState)(!1),Dt=(0,K.useRef)(!1),Ot=async t=>{if(mt.current.has(t))return;mt.current.add(t),pt(new Set(mt.current)),gt(!1);let n=Qe.current;try{let r=await e.actions.unarchiveSession(t);if(!$e.current||Qe.current!==n)return;r?(tt(e=>e?{...e,sessions:e.sessions.filter(e=>e.path!==t)}:null),await lt()):gt(!0)}finally{mt.current.delete(t),$e.current&&pt(new Set(mt.current))}};(0,K.useEffect)(()=>($e.current=!0,()=>{$e.current=!1}),[]),(0,K.useEffect)(()=>(gt(!1),at(null),be&&(tt(e=>e?.query===Xe?e:null),lt()),()=>{ot.current?.abort(),ot.current=null}),[Xe,be,lt]),(0,K.useEffect)(()=>{if(e.searchOpen)return oe.current?.focus(),()=>se.current?.focus()},[e.searchOpen]),(0,K.useEffect)(()=>{if(e.mobileOpen)return H.current?.focus(),()=>{let t=e.returnFocusRef?.current;t?.checkVisibility()&&t.focus()}},[e.mobileOpen,e.returnFocusRef]),(0,K.useEffect)(()=>{e.mobileOpen&&document.activeElement===document.body&&!document.querySelector(`dialog:modal`)&&H.current?.focus()}),(0,K.useEffect)(()=>{c&&(ce.current?.focus(),ce.current?.select())},[c]);let kt=(0,K.useMemo)(()=>{let n=e.query.trim().toLowerCase(),r=be?st?.sessions??[]:pe?.sessions??[],i=(e,i)=>r.filter(r=>!!r.archived===be&&(be||r.pinOrder===void 0)&&(e===`__ungrouped__`?r.ungrouped:wA(r)===e&&!r.ungrouped)&&(!n||be||i||`${ID(r,t(`untitledSession`))} ${r.cwd}`.toLowerCase().includes(n))),a=[...pe?.workspaces??[]];for(let e of r)!e.ungrouped&&!a.some(t=>t.path===wA(e))&&a.push({path:wA(e),name:wA(e),current:!1});return[...a.map(e=>{let t=!!n&&`${e.name} ${e.path}`.toLowerCase().includes(n);return{...e,showPath:a.some(t=>t.path!==e.path&&t.name===e.name),sessions:i(e.path,t),ungrouped:!1,matches:t}}),{path:`__ungrouped__`,name:t(`ungrouped`),current:!1,sessions:i(`__ungrouped__`,!1),ungrouped:!0,pinOrder:void 0,showPath:!1,matches:!1}].filter(e=>e.sessions.length>0||!be&&!e.ungrouped&&(!n||e.matches))},[be,e.query,st,pe,t]),At=e=>[...e].sort((e,t)=>(Ue===`manual`?(e.order??2**53-1)-(t.order??2**53-1):0)||t.modified.localeCompare(e.modified)||e.path.localeCompare(t.path)),jt=(e,t)=>{if(e.length<=t+1)return e;let n=e.slice(0,t),r=e.find(e=>e.path===he&&e.id===pe?.selectedSession?.id);return r&&!n.includes(r)&&n.push(r),n},Mt=kt.filter(e=>!e.ungrouped),Nt=Mt.filter(e=>e.pinOrder!==void 0),Pt=[...We.map(e=>({kind:`session`,session:e,pinOrder:e.pinOrder})),...Nt.map(e=>({kind:`workspace`,project:e,pinOrder:e.pinOrder}))].sort((e,t)=>{let n=e=>e.kind===`session`?e.session.modified:e.project.sessions.reduce((e,t)=>t.modified>e?t.modified:e,``);return(Ve===`updated`?n(t).localeCompare(n(e)):0)||e.pinOrder-t.pinOrder}),Ft=e=>e.kind===`session`?{kind:`session`,path:e.session.path,id:e.session.id}:{kind:`workspace`,path:e.project.path},It=Mt.filter(e=>e.pinOrder===void 0),Lt=x||e.query.trim()||be||It.length<=6?It:It.slice(0,5),Rt=It.find(e=>_e?.path===he&&e.path===(_e?wA(_e):void 0));Rt&&!Lt.includes(Rt)&&Lt.push(Rt);let zt=At((pe?.sessions??[]).filter(n=>!n.archived&&n.pinOrder===void 0&&!pe?.workspaces.some(e=>e.pinOrder!==void 0&&e.path===wA(n))&&(He===`list`||pe?.preferences.projectsInRecents!==!1||n.ungrouped||!Mt.some(e=>e.path===wA(n)))&&(!e.query.trim()||`${ID(n,t(`untitledSession`))} ${n.cwd} ${pe?.workspaces.find(e=>e.path===wA(n))?.name??``}`.toLowerCase().includes(e.query.trim().toLowerCase())))),Bt=e.query.trim()?zt:jt(zt,k),Vt=t=>jA(t,e.connected)<3,Ht=new Date;Ht.setHours(0,0,0,0),Ht.setDate(Ht.getDate()-6);let Ut=(pe?.sessions??[]).filter(e=>!e.archived&&(Vt(e)||v.has(AA(e))||[`completed`,`failed`].includes(e.execution?.lastTurn?.outcome??``)&&(e.execution?.lastTurn?.finishedAt??0)>=Ht.getTime())),Wt=new Map([...v].map((e,t)=>[e,t])),Gt=Ut.filter(e=>Vt(e)||v.has(AA(e))).sort((t,n)=>(Wt.get(AA(t))??1/0)-(Wt.get(AA(n))??1/0)||jA(t,e.connected)-jA(n,e.connected)||n.modified.localeCompare(t.modified)),Kt=new Set(Gt.map(e=>e.path)),qt=Ut.filter(e=>!g||!Kt.has(e.path)).sort((e,t)=>kA(t)-kA(e)),Jt=g?Gt.slice(0,m):[],Yt=qt.slice(0,Math.max(0,m-Jt.length)),Xt=Ut.length>Jt.length+Yt.length;(0,K.useEffect)(()=>{let e=fe.current;if(!f||!Xt||!e||typeof IntersectionObserver>`u`)return;let t=new IntersectionObserver(([e])=>{e?.isIntersecting&&(t.disconnect(),h(m+10))},{root:e.closest(`.sidebar-navigation`)});return t.observe(e),()=>t.disconnect()},[f,Xt,m]),(0,K.useEffect)(()=>{if(!f){b.current=null,y(e=>e.size?new Set:e),h(10);return}let t=b.current??{openedAt:Date.now(),sessions:new Set((pe?.sessions??[]).map(AA))},n=(pe?.sessions??[]).filter(t=>!t.archived&&jA(t,e.connected)<3).sort((t,n)=>jA(t,e.connected)-jA(n,e.connected)||n.modified.localeCompare(t.modified)),r=n.filter(e=>!t.sessions.has(AA(e))&&Date.parse(e.created)>=t.openedAt);for(let e of pe?.sessions??[])t.sessions.add(AA(e));b.current=t,y(e=>{let t=new Set([...r.map(AA),...e,...n.map(AA)]);return t.size===e.size?e:t})},[f,pe?.sessions,e.connected]);let Zt=(pe?.sessions??[]).filter(e=>!e.archived&&e.unread),Qt=Zt.filter(e=>e.readRevision),$t=g?Gt.filter(e=>e.unread&&e.readRevision):[],en=async e=>{if(!F){I(!0);try{await Promise.all(e.map(e=>Ye(e,!0)))}finally{I(!1)}}},tn=he?_e?wA(_e):pe?.selectedSession?.cwd:null,nn=!!(pe?.truncation.sessionsOmitted||pe?.truncation.workspacesOmitted),rn=e=>{yt.current||(re(e.name),ae(!1),l(e))},an=async()=>{let t=ne.trim();if(!c||!t||t===c.name||yt.current)return;let n=c,r=Qe.current,i=st?.sessions.length??25;yt.current=!0,vt(!0),ae(!1);try{if(n.kind===`workspace`?await e.actions.renameWorkspace(n.path,t):await e.actions.renameSession(n.path,t),!$e.current)return;l(null),n.kind===`session`&&be&&Qe.current===r&<(void 0,i)}catch{$e.current&&ae(!0)}finally{yt.current=!1,$e.current&&vt(!1)}},on=async()=>{if(!z||St.current)return;let t=z;St.current=!0,xt(!0),wt(!1);try{let n=await e.actions.removeWorkspace(t.path);if(!$e.current)return;n?B(null):wt(!0)}catch{$e.current&&wt(!0)}finally{St.current=!1,$e.current&&xt(!1)}},sn=async t=>{if(Dt.current)return;let n=Qe.current;Dt.current=!0,Et(!0);try{if(!t){await e.actions.chooseWorkspace();return}let r=await e.actions.createSession(t);if(!$e.current||Qe.current!==n||!r?.sessionId||!r.sessionPath||r.workspacePath!==t)return;xe(!1),p(!1),e.actions.setQuery(``)}catch{}finally{Dt.current=!1,$e.current&&Et(!1)}},cn=(0,K.useCallback)(()=>{(De.current||Me.current)&&(Oe.current=!0),De.current=null,Me.current=null,G(!1),Ie(null),Pe(null)},[]);(0,K.useEffect)(()=>{let e=e=>{e.key!==`Escape`||!De.current&&!Me.current||(e.preventDefault(),cn())},t=()=>{(De.current||Me.current)&&cn()};return window.addEventListener(`keydown`,e,!0),window.addEventListener(`blur`,t),()=>{window.removeEventListener(`keydown`,e,!0),window.removeEventListener(`blur`,t)}},[cn]);let ln=(e,t)=>{let n=Pt[e];if(!n)return;let r=TA(Pt,e,t);qe(Ft(n),!0,r?Ft(r):null)},un=e=>Ve===`manual`?[{id:`move-up`,label:t(`movePinUp`),icon:(0,q.jsx)(Xo,{}),isDisabled:Te||e<=0,onClick:()=>ln(e,!1)},{id:`move-down`,label:t(`movePinDown`),icon:(0,q.jsx)(ue,{}),isDisabled:Te||e===Pt.length-1,onClick:()=>ln(e,!0)}]:[],dn=[{id:`updated`,label:t(`pinnedRecentlyUpdated`),endContent:Ue===`updated`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({chatsSort:`updated`})},{id:`manual`,label:t(`pinnedManualOrder`),endContent:Ue===`manual`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({chatsSort:`manual`})}],fn=[{id:`updated`,label:t(`pinnedRecentlyUpdated`),endContent:Ve===`updated`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({pinnedSort:`updated`})},{id:`manual`,label:t(`pinnedManualOrder`),endContent:Ve===`manual`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({pinnedSort:`manual`})}],pn=[{label:t(`sidebarGroupBy`),items:[{label:t(`sidebarByProject`),endContent:He===`project`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({sidebarGrouping:`project`})},{label:t(`sidebarFlatList`),endContent:He===`list`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({sidebarGrouping:`list`})}]},{label:t(`sidebarChatSort`),items:dn}],mn=[...pn,...He===`project`?[{label:t(`sidebarShow`),items:[{label:t(`sidebarProjectsInRecents`),endContent:pe?.preferences.projectsInRecents===!1?void 0:(0,q.jsx)(rs,{size:16}),isDisabled:Te,onClick:()=>void Je({projectsInRecents:pe?.preferences.projectsInRecents===!1})}]}]:[]],hn=(0,q.jsxs)(`div`,{className:`sidebar-section-actions is-always-visible`,children:[(0,q.jsx)(MA,{label:t(`sidebarActivityOptions`),items:[{type:`section`,title:t(`sidebarShow`),items:[{label:t(`sidebarPriority`),endContent:g?(0,q.jsx)(rs,{size:16}):void 0,onClick:()=>_(e=>!e)}]},{type:`divider`},{label:t(`sidebarMarkAllRead`),icon:(0,q.jsx)(ic,{}),isDisabled:F||!$t.length,onClick:()=>void en($t)}]}),g&&Gt.some(e=>!Vt(e))&&(0,q.jsx)(V,{content:t(`sidebarClearRead`),children:(0,q.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":t(`sidebarClearRead`),onClick:()=>y(new Set(Gt.filter(Vt).map(AA))),children:(0,q.jsx)(es,{"aria-hidden":`true`})})})]}),gn=(a,o=!1,s)=>{let c=JSON.stringify([a.path,a.id,o,s?.key]),l=Pt.findIndex(e=>e.kind===`session`&&e.session.path===a.path&&e.session.id===a.id),u={kind:`session`,path:a.path,id:a.id},d=a.pinOrder!==void 0,p=e.connected!==!1&&a.execution?.status===`running`,m=e.connected!==!1&&a.execution?.waitingForInput,h=a.firstUnread?.type===`turn`?a.firstUnread.outcome:a.execution?.lastTurn?.outcome,g=m?`attention`:p?`running`:a.unread?h===`failed`?`attention`:h===`completed`?`completed`:`unread`:void 0,_=g===`running`?rc:g===`attention`?ls:hs,v=e.connected===!1?0:a.execution?.pendingFollowUps??0,y=a.path===he&&a.id===pe?.selectedSession?.id,b=g===`attention`?m?`waiting`:`failed`:g===`running`&&a.execution?.compacting?`compacting`:g,x=[...b?[t(`sidebarState_`+b)]:[],...v>0?[t(`pendingFollowUpsHint`,{count:v})]:[]].join(` · `),S=s?.sessions.findIndex(e=>e.path===a.path&&e.id===a.id)??-1,C=!be&&!o&&Ue===`manual`&&!!s,w=t=>Ge(()=>e.actions.setSessionOrder(a.path,a.id,t?{path:t.path,id:t.id}:null)),T=o?un(l):C&&s?[{id:`move-up`,label:t(`movePinUp`),icon:(0,q.jsx)(Xo,{}),isDisabled:Te||S<=0,onClick:()=>void w(TA(s.sessions,S,!1))},{id:`move-down`,label:t(`movePinDown`),icon:(0,q.jsx)(ue,{}),isDisabled:Te||S===s.sessions.length-1,onClick:()=>void w(TA(s.sessions,S,!0))}]:[];return(0,q.jsxs)(`li`,{className:`session-row `+(a.unread?`is-unread `:``)+(Fe===a.path?Le?`is-pin-drop-after`:`is-pin-drop-target`:``),"aria-label":ID(a,t(`untitledSession`)),"data-session-key":JSON.stringify([a.path,a.id]),"data-dragging":ke&&(De.current?.kind===`session`&&De.current.path===a.path&&De.current.id===a.id||Me.current?.path===a.path&&Me.current.id===a.id)||void 0,draggable:!Te&&!e.query.trim()&&(o?Ve===`manual`:C),onDragStart:e=>{if(e.stopPropagation(),o&&Ve===`manual`)De.current=u;else if(C&&s)Me.current={path:a.path,id:a.id,scope:s.key};else{e.preventDefault();return}G(!0),Oe.current=!0,e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,a.id)},onDragOver:e=>{if(!(o&&Ve===`manual`&&De.current)&&!(C&&Me.current?.scope===s?.key))return;e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`move`,Ie(a.path),Pe(null);let t=e.currentTarget.getBoundingClientRect();Re(DA(e.clientY,t))},onDragEnd:cn,onDrop:t=>{let n=t.currentTarget.getBoundingClientRect(),r=DA(t.clientY,n);if(o&&Ve===`manual`&&De.current){t.preventDefault(),t.stopPropagation();let e=Pt[l+1];qe(De.current,!0,r?e?Ft(e):null:u)}else if(C&&s&&Me.current?.scope===s.key){t.preventDefault(),t.stopPropagation();let n=Me.current,i=EA(s.sessions,S,r);Ge(()=>e.actions.setSessionOrder(n.path,n.id,i?{path:i.path,id:i.id}:null))}else return;cn()},children:[(0,q.jsx)(V,{placement:`end`,delay:450,onOpenChange:e=>i(t=>e?c:t===c?null:t),content:r===c?(0,q.jsxs)(`span`,{className:`session-hover-preview`,children:[(0,q.jsx)(`strong`,{children:ID(a,t(`untitledSession`))}),a.name&&a.firstMessage&&a.firstMessage!==`(no messages)`&&a.firstMessage!==a.name&&(0,q.jsx)(`span`,{children:a.firstMessage}),(0,q.jsx)(`time`,{dateTime:a.modified,children:new Date(a.modified).toLocaleString(n.resolvedLanguage,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})})]}):null,children:(0,q.jsxs)(`button`,{className:`session `+(y?`active`:``),type:`button`,"aria-current":y?`page`:void 0,"aria-label":[ID(a,t(`untitledSession`)),a.path,x].filter(Boolean).join(` · `),onClick:()=>{y&&a.unread&&e.sessionViewVisible&&e.connected!==!1&&Ye(a,!0),e.actions.selectSession(a.path)},onDoubleClick:n=>{y&&e.connected!==!1&&n.target instanceof Element&&n.target.closest(`.session-title`)&&rn({kind:`session`,path:a.path,name:ID(a,t(`untitledSession`))})},children:[(0,q.jsxs)(`span`,{className:`session-copy`,children:[(0,q.jsx)(`span`,{className:`session-title`,children:ID(a,t(`untitledSession`))}),f&&(0,q.jsxs)(`span`,{className:`session-project`,children:[(0,q.jsx)(Vs,{"aria-hidden":`true`}),pe?.workspaces.find(e=>e.path===wA(a))?.name??RD(wA(a))]})]}),x&&(0,q.jsx)(V,{content:x,children:(0,q.jsxs)(`span`,{className:`session-status`,"aria-hidden":`true`,children:[g&&(0,q.jsx)(_,{className:`session-state session-state-`+g}),v>0&&(0,q.jsxs)(`span`,{className:`session-queue`,children:[(0,q.jsx)(ec,{}),(0,q.jsx)(`span`,{children:v>99?`99+`:v})]})]})})]})}),!be&&(0,q.jsx)(V,{content:t(d?`unpinConversation`:`pinConversation`),children:(0,q.jsx)(`button`,{type:`button`,className:`session-pin-button`,"aria-label":t(d?`unpinConversation`:`pinConversation`),disabled:Te,onClick:e=>{let t=vA(e.currentTarget);Ke(a,!d).finally(t)},children:(0,q.jsx)(xc,{"aria-hidden":`true`,fill:d?`currentColor`:`none`})})}),(0,q.jsx)(yA,{session:a,archived:be,connected:e.connected!==!1,pinSaving:Te,restoring:ft.has(a.path),movementItems:T,client:ye,actions:e.actions,onRename:()=>rn({kind:`session`,path:a.path,name:ID(a,t(`untitledSession`))}),onPin:()=>Ke(a,!d),onRead:()=>Ye(a,!!a.unread),onArchive:()=>be?Ot(a.path):e.actions.archiveSession(a.path),onNotice:(e,t=!1)=>P({message:e,error:t})})]},a.path)},_n=(n,r=!1)=>{let i=(be?ut:e.collapsed).has(n.path)&&!e.query.trim(),o=!n.ungrouped&&tn===n.path,c=Pt.findIndex(e=>e.kind===`workspace`&&e.project.path===n.path),l=It.findIndex(e=>e.path===n.path),u=!be&&!n.ungrouped&&!Te&&!e.query.trim(),d=t=>Ge(()=>e.actions.setWorkspaceOrder(n.path,TA(It,l,t)?.path??null)),f={kind:`workspace`,path:n.path},p=At(n.sessions),m=Qt.filter(e=>!e.ungrouped&&wA(e)===n.path),h=be||!!e.query.trim()||D.has(n.path)||p.length<=6,g=[...be?[]:[{id:`pin`,label:t(r?`unpinWorkspace`:`pinWorkspace`),icon:(0,q.jsx)(xc,{}),isDisabled:Te,onClick:()=>void qe(f,!r)},{id:`mark-read`,label:t(`sidebarMarkAllRead`),icon:(0,q.jsx)(ic,{}),isDisabled:F||!m.length,onClick:()=>void en(m)}],...r?un(c):be?[]:[{id:`move-up`,label:t(`movePinUp`),icon:(0,q.jsx)(Xo,{}),isDisabled:!u||l<=0,onClick:()=>void d(!1)},{id:`move-down`,label:t(`movePinDown`),icon:(0,q.jsx)(ue,{}),isDisabled:!u||l===It.length-1,onClick:()=>void d(!0)}],...n.ungrouped?[]:[{id:`managed-worktrees`,label:t(`managedWorktrees`),icon:(0,q.jsx)(Vs,{}),isDisabled:e.connected===!1,onClick:()=>{let e=Array.from(le.current?.querySelectorAll(`.workspace-group`)??[]).find(e=>e.dataset.workspaceKey===n.path);a.current=vA(e?.querySelector(`.workspace-row-actions .menu-action-button`)??null),queueMicrotask(()=>s(n.path))}}],{id:`rename`,label:t(`renameWorkspace`),icon:(0,q.jsx)(Ic,{}),onClick:()=>rn({kind:`workspace`,path:n.path,name:n.name})},{id:`remove`,label:t(`removeWorkspace`),icon:(0,q.jsx)(Uc,{}),variant:`destructive`,onClick:()=>{wt(!1),B({path:n.path,name:n.name})}}];return(0,q.jsxs)(`section`,{className:`workspace-group `+(i?`collapsed `:``)+(o?`is-active-workspace `:``)+(Ne===n.path?Le?`is-pin-drop-after`:`is-pin-drop-target`:``),"data-workspace-key":n.path,"aria-label":n.name,onDragOver:e=>{if(!u||!De.current||(r?Ve!==`manual`:De.current.kind!==`workspace`))return;e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`move`,Pe(n.path),Ie(null);let t=e.currentTarget.getBoundingClientRect();Re(DA(e.clientY,t))},onDragEnd:cn,onDragLeave:e=>{(!(e.relatedTarget instanceof Node)||!e.currentTarget.contains(e.relatedTarget))&&Pe(null)},onDrop:t=>{if(!u||!De.current||(r?Ve!==`manual`:De.current.kind!==`workspace`))return;t.preventDefault(),t.stopPropagation();let i=t.currentTarget.getBoundingClientRect(),a=DA(t.clientY,i),o=De.current;if(o.kind!==`workspace`||o.path!==n.path)if(r){let e=Pt[c+1];qe(o,!0,a?e?Ft(e):null:f)}else Ge(()=>e.actions.setWorkspaceOrder(o.path,a?It[l+1]?.path??null:n.path));cn()},children:[(0,q.jsxs)(`div`,{className:`workspace-button`,draggable:u&&(!r||Ve===`manual`),onDragStart:e=>{if(!u||r&&Ve!==`manual`||e.target instanceof Element&&e.target.closest(`.workspace-row-actions`)){e.preventDefault();return}De.current=f,requestAnimationFrame(()=>{$e.current&&De.current===f&&G(!0)}),Oe.current=!0,e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,n.path)},children:[(0,q.jsxs)(`button`,{className:`workspace-label`,type:`button`,"aria-expanded":!i,"aria-current":o?`location`:void 0,disabled:!!e.query.trim(),title:n.ungrouped?void 0:n.path,onClick:()=>{be?dt(e=>{let t=new Set(e);return t.has(n.path)?t.delete(n.path):t.add(n.path),t}):e.actions.toggleWorkspace(n.path)},children:[(0,q.jsx)(`span`,{className:`workspace-toggle`,"aria-hidden":`true`,children:i?(0,q.jsx)(Vs,{className:`workspace-folder`}):(0,q.jsx)(zs,{className:`workspace-folder`})}),(0,q.jsxs)(`span`,{className:`workspace-identity`,children:[(0,q.jsx)(`strong`,{children:n.name}),n.showPath&&(0,q.jsx)(`small`,{children:RD(n.path)})]})]}),!n.ungrouped&&(0,q.jsxs)(`span`,{className:`workspace-row-actions`,children:[(0,q.jsx)(MA,{label:t(`workspaceOptions`),items:g}),(0,q.jsx)(V,{content:t(`newSession`),children:(0,q.jsx)(`button`,{className:`workspace-action`,type:`button`,"aria-label":t(`newSession`)+` `+n.name,disabled:Tt,"aria-busy":Tt||void 0,onClick:()=>void sn(n.path),children:(0,q.jsx)(Ic,{})})})]})]}),!i&&!p.length&&!be&&!e.query.trim()&&!nn&&(0,q.jsx)(`p`,{className:`workspace-empty`,children:t(`noConversations`)}),!i&&p.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`ul`,{className:`workspace-sessions`,children:(h?p:jt(p,5)).map(e=>gn(e,!1,{key:n.path,sessions:p}))}),!be&&!e.query.trim()&&p.length>6&&(0,q.jsx)(`button`,{className:`sidebar-show-more is-indented`,type:`button`,"aria-expanded":D.has(n.path),onClick:()=>O(e=>{let t=new Set(e);return t.has(n.path)?t.delete(n.path):t.add(n.path),t}),children:t(D.has(n.path)?`sidebarShowLess`:`sidebarShowMore`)})]})]},n.path)},vn=new Map,yn=new Date,bn=new Date(yn);bn.setDate(yn.getDate()-1);for(let e of Yt){let n=new Date(kA(e)),r=n.toDateString()===yn.toDateString()?t(`sidebarToday`):n.toDateString()===bn.toDateString()?t(`sidebarYesterday`):Number.isFinite(n.getTime())?n.toLocaleDateString(void 0,{weekday:`long`}):t(`sidebarEarlier`);vn.set(r,[...vn.get(r)??[],e])}return(0,q.jsxs)(`div`,{ref:le,id:`session-sidebar`,className:`session-sidebar`,role:e.mobileOpen?`dialog`:`complementary`,"aria-modal":e.mobileOpen||void 0,"aria-label":`Session navigation`,tabIndex:e.mobileOpen?-1:void 0,onPointerDownCapture:()=>{!De.current&&!Me.current&&(Oe.current=!1)},onClickCapture:e=>{e.detail!==0&&Oe.current&&(e.preventDefault(),e.stopPropagation(),Oe.current=!1)},onKeyDown:t=>{if(!e.mobileOpen||t.defaultPrevented||t.target instanceof Element&&(t.target.closest(`dialog`)||t.key!==`Tab`&&t.target.closest(`[role="menu"]`))||t.key===`Escape`&&le.current?.querySelector(`[aria-haspopup="menu"][aria-expanded="true"]`)||(t.key===`Escape`&&!t.nativeEvent.isComposing&&(t.preventDefault(),e.actions.closeMobileSidebar()),t.key!==`Tab`))return;let n=Array.from(le.current?.querySelectorAll(`button, input, select, textarea, a[href], [tabindex]`)??[]).filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&e.checkVisibility({visibilityProperty:!0})),r=t.shiftKey?n.at(-1):n[0],i=t.shiftKey?n[0]:n.at(-1);(document.activeElement===le.current||document.activeElement===i)&&(t.preventDefault(),r?.focus())},children:[(0,q.jsxs)(`div`,{className:`sidebar-brand`,children:[(0,q.jsx)(`span`,{className:`sidebar-brand-title`,children:`OpenPI`}),(0,q.jsxs)(`div`,{className:`sidebar-header-actions`,children:[(0,q.jsx)(V,{content:t(f?`sidebarViewChats`:`sidebarViewActivity`),children:(0,q.jsxs)(`button`,{className:`icon-button sidebar-activity-toggle`,type:`button`,"aria-label":t(f?`sidebarViewChats`:`sidebarViewActivity`),"aria-pressed":f,onClick:()=>{xe(!1),p(e=>!e)},children:[(0,q.jsx)(Zo,{"aria-hidden":`true`}),Zt.length>0&&(0,q.jsx)(`span`,{className:`sidebar-unread-dot`})]})}),(0,q.jsx)(V,{content:t(`searchConversations`),children:(0,q.jsx)(`button`,{ref:se,className:`icon-button`,type:`button`,"aria-label":t(`searchConversations`),onClick:()=>d(!0),children:(0,q.jsx)(Dc,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:t(`collapseSidebar`),placement:`end`,children:(0,q.jsx)(`button`,{ref:H,className:`collapse-button sidebar-mobile-close`,type:`button`,"aria-label":t(`collapseSidebar`),onClick:()=>e.mobileOpen?e.actions.closeMobileSidebar():e.actions.toggleSidebar(!1),children:(0,q.jsx)(hc,{})})})]})]}),(0,q.jsx)(V,{content:t(`newSession`),placement:`end`,children:(0,q.jsxs)(`button`,{className:`new-session-button`,type:`button`,"aria-label":t(`newSession`),disabled:Tt,"aria-busy":Tt||void 0,onClick:()=>void sn(e.selectedWorkspace),children:[Tt?(0,q.jsx)(rc,{className:`new-session-spinner`}):(0,q.jsx)(Ae,{}),(0,q.jsx)(`span`,{children:t(`newSession`)})]})}),(0,q.jsx)(SA,{open:u,initialQuery:e.query,initialIncludeArchived:be,sessions:pe?.sessions??[],workspaces:pe?.workspaces??[],onClose:()=>d(!1),onOpenMessage:e.actions.navigateToMessage,onOpenSession:t=>e.actions.selectSession(t),onCreateSession:()=>void sn(e.selectedWorkspace)}),(0,q.jsxs)(`div`,{className:`sidebar-navigation`,children:[N&&(0,q.jsx)(`p`,{className:`sidebar-scope-note sidebar-action-feedback`,role:N.error?`alert`:`status`,children:N.message}),ze&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,role:`alert`,children:t(`sidebarSaveFailed`)}),j&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,role:`alert`,children:t(`sidebarReadFailed`)}),f?(0,q.jsxs)(`section`,{className:`sidebar-activity`,"aria-label":t(`sidebarActivity`),children:[g&&(0,q.jsxs)(`section`,{"aria-label":t(`sidebarPriority`),children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsx)(`h2`,{className:`sidebar-section-label`,children:t(`sidebarPriority`)}),hn]}),(0,q.jsx)(`ul`,{className:`sidebar-activity-sessions`,children:Jt.map(e=>gn(e))}),!Jt.length&&(0,q.jsx)(`p`,{className:`sidebar-activity-empty`,children:t(`sidebarActivityEmpty`)})]}),[...vn].map(([e,t],n)=>(0,q.jsxs)(`section`,{"aria-label":e,children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsx)(`h2`,{className:`sidebar-section-label`,children:e}),!g&&n===0&&hn]}),(0,q.jsx)(`ul`,{className:`sidebar-activity-sessions`,children:t.map(e=>gn(e))})]},e)),!g&&!vn.size&&(0,q.jsxs)(`section`,{"aria-label":t(`sidebarToday`),children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsx)(`h2`,{className:`sidebar-section-label`,children:t(`sidebarToday`)}),hn]}),(0,q.jsx)(`p`,{className:`sidebar-activity-empty`,children:t(`sidebarActivityEmpty`)})]}),Xt&&(0,q.jsx)(`div`,{ref:fe,className:`sidebar-activity-tail`,role:`status`,"aria-label":t(`loading`),children:(0,q.jsx)(rc,{"aria-hidden":`true`})})]}):(0,q.jsxs)(q.Fragment,{children:[!be&&(Pt.length>0||ke&&De.current&&Ve===`manual`)&&(0,q.jsxs)(`section`,{className:`pinned-section `+(Ne===`pinned-tail`?`is-pin-drop-after`:``),"aria-label":t(`pinnedConversations`),onDragOver:t=>{Te||Ve!==`manual`||!De.current||e.query.trim()||(t.preventDefault(),t.dataTransfer.dropEffect=`move`,Pe(`pinned-tail`),Ie(null))},onDragLeave:e=>{(!(e.relatedTarget instanceof Node)||!e.currentTarget.contains(e.relatedTarget))&&Pe(null)},onDrop:t=>{Te||Ve!==`manual`||!De.current||e.query.trim()||(t.preventDefault(),t.stopPropagation(),qe(De.current,!0,null),cn())},children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`workspace-heading-label`,"aria-expanded":!Ce||!!e.query.trim(),onClick:()=>we(e=>!e),children:[t(`pinnedConversations`),(0,q.jsx)(is,{className:Ce&&!e.query.trim()?`is-collapsed`:``,"aria-hidden":`true`})]}),(0,q.jsx)(`div`,{className:`sidebar-section-actions`,children:(0,q.jsx)(MA,{label:t(`pinnedOptions`),items:fn,alignment:`end`})})]}),ke&&Ve===`manual`&&(Pt.length===0||Ce)&&(0,q.jsx)(`p`,{className:`sidebar-drop-hint`,children:t(`sidebarDropPin`)}),(!Ce||!!e.query.trim())&&(0,q.jsx)(`ul`,{className:`pinned-sessions`,children:Pt.map(e=>e.kind===`session`?gn(e.session,!0):(0,q.jsx)(`li`,{className:`pinned-workspace`,children:_n(e.project,!0)},e.project.path))})]}),(be||He===`project`||e.searchOpen)&&(0,q.jsxs)(`div`,{className:`workspace-heading sidebar-section-heading `+(e.searchOpen?`is-searching`:``),children:[(0,q.jsxs)(`button`,{type:`button`,className:`workspace-heading-label`,"aria-label":t(be?`currentConversations`:`sidebarProjects`),"aria-expanded":be?void 0:!C||!!e.query.trim(),onClick:()=>be?xe(!1):w(e=>!e),children:[be&&(0,q.jsx)(Ko,{"aria-hidden":`true`}),t(be?`archivedConversations`:`sidebarProjects`),!be&&(0,q.jsx)(is,{className:C&&!e.query.trim()?`is-collapsed`:``,"aria-hidden":`true`})]}),(0,q.jsxs)(`div`,{className:`session-search`,children:[(0,q.jsx)(Dc,{}),(0,q.jsx)(`input`,{ref:oe,type:`search`,value:e.query,placeholder:t(`searchPlaceholder`),maxLength:be?160:void 0,"aria-label":t(`searchConversations`),onChange:t=>e.actions.setQuery(t.target.value)}),(0,q.jsx)(`button`,{type:`button`,"aria-label":t(`closeSearch`),onClick:()=>e.actions.setSearchOpen(!1),children:(0,q.jsx)(je,{})})]}),(0,q.jsxs)(`div`,{className:`workspace-actions sidebar-section-actions`,children:[!be&&(0,q.jsx)(MA,{label:t(`sidebarProjectOptions`),items:pn}),be&&(0,q.jsx)(V,{content:t(`sidebarFilterList`),children:(0,q.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":t(`sidebarFilterList`),onClick:()=>e.actions.setSearchOpen(!0),children:(0,q.jsx)(Dc,{})})}),!be&&(0,q.jsx)(V,{content:t(`addWorkspace`),children:(0,q.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":t(`addWorkspace`),onClick:()=>void e.actions.chooseWorkspace(),children:(0,q.jsx)(Ae,{})})})]})]}),e.searchOpen&&(0,q.jsxs)(`button`,{type:`button`,className:`sidebar-content-search`,onClick:()=>d(!0),children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),t(`transcriptSearch`)]}),be&&(0,q.jsxs)(`div`,{className:`sidebar-archive-actions`,children:[(0,q.jsx)(V,{content:t(`refreshArchives`),placement:`end`,children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":t(`refreshArchives`),disabled:nt,onClick:()=>void lt(),children:(0,q.jsx)(me,{"aria-hidden":`true`})})}),nt&&(0,q.jsx)(`span`,{role:`status`,children:t(`loadingArchives`)})]}),be&&ct&&(0,q.jsxs)(`div`,{className:`sidebar-scope-note`,role:`alert`,children:[(0,q.jsx)(`p`,{children:t(ct.kind===`stale`?`archiveCursorStale`:`archiveLoadFailed`)}),(0,q.jsx)(`button`,{type:`button`,disabled:nt,onClick:()=>void lt(ct.kind===`stale`?void 0:ct.cursor,ct.retainedCount),children:t(ct.kind===`stale`?`refreshArchives`:`retryArchives`)})]}),be&&!!st?.truncation.recordsUnscanned&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,children:t(`archiveScanBounded`,{count:st?.truncation.recordsUnscanned})}),!be&&nn&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,children:t(`loadedHistoryBounded`,{sessions:pe?.truncation.sessionsOmitted,workspaces:pe?.truncation.workspacesOmitted})}),be&&ht&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,role:`alert`,children:t(`restoreFailed`)}),(0,q.jsxs)(`div`,{className:`workspace-tree`,children:[(be?kt:He===`project`&&(!C||e.query.trim())?Lt:[]).map(e=>_n(e)),!be&&He===`project`&&ke&&De.current?.kind===`workspace`&&!e.query.trim()&&(0,q.jsx)(`section`,{className:`sidebar-project-tail `+(Ne===`project-tail`?`is-pin-drop-target`:``),"aria-label":t(`sidebarDropProjectLast`),onDragOver:e=>{Te||De.current?.kind!==`workspace`||(e.preventDefault(),e.dataTransfer.dropEffect=`move`,Pe(`project-tail`),Ie(null))},onDragLeave:e=>{(!(e.relatedTarget instanceof Node)||!e.currentTarget.contains(e.relatedTarget))&&Pe(null)},onDrop:t=>{if(Te||De.current?.kind!==`workspace`)return;t.preventDefault();let n=De.current;Ge(()=>e.actions.setWorkspaceOrder(n.path,null)),cn()},children:t(`sidebarDropProjectLast`)}),!be&&He===`project`&&!C&&!e.query.trim()&&It.length>6&&(0,q.jsx)(`button`,{className:`sidebar-show-more`,type:`button`,"aria-expanded":x,onClick:()=>S(e=>!e),children:t(x?`sidebarShowLess`:`sidebarShowMore`)}),!be&&(0,q.jsxs)(`section`,{className:`sidebar-recents`,"aria-label":t(`sidebarRecent`),children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`workspace-heading-label`,"aria-expanded":!T||!!e.query.trim(),onClick:()=>E(e=>!e),children:[t(`sidebarRecent`),(0,q.jsx)(is,{className:T&&!e.query.trim()?`is-collapsed`:``,"aria-hidden":`true`})]}),(0,q.jsx)(`div`,{className:`sidebar-section-actions`,children:(0,q.jsx)(MA,{label:t(`sidebarRecentOptions`),items:mn})})]}),(!T||!!e.query.trim())&&(0,q.jsx)(`ul`,{className:`recent-sessions`,children:Bt.map(e=>gn(e,!1,{key:`recent`,sessions:zt}))}),!T&&Bt.lengthA(e=>e+10),children:t(`sidebarShowMore`)})]}),(be?!kt.length:!Pt.length&&!zt.length&&(He===`list`||!It.length))&&(0,q.jsx)(`div`,{className:`empty`,hidden:be&&(nt||!!ct),children:e.query.trim()?t(be&&st?.truncation.recordsUnscanned?`noMatchingScannedArchives`:!be&&nn?`noMatchingLoaded`:`noMatching`):t(be?st?.truncation.recordsUnscanned?`noScannedArchives`:`noArchivedSessions`:`noSessions`)}),be&&st?.nextCursor&&ct?.kind!==`stale`&&(0,q.jsx)(`button`,{type:`button`,className:`sidebar-archive-more`,disabled:nt,onClick:()=>void lt(st.nextCursor),children:t(`moreArchives`)})]})]})]}),(0,q.jsx)(`div`,{className:`sidebar-footer`,children:(0,q.jsx)(V,{content:t(`settings`),placement:`above`,children:(0,q.jsxs)(`button`,{className:`sidebar-settings-button`,type:`button`,"aria-label":t(`settings`),"data-provider-settings-trigger":!0,disabled:e.settingsDisabled,onClick:e.onOpenSettings,children:[(0,q.jsx)(Ac,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:t(`settings`)})]})})}),(0,q.jsx)(Se,{isOpen:!!c,onOpenChange:e=>!e&&!yt.current&&l(null),purpose:`form`,width:400,"aria-label":c?.kind===`workspace`?t(`renameWorkspace`):t(`renameConversation`),children:(0,q.jsxs)(`form`,{className:`openpi-dialog`,onSubmit:e=>{e.preventDefault(),an()},children:[(0,q.jsx)(`strong`,{children:c?.kind===`workspace`?t(`renameWorkspace`):t(`renameConversation`)}),(0,q.jsx)(`input`,{ref:ce,value:ne,maxLength:80,disabled:_t,"aria-label":c?.kind===`workspace`?t(`workspaceName`):t(`conversationName`),onChange:e=>re(e.target.value)}),ie&&(0,q.jsx)(`p`,{className:`sidebar-dialog-error`,role:`alert`,children:t(`renameFailed`)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:_t,onClick:()=>{yt.current||l(null)},children:t(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,className:`primary`,disabled:_t||!ne.trim()||ne.trim()===c?.name,children:t(_t?`savingName`:`save`)})]})]})}),o&&(0,q.jsx)(CA,{workspace:o,client:ye,actions:e.actions,connected:e.connected!==!1,onClose:()=>{s(null),a.current?.()}},o),(0,q.jsx)(Se,{isOpen:!!z,onOpenChange:e=>!e&&!St.current&&B(null),purpose:`form`,width:440,"aria-label":t(`removeWorkspace`),children:(0,q.jsxs)(`div`,{className:`openpi-dialog`,children:[(0,q.jsx)(`strong`,{children:t(`removeWorkspace`)}),(0,q.jsx)(`p`,{className:`sidebar-dialog-path`,children:z?.path}),(0,q.jsxs)(`p`,{children:[z?.name,`:`,t(`workspaceDeleteConfirm`)]}),Ct&&(0,q.jsx)(`p`,{className:`sidebar-dialog-error`,role:`alert`,children:t(`workspaceRemoveFailed`)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:bt,onClick:()=>{St.current||B(null)},children:t(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`danger`,disabled:bt,onClick:()=>void on(),children:t(bt?`removingWorkspace`:`removeWorkspace`)})]})]})})]})}var PA=(0,K.createContext)(null);PA.displayName=`LayoutAreaContext`;var FA=(0,K.createContext)({hasHeader:!1,hasFooter:!1,hasStart:!1,hasEnd:!1});FA.displayName=`LayoutSlotsContext`;var IA={center:{kGNEyG:`x6s0dn4`,$$css:!0},end:{kGNEyG:`xuk3077`,$$css:!0},start:{kGNEyG:`x1cy8zhl`,$$css:!0},stretch:{kGNEyG:`x1qjc9v5`,$$css:!0}},LA={start:{kjj79g:`x1nhvcw1`,$$css:!0},center:{kjj79g:`xl56j7k`,$$css:!0},end:{kjj79g:`x13a6bvl`,$$css:!0},between:{kjj79g:`x1qughib`,$$css:!0},around:{kjj79g:`x1l1ennw`,$$css:!0},evenly:{kjj79g:`xaw8158`,$$css:!0}},RA={horizontal:{kXwgrk:`x1q0g3np`,$$css:!0},vertical:{kXwgrk:`xdt5ytf`,$$css:!0}},zA={nowrap:{kwnvtZ:`xozqiw3`,$$css:!0},wrap:{kwnvtZ:`x1a02dak`,$$css:!0},"wrap-reverse":{kwnvtZ:`x8hhl5t`,$$css:!0}},BA={stack:{k1xSpc:`x78zum5`,$$css:!0}},VA={0:{k1C7PZ:`x1o57wo1`,khm7nJ:`x6yxi7o`,$$css:!0},1:{k1C7PZ:`x1lfs0n9`,khm7nJ:`x1ngg2t4`,$$css:!0},2:{k1C7PZ:`xak3so`,khm7nJ:`x1x7z4sm`,$$css:!0},3:{k1C7PZ:`xewh9hi`,khm7nJ:`x4olc9o`,$$css:!0},4:{k1C7PZ:`xty4p9g`,khm7nJ:`xtx9w7w`,$$css:!0},5:{k1C7PZ:`x1eqhezk`,khm7nJ:`x1iu6piu`,$$css:!0},6:{k1C7PZ:`x3qlgwd`,khm7nJ:`xczp1bk`,$$css:!0},8:{k1C7PZ:`xicv188`,khm7nJ:`xgx0vcf`,$$css:!0},10:{k1C7PZ:`x1p37tyl`,khm7nJ:`x1xpicb7`,$$css:!0},"0.5":{k1C7PZ:`x1kihgfc`,khm7nJ:`x1tw44j4`,$$css:!0},"1.5":{k1C7PZ:`x1thn6ci`,khm7nJ:`xhq53yo`,$$css:!0}};function HA({crossAlign:e,direction:t,gap:n,mainAlign:r,wrap:i}){return[BA.stack,RA[t],n!=null&&VA[n],e!=null&&IA[e],r!=null&&LA[r],i!=null&&zA[i]]}var UA={reset:{kAzted:`x2lwn1j`,k7Eaqz:`xeuugli`,$$css:!0}},WA={center:{kSGwAc:`xamitd3`,$$css:!0},end:{kSGwAc:`xpvyfi4`,$$css:!0},start:{kSGwAc:`xqcrz7y`,$$css:!0},stretch:{kSGwAc:`xkh2ocl`,$$css:!0}},GA={fill:{kzQI83:`x1iyjqo2`,$$css:!0},static:{kzQI83:`x1c4vz4f`,kmuXW:`x2lah0s`,$$css:!0}};function KA({crossAlignSelf:e,size:t}={}){return[UA.reset,GA[t??`static`],e!=null&&WA[e]]}var qA={layoutOuter:{keTefX:`xojxgvx`,k71WvV:`x1fcf3bl`,keoZOQ:`x1sa9bsh`,k1K539:`x6h7pi7`,$$css:!0},layoutInner:{"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0},fill:{kZKoxP:`x12qplqi`,kskxy:`xenllk4`,$$css:!0},auto:{kAzted:`x1us19tq`,$$css:!0},middle:{kUk6DE:`x98rzlu`,kAzted:`x2lwn1j`,$$css:!0},fullBleed:{"--layout-padding-outer-x":`x1wbjvqu`,"--layout-padding-outer-y":`xzxxx64`,$$css:!0}},JA={kzqmXN:`xh8yej3`,kUOVxO:`xvueqy4`,$$css:!0},YA={contentWidthVar:e=>[{"--layout-content-width":(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`x4906uf`,$$css:!0},{"--x---layout-content-width":(typeof e==`number`?`${e}px`:e)==null?void 0:typeof e==`number`?`${e}px`:e}],contentWidth:e=>[JA,{ks0D6T:(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`xf68679`,$$css:!0},{"--x-maxWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(typeof e==`number`?`${e}px`:e)}]};function XA({area:e,children:t}){return t==null?null:(0,q.jsx)(PA,{value:e,children:t})}var ZA={"x-default-marker":`x-default-marker`,$$css:!0};function QA({children:e,content:t,contentWidth:n,defaultHasDividers:r,end:i,footer:a,header:o,height:s=`fill`,padding:c,ref:l,start:u,xstyle:d,className:f,style:p}){let m=s===`fill`,h=t??e,g=(0,K.useMemo)(()=>r==null?null:{defaultHasDividers:r},[r]),_=o!=null,v=a!=null,y=u!=null,x=i!=null,S=(0,K.useMemo)(()=>({hasHeader:_,hasFooter:v,hasStart:y,hasEnd:x}),[_,v,y,x]),C=(0,q.jsx)(FA,{value:S,children:(0,q.jsx)(`div`,{ref:l,...H(O(`layout`,{height:s}),w(qA.layoutOuter,m?qA.fill:qA.auto,d),f,p),children:(0,q.jsxs)(`div`,{...w(ZA,qA.layoutInner,...HA({direction:`vertical`}),m?qA.fill:qA.auto,c===0&&qA.fullBleed,c!=null&&oe[c],c!=null&&b[c],n!=null&&YA.contentWidthVar(n)),children:[(0,q.jsx)(XA,{area:`header`,children:o}),(0,q.jsxs)(`div`,{...w(...HA({direction:`horizontal`}),qA.middle,n!=null&&YA.contentWidth(n)),children:[(0,q.jsx)(XA,{area:`start`,children:u}),(0,q.jsx)(`div`,{...w(...KA({size:`fill`})),children:(0,q.jsx)(XA,{area:`content`,children:h})}),(0,q.jsx)(XA,{area:`end`,children:i})]}),(0,q.jsx)(XA,{area:`footer`,children:a})]})})});return g==null?C:(0,q.jsx)(iO,{value:g,children:C})}QA.displayName=`Layout`;var $A={content:{kB7OPa:`x9f619`,kZKoxP:`x5yr21d`,kUk6DE:`x98rzlu`,kAzted:`x2lwn1j`,kVQacm:`x7giv3`,kZCmMZ:`xwjyata`,kwRFfy:`x1peupej`,kLKAdn:`xqty4a x1ioh5az`,kGO01o:`xg476vw xsg11nj`,"--container-padding-inline-start":`x408pgh`,"--container-padding-inline-end":`xikqloz`,"--container-padding-block-start":`xjmgx01`,"--container-padding-block-end":`xi9ns85`,$$css:!0},noStart:{kZCmMZ:`x139j0dd`,"--container-padding-inline-start":`xdvaxxn`,"--container-padding-inline-end":`xqpvj4r`,$$css:!0},noEnd:{kwRFfy:`xpc6k2p`,$$css:!0},noHeader:{kLKAdn:`x81pis9`,"--container-padding-block-start":`xzz8v79`,$$css:!0},noFooter:{kGO01o:`xon7vh3`,"--container-padding-block-end":`x1xjq73n`,$$css:!0},scrollable:{kVQacm:`xysyzu8`,$$css:!0},fullBleed:{kZCmMZ:`x1c1uobl`,kwRFfy:`xyri2b`,kLKAdn:`xexx8yu`,kGO01o:`x18d9i69`,"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0}};function ej({children:e,isScrollable:t=!0,padding:n,label:r,role:i,xstyle:a,className:s,style:c,ref:l,...u}){let{hasHeader:d,hasFooter:f,hasStart:p,hasEnd:m}=(0,K.use)(FA),h=n===0;return(0,q.jsx)(`div`,{ref:l,role:i,"aria-label":r,...H(O(`layout-content`),w($A.content,!p&&!h&&n==null&&$A.noStart,!m&&!h&&n==null&&$A.noEnd,!d&&!h&&n==null&&$A.noHeader,!f&&!h&&n==null&&$A.noFooter,t&&$A.scrollable,h&&$A.fullBleed,n!=null&&I[n],n!=null&&o[n],n!=null&&y[n],n!=null&&se[n],a),s,c),...u,children:e})}ej.displayName=`LayoutContent`;var tj={footer:{kmuXW:`x2lah0s`,$$css:!0},inner:{kB7OPa:`x9f619`,ks0D6T:`xjl2t3p`,kUOVxO:`xvueqy4`,kZCmMZ:`x139j0dd`,kwRFfy:`xpc6k2p`,kLKAdn:`xqty4a`,kGO01o:`xon7vh3`,"--container-padding-inline-start":`xdvaxxn`,"--container-padding-inline-end":`xqpvj4r`,"--container-padding-block-start":`xjmgx01`,"--container-padding-block-end":`x1xjq73n`,$$css:!0},fullBleed:{kZCmMZ:`x1c1uobl`,kwRFfy:`xyri2b`,kLKAdn:`xexx8yu`,kGO01o:`x18d9i69`,"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0},divider:{kEafiO:`x178xt8z`,kPef9Z:`x13fuv20`,kLZC3w:`x1pc3f07`,$$css:!0}},nj={sizing:e=>[{kZKoxP:e==null?e:`x16ye13r`,$$css:!0},{"--x-height":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]};function rj({children:e,hasDivider:t,height:n,label:r,padding:i,role:a,xstyle:s,className:c,style:l,ref:u,...d}){let f=(0,K.use)(iO),p=t??f?.defaultHasDividers??!1,m=i===0;return(0,q.jsx)(`div`,{ref:u,role:a,"aria-label":r,"data-divider":p||void 0,...H(O(`layout-footer`),w(tj.footer,nj.sizing(n??null),p&&tj.divider,s),c,l),...d,children:(0,q.jsx)(`div`,{...w(tj.inner,m&&tj.fullBleed,i!=null&&I[i],i!=null&&o[i],i!=null&&y[i],i!=null&&se[i]),children:e})})}rj.displayName=`LayoutFooter`;var ij={scrollable:{kVQacm:`xysyzu8`,$$css:!0}};function aj({direction:e=`vertical`,hAlign:t,vAlign:n,justify:r,align:i,gap:o,padding:c,paddingInline:l,paddingInlineStart:u,paddingInlineEnd:d,paddingBlock:f,paddingBlockStart:p,paddingBlockEnd:m,isScrollable:h,width:_,height:v,maxWidth:y,minHeight:b,wrap:x,as:S=`div`,xstyle:C,className:T,style:E,children:D,ref:k,...A}){let j=t??(e===`horizontal`?r:i),M=n??(e===`horizontal`?i:r),N=e===`horizontal`?j:M,P=e===`horizontal`?M:j,F=u??l??c,I=d??l??c,L=p??f??c,R=m??f??c,te=w(...HA({direction:e,crossAlign:P,mainAlign:N,gap:o,wrap:x}),F!=null&&a[F],I!=null&&ee[I],L!=null&&g[L],R!=null&&s[R],h&&ij.scrollable,C),z={..._!=null&&{width:typeof _==`number`?`${_}px`:_},...v!=null&&{height:typeof v==`number`?`${v}px`:v},...y!=null&&{maxWidth:typeof y==`number`?`${y}px`:y},...b!=null&&{minHeight:typeof b==`number`?`${b}px`:b}};return(0,K.createElement)(S,{ref:k,...H(O(`stack`,{direction:e,gap:o,wrap:x}),te,T,{...E,...z}),...A},D)}aj.displayName=`Stack`;function oj({ref:e,justify:t,align:n,hAlign:r,vAlign:i,...a}){return(0,q.jsx)(aj,{...a,direction:`horizontal`,hAlign:r??t,vAlign:i??n,ref:e})}oj.displayName=`HStack`;function sj({ref:e,justify:t,align:n,hAlign:r,vAlign:i,...a}){return(0,q.jsx)(aj,{...a,direction:`vertical`,hAlign:r??n,vAlign:i??t,ref:e})}sj.displayName=`VStack`;var cj=`(max-width: 640px)`,lj={action:{ks0D6T:`x193iq5w`,k7Eaqz:`xeuugli`,$$css:!0},stackedAction:{kzqmXN:`xh8yej3`,$$css:!0}};function uj({ref:e,isOpen:t,isInline:n,onOpenChange:r,title:i,description:a,cancelLabel:o,actionLabel:s,actionVariant:c=`destructive`,isActionLoading:l,onAction:u,width:d=400,xstyle:f,className:p,style:m,"data-testid":h,...g}){let _=jr(),v=o??_(`@astryx.alertDialog.cancel`),y=(0,K.useId)(),b=(0,K.useId)(),x=Hi(cj),S=(0,K.useCallback)(()=>{r(!1)},[r]),C=[lj.action,x&&lj.stackedAction],w=(0,q.jsx)(Br,{variant:`ghost`,label:v,onClick:S,xstyle:C,"data-autofocus":!0},`cancel`),T=(0,q.jsx)(Br,{variant:c,label:s,onClick:u,isLoading:l,xstyle:C},`action`);return(0,q.jsx)(Se,{...g,ref:e,isOpen:t,isInline:n,onOpenChange:r,width:d,purpose:`form`,role:n?`group`:`alertdialog`,"aria-labelledby":y,"aria-describedby":b,...H(O(`alert-dialog`),{className:p,style:m}),xstyle:f,"data-testid":h,children:(0,q.jsx)(QA,{content:(0,q.jsxs)(ej,{children:[(0,q.jsx)(sO,{level:2,id:y,children:i}),(0,q.jsx)(jt,{type:`body`,color:`secondary`,id:b,children:a})]}),footer:(0,q.jsx)(rj,{children:(0,q.jsx)(aj,{direction:x?`vertical`:`horizontal`,gap:2,hAlign:x?`stretch`:`end`,wrap:x?`nowrap`:`wrap`,children:x?[T,w]:[w,T]})})})})}uj.displayName=`AlertDialog`;var dj={x1iwu4tg:`x1iwu4tg`,$$css:!0},fj={sm:{kzqmXN:`x1td3qas`,kZKoxP:`x1qx5ct2`,$$css:!0},md:{kzqmXN:`x100vrsf`,kZKoxP:`xxk0z11`,$$css:!0}},pj={sm:{kzqmXN:`x1td3qas`,kZKoxP:`x1qx5ct2`,$$css:!0},md:{kzqmXN:`x100vrsf`,kZKoxP:`xxk0z11`,$$css:!0}},mj={sm:{kzqmXN:`x1td3qas`,kZKoxP:`x1qx5ct2`,kmVPX3:`x1i3ajwb`,$$css:!0},md:{kzqmXN:`x100vrsf`,kZKoxP:`xxk0z11`,kmVPX3:`xfawy5m`,$$css:!0}},hj={sm:{kzqmXN:`x6jxa94`,kZKoxP:`x1v9usgg`,k3aq6I:`xbryuvx`,$$css:!0},md:{kzqmXN:`x1kky2od`,kZKoxP:`xlup9mm`,k3aq6I:`xbryuvx`,$$css:!0}},gj={sm:{kzqmXN:`x1kky2od`,kZKoxP:`xlup9mm`,k3aq6I:`xv5t66b xi9aj42`,$$css:!0},md:{kzqmXN:`xw4jnvo`,kZKoxP:`x1qx5ct2`,k3aq6I:`x15481yp x12xz5k6`,$$css:!0}},_j={sm:{kAzted:`xisnujt`,$$css:!0},md:{kAzted:`xjwf9q1`,$$css:!0}},vj={container:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`x1txdalj`,$$css:!0},containerLabelHidden:{kOIVth:`xxhr3t`,$$css:!0},containerSpread:{kjj79g:`x1qughib`,kzqmXN:`xh8yej3`,$$css:!0},statusGap:{keoZOQ:`xtbrsbv`,$$css:!0},switchWrapper:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kmuXW:`x2lah0s`,kHBbk8:`xc8icb0`,$$css:!0},input:{kVAEAm:`x10l6tqk`,kogj98:`x1ghz6dp`,kmVPX3:`x1717udv`,kSiTet:`xg01cxk`,kkrTdU:`x1ypdohk x16khyan`,kY2c9j:`x1vjfegm`,k7Eaqz:`xkagaj0`,kAzted:`x80b3aj`,k87sOh:`xijlfn0`,kLqNvP:`x1hsn8va`,k3aq6I:`x8i4i9p`,$$css:!0},inputDisabled:{kkrTdU:`xt0e3qv`,$$css:!0},inputBusy:{kfzvcC:`x47corl`,$$css:!0},track:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kaIpWk:`xjspbzw`,k1ekBW:`x15406qy`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,kB7OPa:`x9f619`,kMzoRj:`xc342km x13rsnn2`,ksu8eU:`xng3xce xx61lck`,kVAM5u:`x1w1tqly`,$$css:!0},trackFocus:{kI3sdo:`x1a2a7pz xafswnp`,kInvED:`xwz5zln`,$$css:!0},trackOff:{kWkggS:`xspzpui x1a8ae7b x9yvj25`,$$css:!0},trackOn:{kWkggS:`x1ewilqj xcgwt1n x1jzqe4`,$$css:!0},trackDisabled:{kSiTet:`xbyyjgo`,kVAM5u:`xmnqt3w`,$$css:!0},trackDisabledOff:{kWkggS:`xspzpui`,$$css:!0},thumb:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kaIpWk:`xjspbzw`,k1ekBW:`xh3q6i0`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,$$css:!0},thumbOff:{kWkggS:`x10xzikg xwvh9j7`,$$css:!0},thumbOn:{kWkggS:`x10xzikg x1sir5s4`,$$css:!0},labelWrapper:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,kjj79g:`xl56j7k`,$$css:!0}},yj={width:e=>[{kzqmXN:e==null?e:`x5lhr3w`,$$css:!0},{"--x-width":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]};function bj({label:e,isLabelHidden:t=!1,description:n,onChange:r,changeAction:i,isLoading:a=!1,value:o,isDisabled:s=!1,htmlName:c,disabledMessage:l,isOptional:u=!1,isRequired:d=!1,onFocus:f,onBlur:p,labelIcon:m,labelTooltip:h,labelPosition:g=`end`,labelSpacing:_=`hug`,status:v,size:y=`md`,width:b,xstyle:x,className:S,style:C,ref:T,...E}){let D=(0,K.useId)(),k=(0,K.useId)(),A=(0,K.useId)(),j=YO({isRequired:d,isOptional:u}),[,M]=(0,K.useTransition)(),[N,P]=(0,K.useOptimistic)(o),I=a||N!==o,ee=N===!0,L=s&&!!l,R=F({placement:`above`,focusTrigger:`always`,isEnabled:L}),te=[];n&&te.push(k),v?.message&&te.push(A),L&&te.push(R.describedBy);let z=te.length>0?te.join(` `):void 0,B=(0,q.jsxs)(`div`,{...w(vj.switchWrapper,fj[y]),children:[(0,q.jsx)(`input`,{ref:we(T,R.positionRef),id:D,type:`checkbox`,role:`switch`,name:s?void 0:c,checked:ee,disabled:s&&!L,"aria-disabled":L?`true`:void 0,form:L?``:void 0,required:d,"aria-required":j?`true`:void 0,onChange:e=>{if(s||I)return;let t=e.target.checked;r?.(t,e),i&&!e.defaultPrevented&&M(async()=>{P(t),await i(t,e)})},onFocus:f,onBlur:p,"aria-describedby":z,"aria-invalid":v?.type===`error`||void 0,"aria-busy":I||void 0,...w(vj.input,pj[y],s&&vj.inputDisabled,I&&vj.inputBusy)}),(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(O(`switch`,{checked:ee?`checked`:null,disabled:s?`disabled`:null,size:y}),w(vj.track,mj[y],ee?vj.trackOn:vj.trackOff,!s&&vj.trackFocus,s&&vj.trackDisabled,s&&!ee&&vj.trackDisabledOff)),children:(0,q.jsx)(`div`,{...H(O(`switch-thumb`,{checked:ee?`checked`:null,size:y}),w(vj.thumb,ee?gj[y]:hj[y],ee?vj.thumbOn:vj.thumbOff)),children:I&&(0,q.jsx)(Gt,{size:`sm`})})}),I&&(0,q.jsx)(Kt,{role:`status`,children:`Loading`})]}),ne=(0,q.jsx)(`div`,{...w(vj.labelWrapper,_j[y]),children:(0,q.jsx)(MO,{...O(`switch-label`),label:e,inputID:D,isLabelHidden:t,isDisabled:s,isOptional:u,isRequired:d,labelIcon:m,labelTooltip:h,description:n,descriptionID:k})});return(0,q.jsxs)(`div`,{...H(O(`switch-field`,{labelPosition:g===`end`?void 0:g,labelSpacing:_===`hug`?void 0:_}),w(b!=null&&yj.width(b),x),S,C),...E,children:[(0,q.jsxs)(`div`,{ref:e=>{R.interactionRef(e)},...w(vj.container,t&&vj.containerLabelHidden,_===`spread`&&vj.containerSpread,!s&&dj),children:[` `,g===`start`?(0,q.jsxs)(q.Fragment,{children:[ne,B]}):(0,q.jsxs)(q.Fragment,{children:[B,ne]})]}),v?.message&&(0,q.jsx)(IO,{type:v.type,message:v.message,id:A,variant:`detached`,xstyle:vj.statusGap}),L&&R.renderTooltip(l)]})}bj.displayName=`Switch`;var xj=[`chrome`,`edge`,`brave`,`chromium`,`safari`,`firefox`],Sj=[`embedded`,...xj],Cj=e=>xj.some(t=>t===e);function wj(){let[e,t]=(0,K.useState)(),n=(0,K.useRef)(void 0),r=(0,K.useRef)(!1),i=(0,K.useRef)(!0),a=(0,K.useRef)(void 0),o=(0,K.useCallback)(()=>{a.current?.(),a.current=void 0,n.current?.close(),n.current=void 0,i.current&&t(void 0)},[]);return(0,K.useEffect)(()=>(i.current=!0,window.addEventListener(`pagehide`,o),()=>{i.current=!1,window.removeEventListener(`pagehide`,o),o()}),[o]),{container:e,open:async()=>{if(n.current&&!n.current.closed)return n.current.focus(),!0;if(r.current)return!1;r.current=!0;try{let e=window.documentPictureInPicture,r=e?await e.requestWindow({width:460,height:740}):window.open(`about:blank`,`_blank`,`popup,width=460,height=740`);if(!r)return!1;if(!i.current)return r.close(),!1;n.current=r,r.document.title=`OpenPI Browser Bridge`;let o=()=>{r.document.documentElement.lang=document.documentElement.lang,r.document.documentElement.dataset.theme=document.documentElement.dataset.theme,r.document.documentElement.style.cssText=document.documentElement.style.cssText};o(),r.document.documentElement.classList.add(`browser-guide-window`);for(let e of document.styleSheets)try{let t=r.document.createElement(`style`);t.textContent=[...e.cssRules].map(e=>e.cssText).join(` `),r.document.head.append(t)}catch{if(!e.href)continue;let t=r.document.createElement(`link`);t.rel=`stylesheet`,t.href=e.href,r.document.head.append(t)}let s=r.document.createElement(`main`);s.className=`browser-settings browser-settings-detached`,r.document.body.append(s);let c=new MutationObserver(o);c.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`,`style`,`lang`]});let l=()=>{c.disconnect(),n.current===r&&(n.current=void 0,a.current=void 0,i.current&&t(void 0))};return r.addEventListener(`pagehide`,l,{once:!0}),a.current=()=>{c.disconnect(),r.removeEventListener(`pagehide`,l)},t(s),!0}catch{return o(),!1}finally{r.current=!1}},close:o,isOpen:()=>!!(n.current&&!n.current.closed)}}function Tj({id:e,name:t,label:n,value:r,options:i,disabled:a=!1,onChange:o,className:s,menuWidth:c=`min(300px, calc(100vw - 32px))`}){let l=i.find(e=>e.value===r);return(0,q.jsx)(yo,{button:{id:e,name:t,label:l?.label??r,"aria-label":n,variant:`secondary`,size:`sm`,className:`settings-select-menu-trigger${s?` ${s}`:``}`,isDisabled:a},className:`settings-select-menu`,menuWidth:c,alignment:`end`,children:(0,q.jsx)(Bo,{value:r,label:n,onChange:e=>{e!==r&&o(e)},children:i.map(e=>(0,q.jsx)(Ho,{value:e.value,label:e.label,isDisabled:a||e.disabled,description:e.description?(0,q.jsx)(`span`,{className:`settings-select-option-description`,children:e.description}):void 0},e.value))})})}var Ej={chrome:`Chrome`,edge:`Microsoft Edge`,brave:`Brave`,chromium:`Chromium`,safari:`Safari`,firefox:`Firefox`};function Dj({browser:e}){return(0,q.jsx)(`span`,{className:`browser-settings-mark ${e}`,"aria-hidden":`true`,children:e===`chrome`||e===`chromium`?(0,q.jsx)(`i`,{}):(0,q.jsx)(Es,{})})}function Oj({onConfigure:e,setupPending:t=!1}){let{t:n}=W(),r=wj(),i=(0,K.useRef)(r.isOpen);i.current=r.isOpen;let[a,o]=(0,K.useState)(),[s,c]=(0,K.useState)(),[l,u]=(0,K.useState)(!1),d=l||t,[f,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(),[g,_]=(0,K.useState)(`chrome`),[v,y]=(0,K.useState)(1),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(),w=(0,K.useRef)(0),T=(0,K.useRef)(null),E=(0,K.useRef)(null),D=(0,K.useRef)(!0);(0,K.useEffect)(()=>{m&&(T.current?.scrollIntoView?.({block:`start`}),E.current?.focus({preventScroll:!0}))},[m,v,r.container]);let O=(0,K.useCallback)(async()=>{let e=++w.current;try{let t=await new de().request(`/api/settings/browser`);return D.current&&e===w.current&&(o(t),c(void 0)),t}catch(t){D.current&&e===w.current&&c(t instanceof Error?t.message:String(t));return}},[]);(0,K.useEffect)(()=>{D.current=!0,O();let e=setInterval(()=>{(document.visibilityState===`visible`||i.current())&&O()},3e3),t=()=>void O();return window.addEventListener(`focus`,t),()=>{D.current=!1,clearInterval(e),window.removeEventListener(`focus`,t)}},[O]);let k=async t=>{u(!0),c(void 0),C(void 0),++w.current;try{let r=await e(`Configure browser access: ${[t.control===void 0?void 0:`browser_control=${t.control}`,t.embedded===void 0?void 0:`browser_embedded=${t.embedded}`,t.defaultBrowser===void 0?void 0:`browser_default=${JSON.stringify(t.defaultBrowser)}`,t.externalBrowsers===void 0?void 0:`browser_external=${JSON.stringify(t.externalBrowsers)}`].filter(e=>e!==void 0).join(`, `)}. Preserve all other settings.`);if(!D.current)return;if(!r)throw Error(n(`setupRequestFailed`));C(n(`setupRequestAccepted`))}catch(e){await O(),D.current&&c(e instanceof Error?e.message:String(e))}finally{D.current&&u(!1)}},A=async(e,t)=>{u(!0),c(void 0),C(void 0);try{if(await new de().request(`/api/settings/browser/action`,{method:`POST`,body:JSON.stringify({browser:e,action:t})}),D.current)return!0}catch(e){D.current&&c(e instanceof Error?e.message:String(e))}finally{D.current&&u(!1)}return!1},j=e=>e===`embedded`?n(`browserEmbedded`):Ej[e];if(!a)return(0,q.jsxs)(`div`,{className:`browser-settings-load`,role:s?`alert`:`status`,children:[(0,q.jsx)(Es,{}),(0,q.jsx)(`p`,{children:s||n(`browserLoading`)}),s&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>void O(),children:n(`browserCheck`)})]});let{config:M}=a,N=a.profiles.find(e=>e.current&&e.connected&&e.version===a.extensionVersion),P=e=>a.profiles.filter(t=>t.connected&&t.version===a.extensionVersion&&(e===`embedded`?t.current&&![`safari`,`firefox`].includes(t.browser):t.browser===e)),F=e=>e===`embedded`?M.embedded:M.externalBrowsers.includes(e),I=(e,t)=>e===`embedded`?{embedded:t}:{externalBrowsers:t?[...new Set([...M.externalBrowsers,e])]:M.externalBrowsers.filter(t=>t!==e)},ee=e=>{h(e),y(1),C(void 0),x(!1),_(e===`embedded`?N&&![`safari`,`firefox`].includes(N.browser)?N.browser:`chrome`:e)},L=e=>{let t=P(e).length>0,r=e===`embedded`||a.browsers.some(t=>t.id===e&&t.installed),i=a.profiles.some(t=>t.connected&&t.version!==a.extensionVersion&&(e===`embedded`?t.current&&![`safari`,`firefox`].includes(t.browser):t.browser===e));return(0,q.jsxs)(`div`,{className:`browser-settings-row`,children:[(0,q.jsx)(Dj,{browser:e}),(0,q.jsxs)(`div`,{className:`browser-settings-description`,children:[(0,q.jsx)(`strong`,{children:j(e)}),(0,q.jsx)(`span`,{className:t?`connected`:``,children:t?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`i`,{}),n(`browserConnected`)]}):n(i?`browserUpdateNeeded`:r?`browserNeedsSetup`:`browserNotFound`)})]}),(0,q.jsx)(`button`,{className:`browser-settings-button`,type:`button`,disabled:l,"aria-label":n(t?`browserManageNamed`:`browserSetupNamed`,{browser:j(e)}),onClick:()=>ee(e),children:n(t?`browserManage`:`browserSetUp`)}),(0,q.jsx)(bj,{label:n(`browserAllowNamed`,{browser:j(e)}),isLabelHidden:!0,size:`sm`,value:F(e),isDisabled:d,onChange:t=>void k(I(e,t))})]},e)},R=m!==void 0&&P(m).length>0,te=a.browsers.some(e=>e.id===g&&e.installed),z=g===`safari`||g===`firefox`,B=z?a.portableExtensionPath??a.extensionPath:a.extensionPath,ne=g===`firefox`?`${B.replace(/[\\/]+$/,``)}/manifest.json`:B,re=z?`browser-extension-portable`:`browser-extension`,V=g===`safari`?n(`browserSafariSettings`):g===`firefox`?`about:debugging#/runtime/this-firefox`:`${g===`edge`?`edge`:g===`brave`?`brave`:`chrome`}://extensions/`,ie=n(g===`safari`?`browserSafariDeveloper`:g===`firefox`?`browserFirefoxThis`:`browserDeveloperMode`),ae=n(g===`safari`?`browserSafariTemporary`:g===`firefox`?`browserFirefoxTemporary`:`browserLoadUnpacked`),oe=[n(`browserStepOpen`),ie,n(`browserStepAdd`),n(`browserStepConnect`)];return(0,q.jsxs)(`div`,{className:`settings-content-page browser-settings`,children:[(0,q.jsxs)(`header`,{className:`browser-settings-heading`,children:[(0,q.jsx)(`h1`,{children:n(`browserSettings`)}),(0,q.jsx)(`p`,{children:n(`browserSettingsIntro`)})]}),(0,q.jsxs)(`div`,{className:`browser-settings-card browser-settings-main-card`,children:[(0,q.jsxs)(`div`,{className:`browser-settings-control`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:n(`browserControl`)}),(0,q.jsx)(`p`,{children:n(`browserControlHint`)})]}),(0,q.jsx)(bj,{label:n(`browserControl`),isLabelHidden:!0,size:`sm`,value:M.control,isDisabled:d,onChange:e=>void k({control:e})})]}),(0,q.jsxs)(`div`,{className:`browser-settings-default`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{htmlFor:`browser-default`,children:n(`browserDefault`)}),(0,q.jsx)(`p`,{children:n(`browserDefaultHint`)})]}),(0,q.jsx)(Tj,{id:`browser-default`,label:n(`browserDefault`),value:M.defaultBrowser,disabled:d,onChange:e=>{let t=Sj.find(t=>t===e);t&&k({defaultBrowser:t})},options:Sj.map(e=>({value:e,label:`${j(e)}${F(e)?``:` · ${n(`browserBlocked`)}`}`,disabled:!F(e)}))})]})]}),!F(M.defaultBrowser)&&(0,q.jsx)(`p`,{className:`browser-settings-warning`,role:`status`,children:n(`browserDefaultBlocked`)}),(0,q.jsxs)(`div`,{className:`browser-settings-section-heading`,children:[(0,q.jsx)(`h2`,{children:n(`browserAllowedTitle`)}),(0,q.jsx)(`span`,{children:!M.control&&n(`browserOffHint`)})]}),(0,q.jsxs)(`div`,{className:`browser-settings-card`,children:[L(`embedded`),L(`chrome`),(0,q.jsxs)(`details`,{className:`browser-settings-more`,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(os,{}),n(`browserMore`)]}),xj.filter(e=>e!==`chrome`).map(L)]})]}),(0,q.jsx)(`p`,{className:`browser-settings-example`,children:n(`browserSpeakHint`)}),r.container&&(0,q.jsxs)(`div`,{className:`browser-settings-guide-placeholder`,role:`status`,children:[(0,q.jsx)(`p`,{children:n(`browserGuideDetached`)}),(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-button`,onClick:()=>void r.open(),children:n(`browserShowGuide`)}),(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-text-button`,onClick:r.close,children:n(`browserGuideInline`)})]}),m!==void 0&&(e=>r.container?(0,$c.createPortal)(e,r.container):e)((0,q.jsxs)(`section`,{ref:T,className:`browser-settings-guide`,"aria-label":n(`browserGuideTitle`,{browser:j(m)}),children:[(0,q.jsxs)(`div`,{className:`browser-settings-guide-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{children:n(R?`browserConnectionTitle`:`browserGuideEyebrow`)}),(0,q.jsx)(`h3`,{children:n(`browserGuideTitle`,{browser:j(m)})})]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:l,"aria-label":n(`browserCloseGuide`),onClick:()=>{r.close(),h(void 0)},children:(0,q.jsx)(je,{})})]}),!r.container&&!R&&(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-text-button`,onClick:async()=>{await r.open()||C(n(`browserGuideBlocked`))},children:[(0,q.jsx)(Os,{}),n(`browserGuidePopout`)]}),R?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`browser-settings-ready`,children:[(0,q.jsx)(ds,{}),n(`browserConnectionReady`)]}),(0,q.jsx)(`p`,{children:m===`embedded`?n(`browserEmbeddedDetail`):n(`browserExternalDetail`,{browser:j(m)})}),(0,q.jsxs)(`div`,{className:`browser-settings-guide-actions`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-button`,disabled:l,onClick:()=>void A(m===`embedded`?N.browser:m,`manage`),children:[n(`browserManageExtension`),(0,q.jsx)(Os,{})]}),(!F(m)||!M.control)&&(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-primary`,disabled:d,onClick:()=>void k({control:!0,...I(m,!0)}),children:n(`browserAllowUse`)}),F(m)&&M.defaultBrowser!==m&&(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-button`,disabled:d,onClick:()=>void k({defaultBrowser:m}),children:n(`browserMakeDefault`)})]})]}):(0,q.jsxs)(q.Fragment,{children:[m===`embedded`&&(0,q.jsxs)(`label`,{className:`browser-settings-install-browser`,htmlFor:`browser-install-target`,children:[n(`browserInstallIn`),(0,q.jsx)(Tj,{id:`browser-install-target`,label:n(`browserInstallIn`),value:g,disabled:l,onChange:e=>{let t=xj.find(t=>t===e);t&&(_(t),y(1),x(!1),C(void 0))},options:xj.filter(e=>![`safari`,`firefox`].includes(e)).map(e=>({value:e,label:Ej[e]}))})]}),(0,q.jsx)(`ol`,{className:`browser-settings-progress`,"aria-label":n(`browserSetupSteps`),children:oe.map((e,t)=>(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,"aria-current":v===t+1?`step`:void 0,"aria-label":n(`browserStepLabel`,{step:t+1,label:e}),disabled:l,onClick:()=>{y(t+1),C(void 0)},children:[(0,q.jsx)(`span`,{children:t+1}),e]})},e))}),(0,q.jsxs)(`div`,{className:`browser-settings-wizard`,"aria-live":`polite`,children:[(0,q.jsx)(`span`,{className:`browser-settings-step-count`,children:n(`browserStepCount`,{step:v,total:oe.length})}),(0,q.jsx)(`h4`,{ref:E,tabIndex:-1,children:n(v===1?`browserOpenManagerTitle`:v===2?g===`safari`?`browserSafariDeveloperTitle`:g===`firefox`?`browserFirefoxDeveloperTitle`:`browserDeveloperTitle`:v===3?`browserInstallTitle`:`browserConnectTitle`,{browser:Ej[g]})}),(0,q.jsx)(`p`,{children:n(v===1?g===`safari`?`browserSafariOpenHint`:`browserOpenManagerHint`:v===2?g===`safari`?`browserSafariDeveloperHint`:g===`firefox`?`browserFirefoxDeveloperHint`:`browserDeveloperHint`:v===3?g===`safari`?`browserSafariLoadHint`:g===`firefox`?`browserFirefoxLoadHint`:`browserLoadHint`:`browserConnectHint`,{browser:Ej[g],loadLabel:ae})}),v===1&&(0,q.jsxs)(`div`,{className:`browser-settings-address`,children:[(0,q.jsx)(Dj,{browser:g}),(0,q.jsx)(`code`,{children:V})]}),v===2&&(0,q.jsxs)(`figure`,{className:`browser-settings-illustration ${g}`,children:[(0,q.jsx)(`figcaption`,{children:n(`browserIllustration`,{browser:Ej[g]})}),(0,q.jsxs)(`div`,{className:`browser-settings-demo`,"aria-hidden":`true`,children:[(0,q.jsxs)(`div`,{className:`browser-settings-demo-bar`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`code`,{children:V})]}),(0,q.jsxs)(`div`,{className:`browser-settings-demo-heading`,children:[(0,q.jsx)(`span`,{children:n(`browserExtensions`)}),(0,q.jsxs)(`span`,{className:`browser-settings-demo-toggle highlight`,children:[ie,g!==`firefox`&&(0,q.jsx)(`i`,{})]})]}),(0,q.jsxs)(`div`,{className:`browser-settings-demo-toolbar`,children:[(0,q.jsx)(`span`,{children:ae}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]})]})]}),v===3&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`ol`,{className:`browser-settings-install-steps`,children:[(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{className:`browser-settings-install-label`,children:[(0,q.jsx)(`strong`,{children:n(g===`firefox`?`browserLocateManifest`:`browserLocateTarget`)}),(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-button`,disabled:l,onClick:()=>void A(g,`folder`),children:n(g===`firefox`?`browserRevealManifest`:`browserRevealTarget`)})]}),(0,q.jsxs)(`div`,{className:`browser-settings-selection`,children:[(0,q.jsx)(zs,{"aria-hidden":`true`}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:g===`firefox`?`manifest.json`:re}),(0,q.jsx)(`p`,{children:n(g===`firefox`?`browserSelectManifestHint`:`browserSelectFolderHint`)})]})]})]}),(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`strong`,{children:n(z?`browserLoadInBrowser`:`browserDragToBrowser`,{browser:Ej[g],loadLabel:ae})}),(0,q.jsx)(`p`,{children:n(z?`browserSelectLocatedTarget`:`browserDragFolderHint`,{browser:Ej[g],folder:re})}),(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-text-button`,disabled:l||!te,onClick:()=>void A(g,`manage`),children:[n(`browserOpenManager`,{browser:Ej[g]}),(0,q.jsx)(Os,{})]})]})]}),(0,q.jsxs)(`details`,{className:`browser-settings-picker-help`,children:[(0,q.jsx)(`summary`,{children:n(z?`browserManualSelection`:`browserManualInstall`)}),(0,q.jsxs)(`div`,{className:`browser-settings-install-label`,children:[(0,q.jsx)(`strong`,{children:n(`browserCopyLocation`)}),(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-button`,onClick:async e=>{let t=await td(ne,e.currentTarget.ownerDocument);x(t),C(t?void 0:n(`browserCopyFailed`))},children:[b?(0,q.jsx)(rs,{}):(0,q.jsx)(Ss,{}),n(b?`browserPathCopied`:`browserCopyPath`)]})]}),(0,q.jsx)(`code`,{className:`browser-settings-install-path`,children:ne}),(0,q.jsx)(`p`,{children:n(`browserLoadInBrowser`,{browser:Ej[g],loadLabel:ae})}),!z&&(0,q.jsx)(`p`,{children:n(`browserLoadAlternate`)}),(0,q.jsx)(`p`,{children:n(navigator.userAgent.includes(`Mac`)?`browserChooseFolderMac`:`browserChooseFolderOther`,{confirm:n(g===`firefox`?`browserConfirmFile`:`browserConfirmFolder`)})})]}),(0,q.jsx)(`p`,{className:`browser-settings-install-checkpoint`,children:n(`browserInstallCheckpoint`)})]}),v===4&&(0,q.jsxs)(`div`,{className:`browser-settings-waiting`,role:`status`,children:[(0,q.jsx)(me,{}),(0,q.jsx)(`span`,{children:n(`browserWaiting`)})]}),!te&&(0,q.jsx)(`p`,{className:`browser-settings-warning`,children:n(`browserInstallBrowserFirst`,{browser:Ej[g]})}),(0,q.jsxs)(`div`,{className:`browser-settings-wizard-actions`,children:[v>1&&(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-button`,disabled:l,onClick:()=>{y(v-1),C(void 0)},children:[(0,q.jsx)(Ko,{}),n(`browserPreviousStep`)]}),v===1&&(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-text-button`,disabled:l,onClick:()=>y(4),children:n(`browserAlreadyInstalled`)}),v<4?(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-primary`,disabled:l||!te,onClick:async()=>{(v===2||await A(g,v===1?`manage`:`connect`))&&y(v+1)},children:[n(l?`browserOpening`:v===1?`browserOpenManager`:v===2?g===`firefox`?`browserFirefoxDone`:`browserDeveloperDone`:`browserInstalledConnect`,{browser:Ej[g]}),v===2?(0,q.jsx)(qo,{}):(0,q.jsx)(Os,{})]}):(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-primary`,disabled:l||f,onClick:async()=>{p(!0);let e=await O();if(D.current){p(!1);let t=e?.profiles.some(t=>t.connected&&t.version===e.extensionVersion&&(m===`embedded`?t.current&&![`safari`,`firefox`].includes(t.browser):t.browser===m));C(n(t?`browserConnectionReady`:`browserNotConnectedYet`))}},children:[(0,q.jsx)(me,{className:f?`settings-spin`:``}),n(`browserCheck`)]})]}),v===4?(0,q.jsxs)(`div`,{className:`browser-settings-connect-help`,children:[(0,q.jsx)(`p`,{children:n(`browserAllowHint`)}),(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-text-button`,disabled:l||!te,onClick:()=>void A(g,`connect`),children:[n(`browserOpenIn`,{browser:Ej[g]}),(0,q.jsx)(Os,{})]})]}):v===2&&(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-text-button`,disabled:l||!te,onClick:()=>void A(g,`manage`),children:[n(`browserReopenManager`),(0,q.jsx)(Os,{})]})]})]}),(0,q.jsxs)(`details`,{className:`browser-settings-help`,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(is,{}),n(`browserHelp`)]}),(0,q.jsx)(`p`,{children:n(`browserReloadHint`)}),(0,q.jsx)(`p`,{children:n(`browserSupportedHint`)})]}),s&&(0,q.jsx)(`div`,{className:`browser-settings-error`,role:`alert`,children:s}),(0,q.jsx)(`div`,{className:`browser-settings-feedback`,role:`status`,"aria-live":`polite`,children:l?n(`browserSaving`):S})]})),!m&&s&&(0,q.jsxs)(`div`,{className:`browser-settings-error`,role:`alert`,children:[s,(0,q.jsx)(`button`,{type:`button`,onClick:()=>void O(),children:n(`browserCheck`)})]}),(0,q.jsx)(`div`,{className:`browser-settings-feedback`,role:`status`,"aria-live":`polite`,children:!m&&(l?n(`browserSaving`):S)})]})}function kj({label:e,value:t,options:n,disabled:r,onChange:i}){return(0,q.jsx)(yo,{button:{label:n.find(e=>e.value===t)?.label??t,"aria-label":e,variant:`secondary`,size:`sm`,className:`configuration-menu-trigger`,isDisabled:r},className:`configuration-menu`,menuWidth:`min(360px, calc(100vw - 32px))`,alignment:`end`,items:n.map(e=>({id:e.value,label:e.label,isDisabled:r,description:e.description?(0,q.jsx)(`span`,{className:`configuration-option-description`,children:e.description}):void 0,endContent:t===e.value?(0,q.jsx)(`span`,{className:`settings-select-check`,"aria-hidden":`true`,children:(0,q.jsx)(rs,{})}):void 0,onClick:()=>{e.value!==t&&i(e.value)}}))})}function Aj({catalog:e,error:t,pending:n,preferencePending:r,onConfigure:i,onUpdatePreferences:a,onRefresh:o,onOpenRuntimeStatus:s}){let{t:c}=W(),l=e?.setupWritable===!1||!!e?.resources.diagnostics.settingsErrors,u=n||r||!!t||!!e?.resources.diagnostics.settingsErrors,d=e?.setup.ui.webHiddenThinkingLevels??[],f=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],p=e?.setup.response?.verbosity??`default`,m=e?.setup.response?.reasoningSummary??`default`;return(0,q.jsxs)(`section`,{className:`settings-content-page settings-configuration-panel`,children:[(0,q.jsxs)(`header`,{className:`settings-page-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:c(`configurationSettings`)}),(0,q.jsx)(`p`,{children:c(`configurationIntro`)})]}),(0,q.jsx)(`button`,{type:`button`,"aria-label":c(`refreshStatus`),onClick:o,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]}),t&&(0,q.jsx)(`p`,{className:`inspection-warning`,role:`alert`,children:t}),!e&&!t&&(0,q.jsx)(`p`,{role:`status`,children:c(`settingsCatalogLoading`)}),l&&(0,q.jsxs)(`p`,{className:`inspection-warning`,role:`alert`,children:[c(`configurationReadFailure`),e?.setupDiagnostics?.map(e=>(0,q.jsxs)(`span`,{children:[e.path,`: `,e.message]},`${e.path}:${e.message}`))]}),e&&!l&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`configuration-scope`,children:[(0,q.jsxs)(`span`,{className:`configuration-scope-label`,children:[(0,q.jsx)(qc,{"aria-hidden":`true`}),c(`configurationUserScope`)]}),(0,q.jsx)(`span`,{children:c(`configurationSetupHint`)})]}),(0,q.jsxs)(`div`,{className:`configuration-group`,children:[(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationApproval`)}),(0,q.jsx)(`p`,{children:c(`configurationApprovalDetail`)})]}),(0,q.jsx)(`span`,{className:`configuration-readonly`,children:c(`configurationPiPermissions`)})]}),(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationSandbox`)}),(0,q.jsx)(`p`,{children:c(`configurationSandboxDetail`)})]}),(0,q.jsx)(`span`,{className:`configuration-readonly`,children:c(`configurationSandboxUnavailable`)})]}),(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`webSearchSettings`)}),(0,q.jsx)(`p`,{children:c(`configurationSearchDetail`)}),e.webSearch?.available!==!0&&(0,q.jsx)(`p`,{children:c(`webSearchUnsupported`)})]}),(0,q.jsx)(`div`,{className:`configuration-control`,children:(0,q.jsx)(kj,{label:c(`webSearchSettings`),value:e.setup.webSearch?.enabled===!0?`on`:`off`,options:[{value:`off`,label:c(`disabled`),description:c(`configurationSearchOff`)},{value:`on`,label:c(`enabled`),description:c(`configurationSearchOn`)}],disabled:u,onChange:e=>{i(c(e===`on`?`webSearchNativeRequest`:`webSearchDisableRequest`))}})})]}),(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationVerbosity`)}),(0,q.jsx)(`p`,{children:c(`configurationVerbosityDetail`)}),e.responseSupport?.verbosity!==!0&&(0,q.jsx)(`p`,{children:c(`configurationResponsesUnavailable`)})]}),(0,q.jsx)(`div`,{className:`configuration-control`,children:(0,q.jsx)(kj,{label:c(`configurationVerbosity`),value:p,options:[`default`,`low`,`medium`,`high`].map(e=>({value:e,label:c(`configurationVerbosity_${e}`),description:e==="default"?void 0:c(`configurationVerbosityHelp_${e}`)})),disabled:u||e.responseSupport?.verbosity!==!0,onChange:e=>{i(c(`configurationVerbosityRequest`,{value:e}))}})})]}),(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationSummary`)}),(0,q.jsx)(`p`,{children:c(`configurationSummaryDetail`)}),e.responseSupport?.reasoningSummary!==!0&&(0,q.jsx)(`p`,{children:c(`configurationSummaryUnavailable`)})]}),(0,q.jsx)(`div`,{className:`configuration-control`,children:(0,q.jsx)(kj,{label:c(`configurationSummary`),value:m,options:[`default`,`auto`,`concise`,`detailed`,`none`].map(e=>({value:e,label:c(`configurationSummary_${e}`),description:e==="default"?void 0:c(`configurationSummaryHelp_${e}`)})),disabled:u||e.responseSupport?.reasoningSummary!==!0,onChange:e=>{i(c(`configurationSummaryRequest`,{value:e}))}})})]})]}),(0,q.jsxs)(`section`,{className:`configuration-section`,children:[(0,q.jsx)(`h2`,{children:c(`configurationModelFeatures`)}),(0,q.jsx)(`div`,{className:`configuration-group`,children:(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationReasoningLevels`)}),(0,q.jsx)(`p`,{children:c(`configurationReasoningDetail`)})]}),(0,q.jsx)(`div`,{className:`configuration-control`,children:(0,q.jsx)(yo,{button:{label:c(`configurationReasoningCount`,{count:f.filter(e=>!d.includes(e)).length}),"aria-label":c(`configurationReasoningLevels`),variant:`secondary`,size:`sm`,className:`configuration-menu-trigger`,isDisabled:u},className:`configuration-level-menu`,menuWidth:`min(240px, calc(100vw - 32px))`,alignment:`end`,children:f.map(e=>(0,q.jsx)(Ro,{label:e,value:!d.includes(e),isDisabled:u,endContent:(0,q.jsx)(`span`,{className:`configuration-check`,children:!d.includes(e)&&(0,q.jsx)(rs,{"aria-hidden":`true`})}),onChange:t=>{a({thinkingLevelVisibility:{level:e,visible:t}})}},e))})})]})})]}),(0,q.jsxs)(`section`,{className:`configuration-section`,children:[(0,q.jsx)(`h2`,{children:c(`configurationDependencies`)}),(0,q.jsx)(`div`,{className:`configuration-group`,children:(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationEnvironment`)}),(0,q.jsx)(`p`,{children:c(`configurationEnvironmentDetail`)})]}),(0,q.jsxs)(`button`,{type:`button`,className:`configuration-runtime-button`,onClick:s,children:[c(`configurationRuntimeStatus`),(0,q.jsx)(Yo,{"aria-hidden":`true`})]})]})})]})]})]})}function jj({catalog:e,error:t,pending:n,onConfigure:r,onRefresh:i}){let{t:a}=W(),o=e?.setup.webSearch?.enabled===!0,s=e?.webSearch?.available===!0,c=n||!e||!!t||!!e?.resources.diagnostics.settingsErrors;return(0,q.jsxs)(`section`,{className:`settings-content-page settings-web-search-panel`,children:[(0,q.jsxs)(`header`,{className:`settings-page-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:a(`webSearchSettings`)}),(0,q.jsx)(`p`,{children:a(`webSearchIntro`)})]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button settings-heading-refresh`,"aria-label":a(`refreshStatus`),onClick:i,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]}),t&&(0,q.jsx)(`p`,{className:`inspection-warning`,role:`alert`,children:t}),!e&&!t&&(0,q.jsx)(`p`,{role:`status`,children:a(`settingsCatalogLoading`)}),(0,q.jsxs)(`section`,{className:`settings-control-group`,children:[(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsxs)(`div`,{className:`settings-control-copy`,children:[(0,q.jsx)(`h2`,{children:a(`webSearchCurrentModel`)}),(0,q.jsx)(`p`,{children:a(`webSearchNativeDetail`)})]}),(0,q.jsx)(Br,{label:a(o?`webSearchDisable`:`webSearchEnable`),variant:`secondary`,size:`sm`,isDisabled:c,isLoading:n,onClick:()=>void r(a(o?`webSearchDisableRequest`:`webSearchNativeRequest`))})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`div`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:a(`model`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:e?.webSearch?.model?`${e.webSearch.provider} / ${e.webSearch.model}`:a(`unavailable`)})]})]}),(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:a(`webSearchDefaultOff`)}),(0,q.jsx)(`p`,{role:`status`,className:`settings-resource-caption`,children:a(s?`webSearchSupported`:`webSearchUnsupported`)})]})}var Mj={wrapper:{k8WAf4:`xu0wf1k`,kg3NbH:`x7a5moj`,$$css:!0},icon:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kmuXW:`x2lah0s`,$$css:!0}};function Nj({ref:e,label:t,clearLabel:n,placeholder:r,value:i,onValueChange:a,onKeyDown:o,onFocus:s,onBlur:c,onContainerKeyDown:l,xstyle:u,className:d,style:f,...p}){let[m,h]=(0,K.useState)(!1);(0,K.useEffect)(()=>{D()},[]);let g=(0,K.useCallback)(e=>{h(N()===`keyboard`),s?.(e)},[s]),_=(0,K.useCallback)(e=>{h(!1),c?.(e)},[c]),v=(0,K.useCallback)(()=>{a(``),typeof e==`object`&&e?.current&&e.current.focus()},[a,e]);return(0,q.jsx)(`div`,{onKeyDown:l,...H(w(Mj.wrapper,u),d,f),children:(0,q.jsxs)(`div`,{"data-keyboard-focus":m?`true`:void 0,...{0:{className:`x9f619 x78zum5 x6s0dn4 x1txdalj xh8yej3 x1vofgu7 xf314gf xh6dtrn xkdsq27 xuedmi6 x12w9bfk xlr8y92`},1:{className:`x9f619 x78zum5 x6s0dn4 x1txdalj xh8yej3 x1vofgu7 xf314gf xh6dtrn xkdsq27 xuedmi6 x12w9bfk xlr8y92 x1gnnqk1 x1btxeh5`}}[!!m<<0],children:[(0,q.jsx)(ya,{icon:`search`,size:`sm`,color:`secondary`,xstyle:Mj.icon}),(0,q.jsx)(`input`,{ref:e,type:`text`,"aria-label":t,placeholder:r,value:i,onChange:e=>a(e.target.value),onKeyDown:o,onFocus:g,onBlur:_,className:`x1iyjqo2 xs83m0k xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1tgivj0 x9ynric xcr08ib xdk3u5w x1kq96og x1a2a7pz xeyghm5`,...p}),i!==``&&(0,q.jsx)(KO,{label:n,onClick:v})]})})}Nj.displayName=`PanelSearchInput`;function Pj(e){return typeof e==`string`||!(`type`in e)}function Fj(e){return typeof e==`object`&&`type`in e&&e.type===`divider`}function Ij(e){return typeof e==`object`&&`type`in e&&e.type===`section`}function Lj(e){return typeof e==`string`?{value:e,label:e}:{...e,label:e.label??e.value}}function Rj(e){let t=[];for(let n of e)if(Pj(n))t.push(Lj(n));else if(Ij(n))for(let e of n.options)t.push(Lj(e));return t}var zj=1;function Bj(e){let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t}function Vj({isOpen:e,selectedItemIndex:t,listboxId:n,listboxRef:r,anchorRef:i}){let[a,o]=(0,K.useState)(0),[s,c]=(0,K.useState)(!1),l=(0,K.useCallback)((e,t)=>{o(e),c(t)},[]);return ne(()=>{if(!e){l(0,!1);return}if(!r.current||!i.current){l(0,!0);return}let a=`${n}-item-${t>=0?t:0}`,o=document.getElementById(a);if(!o){l(0,!0);return}let s=r.current,c=i.current.getBoundingClientRect(),u=s.offsetHeight;if(u<=0){l(0,!0);return}let d=Bj(o)-Bj(s)-s.scrollTop+o.offsetHeight/2,f=c.top+c.height/2-d-zj,p=window.innerHeight,m=Math.max(0,p-u),h=Math.min(Math.max(f,0),m),g=Math.max(0,c.bottom-h);l(g,!0)},[e,t,n,r,i,l]),{offset:a,isPositioned:s}}function Hj({selectableItems:e,value:t,isDisabled:n=!1,isOpen:r,hasSearch:i=!1,onOpen:a,onClose:o,onSelect:s,onClear:c,onSearchSeed:l,wasJustDismissed:u,listboxId:d}){let[f,p]=(0,K.useState)(-1),m=(0,K.useCallback)(e=>`${d}-item-${e}`,[d]),h=(0,K.useCallback)(()=>e.map((e,t)=>e.disabled?-1:t).filter(e=>e>=0),[e]),g=(0,K.useCallback)(()=>e.findIndex(e=>e.value===t),[e,t]),_=(0,K.useCallback)(()=>{p(-1),o()},[o]),v=(0,K.useCallback)(e=>{e.disabled||(s?.(e.value),_())},[s,_]),y=(0,K.useCallback)(()=>{if(!(n||u?.())){if(r)_();else if(a(),!i){let e=g();p(e>=0?e:0)}}},[n,u,r,a,_,g,i]),b=(0,K.useCallback)((e,t)=>{e.disabled||p(t)},[]);return{highlightedIndex:f,setHighlightedIndex:p,getItemId:m,onTriggerClick:y,onKeyDown:(0,K.useCallback)(o=>{if(n)return;let s=h();switch(o.key){case`ArrowDown`:if(o.preventDefault(),!r)a(),p(0);else{let e=s.indexOf(f),t=Math.min(e+1,s.length-1);p(s[t]??f)}break;case`ArrowUp`:if(o.preventDefault(),!r)a(),p(e.length-1);else{let e=s.indexOf(f),t=Math.max(e-1,0);p(s[t]??f)}break;case` `:if(i)break;case`Enter`:if(o.preventDefault(),r&&f>=0){let t=e[f];t&&!t.disabled&&v(t)}else if(!r&&(a(),!i)){let e=g();p(e>=0?e:0)}break;case`Escape`:r&&(o.preventDefault(),_());break;case`Tab`:r&&_();break;case`Home`:o.preventDefault(),r&&s.length>0&&p(s[0]);break;case`End`:o.preventDefault(),r&&s.length>0&&p(s[s.length-1]);break;case`PageUp`:o.preventDefault(),r&&s.length>0&&p(s[0]);break;case`PageDown`:o.preventDefault(),r&&s.length>0&&p(s[s.length-1]);break;case`Delete`:case`Backspace`:!i&&!r&&c!=null&&t!=null&&(o.preventDefault(),c());break;default:i&&l&&o.key.length===1&&!o.ctrlKey&&!o.metaKey&&(r||a(),l(o.key))}},[n,r,a,_,e,f,v,g,h,i,c,l,t]),onItemSelect:v,onItemMouseEnter:b}}var Uj=(0,K.createContext)(`stacked`);Uj.displayName=`SelectorRowLayoutContext`;function Wj(){return(0,K.use)(Uj)}var Gj={root:{k8WAf4:`xt970qd`,kg3NbH:`xnjsko4`,kaIpWk:`x2u8bby`,$$css:!0}};function Kj({icon:e,label:t,description:n,layout:r,endContent:i,xstyle:a,className:o,style:s}){let c=Wj();return(0,q.jsx)(Na,{startContent:e?xa(e,{size:`sm`,color:`secondary`}):void 0,label:t,description:n,layout:c===`inline`?`inline`:r,endContent:i,xstyle:[Gj.root,a],...H(O(`selector-option`),{className:o,style:s})})}Kj.displayName=`SelectorOption`;var qj={triggerContainer:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`x1qughib`,kOIVth:`x1txdalj`,kzqmXN:`xh8yej3`,k8WAf4:`xce4md1`,kg3NbH:`xrrkdod`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib xdk3u5w`,kLWn49:`x7acx1w`,kMwMTN:`x1tgivj0`,kkrTdU:`x1ypdohk x16khyan`,$$css:!0},triggerPlaceholder:{kMwMTN:`xv1l7n4`,$$css:!0},triggerInGroup:{kAzted:`x2lwn1j`,k8WAf4:`xt970qd`,$$css:!0},triggerIcon:{kmuXW:`x2lah0s`,$$css:!0},triggerIconRotation:{k1ekBW:`x11xpdln`,kIyJzY:`xuedmi6`,kAMwcw:`xlr8y92`,k3nNDw:`x1g0ag68`,$$css:!0},triggerIconOpen:{k3aq6I:`x19jd1h0`,$$css:!0},triggerGhost:{kzqmXN:`x14atkfc`,kMzoRj:`xc342km`,kWkggS:`xjbqb8w`,kGVxlE:`x1gnnqk1 x1s17dad x15ysqaf`,k63SB2:`x1e4wzip`,k1ekBW:`xrafxwg`,k3aq6I:`x3oybdh xk4oym4`,$$css:!0},triggerGhostDisabled:{kKwaWg:`x18o3ruo`,k3aq6I:`x1c071of x1pdlv7q`,$$css:!0},statusButton:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmVPX3:`x1717udv`,kogj98:`x1ghz6dp`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`xjbqb8w`,kMwMTN:`x1heor9g`,kkrTdU:`x1ypdohk x16khyan`,kaIpWk:`xh6dtrn`,$$css:!0},searchRowInput:{kg3NbH:`x2hg6jq`,$$css:!0},popover:{k7Eaqz:`xrzjruh`,$$css:!0},divider:{kqGvvJ:`xsq74q5`,$$css:!0},item:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`x1qughib`,kOIVth:`x1txdalj`,kzqmXN:`xh8yej3`,kmVPX3:`xlsj2fj`,kaIpWk:`xh6dtrn`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib`,kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w`,kkrTdU:`x1ypdohk x16khyan`,k9WMMc:`x1yc453h`,kI3sdo:`x1a2a7pz`,$$css:!0},itemHighlighted:{kWkggS:`x1lmrjuc`,$$css:!0},itemSelected:{k63SB2:`x1e4wzip`,$$css:!0},itemDisabled:{kSiTet:`xbyyjgo`,kkrTdU:`xt0e3qv`,$$css:!0}},Jj={sm:{kAzted:`x1gdqauq`,k8WAf4:`x1ecmfrv`,$$css:!0},md:{kAzted:`x1uogy3y`,k8WAf4:`x1ioay2v`,$$css:!0},lg:{kAzted:`x1xf4nls`,k8WAf4:`x1vn5h1t`,$$css:!0}},Yj={sm:{k8WAf4:`xu0wf1k`,kg3NbH:`xf314gf`,$$css:!0},md:{k8WAf4:`x1vofgu7`,$$css:!0},lg:{$$css:!0}},Xj={warning:`warning`,error:`error`,success:`success`},Zj={warning:`warning`,error:`error`,success:`success`},Qj={warning:`@astryx.input.statusButton.warning`,error:`@astryx.input.statusButton.error`,success:`@astryx.input.statusButton.success`};function $j({option:e}){return(0,q.jsx)(Kj,{icon:e.icon,label:e.label??e.value,description:e.description})}function eM(e,t){return!t||(e.label??e.value).toLowerCase().includes(t.toLowerCase())}function tM(e,t){return t?e.filter(e=>eM(e,t)):e}function nM(e){let t=jr(),{label:n,isLabelHidden:r=!1,description:i,isOptional:a=!1,isRequired:o=!1,isDisabled:s=!1,disabledMessage:c,options:l,value:u,onChange:d,changeAction:f,isLoading:m=!1,placeholder:h,size:g,variant:_=`input`,status:v,statusVariant:y=`attached`,labelTooltip:b,startIcon:x,htmlName:S,renderOption:C,renderValue:T,indicatorPosition:E=`end`,hasSearch:D=!1,searchPlaceholder:k,emptyText:A,emptySearchText:j,placement:N,isDefaultOpen:P=!1,"data-testid":I,width:ee,xstyle:L,className:te,style:z,hasClear:B,id:ne,...re}=e,V=YO({isRequired:o,isOptional:a}),oe=h??t(`@astryx.selector.placeholder`),se=k??t(`@astryx.selector.searchPlaceholder`),ce=A??t(`@astryx.selector.empty`),le=j??t(`@astryx.selector.emptySearchResults`),ue=B===!0,de=Zt(g,`md`),pe=_===`ghost`&&y===`attached`?`detached`:y,me=u===null?void 0:u,he=(0,K.useId)(),ge=ne??he,_e=(0,K.useId)(),ve=(0,K.useId)(),ye=(0,K.useId)(),be=(0,K.useId)(),xe=(0,K.useId)(),Se=(0,K.useRef)(null),Ce=(0,K.useRef)(null),we=(0,K.useRef)(null),Te=ZO(),[Ee,U]=(0,K.useState)(``),De=(0,K.useRef)(``),Oe=Ee.length>0,[,ke]=(0,K.useTransition)(),[W,Ae]=(0,K.useOptimistic)(me),G=m||W!==me,je=vu(),Me=typeof ce==`string`?ce:t(`@astryx.selector.empty`),Ne=typeof le==`string`?le:t(`@astryx.selector.emptySearchResults`),Pe=s&&!!c,Fe=F({placement:`above`,focusTrigger:`always`,isEnabled:Pe}),Ie=F({placement:`above`,isEnabled:pe===`tooltip`&&!!v?.message}),{ariaLabelledBy:Le,ariaDescribedBy:Re}=gt(be,[i?ve:null,!Te&&pe!==`tooltip`&&v?.message?ye:null,pe===`tooltip`&&v?.message?Ie.describedBy:null,Pe?Fe.describedBy:null],Te),ze=(0,K.useMemo)(()=>Rj(l),[l]),Be=(0,K.useMemo)(()=>tM(ze,Ee),[ze,Ee]),Ve=(0,K.useMemo)(()=>ze.findIndex(e=>e.value===W),[ze,W]),He=(0,K.useMemo)(()=>Ve>=0?ze[Ve]:void 0,[ze,Ve]),Ue=(0,K.useRef)(null),We=(0,K.useRef)(()=>{}),Ge=Gr({onHide:(0,K.useCallback)(()=>{U(``),De.current=``,We.current(),je(``),Ce.current?.focus()},[je]),hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:`none`,surfaceTarget:`selector-popup`}),Ke=ae(Ge.id,Ge.isOpen);(0,K.useEffect)(()=>{P&&Ge.show()},[]);let qe=(0,K.useCallback)(e=>{if(e.length===0){je(``);return}if(m){je(``);return}let n=tM(ze,e).length;je(n===0?Ne:t(`@astryx.selector.resultCount`,{count:n}))},[je,m,ze,Ne,t]),Je=(0,K.useCallback)(e=>{U(e),De.current=e,qe(e)},[qe]),Ye=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!(Ge.isOpen&&!m&&Ee===``&&ze.length===0)){Ye.current=null;return}Ye.current!==Me&&(Ye.current=Me,je(Me))},[Ge.isOpen,m,Ee,ze.length,Me,je]);let Xe=N==null&&!D,{offset:Ze,isPositioned:Qe}=Vj({isOpen:Ge.isOpen&&Xe,selectedItemIndex:Ve,listboxId:_e,listboxRef:Ue,anchorRef:Se}),$e=Xe?Ze:0,et=!Xe||Qe,tt=N??`below`,nt=$e>0?{marginBlockStart:`-${$e}px`}:void 0,rt=(0,K.useCallback)(()=>{We.current(),d?.(null),f&&ke(async()=>{Ae(void 0),await f(null)})},[d,f,ke,Ae]),it=(0,K.useCallback)(e=>{let t=De.current+e;De.current=t,U(t),qe(t)},[qe]),at=(0,K.useCallback)(e=>{d?.(e),f&&ke(async()=>{Ae(e),await f(e)})},[d,f,ke,Ae]),{highlightedIndex:ot,setHighlightedIndex:st,getItemId:ct,onTriggerClick:lt,onKeyDown:ut,onItemSelect:dt,onItemMouseEnter:ft}=Hj({selectableItems:Be,wasJustDismissed:Ge.wasJustDismissed,value:W,isDisabled:s,isOpen:Ge.isOpen,hasSearch:D,onOpen:(0,K.useCallback)(()=>{Ge.show(),D&&requestAnimationFrame(()=>{let e=we.current;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))})},[Ge,D]),onClose:Ge.hide,onSelect:at,onClear:ue?rt:void 0,onSearchSeed:it,listboxId:_e}),pt=io({getItemLabels:()=>ze.map(e=>e.label??e.value),isDisabled:e=>ze[e]?.disabled===!0,getCurrentIndex:()=>Ge.isOpen?ot:Ve,onMatch:e=>{let t=ze[e];Ge.isOpen?st(e):t.value!==W&&(at(t.value),je(t.label??t.value))}});We.current=pt.reset;let mt=(0,K.useCallback)(e=>{if(!s&&!D&&pt.onKeyDown(e)){e.preventDefault();return}ut(e)},[s,D,pt,ut]);(0,K.useEffect)(()=>{!Ge.isOpen||ot<0||document.getElementById(ct(ot))?.scrollIntoView?.({block:`nearest`})},[Ge.isOpen,ot,ct]);let ht=(0,K.useCallback)(e=>{e.stopPropagation(),rt()},[rt]),_t=(0,K.useCallback)(()=>D?(0,q.jsx)(Nj,{ref:we,id:xe,label:t(`@astryx.selector.searchOptions`),clearLabel:t(`@astryx.textInput.clearLabel`,{label:t(`@astryx.selector.searchOptions`)}),...O(`selector-search`),xstyle:_!==`ghost`&&qj.searchRowInput,role:`combobox`,"aria-expanded":Ge.isOpen,"aria-controls":_e,"aria-autocomplete":`list`,"aria-activedescendant":Ge.isOpen&&ot>=0?ct(ot):void 0,value:Ee,onValueChange:Je,onContainerKeyDown:e=>{e.target!==we.current&&e.key===`Tab`&&!e.shiftKey&&ut(e)},onKeyDown:e=>{if(!M(e.nativeEvent)){if(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`PageUp`||e.key===`PageDown`||e.key===`Enter`||e.key===`Escape`){ut(e);return}e.key===`Tab`&&(e.shiftKey||!Oe)&&ut(e)}},placeholder:se}):null,[D,xe,_e,Ee,Oe,se,Je,ut,Ge.isOpen,ot,ct,_,t]),vt=Io(`check`),yt=(0,K.useCallback)((e,t)=>{let n=t===ot,r=e.value===me,i=(0,q.jsx)(`span`,{className:`x3nfvp2 x6s0dn4 xl56j7k x2lah0s xgomdpo`,children:(0,q.jsx)(vt,{state:r?`checked`:`unchecked`,size:`sm`,isDisabled:e.disabled??!1,...O(`selector-check`)})}),a=(0,q.jsx)(`span`,{className:`x78zum5 x6s0dn4 x1txdalj x98rzlu xeuugli`,children:C?C(e):(0,q.jsx)($j,{option:e})}),o=E===`start`?(0,q.jsxs)(q.Fragment,{children:[i,a]}):(0,q.jsxs)(q.Fragment,{children:[a,i]});return(0,q.jsx)(`div`,{id:ct(t),role:`option`,"aria-selected":r,"aria-disabled":e.disabled,onClick:()=>dt(e),onMouseEnter:()=>ft(e,t),...H(O(`selector-option-row`,{size:de,selected:r?`selected`:null,disabled:e.disabled?`disabled`:null}),w(qj.item,Yj[de],n&&qj.itemHighlighted,r&&qj.itemSelected,e.disabled&&qj.itemDisabled)),children:o},e.value)},[C,E,ot,de,me,ct,dt,ft,vt]),bt=(0,K.useCallback)(()=>{let e=D&&!!Ee;if(Be.length===0&&!m)return[(0,q.jsx)(`div`,{role:`presentation`,...H(O(`selector-empty-state`),{className:`x1b2ylru x2b8uid xv1l7n4 x9ynric xcr08ib`}),children:e?le:ce},`empty`)];let t=0,n=[];for(let r=0;r{Se.current=e,Ge.triggerRef(e),Fe.ref(e)},onClick:lt,"data-testid":I,...H(O(`selector`,{variant:_,size:de,status:v?.type??null,disabled:s?`disabled`:null}),w(BO.base,qj.triggerContainer,Jj[de],_===`ghost`&&qj.triggerGhost,_===`ghost`&&rn.backgroundImage,_===`ghost`&&fe.focusWithin,s&&BO.disabled,_===`ghost`&&s&&qj.triggerGhostDisabled,!He&&qj.triggerPlaceholder,_!==`ghost`&&v&&VO[v.type],_!==`ghost`&&v&&!s&&HO[v.type],_!==`ghost`&&Te&&JO.inGroup,Te&&qj.triggerInGroup,L),te,z),children:[x&&xa(x,{size:`sm`,color:`secondary`}),Te&&(0,q.jsx)(Kt,{id:be,children:n}),(0,q.jsx)(`button`,{ref:Ce,id:ge,type:`button`,role:D?void 0:`combobox`,...re,"aria-haspopup":`listbox`,"aria-expanded":Ge.isOpen,"aria-controls":_e,"aria-activedescendant":!D&&Ge.isOpen&&ot>=0?ct(ot):void 0,"aria-describedby":Re,"aria-labelledby":Le,"aria-required":V?`true`:void 0,"aria-invalid":v?.type===`error`?`true`:void 0,"aria-busy":G||void 0,disabled:s&&!Pe,"aria-disabled":Pe?`true`:void 0,onKeyDown:mt,tabIndex:s&&!Pe?-1:0,...{0:{className:`x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x16khyan x1a2a7pz`},1:{className:`x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x16khyan x1a2a7pz xkh2ocl`}}[!!Te<<0],children:Ct}),S!=null&&(0,q.jsx)(`input`,{type:`hidden`,name:S,value:u??``,disabled:s}),G&&(0,q.jsx)(Gt,{size:`sm`}),ue&&u!=null&&!s&&(0,q.jsx)(qO,{...Ke,label:t(`@astryx.selector.clearLabel`,{label:n}),onClick:ht,iconClassName:ie(`selector-clear-icon`)}),xt?St?(0,q.jsx)(`button`,{ref:Ie.ref,type:`button`,"aria-label":t(Qj[v.type]),"aria-describedby":Ie.describedBy,...Ke,onClick:e=>e.stopPropagation(),...w(fe.focusVisible,qj.statusButton),children:(0,q.jsx)(ya,{icon:Xj[v.type],size:`sm`,color:Zj[v.type],xstyle:qj.triggerIcon})}):(0,q.jsx)(ya,{icon:Xj[v.type],size:`sm`,color:Zj[v.type],xstyle:qj.triggerIcon}):(0,q.jsx)(ya,{icon:`chevronDown`,size:`sm`,color:`secondary`,xstyle:[qj.triggerIcon,qj.triggerIconRotation,Ge.isOpen&&qj.triggerIconOpen],...O(`selector-indicator-icon`,{state:Ge.isOpen?`expanded`:`collapsed`})})]}),Ge.render(D?(0,q.jsxs)(`div`,{children:[_t(),(0,q.jsx)(Ga,{}),(0,q.jsx)(`div`,{ref:Ue,id:_e,role:`listbox`,"aria-labelledby":ge,...{0:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj x1hc1fzr x1ey1afo`},1:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x1hc1fzr x1ey1afo x2hg6jq`}}[(_!==`ghost`)<<0],children:bt()})]}):(0,q.jsx)(`div`,{ref:Ue,id:_e,role:`listbox`,"aria-labelledby":ge,...{0:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj x1hc1fzr x1ey1afo`},2:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x1hc1fzr x1ey1afo x2hg6jq`},1:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj xg01cxk xq2gx43`},3:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x2hg6jq xg01cxk xq2gx43`}}[(_!==`ghost`)<<1|!et<<0],children:bt()}),{placement:tt,alignment:`start`,offset:Xe?void 0:p[`--spacing-1`],xstyle:[qj.popover,R[tt]],style:nt}),St&&Ie.renderTooltip(v?.message??``),Pe&&Fe.renderTooltip(c)]});return Te?wt:(0,q.jsx)(zO,{label:n,isLabelHidden:r,description:i,inputID:ge,descriptionID:i?ve:void 0,isOptional:a,isRequired:o,isDisabled:s,status:v?{type:v.type,message:v.message,messageID:v.message?ye:void 0}:void 0,statusVariant:pe,labelTooltip:b,width:ee,children:wt})}nM.displayName=`Selector`;function rM(e){return e?.status===`running`||e?.status===`cancelling`}function iM({sessionId:e,auth:t,busy:n,onSaving:r,onAuthenticated:i,onReload:a}){let{t:o}=W(),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(!1),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(0),[_,v]=(0,K.useState)(``),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(!1),T=(0,K.useRef)(!1),E=(0,K.useRef)(null),D=(0,K.useRef)(!1),O=(0,K.useRef)(0),k=(0,K.useRef)(null),A=(0,K.useRef)({onSaving:r,onAuthenticated:i});A.current={onSaving:r,onAuthenticated:i};let j=rM(s),M=t.id,N=`${e}:${M}`,P=(0,K.useRef)({key:N});P.current.key!==N&&(P.current={key:N});let F=P.current,I=(0,K.useCallback)((t,n)=>{if(t&&(t.sessionId!==e||t.provider!==M||n&&t.id!==n))throw Error(`Login ownership changed`);if(n&&!t)throw Error(`Login status unavailable`);if(!T.current||P.current!==F){t&&rM(t)&&new de().cancelProviderLogin(e,t.id).catch(()=>void 0);return}E.current=t,c(t),m(!1),t?.status===`succeeded`&&!t.refreshRequired&&k.current!==t.id&&(k.current=t.id,A.current.onAuthenticated())},[e,M,F]);(0,K.useEffect)(()=>{T.current=!0,E.current=null,D.current=!1,k.current=null,c(null),u(!1),f(!1),m(!1),b(!1),w(!1);let t=new AbortController,n=O.current;return new de().providerLogin(e,void 0,t.signal).then(e=>{!t.signal.aborted&&n===O.current&&!D.current&&e?.provider===M&&rM(e)&&I(e)}).catch(()=>void 0),()=>{T.current=!1,t.abort();let n=E.current;n&&rM(n)&&new de().cancelProviderLogin(e,n.id).catch(()=>void 0),A.current.onSaving(!1)}},[e,M,I]),(0,K.useEffect)(()=>{A.current.onSaving(j||l)},[j,l]);let ee=s?.prompt?.id;(0,K.useEffect)(()=>{v(``)},[ee]);let L=s?.id;(0,K.useEffect)(()=>{b(!1)},[L]),(0,K.useEffect)(()=>{if(l||D.current||!j||!L)return;let t=new AbortController,n=O.current,r=0,i=async()=>{try{let a=await new de().providerLogin(e,L,t.signal);if(t.signal.aborted||n!==O.current||D.current)return;I(a,L),rM(a)&&(r=window.setTimeout(()=>void i(),900))}catch{!t.signal.aborted&&n===O.current&&!D.current&&m(!0)}};return i(),()=>{t.abort(),clearTimeout(r)}},[e,I,L,j,l,h]);let R=async(e,t)=>{if(!D.current){D.current=!0,O.current++,u(!0),f(!1);try{I(await e(),t)}catch{T.current&&P.current===F&&f(!0)}finally{P.current===F&&(D.current=!1,O.current++,T.current&&(u(!1),g(e=>e+1)))}}},te=()=>{n||j||R(()=>new de().startProviderLogin(e,M))},z=t=>{let n=s?.prompt;if(!s||!n)return;let r=s.id;R(()=>new de().respondProviderLogin(e,r,n.id,t))},B=()=>{let t=s?.id;return R(()=>new de().providerLogin(e,t),t)},ne=s?.prompt,re=s?.auth||s?.device,V=ne&&ne.type!==`select`&&(0,q.jsxs)(`div`,{className:`models-login-input`,children:[(0,q.jsxs)(`label`,{className:`models-field`,children:[ne.type===`manual_code`?o(`accountLoginPaste`):ne.message,(0,q.jsx)(`input`,{type:ne.type===`secret`||ne.type===`manual_code`?`password`:`text`,autoComplete:`off`,spellCheck:!1,value:_,maxLength:8192,placeholder:ne.placeholder,disabled:l||s.status!==`running`,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key!==`Enter`||e.nativeEvent.isComposing||(e.preventDefault(),(ne.type===`text`||_.trim())&&z(_))}})]}),(0,q.jsx)(`button`,{type:`button`,className:`models-button primary`,disabled:l||ne.type!==`text`&&!_.trim()||s.status!==`running`,onClick:()=>z(_),children:o(`accountLoginContinue`)})]});return(0,q.jsxs)(`div`,{className:`models-account-login`,children:[!j&&!C&&(!s||[`failed`,`expired`,`cancelled`].includes(s.status))&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`models-login-intro`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:M===`openai`?o(`accountLoginChatGPT`):M===`anthropic`?o(`accountLoginClaude`):t.loginLabel||t.name}),(0,q.jsx)(`p`,{className:`models-hint`,children:o(t.subscription?`accountLoginExisting`:`accountLoginIntro`)})]})}),(0,q.jsxs)(`div`,{className:`models-login-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button primary`,disabled:n||l||d,onClick:te,children:o(t.subscription?`accountLoginAgain`:`accountLoginStart`)}),t.subscription&&(0,q.jsx)(`button`,{type:`button`,className:`models-link`,disabled:n||l,onClick:()=>S(!0),children:o(`accountLogout`)})]})]}),j&&(0,q.jsxs)(`div`,{className:`models-login-flow`,children:[(0,q.jsxs)(`div`,{className:`models-login-status`,role:`status`,children:[(0,q.jsx)(rc,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o(s?.status===`cancelling`?`accountLoginCancelling`:re?`accountLoginWaiting`:ne?`accountLoginChoose`:`accountLoginStarting`)})]}),re&&(0,q.jsx)(`p`,{className:`models-hint`,children:o(s?.device?`accountLoginDeviceHelp`:`accountLoginBrowserHelp`)}),s?.device&&(0,q.jsxs)(`div`,{className:`models-device-code`,children:[(0,q.jsx)(`code`,{children:s.device.code}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":o(`accountLoginCopyCode`),onClick:()=>{s.device&&navigator.clipboard.writeText(s.device.code).then(()=>{T.current&&P.current===F&&b(!0)}).catch(()=>{T.current&&P.current===F&&b(!1)})},children:y?(0,q.jsx)(rs,{}):(0,q.jsx)(Ss,{})})]}),re&&(0,q.jsxs)(`a`,{className:`models-button primary models-login-open`,href:s?.device?.url||s?.auth?.url,target:`_blank`,rel:`noopener noreferrer`,children:[o(`accountLoginOpen`),(0,q.jsx)(Yo,{"aria-hidden":`true`})]}),ne?.type===`select`&&(0,q.jsx)(`fieldset`,{className:`models-login-options`,"aria-label":ne.message,children:ne.options?.map(e=>{let t=[`openai`,`openai-codex`].includes(M)&&[`browser`,`device_code`].includes(e.id);return(0,q.jsxs)(`button`,{type:`button`,className:`models-login-option`,disabled:l||s?.status!==`running`,onClick:()=>z(e.id),children:[(0,q.jsx)(`strong`,{children:t?o(e.id===`browser`?`accountLoginBrowser`:`accountLoginDevice`):e.label}),(t||e.description)&&(0,q.jsx)(`span`,{children:t?o(e.id===`browser`?`accountLoginBrowserOption`:`accountLoginDeviceOption`):e.description})]},e.id)})}),ne?.type===`manual_code`&&re?(0,q.jsxs)(`details`,{className:`models-login-fallback`,children:[(0,q.jsx)(`summary`,{children:o(`accountLoginFallback`)}),(0,q.jsx)(`p`,{className:`models-hint`,children:o(`accountLoginRemoteHelp`)}),V]}):V,s?.messages.map(e=>(0,q.jsxs)(`div`,{className:`models-hint`,children:[(0,q.jsx)(`p`,{children:e.message}),e.links?.map(e=>(0,q.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.label,(0,q.jsx)(Yo,{"aria-hidden":`true`})]},e.url))]},e.id)),(0,q.jsx)(`button`,{type:`button`,className:`models-link models-login-cancel`,disabled:l||s?.status===`cancelling`,onClick:()=>{s&&R(()=>new de().cancelProviderLogin(e,s.id))},children:o(`accountLoginCancel`)})]}),s?.status===`succeeded`&&s.refreshRequired&&(0,q.jsxs)(`p`,{className:`models-hint`,role:`status`,children:[o(`accountLoginRefreshRequired`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:a,children:o(`refreshStatus`)})]}),C&&(0,q.jsxs)(`p`,{className:`models-hint`,role:`status`,children:[o(`accountLogoutRefreshRequired`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:a,children:o(`refreshStatus`)})]}),s&&[`failed`,`expired`,`cancelled`].includes(s.status)&&(0,q.jsx)(`p`,{className:s.status===`failed`?`models-error`:`models-hint`,role:`status`,children:o(`accountLogin_${s.status}`)}),d&&(0,q.jsxs)(`p`,{className:`models-error`,role:`alert`,children:[o(`accountLoginRequestFailed`),(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:()=>void B(),children:o(`refreshStatus`)})]}),p&&(0,q.jsxs)(`p`,{className:`models-error`,role:`alert`,children:[o(`accountLoginStatusUnknown`),(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:()=>g(e=>e+1),children:o(`refreshStatus`)})]}),x&&(0,q.jsx)(uj,{isOpen:!0,title:o(`accountLogoutTitle`,{provider:t.name}),description:o(`accountLogoutDetail`),cancelLabel:o(`cancel`),actionLabel:o(`accountLogout`),isActionLoading:l,onOpenChange:e=>{!e&&!l&&S(!1)},onAction:()=>{D.current||n||(D.current=!0,O.current++,u(!0),f(!1),new de().logoutProvider(e,M).then(e=>{!T.current||P.current!==F||(S(!1),e.refreshRequired?w(!0):a())}).catch(()=>{T.current&&P.current===F&&(S(!1),f(!0))}).finally(()=>{P.current===F&&(D.current=!1,O.current++,T.current&&(u(!1),g(e=>e+1)))}))}})]})}var aM={assign:0,create:0,clone:0,discard:0,update:0};function oM(e){return Array.isArray(e)}function sM(e){return mM(typeof e,`bigint`)}function cM(e){return mM(typeof e,`boolean`)}function lM(e){return mM(e,null)}function uM(e){return Number.isFinite(e)}function dM(e){return fM(e)&&!oM(e)}function fM(e){return mM(typeof e,`object`)&&!lM(e)}function pM(e){return mM(typeof e,`string`)}function mM(e,t){return e===t}function hM(e,t){return e>t}function gM(e,t){return eHM(e))}function RM(e){return e.slice()}function zM(e){return new RegExp(e.source,e.flags)}function BM(e){return new Map(HM([...e.entries()]))}function VM(e){return new Set(HM([...e.values()]))}function HM(e){return wM(e)?RM(e):TM(e)?zM(e):DM(e)?BM(e):EM(e)?VM(e):oM(e)?LM(e):fM(e)?IM(e):e}function UM(e){return aM.clone+=1,HM(e)}function WM(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function GM(e,t){return{...e,...t}}function KM(e,t,n={}){aM.create+=1;let r=GM(t,n);return AM(kM().enumerableKind?GM(r,e):WM(r,e))}function qM(e,t){aM.discard+=1;let n={};for(let r of xM(e)){if(t.includes(r))continue;let i=Object.getOwnPropertyDescriptor(e,r);i.value=UM(i.value),Object.defineProperty(n,r,i)}return AM(n)}function JM(e,t,n){aM.update+=1;let r=kM(),i=UM(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return AM(i)}function YM(e,t){return fM(e)&&bM(e,`~kind`)&&mM(e[`~kind`],t)}function XM(e){return fM(e)}function ZM(e,t,n){return KM({"~kind":`Deferred`},{type:`deferred`,action:e,parameters:t,options:n},{})}function QM(e){return YM(e,`Deferred`)}function $M(e){return JM(e,{"~readonly":!0},{})}function eN(e,t){return JM($M(e),{},t)}function tN(e,t,n,r){return eN(BU(e,t,n),r)}function nN(e){return JM(e,{"~optional":!0},{})}function rN(e,t){return JM(nN(e),{},t)}function iN(e,t,n,r){return rN(BU(e,t,n),r)}function aN(e,t){return KM({"~kind":`Array`},{type:`array`,items:e},t)}function oN(e){return YM(e,`Array`)}function sN(e){return qM(e,[`~kind`,`type`,`items`])}function cN(e,t,n={}){return KM({"~kind":`Constructor`},{type:`constructor`,parameters:e,instanceType:t},n)}function lN(e){return YM(e,`Constructor`)}function uN(e){return qM(e,[`~kind`,`type`,`parameters`,`instanceType`])}function dN(e,t,n={}){return KM({"~kind":`Function`},{type:`function`,parameters:e,returnType:t},n)}function fN(e){return YM(e,`Function`)}function pN(e){return qM(e,[`~kind`,`type`,`parameters`,`returnType`])}function mN(e,t){return KM({"~kind":`Ref`},{$ref:e},t)}function hN(e){return YM(e,`Ref`)}function gN(e,t){return KM({"~kind":`Generic`},{type:`generic`,parameters:e,expression:t})}function _N(e){return YM(e,`Generic`)}function vN(e){return KM({"~kind":`Any`},{},e)}function yN(e){return YM(e,`Any`)}var bN=`(?!)`;function xN(e){return KM({"~kind":`Never`},{not:{}},e)}function SN(e){return YM(e,`Never`)}function CN(e,t={}){return rN(e,t)}function wN(e){return CN(e)}function TN(e){return XM(e)&&bM(e,`~optional`)}function EN(e){return xM(e).filter(t=>!TN(e[t]))}function DN(e){return xM(e)}function ON(e){return CM(e)}function kN(e,t={}){let n=EN(e);return KM({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}function AN(e){return YM(e,`Object`)}function jN(e){return qM(e,[`~kind`,`type`,`properties`,`required`])}function MN(e){return KM({"~kind":`Unknown`},{},e)}function NN(e){return YM(e,`Unknown`)}function PN(e,t,n){return KM({"~kind":`Cyclic`},{$defs:xM(e).reduce((t,n)=>({...t,[n]:JM(e[n],{},{$id:n})}),{}),$ref:t},n)}function FN(e){return YM(e,`Cyclic`)}function IN(e){return dM(e)&&bM(e,`~unsafe`)&&lM(e[`~unsafe`])}function LN(e){return YM(e,`Infer`)}function RN(e,t,n,r={}){return KM({"~kind":`Dependent`},{if:e,then:t,else:n},r)}function zN(e){return YM(e,`Dependent`)}function BN(e){return qM(e,[`~kind`,`if`,`then`,`else`])}function VN(e){return dM(e)}function HN(e){return xM(e).filter(e=>isNaN(e)).reduce((t,n)=>[...t,e[n]],[])}function UN(e,t){return KM({"~kind":`Enum`},{enum:VN(e)?HN(e):e},t)}function WN(e){return YM(e,`Enum`)}function GN(e,t={}){return KM({"~kind":`Intersect`},{allOf:e},t)}function KN(e){return YM(e,`Intersect`)}function qN(e){return qM(e,[`~kind`,`allOf`])}function JN(){throw Error(`Unreachable`)}var YN;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(YN||={}),Array.from({length:256}).map((e,t)=>BigInt(t));var XN=new Float64Array(1);new DataView(XN.buffer),new Uint8Array(XN.buffer),new TextEncoder;function ZN(e){return XM(e)&&bM(e,`~immutable`)}function QN(e,t={}){return eN(e,t)}function $N(e){return XM(e)&&bM(e,`~readonly`)}var eP=`-?(?:0|[1-9][0-9]*)n`;function tP(e){return KM({"~kind":`BigInt`},{type:`bigint`},e)}function nP(e){return YM(e,`BigInt`)}function rP(e){return YM(e,`Boolean`)}var iP=`-?(?:0|[1-9][0-9]*)`;function aP(e){return KM({"~kind":`Integer`},{type:`integer`},e)}function oP(e){return YM(e,`Integer`)}var sP=class extends Error{constructor(e){super(`Invalid Literal value`),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function cP(e){return sM(e)?`bigint`:cM(e)?`boolean`:uM(e)?`number`:pM(e)?`string`:(()=>{throw new sP(e)})()}function lP(e,t){return KM({"~kind":`Literal`},{type:cP(e),const:e},t)}function uP(e){return sM(e)||cM(e)||uM(e)||pM(e)}function dP(e){return pP(e)&&uM(e.const)}function fP(e){return pP(e)&&pM(e.const)}function pP(e){return YM(e,`Literal`)}function mP(e){return KM({"~kind":`Null`},{type:`null`},e)}function hP(e){return YM(e,`Null`)}var gP=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function _P(e){return KM({"~kind":`Number`},{type:`number`},e)}function vP(e){return YM(e,`Number`)}function yP(e){return KM({"~kind":`Symbol`},{type:`symbol`},e)}function bP(e){return YM(e,`Symbol`)}function xP(e){return KM({"~kind":`String`},{type:`string`},e)}function SP(e){return YM(e,`String`)}function CP(e,t={}){return KM({"~kind":`Union`},{anyOf:e},t)}function wP(e){return YM(e,`Union`)}function TP(e){return qM(e,[`~kind`,`anyOf`])}function EP(e){let t=nL(e);return mM(t.length,2)?t[0]:[]}function DP(e){return!0}function OP(e){return vM(e,(e,t)=>AP(e)?OP(t):!1,()=>!0)}function kP(e){return!mM(e.length,0)&&OP(e)}function AP(e){return wP(e)?kP(e.anyOf):pP(e)?DP(e.const):!1}function jP(e){return kP(e)}function MP(e){return KM({"~kind":`TemplateLiteral`},{type:`string`,pattern:e},{})}function NP(e,t,n=[]){return vM(e,(e,r)=>NP(r,t,[...n,`${e}${t}`]),()=>n)}function PP(e,t){return mM(e.length,0)?[`${t}`]:NP(e,t)}function FP(e,t,n=[]){return vM(t,(t,r)=>FP(e,r,[...n,...IP(e,t)]),()=>n)}function IP(e,t){return wP(t)?FP(e,t.anyOf):pP(t)?PP(e,t.const):JN()}function LP(e,t){return vM(t,(t,n)=>LP(IP(e,t),n),()=>e)}function RP(e){return e.map(e=>lP(e))}function zP(e){return CP(RP(LP([],e)))}function BP(e){return mM(e.length,0)?JN():mM(e.length,1)&&pP(e[0])?e[0]:zP(e)}function VP(e){let t=EP(e);return mM(t.length,0)?xP():jP(t)?BP(t):MP(e)}function HP(e){let t=VP(e);return CL(t)?xP():t}function UP(e,t){return KM({"~kind":`Record`},{type:`object`,patternProperties:{[e]:t}})}function WP(e){return UP(XF,e)}function GP(e){return kN({true:e,false:e})}function KP(e,t={}){let[n,r,i]=[e,e.length,!1];return KM({"~kind":`Tuple`},{type:`array`,additionalItems:i,items:n,minItems:r},t)}function qP(e){return YM(e,`Tuple`)}function JP(e){return qM(e,[`~kind`,`type`,`items`,`minItems`,`additionalItems`])}function YP(e){return qM(e,[`~readonly`])}function XP(e,t){return JM(YP(e),{},t)}function ZP(e,t,n,r){return XP(BU(e,t,n),r)}function QP(e,t={}){return XP(e,t)}function $P(e){return qM(e,[`~optional`])}function eF(e,t){return JM($P(e),{},t)}function tF(e,t,n,r){return eF(BU(e,t,n),r)}function nF(e,t={}){return eF(e,t)}function rF(e){return e.reduceRight((e,t,n)=>({[n]:t,...e}),{})}function iF(e){return kN(rF(e.items))}function aF(e){return AN(e)||qP(e)}function oF(e,t){return $N(e)?!!$N(t):!1}function sF(e,t){return TN(e)?!!TN(t):!1}function cF(e,t){let n=oF(e,t),r=sF(e,t),i=QP(nF(EF([e,t])));return n&&r?QN(CN(i)):n&&!r?QN(i):!n&&r?CN(i):i}function lF(e,t,n){return n in e?n in t?cF(e[n],t[n]):e[n]:n in t?t[n]:xN()}function uF(e,t){return[...new Set([...xM(e),...xM(t)])].reduce((n,r)=>({...n,[r]:lF(e,t,r)}),{})}function dF(e){return AN(e)?e.properties:qP(e)?rF(e.items):{}}function fF(e,t){return kN(uF(dF(e),dF(t)))}function pF(e,t){let n=Dz(e,t);return mM(n,2)?e:mM(n,3)||mM(n,0)?t:xN()}function mF(e,t){let n=aF(e),r=aF(t);return n&&r?fF(e,t):n&&!r?e:!n&&r?t:pF(e,t)}function hF(e,t){return SN(e)||yN(e)?e:NN(e)||SN(t)||yN(t)?t:NN(t)?e:mF(e,t)}function gF(e,t){return wP(e)||wP(t)}function _F(e,t){let n=kF(e),r=kF(t);return gF(n,r)?EF([n,r]):hF(n,r)}function vF(e,t,n=[]){return vM(t,(t,r)=>vF(e,r,[...n,_F(t,e)]),()=>mM(n.length,0)?[e]:n)}function yF(e,t,n=[]){return vM(e,(e,r)=>yF(r,t,[...n,...bF([e],t)]),()=>n)}function bF(e,t=[]){return vM(e,(e,n)=>wP(e)?bF(n,yF(e.anyOf,t)):bF(n,vF(e,t)),()=>t)}function xF(e,t){return AL(Ez({},e,t))?[]:[e]}function SF(e,t,n=[]){return vM(e,(e,r)=>SF(r,t,[...n,...xF(e,t)]),()=>n)}function CF(e,t){let n=kF(e);return OF(SF(wP(n)?n.anyOf:[n],t))}function wF(e,t,n){return OF([EF([e,t]),CF(n,e)])}function TF(e,t=[]){return vM(e,(e,n)=>TF(n,[...t,lP(e)]),()=>OF(t))}function EF(e){return OF(jz(bF(e)))}function DF(e){return kF(HP(e))}function OF(e){return AF(jz(e))}function kF(e){return zN(e)?wF(e.if,e.then,e.else):WN(e)?TF(e.enum):KN(e)?EF(e.allOf):CL(e)?DF(e.pattern):wP(e)?OF(e.anyOf):e}function AF(e){return mM(e.length,1)?e[0]:mM(e.length,0)?xN():CP(e)}function jF(e,t){return GF(TF(e),t)}function MF(e,t){return UP(JF,t)}function NF(e,t){return GF(EF(e),t)}function PF(e,t){return pM(e)||uM(e)?kN({[e]:t}):mM(e,!1)?kN({false:t}):mM(e,!0)?kN({true:t}):kN({})}function FF(e,t){return UP(YF,t)}function IF(e,t){return bM(e,`pattern`)&&(pM(e.pattern)||e.pattern instanceof RegExp)?UP(e.pattern.toString(),t):UP(XF,t)}function LF(e,t){return jP(EP(e))?GF(DF(e),t):UP(e,t)}function RF(e){return wP(e)?zF(e.anyOf):[e]}function zF(e,t=[]){return vM(e,(e,n)=>zF(n,[...t,...RF(e)]),()=>t)}function BF(e){return e.some(e=>SP(e)||vP(e)||oP(e))}function VF(e,t){return mM(BF(e),!0)?UP(XF,t):void 0}function HF(e,t){return e.reduce((e,n)=>pP(n)&&(pM(n.const)||uM(n.const))?{...e,[n.const]:t}:e,{})}function UF(e,t){return kN(HF(e,t))}function WF(e,t){let n=zF(e),r=VF(n,t);return XM(r)?r:UF(n,t)}function GF(e,t){return yN(e)?WP(t):rP(e)?GP(t):WN(e)?jF(e.enum,t):oP(e)?MF(e,t):KN(e)?NF(e.allOf,t):pP(e)?PF(e.const,t):vP(e)?FF(e,t):wP(e)?WF(e.anyOf,t):SP(e)?IF(e,t):CL(e)?LF(e.pattern,t):kN({})}function KF(e,t,n){return NU([e])?JM(GF(e,t),{},n):ZF(e,t,n)}function qF(e,t,n,r,i){return KF(BU(e,t,n),BU(e,t,r),i)}var JF=`^${iP}$`,YF=`^${gP}$`,XF=`^.*$`;function ZF(e,t,n={}){return ZM(`Record`,[e,t],n)}function QF(e,t,n={}){return KF(e,t,n)}function $F(e,t){return UP(e,t)}function eI(e){return mM(e,XF)?xP():mM(e,JF)?aP():mM(e,YF)?_P():VP(e)}function tI(e){return xM(e.patternProperties)[0]}function nI(e){return eI(tI(e))}function rI(e){return e.patternProperties[tI(e)]}function iI(e){return YM(e,`Record`)}function aI(e){return KM({"~kind":`Rest`},{type:`rest`,items:e},{})}function oI(e){return YM(e,`Rest`)}function sI(e){return YM(e,`This`)}function cI(e){return KM({"~kind":`Undefined`},{type:`undefined`},e)}function lI(e){return YM(e,`Undefined`)}function uI(e){return YM(e,`Void`)}function dI(e){return tP()}function fI(e){return xP()}function pI(e){return _P()}function mI(e){return aP()}function hI(e){return xN()}function gI(e){return lP(e)}function _I(e){return e}function vI(e){return CP(e[1])}function yI(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function bI(e){return[e[0],...e[1]]}function xI(e){return e}function SI(e){return e[1]}function CI(e){return mM(e.length,2)}function wI(e,t,n){return CI(e)?t(e[0],e[1]):n()}function TI(e,t){return mM(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function EI(e,t){for(let n=0;nString.fromCharCode(e+n))}var OI=[...DI(97,122),...DI(65,90)],kI=[`0`,...DI(49,57)],AI=`//`,jI=`/*`,MI=`*/`;function NI(e){let t=e.indexOf(MI);return mM(t,-1)?``:e.slice(t+2)}function PI(e){let t=e.indexOf(` `);return mM(t,-1)?``:e.slice(t)}function FI(e){return e.replace(/^[ \t\r\f\v]+/,``)}function II(e){let t=FI(e);return t.startsWith(jI)?II(NI(t.slice(2))):t.startsWith(AI)?II(PI(t.slice(2))):t}function LI(e){let t=e.trimStart();return t.startsWith(jI)?LI(NI(t.slice(2))):t.startsWith(AI)?LI(PI(t.slice(2))):t}[...kI];function RI(e,t){return EI([e],t)}function zI(e,t){return mM(e,``)?[``,t]:e.startsWith(` -`)?RI(e,II(t)):e.startsWith(` `)?RI(e,t):RI(e,LI(t))}[...OI,...kI],[...kI];function BI(e){return mM(e,``)?[]:[e.slice(0,1),e.slice(1)]}function VI(e,t){return vM(e,(e,n)=>t.startsWith(e)?!0:VI(n,t),()=>!1)}function HI(e,t,n=``){return wI(BI(t),(r,i)=>VI(e,t)?[n,t]:HI(e,i,`${n}${r}`),()=>[])}function UI(e,t){return wI(HI(e,t),(e,t)=>mM(e,``)?[]:[e,t],()=>[])}var WI=(e,t,n=()=>[])=>e.length===2?t(e):n(),GI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[dI(e),t]),KI=e=>WI(zI(`.*`,e),([e,t])=>[fI(e),t]),qI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,e),([e,t])=>[pI(e),t]),JI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[mI(e),t]),YI=e=>WI(zI(`(?!)`,e),([e,t])=>[hI(e),t]),XI=e=>WI(UI([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[gI(e),t]),ZI=e=>WI(WI(GI(e),([e,t])=>[e,t],()=>WI(KI(e),([e,t])=>[e,t],()=>WI(qI(e),([e,t])=>[e,t],()=>WI(JI(e),([e,t])=>[e,t],()=>WI(YI(e),([e,t])=>[e,t],()=>WI(QI(e),([e,t])=>[e,t],()=>WI(XI(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[_I(e),t]),QI=e=>WI(WI(zI(`(`,e),([e,t])=>WI(tL(t),([t,n])=>WI(zI(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[vI(e),t]),$I=e=>WI(WI(WI(eL(e),([e,t])=>WI(zI(`|`,t),([t,n])=>WI($I(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>WI(WI(eL(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>WI([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[yI(e),t]),eL=e=>WI(WI(ZI(e),([e,t])=>WI(tL(t),([t,n])=>[[e,t],n])),([e,t])=>[bI(e),t]),tL=e=>WI(WI($I(e),([e,t])=>[e,t],()=>WI(eL(e),([e,t])=>[e,t],()=>[])),([e,t])=>[xI(e),t]),nL=e=>WI(WI(zI(`^`,e),([e,t])=>WI(tL(t),([t,n])=>WI(zI(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[SI(e),t]);function rL(e){return e.join(`|`)}function iL(e){return e.slice(1,e.length-1)}function aL(e,t,n){return gL(t,`${n}${e}`)}function oL(e,t){return gL(e,`${t}${eP}`)}function sL(e,t){return gL(e,`${t}${iP}`)}function cL(e,t){return gL(e,`${t}${gP}`)}function lL(e,t){return hL(CP([lP(`false`),lP(`true`)]),e,t)}function uL(e,t){return gL(e,`${t}.*`)}function dL(e,t,n){return gL(t,`${n}${iL(e)}`)}function fL(e,t,n){return hL(yL(e,{}),t,n)}function pL(e,t,n){return hL(TF(e),t,n)}function mL(e,t,n,r=[]){return vM(e,(e,i)=>mL(i,t,n,[...r,hL(e,[],``)]),()=>gL(t,`${n}(${rL(r)})`))}function hL(e,t,n){return WN(e)?pL(e.enum,t,n):oP(e)?sL(t,n):pP(e)?aL(e.const,t,n):nP(e)?oL(t,n):rP(e)?lL(t,n):vP(e)?cL(t,n):SP(e)?uL(t,n):CL(e)?dL(e.pattern,t,n):SL(e)?fL(e.parameters[0],t,n):wP(e)?mL(e.anyOf,t,n):bN}function gL(e,t){return vM(e,(e,n)=>hL(e,n,t),()=>t)}function _L(e){return`^${gL(e,``)}$`}function vL(e){return MP(_L(e))}function yL(e,t){return NU(e)?JM(vL(e),{},t):xL(e,t)}function bL(e,t,n,r){return yL(IU(e,t,n),r)}function xL(e,t={}){return ZM(`TemplateLiteral`,[e],t)}function SL(e){return XM(e)&&bM(e,`action`)&&mM(e.action,`TemplateLiteral`)}function CL(e){return YM(e,`TemplateLiteral`)}function wL(e){return KM({"~kind":`ExtendsUnion`},{inferred:e})}function TL(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`inferred`)&&mM(e[`~kind`],`ExtendsUnion`)&&fM(e.inferred)}function EL(e){return KM({"~kind":`ExtendsTrue`},{inferred:e})}function DL(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`inferred`)&&mM(e[`~kind`],`ExtendsTrue`)&&fM(e.inferred)}function OL(){return KM({"~kind":`ExtendsFalse`},{})}function kL(e){return fM(e)&&bM(e,`~kind`)&&mM(e[`~kind`],`ExtendsFalse`)}function AL(e){return TL(e)||DL(e)}function jL(e,t,n){return AL(e)?t(e.inferred):n()}function ML(e,t,n,r){return jL(XR(e,n,r),r=>EL(jM(jM(e,r),{[t]:n})),()=>OL())}function NL(e,t){return EL(e)}function PL(e,t,n,r,i){return jL(XR(e,t,n),e=>jL(XR(e,t,r),e=>EL(e),()=>OL()),()=>jL(XR(e,t,i),e=>EL(e),()=>OL()))}function FL(e,t,n){return XR(e,t,TF(n))}function IL(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>IL(e,t,r),()=>OL()),()=>EL(e))}function LL(e,t,n){return XR(e,t,DF(n))}function RL(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>EL(e),()=>RL(e,t,r)),()=>OL())}function zL(e,t,n){return yN(n)?NL(e,t):zN(n)?PL(e,t,n.if,n.then,n.else):WN(n)?FL(e,t,n.enum):LN(n)?ML(e,n.name,t,n.extends):KN(n)?IL(e,t,n.allOf):CL(n)?LL(e,t,n.pattern):wP(n)?RL(e,t,n.anyOf):NN(n)?EL(e):OL()}function BL(e,t,n){return LN(n)?zL(e,t,n):yN(n)||NN(n)?EL(e):wL(e)}function VL(e,t){let n=ZN(e),r=ZN(t);return n&&r||!n&&r?!0:!(n&&!r)}function HL(e,t,n,r){return oN(r)?VL(t,r)?XR(e,n,r.items):OL():zL(e,t,r)}function UL(e,t,n){return nP(n)?EL(e):zL(e,t,n)}function WL(e,t,n){return rP(n)?EL(e):zL(e,t,n)}function GL(e,t,n,r,i){let a=LN(r)?t:r,o=LN(r)?r:t,s=TN(t),c=TN(r);return!s&&c?OL():jL(XR(e,a,o),e=>JL(e,n,i),()=>OL())}function KL(e,t,n,r){return vM(r,(r,i)=>GL(e,t,n,r,i),()=>TN(t)?EL(e):OL())}function qL(e,t,n){return vM(t,(t,r)=>KL(e,t,r,n),()=>EL(e))}function JL(e,t,n){return qL(e,t,n)}function YL(e,t,n){return uI(n)?EL(e):XR(e,t,n)}function XL(e,t,n,r){return yN(r)||NN(r)?EL(e):lN(r)?jL(JL(e,t,r.parameters),e=>YL(e,n,r.instanceType),()=>OL()):OL()}function ZL(e,t,n,r,i){return jL(XR(e,t,i),()=>XR(e,n,i),()=>XR(e,r,i))}function QL(e,t,n){return XR(e,TF(t),n)}function $L(e,t,n,r){return yN(r)||NN(r)?EL(e):fN(r)?jL(JL(e,t,r.parameters),e=>YL(e,n,r.returnType),()=>OL()):OL()}function eR(e,t,n){return oP(n)||vP(n)?EL(e):zL(e,t,n)}function tR(e,t,n){return XR(e,EF(t),n)}function nR(e,t,n){return t===n?EL(e):OL()}function rR(e,t,n){return pP(n)?nR(e,t,n.const):nP(n)?EL(e):zL(e,lP(t),n)}function iR(e,t,n){return pP(n)?nR(e,t,n.const):rP(n)?EL(e):zL(e,lP(t),n)}function aR(e,t,n){return pP(n)?nR(e,t,n.const):vP(n)?EL(e):zL(e,lP(t),n)}function oR(e,t,n){return pP(n)?nR(e,t,n.const):SP(n)?EL(e):zL(e,lP(t),n)}function sR(e,t,n){return sM(t.const)?rR(e,t.const,n):cM(t.const)?iR(e,t.const,n):uM(t.const)?aR(e,t.const,n):pM(t.const)?oR(e,t.const,n):JN()}function cR(e,t,n){return LN(n)?zL(e,t,n):EL(e)}function lR(e,t,n){return hP(n)?EL(e):zL(e,t,n)}function uR(e,t,n){return vP(n)?EL(e):zL(e,t,n)}function dR(e,t,n){return TN(t)?TN(n)?EL(e):OL():EL(e)}function fR(e,t,n){return LN(n)&&SN(n.extends)?OL():jL(XR(e,t,n),e=>dR(e,t,n),()=>OL())}function pR(e,t){return e.reduce((e,n)=>n in t&&AL(t[n])?{...e,...t[n].inferred}:JN(),{})}function mR(e,t,n){let r={};for(let i of xM(n))r[i]=i in t?fR({},t[i],n[i]):TN(n[i])?LN(n[i])?EL(jM(e,{[n[i].name]:n[i].extends})):EL(e):OL();let i=CM(r).every(e=>AL(e)),a=i?pR(xM(r),r):{};return i?EL(a):OL()}function hR(e,t,n){let r=mR(e,t,n);return AL(r)?EL(jM(e,r.inferred)):OL()}function gR(e,t,n){return hR(e,t,n)}function _R(e,t){return xM(t).reduce((n,r)=>({...n,[r]:bM(e,r)?wP(n[r])?CP([...n[r].anyOf,t[r]]):CP([e[r],t[r]]):t[r]}),e)}function vR(e,t,n,r){return vM(t,(t,i)=>jL(XR({},e[t],n),t=>vR(e,i,n,_R(r,t)),()=>OL()),()=>EL(r))}function yR(e,t,n,r){return vR(t,xM(t),r,e)}function bR(e,t,n){return iI(n)?yR(e,t,tI(n),rI(n)):AN(n)?gR(e,t,n.properties):zL(e,kN(t),n)}function xR(e,t){return mM(xM(t).length,0)?EL(e):OL()}function SR(e,t,n,r,i){return XR(e,n,i)}function CR(e,t,n,r){return iI(r)?SR(e,eI(t),n,eI(tI(r)),rI(r)):AN(r)?xR(e,r.properties):yN(r)||NN(r)?EL(e):OL()}function wR(e,t,n){return SP(n)?EL(e):zL(e,t,n)}function TR(e,t,n){return bP(n)?EL(e):zL(e,t,n)}function ER(e,t,n){return XR(e,DF(t),n)}function DR(e,t){return KM({"~kind":`Inferrable`},{name:e,type:t},{})}function OR(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`name`)&&bM(e,`type`)&&mM(e[`~kind`],`Inferrable`)&&pM(e.name)&&fM(e.type)}function kR(e){return oI(e)?LN(e.items)?oN(e.items.extends)?DR(e.items.name,e.items.extends.items):NN(e.items.extends)?DR(e.items.name,e.items.extends):void 0:JN():void 0}function AR(e){return LN(e)?DR(e.name,e.extends):void 0}function jR(e,t,n=[]){return vM(e,(e,r)=>jL(XR({},e,t),()=>jR(r,t,[...n,e]),()=>void 0),()=>n)}function MR(e,t,n,r){let i=jR(n,r);return oM(i)?EL(jM(e,{[t]:KP(i)})):OL()}function NR(e,t,n,r){let i=jR(n,r);return oM(i)?EL(jM(e,{[t]:CP(i)})):OL()}function PR(e){return[...e].reverse()}function FR(e,t){return t?PR(e):e}function IR(e){let t=e.length>0?e[0]:void 0;return XM(XM(t)?kR(t):void 0)}function LR(e,t,n,r,i,a){return jL(XR(e,n,i),e=>BR(e,t,r,a),()=>OL())}function RR(e,t,n,r,i){let a=kR(r);return OR(a)?MR(e,a.name,FR(n,t),a.type):vM(n,(n,a)=>LR(e,t,n,a,r,i),()=>OL())}function zR(e,t,n,r){return vM(r,(r,i)=>RR(e,t,n,r,i),()=>mM(n.length,0)?EL(e):OL())}function BR(e,t,n,r){return zR(e,t,n,r)}function VR(e,t,n){let r=FU(e,MU([],[]),n),i=IR(r);return BR(e,i,FR(t,i),FR(r,i))}function HR(e,t,n){let r=AR(n);return OR(r)?NR(e,r.name,t,r.type):vM(t,(t,r)=>jL(XR(e,t,n),e=>HR(e,r,n),()=>OL()),()=>EL(e))}function UR(e,t,n){let r=FU(e,MU([],[]),t);return qP(n)?VR(e,r,n.items):oN(n)?HR(e,r,n.items):zL(e,KP(r),n)}function WR(e,t,n){return uI(n)||lI(n)?EL(e):zL(e,t,n)}function GR(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>EL(e),()=>GR(e,t,r)),()=>OL())}function KR(e,t,n){return vM(t,(t,r)=>jL(GR(e,t,n),e=>KR(e,r,n),()=>OL()),()=>EL(e))}function qR(e,t,n){let r=AR(n);return OR(r)?NR(e,r.name,t,r.type):wP(n)?KR(e,t,n.anyOf):KR(e,t,[n])}function JR(e,t,n){return LN(n)?zL(e,t,n):yN(n)||NN(n)?EL(e):OL()}function YR(e,t,n){return uI(n)?EL(e):zL(e,t,n)}function XR(e,t,n){return yN(t)?BL(e,t,n):oN(t)?HL(e,t,t.items,n):nP(t)?UL(e,t,n):rP(t)?WL(e,t,n):lN(t)?XL(e,t.parameters,t.instanceType,n):zN(t)?ZL(e,t.if,t.then,t.else,n):WN(t)?QL(e,t.enum,n):fN(t)?$L(e,t.parameters,t.returnType,n):oP(t)?eR(e,t,n):KN(t)?tR(e,t.allOf,n):pP(t)?sR(e,t,n):SN(t)?cR(e,t,n):hP(t)?lR(e,t,n):vP(t)?uR(e,t,n):AN(t)?bR(e,t.properties,n):iI(t)?CR(e,tI(t),rI(t),n):SP(t)?wR(e,t,n):bP(t)?TR(e,t,n):CL(t)?ER(e,t.pattern,n):qP(t)?UR(e,t.items,n):lI(t)?WR(e,t,n):wP(t)?qR(e,t.anyOf,n):NN(t)?JR(e,t,n):uI(t)?YR(e,t,n):OL()}function ZR(e,t){return EF([...e,kN(t)])}function QR(e,t,n){return NU(e)?JM(ZR(e,t),{},n):ez(e,t,n)}function $R(e,t,n,r,i){return QR(IU(e,t,n),PU(e,t,r),i)}function ez(e,t,n={}){return ZM(`Interface`,[e,t],n)}function tz(e){return XM(e)&&bM(e,`action`)&&mM(e.action,`Interface`)}function nz(e,t,n){return e.includes(n)?!0:az([...e,n],t,t[n])}function rz(e,t,n){return iz(e,t,ON(n))}function iz(e,t,n){return vM(n,(n,r)=>az(e,t,n)?!0:iz(e,t,r),()=>!1)}function az(e,t,n){return hN(n)?nz(e,t,n.$ref):oN(n)?az(e,t,n.items):lN(n)?iz(e,t,[...n.parameters,n.instanceType]):fN(n)?iz(e,t,[...n.parameters,n.returnType]):tz(n)?rz(e,t,n.parameters[1]):KN(n)?iz(e,t,n.allOf):AN(n)?rz(e,t,n.properties):wP(n)?iz(e,t,n.anyOf):qP(n)?iz(e,t,n.items):iI(n)?az(e,t,rI(n)):!1}function oz(e,t,n){return az(e,t,n)}function sz(e,t){return t.reduce((t,n)=>oz([n],e,e[n])?[...t,n]:t,[])}function cz(e){return sz(e,DN(e))}function lz(e,t,n){return n.includes(t)?n:t in e?fz(e,e[t],[...n,t]):JN()}function uz(e,t,n){return dz(e,ON(t),n)}function dz(e,t,n){return t.reduce((t,n)=>fz(e,n,t),n)}function fz(e,t,n){return hN(t)?lz(e,t.$ref,n):oN(t)?fz(e,t.items,n):lN(t)?dz(e,[...t.parameters,t.instanceType],n):fN(t)?dz(e,[...t.parameters,t.returnType],n):tz(t)?uz(e,t.parameters[1],n):KN(t)?dz(e,t.allOf,n):AN(t)?uz(e,t.properties,n):wP(t)?dz(e,t.anyOf,n):qP(t)?dz(e,t.items,n):iI(t)?fz(e,rI(t),n):n}function pz(e,t,n){return fz(e,n,[t])}function mz(e){return vN()}function hz(e){return xM(e).reduce((t,n)=>({...t,[n]:_z(e[n])}),{})}function gz(e){return e.reduce((e,t)=>[...e,_z(t)],[])}function _z(e){return hN(e)?mz(e.$ref):oN(e)?aN(_z(e.items),sN(e)):lN(e)?cN(gz(e.parameters),_z(e.instanceType)):fN(e)?dN(gz(e.parameters),_z(e.returnType)):KN(e)?GN(gz(e.allOf)):AN(e)?kN(hz(e.properties)):iI(e)?QF(nI(e),_z(rI(e))):wP(e)?CP(gz(e.anyOf)):qP(e)?KP(gz(e.items)):e}function vz(e,t){return t in e?_z(e[t]):MN()}function yz(e){return vz(e.$defs,e.$ref)}function bz(e,t,n){let r=IU(e,MU([],[]),t),i=PU({},MU([],[]),n);return EF([...r,kN(i)])}function xz(e,t){return xM(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=tz(r)?bz(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function Sz(e,t,n){return PN(xz(e,pz(e,t,n)),t)}function Cz(e,t){return t in e?hN(e[t])?Cz(e,e[t].$ref):e[t]:xN()}function wz(e,t){return Cz(e,t)}function Tz(e){return FN(e)?yz(e):IN(e)?MN():e}function Ez(e,t,n){return XR(e,Tz(t),Tz(n))}function Dz(e,t){let n=[Ez({},e,t),Ez({},t,e)];return AL(n[0])&&AL(n[1])?0:AL(n[0])&&kL(n[1])?2:kL(n[0])&&AL(n[1])?3:1}function Oz(e,t,n=[],r=t){return vM(t,(t,i)=>{let a=Dz(e,t);return mM(a,2)||mM(a,0)?r:mM(a,1)?Oz(e,i,[...n,t],r):Oz(e,i,n,r)},()=>[...n,e])}function kz(e,t,n){let r=kF(e);return yN(r)||NN(r)?[r]:SN(r)?Az(t,n):AN(r)?Az(t,[...n,r]):Az(t,Oz(r,n))}function Az(e,t=[]){return vM(e,(e,n)=>kz(e,n,t),()=>t)}function jz(e){return zF(Az(e))}function Mz(e,t){return JM(kF(e),{},t)}function Nz(e,t,n,r){return Mz(BU(e,t,n),r)}function Pz(e,t=[]){return QM(e)&&mM(e.action,`Conditional`)?hN(e.parameters[0])?Pz(e.parameters[2],Pz(e.parameters[3],[...t,e.parameters[0].$ref])):Pz(e.parameters[2],Pz(e.parameters[3],t)):QM(e)&&mM(e.action,`Mapped`)&&QM(e.parameters[1])&&mM(e.parameters[1].action,`KeyOf`)&&hN(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function Fz(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function Iz(e,t,n=[]){return vM(e,(e,r)=>vM(t,(t,i)=>Iz(r,i,[...n,[t,e]]),()=>n),()=>n)}function Lz(e){return CL(e)?DF(e.pattern):WN(e)?TF(e.enum):e}function Rz(e){let t=Lz(e);return wP(t)?[...t.anyOf]:[t]}function zz(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function Bz(e,t){return t.reduce((t,n)=>[...t,...zz(e,n)],[])}function Vz(e){return e.reduce((e,t)=>mM(t[0],!0)?Bz(e,Rz(t[1])):Bz(e,[t[1]]),[[]])}function Hz(e,t,n){let r=Iz(t,Fz(e,Pz(n)));return QM(n)&&mM(n.action,`Conditional`)||QM(n)&&mM(n.action,`Mapped`)?Vz(r):[t]}function Uz(){return[`(not-resolvable)`,xN()]}function Wz(){return[`(not-generic)`,xN()]}function Gz(e,t,n){return[e,gN(t,n)]}function Kz(e,t,n){return t in e?qz(e,t,e[t],n):Uz()}function qz(e,t,n,r){return _N(n)?Gz(t,n.parameters,n.expression):hN(n)?Kz(e,n.$ref,r):Wz()}function Jz(e,t,n){return qz(e,`(anonymous)`,t,n)}function Yz(e,t,n){if(LN(t)||fB(t)||AL(Ez({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function Xz(e,t,n,r,i){let a=BU(e,t,i);return Yz(n,a,r),jM(e,{[n]:a})}function Zz(e,t,n,r,i){let a=BU(e,t,n.extends),o=BU(e,t,n.equals);return vM(i,(i,o)=>Qz(Xz(e,t,n.name,a,i),t,r,o),()=>Qz(Xz(e,t,n.name,a,o),t,r,[]))}function Qz(e,t,n,r){return vM(n,(n,i)=>Zz(e,t,n,i,r),()=>e)}function $z(e,t,n,r){return Qz(e,t,n,r)}var eB=0,tB=0;function nB(){if(!gM(tB,kM().maxInstantiationCount))throw Error(`Type instantiation is excessively deep and possibly infinite`)}function rB(){nB(),tB++,eB++}function iB(){eB--,mM(eB,0)&&(tB=0)}function aB(e){return hM(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function oB(e,t){return mM(aB(e),t)}function sB(e,t,n,r,i,a){rB();try{let o=$z(e,t,r,a),s=BU(o,MU([...t.callstack,n.$ref],t.visited),i);return BU(o,MU([],[]),s)}finally{iB()}}function cB(e,t,n,r,i,a){return a.reduce((a,o)=>{let s=sB(e,t,n,r,i,o);return[...a,s]},[])}function lB(e,t,n,r,i,a){let o=cB(e,t,n,r,i,Hz(r,a,i));return mM(o.length,1)?o[0]:OF(o)}function uB(e,t,n,r){let i=IU(e,t,r),a=Jz(e,n,r),o=a[0],s=a[1];return _N(s)?oB(t,o)?dB(mN(o),i):lB(e,t,mN(o),s.parameters,s.expression,i):dB(n,i)}function dB(e,t){return KM({"~kind":`Call`},{type:`call`,target:e,arguments:t},{})}function fB(e){return YM(e,`Call`)}function pB(e){return qM(e,[`~immutable`])}function mB(e,t){return JM(pB(e),{},t)}function hB(e,t,n,r){return mB(BU(e,t,n),r)}function gB(e,t){return e(t)}function _B(e,t){return pM(t)?lP(gB(e,t)):lP(t)}function vB(e,t){return bB(e,DF(t))}function yB(e,t){return CP(t.map(t=>bB(e,t)))}function bB(e,t){return pP(t)?_B(e,t.const):CL(t)?vB(e,t.pattern):wP(t)?yB(e,t.anyOf):t}function xB(e,t={}){return ZM(`Capitalize`,[e],t)}function SB(e,t={}){return ZM(`Lowercase`,[e],t)}function CB(e,t={}){return ZM(`Uncapitalize`,[e],t)}function wB(e,t={}){return ZM(`Uppercase`,[e],t)}var TB=e=>e[0].toUpperCase()+e.slice(1),EB=e=>e.toLowerCase(),DB=e=>e[0].toLowerCase()+e.slice(1),OB=e=>e.toUpperCase();function kB(e,t){return NU([e])?JM(bB(TB,e),{},t):xB(e,t)}function AB(e,t){return NU([e])?JM(bB(EB,e),{},t):SB(e,t)}function jB(e,t){return NU([e])?JM(bB(DB,e),{},t):CB(e,t)}function MB(e,t){return NU([e])?JM(bB(OB,e),{},t):wB(e,t)}function NB(e,t,n,r){return kB(BU(e,t,n),r)}function PB(e,t,n,r){return AB(BU(e,t,n),r)}function FB(e,t,n,r){return jB(BU(e,t,n),r)}function IB(e,t,n,r){return MB(BU(e,t,n),r)}function LB(e,t,n,r,i={}){return ZM(`Conditional`,[e,t,n,r],i)}function RB(e,t,n,r,i,a){let o=Ez(e,n,r);return TL(o)?CP([BU(o.inferred,t,i),BU(e,t,a)]):DL(o)?BU(o.inferred,t,i):BU(e,t,a)}function zB(e,t,n,r,i,a,o){return NU([n,r])?JM(RB(e,t,n,r,i,a),{},o):LB(n,r,i,a,o)}function BB(e,t,n,r,i,a,o){return zB(e,t,BU(e,t,n),BU(e,t,r),i,a,o)}function VB(e,t={}){return ZM(`ConstructorParameters`,[e],t)}function HB(e){let t=lN(e)?e.parameters:[];return KP(FU({},MU([],[]),t))}function UB(e,t){return NU([e])?JM(HB(e),{},t):VB(e,t)}function WB(e,t,n,r){return UB(BU(e,t,n),r)}function GB(e,t,n={}){return ZM(`Exclude`,[e,t],n)}function KB(e,t,n){return NU([e,t])?JM(CF(e,t),{},n):GB(e,t,n)}function qB(e,t,n,r,i){return KB(BU(e,t,n),BU(e,t,r),i)}function JB(e,t,n={}){return ZM(`Extract`,[e,t],n)}function YB(e,t){return AL(Ez({},e,t))?[e]:[]}function XB(e,t,n=[]){return vM(e,(e,r)=>XB(r,t,[...n,...YB(e,t)]),()=>n)}function ZB(e,t){let n=kF(e);return OF(XB(wP(n)?n.anyOf:[n],t))}function QB(e,t,n){return NU([e,t])?JM(ZB(e,t),{},n):JB(e,t,n)}function $B(e,t,n,r,i){return QB(BU(e,t,n),BU(e,t,r),i)}function eV(e,t,n={}){return ZM(`Index`,[e,t],n)}function tV(e,t){return uV(wz(e,t))}function nV(e,t,n){return uV(wF(e,t,n))}function rV(e,t){let n=xM(e).filter(e=>!bM(t,e)),r=xM(t).filter(t=>!bM(e,t)),i=xM(e).filter(e=>bM(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:EF([e[r],t[r]])}),{});return jM(jM(a,o),s)}function iV(e){return e.reduce((e,t)=>rV(e,uV(t)),{})}function aV(e){return e}function oV(e){return uV(iF(KP(e)))}function sV(e,t){return xM(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:OF([e[r],t[r]])}),{})}function cV(e,t){return vM(e,(e,n)=>cV(n,sV(t,uV(e))),()=>t)}function lV(e){return vM(e,(e,t)=>cV(t,uV(e)),()=>JN())}function uV(e){return FN(e)?tV(e.$defs,e.$ref):zN(e)?nV(e.if,e.then,e.else):KN(e)?iV(e.allOf):wP(e)?lV(e.anyOf):qP(e)?oV(e.items):AN(e)?aV(e.properties):{}}function dV(e){return kN(uV(e))}var fV=RegExp(`^(?:0|[1-9][0-9]*)$`);function pV(e){let t=`${e}`;return fV.test(t)?parseInt(t):e}function mV(e){return lP(pV(e))}function hV(e){return e.map(e=>gV(e))}function gV(e){return KN(e)?GN(hV(e.allOf)):wP(e)?CP(hV(e.anyOf)):pP(e)?mV(e.const):e}function _V(e,t){return AL(Ez({},gV(t),_P()))?e:pP(t)&&mM(t.const,`length`)?_P():xN()}function vV(e,t){return TV(wz(e,t))}function yV(e,t,n){return TV(wF(e,t,n))}function bV(e){return TV(TF(e))}function xV(e){return TV(EF(e))}function SV(e){return[`${e}`]}function CV(e){return TV(DF(e))}function wV(e){return e.reduce((e,t)=>[...e,...TV(t)],[])}function TV(e){return FN(e)?vV(e.$defs,e.$ref):zN(e)?yV(e.if,e.then,e.else):WN(e)?bV(e.enum):KN(e)?xV(e.allOf):pP(e)?SV(e.const):CL(e)?CV(e.pattern):wP(e)?wV(e.anyOf):[]}function EV(e){return TV(e)}function DV(e,t){return t.map(t=>OV(e,t))}function OV(e,t){return oN(t)?aN(OV(e,t.items)):lN(t)?cN(DV(e,t.parameters),OV(e,t.instanceType)):fN(t)?dN(DV(e,t.parameters),OV(e,t.returnType)):qP(t)?KP(DV(e,t.items)):wP(t)?CP(DV(e,t.anyOf)):KN(t)?GN(DV(e,t.allOf)):sI(t)?kN(e):t}function kV(e,t){return OV(e,t)}function AV(e,t){return kV(e,t in e?e[t]:xN())}function jV(e,t){return t.reduce((t,n)=>[...t,AV(e,n)],[])}function MV(e,t){return OF(jV(e,EV(t)))}var NV=new RegExp(JF);function PV(e){return e.filter(e=>NV.test(e))}function FV(e){return OF(jV(e,PV(DN(e))))}function IV(e,t){return vP(t)?FV(e):MV(e,t)}function LV(e){return lP(pV(e))}function RV(e){return e.map(e=>zV(e))}function zV(e){return KN(e)?GN(RV(e.allOf)):wP(e)?CP(RV(e.anyOf)):pP(e)?LV(e.const):e}function BV(e,t){return e.reduceRight((e,n,r)=>AL(Ez({},lP(r),t))?[n,...e]:e,[])}function VV(e,t){return AF(BV(e,zV(t)))}function HV(e){return AF(e)}function UV(e,t){return pP(t)&&mM(t.const,`length`)?lP(e.length):vP(t)||oP(t)?HV(e):VV(e,t)}function WV(e,t){return oN(e)?_V(e.items,t):AN(e)?IV(e.properties,t):qP(e)?UV(e.items,t):xN()}function GV(e){return FN(e)||zN(e)||KN(e)||wP(e)?dV(e):e}function KV(e,t,n){return NU([e,t])?JM(WV(GV(e),t),{},n):eV(e,t,n)}function qV(e,t,n,r,i){return KV(BU(e,t,n),BU(e,t,r),i)}function JV(e,t={}){return ZM(`InstanceType`,[e],t)}function YV(e){return lN(e)?e.instanceType:xN()}function XV(e,t){return NU([e])?JM(YV(e),{},t):JV(e,t)}function ZV(e,t,n,r={}){return XV(BU(e,t,n),r)}function QV(e,t={}){return ZM(`KeyOf`,[e],t)}function $V(){return CP([_P(),xP(),yP()])}function eH(e){return _P()}function tH(e){return e.reduce((e,t)=>uP(t)?[...e,lP(pV(t))]:JN(),[])}function nH(e){return AF(tH(xM(e)))}function rH(e){return nI(e)}function iH(e){return AF(e.map((e,t)=>lP(t)))}function aH(e){return yN(e)?$V():oN(e)?eH(e.items):AN(e)?nH(e.properties):iI(e)?rH(e):qP(e)?iH(e.items):xN()}function oH(e){return FN(e)||zN(e)||KN(e)||wP(e)?dV(e):e}function sH(e,t){return NU([e])?JM(aH(oH(e)),{},t):QV(e,t)}function cH(e,t,n,r){return sH(BU(e,t,n),r)}function lH(e,t,n,r,i={}){return ZM(`Mapped`,[e,t,n,r],i)}function uH(e){return mH(DF(e))}function dH(e){return e.reduce((e,t)=>[...e,...mH(t)],[])}function fH(e){return mH(TF(e))}function pH(e){return uM(e)?[lP(`${e}`)]:[lP(e)]}function mH(e){return WN(e)?fH(e.enum):pP(e)?pH(e.const):CL(e)?uH(e.pattern):wP(e)?dH(e.anyOf):[e]}function hH(e){return mH(e)}function gH(e){return CL(e)?DF(e.pattern):e}function _H(e,t,n,r,i,a){let o=jM(e,{[n.name]:r}),s=gH(BU(o,t,i)),c=BU(o,t,a);return dP(s)||fP(s)?{[s.const]:c}:{}}function vH(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,_H(e,t,n,o,i,a)],[])}function yH(e){return e.reduce((e,t)=>[...e,kN(t)],[])}function bH(e,t,n,r,i,a){return EF(yH(vH(e,t,n,hH(r),i,a)))}function xH(e,t,n,r,i,a,o){return NU([r])?JM(bH(e,t,n,r,i,a),{},o):lH(n,r,i,a,o)}function SH(e,t,n,r,i,a,o){return xH(e,t,n,BU(e,t,r),i,a,o)}function CH(e,t,n){let r=jM(e,t);return xM(t).filter(e=>n.includes(e)).reduce((e,n)=>({...e,[n]:Sz(r,n,t[n])}),{})}function wH(e,t,n){let r=jM(e,t);return xM(t).filter(e=>!n.includes(e)).reduce((e,n)=>({...e,[n]:BU(r,MU([],[]),t[n])}),{})}function TH(e,t,n){let r=cz(t),i=CH(e,t,r),a=wH(e,t,r);return JM({...i,...a},{},n)}function EH(e,t,n,r){return TH(e,n,r)}function DH(e,t={}){return ZM(`NonNullable`,[e],t)}function OH(e){return KB(e,CP([mP(),cI()]),{})}function kH(e,t){return NU([e])?JM(OH(e),{},t):DH(e,t)}function AH(e,t,n,r){return kH(BU(e,t,n),r)}function jH(e,t,n={}){return ZM(`Omit`,[e,t],n)}function MH(e){let t=dV(e);return AN(t)?t.properties:JN()}function NH(e,t){return xM(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function PH(e,t){return kN(NH(MH(e),EV(t)))}function FH(e,t,n){return NU([e,t])?JM(PH(e,t),{},n):jH(e,t,n)}function IH(e,t,n,r,i){return FH(BU(e,t,n),BU(e,t,r),i)}function LH(e,t={}){return ZM(`Parameters`,[e],t)}function RH(e){let t=fN(e)?e.parameters:[];return KP(FU({},MU([],[]),t))}function zH(e,t){return NU([e])?JM(RH(e),{},t):LH(e,t)}function BH(e,t,n,r){return zH(BU(e,t,n),r)}function VH(e,t={}){return ZM(`Partial`,[e],t)}function HH(e,t={}){return YH(e,t)}function UH(e,t){let n=JH(wz(e,t));return PN(jM(e,{[t]:n}),t)}function WH(e,t,n){return JH(wF(e,t,n))}function GH(e){return JH(EF(e))}function KH(e){return CP(e.map(e=>JH(e)))}function qH(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:CN(e[n])}),{}))}function JH(e){return FN(e)?UH(e.$defs,e.$ref):zN(e)?WH(e.if,e.then,e.else):KN(e)?GH(e.allOf):wP(e)?KH(e.anyOf):AN(e)?qH(e.properties):kN({})}function YH(e,t){return NU([e])?JM(JH(e),{},t):VH(e,t)}function XH(e,t,n,r){return YH(BU(e,t,n),r)}function ZH(e,t,n={}){return ZM(`Pick`,[e,t],n)}function QH(e,t){return xM(e).reduce((n,r)=>t.includes(r)?jM(n,{[r]:e[r]}):n,{})}function $H(e,t){return kN(QH(MH(e),EV(t)))}function eU(e,t,n){return NU([e,t])?JM($H(e,t),{},n):ZH(e,t,n)}function tU(e,t,n,r,i){return eU(BU(e,t,n),BU(e,t,r),i)}function nU(e,t={}){return ZM(`ReadonlyObject`,[e],t)}function rU(e){return WU(aN(e))}function iU(e,t){let n=uU(wz(e,t));return PN(jM(e,{[t]:n}),t)}function aU(e,t,n){return uU(wF(e,t,n))}function oU(e){return uU(EF(e))}function sU(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:QN(e[n])}),{}))}function cU(e){return WU(KP(e))}function lU(e){return CP(e.map(e=>uU(e)))}function uU(e){return oN(e)?rU(e.items):FN(e)?iU(e.$defs,e.$ref):zN(e)?aU(e.if,e.then,e.else):KN(e)?oU(e.allOf):AN(e)?sU(e.properties):qP(e)?cU(e.items):wP(e)?lU(e.anyOf):e}function dU(e,t){return NU([e])?JM(uU(e),{},t):nU(e)}function fU(e,t,n,r){return dU(BU(e,t,n),r)}function pU(e,t,n,r){return t.visited.includes(r)?n:r in e?BU(e,MU(t.callstack,[...t.visited,r]),e[r]):n}function mU(e,t){let n=yU(wz(e,t));return PN(jM(e,{[t]:n}),t)}function hU(e,t,n){return yU(wF(e,t,n))}function gU(e){return yU(EF(e))}function _U(e){return CP(e.map(e=>yU(e)))}function vU(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:nF(e[n])}),{}))}function yU(e){return FN(e)?mU(e.$defs,e.$ref):zN(e)?hU(e.if,e.then,e.else):KN(e)?gU(e.allOf):wP(e)?_U(e.anyOf):AN(e)?vU(e.properties):kN({})}function bU(e,t={}){return ZM(`Required`,[e],t)}function xU(e,t){return NU([e])?JM(yU(e),{},t):bU(e,t)}function SU(e,t,n,r){return xU(BU(e,t,n),r)}function CU(e,t={}){return ZM(`ReturnType`,[e],t)}function wU(e){return fN(e)?e.returnType:xN()}function TU(e,t){return NU([e])?JM(wU(e),{},t):CU(e,t)}function EU(e,t,n,r={}){return TU(BU(e,t,n),r)}function DU(e,t){return ZM(`With`,[e,t],{})}function OU(e,t){return NU([e])?JM(e,{},t):DU(e,t)}function kU(e,t,n,r){return OU(BU(e,t,n),r)}function AU(e){return oI(e)?qP(e.items)?jU(e.items.items):LN(e.items)||hN(e.items)?[e]:[xN()]:[e]}function jU(e){return e.reduce((e,t)=>[...e,...AU(t)],[])}function MU(e,t){return{callstack:e,visited:t}}function NU(e){return vM(e,(e,t)=>!hN(e)&&NU(t),()=>!0)}function PU(e,t,n){return xM(n).reduce((r,i)=>({...r,[i]:BU(e,t,n[i])}),{})}function FU(e,t,n){return jU(IU(e,t,n))}function IU(e,t,n){return n.map(n=>BU(e,t,n))}function LU(e,t){let n=TN(e)?rN(t,{}):t,r=$N(e)?eN(n,{}):n;return ZN(e)?HU(r,{}):r}function RU(e,t,n,r,i){return mM(n,`AddImmutable`)?UU(e,t,r[0],i):mM(n,`RemoveImmutable`)?hB(e,t,r[0],i):mM(n,`AddReadonly`)?tN(e,t,r[0],i):mM(n,`RemoveReadonly`)?ZP(e,t,r[0],i):mM(n,`AddOptional`)?iN(e,t,r[0],i):mM(n,`RemoveOptional`)?tF(e,t,r[0],i):mM(n,`Capitalize`)?NB(e,t,r[0],i):mM(n,`Conditional`)?BB(e,t,r[0],r[1],r[2],r[3],i):mM(n,`ConstructorParameters`)?WB(e,t,r[0],i):mM(n,`Evaluate`)?Nz(e,t,r[0],i):mM(n,`Exclude`)?qB(e,t,r[0],r[1],i):mM(n,`Extract`)?$B(e,t,r[0],r[1],i):mM(n,`Index`)?qV(e,t,r[0],r[1],i):mM(n,`InstanceType`)?ZV(e,t,r[0],i):mM(n,`Interface`)?$R(e,t,r[0],r[1],i):mM(n,`KeyOf`)?cH(e,t,r[0],i):mM(n,`Lowercase`)?PB(e,t,r[0],i):mM(n,`Mapped`)?SH(e,t,r[0],r[1],r[2],r[3],i):mM(n,`Module`)?EH(e,t,r[0],i):mM(n,`NonNullable`)?AH(e,t,r[0],i):mM(n,`Pick`)?tU(e,t,r[0],r[1],i):mM(n,`Parameters`)?BH(e,t,r[0],i):mM(n,`Partial`)?XH(e,t,r[0],i):mM(n,`Omit`)?IH(e,t,r[0],r[1],i):mM(n,`ReadonlyObject`)?fU(e,t,r[0],i):mM(n,`Record`)?qF(e,t,r[0],r[1],i):mM(n,`Required`)?SU(e,t,r[0],i):mM(n,`ReturnType`)?EU(e,t,r[0],i):mM(n,`TemplateLiteral`)?bL(e,t,r[0],i):mM(n,`Uncapitalize`)?FB(e,t,r[0],i):mM(n,`Uppercase`)?IB(e,t,r[0],i):mM(n,`With`)?kU(e,t,r[0],r[1]):ZM(n,r,i)}function zU(e,t,n){return LU(n,hN(n)?pU(e,t,n,n.$ref):oN(n)?aN(BU(e,t,n.items),sN(n)):fB(n)?uB(e,t,n.target,n.arguments):lN(n)?cN(IU(e,t,n.parameters),BU(e,t,n.instanceType),uN(n)):fN(n)?dN(IU(e,t,n.parameters),BU(e,t,n.returnType),pN(n)):zN(n)?RN(BU(e,t,n.if),BU(e,t,n.then),BU(e,t,n.else),BN(n)):KN(n)?GN(IU(e,t,n.allOf),qN(n)):AN(n)?kN(PU(e,t,n.properties),jN(n)):iI(n)?$F(tI(n),BU(e,t,rI(n))):oI(n)?aI(BU(e,t,n.items)):qP(n)?KP(FU(e,t,n.items),JP(n)):wP(n)?CP(IU(e,t,n.anyOf),TP(n)):n)}function BU(e,t,n){return QM(n)?RU(e,t,n.action,n.parameters,n.options):zU(e,t,n)}function VU(e){return JM(e,{"~immutable":!0},{})}function HU(e,t){return JM(VU(e),{},t)}function UU(e,t,n,r){return HU(BU(e,t,n),r)}function WU(e,t={}){return HU(e,t)}var GU=[`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],KU=[`off`,...GU],qU=[`text`,`image`],JU=[`none`,`short`,`long`],YU=[`short`,`long`];UN(GU);var XU=UN(KU);UN(qU),UN(JU),HH(QF(XU,CP([xP(),mP()]))),HH(QF(UN(YU),_P({exclusiveMinimum:0})),{description:`Best-effort prompt cache lifetime in seconds for each retention tier. A missing tier means the lifetime is unknown, so Pi does not warm it.`});var ZU={input:_P({description:`Input cost in USD per million tokens.`}),output:_P({description:`Output cost in USD per million tokens.`}),cacheRead:_P({description:`Cache-read cost in USD per million tokens.`}),cacheWrite:_P({description:`Cache-write cost in USD per million tokens.`})};kN(ZU);var QU=kN({inputTokensAbove:_P({description:`Use this tier when total request input exceeds this token count.`}),...ZU});kN({...ZU,tiers:wN(aN(QU,{description:`Request-wide pricing tiers. The highest matching input threshold applies to the full request.`}))});function $U(e){return kN({maxWidth:wN(aP({minimum:1})),maxHeight:wN(aP({minimum:1})),maxBytes:wN(aP({minimum:1,description:`Maximum base64-encoded payload size in bytes.`})),jpegQuality:wN(aP({minimum:1,maximum:100}))},e)}$U();var eW=kN({resize:wN($U({description:`Cache-safe resize profile applied before a new image enters conversation history.`})),maxPerMessage:wN(aP({minimum:1,description:`Maximum images accepted in one provider message.`})),maxPerRequest:wN(aP({minimum:1,description:`Maximum images accepted across one provider request.`}))});kN({maxRequestBytes:wN(aP({minimum:1,description:`Maximum serialized provider request size in bytes.`})),images:wN(eW)});function tW({sessionId:e,template:t,existingIds:n,apiKey:r,onClose:i,onAdd:a}){let{t:o}=W(),[s,c]=(0,K.useState)([]),[l,u]=(0,K.useState)(new Set),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)(!0),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(0),x=(0,K.useRef)({template:t,apiKey:r,existingIds:n}),S=new Set(n),C=Math.max(0,100-S.size),w=s.filter(e=>`${e.id} ${e.name}`.toLowerCase().includes(d.trim().toLowerCase())),T=w.filter(e=>!S.has(e.id)),E=T.length>0&&T.every(e=>l.has(e.id));return(0,K.useEffect)(()=>{let t=new AbortController,{template:n,apiKey:r,existingIds:i}=x.current;return m(!0),v(!1),new de().discoverProviderModels(e,{provider:n.provider,baseUrl:n.baseUrl,api:n.api,...r.trim()?{apiKey:r.trim()}:{}},t.signal).then(e=>{t.signal.aborted||(c(e.models),g(e.truncated),m(!1),u(new Set(e.models.filter(e=>!i.includes(e.id)).slice(0,Math.max(0,100-i.length)).map(e=>e.id))))},()=>{t.signal.aborted||(v(!0),m(!1))}),()=>t.abort()},[e,y]),(0,q.jsx)(Se,{isOpen:!0,width:380,padding:0,className:`models-picker-dialog`,"aria-label":o(`providerPickerTitle`),onOpenChange:e=>!e&&i(),children:(0,q.jsxs)(`div`,{className:`models-picker`,children:[(0,q.jsxs)(`header`,{children:[(0,q.jsx)(`h2`,{children:o(`providerPickerTitle`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":o(`close`),onClick:i,children:(0,q.jsx)(je,{})})]}),(0,q.jsx)(`p`,{children:o(`providerPickerIntro`)}),(0,q.jsxs)(`div`,{className:`models-picker-toolbar`,children:[(0,q.jsx)(`input`,{"data-autofocus":!0,type:`search`,"aria-label":o(`providerPickerSearch`),placeholder:o(`providerPickerSearch`),value:d,onKeyDown:e=>{e.key===`Enter`&&e.preventDefault()},onChange:e=>f(e.target.value)}),(0,q.jsx)(`button`,{type:`button`,className:`models-link`,disabled:p||!T.length,onClick:()=>u(e=>{let t=new Set(e);for(let e of T)E?t.delete(e.id):t.size(0,q.jsxs)(`label`,{className:`models-picker-row`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:S.has(e.id)||l.has(e.id),disabled:S.has(e.id)||!l.has(e.id)&&l.size>=C,onChange:t=>u(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}),(0,q.jsx)(`span`,{title:e.name,children:e.id}),S.has(e.id)&&(0,q.jsx)(`small`,{children:o(`providerPickerAdded`)})]},e.id)),!p&&!_&&!w.length&&(0,q.jsx)(`p`,{className:`models-picker-empty`,children:o(d?`providerPickerNoMatch`:`providerPickerEmpty`)}),_&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[(0,q.jsx)(`p`,{children:o(`providerPickerError_load`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:()=>b(e=>e+1),children:o(`retryAdmissionCheck`)})]})]}),h&&(0,q.jsx)(`p`,{className:`models-hint`,children:o(`providerPickerBounded`)}),(0,q.jsxs)(`footer`,{children:[(0,q.jsx)(`span`,{className:`models-hint`,"aria-live":`polite`,children:l.size>0&&o(`providerPickerSelected`,{count:l.size})}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:i,children:o(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:!l.size||p||_,onClick:()=>a(s.filter(e=>l.has(e.id))),children:o(`providerPickerSave`)})]})]})})}function nW(e){let t=e.trim();if(!t)return;let n=/^(\d+(?:\.\d+)?)([km])?$/i.exec(t);if(!n)return NaN;let r=n[2]?.toLowerCase()===`m`?1e6:n[2]?.toLowerCase()===`k`?1e3:1,i=Number(n[1])*r,a=Math.round(i),o=Math.abs(i-a)<1e-6?a:i;return Number.isSafeInteger(o)&&o>0&&o<=1e8?o:NaN}function rW(e){if(e===void 0)return``;if(Number.isInteger(e)&&e>0){if(e%1e6==0)return`${e/1e6}M`;if(e%1e3==0)return`${e/1e3}K`}return String(e)}function iW({sessionId:e,providerId:t,configuration:n,auth:r,isNew:i,custom:a,taken:o,currentModel:s,availableModels:c,busy:l,onDirty:u,onSaving:d,onClose:f,onReload:p}){let{t:m}=W(),[h]=(0,K.useState)(()=>{let e=n.providers?.find(e=>e.provider===t),i=n.models.filter(e=>e.provider===t).map(e=>({...e,rowKey:crypto.randomUUID()}));return{provider:t,name:e?.name||r?.name||t,baseUrl:e?.baseUrl||i[0]?.baseUrl||r?.baseUrl||``,api:e?.api||i[0]?.api||r?.api||`openai-completions`,models:i}}),[g]=(0,K.useState)(n.revision),[_,v]=(0,K.useState)(h),[y,b]=(0,K.useState)(``),x=!i&&!!r?.authMethods.includes(`oauth`),S=a||!!r?.authMethods.includes(`api_key`),[C,w]=(0,K.useState)(x&&(!r?.configured||r?.subscription||!S)?`oauth`:`api_key`),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1),k=(0,K.useRef)(null),A=(0,K.useRef)(!1),[j,M]=(0,K.useState)(new Set),[N,P]=(0,K.useState)({}),[F,I]=(0,K.useState)(!1),[ee,L]=(0,K.useState)(null),[R,te]=(0,K.useState)(!1),z=(0,K.useRef)(null),B=(0,K.useRef)({onDirty:u,onSaving:d});B.current={onDirty:u,onSaving:d};let ne=JSON.stringify(_)!==JSON.stringify(h),re=ne||y.length>0;(0,K.useEffect)(()=>{B.current.onDirty(re)},[re]),(0,K.useEffect)(()=>{B.current.onSaving(F||T)},[F,T]),(0,K.useEffect)(()=>{D?A.current=!0:A.current&&(A.current=!1,k.current?.focus({preventScroll:!0}))},[D]),(0,K.useEffect)(()=>()=>{z.current?.abort(),B.current.onSaving(!1),B.current.onDirty(!1)},[]);let V=n.providers?.find(e=>e.provider===t)?.editable!==!1,ie=l||F||T,ae=ie||R||!V,oe=!/^[a-zA-Z0-9._-]+$/.test(_.provider)||[`__proto__`,`constructor`,`prototype`].includes(_.provider)||i&&a&&o.includes(_.provider),se=_.models.findIndex(e=>!e.id.trim()||[e.contextWindow,e.maxTokens].some(e=>e!==void 0&&!Number.isFinite(e))||_.models.some(t=>t.rowKey!==e.rowKey&&t.id.trim()===e.id.trim())),ce=se!==-1,le=i&&a||ne,H=!oe&&!/[\r\n\u0000]/u.test(y)&&(R||!le||(!a||_.models.length>0)&&!ce&&!!_.baseUrl)&&(le||y.trim().length>0),ue=e=>{v(t=>({...t,...e})),ee!==`conflict`&&L(null)},fe=(e,t)=>ue({models:_.models.map((n,r)=>r===e?{...n,...t}:n)}),pe=_.models.map(e=>n.thinkingDefaults?.[`${e.provider}/${e.id}`]),me=_.models.map((e,t)=>{let n=e.thinkingLevelMap??pe[t];return KU.filter(e=>n?.[e]!==null&&(e!==`xhigh`&&e!==`max`||n?.[e]!==void 0))}),he={id:``,name:``,reasoning:!1,provider:_.provider,baseUrl:_.baseUrl,api:_.api},_e=async()=>{if(ie||D||!H||ee===`conflict`)return;let t=new AbortController;z.current=t,I(!0),L(null);let n=R,r=new de;try{if(le&&!n){if(await r.changeProviderConfiguration(e,g,{action:`save`,configuration:{..._,name:_.name.trim()||_.provider,models:_.models.map(({rowKey:e,...t})=>({...t,id:t.id.trim(),name:t.name.trim()||t.id.trim(),provider:_.provider,baseUrl:_.baseUrl===h.baseUrl&&t.baseUrl||_.baseUrl,api:_.api===h.api?t.api:_.api}))}},t.signal),t.signal.aborted)return;n=!0,te(!0)}if(y.trim()&&await r.saveProviderKey(e,_.provider,y.trim(),t.signal),t.signal.aborted)return;b(``),B.current.onDirty(!1),f(_.name||_.provider,_.provider)}catch(e){t.signal.aborted||L(e instanceof ge&&e.code===`MODEL_CONFIGURATION_CONFLICT`?`conflict`:e instanceof ge&&e.code===`MODEL_NOT_AVAILABLE`?`current`:n?`key`:`failed`)}finally{t.signal.aborted||I(!1)}},ve=e=>(0,q.jsxs)(`label`,{className:`models-field`,children:[m(e===`name`?`providerDisplayName`:`modelConfig_${e}`),(0,q.jsx)(`input`,{type:e===`baseUrl`?`url`:`text`,value:_[e],maxLength:e===`baseUrl`?2048:160,autoComplete:`off`,disabled:ae,required:e===`provider`||e===`baseUrl`&&le,"aria-invalid":e===`provider`&&_.provider.length>0&&oe,placeholder:e===`provider`?`my-provider`:e===`name`?_.provider:`https://api.example.com/v1`,onChange:t=>ue({[e]:t.target.value})})]}),ye=(0,q.jsxs)(`label`,{className:`models-field`,htmlFor:`provider-api-${t||`custom`}`,children:[m(`modelConfig_api`),(0,q.jsx)(Tj,{id:`provider-api-${t||`custom`}`,label:m(`modelConfig_api`),value:_.api,disabled:ae,onChange:e=>{(e===`openai-responses`||e===`openai-completions`||e===`anthropic-messages`)&&ue({api:e})},options:[{value:`openai-completions`,label:`OpenAI Chat Completions`},{value:`openai-responses`,label:`OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`}]})]}),be=(0,q.jsxs)(`div`,{className:`models-catalog`,children:[(0,q.jsxs)(`div`,{className:`models-list-head`,children:[(0,q.jsx)(`span`,{children:m(`modelSettings`)}),(0,q.jsx)(`button`,{type:`button`,ref:k,className:`models-link`,disabled:ae||oe||!_.baseUrl,onClick:()=>O(!0),children:m(`providerFetchModels`)})]}),!V&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerModelsReadOnly`)}),_.models.length===0&&(0,q.jsx)(`p`,{className:`models-empty`,children:m(a?`providerModelsEmpty`:`providerModelsInherited`,{count:c.length})}),(0,q.jsxs)(`div`,{className:`models-entry-list`,children:[s&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerCurrentSessionModel`,{model:`${s.provider} / ${s.id}`})}),_.models.map((e,t)=>(0,q.jsxs)(`div`,{className:`models-entry`,children:[s?.provider===_.provider&&s.id===e.id&&(0,q.jsx)(`p`,{className:`models-current-label`,children:m(`currentModel`)}),(0,q.jsxs)(`div`,{className:`models-entry-row`,children:[(0,q.jsx)(`input`,{"aria-label":m(`providerModelId`,{number:t+1}),placeholder:m(`modelConfig_id`),value:e.id,maxLength:256,required:!0,disabled:ae||s?.provider===_.provider&&s.id===e.id,onChange:e=>fe(t,{id:e.target.value})}),(0,q.jsx)(`input`,{"aria-label":m(`providerModelName`,{number:t+1}),placeholder:m(`modelConfig_name`),value:e.name,maxLength:256,disabled:ae,onChange:e=>fe(t,{name:e.target.value})}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":m(`providerModelDetails`,{model:e.name||e.id||t+1}),"aria-expanded":j.has(e.rowKey),title:m(`providerModelOptions`),onClick:()=>M(t=>{let n=new Set(t);return n.delete(e.rowKey)||n.add(e.rowKey),n}),children:(0,q.jsx)(os,{})}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon danger`,"aria-label":m(`providerRemoveModel`,{model:e.name||e.id||t+1}),disabled:ae||s?.provider===_.provider&&s.id===e.id,title:s?.provider===_.provider&&s.id===e.id?m(`providerCurrentRemoval`):m(`providerRemoveModel`,{model:e.name||e.id||t+1}),onClick:()=>{ue({models:_.models.filter((e,n)=>n!==t)}),M(t=>new Set([...t].filter(t=>t!==e.rowKey))),P(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.rowKey)))},children:(0,q.jsx)(Uc,{})})]}),j.has(e.rowKey)&&(0,q.jsxs)(`div`,{className:`models-entry-details`,children:[[`contextWindow`,`maxTokens`].map(n=>(0,q.jsxs)(`label`,{className:`models-field models-capacity`,children:[m(`modelConfig_${n}`),(0,q.jsx)(`input`,{type:`text`,inputMode:`numeric`,autoComplete:`off`,spellCheck:!1,"aria-label":m(`providerCapacityLabel`,{field:m(`modelConfig_${n}`),number:t+1}),"aria-invalid":e[n]!==void 0&&!Number.isFinite(e[n]),placeholder:n===`contextWindow`?`256K`:`32K`,value:N[e.rowKey]?.[n]??rW(e[n]),disabled:ae,onChange:r=>{let i=r.target.value;P(t=>({...t,[e.rowKey]:{...t[e.rowKey],[n]:i}})),fe(t,{[n]:nW(i)})}})]},n)),(0,q.jsxs)(`fieldset`,{className:`models-input-types`,"aria-label":m(`providerCapacityLabel`,{field:m(`providerInputTypes`),number:t+1}),children:[(0,q.jsx)(`legend`,{children:m(`providerInputTypes`)}),(0,q.jsx)(`div`,{children:[`text`,`image`].map(n=>{let r=e.input??[`text`];return(0,q.jsxs)(`label`,{className:`models-checkbox`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:r.includes(n),disabled:ae||r.length===1&&r.includes(n),onChange:e=>fe(t,{input:[`text`,`image`].filter(t=>t===n?e.target.checked:r.includes(t))})}),m(n===`text`?`providerInputText`:`providerInputImage`)]},n)})})]}),(0,q.jsx)(`p`,{className:`models-hint models-capability-hint`,children:m(`providerImageHint`)}),(0,q.jsxs)(`label`,{className:`models-checkbox models-reasoning`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:e.reasoning,disabled:ae,onChange:e=>fe(t,{reasoning:e.target.checked})}),m(`modelConfig_reasoning`)]}),(0,q.jsx)(`p`,{className:`models-hint models-capability-hint`,children:m(`providerReasoningHint`)}),e.reasoning&&(0,q.jsxs)(`div`,{className:`models-thinking-levels`,children:[(0,q.jsxs)(`div`,{className:`models-thinking-copy`,children:[(0,q.jsx)(`strong`,{children:m(`providerThinkingLevels`)}),(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerThinkingLevelsHint`)})]}),(0,q.jsx)(yo,{button:{label:e.thinkingLevelMap==null?m(`providerThinkingAutomatic`):m(`providerThinkingSelected`,{count:me[t].length}),"aria-label":m(`providerCapacityLabel`,{field:m(`providerThinkingLevels`),number:t+1}),variant:`secondary`,size:`sm`,className:`models-thinking-trigger`,isDisabled:ae},className:`configuration-level-menu`,menuWidth:`min(240px, calc(100vw - 32px))`,alignment:`end`,children:KU.map(n=>{let r=me[t],i=r.includes(n);return(0,q.jsx)(Ro,{label:n,value:i,isDisabled:ae||i&&r.length===1,endContent:(0,q.jsx)(`span`,{className:`configuration-check`,children:i&&(0,q.jsx)(rs,{"aria-hidden":`true`})}),onChange:i=>{fe(t,{thinkingLevelMap:Object.fromEntries(KU.map(a=>{let o=a===n?i:r.includes(a),s=h.models.find(t=>t.rowKey===e.rowKey)?.thinkingLevelMap?.[a];return[a,o?e.thinkingLevelMap?.[a]??s??pe[t]?.[a]??(a===`off`?`none`:a):null]}))})}},n)})}),e.thinkingLevelMap!=null&&(0,q.jsx)(`button`,{type:`button`,className:`models-link models-thinking-reset`,disabled:ae,onClick:()=>fe(t,{thinkingLevelMap:null}),children:m(`providerThinkingReset`)})]})]})]},e.rowKey))]}),(0,q.jsxs)(`button`,{type:`button`,className:`models-button models-add-model`,disabled:ae||_.models.length>=100,onClick:()=>{ue({models:[..._.models,{...he,rowKey:crypto.randomUUID()}]})},children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),m(`addModel`)]}),ce&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:m(`providerModelInvalid`,{number:se+1})})]});return(0,q.jsxs)(`form`,{className:`models-editor`,onSubmit:e=>{e.preventDefault(),_e()},children:[!i&&a&&(0,q.jsxs)(`div`,{className:`models-editor-heading`,children:[(0,q.jsx)(`span`,{children:_.name||_.provider}),_.name!==_.provider&&(0,q.jsx)(`small`,{children:_.provider})]}),i&&a&&(0,q.jsxs)(q.Fragment,{children:[ve(`provider`),_.provider&&oe&&(0,q.jsx)(`p`,{className:`models-error`,children:m(`providerIdInvalid`)}),ve(`name`),ve(`baseUrl`),ye]}),x&&S&&(0,q.jsxs)(`fieldset`,{className:`models-add-modes`,"aria-label":m(`accountLoginMethod`),children:[(0,q.jsx)(`button`,{type:`button`,"aria-pressed":C===`oauth`,disabled:ie,onClick:()=>w(`oauth`),children:m(`accountLoginTab`)}),(0,q.jsx)(`button`,{type:`button`,"aria-pressed":C===`api_key`,disabled:ie,onClick:()=>w(`api_key`),children:m(`accountLoginKeyTab`)})]}),x&&C===`oauth`&&r&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(iM,{sessionId:e,auth:r,busy:l||F||re,onSaving:E,onAuthenticated:()=>f(_.name||_.provider,_.provider),onReload:p}),re&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`accountLoginUnsaved`)})]}),S&&C===`api_key`?(0,q.jsxs)(`label`,{className:`models-field`,children:[m(`providerApiKey`),(0,q.jsx)(`input`,{type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:8192,value:y,placeholder:m(r?.configured?`providerKeyKeep`:`providerKeyOptional`),disabled:ie,onChange:e=>{b(e.target.value),ee!==`conflict`&&L(null)}})]}):x?null:(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerNativeAuth`)}),i&&a?be:(0,q.jsxs)(`details`,{className:`models-customized`,children:[(0,q.jsx)(`summary`,{children:m(`providerCustomSettings`)}),(0,q.jsxs)(`div`,{children:[a&&ve(`name`),ve(`baseUrl`),a&&ye,be]})]}),ee&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:m(ee===`conflict`?`modelConfigurationConflict`:ee===`key`?`providerProfileSavedKeyFailed`:ee===`current`?`providerCurrentRemoval`:`providerConfigurationFailed`)}),ee===`conflict`&&(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:p,children:m(`providerReload`)}),!T&&(0,q.jsxs)(`div`,{className:`models-editor-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:F,onClick:()=>R?p():f(),children:m(`cancel`)}),(C===`api_key`||ne)&&(0,q.jsx)(`button`,{type:`submit`,className:`models-button primary`,disabled:ie||!H||ee===`conflict`,"aria-busy":F,children:m(F?`savingSettings`:`providerSave`)})]}),D&&(0,q.jsx)(tW,{sessionId:e,template:he,existingIds:_.models.map(e=>e.id),apiKey:y,onClose:()=>O(!1),onAdd:e=>{ue({models:[..._.models,...e.map(e=>({...he,...e,rowKey:crypto.randomUUID()}))]}),O(!1)}})]})}function aW({sessionId:e,sessionPath:t,provider:n,purpose:r,initialModel:i,busy:a,onSelectModel:o,onDefaultSaved:s,onSaving:c,onClose:l}){let{t:u}=W(),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)([]),[h,g]=(0,K.useState)(i?`${i.provider}/${i.id}`:``),[_,v]=(0,K.useState)(!0),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(0),[C,w]=(0,K.useState)(0),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1),[k,A]=(0,K.useState)(null);(0,K.useEffect)(()=>{let t=new AbortController;v(!0),b(!1);let r=window.setTimeout(()=>{new de().searchModels(d.trim(),e,t.signal,n).then(e=>{t.signal.aborted||(m(e.models),S(e.truncation.matchesOmitted),v(!1))},()=>{t.signal.aborted||(b(!0),v(!1))})},d?200:0);return()=>{t.abort(),window.clearTimeout(r)}},[e,n,d,C]);let j=p.find(e=>`${e.provider}/${e.id}`===h)??p[0],M=new Map;for(let e of p){let t=M.get(e.provider);t?t.push(e):M.set(e.provider,[e])}let N=async()=>{if(!j||_||D||a||!t)return;O(!0),c(!0),A(null);let n=!1;try{if(r===`use`){if(!await o(`${j.provider}/${j.id}`))throw Error(`selection failed`);n=!0}(r==="default"||T)&&s(await new de().saveModelDefault(j.provider,j.id,e,t)),l()}catch{A(n?`modelDefaultPartial`:r==="default"?`modelDefaultSaveFailed`:`modelConnectionUseFailed`)}finally{O(!1),c(!1)}};return(0,q.jsxs)(`div`,{className:`models-connection-choice`,children:[(0,q.jsx)(`p`,{className:`models-hint`,children:u(r==="default"?`modelDefaultHint`:`modelConnectionNextHint`)}),(p.length>8||x>0||d)&&(0,q.jsx)(`input`,{type:`search`,"aria-label":u(`modelConnectionSearch`),placeholder:u(`modelConnectionSearch`),maxLength:200,value:d,disabled:D,onChange:e=>f(e.target.value)}),y?(0,q.jsxs)(`p`,{className:`models-error`,role:`alert`,children:[u(`modelConnectionLoadFailed`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:()=>w(e=>e+1),children:u(`retryAdmissionCheck`)})]}):_?(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`loadingModels`)}):p.length?(0,q.jsx)(nM,{label:u(`selectModel`),className:`models-provider-picker`,placement:`below`,value:j?`${j.provider}/${j.id}`:``,isDisabled:D,options:[...M].map(([e,t])=>({type:`section`,title:e,options:t.map(e=>({value:`${e.provider}/${e.id}`,label:e.name||e.id,description:`${e.provider} · ${e.id}`,icon:(0,q.jsx)(Yk,{id:e.provider})}))})),onChange:e=>g(e)}):(0,q.jsx)(`p`,{className:`models-hint`,children:u(d?`modelConnectionNoMatch`:`modelConnectionNoModels`)}),x>0&&!_&&(0,q.jsx)(`p`,{className:`models-hint`,children:u(`modelConnectionMore`,{count:x})}),r===`use`&&(0,q.jsxs)(`label`,{className:`models-checkbox`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:T,disabled:D,onChange:e=>E(e.target.checked)}),u(`modelMakeDefault`)]}),k&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:u(k)}),(0,q.jsxs)(`div`,{className:`models-editor-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:D,onClick:l,children:u(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button primary`,disabled:D||a||_||y||!j||!t,onClick:()=>void N(),children:u(D?`providerSaving`:r==="default"?`modelDefaultSave`:`modelConnectionUse`)})]})]})}function oW({sessionId:e,sessionPath:t,models:n,currentModel:r,busy:i,focusCredentials:a,onSaved:o,onSelectModel:s,onDraftChange:c,onSavingChange:l}){let{t:u}=W(),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(0),[h,g]=(0,K.useState)(!0),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(null),[x,S]=(0,K.useState)([]),[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(`account`),[D,O]=(0,K.useState)(``),[k,A]=(0,K.useState)(``),[j,M]=(0,K.useState)({}),[N,P]=(0,K.useState)(!1),[F,I]=(0,K.useState)({}),[ee,L]=(0,K.useState)(!1),R=N||ee||Object.values(F).some(Boolean),[te,z]=(0,K.useState)(null),[B,ne]=(0,K.useState)(!1),[re,V]=(0,K.useState)(null),[ie,ae]=(0,K.useState)(null),[oe,se]=(0,K.useState)(null),[ce,le]=(0,K.useState)(null),H=(0,K.useRef)(null),ue=(0,K.useRef)(a),fe=(0,K.useRef)(null),pe=(0,K.useRef)(new Map),me=(0,K.useRef)(null),he=(0,K.useRef)(null),_e=(0,K.useRef)({onDraftChange:c,onSavingChange:l});_e.current={onDraftChange:c,onSavingChange:l},(0,K.useEffect)(()=>{c(Object.values(j).some(Boolean))},[j,c]),(0,K.useEffect)(()=>{l(R)},[R,l]),(0,K.useEffect)(()=>{!re&&!R&&he.current&&(he.current.focus({preventScroll:!0}),he.current=null)},[re,R]),(0,K.useEffect)(()=>{if(!fe.current)return;let e=fe.current;fe.current=null,(pe.current.get(e)??me.current)?.focus({preventScroll:!0})}),(0,K.useEffect)(()=>()=>{H.current?.abort(),_e.current.onDraftChange(!1),_e.current.onSavingChange(!1)},[]),(0,K.useEffect)(()=>{let t=new AbortController;g(!0),v(!1);let n=new de;return Promise.all([n.modelConfigurations(e,t.signal),n.providerAuth(e,t.signal)]).then(([e,n])=>{if(!t.signal.aborted&&(f({configuration:e,auth:n}),g(!1),ue.current)){ue.current=!1;let e=r?.provider||n.providers.find(e=>e.configured)?.id;e&&(b(e),S([e]))}},()=>{t.signal.aborted||(v(!0),g(!1))}),()=>t.abort()},[e,p,r?.provider]),(0,K.useEffect)(()=>{let t=new AbortController;return ne(!1),new de().modelDefaults(e,t.signal).then(e=>{t.signal.aborted||z(e)},()=>{t.signal.aborted||ne(!0)}),()=>t.abort()},[e,p]);let ve=d?.configuration,ye=new Set([...ve?.providers?.map(e=>e.provider)??[],...ve?.models.map(e=>e.provider)??[]]),be=new Set([...ye,...d?.auth.providers.filter(e=>e.configured).map(e=>e.id)??[],...n.map(e=>e.provider),...x.filter(e=>!e.startsWith(`add:`))]),xe=[...be].map(e=>{let t=d?.auth.providers.find(t=>t.id===e);return{id:e,name:ve?.providers?.find(t=>t.provider===e)?.name||t?.name||e,auth:t}}),Se=d?.auth.providers.filter(e=>e.authMethods.includes(`api_key`)&&!be.has(e.id))??[],Ce=d?.auth.providers.filter(e=>e.authMethods.includes(`oauth`)&&!e.subscription)??[],we=Ce.find(e=>e.id===D)??Ce[0],Te=Se.find(e=>e.id===k)??Se[0],Ee=[{id:`account`,label:`accountLoginTab`,hint:`providerAccountHint`,available:Ce.length>0},{id:`catalog`,label:`providerAddCatalog`,hint:`providerCatalogHint`,available:Se.length>0},{id:`custom`,label:`providerAddCustom`,hint:`providerCustomHint`,available:!0}],U=e=>{E(e);let t=e===`custom`?`add:custom`:e===`account`?we&&`add:account:${we.id}`:Te&&`add:${Te.id}`;t&&S(e=>e.includes(t)?e:[...e,t])},De=e=>{he.current=null,V(null),ae(null),w(!1),b(y===e?null:e),S(t=>t.includes(e)?t:[...t,e])},Oe=(e,t,n)=>{he.current=null,fe.current=e;let r=t=>e.startsWith(`add:`)?t.startsWith(`add:`):t===e;S(e=>e.filter(e=>!r(e))),M(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!r(e)))),e.startsWith(`add:`)?w(!1):b(null),t&&(ae(t),V({purpose:`use`,provider:n??e}),m(e=>e+1),o().catch(()=>!1))},ke=(t,a,s,c)=>{if(!ve)return null;let l=d?.auth.providers.find(e=>e.id===a),f=e=>I(n=>n[t]===e?n:{...n,[t]:e}),p=()=>{Oe(t),m(e=>e+1),o().catch(()=>!1)};return t.startsWith(`add:account:`)?l&&(0,q.jsxs)(`div`,{className:`models-editor`,children:[(0,q.jsx)(iM,{sessionId:e,auth:l,busy:i,onSaving:f,onAuthenticated:()=>Oe(t,l.name||l.id,l.id),onReload:p}),!F[t]&&(0,q.jsx)(`div`,{className:`models-editor-actions`,children:(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:()=>Oe(t),children:u(`cancel`)})})]}):(0,q.jsx)(iW,{sessionId:e,providerId:a,configuration:ve,auth:l,isNew:s,custom:c,taken:[...d?.auth.providers.map(e=>e.id)??[],...ye],currentModel:r,availableModels:n.filter(e=>e.provider===a),busy:i,onDirty:e=>M(n=>n[t]===e?n:{...n,[t]:e}),onSaving:f,onClose:(e,n)=>Oe(t,e,n),onReload:p},t)},G=e=>xe.find(t=>t.id===e)?.name??e,je=e=>n.find(t=>t.provider===e.provider&&t.id===e.id)?.name||e.id,Me=(e,t,n)=>{he.current=t,V({purpose:e,provider:n}),b(null),w(!1)},Ne=(n,a)=>(0,q.jsx)(aW,{sessionId:e,sessionPath:t,provider:a,purpose:n,initialModel:n==="default"?te?.model:r,busy:i,onSelectModel:s,onDefaultSaved:e=>{z(e),ne(!1),o().catch(()=>!1)},onSaving:L,onClose:()=>{V(null)}},`${n}:${a??`all`}`);return(0,q.jsxs)(`div`,{className:`settings-content-page models-page`,children:[(0,q.jsxs)(`div`,{className:`models-section`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:u(`modelSettings`)}),(0,q.jsx)(`p`,{children:u(`modelsIntro`)})]})}),ie&&(0,q.jsxs)(`p`,{className:`models-saved`,role:`status`,children:[u(`providerSaved`,{provider:ie}),r&&(0,q.jsxs)(`span`,{children:[` `,u(`providerCurrentSessionModel`,{model:`${r.provider} / ${r.id}`})]})]}),_&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[u(`providerLoadFailed`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:h,onClick:()=>m(e=>e+1),children:u(`retryAdmissionCheck`)})]}),ce&&!oe&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[ce,` `,(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:h,onClick:()=>{le(null),m(e=>e+1)},children:u(`refreshStatus`)})]}),!d&&h&&(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`providerLoading`)}),(0,q.jsxs)(`div`,{className:`models-default-card`,children:[(0,q.jsxs)(`div`,{className:`models-default-row`,children:[(0,q.jsxs)(`div`,{className:`models-default-copy`,children:[(0,q.jsx)(`span`,{className:`models-default-title`,children:u(`modelDefaultTitle`)}),B?(0,q.jsx)(`span`,{className:`models-hint`,children:u(`modelDefaultReadFailed`)}):te?.model?(0,q.jsxs)(`span`,{className:`models-default-value`,children:[(0,q.jsx)(`span`,{className:`models-default-avatar`,"aria-hidden":`true`,children:(0,q.jsx)(Yk,{id:te.model.provider,modelId:te.model.id})}),(0,q.jsxs)(`span`,{children:[je(te.model),(0,q.jsx)(`small`,{children:G(te.model.provider)})]})]}):(0,q.jsx)(`span`,{className:`models-hint`,children:u(te?`modelDefaultNotSet`:`loadingModels`)})]}),(0,q.jsxs)(`button`,{type:`button`,className:`models-button primary models-default-choose`,disabled:R||i||Object.values(j).some(Boolean)||!t,"aria-expanded":re?.purpose==="default",onClick:e=>B?m(e=>e+1):re?.purpose==="default"?V(null):Me(`default`,e.currentTarget),children:[(0,q.jsx)(`span`,{children:u(B?`refreshStatus`:`modelDefaultChoose`)}),!B&&(0,q.jsx)(os,{"aria-hidden":`true`})]})]}),te?.projectOverride&&(0,q.jsx)(`p`,{className:`models-hint`,children:u(`modelDefaultProjectOverride`,{model:`${G(te.projectOverride.provider)} / ${je(te.projectOverride)}`})}),re?.purpose==="default"&&Ne(`default`)]}),(0,q.jsxs)(`div`,{className:`models-connections-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:u(`modelConnectionsTitle`)}),(0,q.jsx)(`p`,{children:u(`modelConnectionsIntro`)})]}),(0,q.jsx)(`span`,{"aria-hidden":`true`,children:xe.length})]}),(0,q.jsx)(`ul`,{className:`models-provider-list`,children:xe.map(e=>{let n=!C&&y===e.id,a=e.auth?.custom??ye.has(e.id);return(0,q.jsxs)(`li`,{className:`models-provider-card`,children:[(0,q.jsxs)(`div`,{className:`models-provider-head`,children:[(0,q.jsxs)(`div`,{className:`models-provider-identity`,children:[(0,q.jsx)(`span`,{className:`models-provider-avatar`,"aria-hidden":`true`,children:(0,q.jsx)(Yk,{id:e.id})}),(0,q.jsxs)(`div`,{className:`models-provider-label`,children:[(0,q.jsx)(`span`,{className:`models-provider-name`,children:e.name}),a&&(0,q.jsx)(`span`,{className:`models-provider-tag`,children:u(`providerCustomTag`)}),te?.model?.provider===e.id&&(0,q.jsx)(`span`,{className:`models-provider-tag is-default`,children:u(`modelDefaultBadge`)}),r?.provider===e.id&&(0,q.jsx)(`span`,{className:`models-provider-tag is-current`,children:u(`modelCurrentBadge`)}),e.auth&&(0,q.jsxs)(`span`,{className:`models-provider-status`,children:[(0,q.jsx)(`span`,{className:`models-credential-dot ${e.auth.configured?`configured`:`missing`}`,role:`img`,"aria-label":u(e.auth.configured?`credentialConfigured`:`credentialMissing`),title:u(e.auth.configured?`credentialConfigured`:`credentialMissing`)}),u(e.auth.subscription?`accountLoginConfigured`:e.auth.configured?`credentialConfigured`:`credentialMissing`)]})]})]}),(0,q.jsxs)(`div`,{className:`models-provider-actions`,children:[e.auth?.configured&&(0,q.jsx)(`button`,{type:`button`,className:`models-button models-select-connection`,disabled:R||i||Object.values(j).some(Boolean)||!t,"aria-label":u(`modelConnectionChooseProvider`,{provider:e.name}),"aria-expanded":re?.purpose===`use`&&re.provider===e.id,onClick:t=>re?.purpose===`use`&&re.provider===e.id?V(null):Me(`use`,t.currentTarget,e.id),children:u(`selectModel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,"aria-label":u(`editProvider`,{provider:e.name}),ref:t=>{t?pe.current.set(e.id,t):pe.current.delete(e.id)},"aria-expanded":n,disabled:R,onClick:()=>De(e.id),children:u(e.auth?.authMethods.includes(`oauth`)&&!e.auth.configured?`accountLoginStart`:`providerEdit`)}),ye.has(e.id)&&(0,q.jsx)(`button`,{type:`button`,className:`models-button danger`,"aria-label":u(`removeProvider`,{provider:e.name}),disabled:R||i||r?.provider===e.id,title:r?.provider===e.id?u(`providerCurrentRemoval`):void 0,onClick:()=>{se(e.id),le(null)},children:u(`providerRemove`)})]})]}),re?.purpose===`use`&&re.provider===e.id&&Ne(`use`,e.id),x.includes(e.id)&&(0,q.jsx)(`div`,{hidden:!n,children:ke(e.id,e.id,!1,a)})]},e.id)})}),ve&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{hidden:!C,className:`models-add-card`,children:[(0,q.jsx)(`fieldset`,{className:`models-add-modes`,"aria-label":u(`providerAddMode`),onKeyDown:e=>{if(R||![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=Ee.filter(e=>e.available),n=t.findIndex(e=>e.id===T),r=t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length].id;U(r),e.currentTarget.querySelectorAll(`button`)[Ee.findIndex(e=>e.id===r)]?.focus()},children:Ee.map(e=>(0,q.jsx)(`button`,{type:`button`,"aria-pressed":T===e.id,disabled:R||!e.available,onClick:()=>U(e.id),children:u(e.label)},e.id))}),(0,q.jsx)(`p`,{className:`models-hint`,children:u(Ee.find(e=>e.id===T)?.hint??`providerCustomHint`)}),(0,q.jsxs)(`div`,{hidden:T!==`account`,children:[we&&(0,q.jsx)(`div`,{className:`models-provider-select`,children:(0,q.jsx)(nM,{label:u(`provider`),className:`models-provider-picker`,options:Ce.map(e=>({value:e.id,label:e.name||e.id,icon:(0,q.jsx)(Yk,{id:e.id})})),value:we.id,isDisabled:R,placement:`below`,onChange:e=>{O(e);let t=`add:account:${e}`;S(e=>e.includes(t)?e:[...e,t])}})}),x.filter(e=>e.startsWith(`add:account:`)).map(e=>(0,q.jsx)(`div`,{hidden:e!==`add:account:${we?.id}`,children:ke(e,e.slice(12),!0,!1)},e))]}),(0,q.jsxs)(`div`,{hidden:T!==`catalog`,children:[Te&&(0,q.jsx)(`div`,{className:`models-provider-select`,children:(0,q.jsx)(nM,{label:u(`provider`),className:`models-provider-picker`,options:Se.map(e=>({value:e.id,label:e.name||e.id,icon:(0,q.jsx)(Yk,{id:e.id})})),value:Te.id,isDisabled:R,placement:`below`,onChange:e=>{A(e);let t=`add:${e}`;S(e=>e.includes(t)?e:[...e,t])}})}),x.filter(e=>e.startsWith(`add:`)&&e!==`add:custom`&&!e.startsWith(`add:account:`)).map(e=>(0,q.jsx)(`div`,{hidden:e!==`add:${Te?.id}`,children:ke(e,e.slice(4),!0,!1)},e))]}),x.includes(`add:custom`)&&(0,q.jsx)(`div`,{hidden:T!==`custom`,children:ke(`add:custom`,``,!0,!0)})]}),!C&&(0,q.jsxs)(`button`,{type:`button`,className:`models-add-button`,ref:me,disabled:R,onClick:()=>{he.current=null,V(null),w(!0),b(null),ae(null),U(Ee.find(e=>e.id===T)?.available?T:Ee.find(e=>e.available).id)},children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),u(`providerAdd`)]})]}),i&&(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`modelSelectionBusy`)})]}),oe&&(0,q.jsx)(uj,{isOpen:!0,title:u(`removeProvider`,{provider:xe.find(e=>e.id===oe)?.name||oe}),description:ce||u(`providerRemoveDetail`),isActionLoading:R,cancelLabel:u(`cancel`),actionLabel:u(R?`savingSettings`:`providerRemove`),onOpenChange:e=>{!e&&!R&&se(null)},onAction:()=>{if(R||i||!ve)return;let t=new AbortController;H.current=t,P(!0),le(null),new de().changeProviderConfiguration(e,ve.revision,{action:`remove`,provider:oe},t.signal).then(()=>{t.signal.aborted||(Oe(oe),se(null),m(e=>e+1),o().catch(()=>!1))},e=>{t.signal.aborted||le(u(e instanceof ge&&e.code===`MODEL_CONFIGURATION_CONFLICT`?`modelConfigurationConflict`:`providerConfigurationFailed`))}).finally(()=>{t.signal.aborted||P(!1)})}})]})}function sW(){let e={version:`1.1.0`,id:`55f1dad34a744f33e0bc00f0e88a1b082c0b642f2bbe360dcde22ef9071c7826`,mode:`production`},{t}=W(),[n,r]=(0,K.useState)(null),[i,a]=(0,K.useState)(`loading`),[o,s]=(0,K.useState)(0);(0,K.useEffect)(()=>{let e=new AbortController,t=new de;return a(`loading`),r(null),t.request(`/api/diagnostics`,{signal:e.signal}).then(t=>{e.signal.aborted||(r(t.openpi??null),a(`ready`))},()=>{e.signal.aborted||a(`error`)}),()=>e.abort()},[o]);let c=t(`notReported`),l=e?.id&&n?.frontendAtStartup?.id&&e.id!==n.frontendAtStartup.id;return(0,q.jsxs)(`section`,{className:`settings-section-block`,"aria-label":t(`runtimeIdentity`),children:[(0,q.jsx)(`h2`,{children:t(`runtimeIdentity`)}),(0,q.jsx)(`p`,{children:t(`runtimeIdentityHint`)}),i===`loading`&&(0,q.jsx)(`p`,{role:`status`,children:t(`settingsCatalogLoading`)}),i===`error`&&(0,q.jsx)(`p`,{role:`alert`,children:t(`runtimeIdentityFailed`)}),(0,q.jsxs)(`dl`,{className:`settings-summary-list runtime-identity-list`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeBackendVersion`)}),(0,q.jsx)(`dd`,{children:n?.version??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimePackageRoot`)}),(0,q.jsx)(`dd`,{children:n?.packageRoot??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeStartedAt`)}),(0,q.jsx)(`dd`,{children:n?new Date(n.startedAt).toLocaleString():c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeGitRevision`)}),(0,q.jsx)(`dd`,{children:n?.git?.revision??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeGitState`)}),(0,q.jsx)(`dd`,{children:n?.git?.dirty==null?c:t(n.git.dirty?`runtimeGitDirty`:`runtimeGitClean`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeFrontendVersion`)}),(0,q.jsx)(`dd`,{children:e?.version??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeFrontendBuild`)}),(0,q.jsx)(`dd`,{children:e?.mode===`development`?t(`runtimeDevelopmentBuild`):e?.id??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeStartupBuild`)}),(0,q.jsx)(`dd`,{children:n?.frontendAtStartup?.id??c})]})]}),l&&(0,q.jsx)(`p`,{role:`status`,children:t(`runtimeBuildMismatch`)}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>s(e=>e+1),disabled:i===`loading`,children:t(`refreshStatus`)})]})}var cW=20,lW={track:{kVAEAm:`x10l6tqk`,kWkggS:`xdsb6cv`,kaIpWk:`xjspbzw`,$$css:!0},trackHorizontal:{kLqNvP:`x1o0tod`,kt4wiu:`xtijo5x`,kZKoxP:`xqu0tyb`,k87sOh:`xwa60dl`,k3aq6I:`x1cb1t30`,$$css:!0},trackVertical:{k87sOh:`x13vifvy`,krVfgx:`x1ey2m1c`,kzqmXN:`x51ohtg`,$$css:!0},filledTrack:{kVAEAm:`x10l6tqk`,kWkggS:`x1ewilqj`,kaIpWk:`xjspbzw`,$$css:!0},filledTrackHorizontal:{kZKoxP:`xqu0tyb`,k87sOh:`xwa60dl`,k3aq6I:`x1cb1t30`,$$css:!0},filledTrackVertical:{kzqmXN:`x51ohtg`,$$css:!0},thumb:{kVAEAm:`x10l6tqk`,kzqmXN:`xw4jnvo`,kZKoxP:`x1qx5ct2`,kaIpWk:`xjspbzw`,kWkggS:`x1ewilqj`,k3aq6I:`x11lhmoz`,k1ekBW:`x106061f`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,kI3sdo:`x1a2a7pz`,kkrTdU:`x1jm3nie x16khyan`,kY2c9j:`x1vjfegm`,$$css:!0},thumbHorizontal:{k87sOh:`xwa60dl`,k3aq6I:`x11lhmoz xoffwj3`,$$css:!0},thumbHover:{kWkggS:`x1ewilqj xvxo0qp`,$$css:!0},thumbDisabled:{kWkggS:`xwmxj5m`,kkrTdU:`xt0e3qv`,$$css:!0}};function uW(e,t,n){return Math.min(Math.max(e,t),n)}function dW(e){if(Math.abs(e)<1){let t=e.toExponential().split(`e-`);if(t.length===2)return(t[0].split(`.`)[1]?.length??0)+parseInt(t[1],10)}let t=String(e).split(`.`)[1];return t?t.length:0}function fW(e,t,n){if(n<=0)return e;let r=t+Math.round((e-t)/n)*n,i=Math.min(Math.max(dW(t),dW(n)),20);return Number(r.toFixed(i))}function pW(e,t,n){return n===t?0:(e-t)/(n-t)*100}var mW=cW/2;function hW(e){return vW(e,mW-e/100*cW)}function gW(e,t){let n=t-e;return vW(n,-(n/100)*cW)}function _W(e,t){let n=t-cW;return n>0?(e-mW)/n:t>0?e/t:0}function vW(e,t){let n=e=>Number(e.toFixed(3));return`calc(${n(e)}% ${t<0?`-`:`+`} ${Math.abs(n(t))}px)`}function yW({ref:e,...t}){let{label:n,isLabelHidden:r=!1,description:i,isDisabled:a=!1,disabledMessage:o,isOptional:s=!1,isRequired:c=!1,status:l,labelTooltip:u,min:d=0,max:f=100,step:p=1,orientation:m=`horizontal`,formatValue:h,htmlName:g,valueDisplay:_=`tooltip`,marks:v,width:y,xstyle:b,className:x,style:S,"data-testid":C,value:T,onChange:E,onChangeEnd:k}=t,A=Array.isArray(T),j=A&&`minStepsBetweenThumbs`in t?t.minStepsBetweenThumbs??0:0,M=m===`horizontal`,P=(0,K.useId)(),I=(0,K.useId)(),ee=(0,K.useId)(),L=(0,K.useId)(),R=(0,K.useId)(),te=(0,K.useRef)(null),z=(0,K.useRef)(null),[B,ne]=(0,K.useState)(null),[re,ie]=(0,K.useState)(null);(0,K.useEffect)(()=>{D()},[]);let ae=(0,K.useCallback)((e,t)=>{ie(!a&&N()===`keyboard`?e:null)},[a]),oe=(0,K.useCallback)(e=>{ie(null)},[]),se=a&&!!o,ce=F({placement:`above`,focusTrigger:`always`,isEnabled:se}),le=c&&!s,ue=[];i&&ue.push(ee),l?.message&&ue.push(L),le&&ue.push(R),se&&ue.push(ce.describedBy);let de=ue.length>0?ue.join(` `):void 0,pe=(0,K.useMemo)(()=>(Array.isArray(T)?T:[T??d]).map(e=>uW(e,d,f)),[T,d,f]),me=(0,K.useRef)(pe);me.current=pe;let he=(0,K.useCallback)((e,t)=>{let n=te.current;if(!n)return d;let r=n.getBoundingClientRect(),i;return i=M?_W(Ya(n)?r.right-e:e-r.left,r.width):1-_W(t-r.top,r.height),i=uW(i,0,1),uW(fW(d+i*(f-d),d,p),d,f)},[d,f,p,M]),ge=(0,K.useCallback)(e=>{if(!A)return 0;let[t,n]=pe;return Math.abs(e-t)<=Math.abs(e-n)?0:1},[A,pe]),_e=(0,K.useCallback)((e,t)=>{if(a)return;let n=uW(fW(t,d,p),d,f);if(A){let t=[...pe];t[e]=n;let r=j*p;e===0?t[0]=Math.min(t[0],t[1]-r):t[1]=Math.max(t[1],t[0]+r),t[0]=uW(t[0],d,f),t[1]=uW(t[1],d,f),E?.(t)}else E?.(n)},[a,A,pe,d,f,p,j,E]),ve=(0,K.useRef)(k);ve.current=k;let ye=(0,K.useCallback)(e=>{let t=e??me.current,n=ve.current;A?n?.(t):n?.(t[0])},[A]),be=(0,K.useCallback)(e=>{if(a)return;e.preventDefault();let t=e.target.closest(`[data-mark-value]`),n=t?Number(t.dataset.markValue):he(e.clientX,e.clientY),r=ge(n);z.current=r,ne(r),_e(r,n);let i=te.current;i&&i.querySelectorAll(`[role="slider"]`)[r]?.focus(),ie(null),typeof e.currentTarget.setPointerCapture==`function`&&e.currentTarget.setPointerCapture(e.pointerId)},[a,he,ge,_e]),xe=(0,K.useCallback)(e=>{if(z.current===null||a)return;let t=he(e.clientX,e.clientY);_e(z.current,t)},[a,he,_e]),Se=(0,K.useCallback)(e=>{z.current!==null&&(z.current=null,ne(null),ye())},[ye]),Ce=(0,K.useCallback)((e,t)=>{if(a)return;N()===`keyboard`&&ie(e);let n=pe[e],r;switch(t.key){case`ArrowRight`:case`ArrowUp`:r=n+p;break;case`ArrowLeft`:case`ArrowDown`:r=n-p;break;case`PageUp`:r=n+p*10;break;case`PageDown`:r=n-p*10;break;case`Home`:r=d;break;case`End`:r=f;break;default:return}t.preventDefault();let i=uW(fW(r,d,p),d,f);if(_e(e,r),A){let t=[...pe];t[e]=i;let n=j*p;e===0?t[0]=Math.min(t[0],t[1]-n):t[1]=Math.max(t[1],t[0]+n),t[0]=uW(t[0],d,f),t[1]=uW(t[1],d,f),ye(t)}else ye([i])},[a,A,pe,p,d,f,j,_e,ye]),Te=e=>h?h(e):String(e),Ee=e=>{let t=pe[e],n=pW(t,d,f),r=M?{insetInlineStart:hW(n)}:{bottom:hW(n),left:`50%`},i=A?e===0?`Minimum value`:`Maximum value`:void 0,o=j*p,s=A&&e===1?uW(pe[0]+o,d,f):d,c=A&&e===0?uW(pe[1]-o,d,f):f,u=_===`tooltip`&&!se,g=M?`above`:`start`,v=(0,q.jsx)(`div`,{id:A?void 0:P,role:`slider`,tabIndex:a&&!se?-1:0,"aria-valuemin":s,"aria-valuemax":c,"aria-valuenow":t,"aria-valuetext":h?h(t):void 0,"aria-orientation":m,"aria-disabled":a||void 0,"aria-invalid":l?.type===`error`||void 0,"aria-label":i,"aria-labelledby":A?void 0:I,"aria-describedby":de,onKeyDown:t=>Ce(e,t),onFocus:t=>ae(e,t),onBlur:oe,...H(O(`slider-thumb`,{orientation:m,disabled:a?`disabled`:null}),w(lW.thumb,M?lW.thumbHorizontal:Et.centerInline(`50%`),!a&&lW.thumbHover,!a&&re===e&&fe.focusVisible,a&&lW.thumbDisabled),void 0,r)},e);return u?(0,q.jsx)(V,{content:Te(t),placement:g,delay:0,focusTrigger:`always`,isOpen:B===e||void 0,children:v},e):v},U=(()=>{if(A){let[e,t]=pe,n=pW(e,d,f),r=pW(t,d,f);return M?{insetInlineStart:hW(n),width:gW(n,r)}:{bottom:hW(n),height:gW(n,r)}}let e=pW(pe[0],d,f);return M?{insetInlineStart:`0%`,width:hW(e)}:{bottom:`0%`,height:hW(e)}})(),De=_===`text`?(0,q.jsx)(`span`,{className:`x9ynric xcr08ib x1tgivj0 xuxw1ft x2lah0s`,children:A?`${Te(pe[0])} – ${Te(pe[1])}`:Te(pe[0])}):null;return(0,q.jsxs)(zO,{"data-testid":C,label:n,isLabelHidden:r,description:i,inputID:P,labelID:I,isGroupLabel:!0,descriptionID:i?ee:void 0,isOptional:s,isRequired:c,isDisabled:a,status:l?{type:l.type,message:l.message,messageID:l.message?L:void 0}:void 0,labelTooltip:u,statusVariant:`detached`,width:y,xstyle:b,className:x,style:S,children:[(0,q.jsxs)(`div`,{...H(O(`slider`,{orientation:m,disabled:a?`disabled`:null}),{className:`x78zum5 x6s0dn4 x1txdalj`}),children:[g!=null&&pe.map((e,t)=>(0,q.jsx)(`input`,{type:`hidden`,name:g,value:String(e),disabled:a},t===0?`start`:`end`)),(0,q.jsxs)(`div`,{ref:we(e,te,ce.ref),...A?{role:`group`,"aria-labelledby":I}:void 0,onPointerDown:be,onPointerMove:xe,onPointerUp:Se,onPointerCancel:Se,...{0:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k x1ypdohk x16khyan`},2:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 x1ypdohk x16khyan`},1:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k xbyyjgo xt0e3qv`},3:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 xbyyjgo xt0e3qv`}}[!!M<<1|!!a<<0],children:[(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(O(`slider-track`,{orientation:m}),w(lW.track,M?lW.trackHorizontal:[lW.trackVertical,Et.centerInline(`0px`)]))}),(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(w(lW.filledTrack,M?lW.filledTrackHorizontal:[lW.filledTrackVertical,Et.centerInline(`0px`)]),{style:U})}),v&&(0,q.jsx)(`div`,{"aria-hidden":`true`,...{0:{className:`x10l6tqk x13vifvy x1ey2m1c xbudbmw`},1:{className:`x10l6tqk x1o0tod xtijo5x xwa60dl`}}[!!M<<0],children:v.map(e=>{let t=pW(e.value,d,f),n=M?{insetInlineStart:hW(t)}:{bottom:hW(t)};return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{"data-testid":`slider-mark`,"data-mark-value":e.value,...H({0:{className:`x10l6tqk x7njt3n xjspbzw x36qwtl x1xc55vz x1m9mm8y`},1:{className:`x10l6tqk x7njt3n xjspbzw xfo62xy xdk7pt x11lhmoz xoffwj3`}}[!!M<<0],{style:n})}),e.label&&(0,q.jsx)(`span`,{"data-testid":`slider-mark-label`,"data-mark-value":e.value,...H({0:{className:`x10l6tqk x9ynric x141an7d xv1l7n4 xuxw1ft x131p8rn x9p6ekw`},1:{className:`x10l6tqk x9ynric x141an7d xv1l7n4 xuxw1ft xuuh30 x1nyx83j xuivejd`}}[!!M<<0],{style:n}),children:e.label})]},e.value)})}),pe.map((e,t)=>Ee(t))]}),De]}),le&&(0,q.jsx)(Kt,{id:R,children:`Required`}),se&&ce.renderTooltip(o)]})}yW.displayName=`Slider`;var bW=[`explorer`,`implementer`,`reviewer`,`advisor`];function xW({catalog:e,error:t,onRefresh:n}){let{t:r}=W();return!t&&!e?(0,q.jsxs)(`div`,{className:`settings-load-state`,role:`status`,children:[(0,q.jsx)(me,{className:`settings-spin`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:r(`settingsCatalogLoading`)})]}):t?(0,q.jsxs)(`div`,{className:`settings-load-state error`,role:`alert`,children:[(0,q.jsx)(`strong`,{children:r(`settingsCatalogFailed`)}),(0,q.jsx)(`span`,{children:t}),(0,q.jsx)(`button`,{type:`button`,onClick:n,children:r(`retryAdmissionCheck`)})]}):null}function SW({icon:e,title:t,description:n,value:r,disabled:i,loading:a,onChange:o}){return(0,q.jsxs)(`div`,{className:`settings-inline-control settings-toggle-row`,children:[(0,q.jsx)(e,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-inline-copy`,children:[(0,q.jsx)(`strong`,{children:t}),n&&(0,q.jsx)(`small`,{children:n})]}),(0,q.jsx)(bj,{label:t,isLabelHidden:!0,value:r,size:`sm`,isDisabled:i,isLoading:a,onChange:o})]})}function CW({isPending:e,isBlocked:t=!1,onConfigure:n,request:r,label:i}){return(0,q.jsx)(Br,{label:i,variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Xc,{"aria-hidden":`true`}),isDisabled:e||t,isLoading:e,onClick:()=>void n(r)})}function wW({pending:e,onConfigure:t,placeholder:n}){let{t:r}=W(),[i,a]=(0,K.useState)(``);return(0,q.jsxs)(`form`,{className:`settings-edit-form`,onSubmit:n=>{n.preventDefault(),!e&&i.trim()&&t(i.trim())},children:[(0,q.jsxs)(`label`,{className:`settings-form-field`,children:[r(`setupConfigurationRequest`),(0,q.jsx)(`textarea`,{required:!0,maxLength:2e3,value:i,disabled:e,placeholder:n,onChange:e=>a(e.target.value)})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:e||!i.trim(),children:r(`configureViaSetup`)}),(0,q.jsx)(`small`,{children:r(`setupFormDetail`)})]})}function TW({catalog:e,error:t,currentModel:n,thinkingLevel:r,cwd:i,setupPending:a,setupBlocked:o=!1,preferencePending:s,setupBusy:c,setupBlockedReason:l,onConfigure:u,onUpdatePreferences:d,onOpenRuntimeStatus:f,onRefresh:p}){let{t:m}=W(),h=e?.setup,g=h?.workflows.concurrency??0,_=h?.workflows.maxAgentCalls??0,[v,y]=(0,K.useState)(g),[b,x]=(0,K.useState)(_);return(0,K.useEffect)(()=>y(g),[g]),(0,K.useEffect)(()=>x(_),[_]),(0,q.jsxs)(`section`,{className:`settings-content-page settings-general-panel`,children:[(0,q.jsxs)(`div`,{className:`settings-page-heading`,children:[(0,q.jsx)(`div`,{children:(0,q.jsx)(`h1`,{children:m(`generalSettings`)})}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:u,request:m(`setupRequestReviewAll`),label:m(`configureOpenPi`)})]}),c&&(0,q.jsx)(`p`,{className:`settings-pending-hint`,role:`status`,children:l||m(`settingsSetupBusyHint`)}),(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:p}),h&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`section`,{className:`settings-section-block`,children:(0,q.jsxs)(`div`,{className:`settings-follow-up-control`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:m(`followUpBehavior`)}),(0,q.jsx)(`p`,{children:m(`followUpBehaviorDetail`)})]}),(0,q.jsxs)(`fieldset`,{className:`settings-follow-up-choices`,disabled:s,children:[(0,q.jsx)(`legend`,{className:`sr-only`,children:m(`followUpBehavior`)}),[`followUp`,`steer`].map(e=>(0,q.jsxs)(`label`,{children:[(0,q.jsx)(`input`,{type:`radio`,name:`follow-up-behavior`,value:e,"aria-label":m(e===`steer`?`followUpSteer`:`followUpQueue`),checked:(h.ui.webFollowUpBehavior??`followUp`)===e,onChange:()=>void d({followUpBehavior:e})}),(0,q.jsxs)(`span`,{className:`settings-follow-up-option`,children:[e===`steer`?(0,q.jsx)(Cs,{"aria-hidden":`true`}):(0,q.jsx)(tc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-follow-up-option-copy`,children:[(0,q.jsx)(`strong`,{children:m(e===`steer`?`followUpSteer`:`followUpQueue`)}),(0,q.jsx)(`small`,{children:m(e===`steer`?`followUpSteerDetail`:`followUpQueueDetail`)})]})]})]},e))]})]})}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`agentBehavior`)}),(0,q.jsxs)(`div`,{className:`settings-chat-controls`,children:[(0,q.jsxs)(`form`,{className:`settings-limits-control`,onSubmit:e=>{e.preventDefault(),!a&&!o&&u(m(`setupRequestLimits`,{concurrency:v,calls:b}))},children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(Us,{"aria-hidden":`true`}),m(`workflowLimits`)]}),(0,q.jsx)(`small`,{children:m(`workflowLimitsValue`,{concurrency:h.workflows.concurrency,calls:h.workflows.maxAgentCalls})}),(0,q.jsxs)(`label`,{children:[m(`workflowConcurrency`),(0,q.jsx)(`input`,{type:`number`,min:1,value:v,disabled:a||o,onChange:e=>y(Number(e.target.value)),required:!0})]}),(0,q.jsxs)(`label`,{children:[m(`workflowCalls`),(0,q.jsx)(`input`,{type:`number`,min:1,value:b,disabled:a||o,onChange:e=>x(Number(e.target.value)),required:!0})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:a||o||v===h.workflows.concurrency&&b===h.workflows.maxAgentCalls,children:m(`configureViaSetup`)})]}),(0,q.jsx)(SW,{icon:Pc,title:m(`nextActionSuggestions`),description:m(`nextActionSuggestionsDetail`),value:h.suggestions.enabled,disabled:a||o,loading:a,onChange:e=>void u(m(e?`setupRequestEnableSuggestions`:`setupRequestDisableSuggestions`))}),h.suggestions.model&&(0,q.jsx)(`small`,{children:`${h.suggestions.model.provider}/${h.suggestions.model.model} · ${h.suggestions.model.reasoning}`}),(0,q.jsxs)(`div`,{className:`settings-inline-control`,children:[(0,q.jsx)(bs,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-inline-copy`,children:[(0,q.jsxs)(`strong`,{children:[m(`postEditCommand`),(0,q.jsx)(`span`,{className:`settings-inline-status`,children:m(h.postEditConfigured?`configured`:`disabled`)})]}),(0,q.jsx)(`small`,{children:m(`postEditCommandDetail`)})]}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:u,request:m(`setupRequestPostEdit`),label:m(`configurePostEdit`)})]}),(0,q.jsx)(`small`,{children:m(`agentSettingsSetupHint`)})]})]}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`resultDisplay`)}),(0,q.jsxs)(`div`,{className:`settings-chat-controls`,children:[[[`subagentResultDisplay`,`subagentResults`,ws],[`bashToolDisplay`,`bashOperations`,Vc],[`fileMutationDisplay`,`fileMutations`,Fs]].map(([e,t,n])=>(0,q.jsxs)(`label`,{className:`settings-inline-control`,htmlFor:`settings-${e}`,children:[(0,q.jsx)(n,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`settings-inline-copy`,children:(0,q.jsx)(`strong`,{children:m(t)})}),(0,q.jsx)(Tj,{id:`settings-${e}`,className:`settings-select-control`,label:m(t),value:h.ui[e],disabled:s,onChange:t=>{(t===`full`||t===`compact`)&&d({[e]:t})},options:[{value:`compact`,label:m(`detailDisplay_compact`)},{value:`full`,label:m(`detailDisplay_full`)}]})]},e)),(0,q.jsx)(SW,{icon:mc,title:m(`terminalFooter`),value:h.ui.customFooter,disabled:s,loading:s,onChange:e=>void d({customFooter:e})}),(0,q.jsxs)(`label`,{className:`settings-inline-control`,htmlFor:`settings-footer-style`,children:[(0,q.jsx)(`span`,{children:m(`terminalFooterStyle`)}),(0,q.jsx)(Tj,{id:`settings-footer-style`,className:`settings-select-control`,label:m(`terminalFooterStyle`),value:h.ui.footerStyle,disabled:s||!h.ui.customFooter,onChange:e=>{(e===`plain`||e===`powerline`||e===`powerline-mono`)&&d({footerStyle:e})},options:[{value:`plain`,label:`Plain`},{value:`powerline`,label:`Powerline`},{value:`powerline-mono`,label:`Powerline Mono`}]})]}),(0,q.jsx)(`small`,{children:m(`terminalFooterHint`)})]})]})]}),(0,q.jsx)(sW,{}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`sessionSettings`)}),(0,q.jsxs)(`dl`,{className:`settings-summary-list`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`selectedModel`)}),(0,q.jsx)(`dd`,{children:n?.label??m(`noModels`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`thinkingLevel`)}),(0,q.jsx)(`dd`,{children:r})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`currentWorkspace`)}),(0,q.jsx)(`dd`,{title:i,children:i})]})]}),(0,q.jsx)(Br,{label:m(`openRuntimeDetails`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ls,{"aria-hidden":`true`}),className:`settings-runtime-action`,onClick:f})]})]})}function EW(e){return e.split(/[\\/]/u).filter(Boolean).at(-1)||e}function DW({kind:e,query:t,scope:n,onQuery:r,onScope:i,onAdd:a}){let{t:o}=W();return(0,q.jsxs)(`div`,{className:`settings-resource-toolbar`,children:[(0,q.jsxs)(`div`,{className:`settings-resource-toolbar-heading`,children:[(0,q.jsx)(`strong`,{children:o(`resources`)}),(0,q.jsx)(Br,{label:o(e===`skills`?`addSkill`:`addPlugin`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:a})]}),(0,q.jsxs)(`label`,{className:`settings-resource-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":o(`searchResources`),placeholder:o(`searchResources`),value:t,onChange:e=>r(e.target.value)})]}),(0,q.jsx)(Tj,{label:o(`filterResourceScope`),value:n,onChange:i,options:[{value:`all`,label:o(`allResourceScopes`)},...[`project`,`user`,`temporary`].map(e=>({value:e,label:o(`resourceScope_${e}`)}))]})]})}function OW({kind:e,pending:t,onConfigure:n,onCancel:r}){let{t:i}=W(),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(`user`);return(0,q.jsxs)(`section`,{className:`settings-resource-install`,children:[(0,q.jsx)(`header`,{className:`settings-detail-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:i(e===`skills`?`addSkill`:`addPlugin`)}),(0,q.jsx)(`p`,{children:i(`resourceInstallIntro`)})]})}),(0,q.jsxs)(`form`,{className:`settings-edit-form`,onSubmit:r=>{r.preventDefault(),!t&&a.trim()&&n(i(`setupResourceInstallRequest`,{kind:i(e===`skills`?`skillsSettings`:`pluginsSettings`),source:JSON.stringify(a.trim()),scope:s}))},children:[(0,q.jsxs)(`label`,{className:`settings-form-field`,children:[i(`resourcePackageSource`),(0,q.jsx)(`input`,{required:!0,maxLength:1e3,value:a,placeholder:i(`resourcePackageSourcePlaceholder`),disabled:t,onChange:e=>{o(e.target.value)}})]}),(0,q.jsxs)(`label`,{className:`settings-form-field`,htmlFor:`resource-install-scope`,children:[i(`scope`),(0,q.jsx)(Tj,{id:`resource-install-scope`,label:i(`scope`),value:s,disabled:t,onChange:c,options:[{value:`user`,label:i(`resourceScope_user`)},{value:`project`,label:i(`resourceScope_project`)}]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-actions`,children:[(0,q.jsx)(Br,{type:`submit`,label:i(`configureViaSetup`),variant:`secondary`,size:`sm`,isDisabled:t||!a.trim()}),(0,q.jsx)(Br,{label:i(`cancel`),variant:`ghost`,size:`sm`,onClick:r})]}),(0,q.jsx)(`small`,{children:i(`resourceInstallReview`)})]}),e===`skills`&&(0,q.jsxs)(`a`,{className:`settings-resource-link`,href:`https://skills.sh`,target:`_blank`,rel:`noreferrer`,children:[i(`browseSkills`),(0,q.jsx)(Os,{"aria-hidden":`true`})]})]})}function kW({catalog:e,pending:t,onReload:n,kind:r,onConfigure:i,children:a}){let{t:o}=W(),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(null);return(0,q.jsxs)(`section`,{className:`settings-resource-management`,children:[a&&(0,q.jsx)(`div`,{className:`settings-resource-actions`,children:a}),(0,q.jsxs)(`div`,{className:`settings-resource-reload`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:o(`resourceSessionState`)}),(0,q.jsx)(`p`,{children:o(`resourcesReloadNote`)})]}),(0,q.jsx)(Br,{label:o(`reloadResources`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(me,{"aria-hidden":`true`}),isDisabled:t||l||!e?.sessionPath||!n,isLoading:l,onClick:()=>c(!0)})]}),d&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,role:`status`,children:d}),(0,q.jsxs)(`details`,{className:`settings-resource-advanced`,children:[(0,q.jsx)(`summary`,{children:o(`advancedResourceConfiguration`)}),(0,q.jsx)(wW,{pending:t,onConfigure:i,placeholder:o(r===`skills`?`setupSkillsPlaceholder`:`setupPluginsPlaceholder`)})]}),s&&(0,q.jsx)(uj,{isOpen:!0,onOpenChange:c,title:o(`reloadResources`),description:o(`resourceReloadReview`),cancelLabel:o(`cancel`),actionLabel:o(`reloadResources`),onAction:()=>{c(!1),u(!0),f(null),n?.().then(()=>f(o(`resourceReloaded`)),e=>f(e instanceof Error?e.message:o(`resourceReloadFailed`))).finally(()=>u(!1))}})]})}function AW({catalog:e}){let{t}=W();if(!e)return null;let{diagnostics:n,truncation:r}=e.resources;return!n.settingsErrors&&!n.extensionErrors&&!n.skillErrors&&!r.truncated?null:(0,q.jsxs)(`p`,{className:`settings-resource-notice`,role:`status`,children:[t(`resourceDiagnostics`,n),n.settingsErrors?` ${t(`resourceConfigurationDiagnostics`,{count:n.settingsErrors})}`:``,r.truncated&&` ${t(`resourceCatalogTruncated`)}`]})}function jW({catalog:e,error:t,onRefresh:n,setupPending:r,onConfigure:i,onReload:a}){let{t:o}=W(),s=e?.resources.skills??[],[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(`all`),[f,p]=(0,K.useState)(!1),m=(0,K.useMemo)(()=>s.filter(e=>(u===`all`||e.scope===u)&&`${e.name} ${e.description} ${e.source}`.toLocaleLowerCase().includes(c.trim().toLocaleLowerCase())),[s,c,u]),h=(0,K.useMemo)(()=>[`project`,`user`,`temporary`].map(e=>({scope:e,skills:m.filter(t=>t.scope===e)})).filter(e=>e.skills.length>0),[m]),[g,_]=(0,K.useState)(``),[v,y]=(0,K.useState)(null),b=m.find(e=>e.id===g)??m[0],x=m.filter(e=>e.canManage!==!1),S=JSON.stringify(x.map(e=>e.filePath)),C=new TextEncoder().encode(S).length>12e3;(0,K.useEffect)(()=>{s.length&&!s.some(e=>e.id===g)&&_(s[0].id)},[g,s]);let w=e=>{y(null),td(`/skill:${e.name} `).then(e=>y(e?`copied`:`failed`))};return(0,q.jsxs)(`section`,{className:`settings-content-page settings-managed-panel`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:o(`skillsSettings`)}),(0,q.jsx)(`p`,{children:o(`skillsEmptyIntro`)})]})}),(0,q.jsxs)(`aside`,{className:`settings-resource-sidebar`,children:[(0,q.jsx)(DW,{kind:`skills`,query:c,scope:u,onQuery:l,onScope:d,onAdd:()=>p(!0)}),(0,q.jsxs)(`div`,{className:`settings-resource-list`,children:[h.map(e=>(0,q.jsxs)(`section`,{className:`settings-resource-group`,children:[(0,q.jsx)(`span`,{className:`settings-sidebar-label`,children:o(`resourceScope_${e.scope}`)}),e.skills.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:`settings-resource-item`,"aria-current":e.id===b?.id?`page`:void 0,onClick:()=>{_(e.id),y(null),p(!1)},children:[(0,q.jsx)(Pc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:e.name}),(0,q.jsx)(`small`,{children:o(e.disableModelInvocation?`explicitOnly`:`availableToModel`)})]})]},e.id))]},e.scope)),!e&&!t&&(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}),e&&!m.length&&(0,q.jsx)(`p`,{className:`settings-resource-empty`,children:o(s.length?`noMatchingResources`:`noSkillsFound`)})]}),(0,q.jsxs)(`div`,{className:`settings-sidebar-footer`,children:[(0,q.jsx)(`span`,{children:o(`skillCount`,{count:s.length})}),(0,q.jsx)(`button`,{type:`button`,"aria-label":o(`refreshStatus`),onClick:n,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-detail`,children:[(0,q.jsx)(AW,{catalog:e}),f?(0,q.jsx)(OW,{kind:`skills`,pending:r,onConfigure:i,onCancel:()=>p(!1)}):t?(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}):b?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`settings-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:b.name}),(0,q.jsx)(`p`,{children:b.description})]}),(0,q.jsx)(Br,{label:o(v===`copied`?`copiedMessage`:`copySkillInvocation`),variant:`secondary`,size:`sm`,icon:v===`copied`?(0,q.jsx)(rs,{}):(0,q.jsx)(_s,{}),onClick:()=>w(b)})]}),(0,q.jsxs)(`dl`,{className:`settings-detail-metadata`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`source`)}),(0,q.jsx)(`dd`,{children:b.source===`auto`?o(`resourceSourceAuto`):b.source===`local`?o(`resourceSourceLocal`):b.source===`builtin`?o(`builtIn`):b.source})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`scope`)}),(0,q.jsx)(`dd`,{children:o(`resourceScope_${b.scope}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`invocation`)}),(0,q.jsx)(`dd`,{children:(0,q.jsx)(`code`,{children:`/skill:${b.name}`})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`modelInvocation`)}),(0,q.jsx)(`dd`,{children:o(b.disableModelInvocation?`explicitOnly`:`availableToModel`)})]})]}),(0,q.jsxs)(`section`,{className:`settings-path-block`,children:[(0,q.jsx)(Fs,{"aria-hidden":`true`}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:o(`skillFile`)}),(0,q.jsx)(`code`,{children:b.filePath})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-actions`,children:[(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(b.disableModelInvocation?`enableSkillInvocation`:`disableSkillInvocation`),request:o(`setupSkillInvocationRequest`,{path:b.filePath,disabled:!b.disableModelInvocation})}),(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(`updateResource`),request:o(`setupSkillManageRequest`,{action:`update`,path:JSON.stringify(b.filePath),source:JSON.stringify(b.source),scope:b.scope})}),(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(`removeResource`),request:o(`setupSkillManageRequest`,{action:`remove`,path:JSON.stringify(b.filePath),source:JSON.stringify(b.source),scope:b.scope})})]}),b.canManage===!1&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,children:o(`resourceTargetTruncated`)}),v===`failed`&&(0,q.jsx)(`p`,{className:`inspection-warning`,children:o(`copyFailed`)})]}):(0,q.jsxs)(`div`,{className:`settings-empty-detail`,children:[(0,q.jsx)(Pc,{"aria-hidden":`true`}),(0,q.jsx)(`h2`,{children:o(s.length?`noMatchingResources`:`skillsEmptyTitle`)}),(0,q.jsx)(Br,{label:o(`addSkill`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:()=>p(!0)})]}),!f&&(0,q.jsxs)(kW,{catalog:e,pending:r,onReload:a,kind:`skills`,onConfigure:i,children:[x.length>1&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(CW,{isPending:r,isBlocked:C,onConfigure:i,label:o(`enableVisibleSkills`,{count:x.length}),request:o(`setupSkillsBulkRequest`,{paths:S,disabled:!1})}),(0,q.jsx)(CW,{isPending:r,isBlocked:C,onConfigure:i,label:o(`disableVisibleSkills`,{count:x.length}),request:o(`setupSkillsBulkRequest`,{paths:S,disabled:!0})})]}),C&&(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`resourceBulkTooLarge`)})]})]})]})}function MW({catalog:e,error:t,currentModel:n,models:r,activity:i,setupPending:a,setupBlocked:o=!1,onConfigure:s,onRefresh:c}){let{t:l}=W(),[u,d]=(0,K.useState)(`explorer`),f=e?.setup.subagents.roleModels[u],[p,m]=(0,K.useState)(``),[h,g]=(0,K.useState)(1);(0,K.useEffect)(()=>{let t=e?.setup.subagents.roleModels[u];m(t?`${t.provider}/${t.model}`:``),g(e?.setup.workflows.concurrency??1)},[u,e]);let _=i?.items.filter(e=>e.status===`running`).length??0,v=i?.items.filter(e=>e.status!==`running`).length??0;return(0,q.jsxs)(`section`,{className:`settings-content-page settings-subagents-panel`,children:[(0,q.jsxs)(`header`,{className:`settings-page-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:l(`subagentsSettings`)}),(0,q.jsx)(`p`,{children:l(`subagentConfigurationIntro`)})]}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:s,request:l(`setupRequestSubagents`),label:l(`configureRoles`)})]}),(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:c}),(0,q.jsx)(`div`,{className:`settings-control-group`,children:(0,q.jsxs)(`label`,{className:`settings-control-row`,htmlFor:`subagent-role`,children:[(0,q.jsxs)(`span`,{className:`settings-control-copy`,children:[(0,q.jsx)(`strong`,{children:l(`builtInRoles`)}),(0,q.jsx)(`span`,{children:l(`subagentRoleShort_${u}`)})]}),(0,q.jsx)(Tj,{id:`subagent-role`,name:`subagentRole`,label:l(`builtInRoles`),value:u,onChange:e=>{let t=bW.find(t=>t===e);t&&d(t)},options:bW.map(e=>({value:e,label:l(`subagentRole_${e}`)}))})]})}),(0,q.jsx)(`div`,{className:`settings-role-detail`,children:e&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`header`,{className:`settings-detail-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:l(`subagentRole_${u}`)}),(0,q.jsx)(`p`,{children:l(`subagentRoleDescription_${u}`)})]})}),(0,q.jsxs)(`form`,{className:`settings-edit-form settings-role-form`,onSubmit:e=>{e.preventDefault(),!(a||o)&&s(l(`setupRoleFormRequest`,{role:u,model:p||l(`inheritParentModel`),concurrency:h}))},children:[(0,q.jsxs)(`div`,{className:`settings-control-group`,children:[(0,q.jsxs)(`label`,{className:`settings-control-row`,htmlFor:`role-model`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`modelAssignment`)})}),(0,q.jsx)(Tj,{id:`role-model`,name:`roleModel`,label:l(`modelAssignment`),value:p,disabled:a||o,onChange:m,menuWidth:`min(380px, calc(100vw - 32px))`,options:[{value:``,label:l(`inheritParentModel`)},...p&&!r.some(e=>`${e.provider}/${e.id}`===p)?[{value:p,label:p}]:[],...r.map(e=>({value:`${e.provider}/${e.id}`,label:e.label}))]})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`effectiveModel`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:f?`${f.provider}/${f.model}`:n?.label??l(`unknownState`)})]}),(0,q.jsxs)(`label`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`workflowConcurrencyLabel`)})}),(0,q.jsx)(`input`,{name:`concurrency`,type:`number`,autoComplete:`off`,min:1,max:64,required:!0,value:h,disabled:a||o,onChange:e=>g(Number(e.target.value))})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`workflowCallLimit`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:e.setup.workflows.maxAgentCalls})]})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:a||o,children:l(`configureViaSetup`)}),(0,q.jsx)(`small`,{className:`settings-resource-caption`,children:l(`setupFormDetail`)})]}),(0,q.jsxs)(`section`,{className:`settings-role-principles`,children:[(0,q.jsx)(`h2`,{children:l(`runtimeBoundaries`)}),(0,q.jsxs)(`div`,{className:`settings-control-group`,children:[(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(Ys,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:l(`subagentAuthorityNote`)})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(ws,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:l(`subagentModelNote`)})]})]}),(0,q.jsxs)(`p`,{className:`settings-resource-caption`,children:[l(`subagentActiveCount`,{count:_}),` ·`,` `,l(`subagentCompletedCount`,{count:v})]})]})]})})]})}function NW(e){return e.extensions.length+e.skills.length+e.prompts.length+e.themes.length}function PW(e){return e.enabled===!1?`disabled`:e.configured&&!e.installed?`missing`:e.diagnostics?.length?`error`:NW(e)?`loaded`:e.installed?`installed`:`notLoaded`}function FW({catalog:e,error:t,onRefresh:n,setupPending:r,onConfigure:i,onReload:a}){let{t:o}=W(),s=e?.resources.plugins??[],[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(`all`),[f,p]=(0,K.useState)(!1),m=(0,K.useMemo)(()=>s.filter(e=>(u===`all`||e.scope===u)&&`${e.name??``} ${e.source}`.toLocaleLowerCase().includes(c.trim().toLocaleLowerCase())),[s,c,u]),[h,g]=(0,K.useState)(``),_=m.find(e=>e.id===h)??m[0],v=m.filter(e=>e.configured&&e.canManage!==!1),y=e=>e.name??(e.source===`auto`?o(`resourceSourceAuto`):e.source===`builtin`?o(`builtIn`):EW(e.source)),b=JSON.stringify(v.map(({source:e,scope:t,baseDir:n})=>({source:e,scope:t,path:n}))),x=new TextEncoder().encode(b).length>12e3;return(0,K.useEffect)(()=>{s.length&&!s.some(e=>e.id===h)&&g(s[0].id)},[s,h]),(0,q.jsxs)(`section`,{className:`settings-content-page settings-managed-panel`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:o(`pluginsSettings`)}),(0,q.jsx)(`p`,{children:o(`pluginsEmptyIntro`)})]})}),(0,q.jsxs)(`aside`,{className:`settings-resource-sidebar`,children:[(0,q.jsx)(DW,{kind:`plugins`,query:c,scope:u,onQuery:l,onScope:d,onAdd:()=>p(!0)}),(0,q.jsxs)(`div`,{className:`settings-resource-list`,children:[m.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:`settings-resource-item`,"aria-current":e.id===_?.id?`page`:void 0,onClick:()=>{g(e.id),p(!1)},children:[(0,q.jsx)(Sc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:y(e)}),(0,q.jsxs)(`small`,{children:[o(`resourceScope_${e.scope}`),` ·`,` `,o(`pluginState_${PW(e)}`)]})]})]},e.id)),!e&&!t&&(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}),e&&!m.length&&(0,q.jsx)(`p`,{className:`settings-resource-empty`,children:o(s.length?`noMatchingResources`:`noPluginsFound`)})]}),(0,q.jsxs)(`div`,{className:`settings-sidebar-footer`,children:[(0,q.jsx)(`span`,{children:e?o(`pluginCount`,{count:s.length}):o(`settingsCatalogLoading`)}),(0,q.jsx)(`button`,{type:`button`,"aria-label":o(`refreshStatus`),onClick:n,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-detail`,children:[(0,q.jsx)(AW,{catalog:e}),f?(0,q.jsx)(OW,{kind:`plugins`,pending:r,onConfigure:i,onCancel:()=>p(!1)}):t?(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}):_?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`settings-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:y(_)}),(0,q.jsx)(`code`,{children:_.source})]}),(0,q.jsx)(`span`,{className:`settings-status-badge ${PW(_)===`loaded`?`healthy`:``}`,children:o(`pluginState_${PW(_)}`)})]}),(0,q.jsxs)(`dl`,{className:`settings-detail-metadata settings-detail-metadata-wide`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`scope`)}),(0,q.jsx)(`dd`,{children:o(`resourceScope_${_.scope}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`resourceOrigin`)}),(0,q.jsx)(`dd`,{children:o(`resourceOrigin_${_.origin}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`installedVersion`)}),(0,q.jsx)(`dd`,{children:_.installedVersion??o(`notReported`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`configuredVersion`)}),(0,q.jsx)(`dd`,{children:_.configuredVersion??o(`resourceVersionUnpinned`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`resources`)}),(0,q.jsx)(`dd`,{children:o(`pluginResourceSummary`,{extensions:_.extensions.length,skills:_.skills.length,prompts:_.prompts.length,themes:_.themes.length})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`baseDirectory`)}),(0,q.jsx)(`dd`,{title:_.baseDir,children:_.baseDir??o(`notReported`)})]})]}),[...new Set(_.diagnostics)].map(e=>(0,q.jsx)(`p`,{className:`settings-resource-notice`,role:`status`,children:e},e)),_.canManage===!1&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,children:o(`resourceTargetTruncated`)}),_.configured&&_.canManage!==!1&&(0,q.jsx)(`div`,{className:`settings-resource-actions settings-resource-primary-actions`,children:[_.enabled===!1?`enable`:`disable`,`update`,`remove`].map(e=>(0,q.jsx)(CW,{isPending:r,onConfigure:i,label:o(`pluginAction_${e}`),request:o(`setupPluginOperationRequest`,{action:e,source:JSON.stringify(_.source),path:JSON.stringify(_.baseDir??null),scope:_.scope})},e))}),(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`pluginLoadedResources`,{count:NW(_)})}),(0,q.jsxs)(`section`,{className:`settings-resource-groups`,children:[_.extensions.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`extensions`)}),(0,q.jsx)(`ul`,{children:_.extensions.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:e.name}),(0,q.jsx)(`code`,{children:e.path})]}),(0,q.jsx)(`span`,{children:o(`extensionSurfaceCount`,{tools:e.toolCount,commands:e.commandCount})})]},e.path))})]}),_.skills.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`skillsSettings`)}),(0,q.jsx)(`p`,{children:_.skills.join(` · `)})]}),_.prompts.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`prompts`)}),(0,q.jsx)(`p`,{children:_.prompts.join(` · `)})]}),_.themes.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`themes`)}),(0,q.jsx)(`p`,{children:_.themes.join(` · `)})]})]})]}):(0,q.jsxs)(`div`,{className:`settings-empty-detail`,children:[(0,q.jsx)(Sc,{"aria-hidden":`true`}),(0,q.jsx)(`h2`,{children:o(s.length?`noMatchingResources`:`pluginsEmptyTitle`)}),(0,q.jsx)(Br,{label:o(`addPlugin`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:()=>p(!0)})]}),!f&&(0,q.jsxs)(kW,{catalog:e,pending:r,onReload:a,kind:`plugins`,onConfigure:i,children:[v.length>1&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(CW,{isPending:r,isBlocked:x,onConfigure:i,label:o(`enableVisiblePlugins`,{count:v.length}),request:o(`setupPluginsBulkRequest`,{packages:b,disabled:!1})}),(0,q.jsx)(CW,{isPending:r,isBlocked:x,onConfigure:i,label:o(`disableVisiblePlugins`,{count:v.length}),request:o(`setupPluginsBulkRequest`,{packages:b,disabled:!0})})]}),x&&(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`resourceBulkTooLarge`)})]})]})]})}function IW(e,t=``,n){let r=(0,K.useMemo)(()=>new de,[]),[i,a]=(0,K.useState)(0),o=JSON.stringify([e,t]),s=(0,K.useRef)(o);s.current=o;let c=(0,K.useRef)(0),[l,u]=(0,K.useState)(null),d=(0,K.useCallback)(()=>a(e=>e+1),[]);return(0,K.useEffect)(()=>{let t=new AbortController,n=++c.current;return u(e=>({owner:o,catalog:e?.owner===o?e.catalog:null,error:null})),r.settingsCatalog(e,t.signal).then(e=>{!t.signal.aborted&&c.current===n&&u({owner:o,catalog:e,error:null})},e=>{!t.signal.aborted&&c.current===n&&u(t=>({owner:o,catalog:t?.owner===o?t.catalog:null,error:e instanceof Error?e.message:String(e)}))}),()=>t.abort()},[r,i,e,o,n]),{catalog:l?.owner===o?l.catalog:null,error:l?.owner===o?l.error:null,refresh:d,updateSetup:e=>{s.current===o&&(c.current++,u(t=>t?.owner===o&&t.catalog?{...t,catalog:{...t.catalog,setup:e}}:t))}}}var LW=[`default`,`mist`,`rose`,`pine`],RW=[`codex`,`sans`,`serif`,`mono`],zW=[`system`,`light`,`dark`],BW={palette:`default`,accent:``,background:``,foreground:``,font:`codex`};function VW(e){return e===`pine`?`dark`:e===`mist`||e===`rose`?`light`:e}function HW(e,t){return e===`mist`||e===`rose`||e===`pine`?e:t.palette}function UW(e,t){switch(e){case`mist`:return t?{background:`#182126`,foreground:`#EDF3F5`,sidebar:`#1D292F`,accent:`#7BB5CA`}:{background:`#F8FBFC`,foreground:`#253239`,sidebar:`#EEF3F5`,accent:`#347991`};case`rose`:return t?{background:`#211A1C`,foreground:`#F4ECEC`,sidebar:`#2A2123`,accent:`#E09AA5`}:{background:`#FFF9F7`,foreground:`#342729`,sidebar:`#F6EDEA`,accent:`#B45562`};case`pine`:return t?{background:`#101A17`,foreground:`#EAF2EC`,sidebar:`#16241F`,accent:`#86C89E`}:{background:`#F4F8F5`,foreground:`#20352A`,sidebar:`#E9F1EB`,accent:`#32704A`};default:return t?{background:`#17191C`,foreground:`#EDF0F2`,sidebar:`#1D2024`,accent:`#74A9E6`}:{background:`#FFFFFF`,foreground:`#1A1C1F`,sidebar:`#F6F7F9`,accent:`#2563EB`}}}function WW(e){if(e.length>2e3)return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;if(Object.keys(n).sort().join(`,`)!==`appearance,theme,version`||n.version!==1)return null;let r=zW.find(e=>e===n.theme);if(!r||!n.appearance||typeof n.appearance!=`object`||Array.isArray(n.appearance))return null;let i=n.appearance;if(Object.keys(i).sort().join(`,`)!==`accent,background,font,foreground,palette`)return null;let a=LW.find(e=>e===i.palette),o=i.font===`system`?`codex`:RW.find(e=>e===i.font),{accent:s,background:c,foreground:l}=i;return!a||!o||typeof s!=`string`||typeof c!=`string`||typeof l!=`string`||![s,c,l].every(e=>e===``||/^#[0-9a-f]{6}$/iu.test(e))?null:{theme:r,appearance:{palette:a,font:o,accent:s,background:c,foreground:l}}}catch{return null}}var GW=[``,`#2563EB`,`#7C3AED`,`#DB2777`,`#D97706`,`#16A34A`];function KW({label:e,value:t,options:n,disabled:r,onSelect:i}){let a=n.find(e=>e.id===t);return(0,q.jsx)(yo,{className:`settings-select-menu`,button:{label:a?.label??t,"aria-label":e,variant:`secondary`,size:`sm`,className:`appearance-menu-trigger`,isDisabled:r,...a?.color?{icon:(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:a.color}})}:{}},menuWidth:200,alignment:`end`,items:n.map(e=>({id:e.id||`default`,label:e.label,isDisabled:r,...e.color?{icon:(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:e.color}})}:{},endContent:t===e.id?(0,q.jsx)(`span`,{className:`settings-select-check`,"aria-hidden":`true`,children:(0,q.jsx)(rs,{})}):void 0,onClick:()=>i(e.id)}))})}function qW({label:e,value:t,fallback:n,disabled:r,onSave:i}){let a=(t||n).toUpperCase(),o=(0,K.useRef)(a);o.current=a;let[s,c]=(0,K.useState)(a);(0,K.useEffect)(()=>c(a),[a]);let l=e=>{c(e),e!==a&&/^#[0-9a-f]{6}$/iu.test(e)&&i(e).then(e=>{e||c(o.current)})};return(0,q.jsxs)(`div`,{className:`appearance-color-input`,children:[(0,q.jsxs)(`label`,{className:`appearance-color-picker`,children:[(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:a}}),(0,q.jsx)(`input`,{"aria-label":`${e} — ${a}`,type:`color`,value:a,disabled:r,onChange:e=>l(e.target.value.toUpperCase())})]}),(0,q.jsx)(`input`,{className:`appearance-color-hex`,type:`text`,"aria-label":e,value:s,maxLength:7,spellCheck:!1,disabled:r,onChange:e=>l(e.target.value.toUpperCase()),onBlur:()=>c(a)})]})}function JW({catalog:e,theme:t,pending:n,error:r,onRefresh:i,onUpdatePreferences:a}){let{t:o}=W(),{mode:s}=sa(),c=e?.setup,l=c?.ui.webTheme??t,u=c?.ui.webAppearance??BW,d=HW(l,u),f=VW(l),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(``),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(null),[C,w]=(0,K.useState)(c?.ui.webChatWidth??820),[T,E]=(0,K.useState)(c?.ui.webChatFontSize??14),D=(0,K.useRef)({chatWidth:C,fontSize:T});c&&(D.current={chatWidth:c.ui.webChatWidth,fontSize:c.ui.webChatFontSize}),(0,K.useEffect)(()=>{c&&(w(c.ui.webChatWidth),E(c.ui.webChatFontSize))},[c]);let O=e?.setupWritable===!1||!!e?.resources.diagnostics.settingsErrors,k=n||!c||!!r||O,A=WW(_),j=e=>a({appearance:e}),M=()=>{n||(g(!1),v(``),b(!1))},N=f===`dark`||f===`system`&&s===`dark`,P=UW(d,N);return(0,q.jsxs)(`section`,{className:`settings-content-page settings-appearance-panel`,children:[(0,q.jsx)(`h1`,{children:o(`appearance`)}),(!c||r||O)&&(0,q.jsxs)(`div`,{className:`settings-load-state`,role:r||O?`alert`:`status`,children:[(0,q.jsx)(me,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o(O?`configurationReadFailure`:r?`settingsCatalogFailed`:`settingsCatalogLoading`)}),(r||O)&&(0,q.jsx)(`button`,{type:`button`,onClick:i,children:o(`retryAdmissionCheck`)})]}),(0,q.jsxs)(`section`,{className:`appearance-section`,"aria-labelledby":`appearance-visual-title`,children:[(0,q.jsx)(`h2`,{id:`appearance-visual-title`,children:o(`appearanceVisualStyle`)}),(0,q.jsxs)(`div`,{className:`appearance-card appearance-mode-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceMode`)}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":o(`appearanceMode`),className:`appearance-mode-options`,children:zW.map(e=>(0,q.jsx)(V,{content:o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`),children:(0,q.jsxs)(`label`,{className:`appearance-mode-option`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`openpi-appearance-mode`,"aria-label":o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`),checked:f===e,disabled:k,onChange:()=>void a({theme:e})}),(0,q.jsxs)(`span`,{"aria-hidden":`true`,className:`appearance-mode-preview`,"data-mode":e,"data-selected":f===e,children:[(0,q.jsxs)(`span`,{className:`appearance-mini-window`,children:[(0,q.jsx)(`span`,{className:`appearance-mini-sidebar`}),(0,q.jsxs)(`span`,{className:`appearance-mini-chat`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`em`,{})]})]}),e===`system`&&(0,q.jsxs)(`span`,{className:`appearance-mini-window appearance-mini-dark`,children:[(0,q.jsx)(`span`,{className:`appearance-mini-sidebar`}),(0,q.jsxs)(`span`,{className:`appearance-mini-chat`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`em`,{})]})]})]}),(0,q.jsx)(`span`,{className:`appearance-mode-label`,children:o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`)})]})},e))})]}),(0,q.jsxs)(`div`,{className:`appearance-card`,children:[(0,q.jsxs)(`div`,{className:`appearance-row appearance-theme-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceTheme`)}),(0,q.jsxs)(`div`,{className:`appearance-theme-actions`,children:[(0,q.jsx)(V,{content:o(`appearanceImport`),children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":o(`appearanceImport`),disabled:k,onClick:()=>{b(!1),g(!0)},children:(0,q.jsx)(Ts,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:o(`appearanceCopy`),children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":o(`appearanceCopy`),disabled:k,onClick:()=>{td(JSON.stringify({version:1,theme:f,appearance:{...u,palette:d}})).then(e=>S(e?`saved`:`failed`))},children:(0,q.jsx)(Ss,{"aria-hidden":`true`})})})]})]}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":o(`appearanceTheme`),"aria-busy":n,className:`appearance-palette-options`,children:LW.map(e=>{let t=UW(e,N),n=e==="default"?`OpenPI`:o(`theme${e[0].toUpperCase()}${e.slice(1)}`);return(0,q.jsxs)(`label`,{className:`appearance-palette-option`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`openpi-appearance-palette`,"aria-label":n,checked:d===e,disabled:k,onChange:()=>void j({palette:e})}),(0,q.jsxs)(`span`,{className:`appearance-palette-preview`,"aria-hidden":`true`,style:{background:t.background,color:t.foreground},children:[(0,q.jsxs)(`span`,{className:`appearance-palette-shell`,style:{background:t.sidebar},children:[(0,q.jsxs)(`span`,{className:`appearance-palette-sidebar`,children:[(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]}),(0,q.jsxs)(`span`,{className:`appearance-palette-canvas`,style:{background:t.background},children:[(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`em`,{style:{borderColor:t.accent},children:(0,q.jsx)(`span`,{className:`appearance-palette-send`,style:{background:t.accent}})})]})]}),(0,q.jsx)(`span`,{className:`appearance-palette-check`,children:(0,q.jsx)(rs,{})})]}),(0,q.jsx)(`span`,{className:`appearance-palette-label`,children:n})]},e)})}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceAccent`)}),(0,q.jsxs)(`div`,{className:`appearance-accent-controls`,children:[(0,q.jsx)(KW,{label:o(`appearanceAccent`),value:u.accent,options:GW.map((e,t)=>({id:e,label:o(`appearanceAccent${t}`),color:e||`var(--text)`})),disabled:k,onSelect:e=>void j({accent:e})}),(0,q.jsx)(qW,{label:o(`appearanceCustomAccent`),value:u.accent,fallback:`#2563EB`,disabled:k,onSave:e=>j({accent:e})})]})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceBackground`)}),(0,q.jsx)(qW,{label:o(`appearanceBackground`),value:u.background,fallback:P.background,disabled:k,onSave:e=>j({background:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceForeground`)}),(0,q.jsx)(qW,{label:o(`appearanceForeground`),value:u.foreground,fallback:P.foreground,disabled:k,onSave:e=>j({foreground:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceFont`)}),(0,q.jsx)(KW,{label:o(`appearanceFont`),value:u.font===`system`?`codex`:u.font,options:RW.map(e=>({id:e,label:o(`appearanceFont_${e}`)})),disabled:k,onSelect:e=>{let t=RW.find(t=>t===e);t&&j({font:t})}})]})]}),x&&(0,q.jsx)(`p`,{role:x===`failed`?`alert`:`status`,className:`appearance-share-status`,children:o(x===`saved`?`appearanceCopied`:`appearanceCopyFailed`)})]}),(0,q.jsxs)(`section`,{className:`appearance-section`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`appearance-advanced-toggle`,"aria-expanded":p,"aria-controls":`appearance-advanced`,onClick:()=>m(!p),children:[o(`appearanceAdvanced`),p?(0,q.jsx)(is,{"aria-hidden":`true`}):(0,q.jsx)(os,{"aria-hidden":`true`})]}),p&&c&&(0,q.jsxs)(`div`,{id:`appearance-advanced`,className:`appearance-card appearance-advanced-content`,children:[(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`expandThinkingByDefault`)}),(0,q.jsx)(bj,{label:o(`expandThinkingByDefault`),isLabelHidden:!0,value:c.ui.webExpandThinking,size:`sm`,isDisabled:k,onChange:e=>void a({expandThinking:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-slider-row`,children:[(0,q.jsxs)(`div`,{className:`settings-slider-heading`,children:[(0,q.jsx)(`span`,{children:o(`chatContentWidth`)}),(0,q.jsxs)(`output`,{children:[C,`px`]}),(0,q.jsx)(`button`,{type:`button`,className:`settings-reset-button`,"aria-label":o(`resetChatContentWidth`),disabled:k||C===820,onClick:()=>{w(820),a({chatWidth:820}).then(e=>{e||w(D.current.chatWidth)})},children:(0,q.jsx)(he,{"aria-hidden":`true`})})]}),(0,q.jsx)(yW,{label:o(`chatContentWidth`),isLabelHidden:!0,value:C,min:820,max:2e3,step:10,width:`100%`,valueDisplay:`none`,isDisabled:k,onChange:e=>w(e),onChangeEnd:e=>{e!==c.ui.webChatWidth&&a({chatWidth:e}).then(e=>{e||w(D.current.chatWidth)})}})]}),(0,q.jsxs)(`div`,{className:`appearance-slider-row`,children:[(0,q.jsxs)(`div`,{className:`settings-slider-heading`,children:[(0,q.jsx)(`span`,{children:o(`chatFontSize`)}),(0,q.jsxs)(`output`,{children:[T,`px`]}),(0,q.jsx)(`button`,{type:`button`,className:`settings-reset-button`,"aria-label":o(`resetChatFontSize`),disabled:k||T===14,onClick:()=>{E(14),a({chatFontSize:14}).then(e=>{e||E(D.current.fontSize)})},children:(0,q.jsx)(he,{"aria-hidden":`true`})})]}),(0,q.jsx)(yW,{label:o(`chatFontSize`),isLabelHidden:!0,value:T,min:12,max:24,step:1,width:`100%`,valueDisplay:`none`,isDisabled:k,onChange:e=>E(e),onChangeEnd:e=>{e!==c.ui.webChatFontSize&&a({chatFontSize:e}).then(e=>{e||E(D.current.fontSize)})}})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceReset`)}),(0,q.jsxs)(`button`,{type:`button`,className:`appearance-reset`,disabled:k,onClick:()=>void a({theme:`system`,appearance:BW,chatWidth:820,chatFontSize:14,expandThinking:!1}),children:[(0,q.jsx)(he,{"aria-hidden":`true`}),o(`appearanceResetAction`)]})]})]})]}),(0,q.jsxs)(Se,{isOpen:h,onOpenChange:e=>{e||M()},"aria-label":o(`appearanceImport`),width:480,className:`appearance-import-dialog`,children:[(0,q.jsx)(`h2`,{className:`appearance-import-title`,children:o(`appearanceImport`)}),(0,q.jsxs)(`form`,{className:`appearance-import-form`,onSubmit:e=>{e.preventDefault(),!(!A||k)&&(b(!1),a(A).then(e=>{e?(g(!1),v(``)):b(!0)}))},children:[(0,q.jsxs)(`label`,{children:[o(`appearanceThemeValue`),(0,q.jsx)(`textarea`,{maxLength:2e3,value:_,disabled:n,placeholder:o(`appearanceImportPlaceholder`),onChange:e=>{b(!1),v(e.target.value)}})]}),_&&!A&&(0,q.jsx)(`p`,{role:`alert`,children:o(`appearanceImportInvalid`)}),y&&(0,q.jsx)(`p`,{role:`alert`,children:o(`settingsPreferencesSaveFailed`)}),(0,q.jsxs)(`div`,{className:`appearance-import-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:n,onClick:M,children:o(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,disabled:k||!A,children:o(n?`savingSettings`:`appearanceImportAction`)})]})]})]})]})}function YW({workspaces:e,onRestore:t}){let{t:n,i18n:r}=W(),i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(``),[l,u]=(0,K.useState)(`updated`),[d,f]=(0,K.useState)(new Set),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(null),[y,b]=(0,K.useState)(null),[x,S]=(0,K.useState)(new Set),C=(0,K.useRef)(new Set),w=(0,K.useRef)(null),T=(0,K.useRef)(!1),E=JSON.stringify([a.trim(),s,l]),D=(0,K.useRef)({key:E});D.current.key!==E&&(D.current={key:E});let O=p?.scope===E?p:null,k=_?.scope===E?_:null,A=(0,K.useCallback)(async(e,t=0)=>{w.current?.abort();let n=new AbortController;w.current=n,g(!0),v(null);let r={query:a.trim(),sort:l,...s?{cwd:s}:{},limit:25};try{let a=await i.listArchivedSessions({...r,...e?{cursor:e}:{}},n.signal);if(n.signal.aborted||w.current!==n)return;let o=[...a.sessions];for(;!e&&o.length!o.some(t=>t.path===e.path));if(o.push(...e),!e.length)break}m(t=>({...a,scope:E,sessions:e&&t?.scope===E?[...t.sessions,...o.filter(e=>!t.sessions.some(t=>t.path===e.path))]:o}))}catch(t){!n.signal.aborted&&w.current===n&&v({scope:E,stale:t instanceof ge&&t.code===`ARCHIVED_SESSION_CURSOR_STALE`,...e?{cursor:e}:{}})}finally{w.current===n&&(w.current=null,g(!1))}},[i,s,a,E,l]);(0,K.useEffect)(()=>(T.current=!0,()=>{T.current=!1}),[]),(0,K.useEffect)(()=>(b(null),A(),()=>{w.current?.abort(),w.current=null}),[A]);let j=async e=>{if(C.current.has(e))return;C.current.add(e),S(new Set(C.current)),b(null);let n=D.current;try{let r=await t(e);if(!T.current||D.current!==n)return;if(!r){b(e);return}let i=O?.sessions.length??0;m(t=>t?{...t,sessions:t.sessions.filter(t=>t.path!==e)}:null),await A(void 0,i)}catch{T.current&&D.current===n&&b(e)}finally{C.current.delete(e),T.current&&S(new Set(C.current))}},M=new Map;for(let e of O?.sessions??[]){let t=e.workspacePath??e.cwd,n=M.get(t)??[];n.push(e),M.set(t,n)}let N=t=>e.find(e=>e.path===t)?.name??t.split(/[\\/]/u).filter(Boolean).at(-1)??t,P=[...new Set([...e.map(e=>e.path),...M.keys(),...s?[s]:[]])];return(0,q.jsxs)(`section`,{className:`settings-content-page settings-archive-panel`,children:[(0,q.jsx)(`h1`,{children:n(`settingsArchivedChats`)}),(0,q.jsxs)(`div`,{className:`settings-archive-toolbar`,children:[(0,q.jsxs)(`label`,{className:`settings-archive-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":n(`searchArchivedChats`),placeholder:n(`searchArchivedChats`),maxLength:160,value:a,onChange:e=>o(e.target.value)}),a&&(0,q.jsx)(`button`,{type:`button`,"aria-label":n(`settingsClearSearch`),onClick:()=>o(``),children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),(0,q.jsx)(Tj,{label:n(`archiveProjectFilter`),value:s,onChange:c,options:[{value:``,label:n(`archiveAllProjects`)},...P.map(e=>({value:e,label:N(e)}))]}),(0,q.jsx)(Tj,{label:n(`archiveSort`),value:l,onChange:e=>u(e===`created`?`created`:`updated`),options:[{value:`updated`,label:n(`archiveSortUpdated`)},{value:`created`,label:n(`archiveSortCreated`)}]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":n(`refreshArchives`),disabled:h,onClick:()=>void A(void 0,O?.sessions.length),children:(0,q.jsx)(me,{"aria-hidden":`true`})})]}),k&&(0,q.jsxs)(`div`,{className:`settings-archive-error`,role:`alert`,children:[(0,q.jsx)(`span`,{children:n(k.stale?`archiveCursorStale`:`archiveLoadFailed`)}),(0,q.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>void A(k.stale?void 0:k.cursor),children:n(`retryAdmissionCheck`)})]}),y&&(0,q.jsx)(`div`,{className:`settings-archive-error`,role:`alert`,children:n(`restoreFailed`)}),h&&(0,q.jsx)(`p`,{role:`status`,className:`settings-archive-status`,children:n(`loadingArchives`)}),!h&&!k&&O?.sessions.length===0&&(0,q.jsxs)(`div`,{className:`settings-archive-empty`,children:[(0,q.jsx)(Go,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:n(a.trim()||s?`noMatchingScannedArchives`:O.truncation.truncated?`noScannedArchives`:`noArchivedSessions`)})]}),(0,q.jsx)(`div`,{className:`settings-archive-groups`,children:[...M].map(([e,t])=>(0,q.jsxs)(`section`,{className:`settings-archive-group`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`settings-archive-group-heading`,"aria-label":n(`archiveProjectGroup`,{project:N(e),count:t.length}),"aria-expanded":!d.has(e),"aria-controls":`archive-group-${encodeURIComponent(e)}`,onClick:()=>f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),children:[d.has(e)?(0,q.jsx)(os,{"aria-hidden":`true`}):(0,q.jsx)(is,{"aria-hidden":`true`}),(0,q.jsx)(Vs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{title:e,children:N(e)}),(0,q.jsx)(`small`,{children:t.length})]}),!d.has(e)&&(0,q.jsx)(`ul`,{id:`archive-group-${encodeURIComponent(e)}`,className:`settings-archive-list`,children:t.map(e=>{let t=e.name||e.firstMessage||n(`untitledSession`),i=new Date(l===`created`?e.created:e.modified);return(0,q.jsxs)(`li`,{className:`settings-archive-row`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`settings-archive-chat-title`,title:t,children:t}),(0,q.jsx)(`time`,{dateTime:Number.isNaN(i.getTime())?void 0:i.toISOString(),children:Number.isNaN(i.getTime())?n(`unknownState`):new Intl.DateTimeFormat(r.language,{dateStyle:`medium`}).format(i)})]}),(0,q.jsxs)(`button`,{type:`button`,"aria-label":n(`restoreArchivedChat`,{title:t}),disabled:x.has(e.path),onClick:()=>void j(e.path),children:[(0,q.jsx)(Wo,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:n(x.has(e.path)?`restoringConversation`:`restoreConversation`)})]})]},e.path)})})]},e))}),!!O?.truncation.recordsUnscanned&&(0,q.jsx)(`p`,{className:`settings-archive-status`,children:n(`archiveScanBounded`,{count:O.truncation.recordsUnscanned})}),O?.nextCursor&&(0,q.jsx)(`button`,{type:`button`,className:`settings-archive-more`,disabled:h,onClick:()=>void A(O.nextCursor),children:n(`moreArchives`)})]})}var XW=[{id:`general`,group:`settingsPersonal`,label:`generalSettings`,Icon:Nc,terms:[`agentBehavior`,`resultDisplay`,`workflowLimits`,`runtimeIdentity`,`runtimeBackendVersion`,`runtimePackageRoot`,`runtimeStartedAt`,`runtimeGitRevision`,`runtimeGitState`,`runtimeFrontendVersion`,`runtimeFrontendBuild`,`runtimeStartupBuild`]},{id:`appearance`,group:`settingsPersonal`,label:`appearance`,Icon:zc,terms:[`appearanceTheme`,`appearanceAccent`,`appearanceFont`,`chatContentWidth`,`chatFontSize`]},{id:`archived-chats`,group:`settingsPersonal`,label:`settingsArchivedChats`,Icon:Go,terms:[`restoreConversation`]},{id:`configuration`,group:`settingsPersonal`,label:`configurationSettings`,Icon:Mc,terms:[`configurationApproval`,`configurationSandbox`,`configurationVerbosity`,`configurationSummary`,`configurationReasoningLevels`,`configurationDependencies`]},{id:`models`,group:`settingsAgent`,label:`modelSettings`,Icon:ws,terms:[`modelDefaultTitle`]},{id:`subagents`,group:`settingsAgent`,label:`subagentsSettings`,Icon:$o,terms:[]},{id:`web-search`,group:`settingsAgent`,label:`webSearchSettings`,Icon:Dc,terms:[]},{id:`skills`,group:`settingsIntegrations`,label:`skillsSettings`,Icon:Xs,terms:[]},{id:`plugins`,group:`settingsIntegrations`,label:`pluginsSettings`,Icon:Sc,terms:[]},{id:`browser`,group:`settingsIntegrations`,label:`browserSettings`,Icon:Es,terms:[]}];function ZW(e){return XW.find(({id:t})=>t===e)?.id}function QW({sessionId:e,sessionPath:t,cwd:n,entry:r=`general`,models:i,currentModel:a,thinkingLevel:o,theme:s,preferences:c,workspaces:l=[],onRestoreSession:u,capabilities:d,setupBusy:f,setupBlockedReason:p,plan:m,planSelectionPending:h=!1,onExitPlan:g,setupOutcome:_,onConfigureOpenPi:v,interaction:y,onPreferencesChanged:b,onSelectModel:x,onOpenRuntimeStatus:S,onClose:C}){let{t:w}=W(),T=f||!!p,E=(0,K.useRef)(null),D=(0,K.useRef)(null),[O,k]=(0,K.useState)(``),[A,j]=(0,K.useState)(r===`credentials`?`models`:r),[M,N]=(0,K.useState)(r===`credentials`||r===`models`),[P,F]=(0,K.useState)(!1),[I,ee]=(0,K.useState)(!1),[L,R]=(0,K.useState)(`general`),te=(0,K.useRef)(!1),z=(0,K.useRef)(!1),B=(0,K.useRef)(0),[ne,re]=(0,K.useState)(!1),V=(0,K.useRef)(!1),[ie,ae]=(0,K.useState)(!1),[oe,se]=(0,K.useState)(null),[ce,le]=(0,K.useState)(!1),[H,ue]=(0,K.useState)(!1),[fe,pe]=(0,K.useState)(null),me=H,he=(0,K.useRef)(void 0),ge=m!==void 0&&m!==`inactive`,_e=P||T||ge||h,ve=I&&L!==A||!I&&(A===`skills`||A===`plugins`||A===`web-search`)?void 0:!I||_?.requestId!==he.current?_:void 0,{catalog:ye,error:be,refresh:xe,updateSetup:Ce}=IW(e,a?`${a.provider}/${a.id}`:``,JSON.stringify(c)),we=ve!==void 0&&[`failed`,`cancelled`,`unconfirmed`].includes(ve.status);(0,K.useEffect)(()=>{E.current?.focus()},[]),(0,K.useEffect)(()=>{if(I){if(ve&&ve.status!==`pending`&&te.current){te.current=!1,z.current=!1,window.clearTimeout(B.current),xe(),b();return}if(T){z.current=!0;return}!z.current||!te.current||(te.current=!1,z.current=!1,window.clearTimeout(B.current),xe(),b())}},[b,xe,T,I,ve]),(0,K.useEffect)(()=>()=>window.clearTimeout(B.current),[]);let Te=async e=>{if(ae(!1),_e)return!1;he.current=_?.requestId,R(A),F(!0),ee(!1),te.current=!1,z.current=!1,window.clearTimeout(B.current),se(null);try{let t=await v(e);return t?(ee(!0),te.current=!0,B.current=window.setTimeout(()=>{!te.current||z.current||(te.current=!1,z.current=!1,xe(),b())},2e3)):se(w(`setupRequestFailed`)),t}catch(e){return F(!1),se(e instanceof Error?e.message:w(`setupRequestFailed`)),!1}finally{F(!1)}},Ee=async()=>{if(_e||!ye?.sessionPath)throw Error(w(`resourceReloadFailed`));F(!0);try{await new de().reloadSettingsResources(e,ye.sessionPath),xe(),b()}finally{F(!1)}},U=async e=>{if(V.current||!ye)return!1;V.current=!0,re(!0),ae(!1),se(null);try{let t=await new de().savePreferences(e);return Ce(t.setup),ae(!0),b(),!0}catch{return se(w(`settingsPreferencesSaveFailed`)),!1}finally{V.current=!1,re(!1)}},De=e=>{me||(j(e),k(``),e===`models`&&N(!0),se(null))};(0,K.useEffect)(()=>{let e=new URL(window.location.href);e.searchParams.set(`settings`,A),window.history.replaceState(window.history.state,``,e)},[A]);let Oe=XW.filter(({label:e,terms:t})=>[e,...t].some(e=>w(e).normalize(`NFKC`).toLocaleLowerCase().includes(O.trim().normalize(`NFKC`).toLocaleLowerCase()))),ke=(e,t=!1)=>{if(!me){if(ce&&!t){pe(e);return}pe(null),e.kind===`runtime`?S():C()}};return(0,q.jsxs)(Se,{isOpen:!0,purpose:`info`,padding:0,width:`calc(100vw - 32px)`,maxHeight:`calc(100dvh - 16px)`,className:`provider-settings-dialog`,"aria-label":w(`settings`),onOpenChange:e=>{!e&&!fe&&ke({kind:`close`})},children:[(0,q.jsxs)(`section`,{className:`provider-settings-surface`,children:[(0,q.jsxs)(`aside`,{className:`provider-settings-sidebar`,children:[(0,q.jsxs)(`header`,{className:`provider-settings-header`,children:[(0,q.jsx)(`strong`,{className:`provider-settings-title`,children:w(`settings`)}),(0,q.jsx)(`select`,{className:`provider-settings-mobile-picker`,"aria-label":w(`settingsNavigation`),disabled:me,value:A,onChange:e=>{let t=XW.find(({id:t})=>t===e.target.value);t&&De(t.id)},children:XW.map(({id:e,label:t})=>(0,q.jsx)(`option`,{value:e,children:w(t)},e))})]}),(0,q.jsxs)(`label`,{className:`provider-settings-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":w(`settingsSearch`),placeholder:w(`settingsSearch`),value:O,onChange:e=>k(e.target.value),disabled:me}),O&&(0,q.jsx)(`button`,{type:`button`,"aria-label":w(`settingsClearSearch`),onClick:()=>k(``),children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),(0,q.jsxs)(`div`,{className:`provider-settings-navigation`,ref:D,"aria-label":w(`settingsNavigation`),role:`tablist`,"aria-orientation":`vertical`,children:[[`settingsPersonal`,`settingsAgent`,`settingsIntegrations`].map(e=>(0,q.jsxs)(`div`,{className:`provider-settings-nav-group`,children:[Oe.some(t=>t.group===e)&&(0,q.jsx)(`p`,{children:w(e)}),Oe.filter(t=>t.group===e).map(({id:e,label:t,Icon:n})=>(0,q.jsxs)(`button`,{type:`button`,role:`tab`,disabled:me,id:`settings-tab-${e}`,tabIndex:A===e||!Oe.some(e=>e.id===A)&&Oe[0]?.id===e?0:-1,"aria-selected":A===e,"aria-controls":`settings-panel-${e}`,className:`provider-settings-tab`,title:w(t),onClick:()=>De(e),onKeyDown:t=>{if(t.altKey||t.ctrlKey||t.metaKey||t.nativeEvent.isComposing)return;let n=Oe.findIndex(t=>t.id===e),r=t.key===`Home`?0:t.key===`End`?Oe.length-1:t.key===`ArrowDown`||t.key===`ArrowRight`?(n+1)%Oe.length:t.key===`ArrowUp`||t.key===`ArrowLeft`?(n+Oe.length-1)%Oe.length:void 0;if(r===void 0)return;t.preventDefault();let i=Oe[r].id;De(i),D.current?.querySelector(`#settings-tab-${i}`)?.focus()},children:[(0,q.jsx)(n,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:w(t)})]},e))]},e)),Oe.length===0&&(0,q.jsx)(`p`,{className:`provider-settings-no-results`,role:`status`,children:w(`settingsNoResults`)})]}),(0,q.jsx)(`button`,{ref:E,type:`button`,className:`icon-button provider-settings-close`,"aria-label":w(`close`),disabled:me,title:w(me?`savingSettings`:`close`),onClick:()=>ke({kind:`close`}),children:(0,q.jsx)(je,{})})]}),(0,q.jsxs)(`div`,{className:`provider-settings-body`,children:[ge&&A!==`browser`&&(0,q.jsxs)(`div`,{className:`settings-plan-notice`,role:`status`,children:[(0,q.jsx)(`span`,{children:w(T?`setupPlanBusy`:`setupPlanBlocked`)}),(0,q.jsx)(Br,{label:w(`planModeExit`),variant:`secondary`,size:`sm`,isDisabled:T||h||!g,onClick:()=>void g?.()})]}),(0,q.jsxs)(`div`,{className:`provider-settings-main`,children:[(0,q.jsx)(`div`,{id:`settings-panel-configuration`,"aria-labelledby":`settings-tab-configuration`,"aria-label":w(`configurationSettings`),role:`tabpanel`,hidden:A!==`configuration`,children:A===`configuration`&&(0,q.jsx)(Aj,{catalog:ye,error:be,pending:_e||I&&L===`configuration`&&(!ve||ve.status===`pending`),preferencePending:ne,onConfigure:Te,onUpdatePreferences:U,onRefresh:xe,onOpenRuntimeStatus:()=>ke({kind:`runtime`})})}),(0,q.jsx)(`div`,{id:`settings-panel-appearance`,"aria-labelledby":`settings-tab-appearance`,"aria-label":w(`appearance`),role:`tabpanel`,hidden:A!==`appearance`,children:(0,q.jsx)(JW,{catalog:ye,theme:s,pending:ne,error:be,onRefresh:xe,onUpdatePreferences:U})}),(0,q.jsx)(`div`,{id:`settings-panel-archived-chats`,"aria-labelledby":`settings-tab-archived-chats`,"aria-label":w(`settingsArchivedChats`),role:`tabpanel`,hidden:A!==`archived-chats`,children:A===`archived-chats`&&(0,q.jsx)(YW,{workspaces:l,onRestore:u??(async()=>!1)})}),(0,q.jsx)(`div`,{id:`settings-panel-web-search`,"aria-labelledby":`settings-tab-web-search`,"aria-label":w(`webSearchSettings`),role:`tabpanel`,hidden:A!==`web-search`,children:A===`web-search`&&(0,q.jsx)(jj,{catalog:ye,error:be,pending:_e,onConfigure:Te,onRefresh:xe})}),(0,q.jsx)(`div`,{id:`settings-panel-browser`,"aria-labelledby":`settings-tab-browser`,"aria-label":w(`browserSettings`),role:`tabpanel`,hidden:A!==`browser`,children:A===`browser`&&(0,q.jsx)(Oj,{onConfigure:Te,setupPending:_e})}),(0,q.jsx)(`div`,{id:`settings-panel-general`,"aria-labelledby":`settings-tab-general`,"aria-label":w(`generalSettings`),role:`tabpanel`,hidden:A!==`general`,children:(0,q.jsx)(TW,{catalog:ye,error:be,currentModel:a,thinkingLevel:o,cwd:n,setupPending:P||T,preferencePending:ne||!ye,setupBusy:T,setupBlockedReason:p,setupBlocked:ge||h,onConfigure:Te,onUpdatePreferences:U,onOpenRuntimeStatus:()=>ke({kind:`runtime`}),onRefresh:xe})}),(0,q.jsx)(`section`,{id:`settings-panel-models`,"aria-labelledby":`settings-tab-models`,"aria-label":w(`modelSettings`),className:`settings-models`,role:`tabpanel`,hidden:A!==`models`,children:M&&(0,q.jsx)(oW,{sessionId:e,sessionPath:t,models:i,currentModel:a,busy:T,focusCredentials:r===`credentials`,onSaved:async()=>(xe(),b()),onSelectModel:x,onDraftChange:le,onSavingChange:ue},e)}),(0,q.jsx)(`div`,{id:`settings-panel-skills`,"aria-labelledby":`settings-tab-skills`,"aria-label":w(`skillsSettings`),role:`tabpanel`,hidden:A!==`skills`,children:(0,q.jsx)(jW,{catalog:ye,error:be,onRefresh:xe,setupPending:_e,onConfigure:Te,onReload:Ee},e)}),(0,q.jsx)(`div`,{id:`settings-panel-subagents`,"aria-labelledby":`settings-tab-subagents`,"aria-label":w(`subagentsSettings`),role:`tabpanel`,hidden:A!==`subagents`,children:(0,q.jsx)(MW,{catalog:ye,error:be,currentModel:a,models:i,activity:d?.subagents,setupPending:P||T,setupBlocked:ge||h,onConfigure:Te,onRefresh:xe})}),(0,q.jsx)(`div`,{id:`settings-panel-plugins`,"aria-labelledby":`settings-tab-plugins`,"aria-label":w(`pluginsSettings`),role:`tabpanel`,hidden:A!==`plugins`,children:(0,q.jsx)(FW,{catalog:ye,error:be,onRefresh:xe,setupPending:_e,onConfigure:Te,onReload:Ee},e)})]}),y,oe&&(0,q.jsx)(`div`,{className:`settings-global-error`,role:`alert`,children:oe}),(ne||ie)&&!oe&&!we&&(0,q.jsx)(`div`,{className:`settings-global-status`,role:`status`,children:w(ne?`savingSettings`:`settingsPreferencesSaved`)}),!ne&&(!ie||we)&&(I&&L===A||ve)&&!oe&&(0,q.jsxs)(`div`,{className:ve?.status===`failed`?`settings-global-error`:`settings-global-status`,role:ve?.status===`failed`?`alert`:`status`,children:[w(ve?(A===`skills`||A===`plugins`||A===`web-search`)&&[`unconfirmed`,`saved`,`unchanged`].includes(ve.status)?`resourceRequestFinished`:`setupOutcome_${ve.status}`:T?`setupRequestRunning`:A===`skills`||A===`plugins`||A===`web-search`?`resourceRequestSubmitted`:`setupRequestAccepted`),ve?.error&&(0,q.jsx)(`p`,{children:ve.error})]})]})]}),fe&&(0,q.jsx)(uj,{isOpen:!0,onOpenChange:e=>{e||pe(null)},title:w(`unsavedSettingsTitle`),description:w(`unsavedSettingsDetail`),cancelLabel:w(`keepEditing`),actionLabel:w(`discardAndContinue`),onAction:()=>ke(fe,!0)})]})}function $W({identity:e}){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;let n=t%6;return(0,q.jsx)(`span`,{className:`subagent-avatar tone-${n}`,"aria-hidden":`true`,children:(0,q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,children:[(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,q.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`}),(0,q.jsx)(`path`,{d:`M3 12h18M5 6.5c4 3 10 3 14 0M5 17.5c4-3 10-3 14 0`})]},`sphere`),(0,q.jsx)(`g`,{children:(0,q.jsx)(`path`,{d:`M4 20V4a16 16 0 0 1 16 16H4ZM4 4l16 16M4 9l11 11M4 14l6 6M10 5l-6 15M16 10L4 20`})},`fan`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`path`,{d:`m12 2 3 6 7-1-4 5 4 5-7-1-3 6-3-6-7 1 4-5-4-5 7 1Z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`})]},`rosette`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,q.jsx)(`path`,{d:`M3 12h18M12 3a9 9 0 0 0 0 18M12 6a6 6 0 0 0 0 12M12 9a3 3 0 0 0 0 6M12 3v18`})]},`arcs`),(0,q.jsx)(`g`,{children:(0,q.jsx)(`path`,{d:`m12 2 9 5v10l-9 5-9-5V7Zm0 0v20M3 7l18 10M21 7 3 17M3 7l9 5 9-5M3 17l9-5 9 5`})},`prism`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`path`,{d:`M12 12V2c6 0 10 4 10 10H12Zm0 0v10C6 22 2 18 2 12h10ZM12 12H2C2 6 6 2 12 2v10Zm0 0h10c0 6-4 10-10 10V12Z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2`,fill:`currentColor`})]},`windmill`)][n]})})}function eG(e,t,n,r){let i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(0),p=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(!n)return;let r=new AbortController;return p.current=r,c(!0),u(!1),i.sessionSources(e,t,r.signal).then(n=>{!r.signal.aborted&&n.sessionId===e&&n.path===t&&o(n)}).catch(()=>{r.signal.aborted||u(!0)}).finally(()=>{r.signal.aborted||(c(!1),p.current=null)}),()=>{r.abort(),p.current?.abort(),p.current=null}},[i,e,t,n,r,d]),{page:a?.sessionId===e&&a.path===t?a:null,loading:s,error:l,loadMore:async()=>{if(p.current||!a||a.nextOffset===void 0)return;let n=new AbortController;p.current=n,c(!0),u(!1);try{let r=await i.sessionSources(e,t,n.signal,a.nextOffset,a.revision);!n.signal.aborted&&r.sessionId===e&&r.path===t&&r.revision===a.revision&&o({...r,sources:[...a.sources,...r.sources]})}catch{n.signal.aborted||u(!0)}finally{n.signal.aborted||(c(!1),p.current=null)}},refresh:()=>f(e=>e+1)}}function tG({sessionId:e,path:t,source:n,thumbnail:r=!1,active:i=!0}){let{t:a}=W(),o=(0,K.useRef)(null),[s,c]=(0,K.useState)(!1),l=JSON.stringify([e,t,n.entryId,n.partIndex]),[u,d]=(0,K.useState)(null);(0,K.useEffect)(()=>{if(!r||!o.current||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(([e])=>c(!!e?.isIntersecting));return e.observe(o.current),()=>e.disconnect()},[r]),(0,K.useEffect)(()=>{if(!i||r&&!s){d(null);return}let a=new AbortController,o;return d({identity:l}),new de().sourceImage(e,t,n.entryId,n.partIndex,a.signal).then(e=>{if(a.signal.aborted)return;if(![`image/png`,`image/jpeg`,`image/gif`,`image/webp`].includes(e.mimeType)||e.data.length>xe)throw Error(`Invalid image`);let t=atob(e.data);if(t.length>10485760||btoa(t)!==e.data)throw Error(`Invalid image`);let n=Uint8Array.from(t,e=>e.charCodeAt(0));o=URL.createObjectURL(new Blob([n],{type:e.mimeType})),d({identity:l,url:o})}).catch(()=>{a.signal.aborted||d({identity:l,failed:!0})}),()=>{a.abort(),o&&URL.revokeObjectURL(o)}},[e,t,n.entryId,n.partIndex,l,i,r,s]);let f=i&&(!r||s)&&u?.identity===l?u:null;return(0,q.jsx)(`span`,{ref:o,className:`session-source-image`,"data-thumbnail":r||void 0,children:f?.url&&!f.failed?(0,q.jsx)(`img`,{src:f.url,draggable:!1,alt:r?``:n.name||a(`attachedImage`),onError:()=>d({identity:l,failed:!0})}):r?(0,q.jsx)(qs,{"aria-hidden":`true`}):(0,q.jsx)(`p`,{role:f?.failed?`alert`:`status`,children:a(f?.failed?`imagePreviewFailed`:`readingFile`)})})}function nG({source:e,sessionId:t,path:n,onOpen:r,thumbnail:i=!0,detailed:a=!1}){let{t:o}=W();return(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row session-source-row${a?` source-detail-row`:``}`,title:e.reference||e.name||o(`attachedImage`),onClick:r,children:[(0,q.jsx)(`span`,{className:`session-source-icon`,children:e.kind===`image`?i?(0,q.jsx)(tG,{sessionId:t,path:n,source:e,thumbnail:!0}):(0,q.jsx)(qs,{"aria-hidden":`true`}):(0,q.jsx)(Fs,{"aria-hidden":`true`})}),a?(0,q.jsxs)(`span`,{className:`session-source-copy`,children:[(0,q.jsx)(`strong`,{children:e.name||o(`attachedImage`)}),e.reference&&(0,q.jsx)(`span`,{className:`source-detail-reference`,children:e.reference}),(0,q.jsx)(`span`,{className:`source-detail-status`,children:o(`sourceAttached`)})]}):(0,q.jsx)(`span`,{children:e.name||o(`attachedImage`)})]})}function rG({sessionId:e,path:t,data:n,onSelect:r}){let{t:i}=W(),a=be(),o=(0,K.useRef)(null),s=(0,K.useRef)(a?.sources?.scroll??0);return(0,K.useLayoutEffect)(()=>{n.page?.sources.length&&o.current&&(o.current.scrollTop=s.current)},[n.page?.sources.length]),(0,q.jsxs)(`div`,{className:`session-sources-list`,ref:o,onScroll:e=>{s.current=e.currentTarget.scrollTop,a&&(a.sources={scroll:s.current})},children:[!n.loading&&!n.error&&!n.page?.sources.length&&(0,q.jsx)(`p`,{children:i(`sourcesEmpty`)}),n.page?.sources.map(n=>(0,q.jsx)(nG,{source:n,sessionId:e,path:t,onOpen:()=>r(n),detailed:!0},n.id)),n.error&&(0,q.jsxs)(`p`,{role:`alert`,children:[i(`sourcesFailed`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:n.refresh,children:i(`gitReviewRetry`)})]}),n.loading&&(0,q.jsx)(`p`,{role:`status`,children:i(`readingFile`)}),n.page?.nextOffset!==void 0&&(0,q.jsx)(`button`,{className:`sources-load-more`,type:`button`,disabled:n.loading,onClick:()=>void n.loadMore(),children:i(`sourcesLoadMore`)}),n.page?.truncated&&(0,q.jsx)(`p`,{children:i(`sourcesPartial`)})]})}function iG({sessionId:e,path:t,revision:n}){let{t:r}=W(),i=eG(e,t,!0,n),a=(0,K.useRef)(null);(0,K.useEffect)(()=>{let e=requestAnimationFrame(()=>a.current?.focus({preventScroll:!0}));return()=>cancelAnimationFrame(e)},[]);let o=(0,K.useContext)($E),[s,c]=(0,K.useState)(null),l=e=>{e?.kind===`file`&&e.reference?o?.open(e.reference,void 0,document.activeElement instanceof HTMLElement?document.activeElement:void 0):c(e)};return(0,q.jsxs)(`section`,{className:`session-sources-panel`,ref:a,tabIndex:-1,"aria-label":r(`sessionSources`),children:[(0,q.jsx)(rG,{sessionId:e,path:t,data:i,onSelect:l}),(0,q.jsx)(aG,{sessionId:e,path:t,open:!!s,source:s,data:i,onSelect:l,onClose:()=>c(null)})]})}function aG({sessionId:e,path:t,open:n,source:r,data:i,onSelect:a,onClose:o}){let{t:s}=W(),[c,l]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{r?.id,l(!1)},[e,t,r?.id]),(0,q.jsx)(Se,{isOpen:n,onOpenChange:e=>!e&&o(),purpose:`info`,width:800,maxHeight:`calc(100dvh - 32px)`,padding:0,"aria-label":s(`sessionSources`),children:n&&(0,q.jsxs)(`div`,{className:`session-sources-dialog draft-image-preview`,children:[(0,q.jsxs)(`header`,{children:[r&&i&&(0,q.jsx)(`button`,{type:`button`,"aria-label":s(`sourcesBack`),onClick:()=>a(null),children:(0,q.jsx)(Ko,{})}),(0,q.jsx)(`strong`,{title:r?.name,children:r?r.name||s(`attachedImage`):s(`sessionSources`)}),r&&(0,q.jsx)(`button`,{type:`button`,"aria-pressed":c,onClick:()=>l(e=>!e),children:s(c?`fitImage`:`originalImageSize`)}),(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,"aria-label":s(`close`),onClick:o,children:(0,q.jsx)(je,{})})]}),r?(0,q.jsx)(lO,{original:c,children:(0,q.jsx)(tG,{sessionId:e,path:t,source:r,active:n},JSON.stringify([e,t,r.id]))},JSON.stringify([e,t,r.id])):i?(0,q.jsx)(rG,{sessionId:e,path:t,data:i,onSelect:a}):null]})})}function oG({sessionId:e,workspace:t,agents:n,omitted:r,omittedWorkflows:i=0,review:a,onSubagents:o,onReview:s,onSources:c,sessionPath:l,revision:u,onAddSources:d,reviewLoading:f=!1,reviewError:p}){let{t:m}=W(),[h,g]=(0,K.useState)(!1),_=(0,K.useRef)(null),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!0),S=(0,K.useId)(),[C,w]=(0,K.useState)(null),T=eG(e,l??``,!!(l&&(h||v)),u),E=(0,K.useContext)($E),D=a?.ok?a.snapshot.totals:void 0,O=e=>{!e&&c?(y(!1),w(null),P(c)):e?.kind===`file`&&e.reference?(y(!1),P(()=>E?.open(e.reference,void 0,_.current??void 0))):P(()=>{w(e),y(!0)})},k=n.filter(e=>e.state===`running`),A=n.filter(e=>e.state===`done`),j=n.length-k.length-A.length,M=[...k,...n.filter(e=>e.state!==`running`)].slice(0,4),N=[k.length?m(`subagentSummaryRunning`,{count:k.length}):``,A.length?m(`subagentSummaryDone`,{count:A.length}):``,j?m(`subagentSummaryOther`,{count:j}):``].filter(Boolean).join(` · `)||m(`subagentNoneYet`),P=e=>{g(!1),_.current?.focus(),e()};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Zu,{isOpen:h,onOpenChange:g,placement:`below`,alignment:`end`,width:`min(340px, calc(100vw - 24px))`,label:m(`sessionOverview`),closeButtonLabel:m(`close`),isModal:!1,content:(0,q.jsxs)(`div`,{className:`session-overview`,children:[(0,q.jsx)(`p`,{className:`session-overview-title`,children:t}),(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row`,title:m(`sessionOverviewChanges`),onClick:()=>P(s),children:[(0,q.jsx)(Ms,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:m(`overviewChanges`)}),D&&!p?(0,q.jsxs)(`span`,{className:`session-overview-diff`,title:m(D.complete?`overviewLineTotals`:`overviewPartialTotals`),children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,D.additions.toLocaleString()]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,D.deletions.toLocaleString()]}),!D.complete&&(0,q.jsx)(`span`,{className:`session-overview-note`,children:m(`gitReviewPartialLabel`)})]}):(0,q.jsx)(`span`,{className:`session-overview-note`,children:m(f?`overviewCounting`:a?.ok?`overviewCountsUnknown`:`overviewReviewUnavailable`)})]}),(0,q.jsxs)(`div`,{className:`session-overview-section`,children:[(0,q.jsx)(`p`,{children:m(`subagentDetails`)}),(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row session-overview-agents`,onClick:()=>P(o),"aria-label":`${m(`subagentDetails`)}: ${N}`,children:[M.length>0&&(0,q.jsx)(`span`,{className:`subagent-avatar-stack`,children:M.map(t=>(0,q.jsx)($W,{identity:`${e}:${t.id}`},t.id))}),(0,q.jsx)(`span`,{className:`session-overview-agent-counts`,children:N.split(` · `).map(e=>(0,q.jsx)(`span`,{children:e},e))}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),r>0&&(0,q.jsx)(`small`,{children:m(`subagentListTruncated`,{count:r})}),i>0&&(0,q.jsx)(`small`,{children:m(`subagentWorkflowsTruncated`,{count:i})})]}),l&&(0,q.jsxs)(`div`,{className:`session-overview-section`,children:[(0,q.jsxs)(`div`,{className:`session-overview-section-heading`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`session-sources-toggle`,"aria-expanded":b,"aria-controls":S,onClick:()=>x(e=>!e),children:[(0,q.jsx)(`span`,{children:m(`sessionSources`)}),T.page&&(T.page.total!==void 0||T.page.nextOffset===void 0)&&(0,q.jsxs)(`span`,{children:[`· `,T.page.total??T.page.sources.length,T.page.truncated?`+`:``]}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),d&&(0,q.jsx)(V,{content:m(`sourcesAdd`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":m(`sourcesAdd`),onClick:()=>P(d),children:(0,q.jsx)(Ae,{})})})]}),(0,q.jsxs)(`div`,{id:S,hidden:!b,children:[T.page?.sources.slice(0,3).map(t=>(0,q.jsx)(nG,{source:t,sessionId:e,path:l,onOpen:()=>O(t)},t.id)),T.error?(0,q.jsxs)(`p`,{role:`alert`,children:[m(`sourcesFailed`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:T.refresh,children:m(`gitReviewRetry`)})]}):!T.page?.sources.length&&(0,q.jsx)(`p`,{children:m(T.loading?`readingFile`:`sourcesEmpty`)}),!!(T.page&&(T.page.sources.length>3||T.page.nextOffset!==void 0))&&(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row sources-view-all`,onClick:()=>O(null),children:[(0,q.jsx)(Qs,{}),(0,q.jsx)(`span`,{children:m(`sourcesViewAll`)}),(0,q.jsx)(os,{})]})]})]})]}),children:e=>(0,q.jsx)(V,{content:m(`sessionOverview`),placement:`below`,children:(0,q.jsx)(`button`,{...e,ref:t=>{e.ref(t),_.current=t},type:`button`,className:`task-tools-trigger`,"aria-label":m(`sessionOverview`),children:(0,q.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,q.jsx)(`circle`,{cx:`5.5`,cy:`7`,r:`2.8`}),(0,q.jsx)(`circle`,{cx:`5.5`,cy:`17`,r:`2.8`}),(0,q.jsx)(`path`,{d:`M12 7h8M12 17h8`})]})})})}),l&&(0,q.jsx)(aG,{sessionId:e,path:l,open:v,source:C,data:T,onSelect:O,onClose:()=>{y(!1),w(null)}})]})}function sG(e){return e<1e3?Math.round(e).toString():e<1e4?`${(e/1e3).toFixed(1)}k`:e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1)}M`}function cG(e){if(!e)return;let{input:t,output:n,cacheRead:r,cacheWrite:i}=e;if(t===0&&n===0&&r===0&&i===0)return;let a=t+r+i,o=r>0?` (${sG(r)} cached)`:``;return`${sG(a)} in${o} · ${sG(n)} out`}function lG(e,t,n){if([`session_start`,`session_switched`,`session_created`].includes(t))return e.length===0?e:[];if([`agent_settled`,`turn_settled`].includes(t))return e.some(e=>e.state===`running`)?e.map(e=>e.state===`running`?{...e,state:`unknown`}:e):e;if(!t.startsWith(`tool_execution_`))return e;let r=n.toolCallId;if(typeof r!=`string`||r.length>500)return e;let i=e.find(e=>e.call.id===r);if(i&&i.state!==`running`&&(i.state!==`unknown`||t!==`tool_execution_end`))return e;let a=dd(n.call),o=a.type===`toolCall`&&typeof a.name==`string`&&typeof a.arguments==`string`?a:i?.call;if(!o||o.evidenceTruncated&&o.id?.includes(`[truncated]`))return e;let s=dd(n.result),c=typeof s.content==`string`?s:i?.result,l=typeof n.parentToolCallId==`string`&&n.parentToolCallId.length<=500?n.parentToolCallId:i?.parentToolCallId,u={call:o,result:c,...l?{parentToolCallId:l}:{},state:t===`tool_execution_end`?n.isError===!0?`failed`:`returned`:`running`},d=(i?e.map(e=>e.call.id===r?u:e):[...e,u]).slice(-32);for(;d.length>0&&new TextEncoder().encode(JSON.stringify(d)).byteLength>524288;)d.shift();return d}var uG={en:{translation:{quitOpenPI:`Quit OpenPI`,quittingOpenPI:`Quitting…`,quitConfirmHelp:`Quit this OpenPI Web application? All running tasks in this Web application will stop. Conversations are saved and will be available when you restart.`,quitTabHelp:`Closing this browser tab alone leaves OpenPI and its tasks running in the background.`,quitAccepted:`OpenPI is shutting down`,quitAcceptedHelp:`The quit request was accepted. Wait for the terminal to confirm that OpenPI has stopped, then you can close this tab.`,quitRestartHelp:`To restart, run openpi web in a terminal, or /web in Pi, then open the address it displays. Refreshing this page does not restart OpenPI.`,quitFailed:`Could not confirm shutdown. Check the terminal before trying again. You can also stop OpenPI with Ctrl+C in its terminal.`,promptPending:`Processing your request…`,commandFeedbackTruncated:`This is a limited command preview. Narrow the query or run it in the TUI for the full output.`,planMode_inactive:`Normal mode`,planMode_planning:`Planning · writes blocked`,planMode_ready:`Plan ready · awaiting review`,planMode_invalid:`Plan state invalid · writes blocked`,planModeEnter:`Plan`,promptPlanMessage:`This conversation uses Plan mode · discuss the plan; no implementation yet`,planModeUnconfirmed:`Could not confirm Plan mode. Refresh before continuing.`,planModeExit:`Exit planning`,planModeImplement:`Prepare implementation prompt`,planImplementationReplaceDraft:`Preparing this plan will replace the current draft and turn off Plan mode. The prompt will not be sent. Continue?`,commandSupport_plan:`Planning and same-session implementation prompts are available. Starting a fresh implementation session still requires the TUI.`,commandSupport_setup:`Configuration uses the active model; questions are answered in Web.`,handoffWaiting:`Manual action`,handoffDone:`Done`,handoffUnable:`Unable to complete`,handoffDoneHelp:`I performed the action. The agent still needs to verify it.`,handoffUnableHelp:`I could not finish. I can add a note about the blocker.`,handoffReview:`Review status`,handoffSubmit:`Submit status`,handoffSignal:`Expected result:`,handoffVerify:`Reporting Done lets the agent continue and verify; it is not proof of success.`,planCardLabel:`Development plan`,planCardReady:`Plan ready`,planCardResult:`Plan result`,planCardNotApproval:`This step produced a plan. It did not approve or start implementation.`,planCardCollapse:`Collapse`,planCardExpand:`Expand`,planCardCopy:`Copy plan`,planCardCopyPreview:`Copy visible preview`,planCardTruncated:`Only a bounded preview is displayed.`,planCardLoadFull:`Load full plan`,planCardLoadingFull:`Loading plan...`,planCardLoadFailed:`Could not load the full plan. Retry`,planCardEvidence:`Tool result · plan_ready`,questionWaiting:`Question`,questionPreview:`View preview`,questionSkip:`Skip`,questionProgress:`{{current}} of {{total}}`,questionReview:`Review answers`,questionReviewTitle:`Ready to send?`,questionReviewHelp:`Review your choices. Nothing is sent until you submit.`,questionEdit:`Edit answer: {{question}}`,questionDismiss:`Dismiss questions without answering`,questionCustom:`Or write your own reply`,questionCustomHelp:`Or leave it blank to ask for a clearer question.`,questionYourAnswer:`Your answer`,questionCustomPlaceholder:`Describe what you have in mind…`,questionNotes:`Additional context (optional)`,questionNotesPlaceholder:`Add a constraint or clarify your choice…`,questionRephrase:`Ask for a clearer or smaller question`,questionBack:`Back`,questionNext:`Next question`,questionSubmit:`Submit answers`,questionSubmitting:`Sending…`,questionRetry:`Check submission`,questionUncertain:`We could not confirm delivery. Your submitted answers are kept here. Check submission to recover the result without sending them twice.`,questionDisconnected:`Reconnecting… Your choices stay here; submitting is paused.`,questionLimit:`Keep each answer or note within {{count}} UTF-8 bytes.`,questionLoadFailed:`Could not check for questions awaiting your answer.`,questionDraftLimit:`Question drafts are full. Shorten or clear an existing answer before adding more text.`,questionRetryLoad:`Try again`,questionCloseReceipt:`Close question status`,questionState_dismissed:`Questions dismissed. No answers were submitted.`,questionState_cancelled:`Questions cancelled. No answers were submitted.`,questionState_expired:`Questions expired. No answers were submitted.`,questionState_stale:`This request is no longer active. Check the conversation for its result.`,conversationView:`Conversation view`,jumpToLatest:`Jump to latest`,historyLoading:`Loading history…`,historyOmitted:`{{count}} earlier entries · Scroll up to load automatically`,historyChanged:`The Session branch changed. History has been reset to the current branch.`,historyUnavailable:`Could not load history. Please retry.`,historyValidationUnavailable:`Could not verify the conversation history. Please retry.`,historyVerifying:`Checking conversation history…`,messageLoadFull:`Load full message`,messageLoadMore:`Load more`,messageLoadingFull:`Loading message…`,messageLoadFailed:`Could not load this message. Retry`,filePreview:`File preview`,changeEvidence:`Changes`,changeEvidenceScope:`Read-only Git snapshot of changes since this session started.`,turnLabel:`Turn {{number}}`,turnState_running:`Running`,turnState_complete:`Completed`,turnState_failed:`Failed`,turnState_interrupted:`Interrupted`,turnState_waiting:`Waiting for response`,turnState_forked:`Forked · Ready to continue`,turnChanges_one:`{{count}} file changed during this turn`,turnChanges_other:`{{count}} files changed during this turn`,turnChangesPartial:`At least {{count}} files changed during this turn`,turnChangesIncomplete:`This turn's change record is incomplete.`,turnChangesMore:`Show {{count}} more files`,turnChangesLess:`Show fewer files`,turnChangesReview:`Review turn changes`,turnChangesReviewButton:`Review`,turnChangesBack:`Back to turn changes`,turnChangesLoading:`Loading this turn's changes…`,turnChangesUnavailable:`This turn's saved diff is unavailable.`,messageCopyRequiresFull:`Load the full message before copying.`,filesChanged_one:`{{count}} file changed`,filesChanged_other:`{{count}} files changed`,reviewChanges:`Review changes`,workspaceChanges:`Workspace changes`,overviewChanges:`Changes`,overviewLineTotals:`Text lines added and removed across the current Git comparison`,overviewPartialTotals:`Known line counts only; some files could not be counted. Open Changes for details.`,overviewCounting:`Counting…`,overviewCountsUnknown:`Counts unavailable`,overviewReviewUnavailable:`Unavailable`,sessionSources:`Sources`,sourcesAdd:`Add source`,sourcesDescription:`Browse this conversation's attached images and files`,sourceAttached:`Attached to this conversation`,sourcesEmpty:`No sources yet`,sourcesFailed:`Could not load sources.`,sourcesViewAll:`View all`,sourcesLoadMore:`Load more sources`,sourcesBack:`Back to sources`,sourcesPartial:`This list has reached its display limit. Earlier sources remain in the conversation.`,turnChangesScope:`Saved workspace changes during this turn`,turnEdits_one:`Edited {{count}} file`,turnEdits_other:`Edited {{count}} files`,turnEditsPartial:`Recorded edits to {{count}} files`,turnEditsScope:`This turn's recorded file-tool writes · saved; shell and external edits are not included`,turnEditStatsUnknown:`Line counts unavailable`,turnEditReason_before_unavailable:`The write completed, but previous contents were not authorized for reading. A before/after diff is unavailable.`,turnEditReason_content_limit:`The write completed. Content exceeds the saved comparison limit, so exact line counts are unavailable.`,turnEditReason_concurrent_change:`The file changed between recorded operations. A reliable net diff for this turn is unavailable.`,gitReviewLoadedCount:`{{count}} files loaded`,gitReviewPartialLabel:`Partial`,gitReviewSearch:`Search file paths`,gitReviewExpand:`Expand review`,gitReviewSearchLoaded:`Search loaded files`,gitReviewMarkViewed:`Mark {{path}} as viewed`,gitReviewMarkCurrentViewed:`Mark current file {{path}} as viewed`,gitReviewViewedLabel:`Viewed`,gitReviewViewedProgress:`Viewed {{viewed}} / {{loaded}} loaded files`,gitReviewViewedLimit:`Up to {{count}} viewed marks are remembered for this comparison.`,gitReviewNoMatch:`No matching files.`,gitReviewNoLoadedMatch:`No matches in the loaded files.`,gitReviewLoadNext:`Load the next files`,gitReviewChanged:`The workspace changed. Refresh the list before loading more.`,gitReviewNewVersion:`New changes are available. You are reading the previous version.`,gitReviewShowLatest:`Show latest diff`,gitReviewBinary:`No text diff is available for this binary file.`,gitReviewBinaryShort:`Binary`,gitReviewPendingStats:`Not loaded`,gitReviewComparison:`{{current}} compared with {{base}}`,gitReviewWorkingTree:`Working tree compared with HEAD`,gitReviewSessionSnapshot:`Changes since this session started`,gitReviewDetached:`Detached HEAD`,gitReviewLoading:`Reading Git changes…`,gitReviewRetry:`Retry`,gitReviewRefresh:`Refresh changes`,gitReviewOlderResult:`Showing the previous result.`,gitReviewNotRepository:`This workspace is not a Git repository.`,gitReviewUnborn:`This repository has no readable HEAD yet.`,gitReviewFailed:`Git changes could not be read.`,gitReviewTruncated:`The change snapshot reached its file or diff size limit.`,gitReviewEmpty:`No changes in this comparison.`,gitReviewHiddenLines:`{{count}} more diff lines hidden.`,gitReviewDiffTruncated:`This file's diff was not loaded because the snapshot reached its size limit.`,gitReviewShowMore:`Show {{count}} more files`,gitReviewBackToFiles:`Back to changed files`,gitReviewFilePreview:`Diff for {{file}}`,gitReviewNoDiff:`No text diff is available for this file.`,changeDiff:`Change diff`,diffViewMode:`Diff view`,diffUnified:`Unified`,diffSplit:`Side by side`,diffBefore:`Before`,diffAfter:`After`,diffView:`Diff`,gitFileStatus_added:`Added`,gitFileStatus_modified:`Modified`,gitFileStatus_deleted:`Deleted`,gitFileStatus_renamed:`Renamed`,gitFileStatus_copied:`Copied`,gitFileStatus_untracked:`Untracked`,gitFileStatus_unknown:`Changed`,closePreview:`Close preview`,imageZoom:`Image zoom`,imageZoomHelp:`Zoom is relative to Fit. Use Ctrl + wheel to zoom, then drag to pan.`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,previousImage:`Previous image`,nextImage:`Next image`,imagePosition:`Image {{current}} of {{total}}`,artifactReadOnly:`Read-only`,artifactReferenceUnavailable:`File preview is unavailable in this view: {{path}}`,artifactSession:`Session {{sessionId}}`,copyFilePath:`Copy file path`,filePathCopied:`File path copied`,refreshFile:`Refresh file`,downloadFile:`Download file`,downloadingFile:`Downloading…`,artifactOlderPreview:`Showing an older preview. `,readingFile:`Reading file…`,artifactVersion:`Version`,artifactBytes:`{{count}} bytes`,artifactPreviewTruncated:`Preview truncated. Download the file for the complete content.`,artifactUnsupported:`This file type cannot be previewed. Use Download.`,filesLargeMarkdownSource:`This Markdown preview is large, so it is shown as source to keep scrolling responsive. All loaded text is included.`,chatView:`Chat`,trajectory:`Trajectory`,trajectoryScope:`Recorded Session messages in order, not execution durations or the complete model request.`,trajectoryRunning:`Work is active. This view updates as saved records arrive; in-flight text is available in Chat.`,trajectoryTruncated:`Loaded history is partial: {{entries}} entries omitted, {{parts}} parts omitted, {{messages}} messages truncated.`,trajectoryEmpty:`No saved records yet.`,trajectoryOrder:`Record order`,trajectoryOverview:`Overview`,trajectorySequenceHint:`Record order · widths are not elapsed time`,trajectoryClearRange:`Clear selection`,trajectoryContextLane:`Context`,trajectoryModelLane:`Model`,trajectoryToolLane:`Tools`,trajectorySelectRecord:`Select record {{number}}: {{name}}`,trajectoryTimingTab:`Timing`,trajectoryUsageTab:`Usage`,trajectoryDurationLabel:`Duration`,trajectoryTimingSource:`Source`,trajectoryTimingUnknown:`No execution duration was recorded. Record timestamps are not operation start times.`,trajectoryTimingNative:`Pi nested tool execution`,trajectoryTTFT:`Time to first output`,trajectoryGenerationTime:`Generation time`,trajectoryThroughput:`Output tokens / second`,trajectoryNotRecorded:`Not recorded`,trajectoryUsageUnknown:`This response has no reported token usage in the loaded records.`,trajectoryUsage_input:`Uncached input`,trajectoryUsage_cacheRead:`Cache read`,trajectoryUsage_cacheWrite:`Cache write`,trajectoryUsage_output:`Output`,trajectoryProvider:`Provider`,trajectoryModel:`Model`,trajectoryCode:`Code`,trajectoryWrap:`Wrap lines`,trajectoryCopy:`Copy source`,trajectoryCopied:`Copied`,trajectoryRawArguments:`Original JSON`,trajectoryFoldTurns:`Turns`,trajectoryFoldCalls:`Calls`,trajectoryMetrics:`Loaded execution summary`,trajectoryRequestCount:`{{count}} model responses`,trajectoryToolCount:`{{count}} tool calls`,trajectoryModelResponses:`Model responses`,trajectoryToolCalls:`Tool calls`,trajectoryLastTurn:`Latest recorded turn`,trajectoryEventColumn:`Event`,trajectoryContentColumn:`Content`,trajectoryTurn:`Turn {{number}}`,trajectoryLoadHistory:`Load earlier history`,trajectoryLatestRecords:`Jump to latest records`,trajectoryHistoryLoading:`Loading history…`,trajectoryNestedOutputMissing:`Pi recorded this nested call's status, but did not persist its result body. The outer script's output is separate.`,trajectoryRecordCount:`{{count}} records`,trajectoryMatches:`{{count}} matches`,trajectorySearch:`Search loaded records`,trajectoryNoMatches:`No matching records.`,trajectoryEarlierGroup:`Earlier context`,trajectoryEventCount:`{{count}} Session changes`,trajectorySummary:`Overview`,trajectoryInputTab:`Input`,trajectoryResultTab:`Result`,trajectoryConversationGroup:`Conversation`,trajectoryReasoningTitle:`Thinking`,trajectoryRecordNumber:`Record {{number}}`,trajectoryRecordInfo:`Record information`,trajectoryRecordId:`Record ID`,trajectoryCallId:`Tool call ID`,trajectoryEventType:`Event type`,trajectoryEvent_model_change:`Model changed`,trajectoryEvent_thinking_level_change:`Thinking level changed`,trajectoryEvent_compaction:`Context compacted`,trajectoryEvent_session_info:`Session information updated`,trajectoryEvent_custom:`Session record`,trajectoryEarlier:`Show earlier records ({{count}} remaining in loaded history)`,trajectoryDetails:`Record details`,trajectoryRecordedAt:`Record timestamp`,trajectoryEvidenceTruncated:`This evidence was truncated in the Session projection.`,trajectoryArguments:`Tool arguments`,trajectoryRecordedContent:`Recorded content`,trajectoryThinking:`Recorded model reasoning`,trajectoryOutput:`Tool result`,trajectoryMissingResult:`No unambiguous result is included in the loaded records. This does not imply the tool is still running.`,trajectoryStructured:`Structured result`,trajectoryEventOnly:`Only this event’s type and timestamp are available.`,trajectory_user:`User message`,trajectory_assistant:`Assistant`,trajectory_call:`Tool call`,trajectory_result:`Unpaired result`,trajectory_event:`Session event`,trajectoryRole_user:`User`,trajectoryRole_assistant:`Assistant`,trajectoryRole_call:`Tool`,trajectoryRole_result:`Result`,trajectoryRole_event:`Event`,trajectory_returned:`Tool returned a result.`,trajectory_error:`Tool returned an error`,trajectory_unknown:`Outcome not established`,runtimeStatus:`Runtime status`,runtimeIdentity:`OpenPI runtime information`,runtimeIdentityHint:`Backend information was captured at startup. It does not track later disk changes or Session reloads, and is not proof of every loaded module. Frontend identity describes this page build.`,runtimeIdentityFailed:`Could not read backend runtime information. Try again.`,runtimeBackendVersion:`Backend package version`,runtimePackageRoot:`Backend package directory`,runtimeStartedAt:`Process started`,runtimeGitRevision:`Git revision at startup`,runtimeGitState:`Working tree at startup`,runtimeGitDirty:`Local changes present`,runtimeGitClean:`Clean`,runtimeFrontendVersion:`Page package version`,runtimeFrontendBuild:`Page build ID`,runtimeStartupBuild:`Page build ID recorded at startup`,runtimeDevelopmentBuild:`Development server (no production build ID)`,runtimeBuildMismatch:`This page build differs from the build recorded when the backend started. Refresh the page or restart the service, then check again.`,refreshStatus:`Refresh status`,openTools:`Open tools`,openToolsUnavailable:`Select a chat to open tools`,sideConversation:`Side conversation`,sideConversationDescription:`Ask a focused question in a separate Pi session without interrupting the main task.`,workbarChangesDescription:`Inspect the current Git branch and working tree.`,terminal:`Terminal`,renameTerminal:`Rename terminal`,terminalName:`Terminal name`,workbarTerminalDescription:`Open an interactive shell for the current workspace.`,restartTerminal:`Restart terminal`,reconnectTerminal:`Reconnect terminal`,restartTerminalTitle:`Restart this terminal?`,restartTerminalDetail:`The current terminal will be closed. Running processes may be interrupted.`,terminalReconnecting:`Reconnecting terminal...`,terminalScrollToBottom:`Scroll to bottom`,terminalOutputResynced:`Terminal output resynchronized.`,terminalRestarting:`Restarting terminal...`,terminalConnecting:`Starting terminal…`,terminalExited:`Terminal exited.`,terminalExitCode:`Terminal exited with code {{code}}.`,terminalDisconnected:`Terminal connection ended unexpectedly.`,terminalError:`Terminal unavailable.`,terminalLoadError:`The terminal interface could not load. Refresh the page to try again.`,reloadPage:`Refresh page`,browser:`Browser`,sessionFileRecords:`Session file records`,gitReviewSource:`Changes`,gitReviewBaseBranch:`Compare against branch`,gitReviewChooseBase:`Choose comparison branch`,gitReviewSearchBranches:`Search branches`,gitReviewLocalBranch:`Local branch`,gitReviewRemoteBranch:`Remote branch`,gitReviewBranchesTruncated:`Showing a bounded list of branches. Some branches are omitted.`,gitReviewNoMatchingBranches:`No matching branches.`,gitReviewBaseUnavailable:`No default comparison branch is available. Choose a branch to review committed changes.`,gitReviewBaseInvalid:`The selected comparison branch is unavailable. Choose another branch.`,gitReviewUnstaged:`Unstaged changes`,gitReviewStaged:`Staged changes`,gitReviewBranch:`Branch changes`,gitReviewFileMissing:`This file no longer has changes in this view. Refresh the file list.`,artifactExternalAccess:`This file is in another working directory. You can authorize read-only access to this file for this session; other files remain inaccessible.`,artifactAuthorizeFile:`Open this file read-only`,sideConversationPending:`Preparing side conversation…`,resizeSidebar:`Resize sidebar`,resizePanes:`Resize panes`,resizeWorkbar:`Resize workbar`,browserPasteTooLarge:`Paste at most {{count}} characters at a time.`,browserInputTooLarge:`Enter at most {{count}} characters at a time.`,browserInputTargetChanged:`The input target changed or could not be confirmed. An input operation was not executed.`,workbarBrowserDescription:`Open and interact with a page inside the OpenPI workbar.`,browserReady:`Enter an address to start browsing`,browserStarting:`Starting the embedded browser…`,browserOpened:`Opened in the embedded browser`,browserOpenAgain:`Open again`,browserOpenFailed:`The embedded browser is unavailable.`,browserBack:`Back`,browserForward:`Forward`,browserReload:`Reload`,browserTabs:`Browser tabs`,browserNewTab:`New tab`,browserAddTab:`New browser tab`,browserCloseTab:`Close {{title}}`,browserTabLimit:`Up to {{count}} browser tabs`,browserPageTitle:`Web page: {{address}}`,browserEnteredAddress:`Last address opened from this toolbar`,browserAddressNotAllowed:`Enter an HTTP(S) address without embedded credentials, outside this application's origin.`,browserLocationUnknown:`This page navigated. Its new address is unavailable. Reload returns to the address you entered.`,browserDirectDescription:`Browse pages directly. Sites that refuse embedding can be opened in your external browser.`,browserDirectHint:`The address records toolbar navigation only. Page popups open in your external browser. Blank page? Use Open in external browser.`,browserEnhancedHint:`Browser enhancement is on: addresses sync and ordinary popup links open in these tabs. Some site policies, login popups and cross-site history still require an external browser.`,files:`Files`,filesExplorer:`Workspace files`,filesSearch:`Filter files…`,refreshFiles:`Refresh files`,filesWorkspaceActions:`Workspace file actions`,filesCreateMenu:`New`,filesImportMenu:`Import`,filesMoreMenu:`More`,filesNewFile:`New file`,filesNewDirectory:`New folder`,filesImport:`Import files`,filesImportFolder:`Import folder`,filesImportFolderChoose:`Choose a folder to import`,filesImportFolderLimit:`Import up to 2,000 files and folders at a time, with at most 64 nested levels.`,filesSelectMultiple:`Select multiple files`,filesSelectItem:`Select {{name}}`,filesSelectedCount:`{{count}} selected`,filesRename:`Rename`,filesNewName:`New name`,filesMove:`Move`,filesMoveDestination:`Destination folder (workspace relative path)`,filesTrashAction:`Move to trash`,filesTrash:`Workspace trash`,filesTrashDetail:`Removed files stay in this workspace and can be restored. Existing names are preserved.`,filesTrashEmpty:`No removed files`,filesTrashUnavailable:`{{count}} entries could not be verified. Their contents remain in .openpi-trash; automatic restore is unavailable.`,filesRestore:`Restore`,filesRestoreItem:`Restore {{name}}`,filesUndoTrash:`Undo removal`,filesOrganizationResults:`File operation results`,filesOperationDone:`Done`,filesRefreshBeforeOrganizing:`Refresh the file tree before organizing this item.`,filesImportChoose:`Choose files to import`,filesTargetDirectory:`Destination`,filesWorkspaceRoot:`Workspace root`,filesFileName:`File name`,filesDirectoryName:`Folder name`,filesCreate:`Create`,filesCreating:`Creating…`,filesCreated:`Created: {{path}}`,filesNameInvalid:`Enter one file or folder name without path separators.`,filesNameExists:`This name already exists. Choose a different name; the existing file was preserved.`,filesMutationFailed:`Could not write this file. Your input is preserved.`,filesWriteUnavailable:`Switch to this session to write workspace files.`,filesImportLimit:`Each file can be up to 50 MiB. Existing names are never overwritten.`,filesImportTooLarge:`This file exceeds the 50 MiB import limit.`,filesImportDirectoryUnsupported:`Folders cannot be imported. Choose the files inside the folder.`,filesImportResults:`File import results`,filesImportPending:`Waiting to import`,filesImporting:`Importing…`,filesImported:`Saved to the workspace`,filesImportedNoPreview:`Saved. Preview supports up to 20 MiB; copy the path to use this file in chat.`,filesClearImported:`Clear completed imports`,filesRetryImport:`Retry import`,filesPathActions:`Path actions for {{name}}`,filesCopyRelativePath:`Copy relative path`,filesCopyAbsolutePath:`Copy absolute path`,filesPathCopied:`Copied path: {{path}}`,filesReadFailed:`Unable to read files.`,filesRetryRead:`Try again`,filesErrorDetails:`Error details`,filesReadFailedDetail:`The file list could not be loaded. Check your connection and try again.`,filesReadDenied:`This session's workspace is currently unavailable or cannot be verified. Check the session and workspace, then try again.`,filesSymlink:`Symbolic link — not followed by the file browser`,filesTruncated:`The result is incomplete. Refine your search.`,filesNoMatches:`No matching files`,filesEmpty:`This folder is empty`,filesChoose:`Choose a file to preview`,filesChooseDetail:`Browse your workspace on the right. Files open here, keeping the explorer in place.`,filesHideTree:`Hide file tree`,filesShowTree:`Show file tree`,filesPreview:`Preview`,filesSource:`View source`,filesEdit:`Edit`,filesMode:`File view`,filesEditor:`File editor`,filesSave:`Save file`,filesSaving:`Saving…`,filesSaved:`Saved`,filesUnsaved:`Unsaved changes · draft kept in this window`,filesDiscard:`Discard draft`,filesDiscardConfirm:`Discard your unsaved changes to this file?`,filesSaveConflict:`The file changed on disk. Your draft is preserved. Refresh to inspect the current version, then reconcile your changes before saving.`,filesSaveFailed:`Could not save. Your draft is preserved; check the file and retry.`,filesEditLoadFirst:`Continue reading the complete file before editing.`,filesEditUnavailable:`Editing supports workspace UTF-8 text files up to 1 MiB. At most 16 unsaved drafts can be kept.`,filesOutline:`Document outline`,filesDiskVersion:`Inspect current disk version`,filesReconcile:`Reviewed · continue editing my draft against this version`,filesTable:`Table preview`,filesRow:`Row`,filesSheets:`Worksheets`,filesTableTruncated:`Showing a partial table preview. Download the original file for complete content.`,filesOfficeLayout:`Document content preview; pagination and typography may differ from Office.`,filesSlidesLayout:`Slide text and images; themes, charts and animations may differ from PowerPoint.`,filesPreviousPage:`Previous page`,filesNextPage:`Next page`,filesZoomOut:`Zoom out`,filesZoomIn:`Zoom in`,filesZoomReset:`Reset zoom`,filesPdfPage:`Page {{page}}`,filesDocumentLimit:`This document exceeds the preview limit. Download it to open locally.`,filesPreviewFailed:`Unable to preview this file. You can still download it.`,filesDiagram:`Mermaid diagram`,filesDiagramLoadError:`Unable to load diagram preview. The source is shown below. Refresh the page to try again.`,filesExpandDiagram:`Expand diagram`,filesFitImage:`Fit`,filesOriginalImage:`Original size`,filesLoadMore:`Load more`,filesLoaded:`{{count}} items loaded`,filesReadMore:`Continue reading`,filesContentChanged:`The file changed. Refresh when ready; your current reading position is preserved.`,workbarFilesDescription:`Browse workspace files with an inline preview and file tree.`,backToSideConversations:`Back to side conversations`,continueSideConversation:`Send a follow-up…`,startSideConversation:`Ask a side question…`,sideConversationModelInherited:`New side conversations use the main conversation’s model and thinking level.`,sideConversationModelFixed:`This is the model used by this side conversation.`,stop:`Stop`,start:`Start`,browserAddress:`Browser address`,browserGo:`Open address`,openExternalBrowser:`Open in external browser`,invalidBrowserAddress:`Enter a valid HTTP or HTTPS address.`,addImages:`Add images`,addFiles:`Add files`,fileAttachments:`File attachments`,previewFileAttachment:`Preview file`,fileAttachmentDescription:`Documents, spreadsheets, PDFs, text, code, and other files`,fileAttachmentCount:`Attach up to {{count}} items.`,fileAttachmentTooLarge:`Files must total 50 MB or less.`,fileAttachmentReadFailed:`Could not read this file. Check the format or whether it is password protected.`,fileAttachmentTextReady:`Text ready`,fileAttachmentTextTruncated:`Partial text · original retained`,fileAttachmentOriginalReady:`Original file ready`,fileAttachmentExtractionFailed:`Text unavailable · original retained`,fileAttachmentEncodingUnavailable:`The text encoding could not be read. The original bytes are preserved.`,fileAttachmentDocumentUnavailable:`Text could not be extracted. The document may be password protected or have an unsupported format. The original bytes are preserved.`,fileAttachmentNoText:`The original file will be attached for the agent to read with its tools. No text was extracted.`,fileAttachmentPreviewTruncated:`Preview shows the first 20,000 characters. The complete extracted text will be attached.`,fileAttachmentExtractedContent:`Extracted text`,fileAttachmentPromptLabel:`User-provided files:`,fileAttachmentPromptTooLong:`The message and file references exceed the input limit. Shorten the message or attach fewer files.`,imageAttachmentDescription:`PNG, JPEG, GIF, or WebP`,imageAttachments:`Image attachments`,imageAttachmentsLoading:`Preparing attachments…`,commandOpensPanel:`Open panel`,commandPanelArguments:`This command opens a panel and cannot include arguments or images. Remove them, or use the panel directly.`,commandPanelUnavailable:`The panel could not be opened. Your command is preserved.`,commandUnavailable_terminal_only:`Requires Pi's terminal interface.`,commandUnavailable_not_integrated:`This extension command is not connected to Web yet. Use it in Pi's terminal.`,artifactImagePreviewFailed:`Unable to preview this image. Refresh the file to retry, or download it.`,artifactFileDetails:`File details`,turnElapsedRunning:`Working for {{duration}}`,compactionElapsed:`Waiting {{duration}}`,compactionRunning:`Compacting context`,compactionCompleted:`Context automatically compacted`,compactionFailed:`Context compaction failed`,compactionInterrupted:`Compaction interrupted`,compactionUnchanged:`Compaction finished without a new summary`,compactionUnavailable:`Context compaction status unavailable`,compactionReconnectHelp:`Connection interrupted. The current status will be checked after reconnecting.`,compactionDraftHelp:`Compacting history. Messages you send will be queued.`,turnElapsedFinished:`Worked for {{duration}}`,composerAdd:`Add`,composerCommands:`Commands`,composerFile:`File`,composerPlan:`Plan`,composerCompact:`Compact`,composerModel:`Model`,composerBack:`Back`,composerPlanDescription:`Enter or leave Plan mode`,composerCompactDescription:`Summarize earlier conversation history`,composerModelDescription:`Select this Session's model`,compactionQueueWaiting:`Waiting for compaction to finish`,compactionQueueBlocked:`Messages retained. Retry when ready or clear the queue.`,clearPromptQueue:`Clear queue`,queueUpdateFailed:`Could not update the queue. Check the current session and try again.`,queueStatusUnconfirmed:`The request was received, but the latest queue state could not be verified. Refresh before trying again.`,turnElapsedOutcome_cancelled:`Stopped`,turnElapsedOutcome_failed:`Failed`,turnElapsedOutcome_uncertain:`Outcome unconfirmed`,settingsSetupBusyHint:`Agent configuration is available after this turn. Display settings can be changed now.`,resetChatContentWidth:`Reset chat content width`,resetChatFontSize:`Reset chat font size`,setupResolveAdmission:`Return to the conversation to resolve the pending message before applying settings.`,removeAttachment:`Remove attachment`,dropImagesHere:`Drop files or images here`,imageAttachmentCount:`Attach up to {{count}} images.`,imageAttachmentTooLarge:`Each image must be 10 MB or smaller.`,imageAttachmentTotalTooLarge:`The attached images must total 32 MB or less.`,imageAttachmentUnsupported:`Only valid PNG, JPEG, GIF, and WebP images are supported.`,imageAttachmentReadFailed:`Could not read this image. Add it again to retry; your message is preserved.`,attachedImage:`Attached image`,previewAttachment:`Preview image`,closeImagePreview:`Close image preview`,imagePreviewFailed:`Unable to display this image.`,fitImage:`Fit image`,originalImageSize:`Original size`,imageViewMode:`Image view`,sessionUsage:`Session token usage`,sessionInputTokens:`Input tokens`,sessionOutputTokens:`Output tokens`,sessionCacheTokens:`Cached tokens`,sessionContextUsage:`Context usage and context window`,usageContextLabel:`Context`,usageUnknown:`Unknown`,usageOpenDetails:`Input {{input}} · Output {{output}} · Context {{percent}} / {{capacity}} · View token usage`,usageContextHelp:`Estimated tokens in the current branch / model context limit.`,usageSessionTotals:`Session totals`,usageInputLabel:`Input`,usageOutputLabel:`Output`,usageCacheReadLabel:`Cache read`,usageCacheWriteLabel:`Cache write`,usageTotalLabel:`Total`,usageWorkspaceLabel:`Workspace`,usageSessionId:`Session ID`,usageTotalsHelp:`Session token totals include cache usage.`,subagentDetails:`Subagents`,sessionOverview:`Session overview`,sessionOverviewChanges:`Changes in the current review scope`,subagentSummaryRunning:`{{count}} running`,subagentSummaryDone:`{{count}} completed`,subagentSummaryOther:`{{count}} other`,subagentNoneYet:`No subagents yet`,subagentOtherGroup:`Failed / interrupted`,subagentShowMore:`Show {{count}} more`,backToSubagents:`Back to subagents`,subagentActiveGroup:`Active`,subagentFinishedGroup:`Completed`,subagentNoneRunning:`No subagents running.`,subagentNoneFinished:`Completed tasks will appear here.`,subagentProgress:`Subagents: {{running}} running · {{completed}} completed`,subagentSummaryUnknown:`{{count}} without confirmed status`,subagentTasks:`Subagent tasks`,inspectSubagent:`Open subagent: {{name}}`,subagentState_running:`Running`,subagentProcessing:`Working…`,subagentState_done:`Completed`,subagentState_error:`Failed`,subagentState_interrupted:`Interrupted`,subagentStarting:`Starting…`,subagentSpawnFailed:`Failed to start`,subagentStateUnavailable:`Started · state unavailable`,subagentSpawnReceipt:`Start receipt`,subagentSpawnReceiptHint:`This confirms the start request, not the subagent's final result.`,subagentTask:`Assigned task`,subagentTranscript:`Subagent conversation`,subagentResult:`Result`,subagentSpend:`Cumulative token spend`,subagentSaved:`Saved record`,subagentRecordedState:`Last recorded state`,subagentSavedHint:`From this parent session's saved receipts. A result may include other tasks from the same batch; this is not the child's full live conversation.`,subagentReadOnly:`Read-only view · closing this panel does not stop the task`,subagentUnavailable:`Live details are no longer available for this subagent in the current session. The start receipt is not evidence of completion.`,subagentStale:`Could not refresh. The details below are the last received snapshot.`,subagentNoMessages:`No messages received yet.`,subagentTranscriptUnavailable:`This view retains a task summary and cannot show the full child conversation.`,subagentWorkflowsTruncated:`{{count}} workflows are outside the loaded list; their task counts are unknown.`,subagentState_unknown:`Unconfirmed`,subagentUnconfirmedGroup:`Unconfirmed`,subagentTruncated:`Showing recent messages. {{count}} earlier messages are not included in this view.`,subagentTextTruncated:`Some long content is shown as an excerpt.`,subagentListTruncated:`{{count}} additional tasks are outside the loaded list.`,subagentThinkingRedacted:`Reasoning was redacted by the provider.`,inspectionChanged:`The active session changed. Reopen this panel.`,inspectionUnavailable:`Details are unavailable.`,inspectionLoading:`Loading status…`,thinkingUnavailable:`Thinking state is unavailable.`,trustUnavailable:`Project trust status is unavailable.`,copySetupCommand:`Copy setup command`,savedTrustDecision:`Saved decision`,activeSessionTrust:`Active Session trust`,trustDecision_trusted:`Trusted`,trustDecision_denied:`Denied`,trustDecision_undecided:`Undecided`,trustDecision_unknown:`Unknown`,trustActiveYes:`Trusted in this Session`,trustActiveNo:`Not trusted in this Session`,modelAndThinking:`Model and reasoning`,selectedModel:`Current model`,thinkingLevel:`Thinking level`,availableThinking:`Available levels`,unknownState:`Unknown`,projectTrust:`Project trust`,trust_trusted:`This session trusts the workspace.`,trust_untrusted:`Trust for this workspace has been denied.`,trust_restricted:`Project resources are restricted pending a trust decision.`,trust_unknown:`Trust state is not available.`,trustRefreshNeeded:`The saved decision and active session differ. Refresh the session through Pi to apply it.`,providerAvailability:`Provider credentials`,settings:`Settings`,settingsNavigation:`Settings navigation`,generalSettings:`General`,configurationSettings:`Configuration`,configurationIntro:`Permissions, web access and model responses.`,configurationReadFailure:`Configuration could not be read safely. Fix the settings file, then refresh.`,configurationUserScope:`User configuration`,configurationSetupHint:`Response and search changes use OpenPI setup`,configurationApproval:`Approval policy`,configurationApprovalDetail:`Tool approvals follow the installed Pi extensions.`,configurationPiPermissions:`Pi extensions`,configurationSandbox:`Sandbox`,configurationSandboxDetail:`Tools run with the host process permissions.`,configurationSandboxUnavailable:`No OS sandbox`,configurationSearchDetail:`Let the current Session model search the web when supported.`,configurationSearchOff:`Do not offer native search to the current model.`,configurationSearchOn:`Offer native search when the current connection supports it.`,configurationVerbosity:`Output verbosity`,configurationVerbosityDetail:`Choose how much detail the model includes in its response.`,configurationResponsesUnavailable:`The current connection does not use a supported Responses API.`,configurationVerbosity_default:`Model default`,configurationVerbosity_low:`Low`,configurationVerbosity_medium:`Medium`,configurationVerbosity_high:`High`,configurationVerbosityHelp_low:`Prefer short answers with fewer details.`,configurationVerbosityHelp_medium:`Include useful explanation and a moderate amount of detail.`,configurationVerbosityHelp_high:`Include more complete explanation and detail.`,configurationVerbosityRequest:`Set only response_verbosity to {{value}}; preserve the other OpenPI settings.`,configurationSummary:`Reasoning summary`,configurationSummaryDetail:`Choose the summary requested from a supported reasoning model.`,configurationSummaryUnavailable:`The current connection does not support reasoning summaries.`,configurationSummary_default:`Model default`,configurationSummary_auto:`Auto`,configurationSummary_concise:`Concise`,configurationSummary_detailed:`Detailed`,configurationSummary_none:`Off`,configurationSummaryHelp_auto:`Let the model choose the summary length.`,configurationSummaryHelp_concise:`Request a brief reasoning summary.`,configurationSummaryHelp_detailed:`Request a more detailed reasoning summary.`,configurationSummaryHelp_none:`Do not request a summary. Keep the current reasoning effort.`,configurationSummaryRequest:`Set only response_reasoning_summary to {{value}}; preserve the other OpenPI settings.`,configurationModelFeatures:`Model features`,configurationReasoningLevels:`Available reasoning efforts`,configurationReasoningDetail:`Choose which levels appear in model controls. Only levels supported by the current model are shown; the current level stays visible.`,configurationReasoningCount:`{{count}} selected`,configurationDependencies:`Workspace dependencies`,configurationEnvironment:`Local environment`,configurationEnvironmentDetail:`Node.js, Python and other tools come from your environment. OpenPI does not install a bundled workspace runtime.`,configurationRuntimeStatus:`Runtime status`,browserSettings:`Browser`,webSearchSettings:`Web search`,webSearchCurrentModel:`Current Session model`,webSearchNativeDetail:`Use your current model provider's native search with the existing connection and credentials.`,webSearchSupported:`This connection supports native search. When enabled, the model decides when to search.`,webSearchUnsupported:`Native search is unsupported or unconfirmed for this connection. No search tool is provided and no other provider is used.`,webSearchNativeRequest:`Enable native web search using the current Session model and existing Pi credentials. Do not switch model, connection protocol, or search provider. Unsupported or unknown connections must receive no search tool.`,webSearchIntro:`Let your model search current sources and read the original pages.`,webSearchPackageDetail:`Optional search, page reading, and PDF extraction through a Pi package.`,webSearchDefaultOff:`Off by default. This optional extension follows the current Session model; it needs no separate search key or plugin installation.`,webSearchLoaded:`Package loaded in this Session`,webSearchNotLoaded:`Package not loaded in this Session`,webSearchSource:`Review plugin source`,webSearchProfile:`Search setup`,webSearchExa:`Exa — no API key required`,webSearchExisting:`Keep my existing search preferences`,webSearchProfileHint:`Exa uses search queries with direct page reading. Existing preferences stay untouched. Other search services can be configured after installation.`,webSearchEnable:`Enable web search…`,webSearchDisable:`Disable web search…`,webSearchConfigure:`Change search service…`,webSearchExaRequest:`Enable optional web search with Pi Web Access and Exa, which needs no API key. Let me review the installation confirmation, preserve other preferences, and do not reload automatically.`,webSearchExistingRequest:`Enable optional web search with Pi Web Access and keep my existing search preferences unchanged. Let me review the installation confirmation, preserve other preferences, and do not reload automatically.`,webSearchDisableRequest:`Disable native web search. Preserve other settings and Session history.`,webSearchProviderRequest:`Help me change the search service for my installed Pi Web Access plugin. Explain available services and permissions, preserve unrelated preferences, keep credentials with the search plugin, and do not reload automatically.`,browserSettingsIntro:`Let OpenPI read pages, click, type and take screenshots.`,browserControl:`Browser control`,browserControlHint:`Requests a setup change. Access changes after the configuration is saved.`,browserDefault:`Default browser`,browserDefaultHint:`Requests a setup change for the browser used when none is named.`,browserEmbedded:`OpenPI browser`,browserAllowedTitle:`Allowed browsers`,browserOffHint:`Your choices take effect when browser control is on.`,browserConnected:`Connected`,browserNeedsSetup:`Extension setup needed`,browserNotFound:`Browser not detected`,browserUpdateNeeded:`Extension update needed`,browserBlocked:`Not allowed`,browserDefaultBlocked:`Your default browser is not allowed. Allow it or choose another default.`,browserSetUp:`Set up`,browserManage:`Manage`,browserSetupNamed:`Set up {{browser}}`,browserManageNamed:`Manage {{browser}}`,browserAllowNamed:`Allow {{browser}}`,browserMore:`More browsers`,browserSpeakHint:`Say “Use Chrome to…” to choose a different browser for a request.`,browserGuideTitle:`Connect {{browser}}`,browserGuideEyebrow:`One step at a time`,browserConnectionTitle:`Connection`,browserCloseGuide:`Close browser setup`,browserConnectionReady:`Connected. Choose whether OpenPI may use this browser.`,browserEmbeddedDetail:`Pages open inside OpenPI. Some websites require a regular browser to sign in or display correctly.`,browserExternalDetail:`OpenPI can use existing tabs and signed-in pages in your connected {{browser}} profile. Keep an OpenPI tab open in that profile.`,browserManageExtension:`Manage extension`,browserAllowUse:`Allow OpenPI to use it`,browserMakeDefault:`Use as default`,browserInstallIn:`Install in`,browserInstallTitle:`Install OpenPI Browser Bridge`,browserSetupSteps:`Setup steps`,browserGuidePopout:`Keep this guide in a separate window`,browserGuideDetached:`Your guide is open in a separate window. Follow it alongside the browser settings.`,browserShowGuide:`Show guide`,browserGuideInline:`Return guide here`,browserGuideBlocked:`The guide window could not open. Allow pop-ups and try again, or follow the steps here.`,browserSafariSettings:`Safari → Settings`,browserSafariDeveloper:`Developer settings`,browserSafariTemporary:`Add Temporary Extension…`,browserSafariOpenHint:`Open Safari, then choose Safari → Settings. Keep this guide alongside it. Requires Safari 26 or later on macOS.`,browserSafariDeveloperTitle:`Show Safari’s developer settings`,browserSafariDeveloperHint:`In Settings → Advanced, turn on Show features for web developers. Then select the Developer tab.`,browserSafariLoadHint:`In Developer, click Add Temporary Extension and select the folder below. Enable OpenPI Browser Bridge and allow the websites you want to control, including the local OpenPI page. Temporary extensions need reloading after Safari quits.`,browserFirefoxThis:`This Firefox`,browserFirefoxTemporary:`Load Temporary Add-on…`,browserFirefoxDeveloperTitle:`Select This Firefox`,browserFirefoxDeveloperHint:`On about:debugging, choose This Firefox in the left sidebar. Firefox does not need a Developer mode switch.`,browserFirefoxLoadHint:`Click Load Temporary Add-on and select manifest.json in the folder below. This development installation lasts until Firefox restarts; a permanent installation requires a Mozilla-signed package.`,browserFirefoxDone:`Selected. Next`,browserStepCount:`Step {{step}} of {{total}}`,browserStepLabel:`Step {{step}}: {{label}}`,browserStepOpen:`Open page`,browserStepAdd:`Add extension`,browserStepConnect:`Connect`,browserOpenManagerTitle:`Open {{browser}} extensions`,browserOpenManagerHint:`This opens {{browser}}. Complete the action on its extensions page, then return here to continue.`,browserOpenManager:`Open {{browser}} extensions`,browserReopenManager:`Open extensions page again`,browserAlreadyInstalled:`Already installed? Connect`,browserDeveloperMode:`Developer mode`,browserDeveloperTitle:`Turn on Developer mode`,browserDeveloperHint:`Turn on Developer mode on the extensions page. The {{loadLabel}} button will appear.`,browserDeveloperDone:`It’s on. Next`,browserIllustration:`Illustration · In {{browser}}`,browserExtensions:`Extensions`,browserLoadUnpacked:`Load unpacked`,browserLoadHint:`The extension is ready on this computer. Follow these steps in {{browser}} to load it.`,browserCopyLocation:`Copy the location below`,browserLocateTarget:`Find the extension on this computer`,browserRevealTarget:`Locate extension`,browserLocateManifest:`Find the extension’s manifest.json`,browserRevealManifest:`Locate manifest.json`,browserDragToBrowser:`Drag the folder onto {{browser}} extensions`,browserDragFolderHint:`Drag the entire {{folder}} folder from your file manager onto the extensions page, with Developer mode on.`,browserSelectLocatedTarget:`In the browser’s file picker, select the item located in the previous step.`,browserManualInstall:`Need another way? Select by path`,browserManualSelection:`Can’t find it? Select by path`,browserLoadInBrowser:`In {{browser}}, click “{{loadLabel}}”`,browserLoadAlternate:`The button appears when Developer mode is on.`,browserConfirmFolder:`Select`,browserConfirmFile:`Open`,browserSelectFolderHint:`Select this entire folder, not a .js file inside it.`,browserSelectManifestHint:`Select manifest.json, not one of the .js files.`,browserInstallCheckpoint:`Continue when OpenPI Browser Bridge appears in the extensions list.`,browserPathCopied:`Path copied`,browserCopyFailed:`Couldn’t copy. Select the path above and copy it manually.`,browserChooseFolderMac:`Press ⌘ ⇧ G, paste the copied path and press Return. Then click “{{confirm}}”.`,browserChooseFolderOther:`Paste the copied path into the location bar and press Enter. Then click “{{confirm}}”.`,browserInstalledConnect:`Added. Connect to OpenPI`,browserPreviousStep:`Back`,browserWaiting:`Waiting for OpenPI Browser Bridge… We’ll detect it automatically.`,browserInstallBrowserFirst:`Install {{browser}} first, or open this OpenPI address in your installed browser.`,browserConnectTitle:`Connect to OpenPI`,browserConnectHint:`Open OpenPI in {{browser}}. Use the profile where you installed the extension.`,browserOpenIn:`Open in {{browser}}`,browserAllowHint:`Once connected, you can allow OpenPI to use this browser. Installing the extension does not change your browser permissions.`,browserCheck:`Check connection`,browserNotConnectedYet:`No connection yet. Finish installation, refresh OpenPI in that browser and check again.`,browserHelp:`Setup help`,browserReloadHint:`Already installed? Reload OpenPI Browser Bridge in the extension manager and refresh OpenPI. Accept the browser’s permission prompt if shown.`,browserSupportedHint:`Chrome, Edge, Brave and Chromium 145+ support embedded and native pages. Safari 26+ on macOS and Firefox 128+ use the portable extension for native tabs; nested frames must be opened separately. Temporary Safari/Firefox installations need reloading after browser restart.`,browserCopyPath:`Copy path`,browserOpening:`Opening browser…`,browserLoading:`Checking browser connections…`,browserSaved:`Saved. Browser permissions take effect immediately.`,browserSaving:`Working…`,modelSettings:`Models`,skillsSettings:`Skills`,subagentsSettings:`Sub-agents`,pluginsSettings:`Plugins`,configureOpenPi:`Configure OpenPI`,setupRequestReviewAll:`review every OpenPI configuration area with me`,setupRequestSetTheme:`set only the OpenPI Web theme to {{value}} and preserve every other setting`,setupRequestSetChatWidth:`set only the OpenPI Web chat content width to {{value}}px and preserve every other setting`,setupRequestSetChatFontSize:`set only the OpenPI Web chat font size to {{value}}px and preserve every other setting`,setupRequestEnableExpandedThinking:`expand thinking blocks by default in OpenPI Web and preserve every other setting`,setupRequestDisableExpandedThinking:`collapse thinking blocks by default in OpenPI Web and preserve every other setting`,setupRequestSubagents:`review and configure Agent role models and workflow limits`,setupRequestFailed:`The OpenPI setup request was not accepted.`,setupRequestRunning:`Applying OpenPI settings…`,setupRequestAccepted:`Configuration request accepted.`,setupPlanBlocked:`Exit Plan mode before changing agent configuration. Display settings can be changed directly; exiting does not start implementation.`,setupPlanBusy:`Agent configuration requires an idle turn and leaving Plan mode. Display settings can be changed now.`,setupOutcome_pending:`Configuration request is awaiting a save receipt.`,toolCallArguments:`Tool arguments`,toolCallOutput:`Tool result`,setupOutcome_saved:`OpenPI configuration was saved and applied.`,setupOutcome_unchanged:`Configuration was saved; effective settings are unchanged.`,setupOutcome_failed:`The setup request failed. Review the error and current settings before retrying.`,setupOutcome_cancelled:`Setup was cancelled without a confirmed save.`,setupOutcome_unconfirmed:`No successful save was confirmed. Review current settings before retrying /openpi-setup.`,settingsUpdateFailed:`The Web preference could not be saved.`,settingsPreferencesSaved:`Preferences saved.`,settingsPreferencesSaveFailed:`Could not save display settings. Check configuration diagnostics and retry.`,settingsCatalogLoading:`Loading Pi resources…`,settingsCatalogFailed:`Could not load Pi settings resources.`,appearance:`Appearance`,settingsPersonal:`Personal`,settingsAgent:`Agent`,settingsIntegrations:`Integrations`,settingsArchivedChats:`Archived chats`,settingsSearch:`Search settings`,settingsClearSearch:`Clear search`,settingsNoResults:`No matching settings`,appearanceVisualStyle:`Visual style`,appearanceMode:`Mode`,appearanceTheme:`Theme`,appearanceAccent:`Accent color`,appearanceBackground:`Background`,appearanceForeground:`Foreground`,appearanceFont:`Font`,appearanceFont_codex:`Codex default`,appearanceFont_sans:`Sans serif`,appearanceFont_serif:`Serif`,appearanceFont_mono:`Monospace`,appearanceAccent0:`Default`,appearanceAccent1:`Blue`,appearanceAccent2:`Purple`,appearanceAccent3:`Pink`,appearanceAccent4:`Orange`,appearanceAccent5:`Green`,appearanceCustomAccent:`Custom accent color`,appearanceAdvanced:`Advanced`,appearanceReset:`Restore defaults`,appearanceResetAction:`Reset appearance`,appearanceImport:`Import theme`,appearanceCopy:`Copy theme`,appearanceCopied:`Theme copied`,appearanceCopyFailed:`Could not copy theme. Try again.`,appearanceThemeValue:`Theme data`,appearanceImportPlaceholder:`Paste an OpenPI theme…`,appearanceImportInvalid:`Enter valid OpenPI theme data.`,appearanceImportAction:`Import`,searchArchivedChats:`Search archived chats`,archiveProjectFilter:`Filter by project`,archiveAllProjects:`All projects`,archiveProjectGroup:`{{project}} · {{count}} archived chats`,archiveSort:`Sort archived chats`,archiveSortUpdated:`Last updated`,archiveSortCreated:`Date created`,restoreArchivedChat:`Restore {{title}}`,themeLight:`Light`,themeDark:`Dark`,themeMist:`Mist`,themeRose:`Rose`,themePine:`Pine`,themeSystem:`System`,conversationSettings:`Conversation`,expandThinkingByDefault:`Expand thinking by default`,chatContentWidth:`Chat content width`,chatFontSize:`Chat font size`,agentBehavior:`Agent behavior`,workflowLimits:`Workflow limits`,workflowConcurrency:`Workflow concurrency`,workflowCalls:`Total calls`,agentSettingsSetupHint:`Agent changes are applied through /openpi-setup in the current session.`,setupRequestLimits:`Set workflow concurrency to {{concurrency}} and total agent calls to {{calls}}. Preserve other settings.`,setupRequestEnableSuggestions:`Enable next-action suggestions. Help me choose a model if required; preserve other settings.`,setupRequestDisableSuggestions:`Disable next-action suggestions. Preserve other settings.`,setupRequestPostEdit:`Help me configure or disable the post-edit command. Show the current configuration and ask which command to use.`,configurePostEdit:`Configure post-edit command`,workflowLimitsValue:`{{concurrency}} concurrent · {{calls}} total calls`,nextActionSuggestions:`Next-action suggestions`,nextActionSuggestionsDetail:`Offer a few useful next actions when the current task finishes.`,enabled:`Enabled`,disabled:`Disabled`,configured:`Configured`,postEditCommand:`Post-edit command`,postEditCommandDetail:`Run a command after edits. Nothing runs while this is off.`,resultDisplay:`Default result display`,subagentResults:`Subagent results`,bashOperations:`Bash operations`,fileMutations:`Write / Edit operations`,footer:`Footer`,terminalFooter:`Pi terminal footer`,terminalFooterStyle:`Terminal footer style`,terminalFooterHint:`Applies to Pi's command-line interface. An already open Pi interface updates when restarted or when setup is applied.`,detailDisplay_full:`Full`,detailDisplay_compact:`Compact`,sessionSettings:`Session`,currentModel:`Current`,providerCurrentSessionModel:`This conversation uses {{model}}.`,useThisModel:`Use model`,model:`Model`,modelConnection:`Model connection`,provider:`Provider`,modelId:`Model ID`,providerStatusUnavailable:`This provider is not present in the bounded authentication snapshot.`,providerSettings:`Provider credentials`,providerSettingsIntro:`Inspect which Pi providers can authenticate the current Web session.`,openRuntimeDetails:`Open runtime details`,currentWorkspace:`Current workspace`,providerAuth_api_key:`API key`,providerAuth_oauth:`OAuth`,providerAuthUnknown:`Authentication method not reported`,authentication:`Authentication`,accessType:`Access`,providerAccessSubscription:`Subscription account`,providerAccessStandard:`Provider credentials`,configurationOwner:`Configuration owner`,providerLoading:`Loading provider status…`,providerLoadFailed:`Could not load provider status.`,providerReadOnly:`Managed by Pi`,selectProvider:`Select a provider`,gitReviewBaselineUnavailable:`No usable session baseline was retained (it may exceed the capture limit). Choose Unstaged, Staged or Branch to inspect Git changes, or open the session file records.`,modelsIntro:`Sign in with an account or add an API key. Your existing Pi connections are available here.`,modelConnectionsTitle:`Model connections`,modelConnectionsIntro:`Manage credentials and choose models for new and current chats.`,accountLoginMethod:`Connection method`,accountLoginTab:`Account`,accountLoginChatGPT:`ChatGPT account`,accountLoginClaude:`Claude account`,accountLoginKeyTab:`API key`,accountLoginConfigured:`Account signed in`,accountLoginIntro:`Continue in your browser. No API key needed.`,accountLoginExisting:`Your account credential is saved in Pi.`,accountLoginStart:`Sign in`,accountLoginAgain:`Sign in again`,accountLoginUnsaved:`Save or discard your other changes before signing in.`,accountLoginStarting:`Preparing sign-in…`,accountLoginWaiting:`Waiting for authorization`,accountLoginChoose:`Choose how to sign in`,accountLoginCancelling:`Cancelling sign-in…`,accountLoginBrowser:`Continue in browser`,accountLoginDevice:`Use a device code`,accountLoginBrowserOption:`Sign in on this computer. Returns here automatically.`,accountLoginDeviceOption:`For remote servers or when browser sign-in is unavailable.`,accountLoginBrowserHelp:`Open the sign-in page and approve access. This page updates automatically.`,accountLoginDeviceHelp:`Open the authorization page and enter this code. Keep this page open.`,accountLoginOpen:`Open sign-in page`,accountLoginCopyCode:`Copy device code`,accountLoginPaste:`Authorization code or callback URL`,accountLoginContinue:`Continue`,accountLoginFallback:`Signed in but still waiting?`,accountLoginRemoteHelp:`If automatic return does not work, copy the final callback URL from your browser and paste it here.`,accountLoginCancel:`Cancel sign-in`,accountLogin_failed:`Sign-in failed. Try again or choose another method.`,accountLogin_expired:`Sign-in expired. Start again to get a new authorization link.`,accountLogin_cancelled:`Sign-in cancelled.`,accountLoginRequestFailed:`The request did not complete. Refresh status before retrying.`,accountLoginStatusUnknown:`Cannot check sign-in status. Your authorization may still be in progress.`,accountLoginRefreshRequired:`The credential was saved, but Pi could not update its model list. Reload Pi before using this connection.`,accountLogout:`Sign out`,accountLogoutRefreshRequired:`The saved credential was removed, but Pi could not update its model list. Reload Pi to refresh the status.`,accountLogoutTitle:`Sign out of {{provider}}?`,accountLogoutDetail:`Removes this provider’s saved credential from Pi on this machine. Other Pi sessions using it will also need to sign in again. Environment credentials are unchanged.`,providerInputTypes:`Input types`,providerInputText:`Text`,providerInputImage:`Images`,providerCustomTag:`Custom`,providerEdit:`Edit`,providerRemove:`Delete`,providerSave:`Save`,editProvider:`Edit {{provider}}`,removeProvider:`Delete {{provider}}`,providerAdd:`Add model provider`,providerAddMode:`How to add`,providerAddCatalog:`Third-party providers`,providerAddCustom:`Custom model API`,providerAccountHint:`Use an existing account to connect. Choose a provider and continue in your browser.`,providerCatalogHint:`Choose a provider from the built-in catalog and enter its API key.`,providerCustomHint:`Connect a gateway or self-hosted service using an OpenAI or Anthropic compatible API.`,providerKeyKeep:`Leave blank to keep the existing key`,providerKeyOptional:`Enter an API key, or leave blank to use environment authentication`,providerDisplayName:`Provider name`,providerCustomSettings:`Custom settings`,providerSaved:`Saved {{provider}}.`,modelDefaultTitle:`Default for new chats`,modelDefaultChoose:`Choose model`,modelDefaultBadge:`Default`,modelCurrentBadge:`In use`,modelDefaultNotSet:`Not set · Pi chooses when a new chat starts`,modelDefaultHint:`Choose the model for future chats. Existing chats keep their own model. This also updates Pi's default.`,modelDefaultReadFailed:`Could not read the default model.`,modelDefaultProjectOverride:`This workspace has a Pi override: {{model}}.`,modelDefaultSave:`Save default`,modelMakeDefault:`Also make this the default for new chats`,modelDefaultSaveFailed:`The default was not confirmed. Refresh status and try again.`,modelDefaultPartial:`The chat model changed, but saving the default was not confirmed. Refresh status before retrying.`,modelConnectionNextHint:`Choose a model from this connection to use in the current chat.`,modelConnectionSearch:`Search models…`,modelConnectionChooseProvider:`Choose a model from {{provider}}`,modelConnectionUse:`Use in this chat`,modelConnectionUseFailed:`The model change was not confirmed. Refresh the model list and try again.`,modelConnectionLoadFailed:`Could not load models.`,modelConnectionNoModels:`No selectable models yet. Check the connection or add a model definition.`,modelConnectionNoMatch:`No matching models.`,modelConnectionMore:`{{count}} more models. Search to narrow the list.`,providerModelsEmpty:`No models yet. Fetch available models or add one manually.`,providerModelsInherited:`Uses the provider’s built-in model catalog.`,providerModelsReadOnly:`This provider contains model settings that must be edited in Pi’s configuration file.`,providerModelId:`Model {{number}} ID`,providerModelName:`Model {{number}} name`,providerModelDetails:`Model details: {{model}}`,providerRemoveModel:`Remove model: {{model}}`,providerIdInvalid:`Use a unique provider ID with letters, numbers, hyphens, dots or underscores.`,providerNativeAuth:`This provider uses Pi’s native sign-in.`,providerConfigurationFailed:`Could not save. Check the fields and retry when the session is idle.`,providerProfileSavedKeyFailed:`The provider was saved, but its API key was not. Retry saving the key.`,providerReload:`Discard draft and reload`,providerCurrentRemoval:`Select another model before removing the model currently in use.`,providerRemoveDetail:`Remove this provider’s configuration and custom models? Credentials managed by Pi are kept.`,providerPickerIntro:`Select the models you want to add from this provider.`,providerPickerSelected:`{{count}} selected`,providerApiKey:`API key`,providerKeyPlaceholder:`Paste a key to add or replace it`,saveProviderKey:`Save API key`,savingSettings:`Saving…`,keepEditing:`Keep editing`,discardAndContinue:`Discard and continue`,unsavedSettingsTitle:`Discard unsaved changes?`,unsavedSettingsDetail:`Unsaved model and credential changes will be lost.`,unsavedCredentialTitle:`Discard the unsaved credential?`,unsavedCredentialDetail:`The new key has not been saved and will be cleared.`,modelSelectionBusy:`This session is busy. Model changes are unavailable.`,providerKeySaved:`Saved to Pi credentials. Existing keys are never displayed.`,providerSaveFailed:`Credential save did not complete. Wait until the session is idle, refresh status and retry. Some providers need additional authentication settings.`,providerWriteDetail:`Save API keys here directly to Pi. Keys never enter a model conversation. For OAuth or additional provider fields, use Pi's native login.`,editModelConfiguration:`Add or edit a custom model`,modelConfigurationDetail:`Set up a provider connection, then choose available models or add one manually. Saving does not send a model request.`,configuredModels:`Custom model configuration`,addModel:`Add a model`,modelConfig_provider:`Provider ID`,modelConfig_id:`Model ID`,modelConfig_name:`Display name`,modelConfig_baseUrl:`API base URL`,modelConfig_api:`API format`,modelConfig_contextWindow:`Context window`,modelConfig_maxTokens:`Max output tokens`,providerCapacityLabel:`{{field}} {{number}}`,providerModelOptions:`Model options`,providerModelInvalid:`Model {{number}}: use a unique model ID and positive token counts, such as 128K or 1M. Leave capacities blank to use defaults.`,modelConfig_reasoning:`Supports reasoning`,saveModelConfiguration:`Save model`,reloadModelConfiguration:`Discard draft and load latest`,retryModelConfiguration:`Retry loading`,discardModelDraftTitle:`Discard this model draft?`,discardModelDraftDetail:`The latest configuration will replace this unsaved draft.`,discardAndReload:`Discard and reload`,modelConfigurationUnsaved:`Unsaved changes`,modelConfigurationConflict:`Model configuration changed elsewhere. Your draft is unchanged.`,modelConfigurationLoadFailed:`Could not load model configuration. Your draft is unchanged.`,modelConfigurationSaved:`Saved to Pi models.json. Configure the provider API key to make this model available.`,modelConfigurationFailed:`Model save did not complete. Your draft is unchanged.`,setupConfigurationRequest:`Configuration request`,configureViaSetup:`Apply via OpenPI setup`,setupFormDetail:`Uses /openpi-setup. Follow progress and any required confirmation in the conversation; submission does not mean the configuration is saved.`,setupSkillsPlaceholder:`Describe the skill to add or configure, including its source or local path`,setupPluginsPlaceholder:`Describe the Pi package to configure, including its exact package name or local path`,enableSkillInvocation:`Allow model invocation`,disableSkillInvocation:`Require explicit invocation`,setupSkillInvocationRequest:`Configure this Pi skill: {{path}}. Set its native disable-model-invocation field to {{disabled}}. Preserve other content and explain when the change takes effect.`,setupRoleFormRequest:`Configure the OpenPI {{role}} role to use {{model}} and set workflow concurrency to {{concurrency}}. Inherit parent thinking, validate the selection and preserve unrelated configuration.`,providerReadOnlyDetail:`This page is read-only and never receives credential values. Configure provider authentication through Pi, then refresh this status.`,openProviderSettings:`Open provider settings`,credentialConfigured:`Configured`,credentialMissing:`Not configured`,authNotVerified:`Configured credentials do not guarantee a successful model request.`,configurationViaPi:`Read-only status. Manage model credentials and trust through Pi; manage OpenPI options with /openpi-setup.`,noSkillsFound:`No skills are loaded for this Session.`,addSkill:`Add skill`,addPlugin:`Add plugin`,searchResources:`Search by name or source`,filterResourceScope:`Resource scope`,allResourceScopes:`All scopes`,noMatchingResources:`No matching resources`,resourceBulkTooLarge:`Filter the list further before submitting a bulk request.`,resourceManagement:`Pi resources`,resourceSourceAuto:`Pi automatic discovery`,resourceSourceLocal:`Local resource`,resourcePackageSource:`Package, repository or local path`,resourcePackageSourcePlaceholder:`npm:package@version · git:owner/repo · /path/to/skill`,resourceInstallIntro:`Choose a source and scope. OpenPI setup will review and apply the request in the conversation.`,resourceInstallReview:`Review the exact source and permissions in the conversation. Submitting this request does not mean it is installed or loaded.`,resourceRequestSubmitted:`Request submitted. Follow progress and confirmations in the conversation, then refresh this catalog.`,browseSkills:`Browse skills.sh`,resourceSessionState:`Apply to this Session`,resourcesReloadNote:`Refresh reads the catalog. Reload applies saved resources to this idle Session; changes are never reloaded automatically.`,reloadResources:`Reload resources`,resourceReloadReview:`Apply saved Pi skill and plugin configuration and restart extensions in the current Session? Wait for running work to finish first.`,resourceReloaded:`Resources reloaded. Review the refreshed catalog and diagnostics.`,resourceReloadFailed:`Could not reload resources. Wait for this Session to become idle and refresh before retrying.`,advancedResourceConfiguration:`Advanced configuration`,resourceDiagnostics:`Pi reports {{extensionErrors}} extension diagnostics and {{skillErrors}} skill diagnostics.`,resourceConfigurationDiagnostics:`{{count}} settings files could not be read. Review Pi configuration diagnostics.`,resourceCatalogTruncated:`This catalog is bounded; some resources are omitted.`,resourceTargetTruncated:`This source or path is truncated. Confirm the full target through Advanced configuration before making changes.`,updateResource:`Review update`,removeResource:`Review removal`,skillsEmptyTitle:`Add your first skill`,skillsEmptyIntro:`Skills give Pi reusable instructions. Add a package, repository or local skill; project skills follow Pi project trust.`,pluginsEmptyTitle:`Extend Pi with a plugin`,pluginsEmptyIntro:`Packages can include extensions, skills, prompts and themes. Add a source to review its installation through OpenPI setup.`,pluginCount:`{{count}} plugin sources`,installedVersion:`Installed version`,configuredVersion:`Configured version`,resourceVersionUnpinned:`Not pinned / local source`,pluginState_loaded:`Session resources loaded`,pluginState_installed:`Installed · not loaded`,pluginState_disabled:`Disabled in configuration`,pluginState_missing:`Package missing`,pluginState_error:`Load diagnostics`,pluginState_notLoaded:`Not loaded`,pluginLoadedResources:`{{count}} resources in this Session's catalog. Configuration changes require an explicit reload.`,pluginAction_enable:`Review enable`,pluginAction_disable:`Review disable`,pluginAction_update:`Review update`,pluginAction_remove:`Review removal`,enableVisibleSkills:`Allow model use ({{count}} shown)`,disableVisibleSkills:`Explicit use only ({{count}} shown)`,enableVisiblePlugins:`Enable {{count}} shown packages`,disableVisiblePlugins:`Disable {{count}} shown packages`,setupResourceInstallRequest:`Add these Pi {{kind}} from source {{source}} in scope {{scope}}. Inspect the source and resolve a fixed package identity, review required installation permissions with me using ask_user, then use Pi's native package/skill configuration. For a skill request, preserve unrelated extensions and other resources. Preserve existing preferences and project trust; do not reload this Session automatically. Report saved configuration and any remaining action separately. Do not change unrelated OpenPI settings.`,setupPluginOperationRequest:`Review Pi package action {{action}} for exactly configured source {{source}}, native root {{path}}, scope {{scope}}. Resolve relative sources against the native scope's settings directory. Use Pi's native package management. For updates, inspect available versions and review a fixed target identity and required permissions with me using ask_user before installing. Preserve resource filters and all unrelated preferences; if a toggle would destroy filters, stop and explain. Removal must not delete a local source directory. Do not reload automatically. Report persisted and active states separately; do not change unrelated OpenPI settings.`,setupSkillManageRequest:`Review Pi skill action {{action}} for exactly file {{path}}, source {{source}}, scope {{scope}}. Inspect native ownership first. Review the update/removal and required permissions with me using ask_user. Preserve unrelated skills and package resources; do not remove an entire shared package to remove one skill. Preserve project trust and do not reload automatically. Do not change unrelated OpenPI settings.`,setupSkillsBulkRequest:`For exactly these currently displayed Pi skill files {{paths}}, set native disable-model-invocation to {{disabled}}. Inspect ownership, preserve all other content and preferences, review necessary changes with me, and report any files that cannot be changed safely. Explicit /skill invocation remains available. Do not reload automatically or change unrelated OpenPI settings.`,setupPluginsBulkRequest:`For exactly these currently displayed Pi packages {{packages}}, set disabled to {{disabled}} through native Pi configuration. Preserve all other preferences and resource filters; skip and report entries whose filters cannot be preserved. Respect scope and project trust, review necessary changes with me, and do not reload automatically or change unrelated OpenPI settings.`,resourceRequestFinished:`The setup turn has ended. Refresh and inspect Pi's configuration and Session resources to confirm what changed.`,skillCount_one:`{{count}} skill`,skillCount_other:`{{count}} skills`,skill:`Skill`,copySkillInvocation:`Copy invocation`,source:`Source`,scope:`Scope`,invocation:`Invocation`,modelInvocation:`Model invocation`,resourceScope_user:`Global`,resourceScope_project:`Project`,resourceScope_temporary:`Temporary`,explicitOnly:`Explicit invocation only`,availableToModel:`Available to the model`,skillFile:`Skill file`,selectSkill:`Select a skill`,subagentConfiguration:`Pi-native subagent roles`,subagentConfigurationIntro:`Role models inherit from the parent unless OpenPI setup assigns an available model.`,subagentActiveCount_one:`{{count}} active`,subagentActiveCount_other:`{{count}} active`,subagentCompletedCount_one:`{{count}} recorded`,subagentCompletedCount_other:`{{count}} recorded`,subagentConcurrency:`Limit {{count}}`,builtInRoles:`Built-in roles`,subagentRole_explorer:`Explorer`,subagentRole_implementer:`Implementer`,subagentRole_reviewer:`Reviewer`,subagentRole_advisor:`Advisor`,subagentRoleShort_explorer:`Read-only investigation`,subagentRoleShort_implementer:`Focused implementation`,subagentRoleShort_reviewer:`Correctness review`,subagentRoleShort_advisor:`Technical analysis`,subagentRoleDescription_explorer:`Explores the codebase and reports evidence without modifying files.`,subagentRoleDescription_implementer:`Implements a bounded change and runs the relevant repository checks.`,subagentRoleDescription_reviewer:`Reviews correctness, safety, regressions, and missing validation.`,subagentRoleDescription_advisor:`Analyzes difficult technical questions and recommends a concrete next step.`,configureRoles:`Configure roles`,builtInRole:`Built-in role`,builtIn:`Built-in`,modelAssignment:`Model assignment`,inheritParentModel:`Inherit parent model`,effectiveModel:`Effective model`,workflowConcurrencyLabel:`Concurrent agents`,workflowCallLimit:`Total agent calls`,runtimeBoundaries:`Runtime boundaries`,subagentAuthorityNote:`Child authority is the fail-closed intersection of the parent Session and role capabilities.`,subagentModelNote:`No hardcoded provider is introduced; an unassigned role follows the parent model and thinking level.`,resourceCount_one:`{{count}} resource`,resourceCount_other:`{{count}} resources`,noPluginsFound:`No loaded plugin sources were reported.`,pluginCatalogTotals:`{{extensions}} ext · {{skills}} skills · {{prompts}} prompts · {{themes}} themes`,loaded:`Loaded`,resourceOrigin:`Origin`,resourceOrigin_package:`Package`,resourceOrigin_topLevel:`Top-level resource`,resources:`Resources`,baseDirectory:`Base directory`,notReported:`Not reported`,extensions:`Extensions`,extensionSurfaceCount:`{{tools}} tools · {{commands}} commands`,prompts:`Prompts`,themes:`Themes`,pluginResourceSummary:`{{extensions}} ext · {{skills}} skills · {{prompts}} prompts · {{themes}} themes`,pluginsManagedByPi:`These resources are loaded by Pi. Submit changes using the setup form above. Package changes follow native confirmation and take effect through Pi's reload lifecycle.`,selectPlugin:`Select a plugin source`,statusCaptured:`Snapshot at {{time}} · refresh for the latest state`,conversationViews:`Conversation views`,currentConversations:`Current`,archivedConversations:`Archived`,refreshArchives:`Refresh archived conversations`,loadingArchives:`Loading archived conversations...`,moreArchives:`Load more archived conversations`,retryArchives:`Retry archived conversations`,archiveLoadFailed:`Could not load archived conversations.`,archiveCursorStale:`Archived conversations changed. Refresh to continue.`,archiveScanBounded:`{{count}} older records have not been scanned.`,noArchivedSessions:`No archived conversations.`,noScannedArchives:`No archived conversations in the scanned history.`,noMatchingScannedArchives:`No matching archived conversations in the scanned history.`,draftLimit:`Draft storage is full. Send or clear an existing draft before adding more content.`,restoreConversation:`Restore conversation`,restoringConversation:`Restoring…`,loadedArchives:`Archived conversations in the loaded history`,loadedHistoryBounded:`{{sessions}} more sessions and {{workspaces}} workspace summaries are not loaded. Search covers the loaded list only.`,noLoadedArchives:`No archived conversations in this loaded list.`,restoreFailed:`Could not confirm restoration. Refresh and try again.`,execution_running:`Running`,execution_done:`Completed`,execution_killed:`Stopped`,execution_timed_out:`Timed out`,execution_failed:`Failed`,execution_uncertain:`Uncertain`,activeOnlyHint:`Only the active Web session accepts messages.`,acceptedHint:`Message accepted by OpenPI Web.`,promptAdmissionUnknown:`It is unclear whether the last message was received.`,promptAdmissionUnknownDetail:`Review the refreshed Session history and runtime status before deciding. Sending as a new message may create a duplicate message.`,promptAdmissionCheckingDetail:`Checking the latest Session history and runtime status before resend options are enabled.`,promptAdmissionVerificationFailedDetail:`Could not refresh the latest Session history and runtime status. Check again before sending as a new message.`,abandonAdmission:`Don't resend for now`,retryAdmissionCheck:`Check again`,retryOriginalAdmission:`Retry original message`,promptTooLong:`Message exceeds the send limit ({{count}} / {{limit}}).`,sendAsNew:`Send as new message`,sendingAsNew:`Sending…`,stopTurn:`Stop current turn`,stoppingTurn:`Stopping current turn…`,stoppedTurn:`Current turn stopped.`,pendingFollowUpsHint:`{{count}} messages queued`,sendNextTurn:`Send next turn`,followUpBehavior:`Follow-up behavior`,followUpBehaviorDetail:`While OpenPI is running, queue new messages for the next turn or guide the current turn. Press ⌘/Ctrl+Enter to use the other option once.`,followUpQueue:`Queue`,followUpQueueDetail:`Next turn`,followUpSteer:`Steer`,followUpSteerDetail:`Current turn`,steerCurrentTurn:`Steer current turn`,steeringHint:`Use this instruction after the current tool step finishes.`,pendingSteeringHint:`{{count}} instructions received; waiting for the current tool step`,steeringMessagesTitle:`Pending instructions for this turn`,steerStaleTurn:`That turn has ended or changed. Your draft is kept. Check the updated status and send again.`,sourceFeedbackNew:`{{path}} · new line {{line}}`,sourceFeedbackOld:`{{path}} · old line {{line}}`,forkMessage:`Fork from here`,forkMessageHint:`Create a new conversation from this message. Keep the original conversation; no message is sent.`,forkSessionPending:`Creating a fork…`,forkSessionCreated:`Fork created. The original conversation remains in the sidebar.`,forkSessionCancelled:`Fork cancelled. The original conversation is kept.`,forkSessionUncertain:`The fork could not be confirmed. Refresh and inspect your conversations before trying again.`,forkSessionUnavailable:`Switch to this conversation and let its current work and queued messages finish before forking.`,reviewQuoteLine:`Reference this line`,reviewSelectOldLine:`Select old line {{line}}`,reviewSelectNewLine:`Select new line {{line}}`,queuedMore:`{{count}} more queued`,queuedImage:`Image attachment`,queuedMessageExpand:`Expand queued message`,queuedMessageCollapse:`Collapse queued message`,backgroundSessionRunning:`This session is running in the background…`,observedSessionTools:`{{count}} active tools`,toolsRequireCurrentSession:`Switch to this session to use interactive tools.`,activateViewedSession:`Switch to this session`,activateViewedSessionHint:`Send a message to continue this conversation.`,addWorkspace:`Add workspace`,addWorkspaceMenu:`Add workspace...`,archiveConversation:`Archive conversation`,pinnedConversations:`Pinned`,sidebarOptions:`Sidebar options`,sidebarProjectOptions:`Project sidebar options`,sidebarRecentOptions:`Chat sidebar options`,sidebarActivityOptions:`Activity view options`,sidebarShow:`Show`,sidebarGroupBy:`Group conversations`,sidebarByProject:`By project`,sidebarFlatList:`All conversations`,sidebarChatSort:`Conversation order`,sidebarRecent:`Recent`,sidebarProjectsInRecents:`Show projects in Recent`,sidebarShowMore:`Show more`,sidebarShowLess:`Show less`,sidebarFilterList:`Filter this list`,sidebarSaveFailed:`Could not save the change. Please try again.`,pinWorkspace:`Pin project`,unpinWorkspace:`Unpin project`,markConversationRead:`Mark as read`,markConversationUnread:`Mark as unread`,sidebarState_unread:`Unread conversation`,sidebarActivity:`Activity`,sidebarViewActivity:`View activity`,sidebarViewChats:`View conversations`,sidebarPriority:`Priority`,sidebarActivityEmpty:`Nothing needs attention`,sidebarActivityEmptyHint:`Completed work and conversations needing your attention appear here.`,sidebarMarkAllRead:`Mark all as read`,sidebarClearRead:`Clear read chats from Priority`,sidebarReadFailed:`Could not update read status. Please try again.`,sidebarToday:`Today`,sidebarYesterday:`Yesterday`,sidebarEarlier:`Earlier`,sidebarActivityCompleted:`Completed`,sidebarActivityFailed:`Failed`,sidebarActivityRead:`Read`,modelAdvanced:`Advanced parameters`,providerConnectionHeading:`Provider connection`,providerFetchModels:`Get available models`,providerFetchHint:`Enter the provider and endpoint, then choose models in one step.`,providerPickerTitle:`Choose models to add`,providerPickerAccess:`Connection credentials`,providerPickerKey:`Access key (optional)`,providerPickerKeyHint:`Leave blank to use saved credentials for this endpoint. A key entered here is used for discovery only and is not saved.`,providerPickerSearch:`Search models`,providerPickerSelectAll:`Select all`,providerPickerClear:`Clear selection`,providerPickerLoading:`Reading available models…`,providerPickerAdded:`Added`,providerPickerNoMatch:`No matching models`,providerPickerEmpty:`No models returned. You can still add one manually.`,providerPickerBounded:`Showing the first 500 models. Add other IDs manually.`,providerPickerError_load:`Could not read the model list. Check the endpoint and credentials, then retry or add a model manually.`,providerPickerError_save:`Could not confirm the save. Your selection is kept; check the connection before retrying.`,providerPickerError_conflict:`Configuration changed elsewhere. Close this dialog and reload configuration before saving again.`,providerPickerDefaults:`New models use {{context}} context / {{output}} output tokens. You can adjust these per model after adding.`,providerPickerRetry:`Refresh list`,providerPickerCount:`{{count}} selected · up to 100`,providerPickerSave:`Add selected`,sidebarState_running:`Running`,sidebarState_compacting:`Organizing context`,sidebarState_waiting:`Waiting for your response`,sidebarState_completed:`Completed · unread result`,sidebarState_failed:`Failed · open conversation for details`,pinnedOptions:`Pinned options`,pinConversation:`Pin conversation`,unpinConversation:`Unpin conversation`,pinnedRecentlyUpdated:`Recently updated`,pinnedManualOrder:`Manual order`,movePinUp:`Move up`,movePinDown:`Move down`,pinSaveFailed:`Could not save pinned conversations. Please try again.`,cancel:`Cancel`,chooseWorkspaceHint:`Choose a workspace and describe the work`,close:`Close`,closeSearch:`Close search`,collapseSidebar:`Collapse sidebar`,confirmEdit:`Save and rerun`,editMessageHint:`Rerun from here in a new branch. Keep the original conversation, images and file references. Existing workspace changes are kept.`,regenerateMessage:`Regenerate response`,regenerateMessageHint:`Rerun this question in a new branch, keeping its original attachments and conversation.`,messageRerunStarted:`Rerun admitted in a new branch. The original conversation is kept.`,openOriginalConversation:`View original conversation`,messageRerunWorkspaceHint:`Existing workspace changes are kept.`,modelRequestRecovered:`Request recovered`,modelReconnecting:`Reconnecting`,modelReconnectUnknown:`Reconnection status unconfirmed`,modelEarlierAttempts:`Earlier request errors`,modelFailedAttempts:`Failed attempts ({{count}})`,draftStorageUnavailable:`Draft could not be saved on this device. Keep this page open or copy your message.`,draftStorageInvalid:`Some saved draft content could not be restored. Check your message and attachments.`,draftStorageRetry:`Retry saving draft`,workbarBackToChat:`Back to chat`,workbarCollapseTools:`Collapse tools`,workbarEndTerminal:`Close {{name}} and end its process`,workbarNewTerminal:`New terminal`,workbarContinueInChat:`Continue in chat`,transcriptSearch:`Search message contents`,transcriptSearchPlaceholder:`Search titles, projects, or messages…`,transcriptSearchRecent:`Recent conversations`,transcriptSearchSessions:`Conversations`,transcriptSearchMessages:`Message contents`,transcriptSearchSessionResult:`Open conversation {{session}}`,transcriptSearchSessionOpenFailed:`Could not open this conversation. Try again.`,transcriptSearchIncludeArchived:`Include archived conversations`,transcriptSearching:`Searching messages…`,transcriptSearchEmpty:`No matching messages found.`,transcriptSearchFailed:`Could not search messages. Try again.`,transcriptSearchRetry:`Retry search`,transcriptSearchPartial:`Some history could not be searched. Results may be incomplete.`,transcriptSearchOpenFailed:`This message could not be opened. It may have moved or belong to another branch.`,transcriptSearchResult:`Open message from {{source}} in {{session}}`,transcriptSearchSource_user:`you`,transcriptSearchSource_assistant:`assistant`,transcriptSearchSource_tool_call:`tool call`,transcriptSearchSource_tool_result:`tool output`,connected:`Connected`,connecting:`Connecting`,conversationName:`Conversation name`,conversationOptions:`Conversation options`,sidebarRename:`Rename`,sidebarPin:`Pin`,sidebarUnpin:`Unpin`,sidebarFork:`Fork`,sidebarForkLocal:`Fork chat`,sidebarForkSameWorktree:`Fork in same worktree`,archiveNoticeTitle:`Chat archived`,archiveNoticeView:`View`,archiveNoticeUndo:`Undo`,archiveNoticeFailed:`Could not complete this action. Try again.`,sidebarForkWorktree:`Fork chat in new worktree`,sidebarForkCancelling:`Requesting cancellation…`,sidebarForkFinishing:`Cancellation is no longer available. Confirming the result…`,sidebarForkCancelUnconfirmed:`Cancellation could not be confirmed. Waiting for the fork result.`,sidebarForkWorktreePreserved:`The worktree was kept at {{path}}. Inspect it before retrying.`,sidebarForkWorktreePending:`Creating a worktree and conversation…`,sidebarForkOptionsLoading:`Checking worktree availability…`,sidebarForkOptionsFailed:`Unable to check worktrees. Reopen menu to retry.`,sidebarForkUnavailable:`Send a message before forking this conversation.`,sidebarForkArchived:`Restore this conversation before forking.`,sidebarForkFailed:`Could not create the fork. The original conversation is unchanged.`,sidebarCopy:`Copy`,sidebarCopyLink:`Copy conversation link`,sidebarCopyMarkdown:`Copy as Markdown`,sidebarCopyCwd:`Copy working directory`,sidebarCopied:`Copied`,sidebarCopyFailed:`Could not copy. Try again.`,sidebarNewWindow:`Open in new window`,sidebarOpenIn:`Open in`,sidebarAppsLoading:`Loading available apps…`,sidebarAppsFailed:`Unable to load apps. Reopen menu to retry.`,sidebarOpenFailed:`Unable to open this project in the selected app.`,sidebarArchive:`Archive`,sidebarRestore:`Restore`,sidebarDelete:`Permanently delete`,managedWorktreeRecoveryFull:`Check earlier unfinished removal requests before starting another.`,managedWorktreesChanged:`The worktree list changed. Refresh it before reviewing a target.`,managedWorktreesRefresh:`Refresh worktrees`,managedWorktreesBack:`Back to worktrees`,managedWorktreesRetry:`Retry request`,managedWorktrees:`Retained worktrees`,managedWorktreesDescription:`Worktrees created by OpenPI are kept when a conversation is deleted. Review an exact path before requesting removal. Active, shared, changed or unverified worktrees stay in place.`,managedWorktreeConfirm:`Remove this managed worktree? The server rechecks ownership, active conversations and local changes before removal.`,managedWorktreeRemoved:`Worktree removed.`,managedWorktreePreserved:`Worktree kept:`,managedWorktreeUncertainTerminal:`Removal outcome is uncertain. Automatic removal cannot be repeated. Inspect the retained path before taking further action.`,managedWorktreeUncertain:`Removal outcome is unknown. Retry to check the original request.`,managedWorktreeRemoving:`Checking and removing…`,managedWorktreeRemove:`Remove worktree`,managedWorktreeReview:`Review removal`,managedWorktreesEmpty:`No managed worktrees were found on this page.`,managedWorktreesUnavailable:`{{count}} ownership records could not be verified.`,managedWorktreesLoadFailed:`Could not load retained worktrees. Retry without changing the target.`,managedWorktreesMore:`Load more worktrees`,managedWorktreeRetainedAfterDelete:`Conversation deleted. Worktree kept at {{path}}. Review retained worktrees in the project menu.`,sidebarDeleteTitle:`Delete conversation?`,sidebarDeleteDescription:`Permanently delete “{{name}}”? This cannot be undone.`,sidebarDeleteConfirm:`Delete`,sidebarDeleting:`Deleting…`,sidebarDeleteFailed:`Could not delete this conversation. Retry or cancel.`,sidebarActionRunning:`Let current work and queued messages finish first.`,sidebarActionDisconnected:`Reconnect before changing this conversation.`,sessionDeleteCancelled:`Deletion cancelled`,sessionDeleteUncertain:`Could not confirm whether the conversation was deleted. Refresh and try again.`,sessionDeleted:`Conversation permanently deleted`,sessionDeleteMetadataPending:`The conversation was deleted, but its sidebar records could not be fully cleared.`,sessionLinkUnavailable:`The linked conversation no longer exists or its identity has changed.`,sidebarDropPin:`Drop here to pin`,sidebarDropProjectLast:`Move project to the end`,conversationTurns:`Conversation turns`,conversationTurnPosition:`Go to turn {{position}}`,turnPreviewLoading:`Loading preview…`,turnPreviewUnavailable:`Preview unavailable. Try again.`,commands:`Slash commands`,addContext:`Add context`,fileReference:`Reference workspace file`,fileReferenceTitle:`Reference workspace file`,fileReferenceDetail:`Add a path reference to the prompt without uploading file contents.`,fileReferenceLabel:`Workspace file path`,fileReferencePlaceholder:`src/app.tsx`,fileReferenceValidatedHint:`The current Session verifies that this is a readable workspace file.`,fileReferenceDraftHint:`This path will be resolved by Pi after the new Session starts.`,fileReferenceChecking:`Checking…`,fileReferenceFailed:`Could not verify this file.`,fileReferenceDenied:`Choose a file inside the current Session workspace.`,fileReferenceMissing:`This workspace file no longer exists.`,fileReferenceUnsupported:`Only regular workspace files can be referenced.`,fileReferenceExpired:`The active Session changed. Reopen the file reference and try again.`,fileReferenceBusy:`File validation is busy. Try again shortly.`,insertReference:`Insert reference`,commandsSessionRequired:`Slash commands are available after the Session starts.`,commandsEmptyDraftOnly:`Slash commands can be inserted only into an empty draft.`,commandsLoading:`Loading commands...`,commandsUnavailable:`Commands are temporarily unavailable.`,commandsNoMatch:`No matching commands.`,commandsNoAvailable:`No discovered commands can run in Web. Type a command name to inspect its availability.`,commandsBounded:`{{count}} more commands are not shown.`,commandSessionRequired:`Commands require an active Web session.`,commandUnsupported:`Not adapted · manual commands still reach Pi`,commandAcceptsArguments:`Accepts arguments`,commandSource_extension:`Extension`,commandSource_prompt:`Prompt template`,commandSource_skill:`Skill`,copiedMessage:`Copied`,copyMessage:`Copy message`,copyFailed:`Copy failed. Please select and copy the message manually.`,copiedCode:`Code copied`,copyCode:`Copy code`,copyCodeFailed:`Could not copy this code. Select and copy it manually.`,codeBlock:`Code block`,wrapCode:`Wrap lines`,expandCode:`Show all {{count}} lines`,collapseCode:`Collapse code`,expandInput:`Expand input`,collapseInput:`Collapse input`,deleteWorkspace:`Delete workspace`,describeTask:`Describe a task`,editMessage:`Edit and rerun from here`,enterHint:`Enter to send, Shift+Enter for a new line.`,expandSidebar:`Expand sidebar`,importWorkspace:`Import workspace`,loadingModels:`Loading models...`,modelsTruncated:`Showing {{shown}} models. {{omitted}} more are available; search to find them.`,searchModels:`Search available models`,searchModelsPlaceholder:`Search provider, model name, or ID...`,searchingModels:`Searching models...`,noMatchingModels:`No matching models`,modelSearchFailed:`Could not search models. Try again.`,retryModelSearch:`Retry model search`,fileReferenceDraftChanged:`The draft changed. Reopen the file reference.`,modelSearchTruncated:`{{omitted}} matching models are not shown.`,modelPreparing:`Preparing task...`,modelRetrying:`Retrying model request...`,modelRunning:`Working…`,modelRequestFailed:`Model request failed`,modelRequestStopped:`Model request stopped`,modelFailureUnknown:`The provider did not return an error reason.`,retryPrompt:`Retry prompt`,retryingPrompt:`Retrying...`,newSession:`New session`,noConversations:`No conversations yet`,noMatching:`No matching conversations`,noMatchingLoaded:`No matching conversations in the loaded history`,noModels:`No models available`,noOutput:`no output`,noSessions:`No sessions`,openSidebar:`Open sidebar`,promptMessage:`Send a message or start a task, / for commands`,promptReadonly:`A non-active session cannot receive prompts`,promptStart:`Choose a workspace to begin.`,promptTask:`Describe what you want to build.`,queuedHint:`The message will be queued after the current turn.`,reconnecting:`Reconnecting`,removeWorkspace:`Remove from sidebar`,workspaceOptions:`Workspace options`,renameFailed:`Could not save the name. Your changes were kept.`,savingName:`Saving...`,workspaceRemoveFailed:`Could not remove the workspace. Try again.`,removingWorkspace:`Removing...`,renameConversation:`Rename conversation`,renameWorkspace:`Rename workspace`,save:`Save`,searchConversations:`Search conversations`,searchPlaceholder:`Filter titles and workspaces…`,selectModel:`Select model`,configureModels:`Configure models`,openModelSettings:`Model settings`,selectThinking:`Select thinking level`,thinkingAvailableLevels:`Available: {{levels}}`,resetThinking:`Restore the opening level ({{level}})`,modelThinkingNotEnabled:`Thinking is not enabled for this model. Enable reasoning support in model settings if your provider supports it.`,providerReasoningHint:`Enable only if the provider supports reasoning. Adjust the active level in the composer.`,providerThinkingLevels:`Supported thinking levels`,providerThinkingLevelsHint:`Choose the levels this model supports. Saving updates the conversation picker.`,providerThinkingAutomatic:`Automatic (Pi defaults)`,providerThinkingSelected_one:`{{count}} level selected`,providerThinkingSelected_other:`{{count}} levels selected`,providerThinkingReset:`Use Pi defaults`,providerImageHint:`When Image is unchecked, the model will not receive image attachments.`,selectWorkspace:`Select workspace`,send:`Send`,processDetails:`Execution details`,processRunning:`Working`,processThinkingCount_one:`{{count}} reasoning note`,processThinkingCount_other:`{{count}} reasoning notes`,processToolCount_one:`{{count}} tool call`,processToolCount_other:`{{count}} tool calls`,processFailureCount_one:`{{count}} failed`,processFailureCount_other:`{{count}} failed`,runtimeActivities:`Activity`,activityAgentProgress:`{{completed}}/{{total}} agents finished`,activityCapacity:`Concurrent tasks: {{running}}/{{limit}} · {{queued}} waiting`,composerQueuedCount:`Queued {{count}}`,composerSteeringCount:`Steering {{count}}`,runtimeActivityRunning_one:`{{count}} running`,runtimeActivityRunning_other:`{{count}} running`,runtimeActivityCount_one:`{{count}} activity`,runtimeActivityCount_other:`{{count}} activities`,processActivityCount_one:`{{count}} agent activity`,processActivityCount_other:`{{count}} agent activities`,switchingSession:`Switching session...`,thinkingActive:`Thinking...`,thinkingActiveLevel:`Thinking ({{level}})...`,thinkingDone:`Thinking`,thinkingLoadFull:`Load full thinking`,thinkingLoadingFull:`Loading thinking…`,thinkingLoadFailed:`Unable to load thinking. Retry`,thinkingPartialText:`Showing part of the saved thinking. More text can be loaded below.`,thinkingPreviewOnly:`Thinking preview reached its limit. The full saved text will be available when this message finishes.`,toolState_running:`Running`,toolState_returned:`Returned`,toolState_failed:`Failed`,toolState_cancelled:`Stopped`,toolState_timed_out:`Timed out`,toolState_unknown:`Unconfirmed`,toolSnapshotMissingResult:`No result at fork`,toolActivity_running:`{{action}}…`,toolActivity_failed:`{{action}} failed`,toolActivity_cancelled:`{{action}} stopped`,toolActivity_timed_out:`{{action}} timed out`,toolActivity_unknown:`{{action}}`,toolAction_read:`Read`,toolAction_write:`Write file`,toolAction_edit:`Edit file`,toolAction_command:`Run command`,toolAction_search:`Search`,toolAction_list:`List files`,toolAction_web:`Browse web`,toolAction_agent:`Agent activity`,subagentAction_spawn:`Start subagent`,subagentAction_send:`Send follow-up`,subagentAction_check:`Check subagent`,subagentAction_wait:`Wait for subagent`,subagentAction_cancel:`Stop subagent`,subagentActionDone_spawn:`Started subagent`,subagentActionDone_send:`Sent follow-up`,subagentActionDone_check:`Checked subagent`,subagentActionDone_wait:`Finished waiting`,subagentActionDone_cancel:`Stop request returned`,toolAction_workflow:`Workflow`,toolAction_plan:`Prepare plan`,toolAction_git:`Review changes`,toolAction_call:`Use tool`,toolActionDone_read:`Read`,toolActionDone_write:`Wrote file`,toolActionDone_edit:`Edited`,toolActionDone_command:`Ran command`,toolActionDone_search:`Searched`,toolActionDone_list:`Listed files`,toolActionDone_web:`Browsed web`,toolActionDone_agent:`Agent activity returned`,toolActionDone_workflow:`Workflow tool returned`,toolActionDone_plan:`Plan tool returned`,toolActionDone_git:`Reviewed changes`,toolActionDone_call:`Used tool`,toolActionGroup_read:`read files`,toolActionGroup_write:`write files`,toolActionGroup_edit:`edit files`,toolActionGroup_command:`run commands`,toolActionGroup_search:`search`,toolActionGroup_list:`list files`,toolActionGroup_web:`browse web`,toolActionGroup_agent:`agent activity`,toolActionGroup_workflow:`workflow activity`,toolActionGroup_plan:`planning`,toolActionGroup_git:`review changes`,toolActionGroup_call:`use tools`,toolGroup_done:`Activity · {{actions}}`,toolGroup_running:`Working · {{actions}}`,toolGroup_unknown:`Activity · {{actions}}`,toolGroupSeparator:`, `,toolSearchTarget:`“{{pattern}}” · {{path}}`,toolDiffStatsHelp:`Added and removed lines in the displayed diff`,toolRequestedFile:`File:`,toolWorkspace:`Workspace`,toolRawEvidence:`Arguments and original result`,toolCodemodeDetails:`Script and original result`,toolNestedOutputMissing:`This session records the call and its status, but not the nested tool output.`,toolNestedArgumentsMissing:`This session omits the full arguments and nested tool output.`,toolNestedIncomplete:`The nested-call record is incomplete; some calls, arguments or final states are unavailable.`,toolPartialEvidence:`Partial output: a byte, line or item limit was reached. The original result may also be truncated.`,toolFileChange_created:`File created`,toolFileChange_unchanged:`No content changes`,toolFileChange_overwritten:`File overwritten`,toolChangeUnavailable:`This result does not include a change comparison.`,toolTestResults:`Reported test results · {{format}}`,toolTestCounts:`{{tests}} tests · {{passed}} passed · {{failed}} failed · {{cancelled}} cancelled`,toolTestCountsHelp:`Counts come from command output. The execution status is shown separately.`,toolReadMore:`Read another range using the path and offset. The original result contains continuation details.`,toolFullOutputReference:`Full output:`,subagentBackgroundResult_one:`Background subagent result · {{count}}`,subagentBackgroundResult_other:`Background subagent results · {{count}}`,thinkingDraftHint:`Choose a workspace and create a session first.`,thinkingInactiveHint:`Only the active session can change its thinking level.`,thinkingLevelMismatch:`The confirmed thinking level is not offered by the current model. Choosing another level will correct it.`,thinkingLockedRunning:`Stop the current turn before changing the thinking level.`,thinkingModelPendingHint:`Wait for the model change to finish.`,thinkingNotConfirmed:`Thinking level was not confirmed. Please try again.`,thinkingPendingHint:`Applying the thinking level...`,thinkingUnsupported:`Thinking is unavailable`,thinkingUnsupportedHint:`No model is selected, or the current model does not support thinking.`,unavailable:`Unavailable`,ungrouped:`Ungrouped`,untitledSession:`New session`,workspaceDeleteConfirm:`The folder and conversation records will be kept. Its conversations will move to Ungrouped.`,workspaceName:`Workspace name`,workspaces:`Workspaces`,sidebarProjects:`Projects`}},zh:{translation:{quitOpenPI:`退出 OpenPI`,quittingOpenPI:`正在退出…`,quitConfirmHelp:`确定退出此 OpenPI Web 应用吗?此 Web 应用中所有正在运行的任务都会停止,对话会保存,重启后可继续查看。`,quitTabHelp:`仅关闭浏览器标签页会让 OpenPI 和任务继续在后台运行。`,quitAccepted:`OpenPI 正在关闭`,quitAcceptedHelp:`退出请求已接受。请等待终端确认 OpenPI 已停止,然后可以关闭此标签页。`,quitRestartHelp:`重新启动:在终端运行 openpi web,或在 Pi 中运行 /web,然后打开显示的地址。刷新此页面不会重启 OpenPI。`,quitFailed:`无法确认是否已关闭。请先检查终端,再重试。也可以在 OpenPI 所在终端按 Ctrl+C 停止应用。`,promptPending:`正在处理请求…`,commandFeedbackTruncated:`这里只显示部分命令结果。请缩小查询范围,或在 TUI 查看完整输出。`,planMode_inactive:`普通模式`,planMode_planning:`规划中 · 禁止写入`,planMode_ready:`计划就绪 · 等待审阅`,planMode_invalid:`计划状态异常 · 禁止写入`,planModeEnter:`进入规划`,promptPlanMessage:`本次对话使用 Plan 模式 · 继续讨论计划,暂不实施`,planModeUnconfirmed:`暂时无法确认 Plan 状态,请刷新后再继续。`,planModeExit:`退出规划`,planModeImplement:`准备实施提示`,planImplementationReplaceDraft:`准备实施会替换当前草稿并关闭规划模式,但不会发送提示词。是否继续?`,commandSupport_plan:`支持规划和准备当前会话的实施提示;新建实施会话仍需使用 TUI。`,commandSupport_setup:`通过当前模型配置,在 Web 回答问题。`,handoffWaiting:`需要你操作`,handoffDone:`已完成`,handoffUnable:`无法完成`,handoffDoneHelp:`已执行操作,接下来由模型验证结果。`,handoffUnableHelp:`未能完成,可以补充遇到的障碍。`,handoffReview:`复核状态`,handoffSubmit:`提交状态`,handoffSignal:`预期结果:`,handoffVerify:`提交完成后,模型仍需验证结果;你的反馈本身不代表验证成功。`,planCardLabel:`开发计划`,planCardReady:`计划已就绪`,planCardResult:`计划结果`,planCardNotApproval:`此步骤仅生成计划,不代表已批准或开始实施。`,planCardCollapse:`收起`,planCardExpand:`展开`,planCardCopy:`复制计划`,planCardCopyPreview:`复制可见预览`,planCardTruncated:`当前仅显示截断预览。`,planCardLoadFull:`加载完整计划`,planCardLoadingFull:`正在加载计划...`,planCardLoadFailed:`无法加载完整计划,重试`,planCardEvidence:`工具结果 · plan_ready`,questionWaiting:`问题`,questionPreview:`查看预览`,questionSkip:`跳过`,questionProgress:`{{current}} / {{total}}`,questionReview:`复核答案`,questionReviewTitle:`确认这些选择?`,questionReviewHelp:`可以返回修改,点击提交后才会发送给助手。`,questionEdit:`修改答案:{{question}}`,questionDismiss:`关闭提问,不提交答案`,questionCustom:`或自行撰写回复`,questionCustomHelp:`留空提交,表示希望助手把问题说清楚或拆小。`,questionYourAnswer:`你的答案`,questionCustomPlaceholder:`说说你的想法…`,questionNotes:`补充说明(选填)`,questionNotesPlaceholder:`补充限制条件,或解释你的选择…`,questionRephrase:`请助手把问题说清楚或拆小`,questionBack:`上一步`,questionNext:`下一题`,questionSubmit:`提交答案`,questionSubmitting:`正在提交…`,questionRetry:`核对提交结果`,questionUncertain:`暂时无法确认是否送达,已保留本次提交的答案。点击核对可恢复结果,不会重复提交。`,questionDisconnected:`正在重新连接… 已保留你的选择,暂时无法提交。`,questionLimit:`每项答案或补充说明不能超过 {{count}} 个 UTF-8 字节。`,questionLoadFailed:`暂时无法读取等待回答的问题。`,questionDraftLimit:`提问草稿已达上限,请缩短或清空已有答案后再添加内容。`,questionRetryLoad:`重试`,questionCloseReceipt:`关闭问答状态提示`,questionState_dismissed:`已关闭提问,没有提交答案。`,questionState_cancelled:`提问已取消,没有提交答案。`,questionState_expired:`提问已过期,没有提交答案。`,questionState_stale:`该提问已失效,请查看对话中的处理结果。`,conversationView:`会话视图`,jumpToLatest:`跳至最新`,historyLoading:`正在加载历史…`,historyOmitted:`还有 {{count}} 条较早记录 · 向上滚动自动加载`,historyChanged:`会话分支已更改,已切换到当前分支的历史。`,historyUnavailable:`历史记录加载失败,请重试。`,historyValidationUnavailable:`无法校验会话历史,请重试。`,historyVerifying:`正在校验会话历史…`,messageLoadFull:`加载完整消息`,messageLoadMore:`加载更多`,messageLoadingFull:`正在加载消息…`,messageLoadFailed:`无法加载这条消息,重试`,filePreview:`文件预览`,changeEvidence:`变更`,changeEvidenceScope:`按所选范围查看当前工作目录的只读 Git 变更。`,turnLabel:`第 {{number}} 轮`,turnState_running:`运行中`,turnState_complete:`已完成`,turnState_failed:`失败`,turnState_interrupted:`已中断`,turnState_waiting:`等待回复`,turnState_forked:`已分叉,可继续对话`,turnChanges:`本轮更改 {{count}} 个文件`,turnChangesPartial:`本轮已记录 {{count}} 个文件`,turnChangesIncomplete:`这一轮的变更记录不完整。`,turnChangesMore:`再显示 {{count}} 个文件`,turnChangesLess:`收起文件`,turnChangesReview:`审阅本轮变更`,turnChangesReviewButton:`审阅`,turnChangesBack:`返回本轮变更`,turnChangesLoading:`正在加载本轮变更…`,turnChangesUnavailable:`无法读取本轮保存的差异。`,messageCopyRequiresFull:`加载完整消息后才能复制。`,filesChanged:`{{count}} 个文件已更改`,reviewChanges:`查看变更`,workspaceChanges:`工作区更改`,overviewChanges:`变更`,overviewLineTotals:`当前 Git 比较范围内的文本新增与删除行数`,overviewPartialTotals:`仅展示已核实的行数,部分文件尚无法统计。点击变更查看详情。`,overviewCounting:`统计中…`,overviewCountsUnknown:`行数未知`,overviewReviewUnavailable:`暂不可用`,sessionSources:`来源`,sourcesAdd:`添加来源`,sourcesDescription:`查看此对话附加的图片与文件`,sourceAttached:`已附加到对话`,sourcesEmpty:`暂无来源`,sourcesFailed:`来源加载失败。`,sourcesViewAll:`查看全部`,sourcesLoadMore:`加载更多来源`,sourcesBack:`返回来源列表`,sourcesPartial:`已达到列表展示上限,更早的来源仍可在对话中查看。`,turnChangesScope:`该轮开始至结束的工作区差异 · 已保存`,turnEdits:`已编辑 {{count}} 个文件`,turnEditsPartial:`已记录 {{count}} 个文件的编辑`,turnEditsScope:`本轮文件工具写入记录 · 已保存;不含命令行与外部修改`,turnEditStatsUnknown:`行数未知`,turnEditReason_before_unavailable:`文件已写入,但该操作未授权读取旧内容,无法提供可靠的前后差异。`,turnEditReason_content_limit:`文件已写入,内容超过已保存对比的大小限制,无法提供准确行数。`,turnEditReason_concurrent_change:`文件在已记录的操作之间发生了变化,无法确认本轮净增删行数。`,gitReviewLoadedCount:`已载入 {{count}} 个文件`,gitReviewPartialLabel:`部分`,gitReviewSearch:`搜索文件路径`,gitReviewExpand:`展开审阅`,gitReviewSearchLoaded:`搜索已载入文件`,gitReviewMarkViewed:`标记 {{path}} 为已查看`,gitReviewMarkCurrentViewed:`标记当前文件 {{path}} 为已查看`,gitReviewViewedLabel:`已查看`,gitReviewViewedProgress:`已查看 {{viewed}} / 已加载 {{loaded}} 个文件`,gitReviewViewedLimit:`本次对比最多保留 {{count}} 个已查看标记。`,gitReviewNoMatch:`没有匹配的文件。`,gitReviewNoLoadedMatch:`已载入文件中没有匹配项。`,gitReviewLoadNext:`载入下一批文件`,gitReviewChanged:`工作区已有变化,请刷新清单后继续载入。`,gitReviewNewVersion:`有新的更改,当前仍显示你正在阅读的版本。`,gitReviewShowLatest:`查看最新差异`,gitReviewBinary:`此二进制文件无法显示文本差异。`,gitReviewBinaryShort:`二进制`,gitReviewPendingStats:`待读取`,gitReviewComparison:`{{current}} 对比 {{base}}`,gitReviewWorkingTree:`工作区对比 HEAD`,gitReviewSessionSnapshot:`自本会话开始后的变更`,gitReviewDetached:`游离 HEAD`,gitReviewLoading:`正在读取 Git 变更…`,gitReviewRetry:`重试`,gitReviewRefresh:`刷新变更`,gitReviewOlderResult:`当前显示上一次读取结果。`,gitReviewNotRepository:`此工作区不是 Git 仓库。`,gitReviewUnborn:`此仓库还没有可读取的 HEAD。`,gitReviewFailed:`无法读取 Git 变更。`,gitReviewTruncated:`结果不完整,部分文件或差异未载入。`,gitReviewEmpty:`当前范围内没有文件变更。`,gitReviewHiddenLines:`另有 {{count}} 行 diff 未显示。`,gitReviewDiffTruncated:`快照已达到大小上限,未加载此文件的 diff。`,gitReviewShowMore:`再显示 {{count}} 个文件`,gitReviewBackToFiles:`返回变更文件`,gitReviewFilePreview:`{{file}} 的差异`,gitReviewNoDiff:`此文件没有可显示的文本差异。`,changeDiff:`变更差异`,diffViewMode:`差异视图`,diffUnified:`统一`,diffSplit:`并排`,diffBefore:`修改前`,diffAfter:`修改后`,diffView:`差异`,gitFileStatus_added:`已新增`,gitFileStatus_modified:`已修改`,gitFileStatus_deleted:`已删除`,gitFileStatus_renamed:`已重命名`,gitFileStatus_copied:`已复制`,gitFileStatus_untracked:`未跟踪`,gitFileStatus_unknown:`已变更`,closePreview:`关闭预览`,imageZoom:`图片缩放`,imageZoomHelp:`缩放相对于适应窗口。Ctrl + 滚轮缩放,放大后可拖动查看。`,zoomIn:`放大图片`,zoomOut:`缩小图片`,previousImage:`上一张图片`,nextImage:`下一张图片`,imagePosition:`第 {{current}} 张,共 {{total}} 张图片`,artifactReadOnly:`只读`,artifactReferenceUnavailable:`此视图无法打开文件预览:{{path}}`,artifactSession:`所属会话 {{sessionId}}`,copyFilePath:`复制文件路径`,filePathCopied:`已复制文件路径`,refreshFile:`刷新文件`,downloadFile:`下载文件`,downloadingFile:`正在下载…`,artifactOlderPreview:`当前显示旧版预览。`,readingFile:`正在读取文件…`,artifactVersion:`版本`,artifactBytes:`{{count}} 字节`,artifactPreviewTruncated:`预览已截断;下载文件可获取完整内容。`,artifactUnsupported:`此类型无法预览,请下载文件。`,filesLargeMarkdownSource:`Markdown 预览较大,已显示为源码以保持滚动流畅。已加载的文字全部保留。`,chatView:`对话`,trajectory:`执行轨迹`,trajectoryScope:`按记录顺序展示会话消息,不表示执行耗时,也不是完整模型请求。`,trajectoryRunning:`任务仍在进行。已保存记录到达后自动更新;实时生成内容可在“对话”中查看。`,trajectoryTruncated:`当前历史不完整:省略 {{entries}} 条记录、{{parts}} 个内容片段,{{messages}} 条消息被截断。`,trajectoryEmpty:`尚无已保存记录。`,trajectoryOrder:`记录顺序`,trajectoryOverview:`总览`,trajectorySequenceHint:`按记录顺序排列 · 宽度不表示执行耗时`,trajectoryClearRange:`清除选区`,trajectoryContextLane:`上下文`,trajectoryModelLane:`模型`,trajectoryToolLane:`工具`,trajectorySelectRecord:`选择记录 {{number}}:{{name}}`,trajectoryTimingTab:`时间`,trajectoryUsageTab:`用量`,trajectoryDurationLabel:`耗时`,trajectoryTimingSource:`数据来源`,trajectoryTimingUnknown:`尚未记录执行耗时。保存时间不等于操作开始时间。`,trajectoryTimingNative:`Pi 嵌套工具执行记录`,trajectoryTTFT:`首段输出等待`,trajectoryGenerationTime:`生成时间`,trajectoryThroughput:`每秒输出 tokens`,trajectoryNotRecorded:`未记录`,trajectoryUsageUnknown:`已加载记录中没有此响应的 token 用量。`,trajectoryUsage_input:`未缓存输入`,trajectoryUsage_cacheRead:`缓存读取`,trajectoryUsage_cacheWrite:`缓存写入`,trajectoryUsage_output:`输出`,trajectoryProvider:`提供商`,trajectoryModel:`模型`,trajectoryCode:`代码`,trajectoryWrap:`自动换行`,trajectoryCopy:`复制原文`,trajectoryCopied:`已复制`,trajectoryRawArguments:`原始 JSON`,trajectoryFoldTurns:`回合`,trajectoryFoldCalls:`工具调用`,trajectoryMetrics:`已加载执行摘要`,trajectoryRequestCount:`{{count}} 次模型响应`,trajectoryToolCount:`{{count}} 次工具调用`,trajectoryModelResponses:`模型响应`,trajectoryToolCalls:`工具调用`,trajectoryLastTurn:`最近已记录回合`,trajectoryEventColumn:`事件`,trajectoryContentColumn:`内容`,trajectoryTurn:`回合 {{number}}`,trajectoryLoadHistory:`加载更早历史`,trajectoryLatestRecords:`回到最新记录`,trajectoryHistoryLoading:`正在加载历史…`,trajectoryNestedOutputMissing:`Pi 已记录此嵌套调用的状态,但未保存其结果正文。外层脚本输出单独保留。`,trajectoryRecordCount:`{{count}} 条记录`,trajectoryMatches:`{{count}} 条匹配`,trajectorySearch:`搜索已加载记录`,trajectoryNoMatches:`没有匹配的记录。`,trajectoryEarlierGroup:`较早上下文`,trajectoryEventCount:`{{count}} 条会话变更`,trajectorySummary:`概览`,trajectoryInputTab:`输入`,trajectoryResultTab:`结果`,trajectoryConversationGroup:`本轮对话`,trajectoryReasoningTitle:`思考`,trajectoryRecordNumber:`记录 {{number}}`,trajectoryRecordInfo:`记录信息`,trajectoryRecordId:`记录 ID`,trajectoryCallId:`工具调用 ID`,trajectoryEventType:`事件类型`,trajectoryEvent_model_change:`切换模型`,trajectoryEvent_thinking_level_change:`调整思考级别`,trajectoryEvent_compaction:`压缩上下文`,trajectoryEvent_session_info:`更新会话信息`,trajectoryEvent_custom:`会话记录`,trajectoryEarlier:`显示更早记录(已加载历史中还有 {{count}} 条)`,trajectoryDetails:`记录详情`,trajectoryRecordedAt:`记录时间`,trajectoryEvidenceTruncated:`此证据在会话投影中已被截断。`,trajectoryArguments:`工具参数`,trajectoryRecordedContent:`已记录内容`,trajectoryThinking:`模型返回的推理内容`,trajectoryOutput:`工具结果`,trajectoryMissingResult:`当前记录中没有可明确配对的结果。这不表示工具仍在运行。`,trajectoryStructured:`结构化结果`,trajectoryEventOnly:`当前仅提供此事件的类型和记录时间。`,trajectory_user:`用户消息`,trajectory_assistant:`助手回复`,trajectory_call:`工具调用`,trajectory_result:`未配对结果`,trajectory_event:`会话事件`,trajectoryRole_user:`用户`,trajectoryRole_assistant:`助手`,trajectoryRole_call:`工具`,trajectoryRole_result:`结果`,trajectoryRole_event:`事件`,trajectory_returned:`工具已返回结果。`,trajectory_error:`工具返回错误`,trajectory_unknown:`尚无法确定结果`,runtimeStatus:`运行状态`,runtimeIdentity:`OpenPI 运行信息`,runtimeIdentityHint:`后端信息在启动时采样,不随之后的磁盘改动或会话重新加载更新,也不证明所有模块的加载版本。前端标识对应当前页面构建。`,runtimeIdentityFailed:`无法读取后端运行信息,请重试。`,runtimeBackendVersion:`后端包版本`,runtimePackageRoot:`后端包目录`,runtimeStartedAt:`进程启动时间`,runtimeGitRevision:`启动时 Git 提交`,runtimeGitState:`启动时工作区状态`,runtimeGitDirty:`存在本地改动`,runtimeGitClean:`干净`,runtimeFrontendVersion:`页面包版本`,runtimeFrontendBuild:`页面构建标识`,runtimeStartupBuild:`后端启动时记录的页面构建标识`,runtimeDevelopmentBuild:`开发服务器(无生产构建标识)`,runtimeBuildMismatch:`当前页面构建与后端启动时记录的构建不同。请刷新页面或重启服务后重新检查。`,refreshStatus:`刷新状态`,openTools:`打开工具`,openToolsUnavailable:`选择会话后可打开工具`,sideConversation:`侧边对话`,sideConversationDescription:`在独立 Pi 会话中追问具体问题,不打断当前主任务。`,workbarChangesDescription:`查看当前目录的未暂存、已暂存、分支或会话变更。`,terminal:`终端`,renameTerminal:`重命名终端`,terminalName:`终端名称`,workbarTerminalDescription:`打开当前工作区的交互式终端。`,restartTerminal:`重新启动终端`,reconnectTerminal:`重新连接终端`,restartTerminalTitle:`重新启动此终端?`,restartTerminalDetail:`当前终端会被关闭,其中运行的进程可能被中断。`,terminalReconnecting:`正在重新连接终端...`,terminalScrollToBottom:`回到底部`,terminalOutputResynced:`终端输出已重新同步`,terminalRestarting:`正在重新启动终端...`,terminalConnecting:`正在启动终端…`,terminalExited:`终端已退出。`,terminalExitCode:`终端已退出,状态码 {{code}}。`,terminalDisconnected:`终端连接意外中断。`,terminalError:`终端不可用。`,terminalLoadError:`终端界面加载失败,请刷新页面后重试。`,reloadPage:`刷新页面`,browser:`浏览器`,sessionFileRecords:`本会话文件记录`,gitReviewSource:`变更范围`,gitReviewBaseBranch:`对比分支`,gitReviewChooseBase:`选择对比分支`,gitReviewSearchBranches:`搜索分支`,gitReviewLocalBranch:`本地分支`,gitReviewRemoteBranch:`远程分支`,gitReviewBranchesTruncated:`显示有数量限制的分支列表,部分分支已省略。`,gitReviewNoMatchingBranches:`没有匹配的分支。`,gitReviewBaseUnavailable:`没有可用的默认对比分支。请选择分支以审阅已提交的变更。`,gitReviewBaseInvalid:`所选对比分支已不可用,请选择其他分支。`,gitReviewUnstaged:`未暂存(含未跟踪)`,gitReviewStaged:`已暂存变更`,gitReviewBranch:`分支变更`,gitReviewFileMissing:`此文件在当前范围内已无变更,请刷新文件列表。`,artifactExternalAccess:`此文件位于其他工作目录。可为当前会话授权只读打开这一个文件,不会开放其他文件的访问。`,artifactAuthorizeFile:`只读打开此文件`,sideConversationPending:`正在准备侧边会话…`,resizeSidebar:`调整侧边栏宽度`,resizePanes:`调整面板宽度`,resizeWorkbar:`调整工具栏宽度`,browserPasteTooLarge:`每次最多粘贴 {{count}} 个字符。`,browserInputTooLarge:`每次最多输入 {{count}} 个字符。`,browserInputTargetChanged:`输入目标已变化或无法确认,有输入操作未执行。`,workbarBrowserDescription:`在 OpenPI 工作栏内打开并操作网页。`,browserReady:`输入地址开始浏览`,browserStarting:`正在启动内嵌浏览器…`,browserOpened:`已在内嵌浏览器中打开`,browserOpenAgain:`再次打开`,browserOpenFailed:`内嵌浏览器暂不可用。`,browserBack:`后退`,browserForward:`前进`,browserReload:`重新加载`,browserTabs:`网页标签页`,browserNewTab:`新标签页`,browserAddTab:`新建网页标签页`,browserCloseTab:`关闭 {{title}}`,browserTabLimit:`最多打开 {{count}} 个网页标签页`,browserPageTitle:`网页:{{address}}`,browserEnteredAddress:`最近从此地址栏打开的地址`,browserAddressNotAllowed:`请输入不含用户名或密码、且不属于 OpenPI 自身地址的 HTTP(S) 网址。`,browserLocationUnknown:`网页已跳转,新地址无法读取。重新加载会返回你输入的地址。`,browserDirectDescription:`直接浏览网页。不允许嵌入的网站可在外部浏览器打开。`,browserDirectHint:`地址栏仅记录手动打开的地址。网页弹窗在外部浏览器打开;遇到空白页,可点击外部打开。`,browserEnhancedHint:`浏览增强已开启:地址自动同步,普通弹窗链接在内部标签页打开。部分站点限制、登录弹窗和跨站历史仍需外部浏览器。`,files:`文件`,filesExplorer:`工作区文件`,filesSearch:`筛选文件…`,refreshFiles:`刷新文件`,filesWorkspaceActions:`工作区文件操作`,filesCreateMenu:`新建`,filesImportMenu:`导入`,filesMoreMenu:`更多`,filesNewFile:`新建文件`,filesNewDirectory:`新建文件夹`,filesImport:`导入文件`,filesImportFolder:`导入文件夹`,filesImportFolderChoose:`选择要导入的文件夹`,filesImportFolderLimit:`每次最多导入 2,000 个文件和文件夹,目录层级最多 64 层。`,filesSelectMultiple:`多选文件`,filesSelectItem:`选择 {{name}}`,filesSelectedCount:`已选 {{count}} 项`,filesRename:`重命名`,filesNewName:`新名称`,filesMove:`移动`,filesMoveDestination:`目标文件夹(工作区内相对路径)`,filesTrashAction:`移入回收站`,filesTrash:`工作区回收站`,filesTrashDetail:`移除的文件保留在当前工作区,可恢复;不会覆盖同名文件。`,filesTrashEmpty:`暂无已移除文件`,filesTrashUnavailable:`{{count}} 项记录无法核验,内容仍保留在 .openpi-trash 中,暂不能自动恢复。`,filesRestore:`恢复`,filesRestoreItem:`恢复 {{name}}`,filesUndoTrash:`撤销移除`,filesOrganizationResults:`文件操作结果`,filesOperationDone:`完成`,filesRefreshBeforeOrganizing:`请先刷新文件树,再整理这项文件。`,filesImportChoose:`选择要导入的文件`,filesTargetDirectory:`目标目录`,filesWorkspaceRoot:`工作区根目录`,filesFileName:`文件名称`,filesDirectoryName:`文件夹名称`,filesCreate:`创建`,filesCreating:`创建中…`,filesCreated:`已创建:{{path}}`,filesNameInvalid:`请输入单个文件或文件夹名称,不要包含路径分隔符。`,filesNameExists:`此名称已存在,请更换名称;原有文件已保留。`,filesMutationFailed:`写入失败,输入已保留。`,filesWriteUnavailable:`请先切换到此会话,再修改工作区文件。`,filesImportLimit:`每个文件最多 50 MiB,同名文件不会覆盖。`,filesImportTooLarge:`此文件超过 50 MiB 导入上限。`,filesImportDirectoryUnsupported:`不支持导入整个文件夹,请选择其中的文件。`,filesImportResults:`文件导入结果`,filesImportPending:`等待导入`,filesImporting:`导入中…`,filesImported:`已保存到工作区`,filesImportedNoPreview:`已保存。预览上限为 20 MiB;可复制路径,在对话中引用此文件。`,filesClearImported:`清除已完成的导入`,filesRetryImport:`重试导入`,filesPathActions:`{{name}} 的路径操作`,filesCopyRelativePath:`复制相对路径`,filesCopyAbsolutePath:`复制绝对路径`,filesPathCopied:`已复制路径:{{path}}`,filesReadFailed:`无法读取文件。`,filesRetryRead:`重试读取`,filesErrorDetails:`错误详情`,filesReadFailedDetail:`文件列表未能加载,请检查连接后重试。`,filesReadDenied:`当前会话的工作区暂不可访问,或无法确认目录身份。请确认会话与工作区后重试。`,filesSymlink:`符号链接,文件浏览器不会自动跟随`,filesTruncated:`结果不完整,请缩小搜索范围。`,filesNoMatches:`没有匹配的文件`,filesEmpty:`此文件夹为空`,filesChoose:`选择文件进行预览`,filesChooseDetail:`从右侧浏览工作区文件,在这里直接预览。`,filesHideTree:`收起文件树`,filesShowTree:`显示文件树`,filesPreview:`预览`,filesSource:`查看源代码`,filesEdit:`编辑`,filesMode:`文件视图`,filesEditor:`文件编辑器`,filesSave:`保存文件`,filesSaving:`保存中…`,filesSaved:`已保存`,filesUnsaved:`未保存的修改 · 草稿保留在当前窗口`,filesDiscard:`放弃草稿`,filesDiscardConfirm:`放弃此文件尚未保存的修改?`,filesSaveConflict:`磁盘上的文件已改变,编辑草稿已保留。请刷新查看最新内容,核对修改后再保存。`,filesSaveFailed:`保存失败,编辑草稿已保留。请检查文件后重试。`,filesEditLoadFirst:`请先继续读取完整文件,再编辑。`,filesEditUnavailable:`支持编辑工作区内不超过 1 MiB 的 UTF-8 文本,最多保留 16 份未保存草稿。`,filesOutline:`章节目录`,filesDiskVersion:`查看当前磁盘版本`,filesReconcile:`已核对,保留草稿并基于此版本继续编辑`,filesTable:`表格预览`,filesRow:`行`,filesSheets:`工作表`,filesTableTruncated:`当前仅显示部分表格内容;下载原文件可查看完整内容。`,filesOfficeLayout:`文档内容预览;分页和排版可能与 Office 不同。`,filesSlidesLayout:`幻灯片文字与图片预览;主题、图表和动画可能与 PowerPoint 不同。`,filesPreviousPage:`上一页`,filesNextPage:`下一页`,filesZoomOut:`缩小`,filesZoomIn:`放大`,filesZoomReset:`重置缩放`,filesPdfPage:`第 {{page}} 页`,filesDocumentLimit:`此文档超出预览处理范围,请下载后在本地打开。`,filesPreviewFailed:`无法预览此文件,仍可下载后打开。`,filesDiagram:`Mermaid 图表`,filesDiagramLoadError:`图表预览加载失败,已显示源码。刷新页面后可重试。`,filesExpandDiagram:`放大图表`,filesFitImage:`适应宽度`,filesOriginalImage:`原始尺寸`,filesLoadMore:`加载更多`,filesLoaded:`已加载 {{count}} 项`,filesReadMore:`继续读取`,filesContentChanged:`文件已更新。当前阅读内容已保留,可在准备好后刷新。`,workbarFilesDescription:`浏览工作区文件,在文件树旁直接预览。`,backToSideConversations:`返回侧边对话`,continueSideConversation:`继续追问…`,startSideConversation:`提出一个侧边问题…`,sideConversationModelInherited:`新侧边对话使用主会话的模型与思考等级。`,sideConversationModelFixed:`这是当前侧边对话使用的模型。`,stop:`停止`,start:`开始`,browserAddress:`浏览器地址`,browserGo:`打开地址`,openExternalBrowser:`在外部浏览器打开`,invalidBrowserAddress:`请输入有效的 HTTP 或 HTTPS 地址。`,addImages:`添加图片`,addFiles:`添加文件`,fileAttachments:`文件附件`,previewFileAttachment:`预览文件`,fileAttachmentDescription:`文档、表格、PDF、文本、代码及其他文件`,fileAttachmentCount:`最多可添加 {{count}} 个附件。`,fileAttachmentTooLarge:`文件总大小不能超过 50 MB。`,fileAttachmentReadFailed:`无法读取此文件,请检查格式或是否有密码保护。`,fileAttachmentTextReady:`文本已就绪`,fileAttachmentTextTruncated:`部分文本 · 保留原文件`,fileAttachmentOriginalReady:`原文件已就绪`,fileAttachmentExtractionFailed:`未提取文本 · 原文件保留`,fileAttachmentEncodingUnavailable:`无法读取文本编码,原文件字节已保留。`,fileAttachmentDocumentUnavailable:`无法提取文本。文件可能受密码保护或格式暂不支持,原文件字节已保留。`,fileAttachmentNoText:`发送后,代理可通过工具读取原文件;此文件未提取出文本。`,fileAttachmentPreviewTruncated:`预览显示前 20,000 个字符,发送时会附上全部已提取文本。`,fileAttachmentExtractedContent:`已提取文本`,fileAttachmentPromptLabel:`用户提供的文件:`,fileAttachmentPromptTooLong:`消息和文件引用超过输入限制,请缩短消息或减少附件。`,imageAttachmentDescription:`支持 PNG、JPEG、GIF 或 WebP`,imageAttachments:`图片附件`,imageAttachmentsLoading:`正在准备附件…`,commandOpensPanel:`打开面板`,commandPanelArguments:`此命令用于打开面板,不能携带参数或图片。请移除后重试,或直接使用对应面板。`,commandPanelUnavailable:`未能打开面板,已保留命令。`,commandUnavailable_terminal_only:`需要在 Pi 终端界面中使用。`,commandUnavailable_not_integrated:`此扩展命令尚未接入 Web,请在 Pi 终端中使用。`,artifactImagePreviewFailed:`图片预览失败。请刷新文件重试,或下载后查看。`,artifactFileDetails:`文件信息`,turnElapsedRunning:`正在处理 · {{duration}}`,compactionElapsed:`已等待 {{duration}}`,compactionRunning:`正在压缩上下文`,compactionCompleted:`上下文已自动压缩`,compactionFailed:`上下文压缩失败`,compactionInterrupted:`压缩已中断`,compactionUnchanged:`压缩已结束,未生成新的摘要`,compactionUnavailable:`上下文压缩状态暂不可用`,compactionReconnectHelp:`连接已中断,恢复连接后将核实当前状态。`,compactionDraftHelp:`正在压缩上下文,发送的消息会排队等待。`,turnElapsedFinished:`用时 {{duration}}`,composerAdd:`添加`,composerCommands:`指令`,composerFile:`文件`,composerPlan:`计划`,composerCompact:`压缩`,composerModel:`模型`,composerBack:`返回`,composerPlanDescription:`进入或退出计划模式`,composerCompactDescription:`整理之前的对话,释放上下文空间`,composerModelDescription:`选择本会话使用的模型`,compactionQueueWaiting:`等待压缩完成`,compactionQueueBlocked:`消息已保留,可重试或清空队列。`,clearPromptQueue:`取消排队`,queueUpdateFailed:`未能更新队列,请确认当前会话后重试。`,queueStatusUnconfirmed:`请求已接收,但暂时无法确认最新队列状态。请刷新后再操作。`,turnElapsedOutcome_cancelled:`已停止`,turnElapsedOutcome_failed:`失败`,turnElapsedOutcome_uncertain:`结果待确认`,settingsSetupBusyHint:`Agent 配置需等待当前轮次结束;显示设置可直接调整。`,resetChatContentWidth:`恢复默认聊天宽度`,resetChatFontSize:`恢复默认字体大小`,setupResolveAdmission:`请先返回对话,处理尚未确认的消息,再应用设置。`,removeAttachment:`移除附件`,dropImagesHere:`将文件或图片拖到这里`,imageAttachmentCount:`最多可添加 {{count}} 张图片。`,imageAttachmentTooLarge:`单张图片不能超过 10 MB。`,imageAttachmentTotalTooLarge:`图片总大小不能超过 32 MB。`,imageAttachmentUnsupported:`仅支持有效的 PNG、JPEG、GIF 和 WebP 图片。`,imageAttachmentReadFailed:`无法读取此图片,请重新添加重试;消息内容已保留。`,attachedImage:`已附加图片`,previewAttachment:`预览图片`,closeImagePreview:`关闭图片预览`,imagePreviewFailed:`无法显示这张图片。`,fitImage:`适应窗口`,originalImageSize:`原始尺寸`,imageViewMode:`图片查看`,sessionUsage:`会话 Token 用量`,sessionInputTokens:`输入 Token`,sessionOutputTokens:`输出 Token`,sessionCacheTokens:`缓存 Token`,sessionContextUsage:`上下文占用与窗口大小`,usageContextLabel:`上下文`,usageUnknown:`未知`,usageOpenDetails:`输入 {{input}} · 输出 {{output}} · 上下文 {{percent}} / {{capacity}} · 查看会话用量`,usageContextHelp:`当前分支的估算占用 / 模型上下文容量上限。`,usageSessionTotals:`累计用量`,usageInputLabel:`输入`,usageOutputLabel:`输出`,usageCacheReadLabel:`缓存读取`,usageCacheWriteLabel:`缓存写入`,usageTotalLabel:`总计`,usageWorkspaceLabel:`工作区`,usageSessionId:`会话 ID`,usageTotalsHelp:`本会话累计 Token 用量,包含缓存。`,subagentDetails:`子代理`,sessionOverview:`会话概览`,sessionOverviewChanges:`当前审阅范围的更改`,subagentSummaryRunning:`{{count}} 运行中`,subagentSummaryDone:`{{count}} 完成`,subagentSummaryOther:`{{count}} 其他记录`,subagentNoneYet:`暂无子代理`,subagentOtherGroup:`失败 / 已中断`,subagentShowMore:`再显示 {{count}} 个`,backToSubagents:`返回子代理列表`,subagentActiveGroup:`已开启`,subagentFinishedGroup:`完成`,subagentNoneRunning:`暂无正在运行的子代理。`,subagentNoneFinished:`任务结束后会显示在这里。`,subagentProgress:`子代理:{{running}} 运行中 · {{completed}} 已完成`,subagentSummaryUnknown:`{{count}} 个状态未确认`,subagentTasks:`子代理任务列表`,inspectSubagent:`打开子代理:{{name}}`,subagentState_running:`运行中`,subagentProcessing:`处理中`,subagentState_done:`已完成`,subagentState_error:`失败`,subagentState_interrupted:`已中断`,subagentStarting:`正在启动…`,subagentSpawnFailed:`启动失败`,subagentStateUnavailable:`已启动 · 状态未保留`,subagentSpawnReceipt:`启动回执`,subagentSpawnReceiptHint:`此回执仅确认启动请求,不表示子代理任务已完成。`,subagentTask:`分配的任务`,subagentTranscript:`子代理对话`,subagentResult:`执行结果`,subagentSpend:`累计 token 消耗`,subagentSaved:`已保存记录`,subagentRecordedState:`最后记录的状态`,subagentSavedHint:`来自当前父会话已保存的回执;结果可能包含同批其他任务,并非子代理的完整实时对话。`,subagentReadOnly:`只读查看 · 关闭此面板不会停止任务`,subagentUnavailable:`当前会话已无法提供此子代理的实时详情。启动回执不代表任务已完成。`,subagentStale:`刷新失败,下方保留的是上次收到的状态。`,subagentNoMessages:`暂未收到消息。`,subagentTranscriptUnavailable:`此视图仅保留任务摘要,无法显示完整子代理对话。`,subagentWorkflowsTruncated:`另有 {{count}} 个 workflow 未包含在当前列表中,其任务数量未知。`,subagentState_unknown:`未确认`,subagentUnconfirmedGroup:`未确认`,subagentTruncated:`当前显示最近的消息,另有 {{count}} 条较早消息未包含在此视图中。`,subagentTextTruncated:`部分较长内容仅显示节选。`,subagentListTruncated:`另有 {{count}} 个任务未包含在当前列表中。`,subagentThinkingRedacted:`服务商已隐藏此段思考内容。`,inspectionChanged:`当前会话已切换,请重新打开详情。`,inspectionUnavailable:`暂时无法读取详情。`,inspectionLoading:`正在读取状态…`,thinkingUnavailable:`暂时无法读取思考等级。`,trustUnavailable:`暂时无法读取项目信任状态。`,copySetupCommand:`复制配置命令`,savedTrustDecision:`已保存决定`,activeSessionTrust:`当前会话信任`,trustDecision_trusted:`已信任`,trustDecision_denied:`已拒绝`,trustDecision_undecided:`未决定`,trustDecision_unknown:`未知`,trustActiveYes:`当前会话已信任`,trustActiveNo:`当前会话未信任`,modelAndThinking:`模型与思考`,selectedModel:`当前模型`,thinkingLevel:`思考等级`,availableThinking:`支持的等级`,unknownState:`未知`,projectTrust:`项目信任`,trust_trusted:`当前会话信任此工作区。`,trust_untrusted:`此工作区的信任已被拒绝。`,trust_restricted:`项目资源受到限制,等待信任决定。`,trust_unknown:`尚无法确定信任状态。`,trustRefreshNeeded:`保存的信任决定与当前会话不同,请通过 Pi 刷新会话后生效。`,providerAvailability:`服务商凭据`,settings:`设置`,settingsNavigation:`设置导航`,generalSettings:`常规`,configurationSettings:`配置`,configurationIntro:`配置工具权限、网络访问与模型响应。`,configurationReadFailure:`无法安全读取配置。请修复设置文件后刷新。`,configurationUserScope:`用户配置`,configurationSetupHint:`响应与搜索选项通过 OpenPI setup 应用`,configurationApproval:`批准策略`,configurationApprovalDetail:`工具审批沿用已安装 Pi 扩展的权限机制。`,configurationPiPermissions:`由 Pi 扩展管理`,configurationSandbox:`沙箱设置`,configurationSandboxDetail:`工具使用宿主进程的权限运行。`,configurationSandboxUnavailable:`未提供 OS 沙箱`,configurationSearchDetail:`允许当前会话模型在支持时访问网络。`,configurationSearchOff:`不向当前模型提供原生搜索。`,configurationSearchOn:`在当前连接支持时允许原生搜索。`,configurationVerbosity:`输出详细程度`,configurationVerbosityDetail:`选择模型回复包含细节的详细程度。`,configurationResponsesUnavailable:`当前连接未使用支持的 Responses 接口。`,configurationVerbosity_default:`模型默认`,configurationVerbosity_low:`简短`,configurationVerbosity_medium:`适中`,configurationVerbosity_high:`详细`,configurationVerbosityHelp_low:`简短直接地回答,减少额外细节。`,configurationVerbosityHelp_medium:`给出必要解释与适量细节。`,configurationVerbosityHelp_high:`提供更完整的解释与细节。`,configurationVerbosityRequest:`只把 response_verbosity 设为 {{value}},保留其他 OpenPI 配置。`,configurationSummary:`推理摘要`,configurationSummaryDetail:`选择向支持的推理模型请求哪种摘要。`,configurationSummaryUnavailable:`当前连接不支持推理摘要。`,configurationSummary_default:`模型默认`,configurationSummary_auto:`自动`,configurationSummary_concise:`简洁`,configurationSummary_detailed:`详细`,configurationSummary_none:`关闭`,configurationSummaryHelp_auto:`由模型自动选择摘要长度。`,configurationSummaryHelp_concise:`请求简洁的推理摘要。`,configurationSummaryHelp_detailed:`请求较详细的推理摘要。`,configurationSummaryHelp_none:`不请求推理摘要;保留当前推理强度。`,configurationSummaryRequest:`只把 response_reasoning_summary 设为 {{value}},保留其他 OpenPI 配置。`,configurationModelFeatures:`模型功能`,configurationReasoningLevels:`可用推理强度`,configurationReasoningDetail:`选择在模型控件中显示哪些级别。控件只显示当前模型支持的档位,当前档位始终保留。`,configurationReasoningCount:`已选择 {{count}} 个`,configurationDependencies:`工作空间依赖项`,configurationEnvironment:`本地运行环境`,configurationEnvironmentDetail:`Node.js、Python 等工具由当前环境提供。OpenPI 不安装捆绑的工作空间运行时。`,configurationRuntimeStatus:`运行状态`,browserSettings:`浏览器`,webSearchSettings:`联网搜索`,webSearchCurrentModel:`当前会话模型`,webSearchNativeDetail:`调用当前模型供应商的原生搜索,复用现有连接和凭据。`,webSearchSupported:`当前连接支持原生搜索。开启后,由模型决定何时联网。`,webSearchUnsupported:`当前连接不支持或尚未确认支持原生搜索,不提供搜索工具,也不会切换到其他供应商。`,webSearchNativeRequest:`开启联网搜索,使用当前会话模型的原生搜索和已有 Pi 凭据。不要切换模型、连接协议或搜索供应商;当前连接不支持或支持情况未知时,不提供搜索工具。`,webSearchIntro:`让模型搜索最新资料,并打开原始网页核实。`,webSearchPackageDetail:`通过可选 Pi 插件提供搜索、网页读取和 PDF 提取。`,webSearchDefaultOff:`默认关闭。可选扩展跟随当前会话模型,无需另填搜索密钥或安装插件。`,webSearchLoaded:`本会话已加载插件`,webSearchNotLoaded:`本会话尚未加载插件`,webSearchSource:`查看插件源码`,webSearchProfile:`搜索设置`,webSearchExa:`Exa — 无需 API 密钥`,webSearchExisting:`保留我已有的搜索偏好`,webSearchProfileHint:`Exa 提供搜索,网页由本机直接读取。已有偏好会原样保留;安装后也可更换搜索服务。`,webSearchEnable:`启用联网搜索…`,webSearchDisable:`关闭联网搜索…`,webSearchConfigure:`更换搜索服务…`,webSearchExaRequest:`启用可选联网搜索,使用 Pi Web Access 和无需 API 密钥的 Exa。让我审阅插件安装确认,保留其他偏好,不要自动重新加载。`,webSearchExistingRequest:`启用可选联网搜索,使用 Pi Web Access,原样保留我已有的搜索偏好。让我审阅插件安装确认,保留其他偏好,不要自动重新加载。`,webSearchDisableRequest:`关闭原生联网搜索。保留其他设置和会话记录。`,webSearchProviderRequest:`帮我更换已安装 Pi Web Access 插件的搜索服务。介绍可用服务与权限,保留无关偏好,密钥留在搜索插件中,不要自动重新加载。`,browserSettingsIntro:`让 OpenPI 阅读网页、点击、输入和截图。`,browserControl:`浏览器控制`,browserControlHint:`提交设置变更请求,保存配置后生效。`,browserDefault:`默认浏览器`,browserDefaultHint:`提交设置变更请求,选择未指定浏览器时使用的默认项。`,browserEmbedded:`OpenPI 内置浏览器`,browserAllowedTitle:`允许使用的浏览器`,browserOffHint:`下方选择将在开启浏览器控制后生效。`,browserConnected:`已连接`,browserNeedsSetup:`需要连接浏览器扩展`,browserNotFound:`未检测到此浏览器`,browserUpdateNeeded:`需要更新扩展`,browserBlocked:`未授权`,browserDefaultBlocked:`当前默认浏览器未获授权,请允许使用或更换默认值。`,browserSetUp:`设置`,browserManage:`管理`,browserSetupNamed:`设置 {{browser}}`,browserManageNamed:`管理 {{browser}}`,browserAllowNamed:`允许使用 {{browser}}`,browserMore:`更多浏览器`,browserSpeakHint:`对话中说“使用 Chrome …”,即可指定这次使用的浏览器。`,browserGuideTitle:`连接 {{browser}}`,browserGuideEyebrow:`跟着做,一次一步`,browserConnectionTitle:`连接状态`,browserCloseGuide:`收起浏览器设置引导`,browserConnectionReady:`连接正常,可选择是否允许 OpenPI 使用。`,browserEmbeddedDetail:`网页在 OpenPI 内打开。部分网站需要使用普通浏览器才能登录或正常显示。`,browserExternalDetail:`OpenPI 可以使用已连接的 {{browser}} 配置中的现有标签和登录状态。请在该配置中保留一个 OpenPI 标签页。`,browserManageExtension:`管理扩展`,browserAllowUse:`允许 OpenPI 使用`,browserMakeDefault:`设为默认`,browserInstallIn:`安装到`,browserInstallTitle:`安装 OpenPI Browser Bridge`,browserSetupSteps:`设置步骤`,browserGuidePopout:`在独立窗口中跟随操作`,browserGuideDetached:`引导已在独立窗口打开,可以对照浏览器设置逐步完成。`,browserShowGuide:`显示引导窗口`,browserGuideInline:`把引导放回这里`,browserGuideBlocked:`未能打开引导窗口。可允许弹出式窗口后重试,也可继续查看这里的步骤。`,browserSafariSettings:`Safari → 设置`,browserSafariDeveloper:`开发者设置`,browserSafariTemporary:`添加临时扩展…`,browserSafariOpenHint:`打开 Safari 后,在菜单栏选择「Safari → 设置」,对照此引导操作。需要 macOS 上的 Safari 26 或更新版本。`,browserSafariDeveloperTitle:`显示 Safari 开发者设置`,browserSafariDeveloperHint:`在「设置 → 高级」中开启「显示网页开发者功能」,再进入「开发者」标签。`,browserSafariLoadHint:`在「开发者」中点击「添加临时扩展」,选择下方文件夹。启用 OpenPI Browser Bridge,允许访问要控制的网站及本地 OpenPI 页面。退出 Safari 后需重新加载临时扩展。`,browserFirefoxThis:`此 Firefox`,browserFirefoxTemporary:`临时载入附加组件…`,browserFirefoxDeveloperTitle:`选择「此 Firefox」`,browserFirefoxDeveloperHint:`在 about:debugging 左侧选择「此 Firefox」。Firefox 不需要开启「开发者模式」开关。`,browserFirefoxLoadHint:`点击「临时载入附加组件」,选择下方文件夹中的 manifest.json。此安装在 Firefox 重启后失效;永久安装需要经过 Mozilla 签名的扩展包。`,browserFirefoxDone:`已选中,下一步`,browserStepCount:`第 {{step}} 步,共 {{total}} 步`,browserStepLabel:`第 {{step}} 步:{{label}}`,browserStepOpen:`打开扩展页`,browserStepAdd:`添加扩展`,browserStepConnect:`连接`,browserOpenManagerTitle:`打开 {{browser}} 扩展页`,browserOpenManagerHint:`接下来会打开 {{browser}}。在扩展页完成操作后,回到这里继续。`,browserOpenManager:`打开 {{browser}} 扩展页`,browserReopenManager:`重新打开扩展页`,browserAlreadyInstalled:`已经安装?直接连接`,browserDeveloperMode:`开发者模式`,browserDeveloperTitle:`开启「开发者模式」`,browserDeveloperHint:`在扩展页开启「开发者模式」,页面会出现「{{loadLabel}}」按钮。`,browserDeveloperDone:`已开启,下一步`,browserIllustration:`操作示意 · 在 {{browser}} 中完成`,browserExtensions:`扩展程序`,browserLoadUnpacked:`加载未打包的扩展程序`,browserLoadHint:`扩展已准备在本机,按下面的顺序在 {{browser}} 中载入。`,browserCopyLocation:`复制下面的路径`,browserLocateTarget:`找到本机的扩展文件夹`,browserRevealTarget:`定位扩展文件夹`,browserLocateManifest:`找到扩展中的 manifest.json`,browserRevealManifest:`定位 manifest.json`,browserDragToBrowser:`把文件夹拖到 {{browser}} 扩展页`,browserDragFolderHint:`将文件管理器中的 {{folder}} 整个文件夹拖到扩展页,保持「开发者模式」开启。`,browserSelectLocatedTarget:`在浏览器弹出的选择窗口中,选择上一步定位的项目。`,browserManualInstall:`无法拖入?使用路径选择`,browserManualSelection:`找不到?使用路径选择`,browserLoadInBrowser:`在 {{browser}} 点击「{{loadLabel}}」`,browserLoadAlternate:`部分版本显示为「加载已解压的扩展程序」或 Load unpacked。`,browserConfirmFolder:`选择`,browserConfirmFile:`打开`,browserSelectFolderHint:`选择整个文件夹,不要选择里面的 .js 文件。`,browserSelectManifestHint:`只选择 manifest.json,不要选择 .js 文件。`,browserInstallCheckpoint:`在扩展列表看到 OpenPI Browser Bridge 卡片后,再继续连接。`,browserPathCopied:`已复制路径`,browserCopyFailed:`未能复制,请选中上方路径手动复制。`,browserChooseFolderMac:`按 ⌘ ⇧ G,粘贴刚复制的路径并按回车定位,再点击「{{confirm}}」。`,browserChooseFolderOther:`在选择窗口的地址栏粘贴刚复制的路径并回车,再点击「{{confirm}}」。`,browserInstalledConnect:`已添加,连接 OpenPI`,browserPreviousStep:`上一步`,browserWaiting:`等待 OpenPI Browser Bridge 连接,连接后会自动进入下一步。`,browserInstallBrowserFirst:`请先安装 {{browser}},或在已安装的浏览器中打开当前 OpenPI 地址。`,browserConnectTitle:`连接 OpenPI`,browserConnectHint:`在 {{browser}} 中打开 OpenPI,使用刚安装扩展的浏览器配置。`,browserOpenIn:`在 {{browser}} 中打开`,browserAllowHint:`连接成功后,可以允许 OpenPI 使用此浏览器。安装扩展不会自动开启浏览器控制。`,browserCheck:`检查连接`,browserNotConnectedYet:`还未连接。请完成安装,在该浏览器中刷新 OpenPI 后再次检查。`,browserHelp:`设置帮助`,browserReloadHint:`已安装旧版?在扩展页重新加载 OpenPI Browser Bridge,再刷新 OpenPI。如浏览器提示权限,请完成其原生确认。`,browserSupportedHint:`Chrome、Edge、Brave、Chromium 145+ 可控制内置页面及普通标签。macOS Safari 26+、Firefox 128+ 通过兼容扩展控制普通标签,嵌套框架需单独打开。Safari、Firefox 的临时安装需在浏览器重启后重新加载。`,browserCopyPath:`复制路径`,browserOpening:`正在打开浏览器…`,browserLoading:`正在检查浏览器连接…`,browserSaved:`已保存,浏览器权限立即生效。`,browserSaving:`正在处理…`,modelSettings:`模型`,skillsSettings:`技能`,subagentsSettings:`子代理`,pluginsSettings:`插件`,configureOpenPi:`配置 OpenPI`,setupRequestReviewAll:`和我一起检查全部 OpenPI 配置项`,setupRequestSetTheme:`仅将 OpenPI Web 主题设置为 {{value}},其他配置保持不变`,setupRequestSetChatWidth:`仅将 OpenPI Web 聊天内容宽度设置为 {{value}}px,其他配置保持不变`,setupRequestSetChatFontSize:`仅将 OpenPI Web 聊天字体大小设置为 {{value}}px,其他配置保持不变`,setupRequestEnableExpandedThinking:`仅将 OpenPI Web 的思考块改为默认展开,其他配置保持不变`,setupRequestDisableExpandedThinking:`仅将 OpenPI Web 的思考块改为默认折叠,其他配置保持不变`,setupRequestSubagents:`检查并配置 Agent 角色模型和工作流上限`,setupRequestFailed:`OpenPI 配置请求未被接收。`,setupRequestRunning:`正在应用 OpenPI 设置…`,setupRequestAccepted:`配置请求已接收。`,setupPlanBlocked:`Agent 配置需先退出 Plan 模式;显示设置可直接调整。退出不会开始实施计划。`,setupPlanBusy:`Agent 配置需等待当前回合结束并退出 Plan 模式;显示设置可直接调整。`,setupOutcome_pending:`配置请求正在处理,尚未收到保存回执。`,toolCallArguments:`工具参数`,toolCallOutput:`工具结果`,setupOutcome_saved:`OpenPI 配置已保存并应用。`,setupOutcome_unchanged:`配置已保存,实际设置没有变化。`,setupOutcome_failed:`配置请求失败,请查看错误和当前设置后再重试。`,setupOutcome_cancelled:`配置过程已取消,未确认成功保存。`,setupOutcome_unconfirmed:`本次未确认成功保存,请核对当前设置后再运行 /openpi-setup。`,settingsUpdateFailed:`无法保存 Web 显示设置。`,settingsPreferencesSaved:`偏好设置已保存。`,settingsPreferencesSaveFailed:`无法保存显示设置,请检查配置诊断后重试。`,settingsCatalogLoading:`正在加载 Pi 资源…`,settingsCatalogFailed:`无法加载 Pi 设置资源。`,appearance:`外观`,settingsPersonal:`个人`,settingsAgent:`Agent`,settingsIntegrations:`集成`,settingsArchivedChats:`已归档聊天`,settingsSearch:`搜索设置`,settingsClearSearch:`清除搜索`,settingsNoResults:`没有匹配的设置`,appearanceVisualStyle:`视觉风格`,appearanceMode:`模式`,appearanceTheme:`主题`,appearanceAccent:`强调色`,appearanceBackground:`背景`,appearanceForeground:`前景`,appearanceFont:`字体`,appearanceFont_codex:`Codex 默认`,appearanceFont_sans:`无衬线`,appearanceFont_serif:`衬线`,appearanceFont_mono:`等宽`,appearanceAccent0:`默认`,appearanceAccent1:`蓝色`,appearanceAccent2:`紫色`,appearanceAccent3:`粉色`,appearanceAccent4:`橙色`,appearanceAccent5:`绿色`,appearanceCustomAccent:`自定义强调色`,appearanceAdvanced:`高级`,appearanceReset:`恢复默认设置`,appearanceResetAction:`重置外观`,appearanceImport:`导入主题`,appearanceCopy:`复制主题`,appearanceCopied:`主题已复制`,appearanceCopyFailed:`无法复制主题,请重试。`,appearanceThemeValue:`主题数据`,appearanceImportPlaceholder:`粘贴 OpenPI 主题…`,appearanceImportInvalid:`请输入有效的 OpenPI 主题数据。`,appearanceImportAction:`导入`,searchArchivedChats:`搜索已归档聊天`,archiveProjectFilter:`按项目筛选`,archiveAllProjects:`所有项目`,archiveProjectGroup:`{{project}} · {{count}} 条归档聊天`,archiveSort:`归档聊天排序`,archiveSortUpdated:`最近更新`,archiveSortCreated:`创建时间`,restoreArchivedChat:`恢复 {{title}}`,themeLight:`浅色`,themeDark:`深色`,themeMist:`雾青`,themeRose:`蔷薇`,themePine:`松夜`,themeSystem:`跟随系统`,conversationSettings:`对话`,expandThinkingByDefault:`默认展开思考块`,chatContentWidth:`聊天内容宽度`,chatFontSize:`聊天字体大小`,agentBehavior:`Agent 行为`,workflowLimits:`工作流上限`,workflowConcurrency:`工作流并行上限`,workflowCalls:`总调用次数`,agentSettingsSetupHint:`Agent 设置通过当前会话中的 /openpi-setup 生效。`,setupRequestLimits:`将工作流并行上限设置为 {{concurrency}},总子代理调用上限设置为 {{calls}},保留其他配置。`,setupRequestEnableSuggestions:`启用下一步建议。如需模型配置,请帮助我选择模型,保留其他配置。`,setupRequestDisableSuggestions:`关闭下一步建议,保留其他配置。`,setupRequestPostEdit:`帮我配置或关闭编辑后命令。先展示当前配置,再询问要使用的命令。`,configurePostEdit:`配置编辑后命令`,workflowLimitsValue:`并行 {{concurrency}} · 总调用 {{calls}}`,nextActionSuggestions:`下一步建议`,nextActionSuggestionsDetail:`当前任务结束后,提供几个可选择的下一步操作。`,enabled:`已启用`,disabled:`已关闭`,configured:`已配置`,postEditCommand:`编辑后命令`,postEditCommandDetail:`编辑完成后运行一个命令;关闭时不会执行任何命令。`,resultDisplay:`默认结果显示`,subagentResults:`子代理结果`,bashOperations:`Bash 操作`,fileMutations:`Write / Edit 操作`,footer:`页脚`,terminalFooter:`Pi 终端页脚`,terminalFooterStyle:`终端页脚样式`,terminalFooterHint:`影响 Pi 命令行界面的页脚;已打开的 Pi 界面在下次启动或配置应用后更新。`,detailDisplay_full:`完整`,detailDisplay_compact:`紧凑`,sessionSettings:`会话`,currentModel:`当前`,providerCurrentSessionModel:`当前会话使用 {{model}}。`,useThisModel:`使用此模型`,model:`模型`,modelConnection:`模型连接`,provider:`服务商`,modelId:`模型 ID`,providerStatusUnavailable:`此服务商不在当前有界认证快照中。`,providerSettings:`服务商凭据`,providerSettingsIntro:`查看当前 Web 会话可通过哪些 Pi 服务商完成认证。`,openRuntimeDetails:`打开运行详情`,currentWorkspace:`当前工作区`,providerAuth_api_key:`API 密钥`,providerAuth_oauth:`OAuth`,providerAuthUnknown:`未报告认证方式`,authentication:`认证方式`,accessType:`访问方式`,providerAccessSubscription:`订阅账户`,providerAccessStandard:`服务商凭据`,configurationOwner:`配置归属`,providerLoading:`正在加载服务商状态…`,providerLoadFailed:`无法加载服务商状态。`,providerReadOnly:`由 Pi 管理`,selectProvider:`选择服务商`,gitReviewBaselineUnavailable:`未保留可用的会话基线,可能超出了捕获限额。请切换到未暂存、已暂存或分支查看 Git 变更,也可打开本会话文件记录。`,modelsIntro:`登录账户或添加 API 密钥。已有的 Pi 连接也会显示在这里。`,modelConnectionsTitle:`模型连接`,modelConnectionsIntro:`管理连接凭据,选择新会话和当前会话使用的模型。`,accountLoginMethod:`连接方式`,accountLoginTab:`账户登录`,accountLoginChatGPT:`ChatGPT 账户`,accountLoginClaude:`Claude 账户`,accountLoginKeyTab:`API 密钥`,accountLoginConfigured:`账户已登录`,accountLoginIntro:`在浏览器中完成授权,无需填写 API 密钥。`,accountLoginExisting:`账户凭据已保存在 Pi 中。`,accountLoginStart:`登录`,accountLoginAgain:`重新登录`,accountLoginUnsaved:`请先保存或放弃其他修改,再登录账户。`,accountLoginStarting:`正在准备登录…`,accountLoginWaiting:`等待账户授权`,accountLoginChoose:`选择登录方式`,accountLoginCancelling:`正在取消登录…`,accountLoginBrowser:`在浏览器中继续`,accountLoginDevice:`使用设备码登录`,accountLoginBrowserOption:`在当前电脑上登录,完成后自动返回。`,accountLoginDeviceOption:`适合远程服务器,或无法自动返回的情况。`,accountLoginBrowserHelp:`打开登录页并完成授权,这里会自动更新。`,accountLoginDeviceHelp:`打开授权页并输入下方代码,请保持此页面打开。`,accountLoginOpen:`打开登录页`,accountLoginCopyCode:`复制设备码`,accountLoginPaste:`授权码或回调地址`,accountLoginContinue:`继续`,accountLoginFallback:`已登录,但这里没有更新?`,accountLoginRemoteHelp:`如果无法自动返回,请复制浏览器最后的回调地址,并粘贴到下方。`,accountLoginCancel:`取消登录`,accountLogin_failed:`登录未完成,请重试或选择其他登录方式。`,accountLogin_expired:`登录已过期,请重新开始获取新的授权链接。`,accountLogin_cancelled:`已取消登录。`,accountLoginRequestFailed:`请求未完成,请先刷新状态再重试。`,accountLoginStatusUnknown:`暂时无法查询登录状态,账户授权可能仍在进行。`,accountLoginRefreshRequired:`凭据已保存,但 Pi 未能更新模型列表。请重载 Pi 后使用此连接。`,accountLogout:`退出登录`,accountLogoutRefreshRequired:`已移除保存的凭据,但 Pi 未能更新模型列表。请重载 Pi 刷新状态。`,accountLogoutTitle:`退出 {{provider}}?`,accountLogoutDetail:`将移除此电脑上 Pi 保存的该服务凭据,其他使用它的 Pi 会话也需要重新登录。环境凭据不受影响。`,providerInputTypes:`输入类型`,providerInputText:`文本`,providerInputImage:`图片`,providerCustomTag:`自定义`,providerEdit:`编辑`,providerRemove:`删除`,providerSave:`保存`,editProvider:`编辑 {{provider}}`,removeProvider:`删除 {{provider}}`,providerAdd:`添加模型提供商`,providerAddMode:`添加方式`,providerAddCatalog:`第三方模型提供商`,providerAddCustom:`自定义模型 API`,providerAccountHint:`使用已有账户连接模型,选择服务商后前往浏览器授权。`,providerCatalogHint:`从内置目录中选择提供商,填入其 API 密钥即可使用。`,providerCustomHint:`连接中转站、自部署服务或其他兼容 OpenAI / Anthropic 协议的接口,需填写 API 地址、协议和模型。`,providerKeyKeep:`已配置密钥,留空保持不变`,providerKeyOptional:`输入 API 密钥,或留空使用环境认证`,providerDisplayName:`提供商名称`,providerCustomSettings:`自定义设置`,providerSaved:`已保存 {{provider}}。`,modelDefaultTitle:`新会话默认模型`,modelDefaultChoose:`选择模型`,modelDefaultBadge:`默认`,modelCurrentBadge:`当前使用`,modelDefaultNotSet:`未设置 · 新会话启动时由 Pi 选择`,modelDefaultHint:`选择以后新会话使用的模型,已有会话保留自己的选择。此设置也会更新 Pi 的默认模型。`,modelDefaultReadFailed:`暂时无法读取默认模型。`,modelDefaultProjectOverride:`此工作区有 Pi 独立设置:{{model}}。`,modelDefaultSave:`保存默认模型`,modelMakeDefault:`同时设为新会话默认模型`,modelDefaultSaveFailed:`默认模型保存尚未确认,请刷新状态后重试。`,modelDefaultPartial:`当前模型已切换,但默认模型保存尚未确认,请刷新状态后再试。`,modelConnectionNextHint:`从此连接选择一个模型,用于当前会话。`,modelConnectionSearch:`搜索模型…`,modelConnectionChooseProvider:`选择 {{provider}} 的模型`,modelConnectionUse:`用于当前会话`,modelConnectionUseFailed:`模型切换尚未确认,请刷新模型列表后重试。`,modelConnectionLoadFailed:`暂时无法读取模型列表。`,modelConnectionNoModels:`暂无可选模型,请检查连接或添加模型定义。`,modelConnectionNoMatch:`没有匹配的模型。`,modelConnectionMore:`还有 {{count}} 个模型,可搜索缩小范围。`,providerModelsEmpty:`还没有模型,获取可用模型或手动添加。`,providerModelsInherited:`使用提供商的内置模型目录。`,providerModelsReadOnly:`此提供商包含当前页面未支持的模型设置,请在 Pi 配置文件中编辑。`,providerModelId:`模型 {{number}} ID`,providerModelName:`模型 {{number}} 名称`,providerModelDetails:`模型参数:{{model}}`,providerRemoveModel:`删除模型:{{model}}`,providerIdInvalid:`请使用未被占用的提供商 ID,仅包含字母、数字、连字符、点或下划线。`,providerNativeAuth:`此提供商使用 Pi 原生登录。`,providerConfigurationFailed:`保存失败,请检查填写内容,并在会话空闲时重试。`,providerProfileSavedKeyFailed:`提供商配置已保存,但密钥保存失败。重试将只保存密钥。`,providerReload:`放弃草稿并重新加载`,providerCurrentRemoval:`请先切换当前使用的模型,再删除。`,providerRemoveDetail:`删除此提供商的配置和自定义模型?由 Pi 管理的凭据将保留。`,providerPickerIntro:`以下是模型提供商的可用模型,勾选要添加的模型。`,providerPickerSelected:`已选 {{count}} 个`,providerApiKey:`API 密钥`,providerKeyPlaceholder:`粘贴密钥以添加或替换`,saveProviderKey:`保存密钥`,savingSettings:`正在保存…`,keepEditing:`继续编辑`,discardAndContinue:`放弃更改并继续`,unsavedSettingsTitle:`放弃未保存的更改?`,unsavedSettingsDetail:`未保存的模型和凭据修改将被丢弃。`,unsavedCredentialTitle:`放弃未保存的凭据?`,unsavedCredentialDetail:`新密钥尚未保存,继续后将清空。`,modelSelectionBusy:`当前会话忙碌,暂不能切换模型。`,providerKeySaved:`已保存到 Pi 凭据存储。已有密钥不会回显。`,providerSaveFailed:`密钥保存未完成。请等待会话空闲,刷新状态后重试;部分服务商需要额外认证信息。`,providerWriteDetail:`在这里直接保存到 Pi 凭据存储,密钥不会进入模型对话。OAuth 或需要额外字段的认证请使用 Pi 原生登录。`,editModelConfiguration:`添加或编辑自定义模型`,modelConfigurationDetail:`先设置提供商连接,再获取模型列表或手动添加。保存配置不会调用模型。`,configuredModels:`自定义模型配置`,addModel:`添加模型`,modelConfig_provider:`服务商 ID`,modelConfig_id:`模型 ID`,modelConfig_name:`显示名称`,modelConfig_baseUrl:`API 地址`,modelConfig_api:`API 格式`,modelConfig_contextWindow:`上下文窗口`,modelConfig_maxTokens:`最大输出 token 数`,providerCapacityLabel:`{{field}} {{number}}`,providerModelOptions:`模型选项`,providerModelInvalid:`模型 {{number}}:模型 ID 不能为空或重复;容量需为正数,例如 128K 或 1M,留空使用默认值。`,modelConfig_reasoning:`支持推理`,saveModelConfiguration:`保存模型`,reloadModelConfiguration:`放弃草稿并载入最新配置`,retryModelConfiguration:`重试读取`,discardModelDraftTitle:`放弃这份模型草稿?`,discardModelDraftDetail:`最新配置将替换这份未保存的草稿。`,discardAndReload:`放弃并重新载入`,modelConfigurationUnsaved:`未保存的更改`,modelConfigurationConflict:`模型配置已在别处更改,当前草稿已保留。`,modelConfigurationLoadFailed:`无法读取模型配置,草稿已保留。`,modelConfigurationSaved:`已保存到 Pi models.json。配置服务商密钥后即可选择此模型。`,modelConfigurationFailed:`模型保存未完成,草稿已保留。`,setupConfigurationRequest:`配置需求`,configureViaSetup:`通过 OpenPI setup 应用`,setupFormDetail:`统一走 /openpi-setup。请在对话中查看进度及必要的确认;提交成功不等于配置已保存。`,setupSkillsPlaceholder:`填写要添加或调整的技能,以及来源或本地路径`,setupPluginsPlaceholder:`填写要配置的 Pi 插件,以及准确的包名或本地路径`,enableSkillInvocation:`允许模型调用`,disableSkillInvocation:`改为仅显式调用`,setupSkillInvocationRequest:`配置这个 Pi 技能:{{path}}。将原生 disable-model-invocation 字段设为 {{disabled}},保留其余内容,并说明何时生效。`,setupRoleFormRequest:`将 OpenPI 的 {{role}} 角色配置为使用 {{model}},工作流并发设为 {{concurrency}}。推理级别继承父会话,校验选择有效性,并保留其他配置。`,providerReadOnlyDetail:`此页面只读且不会接收凭据内容。请通过 Pi 配置服务商认证,然后刷新此状态。`,openProviderSettings:`打开服务商设置`,credentialConfigured:`已配置`,credentialMissing:`未配置`,authNotVerified:`凭据已配置不代表模型请求一定成功。`,configurationViaPi:`此处为只读状态。模型凭据与信任由 Pi 管理,OpenPI 选项通过 /openpi-setup 配置。`,noSkillsFound:`当前会话没有加载技能。`,addSkill:`添加技能`,addPlugin:`添加插件`,searchResources:`搜索名称或来源`,filterResourceScope:`资源范围`,allResourceScopes:`全部范围`,noMatchingResources:`没有匹配的资源`,resourceBulkTooLarge:`请进一步筛选列表后,再提交批量配置请求。`,resourceManagement:`Pi 资源`,resourceSourceAuto:`Pi 自动发现`,resourceSourceLocal:`本地资源`,resourcePackageSource:`软件包、仓库或本地路径`,resourcePackageSourcePlaceholder:`npm:包名@版本 · git:owner/repo · /path/to/skill`,resourceInstallIntro:`选择来源和范围,在对话中通过 OpenPI setup 审查并应用。`,resourceInstallReview:`请在对话中确认准确来源和权限。提交请求不代表已安装或已加载。`,resourceRequestSubmitted:`请求已提交。请在对话中查看进度和确认,完成后刷新此目录。`,browseSkills:`浏览 skills.sh 技能`,resourceSessionState:`应用到当前会话`,resourcesReloadNote:`刷新只读取目录;重新加载才会将已保存的资源应用到空闲会话。配置变更不会自动重新加载。`,reloadResources:`重新加载资源`,resourceReloadReview:`将已保存的 Pi 技能与插件配置应用到当前会话,并重新启动扩展?请先等待运行中的工作结束。`,resourceReloaded:`资源已重新加载,请查看更新后的目录和诊断。`,resourceReloadFailed:`无法重新加载资源。请等待当前会话空闲,刷新后重试。`,advancedResourceConfiguration:`高级配置`,resourceDiagnostics:`Pi 报告了 {{extensionErrors}} 项扩展诊断与 {{skillErrors}} 项技能诊断。`,resourceConfigurationDiagnostics:`{{count}} 项设置读取失败,请检查 Pi 配置诊断。`,resourceCatalogTruncated:`此目录有数量上限,部分资源未展示。`,resourceTargetTruncated:`此来源或路径已截断,请通过高级配置确认完整目标后再进行管理。`,updateResource:`检查更新`,removeResource:`审查移除`,skillsEmptyTitle:`添加你的第一个技能`,skillsEmptyIntro:`技能为 Pi 提供可复用的指引。可以添加软件包、仓库或本地技能;项目技能遵循 Pi 的项目信任。`,pluginsEmptyTitle:`用插件扩展 Pi`,pluginsEmptyIntro:`软件包可以包含扩展、技能、提示词和主题。添加来源后,通过 OpenPI setup 审查安装。`,pluginCount:`{{count}} 个插件来源`,installedVersion:`已安装版本`,configuredVersion:`配置版本`,resourceVersionUnpinned:`未固定版本 / 本地来源`,pluginState_loaded:`本会话资源已加载`,pluginState_installed:`已安装 · 未加载`,pluginState_disabled:`配置已禁用`,pluginState_missing:`软件包缺失`,pluginState_error:`加载诊断`,pluginState_notLoaded:`未加载`,pluginLoadedResources:`当前会话目录包含 {{count}} 项资源。配置变更需要明确重新加载后才会应用。`,pluginAction_enable:`审查启用`,pluginAction_disable:`审查禁用`,pluginAction_update:`检查更新`,pluginAction_remove:`审查移除`,enableVisibleSkills:`允许模型使用(当前 {{count}} 项)`,disableVisibleSkills:`仅显式调用(当前 {{count}} 项)`,enableVisiblePlugins:`启用当前 {{count}} 个软件包`,disableVisiblePlugins:`禁用当前 {{count}} 个软件包`,setupResourceInstallRequest:`添加 Pi {{kind}},来源为 {{source}},范围为 {{scope}}。先检查来源并确定固定的软件包身份,通过 ask_user 与我确认安装权限,再使用 Pi 原生的软件包或技能配置。添加技能时保留其他扩展和资源。保留现有偏好与项目信任,不要自动重新加载当前会话。分别报告已保存的配置与仍需执行的操作,不要改动无关的 OpenPI 设置。`,setupPluginOperationRequest:`审查 Pi 软件包操作 {{action}},只针对配置来源 {{source}}、原生安装目录 {{path}}、范围 {{scope}}。相对来源应以该范围的原生设置目录解析。使用 Pi 原生包管理;更新时检查可用版本,通过 ask_user 与我确认固定的目标身份和安装权限。保留资源过滤器及所有无关偏好;如果切换会破坏过滤器,停止并说明。移除时不得删除本地来源目录。不要自动重新加载,分别报告已持久化与当前会话状态,不要改动无关的 OpenPI 设置。`,setupSkillManageRequest:`审查 Pi 技能操作 {{action}},只针对文件 {{path}}、来源 {{source}}、范围 {{scope}}。先检查原生资源归属,通过 ask_user 与我确认更新或移除及所需权限。保留无关技能与软件包资源,不要为了移除一个技能删除整个共享软件包。保留项目信任,不要自动重新加载,也不要改动无关的 OpenPI 设置。`,setupSkillsBulkRequest:`只针对当前展示的 Pi 技能文件 {{paths}},将原生 disable-model-invocation 设为 {{disabled}}。检查资源归属,保留其余内容和偏好,与我审查必要变更,报告无法安全修改的文件。显式 /skill 调用仍应可用。不要自动重新加载,也不要改动无关的 OpenPI 设置。`,setupPluginsBulkRequest:`只针对当前展示的 Pi 软件包 {{packages}},通过 Pi 原生配置将 disabled 设为 {{disabled}}。保留其他偏好与资源过滤器;无法保留过滤器的条目应跳过并报告。遵循范围与项目信任,与我审查必要变更,不要自动重新加载,也不要改动无关的 OpenPI 设置。`,resourceRequestFinished:`配置回合已结束。请刷新并查看 Pi 原生配置与会话资源,确认实际变更。`,skillCount_one:`{{count}} 个技能`,skillCount_other:`{{count}} 个技能`,skill:`技能`,copySkillInvocation:`复制调用命令`,source:`来源`,scope:`范围`,invocation:`调用方式`,modelInvocation:`模型调用`,resourceScope_user:`全局`,resourceScope_project:`项目`,resourceScope_temporary:`临时`,explicitOnly:`仅允许明确调用`,availableToModel:`模型可按需使用`,skillFile:`技能文件`,selectSkill:`选择一个技能`,subagentConfiguration:`Pi 原生子代理角色`,subagentConfigurationIntro:`未在 OpenPI 配置中指定模型时,角色继承父会话模型。`,subagentActiveCount_one:`{{count}} 个运行中`,subagentActiveCount_other:`{{count}} 个运行中`,subagentCompletedCount_one:`{{count}} 条记录`,subagentCompletedCount_other:`{{count}} 条记录`,subagentConcurrency:`上限 {{count}}`,builtInRoles:`内置角色`,subagentRole_explorer:`探索者`,subagentRole_implementer:`实现者`,subagentRole_reviewer:`审查者`,subagentRole_advisor:`顾问`,subagentRoleShort_explorer:`只读调查`,subagentRoleShort_implementer:`聚焦实现`,subagentRoleShort_reviewer:`正确性审查`,subagentRoleShort_advisor:`技术分析`,subagentRoleDescription_explorer:`调查代码库并报告证据,不修改文件。`,subagentRoleDescription_implementer:`实现边界明确的改动并运行相关仓库检查。`,subagentRoleDescription_reviewer:`审查正确性、安全性、回归风险和缺失验证。`,subagentRoleDescription_advisor:`分析困难技术问题并提出具体下一步建议。`,configureRoles:`配置角色`,builtInRole:`内置角色`,builtIn:`内置`,modelAssignment:`模型分配`,inheritParentModel:`继承父会话模型`,effectiveModel:`实际模型`,workflowConcurrencyLabel:`并行 Agent`,workflowCallLimit:`Agent 总调用数`,runtimeBoundaries:`运行时边界`,subagentAuthorityNote:`子会话权限是父会话与角色能力的故障关闭交集,不会静默扩大权限。`,subagentModelNote:`不会硬编码服务商;未分配的角色继承父会话模型和思考等级。`,resourceCount_one:`{{count}} 项资源`,resourceCount_other:`{{count}} 项资源`,noPluginsFound:`Pi 未报告已加载的插件来源。`,pluginCatalogTotals:`{{extensions}} 扩展 · {{skills}} 技能 · {{prompts}} 提示词 · {{themes}} 主题`,loaded:`已加载`,resourceOrigin:`来源类型`,resourceOrigin_package:`软件包`,resourceOrigin_topLevel:`顶层资源`,resources:`资源`,baseDirectory:`基础目录`,notReported:`未报告`,extensions:`扩展`,extensionSurfaceCount:`{{tools}} 个工具 · {{commands}} 个命令`,prompts:`提示词`,themes:`主题`,pluginResourceSummary:`{{extensions}} 扩展 · {{skills}} 技能 · {{prompts}} 提示词 · {{themes}} 主题`,pluginsManagedByPi:`这些资源由 Pi 加载。可通过上方 setup 表单提交变更;软件包操作沿用原生确认,并通过 Pi 的重新加载流程生效。`,selectPlugin:`选择一个插件来源`,statusCaptured:`采集于 {{time}} · 刷新查看最新状态`,conversationViews:`会话视图`,currentConversations:`当前`,archivedConversations:`已归档`,refreshArchives:`刷新归档会话`,loadingArchives:`正在加载归档会话...`,moreArchives:`加载更多归档会话`,retryArchives:`重试读取归档会话`,archiveLoadFailed:`无法加载归档会话。`,archiveCursorStale:`归档会话已变化,请刷新后继续。`,archiveScanBounded:`还有 {{count}} 条更早记录未扫描。`,noArchivedSessions:`没有归档会话。`,noScannedArchives:`已扫描历史中没有归档会话。`,noMatchingScannedArchives:`已扫描历史中没有匹配的归档会话。`,draftLimit:`草稿暂存已满,请先发送或清空已有草稿。`,restoreConversation:`恢复会话`,restoringConversation:`正在恢复…`,loadedArchives:`已加载历史中的归档会话`,loadedHistoryBounded:`另有 {{sessions}} 个会话和 {{workspaces}} 个工作区摘要未加载。搜索仅覆盖已加载列表。`,noLoadedArchives:`已加载列表中没有归档会话。`,restoreFailed:`暂时无法确认恢复结果,请刷新后重试。`,execution_running:`运行中`,execution_done:`已完成`,execution_killed:`已停止`,execution_timed_out:`已超时`,execution_failed:`失败`,execution_uncertain:`状态不确定`,activeOnlyHint:`只有当前 Web 会话可以接收消息。`,stopTurn:`停止当前轮次`,stoppingTurn:`正在停止当前轮次…`,stoppedTurn:`当前轮次已停止。`,pendingFollowUpsHint:`{{count}} 条消息正在排队`,sendNextTurn:`下一轮发送`,followUpBehavior:`跟进处理方式`,followUpBehaviorDetail:`OpenPI 运行时,将后续消息排队到下一轮,或引导当前轮次。按 ⌘/Ctrl+Enter 可仅对这条消息使用另一种方式。`,followUpQueue:`排队`,followUpQueueDetail:`下一轮发送`,followUpSteer:`引导`,followUpSteerDetail:`加入当前轮次`,steerCurrentTurn:`当前执行纠偏`,steeringHint:`在当前工具步骤结束后加入这条指示。`,pendingSteeringHint:`已接收 {{count}} 条纠偏指示,等待当前工具步骤结束`,steeringMessagesTitle:`当前轮次待处理的纠偏指示`,steerStaleTurn:`目标轮次已结束或变化。草稿已保留,请确认更新后的状态并重新发送。`,sourceFeedbackNew:`{{path}} · 新版本第 {{line}} 行`,sourceFeedbackOld:`{{path}} · 旧版本第 {{line}} 行`,forkMessage:`从此处分叉`,forkMessageHint:`从此消息创建新聊天,保留原聊天;不会自动发送消息。`,forkSessionPending:`正在创建分叉会话…`,forkSessionCreated:`已创建分叉会话,原会话保留在侧栏。`,forkSessionCancelled:`分叉已取消,原会话已保留。`,forkSessionUncertain:`无法确认分叉结果。请先刷新并检查会话列表,再决定是否重试。`,forkSessionUnavailable:`切换到此会话并等待当前执行和排队消息结束后,可以从这里创建新会话。`,reviewQuoteLine:`引用此行`,reviewSelectOldLine:`选择旧版本第 {{line}} 行`,reviewSelectNewLine:`选择新版本第 {{line}} 行`,queuedMore:`还有 {{count}} 条排队消息`,queuedImage:`图片附件`,queuedMessageExpand:`展开排队消息`,queuedMessageCollapse:`收起排队消息`,backgroundSessionRunning:`此会话正在后台运行…`,observedSessionTools:`{{count}} 个正在执行的工具`,toolsRequireCurrentSession:`切换到此会话后可使用交互工具。`,activateViewedSession:`切换到此会话`,activateViewedSessionHint:`发送消息即可继续此会话。`,acceptedHint:`OpenPI Web 已接收消息。`,promptAdmissionUnknown:`无法确认上次发送的消息是否已被接收。`,promptAdmissionUnknownDetail:`请先核对已刷新的会话历史和运行状态,再决定下一步。作为新消息发送可能产生重复消息。`,promptAdmissionCheckingDetail:`正在核对最新的会话历史和运行状态,核对完成前不能作为新消息发送。`,promptAdmissionVerificationFailedDetail:`暂时无法刷新最新的会话历史和运行状态。请重新核对后再决定是否作为新消息发送。`,abandonAdmission:`暂不重新发送`,retryAdmissionCheck:`重新核对`,retryOriginalAdmission:`重试原消息`,promptTooLong:`文本超出发送上限({{count}} / {{limit}})。`,sendAsNew:`作为新消息发送`,sendingAsNew:`正在发送…`,addWorkspace:`添加工作区`,addWorkspaceMenu:`添加工作区...`,archiveConversation:`归档会话`,pinnedConversations:`置顶`,sidebarOptions:`侧栏选项`,sidebarProjectOptions:`项目侧栏选项`,sidebarRecentOptions:`会话侧栏选项`,sidebarActivityOptions:`动态视图选项`,sidebarShow:`显示`,sidebarGroupBy:`会话分组`,sidebarByProject:`按项目分组`,sidebarFlatList:`所有会话`,sidebarChatSort:`会话排序`,sidebarRecent:`最近`,sidebarProjectsInRecents:`在最近列表显示项目会话`,sidebarShowMore:`展开显示`,sidebarShowLess:`收起显示`,sidebarFilterList:`筛选当前列表`,sidebarSaveFailed:`更改未能保存,请重试。`,pinWorkspace:`置顶项目`,unpinWorkspace:`取消置顶项目`,markConversationRead:`标记为已读`,markConversationUnread:`标记为未读`,sidebarState_unread:`未读会话`,sidebarActivity:`动态`,sidebarViewActivity:`查看动态`,sidebarViewChats:`查看会话`,sidebarPriority:`优先关注`,sidebarActivityEmpty:`没有需要关注的会话`,sidebarActivityEmptyHint:`已完成的工作和需要你处理的会话会显示在这里。`,sidebarMarkAllRead:`全部标记为已读`,sidebarClearRead:`清除优先关注中的已读会话`,sidebarReadFailed:`未能更新已读状态,请重试。`,sidebarToday:`今天`,sidebarYesterday:`昨天`,sidebarEarlier:`更早`,sidebarActivityCompleted:`已完成`,sidebarActivityFailed:`执行失败`,sidebarActivityRead:`已读`,modelAdvanced:`高级参数`,providerConnectionHeading:`提供商连接`,providerFetchModels:`获取可用模型`,providerFetchHint:`填写提供商和端点后,可一次选择多个模型。`,providerPickerTitle:`选择要添加的模型`,providerPickerAccess:`连接凭据`,providerPickerKey:`访问密钥(可选)`,providerPickerKeyHint:`留空使用此端点已保存的凭据。此处输入的密钥仅用于获取列表,不会保存。`,providerPickerSearch:`搜索模型`,providerPickerSelectAll:`全选`,providerPickerClear:`清空选择`,providerPickerLoading:`正在获取可用模型…`,providerPickerAdded:`已添加`,providerPickerNoMatch:`没有匹配的模型`,providerPickerEmpty:`提供商没有返回模型,仍可手动添加。`,providerPickerBounded:`当前显示前 500 个模型,其他模型可手动填写 ID。`,providerPickerError_load:`未能获取模型列表,请检查端点和凭据后重试,也可以手动添加。`,providerPickerError_save:`尚未确认保存成功。已保留你的选择,请检查连接后重试。`,providerPickerError_conflict:`配置已在其他地方更新,请关闭弹窗、重新读取配置后再保存。`,providerPickerDefaults:`新模型使用 {{context}} 上下文 / {{output}} 输出 token,添加后可逐个调整。`,providerPickerRetry:`刷新列表`,providerPickerCount:`已选 {{count}} 个 · 最多 100 个`,providerPickerSave:`添加所选`,sidebarState_running:`执行中`,sidebarState_compacting:`正在整理上下文`,sidebarState_waiting:`等待你的回复`,sidebarState_completed:`已完成 · 结果未读`,sidebarState_failed:`执行失败 · 打开会话查看详情`,pinnedOptions:`置顶选项`,pinConversation:`置顶会话`,unpinConversation:`取消置顶`,pinnedRecentlyUpdated:`最近更新`,pinnedManualOrder:`手动排序`,movePinUp:`上移`,movePinDown:`下移`,pinSaveFailed:`置顶设置未能保存,请重试。`,cancel:`取消`,chooseWorkspaceHint:`选择工作区并描述任务`,close:`关闭`,closeSearch:`关闭搜索`,collapseSidebar:`收起侧边栏`,confirmEdit:`保存并重新运行`,editMessageHint:`从这里创建新分支并重新运行;保留原对话、图片和文件引用。已有工作区改动会保留。`,regenerateMessage:`重新生成回答`,regenerateMessageHint:`在新分支重新运行这条问题,保留原附件和原对话。`,messageRerunStarted:`已在新分支接收重跑消息,原对话已保留。`,openOriginalConversation:`查看原对话`,messageRerunWorkspaceHint:`已有工作区改动会保留。`,modelRequestRecovered:`请求已恢复`,modelReconnecting:`正在重新连接`,modelReconnectUnknown:`重连状态待确认`,modelEarlierAttempts:`先前请求错误`,modelFailedAttempts:`失败尝试({{count}} 次)`,draftStorageUnavailable:`草稿未能保存到此设备,请保持页面打开或复制消息。`,draftStorageInvalid:`部分保存的草稿内容无法恢复,请检查消息和附件。`,draftStorageRetry:`重试保存草稿`,workbarBackToChat:`返回聊天`,workbarCollapseTools:`收起工具栏`,workbarEndTerminal:`关闭 {{name}} 并结束进程`,workbarNewTerminal:`新建终端`,workbarContinueInChat:`继续追问`,transcriptSearch:`搜索消息内容`,transcriptSearchPlaceholder:`搜索标题、项目或消息…`,transcriptSearchRecent:`最近会话`,transcriptSearchSessions:`会话`,transcriptSearchMessages:`消息内容`,transcriptSearchSessionResult:`打开会话 {{session}}`,transcriptSearchSessionOpenFailed:`暂时无法打开此会话,请重试。`,transcriptSearchIncludeArchived:`包含归档会话`,transcriptSearching:`正在搜索消息…`,transcriptSearchEmpty:`没有匹配的消息。`,transcriptSearchFailed:`暂时无法搜索消息,请重试。`,transcriptSearchRetry:`重试搜索`,transcriptSearchPartial:`部分历史未能搜索,结果可能不完整。`,transcriptSearchOpenFailed:`无法打开这条消息,它可能已移动或位于其他分支。`,transcriptSearchResult:`打开 {{session}} 中来自{{source}}的消息`,transcriptSearchSource_user:`你`,transcriptSearchSource_assistant:`助手`,transcriptSearchSource_tool_call:`工具调用`,transcriptSearchSource_tool_result:`工具结果`,connected:`已连接`,connecting:`正在连接`,conversationName:`会话名称`,conversationOptions:`会话选项`,sidebarRename:`重命名`,sidebarPin:`置顶`,sidebarUnpin:`取消置顶`,sidebarFork:`分叉`,sidebarForkLocal:`创建聊天分支`,sidebarForkSameWorktree:`在同一工作树中分叉`,archiveNoticeTitle:`聊天已归档`,archiveNoticeView:`查看`,archiveNoticeUndo:`撤销`,archiveNoticeFailed:`操作未完成,请重试。`,sidebarForkWorktree:`在新工作树中创建聊天分支`,sidebarForkCancelling:`正在请求取消…`,sidebarForkFinishing:`无法再取消,正在确认创建结果…`,sidebarForkCancelUnconfirmed:`无法确认取消,正在等待分叉结果。`,sidebarForkWorktreePreserved:`工作树已保留在 {{path}},请检查后再重试。`,sidebarForkWorktreePending:`正在创建工作树和聊天分支…`,sidebarForkOptionsLoading:`正在检查工作树是否可用…`,sidebarForkOptionsFailed:`无法检查工作树,请重新打开菜单重试。`,sidebarForkUnavailable:`发送消息后才能创建此聊天的分支。`,sidebarForkArchived:`请先恢复此会话,再创建分叉。`,sidebarForkFailed:`未能创建分叉,原会话已保留。`,sidebarCopy:`复制`,sidebarCopyLink:`复制会话链接`,sidebarCopyMarkdown:`复制为 Markdown`,sidebarCopyCwd:`复制工作目录`,sidebarCopied:`已复制`,sidebarCopyFailed:`复制失败,请重试。`,sidebarNewWindow:`在新窗口中打开`,sidebarOpenIn:`打开方式`,sidebarAppsLoading:`正在加载可用应用…`,sidebarAppsFailed:`无法加载应用,请重新打开菜单重试。`,sidebarOpenFailed:`无法在所选应用中打开此项目。`,sidebarArchive:`归档`,sidebarRestore:`恢复`,sidebarDelete:`永久删除`,managedWorktreeRecoveryFull:`请先核对先前未确认的移除请求,再开始新的请求。`,managedWorktreesChanged:`工作树列表已变化,请刷新后重新核对目标。`,managedWorktreesRefresh:`刷新工作树列表`,managedWorktreesBack:`返回工作树列表`,managedWorktreesRetry:`重试请求`,managedWorktrees:`保留的工作树`,managedWorktreesDescription:`删除会话会保留 OpenPI 创建的工作树。请核对准确路径后再请求移除。使用中、共享、有改动或无法确认归属的工作树会保留。`,managedWorktreeConfirm:`移除此工作树?服务端会重新核对归属、使用中的会话及本地改动后再操作。`,managedWorktreeRemoved:`工作树已移除。`,managedWorktreePreserved:`工作树已保留:`,managedWorktreeUncertainTerminal:`移除结果无法确认,不能自动重复移除。请先检查保留路径,再决定后续操作。`,managedWorktreeUncertain:`尚不能确认移除结果。重试会核对原请求。`,managedWorktreeRemoving:`正在核对并移除…`,managedWorktreeRemove:`移除工作树`,managedWorktreeReview:`核对移除`,managedWorktreesEmpty:`这一页没有找到托管工作树。`,managedWorktreesUnavailable:`有 {{count}} 条归属记录无法确认。`,managedWorktreesLoadFailed:`无法加载保留的工作树。请重试,目标不会改变。`,managedWorktreesMore:`加载更多工作树`,managedWorktreeRetainedAfterDelete:`会话已删除,工作树保留在 {{path}}。可从项目菜单核对保留的工作树。`,sidebarDeleteTitle:`删除会话?`,sidebarDeleteDescription:`确定永久删除“{{name}}”?此操作无法撤销。`,sidebarDeleteConfirm:`删除`,sidebarDeleting:`正在删除…`,sidebarDeleteFailed:`未能删除此会话,请重试或取消。`,sidebarActionRunning:`请等待当前工作和排队消息结束。`,sidebarActionDisconnected:`请先恢复连接,再修改此会话。`,sessionDeleteCancelled:`删除已取消`,sessionDeleteUncertain:`无法确认会话是否删除,请刷新后重试`,sessionDeleted:`会话已永久删除`,sessionDeleteMetadataPending:`会话已删除,但侧栏记录未清理完成`,sessionLinkUnavailable:`链接中的会话已不存在或身份已变化`,sidebarDropPin:`拖到此处置顶`,sidebarDropProjectLast:`将项目移到最后`,conversationTurns:`会话轮次`,conversationTurnPosition:`前往第 {{position}} 轮`,turnPreviewLoading:`正在加载预览…`,turnPreviewUnavailable:`暂时无法读取,请重试。`,commands:`斜杠命令`,addContext:`添加上下文`,fileReference:`引用工作区文件`,fileReferenceTitle:`引用工作区文件`,fileReferenceDetail:`将路径引用加入提示词,不上传文件内容。`,fileReferenceLabel:`工作区文件路径`,fileReferencePlaceholder:`src/app.tsx`,fileReferenceValidatedHint:`当前会话会验证该路径是可读取的工作区文件。`,fileReferenceDraftHint:`新会话启动后,Pi 会按其工具权限解析该路径。`,fileReferenceChecking:`正在检查…`,fileReferenceFailed:`无法验证该文件。`,fileReferenceDenied:`请选择当前会话工作区内的文件。`,fileReferenceMissing:`该工作区文件已不存在。`,fileReferenceUnsupported:`只能引用工作区中的普通文件。`,fileReferenceExpired:`活动会话已变化,请重新打开文件引用后再试。`,fileReferenceBusy:`文件校验正忙,请稍后重试。`,insertReference:`插入引用`,commandsSessionRequired:`会话启动后才能插入斜杠命令。`,commandsEmptyDraftOnly:`只能在空白草稿中插入斜杠命令。`,commandsLoading:`正在加载命令…`,commandsUnavailable:`暂时无法读取命令。`,commandsNoMatch:`没有匹配的命令。`,commandsNoAvailable:`已发现的命令均不能在 Web 中运行。输入具体命令名可查看其可用性。`,commandsBounded:`另有 {{count}} 个命令未显示。`,commandSessionRequired:`命令仅在已创建的 Web 会话中可用。`,commandUnsupported:`尚未适配 · 手动命令仍交给 Pi`,commandAcceptsArguments:`可输入参数`,commandSource_extension:`扩展命令`,commandSource_prompt:`提示词模板`,commandSource_skill:`技能`,copiedMessage:`已复制`,copyMessage:`复制消息`,copyFailed:`复制失败,请选中消息后手动复制。`,copiedCode:`代码已复制`,copyCode:`复制代码`,copyCodeFailed:`无法复制代码,请选中后手动复制。`,codeBlock:`代码块`,wrapCode:`自动换行`,expandCode:`展开全部 {{count}} 行`,collapseCode:`收起代码`,expandInput:`展开输入框`,collapseInput:`收起输入框`,deleteWorkspace:`删除工作区`,describeTask:`描述任务`,editMessage:`修改并从这里重跑`,enterHint:`按 Enter 发送,Shift+Enter 换行。`,expandSidebar:`展开侧边栏`,importWorkspace:`导入工作区`,loadingModels:`正在加载模型...`,modelsTruncated:`当前显示 {{shown}} 个模型,还有 {{omitted}} 个可用;搜索即可查找。`,searchModels:`搜索可用模型`,searchModelsPlaceholder:`搜索服务商、模型名称或 ID...`,searchingModels:`正在搜索模型...`,noMatchingModels:`没有匹配的模型`,modelSearchFailed:`模型搜索失败,请重试。`,retryModelSearch:`重试模型搜索`,fileReferenceDraftChanged:`草稿已变化,请重新打开文件引用。`,modelSearchTruncated:`还有 {{omitted}} 个匹配模型未显示。`,modelPreparing:`正在准备任务...`,modelRetrying:`模型请求重试中...`,modelRunning:`正在运行…`,modelRequestFailed:`模型请求失败`,modelRequestStopped:`模型请求已停止`,modelFailureUnknown:`服务商没有返回具体失败原因。`,retryPrompt:`重试消息`,retryingPrompt:`正在重试…`,newSession:`新建会话`,noConversations:`暂无对话`,noMatching:`没有匹配的会话`,noMatchingLoaded:`已加载历史中没有匹配的会话`,noModels:`没有可用模型`,noOutput:`无输出`,noSessions:`暂无会话`,openSidebar:`打开侧边栏`,promptMessage:`发消息或创建任务,/ 调用指令`,promptReadonly:`非当前会话不能接收消息`,promptStart:`选择一个工作区开始`,promptTask:`描述你想要构建的任务`,queuedHint:`当前回合结束后将发送消息。`,reconnecting:`正在重连`,removeWorkspace:`从侧边栏移除`,workspaceOptions:`工作区选项`,renameFailed:`无法保存名称,已保留你的修改。`,savingName:`正在保存...`,workspaceRemoveFailed:`无法移出工作区,请重试。`,removingWorkspace:`正在移出...`,renameConversation:`重命名会话`,renameWorkspace:`重命名工作区`,save:`保存`,searchConversations:`搜索会话`,searchPlaceholder:`筛选标题与工作目录…`,selectModel:`选择模型`,configureModels:`配置模型`,openModelSettings:`模型设置`,selectThinking:`选择思考等级`,thinkingAvailableLevels:`可选等级:{{levels}}`,resetThinking:`恢复打开时的等级({{level}})`,modelThinkingNotEnabled:`此模型未启用思考。如提供商支持,可在模型设置中开启「支持推理」。`,providerReasoningHint:`按提供商能力开启,在聊天输入框调节当前思考等级。`,providerThinkingLevels:`支持的思考等级`,providerThinkingLevelsHint:`选择此模型支持的等级,保存后同步到会话选择器。`,providerThinkingAutomatic:`自动(Pi 默认)`,providerThinkingSelected:`已选 {{count}} 项`,providerThinkingReset:`使用 Pi 默认等级`,providerImageHint:`未勾选图片时,模型不会收到图片附件。`,selectWorkspace:`选择工作区`,send:`发送`,processDetails:`执行过程`,processRunning:`正在执行`,processThinkingCount:`{{count}} 段思考`,processToolCount:`{{count}} 次工具调用`,processFailureCount:`{{count}} 次失败`,runtimeActivities:`执行活动`,activityAgentProgress:`{{completed}}/{{total}} 个子代理已结束`,activityCapacity:`并行任务:{{running}}/{{limit}} · {{queued}} 个等待中`,composerQueuedCount:`排队 {{count}}`,composerSteeringCount:`引导 {{count}}`,runtimeActivityRunning:`{{count}} 项进行中`,runtimeActivityCount:`{{count}} 项活动`,processActivityCount:`{{count}} 项 Agent 活动`,switchingSession:`正在切换会话...`,thinkingActive:`思考中...`,thinkingActiveLevel:`思考中({{level}})...`,thinkingDone:`思考过程`,thinkingLoadFull:`查看完整思考`,thinkingLoadingFull:`正在加载思考…`,thinkingLoadFailed:`思考加载失败,点击重试`,thinkingPartialText:`当前显示部分已保存的思考,可继续加载下方内容。`,thinkingPreviewOnly:`思考预览已达到显示上限,此消息保存后可查看完整内容。`,toolState_running:`执行中`,toolState_returned:`已返回`,toolState_failed:`失败`,toolState_cancelled:`已停止`,toolState_timed_out:`超时`,toolState_unknown:`未确认`,toolSnapshotMissingResult:`分叉时尚无结果`,toolActivity_running:`正在{{action}}`,toolActivity_failed:`{{action}}失败`,toolActivity_cancelled:`{{action}}已停止`,toolActivity_timed_out:`{{action}}超时`,toolActivity_unknown:`{{action}}`,toolAction_read:`读取`,toolAction_write:`写入文件`,toolAction_edit:`编辑文件`,toolAction_command:`运行`,toolAction_search:`搜索`,toolAction_list:`列出文件`,toolAction_web:`浏览网页`,toolAction_agent:`使用子代理`,subagentAction_spawn:`启动子代理`,subagentAction_send:`发送补充消息`,subagentAction_check:`查询子代理`,subagentAction_wait:`等待子代理`,subagentAction_cancel:`停止子代理`,subagentActionDone_spawn:`已启动子代理`,subagentActionDone_send:`已发送补充消息`,subagentActionDone_check:`已查询子代理`,subagentActionDone_wait:`已结束等待`,subagentActionDone_cancel:`停止请求已返回`,toolAction_workflow:`调用工作流`,toolAction_plan:`准备计划`,toolAction_git:`查看变更`,toolAction_call:`调用工具`,toolActionDone_read:`已读取`,toolActionDone_write:`已写入`,toolActionDone_edit:`已编辑`,toolActionDone_command:`已运行`,toolActionDone_search:`已搜索`,toolActionDone_list:`已列出的文件`,toolActionDone_web:`已浏览网页`,toolActionDone_agent:`子代理工具已返回`,toolActionDone_workflow:`工作流工具已返回`,toolActionDone_plan:`计划工具已返回`,toolActionDone_git:`已查看变更`,toolActionDone_call:`已调用工具`,toolActionGroup_read:`读取文件`,toolActionGroup_write:`写入文件`,toolActionGroup_edit:`编辑文件`,toolActionGroup_command:`运行命令`,toolActionGroup_search:`搜索`,toolActionGroup_list:`列出文件`,toolActionGroup_web:`浏览网页`,toolActionGroup_agent:`子代理活动`,toolActionGroup_workflow:`工作流活动`,toolActionGroup_plan:`准备计划`,toolActionGroup_git:`查看变更`,toolActionGroup_call:`调用工具`,toolGroup_done:`{{actions}}`,toolGroup_running:`正在{{actions}}`,toolGroup_unknown:`{{actions}}`,toolGroupSeparator:`、`,toolSearchTarget:`“{{pattern}}” · {{path}}`,toolDiffStatsHelp:`当前显示差异中的新增和删除行数`,toolRequestedFile:`文件:`,toolWorkspace:`工作区`,toolRawEvidence:`参数与原始结果`,toolCodemodeDetails:`脚本与原始结果`,toolNestedOutputMissing:`会话记录保留了调用和状态,未保存此子工具的输出。`,toolNestedArgumentsMissing:`会话记录未保留完整参数和此子工具的输出。`,toolNestedIncomplete:`子调用记录不完整,部分调用、参数或最终状态不可用。`,toolPartialEvidence:`输出未完整显示:已达到字节、行数或条目上限。原始结果也可能被截断。`,toolFileChange_created:`已创建文件`,toolFileChange_unchanged:`文件内容未改变`,toolFileChange_overwritten:`已覆盖文件`,toolChangeUnavailable:`此工具结果未提供修改对比。`,toolTestResults:`测试结果摘要 · {{format}}`,toolTestCounts:`{{tests}} 项测试 · {{passed}} 通过 · {{failed}} 失败 · {{cancelled}} 取消`,toolTestCountsHelp:`数量来自命令输出,执行状态单独显示。`,toolReadMore:`可使用文件路径和 offset 继续读取,具体方式见原始结果。`,toolFullOutputReference:`完整输出:`,subagentBackgroundResult:`后台子代理结果 · {{count}}`,thinkingDraftHint:`请先选择工作区并创建会话。`,thinkingInactiveHint:`只有当前会话可以更改思考等级。`,thinkingLevelMismatch:`当前确认的思考等级不在此模型支持范围内;选择其它等级即可修正。`,thinkingLockedRunning:`请先停止当前轮次,再更改思考等级。`,thinkingModelPendingHint:`请等待模型切换完成。`,thinkingNotConfirmed:`思考等级未获确认,请重试。`,thinkingPendingHint:`正在应用思考等级...`,thinkingUnsupported:`暂不支持思考`,thinkingUnsupportedHint:`尚未选择模型,或当前模型不支持思考。`,unavailable:`不可用`,ungrouped:`未分组`,untitledSession:`新会话`,workspaceDeleteConfirm:`文件夹与会话记录会保留,其中的会话会被放到“未分组”;再次打开此目录时将是一个干净的工作区。`,workspaceName:`工作区名称`,workspaces:`工作区`,sidebarProjects:`项目`}}},dG=navigator.language?.toLowerCase().startsWith(`zh`)?`zh`:`en`;Xl.use(Zl).init({fallbackLng:`en`,initAsync:!1,interpolation:{escapeValue:!1},lng:dG,resources:uG}),document.documentElement.lang=dG===`zh`?`zh-CN`:`en`;var fG=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},pG=10,mG=13,hG=32,gG=6;function _G(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{maxBufferSize:t,onComment:n,onError:r,onEvent:i,onId:a,onRetry:o}=e,s=[],c=0,l=!0,u,d=``,f=0,p,m=!1,h=!1,g=!1;function _(e){if(m)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l&&(l=!1,e.charCodeAt(0)===65279?e=e.slice(1):e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),(h||g)&&(e=v(e),!e))return;if(!s.length){let t=S(e);t!==``&&y(t),x();return}if(e.indexOf(` +`)?RI(e,II(t)):e.startsWith(` `)?RI(e,t):RI(e,LI(t))}[...OI,...kI],[...kI];function BI(e){return mM(e,``)?[]:[e.slice(0,1),e.slice(1)]}function VI(e,t){return vM(e,(e,n)=>t.startsWith(e)?!0:VI(n,t),()=>!1)}function HI(e,t,n=``){return wI(BI(t),(r,i)=>VI(e,t)?[n,t]:HI(e,i,`${n}${r}`),()=>[])}function UI(e,t){return wI(HI(e,t),(e,t)=>mM(e,``)?[]:[e,t],()=>[])}var WI=(e,t,n=()=>[])=>e.length===2?t(e):n(),GI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[dI(e),t]),KI=e=>WI(zI(`.*`,e),([e,t])=>[fI(e),t]),qI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,e),([e,t])=>[pI(e),t]),JI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[mI(e),t]),YI=e=>WI(zI(`(?!)`,e),([e,t])=>[hI(e),t]),XI=e=>WI(UI([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[gI(e),t]),ZI=e=>WI(WI(GI(e),([e,t])=>[e,t],()=>WI(KI(e),([e,t])=>[e,t],()=>WI(qI(e),([e,t])=>[e,t],()=>WI(JI(e),([e,t])=>[e,t],()=>WI(YI(e),([e,t])=>[e,t],()=>WI(QI(e),([e,t])=>[e,t],()=>WI(XI(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[_I(e),t]),QI=e=>WI(WI(zI(`(`,e),([e,t])=>WI(tL(t),([t,n])=>WI(zI(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[vI(e),t]),$I=e=>WI(WI(WI(eL(e),([e,t])=>WI(zI(`|`,t),([t,n])=>WI($I(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>WI(WI(eL(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>WI([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[yI(e),t]),eL=e=>WI(WI(ZI(e),([e,t])=>WI(tL(t),([t,n])=>[[e,t],n])),([e,t])=>[bI(e),t]),tL=e=>WI(WI($I(e),([e,t])=>[e,t],()=>WI(eL(e),([e,t])=>[e,t],()=>[])),([e,t])=>[xI(e),t]),nL=e=>WI(WI(zI(`^`,e),([e,t])=>WI(tL(t),([t,n])=>WI(zI(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[SI(e),t]);function rL(e){return e.join(`|`)}function iL(e){return e.slice(1,e.length-1)}function aL(e,t,n){return gL(t,`${n}${e}`)}function oL(e,t){return gL(e,`${t}${eP}`)}function sL(e,t){return gL(e,`${t}${iP}`)}function cL(e,t){return gL(e,`${t}${gP}`)}function lL(e,t){return hL(CP([lP(`false`),lP(`true`)]),e,t)}function uL(e,t){return gL(e,`${t}.*`)}function dL(e,t,n){return gL(t,`${n}${iL(e)}`)}function fL(e,t,n){return hL(yL(e,{}),t,n)}function pL(e,t,n){return hL(TF(e),t,n)}function mL(e,t,n,r=[]){return vM(e,(e,i)=>mL(i,t,n,[...r,hL(e,[],``)]),()=>gL(t,`${n}(${rL(r)})`))}function hL(e,t,n){return WN(e)?pL(e.enum,t,n):oP(e)?sL(t,n):pP(e)?aL(e.const,t,n):nP(e)?oL(t,n):rP(e)?lL(t,n):vP(e)?cL(t,n):SP(e)?uL(t,n):CL(e)?dL(e.pattern,t,n):SL(e)?fL(e.parameters[0],t,n):wP(e)?mL(e.anyOf,t,n):bN}function gL(e,t){return vM(e,(e,n)=>hL(e,n,t),()=>t)}function _L(e){return`^${gL(e,``)}$`}function vL(e){return MP(_L(e))}function yL(e,t){return NU(e)?JM(vL(e),{},t):xL(e,t)}function bL(e,t,n,r){return yL(IU(e,t,n),r)}function xL(e,t={}){return ZM(`TemplateLiteral`,[e],t)}function SL(e){return XM(e)&&bM(e,`action`)&&mM(e.action,`TemplateLiteral`)}function CL(e){return YM(e,`TemplateLiteral`)}function wL(e){return KM({"~kind":`ExtendsUnion`},{inferred:e})}function TL(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`inferred`)&&mM(e[`~kind`],`ExtendsUnion`)&&fM(e.inferred)}function EL(e){return KM({"~kind":`ExtendsTrue`},{inferred:e})}function DL(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`inferred`)&&mM(e[`~kind`],`ExtendsTrue`)&&fM(e.inferred)}function OL(){return KM({"~kind":`ExtendsFalse`},{})}function kL(e){return fM(e)&&bM(e,`~kind`)&&mM(e[`~kind`],`ExtendsFalse`)}function AL(e){return TL(e)||DL(e)}function jL(e,t,n){return AL(e)?t(e.inferred):n()}function ML(e,t,n,r){return jL(XR(e,n,r),r=>EL(jM(jM(e,r),{[t]:n})),()=>OL())}function NL(e,t){return EL(e)}function PL(e,t,n,r,i){return jL(XR(e,t,n),e=>jL(XR(e,t,r),e=>EL(e),()=>OL()),()=>jL(XR(e,t,i),e=>EL(e),()=>OL()))}function FL(e,t,n){return XR(e,t,TF(n))}function IL(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>IL(e,t,r),()=>OL()),()=>EL(e))}function LL(e,t,n){return XR(e,t,DF(n))}function RL(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>EL(e),()=>RL(e,t,r)),()=>OL())}function zL(e,t,n){return yN(n)?NL(e,t):zN(n)?PL(e,t,n.if,n.then,n.else):WN(n)?FL(e,t,n.enum):LN(n)?ML(e,n.name,t,n.extends):KN(n)?IL(e,t,n.allOf):CL(n)?LL(e,t,n.pattern):wP(n)?RL(e,t,n.anyOf):NN(n)?EL(e):OL()}function BL(e,t,n){return LN(n)?zL(e,t,n):yN(n)||NN(n)?EL(e):wL(e)}function VL(e,t){let n=ZN(e),r=ZN(t);return n&&r||!n&&r?!0:!(n&&!r)}function HL(e,t,n,r){return oN(r)?VL(t,r)?XR(e,n,r.items):OL():zL(e,t,r)}function UL(e,t,n){return nP(n)?EL(e):zL(e,t,n)}function WL(e,t,n){return rP(n)?EL(e):zL(e,t,n)}function GL(e,t,n,r,i){let a=LN(r)?t:r,o=LN(r)?r:t,s=TN(t),c=TN(r);return!s&&c?OL():jL(XR(e,a,o),e=>JL(e,n,i),()=>OL())}function KL(e,t,n,r){return vM(r,(r,i)=>GL(e,t,n,r,i),()=>TN(t)?EL(e):OL())}function qL(e,t,n){return vM(t,(t,r)=>KL(e,t,r,n),()=>EL(e))}function JL(e,t,n){return qL(e,t,n)}function YL(e,t,n){return uI(n)?EL(e):XR(e,t,n)}function XL(e,t,n,r){return yN(r)||NN(r)?EL(e):lN(r)?jL(JL(e,t,r.parameters),e=>YL(e,n,r.instanceType),()=>OL()):OL()}function ZL(e,t,n,r,i){return jL(XR(e,t,i),()=>XR(e,n,i),()=>XR(e,r,i))}function QL(e,t,n){return XR(e,TF(t),n)}function $L(e,t,n,r){return yN(r)||NN(r)?EL(e):fN(r)?jL(JL(e,t,r.parameters),e=>YL(e,n,r.returnType),()=>OL()):OL()}function eR(e,t,n){return oP(n)||vP(n)?EL(e):zL(e,t,n)}function tR(e,t,n){return XR(e,EF(t),n)}function nR(e,t,n){return t===n?EL(e):OL()}function rR(e,t,n){return pP(n)?nR(e,t,n.const):nP(n)?EL(e):zL(e,lP(t),n)}function iR(e,t,n){return pP(n)?nR(e,t,n.const):rP(n)?EL(e):zL(e,lP(t),n)}function aR(e,t,n){return pP(n)?nR(e,t,n.const):vP(n)?EL(e):zL(e,lP(t),n)}function oR(e,t,n){return pP(n)?nR(e,t,n.const):SP(n)?EL(e):zL(e,lP(t),n)}function sR(e,t,n){return sM(t.const)?rR(e,t.const,n):cM(t.const)?iR(e,t.const,n):uM(t.const)?aR(e,t.const,n):pM(t.const)?oR(e,t.const,n):JN()}function cR(e,t,n){return LN(n)?zL(e,t,n):EL(e)}function lR(e,t,n){return hP(n)?EL(e):zL(e,t,n)}function uR(e,t,n){return vP(n)?EL(e):zL(e,t,n)}function dR(e,t,n){return TN(t)?TN(n)?EL(e):OL():EL(e)}function fR(e,t,n){return LN(n)&&SN(n.extends)?OL():jL(XR(e,t,n),e=>dR(e,t,n),()=>OL())}function pR(e,t){return e.reduce((e,n)=>n in t&&AL(t[n])?{...e,...t[n].inferred}:JN(),{})}function mR(e,t,n){let r={};for(let i of xM(n))r[i]=i in t?fR({},t[i],n[i]):TN(n[i])?LN(n[i])?EL(jM(e,{[n[i].name]:n[i].extends})):EL(e):OL();let i=CM(r).every(e=>AL(e)),a=i?pR(xM(r),r):{};return i?EL(a):OL()}function hR(e,t,n){let r=mR(e,t,n);return AL(r)?EL(jM(e,r.inferred)):OL()}function gR(e,t,n){return hR(e,t,n)}function _R(e,t){return xM(t).reduce((n,r)=>({...n,[r]:bM(e,r)?wP(n[r])?CP([...n[r].anyOf,t[r]]):CP([e[r],t[r]]):t[r]}),e)}function vR(e,t,n,r){return vM(t,(t,i)=>jL(XR({},e[t],n),t=>vR(e,i,n,_R(r,t)),()=>OL()),()=>EL(r))}function yR(e,t,n,r){return vR(t,xM(t),r,e)}function bR(e,t,n){return iI(n)?yR(e,t,tI(n),rI(n)):AN(n)?gR(e,t,n.properties):zL(e,kN(t),n)}function xR(e,t){return mM(xM(t).length,0)?EL(e):OL()}function SR(e,t,n,r,i){return XR(e,n,i)}function CR(e,t,n,r){return iI(r)?SR(e,eI(t),n,eI(tI(r)),rI(r)):AN(r)?xR(e,r.properties):yN(r)||NN(r)?EL(e):OL()}function wR(e,t,n){return SP(n)?EL(e):zL(e,t,n)}function TR(e,t,n){return bP(n)?EL(e):zL(e,t,n)}function ER(e,t,n){return XR(e,DF(t),n)}function DR(e,t){return KM({"~kind":`Inferrable`},{name:e,type:t},{})}function OR(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`name`)&&bM(e,`type`)&&mM(e[`~kind`],`Inferrable`)&&pM(e.name)&&fM(e.type)}function kR(e){return oI(e)?LN(e.items)?oN(e.items.extends)?DR(e.items.name,e.items.extends.items):NN(e.items.extends)?DR(e.items.name,e.items.extends):void 0:JN():void 0}function AR(e){return LN(e)?DR(e.name,e.extends):void 0}function jR(e,t,n=[]){return vM(e,(e,r)=>jL(XR({},e,t),()=>jR(r,t,[...n,e]),()=>void 0),()=>n)}function MR(e,t,n,r){let i=jR(n,r);return oM(i)?EL(jM(e,{[t]:KP(i)})):OL()}function NR(e,t,n,r){let i=jR(n,r);return oM(i)?EL(jM(e,{[t]:CP(i)})):OL()}function PR(e){return[...e].reverse()}function FR(e,t){return t?PR(e):e}function IR(e){let t=e.length>0?e[0]:void 0;return XM(XM(t)?kR(t):void 0)}function LR(e,t,n,r,i,a){return jL(XR(e,n,i),e=>BR(e,t,r,a),()=>OL())}function RR(e,t,n,r,i){let a=kR(r);return OR(a)?MR(e,a.name,FR(n,t),a.type):vM(n,(n,a)=>LR(e,t,n,a,r,i),()=>OL())}function zR(e,t,n,r){return vM(r,(r,i)=>RR(e,t,n,r,i),()=>mM(n.length,0)?EL(e):OL())}function BR(e,t,n,r){return zR(e,t,n,r)}function VR(e,t,n){let r=FU(e,MU([],[]),n),i=IR(r);return BR(e,i,FR(t,i),FR(r,i))}function HR(e,t,n){let r=AR(n);return OR(r)?NR(e,r.name,t,r.type):vM(t,(t,r)=>jL(XR(e,t,n),e=>HR(e,r,n),()=>OL()),()=>EL(e))}function UR(e,t,n){let r=FU(e,MU([],[]),t);return qP(n)?VR(e,r,n.items):oN(n)?HR(e,r,n.items):zL(e,KP(r),n)}function WR(e,t,n){return uI(n)||lI(n)?EL(e):zL(e,t,n)}function GR(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>EL(e),()=>GR(e,t,r)),()=>OL())}function KR(e,t,n){return vM(t,(t,r)=>jL(GR(e,t,n),e=>KR(e,r,n),()=>OL()),()=>EL(e))}function qR(e,t,n){let r=AR(n);return OR(r)?NR(e,r.name,t,r.type):wP(n)?KR(e,t,n.anyOf):KR(e,t,[n])}function JR(e,t,n){return LN(n)?zL(e,t,n):yN(n)||NN(n)?EL(e):OL()}function YR(e,t,n){return uI(n)?EL(e):zL(e,t,n)}function XR(e,t,n){return yN(t)?BL(e,t,n):oN(t)?HL(e,t,t.items,n):nP(t)?UL(e,t,n):rP(t)?WL(e,t,n):lN(t)?XL(e,t.parameters,t.instanceType,n):zN(t)?ZL(e,t.if,t.then,t.else,n):WN(t)?QL(e,t.enum,n):fN(t)?$L(e,t.parameters,t.returnType,n):oP(t)?eR(e,t,n):KN(t)?tR(e,t.allOf,n):pP(t)?sR(e,t,n):SN(t)?cR(e,t,n):hP(t)?lR(e,t,n):vP(t)?uR(e,t,n):AN(t)?bR(e,t.properties,n):iI(t)?CR(e,tI(t),rI(t),n):SP(t)?wR(e,t,n):bP(t)?TR(e,t,n):CL(t)?ER(e,t.pattern,n):qP(t)?UR(e,t.items,n):lI(t)?WR(e,t,n):wP(t)?qR(e,t.anyOf,n):NN(t)?JR(e,t,n):uI(t)?YR(e,t,n):OL()}function ZR(e,t){return EF([...e,kN(t)])}function QR(e,t,n){return NU(e)?JM(ZR(e,t),{},n):ez(e,t,n)}function $R(e,t,n,r,i){return QR(IU(e,t,n),PU(e,t,r),i)}function ez(e,t,n={}){return ZM(`Interface`,[e,t],n)}function tz(e){return XM(e)&&bM(e,`action`)&&mM(e.action,`Interface`)}function nz(e,t,n){return e.includes(n)?!0:az([...e,n],t,t[n])}function rz(e,t,n){return iz(e,t,ON(n))}function iz(e,t,n){return vM(n,(n,r)=>az(e,t,n)?!0:iz(e,t,r),()=>!1)}function az(e,t,n){return hN(n)?nz(e,t,n.$ref):oN(n)?az(e,t,n.items):lN(n)?iz(e,t,[...n.parameters,n.instanceType]):fN(n)?iz(e,t,[...n.parameters,n.returnType]):tz(n)?rz(e,t,n.parameters[1]):KN(n)?iz(e,t,n.allOf):AN(n)?rz(e,t,n.properties):wP(n)?iz(e,t,n.anyOf):qP(n)?iz(e,t,n.items):iI(n)?az(e,t,rI(n)):!1}function oz(e,t,n){return az(e,t,n)}function sz(e,t){return t.reduce((t,n)=>oz([n],e,e[n])?[...t,n]:t,[])}function cz(e){return sz(e,DN(e))}function lz(e,t,n){return n.includes(t)?n:t in e?fz(e,e[t],[...n,t]):JN()}function uz(e,t,n){return dz(e,ON(t),n)}function dz(e,t,n){return t.reduce((t,n)=>fz(e,n,t),n)}function fz(e,t,n){return hN(t)?lz(e,t.$ref,n):oN(t)?fz(e,t.items,n):lN(t)?dz(e,[...t.parameters,t.instanceType],n):fN(t)?dz(e,[...t.parameters,t.returnType],n):tz(t)?uz(e,t.parameters[1],n):KN(t)?dz(e,t.allOf,n):AN(t)?uz(e,t.properties,n):wP(t)?dz(e,t.anyOf,n):qP(t)?dz(e,t.items,n):iI(t)?fz(e,rI(t),n):n}function pz(e,t,n){return fz(e,n,[t])}function mz(e){return vN()}function hz(e){return xM(e).reduce((t,n)=>({...t,[n]:_z(e[n])}),{})}function gz(e){return e.reduce((e,t)=>[...e,_z(t)],[])}function _z(e){return hN(e)?mz(e.$ref):oN(e)?aN(_z(e.items),sN(e)):lN(e)?cN(gz(e.parameters),_z(e.instanceType)):fN(e)?dN(gz(e.parameters),_z(e.returnType)):KN(e)?GN(gz(e.allOf)):AN(e)?kN(hz(e.properties)):iI(e)?QF(nI(e),_z(rI(e))):wP(e)?CP(gz(e.anyOf)):qP(e)?KP(gz(e.items)):e}function vz(e,t){return t in e?_z(e[t]):MN()}function yz(e){return vz(e.$defs,e.$ref)}function bz(e,t,n){let r=IU(e,MU([],[]),t),i=PU({},MU([],[]),n);return EF([...r,kN(i)])}function xz(e,t){return xM(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=tz(r)?bz(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function Sz(e,t,n){return PN(xz(e,pz(e,t,n)),t)}function Cz(e,t){return t in e?hN(e[t])?Cz(e,e[t].$ref):e[t]:xN()}function wz(e,t){return Cz(e,t)}function Tz(e){return FN(e)?yz(e):IN(e)?MN():e}function Ez(e,t,n){return XR(e,Tz(t),Tz(n))}function Dz(e,t){let n=[Ez({},e,t),Ez({},t,e)];return AL(n[0])&&AL(n[1])?0:AL(n[0])&&kL(n[1])?2:kL(n[0])&&AL(n[1])?3:1}function Oz(e,t,n=[],r=t){return vM(t,(t,i)=>{let a=Dz(e,t);return mM(a,2)||mM(a,0)?r:mM(a,1)?Oz(e,i,[...n,t],r):Oz(e,i,n,r)},()=>[...n,e])}function kz(e,t,n){let r=kF(e);return yN(r)||NN(r)?[r]:SN(r)?Az(t,n):AN(r)?Az(t,[...n,r]):Az(t,Oz(r,n))}function Az(e,t=[]){return vM(e,(e,n)=>kz(e,n,t),()=>t)}function jz(e){return zF(Az(e))}function Mz(e,t){return JM(kF(e),{},t)}function Nz(e,t,n,r){return Mz(BU(e,t,n),r)}function Pz(e,t=[]){return QM(e)&&mM(e.action,`Conditional`)?hN(e.parameters[0])?Pz(e.parameters[2],Pz(e.parameters[3],[...t,e.parameters[0].$ref])):Pz(e.parameters[2],Pz(e.parameters[3],t)):QM(e)&&mM(e.action,`Mapped`)&&QM(e.parameters[1])&&mM(e.parameters[1].action,`KeyOf`)&&hN(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function Fz(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function Iz(e,t,n=[]){return vM(e,(e,r)=>vM(t,(t,i)=>Iz(r,i,[...n,[t,e]]),()=>n),()=>n)}function Lz(e){return CL(e)?DF(e.pattern):WN(e)?TF(e.enum):e}function Rz(e){let t=Lz(e);return wP(t)?[...t.anyOf]:[t]}function zz(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function Bz(e,t){return t.reduce((t,n)=>[...t,...zz(e,n)],[])}function Vz(e){return e.reduce((e,t)=>mM(t[0],!0)?Bz(e,Rz(t[1])):Bz(e,[t[1]]),[[]])}function Hz(e,t,n){let r=Iz(t,Fz(e,Pz(n)));return QM(n)&&mM(n.action,`Conditional`)||QM(n)&&mM(n.action,`Mapped`)?Vz(r):[t]}function Uz(){return[`(not-resolvable)`,xN()]}function Wz(){return[`(not-generic)`,xN()]}function Gz(e,t,n){return[e,gN(t,n)]}function Kz(e,t,n){return t in e?qz(e,t,e[t],n):Uz()}function qz(e,t,n,r){return _N(n)?Gz(t,n.parameters,n.expression):hN(n)?Kz(e,n.$ref,r):Wz()}function Jz(e,t,n){return qz(e,`(anonymous)`,t,n)}function Yz(e,t,n){if(LN(t)||fB(t)||AL(Ez({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function Xz(e,t,n,r,i){let a=BU(e,t,i);return Yz(n,a,r),jM(e,{[n]:a})}function Zz(e,t,n,r,i){let a=BU(e,t,n.extends),o=BU(e,t,n.equals);return vM(i,(i,o)=>Qz(Xz(e,t,n.name,a,i),t,r,o),()=>Qz(Xz(e,t,n.name,a,o),t,r,[]))}function Qz(e,t,n,r){return vM(n,(n,i)=>Zz(e,t,n,i,r),()=>e)}function $z(e,t,n,r){return Qz(e,t,n,r)}var eB=0,tB=0;function nB(){if(!gM(tB,kM().maxInstantiationCount))throw Error(`Type instantiation is excessively deep and possibly infinite`)}function rB(){nB(),tB++,eB++}function iB(){eB--,mM(eB,0)&&(tB=0)}function aB(e){return hM(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function oB(e,t){return mM(aB(e),t)}function sB(e,t,n,r,i,a){rB();try{let o=$z(e,t,r,a),s=BU(o,MU([...t.callstack,n.$ref],t.visited),i);return BU(o,MU([],[]),s)}finally{iB()}}function cB(e,t,n,r,i,a){return a.reduce((a,o)=>{let s=sB(e,t,n,r,i,o);return[...a,s]},[])}function lB(e,t,n,r,i,a){let o=cB(e,t,n,r,i,Hz(r,a,i));return mM(o.length,1)?o[0]:OF(o)}function uB(e,t,n,r){let i=IU(e,t,r),a=Jz(e,n,r),o=a[0],s=a[1];return _N(s)?oB(t,o)?dB(mN(o),i):lB(e,t,mN(o),s.parameters,s.expression,i):dB(n,i)}function dB(e,t){return KM({"~kind":`Call`},{type:`call`,target:e,arguments:t},{})}function fB(e){return YM(e,`Call`)}function pB(e){return qM(e,[`~immutable`])}function mB(e,t){return JM(pB(e),{},t)}function hB(e,t,n,r){return mB(BU(e,t,n),r)}function gB(e,t){return e(t)}function _B(e,t){return pM(t)?lP(gB(e,t)):lP(t)}function vB(e,t){return bB(e,DF(t))}function yB(e,t){return CP(t.map(t=>bB(e,t)))}function bB(e,t){return pP(t)?_B(e,t.const):CL(t)?vB(e,t.pattern):wP(t)?yB(e,t.anyOf):t}function xB(e,t={}){return ZM(`Capitalize`,[e],t)}function SB(e,t={}){return ZM(`Lowercase`,[e],t)}function CB(e,t={}){return ZM(`Uncapitalize`,[e],t)}function wB(e,t={}){return ZM(`Uppercase`,[e],t)}var TB=e=>e[0].toUpperCase()+e.slice(1),EB=e=>e.toLowerCase(),DB=e=>e[0].toLowerCase()+e.slice(1),OB=e=>e.toUpperCase();function kB(e,t){return NU([e])?JM(bB(TB,e),{},t):xB(e,t)}function AB(e,t){return NU([e])?JM(bB(EB,e),{},t):SB(e,t)}function jB(e,t){return NU([e])?JM(bB(DB,e),{},t):CB(e,t)}function MB(e,t){return NU([e])?JM(bB(OB,e),{},t):wB(e,t)}function NB(e,t,n,r){return kB(BU(e,t,n),r)}function PB(e,t,n,r){return AB(BU(e,t,n),r)}function FB(e,t,n,r){return jB(BU(e,t,n),r)}function IB(e,t,n,r){return MB(BU(e,t,n),r)}function LB(e,t,n,r,i={}){return ZM(`Conditional`,[e,t,n,r],i)}function RB(e,t,n,r,i,a){let o=Ez(e,n,r);return TL(o)?CP([BU(o.inferred,t,i),BU(e,t,a)]):DL(o)?BU(o.inferred,t,i):BU(e,t,a)}function zB(e,t,n,r,i,a,o){return NU([n,r])?JM(RB(e,t,n,r,i,a),{},o):LB(n,r,i,a,o)}function BB(e,t,n,r,i,a,o){return zB(e,t,BU(e,t,n),BU(e,t,r),i,a,o)}function VB(e,t={}){return ZM(`ConstructorParameters`,[e],t)}function HB(e){let t=lN(e)?e.parameters:[];return KP(FU({},MU([],[]),t))}function UB(e,t){return NU([e])?JM(HB(e),{},t):VB(e,t)}function WB(e,t,n,r){return UB(BU(e,t,n),r)}function GB(e,t,n={}){return ZM(`Exclude`,[e,t],n)}function KB(e,t,n){return NU([e,t])?JM(CF(e,t),{},n):GB(e,t,n)}function qB(e,t,n,r,i){return KB(BU(e,t,n),BU(e,t,r),i)}function JB(e,t,n={}){return ZM(`Extract`,[e,t],n)}function YB(e,t){return AL(Ez({},e,t))?[e]:[]}function XB(e,t,n=[]){return vM(e,(e,r)=>XB(r,t,[...n,...YB(e,t)]),()=>n)}function ZB(e,t){let n=kF(e);return OF(XB(wP(n)?n.anyOf:[n],t))}function QB(e,t,n){return NU([e,t])?JM(ZB(e,t),{},n):JB(e,t,n)}function $B(e,t,n,r,i){return QB(BU(e,t,n),BU(e,t,r),i)}function eV(e,t,n={}){return ZM(`Index`,[e,t],n)}function tV(e,t){return uV(wz(e,t))}function nV(e,t,n){return uV(wF(e,t,n))}function rV(e,t){let n=xM(e).filter(e=>!bM(t,e)),r=xM(t).filter(t=>!bM(e,t)),i=xM(e).filter(e=>bM(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:EF([e[r],t[r]])}),{});return jM(jM(a,o),s)}function iV(e){return e.reduce((e,t)=>rV(e,uV(t)),{})}function aV(e){return e}function oV(e){return uV(iF(KP(e)))}function sV(e,t){return xM(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:OF([e[r],t[r]])}),{})}function cV(e,t){return vM(e,(e,n)=>cV(n,sV(t,uV(e))),()=>t)}function lV(e){return vM(e,(e,t)=>cV(t,uV(e)),()=>JN())}function uV(e){return FN(e)?tV(e.$defs,e.$ref):zN(e)?nV(e.if,e.then,e.else):KN(e)?iV(e.allOf):wP(e)?lV(e.anyOf):qP(e)?oV(e.items):AN(e)?aV(e.properties):{}}function dV(e){return kN(uV(e))}var fV=RegExp(`^(?:0|[1-9][0-9]*)$`);function pV(e){let t=`${e}`;return fV.test(t)?parseInt(t):e}function mV(e){return lP(pV(e))}function hV(e){return e.map(e=>gV(e))}function gV(e){return KN(e)?GN(hV(e.allOf)):wP(e)?CP(hV(e.anyOf)):pP(e)?mV(e.const):e}function _V(e,t){return AL(Ez({},gV(t),_P()))?e:pP(t)&&mM(t.const,`length`)?_P():xN()}function vV(e,t){return TV(wz(e,t))}function yV(e,t,n){return TV(wF(e,t,n))}function bV(e){return TV(TF(e))}function xV(e){return TV(EF(e))}function SV(e){return[`${e}`]}function CV(e){return TV(DF(e))}function wV(e){return e.reduce((e,t)=>[...e,...TV(t)],[])}function TV(e){return FN(e)?vV(e.$defs,e.$ref):zN(e)?yV(e.if,e.then,e.else):WN(e)?bV(e.enum):KN(e)?xV(e.allOf):pP(e)?SV(e.const):CL(e)?CV(e.pattern):wP(e)?wV(e.anyOf):[]}function EV(e){return TV(e)}function DV(e,t){return t.map(t=>OV(e,t))}function OV(e,t){return oN(t)?aN(OV(e,t.items)):lN(t)?cN(DV(e,t.parameters),OV(e,t.instanceType)):fN(t)?dN(DV(e,t.parameters),OV(e,t.returnType)):qP(t)?KP(DV(e,t.items)):wP(t)?CP(DV(e,t.anyOf)):KN(t)?GN(DV(e,t.allOf)):sI(t)?kN(e):t}function kV(e,t){return OV(e,t)}function AV(e,t){return kV(e,t in e?e[t]:xN())}function jV(e,t){return t.reduce((t,n)=>[...t,AV(e,n)],[])}function MV(e,t){return OF(jV(e,EV(t)))}var NV=new RegExp(JF);function PV(e){return e.filter(e=>NV.test(e))}function FV(e){return OF(jV(e,PV(DN(e))))}function IV(e,t){return vP(t)?FV(e):MV(e,t)}function LV(e){return lP(pV(e))}function RV(e){return e.map(e=>zV(e))}function zV(e){return KN(e)?GN(RV(e.allOf)):wP(e)?CP(RV(e.anyOf)):pP(e)?LV(e.const):e}function BV(e,t){return e.reduceRight((e,n,r)=>AL(Ez({},lP(r),t))?[n,...e]:e,[])}function VV(e,t){return AF(BV(e,zV(t)))}function HV(e){return AF(e)}function UV(e,t){return pP(t)&&mM(t.const,`length`)?lP(e.length):vP(t)||oP(t)?HV(e):VV(e,t)}function WV(e,t){return oN(e)?_V(e.items,t):AN(e)?IV(e.properties,t):qP(e)?UV(e.items,t):xN()}function GV(e){return FN(e)||zN(e)||KN(e)||wP(e)?dV(e):e}function KV(e,t,n){return NU([e,t])?JM(WV(GV(e),t),{},n):eV(e,t,n)}function qV(e,t,n,r,i){return KV(BU(e,t,n),BU(e,t,r),i)}function JV(e,t={}){return ZM(`InstanceType`,[e],t)}function YV(e){return lN(e)?e.instanceType:xN()}function XV(e,t){return NU([e])?JM(YV(e),{},t):JV(e,t)}function ZV(e,t,n,r={}){return XV(BU(e,t,n),r)}function QV(e,t={}){return ZM(`KeyOf`,[e],t)}function $V(){return CP([_P(),xP(),yP()])}function eH(e){return _P()}function tH(e){return e.reduce((e,t)=>uP(t)?[...e,lP(pV(t))]:JN(),[])}function nH(e){return AF(tH(xM(e)))}function rH(e){return nI(e)}function iH(e){return AF(e.map((e,t)=>lP(t)))}function aH(e){return yN(e)?$V():oN(e)?eH(e.items):AN(e)?nH(e.properties):iI(e)?rH(e):qP(e)?iH(e.items):xN()}function oH(e){return FN(e)||zN(e)||KN(e)||wP(e)?dV(e):e}function sH(e,t){return NU([e])?JM(aH(oH(e)),{},t):QV(e,t)}function cH(e,t,n,r){return sH(BU(e,t,n),r)}function lH(e,t,n,r,i={}){return ZM(`Mapped`,[e,t,n,r],i)}function uH(e){return mH(DF(e))}function dH(e){return e.reduce((e,t)=>[...e,...mH(t)],[])}function fH(e){return mH(TF(e))}function pH(e){return uM(e)?[lP(`${e}`)]:[lP(e)]}function mH(e){return WN(e)?fH(e.enum):pP(e)?pH(e.const):CL(e)?uH(e.pattern):wP(e)?dH(e.anyOf):[e]}function hH(e){return mH(e)}function gH(e){return CL(e)?DF(e.pattern):e}function _H(e,t,n,r,i,a){let o=jM(e,{[n.name]:r}),s=gH(BU(o,t,i)),c=BU(o,t,a);return dP(s)||fP(s)?{[s.const]:c}:{}}function vH(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,_H(e,t,n,o,i,a)],[])}function yH(e){return e.reduce((e,t)=>[...e,kN(t)],[])}function bH(e,t,n,r,i,a){return EF(yH(vH(e,t,n,hH(r),i,a)))}function xH(e,t,n,r,i,a,o){return NU([r])?JM(bH(e,t,n,r,i,a),{},o):lH(n,r,i,a,o)}function SH(e,t,n,r,i,a,o){return xH(e,t,n,BU(e,t,r),i,a,o)}function CH(e,t,n){let r=jM(e,t);return xM(t).filter(e=>n.includes(e)).reduce((e,n)=>({...e,[n]:Sz(r,n,t[n])}),{})}function wH(e,t,n){let r=jM(e,t);return xM(t).filter(e=>!n.includes(e)).reduce((e,n)=>({...e,[n]:BU(r,MU([],[]),t[n])}),{})}function TH(e,t,n){let r=cz(t),i=CH(e,t,r),a=wH(e,t,r);return JM({...i,...a},{},n)}function EH(e,t,n,r){return TH(e,n,r)}function DH(e,t={}){return ZM(`NonNullable`,[e],t)}function OH(e){return KB(e,CP([mP(),cI()]),{})}function kH(e,t){return NU([e])?JM(OH(e),{},t):DH(e,t)}function AH(e,t,n,r){return kH(BU(e,t,n),r)}function jH(e,t,n={}){return ZM(`Omit`,[e,t],n)}function MH(e){let t=dV(e);return AN(t)?t.properties:JN()}function NH(e,t){return xM(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function PH(e,t){return kN(NH(MH(e),EV(t)))}function FH(e,t,n){return NU([e,t])?JM(PH(e,t),{},n):jH(e,t,n)}function IH(e,t,n,r,i){return FH(BU(e,t,n),BU(e,t,r),i)}function LH(e,t={}){return ZM(`Parameters`,[e],t)}function RH(e){let t=fN(e)?e.parameters:[];return KP(FU({},MU([],[]),t))}function zH(e,t){return NU([e])?JM(RH(e),{},t):LH(e,t)}function BH(e,t,n,r){return zH(BU(e,t,n),r)}function VH(e,t={}){return ZM(`Partial`,[e],t)}function HH(e,t={}){return YH(e,t)}function UH(e,t){let n=JH(wz(e,t));return PN(jM(e,{[t]:n}),t)}function WH(e,t,n){return JH(wF(e,t,n))}function GH(e){return JH(EF(e))}function KH(e){return CP(e.map(e=>JH(e)))}function qH(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:CN(e[n])}),{}))}function JH(e){return FN(e)?UH(e.$defs,e.$ref):zN(e)?WH(e.if,e.then,e.else):KN(e)?GH(e.allOf):wP(e)?KH(e.anyOf):AN(e)?qH(e.properties):kN({})}function YH(e,t){return NU([e])?JM(JH(e),{},t):VH(e,t)}function XH(e,t,n,r){return YH(BU(e,t,n),r)}function ZH(e,t,n={}){return ZM(`Pick`,[e,t],n)}function QH(e,t){return xM(e).reduce((n,r)=>t.includes(r)?jM(n,{[r]:e[r]}):n,{})}function $H(e,t){return kN(QH(MH(e),EV(t)))}function eU(e,t,n){return NU([e,t])?JM($H(e,t),{},n):ZH(e,t,n)}function tU(e,t,n,r,i){return eU(BU(e,t,n),BU(e,t,r),i)}function nU(e,t={}){return ZM(`ReadonlyObject`,[e],t)}function rU(e){return WU(aN(e))}function iU(e,t){let n=uU(wz(e,t));return PN(jM(e,{[t]:n}),t)}function aU(e,t,n){return uU(wF(e,t,n))}function oU(e){return uU(EF(e))}function sU(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:QN(e[n])}),{}))}function cU(e){return WU(KP(e))}function lU(e){return CP(e.map(e=>uU(e)))}function uU(e){return oN(e)?rU(e.items):FN(e)?iU(e.$defs,e.$ref):zN(e)?aU(e.if,e.then,e.else):KN(e)?oU(e.allOf):AN(e)?sU(e.properties):qP(e)?cU(e.items):wP(e)?lU(e.anyOf):e}function dU(e,t){return NU([e])?JM(uU(e),{},t):nU(e)}function fU(e,t,n,r){return dU(BU(e,t,n),r)}function pU(e,t,n,r){return t.visited.includes(r)?n:r in e?BU(e,MU(t.callstack,[...t.visited,r]),e[r]):n}function mU(e,t){let n=yU(wz(e,t));return PN(jM(e,{[t]:n}),t)}function hU(e,t,n){return yU(wF(e,t,n))}function gU(e){return yU(EF(e))}function _U(e){return CP(e.map(e=>yU(e)))}function vU(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:nF(e[n])}),{}))}function yU(e){return FN(e)?mU(e.$defs,e.$ref):zN(e)?hU(e.if,e.then,e.else):KN(e)?gU(e.allOf):wP(e)?_U(e.anyOf):AN(e)?vU(e.properties):kN({})}function bU(e,t={}){return ZM(`Required`,[e],t)}function xU(e,t){return NU([e])?JM(yU(e),{},t):bU(e,t)}function SU(e,t,n,r){return xU(BU(e,t,n),r)}function CU(e,t={}){return ZM(`ReturnType`,[e],t)}function wU(e){return fN(e)?e.returnType:xN()}function TU(e,t){return NU([e])?JM(wU(e),{},t):CU(e,t)}function EU(e,t,n,r={}){return TU(BU(e,t,n),r)}function DU(e,t){return ZM(`With`,[e,t],{})}function OU(e,t){return NU([e])?JM(e,{},t):DU(e,t)}function kU(e,t,n,r){return OU(BU(e,t,n),r)}function AU(e){return oI(e)?qP(e.items)?jU(e.items.items):LN(e.items)||hN(e.items)?[e]:[xN()]:[e]}function jU(e){return e.reduce((e,t)=>[...e,...AU(t)],[])}function MU(e,t){return{callstack:e,visited:t}}function NU(e){return vM(e,(e,t)=>!hN(e)&&NU(t),()=>!0)}function PU(e,t,n){return xM(n).reduce((r,i)=>({...r,[i]:BU(e,t,n[i])}),{})}function FU(e,t,n){return jU(IU(e,t,n))}function IU(e,t,n){return n.map(n=>BU(e,t,n))}function LU(e,t){let n=TN(e)?rN(t,{}):t,r=$N(e)?eN(n,{}):n;return ZN(e)?HU(r,{}):r}function RU(e,t,n,r,i){return mM(n,`AddImmutable`)?UU(e,t,r[0],i):mM(n,`RemoveImmutable`)?hB(e,t,r[0],i):mM(n,`AddReadonly`)?tN(e,t,r[0],i):mM(n,`RemoveReadonly`)?ZP(e,t,r[0],i):mM(n,`AddOptional`)?iN(e,t,r[0],i):mM(n,`RemoveOptional`)?tF(e,t,r[0],i):mM(n,`Capitalize`)?NB(e,t,r[0],i):mM(n,`Conditional`)?BB(e,t,r[0],r[1],r[2],r[3],i):mM(n,`ConstructorParameters`)?WB(e,t,r[0],i):mM(n,`Evaluate`)?Nz(e,t,r[0],i):mM(n,`Exclude`)?qB(e,t,r[0],r[1],i):mM(n,`Extract`)?$B(e,t,r[0],r[1],i):mM(n,`Index`)?qV(e,t,r[0],r[1],i):mM(n,`InstanceType`)?ZV(e,t,r[0],i):mM(n,`Interface`)?$R(e,t,r[0],r[1],i):mM(n,`KeyOf`)?cH(e,t,r[0],i):mM(n,`Lowercase`)?PB(e,t,r[0],i):mM(n,`Mapped`)?SH(e,t,r[0],r[1],r[2],r[3],i):mM(n,`Module`)?EH(e,t,r[0],i):mM(n,`NonNullable`)?AH(e,t,r[0],i):mM(n,`Pick`)?tU(e,t,r[0],r[1],i):mM(n,`Parameters`)?BH(e,t,r[0],i):mM(n,`Partial`)?XH(e,t,r[0],i):mM(n,`Omit`)?IH(e,t,r[0],r[1],i):mM(n,`ReadonlyObject`)?fU(e,t,r[0],i):mM(n,`Record`)?qF(e,t,r[0],r[1],i):mM(n,`Required`)?SU(e,t,r[0],i):mM(n,`ReturnType`)?EU(e,t,r[0],i):mM(n,`TemplateLiteral`)?bL(e,t,r[0],i):mM(n,`Uncapitalize`)?FB(e,t,r[0],i):mM(n,`Uppercase`)?IB(e,t,r[0],i):mM(n,`With`)?kU(e,t,r[0],r[1]):ZM(n,r,i)}function zU(e,t,n){return LU(n,hN(n)?pU(e,t,n,n.$ref):oN(n)?aN(BU(e,t,n.items),sN(n)):fB(n)?uB(e,t,n.target,n.arguments):lN(n)?cN(IU(e,t,n.parameters),BU(e,t,n.instanceType),uN(n)):fN(n)?dN(IU(e,t,n.parameters),BU(e,t,n.returnType),pN(n)):zN(n)?RN(BU(e,t,n.if),BU(e,t,n.then),BU(e,t,n.else),BN(n)):KN(n)?GN(IU(e,t,n.allOf),qN(n)):AN(n)?kN(PU(e,t,n.properties),jN(n)):iI(n)?$F(tI(n),BU(e,t,rI(n))):oI(n)?aI(BU(e,t,n.items)):qP(n)?KP(FU(e,t,n.items),JP(n)):wP(n)?CP(IU(e,t,n.anyOf),TP(n)):n)}function BU(e,t,n){return QM(n)?RU(e,t,n.action,n.parameters,n.options):zU(e,t,n)}function VU(e){return JM(e,{"~immutable":!0},{})}function HU(e,t){return JM(VU(e),{},t)}function UU(e,t,n,r){return HU(BU(e,t,n),r)}function WU(e,t={}){return HU(e,t)}var GU=[`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],KU=[`off`,...GU],qU=[`text`,`image`],JU=[`none`,`short`,`long`],YU=[`short`,`long`];UN(GU);var XU=UN(KU);UN(qU),UN(JU),HH(QF(XU,CP([xP(),mP()]))),HH(QF(UN(YU),_P({exclusiveMinimum:0})),{description:`Best-effort prompt cache lifetime in seconds for each retention tier. A missing tier means the lifetime is unknown, so Pi does not warm it.`});var ZU={input:_P({description:`Input cost in USD per million tokens.`}),output:_P({description:`Output cost in USD per million tokens.`}),cacheRead:_P({description:`Cache-read cost in USD per million tokens.`}),cacheWrite:_P({description:`Cache-write cost in USD per million tokens.`})};kN(ZU);var QU=kN({inputTokensAbove:_P({description:`Use this tier when total request input exceeds this token count.`}),...ZU});kN({...ZU,tiers:wN(aN(QU,{description:`Request-wide pricing tiers. The highest matching input threshold applies to the full request.`}))});function $U(e){return kN({maxWidth:wN(aP({minimum:1})),maxHeight:wN(aP({minimum:1})),maxBytes:wN(aP({minimum:1,description:`Maximum base64-encoded payload size in bytes.`})),jpegQuality:wN(aP({minimum:1,maximum:100}))},e)}$U();var eW=kN({resize:wN($U({description:`Cache-safe resize profile applied before a new image enters conversation history.`})),maxPerMessage:wN(aP({minimum:1,description:`Maximum images accepted in one provider message.`})),maxPerRequest:wN(aP({minimum:1,description:`Maximum images accepted across one provider request.`}))});kN({maxRequestBytes:wN(aP({minimum:1,description:`Maximum serialized provider request size in bytes.`})),images:wN(eW)});function tW({sessionId:e,template:t,existingIds:n,apiKey:r,onClose:i,onAdd:a}){let{t:o}=W(),[s,c]=(0,K.useState)([]),[l,u]=(0,K.useState)(new Set),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)(!0),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(0),x=(0,K.useRef)({template:t,apiKey:r,existingIds:n}),S=new Set(n),C=Math.max(0,100-S.size),w=s.filter(e=>`${e.id} ${e.name}`.toLowerCase().includes(d.trim().toLowerCase())),T=w.filter(e=>!S.has(e.id)),E=T.length>0&&T.every(e=>l.has(e.id));return(0,K.useEffect)(()=>{let t=new AbortController,{template:n,apiKey:r,existingIds:i}=x.current;return m(!0),v(!1),new de().discoverProviderModels(e,{provider:n.provider,baseUrl:n.baseUrl,api:n.api,...r.trim()?{apiKey:r.trim()}:{}},t.signal).then(e=>{t.signal.aborted||(c(e.models),g(e.truncated),m(!1),u(new Set(e.models.filter(e=>!i.includes(e.id)).slice(0,Math.max(0,100-i.length)).map(e=>e.id))))},()=>{t.signal.aborted||(v(!0),m(!1))}),()=>t.abort()},[e,y]),(0,q.jsx)(Se,{isOpen:!0,width:380,padding:0,className:`models-picker-dialog`,"aria-label":o(`providerPickerTitle`),onOpenChange:e=>!e&&i(),children:(0,q.jsxs)(`div`,{className:`models-picker`,children:[(0,q.jsxs)(`header`,{children:[(0,q.jsx)(`h2`,{children:o(`providerPickerTitle`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":o(`close`),onClick:i,children:(0,q.jsx)(je,{})})]}),(0,q.jsx)(`p`,{children:o(`providerPickerIntro`)}),(0,q.jsxs)(`div`,{className:`models-picker-toolbar`,children:[(0,q.jsx)(`input`,{"data-autofocus":!0,type:`search`,"aria-label":o(`providerPickerSearch`),placeholder:o(`providerPickerSearch`),value:d,onKeyDown:e=>{e.key===`Enter`&&e.preventDefault()},onChange:e=>f(e.target.value)}),(0,q.jsx)(`button`,{type:`button`,className:`models-link`,disabled:p||!T.length,onClick:()=>u(e=>{let t=new Set(e);for(let e of T)E?t.delete(e.id):t.size(0,q.jsxs)(`label`,{className:`models-picker-row`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:S.has(e.id)||l.has(e.id),disabled:S.has(e.id)||!l.has(e.id)&&l.size>=C,onChange:t=>u(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}),(0,q.jsx)(`span`,{title:e.name,children:e.id}),S.has(e.id)&&(0,q.jsx)(`small`,{children:o(`providerPickerAdded`)})]},e.id)),!p&&!_&&!w.length&&(0,q.jsx)(`p`,{className:`models-picker-empty`,children:o(d?`providerPickerNoMatch`:`providerPickerEmpty`)}),_&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[(0,q.jsx)(`p`,{children:o(`providerPickerError_load`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:()=>b(e=>e+1),children:o(`retryAdmissionCheck`)})]})]}),h&&(0,q.jsx)(`p`,{className:`models-hint`,children:o(`providerPickerBounded`)}),(0,q.jsxs)(`footer`,{children:[(0,q.jsx)(`span`,{className:`models-hint`,"aria-live":`polite`,children:l.size>0&&o(`providerPickerSelected`,{count:l.size})}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:i,children:o(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:!l.size||p||_,onClick:()=>a(s.filter(e=>l.has(e.id))),children:o(`providerPickerSave`)})]})]})})}function nW(e){let t=e.trim();if(!t)return;let n=/^(\d+(?:\.\d+)?)([km])?$/i.exec(t);if(!n)return NaN;let r=n[2]?.toLowerCase()===`m`?1e6:n[2]?.toLowerCase()===`k`?1e3:1,i=Number(n[1])*r,a=Math.round(i),o=Math.abs(i-a)<1e-6?a:i;return Number.isSafeInteger(o)&&o>0&&o<=1e8?o:NaN}function rW(e){if(e===void 0)return``;if(Number.isInteger(e)&&e>0){if(e%1e6==0)return`${e/1e6}M`;if(e%1e3==0)return`${e/1e3}K`}return String(e)}function iW({sessionId:e,providerId:t,configuration:n,auth:r,isNew:i,custom:a,taken:o,currentModel:s,availableModels:c,busy:l,onDirty:u,onSaving:d,onClose:f,onReload:p}){let{t:m}=W(),[h]=(0,K.useState)(()=>{let e=n.providers?.find(e=>e.provider===t),i=n.models.filter(e=>e.provider===t).map(e=>({...e,rowKey:crypto.randomUUID()}));return{provider:t,name:e?.name||r?.name||t,baseUrl:e?.baseUrl||i[0]?.baseUrl||r?.baseUrl||``,api:e?.api||i[0]?.api||r?.api||`openai-completions`,models:i}}),[g]=(0,K.useState)(n.revision),[_,v]=(0,K.useState)(h),[y,b]=(0,K.useState)(``),x=!i&&!!r?.authMethods.includes(`oauth`),S=a||!!r?.authMethods.includes(`api_key`),[C,w]=(0,K.useState)(x&&(!r?.configured||r?.subscription||!S)?`oauth`:`api_key`),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1),k=(0,K.useRef)(null),A=(0,K.useRef)(!1),[j,M]=(0,K.useState)(new Set),[N,P]=(0,K.useState)({}),[F,I]=(0,K.useState)(!1),[ee,L]=(0,K.useState)(null),[R,te]=(0,K.useState)(!1),z=(0,K.useRef)(null),B=(0,K.useRef)({onDirty:u,onSaving:d});B.current={onDirty:u,onSaving:d};let ne=JSON.stringify(_)!==JSON.stringify(h),re=ne||y.length>0;(0,K.useEffect)(()=>{B.current.onDirty(re)},[re]),(0,K.useEffect)(()=>{B.current.onSaving(F||T)},[F,T]),(0,K.useEffect)(()=>{D?A.current=!0:A.current&&(A.current=!1,k.current?.focus({preventScroll:!0}))},[D]),(0,K.useEffect)(()=>()=>{z.current?.abort(),B.current.onSaving(!1),B.current.onDirty(!1)},[]);let V=n.providers?.find(e=>e.provider===t)?.editable!==!1,ie=l||F||T,ae=ie||R||!V,oe=!/^[a-zA-Z0-9._-]+$/.test(_.provider)||[`__proto__`,`constructor`,`prototype`].includes(_.provider)||i&&a&&o.includes(_.provider),se=_.models.findIndex(e=>!e.id.trim()||[e.contextWindow,e.maxTokens].some(e=>e!==void 0&&!Number.isFinite(e))||_.models.some(t=>t.rowKey!==e.rowKey&&t.id.trim()===e.id.trim())),ce=se!==-1,le=i&&a||ne,H=!oe&&!/[\r\n\u0000]/u.test(y)&&(R||!le||(!a||_.models.length>0)&&!ce&&!!_.baseUrl)&&(le||y.trim().length>0),ue=e=>{v(t=>({...t,...e})),ee!==`conflict`&&L(null)},fe=(e,t)=>ue({models:_.models.map((n,r)=>r===e?{...n,...t}:n)}),pe=_.models.map(e=>n.thinkingDefaults?.[`${e.provider}/${e.id}`]),me=_.models.map((e,t)=>{let n=e.thinkingLevelMap??pe[t];return KU.filter(e=>n?.[e]!==null&&(e!==`xhigh`&&e!==`max`||n?.[e]!==void 0))}),he={id:``,name:``,reasoning:!1,provider:_.provider,baseUrl:_.baseUrl,api:_.api},_e=async()=>{if(ie||D||!H||ee===`conflict`)return;let t=new AbortController;z.current=t,I(!0),L(null);let n=R,r=new de;try{if(le&&!n){if(await r.changeProviderConfiguration(e,g,{action:`save`,configuration:{..._,name:_.name.trim()||_.provider,models:_.models.map(({rowKey:e,...t})=>({...t,id:t.id.trim(),name:t.name.trim()||t.id.trim(),provider:_.provider,baseUrl:_.baseUrl===h.baseUrl&&t.baseUrl||_.baseUrl,api:_.api===h.api?t.api:_.api}))}},t.signal),t.signal.aborted)return;n=!0,te(!0)}if(y.trim()&&await r.saveProviderKey(e,_.provider,y.trim(),t.signal),t.signal.aborted)return;b(``),B.current.onDirty(!1),f(_.name||_.provider,_.provider)}catch(e){t.signal.aborted||L(e instanceof ge&&e.code===`MODEL_CONFIGURATION_CONFLICT`?`conflict`:e instanceof ge&&e.code===`MODEL_NOT_AVAILABLE`?`current`:n?`key`:`failed`)}finally{t.signal.aborted||I(!1)}},ve=e=>(0,q.jsxs)(`label`,{className:`models-field`,children:[m(e===`name`?`providerDisplayName`:`modelConfig_${e}`),(0,q.jsx)(`input`,{type:e===`baseUrl`?`url`:`text`,value:_[e],maxLength:e===`baseUrl`?2048:160,autoComplete:`off`,disabled:ae,required:e===`provider`||e===`baseUrl`&&le,"aria-invalid":e===`provider`&&_.provider.length>0&&oe,placeholder:e===`provider`?`my-provider`:e===`name`?_.provider:`https://api.example.com/v1`,onChange:t=>ue({[e]:t.target.value})})]}),ye=(0,q.jsxs)(`label`,{className:`models-field`,htmlFor:`provider-api-${t||`custom`}`,children:[m(`modelConfig_api`),(0,q.jsx)(Tj,{id:`provider-api-${t||`custom`}`,label:m(`modelConfig_api`),value:_.api,disabled:ae,onChange:e=>{(e===`openai-responses`||e===`openai-completions`||e===`anthropic-messages`)&&ue({api:e})},options:[{value:`openai-completions`,label:`OpenAI Chat Completions`},{value:`openai-responses`,label:`OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`}]})]}),be=(0,q.jsxs)(`div`,{className:`models-catalog`,children:[(0,q.jsxs)(`div`,{className:`models-list-head`,children:[(0,q.jsx)(`span`,{children:m(`modelSettings`)}),(0,q.jsx)(`button`,{type:`button`,ref:k,className:`models-link`,disabled:ae||oe||!_.baseUrl,onClick:()=>O(!0),children:m(`providerFetchModels`)})]}),!V&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerModelsReadOnly`)}),_.models.length===0&&(0,q.jsx)(`p`,{className:`models-empty`,children:m(a?`providerModelsEmpty`:`providerModelsInherited`,{count:c.length})}),(0,q.jsxs)(`div`,{className:`models-entry-list`,children:[s&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerCurrentSessionModel`,{model:`${s.provider} / ${s.id}`})}),_.models.map((e,t)=>(0,q.jsxs)(`div`,{className:`models-entry`,children:[s?.provider===_.provider&&s.id===e.id&&(0,q.jsx)(`p`,{className:`models-current-label`,children:m(`currentModel`)}),(0,q.jsxs)(`div`,{className:`models-entry-row`,children:[(0,q.jsx)(`input`,{"aria-label":m(`providerModelId`,{number:t+1}),placeholder:m(`modelConfig_id`),value:e.id,maxLength:256,required:!0,disabled:ae||s?.provider===_.provider&&s.id===e.id,onChange:e=>fe(t,{id:e.target.value})}),(0,q.jsx)(`input`,{"aria-label":m(`providerModelName`,{number:t+1}),placeholder:m(`modelConfig_name`),value:e.name,maxLength:256,disabled:ae,onChange:e=>fe(t,{name:e.target.value})}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":m(`providerModelDetails`,{model:e.name||e.id||t+1}),"aria-expanded":j.has(e.rowKey),title:m(`providerModelOptions`),onClick:()=>M(t=>{let n=new Set(t);return n.delete(e.rowKey)||n.add(e.rowKey),n}),children:(0,q.jsx)(os,{})}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon danger`,"aria-label":m(`providerRemoveModel`,{model:e.name||e.id||t+1}),disabled:ae||s?.provider===_.provider&&s.id===e.id,title:s?.provider===_.provider&&s.id===e.id?m(`providerCurrentRemoval`):m(`providerRemoveModel`,{model:e.name||e.id||t+1}),onClick:()=>{ue({models:_.models.filter((e,n)=>n!==t)}),M(t=>new Set([...t].filter(t=>t!==e.rowKey))),P(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.rowKey)))},children:(0,q.jsx)(Uc,{})})]}),j.has(e.rowKey)&&(0,q.jsxs)(`div`,{className:`models-entry-details`,children:[[`contextWindow`,`maxTokens`].map(n=>(0,q.jsxs)(`label`,{className:`models-field models-capacity`,children:[m(`modelConfig_${n}`),(0,q.jsx)(`input`,{type:`text`,inputMode:`numeric`,autoComplete:`off`,spellCheck:!1,"aria-label":m(`providerCapacityLabel`,{field:m(`modelConfig_${n}`),number:t+1}),"aria-invalid":e[n]!==void 0&&!Number.isFinite(e[n]),placeholder:n===`contextWindow`?`256K`:`32K`,value:N[e.rowKey]?.[n]??rW(e[n]),disabled:ae,onChange:r=>{let i=r.target.value;P(t=>({...t,[e.rowKey]:{...t[e.rowKey],[n]:i}})),fe(t,{[n]:nW(i)})}})]},n)),(0,q.jsxs)(`fieldset`,{className:`models-input-types`,"aria-label":m(`providerCapacityLabel`,{field:m(`providerInputTypes`),number:t+1}),children:[(0,q.jsx)(`legend`,{children:m(`providerInputTypes`)}),(0,q.jsx)(`div`,{children:[`text`,`image`].map(n=>{let r=e.input??[`text`];return(0,q.jsxs)(`label`,{className:`models-checkbox`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:r.includes(n),disabled:ae||r.length===1&&r.includes(n),onChange:e=>fe(t,{input:[`text`,`image`].filter(t=>t===n?e.target.checked:r.includes(t))})}),m(n===`text`?`providerInputText`:`providerInputImage`)]},n)})})]}),(0,q.jsx)(`p`,{className:`models-hint models-capability-hint`,children:m(`providerImageHint`)}),(0,q.jsxs)(`label`,{className:`models-checkbox models-reasoning`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:e.reasoning,disabled:ae,onChange:e=>fe(t,{reasoning:e.target.checked})}),m(`modelConfig_reasoning`)]}),(0,q.jsx)(`p`,{className:`models-hint models-capability-hint`,children:m(`providerReasoningHint`)}),e.reasoning&&(0,q.jsxs)(`div`,{className:`models-thinking-levels`,children:[(0,q.jsxs)(`div`,{className:`models-thinking-copy`,children:[(0,q.jsx)(`strong`,{children:m(`providerThinkingLevels`)}),(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerThinkingLevelsHint`)})]}),(0,q.jsx)(yo,{button:{label:e.thinkingLevelMap==null?m(`providerThinkingAutomatic`):m(`providerThinkingSelected`,{count:me[t].length}),"aria-label":m(`providerCapacityLabel`,{field:m(`providerThinkingLevels`),number:t+1}),variant:`secondary`,size:`sm`,className:`models-thinking-trigger`,isDisabled:ae},className:`configuration-level-menu`,menuWidth:`min(240px, calc(100vw - 32px))`,alignment:`end`,children:KU.map(n=>{let r=me[t],i=r.includes(n);return(0,q.jsx)(Ro,{label:n,value:i,isDisabled:ae||i&&r.length===1,endContent:(0,q.jsx)(`span`,{className:`configuration-check`,children:i&&(0,q.jsx)(rs,{"aria-hidden":`true`})}),onChange:i=>{fe(t,{thinkingLevelMap:Object.fromEntries(KU.map(a=>{let o=a===n?i:r.includes(a),s=h.models.find(t=>t.rowKey===e.rowKey)?.thinkingLevelMap?.[a];return[a,o?e.thinkingLevelMap?.[a]??s??pe[t]?.[a]??(a===`off`?`none`:a):null]}))})}},n)})}),e.thinkingLevelMap!=null&&(0,q.jsx)(`button`,{type:`button`,className:`models-link models-thinking-reset`,disabled:ae,onClick:()=>fe(t,{thinkingLevelMap:null}),children:m(`providerThinkingReset`)})]})]})]},e.rowKey))]}),(0,q.jsxs)(`button`,{type:`button`,className:`models-button models-add-model`,disabled:ae||_.models.length>=100,onClick:()=>{ue({models:[..._.models,{...he,rowKey:crypto.randomUUID()}]})},children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),m(`addModel`)]}),ce&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:m(`providerModelInvalid`,{number:se+1})})]});return(0,q.jsxs)(`form`,{className:`models-editor`,onSubmit:e=>{e.preventDefault(),_e()},children:[!i&&a&&(0,q.jsxs)(`div`,{className:`models-editor-heading`,children:[(0,q.jsx)(`span`,{children:_.name||_.provider}),_.name!==_.provider&&(0,q.jsx)(`small`,{children:_.provider})]}),i&&a&&(0,q.jsxs)(q.Fragment,{children:[ve(`provider`),_.provider&&oe&&(0,q.jsx)(`p`,{className:`models-error`,children:m(`providerIdInvalid`)}),ve(`name`),ve(`baseUrl`),ye]}),x&&S&&(0,q.jsxs)(`fieldset`,{className:`models-add-modes`,"aria-label":m(`accountLoginMethod`),children:[(0,q.jsx)(`button`,{type:`button`,"aria-pressed":C===`oauth`,disabled:ie,onClick:()=>w(`oauth`),children:m(`accountLoginTab`)}),(0,q.jsx)(`button`,{type:`button`,"aria-pressed":C===`api_key`,disabled:ie,onClick:()=>w(`api_key`),children:m(`accountLoginKeyTab`)})]}),x&&C===`oauth`&&r&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(iM,{sessionId:e,auth:r,busy:l||F||re,onSaving:E,onAuthenticated:()=>f(_.name||_.provider,_.provider),onReload:p}),re&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`accountLoginUnsaved`)})]}),S&&C===`api_key`?(0,q.jsxs)(`label`,{className:`models-field`,children:[m(`providerApiKey`),(0,q.jsx)(`input`,{type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:8192,value:y,placeholder:m(r?.configured?`providerKeyKeep`:`providerKeyOptional`),disabled:ie,onChange:e=>{b(e.target.value),ee!==`conflict`&&L(null)}})]}):x?null:(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerNativeAuth`)}),i&&a?be:(0,q.jsxs)(`details`,{className:`models-customized`,children:[(0,q.jsx)(`summary`,{children:m(`providerCustomSettings`)}),(0,q.jsxs)(`div`,{children:[a&&ve(`name`),ve(`baseUrl`),a&&ye,be]})]}),ee&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:m(ee===`conflict`?`modelConfigurationConflict`:ee===`key`?`providerProfileSavedKeyFailed`:ee===`current`?`providerCurrentRemoval`:`providerConfigurationFailed`)}),ee===`conflict`&&(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:p,children:m(`providerReload`)}),!T&&(0,q.jsxs)(`div`,{className:`models-editor-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:F,onClick:()=>R?p():f(),children:m(`cancel`)}),(C===`api_key`||ne)&&(0,q.jsx)(`button`,{type:`submit`,className:`models-button primary`,disabled:ie||!H||ee===`conflict`,"aria-busy":F,children:m(F?`savingSettings`:`providerSave`)})]}),D&&(0,q.jsx)(tW,{sessionId:e,template:he,existingIds:_.models.map(e=>e.id),apiKey:y,onClose:()=>O(!1),onAdd:e=>{ue({models:[..._.models,...e.map(e=>({...he,...e,rowKey:crypto.randomUUID()}))]}),O(!1)}})]})}function aW({sessionId:e,sessionPath:t,provider:n,purpose:r,initialModel:i,busy:a,onSelectModel:o,onDefaultSaved:s,onSaving:c,onClose:l}){let{t:u}=W(),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)([]),[h,g]=(0,K.useState)(i?`${i.provider}/${i.id}`:``),[_,v]=(0,K.useState)(!0),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(0),[C,w]=(0,K.useState)(0),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1),[k,A]=(0,K.useState)(null);(0,K.useEffect)(()=>{let t=new AbortController;v(!0),b(!1);let r=window.setTimeout(()=>{new de().searchModels(d.trim(),e,t.signal,n).then(e=>{t.signal.aborted||(m(e.models),S(e.truncation.matchesOmitted),v(!1))},()=>{t.signal.aborted||(b(!0),v(!1))})},d?200:0);return()=>{t.abort(),window.clearTimeout(r)}},[e,n,d,C]);let j=p.find(e=>`${e.provider}/${e.id}`===h)??p[0],M=new Map;for(let e of p){let t=M.get(e.provider);t?t.push(e):M.set(e.provider,[e])}let N=async()=>{if(!j||_||D||a||!t)return;O(!0),c(!0),A(null);let n=!1;try{if(r===`use`){if(!await o(`${j.provider}/${j.id}`))throw Error(`selection failed`);n=!0}(r==="default"||T)&&s(await new de().saveModelDefault(j.provider,j.id,e,t)),l()}catch{A(n?`modelDefaultPartial`:r==="default"?`modelDefaultSaveFailed`:`modelConnectionUseFailed`)}finally{O(!1),c(!1)}};return(0,q.jsxs)(`div`,{className:`models-connection-choice`,children:[(0,q.jsx)(`p`,{className:`models-hint`,children:u(r==="default"?`modelDefaultHint`:`modelConnectionNextHint`)}),(p.length>8||x>0||d)&&(0,q.jsx)(`input`,{type:`search`,"aria-label":u(`modelConnectionSearch`),placeholder:u(`modelConnectionSearch`),maxLength:200,value:d,disabled:D,onChange:e=>f(e.target.value)}),y?(0,q.jsxs)(`p`,{className:`models-error`,role:`alert`,children:[u(`modelConnectionLoadFailed`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:()=>w(e=>e+1),children:u(`retryAdmissionCheck`)})]}):_?(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`loadingModels`)}):p.length?(0,q.jsx)(nM,{label:u(`selectModel`),className:`models-provider-picker`,placement:`below`,value:j?`${j.provider}/${j.id}`:``,isDisabled:D,options:[...M].map(([e,t])=>({type:`section`,title:e,options:t.map(e=>({value:`${e.provider}/${e.id}`,label:e.name||e.id,description:`${e.provider} · ${e.id}`,icon:(0,q.jsx)(Yk,{id:e.provider})}))})),onChange:e=>g(e)}):(0,q.jsx)(`p`,{className:`models-hint`,children:u(d?`modelConnectionNoMatch`:`modelConnectionNoModels`)}),x>0&&!_&&(0,q.jsx)(`p`,{className:`models-hint`,children:u(`modelConnectionMore`,{count:x})}),r===`use`&&(0,q.jsxs)(`label`,{className:`models-checkbox`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:T,disabled:D,onChange:e=>E(e.target.checked)}),u(`modelMakeDefault`)]}),k&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:u(k)}),(0,q.jsxs)(`div`,{className:`models-editor-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:D,onClick:l,children:u(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button primary`,disabled:D||a||_||y||!j||!t,onClick:()=>void N(),children:u(D?`providerSaving`:r==="default"?`modelDefaultSave`:`modelConnectionUse`)})]})]})}function oW({sessionId:e,sessionPath:t,models:n,currentModel:r,busy:i,focusCredentials:a,onSaved:o,onSelectModel:s,onDraftChange:c,onSavingChange:l}){let{t:u}=W(),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(0),[h,g]=(0,K.useState)(!0),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(null),[x,S]=(0,K.useState)([]),[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(`account`),[D,O]=(0,K.useState)(``),[k,A]=(0,K.useState)(``),[j,M]=(0,K.useState)({}),[N,P]=(0,K.useState)(!1),[F,I]=(0,K.useState)({}),[ee,L]=(0,K.useState)(!1),R=N||ee||Object.values(F).some(Boolean),[te,z]=(0,K.useState)(null),[B,ne]=(0,K.useState)(!1),[re,V]=(0,K.useState)(null),[ie,ae]=(0,K.useState)(null),[oe,se]=(0,K.useState)(null),[ce,le]=(0,K.useState)(null),H=(0,K.useRef)(null),ue=(0,K.useRef)(a),fe=(0,K.useRef)(null),pe=(0,K.useRef)(new Map),me=(0,K.useRef)(null),he=(0,K.useRef)(null),_e=(0,K.useRef)({onDraftChange:c,onSavingChange:l});_e.current={onDraftChange:c,onSavingChange:l},(0,K.useEffect)(()=>{c(Object.values(j).some(Boolean))},[j,c]),(0,K.useEffect)(()=>{l(R)},[R,l]),(0,K.useEffect)(()=>{!re&&!R&&he.current&&(he.current.focus({preventScroll:!0}),he.current=null)},[re,R]),(0,K.useEffect)(()=>{if(!fe.current)return;let e=fe.current;fe.current=null,(pe.current.get(e)??me.current)?.focus({preventScroll:!0})}),(0,K.useEffect)(()=>()=>{H.current?.abort(),_e.current.onDraftChange(!1),_e.current.onSavingChange(!1)},[]),(0,K.useEffect)(()=>{let t=new AbortController;g(!0),v(!1);let n=new de;return Promise.all([n.modelConfigurations(e,t.signal),n.providerAuth(e,t.signal)]).then(([e,n])=>{if(!t.signal.aborted&&(f({configuration:e,auth:n}),g(!1),ue.current)){ue.current=!1;let e=r?.provider||n.providers.find(e=>e.configured)?.id;e&&(b(e),S([e]))}},()=>{t.signal.aborted||(v(!0),g(!1))}),()=>t.abort()},[e,p,r?.provider]),(0,K.useEffect)(()=>{let t=new AbortController;return ne(!1),new de().modelDefaults(e,t.signal).then(e=>{t.signal.aborted||z(e)},()=>{t.signal.aborted||ne(!0)}),()=>t.abort()},[e,p]);let ve=d?.configuration,ye=new Set([...ve?.providers?.map(e=>e.provider)??[],...ve?.models.map(e=>e.provider)??[]]),be=new Set([...ye,...d?.auth.providers.filter(e=>e.configured).map(e=>e.id)??[],...n.map(e=>e.provider),...x.filter(e=>!e.startsWith(`add:`))]),xe=[...be].map(e=>{let t=d?.auth.providers.find(t=>t.id===e);return{id:e,name:ve?.providers?.find(t=>t.provider===e)?.name||t?.name||e,auth:t}}),Se=d?.auth.providers.filter(e=>e.authMethods.includes(`api_key`)&&!be.has(e.id))??[],Ce=d?.auth.providers.filter(e=>e.authMethods.includes(`oauth`)&&!e.subscription)??[],we=Ce.find(e=>e.id===D)??Ce[0],Te=Se.find(e=>e.id===k)??Se[0],Ee=[{id:`account`,label:`accountLoginTab`,hint:`providerAccountHint`,available:Ce.length>0},{id:`catalog`,label:`providerAddCatalog`,hint:`providerCatalogHint`,available:Se.length>0},{id:`custom`,label:`providerAddCustom`,hint:`providerCustomHint`,available:!0}],U=e=>{E(e);let t=e===`custom`?`add:custom`:e===`account`?we&&`add:account:${we.id}`:Te&&`add:${Te.id}`;t&&S(e=>e.includes(t)?e:[...e,t])},De=e=>{he.current=null,V(null),ae(null),w(!1),b(y===e?null:e),S(t=>t.includes(e)?t:[...t,e])},Oe=(e,t,n)=>{he.current=null,fe.current=e;let r=t=>e.startsWith(`add:`)?t.startsWith(`add:`):t===e;S(e=>e.filter(e=>!r(e))),M(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!r(e)))),e.startsWith(`add:`)?w(!1):b(null),t&&(ae(t),V({purpose:`use`,provider:n??e}),m(e=>e+1),o().catch(()=>!1))},ke=(t,a,s,c)=>{if(!ve)return null;let l=d?.auth.providers.find(e=>e.id===a),f=e=>I(n=>n[t]===e?n:{...n,[t]:e}),p=()=>{Oe(t),m(e=>e+1),o().catch(()=>!1)};return t.startsWith(`add:account:`)?l&&(0,q.jsxs)(`div`,{className:`models-editor`,children:[(0,q.jsx)(iM,{sessionId:e,auth:l,busy:i,onSaving:f,onAuthenticated:()=>Oe(t,l.name||l.id,l.id),onReload:p}),!F[t]&&(0,q.jsx)(`div`,{className:`models-editor-actions`,children:(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:()=>Oe(t),children:u(`cancel`)})})]}):(0,q.jsx)(iW,{sessionId:e,providerId:a,configuration:ve,auth:l,isNew:s,custom:c,taken:[...d?.auth.providers.map(e=>e.id)??[],...ye],currentModel:r,availableModels:n.filter(e=>e.provider===a),busy:i,onDirty:e=>M(n=>n[t]===e?n:{...n,[t]:e}),onSaving:f,onClose:(e,n)=>Oe(t,e,n),onReload:p},t)},G=e=>xe.find(t=>t.id===e)?.name??e,je=e=>n.find(t=>t.provider===e.provider&&t.id===e.id)?.name||e.id,Me=(e,t,n)=>{he.current=t,V({purpose:e,provider:n}),b(null),w(!1)},Ne=(n,a)=>(0,q.jsx)(aW,{sessionId:e,sessionPath:t,provider:a,purpose:n,initialModel:n==="default"?te?.model:r,busy:i,onSelectModel:s,onDefaultSaved:e=>{z(e),ne(!1),o().catch(()=>!1)},onSaving:L,onClose:()=>{V(null)}},`${n}:${a??`all`}`);return(0,q.jsxs)(`div`,{className:`settings-content-page models-page`,children:[(0,q.jsxs)(`div`,{className:`models-section`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:u(`modelSettings`)}),(0,q.jsx)(`p`,{children:u(`modelsIntro`)})]})}),ie&&(0,q.jsxs)(`p`,{className:`models-saved`,role:`status`,children:[u(`providerSaved`,{provider:ie}),r&&(0,q.jsxs)(`span`,{children:[` `,u(`providerCurrentSessionModel`,{model:`${r.provider} / ${r.id}`})]})]}),_&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[u(`providerLoadFailed`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:h,onClick:()=>m(e=>e+1),children:u(`retryAdmissionCheck`)})]}),ce&&!oe&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[ce,` `,(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:h,onClick:()=>{le(null),m(e=>e+1)},children:u(`refreshStatus`)})]}),!d&&h&&(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`providerLoading`)}),(0,q.jsxs)(`div`,{className:`models-default-card`,children:[(0,q.jsxs)(`div`,{className:`models-default-row`,children:[(0,q.jsxs)(`div`,{className:`models-default-copy`,children:[(0,q.jsx)(`span`,{className:`models-default-title`,children:u(`modelDefaultTitle`)}),B?(0,q.jsx)(`span`,{className:`models-hint`,children:u(`modelDefaultReadFailed`)}):te?.model?(0,q.jsxs)(`span`,{className:`models-default-value`,children:[(0,q.jsx)(`span`,{className:`models-default-avatar`,"aria-hidden":`true`,children:(0,q.jsx)(Yk,{id:te.model.provider,modelId:te.model.id})}),(0,q.jsxs)(`span`,{children:[je(te.model),(0,q.jsx)(`small`,{children:G(te.model.provider)})]})]}):(0,q.jsx)(`span`,{className:`models-hint`,children:u(te?`modelDefaultNotSet`:`loadingModels`)})]}),(0,q.jsxs)(`button`,{type:`button`,className:`models-button primary models-default-choose`,disabled:R||i||Object.values(j).some(Boolean)||!t,"aria-expanded":re?.purpose==="default",onClick:e=>B?m(e=>e+1):re?.purpose==="default"?V(null):Me(`default`,e.currentTarget),children:[(0,q.jsx)(`span`,{children:u(B?`refreshStatus`:`modelDefaultChoose`)}),!B&&(0,q.jsx)(os,{"aria-hidden":`true`})]})]}),te?.projectOverride&&(0,q.jsx)(`p`,{className:`models-hint`,children:u(`modelDefaultProjectOverride`,{model:`${G(te.projectOverride.provider)} / ${je(te.projectOverride)}`})}),re?.purpose==="default"&&Ne(`default`)]}),(0,q.jsxs)(`div`,{className:`models-connections-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:u(`modelConnectionsTitle`)}),(0,q.jsx)(`p`,{children:u(`modelConnectionsIntro`)})]}),(0,q.jsx)(`span`,{"aria-hidden":`true`,children:xe.length})]}),(0,q.jsx)(`ul`,{className:`models-provider-list`,children:xe.map(e=>{let n=!C&&y===e.id,a=e.auth?.custom??ye.has(e.id);return(0,q.jsxs)(`li`,{className:`models-provider-card`,children:[(0,q.jsxs)(`div`,{className:`models-provider-head`,children:[(0,q.jsxs)(`div`,{className:`models-provider-identity`,children:[(0,q.jsx)(`span`,{className:`models-provider-avatar`,"aria-hidden":`true`,children:(0,q.jsx)(Yk,{id:e.id})}),(0,q.jsxs)(`div`,{className:`models-provider-label`,children:[(0,q.jsx)(`span`,{className:`models-provider-name`,children:e.name}),a&&(0,q.jsx)(`span`,{className:`models-provider-tag`,children:u(`providerCustomTag`)}),te?.model?.provider===e.id&&(0,q.jsx)(`span`,{className:`models-provider-tag is-default`,children:u(`modelDefaultBadge`)}),r?.provider===e.id&&(0,q.jsx)(`span`,{className:`models-provider-tag is-current`,children:u(`modelCurrentBadge`)}),e.auth&&(0,q.jsxs)(`span`,{className:`models-provider-status`,children:[(0,q.jsx)(`span`,{className:`models-credential-dot ${e.auth.configured?`configured`:`missing`}`,role:`img`,"aria-label":u(e.auth.configured?`credentialConfigured`:`credentialMissing`),title:u(e.auth.configured?`credentialConfigured`:`credentialMissing`)}),u(e.auth.subscription?`accountLoginConfigured`:e.auth.configured?`credentialConfigured`:`credentialMissing`)]})]})]}),(0,q.jsxs)(`div`,{className:`models-provider-actions`,children:[e.auth?.configured&&(0,q.jsx)(`button`,{type:`button`,className:`models-button models-select-connection`,disabled:R||i||Object.values(j).some(Boolean)||!t,"aria-label":u(`modelConnectionChooseProvider`,{provider:e.name}),"aria-expanded":re?.purpose===`use`&&re.provider===e.id,onClick:t=>re?.purpose===`use`&&re.provider===e.id?V(null):Me(`use`,t.currentTarget,e.id),children:u(`selectModel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,"aria-label":u(`editProvider`,{provider:e.name}),ref:t=>{t?pe.current.set(e.id,t):pe.current.delete(e.id)},"aria-expanded":n,disabled:R,onClick:()=>De(e.id),children:u(e.auth?.authMethods.includes(`oauth`)&&!e.auth.configured?`accountLoginStart`:`providerEdit`)}),ye.has(e.id)&&(0,q.jsx)(`button`,{type:`button`,className:`models-button danger`,"aria-label":u(`removeProvider`,{provider:e.name}),disabled:R||i||r?.provider===e.id,title:r?.provider===e.id?u(`providerCurrentRemoval`):void 0,onClick:()=>{se(e.id),le(null)},children:u(`providerRemove`)})]})]}),re?.purpose===`use`&&re.provider===e.id&&Ne(`use`,e.id),x.includes(e.id)&&(0,q.jsx)(`div`,{hidden:!n,children:ke(e.id,e.id,!1,a)})]},e.id)})}),ve&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{hidden:!C,className:`models-add-card`,children:[(0,q.jsx)(`fieldset`,{className:`models-add-modes`,"aria-label":u(`providerAddMode`),onKeyDown:e=>{if(R||![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=Ee.filter(e=>e.available),n=t.findIndex(e=>e.id===T),r=t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length].id;U(r),e.currentTarget.querySelectorAll(`button`)[Ee.findIndex(e=>e.id===r)]?.focus()},children:Ee.map(e=>(0,q.jsx)(`button`,{type:`button`,"aria-pressed":T===e.id,disabled:R||!e.available,onClick:()=>U(e.id),children:u(e.label)},e.id))}),(0,q.jsx)(`p`,{className:`models-hint`,children:u(Ee.find(e=>e.id===T)?.hint??`providerCustomHint`)}),(0,q.jsxs)(`div`,{hidden:T!==`account`,children:[we&&(0,q.jsx)(`div`,{className:`models-provider-select`,children:(0,q.jsx)(nM,{label:u(`provider`),className:`models-provider-picker`,options:Ce.map(e=>({value:e.id,label:e.name||e.id,icon:(0,q.jsx)(Yk,{id:e.id})})),value:we.id,isDisabled:R,placement:`below`,onChange:e=>{O(e);let t=`add:account:${e}`;S(e=>e.includes(t)?e:[...e,t])}})}),x.filter(e=>e.startsWith(`add:account:`)).map(e=>(0,q.jsx)(`div`,{hidden:e!==`add:account:${we?.id}`,children:ke(e,e.slice(12),!0,!1)},e))]}),(0,q.jsxs)(`div`,{hidden:T!==`catalog`,children:[Te&&(0,q.jsx)(`div`,{className:`models-provider-select`,children:(0,q.jsx)(nM,{label:u(`provider`),className:`models-provider-picker`,options:Se.map(e=>({value:e.id,label:e.name||e.id,icon:(0,q.jsx)(Yk,{id:e.id})})),value:Te.id,isDisabled:R,placement:`below`,onChange:e=>{A(e);let t=`add:${e}`;S(e=>e.includes(t)?e:[...e,t])}})}),x.filter(e=>e.startsWith(`add:`)&&e!==`add:custom`&&!e.startsWith(`add:account:`)).map(e=>(0,q.jsx)(`div`,{hidden:e!==`add:${Te?.id}`,children:ke(e,e.slice(4),!0,!1)},e))]}),x.includes(`add:custom`)&&(0,q.jsx)(`div`,{hidden:T!==`custom`,children:ke(`add:custom`,``,!0,!0)})]}),!C&&(0,q.jsxs)(`button`,{type:`button`,className:`models-add-button`,ref:me,disabled:R,onClick:()=>{he.current=null,V(null),w(!0),b(null),ae(null),U(Ee.find(e=>e.id===T)?.available?T:Ee.find(e=>e.available).id)},children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),u(`providerAdd`)]})]}),i&&(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`modelSelectionBusy`)})]}),oe&&(0,q.jsx)(uj,{isOpen:!0,title:u(`removeProvider`,{provider:xe.find(e=>e.id===oe)?.name||oe}),description:ce||u(`providerRemoveDetail`),isActionLoading:R,cancelLabel:u(`cancel`),actionLabel:u(R?`savingSettings`:`providerRemove`),onOpenChange:e=>{!e&&!R&&se(null)},onAction:()=>{if(R||i||!ve)return;let t=new AbortController;H.current=t,P(!0),le(null),new de().changeProviderConfiguration(e,ve.revision,{action:`remove`,provider:oe},t.signal).then(()=>{t.signal.aborted||(Oe(oe),se(null),m(e=>e+1),o().catch(()=>!1))},e=>{t.signal.aborted||le(u(e instanceof ge&&e.code===`MODEL_CONFIGURATION_CONFLICT`?`modelConfigurationConflict`:`providerConfigurationFailed`))}).finally(()=>{t.signal.aborted||P(!1)})}})]})}function sW(){let e={version:`1.1.0`,id:`f3ee7c6867d04f8c4196c6eac9e8b2bb2ab35767fca8d07d66124511dbd50d7d`,mode:`production`},{t}=W(),[n,r]=(0,K.useState)(null),[i,a]=(0,K.useState)(`loading`),[o,s]=(0,K.useState)(0);(0,K.useEffect)(()=>{let e=new AbortController,t=new de;return a(`loading`),r(null),t.request(`/api/diagnostics`,{signal:e.signal}).then(t=>{e.signal.aborted||(r(t.openpi??null),a(`ready`))},()=>{e.signal.aborted||a(`error`)}),()=>e.abort()},[o]);let c=t(`notReported`),l=e?.id&&n?.frontendAtStartup?.id&&e.id!==n.frontendAtStartup.id;return(0,q.jsxs)(`section`,{className:`settings-section-block`,"aria-label":t(`runtimeIdentity`),children:[(0,q.jsx)(`h2`,{children:t(`runtimeIdentity`)}),(0,q.jsx)(`p`,{children:t(`runtimeIdentityHint`)}),i===`loading`&&(0,q.jsx)(`p`,{role:`status`,children:t(`settingsCatalogLoading`)}),i===`error`&&(0,q.jsx)(`p`,{role:`alert`,children:t(`runtimeIdentityFailed`)}),(0,q.jsxs)(`dl`,{className:`settings-summary-list runtime-identity-list`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeBackendVersion`)}),(0,q.jsx)(`dd`,{children:n?.version??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimePackageRoot`)}),(0,q.jsx)(`dd`,{children:n?.packageRoot??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeStartedAt`)}),(0,q.jsx)(`dd`,{children:n?new Date(n.startedAt).toLocaleString():c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeGitRevision`)}),(0,q.jsx)(`dd`,{children:n?.git?.revision??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeGitState`)}),(0,q.jsx)(`dd`,{children:n?.git?.dirty==null?c:t(n.git.dirty?`runtimeGitDirty`:`runtimeGitClean`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeFrontendVersion`)}),(0,q.jsx)(`dd`,{children:e?.version??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeFrontendBuild`)}),(0,q.jsx)(`dd`,{children:e?.mode===`development`?t(`runtimeDevelopmentBuild`):e?.id??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeStartupBuild`)}),(0,q.jsx)(`dd`,{children:n?.frontendAtStartup?.id??c})]})]}),l&&(0,q.jsx)(`p`,{role:`status`,children:t(`runtimeBuildMismatch`)}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>s(e=>e+1),disabled:i===`loading`,children:t(`refreshStatus`)})]})}var cW=20,lW={track:{kVAEAm:`x10l6tqk`,kWkggS:`xdsb6cv`,kaIpWk:`xjspbzw`,$$css:!0},trackHorizontal:{kLqNvP:`x1o0tod`,kt4wiu:`xtijo5x`,kZKoxP:`xqu0tyb`,k87sOh:`xwa60dl`,k3aq6I:`x1cb1t30`,$$css:!0},trackVertical:{k87sOh:`x13vifvy`,krVfgx:`x1ey2m1c`,kzqmXN:`x51ohtg`,$$css:!0},filledTrack:{kVAEAm:`x10l6tqk`,kWkggS:`x1ewilqj`,kaIpWk:`xjspbzw`,$$css:!0},filledTrackHorizontal:{kZKoxP:`xqu0tyb`,k87sOh:`xwa60dl`,k3aq6I:`x1cb1t30`,$$css:!0},filledTrackVertical:{kzqmXN:`x51ohtg`,$$css:!0},thumb:{kVAEAm:`x10l6tqk`,kzqmXN:`xw4jnvo`,kZKoxP:`x1qx5ct2`,kaIpWk:`xjspbzw`,kWkggS:`x1ewilqj`,k3aq6I:`x11lhmoz`,k1ekBW:`x106061f`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,kI3sdo:`x1a2a7pz`,kkrTdU:`x1jm3nie x16khyan`,kY2c9j:`x1vjfegm`,$$css:!0},thumbHorizontal:{k87sOh:`xwa60dl`,k3aq6I:`x11lhmoz xoffwj3`,$$css:!0},thumbHover:{kWkggS:`x1ewilqj xvxo0qp`,$$css:!0},thumbDisabled:{kWkggS:`xwmxj5m`,kkrTdU:`xt0e3qv`,$$css:!0}};function uW(e,t,n){return Math.min(Math.max(e,t),n)}function dW(e){if(Math.abs(e)<1){let t=e.toExponential().split(`e-`);if(t.length===2)return(t[0].split(`.`)[1]?.length??0)+parseInt(t[1],10)}let t=String(e).split(`.`)[1];return t?t.length:0}function fW(e,t,n){if(n<=0)return e;let r=t+Math.round((e-t)/n)*n,i=Math.min(Math.max(dW(t),dW(n)),20);return Number(r.toFixed(i))}function pW(e,t,n){return n===t?0:(e-t)/(n-t)*100}var mW=cW/2;function hW(e){return vW(e,mW-e/100*cW)}function gW(e,t){let n=t-e;return vW(n,-(n/100)*cW)}function _W(e,t){let n=t-cW;return n>0?(e-mW)/n:t>0?e/t:0}function vW(e,t){let n=e=>Number(e.toFixed(3));return`calc(${n(e)}% ${t<0?`-`:`+`} ${Math.abs(n(t))}px)`}function yW({ref:e,...t}){let{label:n,isLabelHidden:r=!1,description:i,isDisabled:a=!1,disabledMessage:o,isOptional:s=!1,isRequired:c=!1,status:l,labelTooltip:u,min:d=0,max:f=100,step:p=1,orientation:m=`horizontal`,formatValue:h,htmlName:g,valueDisplay:_=`tooltip`,marks:v,width:y,xstyle:b,className:x,style:S,"data-testid":C,value:T,onChange:E,onChangeEnd:k}=t,A=Array.isArray(T),j=A&&`minStepsBetweenThumbs`in t?t.minStepsBetweenThumbs??0:0,M=m===`horizontal`,P=(0,K.useId)(),I=(0,K.useId)(),ee=(0,K.useId)(),L=(0,K.useId)(),R=(0,K.useId)(),te=(0,K.useRef)(null),z=(0,K.useRef)(null),[B,ne]=(0,K.useState)(null),[re,ie]=(0,K.useState)(null);(0,K.useEffect)(()=>{D()},[]);let ae=(0,K.useCallback)((e,t)=>{ie(!a&&N()===`keyboard`?e:null)},[a]),oe=(0,K.useCallback)(e=>{ie(null)},[]),se=a&&!!o,ce=F({placement:`above`,focusTrigger:`always`,isEnabled:se}),le=c&&!s,ue=[];i&&ue.push(ee),l?.message&&ue.push(L),le&&ue.push(R),se&&ue.push(ce.describedBy);let de=ue.length>0?ue.join(` `):void 0,pe=(0,K.useMemo)(()=>(Array.isArray(T)?T:[T??d]).map(e=>uW(e,d,f)),[T,d,f]),me=(0,K.useRef)(pe);me.current=pe;let he=(0,K.useCallback)((e,t)=>{let n=te.current;if(!n)return d;let r=n.getBoundingClientRect(),i;return i=M?_W(Ya(n)?r.right-e:e-r.left,r.width):1-_W(t-r.top,r.height),i=uW(i,0,1),uW(fW(d+i*(f-d),d,p),d,f)},[d,f,p,M]),ge=(0,K.useCallback)(e=>{if(!A)return 0;let[t,n]=pe;return Math.abs(e-t)<=Math.abs(e-n)?0:1},[A,pe]),_e=(0,K.useCallback)((e,t)=>{if(a)return;let n=uW(fW(t,d,p),d,f);if(A){let t=[...pe];t[e]=n;let r=j*p;e===0?t[0]=Math.min(t[0],t[1]-r):t[1]=Math.max(t[1],t[0]+r),t[0]=uW(t[0],d,f),t[1]=uW(t[1],d,f),E?.(t)}else E?.(n)},[a,A,pe,d,f,p,j,E]),ve=(0,K.useRef)(k);ve.current=k;let ye=(0,K.useCallback)(e=>{let t=e??me.current,n=ve.current;A?n?.(t):n?.(t[0])},[A]),be=(0,K.useCallback)(e=>{if(a)return;e.preventDefault();let t=e.target.closest(`[data-mark-value]`),n=t?Number(t.dataset.markValue):he(e.clientX,e.clientY),r=ge(n);z.current=r,ne(r),_e(r,n);let i=te.current;i&&i.querySelectorAll(`[role="slider"]`)[r]?.focus(),ie(null),typeof e.currentTarget.setPointerCapture==`function`&&e.currentTarget.setPointerCapture(e.pointerId)},[a,he,ge,_e]),xe=(0,K.useCallback)(e=>{if(z.current===null||a)return;let t=he(e.clientX,e.clientY);_e(z.current,t)},[a,he,_e]),Se=(0,K.useCallback)(e=>{z.current!==null&&(z.current=null,ne(null),ye())},[ye]),Ce=(0,K.useCallback)((e,t)=>{if(a)return;N()===`keyboard`&&ie(e);let n=pe[e],r;switch(t.key){case`ArrowRight`:case`ArrowUp`:r=n+p;break;case`ArrowLeft`:case`ArrowDown`:r=n-p;break;case`PageUp`:r=n+p*10;break;case`PageDown`:r=n-p*10;break;case`Home`:r=d;break;case`End`:r=f;break;default:return}t.preventDefault();let i=uW(fW(r,d,p),d,f);if(_e(e,r),A){let t=[...pe];t[e]=i;let n=j*p;e===0?t[0]=Math.min(t[0],t[1]-n):t[1]=Math.max(t[1],t[0]+n),t[0]=uW(t[0],d,f),t[1]=uW(t[1],d,f),ye(t)}else ye([i])},[a,A,pe,p,d,f,j,_e,ye]),Te=e=>h?h(e):String(e),Ee=e=>{let t=pe[e],n=pW(t,d,f),r=M?{insetInlineStart:hW(n)}:{bottom:hW(n),left:`50%`},i=A?e===0?`Minimum value`:`Maximum value`:void 0,o=j*p,s=A&&e===1?uW(pe[0]+o,d,f):d,c=A&&e===0?uW(pe[1]-o,d,f):f,u=_===`tooltip`&&!se,g=M?`above`:`start`,v=(0,q.jsx)(`div`,{id:A?void 0:P,role:`slider`,tabIndex:a&&!se?-1:0,"aria-valuemin":s,"aria-valuemax":c,"aria-valuenow":t,"aria-valuetext":h?h(t):void 0,"aria-orientation":m,"aria-disabled":a||void 0,"aria-invalid":l?.type===`error`||void 0,"aria-label":i,"aria-labelledby":A?void 0:I,"aria-describedby":de,onKeyDown:t=>Ce(e,t),onFocus:t=>ae(e,t),onBlur:oe,...H(O(`slider-thumb`,{orientation:m,disabled:a?`disabled`:null}),w(lW.thumb,M?lW.thumbHorizontal:Et.centerInline(`50%`),!a&&lW.thumbHover,!a&&re===e&&fe.focusVisible,a&&lW.thumbDisabled),void 0,r)},e);return u?(0,q.jsx)(V,{content:Te(t),placement:g,delay:0,focusTrigger:`always`,isOpen:B===e||void 0,children:v},e):v},U=(()=>{if(A){let[e,t]=pe,n=pW(e,d,f),r=pW(t,d,f);return M?{insetInlineStart:hW(n),width:gW(n,r)}:{bottom:hW(n),height:gW(n,r)}}let e=pW(pe[0],d,f);return M?{insetInlineStart:`0%`,width:hW(e)}:{bottom:`0%`,height:hW(e)}})(),De=_===`text`?(0,q.jsx)(`span`,{className:`x9ynric xcr08ib x1tgivj0 xuxw1ft x2lah0s`,children:A?`${Te(pe[0])} – ${Te(pe[1])}`:Te(pe[0])}):null;return(0,q.jsxs)(zO,{"data-testid":C,label:n,isLabelHidden:r,description:i,inputID:P,labelID:I,isGroupLabel:!0,descriptionID:i?ee:void 0,isOptional:s,isRequired:c,isDisabled:a,status:l?{type:l.type,message:l.message,messageID:l.message?L:void 0}:void 0,labelTooltip:u,statusVariant:`detached`,width:y,xstyle:b,className:x,style:S,children:[(0,q.jsxs)(`div`,{...H(O(`slider`,{orientation:m,disabled:a?`disabled`:null}),{className:`x78zum5 x6s0dn4 x1txdalj`}),children:[g!=null&&pe.map((e,t)=>(0,q.jsx)(`input`,{type:`hidden`,name:g,value:String(e),disabled:a},t===0?`start`:`end`)),(0,q.jsxs)(`div`,{ref:we(e,te,ce.ref),...A?{role:`group`,"aria-labelledby":I}:void 0,onPointerDown:be,onPointerMove:xe,onPointerUp:Se,onPointerCancel:Se,...{0:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k x1ypdohk x16khyan`},2:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 x1ypdohk x16khyan`},1:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k xbyyjgo xt0e3qv`},3:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 xbyyjgo xt0e3qv`}}[!!M<<1|!!a<<0],children:[(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(O(`slider-track`,{orientation:m}),w(lW.track,M?lW.trackHorizontal:[lW.trackVertical,Et.centerInline(`0px`)]))}),(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(w(lW.filledTrack,M?lW.filledTrackHorizontal:[lW.filledTrackVertical,Et.centerInline(`0px`)]),{style:U})}),v&&(0,q.jsx)(`div`,{"aria-hidden":`true`,...{0:{className:`x10l6tqk x13vifvy x1ey2m1c xbudbmw`},1:{className:`x10l6tqk x1o0tod xtijo5x xwa60dl`}}[!!M<<0],children:v.map(e=>{let t=pW(e.value,d,f),n=M?{insetInlineStart:hW(t)}:{bottom:hW(t)};return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{"data-testid":`slider-mark`,"data-mark-value":e.value,...H({0:{className:`x10l6tqk x7njt3n xjspbzw x36qwtl x1xc55vz x1m9mm8y`},1:{className:`x10l6tqk x7njt3n xjspbzw xfo62xy xdk7pt x11lhmoz xoffwj3`}}[!!M<<0],{style:n})}),e.label&&(0,q.jsx)(`span`,{"data-testid":`slider-mark-label`,"data-mark-value":e.value,...H({0:{className:`x10l6tqk x9ynric x141an7d xv1l7n4 xuxw1ft x131p8rn x9p6ekw`},1:{className:`x10l6tqk x9ynric x141an7d xv1l7n4 xuxw1ft xuuh30 x1nyx83j xuivejd`}}[!!M<<0],{style:n}),children:e.label})]},e.value)})}),pe.map((e,t)=>Ee(t))]}),De]}),le&&(0,q.jsx)(Kt,{id:R,children:`Required`}),se&&ce.renderTooltip(o)]})}yW.displayName=`Slider`;var bW=[`explorer`,`implementer`,`reviewer`,`advisor`];function xW({catalog:e,error:t,onRefresh:n}){let{t:r}=W();return!t&&!e?(0,q.jsxs)(`div`,{className:`settings-load-state`,role:`status`,children:[(0,q.jsx)(me,{className:`settings-spin`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:r(`settingsCatalogLoading`)})]}):t?(0,q.jsxs)(`div`,{className:`settings-load-state error`,role:`alert`,children:[(0,q.jsx)(`strong`,{children:r(`settingsCatalogFailed`)}),(0,q.jsx)(`span`,{children:t}),(0,q.jsx)(`button`,{type:`button`,onClick:n,children:r(`retryAdmissionCheck`)})]}):null}function SW({icon:e,title:t,description:n,value:r,disabled:i,loading:a,onChange:o}){return(0,q.jsxs)(`div`,{className:`settings-inline-control settings-toggle-row`,children:[(0,q.jsx)(e,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-inline-copy`,children:[(0,q.jsx)(`strong`,{children:t}),n&&(0,q.jsx)(`small`,{children:n})]}),(0,q.jsx)(bj,{label:t,isLabelHidden:!0,value:r,size:`sm`,isDisabled:i,isLoading:a,onChange:o})]})}function CW({isPending:e,isBlocked:t=!1,onConfigure:n,request:r,label:i}){return(0,q.jsx)(Br,{label:i,variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Xc,{"aria-hidden":`true`}),isDisabled:e||t,isLoading:e,onClick:()=>void n(r)})}function wW({pending:e,onConfigure:t,placeholder:n}){let{t:r}=W(),[i,a]=(0,K.useState)(``);return(0,q.jsxs)(`form`,{className:`settings-edit-form`,onSubmit:n=>{n.preventDefault(),!e&&i.trim()&&t(i.trim())},children:[(0,q.jsxs)(`label`,{className:`settings-form-field`,children:[r(`setupConfigurationRequest`),(0,q.jsx)(`textarea`,{required:!0,maxLength:2e3,value:i,disabled:e,placeholder:n,onChange:e=>a(e.target.value)})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:e||!i.trim(),children:r(`configureViaSetup`)}),(0,q.jsx)(`small`,{children:r(`setupFormDetail`)})]})}function TW({catalog:e,error:t,currentModel:n,thinkingLevel:r,cwd:i,setupPending:a,setupBlocked:o=!1,preferencePending:s,setupBusy:c,setupBlockedReason:l,onConfigure:u,onUpdatePreferences:d,onOpenRuntimeStatus:f,onRefresh:p}){let{t:m}=W(),h=e?.setup,g=h?.workflows.concurrency??0,_=h?.workflows.maxAgentCalls??0,[v,y]=(0,K.useState)(g),[b,x]=(0,K.useState)(_);return(0,K.useEffect)(()=>y(g),[g]),(0,K.useEffect)(()=>x(_),[_]),(0,q.jsxs)(`section`,{className:`settings-content-page settings-general-panel`,children:[(0,q.jsxs)(`div`,{className:`settings-page-heading`,children:[(0,q.jsx)(`div`,{children:(0,q.jsx)(`h1`,{children:m(`generalSettings`)})}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:u,request:m(`setupRequestReviewAll`),label:m(`configureOpenPi`)})]}),c&&(0,q.jsx)(`p`,{className:`settings-pending-hint`,role:`status`,children:l||m(`settingsSetupBusyHint`)}),(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:p}),h&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`section`,{className:`settings-section-block`,children:(0,q.jsxs)(`div`,{className:`settings-follow-up-control`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:m(`followUpBehavior`)}),(0,q.jsx)(`p`,{children:m(`followUpBehaviorDetail`)})]}),(0,q.jsxs)(`fieldset`,{className:`settings-follow-up-choices`,disabled:s,children:[(0,q.jsx)(`legend`,{className:`sr-only`,children:m(`followUpBehavior`)}),[`followUp`,`steer`].map(e=>(0,q.jsxs)(`label`,{children:[(0,q.jsx)(`input`,{type:`radio`,name:`follow-up-behavior`,value:e,"aria-label":m(e===`steer`?`followUpSteer`:`followUpQueue`),checked:(h.ui.webFollowUpBehavior??`followUp`)===e,onChange:()=>void d({followUpBehavior:e})}),(0,q.jsxs)(`span`,{className:`settings-follow-up-option`,children:[e===`steer`?(0,q.jsx)(Cs,{"aria-hidden":`true`}):(0,q.jsx)(tc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-follow-up-option-copy`,children:[(0,q.jsx)(`strong`,{children:m(e===`steer`?`followUpSteer`:`followUpQueue`)}),(0,q.jsx)(`small`,{children:m(e===`steer`?`followUpSteerDetail`:`followUpQueueDetail`)})]})]})]},e))]})]})}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`agentBehavior`)}),(0,q.jsxs)(`div`,{className:`settings-chat-controls`,children:[(0,q.jsxs)(`form`,{className:`settings-limits-control`,onSubmit:e=>{e.preventDefault(),!a&&!o&&u(m(`setupRequestLimits`,{concurrency:v,calls:b}))},children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(Us,{"aria-hidden":`true`}),m(`workflowLimits`)]}),(0,q.jsx)(`small`,{children:m(`workflowLimitsValue`,{concurrency:h.workflows.concurrency,calls:h.workflows.maxAgentCalls})}),(0,q.jsxs)(`label`,{children:[m(`workflowConcurrency`),(0,q.jsx)(`input`,{type:`number`,min:1,value:v,disabled:a||o,onChange:e=>y(Number(e.target.value)),required:!0})]}),(0,q.jsxs)(`label`,{children:[m(`workflowCalls`),(0,q.jsx)(`input`,{type:`number`,min:1,value:b,disabled:a||o,onChange:e=>x(Number(e.target.value)),required:!0})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:a||o||v===h.workflows.concurrency&&b===h.workflows.maxAgentCalls,children:m(`configureViaSetup`)})]}),(0,q.jsx)(SW,{icon:Pc,title:m(`nextActionSuggestions`),description:m(`nextActionSuggestionsDetail`),value:h.suggestions.enabled,disabled:a||o,loading:a,onChange:e=>void u(m(e?`setupRequestEnableSuggestions`:`setupRequestDisableSuggestions`))}),h.suggestions.model&&(0,q.jsx)(`small`,{children:`${h.suggestions.model.provider}/${h.suggestions.model.model} · ${h.suggestions.model.reasoning}`}),(0,q.jsxs)(`div`,{className:`settings-inline-control`,children:[(0,q.jsx)(bs,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-inline-copy`,children:[(0,q.jsxs)(`strong`,{children:[m(`postEditCommand`),(0,q.jsx)(`span`,{className:`settings-inline-status`,children:m(h.postEditConfigured?`configured`:`disabled`)})]}),(0,q.jsx)(`small`,{children:m(`postEditCommandDetail`)})]}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:u,request:m(`setupRequestPostEdit`),label:m(`configurePostEdit`)})]}),(0,q.jsx)(`small`,{children:m(`agentSettingsSetupHint`)})]})]}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`resultDisplay`)}),(0,q.jsxs)(`div`,{className:`settings-chat-controls`,children:[[[`subagentResultDisplay`,`subagentResults`,ws],[`bashToolDisplay`,`bashOperations`,Vc],[`fileMutationDisplay`,`fileMutations`,Fs]].map(([e,t,n])=>(0,q.jsxs)(`label`,{className:`settings-inline-control`,htmlFor:`settings-${e}`,children:[(0,q.jsx)(n,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`settings-inline-copy`,children:(0,q.jsx)(`strong`,{children:m(t)})}),(0,q.jsx)(Tj,{id:`settings-${e}`,className:`settings-select-control`,label:m(t),value:h.ui[e],disabled:s,onChange:t=>{(t===`full`||t===`compact`)&&d({[e]:t})},options:[{value:`compact`,label:m(`detailDisplay_compact`)},{value:`full`,label:m(`detailDisplay_full`)}]})]},e)),(0,q.jsx)(SW,{icon:mc,title:m(`terminalFooter`),value:h.ui.customFooter,disabled:s,loading:s,onChange:e=>void d({customFooter:e})}),(0,q.jsxs)(`label`,{className:`settings-inline-control`,htmlFor:`settings-footer-style`,children:[(0,q.jsx)(`span`,{children:m(`terminalFooterStyle`)}),(0,q.jsx)(Tj,{id:`settings-footer-style`,className:`settings-select-control`,label:m(`terminalFooterStyle`),value:h.ui.footerStyle,disabled:s||!h.ui.customFooter,onChange:e=>{(e===`plain`||e===`powerline`||e===`powerline-mono`)&&d({footerStyle:e})},options:[{value:`plain`,label:`Plain`},{value:`powerline`,label:`Powerline`},{value:`powerline-mono`,label:`Powerline Mono`}]})]}),(0,q.jsx)(`small`,{children:m(`terminalFooterHint`)})]})]})]}),(0,q.jsx)(sW,{}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`sessionSettings`)}),(0,q.jsxs)(`dl`,{className:`settings-summary-list`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`selectedModel`)}),(0,q.jsx)(`dd`,{children:n?.label??m(`noModels`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`thinkingLevel`)}),(0,q.jsx)(`dd`,{children:r})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`currentWorkspace`)}),(0,q.jsx)(`dd`,{title:i,children:i})]})]}),(0,q.jsx)(Br,{label:m(`openRuntimeDetails`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ls,{"aria-hidden":`true`}),className:`settings-runtime-action`,onClick:f})]})]})}function EW(e){return e.split(/[\\/]/u).filter(Boolean).at(-1)||e}function DW({kind:e,query:t,scope:n,onQuery:r,onScope:i,onAdd:a}){let{t:o}=W();return(0,q.jsxs)(`div`,{className:`settings-resource-toolbar`,children:[(0,q.jsxs)(`div`,{className:`settings-resource-toolbar-heading`,children:[(0,q.jsx)(`strong`,{children:o(`resources`)}),(0,q.jsx)(Br,{label:o(e===`skills`?`addSkill`:`addPlugin`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:a})]}),(0,q.jsxs)(`label`,{className:`settings-resource-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":o(`searchResources`),placeholder:o(`searchResources`),value:t,onChange:e=>r(e.target.value)})]}),(0,q.jsx)(Tj,{label:o(`filterResourceScope`),value:n,onChange:i,options:[{value:`all`,label:o(`allResourceScopes`)},...[`project`,`user`,`temporary`].map(e=>({value:e,label:o(`resourceScope_${e}`)}))]})]})}function OW({kind:e,pending:t,onConfigure:n,onCancel:r}){let{t:i}=W(),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(`user`);return(0,q.jsxs)(`section`,{className:`settings-resource-install`,children:[(0,q.jsx)(`header`,{className:`settings-detail-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:i(e===`skills`?`addSkill`:`addPlugin`)}),(0,q.jsx)(`p`,{children:i(`resourceInstallIntro`)})]})}),(0,q.jsxs)(`form`,{className:`settings-edit-form`,onSubmit:r=>{r.preventDefault(),!t&&a.trim()&&n(i(`setupResourceInstallRequest`,{kind:i(e===`skills`?`skillsSettings`:`pluginsSettings`),source:JSON.stringify(a.trim()),scope:s}))},children:[(0,q.jsxs)(`label`,{className:`settings-form-field`,children:[i(`resourcePackageSource`),(0,q.jsx)(`input`,{required:!0,maxLength:1e3,value:a,placeholder:i(`resourcePackageSourcePlaceholder`),disabled:t,onChange:e=>{o(e.target.value)}})]}),(0,q.jsxs)(`label`,{className:`settings-form-field`,htmlFor:`resource-install-scope`,children:[i(`scope`),(0,q.jsx)(Tj,{id:`resource-install-scope`,label:i(`scope`),value:s,disabled:t,onChange:c,options:[{value:`user`,label:i(`resourceScope_user`)},{value:`project`,label:i(`resourceScope_project`)}]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-actions`,children:[(0,q.jsx)(Br,{type:`submit`,label:i(`configureViaSetup`),variant:`secondary`,size:`sm`,isDisabled:t||!a.trim()}),(0,q.jsx)(Br,{label:i(`cancel`),variant:`ghost`,size:`sm`,onClick:r})]}),(0,q.jsx)(`small`,{children:i(`resourceInstallReview`)})]}),e===`skills`&&(0,q.jsxs)(`a`,{className:`settings-resource-link`,href:`https://skills.sh`,target:`_blank`,rel:`noreferrer`,children:[i(`browseSkills`),(0,q.jsx)(Os,{"aria-hidden":`true`})]})]})}function kW({catalog:e,pending:t,onReload:n,kind:r,onConfigure:i,children:a}){let{t:o}=W(),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(null);return(0,q.jsxs)(`section`,{className:`settings-resource-management`,children:[a&&(0,q.jsx)(`div`,{className:`settings-resource-actions`,children:a}),(0,q.jsxs)(`div`,{className:`settings-resource-reload`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:o(`resourceSessionState`)}),(0,q.jsx)(`p`,{children:o(`resourcesReloadNote`)})]}),(0,q.jsx)(Br,{label:o(`reloadResources`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(me,{"aria-hidden":`true`}),isDisabled:t||l||!e?.sessionPath||!n,isLoading:l,onClick:()=>c(!0)})]}),d&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,role:`status`,children:d}),(0,q.jsxs)(`details`,{className:`settings-resource-advanced`,children:[(0,q.jsx)(`summary`,{children:o(`advancedResourceConfiguration`)}),(0,q.jsx)(wW,{pending:t,onConfigure:i,placeholder:o(r===`skills`?`setupSkillsPlaceholder`:`setupPluginsPlaceholder`)})]}),s&&(0,q.jsx)(uj,{isOpen:!0,onOpenChange:c,title:o(`reloadResources`),description:o(`resourceReloadReview`),cancelLabel:o(`cancel`),actionLabel:o(`reloadResources`),onAction:()=>{c(!1),u(!0),f(null),n?.().then(()=>f(o(`resourceReloaded`)),e=>f(e instanceof Error?e.message:o(`resourceReloadFailed`))).finally(()=>u(!1))}})]})}function AW({catalog:e}){let{t}=W();if(!e)return null;let{diagnostics:n,truncation:r}=e.resources;return!n.settingsErrors&&!n.extensionErrors&&!n.skillErrors&&!r.truncated?null:(0,q.jsxs)(`p`,{className:`settings-resource-notice`,role:`status`,children:[t(`resourceDiagnostics`,n),n.settingsErrors?` ${t(`resourceConfigurationDiagnostics`,{count:n.settingsErrors})}`:``,r.truncated&&` ${t(`resourceCatalogTruncated`)}`]})}function jW({catalog:e,error:t,onRefresh:n,setupPending:r,onConfigure:i,onReload:a}){let{t:o}=W(),s=e?.resources.skills??[],[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(`all`),[f,p]=(0,K.useState)(!1),m=(0,K.useMemo)(()=>s.filter(e=>(u===`all`||e.scope===u)&&`${e.name} ${e.description} ${e.source}`.toLocaleLowerCase().includes(c.trim().toLocaleLowerCase())),[s,c,u]),h=(0,K.useMemo)(()=>[`project`,`user`,`temporary`].map(e=>({scope:e,skills:m.filter(t=>t.scope===e)})).filter(e=>e.skills.length>0),[m]),[g,_]=(0,K.useState)(``),[v,y]=(0,K.useState)(null),b=m.find(e=>e.id===g)??m[0],x=m.filter(e=>e.canManage!==!1),S=JSON.stringify(x.map(e=>e.filePath)),C=new TextEncoder().encode(S).length>12e3;(0,K.useEffect)(()=>{s.length&&!s.some(e=>e.id===g)&&_(s[0].id)},[g,s]);let w=e=>{y(null),td(`/skill:${e.name} `).then(e=>y(e?`copied`:`failed`))};return(0,q.jsxs)(`section`,{className:`settings-content-page settings-managed-panel`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:o(`skillsSettings`)}),(0,q.jsx)(`p`,{children:o(`skillsEmptyIntro`)})]})}),(0,q.jsxs)(`aside`,{className:`settings-resource-sidebar`,children:[(0,q.jsx)(DW,{kind:`skills`,query:c,scope:u,onQuery:l,onScope:d,onAdd:()=>p(!0)}),(0,q.jsxs)(`div`,{className:`settings-resource-list`,children:[h.map(e=>(0,q.jsxs)(`section`,{className:`settings-resource-group`,children:[(0,q.jsx)(`span`,{className:`settings-sidebar-label`,children:o(`resourceScope_${e.scope}`)}),e.skills.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:`settings-resource-item`,"aria-current":e.id===b?.id?`page`:void 0,onClick:()=>{_(e.id),y(null),p(!1)},children:[(0,q.jsx)(Pc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:e.name}),(0,q.jsx)(`small`,{children:o(e.disableModelInvocation?`explicitOnly`:`availableToModel`)})]})]},e.id))]},e.scope)),!e&&!t&&(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}),e&&!m.length&&(0,q.jsx)(`p`,{className:`settings-resource-empty`,children:o(s.length?`noMatchingResources`:`noSkillsFound`)})]}),(0,q.jsxs)(`div`,{className:`settings-sidebar-footer`,children:[(0,q.jsx)(`span`,{children:o(`skillCount`,{count:s.length})}),(0,q.jsx)(`button`,{type:`button`,"aria-label":o(`refreshStatus`),onClick:n,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-detail`,children:[(0,q.jsx)(AW,{catalog:e}),f?(0,q.jsx)(OW,{kind:`skills`,pending:r,onConfigure:i,onCancel:()=>p(!1)}):t?(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}):b?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`settings-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:b.name}),(0,q.jsx)(`p`,{children:b.description})]}),(0,q.jsx)(Br,{label:o(v===`copied`?`copiedMessage`:`copySkillInvocation`),variant:`secondary`,size:`sm`,icon:v===`copied`?(0,q.jsx)(rs,{}):(0,q.jsx)(_s,{}),onClick:()=>w(b)})]}),(0,q.jsxs)(`dl`,{className:`settings-detail-metadata`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`source`)}),(0,q.jsx)(`dd`,{children:b.source===`auto`?o(`resourceSourceAuto`):b.source===`local`?o(`resourceSourceLocal`):b.source===`builtin`?o(`builtIn`):b.source})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`scope`)}),(0,q.jsx)(`dd`,{children:o(`resourceScope_${b.scope}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`invocation`)}),(0,q.jsx)(`dd`,{children:(0,q.jsx)(`code`,{children:`/skill:${b.name}`})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`modelInvocation`)}),(0,q.jsx)(`dd`,{children:o(b.disableModelInvocation?`explicitOnly`:`availableToModel`)})]})]}),(0,q.jsxs)(`section`,{className:`settings-path-block`,children:[(0,q.jsx)(Fs,{"aria-hidden":`true`}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:o(`skillFile`)}),(0,q.jsx)(`code`,{children:b.filePath})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-actions`,children:[(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(b.disableModelInvocation?`enableSkillInvocation`:`disableSkillInvocation`),request:o(`setupSkillInvocationRequest`,{path:b.filePath,disabled:!b.disableModelInvocation})}),(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(`updateResource`),request:o(`setupSkillManageRequest`,{action:`update`,path:JSON.stringify(b.filePath),source:JSON.stringify(b.source),scope:b.scope})}),(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(`removeResource`),request:o(`setupSkillManageRequest`,{action:`remove`,path:JSON.stringify(b.filePath),source:JSON.stringify(b.source),scope:b.scope})})]}),b.canManage===!1&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,children:o(`resourceTargetTruncated`)}),v===`failed`&&(0,q.jsx)(`p`,{className:`inspection-warning`,children:o(`copyFailed`)})]}):(0,q.jsxs)(`div`,{className:`settings-empty-detail`,children:[(0,q.jsx)(Pc,{"aria-hidden":`true`}),(0,q.jsx)(`h2`,{children:o(s.length?`noMatchingResources`:`skillsEmptyTitle`)}),(0,q.jsx)(Br,{label:o(`addSkill`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:()=>p(!0)})]}),!f&&(0,q.jsxs)(kW,{catalog:e,pending:r,onReload:a,kind:`skills`,onConfigure:i,children:[x.length>1&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(CW,{isPending:r,isBlocked:C,onConfigure:i,label:o(`enableVisibleSkills`,{count:x.length}),request:o(`setupSkillsBulkRequest`,{paths:S,disabled:!1})}),(0,q.jsx)(CW,{isPending:r,isBlocked:C,onConfigure:i,label:o(`disableVisibleSkills`,{count:x.length}),request:o(`setupSkillsBulkRequest`,{paths:S,disabled:!0})})]}),C&&(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`resourceBulkTooLarge`)})]})]})]})}function MW({catalog:e,error:t,currentModel:n,models:r,activity:i,setupPending:a,setupBlocked:o=!1,onConfigure:s,onRefresh:c}){let{t:l}=W(),[u,d]=(0,K.useState)(`explorer`),f=e?.setup.subagents.roleModels[u],[p,m]=(0,K.useState)(``),[h,g]=(0,K.useState)(1);(0,K.useEffect)(()=>{let t=e?.setup.subagents.roleModels[u];m(t?`${t.provider}/${t.model}`:``),g(e?.setup.workflows.concurrency??1)},[u,e]);let _=i?.items.filter(e=>e.status===`running`).length??0,v=i?.items.filter(e=>e.status!==`running`).length??0;return(0,q.jsxs)(`section`,{className:`settings-content-page settings-subagents-panel`,children:[(0,q.jsxs)(`header`,{className:`settings-page-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:l(`subagentsSettings`)}),(0,q.jsx)(`p`,{children:l(`subagentConfigurationIntro`)})]}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:s,request:l(`setupRequestSubagents`),label:l(`configureRoles`)})]}),(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:c}),(0,q.jsx)(`div`,{className:`settings-control-group`,children:(0,q.jsxs)(`label`,{className:`settings-control-row`,htmlFor:`subagent-role`,children:[(0,q.jsxs)(`span`,{className:`settings-control-copy`,children:[(0,q.jsx)(`strong`,{children:l(`builtInRoles`)}),(0,q.jsx)(`span`,{children:l(`subagentRoleShort_${u}`)})]}),(0,q.jsx)(Tj,{id:`subagent-role`,name:`subagentRole`,label:l(`builtInRoles`),value:u,onChange:e=>{let t=bW.find(t=>t===e);t&&d(t)},options:bW.map(e=>({value:e,label:l(`subagentRole_${e}`)}))})]})}),(0,q.jsx)(`div`,{className:`settings-role-detail`,children:e&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`header`,{className:`settings-detail-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:l(`subagentRole_${u}`)}),(0,q.jsx)(`p`,{children:l(`subagentRoleDescription_${u}`)})]})}),(0,q.jsxs)(`form`,{className:`settings-edit-form settings-role-form`,onSubmit:e=>{e.preventDefault(),!(a||o)&&s(l(`setupRoleFormRequest`,{role:u,model:p||l(`inheritParentModel`),concurrency:h}))},children:[(0,q.jsxs)(`div`,{className:`settings-control-group`,children:[(0,q.jsxs)(`label`,{className:`settings-control-row`,htmlFor:`role-model`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`modelAssignment`)})}),(0,q.jsx)(Tj,{id:`role-model`,name:`roleModel`,label:l(`modelAssignment`),value:p,disabled:a||o,onChange:m,menuWidth:`min(380px, calc(100vw - 32px))`,options:[{value:``,label:l(`inheritParentModel`)},...p&&!r.some(e=>`${e.provider}/${e.id}`===p)?[{value:p,label:p}]:[],...r.map(e=>({value:`${e.provider}/${e.id}`,label:e.label}))]})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`effectiveModel`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:f?`${f.provider}/${f.model}`:n?.label??l(`unknownState`)})]}),(0,q.jsxs)(`label`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`workflowConcurrencyLabel`)})}),(0,q.jsx)(`input`,{name:`concurrency`,type:`number`,autoComplete:`off`,min:1,max:64,required:!0,value:h,disabled:a||o,onChange:e=>g(Number(e.target.value))})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`workflowCallLimit`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:e.setup.workflows.maxAgentCalls})]})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:a||o,children:l(`configureViaSetup`)}),(0,q.jsx)(`small`,{className:`settings-resource-caption`,children:l(`setupFormDetail`)})]}),(0,q.jsxs)(`section`,{className:`settings-role-principles`,children:[(0,q.jsx)(`h2`,{children:l(`runtimeBoundaries`)}),(0,q.jsxs)(`div`,{className:`settings-control-group`,children:[(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(Ys,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:l(`subagentAuthorityNote`)})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(ws,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:l(`subagentModelNote`)})]})]}),(0,q.jsxs)(`p`,{className:`settings-resource-caption`,children:[l(`subagentActiveCount`,{count:_}),` ·`,` `,l(`subagentCompletedCount`,{count:v})]})]})]})})]})}function NW(e){return e.extensions.length+e.skills.length+e.prompts.length+e.themes.length}function PW(e){return e.enabled===!1?`disabled`:e.configured&&!e.installed?`missing`:e.diagnostics?.length?`error`:NW(e)?`loaded`:e.installed?`installed`:`notLoaded`}function FW({catalog:e,error:t,onRefresh:n,setupPending:r,onConfigure:i,onReload:a}){let{t:o}=W(),s=e?.resources.plugins??[],[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(`all`),[f,p]=(0,K.useState)(!1),m=(0,K.useMemo)(()=>s.filter(e=>(u===`all`||e.scope===u)&&`${e.name??``} ${e.source}`.toLocaleLowerCase().includes(c.trim().toLocaleLowerCase())),[s,c,u]),[h,g]=(0,K.useState)(``),_=m.find(e=>e.id===h)??m[0],v=m.filter(e=>e.configured&&e.canManage!==!1),y=e=>e.name??(e.source===`auto`?o(`resourceSourceAuto`):e.source===`builtin`?o(`builtIn`):EW(e.source)),b=JSON.stringify(v.map(({source:e,scope:t,baseDir:n})=>({source:e,scope:t,path:n}))),x=new TextEncoder().encode(b).length>12e3;return(0,K.useEffect)(()=>{s.length&&!s.some(e=>e.id===h)&&g(s[0].id)},[s,h]),(0,q.jsxs)(`section`,{className:`settings-content-page settings-managed-panel`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:o(`pluginsSettings`)}),(0,q.jsx)(`p`,{children:o(`pluginsEmptyIntro`)})]})}),(0,q.jsxs)(`aside`,{className:`settings-resource-sidebar`,children:[(0,q.jsx)(DW,{kind:`plugins`,query:c,scope:u,onQuery:l,onScope:d,onAdd:()=>p(!0)}),(0,q.jsxs)(`div`,{className:`settings-resource-list`,children:[m.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:`settings-resource-item`,"aria-current":e.id===_?.id?`page`:void 0,onClick:()=>{g(e.id),p(!1)},children:[(0,q.jsx)(Sc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:y(e)}),(0,q.jsxs)(`small`,{children:[o(`resourceScope_${e.scope}`),` ·`,` `,o(`pluginState_${PW(e)}`)]})]})]},e.id)),!e&&!t&&(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}),e&&!m.length&&(0,q.jsx)(`p`,{className:`settings-resource-empty`,children:o(s.length?`noMatchingResources`:`noPluginsFound`)})]}),(0,q.jsxs)(`div`,{className:`settings-sidebar-footer`,children:[(0,q.jsx)(`span`,{children:e?o(`pluginCount`,{count:s.length}):o(`settingsCatalogLoading`)}),(0,q.jsx)(`button`,{type:`button`,"aria-label":o(`refreshStatus`),onClick:n,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-detail`,children:[(0,q.jsx)(AW,{catalog:e}),f?(0,q.jsx)(OW,{kind:`plugins`,pending:r,onConfigure:i,onCancel:()=>p(!1)}):t?(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}):_?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`settings-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:y(_)}),(0,q.jsx)(`code`,{children:_.source})]}),(0,q.jsx)(`span`,{className:`settings-status-badge ${PW(_)===`loaded`?`healthy`:``}`,children:o(`pluginState_${PW(_)}`)})]}),(0,q.jsxs)(`dl`,{className:`settings-detail-metadata settings-detail-metadata-wide`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`scope`)}),(0,q.jsx)(`dd`,{children:o(`resourceScope_${_.scope}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`resourceOrigin`)}),(0,q.jsx)(`dd`,{children:o(`resourceOrigin_${_.origin}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`installedVersion`)}),(0,q.jsx)(`dd`,{children:_.installedVersion??o(`notReported`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`configuredVersion`)}),(0,q.jsx)(`dd`,{children:_.configuredVersion??o(`resourceVersionUnpinned`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`resources`)}),(0,q.jsx)(`dd`,{children:o(`pluginResourceSummary`,{extensions:_.extensions.length,skills:_.skills.length,prompts:_.prompts.length,themes:_.themes.length})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`baseDirectory`)}),(0,q.jsx)(`dd`,{title:_.baseDir,children:_.baseDir??o(`notReported`)})]})]}),[...new Set(_.diagnostics)].map(e=>(0,q.jsx)(`p`,{className:`settings-resource-notice`,role:`status`,children:e},e)),_.canManage===!1&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,children:o(`resourceTargetTruncated`)}),_.configured&&_.canManage!==!1&&(0,q.jsx)(`div`,{className:`settings-resource-actions settings-resource-primary-actions`,children:[_.enabled===!1?`enable`:`disable`,`update`,`remove`].map(e=>(0,q.jsx)(CW,{isPending:r,onConfigure:i,label:o(`pluginAction_${e}`),request:o(`setupPluginOperationRequest`,{action:e,source:JSON.stringify(_.source),path:JSON.stringify(_.baseDir??null),scope:_.scope})},e))}),(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`pluginLoadedResources`,{count:NW(_)})}),(0,q.jsxs)(`section`,{className:`settings-resource-groups`,children:[_.extensions.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`extensions`)}),(0,q.jsx)(`ul`,{children:_.extensions.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:e.name}),(0,q.jsx)(`code`,{children:e.path})]}),(0,q.jsx)(`span`,{children:o(`extensionSurfaceCount`,{tools:e.toolCount,commands:e.commandCount})})]},e.path))})]}),_.skills.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`skillsSettings`)}),(0,q.jsx)(`p`,{children:_.skills.join(` · `)})]}),_.prompts.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`prompts`)}),(0,q.jsx)(`p`,{children:_.prompts.join(` · `)})]}),_.themes.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`themes`)}),(0,q.jsx)(`p`,{children:_.themes.join(` · `)})]})]})]}):(0,q.jsxs)(`div`,{className:`settings-empty-detail`,children:[(0,q.jsx)(Sc,{"aria-hidden":`true`}),(0,q.jsx)(`h2`,{children:o(s.length?`noMatchingResources`:`pluginsEmptyTitle`)}),(0,q.jsx)(Br,{label:o(`addPlugin`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:()=>p(!0)})]}),!f&&(0,q.jsxs)(kW,{catalog:e,pending:r,onReload:a,kind:`plugins`,onConfigure:i,children:[v.length>1&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(CW,{isPending:r,isBlocked:x,onConfigure:i,label:o(`enableVisiblePlugins`,{count:v.length}),request:o(`setupPluginsBulkRequest`,{packages:b,disabled:!1})}),(0,q.jsx)(CW,{isPending:r,isBlocked:x,onConfigure:i,label:o(`disableVisiblePlugins`,{count:v.length}),request:o(`setupPluginsBulkRequest`,{packages:b,disabled:!0})})]}),x&&(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`resourceBulkTooLarge`)})]})]})]})}function IW(e,t=``,n){let r=(0,K.useMemo)(()=>new de,[]),[i,a]=(0,K.useState)(0),o=JSON.stringify([e,t]),s=(0,K.useRef)(o);s.current=o;let c=(0,K.useRef)(0),[l,u]=(0,K.useState)(null),d=(0,K.useCallback)(()=>a(e=>e+1),[]);return(0,K.useEffect)(()=>{let t=new AbortController,n=++c.current;return u(e=>({owner:o,catalog:e?.owner===o?e.catalog:null,error:null})),r.settingsCatalog(e,t.signal).then(e=>{!t.signal.aborted&&c.current===n&&u({owner:o,catalog:e,error:null})},e=>{!t.signal.aborted&&c.current===n&&u(t=>({owner:o,catalog:t?.owner===o?t.catalog:null,error:e instanceof Error?e.message:String(e)}))}),()=>t.abort()},[r,i,e,o,n]),{catalog:l?.owner===o?l.catalog:null,error:l?.owner===o?l.error:null,refresh:d,updateSetup:e=>{s.current===o&&(c.current++,u(t=>t?.owner===o&&t.catalog?{...t,catalog:{...t.catalog,setup:e}}:t))}}}var LW=[`default`,`mist`,`rose`,`pine`],RW=[`codex`,`sans`,`serif`,`mono`],zW=[`system`,`light`,`dark`],BW={palette:`default`,accent:``,background:``,foreground:``,font:`codex`};function VW(e){return e===`pine`?`dark`:e===`mist`||e===`rose`?`light`:e}function HW(e,t){return e===`mist`||e===`rose`||e===`pine`?e:t.palette}function UW(e,t){switch(e){case`mist`:return t?{background:`#182126`,foreground:`#EDF3F5`,sidebar:`#1D292F`,accent:`#7BB5CA`}:{background:`#F8FBFC`,foreground:`#253239`,sidebar:`#EEF3F5`,accent:`#347991`};case`rose`:return t?{background:`#211A1C`,foreground:`#F4ECEC`,sidebar:`#2A2123`,accent:`#E09AA5`}:{background:`#FFF9F7`,foreground:`#342729`,sidebar:`#F6EDEA`,accent:`#B45562`};case`pine`:return t?{background:`#101A17`,foreground:`#EAF2EC`,sidebar:`#16241F`,accent:`#86C89E`}:{background:`#F4F8F5`,foreground:`#20352A`,sidebar:`#E9F1EB`,accent:`#32704A`};default:return t?{background:`#17191C`,foreground:`#EDF0F2`,sidebar:`#1D2024`,accent:`#74A9E6`}:{background:`#FFFFFF`,foreground:`#1A1C1F`,sidebar:`#F6F7F9`,accent:`#2563EB`}}}function WW(e){if(e.length>2e3)return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;if(Object.keys(n).sort().join(`,`)!==`appearance,theme,version`||n.version!==1)return null;let r=zW.find(e=>e===n.theme);if(!r||!n.appearance||typeof n.appearance!=`object`||Array.isArray(n.appearance))return null;let i=n.appearance;if(Object.keys(i).sort().join(`,`)!==`accent,background,font,foreground,palette`)return null;let a=LW.find(e=>e===i.palette),o=i.font===`system`?`codex`:RW.find(e=>e===i.font),{accent:s,background:c,foreground:l}=i;return!a||!o||typeof s!=`string`||typeof c!=`string`||typeof l!=`string`||![s,c,l].every(e=>e===``||/^#[0-9a-f]{6}$/iu.test(e))?null:{theme:r,appearance:{palette:a,font:o,accent:s,background:c,foreground:l}}}catch{return null}}var GW=[``,`#2563EB`,`#7C3AED`,`#DB2777`,`#D97706`,`#16A34A`];function KW({label:e,value:t,options:n,disabled:r,onSelect:i}){let a=n.find(e=>e.id===t);return(0,q.jsx)(yo,{className:`settings-select-menu`,button:{label:a?.label??t,"aria-label":e,variant:`secondary`,size:`sm`,className:`appearance-menu-trigger`,isDisabled:r,...a?.color?{icon:(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:a.color}})}:{}},menuWidth:200,alignment:`end`,items:n.map(e=>({id:e.id||`default`,label:e.label,isDisabled:r,...e.color?{icon:(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:e.color}})}:{},endContent:t===e.id?(0,q.jsx)(`span`,{className:`settings-select-check`,"aria-hidden":`true`,children:(0,q.jsx)(rs,{})}):void 0,onClick:()=>i(e.id)}))})}function qW({label:e,value:t,fallback:n,disabled:r,onSave:i}){let a=(t||n).toUpperCase(),o=(0,K.useRef)(a);o.current=a;let[s,c]=(0,K.useState)(a);(0,K.useEffect)(()=>c(a),[a]);let l=e=>{c(e),e!==a&&/^#[0-9a-f]{6}$/iu.test(e)&&i(e).then(e=>{e||c(o.current)})};return(0,q.jsxs)(`div`,{className:`appearance-color-input`,children:[(0,q.jsxs)(`label`,{className:`appearance-color-picker`,children:[(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:a}}),(0,q.jsx)(`input`,{"aria-label":`${e} — ${a}`,type:`color`,value:a,disabled:r,onChange:e=>l(e.target.value.toUpperCase())})]}),(0,q.jsx)(`input`,{className:`appearance-color-hex`,type:`text`,"aria-label":e,value:s,maxLength:7,spellCheck:!1,disabled:r,onChange:e=>l(e.target.value.toUpperCase()),onBlur:()=>c(a)})]})}function JW({catalog:e,theme:t,pending:n,error:r,onRefresh:i,onUpdatePreferences:a}){let{t:o}=W(),{mode:s}=sa(),c=e?.setup,l=c?.ui.webTheme??t,u=c?.ui.webAppearance??BW,d=HW(l,u),f=VW(l),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(``),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(null),[C,w]=(0,K.useState)(c?.ui.webChatWidth??820),[T,E]=(0,K.useState)(c?.ui.webChatFontSize??14),D=(0,K.useRef)({chatWidth:C,fontSize:T});c&&(D.current={chatWidth:c.ui.webChatWidth,fontSize:c.ui.webChatFontSize}),(0,K.useEffect)(()=>{c&&(w(c.ui.webChatWidth),E(c.ui.webChatFontSize))},[c]);let O=e?.setupWritable===!1||!!e?.resources.diagnostics.settingsErrors,k=n||!c||!!r||O,A=WW(_),j=e=>a({appearance:e}),M=()=>{n||(g(!1),v(``),b(!1))},N=f===`dark`||f===`system`&&s===`dark`,P=UW(d,N);return(0,q.jsxs)(`section`,{className:`settings-content-page settings-appearance-panel`,children:[(0,q.jsx)(`h1`,{children:o(`appearance`)}),(!c||r||O)&&(0,q.jsxs)(`div`,{className:`settings-load-state`,role:r||O?`alert`:`status`,children:[(0,q.jsx)(me,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o(O?`configurationReadFailure`:r?`settingsCatalogFailed`:`settingsCatalogLoading`)}),(r||O)&&(0,q.jsx)(`button`,{type:`button`,onClick:i,children:o(`retryAdmissionCheck`)})]}),(0,q.jsxs)(`section`,{className:`appearance-section`,"aria-labelledby":`appearance-visual-title`,children:[(0,q.jsx)(`h2`,{id:`appearance-visual-title`,children:o(`appearanceVisualStyle`)}),(0,q.jsxs)(`div`,{className:`appearance-card appearance-mode-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceMode`)}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":o(`appearanceMode`),className:`appearance-mode-options`,children:zW.map(e=>(0,q.jsx)(V,{content:o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`),children:(0,q.jsxs)(`label`,{className:`appearance-mode-option`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`openpi-appearance-mode`,"aria-label":o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`),checked:f===e,disabled:k,onChange:()=>void a({theme:e})}),(0,q.jsxs)(`span`,{"aria-hidden":`true`,className:`appearance-mode-preview`,"data-mode":e,"data-selected":f===e,children:[(0,q.jsxs)(`span`,{className:`appearance-mini-window`,children:[(0,q.jsx)(`span`,{className:`appearance-mini-sidebar`}),(0,q.jsxs)(`span`,{className:`appearance-mini-chat`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`em`,{})]})]}),e===`system`&&(0,q.jsxs)(`span`,{className:`appearance-mini-window appearance-mini-dark`,children:[(0,q.jsx)(`span`,{className:`appearance-mini-sidebar`}),(0,q.jsxs)(`span`,{className:`appearance-mini-chat`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`em`,{})]})]})]}),(0,q.jsx)(`span`,{className:`appearance-mode-label`,children:o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`)})]})},e))})]}),(0,q.jsxs)(`div`,{className:`appearance-card`,children:[(0,q.jsxs)(`div`,{className:`appearance-row appearance-theme-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceTheme`)}),(0,q.jsxs)(`div`,{className:`appearance-theme-actions`,children:[(0,q.jsx)(V,{content:o(`appearanceImport`),children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":o(`appearanceImport`),disabled:k,onClick:()=>{b(!1),g(!0)},children:(0,q.jsx)(Ts,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:o(`appearanceCopy`),children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":o(`appearanceCopy`),disabled:k,onClick:()=>{td(JSON.stringify({version:1,theme:f,appearance:{...u,palette:d}})).then(e=>S(e?`saved`:`failed`))},children:(0,q.jsx)(Ss,{"aria-hidden":`true`})})})]})]}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":o(`appearanceTheme`),"aria-busy":n,className:`appearance-palette-options`,children:LW.map(e=>{let t=UW(e,N),n=e==="default"?`OpenPI`:o(`theme${e[0].toUpperCase()}${e.slice(1)}`);return(0,q.jsxs)(`label`,{className:`appearance-palette-option`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`openpi-appearance-palette`,"aria-label":n,checked:d===e,disabled:k,onChange:()=>void j({palette:e})}),(0,q.jsxs)(`span`,{className:`appearance-palette-preview`,"aria-hidden":`true`,style:{background:t.background,color:t.foreground},children:[(0,q.jsxs)(`span`,{className:`appearance-palette-shell`,style:{background:t.sidebar},children:[(0,q.jsxs)(`span`,{className:`appearance-palette-sidebar`,children:[(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]}),(0,q.jsxs)(`span`,{className:`appearance-palette-canvas`,style:{background:t.background},children:[(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`em`,{style:{borderColor:t.accent},children:(0,q.jsx)(`span`,{className:`appearance-palette-send`,style:{background:t.accent}})})]})]}),(0,q.jsx)(`span`,{className:`appearance-palette-check`,children:(0,q.jsx)(rs,{})})]}),(0,q.jsx)(`span`,{className:`appearance-palette-label`,children:n})]},e)})}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceAccent`)}),(0,q.jsxs)(`div`,{className:`appearance-accent-controls`,children:[(0,q.jsx)(KW,{label:o(`appearanceAccent`),value:u.accent,options:GW.map((e,t)=>({id:e,label:o(`appearanceAccent${t}`),color:e||`var(--text)`})),disabled:k,onSelect:e=>void j({accent:e})}),(0,q.jsx)(qW,{label:o(`appearanceCustomAccent`),value:u.accent,fallback:`#2563EB`,disabled:k,onSave:e=>j({accent:e})})]})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceBackground`)}),(0,q.jsx)(qW,{label:o(`appearanceBackground`),value:u.background,fallback:P.background,disabled:k,onSave:e=>j({background:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceForeground`)}),(0,q.jsx)(qW,{label:o(`appearanceForeground`),value:u.foreground,fallback:P.foreground,disabled:k,onSave:e=>j({foreground:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceFont`)}),(0,q.jsx)(KW,{label:o(`appearanceFont`),value:u.font===`system`?`codex`:u.font,options:RW.map(e=>({id:e,label:o(`appearanceFont_${e}`)})),disabled:k,onSelect:e=>{let t=RW.find(t=>t===e);t&&j({font:t})}})]})]}),x&&(0,q.jsx)(`p`,{role:x===`failed`?`alert`:`status`,className:`appearance-share-status`,children:o(x===`saved`?`appearanceCopied`:`appearanceCopyFailed`)})]}),(0,q.jsxs)(`section`,{className:`appearance-section`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`appearance-advanced-toggle`,"aria-expanded":p,"aria-controls":`appearance-advanced`,onClick:()=>m(!p),children:[o(`appearanceAdvanced`),p?(0,q.jsx)(is,{"aria-hidden":`true`}):(0,q.jsx)(os,{"aria-hidden":`true`})]}),p&&c&&(0,q.jsxs)(`div`,{id:`appearance-advanced`,className:`appearance-card appearance-advanced-content`,children:[(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`expandThinkingByDefault`)}),(0,q.jsx)(bj,{label:o(`expandThinkingByDefault`),isLabelHidden:!0,value:c.ui.webExpandThinking,size:`sm`,isDisabled:k,onChange:e=>void a({expandThinking:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-slider-row`,children:[(0,q.jsxs)(`div`,{className:`settings-slider-heading`,children:[(0,q.jsx)(`span`,{children:o(`chatContentWidth`)}),(0,q.jsxs)(`output`,{children:[C,`px`]}),(0,q.jsx)(`button`,{type:`button`,className:`settings-reset-button`,"aria-label":o(`resetChatContentWidth`),disabled:k||C===820,onClick:()=>{w(820),a({chatWidth:820}).then(e=>{e||w(D.current.chatWidth)})},children:(0,q.jsx)(he,{"aria-hidden":`true`})})]}),(0,q.jsx)(yW,{label:o(`chatContentWidth`),isLabelHidden:!0,value:C,min:820,max:2e3,step:10,width:`100%`,valueDisplay:`none`,isDisabled:k,onChange:e=>w(e),onChangeEnd:e=>{e!==c.ui.webChatWidth&&a({chatWidth:e}).then(e=>{e||w(D.current.chatWidth)})}})]}),(0,q.jsxs)(`div`,{className:`appearance-slider-row`,children:[(0,q.jsxs)(`div`,{className:`settings-slider-heading`,children:[(0,q.jsx)(`span`,{children:o(`chatFontSize`)}),(0,q.jsxs)(`output`,{children:[T,`px`]}),(0,q.jsx)(`button`,{type:`button`,className:`settings-reset-button`,"aria-label":o(`resetChatFontSize`),disabled:k||T===14,onClick:()=>{E(14),a({chatFontSize:14}).then(e=>{e||E(D.current.fontSize)})},children:(0,q.jsx)(he,{"aria-hidden":`true`})})]}),(0,q.jsx)(yW,{label:o(`chatFontSize`),isLabelHidden:!0,value:T,min:12,max:24,step:1,width:`100%`,valueDisplay:`none`,isDisabled:k,onChange:e=>E(e),onChangeEnd:e=>{e!==c.ui.webChatFontSize&&a({chatFontSize:e}).then(e=>{e||E(D.current.fontSize)})}})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceReset`)}),(0,q.jsxs)(`button`,{type:`button`,className:`appearance-reset`,disabled:k,onClick:()=>void a({theme:`system`,appearance:BW,chatWidth:820,chatFontSize:14,expandThinking:!1}),children:[(0,q.jsx)(he,{"aria-hidden":`true`}),o(`appearanceResetAction`)]})]})]})]}),(0,q.jsxs)(Se,{isOpen:h,onOpenChange:e=>{e||M()},"aria-label":o(`appearanceImport`),width:480,className:`appearance-import-dialog`,children:[(0,q.jsx)(`h2`,{className:`appearance-import-title`,children:o(`appearanceImport`)}),(0,q.jsxs)(`form`,{className:`appearance-import-form`,onSubmit:e=>{e.preventDefault(),!(!A||k)&&(b(!1),a(A).then(e=>{e?(g(!1),v(``)):b(!0)}))},children:[(0,q.jsxs)(`label`,{children:[o(`appearanceThemeValue`),(0,q.jsx)(`textarea`,{maxLength:2e3,value:_,disabled:n,placeholder:o(`appearanceImportPlaceholder`),onChange:e=>{b(!1),v(e.target.value)}})]}),_&&!A&&(0,q.jsx)(`p`,{role:`alert`,children:o(`appearanceImportInvalid`)}),y&&(0,q.jsx)(`p`,{role:`alert`,children:o(`settingsPreferencesSaveFailed`)}),(0,q.jsxs)(`div`,{className:`appearance-import-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:n,onClick:M,children:o(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,disabled:k||!A,children:o(n?`savingSettings`:`appearanceImportAction`)})]})]})]})]})}function YW({workspaces:e,onRestore:t}){let{t:n,i18n:r}=W(),i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(``),[l,u]=(0,K.useState)(`updated`),[d,f]=(0,K.useState)(new Set),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(null),[y,b]=(0,K.useState)(null),[x,S]=(0,K.useState)(new Set),C=(0,K.useRef)(new Set),w=(0,K.useRef)(null),T=(0,K.useRef)(!1),E=JSON.stringify([a.trim(),s,l]),D=(0,K.useRef)({key:E});D.current.key!==E&&(D.current={key:E});let O=p?.scope===E?p:null,k=_?.scope===E?_:null,A=(0,K.useCallback)(async(e,t=0)=>{w.current?.abort();let n=new AbortController;w.current=n,g(!0),v(null);let r={query:a.trim(),sort:l,...s?{cwd:s}:{},limit:25};try{let a=await i.listArchivedSessions({...r,...e?{cursor:e}:{}},n.signal);if(n.signal.aborted||w.current!==n)return;let o=[...a.sessions];for(;!e&&o.length!o.some(t=>t.path===e.path));if(o.push(...e),!e.length)break}m(t=>({...a,scope:E,sessions:e&&t?.scope===E?[...t.sessions,...o.filter(e=>!t.sessions.some(t=>t.path===e.path))]:o}))}catch(t){!n.signal.aborted&&w.current===n&&v({scope:E,stale:t instanceof ge&&t.code===`ARCHIVED_SESSION_CURSOR_STALE`,...e?{cursor:e}:{}})}finally{w.current===n&&(w.current=null,g(!1))}},[i,s,a,E,l]);(0,K.useEffect)(()=>(T.current=!0,()=>{T.current=!1}),[]),(0,K.useEffect)(()=>(b(null),A(),()=>{w.current?.abort(),w.current=null}),[A]);let j=async e=>{if(C.current.has(e))return;C.current.add(e),S(new Set(C.current)),b(null);let n=D.current;try{let r=await t(e);if(!T.current||D.current!==n)return;if(!r){b(e);return}let i=O?.sessions.length??0;m(t=>t?{...t,sessions:t.sessions.filter(t=>t.path!==e)}:null),await A(void 0,i)}catch{T.current&&D.current===n&&b(e)}finally{C.current.delete(e),T.current&&S(new Set(C.current))}},M=new Map;for(let e of O?.sessions??[]){let t=e.workspacePath??e.cwd,n=M.get(t)??[];n.push(e),M.set(t,n)}let N=t=>e.find(e=>e.path===t)?.name??t.split(/[\\/]/u).filter(Boolean).at(-1)??t,P=[...new Set([...e.map(e=>e.path),...M.keys(),...s?[s]:[]])];return(0,q.jsxs)(`section`,{className:`settings-content-page settings-archive-panel`,children:[(0,q.jsx)(`h1`,{children:n(`settingsArchivedChats`)}),(0,q.jsxs)(`div`,{className:`settings-archive-toolbar`,children:[(0,q.jsxs)(`label`,{className:`settings-archive-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":n(`searchArchivedChats`),placeholder:n(`searchArchivedChats`),maxLength:160,value:a,onChange:e=>o(e.target.value)}),a&&(0,q.jsx)(`button`,{type:`button`,"aria-label":n(`settingsClearSearch`),onClick:()=>o(``),children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),(0,q.jsx)(Tj,{label:n(`archiveProjectFilter`),value:s,onChange:c,options:[{value:``,label:n(`archiveAllProjects`)},...P.map(e=>({value:e,label:N(e)}))]}),(0,q.jsx)(Tj,{label:n(`archiveSort`),value:l,onChange:e=>u(e===`created`?`created`:`updated`),options:[{value:`updated`,label:n(`archiveSortUpdated`)},{value:`created`,label:n(`archiveSortCreated`)}]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":n(`refreshArchives`),disabled:h,onClick:()=>void A(void 0,O?.sessions.length),children:(0,q.jsx)(me,{"aria-hidden":`true`})})]}),k&&(0,q.jsxs)(`div`,{className:`settings-archive-error`,role:`alert`,children:[(0,q.jsx)(`span`,{children:n(k.stale?`archiveCursorStale`:`archiveLoadFailed`)}),(0,q.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>void A(k.stale?void 0:k.cursor),children:n(`retryAdmissionCheck`)})]}),y&&(0,q.jsx)(`div`,{className:`settings-archive-error`,role:`alert`,children:n(`restoreFailed`)}),h&&(0,q.jsx)(`p`,{role:`status`,className:`settings-archive-status`,children:n(`loadingArchives`)}),!h&&!k&&O?.sessions.length===0&&(0,q.jsxs)(`div`,{className:`settings-archive-empty`,children:[(0,q.jsx)(Go,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:n(a.trim()||s?`noMatchingScannedArchives`:O.truncation.truncated?`noScannedArchives`:`noArchivedSessions`)})]}),(0,q.jsx)(`div`,{className:`settings-archive-groups`,children:[...M].map(([e,t])=>(0,q.jsxs)(`section`,{className:`settings-archive-group`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`settings-archive-group-heading`,"aria-label":n(`archiveProjectGroup`,{project:N(e),count:t.length}),"aria-expanded":!d.has(e),"aria-controls":`archive-group-${encodeURIComponent(e)}`,onClick:()=>f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),children:[d.has(e)?(0,q.jsx)(os,{"aria-hidden":`true`}):(0,q.jsx)(is,{"aria-hidden":`true`}),(0,q.jsx)(Vs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{title:e,children:N(e)}),(0,q.jsx)(`small`,{children:t.length})]}),!d.has(e)&&(0,q.jsx)(`ul`,{id:`archive-group-${encodeURIComponent(e)}`,className:`settings-archive-list`,children:t.map(e=>{let t=e.name||e.firstMessage||n(`untitledSession`),i=new Date(l===`created`?e.created:e.modified);return(0,q.jsxs)(`li`,{className:`settings-archive-row`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`settings-archive-chat-title`,title:t,children:t}),(0,q.jsx)(`time`,{dateTime:Number.isNaN(i.getTime())?void 0:i.toISOString(),children:Number.isNaN(i.getTime())?n(`unknownState`):new Intl.DateTimeFormat(r.language,{dateStyle:`medium`}).format(i)})]}),(0,q.jsxs)(`button`,{type:`button`,"aria-label":n(`restoreArchivedChat`,{title:t}),disabled:x.has(e.path),onClick:()=>void j(e.path),children:[(0,q.jsx)(Wo,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:n(x.has(e.path)?`restoringConversation`:`restoreConversation`)})]})]},e.path)})})]},e))}),!!O?.truncation.recordsUnscanned&&(0,q.jsx)(`p`,{className:`settings-archive-status`,children:n(`archiveScanBounded`,{count:O.truncation.recordsUnscanned})}),O?.nextCursor&&(0,q.jsx)(`button`,{type:`button`,className:`settings-archive-more`,disabled:h,onClick:()=>void A(O.nextCursor),children:n(`moreArchives`)})]})}var XW=[{id:`general`,group:`settingsPersonal`,label:`generalSettings`,Icon:Nc,terms:[`agentBehavior`,`resultDisplay`,`workflowLimits`,`runtimeIdentity`,`runtimeBackendVersion`,`runtimePackageRoot`,`runtimeStartedAt`,`runtimeGitRevision`,`runtimeGitState`,`runtimeFrontendVersion`,`runtimeFrontendBuild`,`runtimeStartupBuild`]},{id:`appearance`,group:`settingsPersonal`,label:`appearance`,Icon:zc,terms:[`appearanceTheme`,`appearanceAccent`,`appearanceFont`,`chatContentWidth`,`chatFontSize`]},{id:`archived-chats`,group:`settingsPersonal`,label:`settingsArchivedChats`,Icon:Go,terms:[`restoreConversation`]},{id:`configuration`,group:`settingsPersonal`,label:`configurationSettings`,Icon:Mc,terms:[`configurationApproval`,`configurationSandbox`,`configurationVerbosity`,`configurationSummary`,`configurationReasoningLevels`,`configurationDependencies`]},{id:`models`,group:`settingsAgent`,label:`modelSettings`,Icon:ws,terms:[`modelDefaultTitle`]},{id:`subagents`,group:`settingsAgent`,label:`subagentsSettings`,Icon:$o,terms:[]},{id:`web-search`,group:`settingsAgent`,label:`webSearchSettings`,Icon:Dc,terms:[]},{id:`skills`,group:`settingsIntegrations`,label:`skillsSettings`,Icon:Xs,terms:[]},{id:`plugins`,group:`settingsIntegrations`,label:`pluginsSettings`,Icon:Sc,terms:[]},{id:`browser`,group:`settingsIntegrations`,label:`browserSettings`,Icon:Es,terms:[]}];function ZW(e){return XW.find(({id:t})=>t===e)?.id}function QW({sessionId:e,sessionPath:t,cwd:n,entry:r=`general`,models:i,currentModel:a,thinkingLevel:o,theme:s,preferences:c,workspaces:l=[],onRestoreSession:u,capabilities:d,setupBusy:f,setupBlockedReason:p,plan:m,planSelectionPending:h=!1,onExitPlan:g,setupOutcome:_,onConfigureOpenPi:v,interaction:y,onPreferencesChanged:b,onSelectModel:x,onOpenRuntimeStatus:S,onClose:C}){let{t:w}=W(),T=f||!!p,E=(0,K.useRef)(null),D=(0,K.useRef)(null),[O,k]=(0,K.useState)(``),[A,j]=(0,K.useState)(r===`credentials`?`models`:r),[M,N]=(0,K.useState)(r===`credentials`||r===`models`),[P,F]=(0,K.useState)(!1),[I,ee]=(0,K.useState)(!1),[L,R]=(0,K.useState)(`general`),te=(0,K.useRef)(!1),z=(0,K.useRef)(!1),B=(0,K.useRef)(0),[ne,re]=(0,K.useState)(!1),V=(0,K.useRef)(!1),[ie,ae]=(0,K.useState)(!1),[oe,se]=(0,K.useState)(null),[ce,le]=(0,K.useState)(!1),[H,ue]=(0,K.useState)(!1),[fe,pe]=(0,K.useState)(null),me=H,he=(0,K.useRef)(void 0),ge=m!==void 0&&m!==`inactive`,_e=P||T||ge||h,ve=I&&L!==A||!I&&(A===`skills`||A===`plugins`||A===`web-search`)?void 0:!I||_?.requestId!==he.current?_:void 0,{catalog:ye,error:be,refresh:xe,updateSetup:Ce}=IW(e,a?`${a.provider}/${a.id}`:``,JSON.stringify(c)),we=ve!==void 0&&[`failed`,`cancelled`,`unconfirmed`].includes(ve.status);(0,K.useEffect)(()=>{E.current?.focus()},[]),(0,K.useEffect)(()=>{if(I){if(ve&&ve.status!==`pending`&&te.current){te.current=!1,z.current=!1,window.clearTimeout(B.current),xe(),b();return}if(T){z.current=!0;return}!z.current||!te.current||(te.current=!1,z.current=!1,window.clearTimeout(B.current),xe(),b())}},[b,xe,T,I,ve]),(0,K.useEffect)(()=>()=>window.clearTimeout(B.current),[]);let Te=async e=>{if(ae(!1),_e)return!1;he.current=_?.requestId,R(A),F(!0),ee(!1),te.current=!1,z.current=!1,window.clearTimeout(B.current),se(null);try{let t=await v(e);return t?(ee(!0),te.current=!0,B.current=window.setTimeout(()=>{!te.current||z.current||(te.current=!1,z.current=!1,xe(),b())},2e3)):se(w(`setupRequestFailed`)),t}catch(e){return F(!1),se(e instanceof Error?e.message:w(`setupRequestFailed`)),!1}finally{F(!1)}},Ee=async()=>{if(_e||!ye?.sessionPath)throw Error(w(`resourceReloadFailed`));F(!0);try{await new de().reloadSettingsResources(e,ye.sessionPath),xe(),b()}finally{F(!1)}},U=async e=>{if(V.current||!ye)return!1;V.current=!0,re(!0),ae(!1),se(null);try{let t=await new de().savePreferences(e);return Ce(t.setup),ae(!0),b(),!0}catch{return se(w(`settingsPreferencesSaveFailed`)),!1}finally{V.current=!1,re(!1)}},De=e=>{me||(j(e),k(``),e===`models`&&N(!0),se(null))};(0,K.useEffect)(()=>{let e=new URL(window.location.href);e.searchParams.set(`settings`,A),window.history.replaceState(window.history.state,``,e)},[A]);let Oe=XW.filter(({label:e,terms:t})=>[e,...t].some(e=>w(e).normalize(`NFKC`).toLocaleLowerCase().includes(O.trim().normalize(`NFKC`).toLocaleLowerCase()))),ke=(e,t=!1)=>{if(!me){if(ce&&!t){pe(e);return}pe(null),e.kind===`runtime`?S():C()}};return(0,q.jsxs)(Se,{isOpen:!0,purpose:`info`,padding:0,width:`calc(100vw - 32px)`,maxHeight:`calc(100dvh - 16px)`,className:`provider-settings-dialog`,"aria-label":w(`settings`),onOpenChange:e=>{!e&&!fe&&ke({kind:`close`})},children:[(0,q.jsxs)(`section`,{className:`provider-settings-surface`,children:[(0,q.jsxs)(`aside`,{className:`provider-settings-sidebar`,children:[(0,q.jsxs)(`header`,{className:`provider-settings-header`,children:[(0,q.jsx)(`strong`,{className:`provider-settings-title`,children:w(`settings`)}),(0,q.jsx)(`select`,{className:`provider-settings-mobile-picker`,"aria-label":w(`settingsNavigation`),disabled:me,value:A,onChange:e=>{let t=XW.find(({id:t})=>t===e.target.value);t&&De(t.id)},children:XW.map(({id:e,label:t})=>(0,q.jsx)(`option`,{value:e,children:w(t)},e))})]}),(0,q.jsxs)(`label`,{className:`provider-settings-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":w(`settingsSearch`),placeholder:w(`settingsSearch`),value:O,onChange:e=>k(e.target.value),disabled:me}),O&&(0,q.jsx)(`button`,{type:`button`,"aria-label":w(`settingsClearSearch`),onClick:()=>k(``),children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),(0,q.jsxs)(`div`,{className:`provider-settings-navigation`,ref:D,"aria-label":w(`settingsNavigation`),role:`tablist`,"aria-orientation":`vertical`,children:[[`settingsPersonal`,`settingsAgent`,`settingsIntegrations`].map(e=>(0,q.jsxs)(`div`,{className:`provider-settings-nav-group`,children:[Oe.some(t=>t.group===e)&&(0,q.jsx)(`p`,{children:w(e)}),Oe.filter(t=>t.group===e).map(({id:e,label:t,Icon:n})=>(0,q.jsxs)(`button`,{type:`button`,role:`tab`,disabled:me,id:`settings-tab-${e}`,tabIndex:A===e||!Oe.some(e=>e.id===A)&&Oe[0]?.id===e?0:-1,"aria-selected":A===e,"aria-controls":`settings-panel-${e}`,className:`provider-settings-tab`,title:w(t),onClick:()=>De(e),onKeyDown:t=>{if(t.altKey||t.ctrlKey||t.metaKey||t.nativeEvent.isComposing)return;let n=Oe.findIndex(t=>t.id===e),r=t.key===`Home`?0:t.key===`End`?Oe.length-1:t.key===`ArrowDown`||t.key===`ArrowRight`?(n+1)%Oe.length:t.key===`ArrowUp`||t.key===`ArrowLeft`?(n+Oe.length-1)%Oe.length:void 0;if(r===void 0)return;t.preventDefault();let i=Oe[r].id;De(i),D.current?.querySelector(`#settings-tab-${i}`)?.focus()},children:[(0,q.jsx)(n,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:w(t)})]},e))]},e)),Oe.length===0&&(0,q.jsx)(`p`,{className:`provider-settings-no-results`,role:`status`,children:w(`settingsNoResults`)})]}),(0,q.jsx)(`button`,{ref:E,type:`button`,className:`icon-button provider-settings-close`,"aria-label":w(`close`),disabled:me,title:w(me?`savingSettings`:`close`),onClick:()=>ke({kind:`close`}),children:(0,q.jsx)(je,{})})]}),(0,q.jsxs)(`div`,{className:`provider-settings-body`,children:[ge&&A!==`browser`&&(0,q.jsxs)(`div`,{className:`settings-plan-notice`,role:`status`,children:[(0,q.jsx)(`span`,{children:w(T?`setupPlanBusy`:`setupPlanBlocked`)}),(0,q.jsx)(Br,{label:w(`planModeExit`),variant:`secondary`,size:`sm`,isDisabled:T||h||!g,onClick:()=>void g?.()})]}),(0,q.jsxs)(`div`,{className:`provider-settings-main`,children:[(0,q.jsx)(`div`,{id:`settings-panel-configuration`,"aria-labelledby":`settings-tab-configuration`,"aria-label":w(`configurationSettings`),role:`tabpanel`,hidden:A!==`configuration`,children:A===`configuration`&&(0,q.jsx)(Aj,{catalog:ye,error:be,pending:_e||I&&L===`configuration`&&(!ve||ve.status===`pending`),preferencePending:ne,onConfigure:Te,onUpdatePreferences:U,onRefresh:xe,onOpenRuntimeStatus:()=>ke({kind:`runtime`})})}),(0,q.jsx)(`div`,{id:`settings-panel-appearance`,"aria-labelledby":`settings-tab-appearance`,"aria-label":w(`appearance`),role:`tabpanel`,hidden:A!==`appearance`,children:(0,q.jsx)(JW,{catalog:ye,theme:s,pending:ne,error:be,onRefresh:xe,onUpdatePreferences:U})}),(0,q.jsx)(`div`,{id:`settings-panel-archived-chats`,"aria-labelledby":`settings-tab-archived-chats`,"aria-label":w(`settingsArchivedChats`),role:`tabpanel`,hidden:A!==`archived-chats`,children:A===`archived-chats`&&(0,q.jsx)(YW,{workspaces:l,onRestore:u??(async()=>!1)})}),(0,q.jsx)(`div`,{id:`settings-panel-web-search`,"aria-labelledby":`settings-tab-web-search`,"aria-label":w(`webSearchSettings`),role:`tabpanel`,hidden:A!==`web-search`,children:A===`web-search`&&(0,q.jsx)(jj,{catalog:ye,error:be,pending:_e,onConfigure:Te,onRefresh:xe})}),(0,q.jsx)(`div`,{id:`settings-panel-browser`,"aria-labelledby":`settings-tab-browser`,"aria-label":w(`browserSettings`),role:`tabpanel`,hidden:A!==`browser`,children:A===`browser`&&(0,q.jsx)(Oj,{onConfigure:Te,setupPending:_e})}),(0,q.jsx)(`div`,{id:`settings-panel-general`,"aria-labelledby":`settings-tab-general`,"aria-label":w(`generalSettings`),role:`tabpanel`,hidden:A!==`general`,children:(0,q.jsx)(TW,{catalog:ye,error:be,currentModel:a,thinkingLevel:o,cwd:n,setupPending:P||T,preferencePending:ne||!ye,setupBusy:T,setupBlockedReason:p,setupBlocked:ge||h,onConfigure:Te,onUpdatePreferences:U,onOpenRuntimeStatus:()=>ke({kind:`runtime`}),onRefresh:xe})}),(0,q.jsx)(`section`,{id:`settings-panel-models`,"aria-labelledby":`settings-tab-models`,"aria-label":w(`modelSettings`),className:`settings-models`,role:`tabpanel`,hidden:A!==`models`,children:M&&(0,q.jsx)(oW,{sessionId:e,sessionPath:t,models:i,currentModel:a,busy:T,focusCredentials:r===`credentials`,onSaved:async()=>(xe(),b()),onSelectModel:x,onDraftChange:le,onSavingChange:ue},e)}),(0,q.jsx)(`div`,{id:`settings-panel-skills`,"aria-labelledby":`settings-tab-skills`,"aria-label":w(`skillsSettings`),role:`tabpanel`,hidden:A!==`skills`,children:(0,q.jsx)(jW,{catalog:ye,error:be,onRefresh:xe,setupPending:_e,onConfigure:Te,onReload:Ee},e)}),(0,q.jsx)(`div`,{id:`settings-panel-subagents`,"aria-labelledby":`settings-tab-subagents`,"aria-label":w(`subagentsSettings`),role:`tabpanel`,hidden:A!==`subagents`,children:(0,q.jsx)(MW,{catalog:ye,error:be,currentModel:a,models:i,activity:d?.subagents,setupPending:P||T,setupBlocked:ge||h,onConfigure:Te,onRefresh:xe})}),(0,q.jsx)(`div`,{id:`settings-panel-plugins`,"aria-labelledby":`settings-tab-plugins`,"aria-label":w(`pluginsSettings`),role:`tabpanel`,hidden:A!==`plugins`,children:(0,q.jsx)(FW,{catalog:ye,error:be,onRefresh:xe,setupPending:_e,onConfigure:Te,onReload:Ee},e)})]}),y,oe&&(0,q.jsx)(`div`,{className:`settings-global-error`,role:`alert`,children:oe}),(ne||ie)&&!oe&&!we&&(0,q.jsx)(`div`,{className:`settings-global-status`,role:`status`,children:w(ne?`savingSettings`:`settingsPreferencesSaved`)}),!ne&&(!ie||we)&&(I&&L===A||ve)&&!oe&&(0,q.jsxs)(`div`,{className:ve?.status===`failed`?`settings-global-error`:`settings-global-status`,role:ve?.status===`failed`?`alert`:`status`,children:[w(ve?(A===`skills`||A===`plugins`||A===`web-search`)&&[`unconfirmed`,`saved`,`unchanged`].includes(ve.status)?`resourceRequestFinished`:`setupOutcome_${ve.status}`:T?`setupRequestRunning`:A===`skills`||A===`plugins`||A===`web-search`?`resourceRequestSubmitted`:`setupRequestAccepted`),ve?.error&&(0,q.jsx)(`p`,{children:ve.error})]})]})]}),fe&&(0,q.jsx)(uj,{isOpen:!0,onOpenChange:e=>{e||pe(null)},title:w(`unsavedSettingsTitle`),description:w(`unsavedSettingsDetail`),cancelLabel:w(`keepEditing`),actionLabel:w(`discardAndContinue`),onAction:()=>ke(fe,!0)})]})}function $W({identity:e}){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;let n=t%6;return(0,q.jsx)(`span`,{className:`subagent-avatar tone-${n}`,"aria-hidden":`true`,children:(0,q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,children:[(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,q.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`}),(0,q.jsx)(`path`,{d:`M3 12h18M5 6.5c4 3 10 3 14 0M5 17.5c4-3 10-3 14 0`})]},`sphere`),(0,q.jsx)(`g`,{children:(0,q.jsx)(`path`,{d:`M4 20V4a16 16 0 0 1 16 16H4ZM4 4l16 16M4 9l11 11M4 14l6 6M10 5l-6 15M16 10L4 20`})},`fan`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`path`,{d:`m12 2 3 6 7-1-4 5 4 5-7-1-3 6-3-6-7 1 4-5-4-5 7 1Z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`})]},`rosette`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,q.jsx)(`path`,{d:`M3 12h18M12 3a9 9 0 0 0 0 18M12 6a6 6 0 0 0 0 12M12 9a3 3 0 0 0 0 6M12 3v18`})]},`arcs`),(0,q.jsx)(`g`,{children:(0,q.jsx)(`path`,{d:`m12 2 9 5v10l-9 5-9-5V7Zm0 0v20M3 7l18 10M21 7 3 17M3 7l9 5 9-5M3 17l9-5 9 5`})},`prism`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`path`,{d:`M12 12V2c6 0 10 4 10 10H12Zm0 0v10C6 22 2 18 2 12h10ZM12 12H2C2 6 6 2 12 2v10Zm0 0h10c0 6-4 10-10 10V12Z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2`,fill:`currentColor`})]},`windmill`)][n]})})}function eG(e,t,n,r){let i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(0),p=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(!n)return;let r=new AbortController;return p.current=r,c(!0),u(!1),i.sessionSources(e,t,r.signal).then(n=>{!r.signal.aborted&&n.sessionId===e&&n.path===t&&o(n)}).catch(()=>{r.signal.aborted||u(!0)}).finally(()=>{r.signal.aborted||(c(!1),p.current=null)}),()=>{r.abort(),p.current?.abort(),p.current=null}},[i,e,t,n,r,d]),{page:a?.sessionId===e&&a.path===t?a:null,loading:s,error:l,loadMore:async()=>{if(p.current||!a||a.nextOffset===void 0)return;let n=new AbortController;p.current=n,c(!0),u(!1);try{let r=await i.sessionSources(e,t,n.signal,a.nextOffset,a.revision);!n.signal.aborted&&r.sessionId===e&&r.path===t&&r.revision===a.revision&&o({...r,sources:[...a.sources,...r.sources]})}catch{n.signal.aborted||u(!0)}finally{n.signal.aborted||(c(!1),p.current=null)}},refresh:()=>f(e=>e+1)}}function tG({sessionId:e,path:t,source:n,thumbnail:r=!1,active:i=!0}){let{t:a}=W(),o=(0,K.useRef)(null),[s,c]=(0,K.useState)(!1),l=JSON.stringify([e,t,n.entryId,n.partIndex]),[u,d]=(0,K.useState)(null);(0,K.useEffect)(()=>{if(!r||!o.current||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(([e])=>c(!!e?.isIntersecting));return e.observe(o.current),()=>e.disconnect()},[r]),(0,K.useEffect)(()=>{if(!i||r&&!s){d(null);return}let a=new AbortController,o;return d({identity:l}),new de().sourceImage(e,t,n.entryId,n.partIndex,a.signal).then(e=>{if(a.signal.aborted)return;if(![`image/png`,`image/jpeg`,`image/gif`,`image/webp`].includes(e.mimeType)||e.data.length>xe)throw Error(`Invalid image`);let t=atob(e.data);if(t.length>10485760||btoa(t)!==e.data)throw Error(`Invalid image`);let n=Uint8Array.from(t,e=>e.charCodeAt(0));o=URL.createObjectURL(new Blob([n],{type:e.mimeType})),d({identity:l,url:o})}).catch(()=>{a.signal.aborted||d({identity:l,failed:!0})}),()=>{a.abort(),o&&URL.revokeObjectURL(o)}},[e,t,n.entryId,n.partIndex,l,i,r,s]);let f=i&&(!r||s)&&u?.identity===l?u:null;return(0,q.jsx)(`span`,{ref:o,className:`session-source-image`,"data-thumbnail":r||void 0,children:f?.url&&!f.failed?(0,q.jsx)(`img`,{src:f.url,draggable:!1,alt:r?``:n.name||a(`attachedImage`),onError:()=>d({identity:l,failed:!0})}):r?(0,q.jsx)(qs,{"aria-hidden":`true`}):(0,q.jsx)(`p`,{role:f?.failed?`alert`:`status`,children:a(f?.failed?`imagePreviewFailed`:`readingFile`)})})}function nG({source:e,sessionId:t,path:n,onOpen:r,thumbnail:i=!0,detailed:a=!1}){let{t:o}=W();return(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row session-source-row${a?` source-detail-row`:``}`,title:e.reference||e.name||o(`attachedImage`),onClick:r,children:[(0,q.jsx)(`span`,{className:`session-source-icon`,children:e.kind===`image`?i?(0,q.jsx)(tG,{sessionId:t,path:n,source:e,thumbnail:!0}):(0,q.jsx)(qs,{"aria-hidden":`true`}):(0,q.jsx)(Fs,{"aria-hidden":`true`})}),a?(0,q.jsxs)(`span`,{className:`session-source-copy`,children:[(0,q.jsx)(`strong`,{children:e.name||o(`attachedImage`)}),e.reference&&(0,q.jsx)(`span`,{className:`source-detail-reference`,children:e.reference}),(0,q.jsx)(`span`,{className:`source-detail-status`,children:o(`sourceAttached`)})]}):(0,q.jsx)(`span`,{children:e.name||o(`attachedImage`)})]})}function rG({sessionId:e,path:t,data:n,onSelect:r}){let{t:i}=W(),a=be(),o=(0,K.useRef)(null),s=(0,K.useRef)(a?.sources?.scroll??0);return(0,K.useLayoutEffect)(()=>{n.page?.sources.length&&o.current&&(o.current.scrollTop=s.current)},[n.page?.sources.length]),(0,q.jsxs)(`div`,{className:`session-sources-list`,ref:o,onScroll:e=>{s.current=e.currentTarget.scrollTop,a&&(a.sources={scroll:s.current})},children:[!n.loading&&!n.error&&!n.page?.sources.length&&(0,q.jsx)(`p`,{children:i(`sourcesEmpty`)}),n.page?.sources.map(n=>(0,q.jsx)(nG,{source:n,sessionId:e,path:t,onOpen:()=>r(n),detailed:!0},n.id)),n.error&&(0,q.jsxs)(`p`,{role:`alert`,children:[i(`sourcesFailed`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:n.refresh,children:i(`gitReviewRetry`)})]}),n.loading&&(0,q.jsx)(`p`,{role:`status`,children:i(`readingFile`)}),n.page?.nextOffset!==void 0&&(0,q.jsx)(`button`,{className:`sources-load-more`,type:`button`,disabled:n.loading,onClick:()=>void n.loadMore(),children:i(`sourcesLoadMore`)}),n.page?.truncated&&(0,q.jsx)(`p`,{children:i(`sourcesPartial`)})]})}function iG({sessionId:e,path:t,revision:n}){let{t:r}=W(),i=eG(e,t,!0,n),a=(0,K.useRef)(null);(0,K.useEffect)(()=>{let e=requestAnimationFrame(()=>a.current?.focus({preventScroll:!0}));return()=>cancelAnimationFrame(e)},[]);let o=(0,K.useContext)($E),[s,c]=(0,K.useState)(null),l=e=>{e?.kind===`file`&&e.reference?o?.open(e.reference,void 0,document.activeElement instanceof HTMLElement?document.activeElement:void 0):c(e)};return(0,q.jsxs)(`section`,{className:`session-sources-panel`,ref:a,tabIndex:-1,"aria-label":r(`sessionSources`),children:[(0,q.jsx)(rG,{sessionId:e,path:t,data:i,onSelect:l}),(0,q.jsx)(aG,{sessionId:e,path:t,open:!!s,source:s,data:i,onSelect:l,onClose:()=>c(null)})]})}function aG({sessionId:e,path:t,open:n,source:r,data:i,onSelect:a,onClose:o}){let{t:s}=W(),[c,l]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{r?.id,l(!1)},[e,t,r?.id]),(0,q.jsx)(Se,{isOpen:n,onOpenChange:e=>!e&&o(),purpose:`info`,width:800,maxHeight:`calc(100dvh - 32px)`,padding:0,"aria-label":s(`sessionSources`),children:n&&(0,q.jsxs)(`div`,{className:`session-sources-dialog draft-image-preview`,children:[(0,q.jsxs)(`header`,{children:[r&&i&&(0,q.jsx)(`button`,{type:`button`,"aria-label":s(`sourcesBack`),onClick:()=>a(null),children:(0,q.jsx)(Ko,{})}),(0,q.jsx)(`strong`,{title:r?.name,children:r?r.name||s(`attachedImage`):s(`sessionSources`)}),r&&(0,q.jsx)(`button`,{type:`button`,"aria-pressed":c,onClick:()=>l(e=>!e),children:s(c?`fitImage`:`originalImageSize`)}),(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,"aria-label":s(`close`),onClick:o,children:(0,q.jsx)(je,{})})]}),r?(0,q.jsx)(lO,{original:c,children:(0,q.jsx)(tG,{sessionId:e,path:t,source:r,active:n},JSON.stringify([e,t,r.id]))},JSON.stringify([e,t,r.id])):i?(0,q.jsx)(rG,{sessionId:e,path:t,data:i,onSelect:a}):null]})})}function oG({sessionId:e,workspace:t,agents:n,omitted:r,omittedWorkflows:i=0,review:a,onSubagents:o,onReview:s,onSources:c,sessionPath:l,revision:u,onAddSources:d,reviewLoading:f=!1,reviewError:p}){let{t:m}=W(),[h,g]=(0,K.useState)(!1),_=(0,K.useRef)(null),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!0),S=(0,K.useId)(),[C,w]=(0,K.useState)(null),T=eG(e,l??``,!!(l&&(h||v)),u),E=(0,K.useContext)($E),D=a?.ok?a.snapshot.totals:void 0,O=e=>{!e&&c?(y(!1),w(null),P(c)):e?.kind===`file`&&e.reference?(y(!1),P(()=>E?.open(e.reference,void 0,_.current??void 0))):P(()=>{w(e),y(!0)})},k=n.filter(e=>e.state===`running`),A=n.filter(e=>e.state===`done`),j=n.length-k.length-A.length,M=[...k,...n.filter(e=>e.state!==`running`)].slice(0,4),N=[k.length?m(`subagentSummaryRunning`,{count:k.length}):``,A.length?m(`subagentSummaryDone`,{count:A.length}):``,j?m(`subagentSummaryOther`,{count:j}):``].filter(Boolean).join(` · `)||m(`subagentNoneYet`),P=e=>{g(!1),_.current?.focus(),e()};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Zu,{isOpen:h,onOpenChange:g,placement:`below`,alignment:`end`,width:`min(340px, calc(100vw - 24px))`,label:m(`sessionOverview`),closeButtonLabel:m(`close`),isModal:!1,content:(0,q.jsxs)(`div`,{className:`session-overview`,children:[(0,q.jsx)(`p`,{className:`session-overview-title`,children:t}),(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row`,title:m(`sessionOverviewChanges`),onClick:()=>P(s),children:[(0,q.jsx)(Ms,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:m(`overviewChanges`)}),D&&!p?(0,q.jsxs)(`span`,{className:`session-overview-diff`,title:m(D.complete?`overviewLineTotals`:`overviewPartialTotals`),children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,D.additions.toLocaleString()]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,D.deletions.toLocaleString()]}),!D.complete&&(0,q.jsx)(`span`,{className:`session-overview-note`,children:m(`gitReviewPartialLabel`)})]}):(0,q.jsx)(`span`,{className:`session-overview-note`,children:m(f?`overviewCounting`:a?.ok?`overviewCountsUnknown`:`overviewReviewUnavailable`)})]}),(0,q.jsxs)(`div`,{className:`session-overview-section`,children:[(0,q.jsx)(`p`,{children:m(`subagentDetails`)}),(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row session-overview-agents`,onClick:()=>P(o),"aria-label":`${m(`subagentDetails`)}: ${N}`,children:[M.length>0&&(0,q.jsx)(`span`,{className:`subagent-avatar-stack`,children:M.map(t=>(0,q.jsx)($W,{identity:`${e}:${t.id}`},t.id))}),(0,q.jsx)(`span`,{className:`session-overview-agent-counts`,children:N.split(` · `).map(e=>(0,q.jsx)(`span`,{children:e},e))}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),r>0&&(0,q.jsx)(`small`,{children:m(`subagentListTruncated`,{count:r})}),i>0&&(0,q.jsx)(`small`,{children:m(`subagentWorkflowsTruncated`,{count:i})})]}),l&&(0,q.jsxs)(`div`,{className:`session-overview-section`,children:[(0,q.jsxs)(`div`,{className:`session-overview-section-heading`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`session-sources-toggle`,"aria-expanded":b,"aria-controls":S,onClick:()=>x(e=>!e),children:[(0,q.jsx)(`span`,{children:m(`sessionSources`)}),T.page&&(T.page.total!==void 0||T.page.nextOffset===void 0)&&(0,q.jsxs)(`span`,{children:[`· `,T.page.total??T.page.sources.length,T.page.truncated?`+`:``]}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),d&&(0,q.jsx)(V,{content:m(`sourcesAdd`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":m(`sourcesAdd`),onClick:()=>P(d),children:(0,q.jsx)(Ae,{})})})]}),(0,q.jsxs)(`div`,{id:S,hidden:!b,children:[T.page?.sources.slice(0,3).map(t=>(0,q.jsx)(nG,{source:t,sessionId:e,path:l,onOpen:()=>O(t)},t.id)),T.error?(0,q.jsxs)(`p`,{role:`alert`,children:[m(`sourcesFailed`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:T.refresh,children:m(`gitReviewRetry`)})]}):!T.page?.sources.length&&(0,q.jsx)(`p`,{children:m(T.loading?`readingFile`:`sourcesEmpty`)}),!!(T.page&&(T.page.sources.length>3||T.page.nextOffset!==void 0))&&(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row sources-view-all`,onClick:()=>O(null),children:[(0,q.jsx)(Qs,{}),(0,q.jsx)(`span`,{children:m(`sourcesViewAll`)}),(0,q.jsx)(os,{})]})]})]})]}),children:e=>(0,q.jsx)(V,{content:m(`sessionOverview`),placement:`below`,children:(0,q.jsx)(`button`,{...e,ref:t=>{e.ref(t),_.current=t},type:`button`,className:`task-tools-trigger`,"aria-label":m(`sessionOverview`),children:(0,q.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,q.jsx)(`circle`,{cx:`5.5`,cy:`7`,r:`2.8`}),(0,q.jsx)(`circle`,{cx:`5.5`,cy:`17`,r:`2.8`}),(0,q.jsx)(`path`,{d:`M12 7h8M12 17h8`})]})})})}),l&&(0,q.jsx)(aG,{sessionId:e,path:l,open:v,source:C,data:T,onSelect:O,onClose:()=>{y(!1),w(null)}})]})}function sG(e){return e<1e3?Math.round(e).toString():e<1e4?`${(e/1e3).toFixed(1)}k`:e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1)}M`}function cG(e){if(!e)return;let{input:t,output:n,cacheRead:r,cacheWrite:i}=e;if(t===0&&n===0&&r===0&&i===0)return;let a=t+r+i,o=r>0?` (${sG(r)} cached)`:``;return`${sG(a)} in${o} · ${sG(n)} out`}function lG(e,t,n){if([`session_start`,`session_switched`,`session_created`].includes(t))return e.length===0?e:[];if([`agent_settled`,`turn_settled`].includes(t))return e.some(e=>e.state===`running`)?e.map(e=>e.state===`running`?{...e,state:`unknown`}:e):e;if(!t.startsWith(`tool_execution_`))return e;let r=n.toolCallId;if(typeof r!=`string`||r.length>500)return e;let i=e.find(e=>e.call.id===r);if(i&&i.state!==`running`&&(i.state!==`unknown`||t!==`tool_execution_end`))return e;let a=dd(n.call),o=a.type===`toolCall`&&typeof a.name==`string`&&typeof a.arguments==`string`?a:i?.call;if(!o||o.evidenceTruncated&&o.id?.includes(`[truncated]`))return e;let s=dd(n.result),c=typeof s.content==`string`?s:i?.result,l=typeof n.parentToolCallId==`string`&&n.parentToolCallId.length<=500?n.parentToolCallId:i?.parentToolCallId,u={call:o,result:c,...l?{parentToolCallId:l}:{},state:t===`tool_execution_end`?n.isError===!0?`failed`:`returned`:`running`},d=(i?e.map(e=>e.call.id===r?u:e):[...e,u]).slice(-32);for(;d.length>0&&new TextEncoder().encode(JSON.stringify(d)).byteLength>524288;)d.shift();return d}var uG={en:{translation:{quitOpenPI:`Quit OpenPI`,quittingOpenPI:`Quitting…`,quitConfirmHelp:`Quit this OpenPI Web application? All running tasks in this Web application will stop. Conversations are saved and will be available when you restart.`,quitTabHelp:`Closing this browser tab alone leaves OpenPI and its tasks running in the background.`,quitAccepted:`OpenPI is shutting down`,quitAcceptedHelp:`The quit request was accepted. Wait for the terminal to confirm that OpenPI has stopped, then you can close this tab.`,quitRestartHelp:`To restart, run openpi web in a terminal, or /web in Pi, then open the address it displays. Refreshing this page does not restart OpenPI.`,quitFailed:`Could not confirm shutdown. Check the terminal before trying again. You can also stop OpenPI with Ctrl+C in its terminal.`,promptPending:`Processing your request…`,commandFeedbackTruncated:`This is a limited command preview. Narrow the query or run it in the TUI for the full output.`,planMode_inactive:`Normal mode`,planMode_planning:`Planning · writes blocked`,planMode_ready:`Plan ready · awaiting review`,planMode_invalid:`Plan state invalid · writes blocked`,planModeEnter:`Plan`,promptPlanMessage:`This conversation uses Plan mode · discuss the plan; no implementation yet`,planModeUnconfirmed:`Could not confirm Plan mode. Refresh before continuing.`,planModeExit:`Exit planning`,planModeImplement:`Prepare implementation prompt`,planImplementationReplaceDraft:`Preparing this plan will replace the current draft and turn off Plan mode. The prompt will not be sent. Continue?`,commandSupport_plan:`Planning and same-session implementation prompts are available. Starting a fresh implementation session still requires the TUI.`,commandSupport_setup:`Configuration uses the active model; questions are answered in Web.`,handoffWaiting:`Manual action`,handoffDone:`Done`,handoffUnable:`Unable to complete`,handoffDoneHelp:`I performed the action. The agent still needs to verify it.`,handoffUnableHelp:`I could not finish. I can add a note about the blocker.`,handoffReview:`Review status`,handoffSubmit:`Submit status`,handoffSignal:`Expected result:`,handoffVerify:`Reporting Done lets the agent continue and verify; it is not proof of success.`,planCardLabel:`Development plan`,planCardReady:`Plan ready`,planCardResult:`Plan result`,planCardNotApproval:`This step produced a plan. It did not approve or start implementation.`,planCardCollapse:`Collapse`,planCardExpand:`Expand`,planCardCopy:`Copy plan`,planCardCopyPreview:`Copy visible preview`,planCardTruncated:`Only a bounded preview is displayed.`,planCardLoadFull:`Load full plan`,planCardLoadingFull:`Loading plan...`,planCardLoadFailed:`Could not load the full plan. Retry`,planCardEvidence:`Tool result · plan_ready`,questionWaiting:`Question`,questionPreview:`View preview`,questionSkip:`Skip`,questionProgress:`{{current}} of {{total}}`,questionReview:`Review answers`,questionReviewTitle:`Ready to send?`,questionReviewHelp:`Review your choices. Nothing is sent until you submit.`,questionEdit:`Edit answer: {{question}}`,questionDismiss:`Dismiss questions without answering`,questionCustom:`Or write your own reply`,questionCustomHelp:`Or leave it blank to ask for a clearer question.`,questionYourAnswer:`Your answer`,questionCustomPlaceholder:`Describe what you have in mind…`,questionNotes:`Additional context (optional)`,questionNotesPlaceholder:`Add a constraint or clarify your choice…`,questionRephrase:`Ask for a clearer or smaller question`,questionBack:`Back`,questionNext:`Next question`,questionSubmit:`Submit answers`,questionSubmitting:`Sending…`,questionRetry:`Check submission`,questionUncertain:`We could not confirm delivery. Your submitted answers are kept here. Check submission to recover the result without sending them twice.`,questionDisconnected:`Reconnecting… Your choices stay here; submitting is paused.`,questionLimit:`Keep each answer or note within {{count}} UTF-8 bytes.`,questionLoadFailed:`Could not check for questions awaiting your answer.`,questionDraftLimit:`Question drafts are full. Shorten or clear an existing answer before adding more text.`,questionRetryLoad:`Try again`,questionCloseReceipt:`Close question status`,questionState_dismissed:`Questions dismissed. No answers were submitted.`,questionState_cancelled:`Questions cancelled. No answers were submitted.`,questionState_expired:`Questions expired. No answers were submitted.`,questionState_stale:`This request is no longer active. Check the conversation for its result.`,conversationView:`Conversation view`,jumpToLatest:`Jump to latest`,historyLoading:`Loading history…`,historyOmitted:`{{count}} earlier entries · Scroll up to load automatically`,historyChanged:`The Session branch changed. History has been reset to the current branch.`,historyUnavailable:`Could not load history. Please retry.`,historyValidationUnavailable:`Could not verify the conversation history. Please retry.`,historyVerifying:`Checking conversation history…`,messageLoadFull:`Load full message`,messageLoadMore:`Load more`,messageLoadingFull:`Loading message…`,messageLoadFailed:`Could not load this message. Retry`,filePreview:`File preview`,changeEvidence:`Changes`,changeEvidenceScope:`Read-only Git snapshot of changes since this session started.`,turnLabel:`Turn {{number}}`,turnState_running:`Running`,turnState_complete:`Completed`,turnState_failed:`Failed`,turnState_interrupted:`Interrupted`,turnState_waiting:`Waiting for response`,turnState_forked:`Forked · Ready to continue`,turnChanges_one:`{{count}} file changed during this turn`,turnChanges_other:`{{count}} files changed during this turn`,turnChangesPartial:`At least {{count}} files changed during this turn`,turnChangesIncomplete:`This turn's change record is incomplete.`,turnChangesMore:`Show {{count}} more files`,turnChangesLess:`Show fewer files`,turnChangesReview:`Review turn changes`,turnChangesReviewButton:`Review`,turnChangesBack:`Back to turn changes`,turnChangesLoading:`Loading this turn's changes…`,turnChangesUnavailable:`This turn's saved diff is unavailable.`,messageCopyRequiresFull:`Load the full message before copying.`,filesChanged_one:`{{count}} file changed`,filesChanged_other:`{{count}} files changed`,reviewChanges:`Review changes`,workspaceChanges:`Workspace changes`,overviewChanges:`Changes`,overviewLineTotals:`Text lines added and removed across the current Git comparison`,overviewPartialTotals:`Known line counts only; some files could not be counted. Open Changes for details.`,overviewCounting:`Counting…`,overviewCountsUnknown:`Counts unavailable`,overviewReviewUnavailable:`Unavailable`,sessionSources:`Sources`,sourcesAdd:`Add source`,sourcesDescription:`Browse this conversation's attached images and files`,sourceAttached:`Attached to this conversation`,sourcesEmpty:`No sources yet`,sourcesFailed:`Could not load sources.`,sourcesViewAll:`View all`,sourcesLoadMore:`Load more sources`,sourcesBack:`Back to sources`,sourcesPartial:`This list has reached its display limit. Earlier sources remain in the conversation.`,turnChangesScope:`Saved workspace changes during this turn`,turnEdits_one:`Edited {{count}} file`,turnEdits_other:`Edited {{count}} files`,turnEditsPartial:`Recorded edits to {{count}} files`,turnEditsScope:`This turn's recorded file-tool writes · saved; shell and external edits are not included`,turnEditStatsUnknown:`Line counts unavailable`,turnEditReason_before_unavailable:`The write completed, but previous contents were not authorized for reading. A before/after diff is unavailable.`,turnEditReason_content_limit:`The write completed. Content exceeds the saved comparison limit, so exact line counts are unavailable.`,turnEditReason_concurrent_change:`The file changed between recorded operations. A reliable net diff for this turn is unavailable.`,gitReviewLoadedCount:`{{count}} files loaded`,gitReviewPartialLabel:`Partial`,gitReviewSearch:`Search file paths`,gitReviewExpand:`Expand review`,gitReviewSearchLoaded:`Search loaded files`,gitReviewMarkViewed:`Mark {{path}} as viewed`,gitReviewMarkCurrentViewed:`Mark current file {{path}} as viewed`,gitReviewViewedLabel:`Viewed`,gitReviewViewedProgress:`Viewed {{viewed}} / {{loaded}} loaded files`,gitReviewViewedLimit:`Up to {{count}} viewed marks are remembered for this comparison.`,gitReviewNoMatch:`No matching files.`,gitReviewNoLoadedMatch:`No matches in the loaded files.`,gitReviewLoadNext:`Load the next files`,gitReviewChanged:`The workspace changed. Refresh the list before loading more.`,gitReviewNewVersion:`New changes are available. You are reading the previous version.`,gitReviewShowLatest:`Show latest diff`,gitReviewBinary:`No text diff is available for this binary file.`,gitReviewBinaryShort:`Binary`,gitReviewPendingStats:`Not loaded`,gitReviewComparison:`{{current}} compared with {{base}}`,gitReviewWorkingTree:`Working tree compared with HEAD`,gitReviewSessionSnapshot:`Changes since this session started`,gitReviewDetached:`Detached HEAD`,gitReviewLoading:`Reading Git changes…`,gitReviewRetry:`Retry`,gitReviewRefresh:`Refresh changes`,gitReviewOlderResult:`Showing the previous result.`,gitReviewNotRepository:`This workspace is not a Git repository.`,gitReviewUnborn:`This repository has no readable HEAD yet.`,gitReviewFailed:`Git changes could not be read.`,gitReviewTruncated:`The change snapshot reached its file or diff size limit.`,gitReviewEmpty:`No changes in this comparison.`,gitReviewHiddenLines:`{{count}} more diff lines hidden.`,gitReviewDiffTruncated:`This file's diff was not loaded because the snapshot reached its size limit.`,gitReviewShowMore:`Show {{count}} more files`,gitReviewBackToFiles:`Back to changed files`,gitReviewFilePreview:`Diff for {{file}}`,gitReviewNoDiff:`No text diff is available for this file.`,changeDiff:`Change diff`,diffViewMode:`Diff view`,diffUnified:`Unified`,diffSplit:`Side by side`,diffBefore:`Before`,diffAfter:`After`,diffView:`Diff`,gitFileStatus_added:`Added`,gitFileStatus_modified:`Modified`,gitFileStatus_deleted:`Deleted`,gitFileStatus_renamed:`Renamed`,gitFileStatus_copied:`Copied`,gitFileStatus_untracked:`Untracked`,gitFileStatus_unknown:`Changed`,closePreview:`Close preview`,imageZoom:`Image zoom`,imageZoomHelp:`Zoom is relative to Fit. Use Ctrl + wheel to zoom, then drag to pan.`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,previousImage:`Previous image`,nextImage:`Next image`,imagePosition:`Image {{current}} of {{total}}`,artifactReadOnly:`Read-only`,artifactReferenceUnavailable:`File preview is unavailable in this view: {{path}}`,artifactSession:`Session {{sessionId}}`,copyFilePath:`Copy file path`,filePathCopied:`File path copied`,refreshFile:`Refresh file`,downloadFile:`Download file`,downloadingFile:`Downloading…`,artifactOlderPreview:`Showing an older preview. `,readingFile:`Reading file…`,artifactVersion:`Version`,artifactBytes:`{{count}} bytes`,artifactPreviewTruncated:`Preview truncated. Download the file for the complete content.`,artifactUnsupported:`This file type cannot be previewed. Use Download.`,filesLargeMarkdownSource:`This Markdown preview is large, so it is shown as source to keep scrolling responsive. All loaded text is included.`,chatView:`Chat`,trajectory:`Trajectory`,trajectoryScope:`Recorded Session messages in order, not execution durations or the complete model request.`,trajectoryRunning:`Work is active. This view updates as saved records arrive; in-flight text is available in Chat.`,trajectoryTruncated:`Loaded history is partial: {{entries}} entries omitted, {{parts}} parts omitted, {{messages}} messages truncated.`,trajectoryEmpty:`No saved records yet.`,trajectoryOrder:`Record order`,trajectoryOverview:`Overview`,trajectorySequenceHint:`Record order · widths are not elapsed time`,trajectoryClearRange:`Clear selection`,trajectoryContextLane:`Context`,trajectoryModelLane:`Model`,trajectoryToolLane:`Tools`,trajectorySelectRecord:`Select record {{number}}: {{name}}`,trajectoryTimingTab:`Timing`,trajectoryUsageTab:`Usage`,trajectoryDurationLabel:`Duration`,trajectoryTimingSource:`Source`,trajectoryTimingUnknown:`No execution duration was recorded. Record timestamps are not operation start times.`,trajectoryTimingNative:`Pi nested tool execution`,trajectoryTTFT:`Time to first output`,trajectoryGenerationTime:`Generation time`,trajectoryThroughput:`Output tokens / second`,trajectoryNotRecorded:`Not recorded`,trajectoryUsageUnknown:`This response has no reported token usage in the loaded records.`,trajectoryUsage_input:`Uncached input`,trajectoryUsage_cacheRead:`Cache read`,trajectoryUsage_cacheWrite:`Cache write`,trajectoryUsage_output:`Output`,trajectoryProvider:`Provider`,trajectoryModel:`Model`,trajectoryCode:`Code`,trajectoryWrap:`Wrap lines`,trajectoryCopy:`Copy source`,trajectoryCopied:`Copied`,trajectoryRawArguments:`Original JSON`,trajectoryFoldTurns:`Turns`,trajectoryFoldCalls:`Calls`,trajectoryMetrics:`Loaded execution summary`,trajectoryRequestCount:`{{count}} model responses`,trajectoryToolCount:`{{count}} tool calls`,trajectoryModelResponses:`Model responses`,trajectoryToolCalls:`Tool calls`,trajectoryLastTurn:`Latest recorded turn`,trajectoryEventColumn:`Event`,trajectoryContentColumn:`Content`,trajectoryTurn:`Turn {{number}}`,trajectoryLoadHistory:`Load earlier history`,trajectoryLatestRecords:`Jump to latest records`,trajectoryHistoryLoading:`Loading history…`,trajectoryNestedOutputMissing:`Pi recorded this nested call's status, but did not persist its result body. The outer script's output is separate.`,trajectoryRecordCount:`{{count}} records`,trajectoryMatches:`{{count}} matches`,trajectorySearch:`Search loaded records`,trajectoryNoMatches:`No matching records.`,trajectoryEarlierGroup:`Earlier context`,trajectoryEventCount:`{{count}} Session changes`,trajectorySummary:`Overview`,trajectoryInputTab:`Input`,trajectoryResultTab:`Result`,trajectoryConversationGroup:`Conversation`,trajectoryReasoningTitle:`Thinking`,trajectoryRecordNumber:`Record {{number}}`,trajectoryRecordInfo:`Record information`,trajectoryRecordId:`Record ID`,trajectoryCallId:`Tool call ID`,trajectoryEventType:`Event type`,trajectoryEvent_model_change:`Model changed`,trajectoryEvent_thinking_level_change:`Thinking level changed`,trajectoryEvent_compaction:`Context compacted`,trajectoryEvent_session_info:`Session information updated`,trajectoryEvent_custom:`Session record`,trajectoryEarlier:`Show earlier records ({{count}} remaining in loaded history)`,trajectoryDetails:`Record details`,trajectoryRecordedAt:`Record timestamp`,trajectoryEvidenceTruncated:`This evidence was truncated in the Session projection.`,trajectoryArguments:`Tool arguments`,trajectoryRecordedContent:`Recorded content`,trajectoryThinking:`Recorded model reasoning`,trajectoryOutput:`Tool result`,trajectoryMissingResult:`No unambiguous result is included in the loaded records. This does not imply the tool is still running.`,trajectoryStructured:`Structured result`,trajectoryEventOnly:`Only this event’s type and timestamp are available.`,trajectory_user:`User message`,trajectory_assistant:`Assistant`,trajectory_call:`Tool call`,trajectory_result:`Unpaired result`,trajectory_event:`Session event`,trajectoryRole_user:`User`,trajectoryRole_assistant:`Assistant`,trajectoryRole_call:`Tool`,trajectoryRole_result:`Result`,trajectoryRole_event:`Event`,trajectory_returned:`Tool returned a result.`,trajectory_error:`Tool returned an error`,trajectory_unknown:`Outcome not established`,runtimeStatus:`Runtime status`,runtimeIdentity:`OpenPI runtime information`,runtimeIdentityHint:`Backend information was captured at startup. It does not track later disk changes or Session reloads, and is not proof of every loaded module. Frontend identity describes this page build.`,runtimeIdentityFailed:`Could not read backend runtime information. Try again.`,runtimeBackendVersion:`Backend package version`,runtimePackageRoot:`Backend package directory`,runtimeStartedAt:`Process started`,runtimeGitRevision:`Git revision at startup`,runtimeGitState:`Working tree at startup`,runtimeGitDirty:`Local changes present`,runtimeGitClean:`Clean`,runtimeFrontendVersion:`Page package version`,runtimeFrontendBuild:`Page build ID`,runtimeStartupBuild:`Page build ID recorded at startup`,runtimeDevelopmentBuild:`Development server (no production build ID)`,runtimeBuildMismatch:`This page build differs from the build recorded when the backend started. Refresh the page or restart the service, then check again.`,refreshStatus:`Refresh status`,openTools:`Open tools`,openToolsUnavailable:`Select a chat to open tools`,sideConversation:`Side conversation`,sideConversationDescription:`Ask a focused question in a separate Pi session without interrupting the main task.`,workbarChangesDescription:`Inspect the current Git branch and working tree.`,terminal:`Terminal`,renameTerminal:`Rename terminal`,terminalName:`Terminal name`,workbarTerminalDescription:`Open an interactive shell for the current workspace.`,restartTerminal:`Restart terminal`,reconnectTerminal:`Reconnect terminal`,restartTerminalTitle:`Restart this terminal?`,restartTerminalDetail:`The current terminal will be closed. Running processes may be interrupted.`,terminalReconnecting:`Reconnecting terminal...`,terminalScrollToBottom:`Scroll to bottom`,terminalOutputResynced:`Terminal output resynchronized.`,terminalRestarting:`Restarting terminal...`,terminalConnecting:`Starting terminal…`,terminalExited:`Terminal exited.`,terminalExitCode:`Terminal exited with code {{code}}.`,terminalDisconnected:`Terminal connection ended unexpectedly.`,terminalError:`Terminal unavailable.`,terminalLoadError:`The terminal interface could not load. Refresh the page to try again.`,reloadPage:`Refresh page`,browser:`Browser`,sessionFileRecords:`Session file records`,gitReviewSource:`Changes`,gitReviewBaseBranch:`Compare against branch`,gitReviewChooseBase:`Choose comparison branch`,gitReviewSearchBranches:`Search branches`,gitReviewLocalBranch:`Local branch`,gitReviewRemoteBranch:`Remote branch`,gitReviewBranchesTruncated:`Showing a bounded list of branches. Some branches are omitted.`,gitReviewNoMatchingBranches:`No matching branches.`,gitReviewBaseUnavailable:`No default comparison branch is available. Choose a branch to review committed changes.`,gitReviewBaseInvalid:`The selected comparison branch is unavailable. Choose another branch.`,gitReviewUnstaged:`Unstaged changes`,gitReviewStaged:`Staged changes`,gitReviewBranch:`Branch changes`,gitReviewFileMissing:`This file no longer has changes in this view. Refresh the file list.`,artifactExternalAccess:`This file is in another working directory. You can authorize read-only access to this file for this session; other files remain inaccessible.`,artifactAuthorizeFile:`Open this file read-only`,sideConversationPending:`Preparing side conversation…`,resizeSidebar:`Resize sidebar`,resizePanes:`Resize panes`,resizeWorkbar:`Resize workbar`,browserPasteTooLarge:`Paste at most {{count}} characters at a time.`,browserInputTooLarge:`Enter at most {{count}} characters at a time.`,browserInputTargetChanged:`The input target changed or could not be confirmed. An input operation was not executed.`,workbarBrowserDescription:`Open and interact with a page inside the OpenPI workbar.`,browserReady:`Enter an address to start browsing`,browserStarting:`Starting the embedded browser…`,browserOpened:`Opened in the embedded browser`,browserOpenAgain:`Open again`,browserOpenFailed:`The embedded browser is unavailable.`,browserBack:`Back`,browserForward:`Forward`,browserReload:`Reload`,browserTabs:`Browser tabs`,browserNewTab:`New tab`,browserAddTab:`New browser tab`,browserCloseTab:`Close {{title}}`,browserTabLimit:`Up to {{count}} browser tabs`,browserPageTitle:`Web page: {{address}}`,browserEnteredAddress:`Last address opened from this toolbar`,browserAddressNotAllowed:`Enter an HTTP(S) address without embedded credentials, outside this application's origin.`,browserLocationUnknown:`This page navigated. Its new address is unavailable. Reload returns to the address you entered.`,browserDirectDescription:`Browse pages directly. Sites that refuse embedding can be opened in your external browser.`,browserDirectHint:`The address records toolbar navigation only. Page popups open in your external browser. Blank page? Use Open in external browser.`,browserEnhancedHint:`Browser enhancement is on: addresses sync and ordinary popup links open in these tabs. Some site policies, login popups and cross-site history still require an external browser.`,files:`Files`,filesExplorer:`Workspace files`,filesSearch:`Filter files…`,refreshFiles:`Refresh files`,filesWorkspaceActions:`Workspace file actions`,filesCreateMenu:`New`,filesImportMenu:`Import`,filesMoreMenu:`More`,filesNewFile:`New file`,filesNewDirectory:`New folder`,filesImport:`Import files`,filesImportFolder:`Import folder`,filesImportFolderChoose:`Choose a folder to import`,filesImportFolderLimit:`Import up to 2,000 files and folders at a time, with at most 64 nested levels.`,filesSelectMultiple:`Select multiple files`,filesSelectItem:`Select {{name}}`,filesSelectedCount:`{{count}} selected`,filesRename:`Rename`,filesNewName:`New name`,filesMove:`Move`,filesMoveDestination:`Destination folder (workspace relative path)`,filesTrashAction:`Move to trash`,filesTrash:`Workspace trash`,filesTrashDetail:`Removed files stay in this workspace and can be restored. Existing names are preserved.`,filesTrashEmpty:`No removed files`,filesTrashUnavailable:`{{count}} entries could not be verified. Their contents remain in .openpi-trash; automatic restore is unavailable.`,filesRestore:`Restore`,filesRestoreItem:`Restore {{name}}`,filesUndoTrash:`Undo removal`,filesOrganizationResults:`File operation results`,filesOperationDone:`Done`,filesRefreshBeforeOrganizing:`Refresh the file tree before organizing this item.`,filesImportChoose:`Choose files to import`,filesTargetDirectory:`Destination`,filesWorkspaceRoot:`Workspace root`,filesFileName:`File name`,filesDirectoryName:`Folder name`,filesCreate:`Create`,filesCreating:`Creating…`,filesCreated:`Created: {{path}}`,filesNameInvalid:`Enter one file or folder name without path separators.`,filesNameExists:`This name already exists. Choose a different name; the existing file was preserved.`,filesMutationFailed:`Could not write this file. Your input is preserved.`,filesWriteUnavailable:`Switch to this session to write workspace files.`,filesImportLimit:`Each file can be up to 50 MiB. Existing names are never overwritten.`,filesImportTooLarge:`This file exceeds the 50 MiB import limit.`,filesImportDirectoryUnsupported:`Folders cannot be imported. Choose the files inside the folder.`,filesImportResults:`File import results`,filesImportPending:`Waiting to import`,filesImporting:`Importing…`,filesImported:`Saved to the workspace`,filesImportedNoPreview:`Saved. Preview supports up to 20 MiB; copy the path to use this file in chat.`,filesClearImported:`Clear completed imports`,filesRetryImport:`Retry import`,filesPathActions:`Path actions for {{name}}`,filesCopyRelativePath:`Copy relative path`,filesCopyAbsolutePath:`Copy absolute path`,filesPathCopied:`Copied path: {{path}}`,filesReadFailed:`Unable to read files.`,filesRetryRead:`Try again`,filesErrorDetails:`Error details`,filesReadFailedDetail:`The file list could not be loaded. Check your connection and try again.`,filesReadDenied:`This session's workspace is currently unavailable or cannot be verified. Check the session and workspace, then try again.`,filesSymlink:`Symbolic link — not followed by the file browser`,filesTruncated:`The result is incomplete. Refine your search.`,filesNoMatches:`No matching files`,filesEmpty:`This folder is empty`,filesChoose:`Choose a file to preview`,filesChooseDetail:`Browse your workspace on the right. Files open here, keeping the explorer in place.`,filesHideTree:`Hide file tree`,filesShowTree:`Show file tree`,filesPreview:`Preview`,filesSource:`View source`,filesEdit:`Edit`,filesMode:`File view`,filesEditor:`File editor`,filesSave:`Save file`,filesSaving:`Saving…`,filesSaved:`Saved`,filesUnsaved:`Unsaved changes · draft kept in this window`,filesDiscard:`Discard draft`,filesDiscardConfirm:`Discard your unsaved changes to this file?`,filesSaveConflict:`The file changed on disk. Your draft is preserved. Refresh to inspect the current version, then reconcile your changes before saving.`,filesSaveFailed:`Could not save. Your draft is preserved; check the file and retry.`,filesEditLoadFirst:`Continue reading the complete file before editing.`,filesEditUnavailable:`Editing supports workspace UTF-8 text files up to 1 MiB. At most 16 unsaved drafts can be kept.`,filesOutline:`Document outline`,filesDiskVersion:`Inspect current disk version`,filesReconcile:`Reviewed · continue editing my draft against this version`,filesTable:`Table preview`,filesRow:`Row`,filesSheets:`Worksheets`,filesTableTruncated:`Showing a partial table preview. Download the original file for complete content.`,filesOfficeLayout:`Document content preview; pagination and typography may differ from Office.`,filesSlidesLayout:`Slide text and images; themes, charts and animations may differ from PowerPoint.`,filesPreviousPage:`Previous page`,filesNextPage:`Next page`,filesZoomOut:`Zoom out`,filesZoomIn:`Zoom in`,filesZoomReset:`Reset zoom`,filesPdfPage:`Page {{page}}`,filesDocumentLimit:`This document exceeds the preview limit. Download it to open locally.`,filesPreviewFailed:`Unable to preview this file. You can still download it.`,filesDiagram:`Mermaid diagram`,filesDiagramLoadError:`Unable to load diagram preview. The source is shown below. Refresh the page to try again.`,filesExpandDiagram:`Expand diagram`,filesFitImage:`Fit`,filesOriginalImage:`Original size`,filesLoadMore:`Load more`,filesLoaded:`{{count}} items loaded`,filesReadMore:`Continue reading`,filesContentChanged:`The file changed. Refresh when ready; your current reading position is preserved.`,workbarFilesDescription:`Browse workspace files with an inline preview and file tree.`,backToSideConversations:`Back to side conversations`,continueSideConversation:`Send a follow-up…`,startSideConversation:`Ask a side question…`,sideConversationModelInherited:`New side conversations use the main conversation’s model and thinking level.`,sideConversationModelFixed:`This is the model used by this side conversation.`,stop:`Stop`,start:`Start`,browserAddress:`Browser address`,browserGo:`Open address`,openExternalBrowser:`Open in external browser`,invalidBrowserAddress:`Enter a valid HTTP or HTTPS address.`,addImages:`Add images`,addFiles:`Add files`,fileAttachments:`File attachments`,previewFileAttachment:`Preview file`,fileAttachmentDescription:`Documents, spreadsheets, PDFs, text, code, and other files`,fileAttachmentCount:`Attach up to {{count}} items.`,fileAttachmentTooLarge:`Files must total 50 MB or less.`,fileAttachmentReadFailed:`Could not read this file. Check the format or whether it is password protected.`,fileAttachmentTextReady:`Text ready`,fileAttachmentTextTruncated:`Partial text · original retained`,fileAttachmentOriginalReady:`Original file ready`,fileAttachmentExtractionFailed:`Text unavailable · original retained`,fileAttachmentEncodingUnavailable:`The text encoding could not be read. The original bytes are preserved.`,fileAttachmentDocumentUnavailable:`Text could not be extracted. The document may be password protected or have an unsupported format. The original bytes are preserved.`,fileAttachmentNoText:`The original file will be attached for the agent to read with its tools. No text was extracted.`,fileAttachmentPreviewTruncated:`Preview shows the first 20,000 characters. The complete extracted text will be attached.`,fileAttachmentExtractedContent:`Extracted text`,fileAttachmentPromptLabel:`User-provided files:`,fileAttachmentPromptTooLong:`The message and file references exceed the input limit. Shorten the message or attach fewer files.`,imageAttachmentDescription:`PNG, JPEG, GIF, or WebP`,imageAttachments:`Image attachments`,imageAttachmentsLoading:`Preparing attachments…`,commandOpensPanel:`Open panel`,commandPanelArguments:`This command opens a panel and cannot include arguments or images. Remove them, or use the panel directly.`,commandPanelUnavailable:`The panel could not be opened. Your command is preserved.`,commandUnavailable_terminal_only:`Requires Pi's terminal interface.`,commandUnavailable_not_integrated:`This extension command is not connected to Web yet. Use it in Pi's terminal.`,artifactImagePreviewFailed:`Unable to preview this image. Refresh the file to retry, or download it.`,artifactFileDetails:`File details`,turnElapsedRunning:`Working for {{duration}}`,compactionElapsed:`Waiting {{duration}}`,compactionRunning:`Compacting context`,compactionCompleted:`Context automatically compacted`,compactionFailed:`Context compaction failed`,compactionInterrupted:`Compaction interrupted`,compactionUnchanged:`Compaction finished without a new summary`,compactionUnavailable:`Context compaction status unavailable`,compactionReconnectHelp:`Connection interrupted. The current status will be checked after reconnecting.`,compactionDraftHelp:`Compacting history. Messages you send will be queued.`,turnElapsedFinished:`Worked for {{duration}}`,composerAdd:`Add`,composerCommands:`Commands`,composerFile:`File`,composerPlan:`Plan`,composerCompact:`Compact`,composerModel:`Model`,composerBack:`Back`,composerPlanDescription:`Enter or leave Plan mode`,composerCompactDescription:`Summarize earlier conversation history`,composerModelDescription:`Select this Session's model`,compactionQueueWaiting:`Waiting for compaction to finish`,compactionQueueBlocked:`Messages retained. Retry when ready or clear the queue.`,clearPromptQueue:`Clear queue`,queueUpdateFailed:`Could not update the queue. Check the current session and try again.`,queueStatusUnconfirmed:`The request was received, but the latest queue state could not be verified. Refresh before trying again.`,turnElapsedOutcome_cancelled:`Stopped`,turnElapsedOutcome_failed:`Failed`,turnElapsedOutcome_uncertain:`Outcome unconfirmed`,settingsSetupBusyHint:`Agent configuration is available after this turn. Display settings can be changed now.`,resetChatContentWidth:`Reset chat content width`,resetChatFontSize:`Reset chat font size`,setupResolveAdmission:`Return to the conversation to resolve the pending message before applying settings.`,removeAttachment:`Remove attachment`,dropImagesHere:`Drop files or images here`,imageAttachmentCount:`Attach up to {{count}} images.`,imageAttachmentTooLarge:`Each image must be 10 MB or smaller.`,imageAttachmentTotalTooLarge:`The attached images must total 32 MB or less.`,imageAttachmentUnsupported:`Only valid PNG, JPEG, GIF, and WebP images are supported.`,imageAttachmentReadFailed:`Could not read this image. Add it again to retry; your message is preserved.`,attachedImage:`Attached image`,previewAttachment:`Preview image`,closeImagePreview:`Close image preview`,imagePreviewFailed:`Unable to display this image.`,fitImage:`Fit image`,originalImageSize:`Original size`,imageViewMode:`Image view`,sessionUsage:`Session token usage`,sessionInputTokens:`Input tokens`,sessionOutputTokens:`Output tokens`,sessionCacheTokens:`Cached tokens`,sessionContextUsage:`Context usage and context window`,usageContextLabel:`Context`,usageUnknown:`Unknown`,usageOpenDetails:`Input {{input}} · Output {{output}} · Context {{percent}} / {{capacity}} · View token usage`,usageContextHelp:`Estimated tokens in the current branch / model context limit.`,usageSessionTotals:`Session totals`,usageInputLabel:`Input`,usageOutputLabel:`Output`,usageCacheReadLabel:`Cache read`,usageCacheWriteLabel:`Cache write`,usageTotalLabel:`Total`,usageWorkspaceLabel:`Workspace`,usageSessionId:`Session ID`,usageTotalsHelp:`Session token totals include cache usage.`,subagentDetails:`Subagents`,sessionOverview:`Session overview`,sessionOverviewChanges:`Changes in the current review scope`,subagentSummaryRunning:`{{count}} running`,subagentSummaryDone:`{{count}} completed`,subagentSummaryOther:`{{count}} other`,subagentNoneYet:`No subagents yet`,subagentOtherGroup:`Failed / interrupted`,subagentShowMore:`Show {{count}} more`,backToSubagents:`Back to subagents`,subagentActiveGroup:`Active`,subagentFinishedGroup:`Completed`,subagentNoneRunning:`No subagents running.`,subagentNoneFinished:`Completed tasks will appear here.`,subagentProgress:`Subagents: {{running}} running · {{completed}} completed`,subagentSummaryUnknown:`{{count}} without confirmed status`,subagentTasks:`Subagent tasks`,inspectSubagent:`Open subagent: {{name}}`,subagentState_running:`Running`,subagentProcessing:`Working…`,subagentState_done:`Completed`,subagentState_error:`Failed`,subagentState_interrupted:`Interrupted`,subagentStarting:`Starting…`,subagentSpawnFailed:`Failed to start`,subagentStateUnavailable:`Started · state unavailable`,subagentSpawnReceipt:`Start receipt`,subagentSpawnReceiptHint:`This confirms the start request, not the subagent's final result.`,subagentTask:`Assigned task`,subagentTranscript:`Subagent conversation`,subagentResult:`Result`,subagentSpend:`Cumulative token spend`,subagentSaved:`Saved record`,subagentRecordedState:`Last recorded state`,subagentSavedHint:`From this parent session's saved receipts. A result may include other tasks from the same batch; this is not the child's full live conversation.`,subagentReadOnly:`Read-only view · closing this panel does not stop the task`,subagentUnavailable:`Live details are no longer available for this subagent in the current session. The start receipt is not evidence of completion.`,subagentStale:`Could not refresh. The details below are the last received snapshot.`,subagentNoMessages:`No messages received yet.`,subagentTranscriptUnavailable:`This view retains a task summary and cannot show the full child conversation.`,subagentWorkflowsTruncated:`{{count}} workflows are outside the loaded list; their task counts are unknown.`,subagentState_unknown:`Unconfirmed`,subagentUnconfirmedGroup:`Unconfirmed`,subagentTruncated:`Showing recent messages. {{count}} earlier messages are not included in this view.`,subagentTextTruncated:`Some long content is shown as an excerpt.`,subagentListTruncated:`{{count}} additional tasks are outside the loaded list.`,subagentThinkingRedacted:`Reasoning was redacted by the provider.`,inspectionChanged:`The active session changed. Reopen this panel.`,inspectionUnavailable:`Details are unavailable.`,inspectionLoading:`Loading status…`,thinkingUnavailable:`Thinking state is unavailable.`,trustUnavailable:`Project trust status is unavailable.`,copySetupCommand:`Copy setup command`,savedTrustDecision:`Saved decision`,activeSessionTrust:`Active Session trust`,trustDecision_trusted:`Trusted`,trustDecision_denied:`Denied`,trustDecision_undecided:`Undecided`,trustDecision_unknown:`Unknown`,trustActiveYes:`Trusted in this Session`,trustActiveNo:`Not trusted in this Session`,modelAndThinking:`Model and reasoning`,selectedModel:`Current model`,thinkingLevel:`Thinking level`,availableThinking:`Available levels`,unknownState:`Unknown`,projectTrust:`Project trust`,trust_trusted:`This session trusts the workspace.`,trust_untrusted:`Trust for this workspace has been denied.`,trust_restricted:`Project resources are restricted pending a trust decision.`,trust_unknown:`Trust state is not available.`,trustRefreshNeeded:`The saved decision and active session differ. Refresh the session through Pi to apply it.`,providerAvailability:`Provider credentials`,settings:`Settings`,settingsNavigation:`Settings navigation`,generalSettings:`General`,configurationSettings:`Configuration`,configurationIntro:`Permissions, web access and model responses.`,configurationReadFailure:`Configuration could not be read safely. Fix the settings file, then refresh.`,configurationUserScope:`User configuration`,configurationSetupHint:`Response and search changes use OpenPI setup`,configurationApproval:`Approval policy`,configurationApprovalDetail:`Tool approvals follow the installed Pi extensions.`,configurationPiPermissions:`Pi extensions`,configurationSandbox:`Sandbox`,configurationSandboxDetail:`Tools run with the host process permissions.`,configurationSandboxUnavailable:`No OS sandbox`,configurationSearchDetail:`Let the current Session model search the web when supported.`,configurationSearchOff:`Do not offer native search to the current model.`,configurationSearchOn:`Offer native search when the current connection supports it.`,configurationVerbosity:`Output verbosity`,configurationVerbosityDetail:`Choose how much detail the model includes in its response.`,configurationResponsesUnavailable:`The current connection does not use a supported Responses API.`,configurationVerbosity_default:`Model default`,configurationVerbosity_low:`Low`,configurationVerbosity_medium:`Medium`,configurationVerbosity_high:`High`,configurationVerbosityHelp_low:`Prefer short answers with fewer details.`,configurationVerbosityHelp_medium:`Include useful explanation and a moderate amount of detail.`,configurationVerbosityHelp_high:`Include more complete explanation and detail.`,configurationVerbosityRequest:`Set only response_verbosity to {{value}}; preserve the other OpenPI settings.`,configurationSummary:`Reasoning summary`,configurationSummaryDetail:`Choose the summary requested from a supported reasoning model.`,configurationSummaryUnavailable:`The current connection does not support reasoning summaries.`,configurationSummary_default:`Model default`,configurationSummary_auto:`Auto`,configurationSummary_concise:`Concise`,configurationSummary_detailed:`Detailed`,configurationSummary_none:`Off`,configurationSummaryHelp_auto:`Let the model choose the summary length.`,configurationSummaryHelp_concise:`Request a brief reasoning summary.`,configurationSummaryHelp_detailed:`Request a more detailed reasoning summary.`,configurationSummaryHelp_none:`Do not request a summary. Keep the current reasoning effort.`,configurationSummaryRequest:`Set only response_reasoning_summary to {{value}}; preserve the other OpenPI settings.`,configurationModelFeatures:`Model features`,configurationReasoningLevels:`Available reasoning efforts`,configurationReasoningDetail:`Choose which levels appear in model controls. Only levels supported by the current model are shown; the current level stays visible.`,configurationReasoningCount:`{{count}} selected`,configurationDependencies:`Workspace dependencies`,configurationEnvironment:`Local environment`,configurationEnvironmentDetail:`Node.js, Python and other tools come from your environment. OpenPI does not install a bundled workspace runtime.`,configurationRuntimeStatus:`Runtime status`,browserSettings:`Browser`,webSearchSettings:`Web search`,webSearchCurrentModel:`Current Session model`,webSearchNativeDetail:`Use your current model provider's native search with the existing connection and credentials.`,webSearchSupported:`This connection supports native search. When enabled, the model decides when to search.`,webSearchUnsupported:`Native search is unsupported or unconfirmed for this connection. No search tool is provided and no other provider is used.`,webSearchNativeRequest:`Enable native web search using the current Session model and existing Pi credentials. Do not switch model, connection protocol, or search provider. Unsupported or unknown connections must receive no search tool.`,webSearchIntro:`Let your model search current sources and read the original pages.`,webSearchPackageDetail:`Optional search, page reading, and PDF extraction through a Pi package.`,webSearchDefaultOff:`Off by default. This optional extension follows the current Session model; it needs no separate search key or plugin installation.`,webSearchLoaded:`Package loaded in this Session`,webSearchNotLoaded:`Package not loaded in this Session`,webSearchSource:`Review plugin source`,webSearchProfile:`Search setup`,webSearchExa:`Exa — no API key required`,webSearchExisting:`Keep my existing search preferences`,webSearchProfileHint:`Exa uses search queries with direct page reading. Existing preferences stay untouched. Other search services can be configured after installation.`,webSearchEnable:`Enable web search…`,webSearchDisable:`Disable web search…`,webSearchConfigure:`Change search service…`,webSearchExaRequest:`Enable optional web search with Pi Web Access and Exa, which needs no API key. Let me review the installation confirmation, preserve other preferences, and do not reload automatically.`,webSearchExistingRequest:`Enable optional web search with Pi Web Access and keep my existing search preferences unchanged. Let me review the installation confirmation, preserve other preferences, and do not reload automatically.`,webSearchDisableRequest:`Disable native web search. Preserve other settings and Session history.`,webSearchProviderRequest:`Help me change the search service for my installed Pi Web Access plugin. Explain available services and permissions, preserve unrelated preferences, keep credentials with the search plugin, and do not reload automatically.`,browserSettingsIntro:`Let OpenPI read pages, click, type and take screenshots.`,browserControl:`Browser control`,browserControlHint:`Requests a setup change. Access changes after the configuration is saved.`,browserDefault:`Default browser`,browserDefaultHint:`Requests a setup change for the browser used when none is named.`,browserEmbedded:`OpenPI browser`,browserAllowedTitle:`Allowed browsers`,browserOffHint:`Your choices take effect when browser control is on.`,browserConnected:`Connected`,browserNeedsSetup:`Extension setup needed`,browserNotFound:`Browser not detected`,browserUpdateNeeded:`Extension update needed`,browserBlocked:`Not allowed`,browserDefaultBlocked:`Your default browser is not allowed. Allow it or choose another default.`,browserSetUp:`Set up`,browserManage:`Manage`,browserSetupNamed:`Set up {{browser}}`,browserManageNamed:`Manage {{browser}}`,browserAllowNamed:`Allow {{browser}}`,browserMore:`More browsers`,browserSpeakHint:`Say “Use Chrome to…” to choose a different browser for a request.`,browserGuideTitle:`Connect {{browser}}`,browserGuideEyebrow:`One step at a time`,browserConnectionTitle:`Connection`,browserCloseGuide:`Close browser setup`,browserConnectionReady:`Connected. Choose whether OpenPI may use this browser.`,browserEmbeddedDetail:`Pages open inside OpenPI. Some websites require a regular browser to sign in or display correctly.`,browserExternalDetail:`OpenPI can use existing tabs and signed-in pages in your connected {{browser}} profile. Keep an OpenPI tab open in that profile.`,browserManageExtension:`Manage extension`,browserAllowUse:`Allow OpenPI to use it`,browserMakeDefault:`Use as default`,browserInstallIn:`Install in`,browserInstallTitle:`Install OpenPI Browser Bridge`,browserSetupSteps:`Setup steps`,browserGuidePopout:`Keep this guide in a separate window`,browserGuideDetached:`Your guide is open in a separate window. Follow it alongside the browser settings.`,browserShowGuide:`Show guide`,browserGuideInline:`Return guide here`,browserGuideBlocked:`The guide window could not open. Allow pop-ups and try again, or follow the steps here.`,browserSafariSettings:`Safari → Settings`,browserSafariDeveloper:`Developer settings`,browserSafariTemporary:`Add Temporary Extension…`,browserSafariOpenHint:`Open Safari, then choose Safari → Settings. Keep this guide alongside it. Requires Safari 26 or later on macOS.`,browserSafariDeveloperTitle:`Show Safari’s developer settings`,browserSafariDeveloperHint:`In Settings → Advanced, turn on Show features for web developers. Then select the Developer tab.`,browserSafariLoadHint:`In Developer, click Add Temporary Extension and select the folder below. Enable OpenPI Browser Bridge and allow the websites you want to control, including the local OpenPI page. Temporary extensions need reloading after Safari quits.`,browserFirefoxThis:`This Firefox`,browserFirefoxTemporary:`Load Temporary Add-on…`,browserFirefoxDeveloperTitle:`Select This Firefox`,browserFirefoxDeveloperHint:`On about:debugging, choose This Firefox in the left sidebar. Firefox does not need a Developer mode switch.`,browserFirefoxLoadHint:`Click Load Temporary Add-on and select manifest.json in the folder below. This development installation lasts until Firefox restarts; a permanent installation requires a Mozilla-signed package.`,browserFirefoxDone:`Selected. Next`,browserStepCount:`Step {{step}} of {{total}}`,browserStepLabel:`Step {{step}}: {{label}}`,browserStepOpen:`Open page`,browserStepAdd:`Add extension`,browserStepConnect:`Connect`,browserOpenManagerTitle:`Open {{browser}} extensions`,browserOpenManagerHint:`This opens {{browser}}. Complete the action on its extensions page, then return here to continue.`,browserOpenManager:`Open {{browser}} extensions`,browserReopenManager:`Open extensions page again`,browserAlreadyInstalled:`Already installed? Connect`,browserDeveloperMode:`Developer mode`,browserDeveloperTitle:`Turn on Developer mode`,browserDeveloperHint:`Turn on Developer mode on the extensions page. The {{loadLabel}} button will appear.`,browserDeveloperDone:`It’s on. Next`,browserIllustration:`Illustration · In {{browser}}`,browserExtensions:`Extensions`,browserLoadUnpacked:`Load unpacked`,browserLoadHint:`The extension is ready on this computer. Follow these steps in {{browser}} to load it.`,browserCopyLocation:`Copy the location below`,browserLocateTarget:`Find the extension on this computer`,browserRevealTarget:`Locate extension`,browserLocateManifest:`Find the extension’s manifest.json`,browserRevealManifest:`Locate manifest.json`,browserDragToBrowser:`Drag the folder onto {{browser}} extensions`,browserDragFolderHint:`Drag the entire {{folder}} folder from your file manager onto the extensions page, with Developer mode on.`,browserSelectLocatedTarget:`In the browser’s file picker, select the item located in the previous step.`,browserManualInstall:`Need another way? Select by path`,browserManualSelection:`Can’t find it? Select by path`,browserLoadInBrowser:`In {{browser}}, click “{{loadLabel}}”`,browserLoadAlternate:`The button appears when Developer mode is on.`,browserConfirmFolder:`Select`,browserConfirmFile:`Open`,browserSelectFolderHint:`Select this entire folder, not a .js file inside it.`,browserSelectManifestHint:`Select manifest.json, not one of the .js files.`,browserInstallCheckpoint:`Continue when OpenPI Browser Bridge appears in the extensions list.`,browserPathCopied:`Path copied`,browserCopyFailed:`Couldn’t copy. Select the path above and copy it manually.`,browserChooseFolderMac:`Press ⌘ ⇧ G, paste the copied path and press Return. Then click “{{confirm}}”.`,browserChooseFolderOther:`Paste the copied path into the location bar and press Enter. Then click “{{confirm}}”.`,browserInstalledConnect:`Added. Connect to OpenPI`,browserPreviousStep:`Back`,browserWaiting:`Waiting for OpenPI Browser Bridge… We’ll detect it automatically.`,browserInstallBrowserFirst:`Install {{browser}} first, or open this OpenPI address in your installed browser.`,browserConnectTitle:`Connect to OpenPI`,browserConnectHint:`Open OpenPI in {{browser}}. Use the profile where you installed the extension.`,browserOpenIn:`Open in {{browser}}`,browserAllowHint:`Once connected, you can allow OpenPI to use this browser. Installing the extension does not change your browser permissions.`,browserCheck:`Check connection`,browserNotConnectedYet:`No connection yet. Finish installation, refresh OpenPI in that browser and check again.`,browserHelp:`Setup help`,browserReloadHint:`Already installed? Reload OpenPI Browser Bridge in the extension manager and refresh OpenPI. Accept the browser’s permission prompt if shown.`,browserSupportedHint:`Chrome, Edge, Brave and Chromium 145+ support embedded and native pages. Safari 26+ on macOS and Firefox 128+ use the portable extension for native tabs; nested frames must be opened separately. Temporary Safari/Firefox installations need reloading after browser restart.`,browserCopyPath:`Copy path`,browserOpening:`Opening browser…`,browserLoading:`Checking browser connections…`,browserSaved:`Saved. Browser permissions take effect immediately.`,browserSaving:`Working…`,modelSettings:`Models`,skillsSettings:`Skills`,subagentsSettings:`Sub-agents`,pluginsSettings:`Plugins`,configureOpenPi:`Configure OpenPI`,setupRequestReviewAll:`review every OpenPI configuration area with me`,setupRequestSetTheme:`set only the OpenPI Web theme to {{value}} and preserve every other setting`,setupRequestSetChatWidth:`set only the OpenPI Web chat content width to {{value}}px and preserve every other setting`,setupRequestSetChatFontSize:`set only the OpenPI Web chat font size to {{value}}px and preserve every other setting`,setupRequestEnableExpandedThinking:`expand thinking blocks by default in OpenPI Web and preserve every other setting`,setupRequestDisableExpandedThinking:`collapse thinking blocks by default in OpenPI Web and preserve every other setting`,setupRequestSubagents:`review and configure Agent role models and workflow limits`,setupRequestFailed:`The OpenPI setup request was not accepted.`,setupRequestRunning:`Applying OpenPI settings…`,setupRequestAccepted:`Configuration request accepted.`,setupPlanBlocked:`Exit Plan mode before changing agent configuration. Display settings can be changed directly; exiting does not start implementation.`,setupPlanBusy:`Agent configuration requires an idle turn and leaving Plan mode. Display settings can be changed now.`,setupOutcome_pending:`Configuration request is awaiting a save receipt.`,toolCallArguments:`Tool arguments`,toolCallOutput:`Tool result`,setupOutcome_saved:`OpenPI configuration was saved and applied.`,setupOutcome_unchanged:`Configuration was saved; effective settings are unchanged.`,setupOutcome_failed:`The setup request failed. Review the error and current settings before retrying.`,setupOutcome_cancelled:`Setup was cancelled without a confirmed save.`,setupOutcome_unconfirmed:`No successful save was confirmed. Review current settings before retrying /openpi-setup.`,settingsUpdateFailed:`The Web preference could not be saved.`,settingsPreferencesSaved:`Preferences saved.`,settingsPreferencesSaveFailed:`Could not save display settings. Check configuration diagnostics and retry.`,settingsCatalogLoading:`Loading Pi resources…`,settingsCatalogFailed:`Could not load Pi settings resources.`,appearance:`Appearance`,settingsPersonal:`Personal`,settingsAgent:`Agent`,settingsIntegrations:`Integrations`,settingsArchivedChats:`Archived chats`,settingsSearch:`Search settings`,settingsClearSearch:`Clear search`,settingsNoResults:`No matching settings`,appearanceVisualStyle:`Visual style`,appearanceMode:`Mode`,appearanceTheme:`Theme`,appearanceAccent:`Accent color`,appearanceBackground:`Background`,appearanceForeground:`Foreground`,appearanceFont:`Font`,appearanceFont_codex:`Codex default`,appearanceFont_sans:`Sans serif`,appearanceFont_serif:`Serif`,appearanceFont_mono:`Monospace`,appearanceAccent0:`Default`,appearanceAccent1:`Blue`,appearanceAccent2:`Purple`,appearanceAccent3:`Pink`,appearanceAccent4:`Orange`,appearanceAccent5:`Green`,appearanceCustomAccent:`Custom accent color`,appearanceAdvanced:`Advanced`,appearanceReset:`Restore defaults`,appearanceResetAction:`Reset appearance`,appearanceImport:`Import theme`,appearanceCopy:`Copy theme`,appearanceCopied:`Theme copied`,appearanceCopyFailed:`Could not copy theme. Try again.`,appearanceThemeValue:`Theme data`,appearanceImportPlaceholder:`Paste an OpenPI theme…`,appearanceImportInvalid:`Enter valid OpenPI theme data.`,appearanceImportAction:`Import`,searchArchivedChats:`Search archived chats`,archiveProjectFilter:`Filter by project`,archiveAllProjects:`All projects`,archiveProjectGroup:`{{project}} · {{count}} archived chats`,archiveSort:`Sort archived chats`,archiveSortUpdated:`Last updated`,archiveSortCreated:`Date created`,restoreArchivedChat:`Restore {{title}}`,themeLight:`Light`,themeDark:`Dark`,themeMist:`Mist`,themeRose:`Rose`,themePine:`Pine`,themeSystem:`System`,conversationSettings:`Conversation`,expandThinkingByDefault:`Expand thinking by default`,chatContentWidth:`Chat content width`,chatFontSize:`Chat font size`,agentBehavior:`Agent behavior`,workflowLimits:`Workflow limits`,workflowConcurrency:`Workflow concurrency`,workflowCalls:`Total calls`,agentSettingsSetupHint:`Agent changes are applied through /openpi-setup in the current session.`,setupRequestLimits:`Set workflow concurrency to {{concurrency}} and total agent calls to {{calls}}. Preserve other settings.`,setupRequestEnableSuggestions:`Enable next-action suggestions. Help me choose a model if required; preserve other settings.`,setupRequestDisableSuggestions:`Disable next-action suggestions. Preserve other settings.`,setupRequestPostEdit:`Help me configure or disable the post-edit command. Show the current configuration and ask which command to use.`,configurePostEdit:`Configure post-edit command`,workflowLimitsValue:`{{concurrency}} concurrent · {{calls}} total calls`,nextActionSuggestions:`Next-action suggestions`,nextActionSuggestionsDetail:`Offer a few useful next actions when the current task finishes.`,enabled:`Enabled`,disabled:`Disabled`,configured:`Configured`,postEditCommand:`Post-edit command`,postEditCommandDetail:`Run a command after edits. Nothing runs while this is off.`,resultDisplay:`Default result display`,subagentResults:`Subagent results`,bashOperations:`Bash operations`,fileMutations:`Write / Edit operations`,footer:`Footer`,terminalFooter:`Pi terminal footer`,terminalFooterStyle:`Terminal footer style`,terminalFooterHint:`Applies to Pi's command-line interface. An already open Pi interface updates when restarted or when setup is applied.`,detailDisplay_full:`Full`,detailDisplay_compact:`Compact`,sessionSettings:`Session`,currentModel:`Current`,providerCurrentSessionModel:`This conversation uses {{model}}.`,useThisModel:`Use model`,model:`Model`,modelConnection:`Model connection`,provider:`Provider`,modelId:`Model ID`,providerStatusUnavailable:`This provider is not present in the bounded authentication snapshot.`,providerSettings:`Provider credentials`,providerSettingsIntro:`Inspect which Pi providers can authenticate the current Web session.`,openRuntimeDetails:`Open runtime details`,currentWorkspace:`Current workspace`,providerAuth_api_key:`API key`,providerAuth_oauth:`OAuth`,providerAuthUnknown:`Authentication method not reported`,authentication:`Authentication`,accessType:`Access`,providerAccessSubscription:`Subscription account`,providerAccessStandard:`Provider credentials`,configurationOwner:`Configuration owner`,providerLoading:`Loading provider status…`,providerLoadFailed:`Could not load provider status.`,providerReadOnly:`Managed by Pi`,selectProvider:`Select a provider`,gitReviewBaselineUnavailable:`No usable session baseline was retained (it may exceed the capture limit). Choose Unstaged, Staged or Branch to inspect Git changes, or open the session file records.`,modelsIntro:`Sign in with an account or add an API key. Your existing Pi connections are available here.`,modelConnectionsTitle:`Model connections`,modelConnectionsIntro:`Manage credentials and choose models for new and current chats.`,accountLoginMethod:`Connection method`,accountLoginTab:`Account`,accountLoginChatGPT:`ChatGPT account`,accountLoginClaude:`Claude account`,accountLoginKeyTab:`API key`,accountLoginConfigured:`Account signed in`,accountLoginIntro:`Continue in your browser. No API key needed.`,accountLoginExisting:`Your account credential is saved in Pi.`,accountLoginStart:`Sign in`,accountLoginAgain:`Sign in again`,accountLoginUnsaved:`Save or discard your other changes before signing in.`,accountLoginStarting:`Preparing sign-in…`,accountLoginWaiting:`Waiting for authorization`,accountLoginChoose:`Choose how to sign in`,accountLoginCancelling:`Cancelling sign-in…`,accountLoginBrowser:`Continue in browser`,accountLoginDevice:`Use a device code`,accountLoginBrowserOption:`Sign in on this computer. Returns here automatically.`,accountLoginDeviceOption:`For remote servers or when browser sign-in is unavailable.`,accountLoginBrowserHelp:`Open the sign-in page and approve access. This page updates automatically.`,accountLoginDeviceHelp:`Open the authorization page and enter this code. Keep this page open.`,accountLoginOpen:`Open sign-in page`,accountLoginCopyCode:`Copy device code`,accountLoginPaste:`Authorization code or callback URL`,accountLoginContinue:`Continue`,accountLoginFallback:`Signed in but still waiting?`,accountLoginRemoteHelp:`If automatic return does not work, copy the final callback URL from your browser and paste it here.`,accountLoginCancel:`Cancel sign-in`,accountLogin_failed:`Sign-in failed. Try again or choose another method.`,accountLogin_expired:`Sign-in expired. Start again to get a new authorization link.`,accountLogin_cancelled:`Sign-in cancelled.`,accountLoginRequestFailed:`The request did not complete. Refresh status before retrying.`,accountLoginStatusUnknown:`Cannot check sign-in status. Your authorization may still be in progress.`,accountLoginRefreshRequired:`The credential was saved, but Pi could not update its model list. Reload Pi before using this connection.`,accountLogout:`Sign out`,accountLogoutRefreshRequired:`The saved credential was removed, but Pi could not update its model list. Reload Pi to refresh the status.`,accountLogoutTitle:`Sign out of {{provider}}?`,accountLogoutDetail:`Removes this provider’s saved credential from Pi on this machine. Other Pi sessions using it will also need to sign in again. Environment credentials are unchanged.`,providerInputTypes:`Input types`,providerInputText:`Text`,providerInputImage:`Images`,providerCustomTag:`Custom`,providerEdit:`Edit`,providerRemove:`Delete`,providerSave:`Save`,editProvider:`Edit {{provider}}`,removeProvider:`Delete {{provider}}`,providerAdd:`Add model provider`,providerAddMode:`How to add`,providerAddCatalog:`Third-party providers`,providerAddCustom:`Custom model API`,providerAccountHint:`Use an existing account to connect. Choose a provider and continue in your browser.`,providerCatalogHint:`Choose a provider from the built-in catalog and enter its API key.`,providerCustomHint:`Connect a gateway or self-hosted service using an OpenAI or Anthropic compatible API.`,providerKeyKeep:`Leave blank to keep the existing key`,providerKeyOptional:`Enter an API key, or leave blank to use environment authentication`,providerDisplayName:`Provider name`,providerCustomSettings:`Custom settings`,providerSaved:`Saved {{provider}}.`,modelDefaultTitle:`Default for new chats`,modelDefaultChoose:`Choose model`,modelDefaultBadge:`Default`,modelCurrentBadge:`In use`,modelDefaultNotSet:`Not set · Pi chooses when a new chat starts`,modelDefaultHint:`Choose the model for future chats. Existing chats keep their own model. This also updates Pi's default.`,modelDefaultReadFailed:`Could not read the default model.`,modelDefaultProjectOverride:`This workspace has a Pi override: {{model}}.`,modelDefaultSave:`Save default`,modelMakeDefault:`Also make this the default for new chats`,modelDefaultSaveFailed:`The default was not confirmed. Refresh status and try again.`,modelDefaultPartial:`The chat model changed, but saving the default was not confirmed. Refresh status before retrying.`,modelConnectionNextHint:`Choose a model from this connection to use in the current chat.`,modelConnectionSearch:`Search models…`,modelConnectionChooseProvider:`Choose a model from {{provider}}`,modelConnectionUse:`Use in this chat`,modelConnectionUseFailed:`The model change was not confirmed. Refresh the model list and try again.`,modelConnectionLoadFailed:`Could not load models.`,modelConnectionNoModels:`No selectable models yet. Check the connection or add a model definition.`,modelConnectionNoMatch:`No matching models.`,modelConnectionMore:`{{count}} more models. Search to narrow the list.`,providerModelsEmpty:`No models yet. Fetch available models or add one manually.`,providerModelsInherited:`Uses the provider’s built-in model catalog.`,providerModelsReadOnly:`This provider contains model settings that must be edited in Pi’s configuration file.`,providerModelId:`Model {{number}} ID`,providerModelName:`Model {{number}} name`,providerModelDetails:`Model details: {{model}}`,providerRemoveModel:`Remove model: {{model}}`,providerIdInvalid:`Use a unique provider ID with letters, numbers, hyphens, dots or underscores.`,providerNativeAuth:`This provider uses Pi’s native sign-in.`,providerConfigurationFailed:`Could not save. Check the fields and retry when the session is idle.`,providerProfileSavedKeyFailed:`The provider was saved, but its API key was not. Retry saving the key.`,providerReload:`Discard draft and reload`,providerCurrentRemoval:`Select another model before removing the model currently in use.`,providerRemoveDetail:`Remove this provider’s configuration and custom models? Credentials managed by Pi are kept.`,providerPickerIntro:`Select the models you want to add from this provider.`,providerPickerSelected:`{{count}} selected`,providerApiKey:`API key`,providerKeyPlaceholder:`Paste a key to add or replace it`,saveProviderKey:`Save API key`,savingSettings:`Saving…`,keepEditing:`Keep editing`,discardAndContinue:`Discard and continue`,unsavedSettingsTitle:`Discard unsaved changes?`,unsavedSettingsDetail:`Unsaved model and credential changes will be lost.`,unsavedCredentialTitle:`Discard the unsaved credential?`,unsavedCredentialDetail:`The new key has not been saved and will be cleared.`,modelSelectionBusy:`This session is busy. Model changes are unavailable.`,providerKeySaved:`Saved to Pi credentials. Existing keys are never displayed.`,providerSaveFailed:`Credential save did not complete. Wait until the session is idle, refresh status and retry. Some providers need additional authentication settings.`,providerWriteDetail:`Save API keys here directly to Pi. Keys never enter a model conversation. For OAuth or additional provider fields, use Pi's native login.`,editModelConfiguration:`Add or edit a custom model`,modelConfigurationDetail:`Set up a provider connection, then choose available models or add one manually. Saving does not send a model request.`,configuredModels:`Custom model configuration`,addModel:`Add a model`,modelConfig_provider:`Provider ID`,modelConfig_id:`Model ID`,modelConfig_name:`Display name`,modelConfig_baseUrl:`API base URL`,modelConfig_api:`API format`,modelConfig_contextWindow:`Context window`,modelConfig_maxTokens:`Max output tokens`,providerCapacityLabel:`{{field}} {{number}}`,providerModelOptions:`Model options`,providerModelInvalid:`Model {{number}}: use a unique model ID and positive token counts, such as 128K or 1M. Leave capacities blank to use defaults.`,modelConfig_reasoning:`Supports reasoning`,saveModelConfiguration:`Save model`,reloadModelConfiguration:`Discard draft and load latest`,retryModelConfiguration:`Retry loading`,discardModelDraftTitle:`Discard this model draft?`,discardModelDraftDetail:`The latest configuration will replace this unsaved draft.`,discardAndReload:`Discard and reload`,modelConfigurationUnsaved:`Unsaved changes`,modelConfigurationConflict:`Model configuration changed elsewhere. Your draft is unchanged.`,modelConfigurationLoadFailed:`Could not load model configuration. Your draft is unchanged.`,modelConfigurationSaved:`Saved to Pi models.json. Configure the provider API key to make this model available.`,modelConfigurationFailed:`Model save did not complete. Your draft is unchanged.`,setupConfigurationRequest:`Configuration request`,configureViaSetup:`Apply via OpenPI setup`,setupFormDetail:`Uses /openpi-setup. Follow progress and any required confirmation in the conversation; submission does not mean the configuration is saved.`,setupSkillsPlaceholder:`Describe the skill to add or configure, including its source or local path`,setupPluginsPlaceholder:`Describe the Pi package to configure, including its exact package name or local path`,enableSkillInvocation:`Allow model invocation`,disableSkillInvocation:`Require explicit invocation`,setupSkillInvocationRequest:`Configure this Pi skill: {{path}}. Set its native disable-model-invocation field to {{disabled}}. Preserve other content and explain when the change takes effect.`,setupRoleFormRequest:`Configure the OpenPI {{role}} role to use {{model}} and set workflow concurrency to {{concurrency}}. Inherit parent thinking, validate the selection and preserve unrelated configuration.`,providerReadOnlyDetail:`This page is read-only and never receives credential values. Configure provider authentication through Pi, then refresh this status.`,openProviderSettings:`Open provider settings`,credentialConfigured:`Configured`,credentialMissing:`Not configured`,authNotVerified:`Configured credentials do not guarantee a successful model request.`,configurationViaPi:`Read-only status. Manage model credentials and trust through Pi; manage OpenPI options with /openpi-setup.`,noSkillsFound:`No skills are loaded for this Session.`,addSkill:`Add skill`,addPlugin:`Add plugin`,searchResources:`Search by name or source`,filterResourceScope:`Resource scope`,allResourceScopes:`All scopes`,noMatchingResources:`No matching resources`,resourceBulkTooLarge:`Filter the list further before submitting a bulk request.`,resourceManagement:`Pi resources`,resourceSourceAuto:`Pi automatic discovery`,resourceSourceLocal:`Local resource`,resourcePackageSource:`Package, repository or local path`,resourcePackageSourcePlaceholder:`npm:package@version · git:owner/repo · /path/to/skill`,resourceInstallIntro:`Choose a source and scope. OpenPI setup will review and apply the request in the conversation.`,resourceInstallReview:`Review the exact source and permissions in the conversation. Submitting this request does not mean it is installed or loaded.`,resourceRequestSubmitted:`Request submitted. Follow progress and confirmations in the conversation, then refresh this catalog.`,browseSkills:`Browse skills.sh`,resourceSessionState:`Apply to this Session`,resourcesReloadNote:`Refresh reads the catalog. Reload applies saved resources to this idle Session; changes are never reloaded automatically.`,reloadResources:`Reload resources`,resourceReloadReview:`Apply saved Pi skill and plugin configuration and restart extensions in the current Session? Wait for running work to finish first.`,resourceReloaded:`Resources reloaded. Review the refreshed catalog and diagnostics.`,resourceReloadFailed:`Could not reload resources. Wait for this Session to become idle and refresh before retrying.`,advancedResourceConfiguration:`Advanced configuration`,resourceDiagnostics:`Pi reports {{extensionErrors}} extension diagnostics and {{skillErrors}} skill diagnostics.`,resourceConfigurationDiagnostics:`{{count}} settings files could not be read. Review Pi configuration diagnostics.`,resourceCatalogTruncated:`This catalog is bounded; some resources are omitted.`,resourceTargetTruncated:`This source or path is truncated. Confirm the full target through Advanced configuration before making changes.`,updateResource:`Review update`,removeResource:`Review removal`,skillsEmptyTitle:`Add your first skill`,skillsEmptyIntro:`Skills give Pi reusable instructions. Add a package, repository or local skill; project skills follow Pi project trust.`,pluginsEmptyTitle:`Extend Pi with a plugin`,pluginsEmptyIntro:`Packages can include extensions, skills, prompts and themes. Add a source to review its installation through OpenPI setup.`,pluginCount:`{{count}} plugin sources`,installedVersion:`Installed version`,configuredVersion:`Configured version`,resourceVersionUnpinned:`Not pinned / local source`,pluginState_loaded:`Session resources loaded`,pluginState_installed:`Installed · not loaded`,pluginState_disabled:`Disabled in configuration`,pluginState_missing:`Package missing`,pluginState_error:`Load diagnostics`,pluginState_notLoaded:`Not loaded`,pluginLoadedResources:`{{count}} resources in this Session's catalog. Configuration changes require an explicit reload.`,pluginAction_enable:`Review enable`,pluginAction_disable:`Review disable`,pluginAction_update:`Review update`,pluginAction_remove:`Review removal`,enableVisibleSkills:`Allow model use ({{count}} shown)`,disableVisibleSkills:`Explicit use only ({{count}} shown)`,enableVisiblePlugins:`Enable {{count}} shown packages`,disableVisiblePlugins:`Disable {{count}} shown packages`,setupResourceInstallRequest:`Add these Pi {{kind}} from source {{source}} in scope {{scope}}. Inspect the source and resolve a fixed package identity, review required installation permissions with me using ask_user, then use Pi's native package/skill configuration. For a skill request, preserve unrelated extensions and other resources. Preserve existing preferences and project trust; do not reload this Session automatically. Report saved configuration and any remaining action separately. Do not change unrelated OpenPI settings.`,setupPluginOperationRequest:`Review Pi package action {{action}} for exactly configured source {{source}}, native root {{path}}, scope {{scope}}. Resolve relative sources against the native scope's settings directory. Use Pi's native package management. For updates, inspect available versions and review a fixed target identity and required permissions with me using ask_user before installing. Preserve resource filters and all unrelated preferences; if a toggle would destroy filters, stop and explain. Removal must not delete a local source directory. Do not reload automatically. Report persisted and active states separately; do not change unrelated OpenPI settings.`,setupSkillManageRequest:`Review Pi skill action {{action}} for exactly file {{path}}, source {{source}}, scope {{scope}}. Inspect native ownership first. Review the update/removal and required permissions with me using ask_user. Preserve unrelated skills and package resources; do not remove an entire shared package to remove one skill. Preserve project trust and do not reload automatically. Do not change unrelated OpenPI settings.`,setupSkillsBulkRequest:`For exactly these currently displayed Pi skill files {{paths}}, set native disable-model-invocation to {{disabled}}. Inspect ownership, preserve all other content and preferences, review necessary changes with me, and report any files that cannot be changed safely. Explicit /skill invocation remains available. Do not reload automatically or change unrelated OpenPI settings.`,setupPluginsBulkRequest:`For exactly these currently displayed Pi packages {{packages}}, set disabled to {{disabled}} through native Pi configuration. Preserve all other preferences and resource filters; skip and report entries whose filters cannot be preserved. Respect scope and project trust, review necessary changes with me, and do not reload automatically or change unrelated OpenPI settings.`,resourceRequestFinished:`The setup turn has ended. Refresh and inspect Pi's configuration and Session resources to confirm what changed.`,skillCount_one:`{{count}} skill`,skillCount_other:`{{count}} skills`,skill:`Skill`,copySkillInvocation:`Copy invocation`,source:`Source`,scope:`Scope`,invocation:`Invocation`,modelInvocation:`Model invocation`,resourceScope_user:`Global`,resourceScope_project:`Project`,resourceScope_temporary:`Temporary`,explicitOnly:`Explicit invocation only`,availableToModel:`Available to the model`,skillFile:`Skill file`,selectSkill:`Select a skill`,subagentConfiguration:`Pi-native subagent roles`,subagentConfigurationIntro:`Role models inherit from the parent unless OpenPI setup assigns an available model.`,subagentActiveCount_one:`{{count}} active`,subagentActiveCount_other:`{{count}} active`,subagentCompletedCount_one:`{{count}} recorded`,subagentCompletedCount_other:`{{count}} recorded`,subagentConcurrency:`Limit {{count}}`,builtInRoles:`Built-in roles`,subagentRole_explorer:`Explorer`,subagentRole_implementer:`Implementer`,subagentRole_reviewer:`Reviewer`,subagentRole_advisor:`Advisor`,subagentRoleShort_explorer:`Read-only investigation`,subagentRoleShort_implementer:`Focused implementation`,subagentRoleShort_reviewer:`Correctness review`,subagentRoleShort_advisor:`Technical analysis`,subagentRoleDescription_explorer:`Explores the codebase and reports evidence without modifying files.`,subagentRoleDescription_implementer:`Implements a bounded change and runs the relevant repository checks.`,subagentRoleDescription_reviewer:`Reviews correctness, safety, regressions, and missing validation.`,subagentRoleDescription_advisor:`Analyzes difficult technical questions and recommends a concrete next step.`,configureRoles:`Configure roles`,builtInRole:`Built-in role`,builtIn:`Built-in`,modelAssignment:`Model assignment`,inheritParentModel:`Inherit parent model`,effectiveModel:`Effective model`,workflowConcurrencyLabel:`Concurrent agents`,workflowCallLimit:`Total agent calls`,runtimeBoundaries:`Runtime boundaries`,subagentAuthorityNote:`Child authority is the fail-closed intersection of the parent Session and role capabilities.`,subagentModelNote:`No hardcoded provider is introduced; an unassigned role follows the parent model and thinking level.`,resourceCount_one:`{{count}} resource`,resourceCount_other:`{{count}} resources`,noPluginsFound:`No loaded plugin sources were reported.`,pluginCatalogTotals:`{{extensions}} ext · {{skills}} skills · {{prompts}} prompts · {{themes}} themes`,loaded:`Loaded`,resourceOrigin:`Origin`,resourceOrigin_package:`Package`,resourceOrigin_topLevel:`Top-level resource`,resources:`Resources`,baseDirectory:`Base directory`,notReported:`Not reported`,extensions:`Extensions`,extensionSurfaceCount:`{{tools}} tools · {{commands}} commands`,prompts:`Prompts`,themes:`Themes`,pluginResourceSummary:`{{extensions}} ext · {{skills}} skills · {{prompts}} prompts · {{themes}} themes`,pluginsManagedByPi:`These resources are loaded by Pi. Submit changes using the setup form above. Package changes follow native confirmation and take effect through Pi's reload lifecycle.`,selectPlugin:`Select a plugin source`,statusCaptured:`Snapshot at {{time}} · refresh for the latest state`,conversationViews:`Conversation views`,currentConversations:`Current`,archivedConversations:`Archived`,refreshArchives:`Refresh archived conversations`,loadingArchives:`Loading archived conversations...`,moreArchives:`Load more archived conversations`,retryArchives:`Retry archived conversations`,archiveLoadFailed:`Could not load archived conversations.`,archiveCursorStale:`Archived conversations changed. Refresh to continue.`,archiveScanBounded:`{{count}} older records have not been scanned.`,noArchivedSessions:`No archived conversations.`,noScannedArchives:`No archived conversations in the scanned history.`,noMatchingScannedArchives:`No matching archived conversations in the scanned history.`,draftLimit:`Draft storage is full. Send or clear an existing draft before adding more content.`,restoreConversation:`Restore conversation`,restoringConversation:`Restoring…`,loadedArchives:`Archived conversations in the loaded history`,loadedHistoryBounded:`{{sessions}} more sessions and {{workspaces}} workspace summaries are not loaded. Search covers the loaded list only.`,noLoadedArchives:`No archived conversations in this loaded list.`,restoreFailed:`Could not confirm restoration. Refresh and try again.`,execution_running:`Running`,execution_done:`Completed`,execution_killed:`Stopped`,execution_timed_out:`Timed out`,execution_failed:`Failed`,execution_uncertain:`Uncertain`,activeOnlyHint:`Only the active Web session accepts messages.`,acceptedHint:`Message accepted by OpenPI Web.`,promptAdmissionUnknown:`It is unclear whether the last message was received.`,promptAdmissionUnknownDetail:`Review the refreshed Session history and runtime status before deciding. Sending as a new message may create a duplicate message.`,promptAdmissionCheckingDetail:`Checking the latest Session history and runtime status before resend options are enabled.`,promptAdmissionVerificationFailedDetail:`Could not refresh the latest Session history and runtime status. Check again before sending as a new message.`,abandonAdmission:`Don't resend for now`,retryAdmissionCheck:`Check again`,retryOriginalAdmission:`Retry original message`,promptTooLong:`Message exceeds the send limit ({{count}} / {{limit}}).`,sendAsNew:`Send as new message`,sendingAsNew:`Sending…`,stopTurn:`Stop current turn`,stoppingTurn:`Stopping current turn…`,stoppedTurn:`Current turn stopped.`,pendingFollowUpsHint:`{{count}} messages queued`,sendNextTurn:`Send next turn`,followUpBehavior:`Follow-up behavior`,followUpBehaviorDetail:`While OpenPI is running, queue new messages for the next turn or guide the current turn. Press ⌘/Ctrl+Enter to use the other option once.`,followUpQueue:`Queue`,followUpQueueDetail:`Next turn`,followUpSteer:`Steer`,followUpSteerDetail:`Current turn`,steerCurrentTurn:`Steer current turn`,steeringHint:`Use this instruction after the current tool step finishes.`,pendingSteeringHint:`{{count}} instructions received; waiting for the current tool step`,steeringMessagesTitle:`Pending instructions for this turn`,steerStaleTurn:`That turn has ended or changed. Your draft is kept. Check the updated status and send again.`,sourceFeedbackNew:`{{path}} · new line {{line}}`,sourceFeedbackOld:`{{path}} · old line {{line}}`,forkMessage:`Fork from here`,forkMessageHint:`Create a new conversation from this message. Keep the original conversation; no message is sent.`,forkSessionPending:`Creating a fork…`,forkSessionCreated:`Fork created. The original conversation remains in the sidebar.`,forkSessionCancelled:`Fork cancelled. The original conversation is kept.`,forkSessionUncertain:`The fork could not be confirmed. Refresh and inspect your conversations before trying again.`,forkSessionUnavailable:`Switch to this conversation and let its current work and queued messages finish before forking.`,reviewQuoteLine:`Reference this line`,reviewSelectOldLine:`Select old line {{line}}`,reviewSelectNewLine:`Select new line {{line}}`,queuedMore:`{{count}} more queued`,queuedImage:`Image attachment`,queuedMessageExpand:`Expand queued message`,queuedMessageCollapse:`Collapse queued message`,backgroundSessionRunning:`This session is running in the background…`,observedSessionTools:`{{count}} active tools`,toolsRequireCurrentSession:`Switch to this session to use interactive tools.`,activateViewedSession:`Switch to this session`,activateViewedSessionHint:`Send a message to continue this conversation.`,addWorkspace:`Add workspace`,addWorkspaceMenu:`Add workspace...`,archiveConversation:`Archive conversation`,pinnedConversations:`Pinned`,sidebarOptions:`Sidebar options`,sidebarProjectOptions:`Project sidebar options`,sidebarRecentOptions:`Chat sidebar options`,sidebarActivityOptions:`Activity view options`,sidebarShow:`Show`,sidebarGroupBy:`Group conversations`,sidebarByProject:`By project`,sidebarFlatList:`All conversations`,sidebarChatSort:`Conversation order`,sidebarRecent:`Recent`,sidebarProjectsInRecents:`Show projects in Recent`,sidebarShowMore:`Show more`,sidebarShowLess:`Show less`,sidebarFilterList:`Filter this list`,sidebarSaveFailed:`Could not save the change. Please try again.`,pinWorkspace:`Pin project`,unpinWorkspace:`Unpin project`,markConversationRead:`Mark as read`,markConversationUnread:`Mark as unread`,sidebarState_unread:`Unread conversation`,sidebarActivity:`Activity`,sidebarViewActivity:`View activity`,sidebarViewChats:`View conversations`,sidebarPriority:`Priority`,sidebarActivityEmpty:`Nothing needs attention`,sidebarActivityEmptyHint:`Completed work and conversations needing your attention appear here.`,sidebarMarkAllRead:`Mark all as read`,sidebarClearRead:`Clear read chats from Priority`,sidebarReadFailed:`Could not update read status. Please try again.`,sidebarToday:`Today`,sidebarYesterday:`Yesterday`,sidebarEarlier:`Earlier`,sidebarActivityCompleted:`Completed`,sidebarActivityFailed:`Failed`,sidebarActivityRead:`Read`,modelAdvanced:`Advanced parameters`,providerConnectionHeading:`Provider connection`,providerFetchModels:`Get available models`,providerFetchHint:`Enter the provider and endpoint, then choose models in one step.`,providerPickerTitle:`Choose models to add`,providerPickerAccess:`Connection credentials`,providerPickerKey:`Access key (optional)`,providerPickerKeyHint:`Leave blank to use saved credentials for this endpoint. A key entered here is used for discovery only and is not saved.`,providerPickerSearch:`Search models`,providerPickerSelectAll:`Select all`,providerPickerClear:`Clear selection`,providerPickerLoading:`Reading available models…`,providerPickerAdded:`Added`,providerPickerNoMatch:`No matching models`,providerPickerEmpty:`No models returned. You can still add one manually.`,providerPickerBounded:`Showing the first 500 models. Add other IDs manually.`,providerPickerError_load:`Could not read the model list. Check the endpoint and credentials, then retry or add a model manually.`,providerPickerError_save:`Could not confirm the save. Your selection is kept; check the connection before retrying.`,providerPickerError_conflict:`Configuration changed elsewhere. Close this dialog and reload configuration before saving again.`,providerPickerDefaults:`New models use {{context}} context / {{output}} output tokens. You can adjust these per model after adding.`,providerPickerRetry:`Refresh list`,providerPickerCount:`{{count}} selected · up to 100`,providerPickerSave:`Add selected`,sidebarState_running:`Running`,sidebarState_compacting:`Organizing context`,sidebarState_waiting:`Waiting for your response`,sidebarState_completed:`Completed · unread result`,sidebarState_failed:`Failed · open conversation for details`,pinnedOptions:`Pinned options`,pinConversation:`Pin conversation`,unpinConversation:`Unpin conversation`,pinnedRecentlyUpdated:`Recently updated`,pinnedManualOrder:`Manual order`,movePinUp:`Move up`,movePinDown:`Move down`,pinSaveFailed:`Could not save pinned conversations. Please try again.`,cancel:`Cancel`,chooseWorkspaceHint:`Choose a workspace and describe the work`,close:`Close`,closeSearch:`Close search`,collapseSidebar:`Collapse sidebar`,confirmEdit:`Save and rerun`,editMessageHint:`Rerun from here in a new branch. Keep the original conversation, images and file references. Existing workspace changes are kept.`,regenerateMessage:`Regenerate response`,regenerateMessageHint:`Rerun this question in a new branch, keeping its original attachments and conversation.`,messageRerunStarted:`Rerun admitted in a new branch. The original conversation is kept.`,openOriginalConversation:`View original conversation`,messageRerunWorkspaceHint:`Existing workspace changes are kept.`,modelRequestRecovered:`Request recovered`,modelReconnecting:`Reconnecting`,modelReconnectUnknown:`Reconnection status unconfirmed`,modelEarlierAttempts:`Earlier request errors`,modelFailedAttempts:`Failed attempts ({{count}})`,draftStorageUnavailable:`Draft could not be saved on this device. Keep this page open or copy your message.`,draftStorageInvalid:`Some saved draft content could not be restored. Check your message and attachments.`,draftStorageRetry:`Retry saving draft`,workbarBackToChat:`Back to chat`,workbarCollapseTools:`Collapse tools`,workbarEndTerminal:`Close {{name}} and end its process`,workbarNewTerminal:`New terminal`,workbarContinueInChat:`Continue in chat`,transcriptSearch:`Search message contents`,transcriptSearchPlaceholder:`Search titles, projects, or messages…`,transcriptSearchRecent:`Recent conversations`,transcriptSearchSessions:`Conversations`,transcriptSearchMessages:`Message contents`,transcriptSearchSessionResult:`Open conversation {{session}}`,transcriptSearchSessionOpenFailed:`Could not open this conversation. Try again.`,transcriptSearchIncludeArchived:`Include archived conversations`,transcriptSearching:`Searching messages…`,transcriptSearchEmpty:`No matching messages found.`,transcriptSearchFailed:`Could not search messages. Try again.`,transcriptSearchRetry:`Retry search`,transcriptSearchPartial:`Some history could not be searched. Results may be incomplete.`,transcriptSearchOpenFailed:`This message could not be opened. It may have moved or belong to another branch.`,transcriptSearchResult:`Open message from {{source}} in {{session}}`,transcriptSearchSource_user:`you`,transcriptSearchSource_assistant:`assistant`,transcriptSearchSource_tool_call:`tool call`,transcriptSearchSource_tool_result:`tool output`,connected:`Connected`,connecting:`Connecting`,conversationName:`Conversation name`,conversationOptions:`Conversation options`,sidebarRename:`Rename`,sidebarPin:`Pin`,sidebarUnpin:`Unpin`,sidebarFork:`Fork`,sidebarForkLocal:`Fork chat`,sidebarForkSameWorktree:`Fork in same worktree`,archiveNoticeTitle:`Chat archived`,archiveNoticeView:`View`,archiveNoticeUndo:`Undo`,archiveNoticeFailed:`Could not complete this action. Try again.`,sidebarForkWorktree:`Fork chat in new worktree`,sidebarForkCancelling:`Requesting cancellation…`,sidebarForkFinishing:`Cancellation is no longer available. Confirming the result…`,sidebarForkCancelUnconfirmed:`Cancellation could not be confirmed. Waiting for the fork result.`,sidebarForkWorktreePreserved:`The worktree was kept at {{path}}. Inspect it before retrying.`,sidebarForkWorktreePending:`Creating a worktree and conversation…`,sidebarForkOptionsLoading:`Checking worktree availability…`,sidebarForkOptionsFailed:`Unable to check worktrees. Reopen menu to retry.`,sidebarForkUnavailable:`Send a message before forking this conversation.`,sidebarForkArchived:`Restore this conversation before forking.`,sidebarForkFailed:`Could not create the fork. The original conversation is unchanged.`,sidebarCopy:`Copy`,sidebarCopyLink:`Copy conversation link`,sidebarCopyMarkdown:`Copy as Markdown`,sidebarCopyCwd:`Copy working directory`,sidebarCopied:`Copied`,sidebarCopyFailed:`Could not copy. Try again.`,sidebarNewWindow:`Open in new window`,sidebarOpenIn:`Open in`,sidebarAppsLoading:`Loading available apps…`,sidebarAppsFailed:`Unable to load apps. Reopen menu to retry.`,sidebarOpenFailed:`Unable to open this project in the selected app.`,sidebarArchive:`Archive`,sidebarRestore:`Restore`,sidebarDelete:`Permanently delete`,managedWorktreeRecoveryFull:`Check earlier unfinished removal requests before starting another.`,managedWorktreesChanged:`The worktree list changed. Refresh it before reviewing a target.`,managedWorktreesRefresh:`Refresh worktrees`,managedWorktreesBack:`Back to worktrees`,managedWorktreesRetry:`Retry request`,managedWorktrees:`Retained worktrees`,managedWorktreesDescription:`Worktrees created by OpenPI are kept when a conversation is deleted. Review an exact path before requesting removal. Active, shared, changed or unverified worktrees stay in place.`,managedWorktreeConfirm:`Remove this managed worktree? The server rechecks ownership, active conversations and local changes before removal.`,managedWorktreeRemoved:`Worktree removed.`,managedWorktreePreserved:`Worktree kept:`,managedWorktreeUncertainTerminal:`Removal outcome is uncertain. Automatic removal cannot be repeated. Inspect the retained path before taking further action.`,managedWorktreeUncertain:`Removal outcome is unknown. Retry to check the original request.`,managedWorktreeRemoving:`Checking and removing…`,managedWorktreeRemove:`Remove worktree`,managedWorktreeReview:`Review removal`,managedWorktreesEmpty:`No managed worktrees were found on this page.`,managedWorktreesUnavailable:`{{count}} ownership records could not be verified.`,managedWorktreesLoadFailed:`Could not load retained worktrees. Retry without changing the target.`,managedWorktreesMore:`Load more worktrees`,managedWorktreeRetainedAfterDelete:`Conversation deleted. Worktree kept at {{path}}. Review retained worktrees in the project menu.`,sidebarDeleteTitle:`Delete conversation?`,sidebarDeleteDescription:`Permanently delete “{{name}}”? This cannot be undone.`,sidebarDeleteConfirm:`Delete`,sidebarDeleting:`Deleting…`,sidebarDeleteFailed:`Could not delete this conversation. Retry or cancel.`,sidebarActionRunning:`Let current work and queued messages finish first.`,sidebarActionDisconnected:`Reconnect before changing this conversation.`,sessionDeleteCancelled:`Deletion cancelled`,sessionDeleteUncertain:`Could not confirm whether the conversation was deleted. Refresh and try again.`,sessionDeleted:`Conversation permanently deleted`,sessionDeleteMetadataPending:`The conversation was deleted, but its sidebar records could not be fully cleared.`,sessionLinkUnavailable:`The linked conversation no longer exists or its identity has changed.`,sidebarDropPin:`Drop here to pin`,sidebarDropProjectLast:`Move project to the end`,conversationTurns:`Conversation turns`,conversationTurnPosition:`Go to turn {{position}}`,turnPreviewLoading:`Loading preview…`,turnPreviewUnavailable:`Preview unavailable. Try again.`,commands:`Slash commands`,addContext:`Add context`,fileReference:`Reference workspace file`,fileReferenceTitle:`Reference workspace file`,fileReferenceDetail:`Add a path reference to the prompt without uploading file contents.`,fileReferenceLabel:`Workspace file path`,fileReferencePlaceholder:`src/app.tsx`,fileReferenceValidatedHint:`The current Session verifies that this is a readable workspace file.`,fileReferenceDraftHint:`This path will be resolved by Pi after the new Session starts.`,fileReferenceChecking:`Checking…`,fileReferenceFailed:`Could not verify this file.`,fileReferenceDenied:`Choose a file inside the current Session workspace.`,fileReferenceMissing:`This workspace file no longer exists.`,fileReferenceUnsupported:`Only regular workspace files can be referenced.`,fileReferenceExpired:`The active Session changed. Reopen the file reference and try again.`,fileReferenceBusy:`File validation is busy. Try again shortly.`,insertReference:`Insert reference`,commandsSessionRequired:`Slash commands are available after the Session starts.`,commandsEmptyDraftOnly:`Slash commands can be inserted only into an empty draft.`,commandsLoading:`Loading commands...`,commandsUnavailable:`Commands are temporarily unavailable.`,commandsNoMatch:`No matching commands.`,commandsNoAvailable:`No discovered commands can run in Web. Type a command name to inspect its availability.`,commandsBounded:`{{count}} more commands are not shown.`,commandSessionRequired:`Commands require an active Web session.`,commandUnsupported:`Not adapted · manual commands still reach Pi`,commandAcceptsArguments:`Accepts arguments`,commandSource_extension:`Extension`,commandSource_prompt:`Prompt template`,commandSource_skill:`Skill`,copiedMessage:`Copied`,copyMessage:`Copy message`,copyFailed:`Copy failed. Please select and copy the message manually.`,copiedCode:`Code copied`,copyCode:`Copy code`,copyCodeFailed:`Could not copy this code. Select and copy it manually.`,codeBlock:`Code block`,wrapCode:`Wrap lines`,expandCode:`Show all {{count}} lines`,collapseCode:`Collapse code`,expandInput:`Expand input`,collapseInput:`Collapse input`,deleteWorkspace:`Delete workspace`,describeTask:`Describe a task`,editMessage:`Edit and rerun from here`,enterHint:`Enter to send, Shift+Enter for a new line.`,expandSidebar:`Expand sidebar`,importWorkspace:`Import workspace`,loadingModels:`Loading models...`,modelsTruncated:`Showing {{shown}} models. {{omitted}} more are available; search to find them.`,searchModels:`Search available models`,searchModelsPlaceholder:`Search provider, model name, or ID...`,searchingModels:`Searching models...`,noMatchingModels:`No matching models`,modelSearchFailed:`Could not search models. Try again.`,retryModelSearch:`Retry model search`,fileReferenceDraftChanged:`The draft changed. Reopen the file reference.`,modelSearchTruncated:`{{omitted}} matching models are not shown.`,modelPreparing:`Preparing task...`,modelRetrying:`Retrying model request...`,modelRunning:`Working…`,modelRequestFailed:`Model request failed`,modelRequestStopped:`Model request stopped`,modelFailureUnknown:`The provider did not return an error reason.`,retryPrompt:`Retry prompt`,retryingPrompt:`Retrying...`,newSession:`New session`,noConversations:`No conversations yet`,noMatching:`No matching conversations`,noMatchingLoaded:`No matching conversations in the loaded history`,noModels:`No models available`,noOutput:`no output`,noSessions:`No sessions`,openSidebar:`Open sidebar`,promptMessage:`Send a message or start a task, / for commands`,promptReadonly:`A non-active session cannot receive prompts`,promptStart:`Choose a workspace to begin.`,promptTask:`Describe what you want to build.`,queuedHint:`The message will be queued after the current turn.`,reconnecting:`Reconnecting`,removeWorkspace:`Remove from sidebar`,workspaceOptions:`Workspace options`,renameFailed:`Could not save the name. Your changes were kept.`,savingName:`Saving...`,workspaceRemoveFailed:`Could not remove the workspace. Try again.`,removingWorkspace:`Removing...`,renameConversation:`Rename conversation`,renameWorkspace:`Rename workspace`,save:`Save`,searchConversations:`Search conversations`,searchPlaceholder:`Filter titles and workspaces…`,selectModel:`Select model`,configureModels:`Configure models`,openModelSettings:`Model settings`,selectThinking:`Select thinking level`,thinkingAvailableLevels:`Available: {{levels}}`,resetThinking:`Restore the opening level ({{level}})`,modelThinkingNotEnabled:`Thinking is not enabled for this model. Enable reasoning support in model settings if your provider supports it.`,providerReasoningHint:`Enable only if the provider supports reasoning. Adjust the active level in the composer.`,providerThinkingLevels:`Supported thinking levels`,providerThinkingLevelsHint:`Choose the levels this model supports. Saving updates the conversation picker.`,providerThinkingAutomatic:`Automatic (Pi defaults)`,providerThinkingSelected_one:`{{count}} level selected`,providerThinkingSelected_other:`{{count}} levels selected`,providerThinkingReset:`Use Pi defaults`,providerImageHint:`When Image is unchecked, the model will not receive image attachments.`,selectWorkspace:`Select workspace`,send:`Send`,processDetails:`Execution details`,processRunning:`Working`,processThinkingCount_one:`{{count}} reasoning note`,processThinkingCount_other:`{{count}} reasoning notes`,processToolCount_one:`{{count}} tool call`,processToolCount_other:`{{count}} tool calls`,processFailureCount_one:`{{count}} failed`,processFailureCount_other:`{{count}} failed`,runtimeActivities:`Activity`,activityAgentProgress:`{{completed}}/{{total}} agents finished`,activityCapacity:`Concurrent tasks: {{running}}/{{limit}} · {{queued}} waiting`,composerQueuedCount:`Queued {{count}}`,composerSteeringCount:`Steering {{count}}`,runtimeActivityRunning_one:`{{count}} running`,runtimeActivityRunning_other:`{{count}} running`,runtimeActivityCount_one:`{{count}} activity`,runtimeActivityCount_other:`{{count}} activities`,processActivityCount_one:`{{count}} agent activity`,processActivityCount_other:`{{count}} agent activities`,switchingSession:`Switching session...`,thinkingActive:`Thinking...`,thinkingActiveLevel:`Thinking ({{level}})...`,thinkingDone:`Thinking`,thinkingLoadFull:`Load full thinking`,thinkingLoadingFull:`Loading thinking…`,thinkingLoadFailed:`Unable to load thinking. Retry`,thinkingPartialText:`Showing part of the saved thinking. More text can be loaded below.`,thinkingPreviewOnly:`Thinking preview reached its limit. The full saved text will be available when this message finishes.`,toolState_running:`Running`,toolState_returned:`Returned`,toolState_failed:`Failed`,toolState_cancelled:`Stopped`,toolState_timed_out:`Timed out`,toolState_unknown:`Unconfirmed`,toolSnapshotMissingResult:`No result at fork`,toolActivity_running:`{{action}}…`,toolActivity_failed:`{{action}} failed`,toolActivity_cancelled:`{{action}} stopped`,toolActivity_timed_out:`{{action}} timed out`,toolActivity_unknown:`{{action}}`,toolAction_read:`Read`,toolAction_write:`Write file`,toolAction_edit:`Edit file`,toolAction_command:`Run command`,toolAction_search:`Search`,toolAction_list:`List files`,toolAction_web:`Browse web`,toolAction_agent:`Agent activity`,subagentAction_spawn:`Start subagent`,subagentAction_send:`Send follow-up`,subagentAction_check:`Check subagent`,subagentAction_wait:`Wait for subagent`,subagentAction_cancel:`Stop subagent`,subagentActionDone_spawn:`Started subagent`,subagentActionDone_send:`Sent follow-up`,subagentActionDone_check:`Checked subagent`,subagentActionDone_wait:`Finished waiting`,subagentActionDone_cancel:`Stop request returned`,toolAction_workflow:`Workflow`,toolAction_plan:`Prepare plan`,toolAction_git:`Review changes`,toolAction_call:`Use tool`,toolActionDone_read:`Read`,toolActionDone_write:`Wrote file`,toolActionDone_edit:`Edited`,toolActionDone_command:`Ran command`,toolActionDone_search:`Searched`,toolActionDone_list:`Listed files`,toolActionDone_web:`Browsed web`,toolActionDone_agent:`Agent activity returned`,toolActionDone_workflow:`Workflow tool returned`,toolActionDone_plan:`Plan tool returned`,toolActionDone_git:`Reviewed changes`,toolActionDone_call:`Used tool`,toolActionGroup_read:`read files`,toolActionGroup_write:`write files`,toolActionGroup_edit:`edit files`,toolActionGroup_command:`run commands`,toolActionGroup_search:`search`,toolActionGroup_list:`list files`,toolActionGroup_web:`browse web`,toolActionGroup_agent:`agent activity`,toolActionGroup_workflow:`workflow activity`,toolActionGroup_plan:`planning`,toolActionGroup_git:`review changes`,toolActionGroup_call:`use tools`,toolGroup_done:`Activity · {{actions}}`,toolGroup_running:`Working · {{actions}}`,toolGroup_unknown:`Activity · {{actions}}`,toolGroupSeparator:`, `,toolSearchTarget:`“{{pattern}}” · {{path}}`,toolDiffStatsHelp:`Added and removed lines in the displayed diff`,toolRequestedFile:`File:`,toolWorkspace:`Workspace`,toolRawEvidence:`Arguments and original result`,toolCodemodeDetails:`Script and original result`,toolNestedOutputMissing:`This session records the call and its status, but not the nested tool output.`,toolNestedArgumentsMissing:`This session omits the full arguments and nested tool output.`,toolNestedIncomplete:`The nested-call record is incomplete; some calls, arguments or final states are unavailable.`,toolPartialEvidence:`Partial output: a byte, line or item limit was reached. The original result may also be truncated.`,toolFileChange_created:`File created`,toolFileChange_unchanged:`No content changes`,toolFileChange_overwritten:`File overwritten`,toolChangeUnavailable:`This result does not include a change comparison.`,toolTestResults:`Reported test results · {{format}}`,toolTestCounts:`{{tests}} tests · {{passed}} passed · {{failed}} failed · {{cancelled}} cancelled`,toolTestCountsHelp:`Counts come from command output. The execution status is shown separately.`,toolReadMore:`Read another range using the path and offset. The original result contains continuation details.`,toolFullOutputReference:`Full output:`,subagentBackgroundResult_one:`Background subagent result · {{count}}`,subagentBackgroundResult_other:`Background subagent results · {{count}}`,thinkingDraftHint:`Choose a workspace and create a session first.`,thinkingInactiveHint:`Only the active session can change its thinking level.`,thinkingLevelMismatch:`The confirmed thinking level is not offered by the current model. Choosing another level will correct it.`,thinkingLockedRunning:`Stop the current turn before changing the thinking level.`,thinkingModelPendingHint:`Wait for the model change to finish.`,thinkingNotConfirmed:`Thinking level was not confirmed. Please try again.`,thinkingPendingHint:`Applying the thinking level...`,thinkingUnsupported:`Thinking is unavailable`,thinkingUnsupportedHint:`No model is selected, or the current model does not support thinking.`,unavailable:`Unavailable`,ungrouped:`Ungrouped`,untitledSession:`New session`,workspaceDeleteConfirm:`The folder and conversation records will be kept. Its conversations will move to Ungrouped.`,workspaceName:`Workspace name`,workspaces:`Workspaces`,sidebarProjects:`Projects`}},zh:{translation:{quitOpenPI:`退出 OpenPI`,quittingOpenPI:`正在退出…`,quitConfirmHelp:`确定退出此 OpenPI Web 应用吗?此 Web 应用中所有正在运行的任务都会停止,对话会保存,重启后可继续查看。`,quitTabHelp:`仅关闭浏览器标签页会让 OpenPI 和任务继续在后台运行。`,quitAccepted:`OpenPI 正在关闭`,quitAcceptedHelp:`退出请求已接受。请等待终端确认 OpenPI 已停止,然后可以关闭此标签页。`,quitRestartHelp:`重新启动:在终端运行 openpi web,或在 Pi 中运行 /web,然后打开显示的地址。刷新此页面不会重启 OpenPI。`,quitFailed:`无法确认是否已关闭。请先检查终端,再重试。也可以在 OpenPI 所在终端按 Ctrl+C 停止应用。`,promptPending:`正在处理请求…`,commandFeedbackTruncated:`这里只显示部分命令结果。请缩小查询范围,或在 TUI 查看完整输出。`,planMode_inactive:`普通模式`,planMode_planning:`规划中 · 禁止写入`,planMode_ready:`计划就绪 · 等待审阅`,planMode_invalid:`计划状态异常 · 禁止写入`,planModeEnter:`进入规划`,promptPlanMessage:`本次对话使用 Plan 模式 · 继续讨论计划,暂不实施`,planModeUnconfirmed:`暂时无法确认 Plan 状态,请刷新后再继续。`,planModeExit:`退出规划`,planModeImplement:`准备实施提示`,planImplementationReplaceDraft:`准备实施会替换当前草稿并关闭规划模式,但不会发送提示词。是否继续?`,commandSupport_plan:`支持规划和准备当前会话的实施提示;新建实施会话仍需使用 TUI。`,commandSupport_setup:`通过当前模型配置,在 Web 回答问题。`,handoffWaiting:`需要你操作`,handoffDone:`已完成`,handoffUnable:`无法完成`,handoffDoneHelp:`已执行操作,接下来由模型验证结果。`,handoffUnableHelp:`未能完成,可以补充遇到的障碍。`,handoffReview:`复核状态`,handoffSubmit:`提交状态`,handoffSignal:`预期结果:`,handoffVerify:`提交完成后,模型仍需验证结果;你的反馈本身不代表验证成功。`,planCardLabel:`开发计划`,planCardReady:`计划已就绪`,planCardResult:`计划结果`,planCardNotApproval:`此步骤仅生成计划,不代表已批准或开始实施。`,planCardCollapse:`收起`,planCardExpand:`展开`,planCardCopy:`复制计划`,planCardCopyPreview:`复制可见预览`,planCardTruncated:`当前仅显示截断预览。`,planCardLoadFull:`加载完整计划`,planCardLoadingFull:`正在加载计划...`,planCardLoadFailed:`无法加载完整计划,重试`,planCardEvidence:`工具结果 · plan_ready`,questionWaiting:`问题`,questionPreview:`查看预览`,questionSkip:`跳过`,questionProgress:`{{current}} / {{total}}`,questionReview:`复核答案`,questionReviewTitle:`确认这些选择?`,questionReviewHelp:`可以返回修改,点击提交后才会发送给助手。`,questionEdit:`修改答案:{{question}}`,questionDismiss:`关闭提问,不提交答案`,questionCustom:`或自行撰写回复`,questionCustomHelp:`留空提交,表示希望助手把问题说清楚或拆小。`,questionYourAnswer:`你的答案`,questionCustomPlaceholder:`说说你的想法…`,questionNotes:`补充说明(选填)`,questionNotesPlaceholder:`补充限制条件,或解释你的选择…`,questionRephrase:`请助手把问题说清楚或拆小`,questionBack:`上一步`,questionNext:`下一题`,questionSubmit:`提交答案`,questionSubmitting:`正在提交…`,questionRetry:`核对提交结果`,questionUncertain:`暂时无法确认是否送达,已保留本次提交的答案。点击核对可恢复结果,不会重复提交。`,questionDisconnected:`正在重新连接… 已保留你的选择,暂时无法提交。`,questionLimit:`每项答案或补充说明不能超过 {{count}} 个 UTF-8 字节。`,questionLoadFailed:`暂时无法读取等待回答的问题。`,questionDraftLimit:`提问草稿已达上限,请缩短或清空已有答案后再添加内容。`,questionRetryLoad:`重试`,questionCloseReceipt:`关闭问答状态提示`,questionState_dismissed:`已关闭提问,没有提交答案。`,questionState_cancelled:`提问已取消,没有提交答案。`,questionState_expired:`提问已过期,没有提交答案。`,questionState_stale:`该提问已失效,请查看对话中的处理结果。`,conversationView:`会话视图`,jumpToLatest:`跳至最新`,historyLoading:`正在加载历史…`,historyOmitted:`还有 {{count}} 条较早记录 · 向上滚动自动加载`,historyChanged:`会话分支已更改,已切换到当前分支的历史。`,historyUnavailable:`历史记录加载失败,请重试。`,historyValidationUnavailable:`无法校验会话历史,请重试。`,historyVerifying:`正在校验会话历史…`,messageLoadFull:`加载完整消息`,messageLoadMore:`加载更多`,messageLoadingFull:`正在加载消息…`,messageLoadFailed:`无法加载这条消息,重试`,filePreview:`文件预览`,changeEvidence:`变更`,changeEvidenceScope:`按所选范围查看当前工作目录的只读 Git 变更。`,turnLabel:`第 {{number}} 轮`,turnState_running:`运行中`,turnState_complete:`已完成`,turnState_failed:`失败`,turnState_interrupted:`已中断`,turnState_waiting:`等待回复`,turnState_forked:`已分叉,可继续对话`,turnChanges:`本轮更改 {{count}} 个文件`,turnChangesPartial:`本轮已记录 {{count}} 个文件`,turnChangesIncomplete:`这一轮的变更记录不完整。`,turnChangesMore:`再显示 {{count}} 个文件`,turnChangesLess:`收起文件`,turnChangesReview:`审阅本轮变更`,turnChangesReviewButton:`审阅`,turnChangesBack:`返回本轮变更`,turnChangesLoading:`正在加载本轮变更…`,turnChangesUnavailable:`无法读取本轮保存的差异。`,messageCopyRequiresFull:`加载完整消息后才能复制。`,filesChanged:`{{count}} 个文件已更改`,reviewChanges:`查看变更`,workspaceChanges:`工作区更改`,overviewChanges:`变更`,overviewLineTotals:`当前 Git 比较范围内的文本新增与删除行数`,overviewPartialTotals:`仅展示已核实的行数,部分文件尚无法统计。点击变更查看详情。`,overviewCounting:`统计中…`,overviewCountsUnknown:`行数未知`,overviewReviewUnavailable:`暂不可用`,sessionSources:`来源`,sourcesAdd:`添加来源`,sourcesDescription:`查看此对话附加的图片与文件`,sourceAttached:`已附加到对话`,sourcesEmpty:`暂无来源`,sourcesFailed:`来源加载失败。`,sourcesViewAll:`查看全部`,sourcesLoadMore:`加载更多来源`,sourcesBack:`返回来源列表`,sourcesPartial:`已达到列表展示上限,更早的来源仍可在对话中查看。`,turnChangesScope:`该轮开始至结束的工作区差异 · 已保存`,turnEdits:`已编辑 {{count}} 个文件`,turnEditsPartial:`已记录 {{count}} 个文件的编辑`,turnEditsScope:`本轮文件工具写入记录 · 已保存;不含命令行与外部修改`,turnEditStatsUnknown:`行数未知`,turnEditReason_before_unavailable:`文件已写入,但该操作未授权读取旧内容,无法提供可靠的前后差异。`,turnEditReason_content_limit:`文件已写入,内容超过已保存对比的大小限制,无法提供准确行数。`,turnEditReason_concurrent_change:`文件在已记录的操作之间发生了变化,无法确认本轮净增删行数。`,gitReviewLoadedCount:`已载入 {{count}} 个文件`,gitReviewPartialLabel:`部分`,gitReviewSearch:`搜索文件路径`,gitReviewExpand:`展开审阅`,gitReviewSearchLoaded:`搜索已载入文件`,gitReviewMarkViewed:`标记 {{path}} 为已查看`,gitReviewMarkCurrentViewed:`标记当前文件 {{path}} 为已查看`,gitReviewViewedLabel:`已查看`,gitReviewViewedProgress:`已查看 {{viewed}} / 已加载 {{loaded}} 个文件`,gitReviewViewedLimit:`本次对比最多保留 {{count}} 个已查看标记。`,gitReviewNoMatch:`没有匹配的文件。`,gitReviewNoLoadedMatch:`已载入文件中没有匹配项。`,gitReviewLoadNext:`载入下一批文件`,gitReviewChanged:`工作区已有变化,请刷新清单后继续载入。`,gitReviewNewVersion:`有新的更改,当前仍显示你正在阅读的版本。`,gitReviewShowLatest:`查看最新差异`,gitReviewBinary:`此二进制文件无法显示文本差异。`,gitReviewBinaryShort:`二进制`,gitReviewPendingStats:`待读取`,gitReviewComparison:`{{current}} 对比 {{base}}`,gitReviewWorkingTree:`工作区对比 HEAD`,gitReviewSessionSnapshot:`自本会话开始后的变更`,gitReviewDetached:`游离 HEAD`,gitReviewLoading:`正在读取 Git 变更…`,gitReviewRetry:`重试`,gitReviewRefresh:`刷新变更`,gitReviewOlderResult:`当前显示上一次读取结果。`,gitReviewNotRepository:`此工作区不是 Git 仓库。`,gitReviewUnborn:`此仓库还没有可读取的 HEAD。`,gitReviewFailed:`无法读取 Git 变更。`,gitReviewTruncated:`结果不完整,部分文件或差异未载入。`,gitReviewEmpty:`当前范围内没有文件变更。`,gitReviewHiddenLines:`另有 {{count}} 行 diff 未显示。`,gitReviewDiffTruncated:`快照已达到大小上限,未加载此文件的 diff。`,gitReviewShowMore:`再显示 {{count}} 个文件`,gitReviewBackToFiles:`返回变更文件`,gitReviewFilePreview:`{{file}} 的差异`,gitReviewNoDiff:`此文件没有可显示的文本差异。`,changeDiff:`变更差异`,diffViewMode:`差异视图`,diffUnified:`统一`,diffSplit:`并排`,diffBefore:`修改前`,diffAfter:`修改后`,diffView:`差异`,gitFileStatus_added:`已新增`,gitFileStatus_modified:`已修改`,gitFileStatus_deleted:`已删除`,gitFileStatus_renamed:`已重命名`,gitFileStatus_copied:`已复制`,gitFileStatus_untracked:`未跟踪`,gitFileStatus_unknown:`已变更`,closePreview:`关闭预览`,imageZoom:`图片缩放`,imageZoomHelp:`缩放相对于适应窗口。Ctrl + 滚轮缩放,放大后可拖动查看。`,zoomIn:`放大图片`,zoomOut:`缩小图片`,previousImage:`上一张图片`,nextImage:`下一张图片`,imagePosition:`第 {{current}} 张,共 {{total}} 张图片`,artifactReadOnly:`只读`,artifactReferenceUnavailable:`此视图无法打开文件预览:{{path}}`,artifactSession:`所属会话 {{sessionId}}`,copyFilePath:`复制文件路径`,filePathCopied:`已复制文件路径`,refreshFile:`刷新文件`,downloadFile:`下载文件`,downloadingFile:`正在下载…`,artifactOlderPreview:`当前显示旧版预览。`,readingFile:`正在读取文件…`,artifactVersion:`版本`,artifactBytes:`{{count}} 字节`,artifactPreviewTruncated:`预览已截断;下载文件可获取完整内容。`,artifactUnsupported:`此类型无法预览,请下载文件。`,filesLargeMarkdownSource:`Markdown 预览较大,已显示为源码以保持滚动流畅。已加载的文字全部保留。`,chatView:`对话`,trajectory:`执行轨迹`,trajectoryScope:`按记录顺序展示会话消息,不表示执行耗时,也不是完整模型请求。`,trajectoryRunning:`任务仍在进行。已保存记录到达后自动更新;实时生成内容可在“对话”中查看。`,trajectoryTruncated:`当前历史不完整:省略 {{entries}} 条记录、{{parts}} 个内容片段,{{messages}} 条消息被截断。`,trajectoryEmpty:`尚无已保存记录。`,trajectoryOrder:`记录顺序`,trajectoryOverview:`总览`,trajectorySequenceHint:`按记录顺序排列 · 宽度不表示执行耗时`,trajectoryClearRange:`清除选区`,trajectoryContextLane:`上下文`,trajectoryModelLane:`模型`,trajectoryToolLane:`工具`,trajectorySelectRecord:`选择记录 {{number}}:{{name}}`,trajectoryTimingTab:`时间`,trajectoryUsageTab:`用量`,trajectoryDurationLabel:`耗时`,trajectoryTimingSource:`数据来源`,trajectoryTimingUnknown:`尚未记录执行耗时。保存时间不等于操作开始时间。`,trajectoryTimingNative:`Pi 嵌套工具执行记录`,trajectoryTTFT:`首段输出等待`,trajectoryGenerationTime:`生成时间`,trajectoryThroughput:`每秒输出 tokens`,trajectoryNotRecorded:`未记录`,trajectoryUsageUnknown:`已加载记录中没有此响应的 token 用量。`,trajectoryUsage_input:`未缓存输入`,trajectoryUsage_cacheRead:`缓存读取`,trajectoryUsage_cacheWrite:`缓存写入`,trajectoryUsage_output:`输出`,trajectoryProvider:`提供商`,trajectoryModel:`模型`,trajectoryCode:`代码`,trajectoryWrap:`自动换行`,trajectoryCopy:`复制原文`,trajectoryCopied:`已复制`,trajectoryRawArguments:`原始 JSON`,trajectoryFoldTurns:`回合`,trajectoryFoldCalls:`工具调用`,trajectoryMetrics:`已加载执行摘要`,trajectoryRequestCount:`{{count}} 次模型响应`,trajectoryToolCount:`{{count}} 次工具调用`,trajectoryModelResponses:`模型响应`,trajectoryToolCalls:`工具调用`,trajectoryLastTurn:`最近已记录回合`,trajectoryEventColumn:`事件`,trajectoryContentColumn:`内容`,trajectoryTurn:`回合 {{number}}`,trajectoryLoadHistory:`加载更早历史`,trajectoryLatestRecords:`回到最新记录`,trajectoryHistoryLoading:`正在加载历史…`,trajectoryNestedOutputMissing:`Pi 已记录此嵌套调用的状态,但未保存其结果正文。外层脚本输出单独保留。`,trajectoryRecordCount:`{{count}} 条记录`,trajectoryMatches:`{{count}} 条匹配`,trajectorySearch:`搜索已加载记录`,trajectoryNoMatches:`没有匹配的记录。`,trajectoryEarlierGroup:`较早上下文`,trajectoryEventCount:`{{count}} 条会话变更`,trajectorySummary:`概览`,trajectoryInputTab:`输入`,trajectoryResultTab:`结果`,trajectoryConversationGroup:`本轮对话`,trajectoryReasoningTitle:`思考`,trajectoryRecordNumber:`记录 {{number}}`,trajectoryRecordInfo:`记录信息`,trajectoryRecordId:`记录 ID`,trajectoryCallId:`工具调用 ID`,trajectoryEventType:`事件类型`,trajectoryEvent_model_change:`切换模型`,trajectoryEvent_thinking_level_change:`调整思考级别`,trajectoryEvent_compaction:`压缩上下文`,trajectoryEvent_session_info:`更新会话信息`,trajectoryEvent_custom:`会话记录`,trajectoryEarlier:`显示更早记录(已加载历史中还有 {{count}} 条)`,trajectoryDetails:`记录详情`,trajectoryRecordedAt:`记录时间`,trajectoryEvidenceTruncated:`此证据在会话投影中已被截断。`,trajectoryArguments:`工具参数`,trajectoryRecordedContent:`已记录内容`,trajectoryThinking:`模型返回的推理内容`,trajectoryOutput:`工具结果`,trajectoryMissingResult:`当前记录中没有可明确配对的结果。这不表示工具仍在运行。`,trajectoryStructured:`结构化结果`,trajectoryEventOnly:`当前仅提供此事件的类型和记录时间。`,trajectory_user:`用户消息`,trajectory_assistant:`助手回复`,trajectory_call:`工具调用`,trajectory_result:`未配对结果`,trajectory_event:`会话事件`,trajectoryRole_user:`用户`,trajectoryRole_assistant:`助手`,trajectoryRole_call:`工具`,trajectoryRole_result:`结果`,trajectoryRole_event:`事件`,trajectory_returned:`工具已返回结果。`,trajectory_error:`工具返回错误`,trajectory_unknown:`尚无法确定结果`,runtimeStatus:`运行状态`,runtimeIdentity:`OpenPI 运行信息`,runtimeIdentityHint:`后端信息在启动时采样,不随之后的磁盘改动或会话重新加载更新,也不证明所有模块的加载版本。前端标识对应当前页面构建。`,runtimeIdentityFailed:`无法读取后端运行信息,请重试。`,runtimeBackendVersion:`后端包版本`,runtimePackageRoot:`后端包目录`,runtimeStartedAt:`进程启动时间`,runtimeGitRevision:`启动时 Git 提交`,runtimeGitState:`启动时工作区状态`,runtimeGitDirty:`存在本地改动`,runtimeGitClean:`干净`,runtimeFrontendVersion:`页面包版本`,runtimeFrontendBuild:`页面构建标识`,runtimeStartupBuild:`后端启动时记录的页面构建标识`,runtimeDevelopmentBuild:`开发服务器(无生产构建标识)`,runtimeBuildMismatch:`当前页面构建与后端启动时记录的构建不同。请刷新页面或重启服务后重新检查。`,refreshStatus:`刷新状态`,openTools:`打开工具`,openToolsUnavailable:`选择会话后可打开工具`,sideConversation:`侧边对话`,sideConversationDescription:`在独立 Pi 会话中追问具体问题,不打断当前主任务。`,workbarChangesDescription:`查看当前目录的未暂存、已暂存、分支或会话变更。`,terminal:`终端`,renameTerminal:`重命名终端`,terminalName:`终端名称`,workbarTerminalDescription:`打开当前工作区的交互式终端。`,restartTerminal:`重新启动终端`,reconnectTerminal:`重新连接终端`,restartTerminalTitle:`重新启动此终端?`,restartTerminalDetail:`当前终端会被关闭,其中运行的进程可能被中断。`,terminalReconnecting:`正在重新连接终端...`,terminalScrollToBottom:`回到底部`,terminalOutputResynced:`终端输出已重新同步`,terminalRestarting:`正在重新启动终端...`,terminalConnecting:`正在启动终端…`,terminalExited:`终端已退出。`,terminalExitCode:`终端已退出,状态码 {{code}}。`,terminalDisconnected:`终端连接意外中断。`,terminalError:`终端不可用。`,terminalLoadError:`终端界面加载失败,请刷新页面后重试。`,reloadPage:`刷新页面`,browser:`浏览器`,sessionFileRecords:`本会话文件记录`,gitReviewSource:`变更范围`,gitReviewBaseBranch:`对比分支`,gitReviewChooseBase:`选择对比分支`,gitReviewSearchBranches:`搜索分支`,gitReviewLocalBranch:`本地分支`,gitReviewRemoteBranch:`远程分支`,gitReviewBranchesTruncated:`显示有数量限制的分支列表,部分分支已省略。`,gitReviewNoMatchingBranches:`没有匹配的分支。`,gitReviewBaseUnavailable:`没有可用的默认对比分支。请选择分支以审阅已提交的变更。`,gitReviewBaseInvalid:`所选对比分支已不可用,请选择其他分支。`,gitReviewUnstaged:`未暂存(含未跟踪)`,gitReviewStaged:`已暂存变更`,gitReviewBranch:`分支变更`,gitReviewFileMissing:`此文件在当前范围内已无变更,请刷新文件列表。`,artifactExternalAccess:`此文件位于其他工作目录。可为当前会话授权只读打开这一个文件,不会开放其他文件的访问。`,artifactAuthorizeFile:`只读打开此文件`,sideConversationPending:`正在准备侧边会话…`,resizeSidebar:`调整侧边栏宽度`,resizePanes:`调整面板宽度`,resizeWorkbar:`调整工具栏宽度`,browserPasteTooLarge:`每次最多粘贴 {{count}} 个字符。`,browserInputTooLarge:`每次最多输入 {{count}} 个字符。`,browserInputTargetChanged:`输入目标已变化或无法确认,有输入操作未执行。`,workbarBrowserDescription:`在 OpenPI 工作栏内打开并操作网页。`,browserReady:`输入地址开始浏览`,browserStarting:`正在启动内嵌浏览器…`,browserOpened:`已在内嵌浏览器中打开`,browserOpenAgain:`再次打开`,browserOpenFailed:`内嵌浏览器暂不可用。`,browserBack:`后退`,browserForward:`前进`,browserReload:`重新加载`,browserTabs:`网页标签页`,browserNewTab:`新标签页`,browserAddTab:`新建网页标签页`,browserCloseTab:`关闭 {{title}}`,browserTabLimit:`最多打开 {{count}} 个网页标签页`,browserPageTitle:`网页:{{address}}`,browserEnteredAddress:`最近从此地址栏打开的地址`,browserAddressNotAllowed:`请输入不含用户名或密码、且不属于 OpenPI 自身地址的 HTTP(S) 网址。`,browserLocationUnknown:`网页已跳转,新地址无法读取。重新加载会返回你输入的地址。`,browserDirectDescription:`直接浏览网页。不允许嵌入的网站可在外部浏览器打开。`,browserDirectHint:`地址栏仅记录手动打开的地址。网页弹窗在外部浏览器打开;遇到空白页,可点击外部打开。`,browserEnhancedHint:`浏览增强已开启:地址自动同步,普通弹窗链接在内部标签页打开。部分站点限制、登录弹窗和跨站历史仍需外部浏览器。`,files:`文件`,filesExplorer:`工作区文件`,filesSearch:`筛选文件…`,refreshFiles:`刷新文件`,filesWorkspaceActions:`工作区文件操作`,filesCreateMenu:`新建`,filesImportMenu:`导入`,filesMoreMenu:`更多`,filesNewFile:`新建文件`,filesNewDirectory:`新建文件夹`,filesImport:`导入文件`,filesImportFolder:`导入文件夹`,filesImportFolderChoose:`选择要导入的文件夹`,filesImportFolderLimit:`每次最多导入 2,000 个文件和文件夹,目录层级最多 64 层。`,filesSelectMultiple:`多选文件`,filesSelectItem:`选择 {{name}}`,filesSelectedCount:`已选 {{count}} 项`,filesRename:`重命名`,filesNewName:`新名称`,filesMove:`移动`,filesMoveDestination:`目标文件夹(工作区内相对路径)`,filesTrashAction:`移入回收站`,filesTrash:`工作区回收站`,filesTrashDetail:`移除的文件保留在当前工作区,可恢复;不会覆盖同名文件。`,filesTrashEmpty:`暂无已移除文件`,filesTrashUnavailable:`{{count}} 项记录无法核验,内容仍保留在 .openpi-trash 中,暂不能自动恢复。`,filesRestore:`恢复`,filesRestoreItem:`恢复 {{name}}`,filesUndoTrash:`撤销移除`,filesOrganizationResults:`文件操作结果`,filesOperationDone:`完成`,filesRefreshBeforeOrganizing:`请先刷新文件树,再整理这项文件。`,filesImportChoose:`选择要导入的文件`,filesTargetDirectory:`目标目录`,filesWorkspaceRoot:`工作区根目录`,filesFileName:`文件名称`,filesDirectoryName:`文件夹名称`,filesCreate:`创建`,filesCreating:`创建中…`,filesCreated:`已创建:{{path}}`,filesNameInvalid:`请输入单个文件或文件夹名称,不要包含路径分隔符。`,filesNameExists:`此名称已存在,请更换名称;原有文件已保留。`,filesMutationFailed:`写入失败,输入已保留。`,filesWriteUnavailable:`请先切换到此会话,再修改工作区文件。`,filesImportLimit:`每个文件最多 50 MiB,同名文件不会覆盖。`,filesImportTooLarge:`此文件超过 50 MiB 导入上限。`,filesImportDirectoryUnsupported:`不支持导入整个文件夹,请选择其中的文件。`,filesImportResults:`文件导入结果`,filesImportPending:`等待导入`,filesImporting:`导入中…`,filesImported:`已保存到工作区`,filesImportedNoPreview:`已保存。预览上限为 20 MiB;可复制路径,在对话中引用此文件。`,filesClearImported:`清除已完成的导入`,filesRetryImport:`重试导入`,filesPathActions:`{{name}} 的路径操作`,filesCopyRelativePath:`复制相对路径`,filesCopyAbsolutePath:`复制绝对路径`,filesPathCopied:`已复制路径:{{path}}`,filesReadFailed:`无法读取文件。`,filesRetryRead:`重试读取`,filesErrorDetails:`错误详情`,filesReadFailedDetail:`文件列表未能加载,请检查连接后重试。`,filesReadDenied:`当前会话的工作区暂不可访问,或无法确认目录身份。请确认会话与工作区后重试。`,filesSymlink:`符号链接,文件浏览器不会自动跟随`,filesTruncated:`结果不完整,请缩小搜索范围。`,filesNoMatches:`没有匹配的文件`,filesEmpty:`此文件夹为空`,filesChoose:`选择文件进行预览`,filesChooseDetail:`从右侧浏览工作区文件,在这里直接预览。`,filesHideTree:`收起文件树`,filesShowTree:`显示文件树`,filesPreview:`预览`,filesSource:`查看源代码`,filesEdit:`编辑`,filesMode:`文件视图`,filesEditor:`文件编辑器`,filesSave:`保存文件`,filesSaving:`保存中…`,filesSaved:`已保存`,filesUnsaved:`未保存的修改 · 草稿保留在当前窗口`,filesDiscard:`放弃草稿`,filesDiscardConfirm:`放弃此文件尚未保存的修改?`,filesSaveConflict:`磁盘上的文件已改变,编辑草稿已保留。请刷新查看最新内容,核对修改后再保存。`,filesSaveFailed:`保存失败,编辑草稿已保留。请检查文件后重试。`,filesEditLoadFirst:`请先继续读取完整文件,再编辑。`,filesEditUnavailable:`支持编辑工作区内不超过 1 MiB 的 UTF-8 文本,最多保留 16 份未保存草稿。`,filesOutline:`章节目录`,filesDiskVersion:`查看当前磁盘版本`,filesReconcile:`已核对,保留草稿并基于此版本继续编辑`,filesTable:`表格预览`,filesRow:`行`,filesSheets:`工作表`,filesTableTruncated:`当前仅显示部分表格内容;下载原文件可查看完整内容。`,filesOfficeLayout:`文档内容预览;分页和排版可能与 Office 不同。`,filesSlidesLayout:`幻灯片文字与图片预览;主题、图表和动画可能与 PowerPoint 不同。`,filesPreviousPage:`上一页`,filesNextPage:`下一页`,filesZoomOut:`缩小`,filesZoomIn:`放大`,filesZoomReset:`重置缩放`,filesPdfPage:`第 {{page}} 页`,filesDocumentLimit:`此文档超出预览处理范围,请下载后在本地打开。`,filesPreviewFailed:`无法预览此文件,仍可下载后打开。`,filesDiagram:`Mermaid 图表`,filesDiagramLoadError:`图表预览加载失败,已显示源码。刷新页面后可重试。`,filesExpandDiagram:`放大图表`,filesFitImage:`适应宽度`,filesOriginalImage:`原始尺寸`,filesLoadMore:`加载更多`,filesLoaded:`已加载 {{count}} 项`,filesReadMore:`继续读取`,filesContentChanged:`文件已更新。当前阅读内容已保留,可在准备好后刷新。`,workbarFilesDescription:`浏览工作区文件,在文件树旁直接预览。`,backToSideConversations:`返回侧边对话`,continueSideConversation:`继续追问…`,startSideConversation:`提出一个侧边问题…`,sideConversationModelInherited:`新侧边对话使用主会话的模型与思考等级。`,sideConversationModelFixed:`这是当前侧边对话使用的模型。`,stop:`停止`,start:`开始`,browserAddress:`浏览器地址`,browserGo:`打开地址`,openExternalBrowser:`在外部浏览器打开`,invalidBrowserAddress:`请输入有效的 HTTP 或 HTTPS 地址。`,addImages:`添加图片`,addFiles:`添加文件`,fileAttachments:`文件附件`,previewFileAttachment:`预览文件`,fileAttachmentDescription:`文档、表格、PDF、文本、代码及其他文件`,fileAttachmentCount:`最多可添加 {{count}} 个附件。`,fileAttachmentTooLarge:`文件总大小不能超过 50 MB。`,fileAttachmentReadFailed:`无法读取此文件,请检查格式或是否有密码保护。`,fileAttachmentTextReady:`文本已就绪`,fileAttachmentTextTruncated:`部分文本 · 保留原文件`,fileAttachmentOriginalReady:`原文件已就绪`,fileAttachmentExtractionFailed:`未提取文本 · 原文件保留`,fileAttachmentEncodingUnavailable:`无法读取文本编码,原文件字节已保留。`,fileAttachmentDocumentUnavailable:`无法提取文本。文件可能受密码保护或格式暂不支持,原文件字节已保留。`,fileAttachmentNoText:`发送后,代理可通过工具读取原文件;此文件未提取出文本。`,fileAttachmentPreviewTruncated:`预览显示前 20,000 个字符,发送时会附上全部已提取文本。`,fileAttachmentExtractedContent:`已提取文本`,fileAttachmentPromptLabel:`用户提供的文件:`,fileAttachmentPromptTooLong:`消息和文件引用超过输入限制,请缩短消息或减少附件。`,imageAttachmentDescription:`支持 PNG、JPEG、GIF 或 WebP`,imageAttachments:`图片附件`,imageAttachmentsLoading:`正在准备附件…`,commandOpensPanel:`打开面板`,commandPanelArguments:`此命令用于打开面板,不能携带参数或图片。请移除后重试,或直接使用对应面板。`,commandPanelUnavailable:`未能打开面板,已保留命令。`,commandUnavailable_terminal_only:`需要在 Pi 终端界面中使用。`,commandUnavailable_not_integrated:`此扩展命令尚未接入 Web,请在 Pi 终端中使用。`,artifactImagePreviewFailed:`图片预览失败。请刷新文件重试,或下载后查看。`,artifactFileDetails:`文件信息`,turnElapsedRunning:`正在处理 · {{duration}}`,compactionElapsed:`已等待 {{duration}}`,compactionRunning:`正在压缩上下文`,compactionCompleted:`上下文已自动压缩`,compactionFailed:`上下文压缩失败`,compactionInterrupted:`压缩已中断`,compactionUnchanged:`压缩已结束,未生成新的摘要`,compactionUnavailable:`上下文压缩状态暂不可用`,compactionReconnectHelp:`连接已中断,恢复连接后将核实当前状态。`,compactionDraftHelp:`正在压缩上下文,发送的消息会排队等待。`,turnElapsedFinished:`用时 {{duration}}`,composerAdd:`添加`,composerCommands:`指令`,composerFile:`文件`,composerPlan:`计划`,composerCompact:`压缩`,composerModel:`模型`,composerBack:`返回`,composerPlanDescription:`进入或退出计划模式`,composerCompactDescription:`整理之前的对话,释放上下文空间`,composerModelDescription:`选择本会话使用的模型`,compactionQueueWaiting:`等待压缩完成`,compactionQueueBlocked:`消息已保留,可重试或清空队列。`,clearPromptQueue:`取消排队`,queueUpdateFailed:`未能更新队列,请确认当前会话后重试。`,queueStatusUnconfirmed:`请求已接收,但暂时无法确认最新队列状态。请刷新后再操作。`,turnElapsedOutcome_cancelled:`已停止`,turnElapsedOutcome_failed:`失败`,turnElapsedOutcome_uncertain:`结果待确认`,settingsSetupBusyHint:`Agent 配置需等待当前轮次结束;显示设置可直接调整。`,resetChatContentWidth:`恢复默认聊天宽度`,resetChatFontSize:`恢复默认字体大小`,setupResolveAdmission:`请先返回对话,处理尚未确认的消息,再应用设置。`,removeAttachment:`移除附件`,dropImagesHere:`将文件或图片拖到这里`,imageAttachmentCount:`最多可添加 {{count}} 张图片。`,imageAttachmentTooLarge:`单张图片不能超过 10 MB。`,imageAttachmentTotalTooLarge:`图片总大小不能超过 32 MB。`,imageAttachmentUnsupported:`仅支持有效的 PNG、JPEG、GIF 和 WebP 图片。`,imageAttachmentReadFailed:`无法读取此图片,请重新添加重试;消息内容已保留。`,attachedImage:`已附加图片`,previewAttachment:`预览图片`,closeImagePreview:`关闭图片预览`,imagePreviewFailed:`无法显示这张图片。`,fitImage:`适应窗口`,originalImageSize:`原始尺寸`,imageViewMode:`图片查看`,sessionUsage:`会话 Token 用量`,sessionInputTokens:`输入 Token`,sessionOutputTokens:`输出 Token`,sessionCacheTokens:`缓存 Token`,sessionContextUsage:`上下文占用与窗口大小`,usageContextLabel:`上下文`,usageUnknown:`未知`,usageOpenDetails:`输入 {{input}} · 输出 {{output}} · 上下文 {{percent}} / {{capacity}} · 查看会话用量`,usageContextHelp:`当前分支的估算占用 / 模型上下文容量上限。`,usageSessionTotals:`累计用量`,usageInputLabel:`输入`,usageOutputLabel:`输出`,usageCacheReadLabel:`缓存读取`,usageCacheWriteLabel:`缓存写入`,usageTotalLabel:`总计`,usageWorkspaceLabel:`工作区`,usageSessionId:`会话 ID`,usageTotalsHelp:`本会话累计 Token 用量,包含缓存。`,subagentDetails:`子代理`,sessionOverview:`会话概览`,sessionOverviewChanges:`当前审阅范围的更改`,subagentSummaryRunning:`{{count}} 运行中`,subagentSummaryDone:`{{count}} 完成`,subagentSummaryOther:`{{count}} 其他记录`,subagentNoneYet:`暂无子代理`,subagentOtherGroup:`失败 / 已中断`,subagentShowMore:`再显示 {{count}} 个`,backToSubagents:`返回子代理列表`,subagentActiveGroup:`已开启`,subagentFinishedGroup:`完成`,subagentNoneRunning:`暂无正在运行的子代理。`,subagentNoneFinished:`任务结束后会显示在这里。`,subagentProgress:`子代理:{{running}} 运行中 · {{completed}} 已完成`,subagentSummaryUnknown:`{{count}} 个状态未确认`,subagentTasks:`子代理任务列表`,inspectSubagent:`打开子代理:{{name}}`,subagentState_running:`运行中`,subagentProcessing:`处理中`,subagentState_done:`已完成`,subagentState_error:`失败`,subagentState_interrupted:`已中断`,subagentStarting:`正在启动…`,subagentSpawnFailed:`启动失败`,subagentStateUnavailable:`已启动 · 状态未保留`,subagentSpawnReceipt:`启动回执`,subagentSpawnReceiptHint:`此回执仅确认启动请求,不表示子代理任务已完成。`,subagentTask:`分配的任务`,subagentTranscript:`子代理对话`,subagentResult:`执行结果`,subagentSpend:`累计 token 消耗`,subagentSaved:`已保存记录`,subagentRecordedState:`最后记录的状态`,subagentSavedHint:`来自当前父会话已保存的回执;结果可能包含同批其他任务,并非子代理的完整实时对话。`,subagentReadOnly:`只读查看 · 关闭此面板不会停止任务`,subagentUnavailable:`当前会话已无法提供此子代理的实时详情。启动回执不代表任务已完成。`,subagentStale:`刷新失败,下方保留的是上次收到的状态。`,subagentNoMessages:`暂未收到消息。`,subagentTranscriptUnavailable:`此视图仅保留任务摘要,无法显示完整子代理对话。`,subagentWorkflowsTruncated:`另有 {{count}} 个 workflow 未包含在当前列表中,其任务数量未知。`,subagentState_unknown:`未确认`,subagentUnconfirmedGroup:`未确认`,subagentTruncated:`当前显示最近的消息,另有 {{count}} 条较早消息未包含在此视图中。`,subagentTextTruncated:`部分较长内容仅显示节选。`,subagentListTruncated:`另有 {{count}} 个任务未包含在当前列表中。`,subagentThinkingRedacted:`服务商已隐藏此段思考内容。`,inspectionChanged:`当前会话已切换,请重新打开详情。`,inspectionUnavailable:`暂时无法读取详情。`,inspectionLoading:`正在读取状态…`,thinkingUnavailable:`暂时无法读取思考等级。`,trustUnavailable:`暂时无法读取项目信任状态。`,copySetupCommand:`复制配置命令`,savedTrustDecision:`已保存决定`,activeSessionTrust:`当前会话信任`,trustDecision_trusted:`已信任`,trustDecision_denied:`已拒绝`,trustDecision_undecided:`未决定`,trustDecision_unknown:`未知`,trustActiveYes:`当前会话已信任`,trustActiveNo:`当前会话未信任`,modelAndThinking:`模型与思考`,selectedModel:`当前模型`,thinkingLevel:`思考等级`,availableThinking:`支持的等级`,unknownState:`未知`,projectTrust:`项目信任`,trust_trusted:`当前会话信任此工作区。`,trust_untrusted:`此工作区的信任已被拒绝。`,trust_restricted:`项目资源受到限制,等待信任决定。`,trust_unknown:`尚无法确定信任状态。`,trustRefreshNeeded:`保存的信任决定与当前会话不同,请通过 Pi 刷新会话后生效。`,providerAvailability:`服务商凭据`,settings:`设置`,settingsNavigation:`设置导航`,generalSettings:`常规`,configurationSettings:`配置`,configurationIntro:`配置工具权限、网络访问与模型响应。`,configurationReadFailure:`无法安全读取配置。请修复设置文件后刷新。`,configurationUserScope:`用户配置`,configurationSetupHint:`响应与搜索选项通过 OpenPI setup 应用`,configurationApproval:`批准策略`,configurationApprovalDetail:`工具审批沿用已安装 Pi 扩展的权限机制。`,configurationPiPermissions:`由 Pi 扩展管理`,configurationSandbox:`沙箱设置`,configurationSandboxDetail:`工具使用宿主进程的权限运行。`,configurationSandboxUnavailable:`未提供 OS 沙箱`,configurationSearchDetail:`允许当前会话模型在支持时访问网络。`,configurationSearchOff:`不向当前模型提供原生搜索。`,configurationSearchOn:`在当前连接支持时允许原生搜索。`,configurationVerbosity:`输出详细程度`,configurationVerbosityDetail:`选择模型回复包含细节的详细程度。`,configurationResponsesUnavailable:`当前连接未使用支持的 Responses 接口。`,configurationVerbosity_default:`模型默认`,configurationVerbosity_low:`简短`,configurationVerbosity_medium:`适中`,configurationVerbosity_high:`详细`,configurationVerbosityHelp_low:`简短直接地回答,减少额外细节。`,configurationVerbosityHelp_medium:`给出必要解释与适量细节。`,configurationVerbosityHelp_high:`提供更完整的解释与细节。`,configurationVerbosityRequest:`只把 response_verbosity 设为 {{value}},保留其他 OpenPI 配置。`,configurationSummary:`推理摘要`,configurationSummaryDetail:`选择向支持的推理模型请求哪种摘要。`,configurationSummaryUnavailable:`当前连接不支持推理摘要。`,configurationSummary_default:`模型默认`,configurationSummary_auto:`自动`,configurationSummary_concise:`简洁`,configurationSummary_detailed:`详细`,configurationSummary_none:`关闭`,configurationSummaryHelp_auto:`由模型自动选择摘要长度。`,configurationSummaryHelp_concise:`请求简洁的推理摘要。`,configurationSummaryHelp_detailed:`请求较详细的推理摘要。`,configurationSummaryHelp_none:`不请求推理摘要;保留当前推理强度。`,configurationSummaryRequest:`只把 response_reasoning_summary 设为 {{value}},保留其他 OpenPI 配置。`,configurationModelFeatures:`模型功能`,configurationReasoningLevels:`可用推理强度`,configurationReasoningDetail:`选择在模型控件中显示哪些级别。控件只显示当前模型支持的档位,当前档位始终保留。`,configurationReasoningCount:`已选择 {{count}} 个`,configurationDependencies:`工作空间依赖项`,configurationEnvironment:`本地运行环境`,configurationEnvironmentDetail:`Node.js、Python 等工具由当前环境提供。OpenPI 不安装捆绑的工作空间运行时。`,configurationRuntimeStatus:`运行状态`,browserSettings:`浏览器`,webSearchSettings:`联网搜索`,webSearchCurrentModel:`当前会话模型`,webSearchNativeDetail:`调用当前模型供应商的原生搜索,复用现有连接和凭据。`,webSearchSupported:`当前连接支持原生搜索。开启后,由模型决定何时联网。`,webSearchUnsupported:`当前连接不支持或尚未确认支持原生搜索,不提供搜索工具,也不会切换到其他供应商。`,webSearchNativeRequest:`开启联网搜索,使用当前会话模型的原生搜索和已有 Pi 凭据。不要切换模型、连接协议或搜索供应商;当前连接不支持或支持情况未知时,不提供搜索工具。`,webSearchIntro:`让模型搜索最新资料,并打开原始网页核实。`,webSearchPackageDetail:`通过可选 Pi 插件提供搜索、网页读取和 PDF 提取。`,webSearchDefaultOff:`默认关闭。可选扩展跟随当前会话模型,无需另填搜索密钥或安装插件。`,webSearchLoaded:`本会话已加载插件`,webSearchNotLoaded:`本会话尚未加载插件`,webSearchSource:`查看插件源码`,webSearchProfile:`搜索设置`,webSearchExa:`Exa — 无需 API 密钥`,webSearchExisting:`保留我已有的搜索偏好`,webSearchProfileHint:`Exa 提供搜索,网页由本机直接读取。已有偏好会原样保留;安装后也可更换搜索服务。`,webSearchEnable:`启用联网搜索…`,webSearchDisable:`关闭联网搜索…`,webSearchConfigure:`更换搜索服务…`,webSearchExaRequest:`启用可选联网搜索,使用 Pi Web Access 和无需 API 密钥的 Exa。让我审阅插件安装确认,保留其他偏好,不要自动重新加载。`,webSearchExistingRequest:`启用可选联网搜索,使用 Pi Web Access,原样保留我已有的搜索偏好。让我审阅插件安装确认,保留其他偏好,不要自动重新加载。`,webSearchDisableRequest:`关闭原生联网搜索。保留其他设置和会话记录。`,webSearchProviderRequest:`帮我更换已安装 Pi Web Access 插件的搜索服务。介绍可用服务与权限,保留无关偏好,密钥留在搜索插件中,不要自动重新加载。`,browserSettingsIntro:`让 OpenPI 阅读网页、点击、输入和截图。`,browserControl:`浏览器控制`,browserControlHint:`提交设置变更请求,保存配置后生效。`,browserDefault:`默认浏览器`,browserDefaultHint:`提交设置变更请求,选择未指定浏览器时使用的默认项。`,browserEmbedded:`OpenPI 内置浏览器`,browserAllowedTitle:`允许使用的浏览器`,browserOffHint:`下方选择将在开启浏览器控制后生效。`,browserConnected:`已连接`,browserNeedsSetup:`需要连接浏览器扩展`,browserNotFound:`未检测到此浏览器`,browserUpdateNeeded:`需要更新扩展`,browserBlocked:`未授权`,browserDefaultBlocked:`当前默认浏览器未获授权,请允许使用或更换默认值。`,browserSetUp:`设置`,browserManage:`管理`,browserSetupNamed:`设置 {{browser}}`,browserManageNamed:`管理 {{browser}}`,browserAllowNamed:`允许使用 {{browser}}`,browserMore:`更多浏览器`,browserSpeakHint:`对话中说“使用 Chrome …”,即可指定这次使用的浏览器。`,browserGuideTitle:`连接 {{browser}}`,browserGuideEyebrow:`跟着做,一次一步`,browserConnectionTitle:`连接状态`,browserCloseGuide:`收起浏览器设置引导`,browserConnectionReady:`连接正常,可选择是否允许 OpenPI 使用。`,browserEmbeddedDetail:`网页在 OpenPI 内打开。部分网站需要使用普通浏览器才能登录或正常显示。`,browserExternalDetail:`OpenPI 可以使用已连接的 {{browser}} 配置中的现有标签和登录状态。请在该配置中保留一个 OpenPI 标签页。`,browserManageExtension:`管理扩展`,browserAllowUse:`允许 OpenPI 使用`,browserMakeDefault:`设为默认`,browserInstallIn:`安装到`,browserInstallTitle:`安装 OpenPI Browser Bridge`,browserSetupSteps:`设置步骤`,browserGuidePopout:`在独立窗口中跟随操作`,browserGuideDetached:`引导已在独立窗口打开,可以对照浏览器设置逐步完成。`,browserShowGuide:`显示引导窗口`,browserGuideInline:`把引导放回这里`,browserGuideBlocked:`未能打开引导窗口。可允许弹出式窗口后重试,也可继续查看这里的步骤。`,browserSafariSettings:`Safari → 设置`,browserSafariDeveloper:`开发者设置`,browserSafariTemporary:`添加临时扩展…`,browserSafariOpenHint:`打开 Safari 后,在菜单栏选择「Safari → 设置」,对照此引导操作。需要 macOS 上的 Safari 26 或更新版本。`,browserSafariDeveloperTitle:`显示 Safari 开发者设置`,browserSafariDeveloperHint:`在「设置 → 高级」中开启「显示网页开发者功能」,再进入「开发者」标签。`,browserSafariLoadHint:`在「开发者」中点击「添加临时扩展」,选择下方文件夹。启用 OpenPI Browser Bridge,允许访问要控制的网站及本地 OpenPI 页面。退出 Safari 后需重新加载临时扩展。`,browserFirefoxThis:`此 Firefox`,browserFirefoxTemporary:`临时载入附加组件…`,browserFirefoxDeveloperTitle:`选择「此 Firefox」`,browserFirefoxDeveloperHint:`在 about:debugging 左侧选择「此 Firefox」。Firefox 不需要开启「开发者模式」开关。`,browserFirefoxLoadHint:`点击「临时载入附加组件」,选择下方文件夹中的 manifest.json。此安装在 Firefox 重启后失效;永久安装需要经过 Mozilla 签名的扩展包。`,browserFirefoxDone:`已选中,下一步`,browserStepCount:`第 {{step}} 步,共 {{total}} 步`,browserStepLabel:`第 {{step}} 步:{{label}}`,browserStepOpen:`打开扩展页`,browserStepAdd:`添加扩展`,browserStepConnect:`连接`,browserOpenManagerTitle:`打开 {{browser}} 扩展页`,browserOpenManagerHint:`接下来会打开 {{browser}}。在扩展页完成操作后,回到这里继续。`,browserOpenManager:`打开 {{browser}} 扩展页`,browserReopenManager:`重新打开扩展页`,browserAlreadyInstalled:`已经安装?直接连接`,browserDeveloperMode:`开发者模式`,browserDeveloperTitle:`开启「开发者模式」`,browserDeveloperHint:`在扩展页开启「开发者模式」,页面会出现「{{loadLabel}}」按钮。`,browserDeveloperDone:`已开启,下一步`,browserIllustration:`操作示意 · 在 {{browser}} 中完成`,browserExtensions:`扩展程序`,browserLoadUnpacked:`加载未打包的扩展程序`,browserLoadHint:`扩展已准备在本机,按下面的顺序在 {{browser}} 中载入。`,browserCopyLocation:`复制下面的路径`,browserLocateTarget:`找到本机的扩展文件夹`,browserRevealTarget:`定位扩展文件夹`,browserLocateManifest:`找到扩展中的 manifest.json`,browserRevealManifest:`定位 manifest.json`,browserDragToBrowser:`把文件夹拖到 {{browser}} 扩展页`,browserDragFolderHint:`将文件管理器中的 {{folder}} 整个文件夹拖到扩展页,保持「开发者模式」开启。`,browserSelectLocatedTarget:`在浏览器弹出的选择窗口中,选择上一步定位的项目。`,browserManualInstall:`无法拖入?使用路径选择`,browserManualSelection:`找不到?使用路径选择`,browserLoadInBrowser:`在 {{browser}} 点击「{{loadLabel}}」`,browserLoadAlternate:`部分版本显示为「加载已解压的扩展程序」或 Load unpacked。`,browserConfirmFolder:`选择`,browserConfirmFile:`打开`,browserSelectFolderHint:`选择整个文件夹,不要选择里面的 .js 文件。`,browserSelectManifestHint:`只选择 manifest.json,不要选择 .js 文件。`,browserInstallCheckpoint:`在扩展列表看到 OpenPI Browser Bridge 卡片后,再继续连接。`,browserPathCopied:`已复制路径`,browserCopyFailed:`未能复制,请选中上方路径手动复制。`,browserChooseFolderMac:`按 ⌘ ⇧ G,粘贴刚复制的路径并按回车定位,再点击「{{confirm}}」。`,browserChooseFolderOther:`在选择窗口的地址栏粘贴刚复制的路径并回车,再点击「{{confirm}}」。`,browserInstalledConnect:`已添加,连接 OpenPI`,browserPreviousStep:`上一步`,browserWaiting:`等待 OpenPI Browser Bridge 连接,连接后会自动进入下一步。`,browserInstallBrowserFirst:`请先安装 {{browser}},或在已安装的浏览器中打开当前 OpenPI 地址。`,browserConnectTitle:`连接 OpenPI`,browserConnectHint:`在 {{browser}} 中打开 OpenPI,使用刚安装扩展的浏览器配置。`,browserOpenIn:`在 {{browser}} 中打开`,browserAllowHint:`连接成功后,可以允许 OpenPI 使用此浏览器。安装扩展不会自动开启浏览器控制。`,browserCheck:`检查连接`,browserNotConnectedYet:`还未连接。请完成安装,在该浏览器中刷新 OpenPI 后再次检查。`,browserHelp:`设置帮助`,browserReloadHint:`已安装旧版?在扩展页重新加载 OpenPI Browser Bridge,再刷新 OpenPI。如浏览器提示权限,请完成其原生确认。`,browserSupportedHint:`Chrome、Edge、Brave、Chromium 145+ 可控制内置页面及普通标签。macOS Safari 26+、Firefox 128+ 通过兼容扩展控制普通标签,嵌套框架需单独打开。Safari、Firefox 的临时安装需在浏览器重启后重新加载。`,browserCopyPath:`复制路径`,browserOpening:`正在打开浏览器…`,browserLoading:`正在检查浏览器连接…`,browserSaved:`已保存,浏览器权限立即生效。`,browserSaving:`正在处理…`,modelSettings:`模型`,skillsSettings:`技能`,subagentsSettings:`子代理`,pluginsSettings:`插件`,configureOpenPi:`配置 OpenPI`,setupRequestReviewAll:`和我一起检查全部 OpenPI 配置项`,setupRequestSetTheme:`仅将 OpenPI Web 主题设置为 {{value}},其他配置保持不变`,setupRequestSetChatWidth:`仅将 OpenPI Web 聊天内容宽度设置为 {{value}}px,其他配置保持不变`,setupRequestSetChatFontSize:`仅将 OpenPI Web 聊天字体大小设置为 {{value}}px,其他配置保持不变`,setupRequestEnableExpandedThinking:`仅将 OpenPI Web 的思考块改为默认展开,其他配置保持不变`,setupRequestDisableExpandedThinking:`仅将 OpenPI Web 的思考块改为默认折叠,其他配置保持不变`,setupRequestSubagents:`检查并配置 Agent 角色模型和工作流上限`,setupRequestFailed:`OpenPI 配置请求未被接收。`,setupRequestRunning:`正在应用 OpenPI 设置…`,setupRequestAccepted:`配置请求已接收。`,setupPlanBlocked:`Agent 配置需先退出 Plan 模式;显示设置可直接调整。退出不会开始实施计划。`,setupPlanBusy:`Agent 配置需等待当前回合结束并退出 Plan 模式;显示设置可直接调整。`,setupOutcome_pending:`配置请求正在处理,尚未收到保存回执。`,toolCallArguments:`工具参数`,toolCallOutput:`工具结果`,setupOutcome_saved:`OpenPI 配置已保存并应用。`,setupOutcome_unchanged:`配置已保存,实际设置没有变化。`,setupOutcome_failed:`配置请求失败,请查看错误和当前设置后再重试。`,setupOutcome_cancelled:`配置过程已取消,未确认成功保存。`,setupOutcome_unconfirmed:`本次未确认成功保存,请核对当前设置后再运行 /openpi-setup。`,settingsUpdateFailed:`无法保存 Web 显示设置。`,settingsPreferencesSaved:`偏好设置已保存。`,settingsPreferencesSaveFailed:`无法保存显示设置,请检查配置诊断后重试。`,settingsCatalogLoading:`正在加载 Pi 资源…`,settingsCatalogFailed:`无法加载 Pi 设置资源。`,appearance:`外观`,settingsPersonal:`个人`,settingsAgent:`Agent`,settingsIntegrations:`集成`,settingsArchivedChats:`已归档聊天`,settingsSearch:`搜索设置`,settingsClearSearch:`清除搜索`,settingsNoResults:`没有匹配的设置`,appearanceVisualStyle:`视觉风格`,appearanceMode:`模式`,appearanceTheme:`主题`,appearanceAccent:`强调色`,appearanceBackground:`背景`,appearanceForeground:`前景`,appearanceFont:`字体`,appearanceFont_codex:`Codex 默认`,appearanceFont_sans:`无衬线`,appearanceFont_serif:`衬线`,appearanceFont_mono:`等宽`,appearanceAccent0:`默认`,appearanceAccent1:`蓝色`,appearanceAccent2:`紫色`,appearanceAccent3:`粉色`,appearanceAccent4:`橙色`,appearanceAccent5:`绿色`,appearanceCustomAccent:`自定义强调色`,appearanceAdvanced:`高级`,appearanceReset:`恢复默认设置`,appearanceResetAction:`重置外观`,appearanceImport:`导入主题`,appearanceCopy:`复制主题`,appearanceCopied:`主题已复制`,appearanceCopyFailed:`无法复制主题,请重试。`,appearanceThemeValue:`主题数据`,appearanceImportPlaceholder:`粘贴 OpenPI 主题…`,appearanceImportInvalid:`请输入有效的 OpenPI 主题数据。`,appearanceImportAction:`导入`,searchArchivedChats:`搜索已归档聊天`,archiveProjectFilter:`按项目筛选`,archiveAllProjects:`所有项目`,archiveProjectGroup:`{{project}} · {{count}} 条归档聊天`,archiveSort:`归档聊天排序`,archiveSortUpdated:`最近更新`,archiveSortCreated:`创建时间`,restoreArchivedChat:`恢复 {{title}}`,themeLight:`浅色`,themeDark:`深色`,themeMist:`雾青`,themeRose:`蔷薇`,themePine:`松夜`,themeSystem:`跟随系统`,conversationSettings:`对话`,expandThinkingByDefault:`默认展开思考块`,chatContentWidth:`聊天内容宽度`,chatFontSize:`聊天字体大小`,agentBehavior:`Agent 行为`,workflowLimits:`工作流上限`,workflowConcurrency:`工作流并行上限`,workflowCalls:`总调用次数`,agentSettingsSetupHint:`Agent 设置通过当前会话中的 /openpi-setup 生效。`,setupRequestLimits:`将工作流并行上限设置为 {{concurrency}},总子代理调用上限设置为 {{calls}},保留其他配置。`,setupRequestEnableSuggestions:`启用下一步建议。如需模型配置,请帮助我选择模型,保留其他配置。`,setupRequestDisableSuggestions:`关闭下一步建议,保留其他配置。`,setupRequestPostEdit:`帮我配置或关闭编辑后命令。先展示当前配置,再询问要使用的命令。`,configurePostEdit:`配置编辑后命令`,workflowLimitsValue:`并行 {{concurrency}} · 总调用 {{calls}}`,nextActionSuggestions:`下一步建议`,nextActionSuggestionsDetail:`当前任务结束后,提供几个可选择的下一步操作。`,enabled:`已启用`,disabled:`已关闭`,configured:`已配置`,postEditCommand:`编辑后命令`,postEditCommandDetail:`编辑完成后运行一个命令;关闭时不会执行任何命令。`,resultDisplay:`默认结果显示`,subagentResults:`子代理结果`,bashOperations:`Bash 操作`,fileMutations:`Write / Edit 操作`,footer:`页脚`,terminalFooter:`Pi 终端页脚`,terminalFooterStyle:`终端页脚样式`,terminalFooterHint:`影响 Pi 命令行界面的页脚;已打开的 Pi 界面在下次启动或配置应用后更新。`,detailDisplay_full:`完整`,detailDisplay_compact:`紧凑`,sessionSettings:`会话`,currentModel:`当前`,providerCurrentSessionModel:`当前会话使用 {{model}}。`,useThisModel:`使用此模型`,model:`模型`,modelConnection:`模型连接`,provider:`服务商`,modelId:`模型 ID`,providerStatusUnavailable:`此服务商不在当前有界认证快照中。`,providerSettings:`服务商凭据`,providerSettingsIntro:`查看当前 Web 会话可通过哪些 Pi 服务商完成认证。`,openRuntimeDetails:`打开运行详情`,currentWorkspace:`当前工作区`,providerAuth_api_key:`API 密钥`,providerAuth_oauth:`OAuth`,providerAuthUnknown:`未报告认证方式`,authentication:`认证方式`,accessType:`访问方式`,providerAccessSubscription:`订阅账户`,providerAccessStandard:`服务商凭据`,configurationOwner:`配置归属`,providerLoading:`正在加载服务商状态…`,providerLoadFailed:`无法加载服务商状态。`,providerReadOnly:`由 Pi 管理`,selectProvider:`选择服务商`,gitReviewBaselineUnavailable:`未保留可用的会话基线,可能超出了捕获限额。请切换到未暂存、已暂存或分支查看 Git 变更,也可打开本会话文件记录。`,modelsIntro:`登录账户或添加 API 密钥。已有的 Pi 连接也会显示在这里。`,modelConnectionsTitle:`模型连接`,modelConnectionsIntro:`管理连接凭据,选择新会话和当前会话使用的模型。`,accountLoginMethod:`连接方式`,accountLoginTab:`账户登录`,accountLoginChatGPT:`ChatGPT 账户`,accountLoginClaude:`Claude 账户`,accountLoginKeyTab:`API 密钥`,accountLoginConfigured:`账户已登录`,accountLoginIntro:`在浏览器中完成授权,无需填写 API 密钥。`,accountLoginExisting:`账户凭据已保存在 Pi 中。`,accountLoginStart:`登录`,accountLoginAgain:`重新登录`,accountLoginUnsaved:`请先保存或放弃其他修改,再登录账户。`,accountLoginStarting:`正在准备登录…`,accountLoginWaiting:`等待账户授权`,accountLoginChoose:`选择登录方式`,accountLoginCancelling:`正在取消登录…`,accountLoginBrowser:`在浏览器中继续`,accountLoginDevice:`使用设备码登录`,accountLoginBrowserOption:`在当前电脑上登录,完成后自动返回。`,accountLoginDeviceOption:`适合远程服务器,或无法自动返回的情况。`,accountLoginBrowserHelp:`打开登录页并完成授权,这里会自动更新。`,accountLoginDeviceHelp:`打开授权页并输入下方代码,请保持此页面打开。`,accountLoginOpen:`打开登录页`,accountLoginCopyCode:`复制设备码`,accountLoginPaste:`授权码或回调地址`,accountLoginContinue:`继续`,accountLoginFallback:`已登录,但这里没有更新?`,accountLoginRemoteHelp:`如果无法自动返回,请复制浏览器最后的回调地址,并粘贴到下方。`,accountLoginCancel:`取消登录`,accountLogin_failed:`登录未完成,请重试或选择其他登录方式。`,accountLogin_expired:`登录已过期,请重新开始获取新的授权链接。`,accountLogin_cancelled:`已取消登录。`,accountLoginRequestFailed:`请求未完成,请先刷新状态再重试。`,accountLoginStatusUnknown:`暂时无法查询登录状态,账户授权可能仍在进行。`,accountLoginRefreshRequired:`凭据已保存,但 Pi 未能更新模型列表。请重载 Pi 后使用此连接。`,accountLogout:`退出登录`,accountLogoutRefreshRequired:`已移除保存的凭据,但 Pi 未能更新模型列表。请重载 Pi 刷新状态。`,accountLogoutTitle:`退出 {{provider}}?`,accountLogoutDetail:`将移除此电脑上 Pi 保存的该服务凭据,其他使用它的 Pi 会话也需要重新登录。环境凭据不受影响。`,providerInputTypes:`输入类型`,providerInputText:`文本`,providerInputImage:`图片`,providerCustomTag:`自定义`,providerEdit:`编辑`,providerRemove:`删除`,providerSave:`保存`,editProvider:`编辑 {{provider}}`,removeProvider:`删除 {{provider}}`,providerAdd:`添加模型提供商`,providerAddMode:`添加方式`,providerAddCatalog:`第三方模型提供商`,providerAddCustom:`自定义模型 API`,providerAccountHint:`使用已有账户连接模型,选择服务商后前往浏览器授权。`,providerCatalogHint:`从内置目录中选择提供商,填入其 API 密钥即可使用。`,providerCustomHint:`连接中转站、自部署服务或其他兼容 OpenAI / Anthropic 协议的接口,需填写 API 地址、协议和模型。`,providerKeyKeep:`已配置密钥,留空保持不变`,providerKeyOptional:`输入 API 密钥,或留空使用环境认证`,providerDisplayName:`提供商名称`,providerCustomSettings:`自定义设置`,providerSaved:`已保存 {{provider}}。`,modelDefaultTitle:`新会话默认模型`,modelDefaultChoose:`选择模型`,modelDefaultBadge:`默认`,modelCurrentBadge:`当前使用`,modelDefaultNotSet:`未设置 · 新会话启动时由 Pi 选择`,modelDefaultHint:`选择以后新会话使用的模型,已有会话保留自己的选择。此设置也会更新 Pi 的默认模型。`,modelDefaultReadFailed:`暂时无法读取默认模型。`,modelDefaultProjectOverride:`此工作区有 Pi 独立设置:{{model}}。`,modelDefaultSave:`保存默认模型`,modelMakeDefault:`同时设为新会话默认模型`,modelDefaultSaveFailed:`默认模型保存尚未确认,请刷新状态后重试。`,modelDefaultPartial:`当前模型已切换,但默认模型保存尚未确认,请刷新状态后再试。`,modelConnectionNextHint:`从此连接选择一个模型,用于当前会话。`,modelConnectionSearch:`搜索模型…`,modelConnectionChooseProvider:`选择 {{provider}} 的模型`,modelConnectionUse:`用于当前会话`,modelConnectionUseFailed:`模型切换尚未确认,请刷新模型列表后重试。`,modelConnectionLoadFailed:`暂时无法读取模型列表。`,modelConnectionNoModels:`暂无可选模型,请检查连接或添加模型定义。`,modelConnectionNoMatch:`没有匹配的模型。`,modelConnectionMore:`还有 {{count}} 个模型,可搜索缩小范围。`,providerModelsEmpty:`还没有模型,获取可用模型或手动添加。`,providerModelsInherited:`使用提供商的内置模型目录。`,providerModelsReadOnly:`此提供商包含当前页面未支持的模型设置,请在 Pi 配置文件中编辑。`,providerModelId:`模型 {{number}} ID`,providerModelName:`模型 {{number}} 名称`,providerModelDetails:`模型参数:{{model}}`,providerRemoveModel:`删除模型:{{model}}`,providerIdInvalid:`请使用未被占用的提供商 ID,仅包含字母、数字、连字符、点或下划线。`,providerNativeAuth:`此提供商使用 Pi 原生登录。`,providerConfigurationFailed:`保存失败,请检查填写内容,并在会话空闲时重试。`,providerProfileSavedKeyFailed:`提供商配置已保存,但密钥保存失败。重试将只保存密钥。`,providerReload:`放弃草稿并重新加载`,providerCurrentRemoval:`请先切换当前使用的模型,再删除。`,providerRemoveDetail:`删除此提供商的配置和自定义模型?由 Pi 管理的凭据将保留。`,providerPickerIntro:`以下是模型提供商的可用模型,勾选要添加的模型。`,providerPickerSelected:`已选 {{count}} 个`,providerApiKey:`API 密钥`,providerKeyPlaceholder:`粘贴密钥以添加或替换`,saveProviderKey:`保存密钥`,savingSettings:`正在保存…`,keepEditing:`继续编辑`,discardAndContinue:`放弃更改并继续`,unsavedSettingsTitle:`放弃未保存的更改?`,unsavedSettingsDetail:`未保存的模型和凭据修改将被丢弃。`,unsavedCredentialTitle:`放弃未保存的凭据?`,unsavedCredentialDetail:`新密钥尚未保存,继续后将清空。`,modelSelectionBusy:`当前会话忙碌,暂不能切换模型。`,providerKeySaved:`已保存到 Pi 凭据存储。已有密钥不会回显。`,providerSaveFailed:`密钥保存未完成。请等待会话空闲,刷新状态后重试;部分服务商需要额外认证信息。`,providerWriteDetail:`在这里直接保存到 Pi 凭据存储,密钥不会进入模型对话。OAuth 或需要额外字段的认证请使用 Pi 原生登录。`,editModelConfiguration:`添加或编辑自定义模型`,modelConfigurationDetail:`先设置提供商连接,再获取模型列表或手动添加。保存配置不会调用模型。`,configuredModels:`自定义模型配置`,addModel:`添加模型`,modelConfig_provider:`服务商 ID`,modelConfig_id:`模型 ID`,modelConfig_name:`显示名称`,modelConfig_baseUrl:`API 地址`,modelConfig_api:`API 格式`,modelConfig_contextWindow:`上下文窗口`,modelConfig_maxTokens:`最大输出 token 数`,providerCapacityLabel:`{{field}} {{number}}`,providerModelOptions:`模型选项`,providerModelInvalid:`模型 {{number}}:模型 ID 不能为空或重复;容量需为正数,例如 128K 或 1M,留空使用默认值。`,modelConfig_reasoning:`支持推理`,saveModelConfiguration:`保存模型`,reloadModelConfiguration:`放弃草稿并载入最新配置`,retryModelConfiguration:`重试读取`,discardModelDraftTitle:`放弃这份模型草稿?`,discardModelDraftDetail:`最新配置将替换这份未保存的草稿。`,discardAndReload:`放弃并重新载入`,modelConfigurationUnsaved:`未保存的更改`,modelConfigurationConflict:`模型配置已在别处更改,当前草稿已保留。`,modelConfigurationLoadFailed:`无法读取模型配置,草稿已保留。`,modelConfigurationSaved:`已保存到 Pi models.json。配置服务商密钥后即可选择此模型。`,modelConfigurationFailed:`模型保存未完成,草稿已保留。`,setupConfigurationRequest:`配置需求`,configureViaSetup:`通过 OpenPI setup 应用`,setupFormDetail:`统一走 /openpi-setup。请在对话中查看进度及必要的确认;提交成功不等于配置已保存。`,setupSkillsPlaceholder:`填写要添加或调整的技能,以及来源或本地路径`,setupPluginsPlaceholder:`填写要配置的 Pi 插件,以及准确的包名或本地路径`,enableSkillInvocation:`允许模型调用`,disableSkillInvocation:`改为仅显式调用`,setupSkillInvocationRequest:`配置这个 Pi 技能:{{path}}。将原生 disable-model-invocation 字段设为 {{disabled}},保留其余内容,并说明何时生效。`,setupRoleFormRequest:`将 OpenPI 的 {{role}} 角色配置为使用 {{model}},工作流并发设为 {{concurrency}}。推理级别继承父会话,校验选择有效性,并保留其他配置。`,providerReadOnlyDetail:`此页面只读且不会接收凭据内容。请通过 Pi 配置服务商认证,然后刷新此状态。`,openProviderSettings:`打开服务商设置`,credentialConfigured:`已配置`,credentialMissing:`未配置`,authNotVerified:`凭据已配置不代表模型请求一定成功。`,configurationViaPi:`此处为只读状态。模型凭据与信任由 Pi 管理,OpenPI 选项通过 /openpi-setup 配置。`,noSkillsFound:`当前会话没有加载技能。`,addSkill:`添加技能`,addPlugin:`添加插件`,searchResources:`搜索名称或来源`,filterResourceScope:`资源范围`,allResourceScopes:`全部范围`,noMatchingResources:`没有匹配的资源`,resourceBulkTooLarge:`请进一步筛选列表后,再提交批量配置请求。`,resourceManagement:`Pi 资源`,resourceSourceAuto:`Pi 自动发现`,resourceSourceLocal:`本地资源`,resourcePackageSource:`软件包、仓库或本地路径`,resourcePackageSourcePlaceholder:`npm:包名@版本 · git:owner/repo · /path/to/skill`,resourceInstallIntro:`选择来源和范围,在对话中通过 OpenPI setup 审查并应用。`,resourceInstallReview:`请在对话中确认准确来源和权限。提交请求不代表已安装或已加载。`,resourceRequestSubmitted:`请求已提交。请在对话中查看进度和确认,完成后刷新此目录。`,browseSkills:`浏览 skills.sh 技能`,resourceSessionState:`应用到当前会话`,resourcesReloadNote:`刷新只读取目录;重新加载才会将已保存的资源应用到空闲会话。配置变更不会自动重新加载。`,reloadResources:`重新加载资源`,resourceReloadReview:`将已保存的 Pi 技能与插件配置应用到当前会话,并重新启动扩展?请先等待运行中的工作结束。`,resourceReloaded:`资源已重新加载,请查看更新后的目录和诊断。`,resourceReloadFailed:`无法重新加载资源。请等待当前会话空闲,刷新后重试。`,advancedResourceConfiguration:`高级配置`,resourceDiagnostics:`Pi 报告了 {{extensionErrors}} 项扩展诊断与 {{skillErrors}} 项技能诊断。`,resourceConfigurationDiagnostics:`{{count}} 项设置读取失败,请检查 Pi 配置诊断。`,resourceCatalogTruncated:`此目录有数量上限,部分资源未展示。`,resourceTargetTruncated:`此来源或路径已截断,请通过高级配置确认完整目标后再进行管理。`,updateResource:`检查更新`,removeResource:`审查移除`,skillsEmptyTitle:`添加你的第一个技能`,skillsEmptyIntro:`技能为 Pi 提供可复用的指引。可以添加软件包、仓库或本地技能;项目技能遵循 Pi 的项目信任。`,pluginsEmptyTitle:`用插件扩展 Pi`,pluginsEmptyIntro:`软件包可以包含扩展、技能、提示词和主题。添加来源后,通过 OpenPI setup 审查安装。`,pluginCount:`{{count}} 个插件来源`,installedVersion:`已安装版本`,configuredVersion:`配置版本`,resourceVersionUnpinned:`未固定版本 / 本地来源`,pluginState_loaded:`本会话资源已加载`,pluginState_installed:`已安装 · 未加载`,pluginState_disabled:`配置已禁用`,pluginState_missing:`软件包缺失`,pluginState_error:`加载诊断`,pluginState_notLoaded:`未加载`,pluginLoadedResources:`当前会话目录包含 {{count}} 项资源。配置变更需要明确重新加载后才会应用。`,pluginAction_enable:`审查启用`,pluginAction_disable:`审查禁用`,pluginAction_update:`检查更新`,pluginAction_remove:`审查移除`,enableVisibleSkills:`允许模型使用(当前 {{count}} 项)`,disableVisibleSkills:`仅显式调用(当前 {{count}} 项)`,enableVisiblePlugins:`启用当前 {{count}} 个软件包`,disableVisiblePlugins:`禁用当前 {{count}} 个软件包`,setupResourceInstallRequest:`添加 Pi {{kind}},来源为 {{source}},范围为 {{scope}}。先检查来源并确定固定的软件包身份,通过 ask_user 与我确认安装权限,再使用 Pi 原生的软件包或技能配置。添加技能时保留其他扩展和资源。保留现有偏好与项目信任,不要自动重新加载当前会话。分别报告已保存的配置与仍需执行的操作,不要改动无关的 OpenPI 设置。`,setupPluginOperationRequest:`审查 Pi 软件包操作 {{action}},只针对配置来源 {{source}}、原生安装目录 {{path}}、范围 {{scope}}。相对来源应以该范围的原生设置目录解析。使用 Pi 原生包管理;更新时检查可用版本,通过 ask_user 与我确认固定的目标身份和安装权限。保留资源过滤器及所有无关偏好;如果切换会破坏过滤器,停止并说明。移除时不得删除本地来源目录。不要自动重新加载,分别报告已持久化与当前会话状态,不要改动无关的 OpenPI 设置。`,setupSkillManageRequest:`审查 Pi 技能操作 {{action}},只针对文件 {{path}}、来源 {{source}}、范围 {{scope}}。先检查原生资源归属,通过 ask_user 与我确认更新或移除及所需权限。保留无关技能与软件包资源,不要为了移除一个技能删除整个共享软件包。保留项目信任,不要自动重新加载,也不要改动无关的 OpenPI 设置。`,setupSkillsBulkRequest:`只针对当前展示的 Pi 技能文件 {{paths}},将原生 disable-model-invocation 设为 {{disabled}}。检查资源归属,保留其余内容和偏好,与我审查必要变更,报告无法安全修改的文件。显式 /skill 调用仍应可用。不要自动重新加载,也不要改动无关的 OpenPI 设置。`,setupPluginsBulkRequest:`只针对当前展示的 Pi 软件包 {{packages}},通过 Pi 原生配置将 disabled 设为 {{disabled}}。保留其他偏好与资源过滤器;无法保留过滤器的条目应跳过并报告。遵循范围与项目信任,与我审查必要变更,不要自动重新加载,也不要改动无关的 OpenPI 设置。`,resourceRequestFinished:`配置回合已结束。请刷新并查看 Pi 原生配置与会话资源,确认实际变更。`,skillCount_one:`{{count}} 个技能`,skillCount_other:`{{count}} 个技能`,skill:`技能`,copySkillInvocation:`复制调用命令`,source:`来源`,scope:`范围`,invocation:`调用方式`,modelInvocation:`模型调用`,resourceScope_user:`全局`,resourceScope_project:`项目`,resourceScope_temporary:`临时`,explicitOnly:`仅允许明确调用`,availableToModel:`模型可按需使用`,skillFile:`技能文件`,selectSkill:`选择一个技能`,subagentConfiguration:`Pi 原生子代理角色`,subagentConfigurationIntro:`未在 OpenPI 配置中指定模型时,角色继承父会话模型。`,subagentActiveCount_one:`{{count}} 个运行中`,subagentActiveCount_other:`{{count}} 个运行中`,subagentCompletedCount_one:`{{count}} 条记录`,subagentCompletedCount_other:`{{count}} 条记录`,subagentConcurrency:`上限 {{count}}`,builtInRoles:`内置角色`,subagentRole_explorer:`探索者`,subagentRole_implementer:`实现者`,subagentRole_reviewer:`审查者`,subagentRole_advisor:`顾问`,subagentRoleShort_explorer:`只读调查`,subagentRoleShort_implementer:`聚焦实现`,subagentRoleShort_reviewer:`正确性审查`,subagentRoleShort_advisor:`技术分析`,subagentRoleDescription_explorer:`调查代码库并报告证据,不修改文件。`,subagentRoleDescription_implementer:`实现边界明确的改动并运行相关仓库检查。`,subagentRoleDescription_reviewer:`审查正确性、安全性、回归风险和缺失验证。`,subagentRoleDescription_advisor:`分析困难技术问题并提出具体下一步建议。`,configureRoles:`配置角色`,builtInRole:`内置角色`,builtIn:`内置`,modelAssignment:`模型分配`,inheritParentModel:`继承父会话模型`,effectiveModel:`实际模型`,workflowConcurrencyLabel:`并行 Agent`,workflowCallLimit:`Agent 总调用数`,runtimeBoundaries:`运行时边界`,subagentAuthorityNote:`子会话权限是父会话与角色能力的故障关闭交集,不会静默扩大权限。`,subagentModelNote:`不会硬编码服务商;未分配的角色继承父会话模型和思考等级。`,resourceCount_one:`{{count}} 项资源`,resourceCount_other:`{{count}} 项资源`,noPluginsFound:`Pi 未报告已加载的插件来源。`,pluginCatalogTotals:`{{extensions}} 扩展 · {{skills}} 技能 · {{prompts}} 提示词 · {{themes}} 主题`,loaded:`已加载`,resourceOrigin:`来源类型`,resourceOrigin_package:`软件包`,resourceOrigin_topLevel:`顶层资源`,resources:`资源`,baseDirectory:`基础目录`,notReported:`未报告`,extensions:`扩展`,extensionSurfaceCount:`{{tools}} 个工具 · {{commands}} 个命令`,prompts:`提示词`,themes:`主题`,pluginResourceSummary:`{{extensions}} 扩展 · {{skills}} 技能 · {{prompts}} 提示词 · {{themes}} 主题`,pluginsManagedByPi:`这些资源由 Pi 加载。可通过上方 setup 表单提交变更;软件包操作沿用原生确认,并通过 Pi 的重新加载流程生效。`,selectPlugin:`选择一个插件来源`,statusCaptured:`采集于 {{time}} · 刷新查看最新状态`,conversationViews:`会话视图`,currentConversations:`当前`,archivedConversations:`已归档`,refreshArchives:`刷新归档会话`,loadingArchives:`正在加载归档会话...`,moreArchives:`加载更多归档会话`,retryArchives:`重试读取归档会话`,archiveLoadFailed:`无法加载归档会话。`,archiveCursorStale:`归档会话已变化,请刷新后继续。`,archiveScanBounded:`还有 {{count}} 条更早记录未扫描。`,noArchivedSessions:`没有归档会话。`,noScannedArchives:`已扫描历史中没有归档会话。`,noMatchingScannedArchives:`已扫描历史中没有匹配的归档会话。`,draftLimit:`草稿暂存已满,请先发送或清空已有草稿。`,restoreConversation:`恢复会话`,restoringConversation:`正在恢复…`,loadedArchives:`已加载历史中的归档会话`,loadedHistoryBounded:`另有 {{sessions}} 个会话和 {{workspaces}} 个工作区摘要未加载。搜索仅覆盖已加载列表。`,noLoadedArchives:`已加载列表中没有归档会话。`,restoreFailed:`暂时无法确认恢复结果,请刷新后重试。`,execution_running:`运行中`,execution_done:`已完成`,execution_killed:`已停止`,execution_timed_out:`已超时`,execution_failed:`失败`,execution_uncertain:`状态不确定`,activeOnlyHint:`只有当前 Web 会话可以接收消息。`,stopTurn:`停止当前轮次`,stoppingTurn:`正在停止当前轮次…`,stoppedTurn:`当前轮次已停止。`,pendingFollowUpsHint:`{{count}} 条消息正在排队`,sendNextTurn:`下一轮发送`,followUpBehavior:`跟进处理方式`,followUpBehaviorDetail:`OpenPI 运行时,将后续消息排队到下一轮,或引导当前轮次。按 ⌘/Ctrl+Enter 可仅对这条消息使用另一种方式。`,followUpQueue:`排队`,followUpQueueDetail:`下一轮发送`,followUpSteer:`引导`,followUpSteerDetail:`加入当前轮次`,steerCurrentTurn:`当前执行纠偏`,steeringHint:`在当前工具步骤结束后加入这条指示。`,pendingSteeringHint:`已接收 {{count}} 条纠偏指示,等待当前工具步骤结束`,steeringMessagesTitle:`当前轮次待处理的纠偏指示`,steerStaleTurn:`目标轮次已结束或变化。草稿已保留,请确认更新后的状态并重新发送。`,sourceFeedbackNew:`{{path}} · 新版本第 {{line}} 行`,sourceFeedbackOld:`{{path}} · 旧版本第 {{line}} 行`,forkMessage:`从此处分叉`,forkMessageHint:`从此消息创建新聊天,保留原聊天;不会自动发送消息。`,forkSessionPending:`正在创建分叉会话…`,forkSessionCreated:`已创建分叉会话,原会话保留在侧栏。`,forkSessionCancelled:`分叉已取消,原会话已保留。`,forkSessionUncertain:`无法确认分叉结果。请先刷新并检查会话列表,再决定是否重试。`,forkSessionUnavailable:`切换到此会话并等待当前执行和排队消息结束后,可以从这里创建新会话。`,reviewQuoteLine:`引用此行`,reviewSelectOldLine:`选择旧版本第 {{line}} 行`,reviewSelectNewLine:`选择新版本第 {{line}} 行`,queuedMore:`还有 {{count}} 条排队消息`,queuedImage:`图片附件`,queuedMessageExpand:`展开排队消息`,queuedMessageCollapse:`收起排队消息`,backgroundSessionRunning:`此会话正在后台运行…`,observedSessionTools:`{{count}} 个正在执行的工具`,toolsRequireCurrentSession:`切换到此会话后可使用交互工具。`,activateViewedSession:`切换到此会话`,activateViewedSessionHint:`发送消息即可继续此会话。`,acceptedHint:`OpenPI Web 已接收消息。`,promptAdmissionUnknown:`无法确认上次发送的消息是否已被接收。`,promptAdmissionUnknownDetail:`请先核对已刷新的会话历史和运行状态,再决定下一步。作为新消息发送可能产生重复消息。`,promptAdmissionCheckingDetail:`正在核对最新的会话历史和运行状态,核对完成前不能作为新消息发送。`,promptAdmissionVerificationFailedDetail:`暂时无法刷新最新的会话历史和运行状态。请重新核对后再决定是否作为新消息发送。`,abandonAdmission:`暂不重新发送`,retryAdmissionCheck:`重新核对`,retryOriginalAdmission:`重试原消息`,promptTooLong:`文本超出发送上限({{count}} / {{limit}})。`,sendAsNew:`作为新消息发送`,sendingAsNew:`正在发送…`,addWorkspace:`添加工作区`,addWorkspaceMenu:`添加工作区...`,archiveConversation:`归档会话`,pinnedConversations:`置顶`,sidebarOptions:`侧栏选项`,sidebarProjectOptions:`项目侧栏选项`,sidebarRecentOptions:`会话侧栏选项`,sidebarActivityOptions:`动态视图选项`,sidebarShow:`显示`,sidebarGroupBy:`会话分组`,sidebarByProject:`按项目分组`,sidebarFlatList:`所有会话`,sidebarChatSort:`会话排序`,sidebarRecent:`最近`,sidebarProjectsInRecents:`在最近列表显示项目会话`,sidebarShowMore:`展开显示`,sidebarShowLess:`收起显示`,sidebarFilterList:`筛选当前列表`,sidebarSaveFailed:`更改未能保存,请重试。`,pinWorkspace:`置顶项目`,unpinWorkspace:`取消置顶项目`,markConversationRead:`标记为已读`,markConversationUnread:`标记为未读`,sidebarState_unread:`未读会话`,sidebarActivity:`动态`,sidebarViewActivity:`查看动态`,sidebarViewChats:`查看会话`,sidebarPriority:`优先关注`,sidebarActivityEmpty:`没有需要关注的会话`,sidebarActivityEmptyHint:`已完成的工作和需要你处理的会话会显示在这里。`,sidebarMarkAllRead:`全部标记为已读`,sidebarClearRead:`清除优先关注中的已读会话`,sidebarReadFailed:`未能更新已读状态,请重试。`,sidebarToday:`今天`,sidebarYesterday:`昨天`,sidebarEarlier:`更早`,sidebarActivityCompleted:`已完成`,sidebarActivityFailed:`执行失败`,sidebarActivityRead:`已读`,modelAdvanced:`高级参数`,providerConnectionHeading:`提供商连接`,providerFetchModels:`获取可用模型`,providerFetchHint:`填写提供商和端点后,可一次选择多个模型。`,providerPickerTitle:`选择要添加的模型`,providerPickerAccess:`连接凭据`,providerPickerKey:`访问密钥(可选)`,providerPickerKeyHint:`留空使用此端点已保存的凭据。此处输入的密钥仅用于获取列表,不会保存。`,providerPickerSearch:`搜索模型`,providerPickerSelectAll:`全选`,providerPickerClear:`清空选择`,providerPickerLoading:`正在获取可用模型…`,providerPickerAdded:`已添加`,providerPickerNoMatch:`没有匹配的模型`,providerPickerEmpty:`提供商没有返回模型,仍可手动添加。`,providerPickerBounded:`当前显示前 500 个模型,其他模型可手动填写 ID。`,providerPickerError_load:`未能获取模型列表,请检查端点和凭据后重试,也可以手动添加。`,providerPickerError_save:`尚未确认保存成功。已保留你的选择,请检查连接后重试。`,providerPickerError_conflict:`配置已在其他地方更新,请关闭弹窗、重新读取配置后再保存。`,providerPickerDefaults:`新模型使用 {{context}} 上下文 / {{output}} 输出 token,添加后可逐个调整。`,providerPickerRetry:`刷新列表`,providerPickerCount:`已选 {{count}} 个 · 最多 100 个`,providerPickerSave:`添加所选`,sidebarState_running:`执行中`,sidebarState_compacting:`正在整理上下文`,sidebarState_waiting:`等待你的回复`,sidebarState_completed:`已完成 · 结果未读`,sidebarState_failed:`执行失败 · 打开会话查看详情`,pinnedOptions:`置顶选项`,pinConversation:`置顶会话`,unpinConversation:`取消置顶`,pinnedRecentlyUpdated:`最近更新`,pinnedManualOrder:`手动排序`,movePinUp:`上移`,movePinDown:`下移`,pinSaveFailed:`置顶设置未能保存,请重试。`,cancel:`取消`,chooseWorkspaceHint:`选择工作区并描述任务`,close:`关闭`,closeSearch:`关闭搜索`,collapseSidebar:`收起侧边栏`,confirmEdit:`保存并重新运行`,editMessageHint:`从这里创建新分支并重新运行;保留原对话、图片和文件引用。已有工作区改动会保留。`,regenerateMessage:`重新生成回答`,regenerateMessageHint:`在新分支重新运行这条问题,保留原附件和原对话。`,messageRerunStarted:`已在新分支接收重跑消息,原对话已保留。`,openOriginalConversation:`查看原对话`,messageRerunWorkspaceHint:`已有工作区改动会保留。`,modelRequestRecovered:`请求已恢复`,modelReconnecting:`正在重新连接`,modelReconnectUnknown:`重连状态待确认`,modelEarlierAttempts:`先前请求错误`,modelFailedAttempts:`失败尝试({{count}} 次)`,draftStorageUnavailable:`草稿未能保存到此设备,请保持页面打开或复制消息。`,draftStorageInvalid:`部分保存的草稿内容无法恢复,请检查消息和附件。`,draftStorageRetry:`重试保存草稿`,workbarBackToChat:`返回聊天`,workbarCollapseTools:`收起工具栏`,workbarEndTerminal:`关闭 {{name}} 并结束进程`,workbarNewTerminal:`新建终端`,workbarContinueInChat:`继续追问`,transcriptSearch:`搜索消息内容`,transcriptSearchPlaceholder:`搜索标题、项目或消息…`,transcriptSearchRecent:`最近会话`,transcriptSearchSessions:`会话`,transcriptSearchMessages:`消息内容`,transcriptSearchSessionResult:`打开会话 {{session}}`,transcriptSearchSessionOpenFailed:`暂时无法打开此会话,请重试。`,transcriptSearchIncludeArchived:`包含归档会话`,transcriptSearching:`正在搜索消息…`,transcriptSearchEmpty:`没有匹配的消息。`,transcriptSearchFailed:`暂时无法搜索消息,请重试。`,transcriptSearchRetry:`重试搜索`,transcriptSearchPartial:`部分历史未能搜索,结果可能不完整。`,transcriptSearchOpenFailed:`无法打开这条消息,它可能已移动或位于其他分支。`,transcriptSearchResult:`打开 {{session}} 中来自{{source}}的消息`,transcriptSearchSource_user:`你`,transcriptSearchSource_assistant:`助手`,transcriptSearchSource_tool_call:`工具调用`,transcriptSearchSource_tool_result:`工具结果`,connected:`已连接`,connecting:`正在连接`,conversationName:`会话名称`,conversationOptions:`会话选项`,sidebarRename:`重命名`,sidebarPin:`置顶`,sidebarUnpin:`取消置顶`,sidebarFork:`分叉`,sidebarForkLocal:`创建聊天分支`,sidebarForkSameWorktree:`在同一工作树中分叉`,archiveNoticeTitle:`聊天已归档`,archiveNoticeView:`查看`,archiveNoticeUndo:`撤销`,archiveNoticeFailed:`操作未完成,请重试。`,sidebarForkWorktree:`在新工作树中创建聊天分支`,sidebarForkCancelling:`正在请求取消…`,sidebarForkFinishing:`无法再取消,正在确认创建结果…`,sidebarForkCancelUnconfirmed:`无法确认取消,正在等待分叉结果。`,sidebarForkWorktreePreserved:`工作树已保留在 {{path}},请检查后再重试。`,sidebarForkWorktreePending:`正在创建工作树和聊天分支…`,sidebarForkOptionsLoading:`正在检查工作树是否可用…`,sidebarForkOptionsFailed:`无法检查工作树,请重新打开菜单重试。`,sidebarForkUnavailable:`发送消息后才能创建此聊天的分支。`,sidebarForkArchived:`请先恢复此会话,再创建分叉。`,sidebarForkFailed:`未能创建分叉,原会话已保留。`,sidebarCopy:`复制`,sidebarCopyLink:`复制会话链接`,sidebarCopyMarkdown:`复制为 Markdown`,sidebarCopyCwd:`复制工作目录`,sidebarCopied:`已复制`,sidebarCopyFailed:`复制失败,请重试。`,sidebarNewWindow:`在新窗口中打开`,sidebarOpenIn:`打开方式`,sidebarAppsLoading:`正在加载可用应用…`,sidebarAppsFailed:`无法加载应用,请重新打开菜单重试。`,sidebarOpenFailed:`无法在所选应用中打开此项目。`,sidebarArchive:`归档`,sidebarRestore:`恢复`,sidebarDelete:`永久删除`,managedWorktreeRecoveryFull:`请先核对先前未确认的移除请求,再开始新的请求。`,managedWorktreesChanged:`工作树列表已变化,请刷新后重新核对目标。`,managedWorktreesRefresh:`刷新工作树列表`,managedWorktreesBack:`返回工作树列表`,managedWorktreesRetry:`重试请求`,managedWorktrees:`保留的工作树`,managedWorktreesDescription:`删除会话会保留 OpenPI 创建的工作树。请核对准确路径后再请求移除。使用中、共享、有改动或无法确认归属的工作树会保留。`,managedWorktreeConfirm:`移除此工作树?服务端会重新核对归属、使用中的会话及本地改动后再操作。`,managedWorktreeRemoved:`工作树已移除。`,managedWorktreePreserved:`工作树已保留:`,managedWorktreeUncertainTerminal:`移除结果无法确认,不能自动重复移除。请先检查保留路径,再决定后续操作。`,managedWorktreeUncertain:`尚不能确认移除结果。重试会核对原请求。`,managedWorktreeRemoving:`正在核对并移除…`,managedWorktreeRemove:`移除工作树`,managedWorktreeReview:`核对移除`,managedWorktreesEmpty:`这一页没有找到托管工作树。`,managedWorktreesUnavailable:`有 {{count}} 条归属记录无法确认。`,managedWorktreesLoadFailed:`无法加载保留的工作树。请重试,目标不会改变。`,managedWorktreesMore:`加载更多工作树`,managedWorktreeRetainedAfterDelete:`会话已删除,工作树保留在 {{path}}。可从项目菜单核对保留的工作树。`,sidebarDeleteTitle:`删除会话?`,sidebarDeleteDescription:`确定永久删除“{{name}}”?此操作无法撤销。`,sidebarDeleteConfirm:`删除`,sidebarDeleting:`正在删除…`,sidebarDeleteFailed:`未能删除此会话,请重试或取消。`,sidebarActionRunning:`请等待当前工作和排队消息结束。`,sidebarActionDisconnected:`请先恢复连接,再修改此会话。`,sessionDeleteCancelled:`删除已取消`,sessionDeleteUncertain:`无法确认会话是否删除,请刷新后重试`,sessionDeleted:`会话已永久删除`,sessionDeleteMetadataPending:`会话已删除,但侧栏记录未清理完成`,sessionLinkUnavailable:`链接中的会话已不存在或身份已变化`,sidebarDropPin:`拖到此处置顶`,sidebarDropProjectLast:`将项目移到最后`,conversationTurns:`会话轮次`,conversationTurnPosition:`前往第 {{position}} 轮`,turnPreviewLoading:`正在加载预览…`,turnPreviewUnavailable:`暂时无法读取,请重试。`,commands:`斜杠命令`,addContext:`添加上下文`,fileReference:`引用工作区文件`,fileReferenceTitle:`引用工作区文件`,fileReferenceDetail:`将路径引用加入提示词,不上传文件内容。`,fileReferenceLabel:`工作区文件路径`,fileReferencePlaceholder:`src/app.tsx`,fileReferenceValidatedHint:`当前会话会验证该路径是可读取的工作区文件。`,fileReferenceDraftHint:`新会话启动后,Pi 会按其工具权限解析该路径。`,fileReferenceChecking:`正在检查…`,fileReferenceFailed:`无法验证该文件。`,fileReferenceDenied:`请选择当前会话工作区内的文件。`,fileReferenceMissing:`该工作区文件已不存在。`,fileReferenceUnsupported:`只能引用工作区中的普通文件。`,fileReferenceExpired:`活动会话已变化,请重新打开文件引用后再试。`,fileReferenceBusy:`文件校验正忙,请稍后重试。`,insertReference:`插入引用`,commandsSessionRequired:`会话启动后才能插入斜杠命令。`,commandsEmptyDraftOnly:`只能在空白草稿中插入斜杠命令。`,commandsLoading:`正在加载命令…`,commandsUnavailable:`暂时无法读取命令。`,commandsNoMatch:`没有匹配的命令。`,commandsNoAvailable:`已发现的命令均不能在 Web 中运行。输入具体命令名可查看其可用性。`,commandsBounded:`另有 {{count}} 个命令未显示。`,commandSessionRequired:`命令仅在已创建的 Web 会话中可用。`,commandUnsupported:`尚未适配 · 手动命令仍交给 Pi`,commandAcceptsArguments:`可输入参数`,commandSource_extension:`扩展命令`,commandSource_prompt:`提示词模板`,commandSource_skill:`技能`,copiedMessage:`已复制`,copyMessage:`复制消息`,copyFailed:`复制失败,请选中消息后手动复制。`,copiedCode:`代码已复制`,copyCode:`复制代码`,copyCodeFailed:`无法复制代码,请选中后手动复制。`,codeBlock:`代码块`,wrapCode:`自动换行`,expandCode:`展开全部 {{count}} 行`,collapseCode:`收起代码`,expandInput:`展开输入框`,collapseInput:`收起输入框`,deleteWorkspace:`删除工作区`,describeTask:`描述任务`,editMessage:`修改并从这里重跑`,enterHint:`按 Enter 发送,Shift+Enter 换行。`,expandSidebar:`展开侧边栏`,importWorkspace:`导入工作区`,loadingModels:`正在加载模型...`,modelsTruncated:`当前显示 {{shown}} 个模型,还有 {{omitted}} 个可用;搜索即可查找。`,searchModels:`搜索可用模型`,searchModelsPlaceholder:`搜索服务商、模型名称或 ID...`,searchingModels:`正在搜索模型...`,noMatchingModels:`没有匹配的模型`,modelSearchFailed:`模型搜索失败,请重试。`,retryModelSearch:`重试模型搜索`,fileReferenceDraftChanged:`草稿已变化,请重新打开文件引用。`,modelSearchTruncated:`还有 {{omitted}} 个匹配模型未显示。`,modelPreparing:`正在准备任务...`,modelRetrying:`模型请求重试中...`,modelRunning:`正在运行…`,modelRequestFailed:`模型请求失败`,modelRequestStopped:`模型请求已停止`,modelFailureUnknown:`服务商没有返回具体失败原因。`,retryPrompt:`重试消息`,retryingPrompt:`正在重试…`,newSession:`新建会话`,noConversations:`暂无对话`,noMatching:`没有匹配的会话`,noMatchingLoaded:`已加载历史中没有匹配的会话`,noModels:`没有可用模型`,noOutput:`无输出`,noSessions:`暂无会话`,openSidebar:`打开侧边栏`,promptMessage:`发消息或创建任务,/ 调用指令`,promptReadonly:`非当前会话不能接收消息`,promptStart:`选择一个工作区开始`,promptTask:`描述你想要构建的任务`,queuedHint:`当前回合结束后将发送消息。`,reconnecting:`正在重连`,removeWorkspace:`从侧边栏移除`,workspaceOptions:`工作区选项`,renameFailed:`无法保存名称,已保留你的修改。`,savingName:`正在保存...`,workspaceRemoveFailed:`无法移出工作区,请重试。`,removingWorkspace:`正在移出...`,renameConversation:`重命名会话`,renameWorkspace:`重命名工作区`,save:`保存`,searchConversations:`搜索会话`,searchPlaceholder:`筛选标题与工作目录…`,selectModel:`选择模型`,configureModels:`配置模型`,openModelSettings:`模型设置`,selectThinking:`选择思考等级`,thinkingAvailableLevels:`可选等级:{{levels}}`,resetThinking:`恢复打开时的等级({{level}})`,modelThinkingNotEnabled:`此模型未启用思考。如提供商支持,可在模型设置中开启「支持推理」。`,providerReasoningHint:`按提供商能力开启,在聊天输入框调节当前思考等级。`,providerThinkingLevels:`支持的思考等级`,providerThinkingLevelsHint:`选择此模型支持的等级,保存后同步到会话选择器。`,providerThinkingAutomatic:`自动(Pi 默认)`,providerThinkingSelected:`已选 {{count}} 项`,providerThinkingReset:`使用 Pi 默认等级`,providerImageHint:`未勾选图片时,模型不会收到图片附件。`,selectWorkspace:`选择工作区`,send:`发送`,processDetails:`执行过程`,processRunning:`正在执行`,processThinkingCount:`{{count}} 段思考`,processToolCount:`{{count}} 次工具调用`,processFailureCount:`{{count}} 次失败`,runtimeActivities:`执行活动`,activityAgentProgress:`{{completed}}/{{total}} 个子代理已结束`,activityCapacity:`并行任务:{{running}}/{{limit}} · {{queued}} 个等待中`,composerQueuedCount:`排队 {{count}}`,composerSteeringCount:`引导 {{count}}`,runtimeActivityRunning:`{{count}} 项进行中`,runtimeActivityCount:`{{count}} 项活动`,processActivityCount:`{{count}} 项 Agent 活动`,switchingSession:`正在切换会话...`,thinkingActive:`思考中...`,thinkingActiveLevel:`思考中({{level}})...`,thinkingDone:`思考过程`,thinkingLoadFull:`查看完整思考`,thinkingLoadingFull:`正在加载思考…`,thinkingLoadFailed:`思考加载失败,点击重试`,thinkingPartialText:`当前显示部分已保存的思考,可继续加载下方内容。`,thinkingPreviewOnly:`思考预览已达到显示上限,此消息保存后可查看完整内容。`,toolState_running:`执行中`,toolState_returned:`已返回`,toolState_failed:`失败`,toolState_cancelled:`已停止`,toolState_timed_out:`超时`,toolState_unknown:`未确认`,toolSnapshotMissingResult:`分叉时尚无结果`,toolActivity_running:`正在{{action}}`,toolActivity_failed:`{{action}}失败`,toolActivity_cancelled:`{{action}}已停止`,toolActivity_timed_out:`{{action}}超时`,toolActivity_unknown:`{{action}}`,toolAction_read:`读取`,toolAction_write:`写入文件`,toolAction_edit:`编辑文件`,toolAction_command:`运行`,toolAction_search:`搜索`,toolAction_list:`列出文件`,toolAction_web:`浏览网页`,toolAction_agent:`使用子代理`,subagentAction_spawn:`启动子代理`,subagentAction_send:`发送补充消息`,subagentAction_check:`查询子代理`,subagentAction_wait:`等待子代理`,subagentAction_cancel:`停止子代理`,subagentActionDone_spawn:`已启动子代理`,subagentActionDone_send:`已发送补充消息`,subagentActionDone_check:`已查询子代理`,subagentActionDone_wait:`已结束等待`,subagentActionDone_cancel:`停止请求已返回`,toolAction_workflow:`调用工作流`,toolAction_plan:`准备计划`,toolAction_git:`查看变更`,toolAction_call:`调用工具`,toolActionDone_read:`已读取`,toolActionDone_write:`已写入`,toolActionDone_edit:`已编辑`,toolActionDone_command:`已运行`,toolActionDone_search:`已搜索`,toolActionDone_list:`已列出的文件`,toolActionDone_web:`已浏览网页`,toolActionDone_agent:`子代理工具已返回`,toolActionDone_workflow:`工作流工具已返回`,toolActionDone_plan:`计划工具已返回`,toolActionDone_git:`已查看变更`,toolActionDone_call:`已调用工具`,toolActionGroup_read:`读取文件`,toolActionGroup_write:`写入文件`,toolActionGroup_edit:`编辑文件`,toolActionGroup_command:`运行命令`,toolActionGroup_search:`搜索`,toolActionGroup_list:`列出文件`,toolActionGroup_web:`浏览网页`,toolActionGroup_agent:`子代理活动`,toolActionGroup_workflow:`工作流活动`,toolActionGroup_plan:`准备计划`,toolActionGroup_git:`查看变更`,toolActionGroup_call:`调用工具`,toolGroup_done:`{{actions}}`,toolGroup_running:`正在{{actions}}`,toolGroup_unknown:`{{actions}}`,toolGroupSeparator:`、`,toolSearchTarget:`“{{pattern}}” · {{path}}`,toolDiffStatsHelp:`当前显示差异中的新增和删除行数`,toolRequestedFile:`文件:`,toolWorkspace:`工作区`,toolRawEvidence:`参数与原始结果`,toolCodemodeDetails:`脚本与原始结果`,toolNestedOutputMissing:`会话记录保留了调用和状态,未保存此子工具的输出。`,toolNestedArgumentsMissing:`会话记录未保留完整参数和此子工具的输出。`,toolNestedIncomplete:`子调用记录不完整,部分调用、参数或最终状态不可用。`,toolPartialEvidence:`输出未完整显示:已达到字节、行数或条目上限。原始结果也可能被截断。`,toolFileChange_created:`已创建文件`,toolFileChange_unchanged:`文件内容未改变`,toolFileChange_overwritten:`已覆盖文件`,toolChangeUnavailable:`此工具结果未提供修改对比。`,toolTestResults:`测试结果摘要 · {{format}}`,toolTestCounts:`{{tests}} 项测试 · {{passed}} 通过 · {{failed}} 失败 · {{cancelled}} 取消`,toolTestCountsHelp:`数量来自命令输出,执行状态单独显示。`,toolReadMore:`可使用文件路径和 offset 继续读取,具体方式见原始结果。`,toolFullOutputReference:`完整输出:`,subagentBackgroundResult:`后台子代理结果 · {{count}}`,thinkingDraftHint:`请先选择工作区并创建会话。`,thinkingInactiveHint:`只有当前会话可以更改思考等级。`,thinkingLevelMismatch:`当前确认的思考等级不在此模型支持范围内;选择其它等级即可修正。`,thinkingLockedRunning:`请先停止当前轮次,再更改思考等级。`,thinkingModelPendingHint:`请等待模型切换完成。`,thinkingNotConfirmed:`思考等级未获确认,请重试。`,thinkingPendingHint:`正在应用思考等级...`,thinkingUnsupported:`暂不支持思考`,thinkingUnsupportedHint:`尚未选择模型,或当前模型不支持思考。`,unavailable:`不可用`,ungrouped:`未分组`,untitledSession:`新会话`,workspaceDeleteConfirm:`文件夹与会话记录会保留,其中的会话会被放到“未分组”;再次打开此目录时将是一个干净的工作区。`,workspaceName:`工作区名称`,workspaces:`工作区`,sidebarProjects:`项目`}}},dG=navigator.language?.toLowerCase().startsWith(`zh`)?`zh`:`en`;Xl.use(Zl).init({fallbackLng:`en`,initAsync:!1,interpolation:{escapeValue:!1},lng:dG,resources:uG}),document.documentElement.lang=dG===`zh`?`zh-CN`:`en`;var fG=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},pG=10,mG=13,hG=32,gG=6;function _G(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{maxBufferSize:t,onComment:n,onError:r,onEvent:i,onId:a,onRetry:o}=e,s=[],c=0,l=!0,u,d=``,f=0,p,m=!1,h=!1,g=!1;function _(e){if(m)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l&&(l=!1,e.charCodeAt(0)===65279?e=e.slice(1):e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),(h||g)&&(e=v(e),!e))return;if(!s.length){let t=S(e);t!==``&&y(t),x();return}if(e.indexOf(` `)===-1&&e.indexOf(`\r`)===-1){if(c0&&i?.({id:u,event:p,data:d}),u=void 0,d=``,f=0,p=void 0,t=n+1,n=e.indexOf(` @@ -113,7 +113,7 @@ Try polyfilling it using "@formatjs/intl-pluralrules" `),C=`${e.id}:${S}`,w=c?.source===C?c.status:null,T=`${e.id}:diff:${d.diff}`,E=c?.source===T?c.status:null,D=d.output.split(` `).map((e,t)=>({text:e,number:d.offset+t})),O=d.diff?yK(d.diff):[],k=O.filter(e=>e.kind===`added`).length,A=O.filter(e=>e.kind===`removed`).length,j=d.diff||d.change===`created`?(0,q.jsxs)(`span`,{className:`evidence-summary-meta`,title:s(`toolDiffStatsHelp`),children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,k.toLocaleString()]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,A.toLocaleString()]}),d.truncated&&(0,q.jsx)(`span`,{children:s(`gitReviewPartialLabel`)})]}):null,M=d.tests?.failures.map((e,t)=>({text:e,number:t+1}))??[];return(0,q.jsxs)(`details`,{className:`tool-evidence-card evidence-${d.kind}`,"data-state":f,"data-tool":e.name,open:a||void 0,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(`span`,{className:`evidence-icon`,"aria-hidden":`true`,children:(0,q.jsx)(y,{})}),(0,q.jsxs)(`span`,{className:`evidence-target`,title:h||b,children:[(0,q.jsx)(`span`,{className:`tool-action`,children:f===`returned`&&d.change===`created`?s(`toolFileChange_created`):gK(s,e.name,f)}),v?(0,q.jsx)(`span`,{className:`evidence-filename`,children:v}):b?(0,q.jsx)(`span`,{className:`evidence-command`,children:b}):null]}),j,(0,q.jsx)(os,{className:`evidence-chevron`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`evidence-status`,children:p})]}),(0,q.jsxs)(`div`,{className:`evidence-content`,children:[(m||d.displayPath||d.pathUnavailable)&&!d.diff&&(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`strong`,{children:s(`toolRequestedFile`)}),` `,u&&m?(0,q.jsx)(`button`,{className:`artifact-link`,type:`button`,onClick:()=>u.open(m),children:(0,q.jsx)(`code`,{children:g})}):(0,q.jsx)(`code`,{children:g}),i&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`br`,{}),(0,q.jsxs)(`small`,{children:[s(`toolWorkspace`),`: `,i]})]})]}),d.pathUnavailable&&(0,q.jsx)(`p`,{className:`evidence-warning`,children:d.pathUnavailable}),x&&(0,q.jsxs)(`figure`,{className:`evidence-shell`,"aria-label":s(`toolCallOutput`),children:[(0,q.jsxs)(`figcaption`,{children:[(0,q.jsxs)(`span`,{className:`evidence-shell-label`,children:[(0,q.jsx)(Vc,{"aria-hidden":`true`}),e.name===`bash`?`Bash`:`Shell`]}),(0,q.jsxs)(`span`,{className:`evidence-process-meta`,children:[p,d.exitCode===void 0?d.signal?` · ${d.signal}`:``:` · exit ${d.exitCode}`]}),(0,q.jsx)(`button`,{type:`button`,"data-copied":w===`copiedCode`||void 0,"aria-label":s(w===`copiedCode`?`copiedCode`:`copyCode`),title:s(w===`copiedCode`?`copiedCode`:`copyCode`),onClick:async()=>{let e=await td(S);l({source:C,status:e?`copiedCode`:`copyCodeFailed`})},children:w===`copiedCode`?(0,q.jsx)(rs,{}):(0,q.jsx)(_s,{})})]}),d.command&&(0,q.jsxs)(`pre`,{className:`evidence-shell-command`,children:[`$ `,d.command]}),(d.output||!d.command)&&(0,q.jsx)(`pre`,{className:`evidence-shell-output`,tabIndex:0,children:d.output||s(`noOutput`)}),w===`copyCodeFailed`&&(0,q.jsx)(`p`,{role:`status`,className:`evidence-warning`,children:s(w)})]}),d.truncated&&(0,q.jsx)(`p`,{className:`evidence-warning`,children:s(`toolPartialEvidence`)}),d.change&&!d.diff&&(0,q.jsx)(`p`,{children:s(`toolFileChange_${d.change}`)}),d.kind===`change`&&!d.diff&&!d.change&&(0,q.jsx)(`p`,{children:d.evidenceUnavailable??s(`toolChangeUnavailable`)}),d.tests&&(0,q.jsxs)(`figure`,{className:`evidence-test-summary`,"aria-label":`Test evidence`,children:[(0,q.jsx)(`figcaption`,{children:(0,q.jsx)(`strong`,{children:s(`toolTestResults`,{format:d.tests.format})})}),(0,q.jsx)(`p`,{children:s(`toolTestCounts`,d.tests)}),(0,q.jsx)(`p`,{children:s(`toolTestCountsHelp`)}),M.map(e=>(0,q.jsx)(bK,{"aria-label":`Failure excerpt ${e.number}`,children:e.text},e.number))]}),x?null:d.diff?(0,q.jsxs)(`figure`,{className:`evidence-diff`,"aria-label":`Change diff`,children:[(0,q.jsxs)(`figcaption`,{children:[u&&m?(0,q.jsx)(`button`,{className:`evidence-diff-file`,type:`button`,title:g,"aria-label":g,onClick:()=>u.open(m),children:v}):(0,q.jsx)(`span`,{className:`evidence-diff-file`,title:g,children:v}),j,(0,q.jsx)(`button`,{className:`evidence-copy`,type:`button`,"data-copied":E===`copiedCode`||void 0,"aria-label":s(E===`copiedCode`?`copiedCode`:`copyCode`),title:s(E===`copiedCode`?`copiedCode`:`copyCode`),onClick:async()=>{let e=await td(d.diff??``);l({source:T,status:e?`copiedCode`:`copyCodeFailed`})},children:E===`copiedCode`?(0,q.jsx)(rs,{}):(0,q.jsx)(_s,{})})]}),(0,q.jsx)(`pre`,{className:`evidence-diff-lines`,children:O.map(e=>(0,q.jsxs)(`span`,{className:`evidence-diff-row diff-${e.kind}`,children:[(0,q.jsx)(`span`,{className:`evidence-line-number`,"aria-hidden":`true`,children:e.newLine??e.oldLine??``}),(0,q.jsx)(`span`,{className:`evidence-diff-marker`,children:e.marker}),(0,q.jsx)(`span`,{children:e.code}),` `]},e.id))}),E===`copyCodeFailed`&&(0,q.jsx)(`p`,{role:`status`,className:`evidence-warning`,children:s(E)})]}):d.numberLines?(0,q.jsx)(bK,{className:`evidence-lines`,"aria-label":`File content`,children:D.map(e=>(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`span`,{className:`evidence-line-number`,"aria-hidden":`true`,children:e.number}),e.text,` -`]},e.number))}):(0,q.jsx)(bK,{className:`evidence-log`,"aria-label":`Tool output`,children:d.output||s(`noOutput`)}),d.kind===`file`&&d.truncated&&(0,q.jsx)(`p`,{children:s(`toolReadMore`)}),d.recovery&&(0,q.jsxs)(`p`,{children:[s(`toolFullOutputReference`),` `,(0,q.jsx)(`code`,{children:d.recovery})]}),d.readRecovery&&(0,q.jsx)(`p`,{className:`evidence-warning`,children:d.readRecovery}),(0,q.jsxs)(`details`,{children:[(0,q.jsx)(`summary`,{children:s(`toolRawEvidence`)}),(0,q.jsx)(`p`,{children:(0,q.jsx)(`code`,{children:e.name})}),(0,q.jsx)(`p`,{children:(0,q.jsx)(`strong`,{children:s(`toolCallArguments`)})}),(0,q.jsx)(`pre`,{children:d.rawArguments}),(0,q.jsx)(`p`,{children:(0,q.jsx)(`strong`,{children:s(`toolCallOutput`)})}),(0,q.jsx)(`pre`,{children:d.rawResult})]}),o]})]})}function SK({changes:e,onReview:t}){let{t:n}=W(),[r,i]=(0,K.useState)(!1),a=(0,K.useId)();if(e.state===`unavailable`||e.files.length===0)return null;let o=e.state===`partial`,s=e.source===`file-tools`,c=e.fileCount===null;return(0,q.jsxs)(`section`,{className:`turn-changes`,"aria-label":n(`turnChangesReview`),children:[(0,q.jsxs)(`header`,{className:`turn-changes-header`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`turn-changes-summary`,"aria-expanded":r,"aria-controls":a,onClick:()=>i(e=>!e),children:[(0,q.jsx)(Ms,{className:`turn-changes-icon`,"aria-hidden":`true`}),(0,q.jsx)(`strong`,{title:n(s?`turnEditsScope`:`turnChangesScope`),children:n(s?c?`turnEditsPartial`:`turnEdits`:o?`turnChangesPartial`:`turnChanges`,{count:e.fileCount??e.files.length})}),!c&&!e.files.some(e=>e.binary||e.statsUnavailable)&&(0,q.jsxs)(`span`,{className:`turn-changes-totals`,children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,e.additions]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,e.deletions]})]}),o&&!s&&(0,q.jsx)(`span`,{className:`turn-changes-warning`,children:n(`turnChangesIncomplete`)}),(0,q.jsx)(is,{className:r?`up`:``,"aria-hidden":`true`})]}),(0,q.jsx)(`button`,{type:`button`,className:`turn-changes-review-button`,"aria-label":n(`turnChangesReview`),disabled:!t,onClick:()=>t?.(e.promptEntryId,e.files[0]?.path),children:n(`reviewChanges`)})]}),(0,q.jsx)(`div`,{className:`turn-changes-list`,id:a,hidden:!r,children:e.files.map(r=>{let i=Math.max(r.path.lastIndexOf(`/`),r.path.lastIndexOf(`\\`));return(0,q.jsxs)(`button`,{type:`button`,className:`turn-changes-file`,title:r.path,"aria-label":r.path,disabled:!t,onClick:()=>t?.(e.promptEntryId,r.path),children:[(0,q.jsxs)(`span`,{className:`turn-changes-path`,children:[(0,q.jsx)(`strong`,{children:r.path.slice(i+1)}),i>=0&&(0,q.jsx)(`span`,{children:r.path.slice(0,i)})]}),(0,q.jsx)(`span`,{className:`turn-changes-file-stats`,children:r.binary?(0,q.jsx)(`span`,{children:n(`gitReviewBinaryShort`)}):r.statsUnavailable?(0,q.jsx)(`span`,{title:n(`turnEditReason_${r.statsUnavailable}`),children:n(`turnEditStatsUnknown`)}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,r.additions]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,r.deletions]})]})})]},r.path)})})]})}function CK({item:e,position:t,current:n,onNavigate:r,onPreview:i}){let{t:a}=W(),o=(0,K.useRef)(()=>{}),s=ed({placement:`start`,delay:150,hideDelay:100,touchTrigger:`none`,onShow:(0,K.useCallback)(()=>i(e.entryId,()=>o.current()),[e.entryId,i])});return o.current=s.hide,(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{ref:s.ref,className:`turn-tick`,type:`button`,"data-turn-entry":e.entryId,"aria-label":a(`conversationTurnPosition`,{position:t}),"aria-describedby":s.describedBy,"aria-current":n?`location`:void 0,onClick:()=>{s.hide(),r(e.entryId)},children:(0,q.jsx)(`span`,{className:`turn-tick-mark`,"aria-hidden":`true`})}),s.renderHoverCard((0,q.jsx)(`span`,{className:`turn-preview`,children:e.previewState===`idle`||e.previewState===`loading`?(0,q.jsx)(`span`,{role:`status`,children:a(`turnPreviewLoading`)}):e.previewState===`unavailable`?(0,q.jsx)(`span`,{role:`status`,children:a(`turnPreviewUnavailable`)}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`turn-preview-prompt`,children:e.title}),e.reply&&(0,q.jsx)(`span`,{className:`turn-preview-reply`,children:e.reply})]})}),{className:`turn-preview-layer`})]})}function wK({items:e,viewport:t,onNavigate:n,readingHistory:r,onRequestPreview:i,enabled:a=!0,onHidden:o}){let{t:s}=W(),c=(0,K.useRef)(null),l=JSON.stringify(e.map(e=>e.entryId)),u=(0,K.useRef)(null),d=(0,K.useRef)(null),f=(0,K.useRef)(!1),p=(0,K.useRef)(0),[m,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)({top:0,height:0,visible:!1,current:[]}),v=(0,K.useCallback)(()=>{u.current?.hide(),u.current=null,d.current&&d.current.captureTarget.hasPointerCapture?.(d.current.pointerId)&&d.current.captureTarget.releasePointerCapture(d.current.pointerId),d.current=null,p.current++,o?.()},[o]),y=(0,K.useCallback)((e,n)=>{if(!a||!t.current||!c.current||c.current.style.visibility===`hidden`||t.current.checkVisibility?.()===!1||c.current.checkVisibility?.()===!1||getComputedStyle(t.current).display===`none`||getComputedStyle(c.current).display===`none`){n();return}u.current?.entryId!==e&&u.current?.hide(),u.current={entryId:e,hide:n},i?.(e)},[a,t,i]),b=(0,K.useCallback)((e,t=!1)=>{u.current?.hide();let r=++p.current;h(!1),Promise.resolve(n(e,t)).then(e=>{p.current===r&&e===!1&&h(!0)})},[n]);return(0,K.useLayoutEffect)(()=>{let e=t.current,n=e?.parentElement,i=JSON.parse(l);if(!e||!n){v();return}let o,s=r?n.querySelector(`.jump-to-latest`):null,u=()=>{o=void 0;let t=e.getBoundingClientRect(),r=n.getBoundingClientRect(),l=new Map;for(let t of e.querySelectorAll(`[data-history-entry]`)){let e=t.dataset.historyEntry;e&&!l.has(e)&&l.set(e,t)}let u=e.querySelector(`.conversation-turn`)??l.values().next().value,d=e.offsetWidth>0?t.width/e.offsetWidth:1,f=a&&t.height>0&&d>0&&!!u&&(t.right-u.getBoundingClientRect().right)/d>=48&&e.checkVisibility?.()!==!1&&getComputedStyle(e).display!==`none`&&(!c.current||getComputedStyle(c.current).display!==`none`);f||v();let p=s?.getBoundingClientRect(),m=Math.min(t.bottom-8,p&&p.height>0?p.top-12:1/0),h=Math.max(0,m-t.top-8),g=i.flatMap(e=>{let n=l.get(e);if(!n)return[];let r=(n.closest(`.conversation-turn`)??n).getBoundingClientRect();return r.bottom>t.top+16&&r.tope.top===y.top&&e.height===y.height&&e.visible===f&&e.current.join(`\0`)===g.join(`\0`)?e:y)},d=()=>{o===void 0&&(o=requestAnimationFrame(u))};u(),e.addEventListener(`scroll`,d),window.addEventListener(`resize`,d);let f=typeof ResizeObserver>`u`?void 0:new ResizeObserver(d);f?.observe(e),f?.observe(n),s&&f?.observe(s);for(let t of e.children)f?.observe(t);let p=new MutationObserver(d);return p.observe(e,{childList:!0,subtree:!0}),()=>{o!==void 0&&cancelAnimationFrame(o),e.removeEventListener(`scroll`,d),window.removeEventListener(`resize`,d),f?.disconnect(),p.disconnect()}},[l,t,r,a,v]),(0,K.useLayoutEffect)(()=>{if(g.height,!g.visible||d.current)return;let e=c.current,t=Array.from(e?.querySelectorAll(`[data-turn-entry]`)??[]),n=t.find(e=>e===document.activeElement)??t.find(e=>e.matches(`:hover`))??t.find(e=>g.current.includes(e.dataset.turnEntry??``));if(!e||!n)return;let r=e.getBoundingClientRect(),i=n.getBoundingClientRect();i.topr.bottom&&(e.scrollTop+=i.bottom-r.bottom)},[g.current,g.height,g.visible,l]),(0,K.useLayoutEffect)(()=>{let n=t.current;if(!n)return;let r=t=>{if(!a||t.defaultPrevented||t.isComposing||!t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||![`ArrowUp`,`ArrowDown`].includes(t.key)||!n.parentElement?.contains(document.activeElement)||n.checkVisibility?.()===!1||getComputedStyle(n).display===`none`||getComputedStyle(n).visibility===`hidden`||n.getBoundingClientRect().height<=0)return;let r=new Map;for(let e of n.querySelectorAll(`[data-history-entry]`)){let t=e.dataset.historyEntry;t&&!r.has(t)&&r.set(t,e)}let i=e.flatMap((e,t)=>{let n=r.get(e.entryId);return n?[{item:e,index:t,top:n.getBoundingClientRect().top}]:[]}),o=n.getBoundingClientRect().top,s;if(t.key===`ArrowDown`){let t=i.findIndex(e=>e.top>o+24);s=i.length===0?e[0]:t<0?e[i.at(-1).index+1]:e[(i[t-1]?.index??-1)+1]}else{for(let t=i.length-1;t>=0;t--){let n=i[t];if(Math.abs(n.top-o)<=24){s=e[n.index-1];break}if(n.tope.top>o+24)&&(s=i[0]?.item),i.length===0&&(s=e.at(-1))}s&&(t.preventDefault(),b(s.entryId))};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[t,a,e,b]),(0,K.useLayoutEffect)(()=>()=>v(),[v]),e.length<4?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`nav`,{ref:c,className:`turn-rail`,"aria-label":s(`conversationTurns`),style:{top:g.top,maxHeight:g.height,visibility:g.visible?`visible`:`hidden`},onClickCapture:e=>{f.current&&=(e.preventDefault(),e.stopPropagation(),!1)},onPointerDown:e=>{if(!e.isPrimary||e.button!==0)return;let t=e.target instanceof Element?e.target.closest(`.turn-tick`):null;!t||!e.currentTarget.contains(t)||(f.current=!1,d.current={pointerId:e.pointerId,captureTarget:t,y:e.clientY,moved:!1},t.setPointerCapture?.(e.pointerId))},onPointerMove:e=>{let t=d.current;if(!t||t.pointerId!==e.pointerId||Math.abs(e.clientY-t.y)<3&&!t.moved)return;t.moved=!0,f.current=!0;let n=Array.from(e.currentTarget.querySelectorAll(`[data-turn-entry]`)).find(t=>{let n=t.getBoundingClientRect();return e.clientY>=n.top&&e.clientY{let t=d.current;d.current=null,t?.captureTarget.hasPointerCapture?.(e.pointerId)&&t.captureTarget.releasePointerCapture(e.pointerId)},onPointerCancel:e=>{let t=d.current;d.current=null,t?.captureTarget.hasPointerCapture?.(e.pointerId)&&t.captureTarget.releasePointerCapture(e.pointerId),f.current=!1},children:e.map((e,t)=>(0,q.jsx)(CK,{item:e,position:t+1,current:g.current.includes(e.entryId),onNavigate:b,onPreview:y},e.entryId))}),m&&(0,q.jsx)(`span`,{className:`turn-navigation-error`,role:`status`,children:s(`turnPreviewUnavailable`)})]})}function TK(e){if(e.role!==`custom`||e.customType!==`openpi-setup-request`||e.truncation?.details)return e;let t=e.details;return!t||typeof t!=`object`||Array.isArray(t)||!(`command`in t)||t.command!==`openpi-setup`&&t.command!==`my-pi-setup`||!(`request`in t)||typeof t.request!=`string`?e:{...e,role:`user`,content:`/${t.command}${t.request?` ${t.request}`:``}`,parts:void 0}}function EK(e,t){let n=e.parentId,r=new Set;for(let e=0;n&&e<32;e++){if(r.has(n))return;r.add(n);let e=t(n);if(!e||e.id!==n)return;if(e.message?.role!==`system`)return e.message;n=e.parentId}}function DK(e,t){let n=TK(e);return e.customType===`openpi-setup-request`&&n.role===`user`&&t?.role===`user`&&t.customType===`openpi-web-command-input`&&typeof t.commandId==`string`&&t.commandId.length>0&&t.commandId.length<=128&&!/[\u0000-\u001f\u007f]/u.test(t.commandId)&&t.content===n.content}function OK(e){if(e.role===`toolResult`&&e.toolCallId&&!e.toolCallId.includes(`[truncated]`))return`tool-result-${e.toolCallId}`;if(e.role!==`assistant`||e.truncation?.partsOmitted)return;let t=e.parts?.filter(e=>e.type===`toolCall`);if(!(!t?.length||t.some(e=>!e.id||e.id.includes(`[truncated]`))))return`tool-calls-${JSON.stringify(t.map(e=>e.id))}`}function kK(e){let t=OK(e);if(t)return t;if(e.timestamp!==void 0)return`message-${e.role}-${e.timestamp}`}function AK(e){return[`assistant`,`toolResult`].includes(e.role??``)&&!e.truncation?.truncated?JSON.stringify(e):null}function jK(e){return JSON.stringify([e.role,e.content,(e.parts??[]).filter(t=>e.role!==`user`||t.type!==`text`).map(t=>t.type===`image`?[t.type,t.mimeType,e.role===`user`?void 0:t.name]:t.type),e.stopReason,e.errorMessage,e.toolCallId])}function MK(e){return e.role===`user`?jK(e):JSON.stringify({...e,timestamp:void 0})}var NK=new WeakMap;function PK(e,t){let n=NK.get(e),r=n?.get(t);if(r&&r.length===e.length&&r.head===e[0]&&r.tail===e[e.length-1])return r.projection;let i=new Map(e.map(e=>[e.id,e])),a=new Map;for(let t of e){let e=t.message&&AK(t.message);if(!e)continue;let n=a.get(e)??[];n.push(t),a.set(e,n)}let o=e.flatMap(e=>{if(e.forkSnapshotBoundary)return[{key:e.id,entryId:e.id,timestamp:e.timestamp,forkSnapshotBoundary:!0,message:{role:`custom`,content:``}}];if(e.type===`compaction`)return[{key:e.id,entryId:e.id,timestamp:e.timestamp,compaction:!0,message:{role:`custom`,content:``}}];if(`turnTiming`in e&&e.turnTiming&&e.turnTiming.sessionId===t)return[{key:e.id,timestamp:e.timestamp,timing:e.turnTiming,message:{role:`custom`,content:``}}];if(e.type!==`message`||!e.message)return[];let n=TK(e.message),r=EK(e,e=>i.get(e));return DK(e.message,r)?[]:[{key:e.id,entryId:e.id,timestamp:e.timestamp,message:n}]}),s=new Map,c=new Map;o.forEach((e,t)=>{if(e.entryId&&s.set(e.entryId,t),e.timing||e.compaction||e.forkSnapshotBoundary)return;let n=kK(e.message)??e.entryId??e.key,r=c.get(n)??[];r.push(t),c.set(n,r)});let l=[];for(let e of c.values())if(!(e.length<2))for(let t of e){let e=o[t].entryId;e&&l.push(e)}let u=new Map,d=0;for(let t of e){if(t.message?.role!==`custom`||t.message.truncation?.truncated)continue;let e=MK(t.message),n=u.get(e)??[];n.push(d),u.set(e,n),d++}let f=o.map(e=>({identity:kK(e.message),signature:MK(e.message)})),p=new Map,m=new Map;f.forEach((e,t)=>{let n=m.get(e.signature)??[];if(n.push(t),m.set(e.signature,n),e.identity===void 0)return;let r=p.get(e.identity)??[];r.push(t),p.set(e.identity,r)});let h=new Map(e.map((e,t)=>[e.id,t])),g=o.filter(e=>e.message.role===`user`).map(e=>({key:e.entryId??e.key,position:h.get(e.entryId??e.key),parentId:i.get(e.entryId??e.key)?.parentId,signature:jK(e.message)})),_=new Map;for(let e of g){let t=_.get(e.signature)??[];t.push(e),_.set(e.signature,t)}let v={nativeById:i,exactNative:a,baseEntries:o,indexById:s,lookupIndexes:c,ambiguousNativeIds:l,customIndexes:u,nativeByIdentity:p,nativeByLegacySignature:m,nativeMessages:f,promptCandidates:g,promptsBySignature:_,commandInputs:new Map(o.flatMap(e=>e.message.role===`user`&&e.message.customType===`openpi-web-command-input`&&e.message.commandId?[[e.message.commandId,e.entryId??e.key]]:[])),persistedPositions:h};return n||(n=new Map,NK.set(e,n)),n.set(t,{projection:v,length:e.length,head:e[0],tail:e[e.length-1]}),v}function FK(e,t){if(!e)return-1;for(let n of e)if(!t.has(n))return n;return-1}function IK(e,t){let n=[e.timingKey,e.key,e.entryId,e.ambiguousTimingIdentity?void 0:kK(e.message)];for(let e of n){if(!e)continue;let n=t[e];if(n!==void 0)return n}}function LK(e,t,n){let{nativeRowKeys:r,ambiguousTimingIds:i}=n,a=e.selectedSession,o=PK(a?.entries??[],a?.id);for(let e of r.keys())o.nativeById.has(e)||r.delete(e);for(let e of i)o.nativeById.has(e)||i.delete(e);let s=new Map;for(let e of t){if(e.optimistic)continue;let t=AK(e.message);if(!t)continue;let n=s.get(t)??[];n.push(e),s.set(t,n)}let c=new Set(r.values());for(let[e,t]of s){let n=o.exactNative.get(e);if(n?.length!==1||t.length!==1)continue;let a=n[0].id,s=t[0].key;r.has(a)||i.has(a)||c.has(s)||o.nativeById.has(s)||(r.set(a,s),c.add(s))}for(let e of o.ambiguousNativeIds)i.add(e);let l=new Map,u=new Set;for(let e of t){let t=kK(e.message)??e.key,n=o.lookupIndexes.get(t);if(!n)continue;let a=MK(e.message),s=n.filter(e=>o.nativeMessages[e]?.signature===a);if((s.length!==n.length||n.length>1)&&u.add(t),s.length===1){let n=s[0],a=o.baseEntries[n].entryId,c=a?r.get(a):void 0;if(c&&c!==e.key||a&&i.has(a)&&!c&&e.key!==a){u.add(t);continue}let d=l.get(n);d===void 0||d===e.key?l.set(n,e.key):(l.set(n,null),u.add(t))}}for(let e of u)for(let t of o.lookupIndexes.get(e)??[]){let e=o.baseEntries[t].entryId;e&&i.add(e)}let d=new Set(t.flatMap(e=>e.optimistic?.projectedEntryId?[e.optimistic.projectedEntryId]:[])),f=[],p=[],m=e.selectedExecution?.sessionId===a?.id&&e.selectedExecution?.sessionPath===a?.path?e.selectedExecution:void 0,h=m?.pendingFollowUps??0,g=Math.max(0,t.filter(e=>e.optimistic?.admitted&&!e.optimistic.projectedEntryId&&!o.commandInputs.has(e.optimistic.commandId)).length-h),_=0,v=new Set,y=new Set,b=new Set,x=[];for(let e of t){if(e.optimistic?.projectedEntryId)continue;if(e.message.role===`custom`&&!e.message.truncation?.truncated){let t=MK(e.message),n=FK(o.customIndexes.get(t),y);if(n>=0){y.add(n);continue}}let n=e.optimistic?.commandId??(e.key.startsWith(`optimistic-`)?e.key.slice(11):void 0),r=n?o.commandInputs.get(n):void 0;if(r){e.optimistic&&f.push({key:e.key,entryId:r});continue}let i=TK(e.message);if(i.role===`user`&&e.optimistic){let t=e.optimistic.afterEntryId===null?-1:o.persistedPositions.get(e.optimistic.afterEntryId),n=!e.optimistic.admitted||_>=g?void 0:o.promptsBySignature.get(jK(i))?.find(n=>n.position!==void 0&&(t===void 0?n.parentId===e.optimistic?.afterEntryId:n.position>t)&&!d.has(n.key));if(n){d.add(n.key),f.push({key:e.key,entryId:n.key}),_++;continue}}else{let e=i.role===`user`?t.find(e=>e.optimistic?.admitted&&!e.optimistic.projectedEntryId&&!v.has(e.key)&&!f.some(t=>t.key===e.key)&&e.optimistic.sessionId===a?.id&&e.optimistic.sessionPath===a?.path&&jK(TK(e.message))===jK(i)):void 0;if(e){v.add(e.key);continue}let n=kK(i),r=OK(i),s=MK(i),c=n===void 0?FK(o.nativeByLegacySignature.get(s),b):(o.nativeByIdentity.get(n)??[]).find(e=>(r!==void 0||!b.has(e))&&(r!==void 0||o.nativeMessages[e]?.signature===s))??-1;if(c>=0){b.add(c);continue}}let s={key:e.key,timingKey:e.key,ambiguousTimingIdentity:u.has(kK(i)??e.key)?!0:void 0,timestamp:e.timestamp??new Date().toISOString(),message:i,optimistic:e.optimistic};i.role===`user`&&e.optimistic?p.push(s):x.push(s)}let S=new Map;for(let e of m?.queuedMessages??[])S.set(e,(S.get(e)??0)+1);let C=p.filter(e=>{if(!e.optimistic?.admitted||e.optimistic.commandId===m?.activeTurn?.commandId)return!0;let t=S.get(e.message.content)??0;return!t||(S.set(e.message.content,t-1),!1)}),w=new Map(t.flatMap(e=>e.optimistic?.projectedEntryId?[[e.optimistic.projectedEntryId,e.key]]:[]));for(let e of f)w.set(e.entryId,e.key);let T=o.baseEntries,E=(e,t)=>{T===o.baseEntries&&(T=o.baseEntries.slice()),T[e]=t};for(let e of i){let t=o.indexById.get(e);if(t===void 0)continue;let n=T[t];!n||n.ambiguousTimingIdentity||E(t,{...n,ambiguousTimingIdentity:!0})}for(let[e,t]of l){if(t===null)continue;let n=T[e];!n||n.timingKey===t||E(e,{...n,timingKey:t})}for(let[e,t]of r){let n=o.indexById.get(e);if(n===void 0)continue;let r=T[n];!r||r.key===t||E(n,{...r,key:t})}for(let[e,t]of w){let n=o.indexById.get(e);if(n===void 0)continue;let r=T[n];!r||r.key===t||E(n,{...r,key:t})}return{entries:T.concat(x,C),projectedPrompts:f}}function RK({message:e,sessionId:t,path:n,entryId:r}){let{t:i}=W(),[a,o]=(0,K.useState)(null),s=JSON.stringify([t,n,r]),c=e.parts?.filter(e=>e.type===`image`)??[];if(c.length===0)return null;let l=new Map,u=a?.scope===s?a:null,d=()=>o(e=>e?{...e,open:!1}:null);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`section`,{className:`message-attachments`,"aria-label":i(`imageAttachments`),children:c.map(e=>{let a=`${e.mimeType}:${e.name??``}:${e.previewUrl??``}`,c=l.get(a)??0;l.set(a,c+1);let u=`${a}:${c}`,d=t&&n&&r&&typeof e.sourcePartIndex==`number`&&Number.isSafeInteger(e.sourcePartIndex)&&e.sourcePartIndex>=0?{id:`${r}:${e.sourcePartIndex}`,entryId:r,partIndex:e.sourcePartIndex,kind:`image`,name:e.name??i(`attachedImage`)}:null,f=e.previewUrl?(0,q.jsx)(`img`,{src:e.previewUrl,alt:e.name??i(`attachedImage`)},`preview`):d&&t&&n?(0,q.jsx)(`span`,{className:`message-attachment-preview`,children:(0,q.jsx)(tG,{sessionId:t,path:n,source:d,thumbnail:!0})},`preview`):(0,q.jsx)(qs,{"aria-hidden":`true`},`preview`),p=(0,q.jsx)(`span`,{children:e.name??i(`attachedImage`)},`name`);return d?(0,q.jsxs)(`button`,{className:`message-attachment`,type:`button`,title:d.name,"aria-label":d.name,onClick:()=>o({scope:s,source:d,open:!0}),children:[f,p]},u):(0,q.jsxs)(`div`,{className:`message-attachment`,children:[f,p]},u)})}),t&&n&&u&&(0,q.jsx)(aG,{sessionId:t,path:n,source:u.source,open:u.open,onSelect:d,onClose:d})]})}function zK(e,t,n){let r=(0,K.useMemo)(()=>new de,[]),i=e?.history?.leafEntryId??e?.entries.at(-1)?.id,a=e?.id,o=e?.path,s=JSON.stringify([e?.id,e?.path,i]),c=(0,K.useRef)(s);c.current=s;let[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)({}),p=(0,K.useRef)(new Map),m=(0,K.useMemo)(()=>a&&o&&i?{sessionId:a,sessionPath:o,entryId:i}:null,[a,o,i]);(0,K.useEffect)(()=>{if(u(null),f({}),!n||!m)return;let e=new AbortController,t=async()=>{try{let t=null,n=[],i=new Set;for(let a=0;a<10;a++){let a=await r.sessionPromptHistory(m,t,e.signal);if(e.signal.aborted||c.current!==s||a.sessionId!==m.sessionId||a.sessionPath!==m.sessionPath||a.anchorEntryId!==m.entryId||a.requestedBeforeEntryId!==t||a.entryIds.length>100||a.entryIds.some(e=>!e||i.has(e))||new Set(a.entryIds).size!==a.entryIds.length||a.nextBeforeEntryId!==null&&(a.entryIds.length===0||a.nextBeforeEntryId!==a.entryIds[0]))return;for(let e of a.entryIds)i.add(e);if(n=[...a.entryIds,...n],a.nextBeforeEntryId===null){u({scope:s,ids:n});return}t=a.nextBeforeEntryId}}catch{}},i=typeof window.requestIdleCallback==`function`?window.requestIdleCallback(()=>void t(),{timeout:2e3}):void 0,a=i===void 0?window.setTimeout(()=>void t(),0):void 0;return()=>{e.abort(),i!==void 0&&window.cancelIdleCallback(i),a!==void 0&&window.clearTimeout(a);for(let e of p.current.values())e.abort();p.current.clear()}},[s,n,m,r]);let h=(0,K.useMemo)(()=>{let e=new Map(t.map(e=>[e.entryId,e]));if(l?.scope!==s)return t;let n=new Set(l.ids);return[...l.ids.map(t=>e.get(t)??d[t]??{entryId:t,title:``,previewState:`idle`}),...t.filter(e=>!n.has(e.entryId))]},[l,s,t,d]),g=(0,K.useRef)(h);return g.current=h,{items:h,requestPreview:(0,K.useCallback)(e=>{if(!n||!m||c.current!==s||p.current.has(e))return;let t=g.current.find(t=>t.entryId===e);if(!t||t.previewState===void 0||t.previewState===`ready`)return;let i=new AbortController;p.current.set(e,i),f(t=>({...t,[e]:{entryId:e,title:``,previewState:`loading`}})),r.sessionPromptPreview(m,e,i.signal).then(t=>{if(!(i.signal.aborted||c.current!==s)){if(t.sessionId!==m.sessionId||t.sessionPath!==m.sessionPath||t.anchorEntryId!==m.entryId||t.entryId!==e||typeof t.prompt!=`string`||typeof t.response!=`string`||Array.from(t.prompt).length>240||Array.from(t.response).length>240)throw Error(`Unverified preview`);f(n=>({...n,[e]:{entryId:e,title:t.prompt,reply:t.response,previewState:`ready`}}))}}).catch(()=>{!i.signal.aborted&&c.current===s&&f(t=>({...t,[e]:{entryId:e,title:``,previewState:`unavailable`}}))}).finally(()=>{p.current.get(e)===i&&p.current.delete(e)})},[n,m,s,r])}}var BK=`[data-history-entry], [data-history-message], [data-history-result]`;function VK(e,t,n,r){let i=(0,K.useRef)(null),a=(0,K.useCallback)(()=>{let r=e.current;if(!r||t.current){i.current=null;return}let a=r.getBoundingClientRect(),o=Array.from(r.querySelectorAll(BK)).filter(e=>{let t=e.getBoundingClientRect();if(t.height<=0||t.bottom<=a.top||t.top>=a.bottom)return!1;for(let t=e.parentElement;t&&t!==r;t=t.parentElement){if(t.hidden)return!1;let e=getComputedStyle(t);if(/^(auto|scroll|overlay)$/.test(e.overflowY)&&t.scrollHeight>t.clientHeight)return!1}return!0}),s=o.find(e=>!o.some(t=>t!==e&&e.contains(t)));i.current=s?{scope:n,element:s,offset:s.getBoundingClientRect().top-a.top}:null},[e,t,n]),o=(0,K.useCallback)(()=>{let a=e.current,o=i.current;if(!a||t.current||!o||o.scope!==n)return;if(!a.contains(o.element)||!o.element.getClientRects().length){i.current=null;return}let s=o.element.getBoundingClientRect().top-a.getBoundingClientRect().top-o.offset;if(Math.abs(s)>.5){let e=a.scrollTop+s;typeof a.scrollTo==`function`?a.scrollTo({top:e,behavior:`instant`}):a.scrollTop=e,r.current=a.scrollTop}},[e,t,n,r]);return(0,K.useLayoutEffect)(()=>{o(),a()}),{capture:a,restore:o,clear:(0,K.useCallback)(()=>{i.current=null},[])}}var HK=1e3,UK=ye*4;function WK(e,t){return t.history?.leafEntryId===e.validatedLeaf||t.history?.anchorEntryId===e.anchor&&t.history.anchorOnBranch===!0}function GK(e,t,n=t.entriesOmitted){let r=e.filter(e=>e.message?.truncation).length,i=e.reduce((e,t)=>e+(t.message?.truncation?.partsOmitted??0),0);return{...t,entriesOmitted:n,messagesTruncated:r,messagePartsOmitted:i,truncated:n>0||r>0||i>0}}function KK(e,t){let n=t.history?.leafEntryId??null;if(n===e.validatedLeaf)return e;let r=t.entries.findIndex(t=>t.id===e.anchor),i=r>=0?t.entries.slice(r+1):t.entries[0]?.parentId===e.anchor?t.entries:null,a=i?.reduce((e,t)=>e+pe(t)+1,0)??0;return i&&e.session.entries.length+i.length<=HK&&e.session.bytes+a<=UK?{...e,anchor:n??e.anchor,validatedLeaf:n,session:{...e.session,entries:[...e.session.entries,...i],bytes:e.session.bytes+a,truncation:GK([...e.session.entries,...i],e.session.truncation)}}:{...e,validatedLeaf:n}}function qK(e,t,n,r){let i=(0,K.useMemo)(()=>new de,[]),a=(0,K.useMemo)(()=>n??new Map,[n]),o=lK(e),s=(0,K.useRef)({scope:o,state:a.get(o)});s.current.scope!==o&&(s.current={scope:o,state:a.get(o)});let c=(0,K.useRef)({selected:e,callbacks:t});c.current={selected:e,callbacks:t};let l=(0,K.useRef)(s.current.state?.window??null),u=(0,K.useRef)(null),d=(0,K.useRef)(null),f=(0,K.useRef)(null),[p,m]=(0,K.useState)(l.current),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(null),[y,b]=(0,K.useState)(0),x=(0,K.useRef)(o),S=(0,K.useRef)(null),C=r?JSON.stringify([r.sessionId,r.sessionPath,r.entryId,r.revision]):null,w=r&&e&&C!==S.current&&r.sessionId===e.id&&r.sessionPath===e.path&&r.session.id===e.id&&r.session.path===e.path&&r.session.history?.anchorEntryId===r.entryId&&r.session.history.anchorOnBranch===!0&&r.session.entries.some(e=>e.id===r.entryId)?{session:r.session,anchor:r.session.entries.at(-1).id,validatedLeaf:r.session.history?.leafEntryId??null}:null,T=(0,K.useCallback)(e=>{l.current=e,uK(a,lK(e.session),{window:e}),m(e),c.current.callbacks.onAnchorChange?.({sessionId:e.session.id,sessionPath:e.session.path,entryId:e.anchor})},[a]),E=(0,K.useCallback)((e=!1)=>{u.current?.controller.abort(),u.current=null,d.current=null,a.delete(lK(l.current?.session??c.current.selected)),l.current=null,a.persist?.(),m(null),g(!1),v(e?`historyChanged`:null),f.current=null,c.current.callbacks.onAnchorChange?.(null),b(e=>e+1)},[a]),D=(0,K.useCallback)((e=!1)=>{let t=l.current,n=c.current.selected;if(!t||!n)return;let r=JSON.stringify([lK(n),t.anchor,n.history?.leafEntryId]);if(!e&&f.current?.key===r)return;let i={key:r};f.current=i,v(null);let a=()=>{f.current===i&&l.current===t&&(u.current?.controller.abort(),u.current=null,g(!1),v(`historyValidationUnavailable`))};c.current.callbacks.onAnchorChange?.({sessionId:t.session.id,sessionPath:t.session.path,entryId:t.anchor});let o=c.current.callbacks.onRefresh?.();if(!o){a();return}o.then(e=>{e||a()}).catch(a)},[]),O=(0,K.useCallback)(e=>{let t=l.current,n=c.current.selected;if(!e.page||!e.consuming||u.current!==e||e.controller.signal.aborted||!t||!n||e.scope!==lK(n)||t.session.history?.beforeEntryId!==e.before||!WK(t,n))return;let r=e.page,i=new Set(t.session.entries.map(e=>e.id)),a=[...r.entries.filter(e=>!i.has(e.id)),...t.session.entries],o=pe(a);for(;a.length>HK||o>UK;){let e=a.pop();if(!e)break;o-=pe(e)+ +!!a.length}c.current.callbacks.beforePrepend(),T({...t,anchor:a.at(-1)?.id??t.anchor,session:{...t.session,entries:a,bytes:o,truncation:GK(a,t.session.truncation,r.truncation.entriesOmitted),history:{...t.session.history,beforeEntryId:r.history?.beforeEntryId??null}}}),u.current=null,g(!1),v(null)},[T]);(0,K.useLayoutEffect)(()=>{if(w&&C!==S.current){x.current=o,u.current?.controller.abort(),u.current=null,d.current=null,f.current=null,g(!1),v(null),S.current=C,T(w);return}x.current!==o&&(x.current=o,u.current?.controller.abort(),u.current=null,d.current=null,l.current=s.current.state?.window??null,m(l.current),g(!1),v(null),f.current=null,b(e=>e+1),l.current||c.current.callbacks.onAnchorChange?.(null));let t=u.current;t&&!t.consuming&&e&&!WK(t.source,e)&&(t.controller.abort(),u.current=null);let n=l.current;if(!(!n||!e)){if(e.history?.anchorEntryId===n.anchor&&e.history.anchorOnBranch===!1){E(!0),c.current.callbacks.onRefresh?.();return}if(!WK(n,e)){D();return}v(e=>e===`historyValidationUnavailable`?null:e),(e.history?.leafEntryId??null)!==n.validatedLeaf&&(n=KK(n,e),T(n)),u.current?.page&&O(u.current)}},[o,e,E,D,T,O,w,C]),(0,K.useLayoutEffect)(()=>{let e=l.current;return e&&(uK(a,o,{...s.current.state,window:e}),c.current.callbacks.onAnchorChange?.({sessionId:e.session.id,sessionPath:e.session.path,entryId:e.anchor})),()=>{u.current?.controller.abort(),u.current=null,d.current=null,c.current.callbacks.onAnchorChange?.(null)}},[o,a]);let k=(0,K.useCallback)(()=>{let e=c.current.selected;return!l.current&&e?.history?.leafEntryId&&T({session:e,anchor:e.history.leafEntryId,validatedLeaf:e.history.leafEntryId}),l.current},[T]),A=(0,K.useCallback)((e,t)=>{let n=c.current.selected;if(!n||u.current)return;let r=e.session.history?.beforeEntryId;if(!r)return;let a={controller:new AbortController,scope:lK(n),before:r,source:e,consuming:t,anchor:{sessionId:n.id,sessionPath:n.path,entryId:e.anchor}};return u.current=a,t&&(g(!0),v(null)),a.done=(async()=>{try{let e=await i.sessionHistory(a.anchor,r,a.controller.signal);if(u.current!==a||a.controller.signal.aborted||a.scope!==lK(c.current.selected))return;if(e.id!==n.id||e.path!==n.path||e.anchorEntryId!==a.anchor.entryId||e.requestedBeforeEntryId!==r||e.history?.anchorEntryId!==a.anchor.entryId||e.history.anchorOnBranch!==!0)throw new ge(`Session history identity changed`,409,`SESSION_HISTORY_CHANGED`);a.page=e,a.consuming&&(O(a),u.current===a&&D())}catch(e){if(u.current!==a||a.controller.signal.aborted||(u.current=null,!a.consuming))return;g(!1),e instanceof ge&&e.code===`SESSION_HISTORY_CHANGED`?(E(!0),c.current.callbacks.onRefresh?.()):v(`historyUnavailable`)}})(),a.done},[O,E,i,D]),j=(0,K.useCallback)(async()=>{let e=c.current.selected;if(!e?.history?.leafEntryId)return;let t=l.current;if(t&&!WK(t,e)){D(!0);return}if(t||=k(),!t)return;let n=u.current;if(n){if(n.scope===lK(e)&&n.before===t.session.history?.beforeEntryId&&WK(n.source,e))return n.consuming=!0,g(!0),v(null),n.page&&O(n),n.done;n.controller.abort(),u.current=null}return A(t,!0)},[O,A,D,k]);(0,K.useEffect)(()=>{if(!t.preload){let e=u.current;e&&!e.consuming&&(e.controller.abort(),u.current=null,d.current=null);return}if(_||u.current||!e||p!==l.current)return;let n=p;if(n&&!WK(n,e))return;let r=n??(e.history?.leafEntryId?{session:e,anchor:e.history.leafEntryId,validatedLeaf:e.history.leafEntryId}:null);if(!r?.session.history?.beforeEntryId)return;let i=JSON.stringify([o,n?r.anchor:`initial`,n?r.session.history.beforeEntryId:null]);d.current!==i&&(d.current=i,A(r,!1))},[t.preload,_,o,e,p,A]);let M=p&&lK(p.session)===o?p:null,N=w??(M&&e&&WK(M,e)?KK(M,e):M),P=(0,K.useCallback)(()=>E(),[E]),F=!!(N&&e&&!WK(N,e));return{session:N?.session??e,engaged:!!N,hasMore:!!(N?.session??e)?.history?.beforeEntryId,hasNewer:!!(N&&N.anchor!==e?.history?.leafEntryId),verifying:F,loading:h,error:_,reset:y,retainReading:k,loadOlder:j,resetToLatest:P}}function JK(e){return e&&typeof e==`object`?e:{}}function YK(e){try{return JK(JSON.parse(e))}catch{return{}}}function XK(e){return e===`running`?`running`:e===`done`||e===`completed`?`done`:[`error`,`failed`,`aborted`,`killed`,`timed_out`].includes(String(e))?`error`:e===`uncertain`?`warn`:`unknown`}function ZK(e,t){if(e?.forkSnapshotToolResult)return`unknown`;if(t===`running`)return`running`;if(t===`unknown`)return`unknown`;if(t===`failed`||e?.isError)return`error`;if(t===`cancelled`||t===`timed_out`)return`warn`;if(!e?.toolName?.startsWith(`subagent`)){let t=XK(JK(e?.details).status);if(t!==`unknown`&&t!==`running`)return t}return t===`returned`||e?.isError===!1?`done`:`unknown`}function QK({status:e}){let{t}=W();return e===`running`?(0,q.jsx)(`span`,{className:`status-mark running`,role:`img`,"aria-label":t(`toolState_running`),children:(0,q.jsx)(`i`,{})}):e===`done`?(0,q.jsx)(rs,{className:`status-mark done`,"aria-label":t(`execution_done`)}):e===`error`?(0,q.jsx)(je,{className:`status-mark error`,"aria-label":t(`toolState_failed`)}):e===`warn`?(0,q.jsx)(`span`,{className:`status-mark warn`,role:`img`,"aria-label":t(`toolState_unknown`),children:`?`}):null}function $K({label:e,message:t,children:n}){return(0,q.jsxs)(`div`,{className:`execution-error`,role:`alert`,"aria-label":e,children:[(0,q.jsx)(ls,{"aria-hidden":`true`}),(0,q.jsxs)(`div`,{className:`execution-error-content`,children:[(0,q.jsx)(`p`,{children:t}),n]})]})}function eq({failed:e,error:t,retryPrompt:n,retryEntryId:r,canRetry:i,onRetry:a}){let{t:o}=W(),[s,c]=(0,K.useState)(!1);return e?(0,q.jsx)($K,{label:o(`modelRequestFailed`),message:t||o(`modelFailureUnknown`),children:n!==void 0&&r&&a&&(0,q.jsx)(`div`,{className:`provider-outcome-actions`,children:(0,q.jsxs)(`button`,{type:`button`,disabled:!i||s,onClick:()=>{c(!0),a(n,r).finally(()=>c(!1))},children:[(0,q.jsx)(he,{"aria-hidden":`true`}),o(s?`retryingPrompt`:`retryPrompt`)]})})}):(0,q.jsx)(`div`,{className:`provider-outcome aborted`,role:`status`,children:o(`modelRequestStopped`)})}function tq({attempts:e,state:t,retry:n,observed:r=!0}){let{t:i}=W(),a=t===`retrying`&&!r,o=n?.attempt,s=n?.maxAttempts,c=typeof o==`number`&&Number.isSafeInteger(o)&&o>0&&typeof s==`number`&&Number.isSafeInteger(s)&&s>=o,l=e.length>0||!!n?.errorMessage,u=(0,q.jsxs)(q.Fragment,{children:[t===`retrying`?(0,q.jsx)(Jc,{"aria-hidden":`true`}):(0,q.jsx)(wc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{role:t===`retrying`?`status`:void 0,children:[i(a?`modelReconnectUnknown`:t===`recovered`?`modelRequestRecovered`:t===`retrying`?n?`modelRetrying`:`modelEarlierAttempts`:t===`interrupted`?`modelRequestStopped`:`modelEarlierAttempts`),t===`retrying`&&c&&` ${o}/${s}`]}),t!==`retrying`&&(0,q.jsx)(`span`,{className:`provider-attempts-count`,children:i(`modelFailedAttempts`,{count:e.length})}),l&&(0,q.jsx)(os,{className:`reconnect-chevron`,"aria-hidden":`true`})]}),d=`provider-attempts ${t}${a?` unavailable`:``}`;return l?(0,q.jsxs)(`details`,{className:d,children:[(0,q.jsx)(`summary`,{children:u}),(0,q.jsxs)(`ol`,{children:[e.length===0&&(0,q.jsx)(`li`,{children:(0,q.jsx)(`p`,{children:n?.errorMessage})}),e.map(({entry:e,content:t},n)=>(0,q.jsxs)(`li`,{"data-history-entry":e.entryId??e.key,children:[(0,q.jsx)(`span`,{className:`provider-attempt-index`,"aria-hidden":`true`,children:String(n+1).padStart(2,`0`)}),(0,q.jsxs)(`div`,{className:`provider-attempt-body`,children:[(0,q.jsx)(`p`,{children:e.message.errorMessage||i(`modelFailureUnknown`)}),t?.map(e=>(0,q.jsx)(K.Fragment,{children:e.content},e.key))]})]},e.key))]})]}):(0,q.jsx)(`div`,{className:d,children:u})}function nq(e,t,n){let r=new Set,i=new Map,a=[],o=-1,s=(s,c=!1,l=!1)=>{if(a.length>0){let u=e[o]?.message.stopReason,d=s?.outcome===`cancelled`||u===`aborted`,f=u===`error`&&!d&&!(c&&t)&&!l;f&&r.add(o);let p=f?a.slice(0,-1):a,m=p.at(-1);m!==void 0&&i.set(m,{attempts:p.map(t=>e[t]),state:d?`interrupted`:u===`stop`||u===`length`||u===`toolUse`?`recovered`:c&&t&&n?`retrying`:`earlier`})}a=[],o=-1};return e.forEach((e,t)=>{e.optimistic||(e.timing?s(e.timing):e.forkSnapshotBoundary?s(void 0,!1,!0):e.message.role===`user`||e.message.role===`custom`&&e.message.customType===`openpi-setup-request`?s():e.message.role===`assistant`&&(o=t,e.message.stopReason===`error`&&a.push(t)))}),s(void 0,!0),{finalErrors:r,groups:i}}function rq(e,t){return zD(vK(e,t).split(` +`]},e.number))}):(0,q.jsx)(bK,{className:`evidence-log`,"aria-label":`Tool output`,children:d.output||s(`noOutput`)}),d.kind===`file`&&d.truncated&&(0,q.jsx)(`p`,{children:s(`toolReadMore`)}),d.recovery&&(0,q.jsxs)(`p`,{children:[s(`toolFullOutputReference`),` `,(0,q.jsx)(`code`,{children:d.recovery})]}),d.readRecovery&&(0,q.jsx)(`p`,{className:`evidence-warning`,children:d.readRecovery}),(0,q.jsxs)(`details`,{children:[(0,q.jsx)(`summary`,{children:s(`toolRawEvidence`)}),(0,q.jsx)(`p`,{children:(0,q.jsx)(`code`,{children:e.name})}),(0,q.jsx)(`p`,{children:(0,q.jsx)(`strong`,{children:s(`toolCallArguments`)})}),(0,q.jsx)(`pre`,{children:d.rawArguments}),(0,q.jsx)(`p`,{children:(0,q.jsx)(`strong`,{children:s(`toolCallOutput`)})}),(0,q.jsx)(`pre`,{children:d.rawResult})]}),o]})]})}function SK({changes:e,onReview:t}){let{t:n}=W(),[r,i]=(0,K.useState)(!1),a=(0,K.useId)();if(e.state===`unavailable`||e.files.length===0)return null;let o=e.state===`partial`,s=e.source===`file-tools`,c=e.fileCount===null;return(0,q.jsxs)(`section`,{className:`turn-changes`,"aria-label":n(`turnChangesReview`),children:[(0,q.jsxs)(`header`,{className:`turn-changes-header`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`turn-changes-summary`,"aria-expanded":r,"aria-controls":a,onClick:()=>i(e=>!e),children:[(0,q.jsx)(Ms,{className:`turn-changes-icon`,"aria-hidden":`true`}),(0,q.jsx)(`strong`,{title:n(s?`turnEditsScope`:`turnChangesScope`),children:n(s?c?`turnEditsPartial`:`turnEdits`:o?`turnChangesPartial`:`turnChanges`,{count:e.fileCount??e.files.length})}),!c&&!e.files.some(e=>e.binary||e.statsUnavailable)&&(0,q.jsxs)(`span`,{className:`turn-changes-totals`,children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,e.additions]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,e.deletions]})]}),o&&!s&&(0,q.jsx)(`span`,{className:`turn-changes-warning`,children:n(`turnChangesIncomplete`)}),(0,q.jsx)(is,{className:r?`up`:``,"aria-hidden":`true`})]}),(0,q.jsx)(`button`,{type:`button`,className:`turn-changes-review-button`,"aria-label":n(`turnChangesReview`),disabled:!t,onClick:()=>t?.(e.promptEntryId,e.files[0]?.path),children:n(`reviewChanges`)})]}),(0,q.jsx)(`div`,{className:`turn-changes-list`,id:a,hidden:!r,children:e.files.map(r=>{let i=Math.max(r.path.lastIndexOf(`/`),r.path.lastIndexOf(`\\`));return(0,q.jsxs)(`button`,{type:`button`,className:`turn-changes-file`,title:r.path,"aria-label":r.path,disabled:!t,onClick:()=>t?.(e.promptEntryId,r.path),children:[(0,q.jsxs)(`span`,{className:`turn-changes-path`,children:[(0,q.jsx)(`strong`,{children:r.path.slice(i+1)}),i>=0&&(0,q.jsx)(`span`,{children:r.path.slice(0,i)})]}),(0,q.jsx)(`span`,{className:`turn-changes-file-stats`,children:r.binary?(0,q.jsx)(`span`,{children:n(`gitReviewBinaryShort`)}):r.statsUnavailable?(0,q.jsx)(`span`,{title:n(`turnEditReason_${r.statsUnavailable}`),children:n(`turnEditStatsUnknown`)}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,r.additions]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,r.deletions]})]})})]},r.path)})})]})}function CK({item:e,position:t,current:n,onNavigate:r,onPreview:i}){let{t:a}=W(),o=(0,K.useRef)(()=>{}),s=ed({placement:`start`,delay:150,hideDelay:100,touchTrigger:`none`,onShow:(0,K.useCallback)(()=>i(e.entryId,()=>o.current()),[e.entryId,i])});return o.current=s.hide,(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{ref:s.ref,className:`turn-tick`,type:`button`,"data-turn-entry":e.entryId,"aria-label":a(`conversationTurnPosition`,{position:t}),"aria-describedby":s.describedBy,"aria-current":n?`location`:void 0,onClick:()=>{s.hide(),r(e.entryId)},children:(0,q.jsx)(`span`,{className:`turn-tick-mark`,"aria-hidden":`true`})}),s.renderHoverCard((0,q.jsx)(`span`,{className:`turn-preview`,children:e.previewState===`idle`||e.previewState===`loading`?(0,q.jsx)(`span`,{role:`status`,children:a(`turnPreviewLoading`)}):e.previewState===`unavailable`?(0,q.jsx)(`span`,{role:`status`,children:a(`turnPreviewUnavailable`)}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`turn-preview-prompt`,children:e.title}),e.reply&&(0,q.jsx)(`span`,{className:`turn-preview-reply`,children:e.reply})]})}),{className:`turn-preview-layer`})]})}function wK({items:e,viewport:t,onNavigate:n,readingHistory:r,onRequestPreview:i,enabled:a=!0,onHidden:o}){let{t:s}=W(),c=(0,K.useRef)(null),l=JSON.stringify(e.map(e=>e.entryId)),u=(0,K.useRef)(null),d=(0,K.useRef)(null),f=(0,K.useRef)(!1),p=(0,K.useRef)(0),[m,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)({top:0,height:0,visible:!1,current:[]}),v=(0,K.useCallback)(()=>{u.current?.hide(),u.current=null,d.current&&d.current.captureTarget.hasPointerCapture?.(d.current.pointerId)&&d.current.captureTarget.releasePointerCapture(d.current.pointerId),d.current=null,p.current++,o?.()},[o]),y=(0,K.useCallback)((e,n)=>{if(!a||!t.current||!c.current||c.current.style.visibility===`hidden`||t.current.checkVisibility?.()===!1||c.current.checkVisibility?.()===!1||getComputedStyle(t.current).display===`none`||getComputedStyle(c.current).display===`none`){n();return}u.current?.entryId!==e&&u.current?.hide(),u.current={entryId:e,hide:n},i?.(e)},[a,t,i]),b=(0,K.useCallback)((e,t=!1)=>{u.current?.hide();let r=++p.current;h(!1),Promise.resolve(n(e,t)).then(e=>{p.current===r&&e===!1&&h(!0)})},[n]);return(0,K.useLayoutEffect)(()=>{let e=t.current,n=e?.parentElement,i=JSON.parse(l);if(!e||!n){v();return}let o,s=r?n.querySelector(`.jump-to-latest`):null,u=()=>{o=void 0;let t=e.getBoundingClientRect(),r=n.getBoundingClientRect(),l=new Map;for(let t of e.querySelectorAll(`[data-history-entry]`)){let e=t.dataset.historyEntry;e&&!l.has(e)&&l.set(e,t)}let u=e.querySelector(`.conversation-turn`)??l.values().next().value,d=e.offsetWidth>0?t.width/e.offsetWidth:1,f=a&&t.height>0&&d>0&&!!u&&(t.right-u.getBoundingClientRect().right)/d>=48&&e.checkVisibility?.()!==!1&&getComputedStyle(e).display!==`none`&&(!c.current||getComputedStyle(c.current).display!==`none`);f||v();let p=s?.getBoundingClientRect(),m=Math.min(t.bottom-8,p&&p.height>0?p.top-12:1/0),h=Math.max(0,m-t.top-8),g=i.flatMap(e=>{let n=l.get(e);if(!n)return[];let r=(n.closest(`.conversation-turn`)??n).getBoundingClientRect();return r.bottom>t.top+16&&r.tope.top===y.top&&e.height===y.height&&e.visible===f&&e.current.join(`\0`)===g.join(`\0`)?e:y)},d=()=>{o===void 0&&(o=requestAnimationFrame(u))};u(),e.addEventListener(`scroll`,d),window.addEventListener(`resize`,d);let f=typeof ResizeObserver>`u`?void 0:new ResizeObserver(d);f?.observe(e),f?.observe(n),s&&f?.observe(s);for(let t of e.children)f?.observe(t);let p=new MutationObserver(d);return p.observe(e,{childList:!0,subtree:!0}),()=>{o!==void 0&&cancelAnimationFrame(o),e.removeEventListener(`scroll`,d),window.removeEventListener(`resize`,d),f?.disconnect(),p.disconnect()}},[l,t,r,a,v]),(0,K.useLayoutEffect)(()=>{if(g.height,!g.visible||d.current)return;let e=c.current,t=Array.from(e?.querySelectorAll(`[data-turn-entry]`)??[]),n=t.find(e=>e===document.activeElement)??t.find(e=>e.matches(`:hover`))??t.find(e=>g.current.includes(e.dataset.turnEntry??``));if(!e||!n)return;let r=e.getBoundingClientRect(),i=n.getBoundingClientRect();i.topr.bottom&&(e.scrollTop+=i.bottom-r.bottom)},[g.current,g.height,g.visible,l]),(0,K.useLayoutEffect)(()=>{let n=t.current;if(!n)return;let r=t=>{if(!a||t.defaultPrevented||t.isComposing||!t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||![`ArrowUp`,`ArrowDown`].includes(t.key)||!n.parentElement?.contains(document.activeElement)||n.checkVisibility?.()===!1||getComputedStyle(n).display===`none`||getComputedStyle(n).visibility===`hidden`||n.getBoundingClientRect().height<=0)return;let r=new Map;for(let e of n.querySelectorAll(`[data-history-entry]`)){let t=e.dataset.historyEntry;t&&!r.has(t)&&r.set(t,e)}let i=e.flatMap((e,t)=>{let n=r.get(e.entryId);return n?[{item:e,index:t,top:n.getBoundingClientRect().top}]:[]}),o=n.getBoundingClientRect().top,s;if(t.key===`ArrowDown`){let t=i.findIndex(e=>e.top>o+24);s=i.length===0?e[0]:t<0?e[i.at(-1).index+1]:e[(i[t-1]?.index??-1)+1]}else{for(let t=i.length-1;t>=0;t--){let n=i[t];if(Math.abs(n.top-o)<=24){s=e[n.index-1];break}if(n.tope.top>o+24)&&(s=i[0]?.item),i.length===0&&(s=e.at(-1))}s&&(t.preventDefault(),b(s.entryId))};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[t,a,e,b]),(0,K.useLayoutEffect)(()=>()=>v(),[v]),e.length<4?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`nav`,{ref:c,className:`turn-rail`,"aria-label":s(`conversationTurns`),style:{top:g.top,maxHeight:g.height,visibility:g.visible?`visible`:`hidden`},onClickCapture:e=>{f.current&&=(e.preventDefault(),e.stopPropagation(),!1)},onPointerDown:e=>{if(!e.isPrimary||e.button!==0)return;let t=e.target instanceof Element?e.target.closest(`.turn-tick`):null;!t||!e.currentTarget.contains(t)||(f.current=!1,d.current={pointerId:e.pointerId,captureTarget:t,y:e.clientY,moved:!1},t.setPointerCapture?.(e.pointerId))},onPointerMove:e=>{let t=d.current;if(!t||t.pointerId!==e.pointerId||Math.abs(e.clientY-t.y)<3&&!t.moved)return;t.moved=!0,f.current=!0;let n=Array.from(e.currentTarget.querySelectorAll(`[data-turn-entry]`)).find(t=>{let n=t.getBoundingClientRect();return e.clientY>=n.top&&e.clientY{let t=d.current;d.current=null,t?.captureTarget.hasPointerCapture?.(e.pointerId)&&t.captureTarget.releasePointerCapture(e.pointerId)},onPointerCancel:e=>{let t=d.current;d.current=null,t?.captureTarget.hasPointerCapture?.(e.pointerId)&&t.captureTarget.releasePointerCapture(e.pointerId),f.current=!1},children:e.map((e,t)=>(0,q.jsx)(CK,{item:e,position:t+1,current:g.current.includes(e.entryId),onNavigate:b,onPreview:y},e.entryId))}),m&&(0,q.jsx)(`span`,{className:`turn-navigation-error`,role:`status`,children:s(`turnPreviewUnavailable`)})]})}function TK(e){if(e.role!==`custom`||e.customType!==`openpi-setup-request`||e.truncation?.details)return e;let t=e.details;return!t||typeof t!=`object`||Array.isArray(t)||!(`command`in t)||t.command!==`openpi-setup`&&t.command!==`my-pi-setup`||!(`request`in t)||typeof t.request!=`string`?e:{...e,role:`user`,content:`/${t.command}${t.request?` ${t.request}`:``}`,parts:void 0}}function EK(e,t){let n=e.parentId,r=new Set;for(let e=0;n&&e<32;e++){if(r.has(n))return;r.add(n);let e=t(n);if(!e||e.id!==n)return;if(e.message?.role!==`system`)return e.message;n=e.parentId}}function DK(e,t){let n=TK(e);return e.customType===`openpi-setup-request`&&n.role===`user`&&t?.role===`user`&&t.customType===`openpi-web-command-input`&&typeof t.commandId==`string`&&t.commandId.length>0&&t.commandId.length<=128&&!/[\u0000-\u001f\u007f]/u.test(t.commandId)&&t.content===n.content}function OK(e){if(e.role===`toolResult`&&e.toolCallId&&!e.toolCallId.includes(`[truncated]`))return`tool-result-${e.toolCallId}`;if(e.role!==`assistant`||e.truncation?.partsOmitted)return;let t=e.parts?.filter(e=>e.type===`toolCall`);if(!(!t?.length||t.some(e=>!e.id||e.id.includes(`[truncated]`))))return`tool-calls-${JSON.stringify(t.map(e=>e.id))}`}function kK(e){let t=OK(e);if(t)return t;if(e.timestamp!==void 0)return`message-${e.role}-${e.timestamp}`}function AK(e){return[`assistant`,`toolResult`].includes(e.role??``)&&!e.truncation?.truncated?JSON.stringify(e):null}function jK(e){return JSON.stringify([e.role,e.content,(e.parts??[]).filter(t=>e.role!==`user`||t.type!==`text`).map(t=>t.type===`image`?[t.type,t.mimeType,e.role===`user`?void 0:t.name]:t.type),e.stopReason,e.errorMessage,e.toolCallId])}function MK(e){return e.role===`user`?jK(e):JSON.stringify({...e,timestamp:void 0})}var NK=new WeakMap;function PK(e,t){let n=NK.get(e),r=n?.get(t);if(r&&r.length===e.length&&r.head===e[0]&&r.tail===e[e.length-1])return r.projection;let i=new Map(e.map(e=>[e.id,e])),a=new Map;for(let t of e){let e=t.message&&AK(t.message);if(!e)continue;let n=a.get(e)??[];n.push(t),a.set(e,n)}let o=e.flatMap(e=>{if(e.forkSnapshotBoundary)return[{key:e.id,entryId:e.id,timestamp:e.timestamp,forkSnapshotBoundary:!0,message:{role:`custom`,content:``}}];if(e.type===`compaction`)return[{key:e.id,entryId:e.id,timestamp:e.timestamp,compaction:!0,message:{role:`custom`,content:``}}];if(`turnTiming`in e&&e.turnTiming&&e.turnTiming.sessionId===t)return[{key:e.id,timestamp:e.timestamp,timing:e.turnTiming,message:{role:`custom`,content:``}}];if(e.type!==`message`||!e.message)return[];let n=TK(e.message),r=EK(e,e=>i.get(e));return DK(e.message,r)?[]:[{key:e.id,entryId:e.id,timestamp:e.timestamp,message:n}]}),s=new Map,c=new Map;o.forEach((e,t)=>{if(e.entryId&&s.set(e.entryId,t),e.timing||e.compaction||e.forkSnapshotBoundary)return;let n=kK(e.message)??e.entryId??e.key,r=c.get(n)??[];r.push(t),c.set(n,r)});let l=[];for(let e of c.values())if(!(e.length<2))for(let t of e){let e=o[t].entryId;e&&l.push(e)}let u=new Map,d=0;for(let t of e){if(t.message?.role!==`custom`||t.message.truncation?.truncated)continue;let e=MK(t.message),n=u.get(e)??[];n.push(d),u.set(e,n),d++}let f=o.map(e=>({identity:kK(e.message),signature:MK(e.message),content:e.message.content})),p=new Map,m=new Map;f.forEach((e,t)=>{let n=m.get(e.signature)??[];if(n.push(t),m.set(e.signature,n),e.identity===void 0)return;let r=p.get(e.identity)??[];r.push(t),p.set(e.identity,r)});let h=new Map(e.map((e,t)=>[e.id,t])),g=o.filter(e=>e.message.role===`user`).map(e=>({key:e.entryId??e.key,position:h.get(e.entryId??e.key),parentId:i.get(e.entryId??e.key)?.parentId,signature:jK(e.message)})),_=new Map;for(let e of g){let t=_.get(e.signature)??[];t.push(e),_.set(e.signature,t)}let v={nativeById:i,exactNative:a,baseEntries:o,indexById:s,lookupIndexes:c,ambiguousNativeIds:l,customIndexes:u,nativeByIdentity:p,nativeByLegacySignature:m,nativeMessages:f,promptCandidates:g,promptsBySignature:_,commandInputs:new Map(o.flatMap(e=>e.message.role===`user`&&e.message.customType===`openpi-web-command-input`&&e.message.commandId?[[e.message.commandId,e.entryId??e.key]]:[])),persistedPositions:h};return n||(n=new Map,NK.set(e,n)),n.set(t,{projection:v,length:e.length,head:e[0],tail:e[e.length-1]}),v}function FK(e,t){if(!e)return-1;for(let n of e)if(!t.has(n))return n;return-1}function IK(e,t){let n=[e.timingKey,e.key,e.entryId,e.ambiguousTimingIdentity?void 0:kK(e.message)];for(let e of n){if(!e)continue;let n=t[e];if(n!==void 0)return n}}function LK(e,t,n){let{nativeRowKeys:r,ambiguousTimingIds:i}=n,a=e.selectedSession,o=PK(a?.entries??[],a?.id);for(let e of r.keys())o.nativeById.has(e)||r.delete(e);for(let e of i)o.nativeById.has(e)||i.delete(e);let s=new Map;for(let e of t){if(e.optimistic)continue;let t=AK(e.message);if(!t)continue;let n=s.get(t)??[];n.push(e),s.set(t,n)}let c=new Set(r.values());for(let[e,t]of s){let n=o.exactNative.get(e);if(n?.length!==1||t.length!==1)continue;let a=n[0].id,s=t[0].key;r.has(a)||i.has(a)||c.has(s)||o.nativeById.has(s)||(r.set(a,s),c.add(s))}for(let e of o.ambiguousNativeIds)i.add(e);let l=new Map,u=new Set;for(let e of t){let t=kK(e.message)??e.key,n=o.lookupIndexes.get(t);if(!n)continue;let a=MK(e.message),s=n.filter(e=>o.nativeMessages[e]?.signature===a);if((s.length!==n.length||n.length>1)&&u.add(t),s.length===1){let n=s[0],a=o.baseEntries[n].entryId,c=a?r.get(a):void 0;if(c&&c!==e.key||a&&i.has(a)&&!c&&e.key!==a){u.add(t);continue}let d=l.get(n);d===void 0||d===e.key?l.set(n,e.key):(l.set(n,null),u.add(t))}}for(let e of u)for(let t of o.lookupIndexes.get(e)??[]){let e=o.baseEntries[t].entryId;e&&i.add(e)}let d=new Set(t.flatMap(e=>e.optimistic?.projectedEntryId?[e.optimistic.projectedEntryId]:[])),f=[],p=[],m=e.selectedExecution?.sessionId===a?.id&&e.selectedExecution?.sessionPath===a?.path?e.selectedExecution:void 0,h=m?.pendingFollowUps??0,g=Math.max(0,t.filter(e=>e.optimistic?.admitted&&!e.optimistic.projectedEntryId&&!o.commandInputs.has(e.optimistic.commandId)).length-h),_=0,v=new Set,y=new Set,b=new Set,x=[];for(let e of t){if(e.optimistic?.projectedEntryId)continue;if(e.message.role===`custom`&&!e.message.truncation?.truncated){let t=MK(e.message),n=FK(o.customIndexes.get(t),y);if(n>=0){y.add(n);continue}}let n=e.optimistic?.commandId??(e.key.startsWith(`optimistic-`)?e.key.slice(11):void 0),r=n?o.commandInputs.get(n):void 0;if(r){e.optimistic&&f.push({key:e.key,entryId:r});continue}let i=TK(e.message);if(i.role===`user`&&e.optimistic){let t=e.optimistic.afterEntryId===null?-1:o.persistedPositions.get(e.optimistic.afterEntryId),n=!e.optimistic.admitted||_>=g?void 0:o.promptsBySignature.get(jK(i))?.find(n=>n.position!==void 0&&(t===void 0?n.parentId===e.optimistic?.afterEntryId:n.position>t)&&!d.has(n.key));if(n){d.add(n.key),f.push({key:e.key,entryId:n.key}),_++;continue}}else{let e=i.role===`user`?t.find(e=>e.optimistic?.admitted&&!e.optimistic.projectedEntryId&&!v.has(e.key)&&!f.some(t=>t.key===e.key)&&e.optimistic.sessionId===a?.id&&e.optimistic.sessionPath===a?.path&&jK(TK(e.message))===jK(i)):void 0;if(e){v.add(e.key);continue}let n=kK(i),r=OK(i),s=MK(i),c=i.truncation?.transport?i.content.replace(/\n\[truncated\]$/,``):void 0,l=n===void 0?FK(o.nativeByLegacySignature.get(s),b):(o.nativeByIdentity.get(n)??[]).find(e=>(r!==void 0||!b.has(e))&&(r!==void 0||(c===void 0?o.nativeMessages[e]?.signature===s:o.nativeMessages[e]?.content.startsWith(c))))??-1;if(l>=0){b.add(l);continue}}let s={key:e.key,timingKey:e.key,ambiguousTimingIdentity:u.has(kK(i)??e.key)?!0:void 0,timestamp:e.timestamp??new Date().toISOString(),message:i,optimistic:e.optimistic};i.role===`user`&&e.optimistic?p.push(s):x.push(s)}let S=new Map;for(let e of m?.queuedMessages??[])S.set(e,(S.get(e)??0)+1);let C=p.filter(e=>{if(!e.optimistic?.admitted||e.optimistic.commandId===m?.activeTurn?.commandId)return!0;let t=S.get(e.message.content)??0;return!t||(S.set(e.message.content,t-1),!1)}),w=new Map(t.flatMap(e=>e.optimistic?.projectedEntryId?[[e.optimistic.projectedEntryId,e.key]]:[]));for(let e of f)w.set(e.entryId,e.key);let T=o.baseEntries,E=(e,t)=>{T===o.baseEntries&&(T=o.baseEntries.slice()),T[e]=t};for(let e of i){let t=o.indexById.get(e);if(t===void 0)continue;let n=T[t];!n||n.ambiguousTimingIdentity||E(t,{...n,ambiguousTimingIdentity:!0})}for(let[e,t]of l){if(t===null)continue;let n=T[e];!n||n.timingKey===t||E(e,{...n,timingKey:t})}for(let[e,t]of r){let n=o.indexById.get(e);if(n===void 0)continue;let r=T[n];!r||r.key===t||E(n,{...r,key:t})}for(let[e,t]of w){let n=o.indexById.get(e);if(n===void 0)continue;let r=T[n];!r||r.key===t||E(n,{...r,key:t})}return{entries:T.concat(x,C),projectedPrompts:f}}function RK({message:e,sessionId:t,path:n,entryId:r}){let{t:i}=W(),[a,o]=(0,K.useState)(null),s=JSON.stringify([t,n,r]),c=e.parts?.filter(e=>e.type===`image`)??[];if(c.length===0)return null;let l=new Map,u=a?.scope===s?a:null,d=()=>o(e=>e?{...e,open:!1}:null);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`section`,{className:`message-attachments`,"aria-label":i(`imageAttachments`),children:c.map(e=>{let a=`${e.mimeType}:${e.name??``}:${e.previewUrl??``}`,c=l.get(a)??0;l.set(a,c+1);let u=`${a}:${c}`,d=t&&n&&r&&typeof e.sourcePartIndex==`number`&&Number.isSafeInteger(e.sourcePartIndex)&&e.sourcePartIndex>=0?{id:`${r}:${e.sourcePartIndex}`,entryId:r,partIndex:e.sourcePartIndex,kind:`image`,name:e.name??i(`attachedImage`)}:null,f=e.previewUrl?(0,q.jsx)(`img`,{src:e.previewUrl,alt:e.name??i(`attachedImage`)},`preview`):d&&t&&n?(0,q.jsx)(`span`,{className:`message-attachment-preview`,children:(0,q.jsx)(tG,{sessionId:t,path:n,source:d,thumbnail:!0})},`preview`):(0,q.jsx)(qs,{"aria-hidden":`true`},`preview`),p=(0,q.jsx)(`span`,{children:e.name??i(`attachedImage`)},`name`);return d?(0,q.jsxs)(`button`,{className:`message-attachment`,type:`button`,title:d.name,"aria-label":d.name,onClick:()=>o({scope:s,source:d,open:!0}),children:[f,p]},u):(0,q.jsxs)(`div`,{className:`message-attachment`,children:[f,p]},u)})}),t&&n&&u&&(0,q.jsx)(aG,{sessionId:t,path:n,source:u.source,open:u.open,onSelect:d,onClose:d})]})}function zK(e,t,n){let r=(0,K.useMemo)(()=>new de,[]),i=e?.history?.leafEntryId??e?.entries.at(-1)?.id,a=e?.id,o=e?.path,s=JSON.stringify([e?.id,e?.path,i]),c=(0,K.useRef)(s);c.current=s;let[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)({}),p=(0,K.useRef)(new Map),m=(0,K.useMemo)(()=>a&&o&&i?{sessionId:a,sessionPath:o,entryId:i}:null,[a,o,i]);(0,K.useEffect)(()=>{if(u(null),f({}),!n||!m)return;let e=new AbortController,t=async()=>{try{let t=null,n=[],i=new Set;for(let a=0;a<10;a++){let a=await r.sessionPromptHistory(m,t,e.signal);if(e.signal.aborted||c.current!==s||a.sessionId!==m.sessionId||a.sessionPath!==m.sessionPath||a.anchorEntryId!==m.entryId||a.requestedBeforeEntryId!==t||a.entryIds.length>100||a.entryIds.some(e=>!e||i.has(e))||new Set(a.entryIds).size!==a.entryIds.length||a.nextBeforeEntryId!==null&&(a.entryIds.length===0||a.nextBeforeEntryId!==a.entryIds[0]))return;for(let e of a.entryIds)i.add(e);if(n=[...a.entryIds,...n],a.nextBeforeEntryId===null){u({scope:s,ids:n});return}t=a.nextBeforeEntryId}}catch{}},i=typeof window.requestIdleCallback==`function`?window.requestIdleCallback(()=>void t(),{timeout:2e3}):void 0,a=i===void 0?window.setTimeout(()=>void t(),0):void 0;return()=>{e.abort(),i!==void 0&&window.cancelIdleCallback(i),a!==void 0&&window.clearTimeout(a);for(let e of p.current.values())e.abort();p.current.clear()}},[s,n,m,r]);let h=(0,K.useMemo)(()=>{let e=new Map(t.map(e=>[e.entryId,e]));if(l?.scope!==s)return t;let n=new Set(l.ids);return[...l.ids.map(t=>e.get(t)??d[t]??{entryId:t,title:``,previewState:`idle`}),...t.filter(e=>!n.has(e.entryId))]},[l,s,t,d]),g=(0,K.useRef)(h);return g.current=h,{items:h,requestPreview:(0,K.useCallback)(e=>{if(!n||!m||c.current!==s||p.current.has(e))return;let t=g.current.find(t=>t.entryId===e);if(!t||t.previewState===void 0||t.previewState===`ready`)return;let i=new AbortController;p.current.set(e,i),f(t=>({...t,[e]:{entryId:e,title:``,previewState:`loading`}})),r.sessionPromptPreview(m,e,i.signal).then(t=>{if(!(i.signal.aborted||c.current!==s)){if(t.sessionId!==m.sessionId||t.sessionPath!==m.sessionPath||t.anchorEntryId!==m.entryId||t.entryId!==e||typeof t.prompt!=`string`||typeof t.response!=`string`||Array.from(t.prompt).length>240||Array.from(t.response).length>240)throw Error(`Unverified preview`);f(n=>({...n,[e]:{entryId:e,title:t.prompt,reply:t.response,previewState:`ready`}}))}}).catch(()=>{!i.signal.aborted&&c.current===s&&f(t=>({...t,[e]:{entryId:e,title:``,previewState:`unavailable`}}))}).finally(()=>{p.current.get(e)===i&&p.current.delete(e)})},[n,m,s,r])}}var BK=`[data-history-entry], [data-history-message], [data-history-result]`;function VK(e,t,n,r){let i=(0,K.useRef)(null),a=(0,K.useCallback)(()=>{let r=e.current;if(!r||t.current){i.current=null;return}let a=r.getBoundingClientRect(),o=Array.from(r.querySelectorAll(BK)).filter(e=>{let t=e.getBoundingClientRect();if(t.height<=0||t.bottom<=a.top||t.top>=a.bottom)return!1;for(let t=e.parentElement;t&&t!==r;t=t.parentElement){if(t.hidden)return!1;let e=getComputedStyle(t);if(/^(auto|scroll|overlay)$/.test(e.overflowY)&&t.scrollHeight>t.clientHeight)return!1}return!0}),s=o.find(e=>!o.some(t=>t!==e&&e.contains(t)));i.current=s?{scope:n,element:s,offset:s.getBoundingClientRect().top-a.top}:null},[e,t,n]),o=(0,K.useCallback)(()=>{let a=e.current,o=i.current;if(!a||t.current||!o||o.scope!==n)return;if(!a.contains(o.element)||!o.element.getClientRects().length){i.current=null;return}let s=o.element.getBoundingClientRect().top-a.getBoundingClientRect().top-o.offset;if(Math.abs(s)>.5){let e=a.scrollTop+s;typeof a.scrollTo==`function`?a.scrollTo({top:e,behavior:`instant`}):a.scrollTop=e,r.current=a.scrollTop}},[e,t,n,r]);return(0,K.useLayoutEffect)(()=>{o(),a()}),{capture:a,restore:o,clear:(0,K.useCallback)(()=>{i.current=null},[])}}var HK=1e3,UK=ye*4;function WK(e,t){return t.history?.leafEntryId===e.validatedLeaf||t.history?.anchorEntryId===e.anchor&&t.history.anchorOnBranch===!0}function GK(e,t,n=t.entriesOmitted){let r=e.filter(e=>e.message?.truncation).length,i=e.reduce((e,t)=>e+(t.message?.truncation?.partsOmitted??0),0);return{...t,entriesOmitted:n,messagesTruncated:r,messagePartsOmitted:i,truncated:n>0||r>0||i>0}}function KK(e,t){let n=t.history?.leafEntryId??null;if(n===e.validatedLeaf)return e;let r=t.entries.findIndex(t=>t.id===e.anchor),i=r>=0?t.entries.slice(r+1):t.entries[0]?.parentId===e.anchor?t.entries:null,a=i?.reduce((e,t)=>e+pe(t)+1,0)??0;return i&&e.session.entries.length+i.length<=HK&&e.session.bytes+a<=UK?{...e,anchor:n??e.anchor,validatedLeaf:n,session:{...e.session,entries:[...e.session.entries,...i],bytes:e.session.bytes+a,truncation:GK([...e.session.entries,...i],e.session.truncation)}}:{...e,validatedLeaf:n}}function qK(e,t,n,r){let i=(0,K.useMemo)(()=>new de,[]),a=(0,K.useMemo)(()=>n??new Map,[n]),o=lK(e),s=(0,K.useRef)({scope:o,state:a.get(o)});s.current.scope!==o&&(s.current={scope:o,state:a.get(o)});let c=(0,K.useRef)({selected:e,callbacks:t});c.current={selected:e,callbacks:t};let l=(0,K.useRef)(s.current.state?.window??null),u=(0,K.useRef)(null),d=(0,K.useRef)(null),f=(0,K.useRef)(null),[p,m]=(0,K.useState)(l.current),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(null),[y,b]=(0,K.useState)(0),x=(0,K.useRef)(o),S=(0,K.useRef)(null),C=r?JSON.stringify([r.sessionId,r.sessionPath,r.entryId,r.revision]):null,w=r&&e&&C!==S.current&&r.sessionId===e.id&&r.sessionPath===e.path&&r.session.id===e.id&&r.session.path===e.path&&r.session.history?.anchorEntryId===r.entryId&&r.session.history.anchorOnBranch===!0&&r.session.entries.some(e=>e.id===r.entryId)?{session:r.session,anchor:r.session.entries.at(-1).id,validatedLeaf:r.session.history?.leafEntryId??null}:null,T=(0,K.useCallback)(e=>{l.current=e,uK(a,lK(e.session),{window:e}),m(e),c.current.callbacks.onAnchorChange?.({sessionId:e.session.id,sessionPath:e.session.path,entryId:e.anchor})},[a]),E=(0,K.useCallback)((e=!1)=>{u.current?.controller.abort(),u.current=null,d.current=null,a.delete(lK(l.current?.session??c.current.selected)),l.current=null,a.persist?.(),m(null),g(!1),v(e?`historyChanged`:null),f.current=null,c.current.callbacks.onAnchorChange?.(null),b(e=>e+1)},[a]),D=(0,K.useCallback)((e=!1)=>{let t=l.current,n=c.current.selected;if(!t||!n)return;let r=JSON.stringify([lK(n),t.anchor,n.history?.leafEntryId]);if(!e&&f.current?.key===r)return;let i={key:r};f.current=i,v(null);let a=()=>{f.current===i&&l.current===t&&(u.current?.controller.abort(),u.current=null,g(!1),v(`historyValidationUnavailable`))};c.current.callbacks.onAnchorChange?.({sessionId:t.session.id,sessionPath:t.session.path,entryId:t.anchor});let o=c.current.callbacks.onRefresh?.();if(!o){a();return}o.then(e=>{e||a()}).catch(a)},[]),O=(0,K.useCallback)(e=>{let t=l.current,n=c.current.selected;if(!e.page||!e.consuming||u.current!==e||e.controller.signal.aborted||!t||!n||e.scope!==lK(n)||t.session.history?.beforeEntryId!==e.before||!WK(t,n))return;let r=e.page,i=new Set(t.session.entries.map(e=>e.id)),a=[...r.entries.filter(e=>!i.has(e.id)),...t.session.entries],o=pe(a);for(;a.length>HK||o>UK;){let e=a.pop();if(!e)break;o-=pe(e)+ +!!a.length}c.current.callbacks.beforePrepend(),T({...t,anchor:a.at(-1)?.id??t.anchor,session:{...t.session,entries:a,bytes:o,truncation:GK(a,t.session.truncation,r.truncation.entriesOmitted),history:{...t.session.history,beforeEntryId:r.history?.beforeEntryId??null}}}),u.current=null,g(!1),v(null)},[T]);(0,K.useLayoutEffect)(()=>{if(w&&C!==S.current){x.current=o,u.current?.controller.abort(),u.current=null,d.current=null,f.current=null,g(!1),v(null),S.current=C,T(w);return}x.current!==o&&(x.current=o,u.current?.controller.abort(),u.current=null,d.current=null,l.current=s.current.state?.window??null,m(l.current),g(!1),v(null),f.current=null,b(e=>e+1),l.current||c.current.callbacks.onAnchorChange?.(null));let t=u.current;t&&!t.consuming&&e&&!WK(t.source,e)&&(t.controller.abort(),u.current=null);let n=l.current;if(!(!n||!e)){if(e.history?.anchorEntryId===n.anchor&&e.history.anchorOnBranch===!1){E(!0),c.current.callbacks.onRefresh?.();return}if(!WK(n,e)){D();return}v(e=>e===`historyValidationUnavailable`?null:e),(e.history?.leafEntryId??null)!==n.validatedLeaf&&(n=KK(n,e),T(n)),u.current?.page&&O(u.current)}},[o,e,E,D,T,O,w,C]),(0,K.useLayoutEffect)(()=>{let e=l.current;return e&&(uK(a,o,{...s.current.state,window:e}),c.current.callbacks.onAnchorChange?.({sessionId:e.session.id,sessionPath:e.session.path,entryId:e.anchor})),()=>{u.current?.controller.abort(),u.current=null,d.current=null,c.current.callbacks.onAnchorChange?.(null)}},[o,a]);let k=(0,K.useCallback)(()=>{let e=c.current.selected;return!l.current&&e?.history?.leafEntryId&&T({session:e,anchor:e.history.leafEntryId,validatedLeaf:e.history.leafEntryId}),l.current},[T]),A=(0,K.useCallback)((e,t)=>{let n=c.current.selected;if(!n||u.current)return;let r=e.session.history?.beforeEntryId;if(!r)return;let a={controller:new AbortController,scope:lK(n),before:r,source:e,consuming:t,anchor:{sessionId:n.id,sessionPath:n.path,entryId:e.anchor}};return u.current=a,t&&(g(!0),v(null)),a.done=(async()=>{try{let e=await i.sessionHistory(a.anchor,r,a.controller.signal);if(u.current!==a||a.controller.signal.aborted||a.scope!==lK(c.current.selected))return;if(e.id!==n.id||e.path!==n.path||e.anchorEntryId!==a.anchor.entryId||e.requestedBeforeEntryId!==r||e.history?.anchorEntryId!==a.anchor.entryId||e.history.anchorOnBranch!==!0)throw new ge(`Session history identity changed`,409,`SESSION_HISTORY_CHANGED`);a.page=e,a.consuming&&(O(a),u.current===a&&D())}catch(e){if(u.current!==a||a.controller.signal.aborted||(u.current=null,!a.consuming))return;g(!1),e instanceof ge&&e.code===`SESSION_HISTORY_CHANGED`?(E(!0),c.current.callbacks.onRefresh?.()):v(`historyUnavailable`)}})(),a.done},[O,E,i,D]),j=(0,K.useCallback)(async()=>{let e=c.current.selected;if(!e?.history?.leafEntryId)return;let t=l.current;if(t&&!WK(t,e)){D(!0);return}if(t||=k(),!t)return;let n=u.current;if(n){if(n.scope===lK(e)&&n.before===t.session.history?.beforeEntryId&&WK(n.source,e))return n.consuming=!0,g(!0),v(null),n.page&&O(n),n.done;n.controller.abort(),u.current=null}return A(t,!0)},[O,A,D,k]);(0,K.useEffect)(()=>{if(!t.preload){let e=u.current;e&&!e.consuming&&(e.controller.abort(),u.current=null,d.current=null);return}if(_||u.current||!e||p!==l.current)return;let n=p;if(n&&!WK(n,e))return;let r=n??(e.history?.leafEntryId?{session:e,anchor:e.history.leafEntryId,validatedLeaf:e.history.leafEntryId}:null);if(!r?.session.history?.beforeEntryId)return;let i=JSON.stringify([o,n?r.anchor:`initial`,n?r.session.history.beforeEntryId:null]);d.current!==i&&(d.current=i,A(r,!1))},[t.preload,_,o,e,p,A]);let M=p&&lK(p.session)===o?p:null,N=w??(M&&e&&WK(M,e)?KK(M,e):M),P=(0,K.useCallback)(()=>E(),[E]),F=!!(N&&e&&!WK(N,e));return{session:N?.session??e,engaged:!!N,hasMore:!!(N?.session??e)?.history?.beforeEntryId,hasNewer:!!(N&&N.anchor!==e?.history?.leafEntryId),verifying:F,loading:h,error:_,reset:y,retainReading:k,loadOlder:j,resetToLatest:P}}function JK(e){return e&&typeof e==`object`?e:{}}function YK(e){try{return JK(JSON.parse(e))}catch{return{}}}function XK(e){return e===`running`?`running`:e===`done`||e===`completed`?`done`:[`error`,`failed`,`aborted`,`killed`,`timed_out`].includes(String(e))?`error`:e===`uncertain`?`warn`:`unknown`}function ZK(e,t){if(e?.forkSnapshotToolResult)return`unknown`;if(t===`running`)return`running`;if(t===`unknown`)return`unknown`;if(t===`failed`||e?.isError)return`error`;if(t===`cancelled`||t===`timed_out`)return`warn`;if(!e?.toolName?.startsWith(`subagent`)){let t=XK(JK(e?.details).status);if(t!==`unknown`&&t!==`running`)return t}return t===`returned`||e?.isError===!1?`done`:`unknown`}function QK({status:e}){let{t}=W();return e===`running`?(0,q.jsx)(`span`,{className:`status-mark running`,role:`img`,"aria-label":t(`toolState_running`),children:(0,q.jsx)(`i`,{})}):e===`done`?(0,q.jsx)(rs,{className:`status-mark done`,"aria-label":t(`execution_done`)}):e===`error`?(0,q.jsx)(je,{className:`status-mark error`,"aria-label":t(`toolState_failed`)}):e===`warn`?(0,q.jsx)(`span`,{className:`status-mark warn`,role:`img`,"aria-label":t(`toolState_unknown`),children:`?`}):null}function $K({label:e,message:t,children:n}){return(0,q.jsxs)(`div`,{className:`execution-error`,role:`alert`,"aria-label":e,children:[(0,q.jsx)(ls,{"aria-hidden":`true`}),(0,q.jsxs)(`div`,{className:`execution-error-content`,children:[(0,q.jsx)(`p`,{children:t}),n]})]})}function eq({failed:e,error:t,retryPrompt:n,retryEntryId:r,canRetry:i,onRetry:a}){let{t:o}=W(),[s,c]=(0,K.useState)(!1);return e?(0,q.jsx)($K,{label:o(`modelRequestFailed`),message:t||o(`modelFailureUnknown`),children:n!==void 0&&r&&a&&(0,q.jsx)(`div`,{className:`provider-outcome-actions`,children:(0,q.jsxs)(`button`,{type:`button`,disabled:!i||s,onClick:()=>{c(!0),a(n,r).finally(()=>c(!1))},children:[(0,q.jsx)(he,{"aria-hidden":`true`}),o(s?`retryingPrompt`:`retryPrompt`)]})})}):(0,q.jsx)(`div`,{className:`provider-outcome aborted`,role:`status`,children:o(`modelRequestStopped`)})}function tq({attempts:e,state:t,retry:n,observed:r=!0}){let{t:i}=W(),a=t===`retrying`&&!r,o=n?.attempt,s=n?.maxAttempts,c=typeof o==`number`&&Number.isSafeInteger(o)&&o>0&&typeof s==`number`&&Number.isSafeInteger(s)&&s>=o,l=e.length>0||!!n?.errorMessage,u=(0,q.jsxs)(q.Fragment,{children:[t===`retrying`?(0,q.jsx)(Jc,{"aria-hidden":`true`}):(0,q.jsx)(wc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{role:t===`retrying`?`status`:void 0,children:[i(a?`modelReconnectUnknown`:t===`recovered`?`modelRequestRecovered`:t===`retrying`?n?`modelRetrying`:`modelEarlierAttempts`:t===`interrupted`?`modelRequestStopped`:`modelEarlierAttempts`),t===`retrying`&&c&&` ${o}/${s}`]}),t!==`retrying`&&(0,q.jsx)(`span`,{className:`provider-attempts-count`,children:i(`modelFailedAttempts`,{count:e.length})}),l&&(0,q.jsx)(os,{className:`reconnect-chevron`,"aria-hidden":`true`})]}),d=`provider-attempts ${t}${a?` unavailable`:``}`;return l?(0,q.jsxs)(`details`,{className:d,children:[(0,q.jsx)(`summary`,{children:u}),(0,q.jsxs)(`ol`,{children:[e.length===0&&(0,q.jsx)(`li`,{children:(0,q.jsx)(`p`,{children:n?.errorMessage})}),e.map(({entry:e,content:t},n)=>(0,q.jsxs)(`li`,{"data-history-entry":e.entryId??e.key,children:[(0,q.jsx)(`span`,{className:`provider-attempt-index`,"aria-hidden":`true`,children:String(n+1).padStart(2,`0`)}),(0,q.jsxs)(`div`,{className:`provider-attempt-body`,children:[(0,q.jsx)(`p`,{children:e.message.errorMessage||i(`modelFailureUnknown`)}),t?.map(e=>(0,q.jsx)(K.Fragment,{children:e.content},e.key))]})]},e.key))]})]}):(0,q.jsx)(`div`,{className:d,children:u})}function nq(e,t,n){let r=new Set,i=new Map,a=[],o=-1,s=(s,c=!1,l=!1)=>{if(a.length>0){let u=e[o]?.message.stopReason,d=s?.outcome===`cancelled`||u===`aborted`,f=u===`error`&&!d&&!(c&&t)&&!l;f&&r.add(o);let p=f?a.slice(0,-1):a,m=p.at(-1);m!==void 0&&i.set(m,{attempts:p.map(t=>e[t]),state:d?`interrupted`:u===`stop`||u===`length`||u===`toolUse`?`recovered`:c&&t&&n?`retrying`:`earlier`})}a=[],o=-1};return e.forEach((e,t)=>{e.optimistic||(e.timing?s(e.timing):e.forkSnapshotBoundary?s(void 0,!1,!0):e.message.role===`user`||e.message.role===`custom`&&e.message.customType===`openpi-setup-request`?s():e.message.role===`assistant`&&(o=t,e.message.stopReason===`error`&&a.push(t)))}),s(void 0,!0),{finalErrors:r,groups:i}}function rq(e,t){return zD(vK(e,t).split(` `).find(Boolean),120)}function iq(e){let t=e.split(` `).map(e=>e.trim()).find(Boolean);return t?zD(t.replace(/^#{1,6}\s+/u,``).replace(/^>\s*/u,``).replace(/[*_~`]+/gu,``).replace(/\[([^\]]+)\]\([^)]*\)/gu,`$1`).trim(),600):``}function aq({body:e,icon:t,name:n,status:r,summary:i,output:a,evidenceState:o,note:s,rawDetails:c,children:l,snapshotMissingResult:u=!1,defaultOpen:d=!1}){let{t:f}=W(),[p,m]=(0,K.useState)(d);(0,K.useEffect)(()=>m(d),[d]);let h=o??(r===`done`?`returned`:r===`error`?`failed`:r===`running`?`running`:`unknown`);return(0,q.jsxs)(`details`,{className:`message-details tool-line ${r}`,"data-tool":n,open:p,onToggle:e=>m(e.currentTarget.open),children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(`span`,{className:`tool-icon`,"aria-hidden":`true`,children:t}),hK(n).action===`call`&&(0,q.jsx)(`span`,{className:`tool-kind`,title:n,children:_K(n)}),(0,q.jsxs)(`span`,{className:`details-title`,children:[(0,q.jsx)(`span`,{className:`tool-action`,children:gK(f,n,h)}),i&&(0,q.jsx)(`span`,{className:`tool-summary`,children:i})]}),u&&(0,q.jsx)(`span`,{className:`evidence-status`,children:f(`toolSnapshotMissingResult`)}),(0,q.jsx)(os,{className:`tool-disclosure`,"aria-hidden":`true`}),(0,q.jsx)(QK,{status:r})]}),s&&(0,q.jsx)(`p`,{className:`evidence-note`,children:s}),a===void 0?(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:pd(e).text}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`figure`,{"aria-label":f(`toolCallArguments`),style:{margin:0},children:(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:pd(e).text})}),(0,q.jsx)(`figure`,{"aria-label":f(`toolCallOutput`),style:{margin:0},children:(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:pd(a).text||f(`noOutput`)})})]}),c!==void 0&&(0,q.jsxs)(`details`,{className:`evidence-raw`,children:[(0,q.jsx)(`summary`,{children:f(`toolRawEvidence`)}),(0,q.jsx)(`pre`,{children:pd(JSON.stringify(c,null,2)).text})]}),l]})}function oq({body:e,family:t,meta:n,status:r,title:i,defaultOpen:a=!1}){return(0,q.jsxs)(`details`,{className:`message-details activity-card ${t}`,open:a||void 0,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(`span`,{className:`activity-icon`,"aria-hidden":`true`,children:t===`subagent`?(0,q.jsx)($o,{}):(0,q.jsx)(Yc,{})}),(0,q.jsxs)(`span`,{className:`activity-main`,children:[(0,q.jsx)(`span`,{className:`activity-title`,children:i}),n&&(0,q.jsx)(`span`,{className:`activity-meta`,children:n})]}),(0,q.jsx)(QK,{status:r}),(0,q.jsx)(os,{className:`tool-disclosure`,"aria-hidden":`true`})]}),(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:e})]})}function sq(e,t){let n=typeof e.id==`string`?[e.id]:Array.isArray(e.ids)?e.ids:typeof t.id==`string`?[t.id]:Array.isArray(t.results)?t.results.map(e=>JK(e).id):[];return[...new Set(n.filter(e=>typeof e==`string`&&!!e))]}function cq({call:e,result:t,status:n,sessionId:r,subagents:i,records:a,onInspect:o,defaultOpen:s}){let{t:c}=W(),l=sq(YK(e.arguments),JK(t?.details)),u=gK(c,e.name,n===`done`?`returned`:n===`error`?`failed`:n);return(0,q.jsxs)(`section`,{className:`subagent-operation`,children:[(l.length?l:[void 0]).map(t=>(0,q.jsx)(JG,{identity:`${r}:${t??e.id}`,title:t?UD(t,i,a):``,action:u,state:n===`warn`?`unknown`:n,label:c(`toolState_${n===`done`?`returned`:n===`error`?`failed`:n===`warn`?`unknown`:n}`),onInspect:t&&o?()=>o(t):void 0},t??e.id)),(0,q.jsxs)(`details`,{className:`subagent-operation-receipt`,open:s||void 0,children:[(0,q.jsx)(`summary`,{"aria-label":c(`toolRawEvidence`),title:c(`toolRawEvidence`),children:(0,q.jsx)(Ds,{"aria-hidden":`true`})}),e.arguments!==`{}`&&(0,q.jsx)(`pre`,{children:pd(e.arguments).text}),(0,q.jsx)(`pre`,{children:pd(t?.content??``).text||c(`noOutput`)})]})]})}function lq(e,t,n={sessionId:``}){if(t?.forkSnapshotToolResult)return null;let{sessionId:r,subagents:i=[],records:a=[],workflows:o=[],onInspectSubagent:s,liveState:c,defaultOpen:l=!1,observed:u=!0}=n,d=e.name||``,f=YK(e.arguments),p=JK(t?.details),m=ZK(t,c),h=!u&&m===`running`?`unknown`:m;if(d===`subagent_spawn`)return(0,q.jsx)(uq,{sessionId:r,id:typeof p.id==`string`?p.id:void 0,title:String(p.title||f.name||`subagent`),body:t?.content||String(f.prompt||e.arguments),activity:i.find(e=>e.id===p.id),saved:a.find(e=>e.id===p.id),spawnFailed:t?.isError===!0,observed:u,defaultOpen:l,onInspect:s});if(d.startsWith(`subagent`))return(0,q.jsx)(cq,{call:e,result:t,sessionId:r,subagents:i,records:a,onInspect:s,defaultOpen:l,status:h});if(d===`workflow`){let n=typeof f.script==`string`?f.script:e.arguments,i=String(p.name||n.match(/\bname:\s*["'`]([^"'`]+)["'`]/u)?.[1]||`unnamed`),a=JK(p.agents),c=o.find(e=>e.runId===p.runId)?.children,l=[p.runId,p.status,a.total?`${Number(a.total)-Number(a.running||0)}/${a.total} agents`:``].filter(Boolean).join(` · `);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(oq,{family:`workflow`,title:`Workflow · ${i}`,meta:l,body:t?.content||n,status:h}),(0,q.jsx)(dq,{sessionId:r,tasks:c,observed:u,onInspect:s})]})}return d.startsWith(`workflow`)?(0,q.jsx)(oq,{family:`workflow`,title:d.replaceAll(`_`,` `),meta:String(f.runId||``),body:t?.content||e.arguments,status:h}):null}function uq({sessionId:e,id:t,title:n,body:r,activity:i,saved:a,spawnFailed:o,onInspect:s,defaultOpen:c=!1,observed:l=!0}){let{t:u}=W(),d=i?.outcome===`interrupted`?`interrupted`:i?.status??(a?.state===`running`?void 0:a?.state),f=!l&&(d===`running`||!d&&!o)?`unknown`:d,p=u(f===`unknown`?`toolState_unknown`:f?`subagentState_${f}`:o?`subagentSpawnFailed`:t?`subagentStateUnavailable`:`subagentStarting`);return(0,q.jsxs)(`section`,{className:`activity-card subagent subagent-activity`,children:[(0,q.jsx)(JG,{identity:`${e}:${t??n}`,title:n,state:f,label:p,onInspect:t&&s?()=>s(t):void 0}),(c||o)&&(0,q.jsxs)(`details`,{className:`subagent-receipt`,open:c||void 0,children:[(0,q.jsx)(`summary`,{children:u(`subagentSpawnReceipt`)}),(0,q.jsx)(`p`,{children:u(`subagentSpawnReceiptHint`)}),(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:r})]})]})}function dq({sessionId:e,tasks:t,observed:n,onInspect:r}){let{t:i}=W();return(0,q.jsxs)(q.Fragment,{children:[t?.items.map(t=>{let a=t.outcome===`interrupted`?`interrupted`:!n&&t.status===`running`?`unknown`:t.status;return(0,q.jsx)(JG,{identity:`${e}:${t.id}`,title:t.title,state:a,label:i(a===`unknown`?`toolState_unknown`:`subagentState_${a}`),onInspect:r?()=>r(t.id,`workflows`):void 0},t.id)}),!!t?.omitted&&(0,q.jsx)(`p`,{className:`inspection-note`,children:i(`subagentListTruncated`,{count:t?.omitted})})]})}function fq({body:e,duration:t,status:n,level:r,defaultOpen:i,truncated:a,source:o}){let{t:s}=W(),c=n===`running`,[l,u]=(0,K.useState)(i),[d,f]=(0,K.useState)();(0,K.useEffect)(()=>u(i),[i]);let p=t===void 0?``:VD(0,t),m=iq(e),h=[n===`unknown`?s(`toolState_unknown`):c?r?s(`thinkingActiveLevel`,{level:r}):s(`thinkingActive`):s(`thinkingDone`),p].filter(Boolean).join(` · `);return(0,q.jsxs)(`details`,{className:`message-details tool-line thinking-line ${n}`,open:l,onToggle:e=>u(e.currentTarget.open),children:[(0,q.jsxs)(`summary`,{"aria-label":[h,m].filter(Boolean).join(` · `),title:m,children:[(0,q.jsx)(`span`,{className:`tool-icon`,"aria-hidden":`true`,children:(0,q.jsx)(Zs,{})}),(0,q.jsx)(`span`,{className:`details-title`,children:(0,q.jsx)(`span`,{className:`tool-summary`,children:m||h})}),(0,q.jsx)(os,{className:`tool-disclosure`,"aria-hidden":`true`})]}),l&&(0,q.jsx)(`div`,{className:`details-body thinking-evidence`,children:a&&o&&!c?(0,q.jsx)(iK,{...o,preview:e,markdown:!0,purpose:`thinking`,fullText:d,onComplete:f}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(vD,{children:e}),a&&(0,q.jsx)(`p`,{className:`evidence-warning`,children:s(`thinkingPreviewOnly`)})]})})]})}function pq({content:e,editable:t,copyRequiresFull:n=!1,timestamp:r,onResend:i,onRegenerate:a,onFork:o,canFork:s=!1,forkPending:c=!1}){let{t:l}=W(),[u,d]=(0,K.useState)(!1),[f,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(!1),g=(0,K.useRef)(0),_=(0,K.useRef)(void 0);(0,K.useEffect)(()=>()=>{g.current+=1,window.clearTimeout(_.current)},[]);let[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(e),[S,C]=(0,K.useState)(!1),w=(0,K.useRef)(null),T=(0,K.useId)();(0,K.useEffect)(()=>{v&&w.current?.focus()},[v]);let E=async()=>{if(!(S||!b.trim()||!t||!i)){C(!0);try{await i(b.trim())&&y(!1)}finally{C(!1)}}};if(v)return(0,q.jsxs)(`div`,{className:`message-editor`,children:[(0,q.jsx)(`textarea`,{ref:w,value:b,"aria-label":l(`editMessage`),"aria-describedby":T,readOnly:S,onChange:e=>x(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||S||(e.key===`Escape`&&y(!1),e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),E()))}}),(0,q.jsx)(`p`,{className:`message-edit-hint`,id:T,children:l(`editMessageHint`)}),(0,q.jsxs)(`div`,{className:`message-edit-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:S,onClick:()=>y(!1),children:l(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`confirm`,disabled:S||!b.trim()||!t,onClick:()=>void E(),children:l(`confirmEdit`)})]})]});let D=BD(r);return(0,q.jsxs)(`div`,{className:`message-actions${f?` copy-failed`:``}`,children:[D&&(0,q.jsx)(`time`,{dateTime:r,children:D}),o&&(0,q.jsx)(V,{content:l(c?`forkSessionPending`:s?`forkMessageHint`:`forkSessionUnavailable`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":l(`forkMessage`),disabled:!s||c,onClick:()=>void o(),children:(0,q.jsx)(Ws,{"aria-hidden":`true`})})}),t&&(0,q.jsx)(V,{content:l(`editMessage`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":l(`editMessage`),onClick:()=>{x(e),y(!0)},children:(0,q.jsx)(yc,{})})}),a&&(0,q.jsx)(V,{content:l(`regenerateMessageHint`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":l(`regenerateMessage`),disabled:!s||c,onClick:()=>void a(),children:(0,q.jsx)(he,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:l(n?`messageCopyRequiresFull`:u?`copiedMessage`:`copyMessage`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":l(u?`copiedMessage`:`copyMessage`),"data-copied":u||void 0,disabled:m||n,onClick:()=>{let t=++g.current;window.clearTimeout(_.current),h(!0),d(!1),p(!1),td(e).then(e=>{t===g.current&&(h(!1),d(e),p(!e),e&&(_.current=window.setTimeout(()=>d(!1),1200)))})},children:u?(0,q.jsx)(rs,{}):(0,q.jsx)(_s,{})})}),f&&(0,q.jsx)(`span`,{className:`copy-error`,role:`status`,children:l(`copyFailed`)})]})}function mq({message:e,fullSubagent:t=!1,sessionId:n,onInspectSubagent:r}){let{t:i}=W();if(e.customType===`openpi-web-command-feedback`)return(0,q.jsxs)(`div`,{className:`command-feedback`,role:`status`,children:[e.content,e.truncation?.truncated&&(0,q.jsx)(`p`,{children:i(`commandFeedbackTruncated`)})]});let a=JK(e.details);if(e.customType===`openpi-setup-request`||e.customType===`openpi-setup-closed`)return(0,q.jsx)(aq,{body:e.content,icon:(0,q.jsx)(Xc,{}),name:i(`configureOpenPi`),summary:e.customType===`openpi-setup-closed`?zD(e.content):void 0,status:`unknown`});if(e.customType===`subagent-result`){let o=Array.isArray(a.results)?a.results.map(JK):[a],s=new Set(GD([e]).map(e=>e.id));return(0,q.jsxs)(`section`,{className:`activity-card subagent subagent-activity`,children:[o.map(e=>{let t=typeof e.id==`string`?e.id:``,a=e.outcome===`interrupted`?`interrupted`:e.status===`done`||e.status===`error`||e.status===`running`?e.status:`unknown`;return(0,q.jsx)(JG,{identity:`${n}:${t}`,title:String(e.title||t||i(`subagentDetails`)),state:a,label:i(a===`unknown`?`unknownState`:`subagentState_${a}`),onInspect:r&&s.has(t)?()=>r(t):void 0},t||JSON.stringify(e))}),(0,q.jsxs)(`details`,{className:`subagent-result-evidence`,open:t||void 0,children:[(0,q.jsx)(`summary`,{children:i(`subagentBackgroundResult`,{count:o.length})}),(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:!t&&typeof a.displayContent==`string`?a.displayContent:e.content})]})]})}if(e.customType===`workflow-result`){let t=Array.isArray(a.entries)?a.entries.map(JK):[],n=t.map(e=>XK(e.status)),r=n.includes(`error`)?`error`:n.includes(`warn`)?`warn`:n.length>0&&n.every(e=>e===`done`)?`done`:n.includes(`running`)?`running`:`unknown`,i=t.length?t.map(e=>`${e.status===`completed`?`✓`:`✗`} ${String(e.summary||e.runId||`run`)}${e.resultPreview?`\nResult: ${e.resultPreview}`:``}`).join(` `):e.content;return(0,q.jsx)(oq,{family:`workflow`,title:t.length>1?`Workflow results · ${t.length} runs`:`Workflow ${String(t[0]?.runId||`result`)}`,body:i,status:r})}return null}function hq(e){return[``,`[]`,`{}`,`null`].includes(e.trim())}function gq({rows:e,active:t}){let{t:n}=W(),[r,i]=(0,K.useState)(!1),a=e.length===1,o=(0,K.useRef)(a),s=(0,K.useRef)(null),c=(0,K.useRef)(null),l=(0,K.useRef)(!0),u=(0,K.useRef)(0),d=(0,K.useRef)(void 0),[f,p]=(0,K.useState)({above:!1,below:!1}),m=(0,K.useCallback)(()=>{let e=c.current;if(!e)return;let t=e.scrollTop>1,n=e.scrollHeight-e.clientHeight-e.scrollTop>1;p(e=>e.above===t&&e.below===n?e:{above:t,below:n})},[]);(0,K.useLayoutEffect)(()=>{let n=c.current,s=o.current&&!a;if(s&&!r&&n?.querySelector(`.thinking-line[open]`)){i(!0);return}o.current=a,!(!n||a||!r||e.length===0)&&(!s&&n.scrollTop!==u.current&&n.scrollHeight-n.clientHeight-n.scrollTop>24&&(l.current=!1),s&&!l.current&&(n.scrollTop=u.current),t&&l.current&&(n.scrollTop=n.scrollHeight,u.current=n.scrollTop),m())},[e,t,r,a,m]),(0,K.useEffect)(()=>{let e=c.current,n=e?.firstElementChild;if(!e||!n||a||typeof ResizeObserver>`u`)return;let i=new ResizeObserver(()=>{r&&t&&l.current&&(e.scrollTop=e.scrollHeight,u.current=e.scrollTop),m()});return i.observe(e),i.observe(n),()=>i.disconnect()},[t,r,a,m]);let h=e.filter(e=>e.processType===`thinking`).length,g=e.filter(e=>e.processType===`tool`).length,_=e.filter(e=>e.processType===`activity`).length,v=[h?n(`processThinkingCount`,{count:h}):``,g?n(`processToolCount`,{count:g}):``,_?n(`processActivityCount`,{count:_}):``].filter(Boolean),y=[...e].reverse().find(e=>e.processStatus===`running`),b=y?.processPreview??(t?[...e].reverse():e).find(e=>e.processPreview)?.processPreview,x=y?.processToolName&&[`read`,`write`,`edit`].includes(y.processToolName)?b?.slice(Math.max(b.lastIndexOf(`/`),b.lastIndexOf(`\\`))+1):b,S=e.filter(e=>e.error||e.processStatus===`error`).length,C=S>0,w=y?`running`:C?`error`:e.some(e=>e.processStatus===`warn`)?`warn`:e.every(e=>e.processStatus===`done`)?`done`:`unknown`,T=e.flatMap(e=>e.processToolName?[e.processToolName]:[]),E=[...new Set(T.map(e=>hK(e).action))],D=E.map(e=>n(`toolActionGroup_${e}`)),O=E.length?n(`toolGroup_${w===`done`?`done`:w===`running`?`running`:`unknown`}`,{actions:D.join(n(`toolGroupSeparator`))}):n(w===`running`?`processRunning`:`processDetails`),k=y?.processToolName?gK(n,y.processToolName,`running`):y?.processType===`thinking`?n(`thinkingActive`):r?n(`processDetails`):O,A=y?.processToolName??T[0],j=y?.processType===`thinking`?Zs:A?hK(A).Icon:Xc;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`details`,{className:`process-sequence ${a?`single-process `:``}${w}`,open:a||r,"data-status":w,"data-running":w===`running`?`true`:void 0,"data-history-entry":e[0]?.key,onToggle:e=>{a||i(e.currentTarget.open)},children:[(0,q.jsxs)(`summary`,{ref:s,hidden:a,"aria-label":[k,y?b:``,...v,C?n(`processFailureCount`,{count:S}):``].filter(Boolean).join(` · `),children:[(0,q.jsx)(`span`,{className:`tool-icon`,"aria-hidden":`true`,children:(0,q.jsx)(j,{})}),(0,q.jsx)(`span`,{className:`process-sequence-title`,children:(0,q.jsx)(`strong`,{children:k})}),b&&(y||!t&&!E.length)&&(0,q.jsx)(`span`,{className:`process-sequence-preview`,title:b,children:x}),(0,q.jsx)(os,{className:`tool-disclosure`,"aria-hidden":`true`}),!C&&(0,q.jsx)(QK,{status:w})]}),(0,q.jsx)(`section`,{ref:c,className:`process-sequence-scroll`,"aria-label":a?void 0:[n(`processDetails`),...v].join(` · `),tabIndex:a?void 0:0,"data-scroll-above":f.above||void 0,"data-scroll-below":f.below||void 0,onScrollCapture:e=>{let t=e.target;if(a&&t instanceof HTMLElement&&t.classList.contains(`thinking-evidence`)){let n=t.getBoundingClientRect().top-e.currentTarget.getBoundingClientRect().top+t.scrollTop,r=n>u.current;u.current=n,l.current=(l.current||r)&&t.scrollHeight-t.clientHeight-t.scrollTop<=24}},onScroll:e=>{if(a)return;let t=e.currentTarget,n=t.scrollTop>u.current;u.current=t.scrollTop,l.current=(l.current||n)&&t.scrollHeight-t.clientHeight-t.scrollTop<=24,m()},onWheel:e=>{!e.defaultPrevented&&!e.ctrlKey&&!e.metaKey&&e.deltaY<0&&(a||Tq(e.nativeEvent,e.currentTarget))&&(l.current=!1)},onKeyDown:e=>{let t=e.target;!e.defaultPrevented&&!e.altKey&&!e.metaKey&&(!e.ctrlKey||e.key===`Home`)&&([`ArrowUp`,`PageUp`,`Home`].includes(e.key)||e.key===` `&&e.shiftKey)&&t instanceof HTMLElement&&!t.isContentEditable&&!t.closest(`input, textarea, select`)&&!(e.key===` `&&t.closest(`button, summary`))&&(a||Tq(e.nativeEvent,e.currentTarget))&&(l.current=!1)},onTouchStart:e=>{d.current=e.touches[0]?.clientY},onTouchMove:e=>{let t=e.touches[0]?.clientY;t!==void 0&&d.current!==void 0&&t>d.current&&(a||Tq(e.nativeEvent,e.currentTarget))&&(l.current=!1),d.current=t},children:(0,q.jsx)(`div`,{className:`process-sequence-body`,children:e.map(e=>(0,q.jsx)(`div`,{className:`process-step ${a?`single-tool-step `:``}${e.processStatus??`unknown`}`,"data-status":e.processStatus??`unknown`,children:e.content},e.key))})})]}),(0,q.jsx)(V,{anchorRef:s,focusTrigger:`always`,content:[...v,C?n(`processFailureCount`,{count:S}):``].filter(Boolean).join(` · `),placement:`above`,isEnabled:!a})]})}function _q(e,t){let n=[];for(let t of e){let e=n.at(-1),r=t.kind===`process`;r&&e?.process?e.rows.push(t):n.push({process:r,rows:[t]})}return n.flatMap((e,r)=>{let i=`${e.process?`process`:`rows`}-${e.rows[0]?.key}`;return e.process?(0,q.jsx)(gq,{rows:e.rows,active:t&&r===n.length-1},i):e.rows.map(e=>(0,q.jsx)(K.Fragment,{children:e.content},e.key))})}function vq({rows:e,timing:t,active:n,timedTurn:r}){let{t:i}=W(),a=(0,K.useId)(),[o,s]=(0,K.useState)(t?.outcome!==`completed`),c=(0,K.useRef)(!1),l=(0,K.useRef)(t?.outcome);(0,K.useEffect)(()=>{l.current!==t?.outcome&&t?.outcome===`completed`&&s(!1),l.current=t?.outcome},[t?.outcome]);let u=!!(t||r),d=[];for(let r of e){if(r.content===null)continue;let e=t?.resultEntryId?r.responseEntryId===t.resultEntryId&&r.final!==!1:!n&&r.final,i=r.kind!==`prompt`&&!e,a=d.at(-1);i&&a?.foldable?a.rows.push(r):d.push({foldable:i,rows:[r]})}let f=d.filter(e=>e.foldable),p=e=>e===0?a:`${a}-${e}`,m=f.length>0,h=t?(0,q.jsx)(ZG,{timing:t}):r?(0,q.jsx)(XG,{elapsedMs:r.elapsedMs},JSON.stringify([r.sessionId,r.sessionPath,r.commandId,r.epoch,r.startedAt])):null;return(0,q.jsxs)(q.Fragment,{children:[u&&(0,q.jsxs)(`header`,{className:`turn-duration`,"data-outcome":t?.outcome,children:[m?(0,q.jsxs)(`button`,{type:`button`,className:`turn-duration-toggle`,"aria-expanded":o,"aria-controls":f.map((e,t)=>p(t)).join(` `),onClick:e=>{c.current=e.nativeEvent.isTrusted,s(e=>!e)},children:[(0,q.jsx)(vs,{className:`turn-duration-icon`,"aria-hidden":`true`}),h,(0,q.jsx)(os,{className:`turn-duration-chevron`,"aria-hidden":`true`})]}):h,t&&t.outcome!==`completed`&&(0,q.jsx)(`span`,{className:`turn-duration-outcome`,children:i(`turnElapsedOutcome_${t.outcome}`)})]}),u?d.map(e=>e.foldable?(0,q.jsx)(`div`,{className:`turn-response-body`,id:p(f.indexOf(e)),hidden:!o,inert:!o,"data-user-toggle":c.current||void 0,children:_q(e.rows,n&&e===f.at(-1))},e.rows[0].key):(0,q.jsx)(K.Fragment,{children:_q(e.rows,!1)},e.rows[0].key)):_q(e,n)]})}function yq({id:e,rows:t,active:n,observed:r=!0,changes:i,session:a,timedTurn:o,onReviewTurn:s}){let{t:c}=W(),l=[...t].reverse().find(e=>e.outcome||e.timing),u=l?.timing?.outcome??l?.outcome,d=t.some(e=>e.kind===`response`),f=t.find(e=>e.kind===`prompt`),p=!!(f?.promptEntryId&&t.some(e=>e.commandHandledInputId===f.promptEntryId&&e.commandHandledCommandId===f.promptCommandId)),m=t.some(e=>e.forkSnapshotBoundary),h=m?`forked`:n?r?`running`:`unknown`:u===`failed`?`failed`:u===`interrupted`||u===`cancelled`?`interrupted`:u===`completed`||d||p?`complete`:`waiting`,g=h===`failed`?`error`:h===`interrupted`?`warning`:h===`running`?`accent`:h===`complete`?`success`:`neutral`,_=c(h===`unknown`?`toolState_unknown`:`turnState_${h}`),v=t.some(e=>e.timing&&e.timing.commandId===o?.commandId&&e.timing.epoch===o?.epoch)?void 0:o,y=[],b=[],x=0,S=(e,t=!1)=>{y.push((0,q.jsx)(vq,{rows:b,timing:e,active:n&&t,timedTurn:t?v:void 0},`run-${x++}`)),b=[]};for(let e of t)e.kind===`prompt`?b.length?b.push(e):y.push((0,q.jsx)(K.Fragment,{children:e.content},e.key)):e.timing?S(e.timing):b.push(e);let C=n&&r&&(b.length>0||!!v||!t.some(e=>e.timing))&&!b.some(e=>e.kind!==`prompt`&&e.content!==null);(b.length||v)&&S(void 0,!0);let w=!!(o||t.some(e=>e.timing));return(0,q.jsxs)(`section`,{className:`conversation-turn${e===0?` prelude`:``}`,"data-turn":e,children:[e>0&&h!==`complete`&&(!w||m)&&(0,q.jsxs)(`header`,{className:`turn-heading`,children:[(0,q.jsx)(`span`,{className:`sr-only`,children:c(`turnLabel`,{number:e})}),(0,q.jsxs)(`span`,{className:`turn-state ${h}`,children:[(0,q.jsx)(qG,{variant:g,label:_,isPulsing:h===`running`,icon:h===`failed`||h===`interrupted`?(0,q.jsx)(je,{"aria-hidden":`true`}):h===`forked`?(0,q.jsx)(Ws,{"aria-hidden":`true`}):void 0}),_]})]}),y,C&&(0,q.jsxs)(`div`,{className:`conversation-waiting`,"aria-hidden":`true`,children:[(0,q.jsxs)(`span`,{className:`conversation-waiting-dots`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]}),(0,q.jsx)(`span`,{children:c(`modelRunning`)})]}),i&&a&&(0,q.jsx)(SK,{changes:i,onReview:s},`${a.id}:${a.path}:${i.promptEntryId}`)]})}function bq(e,t,n,r){let i=new Map;for(let t=0;t{if(!t)return;let r=i.get(t);if(!(r===void 0||r>=n)){for(let t=r+1;te.rows.some(e=>e.promptCommandId===n||r?.promptEntryId&&e.promptEntryId===r.promptEntryId)):void 0,l=s.length-1;for(;l>=0&&s[l].id!==0&&!s[l].rows.some(e=>e.kind===`prompt`&&!e.pendingPrompt);)l--;return{turns:s,activeTurn:c?.id??s[l]?.id}}function xq(e,t,n,r,i,a,o,s=!0,c=t){let{turns:l,activeTurn:u}=bq(e,c,n,a);return l.map(e=>(0,q.jsx)(yq,{id:e.id,rows:e.rows,active:t&&e.id===u&&!e.rows.some(e=>e.forkSnapshotBoundary),observed:s,changes:c&&e.id===u?void 0:r?.get(e.rows.find(e=>e.kind===`prompt`&&!e.pendingPrompt)?.promptEntryId??``),session:i,timedTurn:t&&e.id===u&&!e.rows.some(e=>e.forkSnapshotBoundary)?a:void 0,onReviewTurn:o},`turn-group-${e.rows[0]?.key}`))}function Sq(e,t,n){let r=e.getBoundingClientRect(),i=r.top,a=Array.from(e.querySelectorAll(`[data-history-entry], [data-history-message], [data-history-result]`)).filter(t=>{let n=t.getBoundingClientRect(),i=Math.max(n.top,r.top),a=Math.min(n.bottom,r.bottom);for(let n=t;n&&n!==e;n=n.parentElement){if(n.hidden||n instanceof HTMLDetailsElement&&!n.open&&n!==t&&!n.querySelector(`:scope > summary`)?.contains(t))return!1;if(n===t)continue;let e=getComputedStyle(n);if(!/^(auto|scroll|overlay|hidden|clip)$/.test(e.overflowY))continue;let r=n.getBoundingClientRect();i=Math.max(i,r.top),a=Math.min(a,r.bottom)}return a>i}),o=a.find(e=>!a.some(t=>t!==e&&e.contains(t))),s=o?.dataset.historyResult??o?.dataset.historyEntry??o?.dataset.historyMessage,c=o?.dataset.historyResult??o?.dataset.historyMessage,l=n?.entries.find(e=>e.id===c||e.id===s)?.id;if(!l&&s)for(let e of n?.entries??[])s.startsWith(`${e.id}-`)&&(!l||e.id.length>l.length)&&(l=e.id);return{key:l?s:void 0,entryId:l,offset:(o?.getBoundingClientRect().top??i)-i,scrollTop:e.scrollTop,pinned:t}}function Cq(e,t){let n=!1;for(let r=e.parentElement;r&&r!==t;r=r.parentElement)if(r instanceof HTMLDetailsElement&&(r.open=!0),r.classList.contains(`turn-response-body`)&&r.hidden){let e=Array.from(t.querySelectorAll(`button[aria-controls]`)).find(e=>e.getAttribute(`aria-controls`)?.split(` `).includes(r.id));e&&(e.click(),n=!0)}return n}function wq(e,t,n){if(e.scrollIntoView?.({block:`nearest`,inline:`nearest`,behavior:`instant`}),n){t.scrollTop=n.scrollTop;for(let r=e.parentElement;r&&r!==t;r=r.parentElement)!/^(auto|scroll|overlay)$/.test(getComputedStyle(r).overflowY)||r.scrollHeight<=r.clientHeight||(r.scrollTop+=e.getBoundingClientRect().top-t.getBoundingClientRect().top-n.offset)}return Math.max(0,t.scrollTop+e.getBoundingClientRect().top-t.getBoundingClientRect().top-(n?.offset??24))}function Tq(e,t){return Eq(e,t,`up`)}function Eq(e,t,n){for(let r of e.composedPath()){if(r===t)return!0;if(!(r instanceof HTMLElement))continue;let e=getComputedStyle(r);if(/^(auto|scroll|overlay)$/.test(e.overflowY)&&((n===`up`?r.scrollTop:r.scrollHeight-r.clientHeight-r.scrollTop)>0||/^(contain|none)$/.test(e.overscrollBehaviorY)))return!1}return!1}function Dq(e){let{t}=W(),n=(0,K.useRef)(null),r=(0,K.useRef)(null),i=(0,K.useRef)(!0),a=(0,K.useRef)(0),o=(0,K.useRef)(null);(0,K.useEffect)(()=>{let e=n.current,t=()=>{o.current=null};return e?.addEventListener(`scrollend`,t),()=>e?.removeEventListener(`scrollend`,t)},[]);let s=(0,K.useRef)(null),c=(0,K.useCallback)(()=>{s.current!==null&&cancelAnimationFrame(s.current),s.current=null},[]),l=(0,K.useCallback)(e=>{let t=n.current;if(!t)return;let r=window.matchMedia?.(`(prefers-reduced-motion: reduce)`),o=(e=t.scrollHeight)=>{c(),typeof t.scrollTo==`function`?t.scrollTo({top:e,behavior:`instant`}):t.scrollTop=e,a.current=t.scrollTop};if(!e||r?.matches||document.visibilityState===`hidden`||!t.clientHeight){o();return}if(s.current!==null)return;let l=t.scrollHeight-t.clientHeight-t.scrollTop;if(l<=1||l>t.clientHeight){o();return}let u=performance.now(),d=e=>{if(s.current=null,!i.current||n.current!==t)return;if(r?.matches||document.visibilityState===`hidden`){o();return}let a=Math.max(0,t.scrollHeight-t.clientHeight),c=a-t.scrollTop;if(c<=1){o(a);return}let l=Math.min(64,Math.max(1,e-u));u=e,o(t.scrollTop+Math.max(1,c*(1-Math.exp(-l/48)))),s.current=requestAnimationFrame(d)};s.current=requestAnimationFrame(d)},[c]),u=(0,K.useRef)(void 0),d=(0,K.useRef)(0),f=(0,K.useRef)(e.readingRestorePending);f.current=e.readingRestorePending;let[p,m]=(0,K.useState)(!1),h=(0,K.useRef)(null),g=e.activityObserved!==!1&&e.resultExposureEnabled!==!1,_=(0,K.useCallback)(()=>{h.current?.abort(),h.current=null},[]),v=(0,K.useRef)(void 0),y=(0,K.useRef)(e.scrollToBottom),b=(0,K.useRef)(null),x=(0,K.useMemo)(()=>e.readingCache??new Map,[e.readingCache]),S=e.historyNavigation,C=S?JSON.stringify([S.sessionId,S.sessionPath,S.entryId,S.revision]):null,w=(0,K.useRef)(null),[T,E]=(0,K.useState)(null),D=qK(e.snapshot.selectedSession,{onAnchorChange:e.onHistoryAnchorChange,onRefresh:e.onRefreshHistory,preload:e.activityObserved!==!1&&e.resultExposureEnabled!==!1,beforePrepend:()=>{let e=n.current;e&&(b.current={...Sq(e,!1,k.current),scrollHeight:e.scrollHeight},i.current=!1)}},x,S),O=D.session,k=(0,K.useRef)(O);k.current=O;let A=O?.id,j=O?.path,M=O?.cwd,N=T&&T.sessionId===A&&T.sessionPath===j?T.entryId:void 0,P=JSON.stringify([A,j]),{capture:F,restore:I,clear:ee}=VK(n,i,P,a);(0,K.useLayoutEffect)(()=>c,[P,c]);let L=JSON.stringify([e.snapshot.selectedSession?.id,e.snapshot.selectedSession?.path,e.snapshot.selectedSession?.history?.leafEntryId??e.snapshot.selectedSession?.entries.at(-1)?.id]);(0,K.useLayoutEffect)(()=>(g||_(),_),[L,C,g,_]),(0,K.useLayoutEffect)(()=>{let e=n.current;if(!e||!A||!j)return;let t=()=>{f.current||uK(x,P,{position:Sq(e,i.current,k.current)})};window.addEventListener(`pagehide`,t);let r=()=>{document.visibilityState===`hidden`&&t()};return document.addEventListener(`visibilitychange`,r),()=>{window.clearTimeout(d.current),window.removeEventListener(`pagehide`,t),document.removeEventListener(`visibilitychange`,r),t()}},[P,x,A,j]);let R=(0,K.useRef)(P),[te,z]=(0,K.useState)({});(0,K.useLayoutEffect)(()=>{R.current!==P&&(R.current=P,z({}))},[P]);let B=(0,K.useMemo)(()=>new Map((O?.entries??[]).flatMap(e=>e.turnChanges&&e.turnChanges.sessionId===O?.id?[[e.turnChanges.promptEntryId,e.turnChanges]]:[])),[O?.entries,O?.id]),ne=(0,K.useRef)(D.reset),re=D.hasNewer||D.verifying,ie=HD(e.snapshot,O),ae=e.snapshot.selectedExecution?.sessionId===O?.id&&e.snapshot.selectedExecution?.sessionPath===O?.path?e.snapshot.selectedExecution:void 0,oe=ie&&e.liveActiveTurn!==void 0?e.liveRunning:ie&&e.liveRunning||(ae?ae.status===`running`:ie&&e.snapshot.runtime.status===`running`),se=!re&&oe?ie&&e.liveActiveTurn!==void 0?e.liveRetry??void 0:ae?ae.retry:ie?e.liveRetry??void 0:void 0:void 0,ce=(0,K.useRef)({scope:P,nativeRowKeys:new Map,ambiguousTimingIds:new Set});ce.current.scope!==P&&(ce.current={scope:P,nativeRowKeys:new Map,ambiguousTimingIds:new Set});let{entries:le,projectedPrompts:H}=(0,K.useMemo)(()=>LK({...e.snapshot,selectedSession:O},re?[]:e.liveMessages.filter(e=>e.optimistic?e.optimistic.sessionId===O?.id&&e.optimistic.sessionPath===O?.path:ie),ce.current),[e.snapshot,O,ie,re,e.liveMessages]);(0,K.useEffect)(()=>{O&&H.length>0&&e.onPromptProjection?.(O.id,O.path,H)},[O,H,e.onPromptProjection]),(0,K.useEffect)(()=>{let e=n.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{if(!i.current){I(),F();return}l(oe)});return t.observe(e),r.current&&t.observe(r.current),()=>t.disconnect()},[l,oe,I,F]);let{rows:de,turns:fe}=(0,K.useMemo)(()=>{let n=GD(le.map(e=>e.message)),r=nq(le,oe&&!re,!!se),i=[...r.finalErrors].at(-1),a=-1;for(let e=le.length-1;e>=0;e--)if(le[e].message.role===`assistant`){a=e;break}let o=new Map,s,c=new Map,l=new Set,u=ie?e.snapshot.runtime.liveTools??[]:[],d=ae?.liveTools??[],f=re?[]:[...u,...d.filter(e=>!u.some(t=>t.call.id===e.call.id))];le.forEach(e=>{let{message:t}=e;t.role===`toolResult`&&t.toolCallId&&c.set(t.toolCallId,e),t.parts?.forEach(e=>{e.type===`toolCall`&&e.id&&![`ask_user`,`human_handoff`].includes(e.name)&&l.add(e.id)})});let p=[],m=0,h,g=-1,_=-1;for(let e=le.length-1;e>=0;e--){if(le[e]?.message.role===`user`){_=e;break}if(le[e]?.message.role===`custom`&&le[e]?.message.customType===`openpi-setup-request`)break}let v=new Set,y=-1;le.forEach(({message:e},t)=>{e.role===`user`||e.role===`custom`&&e.customType===`openpi-setup-request`?(y>=0&&v.add(y),y=-1):e.role===`assistant`&&e.content.trim()&&(y=t)}),y>=0&&v.add(y);let b=le.flatMap((u,d)=>{let y=u.message;if(u.forkSnapshotBoundary)return[{key:u.key,turn:m,kind:`custom`,forkSnapshotBoundary:!0,content:null}];if(u.timing)return[{key:u.key,turn:m,kind:`custom`,timing:u.timing,content:null}];if(u.compaction)return[{key:u.key,turn:m,kind:`custom`,content:(0,q.jsx)(QG,{compaction:{state:`completed`}})}];if(y.role===`custom`){if(y.customType===`openpi-web-command-handled`){let e=y.details;return e&&typeof e==`object`&&`inputEntryId`in e&&typeof e.inputEntryId==`string`?[{key:u.key,turn:m,kind:`custom`,commandHandledInputId:e.inputEntryId,commandHandledCommandId:`commandId`in e&&typeof e.commandId==`string`?e.commandId:void 0,content:null}]:[]}return y.display===!1||![`openpi-web-command-feedback`,`openpi-setup-request`,`openpi-setup-closed`,`subagent-result`,`workflow-result`].includes(y.customType??``)?[]:(y.customType===`openpi-setup-request`&&(h=void 0,g=-1,m++),[{key:u.key,turn:m,kind:`custom`,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-entry":u.entryId??u.key,tabIndex:-1,children:(0,q.jsx)(`div`,{className:`message-content`,children:(0,q.jsx)(mq,{message:y,sessionId:A??``,onInspectSubagent:e.onInspectSubagent,fullSubagent:e.snapshot.preferences.subagentResultDisplay===`full`})})})}])}if(y.role===`user`){h=y.content,g=d,m++,p.push({entryId:u.entryId??u.key,title:Array.from((y.content||t(`attachedImage`)).replace(/\s+/g,` `).trim()).slice(0,240).join(``)});let n=u.entryId?JSON.stringify([A,j,u.entryId]):``,r=te[n],i=!!(y.truncation?.visibleText&&r===void 0);return[{key:u.key,turn:m,kind:`prompt`,pendingPrompt:!!u.optimistic,promptCommandId:u.optimistic?.commandId??y.commandId,promptEntryId:u.entryId,content:(0,q.jsxs)(`article`,{className:`message-row user`,id:`turn-${m}`,"data-history-entry":u.entryId??u.key,"data-history-highlighted":N&&u.entryId===N||void 0,tabIndex:-1,children:[(0,q.jsxs)(`div`,{className:`message-content`,children:[(0,q.jsx)(RK,{message:y,sessionId:A,path:j,entryId:u.entryId}),(y.content||y.truncation?.visibleText)&&(u.entryId&&A&&j&&y.truncation?.visibleText?(0,q.jsx)(iK,{preview:y.content,sessionId:A,sessionPath:j,entryId:u.entryId,markdown:!1,fullText:r,onComplete:e=>z(t=>({...t,[n]:e}))},`${A}:${j}:${u.entryId}`):(0,q.jsx)(rK,{content:y.content}))]}),(0,q.jsx)(pq,{content:r??y.content,editable:ie&&!oe&&!!(e.forkAvailable&&e.onEdit&&u.entryId&&A&&j&&!u.optimistic)&&!i,copyRequiresFull:i,timestamp:u.timestamp,onResend:t=>e.onEdit&&u.entryId&&A&&j?e.onEdit({sessionId:A,sessionPath:j,entryId:u.entryId},t):Promise.resolve(!1),onFork:u.entryId&&A&&j&&e.onFork&&!u.optimistic?()=>e.onFork({sessionId:A,sessionPath:j,entryId:u.entryId}):void 0,canFork:ie&&!oe&&e.forkAvailable,forkPending:e.forkPending})]})}]}if(y.role===`assistant`){let b=p.at(-1);b&&y.content.trim()&&(b.reply=Array.from(y.content.replace(/\s+/g,` `).trim()).slice(0,240).join(``));let x=[],S=y.parts??[],C=y.webSearch??[],w=e=>Math.min(S.length,e.beforePartIndex??0),T=e=>{for(let[t,n]of C.entries()){if(w(n)!==e)continue;let r=n.status===`completed`?`done`:n.status===`failed`?`error`:`warn`;x.push({key:`${u.key}-native-search-${t}`,turn:m,kind:`process`,processType:`tool`,processToolName:`web_search`,processPreview:n.query,processStatus:r,error:n.status===`failed`,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-entry":`${u.entryId??u.key}-native-search-${t}-body`,"data-history-message":u.entryId??u.key,tabIndex:-1,children:(0,q.jsx)(`div`,{className:`message-content`,children:(0,q.jsx)(aq,{body:n.query,icon:(0,q.jsx)(Gs,{}),name:`web_search`,summary:n.query,status:r})})})})}},E=S.reduce((e,t,n)=>(t.type===`thinking`||t.type===`text`)&&!t.text.trim()?e:n,-1),D=S.reduce((e,t,n)=>t.type===`text`?n:e,-1),O=!!(u.entryId&&A&&j&&y.truncation?.visibleText),k=y.content,F=u.entryId?JSON.stringify([A,j,u.entryId]):``,I=te[F],ee=!!(y.truncation?.visibleText&&I===void 0),L=(t,n,r)=>{if(O&&!r||!O&&!t.trim())return;let i=r&&!re&&!se&&e.activityObserved!==!1&&oe&&ae?.compaction?.state!==`running`&&!y.stopReason&&d===le.length-1&&E===D,a=r&&v.has(d)&&!i&&(y.stopReason===`stop`||y.stopReason===`length`||y.stopReason===`error`||y.stopReason===`aborted`||!oe&&!y.parts?.some(e=>e.type===`toolCall`));x.push({key:n,turn:m,kind:`response`,responseEntryId:u.entryId,final:r&&(y.stopReason===`stop`||y.stopReason===`length`),content:(0,q.jsxs)(`article`,{className:`message-row assistant response${a?` final-response`:``}`,"data-streaming":i||void 0,"data-history-message":u.entryId??u.key,"data-history-highlighted":N&&u.entryId===N||void 0,tabIndex:-1,"data-history-entry":u.entryId?`${u.entryId}-${n.slice(u.key.length+1)}`:n,children:[(0,q.jsx)(`div`,{className:`message-content`,children:O&&A&&j&&u.entryId?(0,q.jsx)(iK,{preview:k,sessionId:A,sessionPath:j,entryId:u.entryId,markdown:!0,fullText:I,onComplete:e=>z(t=>({...t,[F]:e}))},`${A}:${j}:${u.entryId}`):(0,q.jsx)(vD,{streaming:i,children:t},P)}),a&&(0,q.jsx)(pq,{content:I??y.content,editable:!1,copyRequiresFull:ee,timestamp:u.timestamp,onResend:e.onResend,onRegenerate:b?.entryId&&A&&j&&e.onRegenerate&&!u.optimistic&&!y.isError&&(y.stopReason===`stop`||y.stopReason===`length`)?()=>e.onRegenerate({sessionId:A,sessionPath:j,entryId:b.entryId}):void 0,onFork:u.entryId&&A&&j&&e.onFork?()=>e.onFork({sessionId:A,sessionPath:j,entryId:u.entryId}):void 0,canFork:ie&&!oe&&e.forkAvailable,forkPending:e.forkPending})]})})};y.parts?.forEach((r,i)=>{if(T(i),r.type===`text`&&(S[i-1]?.type!==`text`||C.some(e=>w(e)===i))){let e=r.text,t=i+1;for(;S[t]?.type===`text`&&!C.some(e=>w(e)===t);){let n=S[t];n?.type===`text`&&(e+=n.text),t++}L(e,`${u.key}-text-${i}`,t>D)}if(r.type===`thinking`&&r.text.trim()){let t=!re&&!se&&!y.stopReason&&ae?.compaction?.state!==`running`&&oe&&d===le.length-1&&i===E?e.activityObserved===!1?`unknown`:`running`:`done`;x.push({key:`${u.key}-thinking-${i}`,turn:m,kind:`process`,processType:`thinking`,processPreview:iq(r.text),processStatus:t,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-entry":`${u.entryId??u.key}-thinking-${i}-body`,"data-history-message":u.entryId??u.key,"data-history-highlighted":N&&u.entryId===N||void 0,tabIndex:-1,children:(0,q.jsx)(`div`,{className:`message-content`,children:(0,q.jsx)(fq,{body:r.text,truncated:r.textTruncated,source:u.entryId&&A&&j&&r.sourcePartIndex!==void 0?{sessionId:A,sessionPath:j,entryId:u.entryId,partIndex:r.sourcePartIndex}:void 0,status:t,level:t===`running`?e.snapshot.thinking?.level:void 0,duration:IK(u,e.thinkingDurations),defaultOpen:e.snapshot.preferences.expandThinking===!0},JSON.stringify([A,j,u.key,i]))})})})}if(r.type===`toolCall`){let a=r,o=f.find(e=>e.call.id===a.id),s=a.id?c.get(a.id):void 0,d=s?.message??o?.result,p=$G(a,d,f,s?void 0:o?.state),h=p?[...p.children.map(e=>({call:e.call,child:e})),...p.showWrapper?[{call:a}]:[]]:[{call:a}];for(let[r,{call:o,child:g}]of h.entries()){let _=o.name.startsWith(`subagent`)?e.snapshot.preferences.subagentResultDisplay===`full`:o.name===`bash`?e.snapshot.preferences.bashToolDisplay===`full`:o.name===`write`||o.name===`edit`?e.snapshot.preferences.fileMutationDisplay===`full`:!1,v=o.id?f.find(e=>e.call.id===o.id):void 0,y=g?s:o.id?c.get(o.id):void 0,b=g?void 0:y?.message,S=g?g.result:b??v?.result,C=g?g.state:b?void 0:v?.state,w=g?g.state===`returned`?`done`:g.state===`failed`?`error`:g.state===`cancelled`||g.state===`timed_out`?`warn`:g.state:ZK(S,C),T=e.activityObserved===!1&&w===`running`?`unknown`:w,E=p&&r===h.length-1&&!p.showWrapper?(0,q.jsxs)(`details`,{className:`evidence-raw`,children:[(0,q.jsx)(`summary`,{children:t(`toolCodemodeDetails`)}),(0,q.jsx)(`pre`,{children:pd(a.arguments).text}),(0,q.jsx)(`pre`,{children:pd(d?.content??``).text})]}):null,D=o.name===`plan_ready`&&S&&aK(S)?(0,q.jsx)(oK,{result:S,sessionId:A,sessionPath:j,entryId:y?.entryId},`${u.key}-${o.id||i}-plan`):hd(o.name)&&!g?.outputMissing?(0,q.jsx)(xK,{call:o,result:S,liveState:C,observed:e.activityObserved,cwd:M,defaultOpen:_,children:E},`${u.key}-${o.id||i}-evidence`):g?.outputMissing?null:lq(o,S,{sessionId:A??``,subagents:ie?e.snapshot.runtime.capabilities.subagents?.items:void 0,workflows:ie?e.snapshot.runtime.capabilities.workflows?.items:void 0,records:n,onInspectSubagent:e.onInspectSubagent,liveState:C,defaultOpen:_,observed:e.activityObserved!==!1}),O=YK(o.arguments),{Icon:k,action:P}=hK(o.name),F=P===`agent`?sq(O,JK(S?.details)).map(t=>UD(t,ie?e.snapshot.runtime.capabilities.subagents?.items:void 0,n)).join(t(`toolGroupSeparator`)):vK(o.name,O),I=(0,q.jsx)(k,{},`${u.key}-${o.id||i}-icon`);x.push({key:`${u.key}-tool-${o.id||i}`,turn:m,kind:o.name===`plan_ready`&&S&&aK(S)?`response`:D&&(o.name===`subagent_spawn`||o.name===`workflow`)?`custom`:`process`,processType:/^(subagent|workflow)/u.test(o.name)?`activity`:`tool`,processToolName:o.name,processPreview:F.split(` diff --git a/web/dist/build-info.json b/web/dist/build-info.json index 55ac7007b..9eb103922 100644 --- a/web/dist/build-info.json +++ b/web/dist/build-info.json @@ -1,5 +1,5 @@ { "version": "1.1.0", - "id": "55f1dad34a744f33e0bc00f0e88a1b082c0b642f2bbe360dcde22ef9071c7826", + "id": "f3ee7c6867d04f8c4196c6eac9e8b2bb2ab35767fca8d07d66124511dbd50d7d", "mode": "production" } diff --git a/web/host/web-host.ts b/web/host/web-host.ts index da945378b..f62cbace5 100644 --- a/web/host/web-host.ts +++ b/web/host/web-host.ts @@ -42,6 +42,7 @@ import { WebReadOnlySessionError, } from "../adapter/pi-adapter.ts"; import { + fitLiveMessage, jsonByteLength, boundThinkingProjection, WEB_MAX_ARCHIVED_SESSION_PAGE, @@ -60,6 +61,7 @@ import { type WebAppearancePreference, type WebSettingsPreferencesPatch, type WebInteractiveTerminalEvent, + type WebLiveMessage, type WebPromptImage, type WebSidebarPinTarget, type WebSnapshot, @@ -102,6 +104,11 @@ const DEFAULT_SSE_HEARTBEAT_MS = 15_000; const SERVER_CLOSE_DRAIN_MS = 500; const DEFAULT_SHUTDOWN_TIMEOUT_MS = 5_000; const MAX_PROMPT_ADMISSIONS = 128; +const LIVE_MESSAGE_EVENTS = new Set([ + "message_start", + "message_update", + "message_end", +]); const THINKING_LEVELS = new Set([ "off", "minimal", @@ -486,7 +493,32 @@ export class WebHost { ...(detail ? { detail } : {}), }; let serialized = JSON.stringify(event); - if (Buffer.byteLength(serialized) > WEB_MAX_EVENT_BYTES) { + let bytes = Buffer.byteLength(serialized); + const message = detail?.message; + if ( + bytes > WEB_MAX_EVENT_BYTES && + LIVE_MESSAGE_EVENTS.has(type) && + message && + typeof message === "object" + ) { + // Each live update repeats the whole message. Trim its reply text to + // what this exact envelope leaves room for, rather than invalidating + // every update of a long reply; the persisted entry keeps the full text. + const envelopeBytes = bytes - jsonByteLength(message); + event = { + ...event, + detail: { + ...detail, + message: fitLiveMessage( + message as WebLiveMessage, + WEB_MAX_EVENT_BYTES - envelopeBytes, + ), + }, + }; + serialized = JSON.stringify(event); + bytes = Buffer.byteLength(serialized); + } + if (bytes > WEB_MAX_EVENT_BYTES) { event = { protocolVersion: WEB_PROTOCOL_VERSION, sequence: event.sequence, diff --git a/web/protocol/types.ts b/web/protocol/types.ts index 1e1f8051e..99fcae36b 100644 --- a/web/protocol/types.ts +++ b/web/protocol/types.ts @@ -407,6 +407,8 @@ export interface WebMessageTruncation { readonly visibleText?: true; readonly partsOmitted?: number; readonly details?: true; + /** Shortened only to fit one live SSE event; the persisted entry is canonical. */ + readonly transport?: true; } export interface WebLiveMessage { @@ -1206,6 +1208,128 @@ export function jsonByteLength(value: unknown) { return textEncoder.encode(JSON.stringify(value)).byteLength; } +const LIVE_TRUNCATION_MARKER = "\n[truncated]"; + +/** Bytes one code point adds inside a JSON string, matching JSON.stringify. */ +function jsonCodePointBytes(codePoint: number) { + if (codePoint === 0x22 || codePoint === 0x5c) return 2; + if (codePoint < 0x20) + return [0x08, 0x09, 0x0a, 0x0c, 0x0d].includes(codePoint) ? 2 : 6; + if (codePoint < 0x80) return 1; + if (codePoint < 0x800) return 2; + // Lone surrogates serialize as \uXXXX escapes. + if (codePoint >= 0xd800 && codePoint <= 0xdfff) return 6; + return codePoint < 0x10000 ? 3 : 4; +} + +function jsonStringBytes(value: string) { + let bytes = 0; + for (const char of value) bytes += jsonCodePointBytes(char.codePointAt(0)!); + return bytes; +} + +/** Longest whole-code-point prefix that fits `maxBytes` inside a JSON string. */ +function jsonPrefix(value: string, maxBytes: number) { + let bytes = 0; + let end = 0; + for (const char of value) { + bytes += jsonCodePointBytes(char.codePointAt(0)!); + if (bytes > maxBytes) break; + end += char.length; + } + return value.slice(0, end); +} + +/** + * Fit one live message into `maxBytes` of serialized JSON. WEB_MAX_TEXT bounds + * characters, but CJK text costs three UTF-8 bytes per character and + * `content` repeats the text parts, so a normal long reply could exceed the + * SSE event limit and turn every update into `state_invalidated`. Shrink only + * the reply text (`content`, text and thinking parts), sharing the budget + * evenly; the persisted entry keeps the full text and its own recovery path. + * Returns the message unchanged when even empty text would not fit. + */ +export function fitLiveMessage( + message: WebLiveMessage, + maxBytes: number, +): WebLiveMessage { + if (jsonByteLength(message) <= maxBytes) return message; + const parts = message.parts ?? []; + const texts = [ + message.content, + ...parts.flatMap((part) => + part.type === "text" || part.type === "thinking" ? [part.text] : [], + ), + ]; + const fixed = jsonByteLength({ + ...message, + content: "", + ...(message.parts + ? { + parts: parts.map((part) => + part.type === "text" || part.type === "thinking" + ? { ...part, text: "", ...(part.type === "thinking" ? { textTruncated: true } : {}) } + : part, + ), + } + : {}), + truncation: { + ...message.truncation, + truncated: true, + text: true, + visibleText: true, + transport: true, + }, + }); + const markerBytes = jsonStringBytes(LIVE_TRUNCATION_MARKER); + let available = maxBytes - fixed - markerBytes * texts.length; + // Metadata or tool calls alone are too large; keep the publish-time + // fail-closed invalidation for that case. + if (available <= 0) return message; + + // Water-fill: short texts stay whole, long ones share what remains. + const costs = texts.map(jsonStringBytes); + const order = costs.map((_, index) => index).sort((a, b) => costs[a]! - costs[b]!); + let cap = Number.POSITIVE_INFINITY; + for (const [rank, index] of order.entries()) { + const remaining = order.length - rank; + if (costs[index]! * remaining > available) { + cap = Math.floor(available / remaining); + break; + } + available -= costs[index]!; + } + let visibleTextTruncated = false; + const fit = (text: string, cost: number) => + cost <= cap ? undefined : `${jsonPrefix(text, cap)}${LIVE_TRUNCATION_MARKER}`; + + const content = fit(message.content, costs[0]!); + if (content !== undefined) visibleTextTruncated = true; + let textIndex = 1; + const fittedParts = message.parts?.map((part): WebMessagePart => { + if (part.type !== "text" && part.type !== "thinking") return part; + const fitted = fit(part.text, costs[textIndex++]!); + if (fitted === undefined) return part; + if (part.type === "thinking") + return { ...part, text: fitted, textTruncated: true }; + visibleTextTruncated = true; + return { ...part, text: fitted }; + }); + const visibleRole = message.role === "user" || message.role === "assistant"; + return { + ...message, + content: content ?? message.content, + ...(fittedParts ? { parts: fittedParts } : {}), + truncation: { + ...message.truncation, + truncated: true, + text: true, + transport: true, + ...(visibleRole && visibleTextTruncated ? { visibleText: true } : {}), + }, + }; +} + export function projectEntries(entries: readonly SessionEntry[], resolvePath?: (path: string) => string | undefined, maxBytes = WEB_MAX_SELECTED_TRANSCRIPT_BYTES) { const budget = Math.min(maxBytes, WEB_MAX_SELECTED_TRANSCRIPT_BYTES); const retained = entries.slice(-WEB_MAX_ENTRIES); diff --git a/web/ui/src/features/transcript/transcript-entries.ts b/web/ui/src/features/transcript/transcript-entries.ts index 2d7d0bbdf..da0c2ecb4 100644 --- a/web/ui/src/features/transcript/transcript-entries.ts +++ b/web/ui/src/features/transcript/transcript-entries.ts @@ -101,7 +101,11 @@ interface PersistedProjection { customIndexes: Map; nativeByIdentity: Map; nativeByLegacySignature: Map; - nativeMessages: { identity: string | undefined; signature: string }[]; + nativeMessages: { + identity: string | undefined; + signature: string; + content: string; + }[]; promptCandidates: { key: string; position: number | undefined; @@ -235,6 +239,7 @@ function persistedTranscriptProjection( const nativeMessages = baseEntries.map((entry) => ({ identity: messageIdentity(entry.message), signature: legacySignature(entry.message), + content: entry.message.content, })); const nativeByIdentity = new Map(); const nativeByLegacySignature = new Map(); @@ -516,6 +521,11 @@ export function buildEntries( const identity = messageIdentity(message); const toolIdentity = toolMessageIdentity(message); const legacy = legacySignature(message); + // A live message shortened to fit one SSE event never equals its + // persisted entry; the same identity with a matching text prefix does. + const transportPrefix = message.truncation?.transport + ? message.content.replace(/\n\[truncated\]$/, "") + : undefined; const match = identity === undefined ? firstUnmatched( @@ -526,7 +536,11 @@ export function buildEntries( (index) => (toolIdentity !== undefined || !matchedMessages.has(index)) && (toolIdentity !== undefined || - projection.nativeMessages[index]?.signature === legacy), + (transportPrefix !== undefined + ? projection.nativeMessages[index]?.content.startsWith( + transportPrefix, + ) + : projection.nativeMessages[index]?.signature === legacy)), ) ?? -1); if (match >= 0) { matchedMessages.add(match); From a13796a36c596779d01ce3fb150b417f22b2e44e Mon Sep 17 00:00:00 2001 From: tt-a1i <53142663+tt-a1i@users.noreply.github.com> Date: Sat, 31 Oct 2026 08:44:06 +0800 Subject: [PATCH 2/3] fix(web): qualify truncated message identity and preserve timing --- tests/web/live-message-budget.spec.ts | 129 +++++++++++++++++- web/dist/app-MermaidPreview.js | 10 +- web/dist/app-abnfDiagram-O67JEVCF.js | 2 +- web/dist/app-architectureDiagram-NJMV4G6O.js | 6 +- web/dist/app-blockDiagram-BEXU5L5S.js | 8 +- web/dist/app-c4Diagram-YGBWAQC7.js | 2 +- web/dist/app-chunk-3FUC2YCW.js | 2 +- web/dist/app-chunk-7INBJB4K.js | 40 +++--- web/dist/app-chunk-7M6MHVWA.js | 10 +- web/dist/app-chunk-GNY47TPC.js | 4 +- web/dist/app-chunk-UA2S7LBM.js | 2 +- web/dist/app-chunk-Z7XXMR3K.js | 6 +- web/dist/app-classDiagram-v2-NBCMYWYE.js | 8 +- web/dist/app-dagre-6A5THRUB.js | 4 +- web/dist/app-diagram-22UHCM2B.js | 14 +- web/dist/app-diagram-3UASUU5V.js | 2 +- web/dist/app-diagram-ATOU4E4O.js | 6 +- web/dist/app-diagram-CDSNMT55.js | 4 +- web/dist/app-ebnfDiagram-ZINNZB2B.js | 2 +- web/dist/app-elk-276RUBZZ.js | 4 +- web/dist/app-erDiagram-OPXOYQCR.js | 4 +- web/dist/app-flowDiagram-KWPJA3E3.js | 2 +- web/dist/app-kanban-definition-PNTS6WVX.js | 10 +- web/dist/app-mindmap-definition-NLK3R4M7.js | 4 +- web/dist/app-pegDiagram-GJSIUBJH.js | 2 +- web/dist/app-railroadDiagram-XR7U4H2S.js | 2 +- web/dist/app-requirementDiagram-PLB6GJNP.js | 4 +- web/dist/app-sequenceDiagram-PO4LG4MO.js | 10 +- web/dist/app-stateDiagram-v2-GCMORJYK.js | 4 +- web/dist/app-swimlanes-2SLR337P.js | 2 +- web/dist/app-swimlanesDiagram-TC7HE7FX.js | 2 +- web/dist/app-usecaseDiagram-POWQR4AR.js | 4 +- web/dist/app.js | 21 +-- web/dist/build-info.json | 2 +- .../features/transcript/transcript-entries.ts | 125 ++++++++++++++--- 35 files changed, 336 insertions(+), 127 deletions(-) diff --git a/tests/web/live-message-budget.spec.ts b/tests/web/live-message-budget.spec.ts index 9af07dfcb..fe9474983 100644 --- a/tests/web/live-message-budget.spec.ts +++ b/tests/web/live-message-budget.spec.ts @@ -12,6 +12,10 @@ import { type WebSnapshot, } from "../../web/protocol/types.ts"; import { Transcript } from "../../web/ui/src/features/transcript/Transcript.tsx"; +import { + buildEntries, + displayedThinkingDuration, +} from "../../web/ui/src/features/transcript/transcript-entries.ts"; import { i18n } from "../../web/ui/src/i18n.ts"; afterEach(cleanup); @@ -92,7 +96,7 @@ const persistedEntry = (message: WebLiveMessage) => ({ message, }); -it("FAIL: a byte-trimmed live reply is not shown again beside its persisted entry", () => { +it("a byte-trimmed live reply is not shown again beside its persisted entry", () => { expect(live.truncation?.transport).toBe(true); expect(responseRows(snapshotWith([persistedEntry(persisted)]), live)).toBe(1); }); @@ -108,3 +112,126 @@ it("a byte-trimmed live reply does not hide a different reply that shares its ti }); expect(responseRows(snapshotWith([persistedEntry(other)]), live)).toBe(2); }); + +const thinking = projectMessage({ + role: "assistant", + timestamp: 42, + content: [ + { type: "thinking", thinking: "思".repeat(12_000) }, + { type: "thinking", thinking: "考".repeat(12_000) }, + ], +}); +const shortThinking = fitLiveMessage(thinking, WEB_MAX_EVENT_BYTES - 200); +const presentation = () => ({ + nativeRowKeys: new Map(), + ambiguousTimingIds: new Set(), +}); + +it("does not hide a transport-trimmed pure-thinking reply behind unrelated same-timestamp thinking", () => { + const other = projectMessage({ + role: "assistant", + timestamp: 42, + content: [{ type: "thinking", thinking: "Earlier reasoning" }], + }); + expect(shortThinking.content).toBe(""); + expect(shortThinking.truncation?.transport).toBe(true); + const { entries } = buildEntries( + snapshotWith([persistedEntry(other)]), + [{ key: "live", message: shortThinking }], + presentation(), + ); + expect(entries.map((entry) => entry.key)).toEqual(["reply", "live"]); + expect( + displayedThinkingDuration(entries[0]!, { "message-assistant-42": 1234 }), + ).toBeUndefined(); +}); + +it.each([undefined, 42])( + "reconciles transport projections without losing thinking timing (timestamp %s)", + (timestamp) => { + const message = { ...thinking, timestamp }; + const live = fitLiveMessage(message, WEB_MAX_EVENT_BYTES - 200); + const keys = presentation(); + const state = snapshotWith([persistedEntry(message)]); + for (const liveMessages of [[{ key: "live", message: live }], []]) { + const { entries } = buildEntries(state, liveMessages, keys); + expect(entries).toHaveLength(1); + expect(entries[0]!.entryId).toBe("reply"); + expect(displayedThinkingDuration(entries[0]!, { live: 1234 })).toBe(1234); + } + }, +); + +it("collapses a timestamp-free byte-trimmed user message", () => { + const message = projectMessage({ + role: "user", + content: "中".repeat(12_000), + }); + const live = fitLiveMessage(message, 20_000); + expect(live.truncation?.transport).toBe(true); + expect( + buildEntries( + snapshotWith([persistedEntry(message)]), + [{ key: "live", message: live }], + presentation(), + ).entries, + ).toHaveLength(1); +}); + +it("qualifies thinking parts even when visible reply prefixes agree", () => { + const message = projectMessage({ + role: "assistant", + timestamp: 42, + content: [ + { type: "text", text: "中".repeat(12_000) }, + { type: "thinking", thinking: "思".repeat(12_000) }, + ], + }); + const other = { + ...message, + parts: message.parts?.map((part) => + part.type === "thinking" + ? { ...part, text: "Different reasoning" } + : part, + ), + }; + const live = fitLiveMessage(message, 20_000); + expect( + buildEntries( + snapshotWith([persistedEntry(other)]), + [{ key: "live", message: live }], + presentation(), + ).entries, + ).toHaveLength(2); +}); + +it("does not assign transport timing when native candidates or live owners are indistinguishable", () => { + for (const duplicate of ["native", "live"]) { + const state = snapshotWith([ + persistedEntry(thinking), + ...(duplicate === "native" + ? [{ ...persistedEntry(thinking), id: "second" }] + : []), + ]); + const keys = presentation(); + const { entries } = buildEntries( + state, + [ + { key: "live", message: shortThinking }, + ...(duplicate === "live" + ? [{ key: "other-live", message: shortThinking }] + : []), + ], + keys, + ); + const durations = { + live: 1234, + "other-live": 2345, + "message-assistant-42": 3456, + }; + for (const entry of entries.filter((entry) => entry.entryId)) + expect(displayedThinkingDuration(entry, durations)).toBeUndefined(); + for (const entry of buildEntries(state, [], keys).entries) + expect(displayedThinkingDuration(entry, durations)).toBeUndefined(); + } +}); diff --git a/web/dist/app-MermaidPreview.js b/web/dist/app-MermaidPreview.js index e38a406ce..ad29af2fc 100644 --- a/web/dist/app-MermaidPreview.js +++ b/web/dist/app-MermaidPreview.js @@ -1,11 +1,11 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["app-c4Diagram-YGBWAQC7.js","app-chunk-Y2CYZVJY.js","app-src.js","app-rolldown-runtime.js","app-chunk-O7XYJQB3.js","app-preload-helper.js","app-purify.es.js","app-chunk-ZIGJFQKS.js","app-dist.js","app-chunk-742MDFTN.js","app-chunk-MBY4JIJT.js","app-chunk-7PRAP22T.js","app-chunk-7INBJB4K.js","app-chunk-J5ZVWO5B.js","app-rough.esm.js","app-chunk-GWA4HPMP.js","app-flowDiagram-KWPJA3E3.js","app-chunk-5DYCD2WN.js","app-chunk-Z7XXMR3K.js","app-line.js","app-path.js","app-array.js","app-chunk-XXDRQBXY.js","app-chunk-WEXAMYUT.js","app-chunk-UA2S7LBM.js","app-chunk-GNY47TPC.js","app-chunk-DUW6YSOI.js","app-chunk-LNGE3PJU.js","app-chunk-7M6MHVWA.js","app-channel.js","app-chunk-5VM5RSS4.js","app-diagram-22UHCM2B.js","app-swimlanesDiagram-TC7HE7FX.js","app-erDiagram-OPXOYQCR.js","app-gitGraphDiagram-X574FWY7.js","app-chunk-JWPE2WC7.js","app-mermaid-parser.core.js","app-chunk-FOHPRMQF.js","app-chunk-6AZGARVD.js","app-chunk-6TQVIW2G.js","app-chunk-6EIED4P4.js","app-chunk-KI3K4JFJ.js","app-chunk-5V3GS4D5.js","app-chunk-UY3FDG6J.js","app-chunk-3Z5EZCMW.js","app-chunk-I5DQTOEV.js","app-chunk-OUJLGHUK.js","app-chunk-XHIXRSVI.js","app-chunk-2ZTRR5NV.js","app-chunk-747NJXEK.js","app-chunk-IH6LHLGP.js","app-chunk-6K3QC6MW.js","app-chunk-ICYGCRZG.js","app-chunk-2Q5K7J3B.js","app-ganttDiagram-FUAMR5RP.js","app-linear.js","app-defaultLocale.js","app-init.js","app-infoDiagram-VRGFBTTK.js","app-chunk-6AEJRKK7.js","app-pieDiagram-5QR66LMP.js","app-ordinal.js","app-arc.js","app-quadrantDiagram-O4NWA36T.js","app-xychartDiagram-PMCCYNJV.js","app-requirementDiagram-PLB6GJNP.js","app-sequenceDiagram-PO4LG4MO.js","app-classDiagram-v2-NBCMYWYE.js","app-stateDiagram-v2-GCMORJYK.js","app-journeyDiagram-ZHPQQLJL.js","app-timeline-definition-EJHVYXUP.js","app-mindmap-definition-NLK3R4M7.js","app-kanban-definition-PNTS6WVX.js","app-sankeyDiagram-IPEJSGJF.js","app-diagram-MLGK6HIB.js","app-diagram-MPIPVDR6.js","app-blockDiagram-BEXU5L5S.js","app-graphlib.js","app-diagram-CDSNMT55.js","app-architectureDiagram-NJMV4G6O.js","app-cytoscape.esm.js","app-diagram-ATOU4E4O.js","app-ishikawaDiagram-OU5B5YK6.js","app-vennDiagram-UO4OBE2U.js","app-diagram-3UASUU5V.js","app-usecaseDiagram-POWQR4AR.js","app-wardleyDiagram-VNRHLVJA.js","app-cynefinDiagram-VND7K2PF.js","app-railroadDiagram-XR7U4H2S.js","app-chunk-GTNCS2PH.js","app-ebnfDiagram-ZINNZB2B.js","app-abnfDiagram-O67JEVCF.js","app-pegDiagram-GJSIUBJH.js"])))=>i.map(i=>d[i]); -import{i as e}from"./app-rolldown-runtime.js";import{n as t,t as n}from"./app-jsx-runtime.js";import{t as r}from"./app-preload-helper.js";import{a as i,t as a}from"./app-useTranslation.js";import{n as o,r as s,t as c}from"./app-x.js";import{t as l}from"./app-purify.es.js";import{n as u}from"./app-chunk-Y2CYZVJY.js";import{h as d,m as f,p}from"./app-src.js";import{$ as m,C as h,E as g,I as _,J as v,K as y,L as b,N as x,P as S,Q as C,S as w,T as ee,V as te,W as ne,Z as T,_ as re,b as E,c as ie,f as ae,g as oe,l as D,m as O,n as se,p as ce,r as le,t as ue,u as de}from"./app-chunk-O7XYJQB3.js";import{S as fe,a as pe,f as me,g as k,h as he,i as ge,o as _e,v as ve,x as ye,y as be}from"./app-chunk-ZIGJFQKS.js";import{t as xe}from"./app-chunk-6AEJRKK7.js";import{r as Se}from"./app-chunk-742MDFTN.js";import{a as Ce}from"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import"./app-chunk-UA2S7LBM.js";import{n as we}from"./app-chunk-GNY47TPC.js";import{n as Te,t as Ee}from"./app-chunk-LNGE3PJU.js";var De=i(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]);function Oe(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function ke(e){if(e==null)return!0;if(ye(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!fe(e)&&!ve(e)&&!be(e)?!1:e.length===0;if(typeof e==`object`||typeof e==`function`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return Oe(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var Ae=`comm`,je=`rule`,Me=`decl`,Ne=`@import`,Pe=`@namespace`,Fe=`@keyframes`,Ie=`@layer`,Le=Math.abs,A=String.fromCharCode;function Re(e){return e.trim()}function ze(e,t,n){return e.replace(t,n)}function j(e,t){return e.charCodeAt(t)|0}function M(e,t,n){return e.slice(t,n)}function N(e){return e.length}function Be(e){return e.length}function P(e,t){return t.push(e),e}var F=1,I=1,Ve=0,L=0,R=0,z=``;function B(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:F,column:I,length:o,return:``,siblings:s}}function He(){return R}function Ue(){return R=L>0?j(z,--L):0,I--,R===10&&(I=1,F--),R}function V(){return R=L2||G(R)>3?``:` `}function Je(e,t){for(;--t&&V()&&!(R<48||R>102||R>57&&R<65||R>70&&R<97););return W(e,U()+(t<6&&H()==32&&V()==32))}function Ye(e){for(;V();)switch(R){case e:return L;case 34:case 39:e!==34&&e!==39&&Ye(R);break;case 40:e===41&&Ye(e);break;case 92:V();break}return L}function Xe(e,t){for(;V()&&e+R!==57&&(e+R!==84||H()!==47););return`/*`+W(t,L-1)+`*`+A(e===47?e:V())}function Ze(e){for(;!G(H());)V();return W(e,L)}function Qe(e){return Ge(K(``,null,null,null,[``],e=We(e),0,[0],e))}function K(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=V()){case 40:m!=108&&j(w,d-1)==58?(v++,w+=`(`):w+=Ke(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=Ke(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=A(y);break}w+=qe(m);break;case 92:w+=Je(U()-1,7);continue;case 47:switch(H()){case 42:case 47:P(et(Xe(V(),U()),t,n,c),c),(G(m||1)==5||G(H()||1)==5)&&N(w)&&M(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=N(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=A(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=ze(w,/\f/g,``)),p>0&&(N(w)-d||h===0)&&P(p>32?tt(w+`;`,r,n,d-1,c):tt(ze(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(P(C=$e(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)K(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(j(w,3)===110)break;case 108:if(j(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?K(e,C,C,r&&P($e(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):K(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+N(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&Ue()==125)continue}switch(w+=A(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(N(w)-1)*_,_=1;break;case 64:H()===45&&(w+=Ke(V())),f=H(),u=d=N(b=w+=Ze(U())),y++;break;case 45:m===45&&N(w)==2&&(h=0)}}return a}function $e(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=Be(p),h=0,g=0,_=0;h0?p[v]+` `+y:ze(y,/&\f/g,p[v])))&&(c[_++]=b);return B(e,t,n,i===0?je:s,c,l,u,d)}function et(e,t,n,r){return B(e,t,n,Ae,A(He()),M(e,2,-2),0,r)}function tt(e,t,n,r,i){return B(e,t,n,Me,M(e,0,r),M(e,r+1,-1),r,i)}function nt(e,t){for(var n=``,r=0;r/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-c4Diagram-YGBWAQC7.js`);return{diagram:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));return{id:at,diagram:e}},`loader`)},st=`flowchart-v2`,ct={id:st,detector:u(e=>/^\s*(graph|flowchart)/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-flowDiagram-KWPJA3E3.js`);return{diagram:e}},__vite__mapDeps([16,2,3,1,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,15,22,23,24,25,26,27,28,29,30]));return{id:st,diagram:e}},`loader`)},lt=`agentflow`,ut={id:lt,detector:u(e=>/^\s*agentflow-beta\b/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-22UHCM2B.js`);return{diagram:e}},__vite__mapDeps([31,6,1,2,3,4,5,29,7,8,9,10,30,11,13,12,14,17,18,19,20,21,15,22,23,24,25,26,27]));return{id:lt,diagram:e}},`loader`)},dt=`swimlane`,ft={id:dt,detector:u(e=>/^\s*swimlane-beta\b/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-swimlanesDiagram-TC7HE7FX.js`);return{diagram:e}},__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,15,22,23,24,25,26,27,28,29,30]));return{id:dt,diagram:e}},`loader`)},pt=`er`,mt={id:pt,detector:u(e=>/^\s*erDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-erDiagram-OPXOYQCR.js`);return{diagram:e}},__vite__mapDeps([33,1,2,3,4,5,6,29,7,8,9,10,11,13,12,14,17,18,19,20,21,22,23,24,25,26]));return{id:pt,diagram:e}},`loader`)},ht=`gitGraph`,gt={id:ht,detector:u(e=>/^\s*gitGraph/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-gitGraphDiagram-X574FWY7.js`);return{diagram:e}},__vite__mapDeps([34,1,2,3,4,5,6,7,8,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53]));return{id:ht,diagram:e}},`loader`)},_t=`gantt`,vt={id:_t,detector:u(e=>/^\s*gantt/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-ganttDiagram-FUAMR5RP.js`);return{diagram:e}},__vite__mapDeps([54,3,1,2,4,5,6,55,56,57,8,7]));return{id:_t,diagram:e}},`loader`)},yt=`info`,bt={id:yt,detector:u(e=>/^\s*info/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-infoDiagram-VRGFBTTK.js`);return{diagram:e}},__vite__mapDeps([58,1,2,3,4,5,6,59,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:yt,diagram:e}},`loader`)},xt=`pie`,St={id:xt,detector:u(e=>/^\s*pie/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-pieDiagram-5QR66LMP.js`);return{diagram:e}},__vite__mapDeps([60,1,2,3,4,5,6,61,57,20,8,62,21,7,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:xt,diagram:e}},`loader`)},Ct=`quadrantChart`,wt={id:Ct,detector:u(e=>/^\s*quadrantChart/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-quadrantDiagram-O4NWA36T.js`);return{diagram:e}},__vite__mapDeps([63,1,2,3,4,5,6,55,56,57]));return{id:Ct,diagram:e}},`loader`)},Tt=`xychart`,Et={id:Tt,detector:u(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-xychartDiagram-PMCCYNJV.js`);return{diagram:e}},__vite__mapDeps([64,1,2,3,4,5,6,55,56,57,61,7,8,19,20,21,59,9,10]));return{id:Tt,diagram:e}},`loader`)},Dt=`requirement`,Ot={id:Dt,detector:u(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-requirementDiagram-PLB6GJNP.js`);return{diagram:e}},__vite__mapDeps([65,1,2,3,4,5,6,7,8,9,10,11,13,12,14,17,18,19,20,21,22,23,24,25,26]));return{id:Dt,diagram:e}},`loader`)},kt=`sequence`,At={id:kt,detector:u(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-sequenceDiagram-PO4LG4MO.js`);return{diagram:e}},__vite__mapDeps([66,1,2,3,4,5,6,8,7,15,27,53]));return{id:kt,diagram:e}},`loader`)},jt=`classDiagram`,Mt={id:jt,detector:u(e=>/^\s*classDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-classDiagram-v2-NBCMYWYE.js`);return{diagram:e}},__vite__mapDeps([67,6,1,2,3,4,5,7,8,9,10,30,11,13,12,14,17,18,19,20,21,15,22,23,24,25,26]));return{id:jt,diagram:e}},`loader`)},Nt=`stateDiagram`,Pt={id:Nt,detector:u(e=>/^\s*stateDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-stateDiagram-v2-GCMORJYK.js`);return{diagram:e}},__vite__mapDeps([68,6,1,2,3,4,5,7,8,9,10,11,13,12,14,17,18,19,20,21,15,22,23,24,25,26]));return{id:Nt,diagram:e}},`loader`)},Ft=`journey`,It={id:Ft,detector:u(e=>/^\s*journey/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-journeyDiagram-ZHPQQLJL.js`);return{diagram:e}},__vite__mapDeps([69,1,2,3,4,5,6,62,20,8,30,15]));return{id:Ft,diagram:e}},`loader`)},Lt={draw:u((e,t,n)=>{f.debug(`rendering svg for syntax error -`);let r=xe(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),ie(r,100,512,!0),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},Rt=Lt,zt={db:{},renderer:Lt,parser:{parse:u(()=>{},`parse`)}},Bt=`flowchart-elk`,Vt={id:Bt,detector:u((e,t={})=>/^\s*flowchart-elk/.test(e)?(t.layout=`elk`,!0):!1,`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-flowDiagram-KWPJA3E3.js`);return{diagram:e}},__vite__mapDeps([16,2,3,1,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,15,22,23,24,25,26,27,28,29,30]));return{id:Bt,diagram:e}},`loader`)},Ht=`timeline`,Ut={id:Ht,detector:u(e=>/^\s*timeline/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-timeline-definition-EJHVYXUP.js`);return{diagram:e}},__vite__mapDeps([70,1,2,3,4,5,6,62,20,8,7,59,13]));return{id:Ht,diagram:e}},`loader`)},Wt=`mindmap`,Gt={id:Wt,detector:u(e=>/^\s*mindmap/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-mindmap-definition-NLK3R4M7.js`);return{diagram:e}},__vite__mapDeps([71,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,22,23,24,25,26]));return{id:Wt,diagram:e}},`loader`)},Kt=`kanban`,qt={id:Kt,detector:u(e=>/^\s*kanban/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-kanban-definition-PNTS6WVX.js`);return{diagram:e}},__vite__mapDeps([72,1,2,3,4,5,6,7,8,59,9,10,30,11,12,13,14,17,24,27]));return{id:Kt,diagram:e}},`loader`)},Jt=`sankey`,Yt={id:Jt,detector:u(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-sankeyDiagram-IPEJSGJF.js`);return{diagram:e}},__vite__mapDeps([73,1,2,3,4,5,6,61,57]));return{id:Jt,diagram:e}},`loader`)},Xt=`packet`,Zt={id:Xt,detector:u(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-MLGK6HIB.js`);return{diagram:e}},__vite__mapDeps([74,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:Xt,diagram:e}},`loader`)},Qt=`radar`,$t={id:Qt,detector:u(e=>/^\s*radar-beta/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-MPIPVDR6.js`);return{diagram:e}},__vite__mapDeps([75,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:Qt,diagram:e}},`loader`)},en=`block`,tn={id:en,detector:u(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-blockDiagram-BEXU5L5S.js`);return{diagram:e}},__vite__mapDeps([76,1,2,3,4,5,6,29,7,8,9,10,30,26,11,13,12,14,17,18,19,20,21,77]));return{id:en,diagram:e}},`loader`)},nn=`treeView`,rn={id:nn,detector:u(e=>/^\s*treeView-beta/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-CDSNMT55.js`);return{diagram:e}},__vite__mapDeps([78,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,9,53]));return{id:nn,diagram:e}},`loader`)},an=`architecture`,on={id:an,detector:u(e=>/^\s*architecture/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-architectureDiagram-NJMV4G6O.js`);return{diagram:e}},__vite__mapDeps([79,3,1,2,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,9,10,80]));return{id:an,diagram:e}},`loader`)},sn=`eventmodeling`,cn={id:sn,detector:u(e=>/^\s*eventmodeling/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-ATOU4E4O.js`);return{diagram:e}},__vite__mapDeps([81,37,1,2,3,4,5,6,7,8,35,36,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:sn,diagram:e}},`loader`)},ln=`ishikawa`,un={id:ln,detector:u(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-ishikawaDiagram-OU5B5YK6.js`);return{diagram:e}},__vite__mapDeps([82,1,2,3,4,5,6,7,8,59,14]));return{id:ln,diagram:e}},`loader`)},dn=`venn`,fn={id:dn,detector:u(e=>/^\s*venn-beta/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-vennDiagram-UO4OBE2U.js`);return{diagram:e}},__vite__mapDeps([83,1,2,3,4,5,6,7,8,59,14]));return{id:dn,diagram:e}},`loader`)},pn=`treemap`,mn={id:pn,detector:u(e=>/^\s*treemap/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-3UASUU5V.js`);return{diagram:e}},__vite__mapDeps([84,1,2,3,4,5,6,61,57,56,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,11,23]));return{id:pn,diagram:e}},`loader`)},hn=`usecase`,gn={id:hn,detector:u(e=>/^\s*usecase-beta(?:\s|$)/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-usecaseDiagram-POWQR4AR.js`);return{diagram:e}},__vite__mapDeps([85,1,2,3,4,5,6,7,8,9,10,11,13,12,14,17,18,19,20,21,22,23,24,25,26]));return{id:hn,diagram:e}},`loader`)},_n=`wardley`,vn={id:_n,detector:u(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-wardleyDiagram-VNRHLVJA.js`);return{diagram:e}},__vite__mapDeps([86,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:_n,diagram:e}},`loader`)},yn=`cynefin`,bn={id:yn,detector:u(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-cynefinDiagram-VND7K2PF.js`);return{diagram:e}},__vite__mapDeps([87,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:yn,diagram:e}},`loader`)},xn=`railroad`,Sn={id:xn,detector:u(e=>/^\s*railroad-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-railroadDiagram-XR7U4H2S.js`);return{diagram:e}},__vite__mapDeps([88,46,37,1,2,3,4,5,6,59,89,35,36,38,39,40,41,42,43,44,45,47,48,49,50,51,52]));return{id:xn,diagram:e}},`loader`)},Cn=`railroadEbnf`,wn={id:Cn,detector:u(e=>/^\s*railroad-ebnf-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-ebnfDiagram-ZINNZB2B.js`);return{diagram:e}},__vite__mapDeps([90,48,37,1,2,3,4,5,6,59,89,35,36,38,39,40,41,42,43,44,45,46,47,49,50,51,52]));return{id:Cn,diagram:e}},`loader`)},Tn=`railroadAbnf`,En={id:Tn,detector:u(e=>/^\s*railroad-abnf-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-abnfDiagram-O67JEVCF.js`);return{diagram:e}},__vite__mapDeps([91,47,37,1,2,3,4,5,6,59,89,35,36,38,39,40,41,42,43,44,45,46,48,49,50,51,52]));return{id:Tn,diagram:e}},`loader`)},Dn=`railroadPeg`,On={id:Dn,detector:u(e=>/^\s*railroad-peg-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-pegDiagram-GJSIUBJH.js`);return{diagram:e}},__vite__mapDeps([92,49,37,1,2,3,4,5,6,59,89,35,36,38,39,40,41,42,43,44,45,46,47,48,50,51,52]));return{id:Dn,diagram:e}},`loader`)},kn=!1,q=u(()=>{kn||(kn=!0,x(`error`,zt,e=>e.toLowerCase().trim()===`error`),x(`---`,{db:{clear:u(()=>{},`clear`)},styles:{},renderer:{draw:u(()=>{},`draw`)},parser:{parse:u(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:u(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),S(Vt,Gt,on),S(ut,ot,qt,Mt,mt,vt,bt,St,Ot,At,ft,ct,Ut,gt,Pt,It,wt,Yt,Zt,Et,tn,cn,rn,$t,un,mn,Sn,wn,En,On,fn,vn,bn,gn))},`addDiagrams`),An=u(async()=>{f.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(O).map(async([e,{detector:t,loader:n}])=>{if(n)try{w(e)}catch{try{let{diagram:e,id:r}=await n();x(r,e,t)}catch(t){throw f.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete O[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){f.error(`Failed to load ${e.length} external diagrams`);for(let t of e)f.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),jn=`graphics-document document`;function Mn(e,t){e.attr(`role`,jn),t!==``&&e.attr(`aria-roledescription`,t)}u(Mn,`setA11yDiagramInfo`);function Nn(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}u(Nn,`addSVGa11yTitleDescription`);var J=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{u(this,`Diagram`)}static async fromText(t,n={}){let r=typeof t==`string`?{raw:t,cleaned:t}:t,i=E(),a=ce(r.cleaned,i);try{w(a)}catch{let e=h(a);if(!e)throw new ue(`Diagram ${a} not found.`);let{id:t,diagram:n}=await e();x(t,n)}let{db:o,parser:s,renderer:c,init:l}=w(a);s.parser&&(s.parser.yy=o),o.clear?.(),l?.(i),n.title&&o.setDiagramTitle?.(n.title);let u=r.cleaned;if(o.preserveCommentsWhenParsing&&r.withComments){let e=i.maxTextSize??ae.maxTextSize;r.withComments.length>e?f.warn(`Comment-preserving source exceeds maxTextSize (${r.withComments.length} > ${e}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):u=r.withComments}let d=_e(u)+` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["app-c4Diagram-YGBWAQC7.js","app-chunk-Y2CYZVJY.js","app-src.js","app-rolldown-runtime.js","app-chunk-O7XYJQB3.js","app-preload-helper.js","app-purify.es.js","app-chunk-ZIGJFQKS.js","app-dist.js","app-chunk-7PRAP22T.js","app-chunk-742MDFTN.js","app-chunk-MBY4JIJT.js","app-chunk-7INBJB4K.js","app-chunk-J5ZVWO5B.js","app-rough.esm.js","app-chunk-GWA4HPMP.js","app-flowDiagram-KWPJA3E3.js","app-chunk-LNGE3PJU.js","app-chunk-5DYCD2WN.js","app-chunk-UA2S7LBM.js","app-chunk-Z7XXMR3K.js","app-line.js","app-path.js","app-array.js","app-chunk-GNY47TPC.js","app-chunk-DUW6YSOI.js","app-chunk-XXDRQBXY.js","app-chunk-WEXAMYUT.js","app-chunk-7M6MHVWA.js","app-channel.js","app-chunk-5VM5RSS4.js","app-diagram-22UHCM2B.js","app-swimlanesDiagram-TC7HE7FX.js","app-erDiagram-OPXOYQCR.js","app-gitGraphDiagram-X574FWY7.js","app-chunk-JWPE2WC7.js","app-mermaid-parser.core.js","app-chunk-FOHPRMQF.js","app-chunk-6AZGARVD.js","app-chunk-6TQVIW2G.js","app-chunk-6EIED4P4.js","app-chunk-KI3K4JFJ.js","app-chunk-5V3GS4D5.js","app-chunk-UY3FDG6J.js","app-chunk-3Z5EZCMW.js","app-chunk-I5DQTOEV.js","app-chunk-OUJLGHUK.js","app-chunk-XHIXRSVI.js","app-chunk-2ZTRR5NV.js","app-chunk-747NJXEK.js","app-chunk-IH6LHLGP.js","app-chunk-6K3QC6MW.js","app-chunk-ICYGCRZG.js","app-chunk-2Q5K7J3B.js","app-ganttDiagram-FUAMR5RP.js","app-linear.js","app-defaultLocale.js","app-init.js","app-infoDiagram-VRGFBTTK.js","app-chunk-6AEJRKK7.js","app-pieDiagram-5QR66LMP.js","app-ordinal.js","app-arc.js","app-quadrantDiagram-O4NWA36T.js","app-xychartDiagram-PMCCYNJV.js","app-requirementDiagram-PLB6GJNP.js","app-sequenceDiagram-PO4LG4MO.js","app-classDiagram-v2-NBCMYWYE.js","app-stateDiagram-v2-GCMORJYK.js","app-journeyDiagram-ZHPQQLJL.js","app-timeline-definition-EJHVYXUP.js","app-mindmap-definition-NLK3R4M7.js","app-kanban-definition-PNTS6WVX.js","app-sankeyDiagram-IPEJSGJF.js","app-diagram-MLGK6HIB.js","app-diagram-MPIPVDR6.js","app-blockDiagram-BEXU5L5S.js","app-graphlib.js","app-diagram-CDSNMT55.js","app-architectureDiagram-NJMV4G6O.js","app-cytoscape.esm.js","app-diagram-ATOU4E4O.js","app-ishikawaDiagram-OU5B5YK6.js","app-vennDiagram-UO4OBE2U.js","app-diagram-3UASUU5V.js","app-usecaseDiagram-POWQR4AR.js","app-wardleyDiagram-VNRHLVJA.js","app-cynefinDiagram-VND7K2PF.js","app-railroadDiagram-XR7U4H2S.js","app-chunk-GTNCS2PH.js","app-ebnfDiagram-ZINNZB2B.js","app-abnfDiagram-O67JEVCF.js","app-pegDiagram-GJSIUBJH.js"])))=>i.map(i=>d[i]); +import{i as e}from"./app-rolldown-runtime.js";import{n as t,t as n}from"./app-jsx-runtime.js";import{t as r}from"./app-preload-helper.js";import{a as i,t as a}from"./app-useTranslation.js";import{n as o,r as s,t as c}from"./app-x.js";import{t as l}from"./app-purify.es.js";import{n as u}from"./app-chunk-Y2CYZVJY.js";import{h as d,m as f,p}from"./app-src.js";import{$ as m,C as h,E as g,I as _,J as v,K as y,L as b,N as x,P as S,Q as C,S as w,T as ee,V as te,W as ne,Z as T,_ as re,b as E,c as ie,f as ae,g as oe,l as D,m as O,n as se,p as ce,r as le,t as ue,u as de}from"./app-chunk-O7XYJQB3.js";import{S as fe,a as pe,f as me,g as k,h as he,i as ge,o as _e,v as ve,x as ye,y as be}from"./app-chunk-ZIGJFQKS.js";import{t as xe}from"./app-chunk-6AEJRKK7.js";import{n as Se,t as Ce}from"./app-chunk-LNGE3PJU.js";import"./app-chunk-7PRAP22T.js";import{r as we}from"./app-chunk-742MDFTN.js";import{a as Te}from"./app-chunk-MBY4JIJT.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{n as Ee}from"./app-chunk-GNY47TPC.js";var De=i(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]);function Oe(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function ke(e){if(e==null)return!0;if(ye(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!fe(e)&&!ve(e)&&!be(e)?!1:e.length===0;if(typeof e==`object`||typeof e==`function`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return Oe(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var Ae=`comm`,je=`rule`,Me=`decl`,Ne=`@import`,Pe=`@namespace`,Fe=`@keyframes`,Ie=`@layer`,Le=Math.abs,A=String.fromCharCode;function Re(e){return e.trim()}function ze(e,t,n){return e.replace(t,n)}function j(e,t){return e.charCodeAt(t)|0}function M(e,t,n){return e.slice(t,n)}function N(e){return e.length}function Be(e){return e.length}function P(e,t){return t.push(e),e}var F=1,I=1,Ve=0,L=0,R=0,z=``;function B(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:F,column:I,length:o,return:``,siblings:s}}function He(){return R}function Ue(){return R=L>0?j(z,--L):0,I--,R===10&&(I=1,F--),R}function V(){return R=L2||G(R)>3?``:` `}function Je(e,t){for(;--t&&V()&&!(R<48||R>102||R>57&&R<65||R>70&&R<97););return W(e,U()+(t<6&&H()==32&&V()==32))}function Ye(e){for(;V();)switch(R){case e:return L;case 34:case 39:e!==34&&e!==39&&Ye(R);break;case 40:e===41&&Ye(e);break;case 92:V();break}return L}function Xe(e,t){for(;V()&&e+R!==57&&(e+R!==84||H()!==47););return`/*`+W(t,L-1)+`*`+A(e===47?e:V())}function Ze(e){for(;!G(H());)V();return W(e,L)}function Qe(e){return Ge(K(``,null,null,null,[``],e=We(e),0,[0],e))}function K(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=V()){case 40:m!=108&&j(w,d-1)==58?(v++,w+=`(`):w+=Ke(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=Ke(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=A(y);break}w+=qe(m);break;case 92:w+=Je(U()-1,7);continue;case 47:switch(H()){case 42:case 47:P(et(Xe(V(),U()),t,n,c),c),(G(m||1)==5||G(H()||1)==5)&&N(w)&&M(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=N(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=A(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=ze(w,/\f/g,``)),p>0&&(N(w)-d||h===0)&&P(p>32?tt(w+`;`,r,n,d-1,c):tt(ze(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(P(C=$e(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)K(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(j(w,3)===110)break;case 108:if(j(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?K(e,C,C,r&&P($e(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):K(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+N(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&Ue()==125)continue}switch(w+=A(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(N(w)-1)*_,_=1;break;case 64:H()===45&&(w+=Ke(V())),f=H(),u=d=N(b=w+=Ze(U())),y++;break;case 45:m===45&&N(w)==2&&(h=0)}}return a}function $e(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=Be(p),h=0,g=0,_=0;h0?p[v]+` `+y:ze(y,/&\f/g,p[v])))&&(c[_++]=b);return B(e,t,n,i===0?je:s,c,l,u,d)}function et(e,t,n,r){return B(e,t,n,Ae,A(He()),M(e,2,-2),0,r)}function tt(e,t,n,r,i){return B(e,t,n,Me,M(e,0,r),M(e,r+1,-1),r,i)}function nt(e,t){for(var n=``,r=0;r/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-c4Diagram-YGBWAQC7.js`);return{diagram:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));return{id:at,diagram:e}},`loader`)},st=`flowchart-v2`,ct={id:st,detector:u(e=>/^\s*(graph|flowchart)/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-flowDiagram-KWPJA3E3.js`);return{diagram:e}},__vite__mapDeps([16,2,3,1,4,5,6,7,8,17,9,10,11,12,13,14,18,19,20,21,22,23,24,25,15,26,27,28,29,30]));return{id:st,diagram:e}},`loader`)},lt=`agentflow`,ut={id:lt,detector:u(e=>/^\s*agentflow-beta\b/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-22UHCM2B.js`);return{diagram:e}},__vite__mapDeps([31,6,1,2,3,4,5,29,7,8,17,9,10,11,13,12,14,18,19,20,21,22,23,24,25,30,15,26,27]));return{id:lt,diagram:e}},`loader`)},dt=`swimlane`,ft={id:dt,detector:u(e=>/^\s*swimlane-beta\b/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-swimlanesDiagram-TC7HE7FX.js`);return{diagram:e}},__vite__mapDeps([32,1,2,3,4,5,6,7,8,17,9,10,11,12,13,14,18,19,20,21,22,23,24,25,15,26,27,28,29,30]));return{id:dt,diagram:e}},`loader`)},pt=`er`,mt={id:pt,detector:u(e=>/^\s*erDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-erDiagram-OPXOYQCR.js`);return{diagram:e}},__vite__mapDeps([33,1,2,3,4,5,6,29,7,8,9,10,11,13,12,14,18,19,20,21,22,23,24,25,26,27]));return{id:pt,diagram:e}},`loader`)},ht=`gitGraph`,gt={id:ht,detector:u(e=>/^\s*gitGraph/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-gitGraphDiagram-X574FWY7.js`);return{diagram:e}},__vite__mapDeps([34,1,2,3,4,5,6,7,8,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53]));return{id:ht,diagram:e}},`loader`)},_t=`gantt`,vt={id:_t,detector:u(e=>/^\s*gantt/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-ganttDiagram-FUAMR5RP.js`);return{diagram:e}},__vite__mapDeps([54,3,1,2,4,5,6,55,56,57,8,7]));return{id:_t,diagram:e}},`loader`)},yt=`info`,bt={id:yt,detector:u(e=>/^\s*info/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-infoDiagram-VRGFBTTK.js`);return{diagram:e}},__vite__mapDeps([58,1,2,3,4,5,6,59,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:yt,diagram:e}},`loader`)},xt=`pie`,St={id:xt,detector:u(e=>/^\s*pie/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-pieDiagram-5QR66LMP.js`);return{diagram:e}},__vite__mapDeps([60,1,2,3,4,5,6,61,57,22,8,62,23,7,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:xt,diagram:e}},`loader`)},Ct=`quadrantChart`,wt={id:Ct,detector:u(e=>/^\s*quadrantChart/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-quadrantDiagram-O4NWA36T.js`);return{diagram:e}},__vite__mapDeps([63,1,2,3,4,5,6,55,56,57]));return{id:Ct,diagram:e}},`loader`)},Tt=`xychart`,Et={id:Tt,detector:u(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-xychartDiagram-PMCCYNJV.js`);return{diagram:e}},__vite__mapDeps([64,1,2,3,4,5,6,55,56,57,61,7,8,21,22,23,59,10,11]));return{id:Tt,diagram:e}},`loader`)},Dt=`requirement`,Ot={id:Dt,detector:u(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-requirementDiagram-PLB6GJNP.js`);return{diagram:e}},__vite__mapDeps([65,1,2,3,4,5,6,7,8,9,10,11,13,12,14,18,19,20,21,22,23,24,25,26,27]));return{id:Dt,diagram:e}},`loader`)},kt=`sequence`,At={id:kt,detector:u(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-sequenceDiagram-PO4LG4MO.js`);return{diagram:e}},__vite__mapDeps([66,1,2,3,4,5,6,8,7,17,15,53]));return{id:kt,diagram:e}},`loader`)},jt=`classDiagram`,Mt={id:jt,detector:u(e=>/^\s*classDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-classDiagram-v2-NBCMYWYE.js`);return{diagram:e}},__vite__mapDeps([67,6,1,2,3,4,5,7,8,9,10,11,13,12,14,18,19,20,21,22,23,24,25,30,15,26,27]));return{id:jt,diagram:e}},`loader`)},Nt=`stateDiagram`,Pt={id:Nt,detector:u(e=>/^\s*stateDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-stateDiagram-v2-GCMORJYK.js`);return{diagram:e}},__vite__mapDeps([68,6,1,2,3,4,5,7,8,9,10,11,13,12,14,18,19,20,21,22,23,24,25,15,26,27]));return{id:Nt,diagram:e}},`loader`)},Ft=`journey`,It={id:Ft,detector:u(e=>/^\s*journey/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-journeyDiagram-ZHPQQLJL.js`);return{diagram:e}},__vite__mapDeps([69,1,2,3,4,5,6,62,22,8,30,15]));return{id:Ft,diagram:e}},`loader`)},Lt={draw:u((e,t,n)=>{f.debug(`rendering svg for syntax error +`);let r=xe(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),ie(r,100,512,!0),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},Rt=Lt,zt={db:{},renderer:Lt,parser:{parse:u(()=>{},`parse`)}},Bt=`flowchart-elk`,Vt={id:Bt,detector:u((e,t={})=>/^\s*flowchart-elk/.test(e)?(t.layout=`elk`,!0):!1,`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-flowDiagram-KWPJA3E3.js`);return{diagram:e}},__vite__mapDeps([16,2,3,1,4,5,6,7,8,17,9,10,11,12,13,14,18,19,20,21,22,23,24,25,15,26,27,28,29,30]));return{id:Bt,diagram:e}},`loader`)},Ht=`timeline`,Ut={id:Ht,detector:u(e=>/^\s*timeline/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-timeline-definition-EJHVYXUP.js`);return{diagram:e}},__vite__mapDeps([70,1,2,3,4,5,6,62,22,8,7,59,13]));return{id:Ht,diagram:e}},`loader`)},Wt=`mindmap`,Gt={id:Wt,detector:u(e=>/^\s*mindmap/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-mindmap-definition-NLK3R4M7.js`);return{diagram:e}},__vite__mapDeps([71,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18,19,20,21,22,23,24,25,26,27]));return{id:Wt,diagram:e}},`loader`)},Kt=`kanban`,qt={id:Kt,detector:u(e=>/^\s*kanban/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-kanban-definition-PNTS6WVX.js`);return{diagram:e}},__vite__mapDeps([72,1,2,3,4,5,6,7,8,59,17,9,10,11,12,13,14,18,19,30]));return{id:Kt,diagram:e}},`loader`)},Jt=`sankey`,Yt={id:Jt,detector:u(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-sankeyDiagram-IPEJSGJF.js`);return{diagram:e}},__vite__mapDeps([73,1,2,3,4,5,6,61,57]));return{id:Jt,diagram:e}},`loader`)},Xt=`packet`,Zt={id:Xt,detector:u(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-MLGK6HIB.js`);return{diagram:e}},__vite__mapDeps([74,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:Xt,diagram:e}},`loader`)},Qt=`radar`,$t={id:Qt,detector:u(e=>/^\s*radar-beta/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-MPIPVDR6.js`);return{diagram:e}},__vite__mapDeps([75,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:Qt,diagram:e}},`loader`)},en=`block`,tn={id:en,detector:u(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-blockDiagram-BEXU5L5S.js`);return{diagram:e}},__vite__mapDeps([76,1,2,3,4,5,6,29,7,8,25,9,10,11,13,12,14,18,20,21,22,23,30,77]));return{id:en,diagram:e}},`loader`)},nn=`treeView`,rn={id:nn,detector:u(e=>/^\s*treeView-beta/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-CDSNMT55.js`);return{diagram:e}},__vite__mapDeps([78,1,2,3,4,5,6,7,8,59,10,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53]));return{id:nn,diagram:e}},`loader`)},an=`architecture`,on={id:an,detector:u(e=>/^\s*architecture/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-architectureDiagram-NJMV4G6O.js`);return{diagram:e}},__vite__mapDeps([79,3,1,2,4,5,6,7,8,59,10,11,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,80]));return{id:an,diagram:e}},`loader`)},sn=`eventmodeling`,cn={id:sn,detector:u(e=>/^\s*eventmodeling/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-ATOU4E4O.js`);return{diagram:e}},__vite__mapDeps([81,1,2,3,4,5,6,7,8,37,35,36,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:sn,diagram:e}},`loader`)},ln=`ishikawa`,un={id:ln,detector:u(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-ishikawaDiagram-OU5B5YK6.js`);return{diagram:e}},__vite__mapDeps([82,1,2,3,4,5,6,7,8,59,14]));return{id:ln,diagram:e}},`loader`)},dn=`venn`,fn={id:dn,detector:u(e=>/^\s*venn-beta/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-vennDiagram-UO4OBE2U.js`);return{diagram:e}},__vite__mapDeps([83,1,2,3,4,5,6,7,8,59,14]));return{id:dn,diagram:e}},`loader`)},pn=`treemap`,mn={id:pn,detector:u(e=>/^\s*treemap/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-3UASUU5V.js`);return{diagram:e}},__vite__mapDeps([84,1,2,3,4,5,6,61,57,56,7,8,59,9,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,27]));return{id:pn,diagram:e}},`loader`)},hn=`usecase`,gn={id:hn,detector:u(e=>/^\s*usecase-beta(?:\s|$)/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-usecaseDiagram-POWQR4AR.js`);return{diagram:e}},__vite__mapDeps([85,1,2,3,4,5,6,7,8,9,10,11,13,12,14,18,19,20,21,22,23,24,25,26,27]));return{id:hn,diagram:e}},`loader`)},_n=`wardley`,vn={id:_n,detector:u(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-wardleyDiagram-VNRHLVJA.js`);return{diagram:e}},__vite__mapDeps([86,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:_n,diagram:e}},`loader`)},yn=`cynefin`,bn={id:yn,detector:u(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-cynefinDiagram-VND7K2PF.js`);return{diagram:e}},__vite__mapDeps([87,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:yn,diagram:e}},`loader`)},xn=`railroad`,Sn={id:xn,detector:u(e=>/^\s*railroad-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-railroadDiagram-XR7U4H2S.js`);return{diagram:e}},__vite__mapDeps([88,1,2,3,4,5,6,59,46,37,89,35,36,38,39,40,41,42,43,44,45,47,48,49,50,51,52]));return{id:xn,diagram:e}},`loader`)},Cn=`railroadEbnf`,wn={id:Cn,detector:u(e=>/^\s*railroad-ebnf-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-ebnfDiagram-ZINNZB2B.js`);return{diagram:e}},__vite__mapDeps([90,1,2,3,4,5,6,59,48,37,89,35,36,38,39,40,41,42,43,44,45,46,47,49,50,51,52]));return{id:Cn,diagram:e}},`loader`)},Tn=`railroadAbnf`,En={id:Tn,detector:u(e=>/^\s*railroad-abnf-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-abnfDiagram-O67JEVCF.js`);return{diagram:e}},__vite__mapDeps([91,1,2,3,4,5,6,59,47,37,89,35,36,38,39,40,41,42,43,44,45,46,48,49,50,51,52]));return{id:Tn,diagram:e}},`loader`)},Dn=`railroadPeg`,On={id:Dn,detector:u(e=>/^\s*railroad-peg-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-pegDiagram-GJSIUBJH.js`);return{diagram:e}},__vite__mapDeps([92,1,2,3,4,5,6,59,49,37,89,35,36,38,39,40,41,42,43,44,45,46,47,48,50,51,52]));return{id:Dn,diagram:e}},`loader`)},kn=!1,q=u(()=>{kn||(kn=!0,x(`error`,zt,e=>e.toLowerCase().trim()===`error`),x(`---`,{db:{clear:u(()=>{},`clear`)},styles:{},renderer:{draw:u(()=>{},`draw`)},parser:{parse:u(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:u(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),S(Vt,Gt,on),S(ut,ot,qt,Mt,mt,vt,bt,St,Ot,At,ft,ct,Ut,gt,Pt,It,wt,Yt,Zt,Et,tn,cn,rn,$t,un,mn,Sn,wn,En,On,fn,vn,bn,gn))},`addDiagrams`),An=u(async()=>{f.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(O).map(async([e,{detector:t,loader:n}])=>{if(n)try{w(e)}catch{try{let{diagram:e,id:r}=await n();x(r,e,t)}catch(t){throw f.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete O[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){f.error(`Failed to load ${e.length} external diagrams`);for(let t of e)f.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),jn=`graphics-document document`;function Mn(e,t){e.attr(`role`,jn),t!==``&&e.attr(`aria-roledescription`,t)}u(Mn,`setA11yDiagramInfo`);function Nn(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}u(Nn,`addSVGa11yTitleDescription`);var J=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{u(this,`Diagram`)}static async fromText(t,n={}){let r=typeof t==`string`?{raw:t,cleaned:t}:t,i=E(),a=ce(r.cleaned,i);try{w(a)}catch{let e=h(a);if(!e)throw new ue(`Diagram ${a} not found.`);let{id:t,diagram:n}=await e();x(t,n)}let{db:o,parser:s,renderer:c,init:l}=w(a);s.parser&&(s.parser.yy=o),o.clear?.(),l?.(i),n.title&&o.setDiagramTitle?.(n.title);let u=r.cleaned;if(o.preserveCommentsWhenParsing&&r.withComments){let e=i.maxTextSize??ae.maxTextSize;r.withComments.length>e?f.warn(`Comment-preserving source exceeds maxTextSize (${r.withComments.length} > ${e}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):u=r.withComments}let d=_e(u)+` `;return r.frontmatterLineOffset&&o.setFrontmatterLineOffset?.(r.frontmatterLineOffset),await s.parse(d),new e(a,d,o,s,c)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},Pn=[],Fn=u(()=>{Pn.forEach(e=>{e()}),Pn=[]},`attachFunctions`),In=u(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,``).trimStart(),`cleanupComments`);function Ln(e){let t=e.match(re);if(!t)return{text:e,metadata:{}};let n=t[1],r=n?t[2].split(` `).map(e=>e.startsWith(n)?e.slice(n.length):e).join(` -`):t[2],i=Te(r,{schema:Ee})??{};i=typeof i==`object`&&!Array.isArray(i)?i:{};let a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:e.slice(t[0].length),metadata:a}}u(Ln,`extractFrontMatter`);var Rn=u(e=>e.replace(/\r\n?/g,` +`):t[2],i=Se(r,{schema:Ce})??{};i=typeof i==`object`&&!Array.isArray(i)?i:{};let a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:e.slice(t[0].length),metadata:a}}u(Ln,`extractFrontMatter`);var Rn=u(e=>e.replace(/\r\n?/g,` `).replace(/<(\w+)([^>]*)>/g,(e,t,n)=>`<`+t+n.replace(/="([^"]*)"/g,`='$1'`)+`>`),`cleanupText`),zn=u(e=>{let{text:t,metadata:n}=Ln(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||={},a.gantt.displayMode=r),{title:i,config:a,text:t}},`processFrontmatter`),Bn=u(e=>{let t=k.detectInit(e)??{},n=k.detectDirective(e,`wrap`);return Array.isArray(n)?t.wrap=n.some(({type:e})=>e===`wrap`):n?.type===`wrap`&&(t.wrap=!0),{text:he(e),directive:t}},`processDirectives`);function Vn(e){let t=e,n=Rn(e),r=zn(n),i=Bn(r.text),a=ge(r.config,i.directive),o=i.text;return{code:{raw:t,cleaned:In(o),withComments:o,frontmatterLineOffset:n.length>r.text.length?(n.substring(0,n.length-r.text.length).match(/\n/g)??[]).length:0},title:r.title,config:a}}u(Vn,`preprocessDiagram`);function Hn(e){let t=new TextEncoder().encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join(``);return btoa(n)}u(Hn,`toBase64`);var Un=5e4,Wn=`graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa`,Gn=`sandbox`,Kn=`loose`,qn=`http://www.w3.org/2000/svg`,Jn=`http://www.w3.org/1999/xlink`,Yn=`http://www.w3.org/1999/xhtml`,Xn=`100%`,Zn=`100%`,Qn=`border:0;margin:0;`,$n=`margin:0`,er=`allow-top-navigation-by-user-activation allow-popups`,tr=`The "iframe" tag is not supported by your browser.`,nr=[`foreignobject`],rr=[`dominant-baseline`];function ir(e){let t=Vn(e);_();let n;try{n=ce(t.code.cleaned,E())}catch{n=void 0}return y(n),se(t.config??{}),t}u(ir,`processAndSetConfigs`);async function ar(e,t){q();try{let{code:t,config:n}=ir(e);return{diagramType:(await J.fromText(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}finally{y(void 0)}}u(ar,`parse`);var or=u((e,t,n=[])=>`.${e} ${t} ${b(`{ ${n.join(` !important; `)} !important; }`)}`,`cssImportantStyles`),sr=u((e,t=new Map)=>{let n=new CSSStyleSheet;if(e.fontFamily!==void 0&&n.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,n.cssRules.length),e.altFontFamily!==void 0&&n.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,n.cssRules.length),t instanceof Map){let r=ee(e)?[`> *`,`span`]:[`rect`,`polygon`,`ellipse`,`circle`,`path`];t.forEach(e=>{ke(e.styles)||r.forEach(t=>{n.insertRule(or(e.id,t,e.styles),n.cssRules.length)}),ke(e.textStyles)||n.insertRule(or(e.id,`tspan`,(e?.textStyles||[]).map(e=>e.replace(`color`,`fill`))),n.cssRules.length)})}let r=``;if(e.themeCSS!==void 0)if(typeof n.replaceSync==`function`){let t=new CSSStyleSheet;t.replaceSync(e.themeCSS),r=D(t)+` `}else r+=`${e.themeCSS} `;return r+D(n)},`createCssStyles`),cr=u((e,t)=>nt(Qe(`${e}{${t}}`),it([u(function(t,n,r,i){if(t.type===`rule`&&Array.isArray(t.props)){if(t.parent&&t.parent.type===`@keyframes`)return;t.props=t.props.map(n=>n===e&&Array.isArray(t.children)&&t.children.every(e=>e.type===`decl`&&new Set([`font-family`,`font-size`,`fill`]).has(e.props))||(n.startsWith(`${e} `)||n.startsWith(`${e}>`))&&!n.startsWith(`${e} ||`)?n:`${e} ${n}`)}else t.type.startsWith(`@`)&&([`@media`,`@supports`,`@layer`,`@scope`,`@container`,`@starting-style`,`@keyframes`].includes(t.type)||(f.warn(`Removing unsupported at-rule ${t.type} from CSS`),t.type=Ae))},`addNamespace`),rt])),`compileCSS`),lr=u((e,t,n,r)=>{let i=sr(e,n);return cr(r,T(t,i,{...e.themeVariables,theme:e.theme,look:e.look},r))},`createUserStyles`),ur=u((e=``,t,n)=>{let r=e;return!n&&!t&&(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,`marker-end="url(#`)),r=pe(r),r=r.replace(/
/g,`
`),r},`cleanUpSvgCode`),dr=u((e=``,t)=>``,`putIntoIFrame`),fr=u((e,t,n,r,i)=>{let a=e.append(`div`);a.attr(`id`,n),r&&a.attr(`style`,r);let o=a.append(`svg`).attr(`id`,t).attr(`width`,`100%`).attr(`xmlns`,qn);return i&&o.attr(`xmlns:xlink`,i),o.append(`g`),e},`appendDivSvgG`);function pr(e,t){return e.append(`iframe`).attr(`id`,t).attr(`style`,`width: 100%; height: 100%;`).attr(`sandbox`,``)}u(pr,`sandboxedIframe`);var mr=u((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},`removeExistingElements`),hr=u(async function(e,t,n){q();let r=ir(t),i=r.code;t=i.cleaned;let a=E();f.debug(a),t.length>(a?.maxTextSize??Un)&&(t=Wn,i={raw:t,cleaned:t});let o=`#${e}`,s=`i`+e,c=`#`+s,d=`d`+e,m=`#`+d,h=u(()=>{let e=p(_?c:m).node();e&&`remove`in e&&e.remove()},`removeTempElements`),g=p(document.body),_=a.securityLevel===Gn,v=a.securityLevel===Kn,y=a.fontFamily;if(n!==void 0){if(n&&(n.innerHTML=``),_){let e=pr(p(n),s);g=p(e.nodes()[0].contentDocument.body),g.node().style.margin=`0`}else g=p(n);fr(g,e,d,`font-family: ${y}`,Jn)}else{if(mr(document,e,d,s),_){let e=pr(p(document.body),s);g=p(e.nodes()[0].contentDocument.body),g.node().style.margin=`0`}else g=p(`body`);fr(g,e,d)}let b,x;try{b=await J.fromText(i,{title:r.title})}catch(e){if(a.suppressErrorRendering)throw h(),e;b=await J.fromText(`error`),x=e}let S=g.select(m).node(),C=b.type,w=S.firstChild,ee=w.firstChild,te=b.renderer.getClasses?.(t,b),ne=lr(a,C,te,o),T=document.createElement(`style`);T.innerHTML=ne,w.insertBefore(T,ee);try{await b.renderer.draw(t,e,`12.0.0`,b)}catch(n){throw a.suppressErrorRendering?h():Rt.draw(t,e,`12.0.0`),n}let re=g.select(`${m} svg`),ie=b.db.getAccTitle?.(),ae=b.db.getAccDescription?.();yr(C,re,ie,ae);let D=u(()=>{g.select(`[id="${e}"]`).selectAll(`foreignobject > *`).attr(`xmlns`,Yn);let t=g.select(m).node().innerHTML;if(f.debug(`config.arrowMarkerAbsolute`,a.arrowMarkerAbsolute),t=ur(t,_,oe(a.arrowMarkerAbsolute)),_){let e=g.select(m+` svg`).node();t=dr(t,e)}else v||(t=l.sanitize(t,{ADD_TAGS:nr,ADD_ATTR:rr,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return Fn(),t},`serializeSvg`)();if(x)throw x;return h(),{diagramType:C,svg:D,bindFunctions:b.db.bindFunctions}},`renderDiagram`),gr=u(async function(e,t,n){try{return await hr(e,t,n)}finally{y(void 0)}},`render`);function _r(e={}){let t=le({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||={},t.themeVariables.fontFamily=t.fontFamily),te(t);let n=de.theme;t?.theme&&Object.hasOwn(C,t.theme)?t.themeVariables=C[t.theme].getThemeVariables(t.themeVariables):t&&(t.theme!=null&&t.theme!==`null`&&(t.theme=n),t.themeVariables=C[n].getThemeVariables(t.themeVariables));let r=typeof t==`object`?v(t):g();d(r.logLevel),q()}u(_r,`initialize`);var vr=u((e,t={})=>{let{code:n}=Vn(e);return J.fromText(n,t)},`getDiagramFromText`);function yr(e,t,n,r){Mn(t,e),Nn(t,n,r,t.attr(`id`))}u(yr,`addA11yInfo`);var Y=Object.freeze({render:gr,parse:ar,getDiagramFromText:vr,initialize:_r,getConfig:E,setConfig:ne,getSiteConfig:g,updateSiteConfig:m,reset:u(()=>{_()},`reset`),globalReset:u(()=>{_(de)},`globalReset`),defaultConfig:de});d(E().logLevel),_(E());var br=u((e,t,n)=>{f.warn(e),me(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},`handleError`),xr=u(async function(e={querySelector:`.mermaid`}){try{await Sr(e)}catch(t){if(me(t)&&f.error(t.str),Z.parseError&&Z.parseError(t),!e.suppressErrors)throw f.error(`Use the suppressErrors option to suppress these errors`),t}},`run`),Sr=u(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:`.mermaid`}){let r=Y.getConfig();f.debug(`${e?``:`No `}Callback function found`);let i;if(n)i=n;else if(t)i=document.querySelectorAll(t);else throw Error(`Nodes and querySelector are both undefined`);f.debug(`Found ${i.length} diagrams`),r?.startOnLoad!==void 0&&(f.debug(`Start On Load: `+r?.startOnLoad),Y.updateSiteConfig({startOnLoad:r?.startOnLoad}));let a=new k.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed),o,s=[];for(let t of Array.from(i)){if(f.info(`Rendering diagram: `+t.id),t.getAttribute(`data-processed`))continue;t.setAttribute(`data-processed`,`true`);let n=`mermaid-${a.next()}`;o=t.innerHTML,o=Ce(k.entityDecode(o)).trim().replace(//gi,`
`);let r=k.detectInit(o);r&&f.debug(`Detected early reinit: `,r);try{let{svg:r,bindFunctions:i}=await jr(n,o,t);t.innerHTML=r,e&&await e(n),i&&i(t)}catch(e){br(e,s,Z.parseError)}}if(s.length>0)throw s[0]},`runThrowsErrors`),Cr=u(function(e){Y.initialize(e)},`initialize`),wr=u(async function(e,t,n){f.warn(`mermaid.init is deprecated. Please use run instead.`),e&&Cr(e);let r={postRenderCallback:n,querySelector:`.mermaid`};typeof t==`string`?r.querySelector=t:t&&(r.nodes=t instanceof HTMLElement?[t]:t),await xr(r)},`init`),Tr=u(async(e,{lazyLoad:t=!0}={})=>{q(),S(...e),t===!1&&await An()},`registerExternalDiagrams`),Er=u(function(){if(Z.startOnLoad){let{startOnLoad:e}=Y.getConfig();e&&Z.run().catch(e=>f.error(`Mermaid failed to initialize`,e))}},`contentLoaded`);typeof document<`u`&&window.addEventListener(`load`,Er,!1);var Dr=u(function(e){Z.parseError=e},`setParseErrorHandler`),X=[],Or=!1,kr=u(async()=>{if(!Or){for(Or=!0;X.length>0;){let e=X.shift();if(e)try{await e()}catch(e){f.error(`Error executing queue`,e)}}Or=!1}},`executeQueue`),Ar=u(async(e,t)=>new Promise((n,r)=>{let i=u(()=>new Promise((i,a)=>{Y.parse(e,t).then(e=>{i(e),n(e)},e=>{f.error(`Error parsing`,e),Z.parseError?.(e),a(e),r(e)})}),`performCall`);X.push(i),kr().catch(r)}),`parse`),jr=u((e,t,n)=>new Promise((r,i)=>{let a=u(()=>new Promise((a,o)=>{Y.render(e,t,n).then(e=>{a(e),r(e)},e=>{f.error(`Error parsing`,e),Z.parseError?.(e),o(e),i(e)})}),`performCall`);X.push(a),kr().catch(i)}),`render`),Z={startOnLoad:!0,mermaidAPI:Y,parse:Ar,render:jr,init:wr,run:xr,registerExternalDiagrams:Tr,registerLayoutLoaders:we,initialize:Cr,parseError:void 0,contentLoaded:Er,setParseErrorHandler:Dr,detectType:ce,registerIconPacks:Se,getRegisteredDiagramsMetadata:u(()=>Object.keys(O).map(e=>({id:e})),`getRegisteredDiagramsMetadata`)},Mr=Z,Q=e(t(),1),$=n();Mr.initialize({startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0,maxTextSize:5e4,maxEdges:500,theme:`neutral`,htmlLabels:!1,secure:[`securityLevel`,`startOnLoad`,`maxTextSize`,`maxEdges`,`suppressErrorRendering`,`htmlLabels`]});var Nr=Promise.resolve();function Pr({source:e}){let{t}=a(),n=`diagram-${(0,Q.useId)().replace(/[^a-z0-9]/giu,``)}`,[r,i]=(0,Q.useState)(null),u=r?.source===e?r:null,d=u?.image,f=u?.error,[p,m]=(0,Q.useState)(1),h=(0,Q.useRef)(null),g=(0,Q.useRef)(null),_=(0,Q.useRef)(null);return(0,Q.useEffect)(()=>{let r=!1;return Nr=Nr.then(async()=>{if(!r)try{if(e.length>5e4)throw Error(t(`filesDocumentLimit`));let a=await Mr.render(n,e),o=l.sanitize(a.svg,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:[`foreignObject`,`a`,`image`,`use`]});r||i({source:e,image:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(o)}`})}catch(n){r||i({source:e,error:n instanceof Error?n.message:t(`filesPreviewFailed`)})}}),()=>{r=!0}},[n,e,t]),f?(0,$.jsxs)(`div`,{className:`evidence-warning`,children:[(0,$.jsx)(`p`,{children:f}),(0,$.jsx)(`pre`,{children:e})]}):(0,$.jsxs)(`div`,{className:`file-diagram`,children:[d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`img`,{src:d,alt:t(`filesDiagram`)}),(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`filesExpandDiagram`),onClick:()=>{m(1),h.current?.showModal()},children:(0,$.jsx)(De,{})})]}):(0,$.jsx)(`p`,{role:`status`,children:t(`readingFile`)}),(0,$.jsxs)(`dialog`,{ref:h,className:`file-diagram-dialog`,"aria-label":t(`filesDiagram`),onCancel:e=>{e.stopPropagation()},onKeyDown:e=>{e.key===`Escape`&&e.stopPropagation()},children:[(0,$.jsxs)(`div`,{className:`file-preview-toolbar`,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`filesZoomOut`),onClick:()=>m(e=>Math.max(.25,e-.25)),children:(0,$.jsx)(s,{})}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>m(1),children:[Math.round(p*100),`%`]}),(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`filesZoomIn`),onClick:()=>m(e=>Math.min(4,e+.25)),children:(0,$.jsx)(o,{})}),(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`close`),onClick:()=>h.current?.close(),children:(0,$.jsx)(c,{})})]}),(0,$.jsx)(`section`,{ref:g,className:`file-media-viewport`,tabIndex:0,"aria-label":t(`filesDiagram`),onWheel:e=>{(e.ctrlKey||e.metaKey)&&m(t=>Math.max(.25,Math.min(4,t+(e.deltaY>0?-.1:.1))))},onPointerDown:e=>{let t=e.currentTarget;_.current={x:e.clientX,y:e.clientY,left:t.scrollLeft,top:t.scrollTop},t.setPointerCapture(e.pointerId)},onPointerMove:e=>{_.current&&(e.currentTarget.scrollLeft=_.current.left+_.current.x-e.clientX,e.currentTarget.scrollTop=_.current.top+_.current.y-e.clientY)},onPointerUp:()=>{_.current=null},onPointerCancel:()=>{_.current=null},children:d&&(0,$.jsx)(`img`,{src:d,alt:t(`filesDiagram`),draggable:!1,style:{width:`${p*100}%`}})})]})]})}export{Pr as default}; \ No newline at end of file +`,`putIntoIFrame`),fr=u((e,t,n,r,i)=>{let a=e.append(`div`);a.attr(`id`,n),r&&a.attr(`style`,r);let o=a.append(`svg`).attr(`id`,t).attr(`width`,`100%`).attr(`xmlns`,qn);return i&&o.attr(`xmlns:xlink`,i),o.append(`g`),e},`appendDivSvgG`);function pr(e,t){return e.append(`iframe`).attr(`id`,t).attr(`style`,`width: 100%; height: 100%;`).attr(`sandbox`,``)}u(pr,`sandboxedIframe`);var mr=u((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},`removeExistingElements`),hr=u(async function(e,t,n){q();let r=ir(t),i=r.code;t=i.cleaned;let a=E();f.debug(a),t.length>(a?.maxTextSize??Un)&&(t=Wn,i={raw:t,cleaned:t});let o=`#${e}`,s=`i`+e,c=`#`+s,d=`d`+e,m=`#`+d,h=u(()=>{let e=p(_?c:m).node();e&&`remove`in e&&e.remove()},`removeTempElements`),g=p(document.body),_=a.securityLevel===Gn,v=a.securityLevel===Kn,y=a.fontFamily;if(n!==void 0){if(n&&(n.innerHTML=``),_){let e=pr(p(n),s);g=p(e.nodes()[0].contentDocument.body),g.node().style.margin=`0`}else g=p(n);fr(g,e,d,`font-family: ${y}`,Jn)}else{if(mr(document,e,d,s),_){let e=pr(p(document.body),s);g=p(e.nodes()[0].contentDocument.body),g.node().style.margin=`0`}else g=p(`body`);fr(g,e,d)}let b,x;try{b=await J.fromText(i,{title:r.title})}catch(e){if(a.suppressErrorRendering)throw h(),e;b=await J.fromText(`error`),x=e}let S=g.select(m).node(),C=b.type,w=S.firstChild,ee=w.firstChild,te=b.renderer.getClasses?.(t,b),ne=lr(a,C,te,o),T=document.createElement(`style`);T.innerHTML=ne,w.insertBefore(T,ee);try{await b.renderer.draw(t,e,`12.0.0`,b)}catch(n){throw a.suppressErrorRendering?h():Rt.draw(t,e,`12.0.0`),n}let re=g.select(`${m} svg`),ie=b.db.getAccTitle?.(),ae=b.db.getAccDescription?.();yr(C,re,ie,ae);let D=u(()=>{g.select(`[id="${e}"]`).selectAll(`foreignobject > *`).attr(`xmlns`,Yn);let t=g.select(m).node().innerHTML;if(f.debug(`config.arrowMarkerAbsolute`,a.arrowMarkerAbsolute),t=ur(t,_,oe(a.arrowMarkerAbsolute)),_){let e=g.select(m+` svg`).node();t=dr(t,e)}else v||(t=l.sanitize(t,{ADD_TAGS:nr,ADD_ATTR:rr,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return Fn(),t},`serializeSvg`)();if(x)throw x;return h(),{diagramType:C,svg:D,bindFunctions:b.db.bindFunctions}},`renderDiagram`),gr=u(async function(e,t,n){try{return await hr(e,t,n)}finally{y(void 0)}},`render`);function _r(e={}){let t=le({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||={},t.themeVariables.fontFamily=t.fontFamily),te(t);let n=de.theme;t?.theme&&Object.hasOwn(C,t.theme)?t.themeVariables=C[t.theme].getThemeVariables(t.themeVariables):t&&(t.theme!=null&&t.theme!==`null`&&(t.theme=n),t.themeVariables=C[n].getThemeVariables(t.themeVariables));let r=typeof t==`object`?v(t):g();d(r.logLevel),q()}u(_r,`initialize`);var vr=u((e,t={})=>{let{code:n}=Vn(e);return J.fromText(n,t)},`getDiagramFromText`);function yr(e,t,n,r){Mn(t,e),Nn(t,n,r,t.attr(`id`))}u(yr,`addA11yInfo`);var Y=Object.freeze({render:gr,parse:ar,getDiagramFromText:vr,initialize:_r,getConfig:E,setConfig:ne,getSiteConfig:g,updateSiteConfig:m,reset:u(()=>{_()},`reset`),globalReset:u(()=>{_(de)},`globalReset`),defaultConfig:de});d(E().logLevel),_(E());var br=u((e,t,n)=>{f.warn(e),me(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},`handleError`),xr=u(async function(e={querySelector:`.mermaid`}){try{await Sr(e)}catch(t){if(me(t)&&f.error(t.str),Z.parseError&&Z.parseError(t),!e.suppressErrors)throw f.error(`Use the suppressErrors option to suppress these errors`),t}},`run`),Sr=u(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:`.mermaid`}){let r=Y.getConfig();f.debug(`${e?``:`No `}Callback function found`);let i;if(n)i=n;else if(t)i=document.querySelectorAll(t);else throw Error(`Nodes and querySelector are both undefined`);f.debug(`Found ${i.length} diagrams`),r?.startOnLoad!==void 0&&(f.debug(`Start On Load: `+r?.startOnLoad),Y.updateSiteConfig({startOnLoad:r?.startOnLoad}));let a=new k.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed),o,s=[];for(let t of Array.from(i)){if(f.info(`Rendering diagram: `+t.id),t.getAttribute(`data-processed`))continue;t.setAttribute(`data-processed`,`true`);let n=`mermaid-${a.next()}`;o=t.innerHTML,o=Te(k.entityDecode(o)).trim().replace(//gi,`
`);let r=k.detectInit(o);r&&f.debug(`Detected early reinit: `,r);try{let{svg:r,bindFunctions:i}=await jr(n,o,t);t.innerHTML=r,e&&await e(n),i&&i(t)}catch(e){br(e,s,Z.parseError)}}if(s.length>0)throw s[0]},`runThrowsErrors`),Cr=u(function(e){Y.initialize(e)},`initialize`),wr=u(async function(e,t,n){f.warn(`mermaid.init is deprecated. Please use run instead.`),e&&Cr(e);let r={postRenderCallback:n,querySelector:`.mermaid`};typeof t==`string`?r.querySelector=t:t&&(r.nodes=t instanceof HTMLElement?[t]:t),await xr(r)},`init`),Tr=u(async(e,{lazyLoad:t=!0}={})=>{q(),S(...e),t===!1&&await An()},`registerExternalDiagrams`),Er=u(function(){if(Z.startOnLoad){let{startOnLoad:e}=Y.getConfig();e&&Z.run().catch(e=>f.error(`Mermaid failed to initialize`,e))}},`contentLoaded`);typeof document<`u`&&window.addEventListener(`load`,Er,!1);var Dr=u(function(e){Z.parseError=e},`setParseErrorHandler`),X=[],Or=!1,kr=u(async()=>{if(!Or){for(Or=!0;X.length>0;){let e=X.shift();if(e)try{await e()}catch(e){f.error(`Error executing queue`,e)}}Or=!1}},`executeQueue`),Ar=u(async(e,t)=>new Promise((n,r)=>{let i=u(()=>new Promise((i,a)=>{Y.parse(e,t).then(e=>{i(e),n(e)},e=>{f.error(`Error parsing`,e),Z.parseError?.(e),a(e),r(e)})}),`performCall`);X.push(i),kr().catch(r)}),`parse`),jr=u((e,t,n)=>new Promise((r,i)=>{let a=u(()=>new Promise((a,o)=>{Y.render(e,t,n).then(e=>{a(e),r(e)},e=>{f.error(`Error parsing`,e),Z.parseError?.(e),o(e),i(e)})}),`performCall`);X.push(a),kr().catch(i)}),`render`),Z={startOnLoad:!0,mermaidAPI:Y,parse:Ar,render:jr,init:wr,run:xr,registerExternalDiagrams:Tr,registerLayoutLoaders:Ee,initialize:Cr,parseError:void 0,contentLoaded:Er,setParseErrorHandler:Dr,detectType:ce,registerIconPacks:we,getRegisteredDiagramsMetadata:u(()=>Object.keys(O).map(e=>({id:e})),`getRegisteredDiagramsMetadata`)},Mr=Z,Q=e(t(),1),$=n();Mr.initialize({startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0,maxTextSize:5e4,maxEdges:500,theme:`neutral`,htmlLabels:!1,secure:[`securityLevel`,`startOnLoad`,`maxTextSize`,`maxEdges`,`suppressErrorRendering`,`htmlLabels`]});var Nr=Promise.resolve();function Pr({source:e}){let{t}=a(),n=`diagram-${(0,Q.useId)().replace(/[^a-z0-9]/giu,``)}`,[r,i]=(0,Q.useState)(null),u=r?.source===e?r:null,d=u?.image,f=u?.error,[p,m]=(0,Q.useState)(1),h=(0,Q.useRef)(null),g=(0,Q.useRef)(null),_=(0,Q.useRef)(null);return(0,Q.useEffect)(()=>{let r=!1;return Nr=Nr.then(async()=>{if(!r)try{if(e.length>5e4)throw Error(t(`filesDocumentLimit`));let a=await Mr.render(n,e),o=l.sanitize(a.svg,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:[`foreignObject`,`a`,`image`,`use`]});r||i({source:e,image:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(o)}`})}catch(n){r||i({source:e,error:n instanceof Error?n.message:t(`filesPreviewFailed`)})}}),()=>{r=!0}},[n,e,t]),f?(0,$.jsxs)(`div`,{className:`evidence-warning`,children:[(0,$.jsx)(`p`,{children:f}),(0,$.jsx)(`pre`,{children:e})]}):(0,$.jsxs)(`div`,{className:`file-diagram`,children:[d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`img`,{src:d,alt:t(`filesDiagram`)}),(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`filesExpandDiagram`),onClick:()=>{m(1),h.current?.showModal()},children:(0,$.jsx)(De,{})})]}):(0,$.jsx)(`p`,{role:`status`,children:t(`readingFile`)}),(0,$.jsxs)(`dialog`,{ref:h,className:`file-diagram-dialog`,"aria-label":t(`filesDiagram`),onCancel:e=>{e.stopPropagation()},onKeyDown:e=>{e.key===`Escape`&&e.stopPropagation()},children:[(0,$.jsxs)(`div`,{className:`file-preview-toolbar`,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`filesZoomOut`),onClick:()=>m(e=>Math.max(.25,e-.25)),children:(0,$.jsx)(s,{})}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>m(1),children:[Math.round(p*100),`%`]}),(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`filesZoomIn`),onClick:()=>m(e=>Math.min(4,e+.25)),children:(0,$.jsx)(o,{})}),(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`close`),onClick:()=>h.current?.close(),children:(0,$.jsx)(c,{})})]}),(0,$.jsx)(`section`,{ref:g,className:`file-media-viewport`,tabIndex:0,"aria-label":t(`filesDiagram`),onWheel:e=>{(e.ctrlKey||e.metaKey)&&m(t=>Math.max(.25,Math.min(4,t+(e.deltaY>0?-.1:.1))))},onPointerDown:e=>{let t=e.currentTarget;_.current={x:e.clientX,y:e.clientY,left:t.scrollLeft,top:t.scrollTop},t.setPointerCapture(e.pointerId)},onPointerMove:e=>{_.current&&(e.currentTarget.scrollLeft=_.current.left+_.current.x-e.clientX,e.currentTarget.scrollTop=_.current.top+_.current.y-e.clientY)},onPointerUp:()=>{_.current=null},onPointerCancel:()=>{_.current=null},children:d&&(0,$.jsx)(`img`,{src:d,alt:t(`filesDiagram`),draggable:!1,style:{width:`${p*100}%`}})})]})]})}export{Pr as default}; \ No newline at end of file diff --git a/web/dist/app-abnfDiagram-O67JEVCF.js b/web/dist/app-abnfDiagram-O67JEVCF.js index 1ab3376a7..5c2d9188c 100644 --- a/web/dist/app-abnfDiagram-O67JEVCF.js +++ b/web/dist/app-abnfDiagram-O67JEVCF.js @@ -1 +1 @@ -import{n as e}from"./app-chunk-XHIXRSVI.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=e().RailroadAbnf.parser.LangiumParser,l=t(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=t(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=t(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=t(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=t(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=t(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=t(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:t(e=>{a.clear(),n.debug(`[ABNF Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;n.debug(`[ABNF Parser] Parsed rules:`,r.rules.length),h(r),n.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{g as diagram}; \ No newline at end of file +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n}from"./app-chunk-XHIXRSVI.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=n().RailroadAbnf.parser.LangiumParser,l=e(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=e(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=e(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=e(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=e(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=e(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:e(e=>{a.clear(),t.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new s(n);let r=n.value;t.debug(`[ABNF Parser] Parsed rules:`,r.rules.length),h(r),t.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{g as diagram}; \ No newline at end of file diff --git a/web/dist/app-architectureDiagram-NJMV4G6O.js b/web/dist/app-architectureDiagram-NJMV4G6O.js index f3b509c50..83f076457 100644 --- a/web/dist/app-architectureDiagram-NJMV4G6O.js +++ b/web/dist/app-architectureDiagram-NJMV4G6O.js @@ -1,4 +1,4 @@ -import{i as e,t}from"./app-rolldown-runtime.js";import{n}from"./app-chunk-Y2CYZVJY.js";import{m as r,p as i}from"./app-src.js";import{H as a,U as o,Y as s,a as c,b as l,f as u,q as d,v as f,w as p,x as m,y as h,z as g}from"./app-chunk-O7XYJQB3.js";import{c as _,i as v}from"./app-chunk-ZIGJFQKS.js";import{t as y}from"./app-chunk-6AEJRKK7.js";import{t as b}from"./app-chunk-JWPE2WC7.js";import{n as x}from"./app-mermaid-parser.core.js";import{i as S,r as C,t as w}from"./app-chunk-742MDFTN.js";import{n as T}from"./app-chunk-MBY4JIJT.js";import{t as E}from"./app-cytoscape.esm.js";var D=t(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.layoutBase=r():n.layoutBase=r()})(e,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=28)})([(function(e,t,n){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r}),(function(e,t,n){var r=n(2),i=n(8),a=n(9);function o(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw`Node is not incident with this edge`},o.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var e=[,,,,];this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=o}),(function(e,t,n){function r(e){this.vGraphObject=e}e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(13),o=n(0),s=n(16),c=n(5);function l(e,t,n,o){n==null&&o==null&&(o=t),r.call(this,o),e.graphManager!=null&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=e,this.rect=n!=null&&t!=null?new a(t.x,t.y,n.width,n.height):new a}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.getEdges=function(){return this.edges},l.prototype.getChild=function(){return this.child},l.prototype.getOwner=function(){return this.owner},l.prototype.getWidth=function(){return this.rect.width},l.prototype.setWidth=function(e){this.rect.width=e},l.prototype.getHeight=function(){return this.rect.height},l.prototype.setHeight=function(e){this.rect.height=e},l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},l.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},l.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},l.prototype.getRect=function(){return this.rect},l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},l.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},l.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},l.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},l.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},l.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.target==e){if(r.source!=n)throw`Incorrect edge source!`;t.push(r)}}),t},l.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw`Incorrect edge source and/or target`;(r.target==e||r.source==e)&&t.push(r)}),t},l.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach(function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw`Incorrect incidency!`;e.add(n.source)}}),e},l.prototype.withChildren=function(){var e=new Set,t,n;if(e.add(this),this.child!=null)for(var r=this.child.getNodes(),i=0;it?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal==`right`&&this.setWidth(t+this.labelWidth)),this.labelHeight&&(this.labelPosVertical==`top`?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):this.labelPosVertical==`center`&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):this.labelPosVertical==`bottom`&&this.setHeight(n+this.labelHeight))}}},l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw`assert failed`;return this.inclusionTreeDepth},l.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new c(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},l.prototype.getLeft=function(){return this.rect.x},l.prototype.getRight=function(){return this.rect.x+this.rect.width},l.prototype.getTop=function(){return this.rect.y},l.prototype.getBottom=function(){return this.rect.y+this.rect.height},l.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},e.exports=l}),(function(e,t,n){var r=n(0);function i(){}for(var a in r)i[a]=r[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=i.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i}),(function(e,t,n){function r(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(0),o=n(7),s=n(3),c=n(1),l=n(13),u=n(12),d=n(11);function f(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,t!=null&&t instanceof o?this.graphManager=t:t!=null&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in f.prototype=Object.create(r.prototype),r)f[p]=r[p];f.prototype.getNodes=function(){return this.nodes},f.prototype.getEdges=function(){return this.edges},f.prototype.getGraphManager=function(){return this.graphManager},f.prototype.getParent=function(){return this.parent},f.prototype.getLeft=function(){return this.left},f.prototype.getRight=function(){return this.right},f.prototype.getTop=function(){return this.top},f.prototype.getBottom=function(){return this.bottom},f.prototype.isConnected=function(){return this.isConnected},f.prototype.add=function(e,t,n){if(t==null&&n==null){var r=e;if(this.graphManager==null)throw`Graph has no graph mgr!`;if(this.getNodes().indexOf(r)>-1)throw`Node already in graph!`;return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw`Source or target not in graph!`;if(t.owner!=n.owner||t.owner!=this)throw`Both owners must be this graph!`;return t.owner==n.owner?(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i):null},f.prototype.remove=function(e){var t=e;if(e instanceof s){if(t==null)throw`Node is null!`;if(t.owner==null||t.owner!=this)throw`Owner graph is invalid!`;if(this.graphManager==null)throw`Owner graph manager is invalid!`;for(var n=t.edges.slice(),r,i=n.length,a=0;a-1&&u>-1))throw`Source and/or target doesn't know this edge!`;r.source.edges.splice(l,1),r.target!=r.source&&r.target.edges.splice(u,1);var o=r.source.owner.getEdges().indexOf(r);if(o==-1)throw`Not in owner's edge list!`;r.source.owner.getEdges().splice(o,1)}},f.prototype.updateLeftTop=function(){for(var e=i.MAX_VALUE,t=i.MAX_VALUE,n,r,a,o=this.getNodes(),s=o.length,c=0;cn&&(e=n),t>r&&(t=r)}return e==i.MAX_VALUE?null:(a=o[0].getParent().paddingLeft==null?this.margin:o[0].getParent().paddingLeft,this.left=t-a,this.top=e-a,new u(this.left,this.top))},f.prototype.updateBounds=function(e){for(var t=i.MAX_VALUE,n=-i.MAX_VALUE,r=i.MAX_VALUE,a=-i.MAX_VALUE,o,s,c,u,d,f=this.nodes,p=f.length,m=0;mo&&(t=o),nc&&(r=c),ao&&(t=o),nc&&(r=c),a=this.nodes.length){var c=0;n.forEach(function(t){t.owner==e&&c++}),c==this.nodes.length&&(this.isConnected=!0)}},e.exports=f}),(function(e,t,n){var r,i=n(1);function a(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(n==null&&r==null&&i==null){if(e==null)throw`Graph is null!`;if(t==null)throw`Parent node is null!`;if(this.graphs.indexOf(e)>-1)throw`Graph already in this graph mgr!`;if(this.graphs.push(e),e.parent!=null)throw`Already has a parent!`;if(t.child!=null)throw`Already has a child!`;return e.parent=t,t.child=e,e}i=n,r=t,n=e;var a=r.getOwner(),o=i.getOwner();if(a==null||a.getGraphManager()!=this)throw`Source not in this graph mgr!`;if(o==null||o.getGraphManager()!=this)throw`Target not in this graph mgr!`;if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw`Edge already in inter-graph edge list!`;if(this.edges.push(n),n.source==null||n.target==null)throw`Edge source and/or target is null!`;if(n.source.edges.indexOf(n)!=-1||n.target.edges.indexOf(n)!=-1)throw`Edge already in source and/or target incidency list!`;return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw`Graph not in this graph mgr`;if(!(t==this.rootGraph||t.parent!=null&&t.parent.graphManager==this))throw`Invalid parent node!`;var n=[];n=n.concat(t.getEdges());for(var a,o=n.length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]o)return n[0]=r,n[1]=c,n[2]=a,n[3]=y,!1;if(ia)return n[0]=s,n[1]=i,n[2]=_,n[3]=o,!1;if(ra?(n[0]=u,n[1]=d,C=!0):(n[0]=l,n[1]=c,C=!0):T===D&&(r>a?(n[0]=s,n[1]=c,C=!0):(n[0]=f,n[1]=d,C=!0)),-E===D?a>r?(n[2]=v,n[3]=y,w=!0):(n[2]=_,n[3]=g,w=!0):E===D&&(a>r?(n[2]=h,n[3]=g,w=!0):(n[2]=b,n[3]=y,w=!0)),C&&w)return!1;if(r>a?i>o?(O=this.getCardinalDirection(T,D,4),k=this.getCardinalDirection(E,D,2)):(O=this.getCardinalDirection(-T,D,3),k=this.getCardinalDirection(-E,D,1)):i>o?(O=this.getCardinalDirection(-T,D,1),k=this.getCardinalDirection(-E,D,3)):(O=this.getCardinalDirection(T,D,2),k=this.getCardinalDirection(E,D,4)),!C)switch(O){case 1:j=c,A=r+-m/D,n[0]=A,n[1]=j;break;case 2:A=f,j=i+p*D,n[0]=A,n[1]=j;break;case 3:j=d,A=r+m/D,n[0]=A,n[1]=j;break;case 4:A=u,j=i+-p*D,n[0]=A,n[1]=j}if(!w)switch(k){case 1:N=g,M=a+-S/D,n[2]=M,n[3]=N;break;case 2:M=b,N=o+x*D,n[2]=M,n[3]=N;break;case 3:N=y,M=a+S/D,n[2]=M,n[3]=N;break;case 4:M=v,N=o+-x*D,n[2]=M,n[3]=N}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(i==null)return this.getIntersection2(e,t,n);var a=e.x,o=e.y,s=t.x,c=t.y,l=n.x,u=n.y,d=i.x,f=i.y,p=void 0,m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0;return h=c-o,_=a-s,y=s*o-a*c,g=f-u,v=l-d,b=d*u-l*f,x=h*v-g*_,x===0?null:(p=(_*b-v*y)/x,m=(g*y-h*b)/x,new r(p,m))},i.angleOfVector=function(e,t,n,r){var i=void 0;return e===n?i=r=0){var u=(-c+Math.sqrt(c*c-4*s*l))/(2*s),d=(-c-Math.sqrt(c*c-4*s*l))/(2*s);return u>=0&&u<=1?[u]:d>=0&&d<=1?[d]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i}),(function(e,t,n){function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r}),(function(e,t,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(l[0]);s.length>0&&t;){var u=s[0];s.splice(0,1),o.add(u);for(var d=u.getEdges(),a=0;a-1&&l.splice(h,1)}o=new Set,c=new Map}}return e},f.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),a=0;a=0&&t.splice(d,1),s.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;t==1&&l.push(e),r.set(e,t)}})}n=n.concat(l),(t.length==1||t.length==2)&&(i=!0,a=t[0])}return a},f.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=f}),(function(e,t,n){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=Math.sin(r.seed++)*1e4,r.x-Math.floor(r.x)},e.exports=r}),(function(e,t,n){var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return n!=0&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return n!=0&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return n!=0&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return n!=0&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i}),(function(e,t,n){function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);ta.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(this.coolingFactor=e>a.ADAPTATION_LOWER_NODE_LIMIT?Math.max(a.COOLING_ADAPTATION_FACTOR,1-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e=this.getAllEdges(),t,n=0;n0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n,r,i,o,s=this.getAllNodes(),c;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&e&&this.updateGrid(),c=new Set,n=0;nc||s>c)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a)):(c=t.getEstimatedSize()*this.compoundGravityRangeFactor,(o>c||s>c)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant))},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=c.length||u>=c[0].length)){for(var d=0;de}}]),e}()}),(function(e,t,n){function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-->0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function(e){return function e(t){if(t.length==0)return 0;for(var n=[],r=0;r0;)t.push(0);return t}(this.n),i=function(e){for(var t=[];e-->0;)t.push(0);return t}(this.m),a=!0,o=!0,s=Math.min(this.m-1,this.n),c=Math.max(0,Math.min(this.n-2,this.m)),l=0;l=0;k--)if(this.s[k]!==0){for(var A=k+1;A=0;L--){if(function(e,t){return e&&t}(L0;){var U=void 0,W=void 0;for(U=E-2;U>=-1&&U!==-1;U--)if(Math.abs(n[U])<=re+ne*(Math.abs(this.s[U])+Math.abs(this.s[U+1]))){n[U]=0;break}if(U===E-2)W=4;else{var G=void 0;for(G=E-1;G>=U&&G!==U;G--){var ie=(G===E?0:Math.abs(n[G]))+(G===U+1?0:Math.abs(n[G-1]));if(Math.abs(this.s[G])<=re+ne*ie){this.s[G]=0;break}}G===U?W=3:G===E-1?W=1:(W=2,U=G)}switch(U++,W){case 1:var K=n[E-2];n[E-2]=0;for(var q=E-2;q>=U;q--){var ae=r.hypot(this.s[q],K),J=this.s[q]/ae,Y=K/ae;if(this.s[q]=ae,q!==U&&(K=-Y*n[q-1],n[q-1]=J*n[q-1]),o)for(var X=0;X=this.s[U+1]);){var De=this.s[U];if(this.s[U]=this.s[U+1],this.s[U+1]=De,o&&UMath.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):t==0?n=0:(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)),n},e.exports=r}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=a,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=Array(this.iMax);for(var s=0;s=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(D()):typeof define==`function`&&define.amd?define([`layout-base`],r):typeof e==`object`?e.coseBase=r(D()):n.coseBase=r(n.layoutBase)})(e,function(e){return(()=>{var t={45:((e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r}),806:((e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i}),767:((e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),880:((e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),578:((e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),765:((e,t,n)=>{var r=n(551).FDLayout,i=n(578),a=n(880),o=n(991),s=n(767),c=n(806),l=n(902),u=n(551).FDLayoutConstants,d=n(551).LayoutConstants,f=n(551).Point,p=n(551).PointD,m=n(551).DimensionD,h=n(551).Layout,g=n(551).Integer,_=n(551).IGeometry,v=n(551).LGraph,y=n(551).Transform,b=n(551).LinkedList;function x(){r.call(this),this.toBeTiled={},this.constraints={}}for(var S in x.prototype=Object.create(r.prototype),r)x[S]=r[S];x.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},x.prototype.newGraph=function(e){return new a(null,this.graphManager,e)},x.prototype.newNode=function(e){return new o(this.graphManager,e)},x.prototype.newEdge=function(e){return new s(null,null,e)},x.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH<10?10:c.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},x.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},x.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},x.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),!this.incremental){var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n)}return Object.keys(this.constraints).length>0&&(l.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),c.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},x.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-this.coolingCycle**+(Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=c.PURE_INCREMENTAL?u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=c.PURE_INCREMENTAL?u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements();for(var n=0;n0&&(r.fixedNodeWeight=a)}}if(this.constraints.relativePlacementConstraint){var o=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var l=this.constraints.alignmentConstraint.vertical,n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var n=o.has(t.left)?o.get(t.left):t.left,r=o.has(t.right)?o.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,a=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(a)||(e.nodesInRelativeVertical.push(a),e.nodeToRelativeConstraintMapVertical.set(a,[]),e.dummyToNodeForHorizontalAlignment.has(a)?e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(a).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:a,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(a).push({top:i,gap:t.gap})}});else{var d=new Map,f=new Map;this.constraints.relativePlacementConstraint.forEach(function(e){if(e.left){var t=o.has(e.left)?o.get(e.left):e.left,n=o.has(e.right)?o.get(e.right):e.right;d.has(t)?d.get(t).push(n):d.set(t,[n]),d.has(n)?d.get(n).push(t):d.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;f.has(r)?f.get(r).push(i):f.set(r,[i]),f.has(i)?f.get(i).push(r):f.set(i,[r])}});var p=function(e,t){var n=[],r=[],i=new b,a=new Set,o=0;return e.forEach(function(s,c){if(!a.has(c)){n[o]=[],r[o]=!1;var l=c;for(i.push(l),a.add(l),n[o].push(l);i.length!=0;)l=i.shift(),t.has(l)&&(r[o]=!0),e.get(l).forEach(function(e){a.has(e)||(i.push(e),a.add(e),n[o].push(e))});o++}}),{components:n,isFixed:r}},m=p(d,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=m.components,this.fixedComponentsOnHorizontal=m.isFixed;var h=p(f,e.fixedNodesOnVertical);this.componentsOnVertical=h.components,this.fixedComponentsOnVertical=h.isFixed}}},x.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1){var s;for(s=0;sr&&(r=Math.floor(o.y)),a=Math.floor(o.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-o.x/2,d.WORLD_CENTER_Y-o.y/2))},x.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),c.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(t,null,0,359,0,r);var i=v.calculateBounds(e),a=new y;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o1;){var g=h[0];h.splice(0,1);var v=u.indexOf(g);v>=0&&u.splice(v,1),p--,d--}m=t==null?0:(u.indexOf(h[0])+1)%p;for(var y=Math.abs(r-n)/d,b=m;f!=d;b=++b%p){var S=u[b].getOtherEnd(e);if(S!=t){var C=(n+f*y)%360,w=(C+y)%360;x.branchRadialLayout(S,e,C,w,i+a,a),f++}}},x.maxDiagonalInTree=function(e){for(var t=g.MIN_VALUE,n=0;nt&&(t=r)}return t},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r=`DummyCompound_`+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),c=i.getChild();c.add(a);for(var l=0;li?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):r.labelPosHorizontal==`right`&&r.setWidth(i+r.labelWidth)),r.labelHeight&&(r.labelPosVertical==`top`?(r.rect.y-=r.labelHeight,r.setHeight(a+r.labelHeight),r.labelMarginTop=r.labelHeight):r.labelPosVertical==`center`&&r.labelHeight>a?(r.rect.y-=(r.labelHeight-a)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-a)/2):r.labelPosVertical==`bottom`&&r.setHeight(a+r.labelHeight))}})},x.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,a=t.labelMarginLeft,o=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,a,o)}},x.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop,o=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a,o,s)})},x.prototype.getToBeTiled=function(e){var t=e.id;if(this.toBeTiled[t]!=null)return this.toBeTiled[t];var n=e.getChild();if(n==null)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(a.getChild()==null){this.toBeTiled[a.id]=!1;continue}if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}return this.toBeTiled[t]=!0,!0},x.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;ru&&(u=f.rect.height)}n+=u+e.verticalPadding}},x.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var a=i.rect.width,o=i.rect.height;i.labelWidth&&(i.labelPosHorizontal==`left`?(i.rect.x-=i.labelWidth,i.setWidth(a+i.labelWidth),i.labelMarginLeft=i.labelWidth):i.labelPosHorizontal==`center`&&i.labelWidth>a?(i.rect.x-=(i.labelWidth-a)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-a)/2):i.labelPosHorizontal==`right`&&i.setWidth(a+i.labelWidth)),i.labelHeight&&(i.labelPosVertical==`top`?(i.rect.y-=i.labelHeight,i.setHeight(o+i.labelHeight),i.labelMarginTop=i.labelHeight):i.labelPosVertical==`center`&&i.labelHeight>o?(i.rect.y-=(i.labelHeight-o)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-o)/2):i.labelPosVertical==`bottom`&&i.setHeight(o+i.labelHeight))}})},x.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())});var l=a/i,u=o/i,d=(n-r)**2+4*(l+r)*(u+n)*i,f=(r-n+Math.sqrt(d))/(2*(l+r)),p;t?(p=Math.ceil(f),p==f&&p++):p=Math.floor(f);var m=p*(l+r)-r;return s>m&&(m=s),m+=r*2,m},x.prototype.tileNodesByFavoringDim=function(e,t,n){var r=c.TILING_PADDING_VERTICAL,i=c.TILING_PADDING_HORIZONTAL,a=c.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};a&&(o.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},l=function(e,t){return s(t)-s(e)};e.sort(function(e,t){var n=l;return o.idealRowWidth?(n=a,n(e.id,t.id)):n(e,t)});for(var u=0,d=0,f=0;f0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},x.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},x.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var a=e.rowWidth[i];if(a+e.horizontalPadding+t<=e.width)return!0;var o=0;e.rowHeight[i]0&&(o=n+e.verticalPadding-e.rowHeight[i]);var s=e.width-a>=t+e.horizontalPadding?(e.height+o)/(a+t+e.horizontalPadding):(e.height+o)/e.width;o=n+e.verticalPadding;var c=e.widtha&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;so&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var c=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]0)for(var d=i;d<=a;d++)l[0]+=this.grid[d][o-1].length+this.grid[d][o].length-1;if(a0)for(var d=o;d<=s;d++)l[3]+=this.grid[i-1][d].length+this.grid[i][d].length-1;for(var f=g.MAX_VALUE,p,m,h=0;h{var r=n(551).FDLayoutNode,i=n(551).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n=this.getChild().getNodes(),r,i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var a=0;r.forEach(function(e){t==`horizontal`?(f.set(e,c.has(e)?l[c.get(e)]:i.get(e)),a+=f.get(e)):(f.set(e,c.has(e)?u[c.get(e)]:i.get(e)),a+=f.get(e))}),a/=r.length,e.forEach(function(e){n.has(e)||f.set(e,a)})}else{var o=0;e.forEach(function(e){o+=t==`horizontal`?c.has(e)?l[c.get(e)]:i.get(e):c.has(e)?u[c.get(e)]:i.get(e)}),o/=e.length,e.forEach(function(e){f.set(e,o)})}});for(var h=function(){var r=m.shift();e.get(r).forEach(function(e){if(f.get(e.id)o&&(o=v),ys&&(s=y)}}catch(e){p=!0,m=e}finally{try{!d&&h.return&&h.return()}finally{if(p)throw m}}var b=(r+o)/2-(a+s)/2,x=!0,S=!1,C=void 0;try{for(var w=e[Symbol.iterator](),T;!(x=(T=w.next()).done);x=!0){var E=T.value;f.set(E,f.get(E)+b)}}catch(e){S=!0,C=e}finally{try{!x&&w.return&&w.return()}finally{if(S)throw C}}})}return f},v=function(e){var t=0,n=0,r=0,i=0;if(e.forEach(function(e){e.left?l[c.get(e.left)]-l[c.get(e.right)]>=0?t++:n++:u[c.get(e.top)]-u[c.get(e.bottom)]>=0?r++:i++}),t>n&&r>i)for(var a=0;an)for(var o=0;oi)for(var s=0;s1)t.fixedNodeConstraint.forEach(function(e,t){S[t]=[e.position.x,e.position.y],C[t]=[l[c.get(e.nodeId)],u[c.get(e.nodeId)]]}),w=!0;else if(t.alignmentConstraint)(function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach(function(e){i.add(e)});var a=new Set([].concat(r(i)).filter(function(e){return E.has(e)})),o=void 0;o=a.size>0?l[c.get(a.values().next().value)]:g(i).x,n[t].forEach(function(t){S[e]=[o,u[c.get(t)]],C[e]=[l[c.get(t)],u[c.get(t)]],e++})},a=0;a0?l[c.get(i.values().next().value)]:g(n).y,o[t].forEach(function(t){S[e]=[l[c.get(t)],a],C[e]=[l[c.get(t)],u[c.get(t)]],e++})},d=0;dA&&(A=k[M].length,j=M);if(A0){var W={x:0,y:0};t.fixedNodeConstraint.forEach(function(e,t){var n={x:l[c.get(e.nodeId)],y:u[c.get(e.nodeId)]},r=e.position,i=h(r,n);W.x+=i.x,W.y+=i.y}),W.x/=t.fixedNodeConstraint.length,W.y/=t.fixedNodeConstraint.length,l.forEach(function(e,t){l[t]+=W.x}),u.forEach(function(e,t){u[t]+=W.y}),t.fixedNodeConstraint.forEach(function(e){l[c.get(e.nodeId)]=e.position.x,u[c.get(e.nodeId)]=e.position.y})}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var G=t.alignmentConstraint.vertical,ie=function(e){var t=new Set;G[e].forEach(function(e){t.add(e)});var n=new Set([].concat(r(t)).filter(function(e){return E.has(e)})),i=void 0;i=n.size>0?l[c.get(n.values().next().value)]:g(t).x,t.forEach(function(e){E.has(e)||(l[c.get(e)]=i)})},K=0;K0?u[c.get(n.values().next().value)]:g(t).y,t.forEach(function(e){E.has(e)||(u[c.get(e)]=i)})},J=0;J{t.exports=e})},n={};function r(e){var i=n[e];if(i!==void 0)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}return r(45)})()})})),k=e(t(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(O()):typeof define==`function`&&define.amd?define([`cose-base`],r):typeof e==`object`?e.cytoscapeFcose=r(O()):n.cytoscapeFcose=r(n.coseBase)})(e,function(e){return(()=>{var t={658:(e=>{e.exports=Object.assign==null?function(e){return[...arguments].slice(1).forEach(function(t){Object.keys(t).forEach(function(n){return e[n]=t[n]})}),e}:Object.assign.bind(Object)}),548:((e,t,n)=>{var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=n(140).layoutBase.LinkedList,a={};a.getTopMostNodes=function(e){for(var t={},n=0;n0&&l.merge(e)});for(var u=0;u1){l=s[0],u=l.connectedEdges().length,s.forEach(function(e){e.connectedEdges().length0&&r.set(`dummy`+(r.size+1),p),m},a.relocateComponent=function(e,t,n){if(!n.fixedNodeConstraint){var i=1/0,a=-1/0,o=1/0,s=-1/0;if(n.quality==`draft`){var c=!0,l=!1,u=void 0;try{for(var d=t.nodeIndexes[Symbol.iterator](),f;!(c=(f=d.next()).done);c=!0){var p=f.value,m=r(p,2),h=m[0],g=m[1],_=n.cy.getElementById(h);if(_){var v=_.boundingBox(),y=t.xCoords[g]-v.w/2,b=t.xCoords[g]+v.w/2,x=t.yCoords[g]-v.h/2,S=t.yCoords[g]+v.h/2;ya&&(a=b),xs&&(s=S)}}}catch(e){l=!0,u=e}finally{try{!c&&d.return&&d.return()}finally{if(l)throw u}}var C=e.x-(a+i)/2,w=e.y-(s+o)/2;t.xCoords=t.xCoords.map(function(e){return e+C}),t.yCoords=t.yCoords.map(function(e){return e+w})}else{Object.keys(t).forEach(function(e){var n=t[e],r=n.getRect().x,c=n.getRect().x+n.getRect().width,l=n.getRect().y,u=n.getRect().y+n.getRect().height;ra&&(a=c),ls&&(s=u)});var T=e.x-(a+i)/2,E=e.y-(s+o)/2;Object.keys(t).forEach(function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+E)})}}},a.calcBoundingBox=function(e,t,n,r){for(var i=2**53-1,a=-(2**53-1),o=2**53-1,s=-(2**53-1),c=void 0,l=void 0,u=void 0,d=void 0,f=e.descendants().not(`:parent`),p=f.length,m=0;mc&&(i=c),au&&(o=u),s{var r=n(548),i=n(140).CoSELayout,a=n(140).CoSENode,o=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,c=n(140).layoutBase.LayoutConstants,l=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,d=e.eles,f=d.nodes(),p=d.edges(),m=void 0,h=void 0,g=void 0,_={};e.randomize&&(m=t.nodeIndexes,h=t.xCoords,g=t.yCoords);var v=function(e){return typeof e==`function`},y=function(e,t){return v(e)?e(t):e},b=r.calcParentsWithoutChildren(n,d),x=function e(t,n,i,c){for(var l=n.length,u=0;u0){var S=void 0;S=i.getGraphManager().add(i.newGraph(),p),e(S,f,i,c)}}},S=function(t,n,r){for(var i=0,a=0,o=0;o0?i/a:v(e.idealEdgeLength)?50:e.idealEdgeLength,u.MIN_REPULSION_DIST=l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH)},C=function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)};e.nestingFactor!=null&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),e.gravity!=null&&(u.DEFAULT_GRAVITY_STRENGTH=l.DEFAULT_GRAVITY_STRENGTH=e.gravity),e.numIter!=null&&(u.MAX_ITERATIONS=l.MAX_ITERATIONS=e.numIter),e.gravityRange!=null&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=l.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),e.gravityCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),e.gravityRangeCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),e.initialEnergyOnIncremental!=null&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=l.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),e.tilingCompareBy!=null&&(u.TILING_COMPARE_BY=e.tilingCompareBy),c.QUALITY=e.quality==`proof`?2:0,u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!e.randomize,u.ANIMATE=l.ANIMATE=c.ANIMATE=e.animate,u.TILE=e.tile,u.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==`function`?e.tilingPaddingVertical.call():e.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==`function`?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!e.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,e.step==`transformed`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),e.step==`enforced`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),e.step==`cose`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),e.step==`all`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!!e.randomize,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),u.TREE_REDUCTION_ON_INCREMENTAL=!(e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint);var w=new i,T=w.newGraphManager();return x(T.addRoot(),r.getTopMostNodes(f),w,e),S(w,T,p),C(w,e),w.runLayout(),_}}}),212:((e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(f){var p=o.getTopMostNodes(t.eles.nodes());if(l=o.connectComponents(n,t.eles,p),l.forEach(function(e){var t=e.boundingBox();u.push({x:t.x1+t.w/2,y:t.y1+t.h/2})}),t.randomize&&l.forEach(function(e){t.eles=e,i.push(s(t))}),t.quality=="default"||t.quality==`proof`){var m=n.collection();if(t.tile){var h=new Map,g=[],_=[],v=0,y={nodeIndexes:h,xCoords:g,yCoords:_},b=[];if(l.forEach(function(e,t){e.edges().length==0&&(e.nodes().forEach(function(t,n){m.merge(e.nodes()[n]),t.isParent()||(y.nodeIndexes.set(e.nodes()[n].id(),v++),y.xCoords.push(e.nodes()[0].position().x),y.yCoords.push(e.nodes()[0].position().y))}),b.push(t))}),m.length>1){var x=m.boundingBox();u.push({x:x.x1+x.w/2,y:x.y1+x.h/2}),l.push(m),i.push(y);for(var S=b.length-1;S>=0;S--)l.splice(b[S],1),i.splice(b[S],1),u.splice(b[S],1)}}l.forEach(function(e,n){t.eles=e,a.push(c(t,i[n])),o.relocateComponent(u[n],a[n],t)})}else l.forEach(function(e,n){o.relocateComponent(u[n],i[n],t)});var C=new Set;if(l.length>1){var w=[],T=r.filter(function(e){return e.css(`display`)==`none`});l.forEach(function(e,n){var r=void 0;if(t.quality==`draft`&&(r=i[n].nodeIndexes),e.nodes().not(T).length>0){var s={};s.edges=[],s.nodes=[];var c=void 0;e.nodes().not(T).forEach(function(e){if(t.quality==`draft`)if(!e.isParent())c=r.get(e.id()),s.nodes.push({x:i[n].xCoords[c]-e.boundingbox().w/2,y:i[n].yCoords[c]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h});else{var l=o.calcBoundingBox(e,i[n].xCoords,i[n].yCoords,r);s.nodes.push({x:l.topLeftX,y:l.topLeftY,width:l.width,height:l.height})}else a[n][e.id()]&&s.nodes.push({x:a[n][e.id()].getLeft(),y:a[n][e.id()].getTop(),width:a[n][e.id()].getWidth(),height:a[n][e.id()].getHeight()})}),e.edges().forEach(function(e){var c=e.source(),l=e.target();if(c.css(`display`)!=`none`&&l.css(`display`)!=`none`)if(t.quality==`draft`){var u=r.get(c.id()),d=r.get(l.id()),f=[],p=[];if(c.isParent()){var m=o.calcBoundingBox(c,i[n].xCoords,i[n].yCoords,r);f.push(m.topLeftX+m.width/2),f.push(m.topLeftY+m.height/2)}else f.push(i[n].xCoords[u]),f.push(i[n].yCoords[u]);if(l.isParent()){var h=o.calcBoundingBox(l,i[n].xCoords,i[n].yCoords,r);p.push(h.topLeftX+h.width/2),p.push(h.topLeftY+h.height/2)}else p.push(i[n].xCoords[d]),p.push(i[n].yCoords[d]);s.edges.push({startX:f[0],startY:f[1],endX:p[0],endY:p[1]})}else a[n][c.id()]&&a[n][l.id()]&&s.edges.push({startX:a[n][c.id()].getCenterX(),startY:a[n][c.id()].getCenterY(),endX:a[n][l.id()].getCenterX(),endY:a[n][l.id()].getCenterY()})}),s.nodes.length>0&&(w.push(s),C.add(n))}});var E=d.packComponents(w,t.randomize).shifts;if(t.quality==`draft`)i.forEach(function(e,t){var n=e.xCoords.map(function(e){return e+E[t].dx}),r=e.yCoords.map(function(e){return e+E[t].dy});e.xCoords=n,e.yCoords=r});else{var D=0;C.forEach(function(e){Object.keys(a[e]).forEach(function(t){var n=a[e][t];n.setCenter(n.getCenterX()+E[D].dx,n.getCenterY()+E[D].dy)}),D++})}}}else{var O=t.eles.boundingBox();if(u.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),t.randomize){var k=s(t);i.push(k)}t.quality=="default"||t.quality==`proof`?(a.push(c(t,i[0])),o.relocateComponent(u[0],a[0],t)):o.relocateComponent(u[0],i[0],t)}var A=function(e,n){if(t.quality=="default"||t.quality==`proof`){typeof e==`number`&&(e=n);var r=void 0,o=void 0,s=e.data(`id`);return a.forEach(function(e){s in e&&(r={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},o=e[s])}),t.nodeDimensionsIncludeLabels&&(o.labelWidth&&(o.labelPosHorizontal==`left`?r.x+=o.labelWidth/2:o.labelPosHorizontal==`right`&&(r.x-=o.labelWidth/2)),o.labelHeight&&(o.labelPosVertical==`top`?r.y+=o.labelHeight/2:o.labelPosVertical==`bottom`&&(r.y-=o.labelHeight/2))),r??={x:e.position(`x`),y:e.position(`y`)},{x:r.x,y:r.y}}var c=void 0;return i.forEach(function(t){var n=t.nodeIndexes.get(e.id());n!=null&&(c={x:t.xCoords[n],y:t.yCoords[n]})}),c??={x:e.position(`x`),y:e.position(`y`)},{x:c.x,y:c.y}};if(t.quality=="default"||t.quality==`proof`||t.randomize){var j=o.calcParentsWithoutChildren(n,r),M=r.filter(function(e){return e.css(`display`)==`none`});t.eles=r.not(M),r.nodes().not(`:parent`).not(M).layoutPositions(e,t,A),j.length>0&&j.forEach(function(e){e.position(A(e))})}else console.log(`If randomize option is set to false, then quality option must be 'default' or 'proof'.`)}}]),e}()}),657:((e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,a=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,o=n.nodes(),s=n.nodes(`:parent`),c=new Map,l=new Map,u=new Map,d=[],f=[],p=[],m=[],h=[],g=[],_=[],v=[],y=void 0,b=1e8,x=1e-9,S=e.piTol,C=e.samplingType,w=e.nodeSeparation,T=void 0,E=function(){for(var e=0,t=0,n=!1;t=i;){o=r[i++];for(var m=d[o],_=0;_u&&(u=h[x],f=x)}return f},O=function(e){var t=void 0;if(e){t=Math.floor(Math.random()*y);for(var n=0;n=1)break;u=l}for(var h=0;h=1)break;u=l}for(var b=0;b0&&(r.isParent()?d[t].push(u.get(r.id())):d[t].push(r.id()))})});var B=function(e){var n=l.get(e),r=void 0;c.get(e).forEach(function(i){r=t.getElementById(i).isParent()?u.get(i):i,d[n].push(r),d[l.get(r)].push(e)})},V=!0,ee=!1,te=void 0;try{for(var H=c.keys()[Symbol.iterator](),ne;!(V=(ne=H.next()).done);V=!0){var re=ne.value;B(re)}}catch(e){ee=!0,te=e}finally{try{!V&&H.return&&H.return()}finally{if(ee)throw te}}y=l.size;var U=void 0;if(y>2){T=y{var r=n(212),i=function(e){e&&e(`layout`,`fcose`,r)};typeof cytoscape<`u`&&i(cytoscape),e.exports=i}),140:(t=>{t.exports=e})},n={};function r(e){var i=n[e];if(i!==void 0)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}return r(579)})()})}))(),1),A={L:`left`,R:`right`,T:`top`,B:`bottom`},j={L:n(e=>`${e},${e/2} 0,${e} 0,0`,`L`),R:n(e=>`0,${e/2} ${e},0 ${e},${e}`,`R`),T:n(e=>`0,0 ${e},0 ${e/2},${e}`,`T`),B:n(e=>`${e/2},0 ${e},${e} 0,${e}`,`B`)},M={L:n((e,t)=>e-t+2,`L`),R:n((e,t)=>e-2,`R`),T:n((e,t)=>e-t+2,`T`),B:n((e,t)=>e-2,`B`)},N=n(function(e){return F(e)?e===`L`?`R`:`L`:e===`T`?`B`:`T`},`getOppositeArchitectureDirection`),P=n(function(e){let t=e;return t===`L`||t===`R`||t===`T`||t===`B`},`isArchitectureDirection`),F=n(function(e){let t=e;return t===`L`||t===`R`},`isArchitectureDirectionX`),I=n(function(e){let t=e;return t===`T`||t===`B`},`isArchitectureDirectionY`),L=n(function(e,t){let n=F(e)&&I(t),r=I(e)&&F(t);return n||r},`isArchitectureDirectionXY`),R=n(function(e){let t=e[0],n=e[1],r=F(t)&&I(n),i=I(t)&&F(n);return r||i},`isArchitecturePairXY`),z=n(function(e){return e!==`LL`&&e!==`RR`&&e!==`TT`&&e!==`BB`},`isValidArchitectureDirectionPair`),B=n(function(e,t){let n=`${e}${t}`;return z(n)?n:void 0},`getArchitectureDirectionPair`),V=n(function([e,t],n){let r=n[0],i=n[1];return F(r)?I(i)?[e+(r===`L`?-1:1),t+(i===`T`?1:-1)]:[e+(r===`L`?-1:1),t]:F(i)?[e+(i===`L`?1:-1),t+(r===`T`?1:-1)]:[e,t+(r===`T`?1:-1)]},`shiftPositionByArchitectureDirectionPair`),ee=n(function(e){return e===`LT`||e===`TL`?[1,1]:e===`BL`||e===`LB`?[1,-1]:e===`BR`||e===`RB`?[-1,-1]:[-1,1]},`getArchitectureDirectionXYFactors`),te=n(function(e,t){return L(e,t)?`bend`:F(e)?`horizontal`:`vertical`},`getArchitectureDirectionAlignment`),H=n(function(e){return e.type===`service`},`isArchitectureService`),ne=n(function(e){return e.type===`junction`},`isArchitectureJunction`),re=n((e,t)=>{let[n,r]=[e,t].sort();return`${JSON.stringify(n)}-${JSON.stringify(r)}`},`architectureGroupAlignmentKey`),U=n(e=>e.data(),`edgeData`),W=n(e=>e.data(),`nodeData`),G=u.architecture,ie=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId=``,this.setAccTitle=o,this.getAccTitle=h,this.setDiagramTitle=d,this.getDiagramTitle=p,this.getAccDescription=f,this.setAccDescription=a,this.clear()}static{n(this,`ArchitectureDB`)}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId=``,c()}addService({id:e,icon:t,in:n,title:r,iconText:i}){if(this.registeredIds.has(e))throw Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(n)===`node`)throw Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,`node`),this.nodes.set(e,{id:e,type:`service`,icon:t,iconText:i,title:r,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(H)}addJunction({id:e,in:t}){if(this.registeredIds.has(e))throw Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(t!==void 0){if(e===t)throw Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(t))throw Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(t)===`node`)throw Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,`node`),this.nodes.set(e,{id:e,type:`junction`,edges:[],in:t})}getJunctions(){return[...this.nodes.values()].filter(ne)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:t,in:n,title:r}){if(this.registeredIds.has(e))throw Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(n)===`node`)throw Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,`group`),this.groups.set(e,{id:e,icon:t,title:r,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:t,lhsDir:n,rhsDir:r,lhsInto:i,rhsInto:a,lhsGroup:o,rhsGroup:s,title:c}){if(!P(n))throw Error(`Invalid direction given for left hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(n)}`);if(!P(r))throw Error(`Invalid direction given for right hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(r)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(t)&&!this.groups.has(t))throw Error(`The right-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);let l=this.nodes.get(e).in,u=this.nodes.get(t).in;if(o&&l&&u&&l==u)throw Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(s&&l&&u&&l==u)throw Error(`The right-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let d={lhsId:e,lhsDir:n,lhsInto:i,lhsGroup:o,rhsId:t,rhsDir:r,rhsInto:a,rhsGroup:s,title:c};this.edges.push(d);let f=this.nodes.get(e),p=this.nodes.get(t);f&&p&&(f.edges.push(this.edges[this.edges.length-1]),p.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw Error(`An align directive requires at least two members; got ${e.members.length}`);let t=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!==`node`)throw Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(t.has(n))throw Error(`align ${e.direction} lists [${n}] more than once`);t.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let e=new Map,t=new Map;for(let[n,r]of this.nodes.entries()){let i=new Map;for(let t of r.edges){let r=this.getNode(t.lhsId)?.in,a=this.getNode(t.rhsId)?.in;if(r&&a&&r!==a){let n=te(t.lhsDir,t.rhsDir);n!==`bend`&&e.set(re(r,a),n)}if(t.lhsId===n){let e=B(t.lhsDir,t.rhsDir);e&&i.set(e,t.rhsId)}else{let e=B(t.rhsDir,t.lhsDir);e&&i.set(e,t.lhsId)}}t.set(n,i)}let r=new Set,i=new Set(t.keys()),a=n(e=>{let n=new Map([[e,[0,0]]]),a=[e];for(;a.length>0;){let e=a.shift();if(e){r.add(e),i.delete(e);let o=t.get(e);if(!o)throw Error(`BFS error: adjacency list for id ${e} not found. Please report this as a bug.`);let s=n.get(e);if(!s)throw Error(`BFS error: position for id ${e} not found in spatial map. Please report this as a bug.`);let[c,l]=s;o.forEach((e,t)=>{r.has(e)||(n.set(e,V([c,l],t)),a.push(e))})}}return n},`BFS`),o=[];for(;i.size>0;){let e=i.values().next().value;o.push(a(e))}this.dataStructures={adjList:t,spatialMaps:o,groupAlignments:e}}return this.dataStructures}setElementForId(e,t){this.elements.set(e,t)}getElementById(e){return this.elements.get(e)}getConfig(){return v({...G,...l().architecture})}getConfigField(e){return this.getConfig()[e]}},K=n((e,t)=>{b(e,t),e.groups.map(e=>t.addGroup(e)),e.services.map(e=>t.addService({...e,type:`service`})),e.junctions.map(e=>t.addJunction({...e,type:`junction`})),e.edges.map(e=>t.addEdge(e)),e.alignments?.map(e=>t.addLayoutHint({direction:e.direction,members:[...e.members]}))},`populateDb`),q={parser:{yy:void 0},parse:n(async e=>{let t=await x(`architecture`,e);r.debug(t);let n=q.parser?.yy;if(!(n instanceof ie))throw Error(`parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);K(t,n)},`parse`)},ae=n(e=>` +import{i as e,t}from"./app-rolldown-runtime.js";import{n}from"./app-chunk-Y2CYZVJY.js";import{m as r,p as i}from"./app-src.js";import{H as a,U as o,Y as s,a as c,b as l,f as u,q as d,v as f,w as p,x as m,y as h,z as g}from"./app-chunk-O7XYJQB3.js";import{c as _,i as v}from"./app-chunk-ZIGJFQKS.js";import{t as y}from"./app-chunk-6AEJRKK7.js";import{i as b,r as x,t as S}from"./app-chunk-742MDFTN.js";import{n as C}from"./app-chunk-MBY4JIJT.js";import{t as w}from"./app-chunk-JWPE2WC7.js";import{n as T}from"./app-mermaid-parser.core.js";import{t as E}from"./app-cytoscape.esm.js";var D=t(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.layoutBase=r():n.layoutBase=r()})(e,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=28)})([(function(e,t,n){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r}),(function(e,t,n){var r=n(2),i=n(8),a=n(9);function o(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw`Node is not incident with this edge`},o.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var e=[,,,,];this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=o}),(function(e,t,n){function r(e){this.vGraphObject=e}e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(13),o=n(0),s=n(16),c=n(5);function l(e,t,n,o){n==null&&o==null&&(o=t),r.call(this,o),e.graphManager!=null&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=e,this.rect=n!=null&&t!=null?new a(t.x,t.y,n.width,n.height):new a}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.getEdges=function(){return this.edges},l.prototype.getChild=function(){return this.child},l.prototype.getOwner=function(){return this.owner},l.prototype.getWidth=function(){return this.rect.width},l.prototype.setWidth=function(e){this.rect.width=e},l.prototype.getHeight=function(){return this.rect.height},l.prototype.setHeight=function(e){this.rect.height=e},l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},l.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},l.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},l.prototype.getRect=function(){return this.rect},l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},l.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},l.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},l.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},l.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},l.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.target==e){if(r.source!=n)throw`Incorrect edge source!`;t.push(r)}}),t},l.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw`Incorrect edge source and/or target`;(r.target==e||r.source==e)&&t.push(r)}),t},l.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach(function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw`Incorrect incidency!`;e.add(n.source)}}),e},l.prototype.withChildren=function(){var e=new Set,t,n;if(e.add(this),this.child!=null)for(var r=this.child.getNodes(),i=0;it?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal==`right`&&this.setWidth(t+this.labelWidth)),this.labelHeight&&(this.labelPosVertical==`top`?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):this.labelPosVertical==`center`&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):this.labelPosVertical==`bottom`&&this.setHeight(n+this.labelHeight))}}},l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw`assert failed`;return this.inclusionTreeDepth},l.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new c(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},l.prototype.getLeft=function(){return this.rect.x},l.prototype.getRight=function(){return this.rect.x+this.rect.width},l.prototype.getTop=function(){return this.rect.y},l.prototype.getBottom=function(){return this.rect.y+this.rect.height},l.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},e.exports=l}),(function(e,t,n){var r=n(0);function i(){}for(var a in r)i[a]=r[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=i.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i}),(function(e,t,n){function r(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(0),o=n(7),s=n(3),c=n(1),l=n(13),u=n(12),d=n(11);function f(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,t!=null&&t instanceof o?this.graphManager=t:t!=null&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in f.prototype=Object.create(r.prototype),r)f[p]=r[p];f.prototype.getNodes=function(){return this.nodes},f.prototype.getEdges=function(){return this.edges},f.prototype.getGraphManager=function(){return this.graphManager},f.prototype.getParent=function(){return this.parent},f.prototype.getLeft=function(){return this.left},f.prototype.getRight=function(){return this.right},f.prototype.getTop=function(){return this.top},f.prototype.getBottom=function(){return this.bottom},f.prototype.isConnected=function(){return this.isConnected},f.prototype.add=function(e,t,n){if(t==null&&n==null){var r=e;if(this.graphManager==null)throw`Graph has no graph mgr!`;if(this.getNodes().indexOf(r)>-1)throw`Node already in graph!`;return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw`Source or target not in graph!`;if(t.owner!=n.owner||t.owner!=this)throw`Both owners must be this graph!`;return t.owner==n.owner?(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i):null},f.prototype.remove=function(e){var t=e;if(e instanceof s){if(t==null)throw`Node is null!`;if(t.owner==null||t.owner!=this)throw`Owner graph is invalid!`;if(this.graphManager==null)throw`Owner graph manager is invalid!`;for(var n=t.edges.slice(),r,i=n.length,a=0;a-1&&u>-1))throw`Source and/or target doesn't know this edge!`;r.source.edges.splice(l,1),r.target!=r.source&&r.target.edges.splice(u,1);var o=r.source.owner.getEdges().indexOf(r);if(o==-1)throw`Not in owner's edge list!`;r.source.owner.getEdges().splice(o,1)}},f.prototype.updateLeftTop=function(){for(var e=i.MAX_VALUE,t=i.MAX_VALUE,n,r,a,o=this.getNodes(),s=o.length,c=0;cn&&(e=n),t>r&&(t=r)}return e==i.MAX_VALUE?null:(a=o[0].getParent().paddingLeft==null?this.margin:o[0].getParent().paddingLeft,this.left=t-a,this.top=e-a,new u(this.left,this.top))},f.prototype.updateBounds=function(e){for(var t=i.MAX_VALUE,n=-i.MAX_VALUE,r=i.MAX_VALUE,a=-i.MAX_VALUE,o,s,c,u,d,f=this.nodes,p=f.length,m=0;mo&&(t=o),nc&&(r=c),ao&&(t=o),nc&&(r=c),a=this.nodes.length){var c=0;n.forEach(function(t){t.owner==e&&c++}),c==this.nodes.length&&(this.isConnected=!0)}},e.exports=f}),(function(e,t,n){var r,i=n(1);function a(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(n==null&&r==null&&i==null){if(e==null)throw`Graph is null!`;if(t==null)throw`Parent node is null!`;if(this.graphs.indexOf(e)>-1)throw`Graph already in this graph mgr!`;if(this.graphs.push(e),e.parent!=null)throw`Already has a parent!`;if(t.child!=null)throw`Already has a child!`;return e.parent=t,t.child=e,e}i=n,r=t,n=e;var a=r.getOwner(),o=i.getOwner();if(a==null||a.getGraphManager()!=this)throw`Source not in this graph mgr!`;if(o==null||o.getGraphManager()!=this)throw`Target not in this graph mgr!`;if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw`Edge already in inter-graph edge list!`;if(this.edges.push(n),n.source==null||n.target==null)throw`Edge source and/or target is null!`;if(n.source.edges.indexOf(n)!=-1||n.target.edges.indexOf(n)!=-1)throw`Edge already in source and/or target incidency list!`;return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw`Graph not in this graph mgr`;if(!(t==this.rootGraph||t.parent!=null&&t.parent.graphManager==this))throw`Invalid parent node!`;var n=[];n=n.concat(t.getEdges());for(var a,o=n.length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]o)return n[0]=r,n[1]=c,n[2]=a,n[3]=y,!1;if(ia)return n[0]=s,n[1]=i,n[2]=_,n[3]=o,!1;if(ra?(n[0]=u,n[1]=d,C=!0):(n[0]=l,n[1]=c,C=!0):T===D&&(r>a?(n[0]=s,n[1]=c,C=!0):(n[0]=f,n[1]=d,C=!0)),-E===D?a>r?(n[2]=v,n[3]=y,w=!0):(n[2]=_,n[3]=g,w=!0):E===D&&(a>r?(n[2]=h,n[3]=g,w=!0):(n[2]=b,n[3]=y,w=!0)),C&&w)return!1;if(r>a?i>o?(O=this.getCardinalDirection(T,D,4),k=this.getCardinalDirection(E,D,2)):(O=this.getCardinalDirection(-T,D,3),k=this.getCardinalDirection(-E,D,1)):i>o?(O=this.getCardinalDirection(-T,D,1),k=this.getCardinalDirection(-E,D,3)):(O=this.getCardinalDirection(T,D,2),k=this.getCardinalDirection(E,D,4)),!C)switch(O){case 1:j=c,A=r+-m/D,n[0]=A,n[1]=j;break;case 2:A=f,j=i+p*D,n[0]=A,n[1]=j;break;case 3:j=d,A=r+m/D,n[0]=A,n[1]=j;break;case 4:A=u,j=i+-p*D,n[0]=A,n[1]=j}if(!w)switch(k){case 1:N=g,M=a+-S/D,n[2]=M,n[3]=N;break;case 2:M=b,N=o+x*D,n[2]=M,n[3]=N;break;case 3:N=y,M=a+S/D,n[2]=M,n[3]=N;break;case 4:M=v,N=o+-x*D,n[2]=M,n[3]=N}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(i==null)return this.getIntersection2(e,t,n);var a=e.x,o=e.y,s=t.x,c=t.y,l=n.x,u=n.y,d=i.x,f=i.y,p=void 0,m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0;return h=c-o,_=a-s,y=s*o-a*c,g=f-u,v=l-d,b=d*u-l*f,x=h*v-g*_,x===0?null:(p=(_*b-v*y)/x,m=(g*y-h*b)/x,new r(p,m))},i.angleOfVector=function(e,t,n,r){var i=void 0;return e===n?i=r=0){var u=(-c+Math.sqrt(c*c-4*s*l))/(2*s),d=(-c-Math.sqrt(c*c-4*s*l))/(2*s);return u>=0&&u<=1?[u]:d>=0&&d<=1?[d]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i}),(function(e,t,n){function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r}),(function(e,t,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(l[0]);s.length>0&&t;){var u=s[0];s.splice(0,1),o.add(u);for(var d=u.getEdges(),a=0;a-1&&l.splice(h,1)}o=new Set,c=new Map}}return e},f.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),a=0;a=0&&t.splice(d,1),s.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;t==1&&l.push(e),r.set(e,t)}})}n=n.concat(l),(t.length==1||t.length==2)&&(i=!0,a=t[0])}return a},f.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=f}),(function(e,t,n){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=Math.sin(r.seed++)*1e4,r.x-Math.floor(r.x)},e.exports=r}),(function(e,t,n){var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return n!=0&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return n!=0&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return n!=0&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return n!=0&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i}),(function(e,t,n){function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);ta.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(this.coolingFactor=e>a.ADAPTATION_LOWER_NODE_LIMIT?Math.max(a.COOLING_ADAPTATION_FACTOR,1-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e=this.getAllEdges(),t,n=0;n0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n,r,i,o,s=this.getAllNodes(),c;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&e&&this.updateGrid(),c=new Set,n=0;nc||s>c)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a)):(c=t.getEstimatedSize()*this.compoundGravityRangeFactor,(o>c||s>c)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant))},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=c.length||u>=c[0].length)){for(var d=0;de}}]),e}()}),(function(e,t,n){function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-->0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function(e){return function e(t){if(t.length==0)return 0;for(var n=[],r=0;r0;)t.push(0);return t}(this.n),i=function(e){for(var t=[];e-->0;)t.push(0);return t}(this.m),a=!0,o=!0,s=Math.min(this.m-1,this.n),c=Math.max(0,Math.min(this.n-2,this.m)),l=0;l=0;k--)if(this.s[k]!==0){for(var A=k+1;A=0;L--){if(function(e,t){return e&&t}(L0;){var U=void 0,W=void 0;for(U=E-2;U>=-1&&U!==-1;U--)if(Math.abs(n[U])<=re+ne*(Math.abs(this.s[U])+Math.abs(this.s[U+1]))){n[U]=0;break}if(U===E-2)W=4;else{var G=void 0;for(G=E-1;G>=U&&G!==U;G--){var ie=(G===E?0:Math.abs(n[G]))+(G===U+1?0:Math.abs(n[G-1]));if(Math.abs(this.s[G])<=re+ne*ie){this.s[G]=0;break}}G===U?W=3:G===E-1?W=1:(W=2,U=G)}switch(U++,W){case 1:var K=n[E-2];n[E-2]=0;for(var q=E-2;q>=U;q--){var ae=r.hypot(this.s[q],K),J=this.s[q]/ae,Y=K/ae;if(this.s[q]=ae,q!==U&&(K=-Y*n[q-1],n[q-1]=J*n[q-1]),o)for(var X=0;X=this.s[U+1]);){var De=this.s[U];if(this.s[U]=this.s[U+1],this.s[U+1]=De,o&&UMath.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):t==0?n=0:(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)),n},e.exports=r}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=a,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=Array(this.iMax);for(var s=0;s=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(D()):typeof define==`function`&&define.amd?define([`layout-base`],r):typeof e==`object`?e.coseBase=r(D()):n.coseBase=r(n.layoutBase)})(e,function(e){return(()=>{var t={45:((e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r}),806:((e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i}),767:((e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),880:((e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),578:((e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),765:((e,t,n)=>{var r=n(551).FDLayout,i=n(578),a=n(880),o=n(991),s=n(767),c=n(806),l=n(902),u=n(551).FDLayoutConstants,d=n(551).LayoutConstants,f=n(551).Point,p=n(551).PointD,m=n(551).DimensionD,h=n(551).Layout,g=n(551).Integer,_=n(551).IGeometry,v=n(551).LGraph,y=n(551).Transform,b=n(551).LinkedList;function x(){r.call(this),this.toBeTiled={},this.constraints={}}for(var S in x.prototype=Object.create(r.prototype),r)x[S]=r[S];x.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},x.prototype.newGraph=function(e){return new a(null,this.graphManager,e)},x.prototype.newNode=function(e){return new o(this.graphManager,e)},x.prototype.newEdge=function(e){return new s(null,null,e)},x.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH<10?10:c.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},x.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},x.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},x.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),!this.incremental){var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n)}return Object.keys(this.constraints).length>0&&(l.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),c.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},x.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-this.coolingCycle**+(Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=c.PURE_INCREMENTAL?u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=c.PURE_INCREMENTAL?u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements();for(var n=0;n0&&(r.fixedNodeWeight=a)}}if(this.constraints.relativePlacementConstraint){var o=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var l=this.constraints.alignmentConstraint.vertical,n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var n=o.has(t.left)?o.get(t.left):t.left,r=o.has(t.right)?o.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,a=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(a)||(e.nodesInRelativeVertical.push(a),e.nodeToRelativeConstraintMapVertical.set(a,[]),e.dummyToNodeForHorizontalAlignment.has(a)?e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(a).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:a,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(a).push({top:i,gap:t.gap})}});else{var d=new Map,f=new Map;this.constraints.relativePlacementConstraint.forEach(function(e){if(e.left){var t=o.has(e.left)?o.get(e.left):e.left,n=o.has(e.right)?o.get(e.right):e.right;d.has(t)?d.get(t).push(n):d.set(t,[n]),d.has(n)?d.get(n).push(t):d.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;f.has(r)?f.get(r).push(i):f.set(r,[i]),f.has(i)?f.get(i).push(r):f.set(i,[r])}});var p=function(e,t){var n=[],r=[],i=new b,a=new Set,o=0;return e.forEach(function(s,c){if(!a.has(c)){n[o]=[],r[o]=!1;var l=c;for(i.push(l),a.add(l),n[o].push(l);i.length!=0;)l=i.shift(),t.has(l)&&(r[o]=!0),e.get(l).forEach(function(e){a.has(e)||(i.push(e),a.add(e),n[o].push(e))});o++}}),{components:n,isFixed:r}},m=p(d,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=m.components,this.fixedComponentsOnHorizontal=m.isFixed;var h=p(f,e.fixedNodesOnVertical);this.componentsOnVertical=h.components,this.fixedComponentsOnVertical=h.isFixed}}},x.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1){var s;for(s=0;sr&&(r=Math.floor(o.y)),a=Math.floor(o.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-o.x/2,d.WORLD_CENTER_Y-o.y/2))},x.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),c.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(t,null,0,359,0,r);var i=v.calculateBounds(e),a=new y;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o1;){var g=h[0];h.splice(0,1);var v=u.indexOf(g);v>=0&&u.splice(v,1),p--,d--}m=t==null?0:(u.indexOf(h[0])+1)%p;for(var y=Math.abs(r-n)/d,b=m;f!=d;b=++b%p){var S=u[b].getOtherEnd(e);if(S!=t){var C=(n+f*y)%360,w=(C+y)%360;x.branchRadialLayout(S,e,C,w,i+a,a),f++}}},x.maxDiagonalInTree=function(e){for(var t=g.MIN_VALUE,n=0;nt&&(t=r)}return t},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r=`DummyCompound_`+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),c=i.getChild();c.add(a);for(var l=0;li?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):r.labelPosHorizontal==`right`&&r.setWidth(i+r.labelWidth)),r.labelHeight&&(r.labelPosVertical==`top`?(r.rect.y-=r.labelHeight,r.setHeight(a+r.labelHeight),r.labelMarginTop=r.labelHeight):r.labelPosVertical==`center`&&r.labelHeight>a?(r.rect.y-=(r.labelHeight-a)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-a)/2):r.labelPosVertical==`bottom`&&r.setHeight(a+r.labelHeight))}})},x.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,a=t.labelMarginLeft,o=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,a,o)}},x.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop,o=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a,o,s)})},x.prototype.getToBeTiled=function(e){var t=e.id;if(this.toBeTiled[t]!=null)return this.toBeTiled[t];var n=e.getChild();if(n==null)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(a.getChild()==null){this.toBeTiled[a.id]=!1;continue}if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}return this.toBeTiled[t]=!0,!0},x.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;ru&&(u=f.rect.height)}n+=u+e.verticalPadding}},x.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var a=i.rect.width,o=i.rect.height;i.labelWidth&&(i.labelPosHorizontal==`left`?(i.rect.x-=i.labelWidth,i.setWidth(a+i.labelWidth),i.labelMarginLeft=i.labelWidth):i.labelPosHorizontal==`center`&&i.labelWidth>a?(i.rect.x-=(i.labelWidth-a)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-a)/2):i.labelPosHorizontal==`right`&&i.setWidth(a+i.labelWidth)),i.labelHeight&&(i.labelPosVertical==`top`?(i.rect.y-=i.labelHeight,i.setHeight(o+i.labelHeight),i.labelMarginTop=i.labelHeight):i.labelPosVertical==`center`&&i.labelHeight>o?(i.rect.y-=(i.labelHeight-o)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-o)/2):i.labelPosVertical==`bottom`&&i.setHeight(o+i.labelHeight))}})},x.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())});var l=a/i,u=o/i,d=(n-r)**2+4*(l+r)*(u+n)*i,f=(r-n+Math.sqrt(d))/(2*(l+r)),p;t?(p=Math.ceil(f),p==f&&p++):p=Math.floor(f);var m=p*(l+r)-r;return s>m&&(m=s),m+=r*2,m},x.prototype.tileNodesByFavoringDim=function(e,t,n){var r=c.TILING_PADDING_VERTICAL,i=c.TILING_PADDING_HORIZONTAL,a=c.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};a&&(o.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},l=function(e,t){return s(t)-s(e)};e.sort(function(e,t){var n=l;return o.idealRowWidth?(n=a,n(e.id,t.id)):n(e,t)});for(var u=0,d=0,f=0;f0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},x.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},x.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var a=e.rowWidth[i];if(a+e.horizontalPadding+t<=e.width)return!0;var o=0;e.rowHeight[i]0&&(o=n+e.verticalPadding-e.rowHeight[i]);var s=e.width-a>=t+e.horizontalPadding?(e.height+o)/(a+t+e.horizontalPadding):(e.height+o)/e.width;o=n+e.verticalPadding;var c=e.widtha&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;so&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var c=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]0)for(var d=i;d<=a;d++)l[0]+=this.grid[d][o-1].length+this.grid[d][o].length-1;if(a0)for(var d=o;d<=s;d++)l[3]+=this.grid[i-1][d].length+this.grid[i][d].length-1;for(var f=g.MAX_VALUE,p,m,h=0;h{var r=n(551).FDLayoutNode,i=n(551).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n=this.getChild().getNodes(),r,i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var a=0;r.forEach(function(e){t==`horizontal`?(f.set(e,c.has(e)?l[c.get(e)]:i.get(e)),a+=f.get(e)):(f.set(e,c.has(e)?u[c.get(e)]:i.get(e)),a+=f.get(e))}),a/=r.length,e.forEach(function(e){n.has(e)||f.set(e,a)})}else{var o=0;e.forEach(function(e){o+=t==`horizontal`?c.has(e)?l[c.get(e)]:i.get(e):c.has(e)?u[c.get(e)]:i.get(e)}),o/=e.length,e.forEach(function(e){f.set(e,o)})}});for(var h=function(){var r=m.shift();e.get(r).forEach(function(e){if(f.get(e.id)o&&(o=v),ys&&(s=y)}}catch(e){p=!0,m=e}finally{try{!d&&h.return&&h.return()}finally{if(p)throw m}}var b=(r+o)/2-(a+s)/2,x=!0,S=!1,C=void 0;try{for(var w=e[Symbol.iterator](),T;!(x=(T=w.next()).done);x=!0){var E=T.value;f.set(E,f.get(E)+b)}}catch(e){S=!0,C=e}finally{try{!x&&w.return&&w.return()}finally{if(S)throw C}}})}return f},v=function(e){var t=0,n=0,r=0,i=0;if(e.forEach(function(e){e.left?l[c.get(e.left)]-l[c.get(e.right)]>=0?t++:n++:u[c.get(e.top)]-u[c.get(e.bottom)]>=0?r++:i++}),t>n&&r>i)for(var a=0;an)for(var o=0;oi)for(var s=0;s1)t.fixedNodeConstraint.forEach(function(e,t){S[t]=[e.position.x,e.position.y],C[t]=[l[c.get(e.nodeId)],u[c.get(e.nodeId)]]}),w=!0;else if(t.alignmentConstraint)(function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach(function(e){i.add(e)});var a=new Set([].concat(r(i)).filter(function(e){return E.has(e)})),o=void 0;o=a.size>0?l[c.get(a.values().next().value)]:g(i).x,n[t].forEach(function(t){S[e]=[o,u[c.get(t)]],C[e]=[l[c.get(t)],u[c.get(t)]],e++})},a=0;a0?l[c.get(i.values().next().value)]:g(n).y,o[t].forEach(function(t){S[e]=[l[c.get(t)],a],C[e]=[l[c.get(t)],u[c.get(t)]],e++})},d=0;dA&&(A=k[M].length,j=M);if(A0){var W={x:0,y:0};t.fixedNodeConstraint.forEach(function(e,t){var n={x:l[c.get(e.nodeId)],y:u[c.get(e.nodeId)]},r=e.position,i=h(r,n);W.x+=i.x,W.y+=i.y}),W.x/=t.fixedNodeConstraint.length,W.y/=t.fixedNodeConstraint.length,l.forEach(function(e,t){l[t]+=W.x}),u.forEach(function(e,t){u[t]+=W.y}),t.fixedNodeConstraint.forEach(function(e){l[c.get(e.nodeId)]=e.position.x,u[c.get(e.nodeId)]=e.position.y})}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var G=t.alignmentConstraint.vertical,ie=function(e){var t=new Set;G[e].forEach(function(e){t.add(e)});var n=new Set([].concat(r(t)).filter(function(e){return E.has(e)})),i=void 0;i=n.size>0?l[c.get(n.values().next().value)]:g(t).x,t.forEach(function(e){E.has(e)||(l[c.get(e)]=i)})},K=0;K0?u[c.get(n.values().next().value)]:g(t).y,t.forEach(function(e){E.has(e)||(u[c.get(e)]=i)})},J=0;J{t.exports=e})},n={};function r(e){var i=n[e];if(i!==void 0)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}return r(45)})()})})),k=e(t(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(O()):typeof define==`function`&&define.amd?define([`cose-base`],r):typeof e==`object`?e.cytoscapeFcose=r(O()):n.cytoscapeFcose=r(n.coseBase)})(e,function(e){return(()=>{var t={658:(e=>{e.exports=Object.assign==null?function(e){return[...arguments].slice(1).forEach(function(t){Object.keys(t).forEach(function(n){return e[n]=t[n]})}),e}:Object.assign.bind(Object)}),548:((e,t,n)=>{var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=n(140).layoutBase.LinkedList,a={};a.getTopMostNodes=function(e){for(var t={},n=0;n0&&l.merge(e)});for(var u=0;u1){l=s[0],u=l.connectedEdges().length,s.forEach(function(e){e.connectedEdges().length0&&r.set(`dummy`+(r.size+1),p),m},a.relocateComponent=function(e,t,n){if(!n.fixedNodeConstraint){var i=1/0,a=-1/0,o=1/0,s=-1/0;if(n.quality==`draft`){var c=!0,l=!1,u=void 0;try{for(var d=t.nodeIndexes[Symbol.iterator](),f;!(c=(f=d.next()).done);c=!0){var p=f.value,m=r(p,2),h=m[0],g=m[1],_=n.cy.getElementById(h);if(_){var v=_.boundingBox(),y=t.xCoords[g]-v.w/2,b=t.xCoords[g]+v.w/2,x=t.yCoords[g]-v.h/2,S=t.yCoords[g]+v.h/2;ya&&(a=b),xs&&(s=S)}}}catch(e){l=!0,u=e}finally{try{!c&&d.return&&d.return()}finally{if(l)throw u}}var C=e.x-(a+i)/2,w=e.y-(s+o)/2;t.xCoords=t.xCoords.map(function(e){return e+C}),t.yCoords=t.yCoords.map(function(e){return e+w})}else{Object.keys(t).forEach(function(e){var n=t[e],r=n.getRect().x,c=n.getRect().x+n.getRect().width,l=n.getRect().y,u=n.getRect().y+n.getRect().height;ra&&(a=c),ls&&(s=u)});var T=e.x-(a+i)/2,E=e.y-(s+o)/2;Object.keys(t).forEach(function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+E)})}}},a.calcBoundingBox=function(e,t,n,r){for(var i=2**53-1,a=-(2**53-1),o=2**53-1,s=-(2**53-1),c=void 0,l=void 0,u=void 0,d=void 0,f=e.descendants().not(`:parent`),p=f.length,m=0;mc&&(i=c),au&&(o=u),s{var r=n(548),i=n(140).CoSELayout,a=n(140).CoSENode,o=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,c=n(140).layoutBase.LayoutConstants,l=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,d=e.eles,f=d.nodes(),p=d.edges(),m=void 0,h=void 0,g=void 0,_={};e.randomize&&(m=t.nodeIndexes,h=t.xCoords,g=t.yCoords);var v=function(e){return typeof e==`function`},y=function(e,t){return v(e)?e(t):e},b=r.calcParentsWithoutChildren(n,d),x=function e(t,n,i,c){for(var l=n.length,u=0;u0){var S=void 0;S=i.getGraphManager().add(i.newGraph(),p),e(S,f,i,c)}}},S=function(t,n,r){for(var i=0,a=0,o=0;o0?i/a:v(e.idealEdgeLength)?50:e.idealEdgeLength,u.MIN_REPULSION_DIST=l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH)},C=function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)};e.nestingFactor!=null&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),e.gravity!=null&&(u.DEFAULT_GRAVITY_STRENGTH=l.DEFAULT_GRAVITY_STRENGTH=e.gravity),e.numIter!=null&&(u.MAX_ITERATIONS=l.MAX_ITERATIONS=e.numIter),e.gravityRange!=null&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=l.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),e.gravityCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),e.gravityRangeCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),e.initialEnergyOnIncremental!=null&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=l.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),e.tilingCompareBy!=null&&(u.TILING_COMPARE_BY=e.tilingCompareBy),c.QUALITY=e.quality==`proof`?2:0,u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!e.randomize,u.ANIMATE=l.ANIMATE=c.ANIMATE=e.animate,u.TILE=e.tile,u.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==`function`?e.tilingPaddingVertical.call():e.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==`function`?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!e.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,e.step==`transformed`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),e.step==`enforced`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),e.step==`cose`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),e.step==`all`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!!e.randomize,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),u.TREE_REDUCTION_ON_INCREMENTAL=!(e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint);var w=new i,T=w.newGraphManager();return x(T.addRoot(),r.getTopMostNodes(f),w,e),S(w,T,p),C(w,e),w.runLayout(),_}}}),212:((e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(f){var p=o.getTopMostNodes(t.eles.nodes());if(l=o.connectComponents(n,t.eles,p),l.forEach(function(e){var t=e.boundingBox();u.push({x:t.x1+t.w/2,y:t.y1+t.h/2})}),t.randomize&&l.forEach(function(e){t.eles=e,i.push(s(t))}),t.quality=="default"||t.quality==`proof`){var m=n.collection();if(t.tile){var h=new Map,g=[],_=[],v=0,y={nodeIndexes:h,xCoords:g,yCoords:_},b=[];if(l.forEach(function(e,t){e.edges().length==0&&(e.nodes().forEach(function(t,n){m.merge(e.nodes()[n]),t.isParent()||(y.nodeIndexes.set(e.nodes()[n].id(),v++),y.xCoords.push(e.nodes()[0].position().x),y.yCoords.push(e.nodes()[0].position().y))}),b.push(t))}),m.length>1){var x=m.boundingBox();u.push({x:x.x1+x.w/2,y:x.y1+x.h/2}),l.push(m),i.push(y);for(var S=b.length-1;S>=0;S--)l.splice(b[S],1),i.splice(b[S],1),u.splice(b[S],1)}}l.forEach(function(e,n){t.eles=e,a.push(c(t,i[n])),o.relocateComponent(u[n],a[n],t)})}else l.forEach(function(e,n){o.relocateComponent(u[n],i[n],t)});var C=new Set;if(l.length>1){var w=[],T=r.filter(function(e){return e.css(`display`)==`none`});l.forEach(function(e,n){var r=void 0;if(t.quality==`draft`&&(r=i[n].nodeIndexes),e.nodes().not(T).length>0){var s={};s.edges=[],s.nodes=[];var c=void 0;e.nodes().not(T).forEach(function(e){if(t.quality==`draft`)if(!e.isParent())c=r.get(e.id()),s.nodes.push({x:i[n].xCoords[c]-e.boundingbox().w/2,y:i[n].yCoords[c]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h});else{var l=o.calcBoundingBox(e,i[n].xCoords,i[n].yCoords,r);s.nodes.push({x:l.topLeftX,y:l.topLeftY,width:l.width,height:l.height})}else a[n][e.id()]&&s.nodes.push({x:a[n][e.id()].getLeft(),y:a[n][e.id()].getTop(),width:a[n][e.id()].getWidth(),height:a[n][e.id()].getHeight()})}),e.edges().forEach(function(e){var c=e.source(),l=e.target();if(c.css(`display`)!=`none`&&l.css(`display`)!=`none`)if(t.quality==`draft`){var u=r.get(c.id()),d=r.get(l.id()),f=[],p=[];if(c.isParent()){var m=o.calcBoundingBox(c,i[n].xCoords,i[n].yCoords,r);f.push(m.topLeftX+m.width/2),f.push(m.topLeftY+m.height/2)}else f.push(i[n].xCoords[u]),f.push(i[n].yCoords[u]);if(l.isParent()){var h=o.calcBoundingBox(l,i[n].xCoords,i[n].yCoords,r);p.push(h.topLeftX+h.width/2),p.push(h.topLeftY+h.height/2)}else p.push(i[n].xCoords[d]),p.push(i[n].yCoords[d]);s.edges.push({startX:f[0],startY:f[1],endX:p[0],endY:p[1]})}else a[n][c.id()]&&a[n][l.id()]&&s.edges.push({startX:a[n][c.id()].getCenterX(),startY:a[n][c.id()].getCenterY(),endX:a[n][l.id()].getCenterX(),endY:a[n][l.id()].getCenterY()})}),s.nodes.length>0&&(w.push(s),C.add(n))}});var E=d.packComponents(w,t.randomize).shifts;if(t.quality==`draft`)i.forEach(function(e,t){var n=e.xCoords.map(function(e){return e+E[t].dx}),r=e.yCoords.map(function(e){return e+E[t].dy});e.xCoords=n,e.yCoords=r});else{var D=0;C.forEach(function(e){Object.keys(a[e]).forEach(function(t){var n=a[e][t];n.setCenter(n.getCenterX()+E[D].dx,n.getCenterY()+E[D].dy)}),D++})}}}else{var O=t.eles.boundingBox();if(u.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),t.randomize){var k=s(t);i.push(k)}t.quality=="default"||t.quality==`proof`?(a.push(c(t,i[0])),o.relocateComponent(u[0],a[0],t)):o.relocateComponent(u[0],i[0],t)}var A=function(e,n){if(t.quality=="default"||t.quality==`proof`){typeof e==`number`&&(e=n);var r=void 0,o=void 0,s=e.data(`id`);return a.forEach(function(e){s in e&&(r={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},o=e[s])}),t.nodeDimensionsIncludeLabels&&(o.labelWidth&&(o.labelPosHorizontal==`left`?r.x+=o.labelWidth/2:o.labelPosHorizontal==`right`&&(r.x-=o.labelWidth/2)),o.labelHeight&&(o.labelPosVertical==`top`?r.y+=o.labelHeight/2:o.labelPosVertical==`bottom`&&(r.y-=o.labelHeight/2))),r??={x:e.position(`x`),y:e.position(`y`)},{x:r.x,y:r.y}}var c=void 0;return i.forEach(function(t){var n=t.nodeIndexes.get(e.id());n!=null&&(c={x:t.xCoords[n],y:t.yCoords[n]})}),c??={x:e.position(`x`),y:e.position(`y`)},{x:c.x,y:c.y}};if(t.quality=="default"||t.quality==`proof`||t.randomize){var j=o.calcParentsWithoutChildren(n,r),M=r.filter(function(e){return e.css(`display`)==`none`});t.eles=r.not(M),r.nodes().not(`:parent`).not(M).layoutPositions(e,t,A),j.length>0&&j.forEach(function(e){e.position(A(e))})}else console.log(`If randomize option is set to false, then quality option must be 'default' or 'proof'.`)}}]),e}()}),657:((e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,a=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,o=n.nodes(),s=n.nodes(`:parent`),c=new Map,l=new Map,u=new Map,d=[],f=[],p=[],m=[],h=[],g=[],_=[],v=[],y=void 0,b=1e8,x=1e-9,S=e.piTol,C=e.samplingType,w=e.nodeSeparation,T=void 0,E=function(){for(var e=0,t=0,n=!1;t=i;){o=r[i++];for(var m=d[o],_=0;_u&&(u=h[x],f=x)}return f},O=function(e){var t=void 0;if(e){t=Math.floor(Math.random()*y);for(var n=0;n=1)break;u=l}for(var h=0;h=1)break;u=l}for(var b=0;b0&&(r.isParent()?d[t].push(u.get(r.id())):d[t].push(r.id()))})});var B=function(e){var n=l.get(e),r=void 0;c.get(e).forEach(function(i){r=t.getElementById(i).isParent()?u.get(i):i,d[n].push(r),d[l.get(r)].push(e)})},V=!0,ee=!1,te=void 0;try{for(var H=c.keys()[Symbol.iterator](),ne;!(V=(ne=H.next()).done);V=!0){var re=ne.value;B(re)}}catch(e){ee=!0,te=e}finally{try{!V&&H.return&&H.return()}finally{if(ee)throw te}}y=l.size;var U=void 0;if(y>2){T=y{var r=n(212),i=function(e){e&&e(`layout`,`fcose`,r)};typeof cytoscape<`u`&&i(cytoscape),e.exports=i}),140:(t=>{t.exports=e})},n={};function r(e){var i=n[e];if(i!==void 0)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}return r(579)})()})}))(),1),A={L:`left`,R:`right`,T:`top`,B:`bottom`},j={L:n(e=>`${e},${e/2} 0,${e} 0,0`,`L`),R:n(e=>`0,${e/2} ${e},0 ${e},${e}`,`R`),T:n(e=>`0,0 ${e},0 ${e/2},${e}`,`T`),B:n(e=>`${e/2},0 ${e},${e} 0,${e}`,`B`)},M={L:n((e,t)=>e-t+2,`L`),R:n((e,t)=>e-2,`R`),T:n((e,t)=>e-t+2,`T`),B:n((e,t)=>e-2,`B`)},N=n(function(e){return F(e)?e===`L`?`R`:`L`:e===`T`?`B`:`T`},`getOppositeArchitectureDirection`),P=n(function(e){let t=e;return t===`L`||t===`R`||t===`T`||t===`B`},`isArchitectureDirection`),F=n(function(e){let t=e;return t===`L`||t===`R`},`isArchitectureDirectionX`),I=n(function(e){let t=e;return t===`T`||t===`B`},`isArchitectureDirectionY`),L=n(function(e,t){let n=F(e)&&I(t),r=I(e)&&F(t);return n||r},`isArchitectureDirectionXY`),R=n(function(e){let t=e[0],n=e[1],r=F(t)&&I(n),i=I(t)&&F(n);return r||i},`isArchitecturePairXY`),z=n(function(e){return e!==`LL`&&e!==`RR`&&e!==`TT`&&e!==`BB`},`isValidArchitectureDirectionPair`),B=n(function(e,t){let n=`${e}${t}`;return z(n)?n:void 0},`getArchitectureDirectionPair`),V=n(function([e,t],n){let r=n[0],i=n[1];return F(r)?I(i)?[e+(r===`L`?-1:1),t+(i===`T`?1:-1)]:[e+(r===`L`?-1:1),t]:F(i)?[e+(i===`L`?1:-1),t+(r===`T`?1:-1)]:[e,t+(r===`T`?1:-1)]},`shiftPositionByArchitectureDirectionPair`),ee=n(function(e){return e===`LT`||e===`TL`?[1,1]:e===`BL`||e===`LB`?[1,-1]:e===`BR`||e===`RB`?[-1,-1]:[-1,1]},`getArchitectureDirectionXYFactors`),te=n(function(e,t){return L(e,t)?`bend`:F(e)?`horizontal`:`vertical`},`getArchitectureDirectionAlignment`),H=n(function(e){return e.type===`service`},`isArchitectureService`),ne=n(function(e){return e.type===`junction`},`isArchitectureJunction`),re=n((e,t)=>{let[n,r]=[e,t].sort();return`${JSON.stringify(n)}-${JSON.stringify(r)}`},`architectureGroupAlignmentKey`),U=n(e=>e.data(),`edgeData`),W=n(e=>e.data(),`nodeData`),G=u.architecture,ie=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId=``,this.setAccTitle=o,this.getAccTitle=h,this.setDiagramTitle=d,this.getDiagramTitle=p,this.getAccDescription=f,this.setAccDescription=a,this.clear()}static{n(this,`ArchitectureDB`)}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId=``,c()}addService({id:e,icon:t,in:n,title:r,iconText:i}){if(this.registeredIds.has(e))throw Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(n)===`node`)throw Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,`node`),this.nodes.set(e,{id:e,type:`service`,icon:t,iconText:i,title:r,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(H)}addJunction({id:e,in:t}){if(this.registeredIds.has(e))throw Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(t!==void 0){if(e===t)throw Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(t))throw Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(t)===`node`)throw Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,`node`),this.nodes.set(e,{id:e,type:`junction`,edges:[],in:t})}getJunctions(){return[...this.nodes.values()].filter(ne)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:t,in:n,title:r}){if(this.registeredIds.has(e))throw Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(n)===`node`)throw Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,`group`),this.groups.set(e,{id:e,icon:t,title:r,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:t,lhsDir:n,rhsDir:r,lhsInto:i,rhsInto:a,lhsGroup:o,rhsGroup:s,title:c}){if(!P(n))throw Error(`Invalid direction given for left hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(n)}`);if(!P(r))throw Error(`Invalid direction given for right hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(r)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(t)&&!this.groups.has(t))throw Error(`The right-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);let l=this.nodes.get(e).in,u=this.nodes.get(t).in;if(o&&l&&u&&l==u)throw Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(s&&l&&u&&l==u)throw Error(`The right-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let d={lhsId:e,lhsDir:n,lhsInto:i,lhsGroup:o,rhsId:t,rhsDir:r,rhsInto:a,rhsGroup:s,title:c};this.edges.push(d);let f=this.nodes.get(e),p=this.nodes.get(t);f&&p&&(f.edges.push(this.edges[this.edges.length-1]),p.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw Error(`An align directive requires at least two members; got ${e.members.length}`);let t=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!==`node`)throw Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(t.has(n))throw Error(`align ${e.direction} lists [${n}] more than once`);t.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let e=new Map,t=new Map;for(let[n,r]of this.nodes.entries()){let i=new Map;for(let t of r.edges){let r=this.getNode(t.lhsId)?.in,a=this.getNode(t.rhsId)?.in;if(r&&a&&r!==a){let n=te(t.lhsDir,t.rhsDir);n!==`bend`&&e.set(re(r,a),n)}if(t.lhsId===n){let e=B(t.lhsDir,t.rhsDir);e&&i.set(e,t.rhsId)}else{let e=B(t.rhsDir,t.lhsDir);e&&i.set(e,t.lhsId)}}t.set(n,i)}let r=new Set,i=new Set(t.keys()),a=n(e=>{let n=new Map([[e,[0,0]]]),a=[e];for(;a.length>0;){let e=a.shift();if(e){r.add(e),i.delete(e);let o=t.get(e);if(!o)throw Error(`BFS error: adjacency list for id ${e} not found. Please report this as a bug.`);let s=n.get(e);if(!s)throw Error(`BFS error: position for id ${e} not found in spatial map. Please report this as a bug.`);let[c,l]=s;o.forEach((e,t)=>{r.has(e)||(n.set(e,V([c,l],t)),a.push(e))})}}return n},`BFS`),o=[];for(;i.size>0;){let e=i.values().next().value;o.push(a(e))}this.dataStructures={adjList:t,spatialMaps:o,groupAlignments:e}}return this.dataStructures}setElementForId(e,t){this.elements.set(e,t)}getElementById(e){return this.elements.get(e)}getConfig(){return v({...G,...l().architecture})}getConfigField(e){return this.getConfig()[e]}},K=n((e,t)=>{w(e,t),e.groups.map(e=>t.addGroup(e)),e.services.map(e=>t.addService({...e,type:`service`})),e.junctions.map(e=>t.addJunction({...e,type:`junction`})),e.edges.map(e=>t.addEdge(e)),e.alignments?.map(e=>t.addLayoutHint({direction:e.direction,members:[...e.members]}))},`populateDb`),q={parser:{yy:void 0},parse:n(async e=>{let t=await T(`architecture`,e);r.debug(t);let n=q.parser?.yy;if(!(n instanceof ie))throw Error(`parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);K(t,n)},`parse`)},ae=n(e=>` .edge { stroke-width: ${e.archEdgeWidth}; stroke: ${e.archEdgeColor}; @@ -29,8 +29,8 @@ import{i as e,t}from"./app-rolldown-runtime.js";import{n}from"./app-chunk-Y2CYZV display: -webkit-box; -webkit-box-orient: vertical; } -`,`getStyles`);function J(e,t){if(e===0)return t();let n=Math.random,r=e>>>0;Math.random=function(){r=r+1831565813>>>0;let e=r;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296};try{return t()}finally{Math.random=n}}n(J,`withSeededRandom`);var Y=n(e=>`${e}`,`wrapIcon`),X={prefix:`mermaid-architecture`,height:80,width:80,icons:{database:{body:Y(``)},server:{body:Y(``)},disk:{body:Y(``)},internet:{body:Y(``)},cloud:{body:Y(``)},unknown:S,blank:{body:Y(``)}}},oe=n(async function(e,t,n,r){let i=n.getConfigField(`padding`),a=n.getConfigField(`iconSize`),o=a/2,s=a/6,c=s/2;await Promise.all(t.edges().map(async t=>{let{source:a,sourceDir:l,sourceArrow:u,sourceGroup:d,target:f,targetDir:p,targetArrow:h,targetGroup:g,label:v}=U(t),{x:y,y:b}=t[0].sourceEndpoint(),{x,y:S}=t[0].midpoint(),{x:C,y:w}=t[0].targetEndpoint(),E=i+4;if(d&&(F(l)?y+=l===`L`?-E:E:b+=l===`T`?-E:E+18),g&&(F(p)?C+=p===`L`?-E:E:w+=p===`T`?-E:E+18),!d&&n.getNode(a)?.type===`junction`&&(F(l)?y+=l===`L`?o:-o:b+=l===`T`?o:-o),!g&&n.getNode(f)?.type===`junction`&&(F(p)?C+=p===`L`?o:-o:w+=p===`T`?o:-o),t[0]._private.rscratch){let t=e.insert(`g`);if(t.insert(`path`).attr(`d`,`M ${y},${b} L ${x},${S} L${C},${w} `).attr(`class`,`edge`).attr(`id`,`${r}-${_(a,f,{prefix:`L`})}`),u){let e=F(l)?M[l](y,s):y-c,n=I(l)?M[l](b,s):b-c;t.insert(`polygon`).attr(`points`,j[l](s)).attr(`transform`,`translate(${e},${n})`).attr(`class`,`arrow`)}if(h){let e=F(p)?M[p](C,s):C-c,n=I(p)?M[p](w,s):w-c;t.insert(`polygon`).attr(`points`,j[p](s)).attr(`transform`,`translate(${e},${n})`).attr(`class`,`arrow`)}if(v){let e=L(l,p)?`XY`:F(l)?`X`:`Y`,n=0;n=e===`X`?Math.abs(y-C):e===`Y`?Math.abs(b-w)/1.5:Math.abs(y-C)/2;let r=t.append(`g`);if(await T(r,v,{useHtmlLabels:!1,width:n,classes:`architecture-service-label`},m()),r.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`),e===`X`)r.attr(`transform`,`translate(`+x+`, `+S+`)`);else if(e===`Y`)r.attr(`transform`,`translate(`+x+`, `+S+`) rotate(-90)`);else if(e===`XY`){let e=B(l,p);if(e&&R(e)){let t=r.node().getBoundingClientRect(),[n,i]=ee(e);r.attr(`dominant-baseline`,`auto`).attr(`transform`,`rotate(${-1*n*i*45})`);let a=r.node().getBoundingClientRect();r.attr(`transform`,` +`,`getStyles`);function J(e,t){if(e===0)return t();let n=Math.random,r=e>>>0;Math.random=function(){r=r+1831565813>>>0;let e=r;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296};try{return t()}finally{Math.random=n}}n(J,`withSeededRandom`);var Y=n(e=>`${e}`,`wrapIcon`),X={prefix:`mermaid-architecture`,height:80,width:80,icons:{database:{body:Y(``)},server:{body:Y(``)},disk:{body:Y(``)},internet:{body:Y(``)},cloud:{body:Y(``)},unknown:b,blank:{body:Y(``)}}},oe=n(async function(e,t,n,r){let i=n.getConfigField(`padding`),a=n.getConfigField(`iconSize`),o=a/2,s=a/6,c=s/2;await Promise.all(t.edges().map(async t=>{let{source:a,sourceDir:l,sourceArrow:u,sourceGroup:d,target:f,targetDir:p,targetArrow:h,targetGroup:g,label:v}=U(t),{x:y,y:b}=t[0].sourceEndpoint(),{x,y:S}=t[0].midpoint(),{x:w,y:T}=t[0].targetEndpoint(),E=i+4;if(d&&(F(l)?y+=l===`L`?-E:E:b+=l===`T`?-E:E+18),g&&(F(p)?w+=p===`L`?-E:E:T+=p===`T`?-E:E+18),!d&&n.getNode(a)?.type===`junction`&&(F(l)?y+=l===`L`?o:-o:b+=l===`T`?o:-o),!g&&n.getNode(f)?.type===`junction`&&(F(p)?w+=p===`L`?o:-o:T+=p===`T`?o:-o),t[0]._private.rscratch){let t=e.insert(`g`);if(t.insert(`path`).attr(`d`,`M ${y},${b} L ${x},${S} L${w},${T} `).attr(`class`,`edge`).attr(`id`,`${r}-${_(a,f,{prefix:`L`})}`),u){let e=F(l)?M[l](y,s):y-c,n=I(l)?M[l](b,s):b-c;t.insert(`polygon`).attr(`points`,j[l](s)).attr(`transform`,`translate(${e},${n})`).attr(`class`,`arrow`)}if(h){let e=F(p)?M[p](w,s):w-c,n=I(p)?M[p](T,s):T-c;t.insert(`polygon`).attr(`points`,j[p](s)).attr(`transform`,`translate(${e},${n})`).attr(`class`,`arrow`)}if(v){let e=L(l,p)?`XY`:F(l)?`X`:`Y`,n=0;n=e===`X`?Math.abs(y-w):e===`Y`?Math.abs(b-T)/1.5:Math.abs(y-w)/2;let r=t.append(`g`);if(await C(r,v,{useHtmlLabels:!1,width:n,classes:`architecture-service-label`},m()),r.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`),e===`X`)r.attr(`transform`,`translate(`+x+`, `+S+`)`);else if(e===`Y`)r.attr(`transform`,`translate(`+x+`, `+S+`) rotate(-90)`);else if(e===`XY`){let e=B(l,p);if(e&&R(e)){let t=r.node().getBoundingClientRect(),[n,i]=ee(e);r.attr(`dominant-baseline`,`auto`).attr(`transform`,`rotate(${-1*n*i*45})`);let a=r.node().getBoundingClientRect();r.attr(`transform`,` translate(${x}, ${S-t.height/2}) translate(${n*a.width/2}, ${i*a.height/2}) rotate(${-1*n*i*45}, 0, ${t.height/2}) - `)}}}}}))},`drawEdges`),Z=n(async function(e,t,n,r){let i=n.getConfigField(`padding`)*.75,a=n.getConfigField(`fontSize`),o=n.getConfigField(`iconSize`)/2;await Promise.all(t.nodes().map(async t=>{let s=W(t);if(s.type===`group`){let{h:c,w:l,x1:u,y1:d}=t.boundingBox(),f=e.append(`rect`);f.attr(`id`,`${r}-group-${s.id}`).attr(`x`,u+o).attr(`y`,d+o).attr(`width`,l).attr(`height`,c).attr(`class`,`node-bkg`);let p=e.append(`g`),h=u,g=d;if(s.icon){let e=p.append(`g`);e.html(`${await w(s.icon,{height:i,width:i,fallbackPrefix:X.prefix})}`),e.attr(`transform`,`translate(`+(h+o+1)+`, `+(g+o+1)+`)`),h+=i,g+=a/2-1-2}if(s.label){let e=p.append(`g`);await T(e,s.label,{useHtmlLabels:!1,width:l,classes:`architecture-service-label`},m()),e.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`start`).attr(`text-anchor`,`start`),e.attr(`transform`,`translate(`+(h+o+4)+`, `+(g+o+2)+`)`)}n.setElementForId(s.id,f)}}))},`drawGroups`),se=n(async function(e,t,n,r){let i=m();for(let a of n){let n=t.append(`g`),o=e.getConfigField(`iconSize`);if(a.title){let e=n.append(`g`);await T(e,a.title,{useHtmlLabels:!1,width:o*1.5,classes:`architecture-service-label`},i),e.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`),e.attr(`transform`,`translate(`+o/2+`, `+o+`)`)}let s=n.append(`g`);if(a.icon)s.html(`${await w(a.icon,{height:o,width:o,fallbackPrefix:X.prefix})}`);else if(a.iconText){s.html(`${await w(`blank`,{height:o,width:o,fallbackPrefix:X.prefix})}`);let e=s.append(`g`).append(`foreignObject`).attr(`width`,o).attr(`height`,o).append(`div`).attr(`class`,`node-icon-text`).attr(`style`,`height: ${o}px;`).append(`div`).html(g(a.iconText,i)),t=parseInt(window.getComputedStyle(e.node(),null).getPropertyValue(`font-size`).replace(/\D/g,``))??16;e.attr(`style`,`-webkit-line-clamp: ${Math.floor((o-2)/t)};`)}else s.append(`path`).attr(`class`,`node-bkg`).attr(`id`,`${r}-node-${a.id}`).attr(`d`,`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);n.attr(`id`,`${r}-service-${a.id}`).attr(`class`,`architecture-service`);let{width:c,height:l}=n.node().getBBox();a.width=c,a.height=l,e.setElementForId(a.id,n)}return 0},`drawServices`),ce=n(function(e,t,n,r){n.forEach(n=>{let i=t.append(`g`),a=e.getConfigField(`iconSize`);i.append(`g`).append(`rect`).attr(`id`,`${r}-node-${n.id}`).attr(`fill-opacity`,`0`).attr(`width`,a).attr(`height`,a),i.attr(`class`,`architecture-junction`);let{width:o,height:s}=i._groups[0][0].getBBox();i.width=o,i.height=s,e.setElementForId(n.id,i)})},`drawJunctions`);C([{name:X.prefix,icons:X}]),E.use(k.default);function le(e,t,n){e.forEach(e=>{t.add({group:`nodes`,data:{type:`service`,id:e.id,icon:e.icon,label:e.title,parent:e.in,width:n.getConfigField(`iconSize`),height:n.getConfigField(`iconSize`)},classes:`node-service`})})}n(le,`addServices`);function ue(e,t,n){e.forEach(e=>{t.add({group:`nodes`,data:{type:`junction`,id:e.id,parent:e.in,width:n.getConfigField(`iconSize`),height:n.getConfigField(`iconSize`)},classes:`node-junction`})})}n(ue,`addJunctions`);function de(e,t){t.nodes().map(t=>{let n=W(t);n.type!==`group`&&(n.x=t.position().x,n.y=t.position().y,e.getElementById(n.id).attr(`transform`,`translate(`+(n.x||0)+`,`+(n.y||0)+`)`))})}n(de,`positionNodes`);function fe(e,t){e.forEach(e=>{t.add({group:`nodes`,data:{type:`group`,id:e.id,icon:e.icon,label:e.title,parent:e.in},classes:`node-group`})})}n(fe,`addGroups`);function pe(e,t){e.forEach(e=>{let{lhsId:n,rhsId:r,lhsInto:i,lhsGroup:a,rhsInto:o,lhsDir:s,rhsDir:c,rhsGroup:l,title:u}=e,d=L(e.lhsDir,e.rhsDir)?`segments`:`straight`,f={id:`${n}-${r}`,label:u,source:n,sourceDir:s,sourceArrow:i,sourceGroup:a,sourceEndpoint:s===`L`?`0 50%`:s===`R`?`100% 50%`:s===`T`?`50% 0`:`50% 100%`,target:r,targetDir:c,targetArrow:o,targetGroup:l,targetEndpoint:c===`L`?`0 50%`:c===`R`?`100% 50%`:c===`T`?`50% 0`:`50% 100%`};t.add({group:`edges`,data:f,classes:d})})}n(pe,`addEdges`);function me(e,t,r,i=[]){let a=n((e,t)=>{let n=new Map;for(let[i,a]of e.entries()){let e=`${i}`,o=0,s=[...a.entries()];if(s.length===1){n.set(e,s[0][1]);continue}for(let i=0;i{let n=new Map,r=new Map;return t.forEach(([t,i],a)=>{let o=e.getNode(a)?.in??`default`,s=n.get(i)??new Map;n.has(i)||n.set(i,s);let c=r.get(t)??new Map;r.has(t)||r.set(t,c);for(let e of[s,c]){let t=e.get(o)??[];e.has(o)||e.set(o,t),t.push(a)}}),{horiz:[...a(n,`horizontal`).values()].filter(e=>e.length>1),vert:[...a(r,`vertical`).values()].filter(e=>e.length>1)}}).reduce(([e,t],{horiz:n,vert:r})=>[[...e,...n],[...t,...r]],[[],[]]),c=new Set;i.forEach(e=>e.members.forEach(e=>c.add(e)));let l=n(e=>e.filter(e=>!e.some(e=>c.has(e))),`dropOverlapping`),u=l(o),d=l(s);return i.forEach(e=>{e.members.length<2||(e.direction===`row`?u.push([...e.members]):d.push([...e.members]))}),{horizontal:u,vertical:d}}n(me,`getAlignments`);function he(e,t,r=[]){let i=[],a=t.getConfigField(`iconSize`),o=t.getConfigField(`idealEdgeLengthMultiplier`),s=o*a,c=new Set;r.forEach(e=>{for(let t=0;t`${e[0]},${e[1]}`,`posToStr`),u=n(e=>e.split(`,`).map(e=>parseInt(e)),`strToPos`);return e.forEach(e=>{let t=new Map([...e.entries()].map(([e,t])=>[l(t),e])),n=[l([0,0])],r={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;n.length>0;){let e=n.shift();if(e){r[e]=1;let d=t.get(e);if(d){let f=u(e);Object.entries(s).forEach(([e,s])=>{let u=l([f[0]+s[0],f[1]+s[1]]),p=t.get(u);if(p&&!r[u]){if(n.push(u),c.has(`${d}|${p}`))return;i.push({[A[e]]:p,[A[N(e)]]:d,gap:o*a})}})}}}}),i}n(he,`getRelativeConstraints`);function ge(e,t,a,o,s,{spatialMaps:c,groupAlignments:l}){return new Promise(u=>{let d=i(`body`).append(`div`).attr(`id`,`cy`).attr(`style`,`display:none`),f=E({container:document.getElementById(`cy`),style:[{selector:`edge`,style:{"curve-style":`straight`,"source-endpoint":`data(sourceEndpoint)`,"target-endpoint":`data(targetEndpoint)`}},{selector:`edge[label]`,style:{label:`data(label)`}},{selector:`edge.segments`,style:{"curve-style":`segments`,"segment-weights":`0`,"segment-distances":[.5],"edge-distances":`endpoints`,"source-endpoint":`data(sourceEndpoint)`,"target-endpoint":`data(targetEndpoint)`}},{selector:`node`,style:{"compound-sizing-wrt-labels":`include`}},{selector:`node[label]`,style:{"text-valign":`bottom`,"text-halign":`center`,"font-size":`${s.getConfigField(`fontSize`)}px`}},{selector:`.node-service`,style:{label:`data(label)`,width:`data(width)`,height:`data(height)`}},{selector:`.node-junction`,style:{width:`data(width)`,height:`data(height)`}},{selector:`.node-group`,style:{padding:`${s.getConfigField(`padding`)}px`}}],layout:{name:`grid`,boundingBox:{x1:0,x2:100,y1:0,y2:100}}});d.remove(),fe(a,f),le(e,f,s),ue(t,f,s),pe(o,f);let p=s.getLayoutHints(),m=me(s,c,l,p),h=he(c,s,p),g=s.getConfigField(`iconSize`),_=s.getConfigField(`idealEdgeLengthMultiplier`)*g,v=.5*g,y=s.getConfigField(`edgeElasticity`),b=s.getConfigField(`seed`),x=f.layout({name:`fcose`,quality:`proof`,randomize:s.getConfigField(`randomize`),nodeSeparation:s.getConfigField(`nodeSeparation`),numIter:s.getConfigField(`numIter`),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(e){let[t,n]=e.connectedNodes(),{parent:r}=W(t),{parent:i}=W(n);return r===i?_:v},edgeElasticity(e){let[t,n]=e.connectedNodes(),{parent:r}=W(t),{parent:i}=W(n);return r===i?y:.001},alignmentConstraint:m,relativePlacementConstraint:h});x.one(`layoutstop`,()=>{function e(e,t,n,r){let i,a,{x:o,y:s}=e,{x:c,y:l}=t;a=(r-s+(o-n)*(s-l)/(o-c))/Math.sqrt(1+((s-l)/(o-c))**2),i=Math.sqrt((r-s)**2+(n-o)**2-a**2);let u=Math.sqrt((c-o)**2+(l-s)**2);i/=u;let d=(c-o)*(r-s)-(l-s)*(n-o);switch(!0){case d>=0:d=1;break;case d<0:d=-1}let f=(c-o)*(n-o)+(l-s)*(r-s);switch(!0){case f>=0:f=1;break;case f<0:f=-1}return a=Math.abs(a)*d,i*=f,{distances:a,weights:i}}n(e,`getSegmentWeights`),f.startBatch();for(let t of Object.values(f.edges()))if(t.data?.()){let{x:n,y:r}=t.source().position(),{x:i,y:a}=t.target().position();if(n!==i&&r!==a){let n=t.sourceEndpoint(),r=t.targetEndpoint(),{sourceDir:i}=U(t),[a,o]=I(i)?[n.x,r.y]:[r.x,n.y],{weights:s,distances:c}=e(n,r,a,o);t.style(`segment-distances`,c),t.style(`segment-weights`,s)}}f.endBatch(),J(b,()=>x.run())});try{J(b,()=>x.run())}catch(e){throw e instanceof RangeError&&e.message.includes(`Invalid array length`)?Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):e}f.ready(e=>{r.info(`Ready`,e),u(f)})})}n(ge,`layoutArchitecture`);var _e={parser:q,get db(){return new ie},renderer:{draw:n(async(e,t,n,r)=>{let i=r.db;i.setDiagramId(t);let a=i.getServices(),o=i.getJunctions(),c=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),d=y(t),f=d.append(`g`);f.attr(`class`,`architecture-edges`);let p=d.append(`g`);p.attr(`class`,`architecture-services`);let m=d.append(`g`);m.attr(`class`,`architecture-groups`),await se(i,p,a,t),ce(i,p,o,t);let h=await ge(a,o,c,l,i,u);await oe(f,h,i,t),await Z(m,h,i,t),de(i,h),s(void 0,d,i.getConfigField(`padding`),i.getConfigField(`useMaxWidth`))},`draw`)},styles:ae};export{_e as diagram}; \ No newline at end of file + `)}}}}}))},`drawEdges`),Z=n(async function(e,t,n,r){let i=n.getConfigField(`padding`)*.75,a=n.getConfigField(`fontSize`),o=n.getConfigField(`iconSize`)/2;await Promise.all(t.nodes().map(async t=>{let s=W(t);if(s.type===`group`){let{h:c,w:l,x1:u,y1:d}=t.boundingBox(),f=e.append(`rect`);f.attr(`id`,`${r}-group-${s.id}`).attr(`x`,u+o).attr(`y`,d+o).attr(`width`,l).attr(`height`,c).attr(`class`,`node-bkg`);let p=e.append(`g`),h=u,g=d;if(s.icon){let e=p.append(`g`);e.html(`${await S(s.icon,{height:i,width:i,fallbackPrefix:X.prefix})}`),e.attr(`transform`,`translate(`+(h+o+1)+`, `+(g+o+1)+`)`),h+=i,g+=a/2-1-2}if(s.label){let e=p.append(`g`);await C(e,s.label,{useHtmlLabels:!1,width:l,classes:`architecture-service-label`},m()),e.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`start`).attr(`text-anchor`,`start`),e.attr(`transform`,`translate(`+(h+o+4)+`, `+(g+o+2)+`)`)}n.setElementForId(s.id,f)}}))},`drawGroups`),se=n(async function(e,t,n,r){let i=m();for(let a of n){let n=t.append(`g`),o=e.getConfigField(`iconSize`);if(a.title){let e=n.append(`g`);await C(e,a.title,{useHtmlLabels:!1,width:o*1.5,classes:`architecture-service-label`},i),e.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`),e.attr(`transform`,`translate(`+o/2+`, `+o+`)`)}let s=n.append(`g`);if(a.icon)s.html(`${await S(a.icon,{height:o,width:o,fallbackPrefix:X.prefix})}`);else if(a.iconText){s.html(`${await S(`blank`,{height:o,width:o,fallbackPrefix:X.prefix})}`);let e=s.append(`g`).append(`foreignObject`).attr(`width`,o).attr(`height`,o).append(`div`).attr(`class`,`node-icon-text`).attr(`style`,`height: ${o}px;`).append(`div`).html(g(a.iconText,i)),t=parseInt(window.getComputedStyle(e.node(),null).getPropertyValue(`font-size`).replace(/\D/g,``))??16;e.attr(`style`,`-webkit-line-clamp: ${Math.floor((o-2)/t)};`)}else s.append(`path`).attr(`class`,`node-bkg`).attr(`id`,`${r}-node-${a.id}`).attr(`d`,`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);n.attr(`id`,`${r}-service-${a.id}`).attr(`class`,`architecture-service`);let{width:c,height:l}=n.node().getBBox();a.width=c,a.height=l,e.setElementForId(a.id,n)}return 0},`drawServices`),ce=n(function(e,t,n,r){n.forEach(n=>{let i=t.append(`g`),a=e.getConfigField(`iconSize`);i.append(`g`).append(`rect`).attr(`id`,`${r}-node-${n.id}`).attr(`fill-opacity`,`0`).attr(`width`,a).attr(`height`,a),i.attr(`class`,`architecture-junction`);let{width:o,height:s}=i._groups[0][0].getBBox();i.width=o,i.height=s,e.setElementForId(n.id,i)})},`drawJunctions`);x([{name:X.prefix,icons:X}]),E.use(k.default);function le(e,t,n){e.forEach(e=>{t.add({group:`nodes`,data:{type:`service`,id:e.id,icon:e.icon,label:e.title,parent:e.in,width:n.getConfigField(`iconSize`),height:n.getConfigField(`iconSize`)},classes:`node-service`})})}n(le,`addServices`);function ue(e,t,n){e.forEach(e=>{t.add({group:`nodes`,data:{type:`junction`,id:e.id,parent:e.in,width:n.getConfigField(`iconSize`),height:n.getConfigField(`iconSize`)},classes:`node-junction`})})}n(ue,`addJunctions`);function de(e,t){t.nodes().map(t=>{let n=W(t);n.type!==`group`&&(n.x=t.position().x,n.y=t.position().y,e.getElementById(n.id).attr(`transform`,`translate(`+(n.x||0)+`,`+(n.y||0)+`)`))})}n(de,`positionNodes`);function fe(e,t){e.forEach(e=>{t.add({group:`nodes`,data:{type:`group`,id:e.id,icon:e.icon,label:e.title,parent:e.in},classes:`node-group`})})}n(fe,`addGroups`);function pe(e,t){e.forEach(e=>{let{lhsId:n,rhsId:r,lhsInto:i,lhsGroup:a,rhsInto:o,lhsDir:s,rhsDir:c,rhsGroup:l,title:u}=e,d=L(e.lhsDir,e.rhsDir)?`segments`:`straight`,f={id:`${n}-${r}`,label:u,source:n,sourceDir:s,sourceArrow:i,sourceGroup:a,sourceEndpoint:s===`L`?`0 50%`:s===`R`?`100% 50%`:s===`T`?`50% 0`:`50% 100%`,target:r,targetDir:c,targetArrow:o,targetGroup:l,targetEndpoint:c===`L`?`0 50%`:c===`R`?`100% 50%`:c===`T`?`50% 0`:`50% 100%`};t.add({group:`edges`,data:f,classes:d})})}n(pe,`addEdges`);function me(e,t,r,i=[]){let a=n((e,t)=>{let n=new Map;for(let[i,a]of e.entries()){let e=`${i}`,o=0,s=[...a.entries()];if(s.length===1){n.set(e,s[0][1]);continue}for(let i=0;i{let n=new Map,r=new Map;return t.forEach(([t,i],a)=>{let o=e.getNode(a)?.in??`default`,s=n.get(i)??new Map;n.has(i)||n.set(i,s);let c=r.get(t)??new Map;r.has(t)||r.set(t,c);for(let e of[s,c]){let t=e.get(o)??[];e.has(o)||e.set(o,t),t.push(a)}}),{horiz:[...a(n,`horizontal`).values()].filter(e=>e.length>1),vert:[...a(r,`vertical`).values()].filter(e=>e.length>1)}}).reduce(([e,t],{horiz:n,vert:r})=>[[...e,...n],[...t,...r]],[[],[]]),c=new Set;i.forEach(e=>e.members.forEach(e=>c.add(e)));let l=n(e=>e.filter(e=>!e.some(e=>c.has(e))),`dropOverlapping`),u=l(o),d=l(s);return i.forEach(e=>{e.members.length<2||(e.direction===`row`?u.push([...e.members]):d.push([...e.members]))}),{horizontal:u,vertical:d}}n(me,`getAlignments`);function he(e,t,r=[]){let i=[],a=t.getConfigField(`iconSize`),o=t.getConfigField(`idealEdgeLengthMultiplier`),s=o*a,c=new Set;r.forEach(e=>{for(let t=0;t`${e[0]},${e[1]}`,`posToStr`),u=n(e=>e.split(`,`).map(e=>parseInt(e)),`strToPos`);return e.forEach(e=>{let t=new Map([...e.entries()].map(([e,t])=>[l(t),e])),n=[l([0,0])],r={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;n.length>0;){let e=n.shift();if(e){r[e]=1;let d=t.get(e);if(d){let f=u(e);Object.entries(s).forEach(([e,s])=>{let u=l([f[0]+s[0],f[1]+s[1]]),p=t.get(u);if(p&&!r[u]){if(n.push(u),c.has(`${d}|${p}`))return;i.push({[A[e]]:p,[A[N(e)]]:d,gap:o*a})}})}}}}),i}n(he,`getRelativeConstraints`);function ge(e,t,a,o,s,{spatialMaps:c,groupAlignments:l}){return new Promise(u=>{let d=i(`body`).append(`div`).attr(`id`,`cy`).attr(`style`,`display:none`),f=E({container:document.getElementById(`cy`),style:[{selector:`edge`,style:{"curve-style":`straight`,"source-endpoint":`data(sourceEndpoint)`,"target-endpoint":`data(targetEndpoint)`}},{selector:`edge[label]`,style:{label:`data(label)`}},{selector:`edge.segments`,style:{"curve-style":`segments`,"segment-weights":`0`,"segment-distances":[.5],"edge-distances":`endpoints`,"source-endpoint":`data(sourceEndpoint)`,"target-endpoint":`data(targetEndpoint)`}},{selector:`node`,style:{"compound-sizing-wrt-labels":`include`}},{selector:`node[label]`,style:{"text-valign":`bottom`,"text-halign":`center`,"font-size":`${s.getConfigField(`fontSize`)}px`}},{selector:`.node-service`,style:{label:`data(label)`,width:`data(width)`,height:`data(height)`}},{selector:`.node-junction`,style:{width:`data(width)`,height:`data(height)`}},{selector:`.node-group`,style:{padding:`${s.getConfigField(`padding`)}px`}}],layout:{name:`grid`,boundingBox:{x1:0,x2:100,y1:0,y2:100}}});d.remove(),fe(a,f),le(e,f,s),ue(t,f,s),pe(o,f);let p=s.getLayoutHints(),m=me(s,c,l,p),h=he(c,s,p),g=s.getConfigField(`iconSize`),_=s.getConfigField(`idealEdgeLengthMultiplier`)*g,v=.5*g,y=s.getConfigField(`edgeElasticity`),b=s.getConfigField(`seed`),x=f.layout({name:`fcose`,quality:`proof`,randomize:s.getConfigField(`randomize`),nodeSeparation:s.getConfigField(`nodeSeparation`),numIter:s.getConfigField(`numIter`),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(e){let[t,n]=e.connectedNodes(),{parent:r}=W(t),{parent:i}=W(n);return r===i?_:v},edgeElasticity(e){let[t,n]=e.connectedNodes(),{parent:r}=W(t),{parent:i}=W(n);return r===i?y:.001},alignmentConstraint:m,relativePlacementConstraint:h});x.one(`layoutstop`,()=>{function e(e,t,n,r){let i,a,{x:o,y:s}=e,{x:c,y:l}=t;a=(r-s+(o-n)*(s-l)/(o-c))/Math.sqrt(1+((s-l)/(o-c))**2),i=Math.sqrt((r-s)**2+(n-o)**2-a**2);let u=Math.sqrt((c-o)**2+(l-s)**2);i/=u;let d=(c-o)*(r-s)-(l-s)*(n-o);switch(!0){case d>=0:d=1;break;case d<0:d=-1}let f=(c-o)*(n-o)+(l-s)*(r-s);switch(!0){case f>=0:f=1;break;case f<0:f=-1}return a=Math.abs(a)*d,i*=f,{distances:a,weights:i}}n(e,`getSegmentWeights`),f.startBatch();for(let t of Object.values(f.edges()))if(t.data?.()){let{x:n,y:r}=t.source().position(),{x:i,y:a}=t.target().position();if(n!==i&&r!==a){let n=t.sourceEndpoint(),r=t.targetEndpoint(),{sourceDir:i}=U(t),[a,o]=I(i)?[n.x,r.y]:[r.x,n.y],{weights:s,distances:c}=e(n,r,a,o);t.style(`segment-distances`,c),t.style(`segment-weights`,s)}}f.endBatch(),J(b,()=>x.run())});try{J(b,()=>x.run())}catch(e){throw e instanceof RangeError&&e.message.includes(`Invalid array length`)?Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):e}f.ready(e=>{r.info(`Ready`,e),u(f)})})}n(ge,`layoutArchitecture`);var _e={parser:q,get db(){return new ie},renderer:{draw:n(async(e,t,n,r)=>{let i=r.db;i.setDiagramId(t);let a=i.getServices(),o=i.getJunctions(),c=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),d=y(t),f=d.append(`g`);f.attr(`class`,`architecture-edges`);let p=d.append(`g`);p.attr(`class`,`architecture-services`);let m=d.append(`g`);m.attr(`class`,`architecture-groups`),await se(i,p,a,t),ce(i,p,o,t);let h=await ge(a,o,c,l,i,u);await oe(f,h,i,t),await Z(m,h,i,t),de(i,h),s(void 0,d,i.getConfigField(`padding`),i.getConfigField(`useMaxWidth`))},`draw`)},styles:ae};export{_e as diagram}; \ No newline at end of file diff --git a/web/dist/app-blockDiagram-BEXU5L5S.js b/web/dist/app-blockDiagram-BEXU5L5S.js index b61fbc5ee..571efdf08 100644 --- a/web/dist/app-blockDiagram-BEXU5L5S.js +++ b/web/dist/app-blockDiagram-BEXU5L5S.js @@ -1,9 +1,9 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{a as r,b as i,c as a,it as o,s,x as c}from"./app-chunk-O7XYJQB3.js";import{t as l}from"./app-channel.js";import{A as u,B as d,C as f,D as p,E as m,F as h,G as g,H as _,I as v,L as y,M as b,N as x,O as S,P as C,R as w,T,U as E,V as D,W as O,b as k,j as A,k as j,l as M,v as ee,w as te,z as ne}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{t as re}from"./app-chunk-5VM5RSS4.js";import{t as ie}from"./app-chunk-DUW6YSOI.js";import"./app-chunk-7PRAP22T.js";import{i as ae,n as oe,o as se,r as ce,s as le}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import{i as ue,r as de}from"./app-chunk-5DYCD2WN.js";import{a as fe,c as pe,i as me,l as he}from"./app-chunk-Z7XXMR3K.js";import{t as ge}from"./app-graphlib.js";function _e(e){return Array.isArray(e)}function ve(e){if(k(e))return e;let t=g(e);if(!ye(e))return{};if(_e(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(ee(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?xe(r,e):N(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return N(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Se(n,e),N(n,e),be(n,e),n}function ye(e){switch(g(e)){case f:case T:case te:case p:case m:case S:case j:case u:case x:case A:case b:case C:case h:case v:case y:case w:case ne:case d:case E:case O:case D:case _:return!0;default:return!1}}function N(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function be(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r=n)&&(e[r]=t[r])}function Se(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}var P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,15],r=[1,7],i=[1,13],a=[1,14],o=[1,19],s=[1,16],c=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],p=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],h=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],_={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACELINE`,5:`NL`,7:`SPACE`,8:`EOF`,10:`BLOCK_DIAGRAM_KEY`,15:`LINK`,16:`START_LINK`,17:`LINK_LABEL`,18:`STR`,21:`SPACE_BLOCK`,27:`SIZE`,28:`COLUMNS`,29:`id-block`,30:`end`,31:`NODE_ID`,34:`DIR`,35:`NODE_DSTART`,36:`NODE_DEND`,37:`BLOCK_ARROW_START`,38:`BLOCK_ARROW_END`,39:`classDef`,40:`CLASSDEF_ID`,41:`CLASSDEF_STYLEOPTS`,42:`DEFAULT`,43:`class`,44:`CLASSENTITY_IDS`,45:`STYLECLASS`,46:`style`,47:`STYLE_ENTITY_IDS`,48:`STYLE_DEFINITION_DATA`},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug(`Rule: separator (NL) `);break;case 5:r.getLogger().debug(`Rule: separator (Space) `);break;case 6:r.getLogger().debug(`Rule: separator (EOF) `);break;case 7:r.getLogger().debug(`Rule: hierarchy: `,a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug(`Stop NL `);break;case 9:r.getLogger().debug(`Stop EOF `);break;case 10:r.getLogger().debug(`Stop NL2 `);break;case 11:r.getLogger().debug(`Stop EOF2 `);break;case 12:r.getLogger().debug(`Rule: statement: `,a[s]),this.$=typeof a[s].length==`number`?a[s]:[a[s]];break;case 13:r.getLogger().debug(`Rule: statement #2: `,a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug(`Rule: link: `,a[s],e),this.$={edgeTypeStr:a[s],label:``};break;case 15:r.getLogger().debug(`Rule: LABEL link: `,a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:let t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:`space`,label:``,width:t,children:[]};break;case 23:r.getLogger().debug(`Rule: (nodeStatement link node) `,a[s-2],a[s-1],a[s],` typestr: `,a[s-1].edgeTypeStr);let i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr),o=r.edgeStrToEdgeStartData(a[s-1].edgeTypeStr),c=r.edgeStrToThickness(a[s-1].edgeTypeStr),l=r.edgeStrToPattern(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+`-`+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:`edge`,thickness:c,pattern:l,directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug(`Rule: nodeStatement (abc88 node size) `,a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug(`Rule: nodeStatement (node) `,a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug(`APA123`,this?this:`na`),r.getLogger().debug(`COLUMNS: `,a[s]),this.$={type:`column-setting`,columns:a[s]===`auto`?-1:parseInt(a[s])};break;case 27:r.getLogger().debug(`Rule: id-block statement : `,a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:`composite`,children:a[s-1]};break;case 28:r.getLogger().debug(`Rule: blockStatement : `,a[s-2],a[s-1],a[s]);let u=r.generateId();this.$={id:u,type:`composite`,label:``,children:a[s-1]};break;case 29:r.getLogger().debug(`Rule: node (NODE_ID separator): `,a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug(`Rule: node (NODE_ID nodeShapeNLabel separator): `,a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug(`Rule: dirList: `,a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug(`Rule: dirList: `,a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug(`Rule: nodeShapeNLabel: `,a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug(`Rule: BLOCK_ARROW nodeShapeNLabel: `,a[s-3],a[s-2],` #3:`,a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:`classDef`,id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:`applyStyles`,id:a[s-1].trim(),stylesStr:a[s].trim()}}},`anonymous`),table:[{9:1,10:[1,2]},{1:[3]},{10:n,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:n,21:r,28:i,29:a,31:o,39:s,43:c,46:l}),t(d,[2,16],{14:22,15:f,16:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(m,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:o},{10:n,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(h,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},t(m,[2,24]),{10:n,11:37,13:4,14:22,15:f,16:p,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(h,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},t(d,[2,27]),t(h,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},t(h,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{a as r,b as i,c as a,it as o,s,x as c}from"./app-chunk-O7XYJQB3.js";import{t as l}from"./app-channel.js";import{A as u,B as d,C as f,D as p,E as m,F as h,G as g,H as _,I as v,L as y,M as b,N as x,O as S,P as C,R as w,T,U as E,V as D,W as O,b as k,j as A,k as j,l as M,v as ee,w as te,z as ne}from"./app-chunk-ZIGJFQKS.js";import{t as re}from"./app-chunk-DUW6YSOI.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{i as ie,n as ae,o as oe,r as se,s as ce}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import{i as le,r as ue}from"./app-chunk-5DYCD2WN.js";import{a as de,c as fe,i as pe,l as me}from"./app-chunk-Z7XXMR3K.js";import{t as he}from"./app-chunk-5VM5RSS4.js";import{t as ge}from"./app-graphlib.js";function _e(e){return Array.isArray(e)}function ve(e){if(k(e))return e;let t=g(e);if(!ye(e))return{};if(_e(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(ee(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?xe(r,e):N(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return N(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Se(n,e),N(n,e),be(n,e),n}function ye(e){switch(g(e)){case f:case T:case te:case p:case m:case S:case j:case u:case x:case A:case b:case C:case h:case v:case y:case w:case ne:case d:case E:case O:case D:case _:return!0;default:return!1}}function N(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function be(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r=n)&&(e[r]=t[r])}function Se(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}var P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,15],r=[1,7],i=[1,13],a=[1,14],o=[1,19],s=[1,16],c=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],p=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],h=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],_={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACELINE`,5:`NL`,7:`SPACE`,8:`EOF`,10:`BLOCK_DIAGRAM_KEY`,15:`LINK`,16:`START_LINK`,17:`LINK_LABEL`,18:`STR`,21:`SPACE_BLOCK`,27:`SIZE`,28:`COLUMNS`,29:`id-block`,30:`end`,31:`NODE_ID`,34:`DIR`,35:`NODE_DSTART`,36:`NODE_DEND`,37:`BLOCK_ARROW_START`,38:`BLOCK_ARROW_END`,39:`classDef`,40:`CLASSDEF_ID`,41:`CLASSDEF_STYLEOPTS`,42:`DEFAULT`,43:`class`,44:`CLASSENTITY_IDS`,45:`STYLECLASS`,46:`style`,47:`STYLE_ENTITY_IDS`,48:`STYLE_DEFINITION_DATA`},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug(`Rule: separator (NL) `);break;case 5:r.getLogger().debug(`Rule: separator (Space) `);break;case 6:r.getLogger().debug(`Rule: separator (EOF) `);break;case 7:r.getLogger().debug(`Rule: hierarchy: `,a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug(`Stop NL `);break;case 9:r.getLogger().debug(`Stop EOF `);break;case 10:r.getLogger().debug(`Stop NL2 `);break;case 11:r.getLogger().debug(`Stop EOF2 `);break;case 12:r.getLogger().debug(`Rule: statement: `,a[s]),this.$=typeof a[s].length==`number`?a[s]:[a[s]];break;case 13:r.getLogger().debug(`Rule: statement #2: `,a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug(`Rule: link: `,a[s],e),this.$={edgeTypeStr:a[s],label:``};break;case 15:r.getLogger().debug(`Rule: LABEL link: `,a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:let t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:`space`,label:``,width:t,children:[]};break;case 23:r.getLogger().debug(`Rule: (nodeStatement link node) `,a[s-2],a[s-1],a[s],` typestr: `,a[s-1].edgeTypeStr);let i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr),o=r.edgeStrToEdgeStartData(a[s-1].edgeTypeStr),c=r.edgeStrToThickness(a[s-1].edgeTypeStr),l=r.edgeStrToPattern(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+`-`+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:`edge`,thickness:c,pattern:l,directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug(`Rule: nodeStatement (abc88 node size) `,a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug(`Rule: nodeStatement (node) `,a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug(`APA123`,this?this:`na`),r.getLogger().debug(`COLUMNS: `,a[s]),this.$={type:`column-setting`,columns:a[s]===`auto`?-1:parseInt(a[s])};break;case 27:r.getLogger().debug(`Rule: id-block statement : `,a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:`composite`,children:a[s-1]};break;case 28:r.getLogger().debug(`Rule: blockStatement : `,a[s-2],a[s-1],a[s]);let u=r.generateId();this.$={id:u,type:`composite`,label:``,children:a[s-1]};break;case 29:r.getLogger().debug(`Rule: node (NODE_ID separator): `,a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug(`Rule: node (NODE_ID nodeShapeNLabel separator): `,a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug(`Rule: dirList: `,a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug(`Rule: dirList: `,a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug(`Rule: nodeShapeNLabel: `,a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug(`Rule: BLOCK_ARROW nodeShapeNLabel: `,a[s-3],a[s-2],` #3:`,a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:`classDef`,id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:`applyStyles`,id:a[s-1].trim(),stylesStr:a[s].trim()}}},`anonymous`),table:[{9:1,10:[1,2]},{1:[3]},{10:n,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:n,21:r,28:i,29:a,31:o,39:s,43:c,46:l}),t(d,[2,16],{14:22,15:f,16:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(m,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:o},{10:n,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(h,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},t(m,[2,24]),{10:n,11:37,13:4,14:22,15:f,16:p,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(h,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},t(d,[2,27]),t(h,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},t(h,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};_.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:e(function(e,t,n,r){switch(n){case 0:return e.getLogger().debug(`Found block-beta`),10;case 1:return e.getLogger().debug(`Found id-block`),29;case 2:return e.getLogger().debug(`Found block`),10;case 3:e.getLogger().debug(`.`,t.yytext);break;case 4:e.getLogger().debug(`_`,t.yytext);break;case 5:return 5;case 6:return t.yytext=-1,28;case 7:return t.yytext=t.yytext.replace(/columns\s+/,``),e.getLogger().debug(`COLUMNS (LEX)`,t.yytext),28;case 8:this.pushState(`md_string`);break;case 9:return`MD_STR`;case 10:this.popState();break;case 11:this.pushState(`string`);break;case 12:e.getLogger().debug(`LEX: POPPING STR:`,t.yytext),this.popState();break;case 13:return e.getLogger().debug(`LEX: STR end:`,t.yytext),`STR`;case 14:return t.yytext=t.yytext.replace(/space\:/,``),e.getLogger().debug(`SPACE NUM (LEX)`,t.yytext),21;case 15:return t.yytext=`1`,e.getLogger().debug(`COLUMNS (LEX)`,t.yytext),21;case 16:return 42;case 17:return`LINKSTYLE`;case 18:return`INTERPOLATE`;case 19:return this.pushState(`CLASSDEF`),39;case 20:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 21:return this.popState(),this.pushState(`CLASSDEFID`),40;case 22:return this.popState(),41;case 23:return this.pushState(`CLASS`),43;case 24:return this.popState(),this.pushState(`CLASS_STYLE`),44;case 25:return this.popState(),45;case 26:return this.pushState(`STYLE_STMNT`),46;case 27:return this.popState(),this.pushState(`STYLE_DEFINITION`),47;case 28:return this.popState(),48;case 29:return this.pushState(`acc_title`),`acc_title`;case 30:return this.popState(),`acc_title_value`;case 31:return this.pushState(`acc_descr`),`acc_descr`;case 32:return this.popState(),`acc_descr_value`;case 33:this.pushState(`acc_descr_multiline`);break;case 34:this.popState();break;case 35:return`acc_descr_multiline_value`;case 36:return 30;case 37:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 38:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 39:return this.popState(),e.getLogger().debug(`Lex: ))`),`NODE_DEND`;case 40:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 41:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 42:return this.popState(),e.getLogger().debug(`Lex: (-`),`NODE_DEND`;case 43:return this.popState(),e.getLogger().debug(`Lex: -)`),`NODE_DEND`;case 44:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 45:return this.popState(),e.getLogger().debug(`Lex: ]]`),`NODE_DEND`;case 46:return this.popState(),e.getLogger().debug(`Lex: (`),`NODE_DEND`;case 47:return this.popState(),e.getLogger().debug(`Lex: ])`),`NODE_DEND`;case 48:return this.popState(),e.getLogger().debug(`Lex: /]`),`NODE_DEND`;case 49:return this.popState(),e.getLogger().debug(`Lex: /]`),`NODE_DEND`;case 50:return this.popState(),e.getLogger().debug(`Lex: )]`),`NODE_DEND`;case 51:return this.popState(),e.getLogger().debug(`Lex: )`),`NODE_DEND`;case 52:return this.popState(),e.getLogger().debug(`Lex: ]>`),`NODE_DEND`;case 53:return this.popState(),e.getLogger().debug(`Lex: ]`),`NODE_DEND`;case 54:return e.getLogger().debug(`Lexa: -)`),this.pushState(`NODE`),35;case 55:return e.getLogger().debug(`Lexa: (-`),this.pushState(`NODE`),35;case 56:return e.getLogger().debug(`Lexa: ))`),this.pushState(`NODE`),35;case 57:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 58:return e.getLogger().debug(`Lex: (((`),this.pushState(`NODE`),35;case 59:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 60:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 61:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 62:return e.getLogger().debug(`Lexc: >`),this.pushState(`NODE`),35;case 63:return e.getLogger().debug(`Lexa: ([`),this.pushState(`NODE`),35;case 64:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 65:return this.pushState(`NODE`),35;case 66:return this.pushState(`NODE`),35;case 67:return this.pushState(`NODE`),35;case 68:return this.pushState(`NODE`),35;case 69:return this.pushState(`NODE`),35;case 70:return this.pushState(`NODE`),35;case 71:return this.pushState(`NODE`),35;case 72:return e.getLogger().debug(`Lexa: [`),this.pushState(`NODE`),35;case 73:return this.pushState(`BLOCK_ARROW`),e.getLogger().debug(`LEX ARR START`),37;case 74:return e.getLogger().debug(`Lex: NODE_ID`,t.yytext),31;case 75:return e.getLogger().debug(`Lex: EOF`,t.yytext),8;case 76:this.pushState(`md_string`);break;case 77:this.pushState(`md_string`);break;case 78:return`NODE_DESCR`;case 79:this.popState();break;case 80:e.getLogger().debug(`Lex: Starting string`),this.pushState(`string`);break;case 81:e.getLogger().debug(`LEX ARR: Starting string`),this.pushState(`string`);break;case 82:return e.getLogger().debug(`LEX: NODE_DESCR:`,t.yytext),`NODE_DESCR`;case 83:e.getLogger().debug(`LEX POPPING`),this.popState();break;case 84:e.getLogger().debug(`Lex: =>BAE`),this.pushState(`ARROW_DIR`);break;case 85:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (right): dir:`,t.yytext),`DIR`;case 86:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (left):`,t.yytext),`DIR`;case 87:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (x):`,t.yytext),`DIR`;case 88:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (y):`,t.yytext),`DIR`;case 89:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (up):`,t.yytext),`DIR`;case 90:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (down):`,t.yytext),`DIR`;case 91:return t.yytext=`]>`,e.getLogger().debug(`Lex (ARROW_DIR end):`,t.yytext),this.popState(),this.popState(),`BLOCK_ARROW_END`;case 92:return e.getLogger().debug(`Lex: LINK`,`#`+t.yytext+`#`),15;case 93:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 94:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 95:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 96:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 97:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 98:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 99:this.pushState(`md_string`);break;case 100:return e.getLogger().debug(`Lex: Starting string`),this.pushState(`string`),`LINK_LABEL`;case 101:return this.popState(),e.getLogger().debug(`Lex: LINK`,`#`+t.yytext+`#`),15;case 102:return this.popState(),e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 103:return this.popState(),e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 104:return e.getLogger().debug(`Lex: COLON`,t.yytext),t.yytext=t.yytext.slice(1),27}},`anonymous`),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}}})();function v(){this.yy={}}return e(v,`Parser`),v.prototype=_,_.Parser=v,new v})();P.parser=P;var Ce=P,F=new Map,I=[],L=new Map,R=`color`,z=`fill`,we=`bgFill`,B=`,`,V=new Map,H=``,Te=e(e=>s.sanitizeText(e,c()),`sanitizeText`),Ee=e(function(e,t=``){let n=V.get(e);n||(n={id:e,styles:[],textStyles:[]},V.set(e,n)),t?.split(B).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(R).exec(e)){let e=t.replace(z,we).replace(R,z);n.textStyles.push(e)}n.styles.push(t)})},`addStyleClass`),De=e(function(e,t=``){let n=F.get(e);t!=null&&(n.styles=t.split(B))},`addStyle2Node`),Oe=e(function(e,t){e.split(`,`).forEach(function(e){let n=F.get(e);if(n===void 0){let t=e.trim();n={id:t,type:`na`,children:[]},F.set(t,n)}n.classes||(n.classes=[]),n.classes.push(t)})},`setCssClass`),U=0,ke=e((e,n)=>{let r=e.flat(),i=[],a=r.find(e=>e?.type===`column-setting`)?.columns??-1;for(let e of r){if(typeof a==`number`&&a>0&&e.type!==`column-setting`&&typeof e.widthInColumns==`number`&&e.widthInColumns>a&&t.warn(`Block ${e.id} width ${e.widthInColumns} exceeds configured column width ${a}`),e.label&&=Te(e.label),e.type===`classDef`){Ee(e.id,e.css);continue}if(e.type===`applyClass`){Oe(e.id,e?.styleClass??``);continue}if(e.type===`applyStyles`){e?.stylesStr&&De(e.id,e?.stylesStr);continue}if(e.type===`column-setting`)n.columns=e.columns??-1;else if(e.type===`edge`){let t=(L.get(e.id)??0)+1;L.set(e.id,t),e.id=t+`-`+e.id,I.push(e)}else{e.label||=e.type===`composite`?``:e.id;let t=F.get(e.id);if(t===void 0?(e.type===`composite`&&(e.colorIndex=U++),F.set(e.id,e)):(e.type!==`na`&&(t.type=e.type),e.label!==e.id&&(t.label=e.label)),e.children&&ke(e.children,e),e.type===`space`){let t=e.width??1;for(let n=0;n{t.debug(`Clear called`),r(),G={id:`root`,type:`composite`,children:[],columns:-1},F=new Map([[`root`,G]]),W=[],V=new Map,I=[],L=new Map,H=``,U=0},`clear`);function je(e){switch(t.debug(`typeStr2Type`,e),e){case`[]`:return`square`;case`()`:return t.debug(`we have a round`),`round`;case`(())`:return`circle`;case`>]`:return`rect_left_inv_arrow`;case`{}`:return`diamond`;case`{{}}`:return`hexagon`;case`([])`:return`stadium`;case`[[]]`:return`subroutine`;case`[()]`:return`cylinder`;case`((()))`:return`doublecircle`;case`[//]`:return`lean_right`;case`[\\\\]`:return`lean_left`;case`[/\\]`:return`trapezoid`;case`[\\/]`:return`inv_trapezoid`;case`<[]>`:return`block_arrow`;default:return`na`}}e(je,`typeStr2Type`);function Me(e){switch(t.debug(`typeStr2Type`,e),e){case`==`:return`thick`;default:return`normal`}}e(Me,`edgeTypeStr2Type`);function Ne(e){switch(e.trim().slice(-1)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`>`:return`arrow_point`;default:return``}}e(Ne,`edgeStrToEdgeData`);function Pe(e){switch(e.trim().charAt(0)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`<`:return`arrow_point`;default:return`arrow_open`}}e(Pe,`edgeStrToEdgeStartData`);function Fe(e){return e.includes(`==`)?`thick`:`normal`}e(Fe,`edgeStrToThickness`);function Ie(e){return e.includes(`.-`)?`dotted`:`solid`}e(Ie,`edgeStrToPattern`);var Le=0,Re={getConfig:e(()=>i().block,`getConfig`),typeStr2Type:je,edgeTypeStr2Type:Me,edgeStrToEdgeData:Ne,edgeStrToEdgeStartData:Pe,edgeStrToThickness:Fe,edgeStrToPattern:Ie,getLogger:e(()=>t,`getLogger`),getBlocksFlat:e(()=>[...F.values()],`getBlocksFlat`),getBlocks:e(()=>W||[],`getBlocks`),getEdges:e(()=>I,`getEdges`),setHierarchy:e(e=>{G.children=e,ke(e,G),W=G.children},`setHierarchy`),getBlock:e(e=>F.get(e),`getBlock`),setBlock:e(e=>{F.set(e.id,e)},`setBlock`),getColumns:e(e=>{let t=F.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},`getColumns`),getClasses:e(function(){return V},`getClasses`),clear:Ae,generateId:e(()=>(Le++,`id-`+Math.random().toString(36).substr(2,12)+`-`+Le),`generateId`),setDiagramId:e(e=>{H=e},`setDiagramId`),getDiagramId:e(()=>H,`getDiagramId`)},ze=e(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!ae(t,r))return``;let i=se(e.look),a=ce(n),o=``;for(let t=0;t0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:e(function(e,t,n,r){switch(n){case 0:return e.getLogger().debug(`Found block-beta`),10;case 1:return e.getLogger().debug(`Found id-block`),29;case 2:return e.getLogger().debug(`Found block`),10;case 3:e.getLogger().debug(`.`,t.yytext);break;case 4:e.getLogger().debug(`_`,t.yytext);break;case 5:return 5;case 6:return t.yytext=-1,28;case 7:return t.yytext=t.yytext.replace(/columns\s+/,``),e.getLogger().debug(`COLUMNS (LEX)`,t.yytext),28;case 8:this.pushState(`md_string`);break;case 9:return`MD_STR`;case 10:this.popState();break;case 11:this.pushState(`string`);break;case 12:e.getLogger().debug(`LEX: POPPING STR:`,t.yytext),this.popState();break;case 13:return e.getLogger().debug(`LEX: STR end:`,t.yytext),`STR`;case 14:return t.yytext=t.yytext.replace(/space\:/,``),e.getLogger().debug(`SPACE NUM (LEX)`,t.yytext),21;case 15:return t.yytext=`1`,e.getLogger().debug(`COLUMNS (LEX)`,t.yytext),21;case 16:return 42;case 17:return`LINKSTYLE`;case 18:return`INTERPOLATE`;case 19:return this.pushState(`CLASSDEF`),39;case 20:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 21:return this.popState(),this.pushState(`CLASSDEFID`),40;case 22:return this.popState(),41;case 23:return this.pushState(`CLASS`),43;case 24:return this.popState(),this.pushState(`CLASS_STYLE`),44;case 25:return this.popState(),45;case 26:return this.pushState(`STYLE_STMNT`),46;case 27:return this.popState(),this.pushState(`STYLE_DEFINITION`),47;case 28:return this.popState(),48;case 29:return this.pushState(`acc_title`),`acc_title`;case 30:return this.popState(),`acc_title_value`;case 31:return this.pushState(`acc_descr`),`acc_descr`;case 32:return this.popState(),`acc_descr_value`;case 33:this.pushState(`acc_descr_multiline`);break;case 34:this.popState();break;case 35:return`acc_descr_multiline_value`;case 36:return 30;case 37:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 38:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 39:return this.popState(),e.getLogger().debug(`Lex: ))`),`NODE_DEND`;case 40:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 41:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 42:return this.popState(),e.getLogger().debug(`Lex: (-`),`NODE_DEND`;case 43:return this.popState(),e.getLogger().debug(`Lex: -)`),`NODE_DEND`;case 44:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 45:return this.popState(),e.getLogger().debug(`Lex: ]]`),`NODE_DEND`;case 46:return this.popState(),e.getLogger().debug(`Lex: (`),`NODE_DEND`;case 47:return this.popState(),e.getLogger().debug(`Lex: ])`),`NODE_DEND`;case 48:return this.popState(),e.getLogger().debug(`Lex: /]`),`NODE_DEND`;case 49:return this.popState(),e.getLogger().debug(`Lex: /]`),`NODE_DEND`;case 50:return this.popState(),e.getLogger().debug(`Lex: )]`),`NODE_DEND`;case 51:return this.popState(),e.getLogger().debug(`Lex: )`),`NODE_DEND`;case 52:return this.popState(),e.getLogger().debug(`Lex: ]>`),`NODE_DEND`;case 53:return this.popState(),e.getLogger().debug(`Lex: ]`),`NODE_DEND`;case 54:return e.getLogger().debug(`Lexa: -)`),this.pushState(`NODE`),35;case 55:return e.getLogger().debug(`Lexa: (-`),this.pushState(`NODE`),35;case 56:return e.getLogger().debug(`Lexa: ))`),this.pushState(`NODE`),35;case 57:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 58:return e.getLogger().debug(`Lex: (((`),this.pushState(`NODE`),35;case 59:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 60:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 61:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 62:return e.getLogger().debug(`Lexc: >`),this.pushState(`NODE`),35;case 63:return e.getLogger().debug(`Lexa: ([`),this.pushState(`NODE`),35;case 64:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 65:return this.pushState(`NODE`),35;case 66:return this.pushState(`NODE`),35;case 67:return this.pushState(`NODE`),35;case 68:return this.pushState(`NODE`),35;case 69:return this.pushState(`NODE`),35;case 70:return this.pushState(`NODE`),35;case 71:return this.pushState(`NODE`),35;case 72:return e.getLogger().debug(`Lexa: [`),this.pushState(`NODE`),35;case 73:return this.pushState(`BLOCK_ARROW`),e.getLogger().debug(`LEX ARR START`),37;case 74:return e.getLogger().debug(`Lex: NODE_ID`,t.yytext),31;case 75:return e.getLogger().debug(`Lex: EOF`,t.yytext),8;case 76:this.pushState(`md_string`);break;case 77:this.pushState(`md_string`);break;case 78:return`NODE_DESCR`;case 79:this.popState();break;case 80:e.getLogger().debug(`Lex: Starting string`),this.pushState(`string`);break;case 81:e.getLogger().debug(`LEX ARR: Starting string`),this.pushState(`string`);break;case 82:return e.getLogger().debug(`LEX: NODE_DESCR:`,t.yytext),`NODE_DESCR`;case 83:e.getLogger().debug(`LEX POPPING`),this.popState();break;case 84:e.getLogger().debug(`Lex: =>BAE`),this.pushState(`ARROW_DIR`);break;case 85:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (right): dir:`,t.yytext),`DIR`;case 86:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (left):`,t.yytext),`DIR`;case 87:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (x):`,t.yytext),`DIR`;case 88:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (y):`,t.yytext),`DIR`;case 89:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (up):`,t.yytext),`DIR`;case 90:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (down):`,t.yytext),`DIR`;case 91:return t.yytext=`]>`,e.getLogger().debug(`Lex (ARROW_DIR end):`,t.yytext),this.popState(),this.popState(),`BLOCK_ARROW_END`;case 92:return e.getLogger().debug(`Lex: LINK`,`#`+t.yytext+`#`),15;case 93:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 94:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 95:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 96:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 97:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 98:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 99:this.pushState(`md_string`);break;case 100:return e.getLogger().debug(`Lex: Starting string`),this.pushState(`string`),`LINK_LABEL`;case 101:return this.popState(),e.getLogger().debug(`Lex: LINK`,`#`+t.yytext+`#`),15;case 102:return this.popState(),e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 103:return this.popState(),e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 104:return e.getLogger().debug(`Lex: COLON`,t.yytext),t.yytext=t.yytext.slice(1),27}},`anonymous`),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}}})();function v(){this.yy={}}return e(v,`Parser`),v.prototype=_,_.Parser=v,new v})();P.parser=P;var Ce=P,F=new Map,I=[],L=new Map,R=`color`,z=`fill`,we=`bgFill`,B=`,`,V=new Map,H=``,Te=e(e=>s.sanitizeText(e,c()),`sanitizeText`),Ee=e(function(e,t=``){let n=V.get(e);n||(n={id:e,styles:[],textStyles:[]},V.set(e,n)),t?.split(B).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(R).exec(e)){let e=t.replace(z,we).replace(R,z);n.textStyles.push(e)}n.styles.push(t)})},`addStyleClass`),De=e(function(e,t=``){let n=F.get(e);t!=null&&(n.styles=t.split(B))},`addStyle2Node`),Oe=e(function(e,t){e.split(`,`).forEach(function(e){let n=F.get(e);if(n===void 0){let t=e.trim();n={id:t,type:`na`,children:[]},F.set(t,n)}n.classes||(n.classes=[]),n.classes.push(t)})},`setCssClass`),U=0,ke=e((e,n)=>{let r=e.flat(),i=[],a=r.find(e=>e?.type===`column-setting`)?.columns??-1;for(let e of r){if(typeof a==`number`&&a>0&&e.type!==`column-setting`&&typeof e.widthInColumns==`number`&&e.widthInColumns>a&&t.warn(`Block ${e.id} width ${e.widthInColumns} exceeds configured column width ${a}`),e.label&&=Te(e.label),e.type===`classDef`){Ee(e.id,e.css);continue}if(e.type===`applyClass`){Oe(e.id,e?.styleClass??``);continue}if(e.type===`applyStyles`){e?.stylesStr&&De(e.id,e?.stylesStr);continue}if(e.type===`column-setting`)n.columns=e.columns??-1;else if(e.type===`edge`){let t=(L.get(e.id)??0)+1;L.set(e.id,t),e.id=t+`-`+e.id,I.push(e)}else{e.label||=e.type===`composite`?``:e.id;let t=F.get(e.id);if(t===void 0?(e.type===`composite`&&(e.colorIndex=U++),F.set(e.id,e)):(e.type!==`na`&&(t.type=e.type),e.label!==e.id&&(t.label=e.label)),e.children&&ke(e.children,e),e.type===`space`){let t=e.width??1;for(let n=0;n{t.debug(`Clear called`),r(),G={id:`root`,type:`composite`,children:[],columns:-1},F=new Map([[`root`,G]]),W=[],V=new Map,I=[],L=new Map,H=``,U=0},`clear`);function je(e){switch(t.debug(`typeStr2Type`,e),e){case`[]`:return`square`;case`()`:return t.debug(`we have a round`),`round`;case`(())`:return`circle`;case`>]`:return`rect_left_inv_arrow`;case`{}`:return`diamond`;case`{{}}`:return`hexagon`;case`([])`:return`stadium`;case`[[]]`:return`subroutine`;case`[()]`:return`cylinder`;case`((()))`:return`doublecircle`;case`[//]`:return`lean_right`;case`[\\\\]`:return`lean_left`;case`[/\\]`:return`trapezoid`;case`[\\/]`:return`inv_trapezoid`;case`<[]>`:return`block_arrow`;default:return`na`}}e(je,`typeStr2Type`);function Me(e){switch(t.debug(`typeStr2Type`,e),e){case`==`:return`thick`;default:return`normal`}}e(Me,`edgeTypeStr2Type`);function Ne(e){switch(e.trim().slice(-1)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`>`:return`arrow_point`;default:return``}}e(Ne,`edgeStrToEdgeData`);function Pe(e){switch(e.trim().charAt(0)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`<`:return`arrow_point`;default:return`arrow_open`}}e(Pe,`edgeStrToEdgeStartData`);function Fe(e){return e.includes(`==`)?`thick`:`normal`}e(Fe,`edgeStrToThickness`);function Ie(e){return e.includes(`.-`)?`dotted`:`solid`}e(Ie,`edgeStrToPattern`);var Le=0,Re={getConfig:e(()=>i().block,`getConfig`),typeStr2Type:je,edgeTypeStr2Type:Me,edgeStrToEdgeData:Ne,edgeStrToEdgeStartData:Pe,edgeStrToThickness:Fe,edgeStrToPattern:Ie,getLogger:e(()=>t,`getLogger`),getBlocksFlat:e(()=>[...F.values()],`getBlocksFlat`),getBlocks:e(()=>W||[],`getBlocks`),getEdges:e(()=>I,`getEdges`),setHierarchy:e(e=>{G.children=e,ke(e,G),W=G.children},`setHierarchy`),getBlock:e(e=>F.get(e),`getBlock`),setBlock:e(e=>{F.set(e.id,e)},`setBlock`),getColumns:e(e=>{let t=F.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},`getColumns`),getClasses:e(function(){return V},`getClasses`),clear:Ae,generateId:e(()=>(Le++,`id-`+Math.random().toString(36).substr(2,12)+`-`+Le),`generateId`),setDiagramId:e(e=>{H=e},`setDiagramId`),getDiagramId:e(()=>H,`getDiagramId`)},ze=e(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!ie(t,r))return``;let i=oe(e.look),a=se(n),o=``;for(let t=0;t{let n=0,r=0;for(let i of e.children){let{width:e,height:a,x:o,y:s}=i.size??{width:0,height:0,x:0,y:0};if(t.debug(`getMaxChildSize abc95 child:`,i.id,`width:`,e,`height:`,a,`x:`,o,`y:`,s,i.type),i.type===`space`)continue;let c=e/(i.widthInColumns??1);c>n&&(n=c),a>r&&(r=a)}return{width:n,height:r}},`getMaxChildSize`);function J(e,n,r=0,i=0,a=8){t.debug(`setBlockSizes abc95 (start)`,e.id,e?.size?.x,`block width =`,e?.size,`siblingWidth`,r),e?.size?.width||(e.size={width:r,height:i,x:0,y:0});let o=0,s=0;if(e.children?.length>0){for(let t of e.children)J(t,n,0,0,a);let c=Ve(e);o=c.width,s=c.height,t.debug(`setBlockSizes abc95 maxWidth of`,e.id,`:s children is `,o,s);for(let n of e.children)n.size&&(t.debug(`abc95 Setting size of children of ${e.id} id=${n.id} ${o} ${s} ${JSON.stringify(n.size)}`),n.size.width=o*(n.widthInColumns??1)+a*((n.widthInColumns??1)-1),n.size.height=s,n.size.x=0,n.size.y=0,t.debug(`abc95 updating size of ${e.id} children child:${n.id} maxWidth:${o} maxHeight:${s}`));for(let t of e.children)J(t,n,o,s,a);let l=e.columns??-1,u=0;for(let t of e.children)u+=t.widthInColumns??1;let d=e.children.length;l>0&&l0?Math.min(e.children.length,l):e.children.length;if(n>0){let r=(p-n*a-a)/n;t.debug(`abc95 (growing to fit) width`,e.id,p,e.size?.width,r);for(let t of e.children)t.size&&(t.size.width=r)}}e.size={width:p,height:m,x:0,y:0}}t.debug(`setBlockSizes abc94 (done)`,e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}e(J,`setBlockSizes`);function Y(e,n,r=8){t.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);let i=e.columns??-1;if(t.debug(`layoutBlocks columns abc95`,e.id,`=>`,i,e),e.children&&e.children.length>0){let a=e?.children[0]?.size?.width??0,o=e.children.length*a+(e.children.length-1)*r;t.debug(`widthOfChildren 88`,o,`posX`);let s=new Map;{let t=0;for(let n of e.children){if(!n.size)continue;let{py:e}=q(i,t),r=s.get(e)??0;n.size.height>r&&s.set(e,n.size.height);let a=n?.widthInColumns??1;i>0&&(a=Math.min(a,i-t%i)),t+=a}}let c=new Map;{let e=0,t=[...s.keys()].sort((e,t)=>e-t);for(let n of t)c.set(n,e),e+=(s.get(n)??0)+r}let l=0;t.debug(`abc91 block?.size?.x`,e.id,e?.size?.x);let u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,d=0;for(let a of e.children){let o=e;if(!a.size)continue;let{width:f,height:p}=a.size,{px:m,py:h}=q(i,l);if(h!=d&&(d=h,u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,t.debug(`New row in layout for block`,e.id,` and child `,a.id,d)),t.debug(`abc89 layout blocks (child) id: ${a.id} Pos: ${l} (px, py) ${m},${h} (${o?.size?.x},${o?.size?.y}) parent: ${o.id} width: ${f}${r}`),o.size){let e=f/2;a.size.x=u+r+e,t.debug(`abc91 layout blocks (calc) px, pyid:${a.id} startingPos=X${u} new startingPosX${a.size.x} ${e} padding=${r} width=${f} halfWidth=${e} => x:${a.size.x} y:${a.size.y} ${a.widthInColumns} (width * (child?.w || 1)) / 2 ${f*(a?.widthInColumns??1)/2}`),u=a.size.x+e;let n=c.get(h)??0,i=s.get(h)??p;a.size.y=o.size.y-o.size.height/2+n+i/2+r,t.debug(`abc88 layout blocks (calc) px, pyid:${a.id}startingPosX${u}${r}${e}=>x:${a.size.x}y:${a.size.y}${a.widthInColumns}(width * (child?.w || 1)) / 2${f*(a?.widthInColumns??1)/2}`)}a.children&&Y(a,n,r);let g=a?.widthInColumns??1;i>0&&(g=Math.min(g,i-l%i)),l+=g,t.debug(`abc88 columnsPos`,a,l)}}t.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}e(Y,`layoutBlocks`);function X(e,{minX:t,minY:n,maxX:r,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!==`root`){let{x:a,y:o,width:s,height:c}=e.size;a-s/2r&&(r=a+s/2),o+c/2>i&&(i=o+c/2)}if(e.children)for(let a of e.children)({minX:t,minY:n,maxX:r,maxY:i}=X(a,{minX:t,minY:n,maxX:r,maxY:i}));return{minX:t,minY:n,maxX:r,maxY:i}}e(X,`findBounds`);function He(e){let n=e.getBlock(`root`);if(!n)return;let r=c()?.block?.padding??8;J(n,e,0,0,r),Y(n,e,r),t.debug(`getBlocks`,JSON.stringify(n,null,2));let{minX:i,minY:a,maxX:o,maxY:s}=X(n),l=s-a;return{x:i,y:a,width:o-i,height:l}}e(He,`layout`);function Z(e,t,n=!1){let r=e,a=`default`;(r?.classes?.length||0)>0&&(a=(r?.classes??[]).join(` `)),a+=` flowchart-label`;let o=(r?.classes??[]).flatMap(e=>t.getClasses().get(e)?.styles??[]),s=0,c=`rect`,l;switch(r.type){case`round`:s=5,c=`rect`;break;case`composite`:s=0,c=`composite`,l=0;break;case`square`:c=`rect`;break;case`diamond`:c=`question`;break;case`hexagon`:c=`hexagon`;break;case`block_arrow`:c=`block_arrow`;break;case`odd`:c=`rect_left_inv_arrow`;break;case`lean_right`:c=`lean_right`;break;case`lean_left`:c=`lean_left`;break;case`trapezoid`:c=`trapezoid`;break;case`inv_trapezoid`:c=`inv_trapezoid`;break;case`rect_left_inv_arrow`:c=`rect_left_inv_arrow`;break;case`circle`:c=`circle`;break;case`ellipse`:c=`ellipse`;break;case`stadium`:c=`stadium`;break;case`subroutine`:c=`subroutine`;break;case`cylinder`:c=`cylinder`;break;case`group`:c=`rect`;break;case`doublecircle`:c=`doublecircle`;break;default:c=`rect`}let u=M(r?.styles??[]),d=r.label,f=r.size??{width:0,height:0,x:0,y:0},p=t.getDiagramId();return{labelStyle:u.labelStyle,shape:c,label:d,labelText:d,rx:s,ry:s,class:a,cssClasses:a,cssStyles:r?.styles??[],cssCompiledStyles:o,style:u.style,id:r.id,domId:p?`${p}-${r.id}`:r.id,isGroup:!1,directions:r.directions,width:f.width||void 0,height:f.height||void 0,wrappingWidth:f.width||1/0,x:f.x,y:f.y,positioned:n,intersect:void 0,padding:l??i()?.block?.padding??0,widthInColumns:r.widthInColumns??1,colorIndex:r.colorIndex,look:i().look}}e(Z,`getNodeFromBlock`);async function Ue(e,t,n){let r=Z(t,n,!1);if(t.type===`group`)return;let a=i(),o=await de(e,r,{config:a}),s=o.node()?.getBBox()??{width:0,height:0},c=n.getBlock(r.id);c.size={width:s.width,height:s.height,x:0,y:0,node:o},n.setBlock(c),o.remove()}e(Ue,`calculateBlockSize`);async function We(e,t,n){let r=Z(t,n,!0);if(n.getBlock(r.id).type!==`space`){let n=i(),a=await de(e,r,{config:n});r.colorIndex!==void 0&&le(a,r.colorIndex,n.theme,n.themeVariables?.borderColorArray),t.intersect=r?.intersect,ue(r)}}e(We,`insertBlockPositioned`);async function Q(e,t,n,r){for(let i of t)await r(e,i,n),i.children&&await Q(e,i.children,n,r)}e(Q,`performOperations`);async function Ge(e,t,n){await Q(e,t,n,Ue)}e(Ge,`calculateBlockSizes`);async function Ke(e,t,n){await Q(e,t,n,We)}e(Ke,`insertBlocks`);async function $(e,t,n,r,i){let a=new ge({multigraph:!0,compound:!0});a.setGraph({rankdir:`TB`,nodesep:10,ranksep:10,marginx:8,marginy:8});for(let e of n)e.size&&a.setNode(e.id,{width:e.size.width,height:e.size.height,intersect:e.intersect});for(let n of t)if(n.start&&n.end){let t=r.getBlock(n.start),o=r.getBlock(n.end);if(t?.size&&o?.size){let r=t.size,s=o.size,c=[{x:r.x,y:r.y},{x:r.x+(s.x-r.x)/2,y:r.y+(s.y-r.y)/2},{x:s.x,y:s.y}],l=i?`${i}-${n.id}`:n.id,u=`${n.thickness===`thick`?`edge-thickness-thick`:`edge-thickness-normal`} ${n.pattern===`dotted`?`edge-pattern-dotted`:`edge-pattern-solid`} flowchart-link LS-a1 LE-b1`;me(e,{...n,id:l,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:c,classes:u},{},`block`,a.node(n.start),a.node(n.end),i),n.label&&(await fe(e,{...n,label:n.label,labelStyle:`stroke: #333; stroke-width: 1.5px;fill:none;`,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:c,classes:u}),he({...n,x:c[1].x,y:c[1].y},{originalPath:c}))}}}e($,`insertEdges`);var qe={parser:Ce,db:Re,renderer:{draw:e(async function(e,r,o,s){let{securityLevel:c,block:l}=i(),u=s.db;u.setDiagramId(r);let d;c===`sandbox`&&(d=n(`#i`+r));let f=n(c===`sandbox`?d.nodes()[0].contentDocument.body:`body`),p=c===`sandbox`?f.select(`[id="${r}"]`):n(`[id="${r}"]`);ie(p,i()),pe(p,[`point`,`circle`,`cross`],s.type,r);let m=u.getBlocks(),h=u.getBlocksFlat(),g=u.getEdges(),_=p.insert(`g`).attr(`class`,`block`);await Ge(_,m,u);let v=He(u);await Ke(_,m,u),await $(_,g,h,u,r);let y=_.node()?.getBBox(),b=y&&Number.isFinite(y.width)&&Number.isFinite(y.height)?y:v;if(b){let e=Math.max(1,Math.round(.125*(b.width/b.height))),n=b.height+e+10,r=b.width+10,{useMaxWidth:i}=l;a(p,n,r,!!i),t.debug(`Here Bounds`,v,b),p.attr(`viewBox`,`${b.x-5} ${b.y-5} ${b.width+10} ${b.height+10}`)}},`draw`),getClasses:e(function(e,t){return t.db.getClasses()},`getClasses`)},styles:Be};export{qe as diagram}; \ No newline at end of file + ${he()} +`,`getStyles`);function q(e,t){if(e===0||!Number.isInteger(e))throw Error(`Columns must be an integer !== 0.`);if(t<0||!Number.isInteger(t))throw Error(`Position must be a non-negative integer.`+t);return e<0?{px:t,py:0}:e===1?{px:0,py:t}:{px:t%e,py:Math.floor(t/e)}}e(q,`calculateBlockPosition`);var Ve=e(e=>{let n=0,r=0;for(let i of e.children){let{width:e,height:a,x:o,y:s}=i.size??{width:0,height:0,x:0,y:0};if(t.debug(`getMaxChildSize abc95 child:`,i.id,`width:`,e,`height:`,a,`x:`,o,`y:`,s,i.type),i.type===`space`)continue;let c=e/(i.widthInColumns??1);c>n&&(n=c),a>r&&(r=a)}return{width:n,height:r}},`getMaxChildSize`);function J(e,n,r=0,i=0,a=8){t.debug(`setBlockSizes abc95 (start)`,e.id,e?.size?.x,`block width =`,e?.size,`siblingWidth`,r),e?.size?.width||(e.size={width:r,height:i,x:0,y:0});let o=0,s=0;if(e.children?.length>0){for(let t of e.children)J(t,n,0,0,a);let c=Ve(e);o=c.width,s=c.height,t.debug(`setBlockSizes abc95 maxWidth of`,e.id,`:s children is `,o,s);for(let n of e.children)n.size&&(t.debug(`abc95 Setting size of children of ${e.id} id=${n.id} ${o} ${s} ${JSON.stringify(n.size)}`),n.size.width=o*(n.widthInColumns??1)+a*((n.widthInColumns??1)-1),n.size.height=s,n.size.x=0,n.size.y=0,t.debug(`abc95 updating size of ${e.id} children child:${n.id} maxWidth:${o} maxHeight:${s}`));for(let t of e.children)J(t,n,o,s,a);let l=e.columns??-1,u=0;for(let t of e.children)u+=t.widthInColumns??1;let d=e.children.length;l>0&&l0?Math.min(e.children.length,l):e.children.length;if(n>0){let r=(p-n*a-a)/n;t.debug(`abc95 (growing to fit) width`,e.id,p,e.size?.width,r);for(let t of e.children)t.size&&(t.size.width=r)}}e.size={width:p,height:m,x:0,y:0}}t.debug(`setBlockSizes abc94 (done)`,e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}e(J,`setBlockSizes`);function Y(e,n,r=8){t.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);let i=e.columns??-1;if(t.debug(`layoutBlocks columns abc95`,e.id,`=>`,i,e),e.children&&e.children.length>0){let a=e?.children[0]?.size?.width??0,o=e.children.length*a+(e.children.length-1)*r;t.debug(`widthOfChildren 88`,o,`posX`);let s=new Map;{let t=0;for(let n of e.children){if(!n.size)continue;let{py:e}=q(i,t),r=s.get(e)??0;n.size.height>r&&s.set(e,n.size.height);let a=n?.widthInColumns??1;i>0&&(a=Math.min(a,i-t%i)),t+=a}}let c=new Map;{let e=0,t=[...s.keys()].sort((e,t)=>e-t);for(let n of t)c.set(n,e),e+=(s.get(n)??0)+r}let l=0;t.debug(`abc91 block?.size?.x`,e.id,e?.size?.x);let u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,d=0;for(let a of e.children){let o=e;if(!a.size)continue;let{width:f,height:p}=a.size,{px:m,py:h}=q(i,l);if(h!=d&&(d=h,u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,t.debug(`New row in layout for block`,e.id,` and child `,a.id,d)),t.debug(`abc89 layout blocks (child) id: ${a.id} Pos: ${l} (px, py) ${m},${h} (${o?.size?.x},${o?.size?.y}) parent: ${o.id} width: ${f}${r}`),o.size){let e=f/2;a.size.x=u+r+e,t.debug(`abc91 layout blocks (calc) px, pyid:${a.id} startingPos=X${u} new startingPosX${a.size.x} ${e} padding=${r} width=${f} halfWidth=${e} => x:${a.size.x} y:${a.size.y} ${a.widthInColumns} (width * (child?.w || 1)) / 2 ${f*(a?.widthInColumns??1)/2}`),u=a.size.x+e;let n=c.get(h)??0,i=s.get(h)??p;a.size.y=o.size.y-o.size.height/2+n+i/2+r,t.debug(`abc88 layout blocks (calc) px, pyid:${a.id}startingPosX${u}${r}${e}=>x:${a.size.x}y:${a.size.y}${a.widthInColumns}(width * (child?.w || 1)) / 2${f*(a?.widthInColumns??1)/2}`)}a.children&&Y(a,n,r);let g=a?.widthInColumns??1;i>0&&(g=Math.min(g,i-l%i)),l+=g,t.debug(`abc88 columnsPos`,a,l)}}t.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}e(Y,`layoutBlocks`);function X(e,{minX:t,minY:n,maxX:r,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!==`root`){let{x:a,y:o,width:s,height:c}=e.size;a-s/2r&&(r=a+s/2),o+c/2>i&&(i=o+c/2)}if(e.children)for(let a of e.children)({minX:t,minY:n,maxX:r,maxY:i}=X(a,{minX:t,minY:n,maxX:r,maxY:i}));return{minX:t,minY:n,maxX:r,maxY:i}}e(X,`findBounds`);function He(e){let n=e.getBlock(`root`);if(!n)return;let r=c()?.block?.padding??8;J(n,e,0,0,r),Y(n,e,r),t.debug(`getBlocks`,JSON.stringify(n,null,2));let{minX:i,minY:a,maxX:o,maxY:s}=X(n),l=s-a;return{x:i,y:a,width:o-i,height:l}}e(He,`layout`);function Z(e,t,n=!1){let r=e,a=`default`;(r?.classes?.length||0)>0&&(a=(r?.classes??[]).join(` `)),a+=` flowchart-label`;let o=(r?.classes??[]).flatMap(e=>t.getClasses().get(e)?.styles??[]),s=0,c=`rect`,l;switch(r.type){case`round`:s=5,c=`rect`;break;case`composite`:s=0,c=`composite`,l=0;break;case`square`:c=`rect`;break;case`diamond`:c=`question`;break;case`hexagon`:c=`hexagon`;break;case`block_arrow`:c=`block_arrow`;break;case`odd`:c=`rect_left_inv_arrow`;break;case`lean_right`:c=`lean_right`;break;case`lean_left`:c=`lean_left`;break;case`trapezoid`:c=`trapezoid`;break;case`inv_trapezoid`:c=`inv_trapezoid`;break;case`rect_left_inv_arrow`:c=`rect_left_inv_arrow`;break;case`circle`:c=`circle`;break;case`ellipse`:c=`ellipse`;break;case`stadium`:c=`stadium`;break;case`subroutine`:c=`subroutine`;break;case`cylinder`:c=`cylinder`;break;case`group`:c=`rect`;break;case`doublecircle`:c=`doublecircle`;break;default:c=`rect`}let u=M(r?.styles??[]),d=r.label,f=r.size??{width:0,height:0,x:0,y:0},p=t.getDiagramId();return{labelStyle:u.labelStyle,shape:c,label:d,labelText:d,rx:s,ry:s,class:a,cssClasses:a,cssStyles:r?.styles??[],cssCompiledStyles:o,style:u.style,id:r.id,domId:p?`${p}-${r.id}`:r.id,isGroup:!1,directions:r.directions,width:f.width||void 0,height:f.height||void 0,wrappingWidth:f.width||1/0,x:f.x,y:f.y,positioned:n,intersect:void 0,padding:l??i()?.block?.padding??0,widthInColumns:r.widthInColumns??1,colorIndex:r.colorIndex,look:i().look}}e(Z,`getNodeFromBlock`);async function Ue(e,t,n){let r=Z(t,n,!1);if(t.type===`group`)return;let a=i(),o=await ue(e,r,{config:a}),s=o.node()?.getBBox()??{width:0,height:0},c=n.getBlock(r.id);c.size={width:s.width,height:s.height,x:0,y:0,node:o},n.setBlock(c),o.remove()}e(Ue,`calculateBlockSize`);async function We(e,t,n){let r=Z(t,n,!0);if(n.getBlock(r.id).type!==`space`){let n=i(),a=await ue(e,r,{config:n});r.colorIndex!==void 0&&ce(a,r.colorIndex,n.theme,n.themeVariables?.borderColorArray),t.intersect=r?.intersect,le(r)}}e(We,`insertBlockPositioned`);async function Q(e,t,n,r){for(let i of t)await r(e,i,n),i.children&&await Q(e,i.children,n,r)}e(Q,`performOperations`);async function Ge(e,t,n){await Q(e,t,n,Ue)}e(Ge,`calculateBlockSizes`);async function Ke(e,t,n){await Q(e,t,n,We)}e(Ke,`insertBlocks`);async function $(e,t,n,r,i){let a=new ge({multigraph:!0,compound:!0});a.setGraph({rankdir:`TB`,nodesep:10,ranksep:10,marginx:8,marginy:8});for(let e of n)e.size&&a.setNode(e.id,{width:e.size.width,height:e.size.height,intersect:e.intersect});for(let n of t)if(n.start&&n.end){let t=r.getBlock(n.start),o=r.getBlock(n.end);if(t?.size&&o?.size){let r=t.size,s=o.size,c=[{x:r.x,y:r.y},{x:r.x+(s.x-r.x)/2,y:r.y+(s.y-r.y)/2},{x:s.x,y:s.y}],l=i?`${i}-${n.id}`:n.id,u=`${n.thickness===`thick`?`edge-thickness-thick`:`edge-thickness-normal`} ${n.pattern===`dotted`?`edge-pattern-dotted`:`edge-pattern-solid`} flowchart-link LS-a1 LE-b1`;pe(e,{...n,id:l,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:c,classes:u},{},`block`,a.node(n.start),a.node(n.end),i),n.label&&(await de(e,{...n,label:n.label,labelStyle:`stroke: #333; stroke-width: 1.5px;fill:none;`,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:c,classes:u}),me({...n,x:c[1].x,y:c[1].y},{originalPath:c}))}}}e($,`insertEdges`);var qe={parser:Ce,db:Re,renderer:{draw:e(async function(e,r,o,s){let{securityLevel:c,block:l}=i(),u=s.db;u.setDiagramId(r);let d;c===`sandbox`&&(d=n(`#i`+r));let f=n(c===`sandbox`?d.nodes()[0].contentDocument.body:`body`),p=c===`sandbox`?f.select(`[id="${r}"]`):n(`[id="${r}"]`);re(p,i()),fe(p,[`point`,`circle`,`cross`],s.type,r);let m=u.getBlocks(),h=u.getBlocksFlat(),g=u.getEdges(),_=p.insert(`g`).attr(`class`,`block`);await Ge(_,m,u);let v=He(u);await Ke(_,m,u),await $(_,g,h,u,r);let y=_.node()?.getBBox(),b=y&&Number.isFinite(y.width)&&Number.isFinite(y.height)?y:v;if(b){let e=Math.max(1,Math.round(.125*(b.width/b.height))),n=b.height+e+10,r=b.width+10,{useMaxWidth:i}=l;a(p,n,r,!!i),t.debug(`Here Bounds`,v,b),p.attr(`viewBox`,`${b.x-5} ${b.y-5} ${b.width+10} ${b.height+10}`)}},`draw`),getClasses:e(function(e,t){return t.db.getClasses()},`getClasses`)},styles:Be};export{qe as diagram}; \ No newline at end of file diff --git a/web/dist/app-c4Diagram-YGBWAQC7.js b/web/dist/app-c4Diagram-YGBWAQC7.js index 39e4e4de0..c522e0381 100644 --- a/web/dist/app-c4Diagram-YGBWAQC7.js +++ b/web/dist/app-c4Diagram-YGBWAQC7.js @@ -1,4 +1,4 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{H as r,U as i,c as a,r as o,s,v as l,x as u,y as d,z as f}from"./app-chunk-O7XYJQB3.js";import{_ as p,n as m,r as h}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import{r as g,s as _}from"./app-chunk-7INBJB4K.js";import{a as v}from"./app-chunk-GWA4HPMP.js";var y=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,24],r=[1,25],i=[1,26],a=[1,27],o=[1,28],s=[1,63],l=[1,64],u=[1,65],d=[1,66],f=[1,67],p=[1,68],m=[1,69],h=[1,29],g=[1,30],_=[1,31],v=[1,32],y=[1,33],b=[1,34],x=[1,35],S=[1,36],C=[1,37],w=[1,38],T=[1,39],E=[1,40],D=[1,41],O=[1,42],k=[1,43],A=[1,44],j=[1,45],M=[1,46],N=[1,47],P=[1,48],F=[1,50],I=[1,51],L=[1,52],R=[1,53],z=[1,54],B=[1,55],V=[1,56],H=[1,57],U=[1,58],W=[1,59],G=[1,60],ee=[14,42],te=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ne=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],K=[1,82],q=[1,83],J=[1,84],Y=[1,85],X=[12,14,42],re=[12,14,33,42],ie=[12,14,33,42,76,77,79,80],Z=[12,33],ae=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],oe={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:`error`,6:`direction_tb`,7:`direction_bt`,8:`direction_rl`,9:`direction_lr`,11:`C4_CONTEXT`,12:`NEWLINE`,14:`EOF`,15:`C4_CONTAINER`,16:`C4_COMPONENT`,17:`C4_DYNAMIC`,18:`C4_DEPLOYMENT`,22:`title`,23:`accDescription`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`LBRACE`,34:`ENTERPRISE_BOUNDARY`,36:`SYSTEM_BOUNDARY`,37:`BOUNDARY`,38:`CONTAINER_BOUNDARY`,39:`NODE`,40:`NODE_L`,41:`NODE_R`,42:`RBRACE`,44:`PERSON`,45:`PERSON_EXT`,46:`SYSTEM`,47:`SYSTEM_DB`,48:`SYSTEM_QUEUE`,49:`SYSTEM_EXT`,50:`SYSTEM_EXT_DB`,51:`SYSTEM_EXT_QUEUE`,52:`CONTAINER`,53:`CONTAINER_DB`,54:`CONTAINER_QUEUE`,55:`CONTAINER_EXT`,56:`CONTAINER_EXT_DB`,57:`CONTAINER_EXT_QUEUE`,58:`COMPONENT`,59:`COMPONENT_DB`,60:`COMPONENT_QUEUE`,61:`COMPONENT_EXT`,62:`COMPONENT_EXT_DB`,63:`COMPONENT_EXT_QUEUE`,64:`REL`,65:`BIREL`,66:`REL_U`,67:`REL_D`,68:`REL_L`,69:`REL_R`,70:`REL_B`,71:`REL_INDEX`,72:`UPDATE_EL_STYLE`,73:`UPDATE_REL_STYLE`,74:`UPDATE_LAYOUT_CONFIG`,76:`STR`,77:`STR_KEY`,78:`STR_VALUE`,79:`ATTRIBUTE`,80:`ATTRIBUTE_EMPTY`},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:r.setDirection(`TB`);break;case 4:r.setDirection(`BT`);break;case 5:r.setDirection(`RL`);break;case 6:r.setDirection(`LR`);break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(a[s-3]);break;case 19:r.setTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 20:r.setAccDescription(a[s].substring(15)),this.$=a[s].substring(15);break;case 21:this.$=a[s].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 28:a[s].splice(2,0,`ENTERPRISE`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 29:a[s].splice(2,0,`SYSTEM`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 30:r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 31:a[s].splice(2,0,`CONTAINER`),r.addContainerBoundary(...a[s]),this.$=a[s];break;case 32:r.addDeploymentNode(`node`,...a[s]),this.$=a[s];break;case 33:r.addDeploymentNode(`nodeL`,...a[s]),this.$=a[s];break;case 34:r.addDeploymentNode(`nodeR`,...a[s]),this.$=a[s];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem(`person`,...a[s]),this.$=a[s];break;case 40:r.addPersonOrSystem(`external_person`,...a[s]),this.$=a[s];break;case 41:r.addPersonOrSystem(`system`,...a[s]),this.$=a[s];break;case 42:r.addPersonOrSystem(`system_db`,...a[s]),this.$=a[s];break;case 43:r.addPersonOrSystem(`system_queue`,...a[s]),this.$=a[s];break;case 44:r.addPersonOrSystem(`external_system`,...a[s]),this.$=a[s];break;case 45:r.addPersonOrSystem(`external_system_db`,...a[s]),this.$=a[s];break;case 46:r.addPersonOrSystem(`external_system_queue`,...a[s]),this.$=a[s];break;case 47:r.addContainer(`container`,...a[s]),this.$=a[s];break;case 48:r.addContainer(`container_db`,...a[s]),this.$=a[s];break;case 49:r.addContainer(`container_queue`,...a[s]),this.$=a[s];break;case 50:r.addContainer(`external_container`,...a[s]),this.$=a[s];break;case 51:r.addContainer(`external_container_db`,...a[s]),this.$=a[s];break;case 52:r.addContainer(`external_container_queue`,...a[s]),this.$=a[s];break;case 53:r.addComponent(`component`,...a[s]),this.$=a[s];break;case 54:r.addComponent(`component_db`,...a[s]),this.$=a[s];break;case 55:r.addComponent(`component_queue`,...a[s]),this.$=a[s];break;case 56:r.addComponent(`external_component`,...a[s]),this.$=a[s];break;case 57:r.addComponent(`external_component_db`,...a[s]),this.$=a[s];break;case 58:r.addComponent(`external_component_queue`,...a[s]),this.$=a[s];break;case 60:r.addRel(`rel`,...a[s]),this.$=a[s];break;case 61:r.addRel(`birel`,...a[s]),this.$=a[s];break;case 62:r.addRel(`rel_u`,...a[s]),this.$=a[s];break;case 63:r.addRel(`rel_d`,...a[s]),this.$=a[s];break;case 64:r.addRel(`rel_l`,...a[s]),this.$=a[s];break;case 65:r.addRel(`rel_r`,...a[s]),this.$=a[s];break;case 66:r.addRel(`rel_b`,...a[s]),this.$=a[s];break;case 67:a[s].splice(0,1),r.addRel(`rel`,...a[s]),this.$=a[s];break;case 68:r.updateElStyle(`update_el_style`,...a[s]),this.$=a[s];break;case 69:r.updateRelStyle(`update_rel_style`,...a[s]),this.$=a[s];break;case 70:r.updateLayoutConfig(`update_layout_config`,...a[s]),this.$=a[s];break;case 71:this.$=[a[s]];break;case 72:a[s].unshift(a[s-1]),this.$=a[s];break;case 73:case 75:this.$=a[s].trim();break;case 74:let e={};e[a[s-1].trim()]=a[s].trim(),this.$=e;break;case 76:this.$=``}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:70,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:71,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:72,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:73,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{14:[1,74]},t(ee,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ee,[2,14]),t(te,[2,16],{12:[1,76]}),t(ee,[2,36],{12:[1,77]}),t(ne,[2,19]),t(ne,[2,20]),{25:[1,78]},{27:[1,79]},t(ne,[2,23]),{35:80,75:81,76:K,77:q,79:J,80:Y},{35:86,75:81,76:K,77:q,79:J,80:Y},{35:87,75:81,76:K,77:q,79:J,80:Y},{35:88,75:81,76:K,77:q,79:J,80:Y},{35:89,75:81,76:K,77:q,79:J,80:Y},{35:90,75:81,76:K,77:q,79:J,80:Y},{35:91,75:81,76:K,77:q,79:J,80:Y},{35:92,75:81,76:K,77:q,79:J,80:Y},{35:93,75:81,76:K,77:q,79:J,80:Y},{35:94,75:81,76:K,77:q,79:J,80:Y},{35:95,75:81,76:K,77:q,79:J,80:Y},{35:96,75:81,76:K,77:q,79:J,80:Y},{35:97,75:81,76:K,77:q,79:J,80:Y},{35:98,75:81,76:K,77:q,79:J,80:Y},{35:99,75:81,76:K,77:q,79:J,80:Y},{35:100,75:81,76:K,77:q,79:J,80:Y},{35:101,75:81,76:K,77:q,79:J,80:Y},{35:102,75:81,76:K,77:q,79:J,80:Y},{35:103,75:81,76:K,77:q,79:J,80:Y},{35:104,75:81,76:K,77:q,79:J,80:Y},t(X,[2,59]),{35:105,75:81,76:K,77:q,79:J,80:Y},{35:106,75:81,76:K,77:q,79:J,80:Y},{35:107,75:81,76:K,77:q,79:J,80:Y},{35:108,75:81,76:K,77:q,79:J,80:Y},{35:109,75:81,76:K,77:q,79:J,80:Y},{35:110,75:81,76:K,77:q,79:J,80:Y},{35:111,75:81,76:K,77:q,79:J,80:Y},{35:112,75:81,76:K,77:q,79:J,80:Y},{35:113,75:81,76:K,77:q,79:J,80:Y},{35:114,75:81,76:K,77:q,79:J,80:Y},{35:115,75:81,76:K,77:q,79:J,80:Y},{20:116,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{12:[1,118],33:[1,117]},{35:119,75:81,76:K,77:q,79:J,80:Y},{35:120,75:81,76:K,77:q,79:J,80:Y},{35:121,75:81,76:K,77:q,79:J,80:Y},{35:122,75:81,76:K,77:q,79:J,80:Y},{35:123,75:81,76:K,77:q,79:J,80:Y},{35:124,75:81,76:K,77:q,79:J,80:Y},{35:125,75:81,76:K,77:q,79:J,80:Y},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ee,[2,15]),t(te,[2,17],{21:22,19:130,22:n,23:r,24:i,26:a,28:o}),t(ee,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:n,23:r,24:i,26:a,28:o,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ne,[2,21]),t(ne,[2,22]),t(X,[2,39]),t(re,[2,71],{75:81,35:132,76:K,77:q,79:J,80:Y}),t(ie,[2,73]),{78:[1,133]},t(ie,[2,75]),t(ie,[2,76]),t(X,[2,40]),t(X,[2,41]),t(X,[2,42]),t(X,[2,43]),t(X,[2,44]),t(X,[2,45]),t(X,[2,46]),t(X,[2,47]),t(X,[2,48]),t(X,[2,49]),t(X,[2,50]),t(X,[2,51]),t(X,[2,52]),t(X,[2,53]),t(X,[2,54]),t(X,[2,55]),t(X,[2,56]),t(X,[2,57]),t(X,[2,58]),t(X,[2,60]),t(X,[2,61]),t(X,[2,62]),t(X,[2,63]),t(X,[2,64]),t(X,[2,65]),t(X,[2,66]),t(X,[2,67]),t(X,[2,68]),t(X,[2,69]),t(X,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(Z,[2,28]),t(Z,[2,29]),t(Z,[2,30]),t(Z,[2,31]),t(Z,[2,32]),t(Z,[2,33]),t(Z,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(te,[2,18]),t(ee,[2,38]),t(re,[2,72]),t(ie,[2,74]),t(X,[2,24]),t(X,[2,35]),t(ae,[2,25]),t(ae,[2,26],{12:[1,138]}),t(ae,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,l=``,u=0,d=0,f=0,p=2,m=1,h=o.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(t,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;o.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){r.length-=2*e,a.length-=e,o.length-=e}e(x,`popStack`);function S(){var e=i.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=r[r.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=s[T]&&s[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],s[T])this.terminals_[k]&&k>p&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(u+1)+`: +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{H as r,U as i,c as a,r as o,s,v as l,x as u,y as d,z as f}from"./app-chunk-O7XYJQB3.js";import{_ as p,n as m,r as h}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{r as g,s as _}from"./app-chunk-7INBJB4K.js";import{a as v}from"./app-chunk-GWA4HPMP.js";var y=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,24],r=[1,25],i=[1,26],a=[1,27],o=[1,28],s=[1,63],l=[1,64],u=[1,65],d=[1,66],f=[1,67],p=[1,68],m=[1,69],h=[1,29],g=[1,30],_=[1,31],v=[1,32],y=[1,33],b=[1,34],x=[1,35],S=[1,36],C=[1,37],w=[1,38],T=[1,39],E=[1,40],D=[1,41],O=[1,42],k=[1,43],A=[1,44],j=[1,45],M=[1,46],N=[1,47],P=[1,48],F=[1,50],I=[1,51],L=[1,52],R=[1,53],z=[1,54],B=[1,55],V=[1,56],H=[1,57],U=[1,58],W=[1,59],G=[1,60],ee=[14,42],te=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ne=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],K=[1,82],q=[1,83],J=[1,84],Y=[1,85],X=[12,14,42],re=[12,14,33,42],ie=[12,14,33,42,76,77,79,80],Z=[12,33],ae=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],oe={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:`error`,6:`direction_tb`,7:`direction_bt`,8:`direction_rl`,9:`direction_lr`,11:`C4_CONTEXT`,12:`NEWLINE`,14:`EOF`,15:`C4_CONTAINER`,16:`C4_COMPONENT`,17:`C4_DYNAMIC`,18:`C4_DEPLOYMENT`,22:`title`,23:`accDescription`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`LBRACE`,34:`ENTERPRISE_BOUNDARY`,36:`SYSTEM_BOUNDARY`,37:`BOUNDARY`,38:`CONTAINER_BOUNDARY`,39:`NODE`,40:`NODE_L`,41:`NODE_R`,42:`RBRACE`,44:`PERSON`,45:`PERSON_EXT`,46:`SYSTEM`,47:`SYSTEM_DB`,48:`SYSTEM_QUEUE`,49:`SYSTEM_EXT`,50:`SYSTEM_EXT_DB`,51:`SYSTEM_EXT_QUEUE`,52:`CONTAINER`,53:`CONTAINER_DB`,54:`CONTAINER_QUEUE`,55:`CONTAINER_EXT`,56:`CONTAINER_EXT_DB`,57:`CONTAINER_EXT_QUEUE`,58:`COMPONENT`,59:`COMPONENT_DB`,60:`COMPONENT_QUEUE`,61:`COMPONENT_EXT`,62:`COMPONENT_EXT_DB`,63:`COMPONENT_EXT_QUEUE`,64:`REL`,65:`BIREL`,66:`REL_U`,67:`REL_D`,68:`REL_L`,69:`REL_R`,70:`REL_B`,71:`REL_INDEX`,72:`UPDATE_EL_STYLE`,73:`UPDATE_REL_STYLE`,74:`UPDATE_LAYOUT_CONFIG`,76:`STR`,77:`STR_KEY`,78:`STR_VALUE`,79:`ATTRIBUTE`,80:`ATTRIBUTE_EMPTY`},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:r.setDirection(`TB`);break;case 4:r.setDirection(`BT`);break;case 5:r.setDirection(`RL`);break;case 6:r.setDirection(`LR`);break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(a[s-3]);break;case 19:r.setTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 20:r.setAccDescription(a[s].substring(15)),this.$=a[s].substring(15);break;case 21:this.$=a[s].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 28:a[s].splice(2,0,`ENTERPRISE`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 29:a[s].splice(2,0,`SYSTEM`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 30:r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 31:a[s].splice(2,0,`CONTAINER`),r.addContainerBoundary(...a[s]),this.$=a[s];break;case 32:r.addDeploymentNode(`node`,...a[s]),this.$=a[s];break;case 33:r.addDeploymentNode(`nodeL`,...a[s]),this.$=a[s];break;case 34:r.addDeploymentNode(`nodeR`,...a[s]),this.$=a[s];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem(`person`,...a[s]),this.$=a[s];break;case 40:r.addPersonOrSystem(`external_person`,...a[s]),this.$=a[s];break;case 41:r.addPersonOrSystem(`system`,...a[s]),this.$=a[s];break;case 42:r.addPersonOrSystem(`system_db`,...a[s]),this.$=a[s];break;case 43:r.addPersonOrSystem(`system_queue`,...a[s]),this.$=a[s];break;case 44:r.addPersonOrSystem(`external_system`,...a[s]),this.$=a[s];break;case 45:r.addPersonOrSystem(`external_system_db`,...a[s]),this.$=a[s];break;case 46:r.addPersonOrSystem(`external_system_queue`,...a[s]),this.$=a[s];break;case 47:r.addContainer(`container`,...a[s]),this.$=a[s];break;case 48:r.addContainer(`container_db`,...a[s]),this.$=a[s];break;case 49:r.addContainer(`container_queue`,...a[s]),this.$=a[s];break;case 50:r.addContainer(`external_container`,...a[s]),this.$=a[s];break;case 51:r.addContainer(`external_container_db`,...a[s]),this.$=a[s];break;case 52:r.addContainer(`external_container_queue`,...a[s]),this.$=a[s];break;case 53:r.addComponent(`component`,...a[s]),this.$=a[s];break;case 54:r.addComponent(`component_db`,...a[s]),this.$=a[s];break;case 55:r.addComponent(`component_queue`,...a[s]),this.$=a[s];break;case 56:r.addComponent(`external_component`,...a[s]),this.$=a[s];break;case 57:r.addComponent(`external_component_db`,...a[s]),this.$=a[s];break;case 58:r.addComponent(`external_component_queue`,...a[s]),this.$=a[s];break;case 60:r.addRel(`rel`,...a[s]),this.$=a[s];break;case 61:r.addRel(`birel`,...a[s]),this.$=a[s];break;case 62:r.addRel(`rel_u`,...a[s]),this.$=a[s];break;case 63:r.addRel(`rel_d`,...a[s]),this.$=a[s];break;case 64:r.addRel(`rel_l`,...a[s]),this.$=a[s];break;case 65:r.addRel(`rel_r`,...a[s]),this.$=a[s];break;case 66:r.addRel(`rel_b`,...a[s]),this.$=a[s];break;case 67:a[s].splice(0,1),r.addRel(`rel`,...a[s]),this.$=a[s];break;case 68:r.updateElStyle(`update_el_style`,...a[s]),this.$=a[s];break;case 69:r.updateRelStyle(`update_rel_style`,...a[s]),this.$=a[s];break;case 70:r.updateLayoutConfig(`update_layout_config`,...a[s]),this.$=a[s];break;case 71:this.$=[a[s]];break;case 72:a[s].unshift(a[s-1]),this.$=a[s];break;case 73:case 75:this.$=a[s].trim();break;case 74:let e={};e[a[s-1].trim()]=a[s].trim(),this.$=e;break;case 76:this.$=``}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:70,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:71,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:72,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:73,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{14:[1,74]},t(ee,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ee,[2,14]),t(te,[2,16],{12:[1,76]}),t(ee,[2,36],{12:[1,77]}),t(ne,[2,19]),t(ne,[2,20]),{25:[1,78]},{27:[1,79]},t(ne,[2,23]),{35:80,75:81,76:K,77:q,79:J,80:Y},{35:86,75:81,76:K,77:q,79:J,80:Y},{35:87,75:81,76:K,77:q,79:J,80:Y},{35:88,75:81,76:K,77:q,79:J,80:Y},{35:89,75:81,76:K,77:q,79:J,80:Y},{35:90,75:81,76:K,77:q,79:J,80:Y},{35:91,75:81,76:K,77:q,79:J,80:Y},{35:92,75:81,76:K,77:q,79:J,80:Y},{35:93,75:81,76:K,77:q,79:J,80:Y},{35:94,75:81,76:K,77:q,79:J,80:Y},{35:95,75:81,76:K,77:q,79:J,80:Y},{35:96,75:81,76:K,77:q,79:J,80:Y},{35:97,75:81,76:K,77:q,79:J,80:Y},{35:98,75:81,76:K,77:q,79:J,80:Y},{35:99,75:81,76:K,77:q,79:J,80:Y},{35:100,75:81,76:K,77:q,79:J,80:Y},{35:101,75:81,76:K,77:q,79:J,80:Y},{35:102,75:81,76:K,77:q,79:J,80:Y},{35:103,75:81,76:K,77:q,79:J,80:Y},{35:104,75:81,76:K,77:q,79:J,80:Y},t(X,[2,59]),{35:105,75:81,76:K,77:q,79:J,80:Y},{35:106,75:81,76:K,77:q,79:J,80:Y},{35:107,75:81,76:K,77:q,79:J,80:Y},{35:108,75:81,76:K,77:q,79:J,80:Y},{35:109,75:81,76:K,77:q,79:J,80:Y},{35:110,75:81,76:K,77:q,79:J,80:Y},{35:111,75:81,76:K,77:q,79:J,80:Y},{35:112,75:81,76:K,77:q,79:J,80:Y},{35:113,75:81,76:K,77:q,79:J,80:Y},{35:114,75:81,76:K,77:q,79:J,80:Y},{35:115,75:81,76:K,77:q,79:J,80:Y},{20:116,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{12:[1,118],33:[1,117]},{35:119,75:81,76:K,77:q,79:J,80:Y},{35:120,75:81,76:K,77:q,79:J,80:Y},{35:121,75:81,76:K,77:q,79:J,80:Y},{35:122,75:81,76:K,77:q,79:J,80:Y},{35:123,75:81,76:K,77:q,79:J,80:Y},{35:124,75:81,76:K,77:q,79:J,80:Y},{35:125,75:81,76:K,77:q,79:J,80:Y},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ee,[2,15]),t(te,[2,17],{21:22,19:130,22:n,23:r,24:i,26:a,28:o}),t(ee,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:n,23:r,24:i,26:a,28:o,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ne,[2,21]),t(ne,[2,22]),t(X,[2,39]),t(re,[2,71],{75:81,35:132,76:K,77:q,79:J,80:Y}),t(ie,[2,73]),{78:[1,133]},t(ie,[2,75]),t(ie,[2,76]),t(X,[2,40]),t(X,[2,41]),t(X,[2,42]),t(X,[2,43]),t(X,[2,44]),t(X,[2,45]),t(X,[2,46]),t(X,[2,47]),t(X,[2,48]),t(X,[2,49]),t(X,[2,50]),t(X,[2,51]),t(X,[2,52]),t(X,[2,53]),t(X,[2,54]),t(X,[2,55]),t(X,[2,56]),t(X,[2,57]),t(X,[2,58]),t(X,[2,60]),t(X,[2,61]),t(X,[2,62]),t(X,[2,63]),t(X,[2,64]),t(X,[2,65]),t(X,[2,66]),t(X,[2,67]),t(X,[2,68]),t(X,[2,69]),t(X,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(Z,[2,28]),t(Z,[2,29]),t(Z,[2,30]),t(Z,[2,31]),t(Z,[2,32]),t(Z,[2,33]),t(Z,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(te,[2,18]),t(ee,[2,38]),t(re,[2,72]),t(ie,[2,74]),t(X,[2,24]),t(X,[2,35]),t(ae,[2,25]),t(ae,[2,26],{12:[1,138]}),t(ae,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,l=``,u=0,d=0,f=0,p=2,m=1,h=o.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(t,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;o.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){r.length-=2*e,a.length-=e,o.length-=e}e(x,`popStack`);function S(){var e=i.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=r[r.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=s[T]&&s[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],s[T])this.terminals_[k]&&k>p&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(u+1)+`: `+g.showPosition()+` Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(u+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:r.push(C),a.push(g.yytext),o.push(g.yylloc),r.push(E[1]),C=null,w?(C=w,w=null):(d=g.yyleng,l=g.yytext,u=g.yylineno,y=g.yylloc,f>0&&f--);break;case 2:if(A=this.productions_[E[1]][1],O.$=a[a.length-A],O._$={first_line:o[o.length-(A||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(A||1)].first_column,last_column:o[o.length-1].last_column},b&&(O._$.range=[o[o.length-(A||1)].range[0],o[o.length-1].range[1]]),D=this.performAction.apply(O,[l,d,u,_.yy,E[1],a,o].concat(h)),D!==void 0)return D;A&&(r=r.slice(0,-1*A*2),a=a.slice(0,-1*A),o=o.slice(0,-1*A)),r.push(this.productions_[E[1]][0]),a.push(O.$),o.push(O._$),j=s[r[r.length-2]][r[r.length-1]],r.push(j);break;case 3:return!0}}return!0},`parse`)};oe.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` diff --git a/web/dist/app-chunk-3FUC2YCW.js b/web/dist/app-chunk-3FUC2YCW.js index 50e9053f1..256a8d282 100644 --- a/web/dist/app-chunk-3FUC2YCW.js +++ b/web/dist/app-chunk-3FUC2YCW.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["app-sizeCapture-INFHLROL.js","app-chunk-Y2CYZVJY.js"])))=>i.map(i=>d[i]); -import{t as e}from"./app-preload-helper.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import{b as r,x as i}from"./app-chunk-O7XYJQB3.js";import{g as a}from"./app-chunk-ZIGJFQKS.js";import{o}from"./app-chunk-7INBJB4K.js";import{i as s,n as c,r as l,t as u}from"./app-chunk-5DYCD2WN.js";import{a as d,c as f,i as p,n as m,r as h,t as g,u as _}from"./app-chunk-Z7XXMR3K.js";import{t as v}from"./app-graphlib.js";import{r as y,t as b}from"./app-chunk-UA2S7LBM.js";function x(e,{edgePathsClass:t=`edges edgePaths`}={}){let n=e.insert(`g`).attr(`class`,`root`);return{clusters:n.insert(`g`).attr(`class`,`clusters`),edgePaths:n.insert(`g`).attr(`class`,t),edgeLabels:n.insert(`g`).attr(`class`,`edgeLabels`),nodes:n.insert(`g`).attr(`class`,`nodes`),rootGroups:n}}t(x,`createLayoutElementGroups`);async function S(e,t,n){if(t.label){let{shapeSvg:r,bbox:i}=await o(e,n===void 0?t:{...t,width:n});t.labelBBox={width:i.width,height:i.height},r.remove()}else t.labelBBox={width:0,height:0}}t(S,`measureGroupLabel`);async function C(e,t,n){let r=await l(e,t,n),i=r.node()?.getBBox()??{width:0,height:0};return t.width=i.width,t.height=i.height,r}t(C,`insertMeasuredNode`);function w(e,t,n){let r=e,i=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||i.has(r.parentId))break;i.add(r.parentId),r=t.get(r.parentId)}return n}t(w,`resolveNodeDir`);async function T(t,n,r={}){let a=new v({multigraph:!0,compound:!0}),o=[...n.edges],s=i(),c=x(t),{edgeLabels:l,nodes:u}=c,f=new Map,p=new Map(n.nodes.map(e=>[e.id,e])),m=n.direction,g=t.node()!=null;await Promise.all(n.nodes.map(async e=>{if(e.isGroup){if(g){let t=r.unwrapGroupLabels&&e.labelType!==`markdown`;await S(u,e,t?1/0:void 0)}a.setNode(e.id,{...e})}else{if(g){let t=await C(u,e,{config:s,dir:w(e,p,m)});f.set(e.id,t)}a.setNode(e.id,{...e})}}));for(let e of o)g&&h(e)&&await d(l,e),a.setEdge(e.start,e.end,{...e},e.id),n.edges.some(t=>t.id===e.id)||n.edges.push(e);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:r}=await e(async()=>{let{captureNodeSizes:e}=await import(`./app-sizeCapture-INFHLROL.js`);return{captureNodeSizes:e}},__vite__mapDeps([0,1]));r(t,n)}return{graph:a,groups:c,nodeElements:f}}t(T,`createGraphWithElements`);var E=new Map,D=new Map,O=new Map,k=t(()=>{D.clear(),O.clear(),E.clear()},`clear`),A=t((e,t)=>{let r=D.get(t)||[];return n.trace(`In isDescendant`,t,` `,e,` = `,r.includes(e)),r.includes(e)},`isDescendant`),j=t((e,t)=>{let r=D.get(t)||[];return n.info(`Descendants of `,t,` is `,r),n.info(`Edge is `,e),e.v===t||e.w===t?!1:r?r.includes(e.v)||A(e.v,t)||A(e.w,t)||r.includes(e.w):(n.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),M=t((e,t,r,i)=>{n.debug(`Copying children of `,e,`root`,i,`data`,t.node(e),i);let a=t.children(e)||[];e!==i&&a.push(e),n.debug(`Copying (nodes) clusterId`,e,`nodes`,a),a.forEach(a=>{if(t.children(a).length>0)M(a,t,r,i);else{let o=t.node(a);n.info(`cp `,a,` to `,i,` with parent `,e),r.setNode(a,o),i!==t.parent(a)&&(n.debug(`Setting parent`,a,t.parent(a)),r.setParent(a,t.parent(a))),e!==i&&a!==e?(n.debug(`Setting parent`,a,e),r.setParent(a,e)):(n.info(`In copy `,e,`root`,i,`data`,t.node(e),i),n.debug(`Not Setting parent for node=`,a,`cluster!==rootId`,e!==i,`node!==clusterId`,a!==e));let s=t.edges(a);n.debug(`Copying Edges`,s),s.forEach(a=>{n.info(`Edge`,a);let o=t.edge(a.v,a.w,a.name);n.info(`Edge data`,o,i);try{j(a,i)?(n.info(`Copying as `,a.v,a.w,o,a.name),r.setEdge(a.v,a.w,o,a.name),n.info(`newGraph edges `,r.edges(),r.edge(r.edges()[0]))):n.info(`Skipping copy of edge `,a.v,`-->`,a.w,` rootId: `,i,` clusterId:`,e)}catch(e){n.error(e)}})}n.debug(`Removing node`,a),t.removeNode(a)})},`copy`),N=t((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)O.set(i,e),r=[...r,...N(i,t)];return r},`extractDescendants`),P=t((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),F=t((e,t,r)=>{let i=t.children(e);if(n.trace(`Searching children of id `,e,i),i.length<1)return e;let a;for(let e of i){let n=F(e,t,r),i=P(t,r,n);if(n)if(i.length>0)a=n;else return n}return a},`findNonClusterChild`),I=t(e=>!E.has(e)||!E.get(e).externalConnections?e:E.has(e)?E.get(e).id:e,`getAnchorId`),L=t((e,t)=>{if(!e||t>10){n.debug(`Opting out, no graph `);return}n.debug(`Opting in, graph `),e.nodes().forEach(function(t){e.children(t).length>0&&(n.debug(`Cluster identified`,t,` Replacement id in edges: `,F(t,e,t)),D.set(t,N(t,e)),E.set(t,{id:F(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let r=e.children(t),i=e.edges();r.length>0?(n.debug(`Cluster identified`,t,D),i.forEach(e=>{A(e.v,t)^A(e.w,t)&&(n.debug(`Edge: `,e,` leaves cluster `,t),n.debug(`Descendants of XXX `,t,`: `,D.get(t)),E.get(t).externalConnections=!0)})):n.debug(`Not a cluster `,t,D)});for(let t of E.keys()){let n=E.get(t).id,r=e.parent(n);r!==t&&E.has(r)&&!E.get(r).externalConnections&&(E.get(t).id=r);let i=e.edges().some(e=>e.v===t);if(n&&E.get(t)?.externalConnections&&i&&V(e,n,t)){let r=ee(e,t,e.parent(n));r&&(E.get(t).id=r)}}e.edges().forEach(function(t){let r=e.edge(t);n.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),n.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let i=t.v,a=t.w;if(n.debug(`Fix XXX`,E,`ids:`,t.v,t.w,`Translating: `,E.get(t.v),` --- `,E.get(t.w)),E.get(t.v)||E.get(t.w)){if(n.debug(`Fixing and trying - removing XXX`,t.v,t.w,t.name),i=I(t.v),a=I(t.w),e.removeEdge(t.v,t.w,t.name),i!==t.v){let n=e.parent(i);E.get(n).externalConnections=!0,r.fromCluster=t.v}if(a!==t.w){let n=e.parent(a);E.get(n).externalConnections=!0,r.toCluster=t.w}n.debug(`Fix Replacing with XXX`,i,a,t.name),e.setEdge(i,a,r,t.name)}}),R(e,0),n.trace(E)},`adjustClustersAndEdges`),R=t((e,t)=>{if(t>10){n.error(`Bailing out`);return}let r=e.nodes(),i=!1;for(let t of r){let n=e.children(t);i||=n.length>0}if(!i){n.debug(`Done, no node has children`,e.nodes());return}n.debug(`Nodes = `,r,t);for(let i of r)if(n.debug(`Extracting node`,i,E,E.has(i)&&!E.get(i).externalConnections,!e.parent(i),e.node(i),e.children(`D`),` Depth `,t),!E.has(i))n.debug(`Not a cluster`,i,t);else if(!E.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){n.debug(`Cluster without external connections, without a parent and with children`,i,t);let r=e.graph().rankdir===`TB`?`LR`:`TB`;E.get(i)?.clusterData?.dir&&(r=E.get(i).clusterData.dir,n.debug(`Fixing dir`,E.get(i).clusterData.dir,r));let a=new v({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});M(i,e,a,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:E.get(i).clusterData,label:E.get(i).label,graph:a})}else n.debug(`Cluster ** `,i,` **not meeting the criteria !externalConnections:`,!E.get(i).externalConnections,` no parent: `,!e.parent(i),` children `,e.children(i)&&e.children(i).length>0,e.children(`D`),t),n.debug(E);r=e.nodes(),n.debug(`New list of nodes`,r);for(let i of r){let r=e.node(i);n.debug(` Now next level`,i,r),r?.clusterNode&&R(r.graph,t+1)}},`extractor`),z=t((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=z(e,e.children(t));n=[...n,...r]}),n},`sorter`),B=t(e=>z(e,e.children()),`sortNodesByHierarchy`),V=t((e,t,n)=>{let r=e.parent(t);for(;r&&r!==n;){let t=E.get(r);if(t&&!t.externalConnections)return!0;r=e.parent(r)}return!1},`isNodeInExtractableCluster`),ee=t((e,t,n)=>{let r=e.children(t)??[];for(let i of r){if(i===n||A(i,n))continue;let r=F(i,e,t);if(r&&!V(e,r,t))return r}return null},`findSafeAnchorNode`);function H({prepareLayout:e,measureLayout:n,runLayoutCore:r,paintLayout:i,afterPaint:a,paintOptions:o}){let s=n??W;return t(async function(t,n,c,l){let u=n.select(`g`);(c?.insertMarkers??f)(u,t.markers,t.type,t.diagramId),U();let d={element:u,helpers:c,options:l};d.preparedLayout=await e?.(t,d);let p=await s(t,d),m=await r(t,d),h={...d,measure:p};i?await i(t,h,m):await G(t,h,o),await a?.(t,h,m)},`render`)}t(H,`createCommonLayoutRenderer`);function U(){u(),g(),b(),k()}t(U,`clearLayoutRenderState`);async function W(e,{element:t},n){return await T(t,e,n)}t(W,`defaultMeasureLayout`);async function G(e,t,n={}){let{measure:r}=t,{groups:i}=r;for(let r of n.getNodes?.(e,t)??e.nodes)n.skipNode?.(r,t)||await K(i,r,t,n);let a=J(e.nodes);for(let r of e.edges)Y(r,n)||await X(i,r,a,e,n,t)}t(G,`paintLayoutData`);async function K(e,t,n,r){t.clusterNode?s(t):q(t,n,r)?await y(e.clusters,t):s(t)}t(K,`paintLayoutNode`);function q(e,t,n){return e.isGroup===!0&&(n.isCluster?.(e,t)??!0)}t(q,`shouldPaintAsCluster`);function J(e){let t=new Map;for(let n of e)n?.id&&t.set(n.id,n);return t}t(J,`buildNodeLookup`);function Y(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}t(Y,`shouldSkipPaintEdge`);async function X(e,t,n,r,i,a){let o=p(e.edgePaths,{...t},i.clusterDb??new Map,r.type,Z(t.start,t,n,a,i),Z(t.end,t,n,a,i),r.diagramId,Q(t,i));h(t)&&(m.has(t.id)||await d(e.edgeLabels,t),$(t,o))}t(X,`paintLayoutEdge`);function Z(e,t,n,r,i){return i.getEdgeNode?.(e,t,r)??(e?n.get(e)??{}:{})}t(Z,`getRenderedNode`);function Q(e,t){return typeof t.skipIntersect==`function`?t.skipIntersect(e):t.skipIntersect??!1}t(Q,`shouldSkipIntersect`);function $(e,t){let i=t?.updatedPath??t?.originalPath,o=r(),{subGraphTitleTotalMargin:s}=c({flowchart:o.flowchart??{}});if(e.label){let r=m.get(e.id),o=e.x,c=e.y;if(i){let r=a.calcLabelPosition(i);n.debug(`Moving label `+e.label+` from (`,o,`,`,c,`) to (`,r.x,`,`,r.y,`) abc88`),t?.updatedPath&&(o=r.x,c=r.y)}r.attr(`transform`,`translate(${o}, ${c+s/2})`)}if(e?.startLabelLeft){let t=_.get(e.id).startLeft,n=e?.x,r=e?.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.startLabelRight){let t=_.get(e.id).startRight,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.endLabelLeft){let t=_.get(e.id).endLeft,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.endLabelRight){let t=_.get(e.id).endRight,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}}t($,`positionRenderedEdgeLabel`);export{W as a,B as c,x as i,E as n,F as o,H as r,C as s,L as t}; \ No newline at end of file +import{t as e}from"./app-preload-helper.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import{b as r,x as i}from"./app-chunk-O7XYJQB3.js";import{g as a}from"./app-chunk-ZIGJFQKS.js";import{o}from"./app-chunk-7INBJB4K.js";import{i as s,n as c,r as l,t as u}from"./app-chunk-5DYCD2WN.js";import{r as d,t as f}from"./app-chunk-UA2S7LBM.js";import{a as p,c as m,i as h,n as g,r as _,t as ee,u as v}from"./app-chunk-Z7XXMR3K.js";import{t as y}from"./app-graphlib.js";function b(e,{edgePathsClass:t=`edges edgePaths`}={}){let n=e.insert(`g`).attr(`class`,`root`);return{clusters:n.insert(`g`).attr(`class`,`clusters`),edgePaths:n.insert(`g`).attr(`class`,t),edgeLabels:n.insert(`g`).attr(`class`,`edgeLabels`),nodes:n.insert(`g`).attr(`class`,`nodes`),rootGroups:n}}t(b,`createLayoutElementGroups`);async function x(e,t,n){if(t.label){let{shapeSvg:r,bbox:i}=await o(e,n===void 0?t:{...t,width:n});t.labelBBox={width:i.width,height:i.height},r.remove()}else t.labelBBox={width:0,height:0}}t(x,`measureGroupLabel`);async function S(e,t,n){let r=await l(e,t,n),i=r.node()?.getBBox()??{width:0,height:0};return t.width=i.width,t.height=i.height,r}t(S,`insertMeasuredNode`);function C(e,t,n){let r=e,i=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||i.has(r.parentId))break;i.add(r.parentId),r=t.get(r.parentId)}return n}t(C,`resolveNodeDir`);async function w(t,n,r={}){let a=new y({multigraph:!0,compound:!0}),o=[...n.edges],s=i(),c=b(t),{edgeLabels:l,nodes:u}=c,d=new Map,f=new Map(n.nodes.map(e=>[e.id,e])),m=n.direction,h=t.node()!=null;await Promise.all(n.nodes.map(async e=>{if(e.isGroup){if(h){let t=r.unwrapGroupLabels&&e.labelType!==`markdown`;await x(u,e,t?1/0:void 0)}a.setNode(e.id,{...e})}else{if(h){let t=await S(u,e,{config:s,dir:C(e,f,m)});d.set(e.id,t)}a.setNode(e.id,{...e})}}));for(let e of o)h&&_(e)&&await p(l,e),a.setEdge(e.start,e.end,{...e},e.id),n.edges.some(t=>t.id===e.id)||n.edges.push(e);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:r}=await e(async()=>{let{captureNodeSizes:e}=await import(`./app-sizeCapture-INFHLROL.js`);return{captureNodeSizes:e}},__vite__mapDeps([0,1]));r(t,n)}return{graph:a,groups:c,nodeElements:d}}t(w,`createGraphWithElements`);var T=new Map,E=new Map,D=new Map,O=t(()=>{E.clear(),D.clear(),T.clear()},`clear`),k=t((e,t)=>{let r=E.get(t)||[];return n.trace(`In isDescendant`,t,` `,e,` = `,r.includes(e)),r.includes(e)},`isDescendant`),A=t((e,t)=>{let r=E.get(t)||[];return n.info(`Descendants of `,t,` is `,r),n.info(`Edge is `,e),e.v===t||e.w===t?!1:r?r.includes(e.v)||k(e.v,t)||k(e.w,t)||r.includes(e.w):(n.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),j=t((e,t,r,i)=>{n.debug(`Copying children of `,e,`root`,i,`data`,t.node(e),i);let a=t.children(e)||[];e!==i&&a.push(e),n.debug(`Copying (nodes) clusterId`,e,`nodes`,a),a.forEach(a=>{if(t.children(a).length>0)j(a,t,r,i);else{let o=t.node(a);n.info(`cp `,a,` to `,i,` with parent `,e),r.setNode(a,o),i!==t.parent(a)&&(n.debug(`Setting parent`,a,t.parent(a)),r.setParent(a,t.parent(a))),e!==i&&a!==e?(n.debug(`Setting parent`,a,e),r.setParent(a,e)):(n.info(`In copy `,e,`root`,i,`data`,t.node(e),i),n.debug(`Not Setting parent for node=`,a,`cluster!==rootId`,e!==i,`node!==clusterId`,a!==e));let s=t.edges(a);n.debug(`Copying Edges`,s),s.forEach(a=>{n.info(`Edge`,a);let o=t.edge(a.v,a.w,a.name);n.info(`Edge data`,o,i);try{A(a,i)?(n.info(`Copying as `,a.v,a.w,o,a.name),r.setEdge(a.v,a.w,o,a.name),n.info(`newGraph edges `,r.edges(),r.edge(r.edges()[0]))):n.info(`Skipping copy of edge `,a.v,`-->`,a.w,` rootId: `,i,` clusterId:`,e)}catch(e){n.error(e)}})}n.debug(`Removing node`,a),t.removeNode(a)})},`copy`),M=t((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)D.set(i,e),r=[...r,...M(i,t)];return r},`extractDescendants`),N=t((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),P=t((e,t,r)=>{let i=t.children(e);if(n.trace(`Searching children of id `,e,i),i.length<1)return e;let a;for(let e of i){let n=P(e,t,r),i=N(t,r,n);if(n)if(i.length>0)a=n;else return n}return a},`findNonClusterChild`),F=t(e=>!T.has(e)||!T.get(e).externalConnections?e:T.has(e)?T.get(e).id:e,`getAnchorId`),I=t((e,t)=>{if(!e||t>10){n.debug(`Opting out, no graph `);return}n.debug(`Opting in, graph `),e.nodes().forEach(function(t){e.children(t).length>0&&(n.debug(`Cluster identified`,t,` Replacement id in edges: `,P(t,e,t)),E.set(t,M(t,e)),T.set(t,{id:P(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let r=e.children(t),i=e.edges();r.length>0?(n.debug(`Cluster identified`,t,E),i.forEach(e=>{k(e.v,t)^k(e.w,t)&&(n.debug(`Edge: `,e,` leaves cluster `,t),n.debug(`Descendants of XXX `,t,`: `,E.get(t)),T.get(t).externalConnections=!0)})):n.debug(`Not a cluster `,t,E)});for(let t of T.keys()){let n=T.get(t).id,r=e.parent(n);r!==t&&T.has(r)&&!T.get(r).externalConnections&&(T.get(t).id=r);let i=e.edges().some(e=>e.v===t);if(n&&T.get(t)?.externalConnections&&i&&B(e,n,t)){let r=V(e,t,e.parent(n));r&&(T.get(t).id=r)}}e.edges().forEach(function(t){let r=e.edge(t);n.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),n.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let i=t.v,a=t.w;if(n.debug(`Fix XXX`,T,`ids:`,t.v,t.w,`Translating: `,T.get(t.v),` --- `,T.get(t.w)),T.get(t.v)||T.get(t.w)){if(n.debug(`Fixing and trying - removing XXX`,t.v,t.w,t.name),i=F(t.v),a=F(t.w),e.removeEdge(t.v,t.w,t.name),i!==t.v){let n=e.parent(i);T.get(n).externalConnections=!0,r.fromCluster=t.v}if(a!==t.w){let n=e.parent(a);T.get(n).externalConnections=!0,r.toCluster=t.w}n.debug(`Fix Replacing with XXX`,i,a,t.name),e.setEdge(i,a,r,t.name)}}),L(e,0),n.trace(T)},`adjustClustersAndEdges`),L=t((e,t)=>{if(t>10){n.error(`Bailing out`);return}let r=e.nodes(),i=!1;for(let t of r){let n=e.children(t);i||=n.length>0}if(!i){n.debug(`Done, no node has children`,e.nodes());return}n.debug(`Nodes = `,r,t);for(let i of r)if(n.debug(`Extracting node`,i,T,T.has(i)&&!T.get(i).externalConnections,!e.parent(i),e.node(i),e.children(`D`),` Depth `,t),!T.has(i))n.debug(`Not a cluster`,i,t);else if(!T.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){n.debug(`Cluster without external connections, without a parent and with children`,i,t);let r=e.graph().rankdir===`TB`?`LR`:`TB`;T.get(i)?.clusterData?.dir&&(r=T.get(i).clusterData.dir,n.debug(`Fixing dir`,T.get(i).clusterData.dir,r));let a=new y({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});j(i,e,a,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:T.get(i).clusterData,label:T.get(i).label,graph:a})}else n.debug(`Cluster ** `,i,` **not meeting the criteria !externalConnections:`,!T.get(i).externalConnections,` no parent: `,!e.parent(i),` children `,e.children(i)&&e.children(i).length>0,e.children(`D`),t),n.debug(T);r=e.nodes(),n.debug(`New list of nodes`,r);for(let i of r){let r=e.node(i);n.debug(` Now next level`,i,r),r?.clusterNode&&L(r.graph,t+1)}},`extractor`),R=t((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=R(e,e.children(t));n=[...n,...r]}),n},`sorter`),z=t(e=>R(e,e.children()),`sortNodesByHierarchy`),B=t((e,t,n)=>{let r=e.parent(t);for(;r&&r!==n;){let t=T.get(r);if(t&&!t.externalConnections)return!0;r=e.parent(r)}return!1},`isNodeInExtractableCluster`),V=t((e,t,n)=>{let r=e.children(t)??[];for(let i of r){if(i===n||k(i,n))continue;let r=P(i,e,t);if(r&&!B(e,r,t))return r}return null},`findSafeAnchorNode`);function H({prepareLayout:e,measureLayout:n,runLayoutCore:r,paintLayout:i,afterPaint:a,paintOptions:o}){let s=n??W;return t(async function(t,n,c,l){let u=n.select(`g`);(c?.insertMarkers??m)(u,t.markers,t.type,t.diagramId),U();let d={element:u,helpers:c,options:l};d.preparedLayout=await e?.(t,d);let f=await s(t,d),p=await r(t,d),h={...d,measure:f};i?await i(t,h,p):await G(t,h,o),await a?.(t,h,p)},`render`)}t(H,`createCommonLayoutRenderer`);function U(){u(),ee(),f(),O()}t(U,`clearLayoutRenderState`);async function W(e,{element:t},n){return await w(t,e,n)}t(W,`defaultMeasureLayout`);async function G(e,t,n={}){let{measure:r}=t,{groups:i}=r;for(let r of n.getNodes?.(e,t)??e.nodes)n.skipNode?.(r,t)||await K(i,r,t,n);let a=J(e.nodes);for(let r of e.edges)Y(r,n)||await X(i,r,a,e,n,t)}t(G,`paintLayoutData`);async function K(e,t,n,r){t.clusterNode?s(t):q(t,n,r)?await d(e.clusters,t):s(t)}t(K,`paintLayoutNode`);function q(e,t,n){return e.isGroup===!0&&(n.isCluster?.(e,t)??!0)}t(q,`shouldPaintAsCluster`);function J(e){let t=new Map;for(let n of e)n?.id&&t.set(n.id,n);return t}t(J,`buildNodeLookup`);function Y(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}t(Y,`shouldSkipPaintEdge`);async function X(e,t,n,r,i,a){let o=h(e.edgePaths,{...t},i.clusterDb??new Map,r.type,Z(t.start,t,n,a,i),Z(t.end,t,n,a,i),r.diagramId,Q(t,i));_(t)&&(g.has(t.id)||await p(e.edgeLabels,t),$(t,o))}t(X,`paintLayoutEdge`);function Z(e,t,n,r,i){return i.getEdgeNode?.(e,t,r)??(e?n.get(e)??{}:{})}t(Z,`getRenderedNode`);function Q(e,t){return typeof t.skipIntersect==`function`?t.skipIntersect(e):t.skipIntersect??!1}t(Q,`shouldSkipIntersect`);function $(e,t){let i=t?.updatedPath??t?.originalPath,o=r(),{subGraphTitleTotalMargin:s}=c({flowchart:o.flowchart??{}});if(e.label){let r=g.get(e.id),o=e.x,c=e.y;if(i){let r=a.calcLabelPosition(i);n.debug(`Moving label `+e.label+` from (`,o,`,`,c,`) to (`,r.x,`,`,r.y,`) abc88`),t?.updatedPath&&(o=r.x,c=r.y)}r.attr(`transform`,`translate(${o}, ${c+s/2})`)}if(e?.startLabelLeft){let t=v.get(e.id).startLeft,n=e?.x,r=e?.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.startLabelRight){let t=v.get(e.id).startRight,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.endLabelLeft){let t=v.get(e.id).endLeft,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.endLabelRight){let t=v.get(e.id).endRight,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}}t($,`positionRenderedEdgeLabel`);export{W as a,z as c,b as i,T as n,P as o,H as r,S as s,I as t}; \ No newline at end of file diff --git a/web/dist/app-chunk-7INBJB4K.js b/web/dist/app-chunk-7INBJB4K.js index 529c81f17..1066e2439 100644 --- a/web/dist/app-chunk-7INBJB4K.js +++ b/web/dist/app-chunk-7INBJB4K.js @@ -1,31 +1,31 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{A as r,B as i,M as a,T as o,b as s,f as c,g as l,x as u,z as d}from"./app-chunk-O7XYJQB3.js";import{a as f,p,r as m,u as h}from"./app-chunk-ZIGJFQKS.js";import{n as g,t as _}from"./app-chunk-742MDFTN.js";import{n as v,r as y}from"./app-chunk-MBY4JIJT.js";import{a as b,i as x,r as S,t as C}from"./app-chunk-7PRAP22T.js";import{s as w}from"./app-chunk-J5ZVWO5B.js";import{t as T}from"./app-rough.esm.js";var E=1,D=3;async function O(t){let n=t.getElementsByTagName(`img`);if(!n||n.length===0)return;let r=!k(t);await Promise.all([...n].map(t=>new Promise(n=>{function i(){if(t.style.display=`flex`,t.style.flexDirection=`column`,r){let e=u().fontSize?u().fontSize:window.getComputedStyle(document.body).fontSize,[n=c.fontSize]=p(e),r=n*5+`px`;t.style.minWidth=r,t.style.maxWidth=r}else t.style.width=`100%`;n(t)}e(i,`setupImage`),setTimeout(()=>{t.complete&&i()}),t.addEventListener(`error`,i),t.addEventListener(`load`,i)})))}e(O,`configureLabelImages`);function k(e){return e.nodeType===D?e.textContent?.trim()!==``:e.nodeType!==E||e.tagName.toLowerCase()===`img`?!1:[...e.childNodes].some(k)}e(k,`hasTextBesidesImages`);var A=3,j=32,M=e(async(e,t,r)=>{let i=u(),a=e.insert(`g`).attr(`class`,r??`node default`).attr(`id`,t.domId||t.id),o=a.insert(`g`).attr(`class`,`label`).attr(`style`,h(t.labelStyle)),s=[{text:typeof t.label==`string`?t.label:t.label?.[0]??``,cssClass:`c4-name`},{text:t.stereotype,cssClass:`c4-type`},...(t.description??[]).map(e=>({text:e,cssClass:`c4-descr`}))].filter(e=>e.text),c=t.width?Math.max(t.width-2*(t.padding??0),j):u().flowchart?.wrappingWidth??200,l=i.c4?.wrap??!0?c:1/0,p=await Promise.all(s.map(async e=>{let r=o.append(`g`).attr(`class`,e.cssClass),a=await v(r,d(f(e.text??``),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:l,style:t.labelStyle},i);return n(a).selectAll(`tspan.text-outer-tspan`).attr(`text-anchor`,`middle`),n(a).selectAll(`tspan.text-inner-tspan`).attr(`font-weight`,null).attr(`font-style`,null),{el:r,box:r.node().getBBox()}})),m=Math.max(...p.map(({box:e})=>e.width),0),g=0;for(let{el:e,box:t}of p)e.attr(`transform`,`translate(${m/2-t.x-t.width/2}, ${g-t.y})`),g+=t.height+A;let _=p.length>0?g-A:0;return o.insert(`rect`,`:first-child`),o.attr(`transform`,`translate(${-m/2}, ${-_/2})`),{shapeSvg:a,bbox:o.node().getBBox(),halfPadding:(t.padding??0)/2,label:o}},`c4LabelHelper`),N=e((t,n)=>{let{x:r,y:i,width:a,height:o}=t;return a>=n?t:`left`in t?{x:r,y:i,width:n,height:o,top:i,left:r,bottom:i+o,right:r+n,toJSON:e(()=>({}),`toJSON`)}:{x:r-(n-a)/2,y:i,width:n,height:o}},`withMinWidth`),P=e(async(e,t,r)=>{if(t.stereotype!==void 0)return M(e,t,r);let i,a=t.useHtmlLabels||l(u()?.htmlLabels);i=r||`node default`;let o=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),s=o.insert(`g`).attr(`class`,`label`).attr(`style`,h(t.labelStyle)),c;c=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let p=!!t.icon||!!t.img,m=t.labelType===`markdown`,g=c&&!t.width?t.minWidth??0:0,_=await v(s,d(f(c),u()),{useHtmlLabels:a,width:t.width||t.wrappingWidth||u().flowchart?.wrappingWidth,minWidth:g,classes:m?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:p,markdown:m},u()),b=(t?.padding??0)/2,x;if(a){let e=_.children[0],t=n(_);await O(e),x=await y.measure(()=>e.getBoundingClientRect()),x=N(x,g),t.attr(`width`,x.width),t.attr(`height`,x.height)}else x=await y.measure(()=>_.getBBox()),x=N(x,g);return a?s.attr(`transform`,`translate(`+-x.width/2+`, `+-x.height/2+`)`):s.attr(`transform`,`translate(0, `+-x.height/2+`)`),t.centerLabel&&s.attr(`transform`,`translate(`+-x.width/2+`, `+-x.height/2+`)`),s.insert(`rect`,`:first-child`),{shapeSvg:o,bbox:x,halfPadding:b,label:s}},`labelHelper`),F=e(async(e,t,r)=>{let i=r.useHtmlLabels??o(u()),a=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await v(a,d(f(t),u()),{useHtmlLabels:i,width:r.width||u()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),c=r.padding/2,l;if(o(u())){let e=s.children[0],t=n(s);l=await y.measure(()=>e.getBoundingClientRect()),t.attr(`width`,l.width),t.attr(`height`,l.height)}else l=await y.measure(()=>s.getBBox());return i?a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`):a.attr(`transform`,`translate(0, `+-l.height/2+`)`),r.centerLabel&&a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`),a.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:l,halfPadding:c,label:a}},`insertLabel`),I=e((e,t,n)=>{if(n){e.width=n.width,e.height=n.height;return}let r=t.node().getBBox();e.width=r.width,e.height=r.height},`updateNodeBounds`),L=e((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function R(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}e(R,`createPathFromPoints`);function z(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}e(z,`generateFullSineWavePoints`);function B(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;ie.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=e((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}e(ee,`mergePaths`);var V=e((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`);function te(e,t){return e.intersect(t)}e(te,`intersectNode`);var H=te;function U(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x0}e(G,`sameSign`);var ae=W;function oe(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),se=e(async(e,t,n,r=!1,i=!1)=>{let a=t||``;typeof a==`object`&&(a=a[0]);let s=u(),c=o(s);return await v(e,a,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`);function ce(e,n){let{labelStyles:r}=x(n);n.labelStyle=r;let i=L(n),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=T.svg(o),l=b(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,h(s)),I(n,d),n.intersect=function(e){return t.info(`Circle intersect`,n,1,e),K.circle(n,1,e)},o}e(ce,`anchor`);function le(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}e(le,`generateArcPoints`);function ue(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}e(ue,`calculateArcSagitta`);async function de(t,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=e(e=>e+s,`calcTotalHeight`),l=e(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await P(t,n,L(n)),f=c(n?.height?n?.height:d.height),[p,m]=l(f),h=ue(f,p,m),g=(n?.width?n?.width:d.width)+o*2+h-h,_=f,{cssStyles:v}=n,y=[{x:g/2,y:-_/2},{x:-g/2,y:-_/2},...le(-g/2,-_/2,-g/2,_/2,p,m,!1),{x:g/2,y:_/2},...le(g/2,_/2,g/2,-_/2,p,m,!0)],S=T.svg(u),C=b(n,{});n.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let w=R(y),E=S.path(w,C),D=u.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),v&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,v),i&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,i),D.attr(`transform`,`translate(${p/2}, 0)`),I(n,D),n.intersect=function(e){return K.polygon(n,y,e)},u}e(de,`bowTieRect`);async function fe(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=x(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await P(t,n,L(n)),l=r?.nodeBorder??r?.lineColor??`currentColor`,u=n.padding??12,d=Math.max(s.width+u*2,n.width??0,80),f=Math.max(Math.min(d*.08,12),5),p=Math.max(s.height+u*2+f,n.height??0),m=-p/2+f,h=p/2,g=d*.72,_=[`M${-d/2},${m}`,`L${-g/2},${h}`,`A${g/2},${f} 0 0 0 ${g/2},${h}`,`L${d/2},${m}`,`A${d/2},${f} 0 0 0 ${-d/2},${m}`,`Z`].join(` `),{cssStyles:v}=n,y=o.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(n.look===`handDrawn`){let e=T.svg(o).path(_,b(n,{}));y.node()?.appendChild(e),v&&y.attr(`style`,v)}else y.append(`path`).attr(`d`,_).attr(`style`,a);y.append(`ellipse`).attr(`cx`,0).attr(`cy`,m).attr(`rx`,d/2).attr(`ry`,f).attr(`style`,`fill:none;stroke:${l};stroke-width:1px`),I(n,y);let S=m+(h-m)/2;c.attr(`transform`,`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${S-s.height/2-(s.y-(s.top??0))})`);let C=e((e,t,n)=>Array.from({length:13},(r,i)=>{let a=Math.PI-i*Math.PI/12;return{x:e*Math.cos(a),y:t+n*f*Math.sin(a)}}),`arc`),w=[...C(d/2,m,-1),...C(g/2,h,1).reverse()];return n.intersect=function(e){return K.polygon(n,w,e)},o}e(fe,`bucket`);var pe=20,me=8,he=80,ge=8;function _e(e){let{themeVariables:t}=u(),n=t.clusterBkg,r=t.clusterBorder;switch(e){case`flow`:return{rx:10,fill:`none`,stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:`flow-collapsed`};default:return{rx:ge,fill:n,stroke:r,cssClass:`collapsed-group`}}}e(_e,`getCollapsedStyle`);async function ve(e,t){let n=_e(t.metadata?.containerType),{fill:r,stroke:i}=n,{nodeStyles:a}=x(t),{shapeSvg:s,bbox:c}=await P(e,t,L(t)),{theme:l,themeVariables:d}=u();w(s,t.colorIndex,l,d.borderColorArray);let f=t.padding??8,p=c.height,m=Math.max(c.width+f*2,he,t?.width??0),g=Math.max(p+me+pe+f*2,t?.height??0),_=-m/2,v=-g/2,y=-(me+pe)/2,S=s.select(`.label`);S&&(t.useHtmlLabels??o(u())?S.attr(`transform`,`translate(${-c.width/2}, ${-c.height/2+y})`):S.attr(`transform`,`translate(0, ${-c.height/2+y})`));let C;if(t.look===`handDrawn`){let e=T.svg(s),a=b(t,{fill:r,stroke:i,...n.strokeWidth===void 0?{}:{strokeWidth:n.strokeWidth},...r===`none`?{fillWeight:0}:{fillStyle:`solid`}}),o=e.path(q(_,v,m,g,n.rx),a);C=s.insert(()=>o,`:first-child`),C.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,h(t.cssStyles))}else C=s.insert(`rect`,`:first-child`),C.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,a).attr(`rx`,n.rx).attr(`ry`,n.rx).attr(`x`,_).attr(`y`,v).attr(`width`,m).attr(`height`,g).attr(`fill`,r).attr(`stroke`,i),n.strokeWidth!==void 0&&C.attr(`stroke-width`,n.strokeWidth+`px`);let E=v+f+p+me;s.append(`line`).attr(`class`,`collapsed-separator`).attr(`x1`,_+8).attr(`y1`,E).attr(`x2`,_+m-8).attr(`y2`,E).attr(`stroke`,i).attr(`stroke-dasharray`,`3, 3`);let D=E+pe/2;for(let e=-1;e<=1;e++)s.append(`circle`).attr(`class`,`collapsed-indicator`).attr(`cx`,e*10).attr(`cy`,D).attr(`r`,2.5).attr(`fill`,i);return I(t,C),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},s}e(ve,`collapsedGroup`);function J(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}e(J,`insertPolygonShape`);var ye=[`right`,`left`,`up`,`down`],be=`point`,xe=e(e=>{let t=new Set;for(let n of e)switch(n){case`x`:t.add(`right`),t.add(`left`);break;case`y`:t.add(`up`),t.add(`down`);break;default:t.add(n)}return t},`expandAndDeduplicateDirections`),Se=e(e=>ye.filter(t=>e.has(t)).join(`|`)||be,`getDirectionKey`),Ce={"right|left|up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*n},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*n,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*n},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*n,y:-e/2},{x:0,y:-e/3}],`right|left|up|down`),"right|left|up":e(({height:e,midpoint:t,width:n})=>[{x:t,y:0},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],`right|left|up`),"right|left|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:t,y:-e},{x:n-t,y:-e},{x:n,y:0}],`right|left|down`),"right|up|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:n,y:-e+t},{x:0,y:-e}],`right|up|down`),"left|up|down":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:n,y:-e}],`left|up|down`),"right|left":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`right|left`),"up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`up|down`),"right|up":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:0,y:-e}],`right|up`),"right|down":e(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],`right|down`),"left|up":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:n,y:-e}],`left|up`),"left|down":e(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],`left|down`),right:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e+n}],`right`),left:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`left`),up:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n}],`up`),down:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`down`),[be]:()=>[{x:0,y:0}]},we=e((e,t,n,r)=>{let i=xe(e),a=(n.padding??0)/2,o=t.height+4*a,s=o/2,c=r??t.width+2*s+2*a;return(Ce[Se(i)]??Ce[be])({height:o,midpoint:s,padding:a,width:c})},`getArrowPoints`);async function Te(e,t){let n=t,{shapeSvg:r,bbox:i}=await P(e,n,L(n)),a=n.padding??0,o=i.height+2*a,s=o/2,c=i.width+2*s+a,l=n.width??0,u=n.positioned&&(n.widthInColumns??1)>1&&l>c?l:c,d=we(n.directions??[],i,n,u),f=J(r,u,o,d);return f.attr(`style`,n.style??null),I(n,f),n.intersect=function(e){return K.polygon(n,d,e)},r}e(Te,`block_arrow`);async function Ee(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await P(e,t,L(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+18,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=T.svg(a).path(q(-u/2,f,u,d,12),b(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`line`).attr(`x1`,-u/2).attr(`y1`,f+18).attr(`x2`,u/2).attr(`y2`,f+18).attr(`style`,`stroke:${c};stroke-width:1px`);for(let e=0;e<3;e++)m.append(`circle`).attr(`cx`,-u/2+12+e*9).attr(`cy`,f+18/2).attr(`r`,2.5).attr(`style`,`fill:${c};stroke:none`);m.append(`rect`).attr(`class`,`browser-address-bar`).attr(`x`,-u/2+44).attr(`y`,f+4).attr(`width`,Math.max(u-56,10)).attr(`height`,10).attr(`rx`,3).attr(`ry`,3).attr(`style`,`fill:none;stroke:${c};stroke-width:1px;opacity:0.6`),I(t,m);let h=f+18+(d-18)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Ee,`browser`);var De=12;async function Oe(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+De),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+De,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+De},{x:0+De,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(p),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=J(s,l,u,p);return r&&m.attr(`style`,r),I(t,m),t.intersect=function(e){return K.polygon(t,p,e)},s}e(Oe,`card`);function ke(e,t){let{nodeStyles:n}=x(t);t.label=``;let r=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=T.svg(r),c=b(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=R(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return K.polygon(t,o,e)},r}e(ke,`choice`);async function Ae(e,n,r){let{labelStyles:i,nodeStyles:a}=x(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await P(e,n,L(n)),l=r?.padding??c,u=Math.sqrt(s.width**2+s.height**2)/2,d=n.look===`neo`?u+32:u+l,f,{cssStyles:p}=n;if(n.look===`handDrawn`){let e=T.svg(o),t=b(n,{}),r=e.circle(0,0,d*2,t);f=o.insert(()=>r,`:first-child`),f.attr(`class`,`basic label-container`).attr(`style`,h(p))}else f=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,d).attr(`cx`,0).attr(`cy`,0);return I(n,f),n.calcIntersect=function(e,t){let n=e.width/2;return K.circle(e,n,t)},n.intersect=function(e){return t.info(`Circle intersect`,n,d,e),K.circle(n,d,e)},o}e(Ae,`circle`);async function je(e,t){let n=t,{shapeSvg:r,bbox:i,halfPadding:a}=await P(e,n,[`node`,n.cssClasses,n.class].filter(Boolean).join(` `)),o=r.insert(`rect`,`:first-child`),s=n.padding??0,c=n.positioned?n.width??0:i.width+s,l=n.positioned?n.height??0:i.height+s,u=n.positioned?-c/2:-i.width/2-a,d=n.positioned?-l/2:-i.height/2-a;return o.attr(`class`,`basic cluster composite label-container`).attr(`style`,n.style??null).attr(`rx`,n.rx??null).attr(`ry`,n.ry??null).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l),I(n,o),n.intersect=function(e){return K.rect(n,e)},r}e(je,`composite`);async function Me(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await P(e,t,L(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+20,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=T.svg(a).path(q(-u/2,f,u,d,12),b(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`text`).attr(`x`,-u/2+12).attr(`y`,f+16).attr(`class`,`console-glyph`).attr(`style`,`font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(`>_`),I(t,m);let h=f+20+(d-20)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Me,`consoleWindow`);function Ne(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y} - M ${i.x},${i.y} L ${o.x},${o.y}`}e(Ne,`createLine`);function Pe(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r,n.label=``;let a=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),o=Math.max(30,n?.width??0),{cssStyles:s}=n,c=T.svg(a),l=b(n,{});n.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=Ne(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),s&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,s),i&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,i),I(n,p),n.intersect=function(e){return t.info(`crossedCircle intersect`,n,{radius:o,point:e}),K.circle(n,o,e)},a}e(Pe,`crossedCircle`);function Y(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;iS,`:first-child`).attr(`stroke-opacity`,0),C.insert(()=>v,`:first-child`),C.attr(`class`,`text`),f&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),C.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Fe,`curlyBraceLeft`);function X(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;iS,`:first-child`).attr(`stroke-opacity`,0),C.insert(()=>v,`:first-child`),C.attr(`class`,`text`),f&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),C.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Ie,`curlyBraceRight`);function Z(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;iE,`:first-child`).attr(`stroke-opacity`,0),D.insert(()=>y,`:first-child`),D.insert(()=>C,`:first-child`),D.attr(`class`,`text`),f&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,D),t.intersect=function(e){return K.polygon(t,h,e)},i}e(Le,`curlyBraces`);async function Re(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(5,c.height+o*2,t?.height??0),u=l/2,d=u-Math.sqrt(Math.max(0,u**2-(c.height/2)**2)),f=Math.max(l/4,d),p=Math.max(20,c.width+a*2+f*2,(c.width+a*2)*1.25,t?.width??0),{cssStyles:m}=t,h=T.svg(s),g=b(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=p,v=l,y=_-u,S=v/4,C=[{x:y,y:0},{x:S,y:0},{x:0,y:v/2},{x:S,y:v},{x:y,y:v},...B(-y,-v/2,u,50,270,90)],w=R(C),E=h.path(w,g),D=s.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&D.selectChildren(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&D.selectChildren(`path`).attr(`style`,r),D.attr(`transform`,`translate(${-p/2}, ${-l/2})`),I(t,D),t.intersect=function(e){return K.polygon(t,C,e)},s}e(Re,`curvedTrapezoid`);async function ze(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??20,c=Math.max(a.width+s*2,t.width??0,100),l=Math.min(Math.max(c*.23,16),56),u=l*.27,d=Math.max(a.height+s*2,t.height?t.height-(2*l-u):0),f=Math.min(c*.177,d*.45),p=d+2*l-u,m=-p/2,h=m+2*l-u,g=i.insert(`g`,`:first-child`).attr(`class`,`basic label-container`),{cssStyles:_}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=b(t,{}),r=e.path(q(-c/2,h,c,d,f),n),a=e.circle(0,m+l,l*2,n);g.insert(()=>a,`:first-child`),g.insert(()=>r,`:first-child`),_&&g.attr(`style`,_)}else g.append(`rect`).attr(`x`,-c/2).attr(`y`,h).attr(`width`,c).attr(`height`,d).attr(`rx`,f).attr(`ry`,f).attr(`style`,r),g.append(`circle`).attr(`cx`,0).attr(`cy`,m+l).attr(`r`,l).attr(`style`,r);I(t,g);let v=h+d/2;o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${v-a.height/2-(a.y-(a.top??0))})`);let y=m+l,S=Math.asin(Math.min(1,(h-y)/l))*180/Math.PI,C=[...B(0,-y,l,24,180+S,-S),...B(-(-c/2+f),-(h+f),f,12,90,0),...B(-(-c/2+f),-(p/2-f),f,12,360,270),...B(-(c/2-f),-(p/2-f),f,12,270,180),...B(-(c/2-f),-(h+f),f,12,180,90)];return t.intersect=function(e){return K.polygon(t,C,e)},i}e(ze,`person`);var Be=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),Ve=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),He=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Ue=8,We=8;async function Ge(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i,s=t.width??0;if(t.width&&(t.width-=o,t.widtho,`:first-child`),g=c.insert(()=>a,`:first-child`),g.attr(`class`,`basic label-container`),_&&g.attr(`style`,_)}else{let e=Be(0,0,d,m,f,p);g=c.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,h(_)).attr(`style`,r)}return g.attr(`label-offset-y`,p),g.attr(`transform`,`translate(${-d/2}, ${-(m/2+p)})`),I(t,g),u.attr(`transform`,`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(f!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-p)){let i=p*p*(1-r*r/(f*f));i>0&&(i=Math.sqrt(i)),i=p-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},c}e(Ge,`cylinder`);async function Ke(e,t,n){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await P(e,t,L(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:f,ry:p}=t,{cssStyles:m}=t;if(n?.rx&&n.ry&&(f=n.rx,p=n.ry),t.look===`handDrawn`){let e=T.svg(a),n=b(t,{}),r=f||p?e.path(q(l,u,s,c,f||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,h(m))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,h(f)).attr(`ry`,h(p)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return I(t,d,t.look===`handDrawn`?void 0:{width:s,height:c}),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},a}e(Ke,`drawRect`);async function qe(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await Ke(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=T.svg(c),n=b(t,{}),r=c.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return c;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return c;return c.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),c.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),c}let l=c.select(`.basic.label-container`),u=(Number(l.attr(`width`))||o)??0,d=(Number(l.attr(`height`))||s)??0;return u>0&&d>0&&l.attr(`stroke-dasharray`,`${u} ${d}`),c}e(qe,`datastore`);async function Je(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:m}=t,h=T.svg(o),g=b(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],v=h.polygon(_.map(e=>[e.x,e.y]),g),y=o.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(t.padding??0)/2-(s.y-(s.top??0))})`),I(t,y),t.intersect=function(e){return K.rect(t,e)},o}e(Je,`dividedRectangle`);async function Ye(e,n){let{labelStyles:r,nodeStyles:i}=x(n),a=n.look===`neo`?12:5;n.labelStyle=r;let o=n.padding??0,s=n.look===`neo`?16:o,{shapeSvg:c,bbox:l}=await P(e,n,L(n)),u=Math.sqrt(l.width**2+l.height**2)/2,d=(n?.width?n?.width/2:u)+(s??0),f=d+a,p,{cssStyles:m}=n;if(n.look===`handDrawn`){let e=T.svg(c),t=b(n,{roughness:.2,strokeWidth:2.5}),r=b(n,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,f*2,t),a=e.circle(0,0,d*2,r);p=c.insert(`g`,`:first-child`),p.attr(`class`,h(n.cssClasses)).attr(`style`,h(m)),p.node()?.appendChild(i),p.node()?.appendChild(a)}else{p=c.insert(`g`,`:first-child`);let e=p.insert(`circle`,`:first-child`),t=p.insert(`circle`);p.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,f).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return I(n,p),n.intersect=function(e){return t.info(`DoubleCircle intersect`,n,f,e),K.circle(n,f,e)},c}e(Ye,`doublecircle`);async function Xe(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o}=await P(e,t,L(t)),{theme:s,themeVariables:c}=u();w(i,t.colorIndex,s,c.borderColorArray);let l=o??10,d=a.width/2+l*2,f=a.height/2+l*2,p,{cssStyles:m}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=b(t,{}),r=e.ellipse(0,0,d*2,f*2,n);p=i.insert(()=>r,`:first-child`),p.attr(`class`,`basic label-container`),m&&p.attr(`style`,m)}else p=i.insert(`ellipse`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,r).attr(`rx`,d).attr(`ry`,f).attr(`cx`,0).attr(`cy`,0);return t.width=d*2,t.height=f*2,I(t,p),t.calcIntersect=function(e,t){let n=e.width/2,r=e.height/2;return K.ellipse(e,n,r,t)},t.intersect=function(e){return K.ellipse(t,d,f,e)},i}e(Xe,`usecaseEllipse`);function Ze(e,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=x(n);n.label=``,n.labelStyle=i;let o=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),{cssStyles:s}=n,c=T.svg(o),{nodeBorder:l}=r,u=b(n,{fillStyle:`solid`});n.look!==`handDrawn`&&(u.roughness=0);let d=c.circle(0,0,14,u),f=o.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),s&&s.length>0&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,s),a&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,a),I(n,f),n.intersect=function(e){return t.info(`filledCircle intersect`,n,{radius:7,point:e}),K.circle(n,7,e)},o}e(Ze,`filledCircle`);var Qe=10,$e=10;async function et(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.height=n?.height??0,n.heightv,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return m&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,m),i&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,i),n.width=u,n.height=d,I(n,y),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-d/2+(n.padding??0)/2+(c.y-(c.top??0))})`),n.intersect=function(e){return t.info(`Triangle intersect`,n,p,e),K.polygon(n,p,e)},s}e(et,`flippedTriangle`);async function tt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??12,c=Math.max(a.width+s*2,t.width??0,90),l=a.height+s*2,u=Math.max(Math.min(l*.16,14),8),d=Math.max(l+u,t.height??0),f=d-u,p=Math.max(c*.38,28),m=-d/2,h=[{x:-c/2,y:m},{x:-c/2+p,y:m},{x:-c/2+p,y:m+u},{x:c/2,y:m+u},{x:c/2,y:d/2},{x:-c/2,y:d/2}],g=[`M${h[0].x},${h[0].y}`,...h.slice(1).map(e=>`L${e.x},${e.y}`),`Z`].join(` `),{cssStyles:_}=t,v;if(t.look===`handDrawn`){let e=T.svg(i).path(g,b(t,{}));v=i.insert(()=>e,`:first-child`).attr(`class`,`basic label-container`),_&&v.attr(`style`,_)}else v=i.insert(`path`,`:first-child`).attr(`d`,g).attr(`class`,`basic label-container`).attr(`style`,r);t.look===`handDrawn`?I(t,v):I(t,v,{width:c,height:d});let y=m+u+f/2;return o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${y-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(e){return K.polygon(t,h,e)},i}e(tt,`folder`);function nt(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=x(t);t.label=``;let o=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);(n===`LR`||n===`RL`)&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=T.svg(o),p=b(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=f.rectangle(u,d,c,l,p),h=o.insert(()=>m,`:first-child`);s&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,a),I(t,h);let g=r?.padding??0;return t.width&&t.height&&(t.width+=g/2||0,t.height+=g/2||0),t.intersect=function(e){return K.rect(t,e)},o}e(nt,`forkJoin`);async function rt(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let a=n.look===`neo`?16:n.padding??0,o=n.look===`neo`?12:n.padding??0;(n.width||n.height)&&(n.height=(n?.height??0)-o*2,n.height<10&&(n.height=10),n.width=(n?.width??0)-a*2,n.width<15&&(n.width=15));let{shapeSvg:s,bbox:c}=await P(e,n,L(n)),l=(n?.height?n?.height:Math.max(10,c.height))+o*2,u=l/2,d=u-Math.sqrt(Math.max(0,u**2-(c.height/2)**2)),f=(n?.width?n?.width:Math.max(15,c.width)+d*2)+a*2,{cssStyles:p}=n,m=T.svg(s),h=b(n,{});n.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-f/2,y:-l/2},{x:f/2-u,y:-l/2},...B(-f/2+u,0,u,50,90,270),{x:f/2-u,y:l/2},{x:-f/2,y:l/2}],_=R(g),v=m.path(_,h),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),p&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,p),i&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,i),I(n,y),n.intersect=function(e){return t.info(`Pill intersect`,n,{radius:u,point:e}),K.polygon(n,g,e)},s}e(rt,`halfRoundedRectangle`);var it=e((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function at(e,t){let{labelStyles:n,nodeStyles:r}=x(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await P(e,t,L(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,f=(t?.width?t?.width:l.width)+2*d+s,p=[{x:d,y:0},{x:f-d,y:0},{x:f,y:-u/2},{x:f-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=T.svg(c),n=b(t,{}),r=it(0,0,f,u,d),i=e.path(r,n);m=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-f/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=J(c,f,u,p);return r&&m.attr(`style`,r),t.width=f,t.height=u,I(t,m),t.intersect=function(e){return K.polygon(t,p,e)},c}e(at,`hexagon`);async function ot(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.label=``,n.labelStyle=r;let{shapeSvg:a}=await P(e,n,L(n)),o=Math.max(30,n?.width??0),s=Math.max(30,n?.height??0),{cssStyles:c}=n,l=T.svg(a),u=b(n,{});n.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],f=R(d),p=l.path(f,u),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container outer-path`),c&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,c),i&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,i),m.attr(`transform`,`translate(${-o/2}, ${-s/2})`),I(n,m),n.intersect=function(e){return t.info(`Pill intersect`,n,{points:d}),K.polygon(n,d,e)},a}e(ot,`hourglass`);async function st(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await P(e,n,`icon-shape default`),p=n.pos===`t`,m=c,h=c,{nodeBorder:g}=r,{stylesMap:v}=C(n),y=-h/2,S=-m/2,w=n.label?8:0,E=T.svg(u),D=b(n,{stroke:`none`,fill:`none`});n.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(y,S,h,m,D),k=Math.max(h,d.width),A=m+d.height+w,j=E.rectangle(-k/2,-A/2,k,A,{...D,fill:`transparent`,stroke:`none`}),M=u.insert(()=>O,`:first-child`),N=u.insert(()=>j);if(n.icon){let e=u.append(`g`);e.html(`${await _(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+w/2-i/2-o:-d.height/2-w/2-i/2-o})`),e.attr(`style`,`color: ${v.get(`stroke`)??g};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-A/2:A/2-d.height})`),M.attr(`transform`,`translate(0,${p?d.height/2+w/2:-d.height/2-w/2})`),I(n,N),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=p?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+w},{x:r+h/2,y:i-a/2+d.height+w},{x:r+h/2,y:i+a/2},{x:r-h/2,y:i+a/2},{x:r-h/2,y:i-a/2+d.height+w},{x:r-d.width/2,y:i-a/2+d.height+w}]:[{x:r-h/2,y:i-a/2},{x:r+h/2,y:i-a/2},{x:r+h/2,y:i-a/2+m},{x:r+d.width/2,y:i-a/2+m},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+m},{x:r-h/2,y:i-a/2+m}],K.polygon(n,o,e)},u}e(st,`icon`);async function ct(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await P(e,n,`icon-shape default`),p=n.label?8:0,m=n.pos===`t`,{nodeBorder:h,mainBkg:g}=r,{stylesMap:v}=C(n),y=T.svg(u),S=b(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`),S.stroke=v.get(`fill`)??g;let w=u.append(`g`);n.icon&&w.html(`${await _(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let E=w.node().getBBox(),D=E.width,O=E.height,k=E.x,A=E.y,j=Math.max(D,O)*Math.SQRT2+40,M=y.circle(0,0,j,S),N=Math.max(j,d.width),F=j+d.height+p,L=y.rectangle(-N/2,-F/2,N,F,{...S,fill:`transparent`,stroke:`none`}),R=u.insert(()=>M,`:first-child`),z=u.insert(()=>L);return w.attr(`transform`,`translate(${-D/2-k},${m?d.height/2+p/2-O/2-A:-d.height/2-p/2-O/2-A})`),w.attr(`style`,`color: ${v.get(`stroke`)??h};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-F/2:F/2-d.height})`),R.attr(`transform`,`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),I(n,z),n.intersect=function(e){return t.info(`iconSquare intersect`,n,e),K.rect(n,e)},u}e(ct,`iconCircle`);async function lt(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await P(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,g=c+f*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:S}=C(n),w=-g/2,E=-h/2,D=n.label?8:0,O=T.svg(u),k=b(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=S.get(`fill`)??y;let A=O.path(q(w,E,g,h,5),k),j=Math.max(g,d.width),M=h+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),F=u.insert(()=>A,`:first-child`).attr(`class`,`icon-shape2`),L=u.insert(()=>N);if(n.icon){let e=u.append(`g`);e.html(`${await _(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${S.get(`stroke`)??v};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-M/2:M/2-d.height})`),F.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),I(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+g/2,y:i-a/2+d.height+D},{x:r+g/2,y:i+a/2},{x:r-g/2,y:i+a/2},{x:r-g/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-g/2,y:i-a/2},{x:r+g/2,y:i-a/2},{x:r+g/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-g/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(lt,`iconRounded`);async function ut(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await P(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,g=c+f*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:S}=C(n),w=-g/2,E=-h/2,D=n.label?8:0,O=T.svg(u),k=b(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=S.get(`fill`)??y;let A=O.path(q(w,E,g,h,.1),k),j=Math.max(g,d.width),M=h+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),F=u.insert(()=>A,`:first-child`),L=u.insert(()=>N);if(n.icon){let e=u.append(`g`);e.html(`${await _(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${S.get(`stroke`)??v};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-M/2:M/2-d.height})`),F.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),I(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+g/2,y:i-a/2+d.height+D},{x:r+g/2,y:i+a/2},{x:r-g/2,y:i+a/2},{x:r-g/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-g/2,y:i-a/2},{x:r+g/2,y:i-a/2},{x:r+g/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-g/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(ut,`iconSquare`);async function dt(e,n,{config:{flowchart:r}}){let i=new Image;i.src=n?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));n.imageAspectRatio=a/o;let{labelStyles:s}=x(n);n.labelStyle=s;let c=r?.wrappingWidth;n.defaultWidth=r?.wrappingWidth;let l=Math.max(n.label?c??0:0,n?.assetWidth??a),u=n.constraint===`on`&&n?.assetHeight?n.assetHeight*n.imageAspectRatio:l,d=n.constraint===`on`?u/n.imageAspectRatio:n?.assetHeight??o;n.width=Math.max(u,c??0);let{shapeSvg:f,bbox:p,label:m}=await P(e,n,`image-shape default`),h=n.pos===`t`,g=-u/2,_=-d/2,v=n.label?8:0,y=T.svg(f),S=b(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let C=y.rectangle(g,_,u,d,S),w=Math.max(u,p.width),E=d+p.height+v,D=y.rectangle(-w/2,-E/2,w,E,{...S,fill:`none`,stroke:`none`}),O=f.insert(()=>C,`:first-child`),k=f.insert(()=>D);if(n.img){let e=f.append(`image`);e.attr(`href`,n.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?E/2-d:-E/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-v/2:d/2-p.height/2+v/2})`),O.attr(`transform`,`translate(0,${h?p.height/2+v/2:-p.height/2-v/2})`),I(n,k),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=h?[{x:r-p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2+p.height+v},{x:r+u/2,y:i-a/2+p.height+v},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+p.height+v},{x:r-p.width/2,y:i-a/2+p.height+v}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+p.width/2,y:i-a/2+d},{x:r+p.width/2/2,y:i+a/2},{x:r-p.width/2,y:i+a/2},{x:r-p.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],K.polygon(n,o,e)},f}e(dt,`imageSquare`);async function ft(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a*2,t.height??0),u=Math.max(c.width+o*2,(t.width??0)-l),d=[{x:0,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:-3*l/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ft,`inv_trapezoid`);async function pt(e,t){let{shapeSvg:n,bbox:r,label:i}=await P(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),I(t,a),t.intersect=function(e){return K.rect(t,e)},n}e(pt,`labelRect`);async function mt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(mt,`lean_left`);async function ht(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ht,`lean_right`);function gt(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.label=``,n.labelStyle=r;let a=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),{cssStyles:o}=n,s=Math.max(35,n?.width??0),c=Math.max(35,n?.height??0),l=[{x:s,y:0},{x:0,y:c+7/2},{x:s-14,y:c+7/2},{x:0,y:2*c},{x:s,y:c-7/2},{x:14,y:c-7/2}],u=T.svg(a),d=b(n,{});n.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=R(l),p=u.path(f,d),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`outer-path`),o&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,o),i&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,i),m.attr(`transform`,`translate(-${s/2},${-c})`),I(n,m),n.intersect=function(e){return t.info(`lightningBolt intersect`,n,e),K.polygon(n,l,e)},a}e(gt,`lightningBolt`);var _t=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),vt=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),yt=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),bt=10,xt=10;async function St(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.widtho,`:first-child`).attr(`class`,`line`),g=s.insert(()=>a,`:first-child`),g.attr(`class`,`basic label-container`),_&&g.attr(`style`,_)}else{let e=_t(0,0,u,p,d,f,m);g=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,h(_)).attr(`style`,r)}return g.attr(`label-offset-y`,f),g.attr(`transform`,`translate(${-u/2}, ${-(p/2+f)})`),I(t,g),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+f-(c.y-(c.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}e(St,`linedCylinder`);async function Ct(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,f=t.look===`neo`?d/4:d/8,p=d+f,{cssStyles:m}=t,h=T.svg(s),g=b(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...z(-u/2-u/2*.1,p/2,u/2+u/2*.1,p/2,f,.8),{x:u/2+u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:-p/2},{x:-u/2,y:-p/2},{x:-u/2,y:p/2*1.1},{x:-u/2,y:-p/2}],v=h.polygon(_.map(e=>[e.x,e.y]),g),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),y.attr(`transform`,`translate(0,${-f/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-f-(c.y-(c.top??0))})`),I(t,y),t.intersect=function(e){return K.polygon(t,_,e)},s}e(Ct,`linedWaveEdgedRect`);var wt=56,Tt=72,Et=8,Dt=2,Ot=8,kt={normal:`usecase-actor-shape usecase-actor-normal`,hollow:`usecase-actor-hollow`,awesome:`usecase-actor-awesome`,icon:`usecase-actor-icon`},At=Math.PI/3,jt=.6,Mt=e((e,t)=>{let n=t*jt,r=t*Math.sqrt(1-jt**2),i=Math.cos(At),a=-Math.sin(At),o=n*-a,s=e+n*i,c=r*i,l=r*a;return`M ${o-c} ${s-l} L ${o+c} ${s+l}`},`businessMarkerPathForCircle`),Nt={normal:Mt(-24,12),hollow:Mt(-23,9),awesome:Mt(-21,13),icon:`M 12 -8 L 26 -26`},Pt=e((e,t,n)=>{let r=(t.x??0)-(t.left??0),i=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${-t.width/2-r},${n-t.height/2-i})`)},`positionLabel`),Ft=e((e,t,n,r,i=!1)=>{if(t.look===`handDrawn`){let a=T.svg(e).path(n,b(t,i?{fill:`none`}:{}));return e.insert(()=>a,`:first-child`).attr(`class`,r)}let a=e.append(`path`).attr(`class`,r).attr(`d`,n);return i&&a.attr(`fill`,`none`),a},`appendActorPath`),It=e((e,t,n,r,i,a,o=!1)=>{if(t.look===`handDrawn`){let s=T.svg(e).circle(n,r,i*2,b(t,o?{fill:`none`}:{}));return e.insert(()=>s,`:first-child`).attr(`class`,a)}let s=e.append(`circle`).attr(`class`,a).attr(`cx`,n).attr(`cy`,r).attr(`r`,i);return o&&s.attr(`fill`,`none`),s},`appendActorCircle`),Lt=e((e,t,n)=>{t.business&&e.append(`path`).attr(`class`,`usecase-business-marker usecase-actor-business-marker`).attr(`d`,Nt[n]).attr(`fill`,`none`).attr(`style`,`stroke: inherit !important; stroke-width: inherit !important`)},`appendBusinessActorMarker`);async function Rt(e,t,n,r){let{labelStyles:i,nodeStyles:a}=x(t);t.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await P(e,n===`icon`||t.stereotype!==void 0?{...t,icon:n===`icon`?void 0:t.icon,stereotype:void 0}:t,L(t,`usecase-actor-variant usecase-actor-${n}`)),l=t.accessibleName??t.label;l&&o.attr(`role`,`img`).attr(`aria-label`,l),c.attr(`class`,`label actor-label usecase-actor-label`);let{theme:d,themeVariables:f}=u();w(o,t.colorIndex,d,f.borderColorArray);let p,m;if(t.stereotype){let e=await F(o,`\xAB${t.stereotype}\xBB`,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});p=e.label.attr(`class`,`label usecase-stereotype`),m=e.bbox}let h=o.append(`g`).attr(`class`,`usecase-actor-glyph ${kt[n]}`).attr(`style`,a||null);await r(h,t),Lt(h,t,n);let g=t.padding??Ot,_=m?.height??0,v=Tt+Et+s.height+(m?_+Dt:0),y=Math.max(wt,s.width,m?.width??0)+g*2,b=v+g*2,S=-v/2;h.attr(`transform`,`translate(0,${S+Tt/2})`);let C=S+Tt+Et;return p&&m&&(C+=_/2,Pt(p,m,C),C+=_/2+Dt),Pt(c,s,C+s.height/2),I(t,o.insert(`rect`,`:first-child`).attr(`class`,`usecase-actor-outline`).attr(`x`,-y/2).attr(`y`,-b/2).attr(`width`,y).attr(`height`,b).attr(`opacity`,0).attr(`aria-hidden`,`true`)),t.intersect=e=>K.rect(t,e),o}e(Rt,`renderUsecaseActor`);var zt=[`M 0 -12`,`C 6.627 -12 12 -17.373 12 -24`,`C 12 -30.627 6.627 -36 0 -36`,`C -6.627 -36 -12 -30.627 -12 -24`,`C -12 -17.373 -6.627 -12 0 -12 Z`,`M 0 -12 V 8`,`M -17 -5 H 17`,`M 0 8 L -15 28`,`M 0 8 L 15 28`].join(` `);async function Bt(e,t){return Rt(e,t,`normal`,(e,t)=>{Ft(e,t,zt,`usecase-actor-stick`)})}e(Bt,`usecaseActor`);var Vt=[`M 0 -34`,`C 7.18 -34 13 -28.18 13 -21`,`C 13 -13.82 7.18 -8 0 -8`,`C -7.18 -8 -13 -13.82 -13 -21`,`C -13 -28.18 -7.18 -34 0 -34 Z`,`M -24 25`,`C -24 7 -14 -3 0 -3`,`C 14 -3 24 7 24 25`,`C 24 28 21 30 18 30`,`H -18`,`C -21 30 -24 28 -24 25 Z`].join(` `);async function Ht(e,t){return Rt(e,t,`awesome`,(e,t)=>{Ft(e,t,Vt,`usecase-actor-awesome-silhouette`)})}e(Ht,`usecaseActorAwesome`);var Ut=[`M -22 -10`,`H 22`,`V 0`,`H 6`,`L 22 17`,`L 13 28`,`L 0 13`,`L -13 28`,`L -22 17`,`L -6 0`,`H -22`,`Z`].join(` `);async function Wt(e,t){return Rt(e,t,`hollow`,(e,t)=>{It(e,t,0,-23,9,`usecase-actor-hollow-head`,!0),Ft(e,t,Ut,`usecase-actor-hollow-body`,!0)})}e(Wt,`usecaseActorHollow`);var Gt=52,Kt=42,qt=-2,Jt=e(async(e,t)=>{let n=-Gt/2,r=qt-Gt/2;if(t.look===`handDrawn`){let i=T.svg(e).rectangle(n,r,Gt,Gt,b(t,{}));e.insert(()=>i,`:first-child`).attr(`class`,`usecase-actor-icon-frame`)}else e.append(`rect`).attr(`class`,`usecase-actor-icon-frame`).attr(`x`,n).attr(`y`,r).attr(`width`,Gt).attr(`height`,Gt).attr(`rx`,4).attr(`ry`,4);let i=t.icon??``,a=await g(i.includes(`:`)?i:`fa:${i}`),o=await _(i,{height:Kt,width:Kt,fallbackPrefix:`fa`}),s=e.append(`g`).attr(`class`,`usecase-actor-icon-symbol${a?``:` usecase-actor-icon-fallback`}`).attr(`aria-hidden`,`true`).html(`${o}`),c=s.node()?.getBBox();c&&s.attr(`transform`,`translate(${-c.width/2-c.x},${qt-c.height/2-c.y})`)},`drawIconActor`);async function Yt(e,t){return Rt(e,t,`icon`,Jt)}e(Yt,`usecaseActorIcon`);var Xt=e((e,t,n)=>{let r=(t.x??0)-(t.left??0),i=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${-t.width/2-r},${n-t.height/2-i})`)},`positionLabel`);async function Zt(e,t){let n=t,{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await P(e,n.stereotype?{...t,stereotype:void 0}:t,L(t,`usecase-business-shape`));c.attr(`class`,`label usecase-label`);let{theme:l,themeVariables:d}=u();w(a,t.colorIndex,l,d.borderColorArray);let f,p;if(n.stereotype){let e=await F(a,`\xAB${n.stereotype}\xBB`,{labelStyle:r,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});f=e.label.attr(`class`,`label usecase-stereotype`),p=e.bbox}let m=p?2:0,h=o.height+(p?.height??0)+m,g=Math.max(o.width,p?.width??0),_=s??10,v=g/2+_*2,y=h/2+_*2,S=Math.min(Math.max(_/5,1),_/2),C=g/2+S,E=v-S,D=C/v,O=E/v,k=y*Math.sqrt(Math.max(0,1-D*D)),A=-y*Math.sqrt(Math.max(0,1-O*O));f&&p&&Xt(f,p,-h/2+p.height/2),Xt(c,o,h/2-o.height/2);let j;if(t.look===`handDrawn`){let e=T.svg(a).ellipse(0,0,v*2,y*2,b(t,{}));j=a.insert(()=>e,`:first-child`).attr(`class`,`basic label-container usecase-business-ellipse`)}else j=a.insert(`ellipse`,`:first-child`).attr(`class`,`basic label-container usecase-business-ellipse`).attr(`style`,i).attr(`rx`,v).attr(`ry`,y).attr(`cx`,0).attr(`cy`,0);a.append(`path`).attr(`class`,`usecase-business-marker`).attr(`d`,`M ${C} ${k} L ${E} ${A}`).attr(`fill`,`none`).attr(`style`,i||null);let M=n.accessibleName??n.label;return M&&a.attr(`role`,`img`).attr(`aria-label`,M),I(t,j),t.calcIntersect=(e,t)=>K.ellipse(e,e.width/2,e.height/2,t),t.intersect=e=>K.ellipse(t,v,y,e),a}e(Zt,`usecaseBusiness`);var Qt=8,$t=4,en=1,tn=e((e,t,n,r)=>{let i=(t.x??0)-(t.left??0),a=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${n-t.width/2-i},${r-t.height/2-a})`)},`positionLabel`),nn=e(e=>{let t=Number.parseFloat(e??``);return Number.isFinite(t)&&t>=0?t:en},`numericStrokeWidth`);async function rn(t,n){let r=n,{labelStyles:i,nodeStyles:a}=x(n),{stylesMap:o}=C(n);n.labelStyle=i;let{shapeSvg:s,bbox:c,label:l}=await P(t,n,L(n,`usecase-json-table`));s.attr(`role`,`img`),r.accessibleName&&s.attr(`aria-label`,r.accessibleName),l.attr(`class`,`label usecase-json-title`);let u=s.append(`g`).attr(`class`,`usecase-json-table-grid`),d=[];for(let e of r.jsonRows??[]){let t=await F(u,e.key,{labelStyle:i,useHtmlLabels:n.useHtmlLabels,padding:0,centerLabel:!0}),r=await F(u,e.value,{labelStyle:i,useHtmlLabels:n.useHtmlLabels,padding:0,centerLabel:!0});d.push({key:{label:t.label.attr(`class`,`label usecase-json-key`),bbox:t.bbox},value:{label:r.label.attr(`class`,`label usecase-json-value`),bbox:r.bbox}})}let f=Math.max(0,...d.map(({key:e})=>e.bbox.width))+Qt*2,p=Math.max(0,...d.map(({value:e})=>e.bbox.width))+Qt*2,m=c.width+Qt*2,h=Math.max(m,f+p),g=p+Math.max(0,h-f-p),_=c.height+$t*2,v=d.map(({key:e,value:t})=>Math.max(e.bbox.height,t.bbox.height)+$t*2),y=_+v.reduce((e,t)=>e+t,0),S=nn(o.get(`stroke-width`)),w=h+S*2,E=y+S*2,D=-h/2,O=-y/2,k=n.look===`handDrawn`?T.svg(s):void 0,A=k?b(n,{}):void 0,j=e((e,t,n,r,i,o)=>{if(k&&A){let a=k.rectangle(n,r,i,o,A);return e.insert(()=>a,`:first-child`).attr(`class`,t)}return e.insert(`rect`,`:first-child`).attr(`class`,t).attr(`x`,n).attr(`y`,r).attr(`width`,i).attr(`height`,o).attr(`style`,a)},`insertCell`),M=j(s,`label-container usecase-json-border`,-w/2,-E/2,w,E);j(u,`usecase-json-cell usecase-json-title-cell`,D,O,h,_),u.node()?.append(l.node()),tn(l,c,0,O+_/2);let N=O+_;return d.forEach(({key:e,value:t},n)=>{let r=v[n],i=u.append(`g`).attr(`class`,`usecase-json-row`).attr(`data-row-index`,n).attr(`transform`,`translate(0,${N})`);j(i,`usecase-json-cell usecase-json-key-cell`,D,0,f,r),j(i,`usecase-json-cell usecase-json-value-cell`,D+f,0,g,r),i.node()?.append(e.label.node(),t.label.node()),tn(e.label,e.bbox,D+f/2,r/2),tn(t.label,t.bbox,D+f+g/2,r/2),N+=r}),I(n,M),n.intersect=e=>K.rect(n,e),s}e(rn,`usecaseJsonTable`);async function an(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await P(e,t,L(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,f=(t?.height?t?.height:l.height)+o*2+2*s,p=d-2*s,m=f-2*s,h=-p/2,g=-m/2,{cssStyles:_}=t,v=T.svg(c),y=b(t,{}),S=[{x:h-s,y:g+s},{x:h-s,y:g+m+s},{x:h+p-s,y:g+m+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g+m-s},{x:h+p+s,y:g+m-s},{x:h+p+s,y:g-s},{x:h+s,y:g-s},{x:h+s,y:g},{x:h,y:g},{x:h,y:g+s}],C=[{x:h,y:g+s},{x:h+p-s,y:g+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g},{x:h,y:g}];t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let w=R(S),E=v.path(w,y),D=R(C),O=v.path(D,y);t.look!==`handDrawn`&&(E=ee(E),O=ee(O));let k=c.insert(`g`,`:first-child`);return k.insert(()=>E),k.insert(()=>O),k.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),I(t,k),t.intersect=function(e){return K.polygon(t,S,e)},c}e(an,`multiRect`);async function on(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,f=Math.max(a.height,t?.height??0)+l*3,p=t.look===`neo`?f/4:f/8,m=f+(u?p/2:-p/2),h=-d/2,g=-m/2,{cssStyles:_}=t,v=z(h-10,g+m+10,h+d-10,g+m+10,p,.8),y=v?.[v.length-1],S=[{x:h-10,y:g+10},{x:h-10,y:g+m+10},...v,{x:h+d-10,y:y.y-10},{x:h+d,y:y.y-10},{x:h+d,y:y.y-20},{x:h+d+10,y:y.y-20},{x:h+d+10,y:g-10},{x:h+10,y:g-10},{x:h+10,y:g},{x:h,y:g},{x:h,y:g+10}],C=[{x:h,y:g+10},{x:h+d-10,y:g+10},{x:h+d-10,y:y.y-10},{x:h+d,y:y.y-10},{x:h+d,y:g},{x:h,y:g}],w=T.svg(i),E=b(t,{});t.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`);let D=R(S),O=w.path(D,E),k=R(C),A=w.path(k,E),j=i.insert(()=>O,`:first-child`);return j.insert(()=>A),j.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p-(a.y-(a.top??0))})`),I(t,j),t.intersect=function(e){return K.polygon(t,S,e)},i}e(on,`multiWaveEdgedRectangle`);async function sn(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r,t.useHtmlLabels||o(s())||(t.centerLabel=!0);let{shapeSvg:a,bbox:c,label:l}=await P(e,t,L(t)),u=Math.max(c.width+(t.padding??0)*2,t?.width??0),d=Math.max(c.height+(t.padding??0)*2,t?.height??0),f=-u/2,p=-d/2,{cssStyles:m}=t,h=T.svg(a),g=b(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=h.rectangle(f,p,u,d,g),v=a.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),l.attr(`class`,`label noteLabel`),m&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,m),i&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,i),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),I(t,v),t.intersect=function(e){return K.rect(t,e)},a}e(sn,`note`);var cn=e((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function ln(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await P(e,t,L(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=b(t,{}),r=cn(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=J(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),I(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}];return K.polygon(e,r,t)},t.intersect=function(e){return this.calcIntersect(t,e)},i}e(ln,`question`);async function un(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=c.width+(t.look===`neo`?a*2:a),d=Math.max(c.height+(t.look===`neo`?o*2:o),t.height??0),f=d/4,p=-Math.max(u,(t.width??0)-f)/2,m=-d/2,h=m/2,g=[{x:p+h,y:m},{x:p,y:0},{x:p+h,y:-m},{x:-p,y:-m},{x:-p,y:m}],{cssStyles:_}=t,v=T.svg(s),y=b(t,{});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let S=R(g),C=v.path(S,y),w=s.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${-h/2},0)`),l.attr(`transform`,`translate(${-h/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),I(t,w),t.intersect=function(e){return K.polygon(t,g,e)},s}e(un,`rect_left_inv_arrow`);async function dn(e,r){let{labelStyles:i,nodeStyles:a}=x(r);r.labelStyle=i;let s;s=r.cssClasses?`node `+r.cssClasses:`node default`;let c=e.insert(`g`).attr(`class`,s).attr(`id`,r.domId||r.id),l=c.insert(`g`),d=c.insert(`g`).attr(`class`,`label`).attr(`style`,a),f=r.description,p=r.label,m=await se(d,p,r.labelStyle,!0,!0),h={width:0,height:0};if(o(u())){let e=m.children[0],t=n(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}t.info(`Text 2`,f);let g=f||[],_=m.getBBox(),v=await se(d,Array.isArray(g)?g.join(`
`):g,r.labelStyle,!0,!0),y=v.children[0],S=n(v);h=y.getBoundingClientRect(),S.attr(`width`,h.width),S.attr(`height`,h.height);let C=(r.padding||0)/2;n(v).attr(`transform`,`translate( `+(h.width>_.width?0:(_.width-h.width)/2)+`, `+(_.height+C+5)+`)`),n(m).attr(`transform`,`translate( `+(h.width<_.width?0:-(_.width-h.width)/2)+`, 0)`),h=d.node().getBBox(),d.attr(`transform`,`translate(`+-h.width/2+`, `+(-h.height/2-C+3)+`)`);let w=h.width+(r.padding||0),E=h.height+(r.padding||0),D=-h.width/2-C,O=-h.height/2-C,k,A;if(r.look===`handDrawn`){let e=T.svg(c),n=b(r,{}),i=e.path(q(D,O,w,E,r.rx||0),n),a=e.line(-h.width/2-C,-h.height/2-C+_.height+C,h.width/2+C,-h.height/2-C+_.height+C,n);A=c.insert(()=>(t.debug(`Rough node insert CXC`,i),a),`:first-child`),k=c.insert(()=>(t.debug(`Rough node insert CXC`,i),i),`:first-child`)}else k=l.insert(`rect`,`:first-child`),A=l.insert(`line`),k.attr(`class`,`outer title-state`).attr(`style`,a).attr(`x`,-h.width/2-C).attr(`y`,-h.height/2-C).attr(`width`,h.width+(r.padding||0)).attr(`height`,h.height+(r.padding||0)),A.attr(`class`,`divider`).attr(`x1`,-h.width/2-C).attr(`x2`,h.width/2+C).attr(`y1`,-h.height/2-C+_.height+C).attr(`y2`,-h.height/2-C+_.height+C);return I(r,k),r.intersect=function(e){return K.rect(r,e)},c}e(dn,`rectWithTitle`);async function fn(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return Ke(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}e(fn,`roundedRect`);var pn=8;async function mn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?pn:pn*2),u=(t?.height??s.height)+a*2,d=l-pn,f=u,p=pn-l/2,m=-u/2,{cssStyles:g}=t,_=T.svg(o),v=b(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:p,y:m},{x:p+d,y:m},{x:p+d,y:m+f},{x:p-pn,y:m+f},{x:p-pn,y:m},{x:p,y:m},{x:p,y:m+f}],S=_.polygon(y.map(e=>[e.x,e.y]),v),C=o.insert(()=>S,`:first-child`);return C.attr(`class`,`basic label-container outer-path`).attr(`style`,h(g)),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),g&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${pn/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),I(t,C),t.intersect=function(e){return K.rect(t,e)},o}e(mn,`shadedProcess`);async function hn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,f=u,p=d/1.5,m=-f/2,h=-p/2,{cssStyles:g}=t,_=T.svg(s),v=b(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:m,y:h},{x:m,y:h+p},{x:m+f,y:h+p},{x:m+f,y:h-p/2}],S=R(y),C=_.path(S,v),w=s.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,r),w.attr(`transform`,`translate(0, ${p/4})`),l.attr(`transform`,`translate(${-f/2+(t.padding??0)-(c.x-(c.left??0))}, ${-p/4+(t.padding??0)-(c.y-(c.top??0))})`),I(t,w),t.intersect=function(e){return K.polygon(t,y,e)},s}e(hn,`slopedRect`);async function gn(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n,a=await Ke(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i});if(t.colorIndex!==void 0){let{theme:e,themeVariables:n}=u();w(a,t.colorIndex,e,n.borderColorArray)}return a}e(gn,`squareRect`);var _n=50,vn=e((e,t,n)=>{let r=e.height+n,i=r*Math.cos(Math.PI/(2*(_n-1))),a=Math.sqrt(Math.max(0,i**2-e.height**2));return{w:Math.max(e.width+r/4+t,1.5*r+(r-i),e.width+t+r-a),h:r}},`stadiumDimensions`);async function yn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?40:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),{w:l,h:u}=vn(c,a,o),d=u/2,{cssStyles:f}=t,p=T.svg(s),m=b(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-l/2+d,y:-u/2},{x:l/2-d,y:-u/2},...B(-l/2+d,0,d,_n,90,270),{x:l/2-d,y:u/2},...B(l/2-d,0,d,_n,270,450)],g=R(h),_=p.path(g,m),v=s.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,r),I(t,v),t.intersect=function(e){return K.polygon(t,h,e)},s}e(yn,`stadium`);async function bn(e,t){return Ke(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}e(bn,`state`);function xn(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=T.svg(u),f=b(t,{});t.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=d.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),m=s??c,h=(t.width??0)*5/14,g=d.circle(0,0,h,{...f,fill:m,stroke:m,strokeWidth:2,fillStyle:`solid`}),_=u.insert(()=>p,`:first-child`);if(_.insert(()=>g),t.look!==`handDrawn`&&_.attr(`class`,`outer-path`),a&&_.selectAll(`path`).attr(`style`,a),i&&_.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;_.attr(`style`,`filter:url(#${n})`)}return I(t,_),t.intersect=function(e){return K.circle(t,(t.width??0)/2,e)},u}e(xn,`stateEnd`);function Sn(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=T.svg(a).circle(0,0,t.width,S(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return I(t,o),t.intersect=function(e){return K.circle(t,(t.width??7)/2,e)},a}e(Sn,`stateStart`);var Cn=8;async function wn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.width+2*Cn+a,t.width??0),u=Math.max(c.height+o,t.height??0),d=l-2*Cn,f=u,p=-l/2,m=-u/2,g=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=e.rectangle(p,m,d+16,f,n),i=e.line(p+Cn,m,p+Cn,m+f,n),a=e.line(p+Cn+d,m,p+Cn+d,m+f,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:c}=t;o.attr(`class`,`basic label-container`).attr(`style`,h(c)),I(t,o)}else{let e=J(s,d,f,g);r&&e.attr(`style`,r),I(t,e)}return t.intersect=function(e){return K.polygon(t,g,e)},s}e(wn,`subroutine`);var Tn=.2;async function En(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-Tn*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.height?t?.height:c.height)+o*2,u=Tn*l,d=Tn*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,m=-f/2,h=-p/2,{cssStyles:g}=t,_=T.svg(s),v=b(t,{}),y=[{x:m-u/2,y:h},{x:m+f+u/2,y:h},{x:m+f+u/2,y:h+p},{x:m-u/2,y:h+p}],S=[{x:m+f-u/2,y:h+p},{x:m+f+u/2,y:h+p},{x:m+f+u/2,y:h+p-d}];t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let C=R(y),w=_.path(C,v),E=R(S),D=_.path(E,{...v,fillStyle:`solid`}),O=s.insert(()=>D,`:first-child`);return O.insert(()=>w,`:first-child`),O.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),I(t,O),t.intersect=function(e){return K.polygon(t,y,e)},s}e(En,`taggedRect`);async function Dn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,m=T.svg(i),h=b(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-s/2-s/2*.1,y:f/2},...z(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],_=-s/2+s/2*.1,v=-f/2-d*.4,y=[{x:_+s-u,y:(v+c)*1.3},{x:_+s,y:v+c-d},{x:_+s,y:(v+c)*.9},...z(_+s,(v+c)*1.25,_+s-u,(v+c)*1.3,-c*.02,.5)],S=R(g),C=m.path(S,h),w=R(y),E=m.path(w,{...h,fillStyle:`solid`}),D=i.insert(()=>E,`:first-child`);return D.insert(()=>C,`:first-child`),D.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),I(t,D),t.intersect=function(e){return K.polygon(t,g,e)},i}e(Dn,`taggedWaveEdgedRectangle`);async function On(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await P(e,t,L(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),I(t,u),t.intersect=function(e){return K.rect(t,e)},i}e(On,`text`);var kn=e((e,t,n,r,i,a)=>`M${e},${t} +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{A as r,B as i,M as a,T as o,b as s,f as c,g as l,x as u,z as d}from"./app-chunk-O7XYJQB3.js";import{a as f,p,r as m,u as h}from"./app-chunk-ZIGJFQKS.js";import{a as g,i as _,r as v,t as y}from"./app-chunk-7PRAP22T.js";import{n as b,t as x}from"./app-chunk-742MDFTN.js";import{n as S,r as C}from"./app-chunk-MBY4JIJT.js";import{s as w}from"./app-chunk-J5ZVWO5B.js";import{t as T}from"./app-rough.esm.js";var E=1,D=3;async function O(t){let n=t.getElementsByTagName(`img`);if(!n||n.length===0)return;let r=!k(t);await Promise.all([...n].map(t=>new Promise(n=>{function i(){if(t.style.display=`flex`,t.style.flexDirection=`column`,r){let e=u().fontSize?u().fontSize:window.getComputedStyle(document.body).fontSize,[n=c.fontSize]=p(e),r=n*5+`px`;t.style.minWidth=r,t.style.maxWidth=r}else t.style.width=`100%`;n(t)}e(i,`setupImage`),setTimeout(()=>{t.complete&&i()}),t.addEventListener(`error`,i),t.addEventListener(`load`,i)})))}e(O,`configureLabelImages`);function k(e){return e.nodeType===D?e.textContent?.trim()!==``:e.nodeType!==E||e.tagName.toLowerCase()===`img`?!1:[...e.childNodes].some(k)}e(k,`hasTextBesidesImages`);var A=3,j=32,M=e(async(e,t,r)=>{let i=u(),a=e.insert(`g`).attr(`class`,r??`node default`).attr(`id`,t.domId||t.id),o=a.insert(`g`).attr(`class`,`label`).attr(`style`,h(t.labelStyle)),s=[{text:typeof t.label==`string`?t.label:t.label?.[0]??``,cssClass:`c4-name`},{text:t.stereotype,cssClass:`c4-type`},...(t.description??[]).map(e=>({text:e,cssClass:`c4-descr`}))].filter(e=>e.text),c=t.width?Math.max(t.width-2*(t.padding??0),j):u().flowchart?.wrappingWidth??200,l=i.c4?.wrap??!0?c:1/0,p=await Promise.all(s.map(async e=>{let r=o.append(`g`).attr(`class`,e.cssClass),a=await S(r,d(f(e.text??``),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:l,style:t.labelStyle},i);return n(a).selectAll(`tspan.text-outer-tspan`).attr(`text-anchor`,`middle`),n(a).selectAll(`tspan.text-inner-tspan`).attr(`font-weight`,null).attr(`font-style`,null),{el:r,box:r.node().getBBox()}})),m=Math.max(...p.map(({box:e})=>e.width),0),g=0;for(let{el:e,box:t}of p)e.attr(`transform`,`translate(${m/2-t.x-t.width/2}, ${g-t.y})`),g+=t.height+A;let _=p.length>0?g-A:0;return o.insert(`rect`,`:first-child`),o.attr(`transform`,`translate(${-m/2}, ${-_/2})`),{shapeSvg:a,bbox:o.node().getBBox(),halfPadding:(t.padding??0)/2,label:o}},`c4LabelHelper`),N=e((t,n)=>{let{x:r,y:i,width:a,height:o}=t;return a>=n?t:`left`in t?{x:r,y:i,width:n,height:o,top:i,left:r,bottom:i+o,right:r+n,toJSON:e(()=>({}),`toJSON`)}:{x:r-(n-a)/2,y:i,width:n,height:o}},`withMinWidth`),P=e(async(e,t,r)=>{if(t.stereotype!==void 0)return M(e,t,r);let i,a=t.useHtmlLabels||l(u()?.htmlLabels);i=r||`node default`;let o=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),s=o.insert(`g`).attr(`class`,`label`).attr(`style`,h(t.labelStyle)),c;c=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let p=!!t.icon||!!t.img,m=t.labelType===`markdown`,g=c&&!t.width?t.minWidth??0:0,_=await S(s,d(f(c),u()),{useHtmlLabels:a,width:t.width||t.wrappingWidth||u().flowchart?.wrappingWidth,minWidth:g,classes:m?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:p,markdown:m},u()),v=(t?.padding??0)/2,y;if(a){let e=_.children[0],t=n(_);await O(e),y=await C.measure(()=>e.getBoundingClientRect()),y=N(y,g),t.attr(`width`,y.width),t.attr(`height`,y.height)}else y=await C.measure(()=>_.getBBox()),y=N(y,g);return a?s.attr(`transform`,`translate(`+-y.width/2+`, `+-y.height/2+`)`):s.attr(`transform`,`translate(0, `+-y.height/2+`)`),t.centerLabel&&s.attr(`transform`,`translate(`+-y.width/2+`, `+-y.height/2+`)`),s.insert(`rect`,`:first-child`),{shapeSvg:o,bbox:y,halfPadding:v,label:s}},`labelHelper`),F=e(async(e,t,r)=>{let i=r.useHtmlLabels??o(u()),a=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await S(a,d(f(t),u()),{useHtmlLabels:i,width:r.width||u()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),c=r.padding/2,l;if(o(u())){let e=s.children[0],t=n(s);l=await C.measure(()=>e.getBoundingClientRect()),t.attr(`width`,l.width),t.attr(`height`,l.height)}else l=await C.measure(()=>s.getBBox());return i?a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`):a.attr(`transform`,`translate(0, `+-l.height/2+`)`),r.centerLabel&&a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`),a.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:l,halfPadding:c,label:a}},`insertLabel`),I=e((e,t,n)=>{if(n){e.width=n.width,e.height=n.height;return}let r=t.node().getBBox();e.width=r.width,e.height=r.height},`updateNodeBounds`),L=e((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function R(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}e(R,`createPathFromPoints`);function z(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}e(z,`generateFullSineWavePoints`);function B(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;ie.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=e((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}e(ee,`mergePaths`);var V=e((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`);function te(e,t){return e.intersect(t)}e(te,`intersectNode`);var H=te;function U(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x0}e(G,`sameSign`);var ae=W;function oe(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),se=e(async(e,t,n,r=!1,i=!1)=>{let a=t||``;typeof a==`object`&&(a=a[0]);let s=u(),c=o(s);return await S(e,a,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`);function ce(e,n){let{labelStyles:r}=_(n);n.labelStyle=r;let i=L(n),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=T.svg(o),l=g(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,h(s)),I(n,d),n.intersect=function(e){return t.info(`Circle intersect`,n,1,e),K.circle(n,1,e)},o}e(ce,`anchor`);function le(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}e(le,`generateArcPoints`);function ue(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}e(ue,`calculateArcSagitta`);async function de(t,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=e(e=>e+s,`calcTotalHeight`),l=e(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await P(t,n,L(n)),f=c(n?.height?n?.height:d.height),[p,m]=l(f),h=ue(f,p,m),v=(n?.width?n?.width:d.width)+o*2+h-h,y=f,{cssStyles:b}=n,x=[{x:v/2,y:-y/2},{x:-v/2,y:-y/2},...le(-v/2,-y/2,-v/2,y/2,p,m,!1),{x:v/2,y:y/2},...le(v/2,y/2,v/2,-y/2,p,m,!0)],S=T.svg(u),C=g(n,{});n.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let w=R(x),E=S.path(w,C),D=u.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),b&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,b),i&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,i),D.attr(`transform`,`translate(${p/2}, 0)`),I(n,D),n.intersect=function(e){return K.polygon(n,x,e)},u}e(de,`bowTieRect`);async function fe(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=_(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await P(t,n,L(n)),l=r?.nodeBorder??r?.lineColor??`currentColor`,u=n.padding??12,d=Math.max(s.width+u*2,n.width??0,80),f=Math.max(Math.min(d*.08,12),5),p=Math.max(s.height+u*2+f,n.height??0),m=-p/2+f,h=p/2,v=d*.72,y=[`M${-d/2},${m}`,`L${-v/2},${h}`,`A${v/2},${f} 0 0 0 ${v/2},${h}`,`L${d/2},${m}`,`A${d/2},${f} 0 0 0 ${-d/2},${m}`,`Z`].join(` `),{cssStyles:b}=n,x=o.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(n.look===`handDrawn`){let e=T.svg(o).path(y,g(n,{}));x.node()?.appendChild(e),b&&x.attr(`style`,b)}else x.append(`path`).attr(`d`,y).attr(`style`,a);x.append(`ellipse`).attr(`cx`,0).attr(`cy`,m).attr(`rx`,d/2).attr(`ry`,f).attr(`style`,`fill:none;stroke:${l};stroke-width:1px`),I(n,x);let S=m+(h-m)/2;c.attr(`transform`,`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${S-s.height/2-(s.y-(s.top??0))})`);let C=e((e,t,n)=>Array.from({length:13},(r,i)=>{let a=Math.PI-i*Math.PI/12;return{x:e*Math.cos(a),y:t+n*f*Math.sin(a)}}),`arc`),w=[...C(d/2,m,-1),...C(v/2,h,1).reverse()];return n.intersect=function(e){return K.polygon(n,w,e)},o}e(fe,`bucket`);var pe=20,me=8,he=80,ge=8;function _e(e){let{themeVariables:t}=u(),n=t.clusterBkg,r=t.clusterBorder;switch(e){case`flow`:return{rx:10,fill:`none`,stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:`flow-collapsed`};default:return{rx:ge,fill:n,stroke:r,cssClass:`collapsed-group`}}}e(_e,`getCollapsedStyle`);async function ve(e,t){let n=_e(t.metadata?.containerType),{fill:r,stroke:i}=n,{nodeStyles:a}=_(t),{shapeSvg:s,bbox:c}=await P(e,t,L(t)),{theme:l,themeVariables:d}=u();w(s,t.colorIndex,l,d.borderColorArray);let f=t.padding??8,p=c.height,m=Math.max(c.width+f*2,he,t?.width??0),v=Math.max(p+me+pe+f*2,t?.height??0),y=-m/2,b=-v/2,x=-(me+pe)/2,S=s.select(`.label`);S&&(t.useHtmlLabels??o(u())?S.attr(`transform`,`translate(${-c.width/2}, ${-c.height/2+x})`):S.attr(`transform`,`translate(0, ${-c.height/2+x})`));let C;if(t.look===`handDrawn`){let e=T.svg(s),a=g(t,{fill:r,stroke:i,...n.strokeWidth===void 0?{}:{strokeWidth:n.strokeWidth},...r===`none`?{fillWeight:0}:{fillStyle:`solid`}}),o=e.path(q(y,b,m,v,n.rx),a);C=s.insert(()=>o,`:first-child`),C.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,h(t.cssStyles))}else C=s.insert(`rect`,`:first-child`),C.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,a).attr(`rx`,n.rx).attr(`ry`,n.rx).attr(`x`,y).attr(`y`,b).attr(`width`,m).attr(`height`,v).attr(`fill`,r).attr(`stroke`,i),n.strokeWidth!==void 0&&C.attr(`stroke-width`,n.strokeWidth+`px`);let E=b+f+p+me;s.append(`line`).attr(`class`,`collapsed-separator`).attr(`x1`,y+8).attr(`y1`,E).attr(`x2`,y+m-8).attr(`y2`,E).attr(`stroke`,i).attr(`stroke-dasharray`,`3, 3`);let D=E+pe/2;for(let e=-1;e<=1;e++)s.append(`circle`).attr(`class`,`collapsed-indicator`).attr(`cx`,e*10).attr(`cy`,D).attr(`r`,2.5).attr(`fill`,i);return I(t,C),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},s}e(ve,`collapsedGroup`);function J(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}e(J,`insertPolygonShape`);var ye=[`right`,`left`,`up`,`down`],be=`point`,xe=e(e=>{let t=new Set;for(let n of e)switch(n){case`x`:t.add(`right`),t.add(`left`);break;case`y`:t.add(`up`),t.add(`down`);break;default:t.add(n)}return t},`expandAndDeduplicateDirections`),Se=e(e=>ye.filter(t=>e.has(t)).join(`|`)||be,`getDirectionKey`),Ce={"right|left|up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*n},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*n,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*n},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*n,y:-e/2},{x:0,y:-e/3}],`right|left|up|down`),"right|left|up":e(({height:e,midpoint:t,width:n})=>[{x:t,y:0},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],`right|left|up`),"right|left|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:t,y:-e},{x:n-t,y:-e},{x:n,y:0}],`right|left|down`),"right|up|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:n,y:-e+t},{x:0,y:-e}],`right|up|down`),"left|up|down":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:n,y:-e}],`left|up|down`),"right|left":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`right|left`),"up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`up|down`),"right|up":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:0,y:-e}],`right|up`),"right|down":e(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],`right|down`),"left|up":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:n,y:-e}],`left|up`),"left|down":e(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],`left|down`),right:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e+n}],`right`),left:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`left`),up:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n}],`up`),down:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`down`),[be]:()=>[{x:0,y:0}]},we=e((e,t,n,r)=>{let i=xe(e),a=(n.padding??0)/2,o=t.height+4*a,s=o/2,c=r??t.width+2*s+2*a;return(Ce[Se(i)]??Ce[be])({height:o,midpoint:s,padding:a,width:c})},`getArrowPoints`);async function Te(e,t){let n=t,{shapeSvg:r,bbox:i}=await P(e,n,L(n)),a=n.padding??0,o=i.height+2*a,s=o/2,c=i.width+2*s+a,l=n.width??0,u=n.positioned&&(n.widthInColumns??1)>1&&l>c?l:c,d=we(n.directions??[],i,n,u),f=J(r,u,o,d);return f.attr(`style`,n.style??null),I(n,f),n.intersect=function(e){return K.polygon(n,d,e)},r}e(Te,`block_arrow`);async function Ee(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await P(e,t,L(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+18,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=T.svg(a).path(q(-u/2,f,u,d,12),g(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`line`).attr(`x1`,-u/2).attr(`y1`,f+18).attr(`x2`,u/2).attr(`y2`,f+18).attr(`style`,`stroke:${c};stroke-width:1px`);for(let e=0;e<3;e++)m.append(`circle`).attr(`cx`,-u/2+12+e*9).attr(`cy`,f+18/2).attr(`r`,2.5).attr(`style`,`fill:${c};stroke:none`);m.append(`rect`).attr(`class`,`browser-address-bar`).attr(`x`,-u/2+44).attr(`y`,f+4).attr(`width`,Math.max(u-56,10)).attr(`height`,10).attr(`rx`,3).attr(`ry`,3).attr(`style`,`fill:none;stroke:${c};stroke-width:1px;opacity:0.6`),I(t,m);let h=f+18+(d-18)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Ee,`browser`);var De=12;async function Oe(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+De),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+De,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+De},{x:0+De,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=g(t,{}),r=R(p),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=J(s,l,u,p);return r&&m.attr(`style`,r),I(t,m),t.intersect=function(e){return K.polygon(t,p,e)},s}e(Oe,`card`);function ke(e,t){let{nodeStyles:n}=_(t);t.label=``;let r=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=T.svg(r),c=g(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=R(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return K.polygon(t,o,e)},r}e(ke,`choice`);async function Ae(e,n,r){let{labelStyles:i,nodeStyles:a}=_(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await P(e,n,L(n)),l=r?.padding??c,u=Math.sqrt(s.width**2+s.height**2)/2,d=n.look===`neo`?u+32:u+l,f,{cssStyles:p}=n;if(n.look===`handDrawn`){let e=T.svg(o),t=g(n,{}),r=e.circle(0,0,d*2,t);f=o.insert(()=>r,`:first-child`),f.attr(`class`,`basic label-container`).attr(`style`,h(p))}else f=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,d).attr(`cx`,0).attr(`cy`,0);return I(n,f),n.calcIntersect=function(e,t){let n=e.width/2;return K.circle(e,n,t)},n.intersect=function(e){return t.info(`Circle intersect`,n,d,e),K.circle(n,d,e)},o}e(Ae,`circle`);async function je(e,t){let n=t,{shapeSvg:r,bbox:i,halfPadding:a}=await P(e,n,[`node`,n.cssClasses,n.class].filter(Boolean).join(` `)),o=r.insert(`rect`,`:first-child`),s=n.padding??0,c=n.positioned?n.width??0:i.width+s,l=n.positioned?n.height??0:i.height+s,u=n.positioned?-c/2:-i.width/2-a,d=n.positioned?-l/2:-i.height/2-a;return o.attr(`class`,`basic cluster composite label-container`).attr(`style`,n.style??null).attr(`rx`,n.rx??null).attr(`ry`,n.ry??null).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l),I(n,o),n.intersect=function(e){return K.rect(n,e)},r}e(je,`composite`);async function Me(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await P(e,t,L(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+20,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=T.svg(a).path(q(-u/2,f,u,d,12),g(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`text`).attr(`x`,-u/2+12).attr(`y`,f+16).attr(`class`,`console-glyph`).attr(`style`,`font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(`>_`),I(t,m);let h=f+20+(d-20)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Me,`consoleWindow`);function Ne(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y} + M ${i.x},${i.y} L ${o.x},${o.y}`}e(Ne,`createLine`);function Pe(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r,n.label=``;let a=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),o=Math.max(30,n?.width??0),{cssStyles:s}=n,c=T.svg(a),l=g(n,{});n.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=Ne(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),s&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,s),i&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,i),I(n,p),n.intersect=function(e){return t.info(`crossedCircle intersect`,n,{radius:o,point:e}),K.circle(n,o,e)},a}e(Pe,`crossedCircle`);function Y(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;iS,`:first-child`).attr(`stroke-opacity`,0),C.insert(()=>b,`:first-child`),C.attr(`class`,`text`),f&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),C.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Fe,`curlyBraceLeft`);function X(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;iS,`:first-child`).attr(`stroke-opacity`,0),C.insert(()=>b,`:first-child`),C.attr(`class`,`text`),f&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),C.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Ie,`curlyBraceRight`);function Z(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;iE,`:first-child`).attr(`stroke-opacity`,0),D.insert(()=>x,`:first-child`),D.insert(()=>C,`:first-child`),D.attr(`class`,`text`),f&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,D),t.intersect=function(e){return K.polygon(t,h,e)},i}e(Le,`curlyBraces`);async function Re(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(5,c.height+o*2,t?.height??0),u=l/2,d=u-Math.sqrt(Math.max(0,u**2-(c.height/2)**2)),f=Math.max(l/4,d),p=Math.max(20,c.width+a*2+f*2,(c.width+a*2)*1.25,t?.width??0),{cssStyles:m}=t,h=T.svg(s),v=g(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=p,b=l,x=y-u,S=b/4,C=[{x,y:0},{x:S,y:0},{x:0,y:b/2},{x:S,y:b},{x,y:b},...B(-x,-b/2,u,50,270,90)],w=R(C),E=h.path(w,v),D=s.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&D.selectChildren(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&D.selectChildren(`path`).attr(`style`,r),D.attr(`transform`,`translate(${-p/2}, ${-l/2})`),I(t,D),t.intersect=function(e){return K.polygon(t,C,e)},s}e(Re,`curvedTrapezoid`);async function ze(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??20,c=Math.max(a.width+s*2,t.width??0,100),l=Math.min(Math.max(c*.23,16),56),u=l*.27,d=Math.max(a.height+s*2,t.height?t.height-(2*l-u):0),f=Math.min(c*.177,d*.45),p=d+2*l-u,m=-p/2,h=m+2*l-u,v=i.insert(`g`,`:first-child`).attr(`class`,`basic label-container`),{cssStyles:y}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=g(t,{}),r=e.path(q(-c/2,h,c,d,f),n),a=e.circle(0,m+l,l*2,n);v.insert(()=>a,`:first-child`),v.insert(()=>r,`:first-child`),y&&v.attr(`style`,y)}else v.append(`rect`).attr(`x`,-c/2).attr(`y`,h).attr(`width`,c).attr(`height`,d).attr(`rx`,f).attr(`ry`,f).attr(`style`,r),v.append(`circle`).attr(`cx`,0).attr(`cy`,m+l).attr(`r`,l).attr(`style`,r);I(t,v);let b=h+d/2;o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${b-a.height/2-(a.y-(a.top??0))})`);let x=m+l,S=Math.asin(Math.min(1,(h-x)/l))*180/Math.PI,C=[...B(0,-x,l,24,180+S,-S),...B(-(-c/2+f),-(h+f),f,12,90,0),...B(-(-c/2+f),-(p/2-f),f,12,360,270),...B(-(c/2-f),-(p/2-f),f,12,270,180),...B(-(c/2-f),-(h+f),f,12,180,90)];return t.intersect=function(e){return K.polygon(t,C,e)},i}e(ze,`person`);var Be=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),Ve=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),He=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Ue=8,We=8;async function Ge(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i,s=t.width??0;if(t.width&&(t.width-=o,t.widtho,`:first-child`),v=c.insert(()=>a,`:first-child`),v.attr(`class`,`basic label-container`),y&&v.attr(`style`,y)}else{let e=Be(0,0,d,m,f,p);v=c.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,h(y)).attr(`style`,r)}return v.attr(`label-offset-y`,p),v.attr(`transform`,`translate(${-d/2}, ${-(m/2+p)})`),I(t,v),u.attr(`transform`,`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(f!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-p)){let i=p*p*(1-r*r/(f*f));i>0&&(i=Math.sqrt(i)),i=p-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},c}e(Ge,`cylinder`);async function Ke(e,t,n){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await P(e,t,L(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:f,ry:p}=t,{cssStyles:m}=t;if(n?.rx&&n.ry&&(f=n.rx,p=n.ry),t.look===`handDrawn`){let e=T.svg(a),n=g(t,{}),r=f||p?e.path(q(l,u,s,c,f||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,h(m))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,h(f)).attr(`ry`,h(p)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return I(t,d,t.look===`handDrawn`?void 0:{width:s,height:c}),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},a}e(Ke,`drawRect`);async function qe(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await Ke(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=T.svg(c),n=g(t,{}),r=c.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return c;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return c;return c.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),c.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),c}let l=c.select(`.basic.label-container`),u=(Number(l.attr(`width`))||o)??0,d=(Number(l.attr(`height`))||s)??0;return u>0&&d>0&&l.attr(`stroke-dasharray`,`${u} ${d}`),c}e(qe,`datastore`);async function Je(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:m}=t,h=T.svg(o),v=g(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],b=h.polygon(y.map(e=>[e.x,e.y]),v),x=o.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(t.padding??0)/2-(s.y-(s.top??0))})`),I(t,x),t.intersect=function(e){return K.rect(t,e)},o}e(Je,`dividedRectangle`);async function Ye(e,n){let{labelStyles:r,nodeStyles:i}=_(n),a=n.look===`neo`?12:5;n.labelStyle=r;let o=n.padding??0,s=n.look===`neo`?16:o,{shapeSvg:c,bbox:l}=await P(e,n,L(n)),u=Math.sqrt(l.width**2+l.height**2)/2,d=(n?.width?n?.width/2:u)+(s??0),f=d+a,p,{cssStyles:m}=n;if(n.look===`handDrawn`){let e=T.svg(c),t=g(n,{roughness:.2,strokeWidth:2.5}),r=g(n,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,f*2,t),a=e.circle(0,0,d*2,r);p=c.insert(`g`,`:first-child`),p.attr(`class`,h(n.cssClasses)).attr(`style`,h(m)),p.node()?.appendChild(i),p.node()?.appendChild(a)}else{p=c.insert(`g`,`:first-child`);let e=p.insert(`circle`,`:first-child`),t=p.insert(`circle`);p.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,f).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return I(n,p),n.intersect=function(e){return t.info(`DoubleCircle intersect`,n,f,e),K.circle(n,f,e)},c}e(Ye,`doublecircle`);async function Xe(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o}=await P(e,t,L(t)),{theme:s,themeVariables:c}=u();w(i,t.colorIndex,s,c.borderColorArray);let l=o??10,d=a.width/2+l*2,f=a.height/2+l*2,p,{cssStyles:m}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=g(t,{}),r=e.ellipse(0,0,d*2,f*2,n);p=i.insert(()=>r,`:first-child`),p.attr(`class`,`basic label-container`),m&&p.attr(`style`,m)}else p=i.insert(`ellipse`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,r).attr(`rx`,d).attr(`ry`,f).attr(`cx`,0).attr(`cy`,0);return t.width=d*2,t.height=f*2,I(t,p),t.calcIntersect=function(e,t){let n=e.width/2,r=e.height/2;return K.ellipse(e,n,r,t)},t.intersect=function(e){return K.ellipse(t,d,f,e)},i}e(Xe,`usecaseEllipse`);function Ze(e,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=_(n);n.label=``,n.labelStyle=i;let o=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),{cssStyles:s}=n,c=T.svg(o),{nodeBorder:l}=r,u=g(n,{fillStyle:`solid`});n.look!==`handDrawn`&&(u.roughness=0);let d=c.circle(0,0,14,u),f=o.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),s&&s.length>0&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,s),a&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,a),I(n,f),n.intersect=function(e){return t.info(`filledCircle intersect`,n,{radius:7,point:e}),K.circle(n,7,e)},o}e(Ze,`filledCircle`);var Qe=10,$e=10;async function et(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.height=n?.height??0,n.heightb,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return m&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,m),i&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,i),n.width=u,n.height=d,I(n,x),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-d/2+(n.padding??0)/2+(c.y-(c.top??0))})`),n.intersect=function(e){return t.info(`Triangle intersect`,n,p,e),K.polygon(n,p,e)},s}e(et,`flippedTriangle`);async function tt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??12,c=Math.max(a.width+s*2,t.width??0,90),l=a.height+s*2,u=Math.max(Math.min(l*.16,14),8),d=Math.max(l+u,t.height??0),f=d-u,p=Math.max(c*.38,28),m=-d/2,h=[{x:-c/2,y:m},{x:-c/2+p,y:m},{x:-c/2+p,y:m+u},{x:c/2,y:m+u},{x:c/2,y:d/2},{x:-c/2,y:d/2}],v=[`M${h[0].x},${h[0].y}`,...h.slice(1).map(e=>`L${e.x},${e.y}`),`Z`].join(` `),{cssStyles:y}=t,b;if(t.look===`handDrawn`){let e=T.svg(i).path(v,g(t,{}));b=i.insert(()=>e,`:first-child`).attr(`class`,`basic label-container`),y&&b.attr(`style`,y)}else b=i.insert(`path`,`:first-child`).attr(`d`,v).attr(`class`,`basic label-container`).attr(`style`,r);t.look===`handDrawn`?I(t,b):I(t,b,{width:c,height:d});let x=m+u+f/2;return o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${x-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(e){return K.polygon(t,h,e)},i}e(tt,`folder`);function nt(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=_(t);t.label=``;let o=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);(n===`LR`||n===`RL`)&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=T.svg(o),p=g(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=f.rectangle(u,d,c,l,p),h=o.insert(()=>m,`:first-child`);s&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,a),I(t,h);let v=r?.padding??0;return t.width&&t.height&&(t.width+=v/2||0,t.height+=v/2||0),t.intersect=function(e){return K.rect(t,e)},o}e(nt,`forkJoin`);async function rt(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.look===`neo`?16:n.padding??0,o=n.look===`neo`?12:n.padding??0;(n.width||n.height)&&(n.height=(n?.height??0)-o*2,n.height<10&&(n.height=10),n.width=(n?.width??0)-a*2,n.width<15&&(n.width=15));let{shapeSvg:s,bbox:c}=await P(e,n,L(n)),l=(n?.height?n?.height:Math.max(10,c.height))+o*2,u=l/2,d=u-Math.sqrt(Math.max(0,u**2-(c.height/2)**2)),f=(n?.width?n?.width:Math.max(15,c.width)+d*2)+a*2,{cssStyles:p}=n,m=T.svg(s),h=g(n,{});n.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let v=[{x:-f/2,y:-l/2},{x:f/2-u,y:-l/2},...B(-f/2+u,0,u,50,90,270),{x:f/2-u,y:l/2},{x:-f/2,y:l/2}],y=R(v),b=m.path(y,h),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),p&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,p),i&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,i),I(n,x),n.intersect=function(e){return t.info(`Pill intersect`,n,{radius:u,point:e}),K.polygon(n,v,e)},s}e(rt,`halfRoundedRectangle`);var it=e((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function at(e,t){let{labelStyles:n,nodeStyles:r}=_(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await P(e,t,L(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,f=(t?.width?t?.width:l.width)+2*d+s,p=[{x:d,y:0},{x:f-d,y:0},{x:f,y:-u/2},{x:f-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=T.svg(c),n=g(t,{}),r=it(0,0,f,u,d),i=e.path(r,n);m=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-f/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=J(c,f,u,p);return r&&m.attr(`style`,r),t.width=f,t.height=u,I(t,m),t.intersect=function(e){return K.polygon(t,p,e)},c}e(at,`hexagon`);async function ot(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.label=``,n.labelStyle=r;let{shapeSvg:a}=await P(e,n,L(n)),o=Math.max(30,n?.width??0),s=Math.max(30,n?.height??0),{cssStyles:c}=n,l=T.svg(a),u=g(n,{});n.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],f=R(d),p=l.path(f,u),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container outer-path`),c&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,c),i&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,i),m.attr(`transform`,`translate(${-o/2}, ${-s/2})`),I(n,m),n.intersect=function(e){return t.info(`Pill intersect`,n,{points:d}),K.polygon(n,d,e)},a}e(ot,`hourglass`);async function st(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await P(e,n,`icon-shape default`),p=n.pos===`t`,m=c,h=c,{nodeBorder:v}=r,{stylesMap:b}=y(n),S=-h/2,C=-m/2,w=n.label?8:0,E=T.svg(u),D=g(n,{stroke:`none`,fill:`none`});n.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(S,C,h,m,D),k=Math.max(h,d.width),A=m+d.height+w,j=E.rectangle(-k/2,-A/2,k,A,{...D,fill:`transparent`,stroke:`none`}),M=u.insert(()=>O,`:first-child`),N=u.insert(()=>j);if(n.icon){let e=u.append(`g`);e.html(`${await x(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+w/2-i/2-o:-d.height/2-w/2-i/2-o})`),e.attr(`style`,`color: ${b.get(`stroke`)??v};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-A/2:A/2-d.height})`),M.attr(`transform`,`translate(0,${p?d.height/2+w/2:-d.height/2-w/2})`),I(n,N),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=p?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+w},{x:r+h/2,y:i-a/2+d.height+w},{x:r+h/2,y:i+a/2},{x:r-h/2,y:i+a/2},{x:r-h/2,y:i-a/2+d.height+w},{x:r-d.width/2,y:i-a/2+d.height+w}]:[{x:r-h/2,y:i-a/2},{x:r+h/2,y:i-a/2},{x:r+h/2,y:i-a/2+m},{x:r+d.width/2,y:i-a/2+m},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+m},{x:r-h/2,y:i-a/2+m}],K.polygon(n,o,e)},u}e(st,`icon`);async function ct(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await P(e,n,`icon-shape default`),p=n.label?8:0,m=n.pos===`t`,{nodeBorder:h,mainBkg:v}=r,{stylesMap:b}=y(n),S=T.svg(u),C=g(n,{});n.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`),C.stroke=b.get(`fill`)??v;let w=u.append(`g`);n.icon&&w.html(`${await x(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let E=w.node().getBBox(),D=E.width,O=E.height,k=E.x,A=E.y,j=Math.max(D,O)*Math.SQRT2+40,M=S.circle(0,0,j,C),N=Math.max(j,d.width),F=j+d.height+p,L=S.rectangle(-N/2,-F/2,N,F,{...C,fill:`transparent`,stroke:`none`}),R=u.insert(()=>M,`:first-child`),z=u.insert(()=>L);return w.attr(`transform`,`translate(${-D/2-k},${m?d.height/2+p/2-O/2-A:-d.height/2-p/2-O/2-A})`),w.attr(`style`,`color: ${b.get(`stroke`)??h};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-F/2:F/2-d.height})`),R.attr(`transform`,`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),I(n,z),n.intersect=function(e){return t.info(`iconSquare intersect`,n,e),K.rect(n,e)},u}e(ct,`iconCircle`);async function lt(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await P(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,v=c+f*2,{nodeBorder:b,mainBkg:S}=r,{stylesMap:C}=y(n),w=-v/2,E=-h/2,D=n.label?8:0,O=T.svg(u),k=g(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=C.get(`fill`)??S;let A=O.path(q(w,E,v,h,5),k),j=Math.max(v,d.width),M=h+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),F=u.insert(()=>A,`:first-child`).attr(`class`,`icon-shape2`),L=u.insert(()=>N);if(n.icon){let e=u.append(`g`);e.html(`${await x(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${C.get(`stroke`)??b};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-M/2:M/2-d.height})`),F.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),I(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+v/2,y:i-a/2+d.height+D},{x:r+v/2,y:i+a/2},{x:r-v/2,y:i+a/2},{x:r-v/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-v/2,y:i-a/2},{x:r+v/2,y:i-a/2},{x:r+v/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-v/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(lt,`iconRounded`);async function ut(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await P(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,v=c+f*2,{nodeBorder:b,mainBkg:S}=r,{stylesMap:C}=y(n),w=-v/2,E=-h/2,D=n.label?8:0,O=T.svg(u),k=g(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=C.get(`fill`)??S;let A=O.path(q(w,E,v,h,.1),k),j=Math.max(v,d.width),M=h+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),F=u.insert(()=>A,`:first-child`),L=u.insert(()=>N);if(n.icon){let e=u.append(`g`);e.html(`${await x(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${C.get(`stroke`)??b};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-M/2:M/2-d.height})`),F.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),I(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+v/2,y:i-a/2+d.height+D},{x:r+v/2,y:i+a/2},{x:r-v/2,y:i+a/2},{x:r-v/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-v/2,y:i-a/2},{x:r+v/2,y:i-a/2},{x:r+v/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-v/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(ut,`iconSquare`);async function dt(e,n,{config:{flowchart:r}}){let i=new Image;i.src=n?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));n.imageAspectRatio=a/o;let{labelStyles:s}=_(n);n.labelStyle=s;let c=r?.wrappingWidth;n.defaultWidth=r?.wrappingWidth;let l=Math.max(n.label?c??0:0,n?.assetWidth??a),u=n.constraint===`on`&&n?.assetHeight?n.assetHeight*n.imageAspectRatio:l,d=n.constraint===`on`?u/n.imageAspectRatio:n?.assetHeight??o;n.width=Math.max(u,c??0);let{shapeSvg:f,bbox:p,label:m}=await P(e,n,`image-shape default`),h=n.pos===`t`,v=-u/2,y=-d/2,b=n.label?8:0,x=T.svg(f),S=g(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let C=x.rectangle(v,y,u,d,S),w=Math.max(u,p.width),E=d+p.height+b,D=x.rectangle(-w/2,-E/2,w,E,{...S,fill:`none`,stroke:`none`}),O=f.insert(()=>C,`:first-child`),k=f.insert(()=>D);if(n.img){let e=f.append(`image`);e.attr(`href`,n.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?E/2-d:-E/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-b/2:d/2-p.height/2+b/2})`),O.attr(`transform`,`translate(0,${h?p.height/2+b/2:-p.height/2-b/2})`),I(n,k),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=h?[{x:r-p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2+p.height+b},{x:r+u/2,y:i-a/2+p.height+b},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+p.height+b},{x:r-p.width/2,y:i-a/2+p.height+b}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+p.width/2,y:i-a/2+d},{x:r+p.width/2/2,y:i+a/2},{x:r-p.width/2,y:i+a/2},{x:r-p.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],K.polygon(n,o,e)},f}e(dt,`imageSquare`);async function ft(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a*2,t.height??0),u=Math.max(c.width+o*2,(t.width??0)-l),d=[{x:0,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:-3*l/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=g(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ft,`inv_trapezoid`);async function pt(e,t){let{shapeSvg:n,bbox:r,label:i}=await P(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),I(t,a),t.intersect=function(e){return K.rect(t,e)},n}e(pt,`labelRect`);async function mt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=g(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(mt,`lean_left`);async function ht(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=g(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ht,`lean_right`);function gt(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.label=``,n.labelStyle=r;let a=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),{cssStyles:o}=n,s=Math.max(35,n?.width??0),c=Math.max(35,n?.height??0),l=[{x:s,y:0},{x:0,y:c+7/2},{x:s-14,y:c+7/2},{x:0,y:2*c},{x:s,y:c-7/2},{x:14,y:c-7/2}],u=T.svg(a),d=g(n,{});n.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=R(l),p=u.path(f,d),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`outer-path`),o&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,o),i&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,i),m.attr(`transform`,`translate(-${s/2},${-c})`),I(n,m),n.intersect=function(e){return t.info(`lightningBolt intersect`,n,e),K.polygon(n,l,e)},a}e(gt,`lightningBolt`);var _t=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),vt=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),yt=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),bt=10,xt=10;async function St(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.widtho,`:first-child`).attr(`class`,`line`),v=s.insert(()=>a,`:first-child`),v.attr(`class`,`basic label-container`),y&&v.attr(`style`,y)}else{let e=_t(0,0,u,p,d,f,m);v=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,h(y)).attr(`style`,r)}return v.attr(`label-offset-y`,f),v.attr(`transform`,`translate(${-u/2}, ${-(p/2+f)})`),I(t,v),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+f-(c.y-(c.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}e(St,`linedCylinder`);async function Ct(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,f=t.look===`neo`?d/4:d/8,p=d+f,{cssStyles:m}=t,h=T.svg(s),v=g(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...z(-u/2-u/2*.1,p/2,u/2+u/2*.1,p/2,f,.8),{x:u/2+u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:-p/2},{x:-u/2,y:-p/2},{x:-u/2,y:p/2*1.1},{x:-u/2,y:-p/2}],b=h.polygon(y.map(e=>[e.x,e.y]),v),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(0,${-f/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-f-(c.y-(c.top??0))})`),I(t,x),t.intersect=function(e){return K.polygon(t,y,e)},s}e(Ct,`linedWaveEdgedRect`);var wt=56,Tt=72,Et=8,Dt=2,Ot=8,kt={normal:`usecase-actor-shape usecase-actor-normal`,hollow:`usecase-actor-hollow`,awesome:`usecase-actor-awesome`,icon:`usecase-actor-icon`},At=Math.PI/3,jt=.6,Mt=e((e,t)=>{let n=t*jt,r=t*Math.sqrt(1-jt**2),i=Math.cos(At),a=-Math.sin(At),o=n*-a,s=e+n*i,c=r*i,l=r*a;return`M ${o-c} ${s-l} L ${o+c} ${s+l}`},`businessMarkerPathForCircle`),Nt={normal:Mt(-24,12),hollow:Mt(-23,9),awesome:Mt(-21,13),icon:`M 12 -8 L 26 -26`},Pt=e((e,t,n)=>{let r=(t.x??0)-(t.left??0),i=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${-t.width/2-r},${n-t.height/2-i})`)},`positionLabel`),Ft=e((e,t,n,r,i=!1)=>{if(t.look===`handDrawn`){let a=T.svg(e).path(n,g(t,i?{fill:`none`}:{}));return e.insert(()=>a,`:first-child`).attr(`class`,r)}let a=e.append(`path`).attr(`class`,r).attr(`d`,n);return i&&a.attr(`fill`,`none`),a},`appendActorPath`),It=e((e,t,n,r,i,a,o=!1)=>{if(t.look===`handDrawn`){let s=T.svg(e).circle(n,r,i*2,g(t,o?{fill:`none`}:{}));return e.insert(()=>s,`:first-child`).attr(`class`,a)}let s=e.append(`circle`).attr(`class`,a).attr(`cx`,n).attr(`cy`,r).attr(`r`,i);return o&&s.attr(`fill`,`none`),s},`appendActorCircle`),Lt=e((e,t,n)=>{t.business&&e.append(`path`).attr(`class`,`usecase-business-marker usecase-actor-business-marker`).attr(`d`,Nt[n]).attr(`fill`,`none`).attr(`style`,`stroke: inherit !important; stroke-width: inherit !important`)},`appendBusinessActorMarker`);async function Rt(e,t,n,r){let{labelStyles:i,nodeStyles:a}=_(t);t.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await P(e,n===`icon`||t.stereotype!==void 0?{...t,icon:n===`icon`?void 0:t.icon,stereotype:void 0}:t,L(t,`usecase-actor-variant usecase-actor-${n}`)),l=t.accessibleName??t.label;l&&o.attr(`role`,`img`).attr(`aria-label`,l),c.attr(`class`,`label actor-label usecase-actor-label`);let{theme:d,themeVariables:f}=u();w(o,t.colorIndex,d,f.borderColorArray);let p,m;if(t.stereotype){let e=await F(o,`\xAB${t.stereotype}\xBB`,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});p=e.label.attr(`class`,`label usecase-stereotype`),m=e.bbox}let h=o.append(`g`).attr(`class`,`usecase-actor-glyph ${kt[n]}`).attr(`style`,a||null);await r(h,t),Lt(h,t,n);let g=t.padding??Ot,v=m?.height??0,y=Tt+Et+s.height+(m?v+Dt:0),b=Math.max(wt,s.width,m?.width??0)+g*2,x=y+g*2,S=-y/2;h.attr(`transform`,`translate(0,${S+Tt/2})`);let C=S+Tt+Et;return p&&m&&(C+=v/2,Pt(p,m,C),C+=v/2+Dt),Pt(c,s,C+s.height/2),I(t,o.insert(`rect`,`:first-child`).attr(`class`,`usecase-actor-outline`).attr(`x`,-b/2).attr(`y`,-x/2).attr(`width`,b).attr(`height`,x).attr(`opacity`,0).attr(`aria-hidden`,`true`)),t.intersect=e=>K.rect(t,e),o}e(Rt,`renderUsecaseActor`);var zt=[`M 0 -12`,`C 6.627 -12 12 -17.373 12 -24`,`C 12 -30.627 6.627 -36 0 -36`,`C -6.627 -36 -12 -30.627 -12 -24`,`C -12 -17.373 -6.627 -12 0 -12 Z`,`M 0 -12 V 8`,`M -17 -5 H 17`,`M 0 8 L -15 28`,`M 0 8 L 15 28`].join(` `);async function Bt(e,t){return Rt(e,t,`normal`,(e,t)=>{Ft(e,t,zt,`usecase-actor-stick`)})}e(Bt,`usecaseActor`);var Vt=[`M 0 -34`,`C 7.18 -34 13 -28.18 13 -21`,`C 13 -13.82 7.18 -8 0 -8`,`C -7.18 -8 -13 -13.82 -13 -21`,`C -13 -28.18 -7.18 -34 0 -34 Z`,`M -24 25`,`C -24 7 -14 -3 0 -3`,`C 14 -3 24 7 24 25`,`C 24 28 21 30 18 30`,`H -18`,`C -21 30 -24 28 -24 25 Z`].join(` `);async function Ht(e,t){return Rt(e,t,`awesome`,(e,t)=>{Ft(e,t,Vt,`usecase-actor-awesome-silhouette`)})}e(Ht,`usecaseActorAwesome`);var Ut=[`M -22 -10`,`H 22`,`V 0`,`H 6`,`L 22 17`,`L 13 28`,`L 0 13`,`L -13 28`,`L -22 17`,`L -6 0`,`H -22`,`Z`].join(` `);async function Wt(e,t){return Rt(e,t,`hollow`,(e,t)=>{It(e,t,0,-23,9,`usecase-actor-hollow-head`,!0),Ft(e,t,Ut,`usecase-actor-hollow-body`,!0)})}e(Wt,`usecaseActorHollow`);var Gt=52,Kt=42,qt=-2,Jt=e(async(e,t)=>{let n=-Gt/2,r=qt-Gt/2;if(t.look===`handDrawn`){let i=T.svg(e).rectangle(n,r,Gt,Gt,g(t,{}));e.insert(()=>i,`:first-child`).attr(`class`,`usecase-actor-icon-frame`)}else e.append(`rect`).attr(`class`,`usecase-actor-icon-frame`).attr(`x`,n).attr(`y`,r).attr(`width`,Gt).attr(`height`,Gt).attr(`rx`,4).attr(`ry`,4);let i=t.icon??``,a=await b(i.includes(`:`)?i:`fa:${i}`),o=await x(i,{height:Kt,width:Kt,fallbackPrefix:`fa`}),s=e.append(`g`).attr(`class`,`usecase-actor-icon-symbol${a?``:` usecase-actor-icon-fallback`}`).attr(`aria-hidden`,`true`).html(`${o}`),c=s.node()?.getBBox();c&&s.attr(`transform`,`translate(${-c.width/2-c.x},${qt-c.height/2-c.y})`)},`drawIconActor`);async function Yt(e,t){return Rt(e,t,`icon`,Jt)}e(Yt,`usecaseActorIcon`);var Xt=e((e,t,n)=>{let r=(t.x??0)-(t.left??0),i=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${-t.width/2-r},${n-t.height/2-i})`)},`positionLabel`);async function Zt(e,t){let n=t,{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await P(e,n.stereotype?{...t,stereotype:void 0}:t,L(t,`usecase-business-shape`));c.attr(`class`,`label usecase-label`);let{theme:l,themeVariables:d}=u();w(a,t.colorIndex,l,d.borderColorArray);let f,p;if(n.stereotype){let e=await F(a,`\xAB${n.stereotype}\xBB`,{labelStyle:r,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});f=e.label.attr(`class`,`label usecase-stereotype`),p=e.bbox}let m=p?2:0,h=o.height+(p?.height??0)+m,v=Math.max(o.width,p?.width??0),y=s??10,b=v/2+y*2,x=h/2+y*2,S=Math.min(Math.max(y/5,1),y/2),C=v/2+S,E=b-S,D=C/b,O=E/b,k=x*Math.sqrt(Math.max(0,1-D*D)),A=-x*Math.sqrt(Math.max(0,1-O*O));f&&p&&Xt(f,p,-h/2+p.height/2),Xt(c,o,h/2-o.height/2);let j;if(t.look===`handDrawn`){let e=T.svg(a).ellipse(0,0,b*2,x*2,g(t,{}));j=a.insert(()=>e,`:first-child`).attr(`class`,`basic label-container usecase-business-ellipse`)}else j=a.insert(`ellipse`,`:first-child`).attr(`class`,`basic label-container usecase-business-ellipse`).attr(`style`,i).attr(`rx`,b).attr(`ry`,x).attr(`cx`,0).attr(`cy`,0);a.append(`path`).attr(`class`,`usecase-business-marker`).attr(`d`,`M ${C} ${k} L ${E} ${A}`).attr(`fill`,`none`).attr(`style`,i||null);let M=n.accessibleName??n.label;return M&&a.attr(`role`,`img`).attr(`aria-label`,M),I(t,j),t.calcIntersect=(e,t)=>K.ellipse(e,e.width/2,e.height/2,t),t.intersect=e=>K.ellipse(t,b,x,e),a}e(Zt,`usecaseBusiness`);var Qt=8,$t=4,en=1,tn=e((e,t,n,r)=>{let i=(t.x??0)-(t.left??0),a=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${n-t.width/2-i},${r-t.height/2-a})`)},`positionLabel`),nn=e(e=>{let t=Number.parseFloat(e??``);return Number.isFinite(t)&&t>=0?t:en},`numericStrokeWidth`);async function rn(t,n){let r=n,{labelStyles:i,nodeStyles:a}=_(n),{stylesMap:o}=y(n);n.labelStyle=i;let{shapeSvg:s,bbox:c,label:l}=await P(t,n,L(n,`usecase-json-table`));s.attr(`role`,`img`),r.accessibleName&&s.attr(`aria-label`,r.accessibleName),l.attr(`class`,`label usecase-json-title`);let u=s.append(`g`).attr(`class`,`usecase-json-table-grid`),d=[];for(let e of r.jsonRows??[]){let t=await F(u,e.key,{labelStyle:i,useHtmlLabels:n.useHtmlLabels,padding:0,centerLabel:!0}),r=await F(u,e.value,{labelStyle:i,useHtmlLabels:n.useHtmlLabels,padding:0,centerLabel:!0});d.push({key:{label:t.label.attr(`class`,`label usecase-json-key`),bbox:t.bbox},value:{label:r.label.attr(`class`,`label usecase-json-value`),bbox:r.bbox}})}let f=Math.max(0,...d.map(({key:e})=>e.bbox.width))+Qt*2,p=Math.max(0,...d.map(({value:e})=>e.bbox.width))+Qt*2,m=c.width+Qt*2,h=Math.max(m,f+p),v=p+Math.max(0,h-f-p),b=c.height+$t*2,x=d.map(({key:e,value:t})=>Math.max(e.bbox.height,t.bbox.height)+$t*2),S=b+x.reduce((e,t)=>e+t,0),C=nn(o.get(`stroke-width`)),w=h+C*2,E=S+C*2,D=-h/2,O=-S/2,k=n.look===`handDrawn`?T.svg(s):void 0,A=k?g(n,{}):void 0,j=e((e,t,n,r,i,o)=>{if(k&&A){let a=k.rectangle(n,r,i,o,A);return e.insert(()=>a,`:first-child`).attr(`class`,t)}return e.insert(`rect`,`:first-child`).attr(`class`,t).attr(`x`,n).attr(`y`,r).attr(`width`,i).attr(`height`,o).attr(`style`,a)},`insertCell`),M=j(s,`label-container usecase-json-border`,-w/2,-E/2,w,E);j(u,`usecase-json-cell usecase-json-title-cell`,D,O,h,b),u.node()?.append(l.node()),tn(l,c,0,O+b/2);let N=O+b;return d.forEach(({key:e,value:t},n)=>{let r=x[n],i=u.append(`g`).attr(`class`,`usecase-json-row`).attr(`data-row-index`,n).attr(`transform`,`translate(0,${N})`);j(i,`usecase-json-cell usecase-json-key-cell`,D,0,f,r),j(i,`usecase-json-cell usecase-json-value-cell`,D+f,0,v,r),i.node()?.append(e.label.node(),t.label.node()),tn(e.label,e.bbox,D+f/2,r/2),tn(t.label,t.bbox,D+f+v/2,r/2),N+=r}),I(n,M),n.intersect=e=>K.rect(n,e),s}e(rn,`usecaseJsonTable`);async function an(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await P(e,t,L(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,f=(t?.height?t?.height:l.height)+o*2+2*s,p=d-2*s,m=f-2*s,h=-p/2,v=-m/2,{cssStyles:y}=t,b=T.svg(c),x=g(t,{}),S=[{x:h-s,y:v+s},{x:h-s,y:v+m+s},{x:h+p-s,y:v+m+s},{x:h+p-s,y:v+m},{x:h+p,y:v+m},{x:h+p,y:v+m-s},{x:h+p+s,y:v+m-s},{x:h+p+s,y:v-s},{x:h+s,y:v-s},{x:h+s,y:v},{x:h,y:v},{x:h,y:v+s}],C=[{x:h,y:v+s},{x:h+p-s,y:v+s},{x:h+p-s,y:v+m},{x:h+p,y:v+m},{x:h+p,y:v},{x:h,y:v}];t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let w=R(S),E=b.path(w,x),D=R(C),O=b.path(D,x);t.look!==`handDrawn`&&(E=ee(E),O=ee(O));let k=c.insert(`g`,`:first-child`);return k.insert(()=>E),k.insert(()=>O),k.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),I(t,k),t.intersect=function(e){return K.polygon(t,S,e)},c}e(an,`multiRect`);async function on(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,f=Math.max(a.height,t?.height??0)+l*3,p=t.look===`neo`?f/4:f/8,m=f+(u?p/2:-p/2),h=-d/2,v=-m/2,{cssStyles:y}=t,b=z(h-10,v+m+10,h+d-10,v+m+10,p,.8),x=b?.[b.length-1],S=[{x:h-10,y:v+10},{x:h-10,y:v+m+10},...b,{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:x.y-20},{x:h+d+10,y:x.y-20},{x:h+d+10,y:v-10},{x:h+10,y:v-10},{x:h+10,y:v},{x:h,y:v},{x:h,y:v+10}],C=[{x:h,y:v+10},{x:h+d-10,y:v+10},{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:v},{x:h,y:v}],w=T.svg(i),E=g(t,{});t.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`);let D=R(S),O=w.path(D,E),k=R(C),A=w.path(k,E),j=i.insert(()=>O,`:first-child`);return j.insert(()=>A),j.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p-(a.y-(a.top??0))})`),I(t,j),t.intersect=function(e){return K.polygon(t,S,e)},i}e(on,`multiWaveEdgedRectangle`);async function sn(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r,t.useHtmlLabels||o(s())||(t.centerLabel=!0);let{shapeSvg:a,bbox:c,label:l}=await P(e,t,L(t)),u=Math.max(c.width+(t.padding??0)*2,t?.width??0),d=Math.max(c.height+(t.padding??0)*2,t?.height??0),f=-u/2,p=-d/2,{cssStyles:m}=t,h=T.svg(a),v=g(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=h.rectangle(f,p,u,d,v),b=a.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),l.attr(`class`,`label noteLabel`),m&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,m),i&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,i),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),I(t,b),t.intersect=function(e){return K.rect(t,e)},a}e(sn,`note`);var cn=e((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function ln(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await P(e,t,L(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=g(t,{}),r=cn(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=J(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),I(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}];return K.polygon(e,r,t)},t.intersect=function(e){return this.calcIntersect(t,e)},i}e(ln,`question`);async function un(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=c.width+(t.look===`neo`?a*2:a),d=Math.max(c.height+(t.look===`neo`?o*2:o),t.height??0),f=d/4,p=-Math.max(u,(t.width??0)-f)/2,m=-d/2,h=m/2,v=[{x:p+h,y:m},{x:p,y:0},{x:p+h,y:-m},{x:-p,y:-m},{x:-p,y:m}],{cssStyles:y}=t,b=T.svg(s),x=g(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=R(v),C=b.path(S,x),w=s.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${-h/2},0)`),l.attr(`transform`,`translate(${-h/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),I(t,w),t.intersect=function(e){return K.polygon(t,v,e)},s}e(un,`rect_left_inv_arrow`);async function dn(e,r){let{labelStyles:i,nodeStyles:a}=_(r);r.labelStyle=i;let s;s=r.cssClasses?`node `+r.cssClasses:`node default`;let c=e.insert(`g`).attr(`class`,s).attr(`id`,r.domId||r.id),l=c.insert(`g`),d=c.insert(`g`).attr(`class`,`label`).attr(`style`,a),f=r.description,p=r.label,m=await se(d,p,r.labelStyle,!0,!0),h={width:0,height:0};if(o(u())){let e=m.children[0],t=n(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}t.info(`Text 2`,f);let v=f||[],y=m.getBBox(),b=await se(d,Array.isArray(v)?v.join(`
`):v,r.labelStyle,!0,!0),x=b.children[0],S=n(b);h=x.getBoundingClientRect(),S.attr(`width`,h.width),S.attr(`height`,h.height);let C=(r.padding||0)/2;n(b).attr(`transform`,`translate( `+(h.width>y.width?0:(y.width-h.width)/2)+`, `+(y.height+C+5)+`)`),n(m).attr(`transform`,`translate( `+(h.width(t.debug(`Rough node insert CXC`,i),a),`:first-child`),k=c.insert(()=>(t.debug(`Rough node insert CXC`,i),i),`:first-child`)}else k=l.insert(`rect`,`:first-child`),A=l.insert(`line`),k.attr(`class`,`outer title-state`).attr(`style`,a).attr(`x`,-h.width/2-C).attr(`y`,-h.height/2-C).attr(`width`,h.width+(r.padding||0)).attr(`height`,h.height+(r.padding||0)),A.attr(`class`,`divider`).attr(`x1`,-h.width/2-C).attr(`x2`,h.width/2+C).attr(`y1`,-h.height/2-C+y.height+C).attr(`y2`,-h.height/2-C+y.height+C);return I(r,k),r.intersect=function(e){return K.rect(r,e)},c}e(dn,`rectWithTitle`);async function fn(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return Ke(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}e(fn,`roundedRect`);var pn=8;async function mn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?pn:pn*2),u=(t?.height??s.height)+a*2,d=l-pn,f=u,p=pn-l/2,m=-u/2,{cssStyles:v}=t,y=T.svg(o),b=g(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:p,y:m},{x:p+d,y:m},{x:p+d,y:m+f},{x:p-pn,y:m+f},{x:p-pn,y:m},{x:p,y:m},{x:p,y:m+f}],S=y.polygon(x.map(e=>[e.x,e.y]),b),C=o.insert(()=>S,`:first-child`);return C.attr(`class`,`basic label-container outer-path`).attr(`style`,h(v)),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),v&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${pn/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),I(t,C),t.intersect=function(e){return K.rect(t,e)},o}e(mn,`shadedProcess`);async function hn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,f=u,p=d/1.5,m=-f/2,h=-p/2,{cssStyles:v}=t,y=T.svg(s),b=g(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:m,y:h},{x:m,y:h+p},{x:m+f,y:h+p},{x:m+f,y:h-p/2}],S=R(x),C=y.path(S,b),w=s.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,r),w.attr(`transform`,`translate(0, ${p/4})`),l.attr(`transform`,`translate(${-f/2+(t.padding??0)-(c.x-(c.left??0))}, ${-p/4+(t.padding??0)-(c.y-(c.top??0))})`),I(t,w),t.intersect=function(e){return K.polygon(t,x,e)},s}e(hn,`slopedRect`);async function gn(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n,a=await Ke(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i});if(t.colorIndex!==void 0){let{theme:e,themeVariables:n}=u();w(a,t.colorIndex,e,n.borderColorArray)}return a}e(gn,`squareRect`);var _n=50,vn=e((e,t,n)=>{let r=e.height+n,i=r*Math.cos(Math.PI/(2*(_n-1))),a=Math.sqrt(Math.max(0,i**2-e.height**2));return{w:Math.max(e.width+r/4+t,1.5*r+(r-i),e.width+t+r-a),h:r}},`stadiumDimensions`);async function yn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?40:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),{w:l,h:u}=vn(c,a,o),d=u/2,{cssStyles:f}=t,p=T.svg(s),m=g(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-l/2+d,y:-u/2},{x:l/2-d,y:-u/2},...B(-l/2+d,0,d,_n,90,270),{x:l/2-d,y:u/2},...B(l/2-d,0,d,_n,270,450)],v=R(h),y=p.path(v,m),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,r),I(t,b),t.intersect=function(e){return K.polygon(t,h,e)},s}e(yn,`stadium`);async function bn(e,t){return Ke(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}e(bn,`state`);function xn(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=T.svg(u),f=g(t,{});t.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=d.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),m=s??c,h=(t.width??0)*5/14,v=d.circle(0,0,h,{...f,fill:m,stroke:m,strokeWidth:2,fillStyle:`solid`}),y=u.insert(()=>p,`:first-child`);if(y.insert(()=>v),t.look!==`handDrawn`&&y.attr(`class`,`outer-path`),a&&y.selectAll(`path`).attr(`style`,a),i&&y.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;y.attr(`style`,`filter:url(#${n})`)}return I(t,y),t.intersect=function(e){return K.circle(t,(t.width??0)/2,e)},u}e(xn,`stateEnd`);function Sn(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=T.svg(a).circle(0,0,t.width,v(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return I(t,o),t.intersect=function(e){return K.circle(t,(t.width??7)/2,e)},a}e(Sn,`stateStart`);var Cn=8;async function wn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.width+2*Cn+a,t.width??0),u=Math.max(c.height+o,t.height??0),d=l-2*Cn,f=u,p=-l/2,m=-u/2,v=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look===`handDrawn`){let e=T.svg(s),n=g(t,{}),r=e.rectangle(p,m,d+16,f,n),i=e.line(p+Cn,m,p+Cn,m+f,n),a=e.line(p+Cn+d,m,p+Cn+d,m+f,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:c}=t;o.attr(`class`,`basic label-container`).attr(`style`,h(c)),I(t,o)}else{let e=J(s,d,f,v);r&&e.attr(`style`,r),I(t,e)}return t.intersect=function(e){return K.polygon(t,v,e)},s}e(wn,`subroutine`);var Tn=.2;async function En(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-Tn*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.height?t?.height:c.height)+o*2,u=Tn*l,d=Tn*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,m=-f/2,h=-p/2,{cssStyles:v}=t,y=T.svg(s),b=g(t,{}),x=[{x:m-u/2,y:h},{x:m+f+u/2,y:h},{x:m+f+u/2,y:h+p},{x:m-u/2,y:h+p}],S=[{x:m+f-u/2,y:h+p},{x:m+f+u/2,y:h+p},{x:m+f+u/2,y:h+p-d}];t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let C=R(x),w=y.path(C,b),E=R(S),D=y.path(E,{...b,fillStyle:`solid`}),O=s.insert(()=>D,`:first-child`);return O.insert(()=>w,`:first-child`),O.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),I(t,O),t.intersect=function(e){return K.polygon(t,x,e)},s}e(En,`taggedRect`);async function Dn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,m=T.svg(i),h=g(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let v=[{x:-s/2-s/2*.1,y:f/2},...z(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],y=-s/2+s/2*.1,b=-f/2-d*.4,x=[{x:y+s-u,y:(b+c)*1.3},{x:y+s,y:b+c-d},{x:y+s,y:(b+c)*.9},...z(y+s,(b+c)*1.25,y+s-u,(b+c)*1.3,-c*.02,.5)],S=R(v),C=m.path(S,h),w=R(x),E=m.path(w,{...h,fillStyle:`solid`}),D=i.insert(()=>E,`:first-child`);return D.insert(()=>C,`:first-child`),D.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),I(t,D),t.intersect=function(e){return K.polygon(t,v,e)},i}e(Dn,`taggedWaveEdgedRectangle`);async function On(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await P(e,t,L(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),I(t,u),t.intersect=function(e){return K.rect(t,e)},i}e(On,`text`);var kn=e((e,t,n,r,i,a)=>`M${e},${t} a${i},${a} 0,0,1 0,${-r} l${n},0 a${i},${a} 0,0,1 0,${r} M${n},${-r} a${i},${a} 0,0,0 0,${r} - l${-n},0`,`createCylinderPathD`),An=e((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),jn=e((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`),Mn=5,Nn=10;async function Pn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?12:i/2,o=t.height??0;if(t.height&&(t.height-=a,t.heighta,`:first-child`),g=s.insert(()=>i,`:first-child`),g.attr(`class`,`basic label-container`),m&&g.attr(`style`,m)}else{let e=kn(0,0,p,u,f,d);g=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,h(m)).attr(`style`,r),g.attr(`class`,`basic label-container outer-path`),m&&g.selectAll(`path`).attr(`style`,m),r&&g.selectAll(`path`).attr(`style`,r)}return g.attr(`label-offset-x`,f),g.attr(`transform`,`translate(${-p/2}, ${u/2} )`),l.attr(`transform`,`translate(${-(c.width/2)-f-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),I(t,g),t.intersect=function(e){let n=K.rect(t,e),r=n.y-(t.y??0);if(d!=0&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-f)){let i=f*f*(1-r*r/(d*d));i!=0&&(i=Math.sqrt(Math.abs(i))),i=f-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},s}e(Pn,`tiltedCylinder`);async function Fn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=(t.look,i),o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(Fn,`trapezoid`);async function In(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=(t.height??0)-o*2,t.height<5&&(t.height=5),t.width=(t.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o*2,{cssStyles:d}=t,f=T.svg(s),p=b(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{x:-l/2*.8,y:-u/2},{x:l/2*.8,y:-u/2},{x:l/2,y:-u/2*.6},{x:l/2,y:u/2},{x:-l/2,y:u/2},{x:-l/2,y:-u/2*.6}],h=R(m),g=f.path(h,p),_=s.insert(()=>g,`:first-child`);return _.attr(`class`,`basic label-container outer-path`),d&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,r),I(t,_),t.intersect=function(e){return K.polygon(t,m,e)},s}e(In,`trapezoidalPentagon`);var Ln=10,Rn=10;async function zn(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.width=((n?.width??0)-o)/2,n.widthC,`:first-child`).attr(`transform`,`translate(${-m/2}, ${m/2})`).attr(`class`,`outer-path`);return _&&n.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,_),i&&n.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,i),n.width=p,n.height=m,I(n,w),d.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${m/2-(c.height+(n.padding??0)/(f?2:1)-(c.y-(c.top??0)))})`),n.intersect=function(e){return t.info(`Triangle intersect`,n,g,e),K.polygon(n,g,e)},s}e(zn,`triangle`);async function Bn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:c,bbox:l,label:u}=await P(e,t,L(t)),d=(t?.width?t?.width:l.width)+(a??0)*2,f=(t?.height?t?.height:l.height)+(o??0)*2,p=t.look===`neo`?f/4:f/8,m=f+(s?p:-p),{cssStyles:h}=t,g=14-d,_=g>0?g/2:0,v=T.svg(c),y=b(t,{});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let S=[{x:-d/2-_,y:m/2},...z(-d/2-_,m/2,d/2+_,m/2,p,.8),{x:d/2+_,y:-m/2},{x:-d/2-_,y:-m/2}],C=R(S),w=v.path(C,y),E=c.insert(()=>w,`:first-child`);return E.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,r),E.attr(`transform`,`translate(0,${-p/2})`),u.attr(`transform`,`translate(${-d/2+(t.padding??0)-(l.x-(l.left??0))},${-f/2+(t.padding??0)-p-(l.y-(l.top??0))})`),I(t,E),t.intersect=function(e){return K.polygon(t,S,e)},c}e(Bn,`waveEdgedRectangle`);async function Vn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let e=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-20/9*e),t.width-=a*2}let{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o,d=u/8,f=u+d*2,{cssStyles:p}=t,m=T.svg(s),h=b(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-l/2,y:f/2},...z(-l/2,f/2,l/2,f/2,d,1),{x:l/2,y:-f/2},...z(l/2,-f/2,-l/2,-f/2,d,-1)],_=R(g),v=m.path(_,h),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),I(t,y),t.intersect=function(e){return K.polygon(t,g,e)},s}e(Vn,`waveRectangle`);var Q=10;async function Hn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-Q,10),t.height=Math.max((t?.height??0)-a*2-Q,10));let{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=(t?.width?t?.width:s.width)+i*2+Q,u=(t?.height?t?.height:s.height)+a*2+Q,d=l-Q,f=u-Q,p=-d/2,m=-f/2,{cssStyles:h}=t,g=T.svg(o),_=b(t,{}),v=[{x:p-Q,y:m-Q},{x:p-Q,y:m+f},{x:p+d,y:m+f},{x:p+d,y:m-Q}],y=`M${p-Q},${m-Q} L${p+d},${m-Q} L${p+d},${m+f} L${p-Q},${m+f} L${p-Q},${m-Q} + l${-n},0`,`createCylinderPathD`),An=e((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),jn=e((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`),Mn=5,Nn=10;async function Pn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?12:i/2,o=t.height??0;if(t.height&&(t.height-=a,t.heighta,`:first-child`),v=s.insert(()=>i,`:first-child`),v.attr(`class`,`basic label-container`),m&&v.attr(`style`,m)}else{let e=kn(0,0,p,u,f,d);v=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,h(m)).attr(`style`,r),v.attr(`class`,`basic label-container outer-path`),m&&v.selectAll(`path`).attr(`style`,m),r&&v.selectAll(`path`).attr(`style`,r)}return v.attr(`label-offset-x`,f),v.attr(`transform`,`translate(${-p/2}, ${u/2} )`),l.attr(`transform`,`translate(${-(c.width/2)-f-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),I(t,v),t.intersect=function(e){let n=K.rect(t,e),r=n.y-(t.y??0);if(d!=0&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-f)){let i=f*f*(1-r*r/(d*d));i!=0&&(i=Math.sqrt(Math.abs(i))),i=f-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},s}e(Pn,`tiltedCylinder`);async function Fn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=(t.look,i),o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=g(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(Fn,`trapezoid`);async function In(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=(t.height??0)-o*2,t.height<5&&(t.height=5),t.width=(t.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o*2,{cssStyles:d}=t,f=T.svg(s),p=g(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{x:-l/2*.8,y:-u/2},{x:l/2*.8,y:-u/2},{x:l/2,y:-u/2*.6},{x:l/2,y:u/2},{x:-l/2,y:u/2},{x:-l/2,y:-u/2*.6}],h=R(m),v=f.path(h,p),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),d&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,r),I(t,y),t.intersect=function(e){return K.polygon(t,m,e)},s}e(In,`trapezoidalPentagon`);var Ln=10,Rn=10;async function zn(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.width=((n?.width??0)-o)/2,n.widthC,`:first-child`).attr(`transform`,`translate(${-m/2}, ${m/2})`).attr(`class`,`outer-path`);return y&&n.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,y),i&&n.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,i),n.width=p,n.height=m,I(n,w),d.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${m/2-(c.height+(n.padding??0)/(f?2:1)-(c.y-(c.top??0)))})`),n.intersect=function(e){return t.info(`Triangle intersect`,n,v,e),K.polygon(n,v,e)},s}e(zn,`triangle`);async function Bn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:c,bbox:l,label:u}=await P(e,t,L(t)),d=(t?.width?t?.width:l.width)+(a??0)*2,f=(t?.height?t?.height:l.height)+(o??0)*2,p=t.look===`neo`?f/4:f/8,m=f+(s?p:-p),{cssStyles:h}=t,v=14-d,y=v>0?v/2:0,b=T.svg(c),x=g(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=[{x:-d/2-y,y:m/2},...z(-d/2-y,m/2,d/2+y,m/2,p,.8),{x:d/2+y,y:-m/2},{x:-d/2-y,y:-m/2}],C=R(S),w=b.path(C,x),E=c.insert(()=>w,`:first-child`);return E.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,r),E.attr(`transform`,`translate(0,${-p/2})`),u.attr(`transform`,`translate(${-d/2+(t.padding??0)-(l.x-(l.left??0))},${-f/2+(t.padding??0)-p-(l.y-(l.top??0))})`),I(t,E),t.intersect=function(e){return K.polygon(t,S,e)},c}e(Bn,`waveEdgedRectangle`);async function Vn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let e=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-20/9*e),t.width-=a*2}let{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o,d=u/8,f=u+d*2,{cssStyles:p}=t,m=T.svg(s),h=g(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let v=[{x:-l/2,y:f/2},...z(-l/2,f/2,l/2,f/2,d,1),{x:l/2,y:-f/2},...z(l/2,-f/2,-l/2,-f/2,d,-1)],y=R(v),b=m.path(y,h),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),I(t,x),t.intersect=function(e){return K.polygon(t,v,e)},s}e(Vn,`waveRectangle`);var Q=10;async function Hn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-Q,10),t.height=Math.max((t?.height??0)-a*2-Q,10));let{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=(t?.width?t?.width:s.width)+i*2+Q,u=(t?.height?t?.height:s.height)+a*2+Q,d=l-Q,f=u-Q,p=-d/2,m=-f/2,{cssStyles:h}=t,v=T.svg(o),y=g(t,{}),b=[{x:p-Q,y:m-Q},{x:p-Q,y:m+f},{x:p+d,y:m+f},{x:p+d,y:m-Q}],x=`M${p-Q},${m-Q} L${p+d},${m-Q} L${p+d},${m+f} L${p-Q},${m+f} L${p-Q},${m-Q} M${p-Q},${m} L${p+d},${m} - M${p},${m-Q} L${p},${m+f}`;t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let S=g.path(y,_),C=o.insert(()=>S,`:first-child`);return C.attr(`transform`,`translate(${Q/2}, ${Q/2})`),C.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${-(s.width/2)+Q/2-(s.x-(s.left??0))}, ${-(s.height/2)+Q/2-(s.y-(s.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,v,e)},o}e(Hn,`windowPane`);var Un=new Set([`redux-color`,`redux-dark-color`]),Wn=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]);async function Gn(e,t){let r=t;r.alias&&(t.label=r.alias);let{theme:i,themeVariables:a}=s(),{rowEven:o,rowOdd:c,nodeBorder:u,borderColorArray:d}=a;if(t.look===`handDrawn`){let{themeVariables:n}=s(),{background:r}=n;await Gn(e,{...t,id:t.id+`-background`,domId:(t.domId||t.id)+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let f=s();t.useHtmlLabels=f.htmlLabels;let p=f.er?.diagramPadding??10,h=f.er?.entityPadding??6,{cssStyles:g}=t,{labelStyles:_,nodeStyles:v}=x(t);if(r.attributes.length===0&&t.label){let n={rx:0,ry:0,labelPaddingX:p,labelPaddingY:p*1.5,classes:``};m(t.label,f)+n.labelPaddingX*20){let e=C.width+p*2-(O+k+A+j);O+=e/P,k+=e/P,A>0&&(A+=e/P),j>0&&(j+=e/P)}let R=O+k+A+j,z=T.svg(S),B=b(t,{});t.look!==`handDrawn`&&(B.roughness=0,B.fillStyle=`solid`);let ee=0;D.length>0&&(ee=D.reduce((e,t)=>e+(t?.rowHeight??0),0));let V=Math.max(F.width+p*2,t?.width||0,R),te=Math.max((ee??0)+C.height,t?.height||0),H=-V/2,U=-te/2;if(S.selectAll(`g:not(:first-child)`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]),i.attr(`class`).includes(`attribute-name`)?o+=O:i.attr(`class`).includes(`attribute-keys`)?o+=O+k:i.attr(`class`).includes(`attribute-comment`)&&(o+=O+k+A))}i.attr(`transform`,`translate(${H+p/2+o}, ${s+U+C.height+h/2})`)}),S.select(`.name`).attr(`transform`,`translate(`+-C.width/2+`, `+(U+h/2)+`)`),i!=null&&Un.has(i)){let e=r.colorIndex??0;S.attr(`data-color-id`,`color-${e%d.length}`)}let ne=z.rectangle(H,U,V,te,B),re=S.insert(()=>ne,`:first-child`).attr(`class`,`outer-path`).attr(`style`,g.join(``));E.push(0);for(let[e,t]of D.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=z.rectangle(H,C.height+U+t?.yOffset,V,t?.rowHeight,{...B,fill:n?o:c,stroke:u});S.insert(()=>r,`g.label`).attr(`style`,g.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let ie=1e-4,W=qn(H,C.height+U,V+H,C.height+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B);if(S.insert(()=>G).attr(`class`,`divider`),W=qn(O+H,C.height+U,O+H,te+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`),M){let e=O+k+H;W=qn(e,C.height+U,e,te+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`)}if(N){let e=O+k+A+H;W=qn(e,C.height+U,e,te+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`)}for(let e of E){let t=C.height+U+e;W=qn(H,t,V+H,t,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`)}if(I(t,re),v&&t.look!==`handDrawn`)if(i!=null&&Wn.has(i))S.selectAll(`path`).attr(`style`,v);else{let e=v.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);S.selectAll(`path`).attr(`style`,e??``),S.selectAll(`.row-rect-even path`).attr(`style`,v)}return t.intersect=function(e){return K.rect(t,e)},S}e(Gn,`erBox`);async function Kn(e,t,r,i=0,o=0,s=[],c=``){let u=e.insert(`g`).attr(`class`,`label ${s.join(` `)}`).attr(`transform`,`translate(${i}, ${o})`).attr(`style`,c);t!==a(t)&&(t=a(t),t=t.replaceAll(`<`,`<`).replaceAll(`>`,`>`));let d=u.node().appendChild(await v(u,t,{width:m(t,r)+100,style:c,useHtmlLabels:r.htmlLabels},r));if(t.includes(`<`)||t.includes(`>`)){let e=d.children[0];for(e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`)}let f=d.getBBox();if(l(r.htmlLabels)){let e=d.children[0];e.style.textAlign=`start`;let t=n(d);f=e.getBoundingClientRect(),t.attr(`width`,f.width),t.attr(`height`,f.height)}return f}e(Kn,`addText`);function qn(e,t,n,r,i){return e===n?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}e(qn,`lineToPolygon`);async function Jn(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId||t.id),s=null,c=null,l=null,u=null,d=0,f=0,p=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await Yn(s,{text:`\xAB${e}\xBB`},0),d=s.node().getBBox().height}c=o.insert(`g`).attr(`class`,`label-group text`),await Yn(c,t,0,[`font-weight: bolder`]);let m=c.node().getBBox();f=m.height,l=o.insert(`g`).attr(`class`,`members-group text`);let h=0;for(let e of t.members){let t=await Yn(l,e,h,[e.parseClassifier()]);h+=t+a}p=l.node().getBBox().height,p<=0&&(p=i/2),u=o.insert(`g`).attr(`class`,`methods-group text`);let g=0;for(let e of t.methods){let t=await Yn(u,e,g,[e.parseClassifier()]);g+=t+a}let _=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return c.attr(`transform`,`translate(${-m.width/2}, ${d})`),_=o.node().getBBox(),l.attr(`transform`,`translate(0, ${d+f+i*2})`),_=o.node().getBBox(),u.attr(`transform`,`translate(0, ${d+f+(p?p+i*4:i*2)})`),_=o.node().getBBox(),{shapeSvg:o,bbox:_}}e(Jn,`textHelper`);async function Yn(e,t,a,o=[]){let c=e.insert(`g`).attr(`class`,`label`).attr(`style`,o.join(`; `)),u=s(),d=`useHtmlLabels`in t?t.useHtmlLabels:l(u.htmlLabels)??!0,p=``;p=`text`in t?t.text:t.label,!d&&p.startsWith(`\\`)&&(p=p.substring(1)),r(p)&&(d=!0);let h=await v(c,i(f(p)),{width:m(p,u)+50,classes:`markdown-node-label`,useHtmlLabels:d},u),g,_=1;if(d){let e=h.children[0],t=n(h);_=e.innerHTML.split(`
`).length,e.innerHTML.includes(``)&&(_+=e.innerHTML.split(``).length-1),await O(e),g=e.getBoundingClientRect(),t.attr(`width`,g.width),t.attr(`height`,g.height)}else{o.includes(`font-weight: bolder`)&&n(h).selectAll(`tspan`).attr(`font-weight`,``),_=h.children.length;let e=h.children[0];(h.textContent===``||h.textContent.includes(`>`))&&(e.textContent=p[0]+p.substring(1).replaceAll(`>`,`>`).replaceAll(`<`,`<`).trim(),p[1]===` `&&(e.textContent=e.textContent[0]+` `+e.textContent.substring(1))),e.textContent===`undefined`&&(e.textContent=``),g=h.getBBox()}return c.attr(`transform`,`translate(0,`+(-g.height/(2*_)+a)+`)`),g.height}e(Yn,`addText`);async function Xn(e,t){let r=u(),{theme:i,themeVariables:a}=r,{useGradient:o,borderColorArray:s}=a,c=r.class.padding??12,d=c,f=t.useHtmlLabels??l(r.htmlLabels)??!0,p=t;p.annotations=p.annotations??[],p.members=p.members??[],p.methods=p.methods??[];let{shapeSvg:m,bbox:h}=await Jn(e,t,r,f,d);w(m,t.colorIndex,i,s);let{labelStyles:g,nodeStyles:_}=x(t);t.labelStyle=g,t.cssStyles=p.styles||``;let v=p.styles?.join(`;`)||_||``;t.cssStyles||=v.replaceAll(`!important`,``).split(`;`);let y=p.members.length===0&&p.methods.length===0&&!r.class?.hideEmptyMembersBox,S=T.svg(m),C=b(t,{});t.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let E=Math.max(t.width??0,h.width),D=Math.max(t.height??0,h.height),O=(t.height??0)>h.height;p.members.length===0&&p.methods.length===0?D+=d:p.members.length>0&&p.methods.length===0&&(D+=d*2);let k=-E/2,A=-D/2,j=y?c*2:p.members.length===0&&p.methods.length===0?-c:0;O&&(j=c*2);let M=S.rectangle(k-c,A-c-(y?c:p.members.length===0&&p.methods.length===0?-c/2:0),E+2*c,D+2*c+j,C),N=m.insert(()=>M,`:first-child`);N.attr(`class`,`basic label-container outer-path`);let P=N.node().getBBox(),F=m.select(`.annotation-group`).node().getBBox().height-(y?c/2:0)||0,L=m.select(`.label-group`).node().getBBox().height-(y?c/2:0)||0,R=m.select(`.members-group`).node().getBBox().height-(y?c/2:0)||0,z=(F+L+A+c-(A-c-(y?c:p.members.length===0&&p.methods.length===0?-c/2:0)))/2;if(m.selectAll(`.text`).each((e,t,i)=>{let a=n(i[t]),o=a.attr(`transform`),s=0;if(o){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);e&&(s=parseFloat(e[2]))}let l=s+A+c-(y?c:p.members.length===0&&p.methods.length===0?-c/2:0);if(a.attr(`class`).includes(`methods-group`)){let e=Math.max(R,d/2);l=O?Math.max(z,F+L+e+A+d*2+c)+d*2:F+L+e+A+d*4+c}p.members.length===0&&p.methods.length===0&&r.class?.hideEmptyMembersBox&&(l=p.annotations.length>0?s-d:s),f||(l-=4);let u=k;(a.attr(`class`).includes(`label-group`)||a.attr(`class`).includes(`annotation-group`))&&(u=-a.node()?.getBBox().width/2||0,m.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(u=0)})),a.attr(`transform`,`translate(${u}, ${l})`)}),p.members.length>0||p.methods.length>0||y){let e=F+L+A+c,n=S.line(P.x,e,P.x+P.width,e+.001,C);m.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!o?` neo-line`:``}`).attr(`style`,v)}if(y||p.members.length>0||p.methods.length>0){let e=F+L+R+A+d*2+c,n=S.line(P.x,O?Math.max(z,e):e,P.x+P.width,(O?Math.max(z,e):e)+.001,C);m.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!o?` neo-line`:``}`).attr(`style`,v)}if(p.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,v),N.select(`:nth-child(2)`).attr(`style`,v),m.selectAll(`.divider`).select(`path`).attr(`style`,v),t.labelStyle?m.selectAll(`span`).attr(`style`,t.labelStyle):m.selectAll(`span`).attr(`style`,v),!f){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(v);if(t){let e=t[0].replace(`color`,`fill`);m.selectAll(`tspan`).attr(`style`,e)}else if(g){let t=e.exec(g);if(t){let e=t[0].replace(`color`,`fill`);m.selectAll(`tspan`).attr(`style`,e)}}}return I(t,N),t.intersect=function(e){return K.rect(t,e)},m}e(Xn,`classBox`);async function Zn(e,t){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let a=t,o=t,s=`verifyMethod`in t,c=L(t),l=u(),{themeVariables:d}=l,{borderColorArray:f,requirementEdgeLabelBackground:p}=d,m=l.layout===`elk`?`start`:`center`,h=e.insert(`g`).attr(`class`,c).attr(`id`,t.domId??t.id),g;g=s?await $(h,`<<${a.type}>>`,0,t.labelStyle):await $(h,`<<Element>>`,0,t.labelStyle);let _=g,v=await $(h,a.name,_,t.labelStyle+`; font-weight: bold;`);if(_+=v+20,s){let e=await $(h,`${a.requirementId?`ID: ${a.requirementId}`:``}`,_,t.labelStyle,m);_+=e;let n=await $(h,`${a.text?`Text: ${a.text}`:``}`,_,t.labelStyle,m);_+=n;let r=await $(h,`${a.risk?`Risk: ${a.risk}`:``}`,_,t.labelStyle,m);_+=r,await $(h,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:``}`,_,t.labelStyle,m)}else{let e=await $(h,`${o.type?`Type: ${o.type}`:``}`,_,t.labelStyle,m);_+=e,await $(h,`${o.docRef?`Doc Ref: ${o.docRef}`:``}`,_,t.labelStyle,m)}let y=(h.node()?.getBBox().width??200)+20,S=(h.node()?.getBBox().height??200)+20,C=-y/2,w=-S/2,E=T.svg(h),D=b(t,{});t.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(C,w,y,S,D),k=h.insert(()=>O,`:first-child`);if(k.attr(`class`,`basic label-container outer-path`).attr(`style`,i),f?.length){let e=t.colorIndex??0;h.attr(`data-color-id`,`color-${e%f.length}`)}if(h.selectAll(`.label`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]))}let c=s-S/2,l=C+20/2;(t===0||t===1)&&(l=o),i.attr(`transform`,`translate(${l}, ${c+20})`)}),_>g+v+20){let e=w+g+v+20,n;if(t.look===`neo`){let t=.001,r=[[C,e],[C+y,e],[C+y,e+t],[C,e+t]];n=E.polygon(r,D)}else n=E.line(C,e,C+y,e,D);h.insert(()=>n).attr(`class`,`divider`)}return I(t,k),t.intersect=function(e){return K.rect(t,e)},i&&t.look!==`handDrawn`&&(p||f?.length)&&h.selectAll(`path`).attr(`style`,i),h}e(Zn,`requirementBox`);async function $(e,t,r,a=``,o=`center`){if(t===``)return 0;let s=e.insert(`g`).attr(`class`,`label`).attr(`style`,a),c=u(),l=c.htmlLabels??!0,d=await v(s,i(f(t)),{width:m(t,c)+50,classes:`markdown-node-label`,useHtmlLabels:l,style:a},c),p;if(l){let e=d.children[0],t=n(d);o===`start`&&n(e).style(`text-align`,`left`),p=e.getBoundingClientRect(),t.attr(`width`,p.width),t.attr(`height`,p.height)}else{let e=d.children[0];for(let t of e.children)a&&t.setAttribute(`style`,a);if(o===`start`){e.setAttribute(`text-anchor`,`start`);for(let t of e.children)t.setAttribute(`text-anchor`,`start`)}p=d.getBBox(),p.height+=6}return s.attr(`transform`,`translate(${-p.width/2},${-p.height/2+r})`),p.height}e($,`addText`);var Qn=e(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`);async function $n(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=t.padding||10,u=``,d;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),d=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,u).attr(`target`,`_blank`));let f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},p,m;d?{label:p,bbox:m}=await F(d,`ticket`in t&&t.ticket||``,f):{label:p,bbox:m}=await F(o,`ticket`in t&&t.ticket||``,f);let{label:h,bbox:g}=await F(o,`assigned`in t&&t.assigned||``,f);t.width=a;let _=t?.width||0,v=Math.max(m.height,g.height)/2,y=Math.max(s.height+20,t?.height||0)+v,S=-_/2,C=-y/2;c.attr(`transform`,`translate(`+(l-_/2)+`, `+(-v-s.height/2)+`)`),p.attr(`transform`,`translate(`+(l-_/2)+`, `+(-v+s.height/2)+`)`),h.attr(`transform`,`translate(`+(l+_/2-g.width-20)+`, `+(-v+s.height/2)+`)`);let w,{rx:E,ry:D}=t,{cssStyles:O}=t;if(t.look===`handDrawn`){let e=T.svg(o),n=b(t,{}),r=E||D?e.path(q(S,C,_,y,E||0),n):e.rectangle(S,C,_,y,n);w=o.insert(()=>r,`:first-child`),w.attr(`class`,`basic label-container`).attr(`style`,O||null)}else{w=o.insert(`rect`,`:first-child`),w.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,E??5).attr(`ry`,D??5).attr(`x`,S).attr(`y`,C).attr(`width`,_).attr(`height`,y);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=S+2,r=C+Math.floor((E??0)/2),i=C+y-Math.floor((E??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,Qn(e))}}return I(t,w),t.height=y,t.intersect=function(e){return K.rect(t,e)},o}e($n,`kanbanItem`);async function er(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await P(e,n,L(n)),l=o.width+10*s,u=o.height+8*s,d=.15*l,{cssStyles:f}=n,p=o.width+20,m=o.height+20,g=Math.max(l,p),_=Math.max(u,m);c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`);let v,y=`M0 0 - a${d},${d} 1 0,0 ${g*.25},${-1*_*.1} - a${d},${d} 1 0,0 ${g*.25},0 - a${d},${d} 1 0,0 ${g*.25},0 - a${d},${d} 1 0,0 ${g*.25},${_*.1} + M${p},${m-Q} L${p},${m+f}`;t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let S=v.path(x,y),C=o.insert(()=>S,`:first-child`);return C.attr(`transform`,`translate(${Q/2}, ${Q/2})`),C.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${-(s.width/2)+Q/2-(s.x-(s.left??0))}, ${-(s.height/2)+Q/2-(s.y-(s.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,b,e)},o}e(Hn,`windowPane`);var Un=new Set([`redux-color`,`redux-dark-color`]),Wn=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]);async function Gn(e,t){let r=t;r.alias&&(t.label=r.alias);let{theme:i,themeVariables:a}=s(),{rowEven:o,rowOdd:c,nodeBorder:u,borderColorArray:d}=a;if(t.look===`handDrawn`){let{themeVariables:n}=s(),{background:r}=n;await Gn(e,{...t,id:t.id+`-background`,domId:(t.domId||t.id)+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let f=s();t.useHtmlLabels=f.htmlLabels;let p=f.er?.diagramPadding??10,h=f.er?.entityPadding??6,{cssStyles:v}=t,{labelStyles:y,nodeStyles:b}=_(t);if(r.attributes.length===0&&t.label){let n={rx:0,ry:0,labelPaddingX:p,labelPaddingY:p*1.5,classes:``};m(t.label,f)+n.labelPaddingX*20){let e=C.width+p*2-(O+k+A+j);O+=e/P,k+=e/P,A>0&&(A+=e/P),j>0&&(j+=e/P)}let R=O+k+A+j,z=T.svg(S),B=g(t,{});t.look!==`handDrawn`&&(B.roughness=0,B.fillStyle=`solid`);let ee=0;D.length>0&&(ee=D.reduce((e,t)=>e+(t?.rowHeight??0),0));let V=Math.max(F.width+p*2,t?.width||0,R),te=Math.max((ee??0)+C.height,t?.height||0),H=-V/2,U=-te/2;if(S.selectAll(`g:not(:first-child)`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]),i.attr(`class`).includes(`attribute-name`)?o+=O:i.attr(`class`).includes(`attribute-keys`)?o+=O+k:i.attr(`class`).includes(`attribute-comment`)&&(o+=O+k+A))}i.attr(`transform`,`translate(${H+p/2+o}, ${s+U+C.height+h/2})`)}),S.select(`.name`).attr(`transform`,`translate(`+-C.width/2+`, `+(U+h/2)+`)`),i!=null&&Un.has(i)){let e=r.colorIndex??0;S.attr(`data-color-id`,`color-${e%d.length}`)}let ne=z.rectangle(H,U,V,te,B),re=S.insert(()=>ne,`:first-child`).attr(`class`,`outer-path`).attr(`style`,v.join(``));E.push(0);for(let[e,t]of D.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=z.rectangle(H,C.height+U+t?.yOffset,V,t?.rowHeight,{...B,fill:n?o:c,stroke:u});S.insert(()=>r,`g.label`).attr(`style`,v.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let ie=1e-4,W=qn(H,C.height+U,V+H,C.height+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B);if(S.insert(()=>G).attr(`class`,`divider`),W=qn(O+H,C.height+U,O+H,te+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`),M){let e=O+k+H;W=qn(e,C.height+U,e,te+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`)}if(N){let e=O+k+A+H;W=qn(e,C.height+U,e,te+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`)}for(let e of E){let t=C.height+U+e;W=qn(H,t,V+H,t,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`)}if(I(t,re),b&&t.look!==`handDrawn`)if(i!=null&&Wn.has(i))S.selectAll(`path`).attr(`style`,b);else{let e=b.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);S.selectAll(`path`).attr(`style`,e??``),S.selectAll(`.row-rect-even path`).attr(`style`,b)}return t.intersect=function(e){return K.rect(t,e)},S}e(Gn,`erBox`);async function Kn(e,t,r,i=0,o=0,s=[],c=``){let u=e.insert(`g`).attr(`class`,`label ${s.join(` `)}`).attr(`transform`,`translate(${i}, ${o})`).attr(`style`,c);t!==a(t)&&(t=a(t),t=t.replaceAll(`<`,`<`).replaceAll(`>`,`>`));let d=u.node().appendChild(await S(u,t,{width:m(t,r)+100,style:c,useHtmlLabels:r.htmlLabels},r));if(t.includes(`<`)||t.includes(`>`)){let e=d.children[0];for(e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`)}let f=d.getBBox();if(l(r.htmlLabels)){let e=d.children[0];e.style.textAlign=`start`;let t=n(d);f=e.getBoundingClientRect(),t.attr(`width`,f.width),t.attr(`height`,f.height)}return f}e(Kn,`addText`);function qn(e,t,n,r,i){return e===n?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}e(qn,`lineToPolygon`);async function Jn(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId||t.id),s=null,c=null,l=null,u=null,d=0,f=0,p=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await Yn(s,{text:`\xAB${e}\xBB`},0),d=s.node().getBBox().height}c=o.insert(`g`).attr(`class`,`label-group text`),await Yn(c,t,0,[`font-weight: bolder`]);let m=c.node().getBBox();f=m.height,l=o.insert(`g`).attr(`class`,`members-group text`);let h=0;for(let e of t.members){let t=await Yn(l,e,h,[e.parseClassifier()]);h+=t+a}p=l.node().getBBox().height,p<=0&&(p=i/2),u=o.insert(`g`).attr(`class`,`methods-group text`);let g=0;for(let e of t.methods){let t=await Yn(u,e,g,[e.parseClassifier()]);g+=t+a}let _=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return c.attr(`transform`,`translate(${-m.width/2}, ${d})`),_=o.node().getBBox(),l.attr(`transform`,`translate(0, ${d+f+i*2})`),_=o.node().getBBox(),u.attr(`transform`,`translate(0, ${d+f+(p?p+i*4:i*2)})`),_=o.node().getBBox(),{shapeSvg:o,bbox:_}}e(Jn,`textHelper`);async function Yn(e,t,a,o=[]){let c=e.insert(`g`).attr(`class`,`label`).attr(`style`,o.join(`; `)),u=s(),d=`useHtmlLabels`in t?t.useHtmlLabels:l(u.htmlLabels)??!0,p=``;p=`text`in t?t.text:t.label,!d&&p.startsWith(`\\`)&&(p=p.substring(1)),r(p)&&(d=!0);let h=await S(c,i(f(p)),{width:m(p,u)+50,classes:`markdown-node-label`,useHtmlLabels:d},u),g,_=1;if(d){let e=h.children[0],t=n(h);_=e.innerHTML.split(`
`).length,e.innerHTML.includes(``)&&(_+=e.innerHTML.split(``).length-1),await O(e),g=e.getBoundingClientRect(),t.attr(`width`,g.width),t.attr(`height`,g.height)}else{o.includes(`font-weight: bolder`)&&n(h).selectAll(`tspan`).attr(`font-weight`,``),_=h.children.length;let e=h.children[0];(h.textContent===``||h.textContent.includes(`>`))&&(e.textContent=p[0]+p.substring(1).replaceAll(`>`,`>`).replaceAll(`<`,`<`).trim(),p[1]===` `&&(e.textContent=e.textContent[0]+` `+e.textContent.substring(1))),e.textContent===`undefined`&&(e.textContent=``),g=h.getBBox()}return c.attr(`transform`,`translate(0,`+(-g.height/(2*_)+a)+`)`),g.height}e(Yn,`addText`);async function Xn(e,t){let r=u(),{theme:i,themeVariables:a}=r,{useGradient:o,borderColorArray:s}=a,c=r.class.padding??12,d=c,f=t.useHtmlLabels??l(r.htmlLabels)??!0,p=t;p.annotations=p.annotations??[],p.members=p.members??[],p.methods=p.methods??[];let{shapeSvg:m,bbox:h}=await Jn(e,t,r,f,d);w(m,t.colorIndex,i,s);let{labelStyles:v,nodeStyles:y}=_(t);t.labelStyle=v,t.cssStyles=p.styles||``;let b=p.styles?.join(`;`)||y||``;t.cssStyles||=b.replaceAll(`!important`,``).split(`;`);let x=p.members.length===0&&p.methods.length===0&&!r.class?.hideEmptyMembersBox,S=T.svg(m),C=g(t,{});t.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let E=Math.max(t.width??0,h.width),D=Math.max(t.height??0,h.height),O=(t.height??0)>h.height;p.members.length===0&&p.methods.length===0?D+=d:p.members.length>0&&p.methods.length===0&&(D+=d*2);let k=-E/2,A=-D/2,j=x?c*2:p.members.length===0&&p.methods.length===0?-c:0;O&&(j=c*2);let M=S.rectangle(k-c,A-c-(x?c:p.members.length===0&&p.methods.length===0?-c/2:0),E+2*c,D+2*c+j,C),N=m.insert(()=>M,`:first-child`);N.attr(`class`,`basic label-container outer-path`);let P=N.node().getBBox(),F=m.select(`.annotation-group`).node().getBBox().height-(x?c/2:0)||0,L=m.select(`.label-group`).node().getBBox().height-(x?c/2:0)||0,R=m.select(`.members-group`).node().getBBox().height-(x?c/2:0)||0,z=(F+L+A+c-(A-c-(x?c:p.members.length===0&&p.methods.length===0?-c/2:0)))/2;if(m.selectAll(`.text`).each((e,t,i)=>{let a=n(i[t]),o=a.attr(`transform`),s=0;if(o){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);e&&(s=parseFloat(e[2]))}let l=s+A+c-(x?c:p.members.length===0&&p.methods.length===0?-c/2:0);if(a.attr(`class`).includes(`methods-group`)){let e=Math.max(R,d/2);l=O?Math.max(z,F+L+e+A+d*2+c)+d*2:F+L+e+A+d*4+c}p.members.length===0&&p.methods.length===0&&r.class?.hideEmptyMembersBox&&(l=p.annotations.length>0?s-d:s),f||(l-=4);let u=k;(a.attr(`class`).includes(`label-group`)||a.attr(`class`).includes(`annotation-group`))&&(u=-a.node()?.getBBox().width/2||0,m.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(u=0)})),a.attr(`transform`,`translate(${u}, ${l})`)}),p.members.length>0||p.methods.length>0||x){let e=F+L+A+c,n=S.line(P.x,e,P.x+P.width,e+.001,C);m.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!o?` neo-line`:``}`).attr(`style`,b)}if(x||p.members.length>0||p.methods.length>0){let e=F+L+R+A+d*2+c,n=S.line(P.x,O?Math.max(z,e):e,P.x+P.width,(O?Math.max(z,e):e)+.001,C);m.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!o?` neo-line`:``}`).attr(`style`,b)}if(p.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,b),N.select(`:nth-child(2)`).attr(`style`,b),m.selectAll(`.divider`).select(`path`).attr(`style`,b),t.labelStyle?m.selectAll(`span`).attr(`style`,t.labelStyle):m.selectAll(`span`).attr(`style`,b),!f){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(b);if(t){let e=t[0].replace(`color`,`fill`);m.selectAll(`tspan`).attr(`style`,e)}else if(v){let t=e.exec(v);if(t){let e=t[0].replace(`color`,`fill`);m.selectAll(`tspan`).attr(`style`,e)}}}return I(t,N),t.intersect=function(e){return K.rect(t,e)},m}e(Xn,`classBox`);async function Zn(e,t){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let a=t,o=t,s=`verifyMethod`in t,c=L(t),l=u(),{themeVariables:d}=l,{borderColorArray:f,requirementEdgeLabelBackground:p}=d,m=l.layout===`elk`?`start`:`center`,h=e.insert(`g`).attr(`class`,c).attr(`id`,t.domId??t.id),v;v=s?await $(h,`<<${a.type}>>`,0,t.labelStyle):await $(h,`<<Element>>`,0,t.labelStyle);let y=v,b=await $(h,a.name,y,t.labelStyle+`; font-weight: bold;`);if(y+=b+20,s){let e=await $(h,`${a.requirementId?`ID: ${a.requirementId}`:``}`,y,t.labelStyle,m);y+=e;let n=await $(h,`${a.text?`Text: ${a.text}`:``}`,y,t.labelStyle,m);y+=n;let r=await $(h,`${a.risk?`Risk: ${a.risk}`:``}`,y,t.labelStyle,m);y+=r,await $(h,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:``}`,y,t.labelStyle,m)}else{let e=await $(h,`${o.type?`Type: ${o.type}`:``}`,y,t.labelStyle,m);y+=e,await $(h,`${o.docRef?`Doc Ref: ${o.docRef}`:``}`,y,t.labelStyle,m)}let x=(h.node()?.getBBox().width??200)+20,S=(h.node()?.getBBox().height??200)+20,C=-x/2,w=-S/2,E=T.svg(h),D=g(t,{});t.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(C,w,x,S,D),k=h.insert(()=>O,`:first-child`);if(k.attr(`class`,`basic label-container outer-path`).attr(`style`,i),f?.length){let e=t.colorIndex??0;h.attr(`data-color-id`,`color-${e%f.length}`)}if(h.selectAll(`.label`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]))}let c=s-S/2,l=C+20/2;(t===0||t===1)&&(l=o),i.attr(`transform`,`translate(${l}, ${c+20})`)}),y>v+b+20){let e=w+v+b+20,n;if(t.look===`neo`){let t=.001,r=[[C,e],[C+x,e],[C+x,e+t],[C,e+t]];n=E.polygon(r,D)}else n=E.line(C,e,C+x,e,D);h.insert(()=>n).attr(`class`,`divider`)}return I(t,k),t.intersect=function(e){return K.rect(t,e)},i&&t.look!==`handDrawn`&&(p||f?.length)&&h.selectAll(`path`).attr(`style`,i),h}e(Zn,`requirementBox`);async function $(e,t,r,a=``,o=`center`){if(t===``)return 0;let s=e.insert(`g`).attr(`class`,`label`).attr(`style`,a),c=u(),l=c.htmlLabels??!0,d=await S(s,i(f(t)),{width:m(t,c)+50,classes:`markdown-node-label`,useHtmlLabels:l,style:a},c),p;if(l){let e=d.children[0],t=n(d);o===`start`&&n(e).style(`text-align`,`left`),p=e.getBoundingClientRect(),t.attr(`width`,p.width),t.attr(`height`,p.height)}else{let e=d.children[0];for(let t of e.children)a&&t.setAttribute(`style`,a);if(o===`start`){e.setAttribute(`text-anchor`,`start`);for(let t of e.children)t.setAttribute(`text-anchor`,`start`)}p=d.getBBox(),p.height+=6}return s.attr(`transform`,`translate(${-p.width/2},${-p.height/2+r})`),p.height}e($,`addText`);var Qn=e(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`);async function $n(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=t.padding||10,u=``,d;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),d=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,u).attr(`target`,`_blank`));let f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},p,m;d?{label:p,bbox:m}=await F(d,`ticket`in t&&t.ticket||``,f):{label:p,bbox:m}=await F(o,`ticket`in t&&t.ticket||``,f);let{label:h,bbox:v}=await F(o,`assigned`in t&&t.assigned||``,f);t.width=a;let y=t?.width||0,b=Math.max(m.height,v.height)/2,x=Math.max(s.height+20,t?.height||0)+b,S=-y/2,C=-x/2;c.attr(`transform`,`translate(`+(l-y/2)+`, `+(-b-s.height/2)+`)`),p.attr(`transform`,`translate(`+(l-y/2)+`, `+(-b+s.height/2)+`)`),h.attr(`transform`,`translate(`+(l+y/2-v.width-20)+`, `+(-b+s.height/2)+`)`);let w,{rx:E,ry:D}=t,{cssStyles:O}=t;if(t.look===`handDrawn`){let e=T.svg(o),n=g(t,{}),r=E||D?e.path(q(S,C,y,x,E||0),n):e.rectangle(S,C,y,x,n);w=o.insert(()=>r,`:first-child`),w.attr(`class`,`basic label-container`).attr(`style`,O||null)}else{w=o.insert(`rect`,`:first-child`),w.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,E??5).attr(`ry`,D??5).attr(`x`,S).attr(`y`,C).attr(`width`,y).attr(`height`,x);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=S+2,r=C+Math.floor((E??0)/2),i=C+x-Math.floor((E??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,Qn(e))}}return I(t,w),t.height=x,t.intersect=function(e){return K.rect(t,e)},o}e($n,`kanbanItem`);async function er(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await P(e,n,L(n)),l=o.width+10*s,u=o.height+8*s,d=.15*l,{cssStyles:f}=n,p=o.width+20,m=o.height+20,v=Math.max(l,p),y=Math.max(u,m);c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`);let b,x=`M0 0 + a${d},${d} 1 0,0 ${v*.25},${-1*y*.1} + a${d},${d} 1 0,0 ${v*.25},0 + a${d},${d} 1 0,0 ${v*.25},0 + a${d},${d} 1 0,0 ${v*.25},${y*.1} - a${d},${d} 1 0,0 ${g*.15},${_*.33} - a${d*.8},${d*.8} 1 0,0 0,${_*.34} - a${d},${d} 1 0,0 ${-1*g*.15},${_*.33} + a${d},${d} 1 0,0 ${v*.15},${y*.33} + a${d*.8},${d*.8} 1 0,0 0,${y*.34} + a${d},${d} 1 0,0 ${-1*v*.15},${y*.33} - a${d},${d} 1 0,0 ${-1*g*.25},${_*.15} - a${d},${d} 1 0,0 ${-1*g*.25},0 - a${d},${d} 1 0,0 ${-1*g*.25},0 - a${d},${d} 1 0,0 ${-1*g*.25},${-1*_*.15} + a${d},${d} 1 0,0 ${-1*v*.25},${y*.15} + a${d},${d} 1 0,0 ${-1*v*.25},0 + a${d},${d} 1 0,0 ${-1*v*.25},0 + a${d},${d} 1 0,0 ${-1*v*.25},${-1*y*.15} - a${d},${d} 1 0,0 ${-1*g*.1},${-1*_*.33} - a${d*.8},${d*.8} 1 0,0 0,${-1*_*.34} - a${d},${d} 1 0,0 ${g*.1},${-1*_*.33} - H0 V0 Z`;if(n.look===`handDrawn`){let e=T.svg(a),t=b(n,{}),r=e.path(y,t);v=a.insert(()=>r,`:first-child`),v.attr(`class`,`basic label-container`).attr(`style`,h(f))}else v=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,y);return v.attr(`transform`,`translate(${-g/2}, ${-_/2})`),I(n,v),n.calcIntersect=function(e,t){return K.rect(e,t)},n.intersect=function(e){return t.info(`Bang intersect`,n,e),K.rect(n,e)},a}e(er,`bang`);async function tr(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await P(e,n,L(n)),l=o.width+2*s,u=o.height+2*s,d=.15*l,f=.25*l,p=.35*l,m=.2*l,{cssStyles:g}=n,_,v=`M0 0 + a${d},${d} 1 0,0 ${-1*v*.1},${-1*y*.33} + a${d*.8},${d*.8} 1 0,0 0,${-1*y*.34} + a${d},${d} 1 0,0 ${v*.1},${-1*y*.33} + H0 V0 Z`;if(n.look===`handDrawn`){let e=T.svg(a),t=g(n,{}),r=e.path(x,t);b=a.insert(()=>r,`:first-child`),b.attr(`class`,`basic label-container`).attr(`style`,h(f))}else b=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,x);return b.attr(`transform`,`translate(${-v/2}, ${-y/2})`),I(n,b),n.calcIntersect=function(e,t){return K.rect(e,t)},n.intersect=function(e){return t.info(`Bang intersect`,n,e),K.rect(n,e)},a}e(er,`bang`);async function tr(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await P(e,n,L(n)),l=o.width+2*s,u=o.height+2*s,d=.15*l,f=.25*l,p=.35*l,m=.2*l,{cssStyles:v}=n,y,b=`M0 0 a${d},${d} 0 0,1 ${l*.25},${-1*l*.1} a${p},${p} 1 0,1 ${l*.4},${-1*l*.1} a${f},${f} 1 0,1 ${l*.35},${l*.2} @@ -39,7 +39,7 @@ import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src. a${d},${d} 1 0,1 ${-1*l*.1},${-1*u*.35} a${m},${m} 1 0,1 ${l*.1},${-1*u*.65} - H0 V0 Z`;if(n.look===`handDrawn`){let e=T.svg(a),t=b(n,{}),r=e.path(v,t);_=a.insert(()=>r,`:first-child`),_.attr(`class`,`basic label-container`).attr(`style`,h(g))}else _=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,v);return c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`),_.attr(`transform`,`translate(${-l/2}, ${-u/2})`),I(n,_),n.calcIntersect=function(e,t){return K.rect(e,t)},n.intersect=function(e){return t.info(`Cloud intersect`,n,e),K.rect(n,e)},a}e(tr,`cloud`);async function nr(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await P(e,t,L(t)),c=a.width+8*o,l=a.height+2*o,u=t.look===`neo`?` + H0 V0 Z`;if(n.look===`handDrawn`){let e=T.svg(a),t=g(n,{}),r=e.path(b,t);y=a.insert(()=>r,`:first-child`),y.attr(`class`,`basic label-container`).attr(`style`,h(v))}else y=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,b);return c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`),y.attr(`transform`,`translate(${-l/2}, ${-u/2})`),I(n,y),n.calcIntersect=function(e,t){return K.rect(e,t)},n.intersect=function(e){return t.info(`Cloud intersect`,n,e),K.rect(n,e)},a}e(tr,`cloud`);async function nr(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await P(e,t,L(t)),c=a.width+8*o,l=a.height+2*o,u=t.look===`neo`?` M${-c/2} ${l/2-5} v${-l+10} q0,-5 5,-5 diff --git a/web/dist/app-chunk-7M6MHVWA.js b/web/dist/app-chunk-7M6MHVWA.js index dcaa7fc5f..bbee9fe8f 100644 --- a/web/dist/app-chunk-7M6MHVWA.js +++ b/web/dist/app-chunk-7M6MHVWA.js @@ -1,18 +1,18 @@ -import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{G as i,H as a,U as o,a as s,d as c,it as l,q as u,s as d,v as f,w as p,x as m,y as h}from"./app-chunk-O7XYJQB3.js";import{t as g}from"./app-channel.js";import{c as _,g as v}from"./app-chunk-ZIGJFQKS.js";import{t as ee}from"./app-chunk-5VM5RSS4.js";import{i as te,n as ne,o as y,r as b}from"./app-chunk-J5ZVWO5B.js";import{a as x}from"./app-chunk-7INBJB4K.js";import{t as S}from"./app-chunk-GWA4HPMP.js";import{t as C}from"./app-chunk-XXDRQBXY.js";import{t as w}from"./app-chunk-WEXAMYUT.js";import{r as T,t as E}from"./app-chunk-GNY47TPC.js";import{n as D,t as O}from"./app-chunk-LNGE3PJU.js";var re=`flowchart-`,ie=class{constructor(){this.vertexCounter=0,this.config=m(),this.diagramId=``,this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=o,this.setAccDescription=a,this.setDiagramTitle=u,this.getAccTitle=h,this.getAccDescription=f,this.getDiagramTitle=p,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen(`gen-2`)}static{t(this,`FlowDB`)}sanitizeText(e){return d.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,r,i,a,o,s={},c){if(!e||e.trim().length===0)return;let l;if(c!==void 0){let e;e=c.includes(` +import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{G as i,H as a,U as o,a as s,d as c,it as l,q as u,s as d,v as f,w as p,x as m,y as h}from"./app-chunk-O7XYJQB3.js";import{t as g}from"./app-channel.js";import{c as _,g as v}from"./app-chunk-ZIGJFQKS.js";import{n as ee,t as te}from"./app-chunk-LNGE3PJU.js";import{i as ne,n as y,o as b,r as x}from"./app-chunk-J5ZVWO5B.js";import{a as S}from"./app-chunk-7INBJB4K.js";import{r as C,t as w}from"./app-chunk-GNY47TPC.js";import{t as T}from"./app-chunk-5VM5RSS4.js";import{t as E}from"./app-chunk-GWA4HPMP.js";import{t as D}from"./app-chunk-XXDRQBXY.js";import{t as O}from"./app-chunk-WEXAMYUT.js";var re=`flowchart-`,ie=class{constructor(){this.vertexCounter=0,this.config=m(),this.diagramId=``,this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=o,this.setAccDescription=a,this.setDiagramTitle=u,this.getAccTitle=h,this.getAccDescription=f,this.getDiagramTitle=p,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen(`gen-2`)}static{t(this,`FlowDB`)}sanitizeText(e){return d.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,r,i,a,o,s={},c){if(!e||e.trim().length===0)return;let l;if(c!==void 0){let e;e=c.includes(` `)?c+` `:`{ `+c+` -}`,l=D(e,{schema:O})}let u=this.subGraphLookup.get(e);if(u&&l){u.metadata={...u.metadata,...l};return}let d=this.edges.find(t=>t.id===e);if(d){let e=l;e?.animate!==void 0&&(d.animate=e.animate),e?.animation!==void 0&&(d.animation=e.animation),e?.curve!==void 0&&(d.interpolate=e.curve);return}let f,p=this.vertices.get(e);if(p===void 0&&(t===void 0&&r===void 0&&i!=null&&n.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),p={id:e,labelType:`text`,domId:re+e+`-`+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,p)),this.vertexCounter++,t===void 0?p.text===void 0&&(p.text=e):(this.config=m(),f=this.sanitizeText(t.text.trim()),p.labelType=t.type,f.startsWith(`"`)&&f.endsWith(`"`)&&(f=f.substring(1,f.length-1)),p.text=f),r!==void 0&&(p.type=r),i?.forEach(e=>{p.styles.push(e)}),a?.forEach(e=>{p.classes.push(e)}),o!==void 0&&(p.dir=o),p.props===void 0?p.props=s:s!==void 0&&Object.assign(p.props,s),l!==void 0){if(l.shape){if(l.shape!==l.shape.toLowerCase()||l.shape.includes(`_`))throw Error(`No such shape: ${l.shape}. Shape names should be lowercase.`);if(!x(l.shape))throw Error(`No such shape: ${l.shape}.`);p.type=l?.shape}l?.label&&(p.text=l?.label,p.labelType=this.sanitizeNodeLabelType(l?.labelType)),l?.icon&&(p.icon=l?.icon,!l.label?.trim()&&p.text===e&&(p.text=``)),l?.form&&(p.form=l?.form),l?.pos&&(p.pos=l?.pos),l?.img&&(p.img=l?.img,!l.label?.trim()&&p.text===e&&(p.text=``)),l?.constraint&&(p.constraint=l.constraint),l.w&&(p.assetWidth=Number(l.w)),l.h&&(p.assetHeight=Number(l.h))}}addSingleLink(e,t,r,i){let a={start:e,end:t,type:void 0,text:``,labelType:`text`,classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};n.info(`abc78 Got edge...`,a);let o=r.text;if(o!==void 0&&(a.text=this.sanitizeText(o.text.trim()),a.text.startsWith(`"`)&&a.text.endsWith(`"`)&&(a.text=a.text.substring(1,a.text.length-1)),a.labelType=this.sanitizeNodeLabelType(o.type)),r!==void 0&&(a.type=r.type,a.stroke=r.stroke,a.length=r.length>10?10:r.length),i&&!this.edges.some(e=>e.id===i))a.id=i,a.isUserDefinedId=!0;else{let e=this.edges.filter(e=>e.start===a.start&&e.end===a.end);a.id=e.length===0?_(a.start,a.end,{counter:0,prefix:`L`}):_(a.start,a.end,{counter:e.length+1,prefix:`L`})}if(this.edges.length<(this.config.maxEdges??500))n.info(`Pushing edge...`),this.edges.push(a);else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. +}`,l=ee(e,{schema:te})}let u=this.subGraphLookup.get(e);if(u&&l){u.metadata={...u.metadata,...l};return}let d=this.edges.find(t=>t.id===e);if(d){let e=l;e?.animate!==void 0&&(d.animate=e.animate),e?.animation!==void 0&&(d.animation=e.animation),e?.curve!==void 0&&(d.interpolate=e.curve);return}let f,p=this.vertices.get(e);if(p===void 0&&(t===void 0&&r===void 0&&i!=null&&n.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),p={id:e,labelType:`text`,domId:re+e+`-`+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,p)),this.vertexCounter++,t===void 0?p.text===void 0&&(p.text=e):(this.config=m(),f=this.sanitizeText(t.text.trim()),p.labelType=t.type,f.startsWith(`"`)&&f.endsWith(`"`)&&(f=f.substring(1,f.length-1)),p.text=f),r!==void 0&&(p.type=r),i?.forEach(e=>{p.styles.push(e)}),a?.forEach(e=>{p.classes.push(e)}),o!==void 0&&(p.dir=o),p.props===void 0?p.props=s:s!==void 0&&Object.assign(p.props,s),l!==void 0){if(l.shape){if(l.shape!==l.shape.toLowerCase()||l.shape.includes(`_`))throw Error(`No such shape: ${l.shape}. Shape names should be lowercase.`);if(!S(l.shape))throw Error(`No such shape: ${l.shape}.`);p.type=l?.shape}l?.label&&(p.text=l?.label,p.labelType=this.sanitizeNodeLabelType(l?.labelType)),l?.icon&&(p.icon=l?.icon,!l.label?.trim()&&p.text===e&&(p.text=``)),l?.form&&(p.form=l?.form),l?.pos&&(p.pos=l?.pos),l?.img&&(p.img=l?.img,!l.label?.trim()&&p.text===e&&(p.text=``)),l?.constraint&&(p.constraint=l.constraint),l.w&&(p.assetWidth=Number(l.w)),l.h&&(p.assetHeight=Number(l.h))}}addSingleLink(e,t,r,i){let a={start:e,end:t,type:void 0,text:``,labelType:`text`,classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};n.info(`abc78 Got edge...`,a);let o=r.text;if(o!==void 0&&(a.text=this.sanitizeText(o.text.trim()),a.text.startsWith(`"`)&&a.text.endsWith(`"`)&&(a.text=a.text.substring(1,a.text.length-1)),a.labelType=this.sanitizeNodeLabelType(o.type)),r!==void 0&&(a.type=r.type,a.stroke=r.stroke,a.length=r.length>10?10:r.length),i&&!this.edges.some(e=>e.id===i))a.id=i,a.isUserDefinedId=!0;else{let e=this.edges.filter(e=>e.start===a.start&&e.end===a.end);a.id=e.length===0?_(a.start,a.end,{counter:0,prefix:`L`}):_(a.start,a.end,{counter:e.length+1,prefix:`L`})}if(this.edges.length<(this.config.maxEdges??500))n.info(`Pushing edge...`),this.edges.push(a);else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. Initialize mermaid with maxEdges set to a higher number to allow more edges. You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return typeof e==`object`&&!!e&&`id`in e&&typeof e.id==`string`}addLink(e,t,r){let i=this.isLinkData(r)?r.id.replace(`@`,``):void 0;n.info(`addLink`,e,t,i);for(let n of e)for(let a of t){let o=n===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(n,a,r,i):this.addSingleLink(n,a,r,void 0)}}updateLinkInterpolate(e,t){e.forEach(e=>{e==="default"?this.edges.defaultInterpolate=t:this.edges[e].interpolate=t})}updateLink(e,t){e.forEach(e=>{if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);e==="default"?this.edges.defaultStyle=t:(this.edges[e].style=t,(this.edges[e]?.style?.length??0)>0&&!this.edges[e]?.style?.some(e=>e?.startsWith(`fill`))&&this.edges[e]?.style?.push(`fill:none`))})}addClass(e,t){let n=t.join().replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);e.split(`,`).forEach(e=>{let t=this.classes.get(e);t===void 0&&(t={id:e,styles:[],textStyles:[]},this.classes.set(e,t)),n?.forEach(e=>{if(/color/.exec(e)){let n=e.replace(`fill`,`bgFill`);t.textStyles.push(n)}t.styles.push(e)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction=`LR`),/.*v/.exec(this.direction)&&(this.direction=`TB`),this.direction===`TD`&&(this.direction=`TB`)}setClass(e,t){for(let n of e.split(`,`)){let e=this.vertices.get(n);e&&e.classes.push(t);let r=this.edges.find(e=>e.id===n);r&&r.classes.push(t);let i=this.subGraphLookup.get(n);i&&i.classes.push(t)}}setTooltip(e,t){if(t!==void 0){t=this.sanitizeText(t);for(let n of e.split(`,`))this.tooltips.set(this.version===`gen-1`?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){if(m().securityLevel!==`loose`||t===void 0)return;let r=[];if(typeof n==`string`){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{let n=this.lookUpDomId(e),i=document.querySelector(`[id="${n}"]`);i!==null&&i.addEventListener(`click`,()=>{v.runFunc(t,...r)},!1)}))}setLink(e,t,n){e.split(`,`).forEach(e=>{let r=this.vertices.get(e);r!==void 0&&(r.link=v.formatUrl(t,this.config),r.linkTarget=n)}),this.setClass(e,`clickable`)}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFun(e,t,n)}),this.setClass(e,`clickable`)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){let n=S();r(t).select(`svg`).selectAll(`g.node`).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(a===null)return;let o=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.text(i.attr(`title`)).style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),n.html(e.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})}clear(e=`gen-2`){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId=``,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=m(),s()}setGen(e){this.version=e||`gen-2`}defaultStyle(){return`fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;`}addSubGraph(e,r,i){let a=e.text.trim(),o=i.text;e===i&&/\s/.exec(i.text)&&(a=void 0);let s=t(e=>{let t={boolean:{},number:{},string:{}},n=[],r;return{nodeList:e.filter(function(e){let i=typeof e;return e.stmt&&e.stmt===`dir`?(r=e.value,!1):e.trim()===``?!1:i in t?t[i].hasOwnProperty(e)?!1:t[i][e]=!0:!n.includes(e)&&n.push(e)}),dir:r}},`uniq`)(r.flat()),c=s.nodeList,l=s.dir,u=m().flowchart??{};if(l??=u.inheritDir?this.getDirection()??m().direction??void 0:void 0,this.version===`gen-1`)for(let e=0;e2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let r=0,i=1;for(;r=0){let n=this.indexNodes2(e,t);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2(`none`,this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let t=e.trim(),n=`arrow_open`;switch(t[0]){case`<`:n=`arrow_point`,t=t.slice(1);break;case`x`:n=`arrow_cross`,t=t.slice(1);break;case`o`:n=`arrow_circle`,t=t.slice(1)}let r=`normal`;return t.includes(`=`)&&(r=`thick`),t.includes(`.`)&&(r=`dotted`),{type:n,stroke:r}}countChar(e,t){let n=t.length,r=0;for(let i=0;i`:r=`arrow_point`,t.startsWith(`<`)&&(r=`double_`+r,n=n.slice(1));break;case`o`:r=`arrow_circle`,t.startsWith(`o`)&&(r=`double_`+r,n=n.slice(1))}let i=`normal`,a=n.length-1;n.startsWith(`=`)&&(i=`thick`),n.startsWith(`~`)&&(i=`invisible`);let o=this.countChar(`.`,n);return o&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}destructLink(e,t){let n=this.destructEndLink(e),r;if(t){if(r=this.destructStartLink(t),r.stroke!==n.stroke)return{type:`INVALID`,stroke:`INVALID`};if(r.type===`arrow_open`)r.type=n.type;else{if(r.type!==n.type)return{type:`INVALID`,stroke:`INVALID`};r.type=`double_`+r.type}return r.type===`double_arrow`&&(r.type=`double_arrow_point`),r.length=n.length,r}return n}exists(e,t){for(let n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){let n=[];return e.nodes.forEach((r,i)=>{this.exists(t,r)||n.push(e.nodes[i])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return`imageSquare`;if(e.icon)return e.form===`circle`?`iconCircle`:e.form===`square`?`iconSquare`:e.form===`rounded`?`iconRounded`:`icon`;switch(e.type){case`square`:case void 0:return`squareRect`;case`round`:return`roundedRect`;case`ellipse`:return`ellipse`;default:return e.type}}findNode(e,t){return e.find(e=>e.id===t)}destructEdgeType(e){let t=`none`,n=`arrow_point`;switch(e){case`arrow_point`:case`arrow_circle`:case`arrow_cross`:n=e;break;case`double_arrow_point`:case`double_arrow_circle`:case`double_arrow_cross`:t=e.replace(`double_`,``),n=t}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,a){let o=n.get(e.id),s=r.get(e.id)??!1,c=this.findNode(t,e.id);if(c)c.cssStyles=e.styles,c.cssCompiledStyles=this.getCompiledStyles(e.classes),c.cssClasses=e.classes.join(` `);else{let n={id:e.id,label:e.text,labelType:e.labelType,labelStyle:``,parentId:o,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles([`default`,`node`,...e.classes]),cssClasses:`default `+e.classes.join(` `),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};s?t.push({...n,isGroup:!0,shape:`rect`}):t.push({...n,isGroup:!1,shape:this.getTypeFromVertex(e),minWidth:i.flowchart?.minNodeWidth})}}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}getData(){let e=m(),n=[],r=[],i=this.getSubGraphs(),a=new Map,o=new Map,s=new Map;for(let e of i)for(let t of e.nodes)this.subGraphLookup.has(t)&&s.set(t,e.id);let c=new Map,l=new Map;for(let e of i){let t=s.get(e.id);t!==void 0&&l.set(t,[...l.get(t)??[],e.id])}let u=0,d=t(e=>{c.set(e,u++);for(let t of l.get(e)??[])d(t)},`walk`);for(let e of i)s.has(e.id)||d(e.id);let f=t(e=>this.subGraphLookup.get(e)?.metadata?.view===`collapsed`,`isCollapsed`),p=t(e=>{let t,n=new Set,r=e;for(;r!==void 0&&!n.has(r);)n.add(r),f(r)&&(t=r),r=s.get(r);return t},`outermostCollapsed`),h=new Set,g=new Map;for(let e of i){let t=p(e.id);if(t!==void 0){e.id!==t&&(h.add(e.id),g.set(e.id,t));for(let n of e.nodes)n!==t&&(h.add(n),g.set(n,t))}}for(let e=i.length-1;e>=0;e--){let t=i[e];if(!h.has(t.id)){t.nodes.length>0&&o.set(t.id,!0);for(let e of t.nodes)a.set(e,t.id)}}for(let t=i.length-1;t>=0;t--){let r=i[t];h.has(r.id)||(r.metadata?.view===`collapsed`?n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:`collapsedGroup`,dir:r.dir,isGroup:!1,look:e.look,colorIndex:c.get(r.id)}):n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:`rect`,dir:r.dir,isGroup:!0,look:e.look,colorIndex:c.get(r.id),metadata:r.metadata}))}this.getVertices().forEach(t=>{h.has(t.id)||this.addNodeFromVertex(t,n,a,o,e,e.look||`classic`)});let v=this.getEdges();return v.forEach((t,n)=>{let{arrowTypeStart:i,arrowTypeEnd:a}=this.destructEdgeType(t.type),o=[...v.defaultStyle??[]],s=g.get(t.start)??t.start,c=g.get(t.end)??t.end;if(s===c&&(g.has(t.start)||g.has(t.end)))return;t.style&&o.push(...t.style);let l={id:_(s,c,{counter:n,prefix:`L`},t.id),isUserDefinedId:t.isUserDefinedId,start:s,end:c,type:t.type??`normal`,label:t.text,labelType:t.labelType,labelpos:`c`,thickness:t.stroke,minlen:t.length,classes:t?.stroke===`invisible`?``:`edge-thickness-normal edge-pattern-solid flowchart-link`,arrowTypeStart:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:i,arrowTypeEnd:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:a,arrowheadStyle:`fill: #333`,cssCompiledStyles:this.getCompiledStyles(t.classes),labelStyle:o,style:o,pattern:t.stroke,look:e.look,animate:t.animate,animation:t.animation,curve:t.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(l)}),{nodes:n,edges:r,other:{},config:e}}defaultConfig(){return c.flowchart}},ae={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing state diagram (v2)`,t);let{securityLevel:a,flowchart:o,layout:s}=m();i.db.setDiagramId(t),n.debug(`Before getData: `);let c=i.db.getData();n.debug(`Data: `,c);let l=C(t,a),u=i.db.getDirection();c.type=i.type,c.layoutAlgorithm=E(s),c.direction=u,c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=[`point`,`circle`,`cross`],c.diagramId=t,n.debug(`REF1:`,c),await T(c,l);let d=c.config.flowchart?.diagramPadding??8;v.insertTitle(l,`flowchartTitleText`,o?.titleTopMargin||0,i.db.getDiagramTitle()),w(l,d,`flowchart`,o?.useMaxWidth||!1)},`draw`)},oe=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,3],i=[1,5],a=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],o=[2,2],s=[1,13],c=[1,14],l=[1,15],u=[1,16],d=[1,23],f=[1,25],p=[1,26],m=[1,27],h=[1,50],g=[1,49],_=[1,29],v=[1,30],ee=[1,31],te=[1,32],ne=[1,33],y=[1,45],b=[1,47],x=[1,43],S=[1,48],C=[1,44],w=[1,51],T=[1,46],E=[1,52],D=[1,53],O=[1,34],re=[1,35],ie=[1,36],ae=[1,37],oe=[1,38],k=[1,58],A=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],j=[1,62],M=[1,61],N=[1,63],se=[8,9,11,75,77,78],ce=[1,79],le=[1,92],ue=[1,97],de=[1,96],fe=[1,93],pe=[1,89],me=[1,95],he=[1,91],ge=[1,98],_e=[1,94],ve=[1,99],ye=[1,90],be=[8,9,10,11,40,75,77,78],P=[8,9,10,11,40,46,75,77,78],F=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],xe=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Se=[44,60,89,102,105,106,109,111,114,115,116],Ce=[1,122],we=[1,123],Te=[1,125],Ee=[1,124],De=[44,60,62,74,89,102,105,106,109,111,114,115,116],Oe=[1,134],ke=[1,148],Ae=[1,149],je=[1,150],Me=[1,151],Ne=[1,136],Pe=[1,138],Fe=[1,142],Ie=[1,143],Le=[1,144],Re=[1,145],ze=[1,146],Be=[1,147],Ve=[1,152],He=[1,153],Ue=[1,132],We=[1,133],Ge=[1,140],Ke=[1,135],qe=[1,139],Je=[1,137],Ye=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Xe=[1,155],Ze=[1,157],I=[8,9,11],L=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],R=[1,177],z=[1,173],B=[1,174],V=[1,178],H=[1,175],U=[1,176],Qe=[77,116,119],W=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],$e=[10,106],et=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],G=[1,248],K=[1,246],q=[1,250],J=[1,244],Y=[1,245],X=[1,247],Z=[1,249],Q=[1,251],tt=[1,269],nt=[8,9,11,106],$=[8,9,10,11,60,84,105,106,109,110,111,112],rt={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:`error`,8:`SEMI`,9:`NEWLINE`,10:`SPACE`,11:`EOF`,12:`GRAPH`,13:`NODIR`,14:`DIR`,27:`subgraph`,29:`SQS`,31:`SQE`,32:`end`,34:`acc_title`,35:`acc_title_value`,36:`acc_descr`,37:`acc_descr_value`,38:`acc_descr_multiline_value`,40:`SHAPE_DATA`,44:`AMP`,46:`STYLE_SEPARATOR`,48:`DOUBLECIRCLESTART`,49:`DOUBLECIRCLEEND`,50:`PS`,51:`PE`,52:`(-`,53:`-)`,54:`STADIUMSTART`,55:`STADIUMEND`,56:`SUBROUTINESTART`,57:`SUBROUTINEEND`,58:`VERTEX_WITH_PROPS_START`,59:`NODE_STRING[field]`,60:`COLON`,61:`NODE_STRING[value]`,62:`PIPE`,63:`CYLINDERSTART`,64:`CYLINDEREND`,65:`DIAMOND_START`,66:`DIAMOND_STOP`,67:`TAGEND`,68:`TRAPSTART`,69:`TRAPEND`,70:`INVTRAPSTART`,71:`INVTRAPEND`,74:`TESTSTR`,75:`START_LINK`,77:`LINK`,78:`LINK_ID`,80:`STR`,81:`MD_STR`,84:`STYLE`,85:`LINKSTYLE`,86:`CLASSDEF`,87:`CLASS`,88:`CLICK`,89:`DOWN`,90:`UP`,93:`idString[vertex]`,94:`idString[class]`,95:`CALLBACKNAME`,96:`CALLBACKARGS`,97:`HREF`,98:`LINK_TARGET`,99:`STR[link]`,100:`STR[tooltip]`,102:`DEFAULT`,104:`INTERPOLATE`,105:`NUM`,106:`COMMA`,109:`NODE_STRING`,110:`UNIT`,111:`BRKT`,112:`PCT`,114:`MINUS`,115:`MULT`,116:`UNICODE_TEXT`,117:`TEXT`,118:`TAGSTART`,119:`EDGE_TEXT`,121:`direction_tb`,122:`direction_bt`,123:`direction_rl`,124:`direction_lr`,125:`direction_td`},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:(!Array.isArray(a[s])||a[s].length>0)&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 183:this.$=a[s];break;case 11:r.setDirection(`TB`),this.$=`TB`;break;case 12:r.setDirection(a[s-1]),this.$=a[s-1];break;case 27:this.$=a[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4]);break;case 34:this.$=r.addSubGraph(a[s-3],a[s-1],a[s-3]);break;case 35:this.$=r.addSubGraph(void 0,a[s-1],void 0);break;case 37:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 38:case 39:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 43:this.$=a[s-1]+a[s];break;case 44:this.$=a[s];break;case 45:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 46:r.addLink(a[s-2].stmt,a[s],a[s-1]),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 47:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 48:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 49:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),this.$={stmt:a[s-1],nodes:a[s-1],shapeData:a[s]};break;case 50:this.$={stmt:a[s],nodes:a[s]};break;case 51:this.$=[a[s]];break;case 52:r.addVertex(a[s-5][a[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s-4]),this.$=a[s-5].concat(a[s]);break;case 53:this.$=a[s-4].concat(a[s]);break;case 54:this.$=a[s];break;case 55:this.$=a[s-2],r.setClass(a[s-2],a[s]);break;case 56:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`square`);break;case 57:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`doublecircle`);break;case 58:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`circle`);break;case 59:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`ellipse`);break;case 60:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`stadium`);break;case 61:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`subroutine`);break;case 62:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],`rect`,void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]]));break;case 63:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`cylinder`);break;case 64:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`round`);break;case 65:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`diamond`);break;case 66:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`hexagon`);break;case 67:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`odd`);break;case 68:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`trapezoid`);break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`inv_trapezoid`);break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_right`);break;case 71:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_left`);break;case 72:this.$=a[s],r.addVertex(a[s]);break;case 73:a[s-1].text=a[s],this.$=a[s-1];break;case 74:case 75:a[s-2].text=a[s-1],this.$=a[s-2];break;case 76:this.$=a[s];break;case 77:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,text:a[s-1]};break;case 78:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,text:a[s-1],id:a[s-3]};break;case 79:this.$={text:a[s],type:`text`};break;case 80:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 81:this.$={text:a[s],type:`string`};break;case 82:this.$={text:a[s],type:`markdown`};break;case 83:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length};break;case 84:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,id:a[s-1]};break;case 85:this.$=a[s-1];break;case 86:this.$={text:a[s],type:`text`};break;case 87:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 88:this.$={text:a[s],type:`string`};break;case 89:case 104:this.$={text:a[s],type:`markdown`};break;case 101:this.$={text:a[s],type:`text`};break;case 102:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 103:this.$={text:a[s],type:`text`};break;case 105:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 106:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 107:case 115:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 108:case 116:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 109:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 110:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 111:this.$=a[s-2],r.setLink(a[s-2],a[s]);break;case 112:this.$=a[s-4],r.setLink(a[s-4],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 113:this.$=a[s-4],r.setLink(a[s-4],a[s-2],a[s]);break;case 114:this.$=a[s-6],r.setLink(a[s-6],a[s-4],a[s]),r.setTooltip(a[s-6],a[s-2]);break;case 117:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 118:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 119:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 120:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 121:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 122:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 123:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 124:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 125:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 126:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 127:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 128:case 130:this.$=[a[s]];break;case 129:case 131:a[s-2].push(a[s]),this.$=a[s-2];break;case 133:this.$=a[s-1]+a[s];break;case 181:this.$=a[s];break;case 182:this.$=a[s-1]+``+a[s];break;case 184:this.$=a[s-1]+``+a[s];break;case 185:this.$={stmt:`dir`,value:`TB`};break;case 186:this.$={stmt:`dir`,value:`BT`};break;case 187:this.$={stmt:`dir`,value:`RL`};break;case 188:this.$={stmt:`dir`,value:`LR`};break;case 189:this.$={stmt:`dir`,value:`TD`}}},`anonymous`),table:[{3:1,4:2,9:n,10:r,12:i},{1:[3]},e(a,o,{5:6}),{4:7,9:n,10:r,12:i},{4:8,9:n,10:r,12:i},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},e(a,[2,9]),e(a,[2,10]),e(a,[2,11]),{8:[1,55],9:[1,56],10:k,15:54,18:57},e(A,[2,3]),e(A,[2,4]),e(A,[2,5]),e(A,[2,6]),e(A,[2,7]),e(A,[2,8]),{8:j,9:M,11:N,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:j,9:M,11:N,21:68},{8:j,9:M,11:N,21:69},{8:j,9:M,11:N,21:70},{8:j,9:M,11:N,21:71},{8:j,9:M,11:N,21:72},{8:j,9:M,10:[1,73],11:N,21:74},e(A,[2,36]),{35:[1,75]},{37:[1,76]},e(A,[2,39]),e(se,[2,50],{18:77,39:78,10:k,40:ce}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:le,44:ue,60:de,80:[1,87],89:fe,95:[1,84],97:[1,85],101:86,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye,120:88},e(A,[2,185]),e(A,[2,186]),e(A,[2,187]),e(A,[2,188]),e(A,[2,189]),e(be,[2,51]),e(be,[2,54],{46:[1,100]}),e(P,[2,72],{113:113,29:[1,101],44:h,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:g,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:y,102:b,105:x,106:S,109:C,111:w,114:T,115:E,116:D}),e(F,[2,181]),e(F,[2,142]),e(F,[2,143]),e(F,[2,144]),e(F,[2,145]),e(F,[2,146]),e(F,[2,147]),e(F,[2,148]),e(F,[2,149]),e(F,[2,150]),e(F,[2,151]),e(F,[2,152]),e(a,[2,12]),e(a,[2,18]),e(a,[2,19]),{9:[1,114]},e(xe,[2,26],{18:115,10:k}),e(A,[2,27]),{42:116,43:39,44:h,45:40,47:41,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(A,[2,40]),e(A,[2,41]),e(A,[2,42]),e(Se,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Ce,81:we,116:Te,119:Ee},{75:[1,126],77:[1,127]},e(De,[2,83]),e(A,[2,28]),e(A,[2,29]),e(A,[2,30]),e(A,[2,31]),e(A,[2,32]),{10:Oe,12:ke,14:Ae,27:je,28:128,32:Me,44:Ne,60:Pe,75:Fe,80:[1,130],81:[1,131],83:141,84:Ie,85:Le,86:Re,87:ze,88:Be,89:Ve,90:He,91:129,105:Ue,109:We,111:Ge,114:Ke,115:qe,116:Je},e(Ye,o,{5:154}),e(A,[2,37]),e(A,[2,38]),e(se,[2,48],{44:Xe}),e(se,[2,49],{18:156,10:k,40:Ze}),e(be,[2,44]),{44:h,47:158,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{102:[1,159],103:160,105:[1,161]},{44:h,47:162,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{44:h,47:163,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(I,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(I,[2,115],{120:168,10:[1,167],14:le,44:ue,60:de,89:fe,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye}),e(I,[2,117],{10:[1,169]}),e(L,[2,183]),e(L,[2,170]),e(L,[2,171]),e(L,[2,172]),e(L,[2,173]),e(L,[2,174]),e(L,[2,175]),e(L,[2,176]),e(L,[2,177]),e(L,[2,178]),e(L,[2,179]),e(L,[2,180]),{44:h,47:170,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{30:171,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:179,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:181,50:[1,180],67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:182,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:183,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:184,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{109:[1,185]},{30:186,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:187,65:[1,188],67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:189,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:190,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:191,67:R,80:z,81:B,82:172,116:V,117:H,118:U},e(F,[2,182]),e(a,[2,20]),e(xe,[2,25]),e(se,[2,46],{39:192,18:193,10:k,40:ce}),e(Se,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{77:[1,197],79:198,116:Te,119:Ee},e(Qe,[2,79]),e(Qe,[2,81]),e(Qe,[2,82]),e(Qe,[2,168]),e(Qe,[2,169]),{76:199,79:121,80:Ce,81:we,116:Te,119:Ee},e(De,[2,84]),{8:j,9:M,10:Oe,11:N,12:ke,14:Ae,21:201,27:je,29:[1,200],32:Me,44:Ne,60:Pe,75:Fe,83:141,84:Ie,85:Le,86:Re,87:ze,88:Be,89:Ve,90:He,91:202,105:Ue,109:We,111:Ge,114:Ke,115:qe,116:Je},e(W,[2,101]),e(W,[2,103]),e(W,[2,104]),e(W,[2,157]),e(W,[2,158]),e(W,[2,159]),e(W,[2,160]),e(W,[2,161]),e(W,[2,162]),e(W,[2,163]),e(W,[2,164]),e(W,[2,165]),e(W,[2,166]),e(W,[2,167]),e(W,[2,90]),e(W,[2,91]),e(W,[2,92]),e(W,[2,93]),e(W,[2,94]),e(W,[2,95]),e(W,[2,96]),e(W,[2,97]),e(W,[2,98]),e(W,[2,99]),e(W,[2,100]),{6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,203],33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},{10:k,18:204},{44:[1,205]},e(be,[2,43]),{10:[1,206],44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:113,114:T,115:E,116:D},{10:[1,207]},{10:[1,208],106:[1,209]},e($e,[2,128]),{10:[1,210],44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:113,114:T,115:E,116:D},{10:[1,211],44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:113,114:T,115:E,116:D},{80:[1,212]},e(I,[2,109],{10:[1,213]}),e(I,[2,111],{10:[1,214]}),{80:[1,215]},e(L,[2,184]),{80:[1,216],98:[1,217]},e(be,[2,55],{113:113,44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,114:T,115:E,116:D}),{31:[1,218],67:R,82:219,116:V,117:H,118:U},e(et,[2,86]),e(et,[2,88]),e(et,[2,89]),e(et,[2,153]),e(et,[2,154]),e(et,[2,155]),e(et,[2,156]),{49:[1,220],67:R,82:219,116:V,117:H,118:U},{30:221,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{51:[1,222],67:R,82:219,116:V,117:H,118:U},{53:[1,223],67:R,82:219,116:V,117:H,118:U},{55:[1,224],67:R,82:219,116:V,117:H,118:U},{57:[1,225],67:R,82:219,116:V,117:H,118:U},{60:[1,226]},{64:[1,227],67:R,82:219,116:V,117:H,118:U},{66:[1,228],67:R,82:219,116:V,117:H,118:U},{30:229,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{31:[1,230],67:R,82:219,116:V,117:H,118:U},{67:R,69:[1,231],71:[1,232],82:219,116:V,117:H,118:U},{67:R,69:[1,234],71:[1,233],82:219,116:V,117:H,118:U},e(se,[2,45],{18:156,10:k,40:Ze}),e(se,[2,47],{44:Xe}),e(Se,[2,75]),e(Se,[2,74]),{62:[1,235],67:R,82:219,116:V,117:H,118:U},e(Se,[2,77]),e(Qe,[2,80]),{77:[1,236],79:198,116:Te,119:Ee},{30:237,67:R,80:z,81:B,82:172,116:V,117:H,118:U},e(Ye,o,{5:238}),e(W,[2,102]),e(A,[2,35]),{43:239,44:h,45:40,47:41,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{10:k,18:240},{10:G,60:K,84:q,92:241,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{10:G,60:K,84:q,92:252,104:[1,253],105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{10:G,60:K,84:q,92:254,104:[1,255],105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{105:[1,256]},{10:G,60:K,84:q,92:257,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{44:h,47:258,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(I,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(I,[2,116]),e(I,[2,118],{10:[1,262]}),e(I,[2,119]),e(P,[2,56]),e(et,[2,87]),e(P,[2,57]),{51:[1,263],67:R,82:219,116:V,117:H,118:U},e(P,[2,64]),e(P,[2,59]),e(P,[2,60]),e(P,[2,61]),{109:[1,264]},e(P,[2,63]),e(P,[2,65]),{66:[1,265],67:R,82:219,116:V,117:H,118:U},e(P,[2,67]),e(P,[2,68]),e(P,[2,70]),e(P,[2,69]),e(P,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(Se,[2,78]),{31:[1,266],67:R,82:219,116:V,117:H,118:U},{6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,267],33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},e(be,[2,53]),{43:268,44:h,45:40,47:41,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(I,[2,121],{106:tt}),e(nt,[2,130],{108:270,10:G,60:K,84:q,105:J,109:Y,110:X,111:Z,112:Q}),e($,[2,132]),e($,[2,134]),e($,[2,135]),e($,[2,136]),e($,[2,137]),e($,[2,138]),e($,[2,139]),e($,[2,140]),e($,[2,141]),e(I,[2,122],{106:tt}),{10:[1,271]},e(I,[2,123],{106:tt}),{10:[1,272]},e($e,[2,129]),e(I,[2,105],{106:tt}),e(I,[2,106],{113:113,44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,114:T,115:E,116:D}),e(I,[2,110]),e(I,[2,112],{10:[1,273]}),e(I,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:j,9:M,11:N,21:278},e(A,[2,34]),e(be,[2,52]),{10:G,60:K,84:q,105:J,107:279,108:243,109:Y,110:X,111:Z,112:Q},e($,[2,133]),{14:le,44:ue,60:de,89:fe,101:280,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye,120:88},{14:le,44:ue,60:de,89:fe,101:281,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye,120:88},{98:[1,282]},e(I,[2,120]),e(P,[2,58]),{30:283,67:R,80:z,81:B,82:172,116:V,117:H,118:U},e(P,[2,66]),e(Ye,o,{5:284}),e(nt,[2,131],{108:270,10:G,60:K,84:q,105:J,109:Y,110:X,111:Z,112:Q}),e(I,[2,126],{120:168,10:[1,285],14:le,44:ue,60:de,89:fe,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye}),e(I,[2,127],{120:168,10:[1,286],14:le,44:ue,60:de,89:fe,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye}),e(I,[2,114]),{31:[1,287],67:R,82:219,116:V,117:H,118:U},{6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,288],33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},{10:G,60:K,84:q,92:289,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{10:G,60:K,84:q,92:290,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},e(P,[2,62]),e(A,[2,33]),e(I,[2,124],{106:tt}),e(I,[2,125],{106:tt})],defaultActions:{},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var ee=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function te(e){r.length-=2*e,a.length-=e,o.length-=e}t(te,`popStack`);function ne(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(ne,`lex`);for(var y,b,x,S,C,w={},T,E,D,O;;){if(x=r[r.length-1],this.defaultActions[x]?S=this.defaultActions[x]:(y??=ne(),S=s[x]&&s[x][y]),S===void 0||!S.length||!S[0]){var re=``;for(T in O=[],s[x])this.terminals_[T]&&T>f&&O.push(`'`+this.terminals_[T]+`'`);re=h.showPosition?`Parse error on line `+(l+1)+`: +You have to call mermaid.initialize.`)}isLinkData(e){return typeof e==`object`&&!!e&&`id`in e&&typeof e.id==`string`}addLink(e,t,r){let i=this.isLinkData(r)?r.id.replace(`@`,``):void 0;n.info(`addLink`,e,t,i);for(let n of e)for(let a of t){let o=n===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(n,a,r,i):this.addSingleLink(n,a,r,void 0)}}updateLinkInterpolate(e,t){e.forEach(e=>{e==="default"?this.edges.defaultInterpolate=t:this.edges[e].interpolate=t})}updateLink(e,t){e.forEach(e=>{if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);e==="default"?this.edges.defaultStyle=t:(this.edges[e].style=t,(this.edges[e]?.style?.length??0)>0&&!this.edges[e]?.style?.some(e=>e?.startsWith(`fill`))&&this.edges[e]?.style?.push(`fill:none`))})}addClass(e,t){let n=t.join().replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);e.split(`,`).forEach(e=>{let t=this.classes.get(e);t===void 0&&(t={id:e,styles:[],textStyles:[]},this.classes.set(e,t)),n?.forEach(e=>{if(/color/.exec(e)){let n=e.replace(`fill`,`bgFill`);t.textStyles.push(n)}t.styles.push(e)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction=`LR`),/.*v/.exec(this.direction)&&(this.direction=`TB`),this.direction===`TD`&&(this.direction=`TB`)}setClass(e,t){for(let n of e.split(`,`)){let e=this.vertices.get(n);e&&e.classes.push(t);let r=this.edges.find(e=>e.id===n);r&&r.classes.push(t);let i=this.subGraphLookup.get(n);i&&i.classes.push(t)}}setTooltip(e,t){if(t!==void 0){t=this.sanitizeText(t);for(let n of e.split(`,`))this.tooltips.set(this.version===`gen-1`?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){if(m().securityLevel!==`loose`||t===void 0)return;let r=[];if(typeof n==`string`){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{let n=this.lookUpDomId(e),i=document.querySelector(`[id="${n}"]`);i!==null&&i.addEventListener(`click`,()=>{v.runFunc(t,...r)},!1)}))}setLink(e,t,n){e.split(`,`).forEach(e=>{let r=this.vertices.get(e);r!==void 0&&(r.link=v.formatUrl(t,this.config),r.linkTarget=n)}),this.setClass(e,`clickable`)}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFun(e,t,n)}),this.setClass(e,`clickable`)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){let n=E();r(t).select(`svg`).selectAll(`g.node`).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(a===null)return;let o=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.text(i.attr(`title`)).style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),n.html(e.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})}clear(e=`gen-2`){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId=``,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=m(),s()}setGen(e){this.version=e||`gen-2`}defaultStyle(){return`fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;`}addSubGraph(e,r,i){let a=e.text.trim(),o=i.text;e===i&&/\s/.exec(i.text)&&(a=void 0);let s=t(e=>{let t={boolean:{},number:{},string:{}},n=[],r;return{nodeList:e.filter(function(e){let i=typeof e;return e.stmt&&e.stmt===`dir`?(r=e.value,!1):e.trim()===``?!1:i in t?t[i].hasOwnProperty(e)?!1:t[i][e]=!0:!n.includes(e)&&n.push(e)}),dir:r}},`uniq`)(r.flat()),c=s.nodeList,l=s.dir,u=m().flowchart??{};if(l??=u.inheritDir?this.getDirection()??m().direction??void 0:void 0,this.version===`gen-1`)for(let e=0;e2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let r=0,i=1;for(;r=0){let n=this.indexNodes2(e,t);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2(`none`,this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let t=e.trim(),n=`arrow_open`;switch(t[0]){case`<`:n=`arrow_point`,t=t.slice(1);break;case`x`:n=`arrow_cross`,t=t.slice(1);break;case`o`:n=`arrow_circle`,t=t.slice(1)}let r=`normal`;return t.includes(`=`)&&(r=`thick`),t.includes(`.`)&&(r=`dotted`),{type:n,stroke:r}}countChar(e,t){let n=t.length,r=0;for(let i=0;i`:r=`arrow_point`,t.startsWith(`<`)&&(r=`double_`+r,n=n.slice(1));break;case`o`:r=`arrow_circle`,t.startsWith(`o`)&&(r=`double_`+r,n=n.slice(1))}let i=`normal`,a=n.length-1;n.startsWith(`=`)&&(i=`thick`),n.startsWith(`~`)&&(i=`invisible`);let o=this.countChar(`.`,n);return o&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}destructLink(e,t){let n=this.destructEndLink(e),r;if(t){if(r=this.destructStartLink(t),r.stroke!==n.stroke)return{type:`INVALID`,stroke:`INVALID`};if(r.type===`arrow_open`)r.type=n.type;else{if(r.type!==n.type)return{type:`INVALID`,stroke:`INVALID`};r.type=`double_`+r.type}return r.type===`double_arrow`&&(r.type=`double_arrow_point`),r.length=n.length,r}return n}exists(e,t){for(let n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){let n=[];return e.nodes.forEach((r,i)=>{this.exists(t,r)||n.push(e.nodes[i])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return`imageSquare`;if(e.icon)return e.form===`circle`?`iconCircle`:e.form===`square`?`iconSquare`:e.form===`rounded`?`iconRounded`:`icon`;switch(e.type){case`square`:case void 0:return`squareRect`;case`round`:return`roundedRect`;case`ellipse`:return`ellipse`;default:return e.type}}findNode(e,t){return e.find(e=>e.id===t)}destructEdgeType(e){let t=`none`,n=`arrow_point`;switch(e){case`arrow_point`:case`arrow_circle`:case`arrow_cross`:n=e;break;case`double_arrow_point`:case`double_arrow_circle`:case`double_arrow_cross`:t=e.replace(`double_`,``),n=t}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,a){let o=n.get(e.id),s=r.get(e.id)??!1,c=this.findNode(t,e.id);if(c)c.cssStyles=e.styles,c.cssCompiledStyles=this.getCompiledStyles(e.classes),c.cssClasses=e.classes.join(` `);else{let n={id:e.id,label:e.text,labelType:e.labelType,labelStyle:``,parentId:o,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles([`default`,`node`,...e.classes]),cssClasses:`default `+e.classes.join(` `),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};s?t.push({...n,isGroup:!0,shape:`rect`}):t.push({...n,isGroup:!1,shape:this.getTypeFromVertex(e),minWidth:i.flowchart?.minNodeWidth})}}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}getData(){let e=m(),n=[],r=[],i=this.getSubGraphs(),a=new Map,o=new Map,s=new Map;for(let e of i)for(let t of e.nodes)this.subGraphLookup.has(t)&&s.set(t,e.id);let c=new Map,l=new Map;for(let e of i){let t=s.get(e.id);t!==void 0&&l.set(t,[...l.get(t)??[],e.id])}let u=0,d=t(e=>{c.set(e,u++);for(let t of l.get(e)??[])d(t)},`walk`);for(let e of i)s.has(e.id)||d(e.id);let f=t(e=>this.subGraphLookup.get(e)?.metadata?.view===`collapsed`,`isCollapsed`),p=t(e=>{let t,n=new Set,r=e;for(;r!==void 0&&!n.has(r);)n.add(r),f(r)&&(t=r),r=s.get(r);return t},`outermostCollapsed`),h=new Set,g=new Map;for(let e of i){let t=p(e.id);if(t!==void 0){e.id!==t&&(h.add(e.id),g.set(e.id,t));for(let n of e.nodes)n!==t&&(h.add(n),g.set(n,t))}}for(let e=i.length-1;e>=0;e--){let t=i[e];if(!h.has(t.id)){t.nodes.length>0&&o.set(t.id,!0);for(let e of t.nodes)a.set(e,t.id)}}for(let t=i.length-1;t>=0;t--){let r=i[t];h.has(r.id)||(r.metadata?.view===`collapsed`?n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:`collapsedGroup`,dir:r.dir,isGroup:!1,look:e.look,colorIndex:c.get(r.id)}):n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:`rect`,dir:r.dir,isGroup:!0,look:e.look,colorIndex:c.get(r.id),metadata:r.metadata}))}this.getVertices().forEach(t=>{h.has(t.id)||this.addNodeFromVertex(t,n,a,o,e,e.look||`classic`)});let v=this.getEdges();return v.forEach((t,n)=>{let{arrowTypeStart:i,arrowTypeEnd:a}=this.destructEdgeType(t.type),o=[...v.defaultStyle??[]],s=g.get(t.start)??t.start,c=g.get(t.end)??t.end;if(s===c&&(g.has(t.start)||g.has(t.end)))return;t.style&&o.push(...t.style);let l={id:_(s,c,{counter:n,prefix:`L`},t.id),isUserDefinedId:t.isUserDefinedId,start:s,end:c,type:t.type??`normal`,label:t.text,labelType:t.labelType,labelpos:`c`,thickness:t.stroke,minlen:t.length,classes:t?.stroke===`invisible`?``:`edge-thickness-normal edge-pattern-solid flowchart-link`,arrowTypeStart:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:i,arrowTypeEnd:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:a,arrowheadStyle:`fill: #333`,cssCompiledStyles:this.getCompiledStyles(t.classes),labelStyle:o,style:o,pattern:t.stroke,look:e.look,animate:t.animate,animation:t.animation,curve:t.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(l)}),{nodes:n,edges:r,other:{},config:e}}defaultConfig(){return c.flowchart}},ae={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing state diagram (v2)`,t);let{securityLevel:a,flowchart:o,layout:s}=m();i.db.setDiagramId(t),n.debug(`Before getData: `);let c=i.db.getData();n.debug(`Data: `,c);let l=D(t,a),u=i.db.getDirection();c.type=i.type,c.layoutAlgorithm=w(s),c.direction=u,c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=[`point`,`circle`,`cross`],c.diagramId=t,n.debug(`REF1:`,c),await C(c,l);let d=c.config.flowchart?.diagramPadding??8;v.insertTitle(l,`flowchartTitleText`,o?.titleTopMargin||0,i.db.getDiagramTitle()),O(l,d,`flowchart`,o?.useMaxWidth||!1)},`draw`)},oe=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,3],i=[1,5],a=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],o=[2,2],s=[1,13],c=[1,14],l=[1,15],u=[1,16],d=[1,23],f=[1,25],p=[1,26],m=[1,27],h=[1,50],g=[1,49],_=[1,29],v=[1,30],ee=[1,31],te=[1,32],ne=[1,33],y=[1,45],b=[1,47],x=[1,43],S=[1,48],C=[1,44],w=[1,51],T=[1,46],E=[1,52],D=[1,53],O=[1,34],re=[1,35],ie=[1,36],ae=[1,37],oe=[1,38],k=[1,58],A=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],j=[1,62],M=[1,61],N=[1,63],se=[8,9,11,75,77,78],ce=[1,79],le=[1,92],ue=[1,97],de=[1,96],fe=[1,93],pe=[1,89],me=[1,95],he=[1,91],ge=[1,98],_e=[1,94],ve=[1,99],ye=[1,90],be=[8,9,10,11,40,75,77,78],P=[8,9,10,11,40,46,75,77,78],F=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],xe=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Se=[44,60,89,102,105,106,109,111,114,115,116],Ce=[1,122],we=[1,123],Te=[1,125],Ee=[1,124],De=[44,60,62,74,89,102,105,106,109,111,114,115,116],Oe=[1,134],ke=[1,148],Ae=[1,149],je=[1,150],Me=[1,151],Ne=[1,136],Pe=[1,138],Fe=[1,142],Ie=[1,143],Le=[1,144],Re=[1,145],ze=[1,146],Be=[1,147],Ve=[1,152],He=[1,153],Ue=[1,132],We=[1,133],Ge=[1,140],Ke=[1,135],qe=[1,139],Je=[1,137],Ye=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Xe=[1,155],Ze=[1,157],I=[8,9,11],L=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],R=[1,177],z=[1,173],B=[1,174],V=[1,178],H=[1,175],U=[1,176],Qe=[77,116,119],W=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],$e=[10,106],et=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],G=[1,248],K=[1,246],q=[1,250],J=[1,244],Y=[1,245],X=[1,247],Z=[1,249],Q=[1,251],tt=[1,269],nt=[8,9,11,106],$=[8,9,10,11,60,84,105,106,109,110,111,112],rt={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:`error`,8:`SEMI`,9:`NEWLINE`,10:`SPACE`,11:`EOF`,12:`GRAPH`,13:`NODIR`,14:`DIR`,27:`subgraph`,29:`SQS`,31:`SQE`,32:`end`,34:`acc_title`,35:`acc_title_value`,36:`acc_descr`,37:`acc_descr_value`,38:`acc_descr_multiline_value`,40:`SHAPE_DATA`,44:`AMP`,46:`STYLE_SEPARATOR`,48:`DOUBLECIRCLESTART`,49:`DOUBLECIRCLEEND`,50:`PS`,51:`PE`,52:`(-`,53:`-)`,54:`STADIUMSTART`,55:`STADIUMEND`,56:`SUBROUTINESTART`,57:`SUBROUTINEEND`,58:`VERTEX_WITH_PROPS_START`,59:`NODE_STRING[field]`,60:`COLON`,61:`NODE_STRING[value]`,62:`PIPE`,63:`CYLINDERSTART`,64:`CYLINDEREND`,65:`DIAMOND_START`,66:`DIAMOND_STOP`,67:`TAGEND`,68:`TRAPSTART`,69:`TRAPEND`,70:`INVTRAPSTART`,71:`INVTRAPEND`,74:`TESTSTR`,75:`START_LINK`,77:`LINK`,78:`LINK_ID`,80:`STR`,81:`MD_STR`,84:`STYLE`,85:`LINKSTYLE`,86:`CLASSDEF`,87:`CLASS`,88:`CLICK`,89:`DOWN`,90:`UP`,93:`idString[vertex]`,94:`idString[class]`,95:`CALLBACKNAME`,96:`CALLBACKARGS`,97:`HREF`,98:`LINK_TARGET`,99:`STR[link]`,100:`STR[tooltip]`,102:`DEFAULT`,104:`INTERPOLATE`,105:`NUM`,106:`COMMA`,109:`NODE_STRING`,110:`UNIT`,111:`BRKT`,112:`PCT`,114:`MINUS`,115:`MULT`,116:`UNICODE_TEXT`,117:`TEXT`,118:`TAGSTART`,119:`EDGE_TEXT`,121:`direction_tb`,122:`direction_bt`,123:`direction_rl`,124:`direction_lr`,125:`direction_td`},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:(!Array.isArray(a[s])||a[s].length>0)&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 183:this.$=a[s];break;case 11:r.setDirection(`TB`),this.$=`TB`;break;case 12:r.setDirection(a[s-1]),this.$=a[s-1];break;case 27:this.$=a[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4]);break;case 34:this.$=r.addSubGraph(a[s-3],a[s-1],a[s-3]);break;case 35:this.$=r.addSubGraph(void 0,a[s-1],void 0);break;case 37:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 38:case 39:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 43:this.$=a[s-1]+a[s];break;case 44:this.$=a[s];break;case 45:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 46:r.addLink(a[s-2].stmt,a[s],a[s-1]),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 47:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 48:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 49:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),this.$={stmt:a[s-1],nodes:a[s-1],shapeData:a[s]};break;case 50:this.$={stmt:a[s],nodes:a[s]};break;case 51:this.$=[a[s]];break;case 52:r.addVertex(a[s-5][a[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s-4]),this.$=a[s-5].concat(a[s]);break;case 53:this.$=a[s-4].concat(a[s]);break;case 54:this.$=a[s];break;case 55:this.$=a[s-2],r.setClass(a[s-2],a[s]);break;case 56:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`square`);break;case 57:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`doublecircle`);break;case 58:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`circle`);break;case 59:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`ellipse`);break;case 60:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`stadium`);break;case 61:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`subroutine`);break;case 62:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],`rect`,void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]]));break;case 63:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`cylinder`);break;case 64:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`round`);break;case 65:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`diamond`);break;case 66:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`hexagon`);break;case 67:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`odd`);break;case 68:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`trapezoid`);break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`inv_trapezoid`);break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_right`);break;case 71:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_left`);break;case 72:this.$=a[s],r.addVertex(a[s]);break;case 73:a[s-1].text=a[s],this.$=a[s-1];break;case 74:case 75:a[s-2].text=a[s-1],this.$=a[s-2];break;case 76:this.$=a[s];break;case 77:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,text:a[s-1]};break;case 78:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,text:a[s-1],id:a[s-3]};break;case 79:this.$={text:a[s],type:`text`};break;case 80:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 81:this.$={text:a[s],type:`string`};break;case 82:this.$={text:a[s],type:`markdown`};break;case 83:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length};break;case 84:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,id:a[s-1]};break;case 85:this.$=a[s-1];break;case 86:this.$={text:a[s],type:`text`};break;case 87:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 88:this.$={text:a[s],type:`string`};break;case 89:case 104:this.$={text:a[s],type:`markdown`};break;case 101:this.$={text:a[s],type:`text`};break;case 102:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 103:this.$={text:a[s],type:`text`};break;case 105:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 106:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 107:case 115:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 108:case 116:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 109:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 110:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 111:this.$=a[s-2],r.setLink(a[s-2],a[s]);break;case 112:this.$=a[s-4],r.setLink(a[s-4],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 113:this.$=a[s-4],r.setLink(a[s-4],a[s-2],a[s]);break;case 114:this.$=a[s-6],r.setLink(a[s-6],a[s-4],a[s]),r.setTooltip(a[s-6],a[s-2]);break;case 117:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 118:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 119:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 120:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 121:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 122:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 123:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 124:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 125:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 126:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 127:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 128:case 130:this.$=[a[s]];break;case 129:case 131:a[s-2].push(a[s]),this.$=a[s-2];break;case 133:this.$=a[s-1]+a[s];break;case 181:this.$=a[s];break;case 182:this.$=a[s-1]+``+a[s];break;case 184:this.$=a[s-1]+``+a[s];break;case 185:this.$={stmt:`dir`,value:`TB`};break;case 186:this.$={stmt:`dir`,value:`BT`};break;case 187:this.$={stmt:`dir`,value:`RL`};break;case 188:this.$={stmt:`dir`,value:`LR`};break;case 189:this.$={stmt:`dir`,value:`TD`}}},`anonymous`),table:[{3:1,4:2,9:n,10:r,12:i},{1:[3]},e(a,o,{5:6}),{4:7,9:n,10:r,12:i},{4:8,9:n,10:r,12:i},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},e(a,[2,9]),e(a,[2,10]),e(a,[2,11]),{8:[1,55],9:[1,56],10:k,15:54,18:57},e(A,[2,3]),e(A,[2,4]),e(A,[2,5]),e(A,[2,6]),e(A,[2,7]),e(A,[2,8]),{8:j,9:M,11:N,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:j,9:M,11:N,21:68},{8:j,9:M,11:N,21:69},{8:j,9:M,11:N,21:70},{8:j,9:M,11:N,21:71},{8:j,9:M,11:N,21:72},{8:j,9:M,10:[1,73],11:N,21:74},e(A,[2,36]),{35:[1,75]},{37:[1,76]},e(A,[2,39]),e(se,[2,50],{18:77,39:78,10:k,40:ce}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:le,44:ue,60:de,80:[1,87],89:fe,95:[1,84],97:[1,85],101:86,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye,120:88},e(A,[2,185]),e(A,[2,186]),e(A,[2,187]),e(A,[2,188]),e(A,[2,189]),e(be,[2,51]),e(be,[2,54],{46:[1,100]}),e(P,[2,72],{113:113,29:[1,101],44:h,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:g,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:y,102:b,105:x,106:S,109:C,111:w,114:T,115:E,116:D}),e(F,[2,181]),e(F,[2,142]),e(F,[2,143]),e(F,[2,144]),e(F,[2,145]),e(F,[2,146]),e(F,[2,147]),e(F,[2,148]),e(F,[2,149]),e(F,[2,150]),e(F,[2,151]),e(F,[2,152]),e(a,[2,12]),e(a,[2,18]),e(a,[2,19]),{9:[1,114]},e(xe,[2,26],{18:115,10:k}),e(A,[2,27]),{42:116,43:39,44:h,45:40,47:41,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(A,[2,40]),e(A,[2,41]),e(A,[2,42]),e(Se,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Ce,81:we,116:Te,119:Ee},{75:[1,126],77:[1,127]},e(De,[2,83]),e(A,[2,28]),e(A,[2,29]),e(A,[2,30]),e(A,[2,31]),e(A,[2,32]),{10:Oe,12:ke,14:Ae,27:je,28:128,32:Me,44:Ne,60:Pe,75:Fe,80:[1,130],81:[1,131],83:141,84:Ie,85:Le,86:Re,87:ze,88:Be,89:Ve,90:He,91:129,105:Ue,109:We,111:Ge,114:Ke,115:qe,116:Je},e(Ye,o,{5:154}),e(A,[2,37]),e(A,[2,38]),e(se,[2,48],{44:Xe}),e(se,[2,49],{18:156,10:k,40:Ze}),e(be,[2,44]),{44:h,47:158,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{102:[1,159],103:160,105:[1,161]},{44:h,47:162,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{44:h,47:163,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(I,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(I,[2,115],{120:168,10:[1,167],14:le,44:ue,60:de,89:fe,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye}),e(I,[2,117],{10:[1,169]}),e(L,[2,183]),e(L,[2,170]),e(L,[2,171]),e(L,[2,172]),e(L,[2,173]),e(L,[2,174]),e(L,[2,175]),e(L,[2,176]),e(L,[2,177]),e(L,[2,178]),e(L,[2,179]),e(L,[2,180]),{44:h,47:170,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{30:171,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:179,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:181,50:[1,180],67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:182,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:183,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:184,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{109:[1,185]},{30:186,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:187,65:[1,188],67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:189,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:190,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:191,67:R,80:z,81:B,82:172,116:V,117:H,118:U},e(F,[2,182]),e(a,[2,20]),e(xe,[2,25]),e(se,[2,46],{39:192,18:193,10:k,40:ce}),e(Se,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{77:[1,197],79:198,116:Te,119:Ee},e(Qe,[2,79]),e(Qe,[2,81]),e(Qe,[2,82]),e(Qe,[2,168]),e(Qe,[2,169]),{76:199,79:121,80:Ce,81:we,116:Te,119:Ee},e(De,[2,84]),{8:j,9:M,10:Oe,11:N,12:ke,14:Ae,21:201,27:je,29:[1,200],32:Me,44:Ne,60:Pe,75:Fe,83:141,84:Ie,85:Le,86:Re,87:ze,88:Be,89:Ve,90:He,91:202,105:Ue,109:We,111:Ge,114:Ke,115:qe,116:Je},e(W,[2,101]),e(W,[2,103]),e(W,[2,104]),e(W,[2,157]),e(W,[2,158]),e(W,[2,159]),e(W,[2,160]),e(W,[2,161]),e(W,[2,162]),e(W,[2,163]),e(W,[2,164]),e(W,[2,165]),e(W,[2,166]),e(W,[2,167]),e(W,[2,90]),e(W,[2,91]),e(W,[2,92]),e(W,[2,93]),e(W,[2,94]),e(W,[2,95]),e(W,[2,96]),e(W,[2,97]),e(W,[2,98]),e(W,[2,99]),e(W,[2,100]),{6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,203],33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},{10:k,18:204},{44:[1,205]},e(be,[2,43]),{10:[1,206],44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:113,114:T,115:E,116:D},{10:[1,207]},{10:[1,208],106:[1,209]},e($e,[2,128]),{10:[1,210],44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:113,114:T,115:E,116:D},{10:[1,211],44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:113,114:T,115:E,116:D},{80:[1,212]},e(I,[2,109],{10:[1,213]}),e(I,[2,111],{10:[1,214]}),{80:[1,215]},e(L,[2,184]),{80:[1,216],98:[1,217]},e(be,[2,55],{113:113,44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,114:T,115:E,116:D}),{31:[1,218],67:R,82:219,116:V,117:H,118:U},e(et,[2,86]),e(et,[2,88]),e(et,[2,89]),e(et,[2,153]),e(et,[2,154]),e(et,[2,155]),e(et,[2,156]),{49:[1,220],67:R,82:219,116:V,117:H,118:U},{30:221,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{51:[1,222],67:R,82:219,116:V,117:H,118:U},{53:[1,223],67:R,82:219,116:V,117:H,118:U},{55:[1,224],67:R,82:219,116:V,117:H,118:U},{57:[1,225],67:R,82:219,116:V,117:H,118:U},{60:[1,226]},{64:[1,227],67:R,82:219,116:V,117:H,118:U},{66:[1,228],67:R,82:219,116:V,117:H,118:U},{30:229,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{31:[1,230],67:R,82:219,116:V,117:H,118:U},{67:R,69:[1,231],71:[1,232],82:219,116:V,117:H,118:U},{67:R,69:[1,234],71:[1,233],82:219,116:V,117:H,118:U},e(se,[2,45],{18:156,10:k,40:Ze}),e(se,[2,47],{44:Xe}),e(Se,[2,75]),e(Se,[2,74]),{62:[1,235],67:R,82:219,116:V,117:H,118:U},e(Se,[2,77]),e(Qe,[2,80]),{77:[1,236],79:198,116:Te,119:Ee},{30:237,67:R,80:z,81:B,82:172,116:V,117:H,118:U},e(Ye,o,{5:238}),e(W,[2,102]),e(A,[2,35]),{43:239,44:h,45:40,47:41,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{10:k,18:240},{10:G,60:K,84:q,92:241,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{10:G,60:K,84:q,92:252,104:[1,253],105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{10:G,60:K,84:q,92:254,104:[1,255],105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{105:[1,256]},{10:G,60:K,84:q,92:257,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{44:h,47:258,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(I,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(I,[2,116]),e(I,[2,118],{10:[1,262]}),e(I,[2,119]),e(P,[2,56]),e(et,[2,87]),e(P,[2,57]),{51:[1,263],67:R,82:219,116:V,117:H,118:U},e(P,[2,64]),e(P,[2,59]),e(P,[2,60]),e(P,[2,61]),{109:[1,264]},e(P,[2,63]),e(P,[2,65]),{66:[1,265],67:R,82:219,116:V,117:H,118:U},e(P,[2,67]),e(P,[2,68]),e(P,[2,70]),e(P,[2,69]),e(P,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(Se,[2,78]),{31:[1,266],67:R,82:219,116:V,117:H,118:U},{6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,267],33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},e(be,[2,53]),{43:268,44:h,45:40,47:41,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(I,[2,121],{106:tt}),e(nt,[2,130],{108:270,10:G,60:K,84:q,105:J,109:Y,110:X,111:Z,112:Q}),e($,[2,132]),e($,[2,134]),e($,[2,135]),e($,[2,136]),e($,[2,137]),e($,[2,138]),e($,[2,139]),e($,[2,140]),e($,[2,141]),e(I,[2,122],{106:tt}),{10:[1,271]},e(I,[2,123],{106:tt}),{10:[1,272]},e($e,[2,129]),e(I,[2,105],{106:tt}),e(I,[2,106],{113:113,44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,114:T,115:E,116:D}),e(I,[2,110]),e(I,[2,112],{10:[1,273]}),e(I,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:j,9:M,11:N,21:278},e(A,[2,34]),e(be,[2,52]),{10:G,60:K,84:q,105:J,107:279,108:243,109:Y,110:X,111:Z,112:Q},e($,[2,133]),{14:le,44:ue,60:de,89:fe,101:280,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye,120:88},{14:le,44:ue,60:de,89:fe,101:281,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye,120:88},{98:[1,282]},e(I,[2,120]),e(P,[2,58]),{30:283,67:R,80:z,81:B,82:172,116:V,117:H,118:U},e(P,[2,66]),e(Ye,o,{5:284}),e(nt,[2,131],{108:270,10:G,60:K,84:q,105:J,109:Y,110:X,111:Z,112:Q}),e(I,[2,126],{120:168,10:[1,285],14:le,44:ue,60:de,89:fe,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye}),e(I,[2,127],{120:168,10:[1,286],14:le,44:ue,60:de,89:fe,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye}),e(I,[2,114]),{31:[1,287],67:R,82:219,116:V,117:H,118:U},{6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,288],33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},{10:G,60:K,84:q,92:289,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{10:G,60:K,84:q,92:290,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},e(P,[2,62]),e(A,[2,33]),e(I,[2,124],{106:tt}),e(I,[2,125],{106:tt})],defaultActions:{},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var ee=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function te(e){r.length-=2*e,a.length-=e,o.length-=e}t(te,`popStack`);function ne(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(ne,`lex`);for(var y,b,x,S,C,w={},T,E,D,O;;){if(x=r[r.length-1],this.defaultActions[x]?S=this.defaultActions[x]:(y??=ne(),S=s[x]&&s[x][y]),S===void 0||!S.length||!S[0]){var re=``;for(T in O=[],s[x])this.terminals_[T]&&T>f&&O.push(`'`+this.terminals_[T]+`'`);re=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+O.join(`, `)+`, got '`+(this.terminals_[y]||y)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(y==p?`end of input`:`'`+(this.terminals_[y]||y)+`'`),this.parseError(re,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:v,expected:O})}if(S[0]instanceof Array&&S.length>1)throw Error(`Parse Error: multiple actions possible at state: `+x+`, token: `+y);switch(S[0]){case 1:r.push(y),a.push(h.yytext),o.push(h.yylloc),r.push(S[1]),y=null,b?(y=b,b=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(E=this.productions_[S[1]][1],w.$=a[a.length-E],w._$={first_line:o[o.length-(E||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(E||1)].first_column,last_column:o[o.length-1].last_column},ee&&(w._$.range=[o[o.length-(E||1)].range[0],o[o.length-1].range[1]]),C=this.performAction.apply(w,[c,u,l,g.yy,S[1],a,o].concat(m)),C!==void 0)return C;E&&(r=r.slice(0,-1*E*2),a=a.slice(0,-1*E),o=o.slice(0,-1*E)),r.push(this.productions_[S[1]][0]),a.push(w.$),o.push(w._$),D=s[r[r.length-2]][r[r.length-1]],r.push(D);break;case 3:return!0}}return!0},`parse`)};rt.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:t(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),34;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),36;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return this.pushState(`shapeData`),t.yytext=``,40;case 8:return this.pushState(`shapeDataStr`),40;case 9:return this.popState(),40;case 10:return t.yytext=t.yytext.replace(/\n\s*/g,`
`),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin(`callbackname`);break;case 14:this.popState();break;case 15:this.popState(),this.begin(`callbackargs`);break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return`MD_STR`;case 20:this.popState();break;case 21:this.begin(`md_string`);break;case 22:return`STR`;case 23:this.popState();break;case 24:this.pushState(`string`);break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin(`click`);break;case 33:this.popState();break;case 34:return 88;case 35:return e.lex.firstGraph()&&this.begin(`dir`),12;case 36:return e.lex.firstGraph()&&this.begin(`dir`),12;case 37:return e.lex.firstGraph()&&this.begin(`dir`),12;case 38:return e.lex.firstGraph()&&this.begin(`dir`),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState(`edgeText`),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState(`thickEdgeText`),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState(`dottedEdgeText`),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return`TEXT`;case 82:return this.pushState(`ellipseText`),52;case 83:return this.popState(),55;case 84:return this.pushState(`text`),54;case 85:return this.popState(),57;case 86:return this.pushState(`text`),56;case 87:return 58;case 88:return this.pushState(`text`),67;case 89:return this.popState(),64;case 90:return this.pushState(`text`),63;case 91:return this.popState(),49;case 92:return this.pushState(`text`),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState(`trapText`),68;case 97:return this.pushState(`trapText`),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return`SEP`;case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState(`text`),62;case 111:return this.popState(),51;case 112:return this.pushState(`text`),50;case 113:return this.popState(),31;case 114:return this.pushState(`text`),29;case 115:return this.popState(),66;case 116:return this.pushState(`text`),65;case 117:return`TEXT`;case 118:return`QUOTE`;case 119:return 9;case 120:return 10;case 121:return 11}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\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\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\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\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-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\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-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\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\u2183\u2184]|[\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\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\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])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:[^\S\n\r]+)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}}})();function it(){this.yy={}}return t(it,`Parser`),it.prototype=rt,rt.Parser=it,new it})();oe.parser=oe;var k=oe,A=Object.assign({},k);A.parse=e=>{let t=e.replace(/}\s*\n/g,`} -`);return k.parse(t)};var j=A,M=t(e=>{let{theme:n,bkgColorArray:r,borderColorArray:i}=e;if(!te(n,i))return``;let a=y(e.look),o=b(r),s=``;for(let n=0;n`${l}.node ${e}, ${l}.rough-node ${e}`,`collapsedRule`),d=t(e=>`${l}.swimlane.cluster .swimlane-title${e}, ${l}.swimlane.cluster .swimlane-body${e}`,`laneRule`);s+=` +`);return k.parse(t)};var j=A,M=t(e=>{let{theme:n,bkgColorArray:r,borderColorArray:i}=e;if(!ne(n,i))return``;let a=b(e.look),o=x(r),s=``;for(let n=0;n`${l}.node ${e}, ${l}.rough-node ${e}`,`collapsedRule`),d=t(e=>`${l}.swimlane.cluster .swimlane-title${e}, ${l}.swimlane.cluster .swimlane-body${e}`,`laneRule`);s+=` ${l}.cluster:not(.swimlane) rect { stroke: ${e}; @@ -209,5 +209,5 @@ ${o?` } text-align: center; } - ${ee()} + ${T()} `,`getStyles`),ce=t(({styles:e=se}={})=>({parser:j,get db(){return new ie},renderer:ae,styles:e,init:t(e=>{e.flowchart||={},e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,i({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},`init`)}),`createFlowDiagram`),le=ce();export{le as n,se as r,ce as t}; \ No newline at end of file diff --git a/web/dist/app-chunk-GNY47TPC.js b/web/dist/app-chunk-GNY47TPC.js index 613f71291..caa2b288d 100644 --- a/web/dist/app-chunk-GNY47TPC.js +++ b/web/dist/app-chunk-GNY47TPC.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["app-elk-276RUBZZ.js","app-rolldown-runtime.js","app-chunk-Y2CYZVJY.js","app-src.js","app-chunk-O7XYJQB3.js","app-preload-helper.js","app-purify.es.js","app-chunk-ZIGJFQKS.js","app-dist.js","app-chunk-742MDFTN.js","app-chunk-MBY4JIJT.js","app-chunk-7PRAP22T.js","app-chunk-7INBJB4K.js","app-chunk-J5ZVWO5B.js","app-rough.esm.js","app-chunk-5DYCD2WN.js","app-chunk-Z7XXMR3K.js","app-line.js","app-path.js","app-array.js","app-chunk-UA2S7LBM.js","app-chunk-3FUC2YCW.js","app-graphlib.js","app-chunk-NETBCI7D.js","app-dagre-6A5THRUB.js","app-swimlanes-2SLR337P.js","app-cose-bilkent-JH36ORCC.js","app-cytoscape.esm.js"])))=>i.map(i=>d[i]); -import{t as e}from"./app-preload-helper.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import{b as r,s as i}from"./app-chunk-O7XYJQB3.js";import{d as a}from"./app-chunk-ZIGJFQKS.js";import{t as o}from"./app-chunk-DUW6YSOI.js";import{o as s}from"./app-chunk-7INBJB4K.js";import{r as c}from"./app-chunk-5DYCD2WN.js";import{a as l,c as u,i as d,l as f}from"./app-chunk-Z7XXMR3K.js";import{r as p}from"./app-chunk-UA2S7LBM.js";var m={common:i,getConfig:r,insertCluster:p,insertEdge:d,insertEdgeLabel:l,insertMarkers:u,insertNode:c,interpolateToCurve:a,labelHelper:s,log:n,positionEdgeLabel:f},h=[`elk.stress`,`elk.force`,`elk.mrtree`,`elk.sporeOverlap`,`elk.box`,`elk.rectpacking`],g=Object.create(null),_=t(e=>{for(let t of e)g[t.name]=t},`registerLayoutLoaders`),v=t(()=>{let n=t(async()=>await e(()=>import(`./app-elk-276RUBZZ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])),`loader`);return[{name:`elk`,loader:n,algorithm:`elk.layered`},...h.map(e=>({name:e,loader:n,algorithm:e}))]},`elkLayoutLoaders`);t(()=>{_([{name:`dagre`,loader:t(async()=>await e(()=>import(`./app-dagre-6A5THRUB.js`),__vite__mapDeps([24,2,3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,22,20,21])),`loader`)},{name:`swimlane`,loader:t(async()=>await e(()=>import(`./app-swimlanes-2SLR337P.js`),__vite__mapDeps([25,2,3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])),`loader`)},{name:`cose-bilkent`,loader:t(async()=>await e(()=>import(`./app-cose-bilkent-JH36ORCC.js`),__vite__mapDeps([26,1,2,3,27])),`loader`)},...v()])},`registerDefaultLayoutLoaders`)();var y=t(async(e,t)=>{if(!Object.hasOwn(g,e.layoutAlgorithm))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=g[e.layoutAlgorithm],r=await n.loader();return o(t,e.config),r.render(e,t,m,{algorithm:n.algorithm})},`render`),b=`dagre`,x=t((e=``,{fallback:t=b}={})=>{if(Object.hasOwn(g,e))return e;for(let r of[t,b])if(Object.hasOwn(g,r))return n.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw Error(`Neither layout algorithm ${e}, ${t}, nor ${b} is registered.`)},`getRegisteredLayoutAlgorithm`);export{_ as n,y as r,x as t}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["app-elk-276RUBZZ.js","app-rolldown-runtime.js","app-chunk-Y2CYZVJY.js","app-src.js","app-chunk-O7XYJQB3.js","app-preload-helper.js","app-purify.es.js","app-chunk-ZIGJFQKS.js","app-dist.js","app-chunk-7PRAP22T.js","app-chunk-742MDFTN.js","app-chunk-MBY4JIJT.js","app-chunk-7INBJB4K.js","app-chunk-J5ZVWO5B.js","app-rough.esm.js","app-chunk-5DYCD2WN.js","app-chunk-UA2S7LBM.js","app-chunk-Z7XXMR3K.js","app-line.js","app-path.js","app-array.js","app-chunk-3FUC2YCW.js","app-graphlib.js","app-chunk-NETBCI7D.js","app-dagre-6A5THRUB.js","app-swimlanes-2SLR337P.js","app-cose-bilkent-JH36ORCC.js","app-cytoscape.esm.js"])))=>i.map(i=>d[i]); +import{t as e}from"./app-preload-helper.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import{b as r,s as i}from"./app-chunk-O7XYJQB3.js";import{d as a}from"./app-chunk-ZIGJFQKS.js";import{t as o}from"./app-chunk-DUW6YSOI.js";import{o as s}from"./app-chunk-7INBJB4K.js";import{r as c}from"./app-chunk-5DYCD2WN.js";import{r as l}from"./app-chunk-UA2S7LBM.js";import{a as u,c as d,i as f,l as p}from"./app-chunk-Z7XXMR3K.js";var m={common:i,getConfig:r,insertCluster:l,insertEdge:f,insertEdgeLabel:u,insertMarkers:d,insertNode:c,interpolateToCurve:a,labelHelper:s,log:n,positionEdgeLabel:p},h=[`elk.stress`,`elk.force`,`elk.mrtree`,`elk.sporeOverlap`,`elk.box`,`elk.rectpacking`],g=Object.create(null),_=t(e=>{for(let t of e)g[t.name]=t},`registerLayoutLoaders`),v=t(()=>{let n=t(async()=>await e(()=>import(`./app-elk-276RUBZZ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])),`loader`);return[{name:`elk`,loader:n,algorithm:`elk.layered`},...h.map(e=>({name:e,loader:n,algorithm:e}))]},`elkLayoutLoaders`);t(()=>{_([{name:`dagre`,loader:t(async()=>await e(()=>import(`./app-dagre-6A5THRUB.js`),__vite__mapDeps([24,2,3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,21])),`loader`)},{name:`swimlane`,loader:t(async()=>await e(()=>import(`./app-swimlanes-2SLR337P.js`),__vite__mapDeps([25,2,3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])),`loader`)},{name:`cose-bilkent`,loader:t(async()=>await e(()=>import(`./app-cose-bilkent-JH36ORCC.js`),__vite__mapDeps([26,1,2,3,27])),`loader`)},...v()])},`registerDefaultLayoutLoaders`)();var y=t(async(e,t)=>{if(!Object.hasOwn(g,e.layoutAlgorithm))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=g[e.layoutAlgorithm],r=await n.loader();return o(t,e.config),r.render(e,t,m,{algorithm:n.algorithm})},`render`),b=`dagre`,x=t((e=``,{fallback:t=b}={})=>{if(Object.hasOwn(g,e))return e;for(let r of[t,b])if(Object.hasOwn(g,r))return n.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw Error(`Neither layout algorithm ${e}, ${t}, nor ${b} is registered.`)},`getRegisteredLayoutAlgorithm`);export{_ as n,y as r,x as t}; \ No newline at end of file diff --git a/web/dist/app-chunk-UA2S7LBM.js b/web/dist/app-chunk-UA2S7LBM.js index 6150383e0..638b27ad9 100644 --- a/web/dist/app-chunk-UA2S7LBM.js +++ b/web/dist/app-chunk-UA2S7LBM.js @@ -1 +1 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{T as r,g as i,x as a}from"./app-chunk-O7XYJQB3.js";import{n as o}from"./app-chunk-MBY4JIJT.js";import{a as s,i as c,t as l}from"./app-chunk-7PRAP22T.js";import{s as u}from"./app-chunk-J5ZVWO5B.js";import{t as d}from"./app-rough.esm.js";import{i as f,n as p,t as m}from"./app-chunk-7INBJB4K.js";import{n as h}from"./app-chunk-5DYCD2WN.js";var g=e(async(e,r)=>{let l=a(),{theme:p,themeVariables:m,handDrawnSeed:h}=l,{clusterBkg:g,clusterBorder:_,borderColorArray:v}=m,y=_,{labelStyles:b,nodeStyles:x,borderStyles:S,backgroundStyles:C}=c(r),w=e.insert(`g`).attr(`class`,`cluster swimlane `+(r.cssClasses||``)).attr(`id`,r.id).attr(`data-id`,r.id).attr(`data-et`,`cluster`).attr(`data-look`,r.look);u(w,r.colorIndex,p,v);let T=i(l.flowchart.htmlLabels),E=r.direction===`LR`,D=w.insert(`g`).attr(`class`,`cluster-label swimlane-label`),O=await o(D,r.label,{style:r.labelStyle,useHtmlLabels:T,isNode:!0,width:r.width}),k=O.getBBox();if(T){let e=O.children[0],t=n(O);k=e.getBoundingClientRect(),t.attr(`width`,k.width),t.attr(`height`,k.height)}let A=r.padding??0,j=r.width<=k.width+A?k.width+A:r.width;r.diff=r.width<=k.width+A?(j-r.width)/2-A:-A;let M=r.height,N=r.y-M/2,P=r.y+M/2,F=r.x-j/2,I=r.swimlaneContentTop===void 0?N+M/3:r.swimlaneContentTop,L=E?4:0,R=k.height+2*L,z,B;if(E){let e=Math.max(R,k.height+2*L),t=F+e,n=Math.max(0,j-e);if(r.look===`handDrawn`){let i=d.svg(w),a=s(r,{roughness:.7,fill:g,stroke:y,seed:h}),o=s(r,{roughness:.7,fill:`none`,stroke:y,seed:h}),c=i.rectangle(F,N,e,M,a);z=w.insert(()=>c,`:first-child`).attr(`class`,`swimlane-title`);let l=i.rectangle(t,N,n,M,o);B=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,F).attr(`y`,N).attr(`width`,e).attr(`height`,M).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,t).attr(`y`,N).attr(`width`,n).attr(`height`,M).attr(`fill`,`none`).attr(`stroke`,y);let i=F+e/2,a=r.y;D.attr(`transform`,`translate(${i}, ${a}) rotate(-90) translate(${-k.width/2}, ${-k.height/2})`)}else{let e=Math.max(0,I-N),t=Math.min(R,e),n=N+t,i=Math.max(0,P-n),a=r.x-j/2;if(r.look===`handDrawn`){let e=d.svg(w),o=s(r,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:h}),c=s(r,{roughness:.7,fill:`none`,stroke:y,seed:h}),l=e.rectangle(a,N,j,t,o);z=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-title`);let u=e.rectangle(a,n,j,i,c);B=w.insert(()=>u,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,a).attr(`y`,N).attr(`width`,j).attr(`height`,t).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,a).attr(`y`,n).attr(`width`,j).attr(`height`,i).attr(`fill`,`none`).attr(`stroke`,y);let o=r.x-k.width/2,c=N+(t-k.height)/2;D.attr(`transform`,`translate(${o}, ${c})`)}if(t.trace(`Swimlane data `,r,JSON.stringify(r)),b){let e=D.select(`span`);e&&e.attr(`style`,b)}return r.offsetX=0,r.width=j,r.height=M,r.offsetY=k.height-A/2,r.intersect=function(e){return f(r,e)},{cluster:w,labelBBox:k}},`swimlane`),_=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let l=a(),{theme:g,themeVariables:_,handDrawnSeed:v}=l,{clusterBkg:y,clusterBorder:b,borderColorArray:x}=_,{labelStyles:S,nodeStyles:C,borderStyles:w,backgroundStyles:T}=c(i),E=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look);u(E,i.colorIndex,g,x);let D=r(l),O=E.insert(`g`).attr(`class`,`cluster-label `),k;k=i.labelType===`markdown`?await o(O,i.label,{style:i.labelStyle,useHtmlLabels:D,isNode:!0,width:i.width}):await m(O,i.label,i.labelStyle||``,!1,!0);let A=k.getBBox();if(r(l)){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let j=i.width<=A.width+i.padding?A.width+i.padding:i.width;i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let M=i.height,N=i.x-j/2,P=i.y-M/2;t.trace(`Data `,i,JSON.stringify(i));let F;if(i.look===`handDrawn`){let e=d.svg(E),n=s(i,{roughness:.7,fill:y,stroke:b,fillWeight:3,seed:v}),r=e.path(p(N,P,j,M,0),n);F=E.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),F.select(`path:nth-child(2)`).attr(`style`,w.join(`;`)),F.select(`path`).attr(`style`,T.join(`;`).replace(`fill`,`stroke`))}else F=E.insert(`rect`,`:first-child`),F.attr(`style`,C).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,N).attr(`y`,P).attr(`width`,j).attr(`height`,M);let{subGraphTitleTopMargin:I}=h(l);if(O.attr(`transform`,`translate(${i.x-A.width/2}, ${i.y-i.height/2+I})`),S){let e=O.select(`span`);e&&e.attr(`style`,S)}let L=F.node().getBBox();return i.offsetX=0,i.width=L.width,i.height=L.height,i.offsetY=A.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`rect`),v=e((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return f(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),y=e(async(e,t)=>{let i=a(),{theme:o,themeVariables:s,handDrawnSeed:c}=i,{altBackground:l,borderColorArray:h,compositeBackground:g,compositeTitleBackground:_,nodeBorder:v}=s,y=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look);u(y,t.colorIndex,o,h);let b=y.insert(`g`,`:first-child`),x=y.insert(`g`).attr(`class`,`cluster-label`),S=y.append(`rect`),C=await m(x,t.label,t.labelStyle,void 0,!0),w=C.getBBox();if(r(i)){let e=C.children[0],t=n(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=0*t.padding,E=T/2,D=(t.width<=w.width+t.padding?w.width+t.padding:t.width)+T;t.diff=t.width<=w.width+t.padding?(D-t.width)/2-t.padding:-t.padding;let O=t.height+T,k=t.height+T-w.height-6,A=t.x-D/2,j=t.y-O/2;t.width=D;let M=t.y-t.height/2-E+w.height+2,N;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=d.svg(y),r=t.rx||t.ry?n.path(p(A,j,D,O,10),{roughness:.7,fill:_,fillStyle:`solid`,stroke:v,seed:c}):n.rectangle(A,j,D,O,{seed:c});N=y.insert(()=>r,`:first-child`);let i=n.rectangle(A,M,D,k,{fill:e?l:g,fillStyle:e?`hachure`:`solid`,stroke:v,seed:c});N=y.insert(()=>r,`:first-child`),S=y.insert(()=>i),N.attr(`class`,`outer`),S.attr(`class`,`inner`)}else N=b.insert(`rect`,`:first-child`),N.attr(`class`,`outer`).attr(`x`,A).attr(`y`,j).attr(`width`,D).attr(`height`,O).attr(`data-look`,t.look),S.attr(`class`,`inner`).attr(`x`,A).attr(`y`,M).attr(`width`,D).attr(`height`,k);return x.attr(`transform`,`translate(${t.x-w.width/2}, ${j+1-(r(i)?0:3)})`),t.height=N.node().getBBox().height,t.offsetX=0,t.offsetY=w.height-t.padding/2,t.labelBBox=w,t.intersect=function(e){return f(t,e)},{cluster:y,labelBBox:w}},`roundedWithTitle`),b=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let l=a(),{themeVariables:u,handDrawnSeed:m}=l,{clusterBkg:g,clusterBorder:_}=u,{labelStyles:v,nodeStyles:y,borderStyles:b,backgroundStyles:x}=c(i),S=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look),C=r(l),w=S.insert(`g`).attr(`class`,`cluster-label `),T=await o(w,i.label,{style:i.labelStyle,useHtmlLabels:C,isNode:!0,width:i.width}),E=T.getBBox();if(r(l)){let e=T.children[0],t=n(T);E=e.getBoundingClientRect(),t.attr(`width`,E.width),t.attr(`height`,E.height)}let D=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(D-i.width)/2-i.padding:-i.padding;let O=i.height,k=i.x-D/2,A=i.y-O/2;t.trace(`Data `,i,JSON.stringify(i));let j;if(i.look===`handDrawn`){let e=d.svg(S),n=s(i,{roughness:.7,fill:g,stroke:_,fillWeight:4,seed:m}),r=e.path(p(k,A,D,O,i.rx),n);j=S.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),j.select(`path:nth-child(2)`).attr(`style`,b.join(`;`)),j.select(`path`).attr(`style`,x.join(`;`).replace(`fill`,`stroke`))}else j=S.insert(`rect`,`:first-child`),j.attr(`style`,y).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,k).attr(`y`,A).attr(`width`,D).attr(`height`,O);let{subGraphTitleTopMargin:M}=h(l);if(w.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+M})`),v){let e=w.select(`span`);e&&e.attr(`style`,v)}let N=j.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:S,labelBBox:E}},`kanbanSection`),x=e((e,t)=>{let{theme:n,themeVariables:r,handDrawnSeed:i}=a(),{altBackground:o,nodeBorder:s,borderColorArray:c}=r,l=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look);u(l,t.colorIndex,n,c);let p=l.insert(`g`,`:first-child`),m=0*t.padding,h=t.width+m;t.diff=-t.padding;let g=t.height+m,_=t.x-h/2,v=t.y-g/2;t.width=h;let y;if(t.look===`handDrawn`){let e=d.svg(l).rectangle(_,v,h,g,{fill:o??`#efefef`,fillStyle:`solid`,roughness:.5,strokeLineDash:[5],stroke:s,seed:i});y=l.insert(()=>e,`:first-child`).attr(`class`,`divider`)}else{y=p.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),y.attr(`class`,e).attr(`x`,_).attr(`y`,v).attr(`width`,h).attr(`height`,g).attr(`data-look`,t.look)}return t.height=y.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return f(t,e)},{cluster:l,labelBBox:{}}},`divider`),S=e(async(e,i,l)=>{t.info(`Creating ${l.cssClass} for `,i.id,i);let g=a(),{theme:_,themeVariables:v,handDrawnSeed:y}=g,{borderColorArray:b}=v,{labelStyles:x,borderStyles:S}=c(i),C=e.insert(`g`).attr(`class`,`cluster `+l.cssClass+` `+i.cssClasses).attr(`id`,i.domId??i.id).attr(`data-look`,i.look);u(C,i.colorIndex,_,b);let w=r(g),T=C.insert(`g`).attr(`class`,`cluster-label`),E={width:0,height:0},D=i.label?.trim();if(D){let e;if(e=i.labelType===`markdown`?await o(T,i.label,{style:i.labelStyle,useHtmlLabels:w,isNode:!0,width:i.width}):await m(T,i.label,i.labelStyle||``,!1,!0),E=e.getBBox(),w){let t=e.children[0],r=n(e);E=t.getBoundingClientRect(),r.attr(`width`,E.width),r.attr(`height`,E.height)}}let O=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(O-i.width)/2-i.padding:-i.padding;let k=i.height,A=i.x-O/2,j=i.y-k/2,M;if(i.look===`handDrawn`){let e=d.svg(C),t=s(i,{roughness:l.roughness,fill:l.fill,stroke:l.stroke,strokeWidth:l.strokeWidth,seed:y,...l.fill===`none`?{fillWeight:0}:{fillStyle:`solid`},...l.strokeDash?{strokeLineDash:l.strokeDash}:{}}),n=e.path(p(A,j,O,k,l.rx),t);M=C.insert(()=>n,`:first-child`),M.select(`path:nth-child(2)`).attr(`style`,S.join(`;`))}else M=C.insert(`rect`,`:first-child`),M.attr(`rx`,l.rx).attr(`ry`,l.rx).attr(`x`,A).attr(`y`,j).attr(`width`,O).attr(`height`,k).attr(`fill`,l.fill).attr(`stroke`,l.stroke).attr(`stroke-width`,l.strokeWidth+`px`),l.strokeDash&&M.attr(`stroke-dasharray`,l.strokeDash.join(`, `));if(D){let{subGraphTitleTopMargin:e}=h(g);if(T.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+e})`),x){let e=T.select(`span`);e&&e.attr(`style`,x)}}let N=M.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:C,labelBBox:E}},`createContainerGroup`),C=e(async(e,t)=>{let{themeVariables:n}=a();return S(e,t,{cssClass:`flow-cluster`,rx:10,fill:`none`,stroke:n.flowContainerStroke||n.secondaryBorderColor,strokeWidth:.75,roughness:.7})},`flowGroup`),w=e((e,t)=>{let n=e.boundaryType||`rect`,r=n===`package`?20:e.padding,i=n===`package`?t.height+10:0,a=Math.max(e.width,t.width+r),o=n===`package`?Math.max(e.height,i+e.padding*2):e.height,s=e.x-a/2,c=e.y-o/2;return{boundaryType:n,width:a,height:o,x:s,y:c,bodyY:c+i,bodyHeight:o-i,tabHeight:i,tabWidth:n===`package`?Math.min(a,Math.max(80,t.width+20)):0}},`getUsecaseSystemBoundaryGeometry`),T={rect:_,squareRect:_,roundedWithTitle:y,noteGroup:v,divider:x,kanbanSection:b,flowGroup:C,usecaseSystemBoundary:e(async(e,i)=>{t.info(`Creating usecase system boundary for `,i.id,i);let p=a(),{theme:m,themeVariables:g,handDrawnSeed:_}=p,{clusterBkg:v,clusterBorder:y,borderColorArray:b}=g,{labelStyles:x,nodeStyles:S}=c(i),{stylesMap:C}=l(i),T=i.boundaryType||`rect`,E=e.insert(`g`).attr(`class`,`cluster usecase-system-boundary usecase-system-boundary-${T} ${i.cssClasses}`).attr(`id`,typeof i.domId==`string`?i.domId:i.id).attr(`data-boundary-type`,T).attr(`data-look`,i.look);u(E,i.colorIndex,m,b);let D=r(p),O=E.insert(`g`).attr(`class`,`cluster-label system-boundary-title`),k=await o(O,i.label,{style:x,useHtmlLabels:D,isNode:!0}),A=k.getBBox();if(D){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let{width:j,height:M,x:N,y:P,bodyY:F,bodyHeight:I,tabHeight:L,tabWidth:R}=w(i,A);i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let z=s(i,{fill:C.get(`fill`)||v,stroke:C.get(`stroke`)||y,strokeWidth:C.get(`stroke-width`)?.replace(`px`,``)||1,seed:_});if(i.look===`handDrawn`){let e=d.svg(E),t=e.rectangle(N,F,j,I,z);if(E.insert(()=>t,`:first-child`).attr(`class`,`boundary-body label-container`),T===`package`){let t=e.rectangle(N,P,R,L,z);E.insert(()=>t,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`)}}else E.insert(`rect`,`:first-child`).attr(`class`,`boundary-body label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,F).attr(`width`,j).attr(`height`,I),T===`package`&&E.insert(`rect`,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,P).attr(`width`,R).attr(`height`,L);let{subGraphTitleTopMargin:B}=h(p);return T===`package`?O.attr(`transform`,`translate(${N+(R-A.width)/2}, ${P+(L-A.height)/2})`):O.attr(`transform`,`translate(${i.x-A.width/2}, ${P+B})`),x&&(O.attr(`style`,x),O.select(`span`).attr(`style`,x)),i.offsetX=0,i.width=j,i.height=M,i.offsetY=A.height-i.padding/2,i.labelBBox=A,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`usecaseSystemBoundary`),swimlane:g},E=new Set([`noteGroup`,`divider`]),D=e(e=>!E.has(e??`rect`),`clusterPaintsTitle`),O=new Map,k=e(async(e,t)=>{let n=await T[t.shape||`rect`](e,t);return O.set(t.id,n),n},`insertCluster`),A=e(()=>{O=new Map},`clear`);export{D as n,k as r,A as t}; \ No newline at end of file +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{T as r,g as i,x as a}from"./app-chunk-O7XYJQB3.js";import{a as o,i as s,t as c}from"./app-chunk-7PRAP22T.js";import{n as l}from"./app-chunk-MBY4JIJT.js";import{s as u}from"./app-chunk-J5ZVWO5B.js";import{t as d}from"./app-rough.esm.js";import{i as f,n as p,t as m}from"./app-chunk-7INBJB4K.js";import{n as h}from"./app-chunk-5DYCD2WN.js";var g=e(async(e,r)=>{let c=a(),{theme:p,themeVariables:m,handDrawnSeed:h}=c,{clusterBkg:g,clusterBorder:_,borderColorArray:v}=m,y=_,{labelStyles:b,nodeStyles:x,borderStyles:S,backgroundStyles:C}=s(r),w=e.insert(`g`).attr(`class`,`cluster swimlane `+(r.cssClasses||``)).attr(`id`,r.id).attr(`data-id`,r.id).attr(`data-et`,`cluster`).attr(`data-look`,r.look);u(w,r.colorIndex,p,v);let T=i(c.flowchart.htmlLabels),E=r.direction===`LR`,D=w.insert(`g`).attr(`class`,`cluster-label swimlane-label`),O=await l(D,r.label,{style:r.labelStyle,useHtmlLabels:T,isNode:!0,width:r.width}),k=O.getBBox();if(T){let e=O.children[0],t=n(O);k=e.getBoundingClientRect(),t.attr(`width`,k.width),t.attr(`height`,k.height)}let A=r.padding??0,j=r.width<=k.width+A?k.width+A:r.width;r.diff=r.width<=k.width+A?(j-r.width)/2-A:-A;let M=r.height,N=r.y-M/2,P=r.y+M/2,F=r.x-j/2,I=r.swimlaneContentTop===void 0?N+M/3:r.swimlaneContentTop,L=E?4:0,R=k.height+2*L,z,B;if(E){let e=Math.max(R,k.height+2*L),t=F+e,n=Math.max(0,j-e);if(r.look===`handDrawn`){let i=d.svg(w),a=o(r,{roughness:.7,fill:g,stroke:y,seed:h}),s=o(r,{roughness:.7,fill:`none`,stroke:y,seed:h}),c=i.rectangle(F,N,e,M,a);z=w.insert(()=>c,`:first-child`).attr(`class`,`swimlane-title`);let l=i.rectangle(t,N,n,M,s);B=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,F).attr(`y`,N).attr(`width`,e).attr(`height`,M).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,t).attr(`y`,N).attr(`width`,n).attr(`height`,M).attr(`fill`,`none`).attr(`stroke`,y);let i=F+e/2,a=r.y;D.attr(`transform`,`translate(${i}, ${a}) rotate(-90) translate(${-k.width/2}, ${-k.height/2})`)}else{let e=Math.max(0,I-N),t=Math.min(R,e),n=N+t,i=Math.max(0,P-n),a=r.x-j/2;if(r.look===`handDrawn`){let e=d.svg(w),s=o(r,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:h}),c=o(r,{roughness:.7,fill:`none`,stroke:y,seed:h}),l=e.rectangle(a,N,j,t,s);z=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-title`);let u=e.rectangle(a,n,j,i,c);B=w.insert(()=>u,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,a).attr(`y`,N).attr(`width`,j).attr(`height`,t).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,a).attr(`y`,n).attr(`width`,j).attr(`height`,i).attr(`fill`,`none`).attr(`stroke`,y);let s=r.x-k.width/2,c=N+(t-k.height)/2;D.attr(`transform`,`translate(${s}, ${c})`)}if(t.trace(`Swimlane data `,r,JSON.stringify(r)),b){let e=D.select(`span`);e&&e.attr(`style`,b)}return r.offsetX=0,r.width=j,r.height=M,r.offsetY=k.height-A/2,r.intersect=function(e){return f(r,e)},{cluster:w,labelBBox:k}},`swimlane`),_=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let c=a(),{theme:g,themeVariables:_,handDrawnSeed:v}=c,{clusterBkg:y,clusterBorder:b,borderColorArray:x}=_,{labelStyles:S,nodeStyles:C,borderStyles:w,backgroundStyles:T}=s(i),E=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look);u(E,i.colorIndex,g,x);let D=r(c),O=E.insert(`g`).attr(`class`,`cluster-label `),k;k=i.labelType===`markdown`?await l(O,i.label,{style:i.labelStyle,useHtmlLabels:D,isNode:!0,width:i.width}):await m(O,i.label,i.labelStyle||``,!1,!0);let A=k.getBBox();if(r(c)){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let j=i.width<=A.width+i.padding?A.width+i.padding:i.width;i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let M=i.height,N=i.x-j/2,P=i.y-M/2;t.trace(`Data `,i,JSON.stringify(i));let F;if(i.look===`handDrawn`){let e=d.svg(E),n=o(i,{roughness:.7,fill:y,stroke:b,fillWeight:3,seed:v}),r=e.path(p(N,P,j,M,0),n);F=E.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),F.select(`path:nth-child(2)`).attr(`style`,w.join(`;`)),F.select(`path`).attr(`style`,T.join(`;`).replace(`fill`,`stroke`))}else F=E.insert(`rect`,`:first-child`),F.attr(`style`,C).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,N).attr(`y`,P).attr(`width`,j).attr(`height`,M);let{subGraphTitleTopMargin:I}=h(c);if(O.attr(`transform`,`translate(${i.x-A.width/2}, ${i.y-i.height/2+I})`),S){let e=O.select(`span`);e&&e.attr(`style`,S)}let L=F.node().getBBox();return i.offsetX=0,i.width=L.width,i.height=L.height,i.offsetY=A.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`rect`),v=e((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return f(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),y=e(async(e,t)=>{let i=a(),{theme:o,themeVariables:s,handDrawnSeed:c}=i,{altBackground:l,borderColorArray:h,compositeBackground:g,compositeTitleBackground:_,nodeBorder:v}=s,y=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look);u(y,t.colorIndex,o,h);let b=y.insert(`g`,`:first-child`),x=y.insert(`g`).attr(`class`,`cluster-label`),S=y.append(`rect`),C=await m(x,t.label,t.labelStyle,void 0,!0),w=C.getBBox();if(r(i)){let e=C.children[0],t=n(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=0*t.padding,E=T/2,D=(t.width<=w.width+t.padding?w.width+t.padding:t.width)+T;t.diff=t.width<=w.width+t.padding?(D-t.width)/2-t.padding:-t.padding;let O=t.height+T,k=t.height+T-w.height-6,A=t.x-D/2,j=t.y-O/2;t.width=D;let M=t.y-t.height/2-E+w.height+2,N;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=d.svg(y),r=t.rx||t.ry?n.path(p(A,j,D,O,10),{roughness:.7,fill:_,fillStyle:`solid`,stroke:v,seed:c}):n.rectangle(A,j,D,O,{seed:c});N=y.insert(()=>r,`:first-child`);let i=n.rectangle(A,M,D,k,{fill:e?l:g,fillStyle:e?`hachure`:`solid`,stroke:v,seed:c});N=y.insert(()=>r,`:first-child`),S=y.insert(()=>i),N.attr(`class`,`outer`),S.attr(`class`,`inner`)}else N=b.insert(`rect`,`:first-child`),N.attr(`class`,`outer`).attr(`x`,A).attr(`y`,j).attr(`width`,D).attr(`height`,O).attr(`data-look`,t.look),S.attr(`class`,`inner`).attr(`x`,A).attr(`y`,M).attr(`width`,D).attr(`height`,k);return x.attr(`transform`,`translate(${t.x-w.width/2}, ${j+1-(r(i)?0:3)})`),t.height=N.node().getBBox().height,t.offsetX=0,t.offsetY=w.height-t.padding/2,t.labelBBox=w,t.intersect=function(e){return f(t,e)},{cluster:y,labelBBox:w}},`roundedWithTitle`),b=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let c=a(),{themeVariables:u,handDrawnSeed:m}=c,{clusterBkg:g,clusterBorder:_}=u,{labelStyles:v,nodeStyles:y,borderStyles:b,backgroundStyles:x}=s(i),S=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look),C=r(c),w=S.insert(`g`).attr(`class`,`cluster-label `),T=await l(w,i.label,{style:i.labelStyle,useHtmlLabels:C,isNode:!0,width:i.width}),E=T.getBBox();if(r(c)){let e=T.children[0],t=n(T);E=e.getBoundingClientRect(),t.attr(`width`,E.width),t.attr(`height`,E.height)}let D=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(D-i.width)/2-i.padding:-i.padding;let O=i.height,k=i.x-D/2,A=i.y-O/2;t.trace(`Data `,i,JSON.stringify(i));let j;if(i.look===`handDrawn`){let e=d.svg(S),n=o(i,{roughness:.7,fill:g,stroke:_,fillWeight:4,seed:m}),r=e.path(p(k,A,D,O,i.rx),n);j=S.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),j.select(`path:nth-child(2)`).attr(`style`,b.join(`;`)),j.select(`path`).attr(`style`,x.join(`;`).replace(`fill`,`stroke`))}else j=S.insert(`rect`,`:first-child`),j.attr(`style`,y).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,k).attr(`y`,A).attr(`width`,D).attr(`height`,O);let{subGraphTitleTopMargin:M}=h(c);if(w.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+M})`),v){let e=w.select(`span`);e&&e.attr(`style`,v)}let N=j.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:S,labelBBox:E}},`kanbanSection`),x=e((e,t)=>{let{theme:n,themeVariables:r,handDrawnSeed:i}=a(),{altBackground:o,nodeBorder:s,borderColorArray:c}=r,l=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look);u(l,t.colorIndex,n,c);let p=l.insert(`g`,`:first-child`),m=0*t.padding,h=t.width+m;t.diff=-t.padding;let g=t.height+m,_=t.x-h/2,v=t.y-g/2;t.width=h;let y;if(t.look===`handDrawn`){let e=d.svg(l).rectangle(_,v,h,g,{fill:o??`#efefef`,fillStyle:`solid`,roughness:.5,strokeLineDash:[5],stroke:s,seed:i});y=l.insert(()=>e,`:first-child`).attr(`class`,`divider`)}else{y=p.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),y.attr(`class`,e).attr(`x`,_).attr(`y`,v).attr(`width`,h).attr(`height`,g).attr(`data-look`,t.look)}return t.height=y.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return f(t,e)},{cluster:l,labelBBox:{}}},`divider`),S=e(async(e,i,c)=>{t.info(`Creating ${c.cssClass} for `,i.id,i);let g=a(),{theme:_,themeVariables:v,handDrawnSeed:y}=g,{borderColorArray:b}=v,{labelStyles:x,borderStyles:S}=s(i),C=e.insert(`g`).attr(`class`,`cluster `+c.cssClass+` `+i.cssClasses).attr(`id`,i.domId??i.id).attr(`data-look`,i.look);u(C,i.colorIndex,_,b);let w=r(g),T=C.insert(`g`).attr(`class`,`cluster-label`),E={width:0,height:0},D=i.label?.trim();if(D){let e;if(e=i.labelType===`markdown`?await l(T,i.label,{style:i.labelStyle,useHtmlLabels:w,isNode:!0,width:i.width}):await m(T,i.label,i.labelStyle||``,!1,!0),E=e.getBBox(),w){let t=e.children[0],r=n(e);E=t.getBoundingClientRect(),r.attr(`width`,E.width),r.attr(`height`,E.height)}}let O=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(O-i.width)/2-i.padding:-i.padding;let k=i.height,A=i.x-O/2,j=i.y-k/2,M;if(i.look===`handDrawn`){let e=d.svg(C),t=o(i,{roughness:c.roughness,fill:c.fill,stroke:c.stroke,strokeWidth:c.strokeWidth,seed:y,...c.fill===`none`?{fillWeight:0}:{fillStyle:`solid`},...c.strokeDash?{strokeLineDash:c.strokeDash}:{}}),n=e.path(p(A,j,O,k,c.rx),t);M=C.insert(()=>n,`:first-child`),M.select(`path:nth-child(2)`).attr(`style`,S.join(`;`))}else M=C.insert(`rect`,`:first-child`),M.attr(`rx`,c.rx).attr(`ry`,c.rx).attr(`x`,A).attr(`y`,j).attr(`width`,O).attr(`height`,k).attr(`fill`,c.fill).attr(`stroke`,c.stroke).attr(`stroke-width`,c.strokeWidth+`px`),c.strokeDash&&M.attr(`stroke-dasharray`,c.strokeDash.join(`, `));if(D){let{subGraphTitleTopMargin:e}=h(g);if(T.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+e})`),x){let e=T.select(`span`);e&&e.attr(`style`,x)}}let N=M.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:C,labelBBox:E}},`createContainerGroup`),C=e(async(e,t)=>{let{themeVariables:n}=a();return S(e,t,{cssClass:`flow-cluster`,rx:10,fill:`none`,stroke:n.flowContainerStroke||n.secondaryBorderColor,strokeWidth:.75,roughness:.7})},`flowGroup`),w=e((e,t)=>{let n=e.boundaryType||`rect`,r=n===`package`?20:e.padding,i=n===`package`?t.height+10:0,a=Math.max(e.width,t.width+r),o=n===`package`?Math.max(e.height,i+e.padding*2):e.height,s=e.x-a/2,c=e.y-o/2;return{boundaryType:n,width:a,height:o,x:s,y:c,bodyY:c+i,bodyHeight:o-i,tabHeight:i,tabWidth:n===`package`?Math.min(a,Math.max(80,t.width+20)):0}},`getUsecaseSystemBoundaryGeometry`),T={rect:_,squareRect:_,roundedWithTitle:y,noteGroup:v,divider:x,kanbanSection:b,flowGroup:C,usecaseSystemBoundary:e(async(e,i)=>{t.info(`Creating usecase system boundary for `,i.id,i);let p=a(),{theme:m,themeVariables:g,handDrawnSeed:_}=p,{clusterBkg:v,clusterBorder:y,borderColorArray:b}=g,{labelStyles:x,nodeStyles:S}=s(i),{stylesMap:C}=c(i),T=i.boundaryType||`rect`,E=e.insert(`g`).attr(`class`,`cluster usecase-system-boundary usecase-system-boundary-${T} ${i.cssClasses}`).attr(`id`,typeof i.domId==`string`?i.domId:i.id).attr(`data-boundary-type`,T).attr(`data-look`,i.look);u(E,i.colorIndex,m,b);let D=r(p),O=E.insert(`g`).attr(`class`,`cluster-label system-boundary-title`),k=await l(O,i.label,{style:x,useHtmlLabels:D,isNode:!0}),A=k.getBBox();if(D){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let{width:j,height:M,x:N,y:P,bodyY:F,bodyHeight:I,tabHeight:L,tabWidth:R}=w(i,A);i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let z=o(i,{fill:C.get(`fill`)||v,stroke:C.get(`stroke`)||y,strokeWidth:C.get(`stroke-width`)?.replace(`px`,``)||1,seed:_});if(i.look===`handDrawn`){let e=d.svg(E),t=e.rectangle(N,F,j,I,z);if(E.insert(()=>t,`:first-child`).attr(`class`,`boundary-body label-container`),T===`package`){let t=e.rectangle(N,P,R,L,z);E.insert(()=>t,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`)}}else E.insert(`rect`,`:first-child`).attr(`class`,`boundary-body label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,F).attr(`width`,j).attr(`height`,I),T===`package`&&E.insert(`rect`,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,P).attr(`width`,R).attr(`height`,L);let{subGraphTitleTopMargin:B}=h(p);return T===`package`?O.attr(`transform`,`translate(${N+(R-A.width)/2}, ${P+(L-A.height)/2})`):O.attr(`transform`,`translate(${i.x-A.width/2}, ${P+B})`),x&&(O.attr(`style`,x),O.select(`span`).attr(`style`,x)),i.offsetX=0,i.width=j,i.height=M,i.offsetY=A.height-i.padding/2,i.labelBBox=A,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`usecaseSystemBoundary`),swimlane:g},E=new Set([`noteGroup`,`divider`]),D=e(e=>!E.has(e??`rect`),`clusterPaintsTitle`),O=new Map,k=e(async(e,t)=>{let n=await T[t.shape||`rect`](e,t);return O.set(t.id,n),n},`insertCluster`),A=e(()=>{O=new Map},`clear`);export{D as n,k as r,A as t}; \ No newline at end of file diff --git a/web/dist/app-chunk-Z7XXMR3K.js b/web/dist/app-chunk-Z7XXMR3K.js index e9f53839b..0f6a3727e 100644 --- a/web/dist/app-chunk-Z7XXMR3K.js +++ b/web/dist/app-chunk-Z7XXMR3K.js @@ -1,10 +1,10 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{T as r,b as i,x as a}from"./app-chunk-O7XYJQB3.js";import{$ as o,J as s,K as c,Q as l,X as u,Y as d,Z as f,et as p,g as m,nt as h,q as g,rt as _,tt as v,u as y}from"./app-chunk-ZIGJFQKS.js";import{t as b}from"./app-line.js";import{n as x,r as S}from"./app-chunk-MBY4JIJT.js";import{i as C,n as ee}from"./app-chunk-7PRAP22T.js";import{t as te}from"./app-rough.esm.js";import{t as w}from"./app-chunk-7INBJB4K.js";import{n as T}from"./app-chunk-5DYCD2WN.js";var E=e((e,t)=>{if(t)return`translate(`+-e.width/2+`, `+-e.height/2+`)`;let n=e.x??0,r=e.y??0;return`translate(`+-(n+e.width/2)+`, `+-(r+e.height/2)+`)`},`computeLabelTransform`),D={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},O={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function k(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=A(e),t=A(t);let[n,r]=[e.x,e.y],[i,a]=[t.x,t.y],o=i-n,s=a-r;return{angle:Math.atan(s/o),deltaX:o,deltaY:s}}e(k,`calculateDeltaAndAngle`);var A=e(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,`pointTransformer`),ne=e(t=>({x:e(function(e,n,r){let i=0,a=A(r[0]).x=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(D,t.arrowTypeEnd)){let{angle:e,deltaX:n}=k(r[r.length-1],r[r.length-2]);i=D[t.arrowTypeEnd]*Math.cos(e)*(n>=0?1:-1)}let o=Math.abs(A(e).x-A(r[r.length-1]).x),s=Math.abs(A(e).y-A(r[r.length-1]).y),c=Math.abs(A(e).x-A(r[0]).x),l=Math.abs(A(e).y-A(r[0]).y),u=D[t.arrowTypeStart],d=D[t.arrowTypeEnd];if(o0&&s0&&l=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(D,t.arrowTypeEnd)){let{angle:e,deltaY:n}=k(r[r.length-1],r[r.length-2]);i=D[t.arrowTypeEnd]*Math.abs(Math.sin(e))*(n>=0?1:-1)}let o=Math.abs(A(e).y-A(r[r.length-1]).y),s=Math.abs(A(e).x-A(r[r.length-1]).x),c=Math.abs(A(e).y-A(r[0]).y),l=Math.abs(A(e).x-A(r[0]).x),u=D[t.arrowTypeStart],d=D[t.arrowTypeEnd];if(o0&&s0&&l{t.arrowTypeStart&&N(e,`start`,t.arrowTypeStart,n,r,i,a,o),t.arrowTypeEnd&&N(e,`end`,t.arrowTypeEnd,n,r,i,a,o)},`addEdgeMarkers`),j={arrow_cross:{type:`cross`,fill:!1},arrow_point:{type:`point`,fill:!0},arrow_barb:{type:`barb`,fill:!0},arrow_barb_neo:{type:`barb`,fill:!0},arrow_circle:{type:`circle`,fill:!1},arrow_hierarchy:{type:`hierarchy`,fill:!1},aggregation:{type:`aggregation`,fill:!1},extension:{type:`extension`,fill:!1},composition:{type:`composition`,fill:!0},dependency:{type:`dependency`,fill:!0},lollipop:{type:`lollipop`,fill:!1},only_one:{type:`onlyOne`,fill:!1},zero_or_one:{type:`zeroOrOne`,fill:!1},one_or_more:{type:`oneOrMore`,fill:!1},zero_or_more:{type:`zeroOrMore`,fill:!1},requirement_arrow:{type:`requirement_arrow`,fill:!1},requirement_contains:{type:`requirement_contains`,fill:!1}},M=[`cross`,`point`,`circle`,`lollipop`,`aggregation`,`extension`,`composition`,`dependency`,`barb`],N=e((e,n,r,i,a,o,s=!1,c)=>{if(!r||r===`none`)return;let l=j[r],u=l&&M.includes(l.type);if(!l){t.warn(`Unknown arrow type: ${r}`);return}let d=`${a}_${o}-${l.type}${n===`start`?`Start`:`End`}${s&&u?`-margin`:``}`;if(c&&c.trim()!==``){let t=`${d}_${c.replace(/[^\dA-Za-z]/g,`_`)}`;if(!document.getElementById(t)){let e=document.getElementById(d);if(e){let n=e.cloneNode(!0);n.id=t,n.querySelectorAll(`path, circle, line`).forEach(e=>{e.setAttribute(`stroke`,c),l.fill&&e.setAttribute(`fill`,c)}),e.parentNode?.appendChild(n)}}e.attr(`marker-${n}`,`url(${i}#${t})`)}else e.attr(`marker-${n}`,`url(${i}#${d})`)},`addEdgeMarker`),ie=e(e=>typeof e==`string`?e:a()?.flowchart?.curve,`resolveEdgeCurveType`),P=new Map,F=new Map,I=e(()=>{P.clear(),F.clear()},`clear`),L=e(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),`hasEdgeLabel`),R=e(e=>e?typeof e==`string`?e:e.reduce((e,t)=>e+`;`+t,``):``,`getLabelStyles`),ae=e(async(e,i)=>{let o=a(),s=r(o),{labelStyles:c}=C(i);i.labelStyle=c;let l=e.insert(`g`).attr(`class`,`edgeLabel`),u=l.insert(`g`).attr(`class`,`label`).attr(`data-id`,i.id),d=i.labelType===`markdown`,f=await x(e,i.label,{style:R(i.labelStyle),useHtmlLabels:s,addSvgBackground:!0,isNode:!1,markdown:d,width:void 0},o);u.node().appendChild(f),t.info(`abc82`,i,i.labelType);let p,m;if(s){let e=f.children[0],t=n(f);p=await S.measure(()=>e.getBoundingClientRect()),m=p,t.attr(`width`,p.width),t.attr(`height`,p.height)}else{let e=n(f).select(`text`).node();await S.measure(()=>{p=f.getBBox(),m=e&&typeof e.getBBox==`function`?e.getBBox():p})}u.attr(`transform`,E(m,s)),P.set(i.id,l),i.width=p.width,i.height=p.height;let h;if(i.startLabelLeft){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await w(r,i.startLabelLeft,R(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,E(o,s)),F.get(i.id)||F.set(i.id,{}),F.get(i.id).startLeft=t,z(h,i.startLabelLeft)}if(i.startLabelRight){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await w(r,i.startLabelRight,R(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,E(o,s)),F.get(i.id)||F.set(i.id,{}),F.get(i.id).startRight=t,z(h,i.startLabelRight)}if(i.endLabelLeft){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await w(t,i.endLabelLeft,R(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,E(o,s)),F.get(i.id)||F.set(i.id,{}),F.get(i.id).endLeft=t,z(h,i.endLabelLeft)}if(i.endLabelRight){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await w(t,i.endLabelRight,R(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,E(o,s)),F.get(i.id)||F.set(i.id,{}),F.get(i.id).endRight=t,z(h,i.endLabelRight)}return f},`insertEdgeLabel`);function z(e,t){r(a())&&e&&(e.style.width=t.length*9+`px`,e.style.height=`12px`)}e(z,`setTerminalWidth`);var B=e((e,n)=>{t.debug(`Moving label abc88 `,e.id,e.label,P.get(e.id),n);let r=n.updatedPath?n.updatedPath:n.originalPath,i=a(),{subGraphTitleTotalMargin:o}=T(i);if(e.label){let i=P.get(e.id),a=e.x,s=e.y;if(r){let i=m.calcLabelPosition(r);t.debug(`Moving label `+e.label+` from (`,a,`,`,s,`) to (`,i.x,`,`,i.y,`) abc88`),n.updatedPath&&(a=i.x,s=i.y)}i.attr(`transform`,`translate(${a}, ${s+o/2})`)}if(e.startLabelLeft){let t=F.get(e.id).startLeft,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.startLabelRight){let t=F.get(e.id).startRight,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.endLabelLeft){let t=F.get(e.id).endLeft,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.endLabelRight){let t=F.get(e.id).endRight,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}},`positionEdgeLabel`),oe=e((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith(`-to-label`)||!Array.isArray(t)||t.length!==2)return t;let[n,r]=t,i=Math.abs(r.x-n.x),a=Math.abs(r.y-n.y);return i<.001||a<.001?t:a>=i?[n,{x:n.x,y:r.y},r]:[n,{x:r.x,y:n.y},r]},`orthogonalizeToLabelClippedPoints`),V=e((e,t)=>{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),H=e((e,n,r)=>{t.debug(`intersection calc abc89: +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{T as r,b as i,x as a}from"./app-chunk-O7XYJQB3.js";import{$ as o,J as s,K as c,Q as l,X as u,Y as d,Z as f,et as p,g as m,nt as h,q as g,rt as _,tt as v,u as y}from"./app-chunk-ZIGJFQKS.js";import{t as b}from"./app-line.js";import{i as x,n as S}from"./app-chunk-7PRAP22T.js";import{n as C,r as w}from"./app-chunk-MBY4JIJT.js";import{t as ee}from"./app-rough.esm.js";import{t as T}from"./app-chunk-7INBJB4K.js";import{n as E}from"./app-chunk-5DYCD2WN.js";var D=e((e,t)=>{if(t)return`translate(`+-e.width/2+`, `+-e.height/2+`)`;let n=e.x??0,r=e.y??0;return`translate(`+-(n+e.width/2)+`, `+-(r+e.height/2)+`)`},`computeLabelTransform`),O={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},k={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function A(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=j(e),t=j(t);let[n,r]=[e.x,e.y],[i,a]=[t.x,t.y],o=i-n,s=a-r;return{angle:Math.atan(s/o),deltaX:o,deltaY:s}}e(A,`calculateDeltaAndAngle`);var j=e(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,`pointTransformer`),te=e(t=>({x:e(function(e,n,r){let i=0,a=j(r[0]).x=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(O,t.arrowTypeEnd)){let{angle:e,deltaX:n}=A(r[r.length-1],r[r.length-2]);i=O[t.arrowTypeEnd]*Math.cos(e)*(n>=0?1:-1)}let o=Math.abs(j(e).x-j(r[r.length-1]).x),s=Math.abs(j(e).y-j(r[r.length-1]).y),c=Math.abs(j(e).x-j(r[0]).x),l=Math.abs(j(e).y-j(r[0]).y),u=O[t.arrowTypeStart],d=O[t.arrowTypeEnd];if(o0&&s0&&l=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(O,t.arrowTypeEnd)){let{angle:e,deltaY:n}=A(r[r.length-1],r[r.length-2]);i=O[t.arrowTypeEnd]*Math.abs(Math.sin(e))*(n>=0?1:-1)}let o=Math.abs(j(e).y-j(r[r.length-1]).y),s=Math.abs(j(e).x-j(r[r.length-1]).x),c=Math.abs(j(e).y-j(r[0]).y),l=Math.abs(j(e).x-j(r[0]).x),u=O[t.arrowTypeStart],d=O[t.arrowTypeEnd];if(o0&&s0&&l{t.arrowTypeStart&&P(e,`start`,t.arrowTypeStart,n,r,i,a,o),t.arrowTypeEnd&&P(e,`end`,t.arrowTypeEnd,n,r,i,a,o)},`addEdgeMarkers`),M={arrow_cross:{type:`cross`,fill:!1},arrow_point:{type:`point`,fill:!0},arrow_barb:{type:`barb`,fill:!0},arrow_barb_neo:{type:`barb`,fill:!0},arrow_circle:{type:`circle`,fill:!1},arrow_hierarchy:{type:`hierarchy`,fill:!1},aggregation:{type:`aggregation`,fill:!1},extension:{type:`extension`,fill:!1},composition:{type:`composition`,fill:!0},dependency:{type:`dependency`,fill:!0},lollipop:{type:`lollipop`,fill:!1},only_one:{type:`onlyOne`,fill:!1},zero_or_one:{type:`zeroOrOne`,fill:!1},one_or_more:{type:`oneOrMore`,fill:!1},zero_or_more:{type:`zeroOrMore`,fill:!1},requirement_arrow:{type:`requirement_arrow`,fill:!1},requirement_contains:{type:`requirement_contains`,fill:!1}},N=[`cross`,`point`,`circle`,`lollipop`,`aggregation`,`extension`,`composition`,`dependency`,`barb`],P=e((e,n,r,i,a,o,s=!1,c)=>{if(!r||r===`none`)return;let l=M[r],u=l&&N.includes(l.type);if(!l){t.warn(`Unknown arrow type: ${r}`);return}let d=`${a}_${o}-${l.type}${n===`start`?`Start`:`End`}${s&&u?`-margin`:``}`;if(c&&c.trim()!==``){let t=`${d}_${c.replace(/[^\dA-Za-z]/g,`_`)}`;if(!document.getElementById(t)){let e=document.getElementById(d);if(e){let n=e.cloneNode(!0);n.id=t,n.querySelectorAll(`path, circle, line`).forEach(e=>{e.setAttribute(`stroke`,c),l.fill&&e.setAttribute(`fill`,c)}),e.parentNode?.appendChild(n)}}e.attr(`marker-${n}`,`url(${i}#${t})`)}else e.attr(`marker-${n}`,`url(${i}#${d})`)},`addEdgeMarker`),re=e(e=>typeof e==`string`?e:a()?.flowchart?.curve,`resolveEdgeCurveType`),F=new Map,I=new Map,L=e(()=>{F.clear(),I.clear()},`clear`),R=e(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),`hasEdgeLabel`),z=e(e=>e?typeof e==`string`?e:e.reduce((e,t)=>e+`;`+t,``):``,`getLabelStyles`),ie=e(async(e,i)=>{let o=a(),s=r(o),{labelStyles:c}=x(i);i.labelStyle=c;let l=e.insert(`g`).attr(`class`,`edgeLabel`),u=l.insert(`g`).attr(`class`,`label`).attr(`data-id`,i.id),d=i.labelType===`markdown`,f=await C(e,i.label,{style:z(i.labelStyle),useHtmlLabels:s,addSvgBackground:!0,isNode:!1,markdown:d,width:void 0},o);u.node().appendChild(f),t.info(`abc82`,i,i.labelType);let p,m;if(s){let e=f.children[0],t=n(f);p=await w.measure(()=>e.getBoundingClientRect()),m=p,t.attr(`width`,p.width),t.attr(`height`,p.height)}else{let e=n(f).select(`text`).node();await w.measure(()=>{p=f.getBBox(),m=e&&typeof e.getBBox==`function`?e.getBBox():p})}u.attr(`transform`,D(m,s)),F.set(i.id,l),i.width=p.width,i.height=p.height;let h;if(i.startLabelLeft){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await T(r,i.startLabelLeft,z(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,D(o,s)),I.get(i.id)||I.set(i.id,{}),I.get(i.id).startLeft=t,B(h,i.startLabelLeft)}if(i.startLabelRight){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await T(r,i.startLabelRight,z(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,D(o,s)),I.get(i.id)||I.set(i.id,{}),I.get(i.id).startRight=t,B(h,i.startLabelRight)}if(i.endLabelLeft){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await T(t,i.endLabelLeft,z(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,D(o,s)),I.get(i.id)||I.set(i.id,{}),I.get(i.id).endLeft=t,B(h,i.endLabelLeft)}if(i.endLabelRight){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await T(t,i.endLabelRight,z(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,D(o,s)),I.get(i.id)||I.set(i.id,{}),I.get(i.id).endRight=t,B(h,i.endLabelRight)}return f},`insertEdgeLabel`);function B(e,t){r(a())&&e&&(e.style.width=t.length*9+`px`,e.style.height=`12px`)}e(B,`setTerminalWidth`);var V=e((e,n)=>{t.debug(`Moving label abc88 `,e.id,e.label,F.get(e.id),n);let r=n.updatedPath?n.updatedPath:n.originalPath,i=a(),{subGraphTitleTotalMargin:o}=E(i);if(e.label){let i=F.get(e.id),a=e.x,s=e.y;if(r){let i=m.calcLabelPosition(r);t.debug(`Moving label `+e.label+` from (`,a,`,`,s,`) to (`,i.x,`,`,i.y,`) abc88`),n.updatedPath&&(a=i.x,s=i.y)}i.attr(`transform`,`translate(${a}, ${s+o/2})`)}if(e.startLabelLeft){let t=I.get(e.id).startLeft,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.startLabelRight){let t=I.get(e.id).startRight,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.endLabelLeft){let t=I.get(e.id).endLeft,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.endLabelRight){let t=I.get(e.id).endRight,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}},`positionEdgeLabel`),ae=e((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith(`-to-label`)||!Array.isArray(t)||t.length!==2)return t;let[n,r]=t,i=Math.abs(r.x-n.x),a=Math.abs(r.y-n.y);return i<.001||a<.001?t:a>=i?[n,{x:n.x,y:r.y},r]:[n,{x:r.x,y:n.y},r]},`orthogonalizeToLabelClippedPoints`),H=e((e,t)=>{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),U=e((e,n,r)=>{t.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(n)} insidePoint : ${JSON.stringify(r)} - node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let i=e.x,a=e.y,o=Math.abs(i-r.x),s=e.width/2,c=r.xMath.abs(i-n.x)*l){let e=r.y{t.warn(`abc88 cutPathAtIntersect`,e,n);let r=[],i=e[0],a=!1;return e.forEach(e=>{if(t.info(`abc88 checking point`,e,n),!V(n,e)&&!a){let o=H(n,i,e);t.debug(`abc88 inside`,e,i,o),t.debug(`abc88 intersection`,o,n);let s=!1;r.forEach(e=>{s||=e.x===o.x&&e.y===o.y}),r.some(e=>e.x===o.x&&e.y===o.y)?t.warn(`abc88 no intersect`,o,r):r.push(o),a=!0}else t.warn(`abc88 outside`,e,i),i=e,a||r.push(e)}),t.debug(`returning points`,r),r},`cutPathAtIntersect`);function W(e){let t=[],n=[];for(let r=1;r5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),n.push(r))}return{cornerPoints:t,cornerPointPositions:n}}e(W,`extractCornerPoints`);var G=e(function(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=n/Math.sqrt(r*r+i*i);return{x:t.x-a*r,y:t.y-a*i}},`findAdjacentPoint`),se=e(function(e){let{cornerPointPositions:n}=W(e),r=[];for(let i=0;i10&&Math.abs(a.y-n.y)>=10?(t.debug(`Corner point fixing`,Math.abs(a.x-n.x),Math.abs(a.y-n.y)),f=o.x===s.x?{x:l<0?s.x-5+d:s.x+5-d,y:u<0?s.y-d:s.y+d}:{x:l<0?s.x-d:s.x+d,y:u<0?s.y-5+d:s.y+5-d}):t.debug(`Corner point skipping fixing`,Math.abs(a.x-n.x),Math.abs(a.y-n.y)),r.push(f,c)}else r.push(e[i]);return r},`fixCorners`),ce=e((e,t,n)=>{let r=e-t-n,i=Math.floor(r/4);return`0 ${t} ${Array(Number.isFinite(i)?Math.max(0,i):0).fill(`2 2`).join(` `)} ${n}`},`generateDashArray`),K=e(function(e,r,i,x,S,C,w,T=!1){if(!w)throw Error(`insertEdge: missing diagramId for edge "${r.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:E,layout:D}=a(),k=r.points,A=!1,j=S;var M=C;let N=[];for(let e in r.cssCompiledStyles)ee(e)||N.push(r.cssCompiledStyles[e]);if(D===`swimlane`){if(M.intersect&&j.intersect&&Array.isArray(k)&&k.length>=2)if(k.length===2)k=[j.intersect(k[0]),M.intersect(k[1])];else{let e=k.slice(1,-1),t=e[0],n=e[e.length-1],r=.5,i=Math.abs(k[k.length-1].x-n.x)!Number.isNaN(e.y)),I=ie(r.curve);I!==`rounded`&&(F=se(F));let L=_;switch(I){case`linear`:L=_;break;case`basis`:L=p;break;case`cardinal`:L=o;break;case`bumpX`:L=v;break;case`bumpY`:L=h;break;case`catmullRom`:L=l;break;case`monotoneX`:L=u;break;case`monotoneY`:L=f;break;case`natural`:L=d;break;case`step`:L=s;break;case`stepAfter`:L=c;break;case`stepBefore`:L=g;break;case`rounded`:L=_;break;default:L=p}let{x:R,y:ae}=ne(r),z=b().x(R).y(ae).curve(L),B;switch(r.thickness){case`normal`:B=`edge-thickness-normal`;break;case`thick`:B=`edge-thickness-thick`;break;case`invisible`:B=`edge-thickness-invisible`;break;default:B=`edge-thickness-normal`}switch(r.pattern){case`solid`:B+=` edge-pattern-solid`;break;case`dotted`:B+=` edge-pattern-dotted`;break;case`dashed`:B+=` edge-pattern-dashed`;break;default:B+=` edge-pattern-solid`}let V,H=I===`rounded`?q(Y(F,r),5):z(F),W=Array.isArray(r.style)?r.style:[r.style],G=W.find(e=>e?.startsWith(`stroke:`)),K=``;r.animate&&(K=`edge-animation-fast`),r.animation&&(K=`edge-animation-`+r.animation);let J=!1;if(r.look===`handDrawn`){let t=te.svg(e);Object.assign([],F);let i=t.path(H,{roughness:.3,seed:E});B+=` transition`,V=n(i).select(`path`).attr(`id`,`${w}-${r.id}`).attr(`class`,` `+B+(r.classes?` `+r.classes:``)+(K?` `+K:``)).attr(`style`,W?W.reduce((e,t)=>e+`;`+t,``):``);let a=V.attr(`d`);V.attr(`d`,a),e.node().appendChild(V.node())}else{let t=N.join(`;`),n=W?W.reduce((e,t)=>e+t+`;`,``):``,i=(t?t+`;`+n+`;`:n)+`;`+(W?W.reduce((e,t)=>e+`;`+t,``):``);V=e.append(`path`).attr(`d`,H).attr(`id`,`${w}-${r.id}`).attr(`class`,` `+B+(r.classes?` `+r.classes:``)+(K?` `+K:``)).attr(`style`,i),G=i.match(/stroke:([^;]+)/)?.[1],J=r.animate===!0||!!r.animation||t.includes(`animation`);let a=V.node(),o=typeof a.getTotalLength==`function`?a.getTotalLength():0,s=O[r.arrowTypeStart]||0,c=O[r.arrowTypeEnd]||0;if(r.look===`neo`&&!J){let e=`stroke-dasharray: ${r.pattern===`dotted`||r.pattern===`dashed`?ce(o,s,c):`0 ${s} ${o-s-c} ${c}`}; stroke-dashoffset: 0;`;V.attr(`style`,e+V.attr(`style`))}}V.attr(`data-edge`,!0),V.attr(`data-et`,`edge`),V.attr(`data-id`,r.id),V.attr(`data-points`,P),V.attr(`data-look`,y(r.look)),r.showPoints&&F.forEach(t=>{e.append(`circle`).style(`stroke`,`red`).style(`fill`,`red`).attr(`r`,1).attr(`cx`,t.x).attr(`cy`,t.y)});let X=``;(a().flowchart.arrowMarkerAbsolute||a().state.arrowMarkerAbsolute)&&(X=window.location.protocol+`//`+window.location.host+window.location.pathname+window.location.search,X=X.replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)),t.info(`arrowTypeStart`,r.arrowTypeStart),t.info(`arrowTypeEnd`,r.arrowTypeEnd);let Z=!J&&r?.look===`neo`;re(V,r,X,w,x,Z,G);let Q=Math.floor(k.length/2),le=k[Q];m.isLabelCoordinateInPath(le,V.attr(`d`))||(A=!0);let $={};return A&&($.updatedPath=k),$.originalPath=r.points,$},`insertEdge`);function q(e,t){if(e.length<2)return``;let n=``,r=e.length,i=1e-5;for(let a=0;a({...e}));if(e.length>=2&&D[t.arrowTypeStart]){let r=D[t.arrowTypeStart],i=e[0],a=e[1],{angle:o}=J(i,a),s=r*Math.cos(o),c=r*Math.sin(o);n[0].x=i.x+s,n[0].y=i.y+c}let r=e.length;if(r>=2&&D[t.arrowTypeEnd]){let i=D[t.arrowTypeEnd],a=e[r-1],o=e[r-2],{angle:s}=J(o,a),c=i*Math.cos(s),l=i*Math.sin(s);n[r-1].x=a.x-c,n[r-1].y=a.y-l}return n}e(Y,`applyMarkerOffsetsToPoints`);var X=e((e,t,n,r)=>{t.forEach(t=>{Z[t](e,n,r)})},`insertMarkers`),Z={extension:e((e,n,r)=>{t.trace(`Making markers for `,r),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionStart`).attr(`class`,`marker extension `+n).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,7 L18,13 V 1 Z`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionEnd`).attr(`class`,`marker extension `+n).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,1 V 13 L18,7 Z`),e.append(`marker`).attr(`id`,r+`_`+n+`-extensionStart-margin`).attr(`class`,`marker extension `+n).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,7 18,13 18,1`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionEnd-margin`).attr(`class`,`marker extension `+n).attr(`refX`,9).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,1 10,13 18,7`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`)},`extension`),composition:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart`).attr(`class`,`marker composition `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd`).attr(`class`,`marker composition `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart-margin`).attr(`class`,`marker composition `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`viewBox`,`0 0 15 15`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd-margin`).attr(`class`,`marker composition `+t).attr(`refX`,3.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`composition`),aggregation:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart`).attr(`class`,`marker aggregation `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`aggregation`),dependency:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart`).attr(`class`,`marker dependency `+t).attr(`refX`,6).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd`).attr(`class`,`marker dependency `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,4).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,16).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`dependency`),lollipop:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2)},`lollipop`),point:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,4.5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 5 L 10 10 L 10 0 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,11.5).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,10.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 11.5 7 L 0 14 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,1).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0,7 11.5,14 11.5,0`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`point`),circle:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,11).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-1).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refY`,5).attr(`refX`,12.25).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`circle`),cross:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,12).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,-1).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,17.7).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,-3.5).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5).style(`stroke-dasharray`,`1,0`)},`cross`),barb:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`barb`),barbNeo:e((e,t,n)=>{let{themeVariables:r}=i(),{transitionColor:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd-margin`).attr(`refX`,17).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`).attr(`fill`,`${a}`)},`barbNeo`),hierarchy:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-hierarchyEnd`).attr(`class`,`marker hierarchy `+t).attr(`viewBox`,`0 0 12 10`).attr(`refX`,10).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,10).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`).style(`fill`,`none`),e.append(`marker`).attr(`id`,n+`_`+t+`-hierarchyStart`).attr(`class`,`marker hierarchy `+t).attr(`viewBox`,`0 0 12 10`).attr(`refX`,2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,10).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`).style(`fill`,`none`)},`hierarchy`),only_one:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`)},`only_one`),zero_or_one:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,21).attr(`cy`,9).attr(`r`,6),r.append(`path`).attr(`d`,`M9,0 L9,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,9).attr(`r`,6),i.append(`path`).attr(`d`,`M21,0 L21,18`)},`zero_or_one`),one_or_more:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`)},`one_or_more`),zero_or_more:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,48).attr(`cy`,18).attr(`r`,6),r.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,18).attr(`r`,6),i.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`)},`zero_or_more`),only_one_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`).attr(`stroke-width`,`${a}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`).attr(`stroke-width`,`${a}`)},`only_one_neo`),zero_or_one_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a,mainBkg:o}=r,s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);s.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,21).attr(`cy`,9).attr(`stroke-width`,`${a}`).attr(`r`,6),s.append(`path`).attr(`d`,`M9,0 L9,18`).attr(`stroke-width`,`${a}`);let c=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);c.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,9).attr(`cy`,9).attr(`stroke-width`,`${a}`).attr(`r`,6),c.append(`path`).attr(`d`,`M21,0 L21,18`).attr(`stroke-width`,`${a}`)},`zero_or_one_neo`),one_or_more_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`).attr(`stroke-width`,`${a}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`).attr(`stroke-width`,`${a}`)},`one_or_more_neo`),zero_or_more_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a,mainBkg:o}=r,s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);s.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,45.5).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${a}`),s.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`).attr(`stroke-width`,`${a}`);let c=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);c.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,11).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${a}`),c.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`).attr(`stroke-width`,`${a}`)},`zero_or_more_neo`),requirement_arrow:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,0 + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let i=e.x,a=e.y,o=Math.abs(i-r.x),s=e.width/2,c=r.xMath.abs(i-n.x)*l){let e=r.y{t.warn(`abc88 cutPathAtIntersect`,e,n);let r=[],i=e[0],a=!1;return e.forEach(e=>{if(t.info(`abc88 checking point`,e,n),!H(n,e)&&!a){let o=U(n,i,e);t.debug(`abc88 inside`,e,i,o),t.debug(`abc88 intersection`,o,n);let s=!1;r.forEach(e=>{s||=e.x===o.x&&e.y===o.y}),r.some(e=>e.x===o.x&&e.y===o.y)?t.warn(`abc88 no intersect`,o,r):r.push(o),a=!0}else t.warn(`abc88 outside`,e,i),i=e,a||r.push(e)}),t.debug(`returning points`,r),r},`cutPathAtIntersect`);function G(e){let t=[],n=[];for(let r=1;r5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),n.push(r))}return{cornerPoints:t,cornerPointPositions:n}}e(G,`extractCornerPoints`);var K=e(function(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=n/Math.sqrt(r*r+i*i);return{x:t.x-a*r,y:t.y-a*i}},`findAdjacentPoint`),oe=e(function(e){let{cornerPointPositions:n}=G(e),r=[];for(let i=0;i10&&Math.abs(a.y-n.y)>=10?(t.debug(`Corner point fixing`,Math.abs(a.x-n.x),Math.abs(a.y-n.y)),f=o.x===s.x?{x:l<0?s.x-5+d:s.x+5-d,y:u<0?s.y-d:s.y+d}:{x:l<0?s.x-d:s.x+d,y:u<0?s.y-5+d:s.y+5-d}):t.debug(`Corner point skipping fixing`,Math.abs(a.x-n.x),Math.abs(a.y-n.y)),r.push(f,c)}else r.push(e[i]);return r},`fixCorners`),se=e((e,t,n)=>{let r=e-t-n,i=Math.floor(r/4);return`0 ${t} ${Array(Number.isFinite(i)?Math.max(0,i):0).fill(`2 2`).join(` `)} ${n}`},`generateDashArray`),q=e(function(e,r,i,x,C,w,T,E=!1){if(!T)throw Error(`insertEdge: missing diagramId for edge "${r.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:D,layout:O}=a(),A=r.points,j=!1,M=C;var N=w;let P=[];for(let e in r.cssCompiledStyles)S(e)||P.push(r.cssCompiledStyles[e]);if(O===`swimlane`){if(N.intersect&&M.intersect&&Array.isArray(A)&&A.length>=2)if(A.length===2)A=[M.intersect(A[0]),N.intersect(A[1])];else{let e=A.slice(1,-1),t=e[0],n=e[e.length-1],r=.5,i=Math.abs(A[A.length-1].x-n.x)!Number.isNaN(e.y)),L=re(r.curve);L!==`rounded`&&(I=oe(I));let R=_;switch(L){case`linear`:R=_;break;case`basis`:R=p;break;case`cardinal`:R=o;break;case`bumpX`:R=v;break;case`bumpY`:R=h;break;case`catmullRom`:R=l;break;case`monotoneX`:R=u;break;case`monotoneY`:R=f;break;case`natural`:R=d;break;case`step`:R=s;break;case`stepAfter`:R=c;break;case`stepBefore`:R=g;break;case`rounded`:R=_;break;default:R=p}let{x:z,y:ie}=te(r),B=b().x(z).y(ie).curve(R),V;switch(r.thickness){case`normal`:V=`edge-thickness-normal`;break;case`thick`:V=`edge-thickness-thick`;break;case`invisible`:V=`edge-thickness-invisible`;break;default:V=`edge-thickness-normal`}switch(r.pattern){case`solid`:V+=` edge-pattern-solid`;break;case`dotted`:V+=` edge-pattern-dotted`;break;case`dashed`:V+=` edge-pattern-dashed`;break;default:V+=` edge-pattern-solid`}let H,U=L===`rounded`?J(X(I,r),5):B(I),G=Array.isArray(r.style)?r.style:[r.style],K=G.find(e=>e?.startsWith(`stroke:`)),q=``;r.animate&&(q=`edge-animation-fast`),r.animation&&(q=`edge-animation-`+r.animation);let Y=!1;if(r.look===`handDrawn`){let t=ee.svg(e);Object.assign([],I);let i=t.path(U,{roughness:.3,seed:D});V+=` transition`,H=n(i).select(`path`).attr(`id`,`${T}-${r.id}`).attr(`class`,` `+V+(r.classes?` `+r.classes:``)+(q?` `+q:``)).attr(`style`,G?G.reduce((e,t)=>e+`;`+t,``):``);let a=H.attr(`d`);H.attr(`d`,a),e.node().appendChild(H.node())}else{let t=P.join(`;`),n=G?G.reduce((e,t)=>e+t+`;`,``):``,i=(t?t+`;`+n+`;`:n)+`;`+(G?G.reduce((e,t)=>e+`;`+t,``):``);H=e.append(`path`).attr(`d`,U).attr(`id`,`${T}-${r.id}`).attr(`class`,` `+V+(r.classes?` `+r.classes:``)+(q?` `+q:``)).attr(`style`,i),K=i.match(/stroke:([^;]+)/)?.[1],Y=r.animate===!0||!!r.animation||t.includes(`animation`);let a=H.node(),o=typeof a.getTotalLength==`function`?a.getTotalLength():0,s=k[r.arrowTypeStart]||0,c=k[r.arrowTypeEnd]||0;if(r.look===`neo`&&!Y){let e=`stroke-dasharray: ${r.pattern===`dotted`||r.pattern===`dashed`?se(o,s,c):`0 ${s} ${o-s-c} ${c}`}; stroke-dashoffset: 0;`;H.attr(`style`,e+H.attr(`style`))}}H.attr(`data-edge`,!0),H.attr(`data-et`,`edge`),H.attr(`data-id`,r.id),H.attr(`data-points`,F),H.attr(`data-look`,y(r.look)),r.showPoints&&I.forEach(t=>{e.append(`circle`).style(`stroke`,`red`).style(`fill`,`red`).attr(`r`,1).attr(`cx`,t.x).attr(`cy`,t.y)});let Z=``;(a().flowchart.arrowMarkerAbsolute||a().state.arrowMarkerAbsolute)&&(Z=window.location.protocol+`//`+window.location.host+window.location.pathname+window.location.search,Z=Z.replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)),t.info(`arrowTypeStart`,r.arrowTypeStart),t.info(`arrowTypeEnd`,r.arrowTypeEnd);let Q=!Y&&r?.look===`neo`;ne(H,r,Z,T,x,Q,K);let ce=Math.floor(A.length/2),le=A[ce];m.isLabelCoordinateInPath(le,H.attr(`d`))||(j=!0);let $={};return j&&($.updatedPath=A),$.originalPath=r.points,$},`insertEdge`);function J(e,t){if(e.length<2)return``;let n=``,r=e.length,i=1e-5;for(let a=0;a({...e}));if(e.length>=2&&O[t.arrowTypeStart]){let r=O[t.arrowTypeStart],i=e[0],a=e[1],{angle:o}=Y(i,a),s=r*Math.cos(o),c=r*Math.sin(o);n[0].x=i.x+s,n[0].y=i.y+c}let r=e.length;if(r>=2&&O[t.arrowTypeEnd]){let i=O[t.arrowTypeEnd],a=e[r-1],o=e[r-2],{angle:s}=Y(o,a),c=i*Math.cos(s),l=i*Math.sin(s);n[r-1].x=a.x-c,n[r-1].y=a.y-l}return n}e(X,`applyMarkerOffsetsToPoints`);var Z=e((e,t,n,r)=>{t.forEach(t=>{Q[t](e,n,r)})},`insertMarkers`),Q={extension:e((e,n,r)=>{t.trace(`Making markers for `,r),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionStart`).attr(`class`,`marker extension `+n).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,7 L18,13 V 1 Z`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionEnd`).attr(`class`,`marker extension `+n).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,1 V 13 L18,7 Z`),e.append(`marker`).attr(`id`,r+`_`+n+`-extensionStart-margin`).attr(`class`,`marker extension `+n).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,7 18,13 18,1`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionEnd-margin`).attr(`class`,`marker extension `+n).attr(`refX`,9).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,1 10,13 18,7`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`)},`extension`),composition:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart`).attr(`class`,`marker composition `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd`).attr(`class`,`marker composition `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart-margin`).attr(`class`,`marker composition `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`viewBox`,`0 0 15 15`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd-margin`).attr(`class`,`marker composition `+t).attr(`refX`,3.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`composition`),aggregation:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart`).attr(`class`,`marker aggregation `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`aggregation`),dependency:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart`).attr(`class`,`marker dependency `+t).attr(`refX`,6).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd`).attr(`class`,`marker dependency `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,4).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,16).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`dependency`),lollipop:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2)},`lollipop`),point:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,4.5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 5 L 10 10 L 10 0 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,11.5).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,10.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 11.5 7 L 0 14 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,1).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0,7 11.5,14 11.5,0`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`point`),circle:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,11).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-1).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refY`,5).attr(`refX`,12.25).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`circle`),cross:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,12).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,-1).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,17.7).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,-3.5).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5).style(`stroke-dasharray`,`1,0`)},`cross`),barb:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`barb`),barbNeo:e((e,t,n)=>{let{themeVariables:r}=i(),{transitionColor:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd-margin`).attr(`refX`,17).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`).attr(`fill`,`${a}`)},`barbNeo`),hierarchy:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-hierarchyEnd`).attr(`class`,`marker hierarchy `+t).attr(`viewBox`,`0 0 12 10`).attr(`refX`,10).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,10).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`).style(`fill`,`none`),e.append(`marker`).attr(`id`,n+`_`+t+`-hierarchyStart`).attr(`class`,`marker hierarchy `+t).attr(`viewBox`,`0 0 12 10`).attr(`refX`,2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,10).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`).style(`fill`,`none`)},`hierarchy`),only_one:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`)},`only_one`),zero_or_one:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,21).attr(`cy`,9).attr(`r`,6),r.append(`path`).attr(`d`,`M9,0 L9,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,9).attr(`r`,6),i.append(`path`).attr(`d`,`M21,0 L21,18`)},`zero_or_one`),one_or_more:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`)},`one_or_more`),zero_or_more:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,48).attr(`cy`,18).attr(`r`,6),r.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,18).attr(`r`,6),i.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`)},`zero_or_more`),only_one_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`).attr(`stroke-width`,`${a}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`).attr(`stroke-width`,`${a}`)},`only_one_neo`),zero_or_one_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a,mainBkg:o}=r,s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);s.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,21).attr(`cy`,9).attr(`stroke-width`,`${a}`).attr(`r`,6),s.append(`path`).attr(`d`,`M9,0 L9,18`).attr(`stroke-width`,`${a}`);let c=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);c.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,9).attr(`cy`,9).attr(`stroke-width`,`${a}`).attr(`r`,6),c.append(`path`).attr(`d`,`M21,0 L21,18`).attr(`stroke-width`,`${a}`)},`zero_or_one_neo`),one_or_more_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`).attr(`stroke-width`,`${a}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`).attr(`stroke-width`,`${a}`)},`one_or_more_neo`),zero_or_more_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a,mainBkg:o}=r,s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);s.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,45.5).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${a}`),s.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`).attr(`stroke-width`,`${a}`);let c=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);c.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,11).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${a}`),c.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`).attr(`stroke-width`,`${a}`)},`zero_or_more_neo`),requirement_arrow:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,0 L20,10 M20,10 L0,20`)},`requirement_arrow`),requirement_contains:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`g`);r.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),r.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),r.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10)},`requirement_contains`),requirement_arrow_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`stroke-width`,`${a}`).attr(`viewBox`,`0 0 25 20`).append(`path`).attr(`d`,`M0,0 L20,10 M20,10 - L0,20`).attr(`stroke-linejoin`,`miter`)},`requirement_arrow_neo`),requirement_contains_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r,o=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`g`);o.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),o.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),o.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10),o.selectAll(`*`).attr(`stroke-width`,`${a}`)},`requirement_contains_neo`)},Q=X;export{ae as a,Q as c,K as i,B as l,P as n,D as o,L as r,O as s,I as t,F as u}; \ No newline at end of file + L0,20`).attr(`stroke-linejoin`,`miter`)},`requirement_arrow_neo`),requirement_contains_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r,o=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`g`);o.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),o.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),o.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10),o.selectAll(`*`).attr(`stroke-width`,`${a}`)},`requirement_contains_neo`)},ce=Z;export{ie as a,ce as c,q as i,V as l,F as n,O as o,R as r,k as s,L as t,I as u}; \ No newline at end of file diff --git a/web/dist/app-classDiagram-v2-NBCMYWYE.js b/web/dist/app-classDiagram-v2-NBCMYWYE.js index 2bdce788e..af4720c61 100644 --- a/web/dist/app-classDiagram-v2-NBCMYWYE.js +++ b/web/dist/app-classDiagram-v2-NBCMYWYE.js @@ -1,9 +1,9 @@ -import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,M as a,U as o,a as s,q as c,s as l,v as u,w as d,x as f,y as p,z as m}from"./app-chunk-O7XYJQB3.js";import{c as h,g}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{t as _}from"./app-chunk-5VM5RSS4.js";import"./app-chunk-7PRAP22T.js";import{i as v,n as y,o as b,r as x}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import{t as S}from"./app-chunk-GWA4HPMP.js";import{t as C}from"./app-chunk-XXDRQBXY.js";import{t as w}from"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import{r as T,t as E}from"./app-chunk-GNY47TPC.js";var D=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,18],r=[1,19],i=[1,20],a=[1,41],o=[1,26],s=[1,42],c=[1,24],l=[1,25],u=[1,32],d=[1,33],f=[1,34],p=[1,45],m=[1,35],h=[1,36],g=[1,37],_=[1,38],v=[1,27],y=[1,28],b=[1,29],x=[1,30],S=[1,31],C=[1,44],w=[1,46],T=[1,43],E=[1,47],D=[1,9],O=[1,8,9],k=[1,58],A=[1,59],j=[1,60],M=[1,61],N=[1,62],P=[1,63],F=[1,64],I=[1,8,9,41],ee=[1,77],L=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],R=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],z=[13,60,86,100,102,103],B=[13,60,73,74,86,100,102,103],te=[13,60,68,69,70,71,72,86,100,102,103],V=[1,103],H=[1,121],U=[1,117],W=[1,113],G=[1,119],K=[1,114],q=[1,115],J=[1,116],Y=[1,118],X=[1,120],ne=[22,50,60,61,82,86,87,88,89,90],re=[1,128],Z=[12,39],ie=[1,8,9,39,41,44,46],Q=[1,8,9,22],ae=[1,153],oe=[1,8,9,61],$=[1,8,9,22,50,60,61,82,86,87,88,89,90],se={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:`error`,7:`CLASS_DIAGRAM`,8:`NEWLINE`,9:`EOF`,12:`SQS`,13:`STR`,14:`SQE`,18:`DOT`,20:`GENERICTYPE`,22:`LABEL`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,39:`STRUCT_START`,41:`STRUCT_STOP`,42:`NAMESPACE`,44:`STYLE_SEPARATOR`,46:`ANNOTATION_START`,47:`ANNOTATION_END`,48:`CLASS`,50:`SPACE`,51:`MEMBER`,52:`SEPARATOR`,54:`NOTE_FOR`,56:`NOTE`,57:`CLASSDEF`,60:`ALPHA`,61:`COMMA`,62:`direction_tb`,63:`direction_bt`,64:`direction_rl`,65:`direction_lr`,68:`AGGREGATION`,69:`EXTENSION`,70:`COMPOSITION`,71:`DEPENDENCY`,72:`LOLLIPOP`,73:`LINE`,74:`DOTTED_LINE`,75:`CALLBACK`,76:`LINK`,77:`LINK_TARGET`,78:`CLICK`,79:`CALLBACK_NAME`,80:`CALLBACK_ARGS`,81:`HREF`,82:`STYLE`,83:`CSSCLASS`,86:`NUM`,87:`COLON`,88:`UNIT`,89:`BRKT`,90:`PCT`,93:`graphCodeTokens`,95:`TAGSTART`,96:`TAGEND`,97:`==`,98:`--`,99:`DEFAULT`,100:`MINUS`,101:`keywords`,102:`UNICODE_TEXT`,103:`BQUOTE_STR`},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 8:this.$=a[s-1];break;case 9:case 10:case 13:case 15:this.$=a[s];break;case 11:case 14:this.$=a[s-2]+`.`+a[s];break;case 12:case 16:this.$=a[s-1]+a[s];break;case 17:case 18:this.$=a[s-1]+`~`+a[s]+`~`;break;case 19:r.addRelation(a[s]);break;case 20:a[s-1].title=r.cleanupLabel(a[s]),r.addRelation(a[s-1]);break;case 31:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 34:r.addClassesToNamespace(a[s-3],a[s-1][0],a[s-1][1]),r.popNamespace();break;case 35:r.addClassesToNamespace(a[s-4],a[s-1][0],a[s-1][1]),r.popNamespace();break;case 36:this.$=r.addNamespace(a[s]);break;case 37:this.$=r.addNamespace(a[s-1],a[s]);break;case 38:this.$=[[a[s]],[]];break;case 39:this.$=[[a[s-1]],[]];break;case 40:a[s][0].unshift(a[s-2]),this.$=a[s];break;case 41:this.$=[[],[a[s]]];break;case 42:this.$=[[],[a[s-1]]];break;case 43:a[s][1].unshift(a[s-2]),this.$=a[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=a[s];break;case 48:r.setCssClass(a[s-2],a[s]);break;case 49:r.addMembers(a[s-3],a[s-1]);break;case 51:r.setCssClass(a[s-5],a[s-3]),r.addMembers(a[s-5],a[s-1]);break;case 52:r.addAnnotation(a[s-3],a[s-1]);break;case 53:r.addAnnotation(a[s-6],a[s-4]),r.addMembers(a[s-6],a[s-1]);break;case 54:r.addAnnotation(a[s-5],a[s-3]);break;case 55:this.$=a[s],r.addClass(a[s]);break;case 56:this.$=a[s-1],r.addClass(a[s-1]),r.setClassLabel(a[s-1],a[s]);break;case 60:r.addAnnotation(a[s],a[s-2]);break;case 61:case 74:this.$=[a[s]];break;case 62:a[s].push(a[s-1]),this.$=a[s];break;case 63:break;case 64:r.addMember(a[s-1],r.cleanupLabel(a[s]));break;case 65:break;case 66:break;case 67:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:`none`,relationTitle2:`none`};break;case 68:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:`none`};break;case 69:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:`none`,relationTitle2:a[s-1]};break;case 70:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 71:this.$=r.addNote(a[s],a[s-1]);break;case 72:this.$=r.addNote(a[s]);break;case 73:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 75:this.$=a[s-2].concat([a[s]]);break;case 76:r.setDirection(`TB`);break;case 77:r.setDirection(`BT`);break;case 78:r.setDirection(`RL`);break;case 79:r.setDirection(`LR`);break;case 80:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 81:this.$={type1:`none`,type2:a[s],lineType:a[s-1]};break;case 82:this.$={type1:a[s-1],type2:`none`,lineType:a[s]};break;case 83:this.$={type1:`none`,type2:`none`,lineType:a[s]};break;case 84:this.$=r.relationType.AGGREGATION;break;case 85:this.$=r.relationType.EXTENSION;break;case 86:this.$=r.relationType.COMPOSITION;break;case 87:this.$=r.relationType.DEPENDENCY;break;case 88:this.$=r.relationType.LOLLIPOP;break;case 89:this.$=r.lineType.LINE;break;case 90:this.$=r.lineType.DOTTED_LINE;break;case 91:case 97:this.$=a[s-2],r.setClickEvent(a[s-1],a[s]);break;case 92:case 98:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 93:this.$=a[s-2],r.setLink(a[s-1],a[s]);break;case 94:this.$=a[s-3],r.setLink(a[s-2],a[s-1],a[s]);break;case 95:this.$=a[s-3],r.setLink(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 96:this.$=a[s-4],r.setLink(a[s-3],a[s-2],a[s]),r.setTooltip(a[s-3],a[s-1]);break;case 99:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 100:this.$=a[s-4],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 101:this.$=a[s-3],r.setLink(a[s-2],a[s]);break;case 102:this.$=a[s-4],r.setLink(a[s-3],a[s-1],a[s]);break;case 103:this.$=a[s-4],r.setLink(a[s-3],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 104:this.$=a[s-5],r.setLink(a[s-4],a[s-2],a[s]),r.setTooltip(a[s-4],a[s-1]);break;case 105:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 106:r.setCssClass(a[s-1],a[s]);break;case 107:this.$=[a[s]];break;case 108:a[s-2].push(a[s]),this.$=a[s-2];break;case 110:this.$=a[s-1]+a[s]}},`anonymous`),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:n,35:r,37:i,38:22,42:a,43:23,46:o,48:s,51:c,52:l,54:u,56:d,57:f,60:p,62:m,63:h,64:g,65:_,75:v,76:y,78:b,82:x,83:S,86:C,100:w,102:T,103:E},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},e(D,[2,5],{8:[1,48]}),{8:[1,49]},e(O,[2,19],{22:[1,50]}),e(O,[2,21]),e(O,[2,22]),e(O,[2,23]),e(O,[2,24]),e(O,[2,25]),e(O,[2,26]),e(O,[2,27]),e(O,[2,28]),e(O,[2,29]),e(O,[2,30]),{34:[1,51]},{36:[1,52]},e(O,[2,33]),e(O,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:k,69:A,70:j,71:M,72:N,73:P,74:F}),{39:[1,65]},e(I,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),e(O,[2,65]),e(O,[2,66]),{16:69,60:p,86:C,100:w,102:T},{16:39,17:40,19:70,60:p,86:C,100:w,102:T,103:E},{16:39,17:40,19:71,60:p,86:C,100:w,102:T,103:E},{16:39,17:40,19:72,60:p,86:C,100:w,102:T,103:E},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:p,86:C,100:w,102:T,103:E},{13:ee,55:76},{58:78,60:[1,79]},e(O,[2,76]),e(O,[2,77]),e(O,[2,78]),e(O,[2,79]),e(L,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:p,86:C,100:w,102:T,103:E}),e(L,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:p,86:C,100:w,102:T,103:E},{16:39,17:40,19:87,60:p,86:C,100:w,102:T,103:E},e(R,[2,133]),e(R,[2,134]),e(R,[2,135]),e(R,[2,136]),e([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),e(D,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:n,35:r,37:i,42:a,46:o,48:s,51:c,52:l,54:u,56:d,57:f,60:p,62:m,63:h,64:g,65:_,75:v,76:y,78:b,82:x,83:S,86:C,100:w,102:T,103:E}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:n,35:r,37:i,38:22,42:a,43:23,46:o,48:s,51:c,52:l,54:u,56:d,57:f,60:p,62:m,63:h,64:g,65:_,75:v,76:y,78:b,82:x,83:S,86:C,100:w,102:T,103:E},e(O,[2,20]),e(O,[2,31]),e(O,[2,32]),{13:[1,91],16:39,17:40,19:90,60:p,86:C,100:w,102:T,103:E},{53:92,66:56,67:57,68:k,69:A,70:j,71:M,72:N,73:P,74:F},e(O,[2,64]),{67:93,73:P,74:F},e(z,[2,83],{66:94,68:k,69:A,70:j,71:M,72:N}),e(B,[2,84]),e(B,[2,85]),e(B,[2,86]),e(B,[2,87]),e(B,[2,88]),e(te,[2,89]),e(te,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:a,43:23,48:s,54:u,56:d},{16:100,60:p,86:C,100:w,102:T},{41:[1,102],45:101,51:V},{16:104,60:p,86:C,100:w,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:H,50:U,59:110,60:W,82:G,84:111,85:112,86:K,87:q,88:J,89:Y,90:X},{60:[1,122]},{13:ee,55:123},e(I,[2,72]),e(I,[2,138]),{22:H,50:U,59:124,60:W,61:[1,125],82:G,84:111,85:112,86:K,87:q,88:J,89:Y,90:X},e(ne,[2,74]),{16:39,17:40,19:126,60:p,86:C,100:w,102:T,103:E},e(L,[2,16]),e(L,[2,17]),e(L,[2,18]),{11:127,12:re,39:[2,36]},e(Z,[2,9],{16:85,17:86,15:130,18:[1,129],60:p,86:C,100:w,102:T,103:E}),e(Z,[2,10]),e(ie,[2,55],{11:131,12:re}),e(D,[2,7]),{9:[1,132]},e(Q,[2,67]),{16:39,17:40,19:133,60:p,86:C,100:w,102:T,103:E},{13:[1,135],16:39,17:40,19:134,60:p,86:C,100:w,102:T,103:E},e(z,[2,82],{66:136,68:k,69:A,70:j,71:M,72:N}),e(z,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:a,43:23,48:s,54:u,56:d},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},e(I,[2,48],{39:[1,142]}),{41:[1,143]},e(I,[2,50]),{41:[2,61],45:144,51:V},{47:[1,145]},{16:39,17:40,19:146,60:p,86:C,100:w,102:T,103:E},e(O,[2,91],{13:[1,147]}),e(O,[2,93],{13:[1,149],77:[1,148]}),e(O,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},e(O,[2,105],{61:ae}),e(oe,[2,107],{85:154,22:H,50:U,60:W,82:G,86:K,87:q,88:J,89:Y,90:X}),e($,[2,109]),e($,[2,111]),e($,[2,112]),e($,[2,113]),e($,[2,114]),e($,[2,115]),e($,[2,116]),e($,[2,117]),e($,[2,118]),e($,[2,119]),e(O,[2,106]),e(I,[2,71]),e(O,[2,73],{61:ae}),{60:[1,155]},e(L,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:p,86:C,100:w,102:T,103:E},e(Z,[2,12]),e(ie,[2,56]),{1:[2,4]},e(Q,[2,69]),e(Q,[2,68]),{16:39,17:40,19:158,60:p,86:C,100:w,102:T,103:E},e(z,[2,80]),e(I,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:a,43:23,48:s,54:u,56:d},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:a,43:23,48:s,54:u,56:d},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:a,43:23,48:s,54:u,56:d},{45:163,51:V},e(I,[2,49]),{41:[2,62]},e(I,[2,52],{39:[1,164]}),e(O,[2,60]),e(O,[2,92]),e(O,[2,94]),e(O,[2,95],{77:[1,165]}),e(O,[2,98]),e(O,[2,99],{13:[1,166]}),e(O,[2,101],{13:[1,168],77:[1,167]}),{22:H,50:U,60:W,82:G,84:169,85:112,86:K,87:q,88:J,89:Y,90:X},e($,[2,110]),e(ne,[2,75]),{14:[1,170]},e(Z,[2,11]),e(Q,[2,70]),e(I,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:V},e(O,[2,96]),e(O,[2,100]),e(O,[2,102]),e(O,[2,103],{77:[1,174]}),e(oe,[2,108],{85:154,22:H,50:U,60:W,82:G,86:K,87:q,88:J,89:Y,90:X}),e(ie,[2,8]),e(I,[2,51]),{41:[1,175]},e(I,[2,54]),e(O,[2,104]),e(I,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,M as a,U as o,a as s,q as c,s as l,v as u,w as d,x as f,y as p,z as m}from"./app-chunk-O7XYJQB3.js";import{c as h,g}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{i as _,n as v,o as y,r as b}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as x,t as S}from"./app-chunk-GNY47TPC.js";import{t as C}from"./app-chunk-5VM5RSS4.js";import{t as w}from"./app-chunk-GWA4HPMP.js";import{t as T}from"./app-chunk-XXDRQBXY.js";import{t as E}from"./app-chunk-WEXAMYUT.js";var D=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,18],r=[1,19],i=[1,20],a=[1,41],o=[1,26],s=[1,42],c=[1,24],l=[1,25],u=[1,32],d=[1,33],f=[1,34],p=[1,45],m=[1,35],h=[1,36],g=[1,37],_=[1,38],v=[1,27],y=[1,28],b=[1,29],x=[1,30],S=[1,31],C=[1,44],w=[1,46],T=[1,43],E=[1,47],D=[1,9],O=[1,8,9],k=[1,58],A=[1,59],j=[1,60],M=[1,61],N=[1,62],P=[1,63],F=[1,64],I=[1,8,9,41],ee=[1,77],L=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],R=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],z=[13,60,86,100,102,103],B=[13,60,73,74,86,100,102,103],te=[13,60,68,69,70,71,72,86,100,102,103],V=[1,103],H=[1,121],U=[1,117],W=[1,113],G=[1,119],K=[1,114],q=[1,115],J=[1,116],Y=[1,118],X=[1,120],ne=[22,50,60,61,82,86,87,88,89,90],re=[1,128],Z=[12,39],ie=[1,8,9,39,41,44,46],Q=[1,8,9,22],ae=[1,153],oe=[1,8,9,61],$=[1,8,9,22,50,60,61,82,86,87,88,89,90],se={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:`error`,7:`CLASS_DIAGRAM`,8:`NEWLINE`,9:`EOF`,12:`SQS`,13:`STR`,14:`SQE`,18:`DOT`,20:`GENERICTYPE`,22:`LABEL`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,39:`STRUCT_START`,41:`STRUCT_STOP`,42:`NAMESPACE`,44:`STYLE_SEPARATOR`,46:`ANNOTATION_START`,47:`ANNOTATION_END`,48:`CLASS`,50:`SPACE`,51:`MEMBER`,52:`SEPARATOR`,54:`NOTE_FOR`,56:`NOTE`,57:`CLASSDEF`,60:`ALPHA`,61:`COMMA`,62:`direction_tb`,63:`direction_bt`,64:`direction_rl`,65:`direction_lr`,68:`AGGREGATION`,69:`EXTENSION`,70:`COMPOSITION`,71:`DEPENDENCY`,72:`LOLLIPOP`,73:`LINE`,74:`DOTTED_LINE`,75:`CALLBACK`,76:`LINK`,77:`LINK_TARGET`,78:`CLICK`,79:`CALLBACK_NAME`,80:`CALLBACK_ARGS`,81:`HREF`,82:`STYLE`,83:`CSSCLASS`,86:`NUM`,87:`COLON`,88:`UNIT`,89:`BRKT`,90:`PCT`,93:`graphCodeTokens`,95:`TAGSTART`,96:`TAGEND`,97:`==`,98:`--`,99:`DEFAULT`,100:`MINUS`,101:`keywords`,102:`UNICODE_TEXT`,103:`BQUOTE_STR`},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 8:this.$=a[s-1];break;case 9:case 10:case 13:case 15:this.$=a[s];break;case 11:case 14:this.$=a[s-2]+`.`+a[s];break;case 12:case 16:this.$=a[s-1]+a[s];break;case 17:case 18:this.$=a[s-1]+`~`+a[s]+`~`;break;case 19:r.addRelation(a[s]);break;case 20:a[s-1].title=r.cleanupLabel(a[s]),r.addRelation(a[s-1]);break;case 31:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 34:r.addClassesToNamespace(a[s-3],a[s-1][0],a[s-1][1]),r.popNamespace();break;case 35:r.addClassesToNamespace(a[s-4],a[s-1][0],a[s-1][1]),r.popNamespace();break;case 36:this.$=r.addNamespace(a[s]);break;case 37:this.$=r.addNamespace(a[s-1],a[s]);break;case 38:this.$=[[a[s]],[]];break;case 39:this.$=[[a[s-1]],[]];break;case 40:a[s][0].unshift(a[s-2]),this.$=a[s];break;case 41:this.$=[[],[a[s]]];break;case 42:this.$=[[],[a[s-1]]];break;case 43:a[s][1].unshift(a[s-2]),this.$=a[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=a[s];break;case 48:r.setCssClass(a[s-2],a[s]);break;case 49:r.addMembers(a[s-3],a[s-1]);break;case 51:r.setCssClass(a[s-5],a[s-3]),r.addMembers(a[s-5],a[s-1]);break;case 52:r.addAnnotation(a[s-3],a[s-1]);break;case 53:r.addAnnotation(a[s-6],a[s-4]),r.addMembers(a[s-6],a[s-1]);break;case 54:r.addAnnotation(a[s-5],a[s-3]);break;case 55:this.$=a[s],r.addClass(a[s]);break;case 56:this.$=a[s-1],r.addClass(a[s-1]),r.setClassLabel(a[s-1],a[s]);break;case 60:r.addAnnotation(a[s],a[s-2]);break;case 61:case 74:this.$=[a[s]];break;case 62:a[s].push(a[s-1]),this.$=a[s];break;case 63:break;case 64:r.addMember(a[s-1],r.cleanupLabel(a[s]));break;case 65:break;case 66:break;case 67:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:`none`,relationTitle2:`none`};break;case 68:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:`none`};break;case 69:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:`none`,relationTitle2:a[s-1]};break;case 70:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 71:this.$=r.addNote(a[s],a[s-1]);break;case 72:this.$=r.addNote(a[s]);break;case 73:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 75:this.$=a[s-2].concat([a[s]]);break;case 76:r.setDirection(`TB`);break;case 77:r.setDirection(`BT`);break;case 78:r.setDirection(`RL`);break;case 79:r.setDirection(`LR`);break;case 80:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 81:this.$={type1:`none`,type2:a[s],lineType:a[s-1]};break;case 82:this.$={type1:a[s-1],type2:`none`,lineType:a[s]};break;case 83:this.$={type1:`none`,type2:`none`,lineType:a[s]};break;case 84:this.$=r.relationType.AGGREGATION;break;case 85:this.$=r.relationType.EXTENSION;break;case 86:this.$=r.relationType.COMPOSITION;break;case 87:this.$=r.relationType.DEPENDENCY;break;case 88:this.$=r.relationType.LOLLIPOP;break;case 89:this.$=r.lineType.LINE;break;case 90:this.$=r.lineType.DOTTED_LINE;break;case 91:case 97:this.$=a[s-2],r.setClickEvent(a[s-1],a[s]);break;case 92:case 98:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 93:this.$=a[s-2],r.setLink(a[s-1],a[s]);break;case 94:this.$=a[s-3],r.setLink(a[s-2],a[s-1],a[s]);break;case 95:this.$=a[s-3],r.setLink(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 96:this.$=a[s-4],r.setLink(a[s-3],a[s-2],a[s]),r.setTooltip(a[s-3],a[s-1]);break;case 99:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 100:this.$=a[s-4],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 101:this.$=a[s-3],r.setLink(a[s-2],a[s]);break;case 102:this.$=a[s-4],r.setLink(a[s-3],a[s-1],a[s]);break;case 103:this.$=a[s-4],r.setLink(a[s-3],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 104:this.$=a[s-5],r.setLink(a[s-4],a[s-2],a[s]),r.setTooltip(a[s-4],a[s-1]);break;case 105:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 106:r.setCssClass(a[s-1],a[s]);break;case 107:this.$=[a[s]];break;case 108:a[s-2].push(a[s]),this.$=a[s-2];break;case 110:this.$=a[s-1]+a[s]}},`anonymous`),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:n,35:r,37:i,38:22,42:a,43:23,46:o,48:s,51:c,52:l,54:u,56:d,57:f,60:p,62:m,63:h,64:g,65:_,75:v,76:y,78:b,82:x,83:S,86:C,100:w,102:T,103:E},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},e(D,[2,5],{8:[1,48]}),{8:[1,49]},e(O,[2,19],{22:[1,50]}),e(O,[2,21]),e(O,[2,22]),e(O,[2,23]),e(O,[2,24]),e(O,[2,25]),e(O,[2,26]),e(O,[2,27]),e(O,[2,28]),e(O,[2,29]),e(O,[2,30]),{34:[1,51]},{36:[1,52]},e(O,[2,33]),e(O,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:k,69:A,70:j,71:M,72:N,73:P,74:F}),{39:[1,65]},e(I,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),e(O,[2,65]),e(O,[2,66]),{16:69,60:p,86:C,100:w,102:T},{16:39,17:40,19:70,60:p,86:C,100:w,102:T,103:E},{16:39,17:40,19:71,60:p,86:C,100:w,102:T,103:E},{16:39,17:40,19:72,60:p,86:C,100:w,102:T,103:E},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:p,86:C,100:w,102:T,103:E},{13:ee,55:76},{58:78,60:[1,79]},e(O,[2,76]),e(O,[2,77]),e(O,[2,78]),e(O,[2,79]),e(L,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:p,86:C,100:w,102:T,103:E}),e(L,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:p,86:C,100:w,102:T,103:E},{16:39,17:40,19:87,60:p,86:C,100:w,102:T,103:E},e(R,[2,133]),e(R,[2,134]),e(R,[2,135]),e(R,[2,136]),e([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),e(D,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:n,35:r,37:i,42:a,46:o,48:s,51:c,52:l,54:u,56:d,57:f,60:p,62:m,63:h,64:g,65:_,75:v,76:y,78:b,82:x,83:S,86:C,100:w,102:T,103:E}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:n,35:r,37:i,38:22,42:a,43:23,46:o,48:s,51:c,52:l,54:u,56:d,57:f,60:p,62:m,63:h,64:g,65:_,75:v,76:y,78:b,82:x,83:S,86:C,100:w,102:T,103:E},e(O,[2,20]),e(O,[2,31]),e(O,[2,32]),{13:[1,91],16:39,17:40,19:90,60:p,86:C,100:w,102:T,103:E},{53:92,66:56,67:57,68:k,69:A,70:j,71:M,72:N,73:P,74:F},e(O,[2,64]),{67:93,73:P,74:F},e(z,[2,83],{66:94,68:k,69:A,70:j,71:M,72:N}),e(B,[2,84]),e(B,[2,85]),e(B,[2,86]),e(B,[2,87]),e(B,[2,88]),e(te,[2,89]),e(te,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:a,43:23,48:s,54:u,56:d},{16:100,60:p,86:C,100:w,102:T},{41:[1,102],45:101,51:V},{16:104,60:p,86:C,100:w,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:H,50:U,59:110,60:W,82:G,84:111,85:112,86:K,87:q,88:J,89:Y,90:X},{60:[1,122]},{13:ee,55:123},e(I,[2,72]),e(I,[2,138]),{22:H,50:U,59:124,60:W,61:[1,125],82:G,84:111,85:112,86:K,87:q,88:J,89:Y,90:X},e(ne,[2,74]),{16:39,17:40,19:126,60:p,86:C,100:w,102:T,103:E},e(L,[2,16]),e(L,[2,17]),e(L,[2,18]),{11:127,12:re,39:[2,36]},e(Z,[2,9],{16:85,17:86,15:130,18:[1,129],60:p,86:C,100:w,102:T,103:E}),e(Z,[2,10]),e(ie,[2,55],{11:131,12:re}),e(D,[2,7]),{9:[1,132]},e(Q,[2,67]),{16:39,17:40,19:133,60:p,86:C,100:w,102:T,103:E},{13:[1,135],16:39,17:40,19:134,60:p,86:C,100:w,102:T,103:E},e(z,[2,82],{66:136,68:k,69:A,70:j,71:M,72:N}),e(z,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:a,43:23,48:s,54:u,56:d},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},e(I,[2,48],{39:[1,142]}),{41:[1,143]},e(I,[2,50]),{41:[2,61],45:144,51:V},{47:[1,145]},{16:39,17:40,19:146,60:p,86:C,100:w,102:T,103:E},e(O,[2,91],{13:[1,147]}),e(O,[2,93],{13:[1,149],77:[1,148]}),e(O,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},e(O,[2,105],{61:ae}),e(oe,[2,107],{85:154,22:H,50:U,60:W,82:G,86:K,87:q,88:J,89:Y,90:X}),e($,[2,109]),e($,[2,111]),e($,[2,112]),e($,[2,113]),e($,[2,114]),e($,[2,115]),e($,[2,116]),e($,[2,117]),e($,[2,118]),e($,[2,119]),e(O,[2,106]),e(I,[2,71]),e(O,[2,73],{61:ae}),{60:[1,155]},e(L,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:p,86:C,100:w,102:T,103:E},e(Z,[2,12]),e(ie,[2,56]),{1:[2,4]},e(Q,[2,69]),e(Q,[2,68]),{16:39,17:40,19:158,60:p,86:C,100:w,102:T,103:E},e(z,[2,80]),e(I,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:a,43:23,48:s,54:u,56:d},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:a,43:23,48:s,54:u,56:d},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:a,43:23,48:s,54:u,56:d},{45:163,51:V},e(I,[2,49]),{41:[2,62]},e(I,[2,52],{39:[1,164]}),e(O,[2,60]),e(O,[2,92]),e(O,[2,94]),e(O,[2,95],{77:[1,165]}),e(O,[2,98]),e(O,[2,99],{13:[1,166]}),e(O,[2,101],{13:[1,168],77:[1,167]}),{22:H,50:U,60:W,82:G,84:169,85:112,86:K,87:q,88:J,89:Y,90:X},e($,[2,110]),e(ne,[2,75]),{14:[1,170]},e(Z,[2,11]),e(Q,[2,70]),e(I,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:V},e(O,[2,96]),e(O,[2,100]),e(O,[2,102]),e(O,[2,103],{77:[1,174]}),e(oe,[2,108],{85:154,22:H,50:U,60:W,82:G,86:K,87:q,88:J,89:Y,90:X}),e(ie,[2,8]),e(I,[2,51]),{41:[1,175]},e(I,[2,54]),e(O,[2,104]),e(I,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};se.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:t(function(e,t,n,r){switch(n){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin(`acc_title`),33;case 7:return this.popState(),`acc_title_value`;case 8:return this.begin(`acc_descr`),35;case 9:return this.popState(),`acc_descr_value`;case 10:this.begin(`acc_descr_multiline`);break;case 11:this.popState();break;case 12:return`acc_descr_multiline_value`;case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return`EDGE_STATE`;case 18:this.begin(`callback_name`);break;case 19:this.popState();break;case 20:this.popState(),this.begin(`callback_args`);break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return`STR`;case 26:this.begin(`string`);break;case 27:return 82;case 28:return 57;case 29:return this.begin(`namespace`),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin(`namespace-body`),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return`EOF_IN_STRUCT`;case 36:return 8;case 37:break;case 38:return`EDGE_STATE`;case 39:return this.begin(`class`),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin(`class-body`),39;case 44:return this.popState(),41;case 45:return`EOF_IN_STRUCT`;case 46:return`EDGE_STATE`;case 47:return`OPEN_IN_STRUCT`;case 48:break;case 49:return`MEMBER`;case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return`GENERICTYPE`;case 61:this.begin(`generic`);break;case 62:this.popState();break;case 63:return`BQUOTE_STR`;case 64:this.begin(`bqstring`);break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return`PLUS`;case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return`EQUALS`;case 89:return`EQUALS`;case 90:return 60;case 91:return 12;case 92:return 14;case 93:return`PUNCTUATION`;case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},`anonymous`),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\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\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\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\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-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\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-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\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\u2183\u2184]|[\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\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\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])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}}})();function ce(){this.yy={}}return t(ce,`Parser`),ce.prototype=se,se.Parser=ce,new ce})();D.parser=D;var O=D,k=[`#`,`+`,`~`,`-`,``],A=class{static{t(this,`ClassMember`)}constructor(e,t){this.memberType=t,this.visibility=``,this.classifier=``,this.text=``;let n=m(e,f());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+a(this.id);this.memberType===`method`&&(e+=`(${a(this.parameters.trim())})`,this.returnType&&(e+=` : `+a(this.returnType))),e=e.trim();let t=this.parseClassifier();return{displayText:e,cssStyle:t}}parseMember(e){let t=``;if(this.memberType===`method`){let n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(n){let e=n[1]?n[1].trim():``;if(k.includes(e)&&(this.visibility=e),this.id=n[2],this.parameters=n[3]?n[3].trim():``,t=n[4]?n[4].trim():``,this.returnType=n[5]?n[5].trim():``,t===``){let e=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(e)&&(t=e,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{let n=e.length,r=e.substring(0,1),i=e.substring(n-1);k.includes(r)&&(this.visibility=r),/[$*]/.exec(i)&&(t=i),this.id=e.substring(this.visibility===``?0:1,t===``?n:n-1)}this.classifier=t,this.id=this.id.startsWith(` `)?` `+this.id.trim():this.id.trim();let n=`${this.visibility?`\\`+this.visibility:``}${a(this.id)}${this.memberType===`method`?`(${a(this.parameters)})${this.returnType?` : `+a(this.returnType):``}`:``}`;this.text=n.replaceAll(`<`,`<`).replaceAll(`>`,`>`),this.text.startsWith(`\\<`)&&(this.text=this.text.replace(`\\<`,`~`))}parseClassifier(){switch(this.classifier){case`*`:return`font-style:italic;`;case`$`:return`text-decoration:underline;`;default:return``}}},j=`classId-`,M=0,N=t(e=>l.sanitizeText(e,f()),`sanitizeText`),P=class a{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId=``,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=t(t=>{let n=S();r(t).select(`svg`).selectAll(`g`).filter(function(){return r(this).attr(`title`)!==null}).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(!a)return;let o=t.currentTarget.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.html(e.sanitize(a)).style(`left`,`${window.scrollX+o.left+o.width/2}px`).style(`top`,`${window.scrollY+o.bottom+4}px`),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})},`setupToolTips`),this.direction=`TB`,this.setAccTitle=o,this.getAccTitle=p,this.setAccDescription=i,this.getAccDescription=u,this.setDiagramTitle=c,this.getDiagramTitle=d,this.getConfig=t(()=>f().class,`getConfig`),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{t(this,`ClassDB`)}splitClassNameAndType(e){let t=l.sanitizeText(e,f()),n=``,r=t;if(t.indexOf(`~`)>0){let e=t.split(`~`);r=N(e[0]),n=N(e[1])}return{className:r,type:n}}setClassLabel(e,t){let n=l.sanitizeText(e,f());t&&=N(t);let{className:r}=this.splitClassNameAndType(n);this.classes.get(r).label=t,this.classes.get(r).text=`${t}${this.classes.get(r).type?`<${this.classes.get(r).type}>`:``}`}addClass(e){let t=l.sanitizeText(e,f()),{className:n,type:r}=this.splitClassNameAndType(t);if(this.classes.has(n))return;let i=l.sanitizeText(n,f());this.classes.set(i,{id:i,type:r,label:i,text:`${i}${r?`<${r}>`:``}`,shape:`classBox`,cssClasses:`default`,methods:[],members:[],annotations:[],styles:[],domId:j+i+`-`+M}),M++}addInterface(e,t){let n={id:`interface${this.interfaces.length}`,label:e,classId:t};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){let t=l.sanitizeText(e,f());if(this.classes.has(t)){let e=this.classes.get(t).domId;return this.diagramId?`${this.diagramId}-${e}`:e}throw Error(`Class not found: `+t)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId=``,this.direction=`TB`,s()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){let t=typeof e==`number`?`note${e}`:e;return this.notes.get(t)}getNotes(){return this.notes}addRelation(e){n.debug(`Adding relation: `+JSON.stringify(e));let t=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!t.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!t.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=l.sanitizeText(e.relationTitle1.trim(),f()),e.relationTitle2=l.sanitizeText(e.relationTitle2.trim(),f()),this.relations.push(e)}addAnnotation(e,t){let n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(t)}addMember(e,t){this.addClass(e);let n=this.splitClassNameAndType(e).className,r=this.classes.get(n);if(typeof t==`string`){let e=t.trim();e.startsWith(`<<`)&&e.endsWith(`>>`)?r.annotations.push(N(e.substring(2,e.length-2))):e.indexOf(`)`)>0?r.methods.push(new A(e,`method`)):e&&r.members.push(new A(e,`attribute`))}}addMembers(e,t){Array.isArray(t)&&(t.reverse(),t.forEach(t=>this.addMember(e,t)))}addNote(e,t){let n=this.notes.size,r={id:`note${n}`,class:t,text:e,index:n};return this.notes.set(r.id,r),r.id}cleanupLabel(e){return e.startsWith(`:`)&&(e=e.substring(1)),N(e.trim())}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=e;/\d/.exec(e[0])&&(n=j+n),n=this.splitClassNameAndType(n).className;let r=this.classes.get(n);r&&(r.cssClasses+=` `+t)})}defineClass(e,t){for(let n of e){let e=this.styleClasses.get(n);e===void 0&&(e={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,e)),t&&t.forEach(t=>{if(/color/.exec(t)){let n=t.replace(`fill`,`bgFill`);e.textStyles.push(n)}e.styles.push(t)}),this.classes.forEach(e=>{e.cssClasses.includes(n)&&e.styles.push(...t.flatMap(e=>e.split(`,`)))})}}setTooltip(e,t){e.split(`,`).forEach(e=>{if(t!==void 0){let n=this.splitClassNameAndType(e).className,r=this.classes.get(n);r&&(r.tooltip=N(t))}})}getTooltip(e,t){return t&&this.namespaces.has(t)?this.namespaces.get(t).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,t,n){let r=f();e.split(`,`).forEach(e=>{let i=e;/\d/.exec(e[0])&&(i=j+i),i=this.splitClassNameAndType(i).className;let a=this.classes.get(i);a&&(a.link=g.formatUrl(t,r),a.linkTarget=r.securityLevel===`sandbox`?`_top`:typeof n==`string`?N(n):`_blank`)}),this.setCssClass(e,`clickable`)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFunc(e,t,n);let r=this.splitClassNameAndType(e).className,i=this.classes.get(r);i&&(i.haveCallback=!0)}),this.setCssClass(e,`clickable`)}setClickFunc(e,t,n){let r=l.sanitizeText(e,f());if(f().securityLevel!==`loose`||t===void 0)return;let i=this.splitClassNameAndType(r).className;if(this.classes.has(i)){let e=[];if(typeof n==`string`){e=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t{let n=this.lookUpDomId(i),r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener(`click`,()=>{g.runFunc(t,...e)},!1)})}}bindFunctions(e){this.functions.forEach(t=>{t(e)})}escapeHtml(e){return e.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,t){let n=t.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){let t=e.split(`.`),n=Array(t.length);n[0]=t[0];for(let e=1;e0?i[e-1]:void 0,o=e===i.length-1,s=o&&t?t:r[e];this.namespaces.has(n)?o&&(this.namespaces.get(n).explicit=!0):this.namespaces.set(n,this.createNamespaceNode(n,s,a,o)),a&&this.linkParentChild(a,n)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,t,n){if(this.namespaces.has(e)){for(let n of t){let{className:t}=this.splitClassNameAndType(n),r=this.getClass(t);r.parent=e,this.namespaces.get(e).classes.set(t,r)}for(let t of n){let n=this.getNote(t);n.parent=e,this.namespaces.get(e).notes.set(t,n)}}}setCssStyle(e,t){let n=this.classes.get(e);if(!(!t||!n))for(let e of t)e.includes(`,`)?n.styles.push(...e.split(`,`)):n.styles.push(e)}getArrowMarker(e){let t;switch(e){case 0:t=`aggregation`;break;case 1:t=`extension`;break;case 2:t=`composition`;break;case 3:t=`dependency`;break;case 4:t=`lollipop`;break;default:t=`none`}return t}resolveExplicitAncestor(e){let t=e;for(;t;){let e=this.namespaces.get(t);if(!e)return;if(e.explicit)return t;t=e.parent}}getData(){let e=[],t=[],n=f(),r=n.class?.hierarchicalNamespaces??!0;for(let t of this.namespaces.values()){if(!r&&!t.explicit)continue;let i={id:t.id,label:r?t.label:t.id,isGroup:!0,padding:n.class.padding??16,shape:`rect`,cssStyles:[],look:n.look,parentId:r?t.parent:void 0};e.push(i)}let i=0;for(let t of this.classes.values()){let a=r?t.parent:this.resolveExplicitAncestor(t.parent),o={...t,type:void 0,isGroup:!1,parentId:a,look:n.look,colorIndex:i++};e.push(o)}for(let i of this.notes.values()){let a=r?i.parent:this.resolveExplicitAncestor(i.parent),o={id:i.id,label:i.text,isGroup:!1,shape:`note`,padding:n.class.padding??6,cssStyles:[`text-align: left`,`white-space: nowrap`,`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:a,labelType:`markdown`};e.push(o);let s=this.classes.get(i.class)?.id;if(s){let e={id:`edgeNote${i.index}`,start:i.id,end:s,type:`normal`,thickness:`normal`,classes:`relation`,arrowTypeStart:`none`,arrowTypeEnd:`none`,arrowheadStyle:``,labelStyle:[``],style:[`fill: none`],pattern:`dotted`,look:n.look};t.push(e)}}for(let t of this.interfaces){let r={id:t.id,label:t.label,isGroup:!1,shape:`rect`,cssStyles:[`opacity: 0;`],look:n.look};e.push(r)}let a=0;for(let e of this.relations){a++;let r={id:h(e.id1,e.id2,{prefix:`id`,counter:a}),start:e.id1,end:e.id2,type:`normal`,label:e.title,labelpos:`c`,thickness:`normal`,classes:`relation`,arrowTypeStart:this.getArrowMarker(e.relation.type1),arrowTypeEnd:this.getArrowMarker(e.relation.type2),startLabelRight:e.relationTitle1===`none`?``:e.relationTitle1,endLabelLeft:e.relationTitle2===`none`?``:e.relationTitle2,arrowheadStyle:``,labelStyle:[`display: inline-block`],style:e.style||``,pattern:e.relation.lineType==1?`dashed`:`solid`,look:n.look,labelType:`markdown`};t.push(r)}return{nodes:e,edges:t,other:{},config:n,direction:this.getDirection()}}},F=t(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!v(t,r))return``;let i=b(e.look),a=x(n),o=``;for(let t=0;t0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:t(function(e,t,n,r){switch(n){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin(`acc_title`),33;case 7:return this.popState(),`acc_title_value`;case 8:return this.begin(`acc_descr`),35;case 9:return this.popState(),`acc_descr_value`;case 10:this.begin(`acc_descr_multiline`);break;case 11:this.popState();break;case 12:return`acc_descr_multiline_value`;case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return`EDGE_STATE`;case 18:this.begin(`callback_name`);break;case 19:this.popState();break;case 20:this.popState(),this.begin(`callback_args`);break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return`STR`;case 26:this.begin(`string`);break;case 27:return 82;case 28:return 57;case 29:return this.begin(`namespace`),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin(`namespace-body`),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return`EOF_IN_STRUCT`;case 36:return 8;case 37:break;case 38:return`EDGE_STATE`;case 39:return this.begin(`class`),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin(`class-body`),39;case 44:return this.popState(),41;case 45:return`EOF_IN_STRUCT`;case 46:return`EDGE_STATE`;case 47:return`OPEN_IN_STRUCT`;case 48:break;case 49:return`MEMBER`;case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return`GENERICTYPE`;case 61:this.begin(`generic`);break;case 62:this.popState();break;case 63:return`BQUOTE_STR`;case 64:this.begin(`bqstring`);break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return`PLUS`;case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return`EQUALS`;case 89:return`EQUALS`;case 90:return 60;case 91:return 12;case 92:return 14;case 93:return`PUNCTUATION`;case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},`anonymous`),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\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\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\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\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-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\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-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\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\u2183\u2184]|[\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\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\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])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}}})();function ce(){this.yy={}}return t(ce,`Parser`),ce.prototype=se,se.Parser=ce,new ce})();D.parser=D;var O=D,k=[`#`,`+`,`~`,`-`,``],A=class{static{t(this,`ClassMember`)}constructor(e,t){this.memberType=t,this.visibility=``,this.classifier=``,this.text=``;let n=m(e,f());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+a(this.id);this.memberType===`method`&&(e+=`(${a(this.parameters.trim())})`,this.returnType&&(e+=` : `+a(this.returnType))),e=e.trim();let t=this.parseClassifier();return{displayText:e,cssStyle:t}}parseMember(e){let t=``;if(this.memberType===`method`){let n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(n){let e=n[1]?n[1].trim():``;if(k.includes(e)&&(this.visibility=e),this.id=n[2],this.parameters=n[3]?n[3].trim():``,t=n[4]?n[4].trim():``,this.returnType=n[5]?n[5].trim():``,t===``){let e=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(e)&&(t=e,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{let n=e.length,r=e.substring(0,1),i=e.substring(n-1);k.includes(r)&&(this.visibility=r),/[$*]/.exec(i)&&(t=i),this.id=e.substring(this.visibility===``?0:1,t===``?n:n-1)}this.classifier=t,this.id=this.id.startsWith(` `)?` `+this.id.trim():this.id.trim();let n=`${this.visibility?`\\`+this.visibility:``}${a(this.id)}${this.memberType===`method`?`(${a(this.parameters)})${this.returnType?` : `+a(this.returnType):``}`:``}`;this.text=n.replaceAll(`<`,`<`).replaceAll(`>`,`>`),this.text.startsWith(`\\<`)&&(this.text=this.text.replace(`\\<`,`~`))}parseClassifier(){switch(this.classifier){case`*`:return`font-style:italic;`;case`$`:return`text-decoration:underline;`;default:return``}}},j=`classId-`,M=0,N=t(e=>l.sanitizeText(e,f()),`sanitizeText`),P=class a{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId=``,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=t(t=>{let n=w();r(t).select(`svg`).selectAll(`g`).filter(function(){return r(this).attr(`title`)!==null}).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(!a)return;let o=t.currentTarget.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.html(e.sanitize(a)).style(`left`,`${window.scrollX+o.left+o.width/2}px`).style(`top`,`${window.scrollY+o.bottom+4}px`),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})},`setupToolTips`),this.direction=`TB`,this.setAccTitle=o,this.getAccTitle=p,this.setAccDescription=i,this.getAccDescription=u,this.setDiagramTitle=c,this.getDiagramTitle=d,this.getConfig=t(()=>f().class,`getConfig`),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{t(this,`ClassDB`)}splitClassNameAndType(e){let t=l.sanitizeText(e,f()),n=``,r=t;if(t.indexOf(`~`)>0){let e=t.split(`~`);r=N(e[0]),n=N(e[1])}return{className:r,type:n}}setClassLabel(e,t){let n=l.sanitizeText(e,f());t&&=N(t);let{className:r}=this.splitClassNameAndType(n);this.classes.get(r).label=t,this.classes.get(r).text=`${t}${this.classes.get(r).type?`<${this.classes.get(r).type}>`:``}`}addClass(e){let t=l.sanitizeText(e,f()),{className:n,type:r}=this.splitClassNameAndType(t);if(this.classes.has(n))return;let i=l.sanitizeText(n,f());this.classes.set(i,{id:i,type:r,label:i,text:`${i}${r?`<${r}>`:``}`,shape:`classBox`,cssClasses:`default`,methods:[],members:[],annotations:[],styles:[],domId:j+i+`-`+M}),M++}addInterface(e,t){let n={id:`interface${this.interfaces.length}`,label:e,classId:t};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){let t=l.sanitizeText(e,f());if(this.classes.has(t)){let e=this.classes.get(t).domId;return this.diagramId?`${this.diagramId}-${e}`:e}throw Error(`Class not found: `+t)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId=``,this.direction=`TB`,s()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){let t=typeof e==`number`?`note${e}`:e;return this.notes.get(t)}getNotes(){return this.notes}addRelation(e){n.debug(`Adding relation: `+JSON.stringify(e));let t=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!t.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!t.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=l.sanitizeText(e.relationTitle1.trim(),f()),e.relationTitle2=l.sanitizeText(e.relationTitle2.trim(),f()),this.relations.push(e)}addAnnotation(e,t){let n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(t)}addMember(e,t){this.addClass(e);let n=this.splitClassNameAndType(e).className,r=this.classes.get(n);if(typeof t==`string`){let e=t.trim();e.startsWith(`<<`)&&e.endsWith(`>>`)?r.annotations.push(N(e.substring(2,e.length-2))):e.indexOf(`)`)>0?r.methods.push(new A(e,`method`)):e&&r.members.push(new A(e,`attribute`))}}addMembers(e,t){Array.isArray(t)&&(t.reverse(),t.forEach(t=>this.addMember(e,t)))}addNote(e,t){let n=this.notes.size,r={id:`note${n}`,class:t,text:e,index:n};return this.notes.set(r.id,r),r.id}cleanupLabel(e){return e.startsWith(`:`)&&(e=e.substring(1)),N(e.trim())}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=e;/\d/.exec(e[0])&&(n=j+n),n=this.splitClassNameAndType(n).className;let r=this.classes.get(n);r&&(r.cssClasses+=` `+t)})}defineClass(e,t){for(let n of e){let e=this.styleClasses.get(n);e===void 0&&(e={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,e)),t&&t.forEach(t=>{if(/color/.exec(t)){let n=t.replace(`fill`,`bgFill`);e.textStyles.push(n)}e.styles.push(t)}),this.classes.forEach(e=>{e.cssClasses.includes(n)&&e.styles.push(...t.flatMap(e=>e.split(`,`)))})}}setTooltip(e,t){e.split(`,`).forEach(e=>{if(t!==void 0){let n=this.splitClassNameAndType(e).className,r=this.classes.get(n);r&&(r.tooltip=N(t))}})}getTooltip(e,t){return t&&this.namespaces.has(t)?this.namespaces.get(t).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,t,n){let r=f();e.split(`,`).forEach(e=>{let i=e;/\d/.exec(e[0])&&(i=j+i),i=this.splitClassNameAndType(i).className;let a=this.classes.get(i);a&&(a.link=g.formatUrl(t,r),a.linkTarget=r.securityLevel===`sandbox`?`_top`:typeof n==`string`?N(n):`_blank`)}),this.setCssClass(e,`clickable`)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFunc(e,t,n);let r=this.splitClassNameAndType(e).className,i=this.classes.get(r);i&&(i.haveCallback=!0)}),this.setCssClass(e,`clickable`)}setClickFunc(e,t,n){let r=l.sanitizeText(e,f());if(f().securityLevel!==`loose`||t===void 0)return;let i=this.splitClassNameAndType(r).className;if(this.classes.has(i)){let e=[];if(typeof n==`string`){e=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t{let n=this.lookUpDomId(i),r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener(`click`,()=>{g.runFunc(t,...e)},!1)})}}bindFunctions(e){this.functions.forEach(t=>{t(e)})}escapeHtml(e){return e.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,t){let n=t.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){let t=e.split(`.`),n=Array(t.length);n[0]=t[0];for(let e=1;e0?i[e-1]:void 0,o=e===i.length-1,s=o&&t?t:r[e];this.namespaces.has(n)?o&&(this.namespaces.get(n).explicit=!0):this.namespaces.set(n,this.createNamespaceNode(n,s,a,o)),a&&this.linkParentChild(a,n)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,t,n){if(this.namespaces.has(e)){for(let n of t){let{className:t}=this.splitClassNameAndType(n),r=this.getClass(t);r.parent=e,this.namespaces.get(e).classes.set(t,r)}for(let t of n){let n=this.getNote(t);n.parent=e,this.namespaces.get(e).notes.set(t,n)}}}setCssStyle(e,t){let n=this.classes.get(e);if(!(!t||!n))for(let e of t)e.includes(`,`)?n.styles.push(...e.split(`,`)):n.styles.push(e)}getArrowMarker(e){let t;switch(e){case 0:t=`aggregation`;break;case 1:t=`extension`;break;case 2:t=`composition`;break;case 3:t=`dependency`;break;case 4:t=`lollipop`;break;default:t=`none`}return t}resolveExplicitAncestor(e){let t=e;for(;t;){let e=this.namespaces.get(t);if(!e)return;if(e.explicit)return t;t=e.parent}}getData(){let e=[],t=[],n=f(),r=n.class?.hierarchicalNamespaces??!0;for(let t of this.namespaces.values()){if(!r&&!t.explicit)continue;let i={id:t.id,label:r?t.label:t.id,isGroup:!0,padding:n.class.padding??16,shape:`rect`,cssStyles:[],look:n.look,parentId:r?t.parent:void 0};e.push(i)}let i=0;for(let t of this.classes.values()){let a=r?t.parent:this.resolveExplicitAncestor(t.parent),o={...t,type:void 0,isGroup:!1,parentId:a,look:n.look,colorIndex:i++};e.push(o)}for(let i of this.notes.values()){let a=r?i.parent:this.resolveExplicitAncestor(i.parent),o={id:i.id,label:i.text,isGroup:!1,shape:`note`,padding:n.class.padding??6,cssStyles:[`text-align: left`,`white-space: nowrap`,`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:a,labelType:`markdown`};e.push(o);let s=this.classes.get(i.class)?.id;if(s){let e={id:`edgeNote${i.index}`,start:i.id,end:s,type:`normal`,thickness:`normal`,classes:`relation`,arrowTypeStart:`none`,arrowTypeEnd:`none`,arrowheadStyle:``,labelStyle:[``],style:[`fill: none`],pattern:`dotted`,look:n.look};t.push(e)}}for(let t of this.interfaces){let r={id:t.id,label:t.label,isGroup:!1,shape:`rect`,cssStyles:[`opacity: 0;`],look:n.look};e.push(r)}let a=0;for(let e of this.relations){a++;let r={id:h(e.id1,e.id2,{prefix:`id`,counter:a}),start:e.id1,end:e.id2,type:`normal`,label:e.title,labelpos:`c`,thickness:`normal`,classes:`relation`,arrowTypeStart:this.getArrowMarker(e.relation.type1),arrowTypeEnd:this.getArrowMarker(e.relation.type2),startLabelRight:e.relationTitle1===`none`?``:e.relationTitle1,endLabelLeft:e.relationTitle2===`none`?``:e.relationTitle2,arrowheadStyle:``,labelStyle:[`display: inline-block`],style:e.style||``,pattern:e.relation.lineType==1?`dashed`:`solid`,look:n.look,labelType:`markdown`};t.push(r)}return{nodes:e,edges:t,other:{},config:n,direction:this.getDirection()}}},F=t(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!_(t,r))return``;let i=y(e.look),a=b(n),o=``;for(let t=0;t{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`)},styles:t(e=>`${F(e)} + `}return o},`genColor`),I={parser:O,get db(){return new P},renderer:{getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing class diagram (v3)`,t);let{securityLevel:a,state:o,layout:s}=f();i.db.setDiagramId(t);let c=i.db.getData(),l=T(t,a);c.type=i.type,c.layoutAlgorithm=S(s),c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=[`aggregation`,`extension`,`composition`,`dependency`,`lollipop`],c.diagramId=t,await x(c,l),g.insertTitle(l,`classDiagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),E(l,8,`classDiagram`,o?.useMaxWidth??!0)},`draw`),getDir:t((e,t=`TB`)=>{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`)},styles:t(e=>`${F(e)} g.classGroup text { fill: ${e.nodeBorder||e.classText}; stroke: none; @@ -213,5 +213,5 @@ g.classGroup line { } text-align: center; } - ${_()} + ${C()} `,`getStyles`),init:t(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{I as diagram}; \ No newline at end of file diff --git a/web/dist/app-dagre-6A5THRUB.js b/web/dist/app-dagre-6A5THRUB.js index fa3547919..ce1d1c98a 100644 --- a/web/dist/app-dagre-6A5THRUB.js +++ b/web/dist/app-dagre-6A5THRUB.js @@ -1,4 +1,4 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{x as n}from"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import{c as r}from"./app-chunk-7INBJB4K.js";import{a as i,i as a,n as o}from"./app-chunk-5DYCD2WN.js";import{a as s,i as c,l}from"./app-chunk-Z7XXMR3K.js";import{$ as u,A as d,B as f,C as p,D as m,E as h,F as g,G as ee,H as _,I as te,J as ne,K as re,L as ie,M as ae,N as oe,O as se,P as v,Q as y,R as ce,S as le,T as ue,U as de,V as fe,W as pe,X as me,Y as he,Z as b,_ as x,a as S,b as ge,c as _e,d as ve,et as ye,f as C,g as be,h as xe,i as w,it as Se,j as Ce,k as we,l as Te,m as Ee,n as T,nt as De,o as E,p as Oe,q as ke,r as D,rt as Ae,s as je,t as O,tt as k,u as Me,v as Ne,w as Pe,x as Fe,y as Ie,z as A}from"./app-graphlib.js";import{r as Le}from"./app-chunk-UA2S7LBM.js";import{c as Re,i as ze,n as j,o as Be,r as Ve,s as He,t as Ue}from"./app-chunk-3FUC2YCW.js";var We=/\s/;function Ge(e){for(var t=e.length;t--&&We.test(e.charAt(t)););return t}var Ke=/^\s+/;function qe(e){return e&&e.slice(0,Ge(e)+1).replace(Ke,``)}var Je=NaN,Ye=/^[-+]0x[0-9a-f]+$/i,Xe=/^0b[01]+$/i,Ze=/^0o[0-7]+$/i,Qe=parseInt;function $e(e){if(typeof e==`number`)return e;if(ye(e))return Je;if(b(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=b(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=qe(e);var n=Xe.test(e);return n||Ze.test(e)?Qe(e.slice(2),n?2:8):Ye.test(e)?Je:+e}var et=1/0,tt=17976931348623157e292;function M(e){return e?(e=$e(e),e===et||e===-et?(e<0?-1:1)*tt:e===e?e:0):e===0?e:0}function nt(e){var t=M(e),n=t%1;return t===t?n?t-n:t:0}var rt=Object.create,it=function(){function e(){}return function(t){if(!b(t))return{};if(rt)return rt(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function at(e,t){var n=-1,r=e.length;for(t||=Array(r);++n1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&I(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r2?t[2]:void 0;for(i&&I(t[0],t[1],i)&&(r=1);++n-1?i[a?t[o]:o]:void 0}}var sr=Math.max;function cr(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:nt(n);return i<0&&(i=sr(r+i,0)),pe(e,C(t,3),i)}var lr=or(cr);function ur(e,t){var n=-1,r=A(e)?Array(e.length):[];return Te(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function H(e,t){return(y(e)?u:ur)(e,C(t,3))}function dr(e,t){return e==null?e:ve(e,je(t),L)}function fr(e,t){return e&&Me(e,je(t))}function pr(e,t){return e>t}var mr=Object.prototype.hasOwnProperty;function hr(e,t){return e!=null&&mr.call(e,t)}function gr(e,t){return e!=null&&xe(e,t,hr)}var _r=`[object String]`;function vr(e){return typeof e==`string`||!y(e)&&k(e)&&De(e)==_r}function yr(e,t){return et||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Or(e,t,n){t=t.length?u(t,function(e){return y(e)?function(t){return ue(t,e.length===1?e[0]:e)}:e}):[me];var r=-1;return t=u(t,g(C)),Tr(ur(e,function(e,n,i){return{criteria:u(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return Dr(e,t,n)})}var kr=Oe(`length`),Ar=`\\ud800-\\udfff`,jr=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,Mr=`\\ufe0e\\ufe0f`,Nr=`[`+Ar+`]`,Pr=`[`+jr+`]`,Fr=`\\ud83c[\\udffb-\\udfff]`,Ir=`(?:`+Pr+`|`+Fr+`)`,Lr=`[^`+Ar+`]`,Rr=`(?:\\ud83c[\\udde6-\\uddff]){2}`,zr=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Br=`\\u200d`,Vr=Ir+`?`,Hr=`[`+Mr+`]?`,Ur=`(?:`+Br+`(?:`+[Lr,Rr,zr].join(`|`)+`)`+Hr+Vr+`)*`,Wr=Hr+Vr+Ur,Gr=`(?:`+[Lr+Pr+`?`,Pr,Rr,zr,Nr].join(`|`)+`)`,Kr=RegExp(Fr+`(?=`+Fr+`)|`+Gr+Wr,`g`);function qr(e){for(var t=Kr.lastIndex=0;Kr.test(e);)++t;return t}function Jr(e){return xt(e)?qr(e):kr(e)}function Yr(e,t){return wr(e,t,function(t,n){return Ee(e,n)})}var K=dt(function(e,t){return e==null?{}:Yr(e,t)}),Xr=Math.ceil,Zr=Math.max;function Qr(e,t,n,r){for(var i=-1,a=Zr(Xr((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function $r(e){return function(t,n,r){return r&&typeof r!=`number`&&I(t,n,r)&&(n=r=void 0),t=M(t),n===void 0?(n=t,t=0):n=M(n),r=r===void 0?t1&&I(e,t[0],t[1])?t=[]:n>2&&I(t[0],t[1],t[2])&&(t=[t[0]]),Or(e,p(t,1),[])}),ri=0;function ii(e){var t=++ri;return se(e)+t}function ai(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r0;--s)if(o=t[s].dequeue(),o){r=r.concat(pi(e,t,n,o,!0));break}}}return r}function pi(e,t,n,r,i){var a=i?[]:void 0;return E(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,hi(t,n,s)}),E(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,hi(t,n,o)}),e.removeNode(r.v),a}function mi(e,t){var n=new O,r=0,i=0;E(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),E(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=q(i+r+3).map(function(){return new si}),o=r+1;return E(n.nodes(),function(e){hi(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function hi(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function gi(e){var t=e.graph().acyclicer===`greedy`?di(e,n(e)):_i(e);E(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,ii(`rev`))});function n(e){return function(t){return e.edge(t).weight}}}function _i(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,E(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return E(e.nodes(),i),t}function vi(e){E(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Y(e,t,n,r){var i;do i=ii(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function yi(e){var t=new O().setGraph(e.graph());return E(e.nodes(),function(n){t.setNode(n,e.node(n))}),E(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function bi(e){var t=new O({multigraph:e.isMultigraph()}).setGraph(e.graph());return E(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),E(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function xi(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function X(e){var t=H(q(Ti(e)+1),function(){return[]});return E(e.nodes(),function(n){var r=e.node(n),i=r.rank;D(i)||(t[i][r.order]=n)}),t}function Si(e){var t=G(H(e.nodes(),function(t){return e.node(t).rank}));E(e.nodes(),function(n){var r=e.node(n);gr(r,`rank`)&&(r.rank-=t)})}function Ci(e){var t=G(H(e.nodes(),function(t){return e.node(t).rank})),n=[];E(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;E(n,function(t,n){D(t)&&n%i!==0?--r:r&&E(t,function(t){e.node(t).rank+=r})})}function wi(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Y(e,`border`,i,t)}function Ti(e){return W(H(e.nodes(),function(t){var n=e.node(t).rank;if(!D(n))return n}))}function Ei(e,t){var n={lhs:[],rhs:[]};return E(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Di(e,t){var n=Zn();try{return t()}finally{console.log(e+` time: `+(Zn()-n)+`ms`)}}function Oi(e,t){return t()}function ki(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&E(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;ao.lim&&(s=o,c=!0),Sr(S(t.edges(),function(t){return c===ca(e,e.node(t.v),s)&&c!==ca(e,e.node(t.w),s)}),function(e){return Z(t,e)})}function aa(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),ta(e),Qi(e,t),oa(e,t)}function oa(e,t){var n=Zi(e,lr(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),E(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function sa(e,t,n){return e.hasEdge(t,n)}function ca(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function la(e){switch(e.graph().ranker){case`network-simplex`:fa(e);break;case`tight-tree`:da(e);break;case`longest-path`:ua(e);break;default:fa(e)}}var ua=Hi;function da(e){Hi(e),Ui(e)}function fa(e){$(e)}function pa(e){var t=Y(e,`root`,{},`_root`),n=ha(e),r=W(w(n))-1,i=2*r+1;e.graph().nestingRoot=t,E(e.edges(),function(t){e.edge(t).minlen*=i});var a=ga(e)+1;E(e.children(),function(o){ma(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function ma(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var c=wi(e,`_bt`),l=wi(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,E(s,function(s){ma(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function ha(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&E(a,function(e){n(e,i+1)}),t[r]=i}return E(e.children(),function(e){n(e,1)}),t}function ga(e){return T(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function _a(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,E(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function va(e,t,n){var r={},i;E(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function ya(e,t,n){var r=ba(e),i=new O({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return E(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),E(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=D(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function ba(e){for(var t;e.hasNode(t=ii(`_root`)););return t}function xa(e,t){for(var n=0,r=1;r0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function Ca(e){var t={},n=S(e.nodes(),function(t){return!e.children(t).length}),r=H(q(W(H(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){gr(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),E(e.successors(n),i))}var a=J(n,function(t){return e.node(t).rank});return E(a,i),r}function wa(e,t){return H(t,function(t){var n=e.inEdges(t);if(n.length){var r=T(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}function Ta(e,t){var n={};return E(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};D(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),E(t.edges(),function(e){var t=n[e.v],r=n[e.w];!D(t)&&!D(r)&&(r.indegree++,t.out.push(n[e.w]))}),Ea(S(n,function(e){return!e.indegree}))}function Ea(e){var t=[];function n(e){return function(t){t.merged||(D(t.barycenter)||D(e.barycenter)||t.barycenter>=e.barycenter)&&Da(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),E(i.in.reverse(),n(i)),E(i.out,r(i))}return H(S(t,function(e){return!e.merged}),function(e){return K(e,[`vs`,`i`,`barycenter`,`weight`])})}function Da(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Oa(e,t){var n=Ei(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=J(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Aa(!!t)),c=ka(a,i,c),E(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=ka(a,i,c)});var l={vs:R(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function ka(e,t,n){for(var r;t.length&&(r=V(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Aa(e){return function(t,n){return t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}}function ja(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=S(i,function(e){return e!==o&&e!==s}));var l=wa(e,i);E(l,function(t){if(e.children(t.v).length){var i=ja(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&Na(t,i)}});var u=Ta(l,n);Ma(u,c);var d=Oa(u,r);if(o&&(d.vs=R([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function Ma(e,t){E(e,function(e){e.vs=R(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function Na(e,t){D(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Pa(e){var t=Ti(e),n=Fa(e,q(1,t+1),`inEdges`),r=Fa(e,q(t-1,-1,-1),`outEdges`),i=Ca(e);La(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){Ia(s%2?n:r,s%4>=2),i=X(e);var l=xa(e,i);lo||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Ba(e){var t={},n=0;function r(i){var a=n;E(e.children(i),r),t[i]={low:a,lim:n++}}return E(e.children(),r),t}function Va(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=V(r);return E(r,function(t,c){var l=Ua(e,t),u=l?e.node(l).order:o;(l||t===s)&&(E(r.slice(a,c+1),function(t){E(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(oo)&&Wa(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return E(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return T(t,i),n}function Ua(e,t){if(e.node(t).dummy)return lr(e.predecessors(t),function(t){return e.node(t).dummy})}function Wa(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ga(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Ka(e,t,n,r){var i={},a={},o={};return E(t,function(e){E(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),E(t,function(e){var t=-1;E(e,function(e){var s=r(e);if(s.length){s=J(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t{var t=n(` buildLayoutGraph`,()=>ho(e));n(` runLayout`,()=>io(t,n)),n(` updateInputGraph`,()=>ao(e,t))})}function io(e,t){t(` makeSpaceForEdgeLabels`,()=>go(e)),t(` removeSelfEdges`,()=>To(e)),t(` acyclic`,()=>gi(e)),t(` nestingGraph.run`,()=>pa(e)),t(` rank`,()=>la(bi(e))),t(` injectEdgeLabelProxies`,()=>_o(e)),t(` removeEmptyRanks`,()=>Ci(e)),t(` nestingGraph.cleanup`,()=>_a(e)),t(` normalizeRanks`,()=>Si(e)),t(` assignRankMinMax`,()=>vo(e)),t(` removeEdgeLabelProxies`,()=>yo(e)),t(` normalize.run`,()=>zi(e)),t(` parentDummyChains`,()=>Ra(e)),t(` addBorderSegments`,()=>ki(e)),t(` order`,()=>Pa(e)),t(` insertSelfEdges`,()=>Eo(e)),t(` adjustCoordinateSystem`,()=>ji(e)),t(` position`,()=>to(e)),t(` positionSelfEdges`,()=>Do(e)),t(` removeBorderNodes`,()=>wo(e)),t(` normalize.undo`,()=>Vi(e)),t(` fixupEdgeLabelCoords`,()=>So(e)),t(` undoCoordinateSystem`,()=>Mi(e)),t(` translateGraph`,()=>bo(e)),t(` assignNodeIntersects`,()=>xo(e)),t(` reversePoints`,()=>Co(e)),t(` acyclic.undo`,()=>vi(e))}function ao(e,t){E(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),E(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var oo=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],so={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},co=[`acyclicer`,`ranker`,`rankdir`,`align`],lo=[`width`,`height`],uo={width:0,height:0},fo=[`minlen`,`weight`,`width`,`height`,`labeloffset`],po={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},mo=[`labelpos`];function ho(e){var t=new O({multigraph:!0,compound:!0}),n=ko(e.graph());return t.setGraph(xr({},so,Oo(n,oo),K(n,co))),E(e.nodes(),function(n){var r=ko(e.node(n));t.setNode(n,er(Oo(r,lo),uo)),t.setParent(n,e.parent(n))}),E(e.edges(),function(n){var r=ko(e.edge(n));t.setEdge(n,xr({},po,Oo(r,fo),K(r,mo)))}),t}function go(e){var t=e.graph();t.ranksep/=2,E(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function _o(e){E(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);Y(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function vo(e){var t=0;E(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=W(t,r.maxRank))}),e.graph().maxRank=t}function yo(e){E(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function bo(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}E(e.nodes(),function(t){c(e.node(t))}),E(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,E(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),E(e.edges(),function(n){var i=e.edge(n);E(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function xo(e){E(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(xi(r,a)),n.points.push(xi(i,o))})}function So(e){E(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(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}})}function Co(e){E(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function wo(e){E(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(V(n.borderLeft)),o=e.node(V(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),E(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function To(e){E(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Eo(e){var t=X(e);E(t,function(t){var n=0;E(t,function(t,r){var i=e.node(t);i.order=r+n,E(i.selfEdges,function(t){Y(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Do(e){E(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Oo(e,t){return U(K(e,t),Number)}function ko(e){var t={};return E(e,function(e,n){t[n.toLowerCase()]=e}),t}var Ao=e((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),jo=e((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),Mo=e(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`||e===`er`||e===`classDiagram`,`shouldMergeSelfLoopSegments`),No=[`x`,`y`,`width`,`height`,`labelBBox`,`intersect`,`calcIntersect`,`diff`,`clusterNode`],Po=e((e,t,n,r,i)=>{let a=[],o=new Set;if(n.forEach(({start:e,end:t})=>{e!==r&&o.add(e),t!==r&&o.add(t)}),o.forEach(t=>{let n=e.node(t);typeof n?.x==`number`&&typeof n?.y==`number`&&a.push(n)}),a.length===0&&n.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{typeof e?.x==`number`&&typeof e?.y==`number`&&a.push(e)})}),a.length===0)return jo(i);let s=a.reduce((e,t)=>({x:e.x+t.x/a.length,y:e.y+t.y/a.length}),{x:0,y:0}),c=s.x-t.x,l=s.y-t.y;return Math.abs(c)>Math.abs(l)?c>0?`right`:`left`:Math.abs(l)>0?l>0?`bottom`:`top`:jo(i)},`getSelfLoopSide`),Fo=e((e,t=`top`,n=0,r=0)=>{let i=e.x,a=e.y-n,o=e.width/2,s=e.height/2,c=Math.max(36,Math.min(100,e.width*.8)),l=Ao(Math.max(r,e.width*.35),36,c),u=Ao(Math.min(e.width,e.height)*.45,24,48);switch(t){case`bottom`:{let e=a+s;return[{x:i-l/2,y:e},{x:i-l/2,y:e+u},{x:i+l/2,y:e+u},{x:i+l/2,y:e}]}case`right`:{let e=i+o;return[{x:e,y:a-l/2},{x:e+u,y:a-l/2},{x:e+u,y:a+l/2},{x:e,y:a+l/2}]}case`left`:{let e=i-o;return[{x:e,y:a-l/2},{x:e-u,y:a-l/2},{x:e-u,y:a+l/2},{x:e,y:a+l/2}]}default:{let e=a-s;return[{x:i-l/2,y:e},{x:i-l/2,y:e-u},{x:i+l/2,y:e-u},{x:i+l/2,y:e}]}}},`getSelfLoopPoints`),Io=e((e,t,n=`top`,r=0,i={})=>{let a=e.x,o=e.y-r,s=i.width??0,c=i.height??0;switch(n){case`bottom`:return{x:a,y:Math.max(...t.map(e=>e.y))+c/2+4};case`right`:return{x:Math.max(...t.map(e=>e.x))+s/2+4,y:o};case`left`:return{x:Math.min(...t.map(e=>e.x))-s/2-4,y:o};default:return{x:a,y:Math.min(...t.map(e=>e.y))-c/2-4}}},`getSelfLoopLabelPosition`),Lo=e((e,t=0,{mergeSelfLoops:n=!0}={})=>{let r=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(t=>{let a=e.edge(t);if(n&&a.selfLoop){let e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:t.v,end:t.w})}else i.push({edge:a,start:t.v,end:t.w})}),r.forEach(n=>{if(n.length!==3){n.forEach(e=>i.push(e));return}n.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);let[r,o,s]=n,c=r.edge.originalEdge??o.edge.originalEdge??s.edge.originalEdge??o.edge,l=e.node(c.start);if(!l){n.forEach(e=>i.push(e));return}let u={width:o.edge.width,height:o.edge.height},d=Po(e,l,n,c.start,a),f=Fo(l,d,t,u.width??0),p=Io(l,f,d,t,u),m={...o.edge,...c,id:c.id,points:f,start:c.start,end:c.end,x:p.x,y:p.y,width:u.width,height:u.height,labelStyle:o.edge.labelStyle,fromCluster:r.edge.fromCluster??o.edge.fromCluster??s.edge.fromCluster,toCluster:r.edge.toCluster??o.edge.toCluster??s.edge.toCluster};delete m.selfLoop,delete m.originalEdge,i.push({edge:m,start:m.start,end:m.end})}),i},`getEdgesToRender`),Ro=e(async({element:n,graph:a,diagramType:c,id:l,parentCluster:u,siteConfig:d})=>{let f=a.graph().rankdir;t.trace(`Dir in recursive render - dir:`,f);let{clusters:p,edgePaths:m,edgeLabels:h,nodes:g,rootGroups:ee}=ze(n,{edgePathsClass:`edgePaths`});a.nodes()?t.info(`Recursive render XXX`,a.nodes()):t.info(`No nodes found for`,a),a.edges().length>0&&t.info(`Recursive edges`,a.edge(a.edges()[0]));let _=Mo(c);await Promise.all(a.nodes().map(async function(e){let n=a.node(e);if(u!==void 0){let n=JSON.parse(JSON.stringify(u.clusterData));t.trace(`Setting data for parent cluster XXX +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{x as n}from"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{c as r}from"./app-chunk-7INBJB4K.js";import{a as i,i as a,n as o}from"./app-chunk-5DYCD2WN.js";import{r as s}from"./app-chunk-UA2S7LBM.js";import{a as c,i as l,l as u}from"./app-chunk-Z7XXMR3K.js";import{$ as d,A as f,B as p,C as m,D as h,E as g,F as _,G as ee,H as v,I as te,J as ne,K as re,L as ie,M as ae,N as oe,O as se,P as y,Q as b,R as ce,S as le,T as ue,U as de,V as fe,W as pe,X as me,Y as he,Z as x,_ as S,a as C,b as ge,c as _e,d as ve,et as w,f as T,g as ye,h as be,i as E,it as xe,j as Se,k as Ce,l as we,m as Te,n as D,nt as Ee,o as O,p as De,q as Oe,r as k,rt as ke,s as Ae,t as A,tt as j,u as je,v as Me,w as Ne,x as Pe,y as Fe,z as M}from"./app-graphlib.js";import{c as Ie,i as Le,n as N,o as Re,r as ze,s as Be,t as Ve}from"./app-chunk-3FUC2YCW.js";var He=/\s/;function Ue(e){for(var t=e.length;t--&&He.test(e.charAt(t)););return t}var We=/^\s+/;function Ge(e){return e&&e.slice(0,Ue(e)+1).replace(We,``)}var Ke=NaN,qe=/^[-+]0x[0-9a-f]+$/i,Je=/^0b[01]+$/i,Ye=/^0o[0-7]+$/i,Xe=parseInt;function Ze(e){if(typeof e==`number`)return e;if(w(e))return Ke;if(x(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=x(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Ge(e);var n=Je.test(e);return n||Ye.test(e)?Xe(e.slice(2),n?2:8):qe.test(e)?Ke:+e}var Qe=1/0,$e=17976931348623157e292;function P(e){return e?(e=Ze(e),e===Qe||e===-Qe?(e<0?-1:1)*$e:e===e?e:0):e===0?e:0}function et(e){var t=P(e),n=t%1;return t===t?n?t-n:t:0}var tt=Object.create,nt=function(){function e(){}return function(t){if(!x(t))return{};if(tt)return tt(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function rt(e,t){var n=-1,r=e.length;for(t||=Array(r);++n1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&L(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r2?t[2]:void 0;for(i&&L(t[0],t[1],i)&&(r=1);++n-1?i[a?t[o]:o]:void 0}}var or=Math.max;function sr(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:et(n);return i<0&&(i=or(r+i,0)),pe(e,T(t,3),i)}var cr=ar(sr);function lr(e,t){var n=-1,r=M(e)?Array(e.length):[];return we(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function U(e,t){return(b(e)?d:lr)(e,T(t,3))}function ur(e,t){return e==null?e:ve(e,Ae(t),R)}function dr(e,t){return e&&je(e,Ae(t))}function fr(e,t){return e>t}var pr=Object.prototype.hasOwnProperty;function mr(e,t){return e!=null&&pr.call(e,t)}function hr(e,t){return e!=null&&be(e,t,mr)}var gr=`[object String]`;function _r(e){return typeof e==`string`||!b(e)&&j(e)&&Ee(e)==gr}function vr(e,t){return et||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Dr(e,t,n){t=t.length?d(t,function(e){return b(e)?function(t){return ue(t,e.length===1?e[0]:e)}:e}):[me];var r=-1;return t=d(t,_(T)),wr(lr(e,function(e,n,i){return{criteria:d(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return Er(e,t,n)})}var Or=De(`length`),kr=`\\ud800-\\udfff`,Ar=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,jr=`\\ufe0e\\ufe0f`,Mr=`[`+kr+`]`,Nr=`[`+Ar+`]`,Pr=`\\ud83c[\\udffb-\\udfff]`,Fr=`(?:`+Nr+`|`+Pr+`)`,Ir=`[^`+kr+`]`,Lr=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Rr=`[\\ud800-\\udbff][\\udc00-\\udfff]`,zr=`\\u200d`,Br=Fr+`?`,Vr=`[`+jr+`]?`,Hr=`(?:`+zr+`(?:`+[Ir,Lr,Rr].join(`|`)+`)`+Vr+Br+`)*`,Ur=Vr+Br+Hr,Wr=`(?:`+[Ir+Nr+`?`,Nr,Lr,Rr,Mr].join(`|`)+`)`,Gr=RegExp(Pr+`(?=`+Pr+`)|`+Wr+Ur,`g`);function Kr(e){for(var t=Gr.lastIndex=0;Gr.test(e);)++t;return t}function qr(e){return bt(e)?Kr(e):Or(e)}function Jr(e,t){return Cr(e,t,function(t,n){return Te(e,n)})}var q=ut(function(e,t){return e==null?{}:Jr(e,t)}),Yr=Math.ceil,Xr=Math.max;function Zr(e,t,n,r){for(var i=-1,a=Xr(Yr((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function Qr(e){return function(t,n,r){return r&&typeof r!=`number`&&L(t,n,r)&&(n=r=void 0),t=P(t),n===void 0?(n=t,t=0):n=P(n),r=r===void 0?t1&&L(e,t[0],t[1])?t=[]:n>2&&L(t[0],t[1],t[2])&&(t=[t[0]]),Dr(e,m(t,1),[])}),ni=0;function ri(e){var t=++ni;return se(e)+t}function ii(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r0;--s)if(o=t[s].dequeue(),o){r=r.concat(fi(e,t,n,o,!0));break}}}return r}function fi(e,t,n,r,i){var a=i?[]:void 0;return O(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,mi(t,n,s)}),O(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,mi(t,n,o)}),e.removeNode(r.v),a}function pi(e,t){var n=new A,r=0,i=0;O(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),O(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=J(i+r+3).map(function(){return new oi}),o=r+1;return O(n.nodes(),function(e){mi(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function mi(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function hi(e){var t=e.graph().acyclicer===`greedy`?ui(e,n(e)):gi(e);O(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,ri(`rev`))});function n(e){return function(t){return e.edge(t).weight}}}function gi(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,O(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return O(e.nodes(),i),t}function _i(e){O(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function X(e,t,n,r){var i;do i=ri(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function vi(e){var t=new A().setGraph(e.graph());return O(e.nodes(),function(n){t.setNode(n,e.node(n))}),O(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function yi(e){var t=new A({multigraph:e.isMultigraph()}).setGraph(e.graph());return O(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),O(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function bi(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function Z(e){var t=U(J(wi(e)+1),function(){return[]});return O(e.nodes(),function(n){var r=e.node(n),i=r.rank;k(i)||(t[i][r.order]=n)}),t}function xi(e){var t=K(U(e.nodes(),function(t){return e.node(t).rank}));O(e.nodes(),function(n){var r=e.node(n);hr(r,`rank`)&&(r.rank-=t)})}function Si(e){var t=K(U(e.nodes(),function(t){return e.node(t).rank})),n=[];O(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;O(n,function(t,n){k(t)&&n%i!==0?--r:r&&O(t,function(t){e.node(t).rank+=r})})}function Ci(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),X(e,`border`,i,t)}function wi(e){return G(U(e.nodes(),function(t){var n=e.node(t).rank;if(!k(n))return n}))}function Ti(e,t){var n={lhs:[],rhs:[]};return O(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Ei(e,t){var n=Xn();try{return t()}finally{console.log(e+` time: `+(Xn()-n)+`ms`)}}function Di(e,t){return t()}function Oi(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&O(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;ao.lim&&(s=o,c=!0),xr(C(t.edges(),function(t){return c===ca(e,e.node(t.v),s)&&c!==ca(e,e.node(t.w),s)}),function(e){return Q(t,e)})}function aa(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),ta(e),Qi(e,t),oa(e,t)}function oa(e,t){var n=Zi(e,cr(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),O(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function sa(e,t,n){return e.hasEdge(t,n)}function ca(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function la(e){switch(e.graph().ranker){case`network-simplex`:fa(e);break;case`tight-tree`:da(e);break;case`longest-path`:ua(e);break;default:fa(e)}}var ua=Vi;function da(e){Vi(e),Hi(e)}function fa(e){$(e)}function pa(e){var t=X(e,`root`,{},`_root`),n=ha(e),r=G(E(n))-1,i=2*r+1;e.graph().nestingRoot=t,O(e.edges(),function(t){e.edge(t).minlen*=i});var a=ga(e)+1;O(e.children(),function(o){ma(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function ma(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var c=Ci(e,`_bt`),l=Ci(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,O(s,function(s){ma(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function ha(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&O(a,function(e){n(e,i+1)}),t[r]=i}return O(e.children(),function(e){n(e,1)}),t}function ga(e){return D(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function _a(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,O(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function va(e,t,n){var r={},i;O(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function ya(e,t,n){var r=ba(e),i=new A({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return O(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),O(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=k(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function ba(e){for(var t;e.hasNode(t=ri(`_root`)););return t}function xa(e,t){for(var n=0,r=1;r0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function Ca(e){var t={},n=C(e.nodes(),function(t){return!e.children(t).length}),r=U(J(G(U(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){hr(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),O(e.successors(n),i))}var a=Y(n,function(t){return e.node(t).rank});return O(a,i),r}function wa(e,t){return U(t,function(t){var n=e.inEdges(t);if(n.length){var r=D(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}function Ta(e,t){var n={};return O(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};k(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),O(t.edges(),function(e){var t=n[e.v],r=n[e.w];!k(t)&&!k(r)&&(r.indegree++,t.out.push(n[e.w]))}),Ea(C(n,function(e){return!e.indegree}))}function Ea(e){var t=[];function n(e){return function(t){t.merged||(k(t.barycenter)||k(e.barycenter)||t.barycenter>=e.barycenter)&&Da(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),O(i.in.reverse(),n(i)),O(i.out,r(i))}return U(C(t,function(e){return!e.merged}),function(e){return q(e,[`vs`,`i`,`barycenter`,`weight`])})}function Da(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Oa(e,t){var n=Ti(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=Y(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Aa(!!t)),c=ka(a,i,c),O(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=ka(a,i,c)});var l={vs:z(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function ka(e,t,n){for(var r;t.length&&(r=H(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Aa(e){return function(t,n){return t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}}function ja(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=C(i,function(e){return e!==o&&e!==s}));var l=wa(e,i);O(l,function(t){if(e.children(t.v).length){var i=ja(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&Na(t,i)}});var u=Ta(l,n);Ma(u,c);var d=Oa(u,r);if(o&&(d.vs=z([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function Ma(e,t){O(e,function(e){e.vs=z(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function Na(e,t){k(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Pa(e){var t=wi(e),n=Fa(e,J(1,t+1),`inEdges`),r=Fa(e,J(t-1,-1,-1),`outEdges`),i=Ca(e);La(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){Ia(s%2?n:r,s%4>=2),i=Z(e);var l=xa(e,i);lo||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Ba(e){var t={},n=0;function r(i){var a=n;O(e.children(i),r),t[i]={low:a,lim:n++}}return O(e.children(),r),t}function Va(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=H(r);return O(r,function(t,c){var l=Ua(e,t),u=l?e.node(l).order:o;(l||t===s)&&(O(r.slice(a,c+1),function(t){O(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(oo)&&Wa(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return O(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return D(t,i),n}function Ua(e,t){if(e.node(t).dummy)return cr(e.predecessors(t),function(t){return e.node(t).dummy})}function Wa(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ga(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Ka(e,t,n,r){var i={},a={},o={};return O(t,function(e){O(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),O(t,function(e){var t=-1;O(e,function(e){var s=r(e);if(s.length){s=Y(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t{var t=n(` buildLayoutGraph`,()=>ho(e));n(` runLayout`,()=>io(t,n)),n(` updateInputGraph`,()=>ao(e,t))})}function io(e,t){t(` makeSpaceForEdgeLabels`,()=>go(e)),t(` removeSelfEdges`,()=>To(e)),t(` acyclic`,()=>hi(e)),t(` nestingGraph.run`,()=>pa(e)),t(` rank`,()=>la(yi(e))),t(` injectEdgeLabelProxies`,()=>_o(e)),t(` removeEmptyRanks`,()=>Si(e)),t(` nestingGraph.cleanup`,()=>_a(e)),t(` normalizeRanks`,()=>xi(e)),t(` assignRankMinMax`,()=>vo(e)),t(` removeEdgeLabelProxies`,()=>yo(e)),t(` normalize.run`,()=>Ri(e)),t(` parentDummyChains`,()=>Ra(e)),t(` addBorderSegments`,()=>Oi(e)),t(` order`,()=>Pa(e)),t(` insertSelfEdges`,()=>Eo(e)),t(` adjustCoordinateSystem`,()=>Ai(e)),t(` position`,()=>to(e)),t(` positionSelfEdges`,()=>Do(e)),t(` removeBorderNodes`,()=>wo(e)),t(` normalize.undo`,()=>Bi(e)),t(` fixupEdgeLabelCoords`,()=>So(e)),t(` undoCoordinateSystem`,()=>ji(e)),t(` translateGraph`,()=>bo(e)),t(` assignNodeIntersects`,()=>xo(e)),t(` reversePoints`,()=>Co(e)),t(` acyclic.undo`,()=>_i(e))}function ao(e,t){O(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),O(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var oo=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],so={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},co=[`acyclicer`,`ranker`,`rankdir`,`align`],lo=[`width`,`height`],uo={width:0,height:0},fo=[`minlen`,`weight`,`width`,`height`,`labeloffset`],po={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},mo=[`labelpos`];function ho(e){var t=new A({multigraph:!0,compound:!0}),n=ko(e.graph());return t.setGraph(br({},so,Oo(n,oo),q(n,co))),O(e.nodes(),function(n){var r=ko(e.node(n));t.setNode(n,$n(Oo(r,lo),uo)),t.setParent(n,e.parent(n))}),O(e.edges(),function(n){var r=ko(e.edge(n));t.setEdge(n,br({},po,Oo(r,fo),q(r,mo)))}),t}function go(e){var t=e.graph();t.ranksep/=2,O(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function _o(e){O(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);X(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function vo(e){var t=0;O(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=G(t,r.maxRank))}),e.graph().maxRank=t}function yo(e){O(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function bo(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}O(e.nodes(),function(t){c(e.node(t))}),O(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,O(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),O(e.edges(),function(n){var i=e.edge(n);O(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function xo(e){O(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(bi(r,a)),n.points.push(bi(i,o))})}function So(e){O(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(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}})}function Co(e){O(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function wo(e){O(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(H(n.borderLeft)),o=e.node(H(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),O(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function To(e){O(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Eo(e){var t=Z(e);O(t,function(t){var n=0;O(t,function(t,r){var i=e.node(t);i.order=r+n,O(i.selfEdges,function(t){X(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Do(e){O(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Oo(e,t){return W(q(e,t),Number)}function ko(e){var t={};return O(e,function(e,n){t[n.toLowerCase()]=e}),t}var Ao=e((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),jo=e((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),Mo=e(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`||e===`er`||e===`classDiagram`,`shouldMergeSelfLoopSegments`),No=[`x`,`y`,`width`,`height`,`labelBBox`,`intersect`,`calcIntersect`,`diff`,`clusterNode`],Po=e((e,t,n,r,i)=>{let a=[],o=new Set;if(n.forEach(({start:e,end:t})=>{e!==r&&o.add(e),t!==r&&o.add(t)}),o.forEach(t=>{let n=e.node(t);typeof n?.x==`number`&&typeof n?.y==`number`&&a.push(n)}),a.length===0&&n.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{typeof e?.x==`number`&&typeof e?.y==`number`&&a.push(e)})}),a.length===0)return jo(i);let s=a.reduce((e,t)=>({x:e.x+t.x/a.length,y:e.y+t.y/a.length}),{x:0,y:0}),c=s.x-t.x,l=s.y-t.y;return Math.abs(c)>Math.abs(l)?c>0?`right`:`left`:Math.abs(l)>0?l>0?`bottom`:`top`:jo(i)},`getSelfLoopSide`),Fo=e((e,t=`top`,n=0,r=0)=>{let i=e.x,a=e.y-n,o=e.width/2,s=e.height/2,c=Math.max(36,Math.min(100,e.width*.8)),l=Ao(Math.max(r,e.width*.35),36,c),u=Ao(Math.min(e.width,e.height)*.45,24,48);switch(t){case`bottom`:{let e=a+s;return[{x:i-l/2,y:e},{x:i-l/2,y:e+u},{x:i+l/2,y:e+u},{x:i+l/2,y:e}]}case`right`:{let e=i+o;return[{x:e,y:a-l/2},{x:e+u,y:a-l/2},{x:e+u,y:a+l/2},{x:e,y:a+l/2}]}case`left`:{let e=i-o;return[{x:e,y:a-l/2},{x:e-u,y:a-l/2},{x:e-u,y:a+l/2},{x:e,y:a+l/2}]}default:{let e=a-s;return[{x:i-l/2,y:e},{x:i-l/2,y:e-u},{x:i+l/2,y:e-u},{x:i+l/2,y:e}]}}},`getSelfLoopPoints`),Io=e((e,t,n=`top`,r=0,i={})=>{let a=e.x,o=e.y-r,s=i.width??0,c=i.height??0;switch(n){case`bottom`:return{x:a,y:Math.max(...t.map(e=>e.y))+c/2+4};case`right`:return{x:Math.max(...t.map(e=>e.x))+s/2+4,y:o};case`left`:return{x:Math.min(...t.map(e=>e.x))-s/2-4,y:o};default:return{x:a,y:Math.min(...t.map(e=>e.y))-c/2-4}}},`getSelfLoopLabelPosition`),Lo=e((e,t=0,{mergeSelfLoops:n=!0}={})=>{let r=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(t=>{let a=e.edge(t);if(n&&a.selfLoop){let e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:t.v,end:t.w})}else i.push({edge:a,start:t.v,end:t.w})}),r.forEach(n=>{if(n.length!==3){n.forEach(e=>i.push(e));return}n.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);let[r,o,s]=n,c=r.edge.originalEdge??o.edge.originalEdge??s.edge.originalEdge??o.edge,l=e.node(c.start);if(!l){n.forEach(e=>i.push(e));return}let u={width:o.edge.width,height:o.edge.height},d=Po(e,l,n,c.start,a),f=Fo(l,d,t,u.width??0),p=Io(l,f,d,t,u),m={...o.edge,...c,id:c.id,points:f,start:c.start,end:c.end,x:p.x,y:p.y,width:u.width,height:u.height,labelStyle:o.edge.labelStyle,fromCluster:r.edge.fromCluster??o.edge.fromCluster??s.edge.fromCluster,toCluster:r.edge.toCluster??o.edge.toCluster??s.edge.toCluster};delete m.selfLoop,delete m.originalEdge,i.push({edge:m,start:m.start,end:m.end})}),i},`getEdgesToRender`),Ro=e(async({element:n,graph:a,diagramType:s,id:l,parentCluster:u,siteConfig:d})=>{let f=a.graph().rankdir;t.trace(`Dir in recursive render - dir:`,f);let{clusters:p,edgePaths:m,edgeLabels:h,nodes:g,rootGroups:_}=Le(n,{edgePathsClass:`edgePaths`});a.nodes()?t.info(`Recursive render XXX`,a.nodes()):t.info(`No nodes found for`,a),a.edges().length>0&&t.info(`Recursive edges`,a.edge(a.edges()[0]));let ee=Mo(s);await Promise.all(a.nodes().map(async function(e){let n=a.node(e);if(u!==void 0){let n=JSON.parse(JSON.stringify(u.clusterData));t.trace(`Setting data for parent cluster XXX Node.id = `,e,` data=`,n.height,` -Parent cluster`,u.height),a.setNode(u.id,n),a.parent(e)||(t.trace(`Setting parent`,e,u.id),a.setParent(e,u.id,n))}if(t.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(a.node(e))),n?.clusterNode){t.info(`Cluster identified XBX`,e,n.width,a.node(e));let{ranksep:o,nodesep:s}=a.graph();n.graph.setGraph({...n.graph.graph(),ranksep:o+25,nodesep:s});let u=await Go({element:g,graph:n.graph,diagramType:c,id:l,parentCluster:a.node(e),siteConfig:d}),f=u.elem;r(n,f),n.diff=u.diff||0,t.info(`New compound node after recursive render XAX`,e,`width`,n.width,`height`,n.height),i(f,n)}else a.children(e).length>0?(t.trace(`Cluster - the non recursive path XBX`,e,n.id,n,n.width,`Graph:`,a),t.trace(Be(n.id,a)),j.set(n.id,{id:Be(n.id,a),node:n})):(t.trace(`Node - the non recursive path XAX`,e,g,a.node(e),f),await He(g,a.node(e),{config:d,dir:f}))})),await e(async()=>{let e=a.edges().map(async function(e){let n=a.edge(e.v,e.w,e.name);if(t.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),t.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(a.edge(e))),t.info(`Fix`,j,`ids:`,e.v,e.w,`Translating: `,j.get(e.v),j.get(e.w)),_&&n.selfLoop){if(n.selfLoop.order!==1)return;let e={...n.originalEdge,...n,id:n.selfLoop.id,startLabelLeft:n.originalEdge?.startLabelLeft??n.startLabelLeft,startLabelRight:n.originalEdge?.startLabelRight??n.startLabelRight,endLabelLeft:n.originalEdge?.endLabelLeft??n.endLabelLeft,endLabelRight:n.originalEdge?.endLabelRight??n.endLabelRight};await s(h,e),n.width=e.width,n.height=e.height,n.labelStyle=e.labelStyle;return}await s(h,n)});await Promise.all(e)},`processEdges`)();let{subGraphTitleTotalMargin:te}=o(d);return{elem:ee,graph:a,groups:{clusters:p,edgePaths:m,edgeLabels:h,nodes:g,rootGroups:ee},diagramType:c,id:l,mergeSelfLoops:_,subGraphTitleTotalMargin:te}},`measureDagreGraph`),zo=e(e=>{t.info(`############################################# XXX`),t.info(`### Layout ### XXX`),t.info(`############################################# XXX`),ro(e)},`runDagreGraphLayout`),Bo=e((e,t,n)=>{let r=e.node(t);if(!r)return;let i={...r};return r?.clusterNode?i.y=(r.y??0)+n:e.children(t).length>0?i.height=(r.height??0)+n:i.y=(r.y??0)+n/2,i},`normalizeDagreNode`),Vo=e((e,t)=>{No.forEach(n=>{t[n]!==void 0&&(e[n]=t[n])})},`applyDagreNodeLayout`),Ho=e((e,t,n,r)=>({...e,start:e.start??t,end:e.end??n,points:(e.points??[]).map(e=>({...e,y:typeof e.y==`number`?e.y+r:e.y}))}),`normalizeDagreEdge`),Uo=e((e,t)=>{let{graph:n,mergeSelfLoops:r,subGraphTitleTotalMargin:i=0}=t,a=new Map(e.nodes.map(e=>[e.id,e]));Re(n).forEach(e=>{let t=Bo(n,e,i);if(!t)return;Vo(n.node(e),t);let r=a.get(e);r&&Vo(r,t)});let o=i/2;return e.edges=Lo(n,o,{mergeSelfLoops:r}).map(({edge:e,start:t,end:n})=>Ho(e,t,n,o)),e},`applyDagreLayoutResult`),Wo=e(async({elem:e,graph:n,groups:{clusters:r,edgePaths:i},diagramType:o,id:s,mergeSelfLoops:u,subGraphTitleTotalMargin:d})=>{let f=0;await Promise.all(Re(n).map(async function(e){let i=n.node(e);if(t.info(`Position XBX => `+e+`: (`+i.x,`,`+i.y,`) width: `,i.width,` height: `,i.height),i?.clusterNode)i.y+=d,t.info(`A tainted cluster node XBX1`,e,i.id,i.width,i.height,i.x,i.y,n.parent(e)),j.get(i.id).node=i,a(i);else if(n.children(e).length>0){t.info(`A pure cluster node XBX1`,e,i.id,i.x,i.y,i.width,i.height,n.parent(e)),i.height+=d,n.node(i.parentId);let a=i?.padding/2||0,o=i?.labelBBox?.height||0,s=o-a||0;t.debug(`OffsetY`,s,`labelHeight`,o,`halfPadding`,a),await Le(r,i),j.get(i.id).node=i}else{let e=n.node(i.parentId);i.y+=d/2,t.info(`A regular node XBX1 - using the padding`,i.id,`parent`,i.parentId,i.width,i.height,i.x,i.y,`offsetY`,i.offsetY,`parent`,e,e?.offsetY,i),a(i)}}));let p=d/2;return Lo(n,p,{mergeSelfLoops:u}).forEach(function({edge:e,start:r,end:a}){t.info(`Edge `+r+` -> `+a+`: `+JSON.stringify(e),e),e.points.forEach(e=>e.y+=p);let u=n.node(r),d=n.node(a),f=c(i,e,j,o,u,d,s);l(e,f)}),n.nodes().forEach(function(e){let r=n.node(e);t.info(e,r.type,r.diff),r.isGroup&&(f=r.diff)}),t.warn(`Returning from recursive render XAX`,e,f),{elem:e,diff:f}},`paintDagreLayoutCore`),Go=e(async e=>{let t=await Ro(e);return zo(t.graph),await Wo(t)},`renderDagreSubgraph`),Ko=e(e=>{let n=new O({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(e=>{n.setNode(e.id,{...e}),e.parentId&&n.setParent(e.id,e.parentId)}),t.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,r=t+`---`+t+`---1`,i=t+`---`+t+`---2`,a=n.node(t);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),n.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e),l=structuredClone(e);s.originalEdge=o,s.selfLoop={id:o.id,order:0},c.originalEdge=o,c.selfLoop={id:o.id,order:1},l.originalEdge=o,l.selfLoop={id:o.id,order:2},s.label=``,s.arrowTypeEnd=`none`,s.endLabelLeft=``,s.endLabelRight=``,s.startLabelLeft=``,s.id=t+`-cyclic-special-1`,c.startLabelRight=``,c.startLabelLeft=``,c.endLabelLeft=``,c.endLabelRight=``,c.arrowTypeStart=`none`,c.arrowTypeEnd=`none`,c.id=t+`-cyclic-special-mid`,l.label=``,l.startLabelRight=``,l.startLabelLeft=``,l.arrowTypeStart=`none`,a.isGroup&&(s.fromCluster=t,l.toCluster=t),l.id=t+`-cyclic-special-2`,l.arrowTypeStart=`none`,n.setEdge(t,r,s,t+`-cyclic-special-0`),n.setEdge(r,i,c,t+`-cyclic-special-1`),n.setEdge(i,t,l,t+`-cyclic-special-2`)}else n.setEdge(e.start,e.end,{...e},e.id)}),Ue(n),{graph:n}},`prepareLayoutForDagre`),qo=e(async(e,{element:t,preparedLayout:r})=>{let i=r??Ko(e),a=n(),o=await Ro({element:t,graph:i.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:a});return i.measuredLayout=o,o},`measureDagreLayout`),Jo=e((e,t)=>{let n=t.preparedLayout?.measuredLayout;if(!n)throw Error(`runDagreLayoutCore requires measureDagreLayout to run first`);return zo(n.graph),Uo(e,n),n},`runDagreLayoutCore`),Yo=Ve({prepareLayout:Ko,measureLayout:qo,runLayoutCore:Jo,paintOptions:{clusterDb:j,getNodes:e((e,{measure:t})=>Re(t.graph).map(e=>t.graph.node(e)).filter(Boolean),`getDagrePaintNodes`),getEdgeNode:e((e,t,{measure:n})=>e?n.graph.node(e):void 0,`getDagreEdgeNode`),skipNode:e((e,{measure:t})=>!t.graph.hasNode(e.id),`skipNode`),isCluster:e((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,`isCluster`)}});export{Uo as applyDagreLayoutResult,Lo as getEdgesToRender,qo as measureDagreLayout,Ko as prepareLayoutForDagre,Yo as render,Jo as runDagreLayoutCore}; \ No newline at end of file +Parent cluster`,u.height),a.setNode(u.id,n),a.parent(e)||(t.trace(`Setting parent`,e,u.id),a.setParent(e,u.id,n))}if(t.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(a.node(e))),n?.clusterNode){t.info(`Cluster identified XBX`,e,n.width,a.node(e));let{ranksep:o,nodesep:c}=a.graph();n.graph.setGraph({...n.graph.graph(),ranksep:o+25,nodesep:c});let u=await Go({element:g,graph:n.graph,diagramType:s,id:l,parentCluster:a.node(e),siteConfig:d}),f=u.elem;r(n,f),n.diff=u.diff||0,t.info(`New compound node after recursive render XAX`,e,`width`,n.width,`height`,n.height),i(f,n)}else a.children(e).length>0?(t.trace(`Cluster - the non recursive path XBX`,e,n.id,n,n.width,`Graph:`,a),t.trace(Re(n.id,a)),N.set(n.id,{id:Re(n.id,a),node:n})):(t.trace(`Node - the non recursive path XAX`,e,g,a.node(e),f),await Be(g,a.node(e),{config:d,dir:f}))})),await e(async()=>{let e=a.edges().map(async function(e){let n=a.edge(e.v,e.w,e.name);if(t.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),t.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(a.edge(e))),t.info(`Fix`,N,`ids:`,e.v,e.w,`Translating: `,N.get(e.v),N.get(e.w)),ee&&n.selfLoop){if(n.selfLoop.order!==1)return;let e={...n.originalEdge,...n,id:n.selfLoop.id,startLabelLeft:n.originalEdge?.startLabelLeft??n.startLabelLeft,startLabelRight:n.originalEdge?.startLabelRight??n.startLabelRight,endLabelLeft:n.originalEdge?.endLabelLeft??n.endLabelLeft,endLabelRight:n.originalEdge?.endLabelRight??n.endLabelRight};await c(h,e),n.width=e.width,n.height=e.height,n.labelStyle=e.labelStyle;return}await c(h,n)});await Promise.all(e)},`processEdges`)();let{subGraphTitleTotalMargin:v}=o(d);return{elem:_,graph:a,groups:{clusters:p,edgePaths:m,edgeLabels:h,nodes:g,rootGroups:_},diagramType:s,id:l,mergeSelfLoops:ee,subGraphTitleTotalMargin:v}},`measureDagreGraph`),zo=e(e=>{t.info(`############################################# XXX`),t.info(`### Layout ### XXX`),t.info(`############################################# XXX`),ro(e)},`runDagreGraphLayout`),Bo=e((e,t,n)=>{let r=e.node(t);if(!r)return;let i={...r};return r?.clusterNode?i.y=(r.y??0)+n:e.children(t).length>0?i.height=(r.height??0)+n:i.y=(r.y??0)+n/2,i},`normalizeDagreNode`),Vo=e((e,t)=>{No.forEach(n=>{t[n]!==void 0&&(e[n]=t[n])})},`applyDagreNodeLayout`),Ho=e((e,t,n,r)=>({...e,start:e.start??t,end:e.end??n,points:(e.points??[]).map(e=>({...e,y:typeof e.y==`number`?e.y+r:e.y}))}),`normalizeDagreEdge`),Uo=e((e,t)=>{let{graph:n,mergeSelfLoops:r,subGraphTitleTotalMargin:i=0}=t,a=new Map(e.nodes.map(e=>[e.id,e]));Ie(n).forEach(e=>{let t=Bo(n,e,i);if(!t)return;Vo(n.node(e),t);let r=a.get(e);r&&Vo(r,t)});let o=i/2;return e.edges=Lo(n,o,{mergeSelfLoops:r}).map(({edge:e,start:t,end:n})=>Ho(e,t,n,o)),e},`applyDagreLayoutResult`),Wo=e(async({elem:e,graph:n,groups:{clusters:r,edgePaths:i},diagramType:o,id:c,mergeSelfLoops:d,subGraphTitleTotalMargin:f})=>{let p=0;await Promise.all(Ie(n).map(async function(e){let i=n.node(e);if(t.info(`Position XBX => `+e+`: (`+i.x,`,`+i.y,`) width: `,i.width,` height: `,i.height),i?.clusterNode)i.y+=f,t.info(`A tainted cluster node XBX1`,e,i.id,i.width,i.height,i.x,i.y,n.parent(e)),N.get(i.id).node=i,a(i);else if(n.children(e).length>0){t.info(`A pure cluster node XBX1`,e,i.id,i.x,i.y,i.width,i.height,n.parent(e)),i.height+=f,n.node(i.parentId);let a=i?.padding/2||0,o=i?.labelBBox?.height||0,c=o-a||0;t.debug(`OffsetY`,c,`labelHeight`,o,`halfPadding`,a),await s(r,i),N.get(i.id).node=i}else{let e=n.node(i.parentId);i.y+=f/2,t.info(`A regular node XBX1 - using the padding`,i.id,`parent`,i.parentId,i.width,i.height,i.x,i.y,`offsetY`,i.offsetY,`parent`,e,e?.offsetY,i),a(i)}}));let m=f/2;return Lo(n,m,{mergeSelfLoops:d}).forEach(function({edge:e,start:r,end:a}){t.info(`Edge `+r+` -> `+a+`: `+JSON.stringify(e),e),e.points.forEach(e=>e.y+=m);let s=n.node(r),d=n.node(a),f=l(i,e,N,o,s,d,c);u(e,f)}),n.nodes().forEach(function(e){let r=n.node(e);t.info(e,r.type,r.diff),r.isGroup&&(p=r.diff)}),t.warn(`Returning from recursive render XAX`,e,p),{elem:e,diff:p}},`paintDagreLayoutCore`),Go=e(async e=>{let t=await Ro(e);return zo(t.graph),await Wo(t)},`renderDagreSubgraph`),Ko=e(e=>{let n=new A({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(e=>{n.setNode(e.id,{...e}),e.parentId&&n.setParent(e.id,e.parentId)}),t.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,r=t+`---`+t+`---1`,i=t+`---`+t+`---2`,a=n.node(t);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),n.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e),l=structuredClone(e);s.originalEdge=o,s.selfLoop={id:o.id,order:0},c.originalEdge=o,c.selfLoop={id:o.id,order:1},l.originalEdge=o,l.selfLoop={id:o.id,order:2},s.label=``,s.arrowTypeEnd=`none`,s.endLabelLeft=``,s.endLabelRight=``,s.startLabelLeft=``,s.id=t+`-cyclic-special-1`,c.startLabelRight=``,c.startLabelLeft=``,c.endLabelLeft=``,c.endLabelRight=``,c.arrowTypeStart=`none`,c.arrowTypeEnd=`none`,c.id=t+`-cyclic-special-mid`,l.label=``,l.startLabelRight=``,l.startLabelLeft=``,l.arrowTypeStart=`none`,a.isGroup&&(s.fromCluster=t,l.toCluster=t),l.id=t+`-cyclic-special-2`,l.arrowTypeStart=`none`,n.setEdge(t,r,s,t+`-cyclic-special-0`),n.setEdge(r,i,c,t+`-cyclic-special-1`),n.setEdge(i,t,l,t+`-cyclic-special-2`)}else n.setEdge(e.start,e.end,{...e},e.id)}),Ve(n),{graph:n}},`prepareLayoutForDagre`),qo=e(async(e,{element:t,preparedLayout:r})=>{let i=r??Ko(e),a=n(),o=await Ro({element:t,graph:i.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:a});return i.measuredLayout=o,o},`measureDagreLayout`),Jo=e((e,t)=>{let n=t.preparedLayout?.measuredLayout;if(!n)throw Error(`runDagreLayoutCore requires measureDagreLayout to run first`);return zo(n.graph),Uo(e,n),n},`runDagreLayoutCore`),Yo=ze({prepareLayout:Ko,measureLayout:qo,runLayoutCore:Jo,paintOptions:{clusterDb:N,getNodes:e((e,{measure:t})=>Ie(t.graph).map(e=>t.graph.node(e)).filter(Boolean),`getDagrePaintNodes`),getEdgeNode:e((e,t,{measure:n})=>e?n.graph.node(e):void 0,`getDagreEdgeNode`),skipNode:e((e,{measure:t})=>!t.graph.hasNode(e.id),`skipNode`),isCluster:e((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,`isCluster`)}});export{Uo as applyDagreLayoutResult,Lo as getEdgesToRender,qo as measureDagreLayout,Ko as prepareLayoutForDagre,Yo as render,Jo as runDagreLayoutCore}; \ No newline at end of file diff --git a/web/dist/app-diagram-22UHCM2B.js b/web/dist/app-diagram-22UHCM2B.js index 07fb75314..72cb5aa47 100644 --- a/web/dist/app-diagram-22UHCM2B.js +++ b/web/dist/app-diagram-22UHCM2B.js @@ -1,12 +1,12 @@ -import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{G as i,H as a,U as o,a as s,d as c,it as l,q as u,s as d,v as f,w as p,x as m,y as h}from"./app-chunk-O7XYJQB3.js";import{t as g}from"./app-channel.js";import{c as _,g as v}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{t as y}from"./app-chunk-5VM5RSS4.js";import"./app-chunk-7PRAP22T.js";import{i as b,n as x,o as S,r as C}from"./app-chunk-J5ZVWO5B.js";import{a as w}from"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import{t as T}from"./app-chunk-GWA4HPMP.js";import{t as E}from"./app-chunk-XXDRQBXY.js";import{t as D}from"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import{r as O,t as k}from"./app-chunk-GNY47TPC.js";import{n as A,t as j}from"./app-chunk-LNGE3PJU.js";var M={SHAPE_UNSUPPORTED:`SHAPE_UNSUPPORTED`,SHAPE_REMOVED:`SHAPE_REMOVED`,EDGE_OPERATOR_UNSUPPORTED:`EDGE_OPERATOR_UNSUPPORTED`,REFERENCE_EDGE_LABEL_REJECTED:`REFERENCE_EDGE_LABEL_REJECTED`,CONNECTOR_REF_UNRESOLVED:`CONNECTOR_REF_UNRESOLVED`,CONNECTOR_REF_NOT_A_CONNECTOR:`CONNECTOR_REF_NOT_A_CONNECTOR`,METADATA_KEY_MISAPPLIED:`METADATA_KEY_MISAPPLIED`,DUPLICATE_ID_NODE:`DUPLICATE_ID_NODE`,RESERVED_SYNTHETIC_ID:`RESERVED_SYNTHETIC_ID`,CONTAINMENT_VIOLATION:`CONTAINMENT_VIOLATION`,EDGE_SEMANTIC_CONTRADICTION:`EDGE_SEMANTIC_CONTRADICTION`,FLOW_NO_INPUT:`FLOW_NO_INPUT`},N=new Set([M.SHAPE_UNSUPPORTED,M.SHAPE_REMOVED,M.CONTAINMENT_VIOLATION]);new Set(Object.values(M).filter(e=>!N.has(e)));var P=new Map([[`task`,`roundedRect`],[`tool`,`subroutine`],[`input`,`lean-right`],[`decision`,`diamond`],[`refdoc`,`lin-doc`],[`action`,`hexagon`],[`round`,`rect`]]),ee=new Set(`doc.stadium.terminal.circle.trapezoid.inv_trapezoid.inv-trapezoid.doublecircle.double-circle.typeDeclaration.procs.lean_left.lean-left.in-out.cylinder.ellipse.odd.tag-rect.tagged-rectangle.delay.half-rounded-rectangle.lin-rect.lined-rectangle.win-pane.window-pane.curv-trap.curved-trapezoid`.split(`.`)),te=new Set([`roundedRect`,`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`lean-right`,`diamond`,`lin-doc`,`lined-document`,`hexagon`,`hex`,`connector`,`collapsedGroup`]),F=`roundedRect`;function I(e){return e&&(P.get(e)??e)}t(I,`resolveShapeAlias`);function ne(e,t){for(let r of e)if(!r.isGroup){if((!r.shape||r.shape===`squareRect`||r.shape===`rect`)&&(r.shape=F),ee.has(r.shape)){let e=`shape "${r.shape}" was removed in v0.8.1, using "${F}"`;t?.emitError?t.emitError(`SHAPE_REMOVED`,e,{nodeId:r.id}):n.warn(`agentflow: ${e}`),r.shape=F;continue}if(!te.has(r.shape)){let e=`shape "${r.shape}" is not supported, using "${F}"`;t?.emitWarning?t.emitWarning(`SHAPE_UNSUPPORTED`,e,{nodeId:r.id}):n.warn(`agentflow: ${e}`),r.shape=F}}}t(ne,`normaliseNodeShapes`);var L=new Map([[`tool`,0],[`task`,1],[`decision`,2],[`input`,3],[`refdoc`,4],[`connector`,5],[`action`,6]]),R=L.size,z=t(e=>`af-kind-${e}`,`kindClass`),B=[...L.keys()],V=t(e=>Math.max(1,e-R),`containerSlotCount`),H=t((e,t)=>{let n=R+e%V(t);return t>0?n%t:n},`containerSlot`);function re(e,t,n){let r=m().themeVariables?.borderColorArray,i=Array.isArray(r)?r.length:0,a=n.size;for(let r of e??[]){if(r.isGroup||r.shape===`collapsedGroup`){r.colorIndex=H(n.get(String(r.id))??a++,i);continue}let e=t(String(r.id));e&&L.has(e)&&(r.cssClasses=`${r.cssClasses??``} ${z(e)}`.replace(/\s+/g,` `).trim())}}t(re,`assignColorSlots`);var ie=`agentflow-`,ae=new Set([`shape`,`view`,`icon`,`img`,`form`,`pos`,`w`,`h`,`class`,`style`,`labelType`]),oe=new Set([`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`tool`]),se={flow:`flowGroup`};function ce(e){if(Array.isArray(e))return e.map(e=>ce(e));if(typeof e!=`object`||!e)return e;let t={};for(let n of Object.keys(e))n!==`__proto__`&&n!==`constructor`&&n!==`prototype`&&(t[n]=ce(e[n]));return t}t(ce,`stripPrototypeKeys`);function le(e){let t=!1,n=!1,r=0,i,a=[];for(let o of e.split(` +import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{G as i,H as a,U as o,a as s,d as c,it as l,q as u,s as d,v as f,w as p,x as m,y as h}from"./app-chunk-O7XYJQB3.js";import{t as g}from"./app-channel.js";import{c as _,g as v}from"./app-chunk-ZIGJFQKS.js";import{n as y,t as b}from"./app-chunk-LNGE3PJU.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{i as x,n as S,o as C,r as w}from"./app-chunk-J5ZVWO5B.js";import{a as T}from"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as E,t as D}from"./app-chunk-GNY47TPC.js";import{t as O}from"./app-chunk-5VM5RSS4.js";import{t as k}from"./app-chunk-GWA4HPMP.js";import{t as A}from"./app-chunk-XXDRQBXY.js";import{t as j}from"./app-chunk-WEXAMYUT.js";var M={SHAPE_UNSUPPORTED:`SHAPE_UNSUPPORTED`,SHAPE_REMOVED:`SHAPE_REMOVED`,EDGE_OPERATOR_UNSUPPORTED:`EDGE_OPERATOR_UNSUPPORTED`,REFERENCE_EDGE_LABEL_REJECTED:`REFERENCE_EDGE_LABEL_REJECTED`,CONNECTOR_REF_UNRESOLVED:`CONNECTOR_REF_UNRESOLVED`,CONNECTOR_REF_NOT_A_CONNECTOR:`CONNECTOR_REF_NOT_A_CONNECTOR`,METADATA_KEY_MISAPPLIED:`METADATA_KEY_MISAPPLIED`,DUPLICATE_ID_NODE:`DUPLICATE_ID_NODE`,RESERVED_SYNTHETIC_ID:`RESERVED_SYNTHETIC_ID`,CONTAINMENT_VIOLATION:`CONTAINMENT_VIOLATION`,EDGE_SEMANTIC_CONTRADICTION:`EDGE_SEMANTIC_CONTRADICTION`,FLOW_NO_INPUT:`FLOW_NO_INPUT`},N=new Set([M.SHAPE_UNSUPPORTED,M.SHAPE_REMOVED,M.CONTAINMENT_VIOLATION]);new Set(Object.values(M).filter(e=>!N.has(e)));var P=new Map([[`task`,`roundedRect`],[`tool`,`subroutine`],[`input`,`lean-right`],[`decision`,`diamond`],[`refdoc`,`lin-doc`],[`action`,`hexagon`],[`round`,`rect`]]),ee=new Set(`doc.stadium.terminal.circle.trapezoid.inv_trapezoid.inv-trapezoid.doublecircle.double-circle.typeDeclaration.procs.lean_left.lean-left.in-out.cylinder.ellipse.odd.tag-rect.tagged-rectangle.delay.half-rounded-rectangle.lin-rect.lined-rectangle.win-pane.window-pane.curv-trap.curved-trapezoid`.split(`.`)),te=new Set([`roundedRect`,`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`lean-right`,`diamond`,`lin-doc`,`lined-document`,`hexagon`,`hex`,`connector`,`collapsedGroup`]),F=`roundedRect`;function I(e){return e&&(P.get(e)??e)}t(I,`resolveShapeAlias`);function ne(e,t){for(let r of e)if(!r.isGroup){if((!r.shape||r.shape===`squareRect`||r.shape===`rect`)&&(r.shape=F),ee.has(r.shape)){let e=`shape "${r.shape}" was removed in v0.8.1, using "${F}"`;t?.emitError?t.emitError(`SHAPE_REMOVED`,e,{nodeId:r.id}):n.warn(`agentflow: ${e}`),r.shape=F;continue}if(!te.has(r.shape)){let e=`shape "${r.shape}" is not supported, using "${F}"`;t?.emitWarning?t.emitWarning(`SHAPE_UNSUPPORTED`,e,{nodeId:r.id}):n.warn(`agentflow: ${e}`),r.shape=F}}}t(ne,`normaliseNodeShapes`);var L=new Map([[`tool`,0],[`task`,1],[`decision`,2],[`input`,3],[`refdoc`,4],[`connector`,5],[`action`,6]]),R=L.size,z=t(e=>`af-kind-${e}`,`kindClass`),B=[...L.keys()],V=t(e=>Math.max(1,e-R),`containerSlotCount`),H=t((e,t)=>{let n=R+e%V(t);return t>0?n%t:n},`containerSlot`);function re(e,t,n){let r=m().themeVariables?.borderColorArray,i=Array.isArray(r)?r.length:0,a=n.size;for(let r of e??[]){if(r.isGroup||r.shape===`collapsedGroup`){r.colorIndex=H(n.get(String(r.id))??a++,i);continue}let e=t(String(r.id));e&&L.has(e)&&(r.cssClasses=`${r.cssClasses??``} ${z(e)}`.replace(/\s+/g,` `).trim())}}t(re,`assignColorSlots`);var ie=`agentflow-`,ae=new Set([`shape`,`view`,`icon`,`img`,`form`,`pos`,`w`,`h`,`class`,`style`,`labelType`]),oe=new Set([`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`tool`]),se={flow:`flowGroup`};function ce(e){if(Array.isArray(e))return e.map(e=>ce(e));if(typeof e!=`object`||!e)return e;let t={};for(let n of Object.keys(e))n!==`__proto__`&&n!==`constructor`&&n!==`prototype`&&(t[n]=ce(e[n]));return t}t(ce,`stripPrototypeKeys`);function le(e){let t=!1,n=!1,r=0,i,a=[];for(let o of e.split(` `)){if(i!==void 0){let e=o.length-o.trimStart().length;if(o.trim()===``||e>i){a.push(o);continue}i=void 0}let e=-1;for(let i=0;i0){a.push(o);continue}let s=e>=0?o.slice(0,e):o,c=e>=0?o.slice(e):``;if(/:\s*[>|][\d+-]*\s*$/.test(s)){i=o.length-o.trimStart().length,a.push(o);continue}a.push(s.replace(/,([\t ]*)$/,`$1`)+c)}return a.join(` `)}t(le,`stripLineTrailingCommas`);var ue=class{constructor(){this.vertexCounter=0,this.config=m(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId=``,this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=o,this.setAccDescription=a,this.setDiagramTitle=u,this.getAccTitle=h,this.getAccDescription=f,this.getDiagramTitle=p,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen(`gen-2`)}static{t(this,`AgentFlowDB`)}sanitizeText(e){return d.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,n,r,i,a,o={},s,c){if(!e||e.trim().length===0)return;let l;if(s!==void 0){let e;e=s.includes(` `)?s+` `:`{ `+s+` -}`;try{l=A(e,{schema:j})??{}}catch(e){let t=s.includes(` -`)?le(s):s;if(t!==s)try{l=A(t+` -`,{schema:j})??{}}catch{this.rethrowMetadataYamlError(e,s,c)}else this.rethrowMetadataYamlError(e,s,c)}l=ce(l)}let u;if(l&&typeof l.shape==`string`){let e=l;u=e.shape;let t=I(u);t&&t!==u&&(e.shape=t)}let d=this.subGraphLookup.get(e);if(d&&l){d.metadata={...d.metadata,...l};return}let f=this.connectors.get(e);if(f&&l){f.metadata={...f.metadata,...l};return}if(e===`connectors`)return;let p=this.edges.find(t=>t.id===e);if(p){let e=l;e?.animate!==void 0&&(p.animate=e.animate),e?.animation!==void 0&&(p.animation=e.animation),e?.curve!==void 0&&(p.interpolate=e.curve),l&&(p.metadata={...p.metadata,...l});return}let h,g=this.vertices.get(e);if(g===void 0&&(g={id:e,labelType:`text`,domId:ie+e+`-`+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,g)),this.vertexCounter++,t===void 0?g.text===void 0&&(g.text=e):(this.config=m(),h=this.sanitizeText(t.text.trim()),g.labelType=t.type,h.startsWith(`"`)&&h.endsWith(`"`)&&(h=h.substring(1,h.length-1)),g.text=h),n!==void 0&&(g.type=n),r?.forEach(e=>{g.styles.push(e)}),i?.forEach(e=>{g.classes.push(e)}),a!==void 0&&(g.dir=a),g.props===void 0?g.props=o:o!==void 0&&Object.assign(g.props,o),l){if(g.metadata={...g.metadata,...l},l.shape){let e=u??l.shape;if(typeof e!=`string`)throw this.positionedShapeError(`No such shape: ${JSON.stringify(e)}.`,c);if(e!==e.toLowerCase()||e.includes(`_`))throw this.positionedShapeError(`No such shape: ${e}. Shape names should be lowercase.`,c);if(!w(l.shape))throw this.positionedShapeError(`No such shape: ${l.shape}.`,c);g.type=l?.shape}l?.label&&(g.text=this.sanitizeText(l.label),g.labelType=this.sanitizeNodeLabelType(l?.labelType))}}positionedShapeError(e,t){let n=Error(e);if(!t)return n;let r=t.first_line+this.frontmatterLineOffset;return Object.assign(n,{hash:{text:``,token:null,line:r-1,loc:{first_line:r,last_line:t.last_line+this.frontmatterLineOffset,first_column:t.first_column,last_column:t.last_column},expected:[]}}),n}rethrowMetadataYamlError(e,n,r){let i=e;if(!i||i.name!==`YAMLException`||!i.mark||!r)throw e;let a;try{let e=!n.includes(` +}`;try{l=y(e,{schema:b})??{}}catch(e){let t=s.includes(` +`)?le(s):s;if(t!==s)try{l=y(t+` +`,{schema:b})??{}}catch{this.rethrowMetadataYamlError(e,s,c)}else this.rethrowMetadataYamlError(e,s,c)}l=ce(l)}let u;if(l&&typeof l.shape==`string`){let e=l;u=e.shape;let t=I(u);t&&t!==u&&(e.shape=t)}let d=this.subGraphLookup.get(e);if(d&&l){d.metadata={...d.metadata,...l};return}let f=this.connectors.get(e);if(f&&l){f.metadata={...f.metadata,...l};return}if(e===`connectors`)return;let p=this.edges.find(t=>t.id===e);if(p){let e=l;e?.animate!==void 0&&(p.animate=e.animate),e?.animation!==void 0&&(p.animation=e.animation),e?.curve!==void 0&&(p.interpolate=e.curve),l&&(p.metadata={...p.metadata,...l});return}let h,g=this.vertices.get(e);if(g===void 0&&(g={id:e,labelType:`text`,domId:ie+e+`-`+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,g)),this.vertexCounter++,t===void 0?g.text===void 0&&(g.text=e):(this.config=m(),h=this.sanitizeText(t.text.trim()),g.labelType=t.type,h.startsWith(`"`)&&h.endsWith(`"`)&&(h=h.substring(1,h.length-1)),g.text=h),n!==void 0&&(g.type=n),r?.forEach(e=>{g.styles.push(e)}),i?.forEach(e=>{g.classes.push(e)}),a!==void 0&&(g.dir=a),g.props===void 0?g.props=o:o!==void 0&&Object.assign(g.props,o),l){if(g.metadata={...g.metadata,...l},l.shape){let e=u??l.shape;if(typeof e!=`string`)throw this.positionedShapeError(`No such shape: ${JSON.stringify(e)}.`,c);if(e!==e.toLowerCase()||e.includes(`_`))throw this.positionedShapeError(`No such shape: ${e}. Shape names should be lowercase.`,c);if(!T(l.shape))throw this.positionedShapeError(`No such shape: ${l.shape}.`,c);g.type=l?.shape}l?.label&&(g.text=this.sanitizeText(l.label),g.labelType=this.sanitizeNodeLabelType(l?.labelType))}}positionedShapeError(e,t){let n=Error(e);if(!t)return n;let r=t.first_line+this.frontmatterLineOffset;return Object.assign(n,{hash:{text:``,token:null,line:r-1,loc:{first_line:r,last_line:t.last_line+this.frontmatterLineOffset,first_column:t.first_column,last_column:t.last_column},expected:[]}}),n}rethrowMetadataYamlError(e,n,r){let i=e;if(!i||i.name!==`YAMLException`||!i.mark||!r)throw e;let a;try{let e=!n.includes(` `),o=e?`{ `+n+` }`:n+` @@ -19,13 +19,13 @@ ${h.join(` Initialize mermaid with maxEdges set to a higher number to allow more edges. You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return typeof e==`object`&&!!e&&`id`in e&&typeof e.id==`string`}addLink(e,t,r){let i=this.isLinkData(r)?r.id.replace(`@`,``):void 0;n.info(`addLink`,e,t,i);for(let n of e)for(let a of t){let o=n===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(n,a,r,i):this.addSingleLink(n,a,r,void 0)}}updateLinkInterpolate(e,t){e.forEach(e=>{if(e==="default"){this.edges.defaultInterpolate=t;return}if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[e].interpolate=t})}updateLink(e,t){e.forEach(e=>{if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);e==="default"?this.edges.defaultStyle=t:(this.edges[e].style=t,(this.edges[e]?.style?.length??0)>0&&!this.edges[e]?.style?.some(e=>e?.startsWith(`fill`))&&this.edges[e]?.style?.push(`fill:none`))})}addClass(e,t){let n=t.join().replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);e.split(`,`).forEach(e=>{let t=this.classes.get(e);t===void 0&&(t={id:e,styles:[],textStyles:[]},this.classes.set(e,t)),n?.forEach(e=>{if(/color/.exec(e)){let n=e.replace(`fill`,`bgFill`);t.textStyles.push(n)}t.styles.push(e)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction=`LR`),/.*v/.exec(this.direction)&&(this.direction=`TB`),this.direction===`TD`&&(this.direction=`TB`)}setClass(e,t){for(let n of e.split(`,`)){let e=this.vertices.get(n);e&&e.classes.push(t);let r=this.edges.find(e=>e.id===n);r&&r.classes.push(t);let i=this.subGraphLookup.get(n);i&&i.classes.push(t)}}setTooltip(e,t){if(t!==void 0){t=this.sanitizeText(t);for(let n of e.split(`,`))this.tooltips.set(this.version===`gen-1`?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){if(m().securityLevel!==`loose`||t===void 0)return;let r=[];if(typeof n==`string`){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{let n=this.lookUpDomId(e),i=document.querySelector(`[id="${n}"]`);i!==null&&i.addEventListener(`click`,()=>{v.runFunc(t,...r)},!1)}))}setLink(e,t,n){e.split(`,`).forEach(e=>{let r=this.vertices.get(e);r!==void 0&&(r.link=v.formatUrl(t,this.config),r.linkTarget=n)}),this.setClass(e,`clickable`)}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFun(e,t,n)}),this.setClass(e,`clickable`)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(e){return oe.has(e.type)}getTools(){let e=[];for(let t of this.vertices.values())this.isToolDefinition(t)&&e.push(t);return e}getClasses(){return this.classes}setupToolTips(t){let n=T();r(t).select(`svg`).selectAll(`g.node`).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(a===null)return;let o=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.text(i.attr(`title`)).style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),n.html(e.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})}clear(e=`gen-2`){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=m(),this.diagramId=``,this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,s()}setGen(e){this.version=e||`gen-2`}defaultStyle(){return`fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;`}addSubGraph(e,r,i,a){let o=e?.text?.trim(),s=i?.text;e===i&&i?.text&&/\s/.exec(i.text)&&(o=void 0);let c=t(e=>{let t={boolean:{},number:{},string:{}},n=[],r;return{nodeList:e.filter(function(e){let i=typeof e;return e.stmt&&e.stmt===`dir`?(r=e.value,!1):e.trim()===``?!1:i in t?t[i].hasOwnProperty(e)?!1:t[i][e]=!0:!n.includes(e)&&n.push(e)}),dir:r}},`uniq`)(r.flat()),l=c.nodeList,u=c.dir,d=m().flowchart??{};if(u??=d.inheritDir?this.getDirection()??m().direction??void 0:void 0,this.version===`gen-1`)for(let e=0;ee!==o&&!this.globalNodes.has(e)),title:s.trim(),classes:[],dir:u,labelType:this.sanitizeNodeLabelType(i?.type),type:a??`flow`};n.info(`Adding`,f.id,f.nodes,f.dir),f.nodes=this.makeUniq(f,this.subGraphs).nodes;let p=this.getPosForId(o);if(p!==-1){let e=this.subGraphs[p];for(let t of f.nodes)e.nodes.includes(t)||e.nodes.push(t);f.title&&(e.title=f.title),f.dir&&(e.dir=f.dir),f.type&&(e.type=f.type),this.subGraphLookup.set(o,e)}else this.subGraphs.push(f),this.subGraphLookup.set(o,f);return o}addGlobal(e){for(let t of e.flat()){if(typeof t!=`string`)continue;let e=t.trim();e!==``&&this.globalNodes.add(e)}for(let e of this.subGraphs)e.nodes=e.nodes.filter(e=>!this.globalNodes.has(e))}getPosForId(e){for(let[t,n]of this.subGraphs.entries())if(n.id===e)return t;return-1}indexNodes2(e,t){let n=this.subGraphs[t].nodes;if(this.secCount+=1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let r=0,i=1;for(;r=0){let n=this.indexNodes2(e,t);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2(`none`,this.subGraphs.length-1)}addConnector(e,t){let n=e?.text?.trim();if(!n)return``;let r=t?.text?.trim()??``,i=r.length>0?this.sanitizeText(r):n,a=this.connectors.get(n);return a?r.length>0&&(a.text=i):(a={id:n,labelType:`text`,domId:ie+n+`-`+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:i},this.connectors.set(n,a),this.vertices.set(n,a),this.vertexCounter++),n}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}computeEdgeSemantic(e,t){if(e===`arrow_point`&&t===`normal`)return`sequence`;if(e===`arrow_cross`&&t===`normal`)return`failure`;if(e===`arrow_open`&&t===`dotted`)return`reference`}destructStartLink(e){let t=e.trim(),n=`normal`;return t.includes(`.`)&&(n=`dotted`),{type:`arrow_open`,stroke:n}}countChar(e,t){let n=t.length,r=0;for(let i=0;i`:r=`arrow_point`;break;case`-`:case`.`:r=`arrow_open`,n=t}let i=`normal`,a=n.length-1,o=this.countChar(`.`,n);return o>0&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}destructLink(e,t){let n=this.destructEndLink(e),r;return t?(r=this.destructStartLink(t),r.stroke===n.stroke?(r.type=n.type,r.length=n.length,{...r,edgeSemantic:this.computeEdgeSemantic(r.type,r.stroke)}):{type:`INVALID`,stroke:`INVALID`}):{...n,edgeSemantic:this.computeEdgeSemantic(n.type,n.stroke)}}exists(e,t){for(let n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){let n=[];return e.nodes.forEach((r,i)=>{this.exists(t,r)||n.push(e.nodes[i])}),{nodes:n}}getTypeFromVertex(e){let t=typeof e.type==`string`?I(e.type):e.type;switch(t){case`square`:case void 0:return`squareRect`;case`round`:return`roundedRect`;case`ellipse`:return`ellipse`;default:return t}}findNode(e,t){return e.find(e=>e.id===t)}destructEdgeType(e){let t=`none`,n=`arrow_point`;switch(e){case`arrow_point`:case`arrow_circle`:case`arrow_cross`:case`arrow_hierarchy`:n=e;break;case`double_arrow_point`:case`double_arrow_circle`:case`double_arrow_cross`:t=e.replace(`double_`,``),n=t}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,a){let o=n.get(e.id),s=r.get(e.id)??!1,c=this.findNode(t,e.id);if(c)c.cssStyles=e.styles,c.cssCompiledStyles=this.getCompiledStyles(e.classes),c.cssClasses=e.classes.join(` `);else{let n={id:e.id,label:e.text,labelType:e.labelType,labelStyle:``,parentId:o,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles([`default`,`node`,...e.classes]),cssClasses:`default `+e.classes.join(` `),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),metadata:e.metadata};s?t.push({...n,isGroup:!0,shape:`rect`}):t.push({...n,isGroup:!1,shape:this.getTypeFromVertex(e),wrappingWidth:i.agentflow?.wrappingWidth,minWidth:i.agentflow?.minNodeWidth})}}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}runPostParseValidators(){this.postParseValidationRun||=!0}getData(){this.runPostParseValidators();let e=m(),n=[],r=[],i=this.getSubGraphs(),a=new Map,o=new Map,s=new Set,c=new Map,l=t((e,t,n=new Set)=>{if(n.has(e))return;n.add(e);let r=this.subGraphLookup.get(e);if(r)for(let e of r.nodes)e===t||n.has(e)||(s.add(e),c.set(e,t),l(e,t,n))},`collectDescendants`);for(let e of i)e.metadata?.view===`collapsed`&&!s.has(e.id)&&l(e.id,e.id);let u=t((e,t)=>{let n=new Set,r=t;for(;r!==void 0&&!n.has(r);){if(r===e)return!0;n.add(r),r=a.get(r)}return!1},`wouldCloseContainmentCycle`);for(let e=i.length-1;e>=0;e--){let t=i[e];if(!s.has(t.id)){t.nodes.length>0&&o.set(t.id,!0);for(let e of t.nodes){if(u(e,t.id)){this.emitWarning(M.CONTAINMENT_VIOLATION,`Container "${t.id}" cannot contain "${e}" because "${e}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:e});continue}a.set(e,t.id)}}}for(let t=i.length-1;t>=0;t--){let r=i[t];if(!s.has(r.id))if(r.metadata?.view===`collapsed`){let t={...r.metadata,containerType:r.type};n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:`collapsedGroup`,dir:r.dir,isGroup:!1,look:e.look,metadata:t})}else n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:se[r.type??`flow`],dir:r.dir,isGroup:!0,look:e.look,metadata:r.metadata})}this.getVertices().forEach(t=>{s.has(t.id)||this.addNodeFromVertex(t,n,a,o,e,e.look||`classic`)});let d=this.getEdges();d.forEach((t,n)=>{let i=c.get(t.start)??t.start,a=c.get(t.end)??t.end;if(i===a&&t.start!==t.end)return;let{arrowTypeStart:o,arrowTypeEnd:s}=this.destructEdgeType(t.type),l=[...d.defaultStyle??[]];t.style&&l.push(...t.style);let u={id:_(i,a,{counter:n,prefix:`L`},t.id),isUserDefinedId:t.isUserDefinedId,start:i,end:a,type:t.type??`normal`,label:t.text,labelType:t.labelType,labelpos:`c`,thickness:t.stroke,minlen:t.length,classes:t?.stroke===`invisible`?``:`edge-thickness-normal edge-pattern-solid flowchart-link`,arrowTypeStart:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:o,arrowTypeEnd:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:s,arrowheadStyle:`fill: #333`,cssCompiledStyles:this.getCompiledStyles(t.classes),labelStyle:l,style:l,pattern:t.stroke,look:e.look,animate:t.animate,animation:t.animation,curve:t.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve,metadata:t.metadata};r.push(u)}),ne(n,this);let f=new Map,p=new Map;for(let e of i){let t=a.get(e.id);t!==void 0&&p.set(t,[...p.get(t)??[],e.id])}let h=0,g=t(e=>{if(!f.has(e)){f.set(e,h++);for(let t of p.get(e)??[])g(t)}},`walkContainers`);for(let e of i)a.get(e.id)===void 0&&g(e.id);let v=new Set(this.getConnectors().map(e=>e.id));return re(n,e=>{if(v.has(e))return`connector`;let t=this.vertices.get(e);return t?this.deriveVertexKind(t,I(t.type)):void 0},f),{nodes:n,edges:r,other:{},config:e,connectors:this.getConnectors()}}defaultConfig(){return c.flowchart}deriveVertexKind(e,t){return this.isToolDefinition(e)?`tool`:t===`hexagon`||t===`hex`?`action`:t===`lean-right`||t===`lean_right`?`input`:t===`lin-doc`||t===`lined-document`?`refdoc`:t===`diamond`?`decision`:`task`}getSemanticModel(){this.runPostParseValidators();let e=new Set(this.subGraphs.map(e=>e.id)),t=[],n=[];for(let[r,i]of this.vertices){if(e.has(r))continue;if(i.isConnector){let e={id:r};if(i.text!==void 0&&i.text!==r&&(e.title=i.text),i.metadata&&Object.keys(i.metadata).length>0){let t={};for(let[e,n]of Object.entries(i.metadata))ae.has(e)||(t[e]=n);Object.keys(t).length>0&&(e.metadata=t)}n.push(e);continue}let a={id:r};i.text!==void 0&&(a.label=i.text);let o=typeof i.type==`string`?I(i.type):i.type;if(o!==void 0&&(a.shape=o),a.vertexKind=this.deriveVertexKind(i,o),i.metadata&&Object.keys(i.metadata).length>0){let e={};for(let[t,n]of Object.entries(i.metadata))ae.has(t)||(e[t]=n);Object.keys(e).length>0&&(a.metadata=e)}t.push(a)}let r={vertices:t,edges:this.edges.map(e=>{let t={start:e.start,end:e.end};return e.id!==void 0&&(t.id=e.id),typeof e.text==`string`&&e.text.length>0&&(t.label=e.text),e.type!==void 0&&(t.type=e.type),e.stroke!==void 0&&(t.stroke=e.stroke),e.edgeSemantic!==void 0&&(t.edgeSemantic=e.edgeSemantic),e.length!==void 0&&(t.length=e.length),e.metadata&&Object.keys(e.metadata).length>0&&(t.metadata={...e.metadata}),t}),subGraphs:this.subGraphs.map(e=>{let t={id:e.id,nodes:[...e.nodes]};if(e.type!==void 0&&(t.type=e.type),e.title!==void 0&&(t.title=e.title),e.dir!==void 0&&(t.direction=e.dir),e.metadata&&Object.keys(e.metadata).length>0){let n={};for(let[t,r]of Object.entries(e.metadata))ae.has(t)||(n[t]=r);Object.keys(n).length>0&&(t.metadata=n)}return t}),connectors:n,diagnostics:this.diagnostics};return this.direction!==void 0&&(r.direction=this.direction),r}setFrontmatterLineOffset(e){this.frontmatterLineOffset=e??0}toElementPosition(e){let t=e?.first_line??0,n=e?.first_column??0,r=e?.last_line??t,i=e?.last_column??n,[a,o]=e?.range??[0,0];return{startLine:t+this.frontmatterLineOffset,startColumn:n,endLine:r+this.frontmatterLineOffset,endColumn:i,startIndex:a,endIndex:o}}pushMapping(e,t,n){if(!e)return;let r={id:e,type:t,position:this.toElementPosition(n)};return this.elementMappings.push(r),r}addVertexMapping(e,t,n,r){let i=this.pushMapping(e,`vertex`,r);i&&n==null&&this.bareVertexMappings.add(i)}extendVertexMapping(e,t){if(!e||!t)return;let n=this.toElementPosition(t);for(let t=this.elementMappings.length-1;t>=0;t--){let r=this.elementMappings[t];if(r.type===`vertex`&&r.id===e){this.bareVertexMappings.has(r)&&(r.type=`attachment`,this.bareVertexMappings.delete(r)),(n.endLine>r.position.endLine||n.endLine===r.position.endLine&&n.endColumn>r.position.endColumn)&&(r.position.endLine=n.endLine,r.position.endColumn=n.endColumn,r.position.endIndex=n.endIndex);return}}this.pushMapping(e,`attachment`,t)}addEdgeMapping(e,t,n,r){let i=Array.isArray(t)?t.map(e=>typeof e==`string`?e:e?.id??``).filter(Boolean):[],a=i.length>0?i.join(`>`):`edge`;this.pushMapping(a,`edge`,r)}addSubgraphMapping(e,t,n,r){let i=(typeof e==`string`?e:e?.text)??``,a=this.toElementPosition(n),o=r?this.toElementPosition(r):a;i&&this.elementMappings.push({id:i,type:`subgraph`,position:{startLine:a.startLine,startColumn:a.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:a.startIndex,endIndex:o.endIndex}})}addConnectorMapping(e,t,n,r){let i=e?.text?.trim()??``;if(!i)return;let a=this.toElementPosition(n),o=r?this.toElementPosition(r):a;this.elementMappings.push({id:i,type:`connector`,position:{startLine:a.startLine,startColumn:a.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:a.startIndex,endIndex:o.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(e){return this.elementMappings.find(t=>t.id===e)}getElementsOnLine(e){return this.elementMappings.filter(t=>e>=t.position.startLine&&e<=t.position.endLine)}getElementAtPosition(e,n){let r=this.elementMappings.filter(t=>{let{startLine:r,startColumn:i,endLine:a,endColumn:o}=t.position;return!(ea||e===r&&no)});if(r.length===0)return;let i=t(({position:e})=>[e.endLine-e.startLine,e.endColumn-e.startColumn],`span`);return r.reduce((e,t)=>{let[n,r]=i(e),[a,o]=i(t);return a===n?oe.id===s.id&&e.severity===s.severity&&e.message===s.message&&e.nodeId===s.nodeId&&e.edgeId===s.edgeId))return;this.diagnostics.push(s);let c=`agentflow[${e}]: ${r}`;t===`error`?n.error(c):n.warn(c)}emitWarning(e,t,n){this.emitDiagnostic(e,`warning`,t,n)}emitError(e,t,n){this.emitDiagnostic(e,`error`,t,n)}getDiagnostics(){return[...this.diagnostics]}},de={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.debug(`Drawing agentflow diagram`,t);let{securityLevel:a,agentflow:o,layout:s}=m();i.db.setDiagramId(t),n.debug(`Before getData: `);let c=i.db.getData();n.debug(`Data: `,c);let l=E(t,a),u=i.db.getDirection();c.type=i.type,c.layoutAlgorithm=k(s),c.layoutAlgorithm===`dagre`&&s===`elk`&&n.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),c.direction=u,c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=[`point`,`circle`,`cross`,`hierarchy`],c.diagramId=t,n.debug(`REF1:`,c),await O(c,l);let d=o?.diagramPadding??8;v.insertTitle(l,`agentflowTitleText`,o?.titleTopMargin??0,i.db.getDiagramTitle()),D(l,d,`agentflow`,o?.useMaxWidth??!0)},`draw`)},fe=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,5],r=[1,4],i=[1,3],a=[1,6],o=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],s=[2,2],c=[1,15],l=[1,16],u=[1,17],d=[1,18],f=[1,19],p=[1,26],m=[1,27],h=[1,28],g=[1,30],_=[1,31],v=[1,32],y=[1,55],b=[1,54],x=[1,34],S=[1,35],C=[1,36],w=[1,37],T=[1,38],E=[1,50],D=[1,52],O=[1,48],k=[1,53],A=[1,49],j=[1,56],M=[1,51],N=[1,57],P=[1,58],ee=[1,39],te=[1,40],F=[1,41],I=[1,42],ne=[1,43],L=[1,64],R=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],z=[1,70],B=[1,68],V=[1,67],H=[1,69],re=[8,9,10,12,78,80,81],ie=[1,88],ae=[1,101],oe=[1,106],se=[1,105],ce=[1,102],le=[1,98],ue=[1,104],de=[1,100],fe=[1,107],pe=[1,103],me=[1,108],he=[1,99],ge=[8,9,10,11,12,43,78,80,81],U=[8,9,10,11,12,43,49,78,80,81],W=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],_e=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],ve=[47,63,92,105,108,109,112,114,117,118,119],ye=[1,131],be=[1,132],xe=[1,134],Se=[1,133],Ce=[47,63,65,77,92,105,108,109,112,114,117,118,119],we=[1,143],Te=[1,157],Ee=[1,158],De=[1,159],Oe=[1,162],ke=[1,161],Ae=[1,160],je=[1,145],Me=[1,147],Ne=[1,151],Pe=[1,139],Fe=[1,140],Ie=[1,152],Le=[1,153],Re=[1,154],ze=[1,155],Be=[1,156],Ve=[1,163],He=[1,164],Ue=[1,141],We=[1,142],Ge=[1,149],Ke=[1,144],qe=[1,148],Je=[1,146],Ye=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],Xe=[1,168],Ze=[1,170],G=[8,9,10,12],K=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],q=[1,190],J=[1,186],Y=[1,187],X=[1,191],Z=[1,188],Q=[1,189],Qe=[80,119,122],$=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],$e=[11,109],et=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],tt=[1,269],nt=[1,267],rt=[1,271],it=[1,265],at=[1,266],ot=[1,268],st=[1,270],ct=[1,272],lt=[1,292],ut=[8,9,10,12,109],dt=[8,9,10,11,12,63,87,108,109,112,113,114,115],ft={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:`error`,8:`COMMENT`,9:`SEMI`,10:`NEWLINE`,11:`SPACE`,12:`EOF`,13:`GRAPH`,14:`NODIR`,15:`DIR`,28:`flow`,30:`SQS`,32:`SQE`,33:`end`,35:`global`,36:`connector`,38:`acc_title`,39:`acc_title_value`,40:`acc_descr`,41:`acc_descr_value`,42:`acc_descr_multiline_value`,43:`SHAPE_DATA`,47:`AMP`,49:`STYLE_SEPARATOR`,51:`DOUBLECIRCLESTART`,52:`DOUBLECIRCLEEND`,53:`PS`,54:`PE`,55:`(-`,56:`-)`,57:`STADIUMSTART`,58:`STADIUMEND`,59:`SUBROUTINESTART`,60:`SUBROUTINEEND`,61:`VERTEX_WITH_PROPS_START`,62:`NODE_STRING[field]`,63:`COLON`,64:`NODE_STRING[value]`,65:`PIPE`,66:`CYLINDERSTART`,67:`CYLINDEREND`,68:`DIAMOND_START`,69:`DIAMOND_STOP`,70:`TAGEND`,71:`TRAPSTART`,72:`TRAPEND`,73:`INVTRAPSTART`,74:`INVTRAPEND`,77:`TESTSTR`,78:`START_LINK`,80:`LINK`,81:`LINK_ID`,83:`STR`,84:`MD_STR`,87:`STYLE`,88:`LINKSTYLE`,89:`CLASSDEF`,90:`CLASS`,91:`CLICK`,92:`DOWN`,93:`UP`,96:`idString[vertex]`,97:`idString[class]`,98:`CALLBACKNAME`,99:`CALLBACKARGS`,100:`HREF`,101:`LINK_TARGET`,102:`STR[link]`,103:`STR[tooltip]`,105:`DEFAULT`,107:`INTERPOLATE`,108:`NUM`,109:`COMMA`,112:`NODE_STRING`,113:`UNIT`,114:`BRKT`,115:`PCT`,117:`MINUS`,118:`MULT`,119:`UNICODE_TEXT`,120:`TEXT`,121:`TAGSTART`,122:`EDGE_TEXT`,124:`direction_tb`,125:`direction_bt`,126:`direction_rl`,127:`direction_lr`,128:`direction_td`},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:(!Array.isArray(a[s])||a[s].length>0)&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 198:this.$=a[s];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:r.setDirection(`TB`),this.$=`TB`;break;case 14:r.setDirection(a[s-1]),this.$=a[s-1];break;case 32:this.$=a[s-1].nodes;break;case 38:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4],`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-6],a[s-4],o[s-8],o[s]);break;case 39:this.$=r.addSubGraph(a[s-7],a[s-1],a[s-5],`flow`),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-3],o[s-3]),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-7],a[s-5],o[s-9],o[s]);break;case 40:this.$=r.addSubGraph(a[s-3],a[s-1],{text:``,type:`text`},`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-3],{text:``,type:`text`},o[s-5],o[s]);break;case 41:this.$=r.addSubGraph(a[s-4],a[s-1],{text:``,type:`text`},`flow`),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-3],o[s-3]),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-4],{text:``,type:`text`},o[s-6],o[s]);break;case 42:this.$=r.addSubGraph(void 0,a[s-1],void 0,`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(void 0,void 0,o[s-3],o[s]);break;case 43:r.addGlobal(a[s-1]),this.$=[];break;case 44:this.$=r.addConnector(a[s-4],a[s-2]),r.addConnectorMapping&&r.addConnectorMapping(a[s-4],a[s-2],o[s-6],o[s]);break;case 45:this.$=r.addConnector(a[s-5],a[s-3]),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-1],o[s-1]),r.addConnectorMapping&&r.addConnectorMapping(a[s-5],a[s-3],o[s-7],o[s]);break;case 46:this.$=r.addConnector(a[s-1],{text:``,type:`text`}),r.addConnectorMapping&&r.addConnectorMapping(a[s-1],{text:``,type:`text`},o[s-3],o[s]);break;case 47:this.$=r.addConnector(a[s-2],{text:``,type:`text`}),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-1],o[s-1]),r.addConnectorMapping&&r.addConnectorMapping(a[s-2],{text:``,type:`text`},o[s-4],o[s]);break;case 49:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 50:case 51:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 56:this.$=a[s-1]+a[s];break;case 57:this.$=a[s];break;case 58:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s],o[s]),r.extendVertexMapping&&r.extendVertexMapping(a[s-1][a[s-1].length-1],o[s]),r.addLink(a[s-3].stmt,a[s-1],a[s-2]),r.addEdgeMapping&&r.addEdgeMapping(a[s-3].stmt,a[s-1],a[s-2],this._$),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 59:r.addLink(a[s-2].stmt,a[s],a[s-1]),r.addEdgeMapping&&r.addEdgeMapping(a[s-2].stmt,a[s],a[s-1],this._$),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 60:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),r.addEdgeMapping&&r.addEdgeMapping(a[s-3].stmt,a[s-1],a[s-2],this._$),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 61:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 62:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s],o[s]),r.extendVertexMapping&&r.extendVertexMapping(a[s-1][a[s-1].length-1],o[s]),this.$={stmt:a[s-1],nodes:a[s-1],shapeData:a[s]};break;case 63:this.$={stmt:a[s],nodes:a[s]};break;case 64:this.$=[a[s]];break;case 65:r.addVertex(a[s-5][a[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s-4],o[s-4]),r.extendVertexMapping&&r.extendVertexMapping(a[s-5][a[s-5].length-1],o[s-4]),this.$=a[s-5].concat(a[s]);break;case 66:this.$=a[s-4].concat(a[s]);break;case 67:this.$=a[s];break;case 68:this.$=a[s-2],r.setClass(a[s-2],a[s]);break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`square`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`square`,this._$);break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`doublecircle`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`doublecircle`,this._$);break;case 71:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`circle`),r.addVertexMapping&&r.addVertexMapping(a[s-5],a[s-2],`circle`,this._$);break;case 72:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`ellipse`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`ellipse`,this._$);break;case 73:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`stadium`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`stadium`,this._$);break;case 74:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`subroutine`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`subroutine`,this._$);break;case 75:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],`rect`,void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]])),r.addVertexMapping&&r.addVertexMapping(a[s-7],a[s-1],`rect`,this._$);break;case 76:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`cylinder`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`cylinder`,this._$);break;case 77:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`round`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`round`,this._$);break;case 78:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`diamond`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`diamond`,this._$);break;case 79:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`hexagon`),r.addVertexMapping&&r.addVertexMapping(a[s-5],a[s-2],`hexagon`,this._$);break;case 80:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`odd`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`odd`,this._$);break;case 81:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`trapezoid`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`trapezoid`,this._$);break;case 82:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`inv_trapezoid`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`inv_trapezoid`,this._$);break;case 83:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_right`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`lean_right`,this._$);break;case 84:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_left`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`lean_left`,this._$);break;case 85:this.$=a[s],r.addVertex(a[s]),r.addVertexMapping&&r.addVertexMapping(a[s],void 0,void 0,this._$);break;case 86:a[s-1].text=a[s],this.$=a[s-1];break;case 87:case 88:a[s-2].text=a[s-1],this.$=a[s-2];break;case 89:this.$=a[s];break;case 90:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,text:a[s-1]};break;case 91:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,text:a[s-1],id:a[s-3]};break;case 92:this.$={text:a[s],type:`text`};break;case 93:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 94:this.$={text:a[s],type:`string`};break;case 95:this.$={text:a[s],type:`markdown`};break;case 96:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic};break;case 97:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,id:a[s-1]};break;case 98:this.$=a[s-1];break;case 99:this.$={text:a[s],type:`text`};break;case 100:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 101:this.$={text:a[s],type:`string`};break;case 102:case 119:this.$={text:a[s],type:`markdown`};break;case 116:this.$={text:a[s],type:`text`};break;case 117:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 118:this.$={text:a[s],type:`text`};break;case 120:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 121:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 122:case 130:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 123:case 131:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 124:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 125:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 126:this.$=a[s-2],r.setLink(a[s-2],a[s]);break;case 127:this.$=a[s-4],r.setLink(a[s-4],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 128:this.$=a[s-4],r.setLink(a[s-4],a[s-2],a[s]);break;case 129:this.$=a[s-6],r.setLink(a[s-6],a[s-4],a[s]),r.setTooltip(a[s-6],a[s-2]);break;case 132:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 133:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 134:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 135:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 136:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 137:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 138:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 139:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 140:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 141:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 142:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 143:case 145:this.$=[a[s]];break;case 144:case 146:a[s-2].push(a[s]),this.$=a[s-2];break;case 148:this.$=a[s-1]+a[s];break;case 196:this.$=a[s];break;case 197:this.$=a[s-1]+``+a[s];break;case 199:this.$=a[s-1]+``+a[s];break;case 200:this.$={stmt:`dir`,value:`TB`};break;case 201:this.$={stmt:`dir`,value:`BT`};break;case 202:this.$={stmt:`dir`,value:`RL`};break;case 203:this.$={stmt:`dir`,value:`LR`};break;case 204:this.$={stmt:`dir`,value:`TD`}}},`anonymous`),table:[{3:1,4:2,8:n,10:r,11:i,13:a},{1:[3]},e(o,s,{5:7}),{4:8,8:n,10:r,11:i,13:a},{4:9,8:n,10:r,11:i,13:a},{4:10,8:n,10:r,11:i,13:a},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(o,[2,10]),e(o,[2,11]),e(o,[2,12]),e(o,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:L,16:59,19:62},e(R,[2,3]),e(R,[2,4]),e(R,[2,5]),e(R,[2,6]),e(R,[2,7]),e(R,[2,8]),e(R,[2,9]),{8:z,9:B,10:V,12:H,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:z,9:B,10:V,12:H,22:75},{8:z,9:B,10:V,12:H,22:76},{8:z,9:B,10:V,12:H,22:77},{8:z,9:B,10:V,12:H,22:78},{8:z,9:B,10:V,12:H,22:79},{8:z,9:B,10:V,11:[1,80],12:H,22:81},{8:z,9:B,10:V,12:H,22:82},{11:[1,83]},e(R,[2,48]),{39:[1,84]},{41:[1,85]},e(R,[2,51]),e(re,[2,63],{19:86,34:87,11:L,43:ie}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:ae,47:oe,63:se,83:[1,96],92:ce,98:[1,93],100:[1,94],104:95,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},e(R,[2,200]),e(R,[2,201]),e(R,[2,202]),e(R,[2,203]),e(R,[2,204]),e(ge,[2,64]),e(ge,[2,67],{49:[1,109]}),e(U,[2,85],{116:122,30:[1,110],47:y,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:b,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),e(W,[2,196]),e(W,[2,157]),e(W,[2,158]),e(W,[2,159]),e(W,[2,160]),e(W,[2,161]),e(W,[2,162]),e(W,[2,163]),e(W,[2,164]),e(W,[2,165]),e(W,[2,166]),e(W,[2,167]),e(o,[2,14]),e(o,[2,20]),e(o,[2,21]),{10:[1,123]},e(o,[2,23]),e(_e,[2,31],{19:124,11:L}),e(R,[2,32]),{45:125,46:44,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(R,[2,52]),e(R,[2,53]),e(R,[2,54]),e(R,[2,55]),e(ve,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:ye,84:be,119:xe,122:Se},{78:[1,135],80:[1,136]},e(Ce,[2,96]),e(R,[2,33]),e(R,[2,34]),e(R,[2,35]),e(R,[2,36]),e(R,[2,37]),{11:we,13:Te,15:Ee,28:De,29:137,33:Oe,35:ke,36:Ae,47:je,63:Me,78:Ne,83:Pe,84:Fe,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:138,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e(Ye,s,{5:165}),e(Ye,s,{5:166}),{11:we,13:Te,15:Ee,28:De,29:167,33:Oe,35:ke,36:Ae,47:je,63:Me,78:Ne,83:Pe,84:Fe,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:138,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e(R,[2,49]),e(R,[2,50]),e(re,[2,61],{47:Xe}),e(re,[2,62],{19:169,11:L,43:Ze}),e(ge,[2,57]),{47:y,50:171,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{105:[1,172],106:173,108:[1,174]},{47:y,50:175,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{47:y,50:176,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},e(G,[2,130],{123:181,11:[1,180],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,132],{11:[1,182]}),e(K,[2,198]),e(K,[2,185]),e(K,[2,186]),e(K,[2,187]),e(K,[2,188]),e(K,[2,189]),e(K,[2,190]),e(K,[2,191]),e(K,[2,192]),e(K,[2,193]),e(K,[2,194]),e(K,[2,195]),{47:y,50:183,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{31:184,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:192,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:194,53:[1,193],70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:195,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:196,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:197,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{112:[1,198]},{31:199,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:200,68:[1,201],70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:202,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:203,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:204,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(W,[2,197]),e(o,[2,22]),e(_e,[2,30]),e(re,[2,59],{34:205,19:206,11:L,43:ie}),e(ve,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{80:[1,210],82:211,119:xe,122:Se},e(Qe,[2,92]),e(Qe,[2,94]),e(Qe,[2,95]),e(Qe,[2,183]),e(Qe,[2,184]),{79:212,82:130,83:ye,84:be,119:xe,122:Se},e(Ce,[2,97]),{8:z,9:B,10:V,11:we,12:H,13:Te,15:Ee,22:214,28:De,30:[1,213],33:Oe,34:215,35:ke,36:Ae,43:ie,47:je,63:Me,78:Ne,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:216,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e($,[2,116]),e($,[2,118]),e($,[2,119]),e($,[2,172]),e($,[2,173]),e($,[2,174]),e($,[2,175]),e($,[2,176]),e($,[2,177]),e($,[2,178]),e($,[2,179]),e($,[2,180]),e($,[2,181]),e($,[2,182]),e($,[2,103]),e($,[2,104]),e($,[2,105]),e($,[2,106]),e($,[2,107]),e($,[2,108]),e($,[2,109]),e($,[2,110]),e($,[2,111]),e($,[2,112]),e($,[2,113]),e($,[2,114]),e($,[2,115]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,217],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,218],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{8:z,9:B,10:V,11:we,12:H,13:Te,15:Ee,22:220,28:De,30:[1,219],33:Oe,34:221,35:ke,36:Ae,43:ie,47:je,63:Me,78:Ne,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:216,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},{11:L,19:222},{47:[1,223]},e(ge,[2,56]),{11:[1,224],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{11:[1,225]},{11:[1,226],109:[1,227]},e($e,[2,143]),{11:[1,228],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{11:[1,229],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{83:[1,230]},e(G,[2,124],{11:[1,231]}),e(G,[2,126],{11:[1,232]}),{83:[1,233]},e(K,[2,199]),{83:[1,234],101:[1,235]},e(ge,[2,68],{116:122,47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),{32:[1,236],70:q,85:237,119:X,120:Z,121:Q},e(et,[2,99]),e(et,[2,101]),e(et,[2,102]),e(et,[2,168]),e(et,[2,169]),e(et,[2,170]),e(et,[2,171]),{52:[1,238],70:q,85:237,119:X,120:Z,121:Q},{31:239,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{54:[1,240],70:q,85:237,119:X,120:Z,121:Q},{56:[1,241],70:q,85:237,119:X,120:Z,121:Q},{58:[1,242],70:q,85:237,119:X,120:Z,121:Q},{60:[1,243],70:q,85:237,119:X,120:Z,121:Q},{63:[1,244]},{67:[1,245],70:q,85:237,119:X,120:Z,121:Q},{69:[1,246],70:q,85:237,119:X,120:Z,121:Q},{31:247,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{32:[1,248],70:q,85:237,119:X,120:Z,121:Q},{70:q,72:[1,249],74:[1,250],85:237,119:X,120:Z,121:Q},{70:q,72:[1,252],74:[1,251],85:237,119:X,120:Z,121:Q},e(re,[2,58],{19:169,11:L,43:Ze}),e(re,[2,60],{47:Xe}),e(ve,[2,88]),e(ve,[2,87]),{65:[1,253],70:q,85:237,119:X,120:Z,121:Q},e(ve,[2,90]),e(Qe,[2,93]),{80:[1,254],82:211,119:xe,122:Se},{31:255,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(Ye,s,{5:256}),{8:z,9:B,10:V,12:H,22:257,43:Ze},e($,[2,117]),e(R,[2,42]),e(R,[2,43]),{31:258,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(R,[2,46]),{8:z,9:B,10:V,12:H,22:259,43:Ze},{46:260,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{11:L,19:261},{11:tt,63:nt,87:rt,95:262,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:273,107:[1,274],108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:275,107:[1,276],108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{108:[1,277]},{11:tt,63:nt,87:rt,95:278,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{47:y,50:279,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},e(G,[2,131]),e(G,[2,133],{11:[1,283]}),e(G,[2,134]),e(U,[2,69]),e(et,[2,100]),e(U,[2,70]),{54:[1,284],70:q,85:237,119:X,120:Z,121:Q},e(U,[2,77]),e(U,[2,72]),e(U,[2,73]),e(U,[2,74]),{112:[1,285]},e(U,[2,76]),e(U,[2,78]),{69:[1,286],70:q,85:237,119:X,120:Z,121:Q},e(U,[2,80]),e(U,[2,81]),e(U,[2,83]),e(U,[2,82]),e(U,[2,84]),e([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),e(ve,[2,91]),{32:[1,287],70:q,85:237,119:X,120:Z,121:Q},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,288],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(Ye,s,{5:289}),{32:[1,290],70:q,85:237,119:X,120:Z,121:Q},e(R,[2,47]),e(ge,[2,66]),{46:291,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,136],{109:lt}),e(ut,[2,145],{111:293,11:tt,63:nt,87:rt,108:it,112:at,113:ot,114:st,115:ct}),e(dt,[2,147]),e(dt,[2,149]),e(dt,[2,150]),e(dt,[2,151]),e(dt,[2,152]),e(dt,[2,153]),e(dt,[2,154]),e(dt,[2,155]),e(dt,[2,156]),e(G,[2,137],{109:lt}),{11:[1,294]},e(G,[2,138],{109:lt}),{11:[1,295]},e($e,[2,144]),e(G,[2,120],{109:lt}),e(G,[2,121],{116:122,47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),e(G,[2,125]),e(G,[2,127],{11:[1,296]}),e(G,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:z,9:B,10:V,12:H,22:301,34:302,43:ie},e(R,[2,40]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,303],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{8:z,9:B,10:V,12:H,22:304,34:305,43:ie},e(ge,[2,65]),{11:tt,63:nt,87:rt,108:it,110:306,111:264,112:at,113:ot,114:st,115:ct},e(dt,[2,148]),{15:ae,47:oe,63:se,92:ce,104:307,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},{15:ae,47:oe,63:se,92:ce,104:308,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},{101:[1,309]},e(G,[2,135]),e(U,[2,71]),{31:310,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(U,[2,79]),e(Ye,s,{5:311}),{8:z,9:B,10:V,12:H,22:312,43:Ze},e(R,[2,41]),e(R,[2,44]),{8:z,9:B,10:V,12:H,22:313,43:Ze},e(ut,[2,146],{111:293,11:tt,63:nt,87:rt,108:it,112:at,113:ot,114:st,115:ct}),e(G,[2,141],{123:181,11:[1,314],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,142],{123:181,11:[1,315],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,129]),{32:[1,316],70:q,85:237,119:X,120:Z,121:Q},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,317],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(Ye,s,{5:318}),e(R,[2,45]),{11:tt,63:nt,87:rt,95:319,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:320,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},e(U,[2,75]),e(R,[2,38]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,321],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(G,[2,139],{109:lt}),e(G,[2,140],{109:lt}),e(R,[2,39])],defaultActions:{},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +You have to call mermaid.initialize.`)}isLinkData(e){return typeof e==`object`&&!!e&&`id`in e&&typeof e.id==`string`}addLink(e,t,r){let i=this.isLinkData(r)?r.id.replace(`@`,``):void 0;n.info(`addLink`,e,t,i);for(let n of e)for(let a of t){let o=n===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(n,a,r,i):this.addSingleLink(n,a,r,void 0)}}updateLinkInterpolate(e,t){e.forEach(e=>{if(e==="default"){this.edges.defaultInterpolate=t;return}if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[e].interpolate=t})}updateLink(e,t){e.forEach(e=>{if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);e==="default"?this.edges.defaultStyle=t:(this.edges[e].style=t,(this.edges[e]?.style?.length??0)>0&&!this.edges[e]?.style?.some(e=>e?.startsWith(`fill`))&&this.edges[e]?.style?.push(`fill:none`))})}addClass(e,t){let n=t.join().replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);e.split(`,`).forEach(e=>{let t=this.classes.get(e);t===void 0&&(t={id:e,styles:[],textStyles:[]},this.classes.set(e,t)),n?.forEach(e=>{if(/color/.exec(e)){let n=e.replace(`fill`,`bgFill`);t.textStyles.push(n)}t.styles.push(e)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction=`LR`),/.*v/.exec(this.direction)&&(this.direction=`TB`),this.direction===`TD`&&(this.direction=`TB`)}setClass(e,t){for(let n of e.split(`,`)){let e=this.vertices.get(n);e&&e.classes.push(t);let r=this.edges.find(e=>e.id===n);r&&r.classes.push(t);let i=this.subGraphLookup.get(n);i&&i.classes.push(t)}}setTooltip(e,t){if(t!==void 0){t=this.sanitizeText(t);for(let n of e.split(`,`))this.tooltips.set(this.version===`gen-1`?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){if(m().securityLevel!==`loose`||t===void 0)return;let r=[];if(typeof n==`string`){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{let n=this.lookUpDomId(e),i=document.querySelector(`[id="${n}"]`);i!==null&&i.addEventListener(`click`,()=>{v.runFunc(t,...r)},!1)}))}setLink(e,t,n){e.split(`,`).forEach(e=>{let r=this.vertices.get(e);r!==void 0&&(r.link=v.formatUrl(t,this.config),r.linkTarget=n)}),this.setClass(e,`clickable`)}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFun(e,t,n)}),this.setClass(e,`clickable`)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(e){return oe.has(e.type)}getTools(){let e=[];for(let t of this.vertices.values())this.isToolDefinition(t)&&e.push(t);return e}getClasses(){return this.classes}setupToolTips(t){let n=k();r(t).select(`svg`).selectAll(`g.node`).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(a===null)return;let o=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.text(i.attr(`title`)).style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),n.html(e.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})}clear(e=`gen-2`){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=m(),this.diagramId=``,this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,s()}setGen(e){this.version=e||`gen-2`}defaultStyle(){return`fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;`}addSubGraph(e,r,i,a){let o=e?.text?.trim(),s=i?.text;e===i&&i?.text&&/\s/.exec(i.text)&&(o=void 0);let c=t(e=>{let t={boolean:{},number:{},string:{}},n=[],r;return{nodeList:e.filter(function(e){let i=typeof e;return e.stmt&&e.stmt===`dir`?(r=e.value,!1):e.trim()===``?!1:i in t?t[i].hasOwnProperty(e)?!1:t[i][e]=!0:!n.includes(e)&&n.push(e)}),dir:r}},`uniq`)(r.flat()),l=c.nodeList,u=c.dir,d=m().flowchart??{};if(u??=d.inheritDir?this.getDirection()??m().direction??void 0:void 0,this.version===`gen-1`)for(let e=0;ee!==o&&!this.globalNodes.has(e)),title:s.trim(),classes:[],dir:u,labelType:this.sanitizeNodeLabelType(i?.type),type:a??`flow`};n.info(`Adding`,f.id,f.nodes,f.dir),f.nodes=this.makeUniq(f,this.subGraphs).nodes;let p=this.getPosForId(o);if(p!==-1){let e=this.subGraphs[p];for(let t of f.nodes)e.nodes.includes(t)||e.nodes.push(t);f.title&&(e.title=f.title),f.dir&&(e.dir=f.dir),f.type&&(e.type=f.type),this.subGraphLookup.set(o,e)}else this.subGraphs.push(f),this.subGraphLookup.set(o,f);return o}addGlobal(e){for(let t of e.flat()){if(typeof t!=`string`)continue;let e=t.trim();e!==``&&this.globalNodes.add(e)}for(let e of this.subGraphs)e.nodes=e.nodes.filter(e=>!this.globalNodes.has(e))}getPosForId(e){for(let[t,n]of this.subGraphs.entries())if(n.id===e)return t;return-1}indexNodes2(e,t){let n=this.subGraphs[t].nodes;if(this.secCount+=1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let r=0,i=1;for(;r=0){let n=this.indexNodes2(e,t);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2(`none`,this.subGraphs.length-1)}addConnector(e,t){let n=e?.text?.trim();if(!n)return``;let r=t?.text?.trim()??``,i=r.length>0?this.sanitizeText(r):n,a=this.connectors.get(n);return a?r.length>0&&(a.text=i):(a={id:n,labelType:`text`,domId:ie+n+`-`+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:i},this.connectors.set(n,a),this.vertices.set(n,a),this.vertexCounter++),n}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}computeEdgeSemantic(e,t){if(e===`arrow_point`&&t===`normal`)return`sequence`;if(e===`arrow_cross`&&t===`normal`)return`failure`;if(e===`arrow_open`&&t===`dotted`)return`reference`}destructStartLink(e){let t=e.trim(),n=`normal`;return t.includes(`.`)&&(n=`dotted`),{type:`arrow_open`,stroke:n}}countChar(e,t){let n=t.length,r=0;for(let i=0;i`:r=`arrow_point`;break;case`-`:case`.`:r=`arrow_open`,n=t}let i=`normal`,a=n.length-1,o=this.countChar(`.`,n);return o>0&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}destructLink(e,t){let n=this.destructEndLink(e),r;return t?(r=this.destructStartLink(t),r.stroke===n.stroke?(r.type=n.type,r.length=n.length,{...r,edgeSemantic:this.computeEdgeSemantic(r.type,r.stroke)}):{type:`INVALID`,stroke:`INVALID`}):{...n,edgeSemantic:this.computeEdgeSemantic(n.type,n.stroke)}}exists(e,t){for(let n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){let n=[];return e.nodes.forEach((r,i)=>{this.exists(t,r)||n.push(e.nodes[i])}),{nodes:n}}getTypeFromVertex(e){let t=typeof e.type==`string`?I(e.type):e.type;switch(t){case`square`:case void 0:return`squareRect`;case`round`:return`roundedRect`;case`ellipse`:return`ellipse`;default:return t}}findNode(e,t){return e.find(e=>e.id===t)}destructEdgeType(e){let t=`none`,n=`arrow_point`;switch(e){case`arrow_point`:case`arrow_circle`:case`arrow_cross`:case`arrow_hierarchy`:n=e;break;case`double_arrow_point`:case`double_arrow_circle`:case`double_arrow_cross`:t=e.replace(`double_`,``),n=t}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,a){let o=n.get(e.id),s=r.get(e.id)??!1,c=this.findNode(t,e.id);if(c)c.cssStyles=e.styles,c.cssCompiledStyles=this.getCompiledStyles(e.classes),c.cssClasses=e.classes.join(` `);else{let n={id:e.id,label:e.text,labelType:e.labelType,labelStyle:``,parentId:o,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles([`default`,`node`,...e.classes]),cssClasses:`default `+e.classes.join(` `),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),metadata:e.metadata};s?t.push({...n,isGroup:!0,shape:`rect`}):t.push({...n,isGroup:!1,shape:this.getTypeFromVertex(e),wrappingWidth:i.agentflow?.wrappingWidth,minWidth:i.agentflow?.minNodeWidth})}}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}runPostParseValidators(){this.postParseValidationRun||=!0}getData(){this.runPostParseValidators();let e=m(),n=[],r=[],i=this.getSubGraphs(),a=new Map,o=new Map,s=new Set,c=new Map,l=t((e,t,n=new Set)=>{if(n.has(e))return;n.add(e);let r=this.subGraphLookup.get(e);if(r)for(let e of r.nodes)e===t||n.has(e)||(s.add(e),c.set(e,t),l(e,t,n))},`collectDescendants`);for(let e of i)e.metadata?.view===`collapsed`&&!s.has(e.id)&&l(e.id,e.id);let u=t((e,t)=>{let n=new Set,r=t;for(;r!==void 0&&!n.has(r);){if(r===e)return!0;n.add(r),r=a.get(r)}return!1},`wouldCloseContainmentCycle`);for(let e=i.length-1;e>=0;e--){let t=i[e];if(!s.has(t.id)){t.nodes.length>0&&o.set(t.id,!0);for(let e of t.nodes){if(u(e,t.id)){this.emitWarning(M.CONTAINMENT_VIOLATION,`Container "${t.id}" cannot contain "${e}" because "${e}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:e});continue}a.set(e,t.id)}}}for(let t=i.length-1;t>=0;t--){let r=i[t];if(!s.has(r.id))if(r.metadata?.view===`collapsed`){let t={...r.metadata,containerType:r.type};n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:`collapsedGroup`,dir:r.dir,isGroup:!1,look:e.look,metadata:t})}else n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:se[r.type??`flow`],dir:r.dir,isGroup:!0,look:e.look,metadata:r.metadata})}this.getVertices().forEach(t=>{s.has(t.id)||this.addNodeFromVertex(t,n,a,o,e,e.look||`classic`)});let d=this.getEdges();d.forEach((t,n)=>{let i=c.get(t.start)??t.start,a=c.get(t.end)??t.end;if(i===a&&t.start!==t.end)return;let{arrowTypeStart:o,arrowTypeEnd:s}=this.destructEdgeType(t.type),l=[...d.defaultStyle??[]];t.style&&l.push(...t.style);let u={id:_(i,a,{counter:n,prefix:`L`},t.id),isUserDefinedId:t.isUserDefinedId,start:i,end:a,type:t.type??`normal`,label:t.text,labelType:t.labelType,labelpos:`c`,thickness:t.stroke,minlen:t.length,classes:t?.stroke===`invisible`?``:`edge-thickness-normal edge-pattern-solid flowchart-link`,arrowTypeStart:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:o,arrowTypeEnd:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:s,arrowheadStyle:`fill: #333`,cssCompiledStyles:this.getCompiledStyles(t.classes),labelStyle:l,style:l,pattern:t.stroke,look:e.look,animate:t.animate,animation:t.animation,curve:t.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve,metadata:t.metadata};r.push(u)}),ne(n,this);let f=new Map,p=new Map;for(let e of i){let t=a.get(e.id);t!==void 0&&p.set(t,[...p.get(t)??[],e.id])}let h=0,g=t(e=>{if(!f.has(e)){f.set(e,h++);for(let t of p.get(e)??[])g(t)}},`walkContainers`);for(let e of i)a.get(e.id)===void 0&&g(e.id);let v=new Set(this.getConnectors().map(e=>e.id));return re(n,e=>{if(v.has(e))return`connector`;let t=this.vertices.get(e);return t?this.deriveVertexKind(t,I(t.type)):void 0},f),{nodes:n,edges:r,other:{},config:e,connectors:this.getConnectors()}}defaultConfig(){return c.flowchart}deriveVertexKind(e,t){return this.isToolDefinition(e)?`tool`:t===`hexagon`||t===`hex`?`action`:t===`lean-right`||t===`lean_right`?`input`:t===`lin-doc`||t===`lined-document`?`refdoc`:t===`diamond`?`decision`:`task`}getSemanticModel(){this.runPostParseValidators();let e=new Set(this.subGraphs.map(e=>e.id)),t=[],n=[];for(let[r,i]of this.vertices){if(e.has(r))continue;if(i.isConnector){let e={id:r};if(i.text!==void 0&&i.text!==r&&(e.title=i.text),i.metadata&&Object.keys(i.metadata).length>0){let t={};for(let[e,n]of Object.entries(i.metadata))ae.has(e)||(t[e]=n);Object.keys(t).length>0&&(e.metadata=t)}n.push(e);continue}let a={id:r};i.text!==void 0&&(a.label=i.text);let o=typeof i.type==`string`?I(i.type):i.type;if(o!==void 0&&(a.shape=o),a.vertexKind=this.deriveVertexKind(i,o),i.metadata&&Object.keys(i.metadata).length>0){let e={};for(let[t,n]of Object.entries(i.metadata))ae.has(t)||(e[t]=n);Object.keys(e).length>0&&(a.metadata=e)}t.push(a)}let r={vertices:t,edges:this.edges.map(e=>{let t={start:e.start,end:e.end};return e.id!==void 0&&(t.id=e.id),typeof e.text==`string`&&e.text.length>0&&(t.label=e.text),e.type!==void 0&&(t.type=e.type),e.stroke!==void 0&&(t.stroke=e.stroke),e.edgeSemantic!==void 0&&(t.edgeSemantic=e.edgeSemantic),e.length!==void 0&&(t.length=e.length),e.metadata&&Object.keys(e.metadata).length>0&&(t.metadata={...e.metadata}),t}),subGraphs:this.subGraphs.map(e=>{let t={id:e.id,nodes:[...e.nodes]};if(e.type!==void 0&&(t.type=e.type),e.title!==void 0&&(t.title=e.title),e.dir!==void 0&&(t.direction=e.dir),e.metadata&&Object.keys(e.metadata).length>0){let n={};for(let[t,r]of Object.entries(e.metadata))ae.has(t)||(n[t]=r);Object.keys(n).length>0&&(t.metadata=n)}return t}),connectors:n,diagnostics:this.diagnostics};return this.direction!==void 0&&(r.direction=this.direction),r}setFrontmatterLineOffset(e){this.frontmatterLineOffset=e??0}toElementPosition(e){let t=e?.first_line??0,n=e?.first_column??0,r=e?.last_line??t,i=e?.last_column??n,[a,o]=e?.range??[0,0];return{startLine:t+this.frontmatterLineOffset,startColumn:n,endLine:r+this.frontmatterLineOffset,endColumn:i,startIndex:a,endIndex:o}}pushMapping(e,t,n){if(!e)return;let r={id:e,type:t,position:this.toElementPosition(n)};return this.elementMappings.push(r),r}addVertexMapping(e,t,n,r){let i=this.pushMapping(e,`vertex`,r);i&&n==null&&this.bareVertexMappings.add(i)}extendVertexMapping(e,t){if(!e||!t)return;let n=this.toElementPosition(t);for(let t=this.elementMappings.length-1;t>=0;t--){let r=this.elementMappings[t];if(r.type===`vertex`&&r.id===e){this.bareVertexMappings.has(r)&&(r.type=`attachment`,this.bareVertexMappings.delete(r)),(n.endLine>r.position.endLine||n.endLine===r.position.endLine&&n.endColumn>r.position.endColumn)&&(r.position.endLine=n.endLine,r.position.endColumn=n.endColumn,r.position.endIndex=n.endIndex);return}}this.pushMapping(e,`attachment`,t)}addEdgeMapping(e,t,n,r){let i=Array.isArray(t)?t.map(e=>typeof e==`string`?e:e?.id??``).filter(Boolean):[],a=i.length>0?i.join(`>`):`edge`;this.pushMapping(a,`edge`,r)}addSubgraphMapping(e,t,n,r){let i=(typeof e==`string`?e:e?.text)??``,a=this.toElementPosition(n),o=r?this.toElementPosition(r):a;i&&this.elementMappings.push({id:i,type:`subgraph`,position:{startLine:a.startLine,startColumn:a.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:a.startIndex,endIndex:o.endIndex}})}addConnectorMapping(e,t,n,r){let i=e?.text?.trim()??``;if(!i)return;let a=this.toElementPosition(n),o=r?this.toElementPosition(r):a;this.elementMappings.push({id:i,type:`connector`,position:{startLine:a.startLine,startColumn:a.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:a.startIndex,endIndex:o.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(e){return this.elementMappings.find(t=>t.id===e)}getElementsOnLine(e){return this.elementMappings.filter(t=>e>=t.position.startLine&&e<=t.position.endLine)}getElementAtPosition(e,n){let r=this.elementMappings.filter(t=>{let{startLine:r,startColumn:i,endLine:a,endColumn:o}=t.position;return!(ea||e===r&&no)});if(r.length===0)return;let i=t(({position:e})=>[e.endLine-e.startLine,e.endColumn-e.startColumn],`span`);return r.reduce((e,t)=>{let[n,r]=i(e),[a,o]=i(t);return a===n?oe.id===s.id&&e.severity===s.severity&&e.message===s.message&&e.nodeId===s.nodeId&&e.edgeId===s.edgeId))return;this.diagnostics.push(s);let c=`agentflow[${e}]: ${r}`;t===`error`?n.error(c):n.warn(c)}emitWarning(e,t,n){this.emitDiagnostic(e,`warning`,t,n)}emitError(e,t,n){this.emitDiagnostic(e,`error`,t,n)}getDiagnostics(){return[...this.diagnostics]}},de={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.debug(`Drawing agentflow diagram`,t);let{securityLevel:a,agentflow:o,layout:s}=m();i.db.setDiagramId(t),n.debug(`Before getData: `);let c=i.db.getData();n.debug(`Data: `,c);let l=A(t,a),u=i.db.getDirection();c.type=i.type,c.layoutAlgorithm=D(s),c.layoutAlgorithm===`dagre`&&s===`elk`&&n.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),c.direction=u,c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=[`point`,`circle`,`cross`,`hierarchy`],c.diagramId=t,n.debug(`REF1:`,c),await E(c,l);let d=o?.diagramPadding??8;v.insertTitle(l,`agentflowTitleText`,o?.titleTopMargin??0,i.db.getDiagramTitle()),j(l,d,`agentflow`,o?.useMaxWidth??!0)},`draw`)},fe=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,5],r=[1,4],i=[1,3],a=[1,6],o=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],s=[2,2],c=[1,15],l=[1,16],u=[1,17],d=[1,18],f=[1,19],p=[1,26],m=[1,27],h=[1,28],g=[1,30],_=[1,31],v=[1,32],y=[1,55],b=[1,54],x=[1,34],S=[1,35],C=[1,36],w=[1,37],T=[1,38],E=[1,50],D=[1,52],O=[1,48],k=[1,53],A=[1,49],j=[1,56],M=[1,51],N=[1,57],P=[1,58],ee=[1,39],te=[1,40],F=[1,41],I=[1,42],ne=[1,43],L=[1,64],R=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],z=[1,70],B=[1,68],V=[1,67],H=[1,69],re=[8,9,10,12,78,80,81],ie=[1,88],ae=[1,101],oe=[1,106],se=[1,105],ce=[1,102],le=[1,98],ue=[1,104],de=[1,100],fe=[1,107],pe=[1,103],me=[1,108],he=[1,99],ge=[8,9,10,11,12,43,78,80,81],U=[8,9,10,11,12,43,49,78,80,81],W=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],_e=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],ve=[47,63,92,105,108,109,112,114,117,118,119],ye=[1,131],be=[1,132],xe=[1,134],Se=[1,133],Ce=[47,63,65,77,92,105,108,109,112,114,117,118,119],we=[1,143],Te=[1,157],Ee=[1,158],De=[1,159],Oe=[1,162],ke=[1,161],Ae=[1,160],je=[1,145],Me=[1,147],Ne=[1,151],Pe=[1,139],Fe=[1,140],Ie=[1,152],Le=[1,153],Re=[1,154],ze=[1,155],Be=[1,156],Ve=[1,163],He=[1,164],Ue=[1,141],We=[1,142],Ge=[1,149],Ke=[1,144],qe=[1,148],Je=[1,146],Ye=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],Xe=[1,168],Ze=[1,170],G=[8,9,10,12],K=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],q=[1,190],J=[1,186],Y=[1,187],X=[1,191],Z=[1,188],Q=[1,189],Qe=[80,119,122],$=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],$e=[11,109],et=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],tt=[1,269],nt=[1,267],rt=[1,271],it=[1,265],at=[1,266],ot=[1,268],st=[1,270],ct=[1,272],lt=[1,292],ut=[8,9,10,12,109],dt=[8,9,10,11,12,63,87,108,109,112,113,114,115],ft={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:`error`,8:`COMMENT`,9:`SEMI`,10:`NEWLINE`,11:`SPACE`,12:`EOF`,13:`GRAPH`,14:`NODIR`,15:`DIR`,28:`flow`,30:`SQS`,32:`SQE`,33:`end`,35:`global`,36:`connector`,38:`acc_title`,39:`acc_title_value`,40:`acc_descr`,41:`acc_descr_value`,42:`acc_descr_multiline_value`,43:`SHAPE_DATA`,47:`AMP`,49:`STYLE_SEPARATOR`,51:`DOUBLECIRCLESTART`,52:`DOUBLECIRCLEEND`,53:`PS`,54:`PE`,55:`(-`,56:`-)`,57:`STADIUMSTART`,58:`STADIUMEND`,59:`SUBROUTINESTART`,60:`SUBROUTINEEND`,61:`VERTEX_WITH_PROPS_START`,62:`NODE_STRING[field]`,63:`COLON`,64:`NODE_STRING[value]`,65:`PIPE`,66:`CYLINDERSTART`,67:`CYLINDEREND`,68:`DIAMOND_START`,69:`DIAMOND_STOP`,70:`TAGEND`,71:`TRAPSTART`,72:`TRAPEND`,73:`INVTRAPSTART`,74:`INVTRAPEND`,77:`TESTSTR`,78:`START_LINK`,80:`LINK`,81:`LINK_ID`,83:`STR`,84:`MD_STR`,87:`STYLE`,88:`LINKSTYLE`,89:`CLASSDEF`,90:`CLASS`,91:`CLICK`,92:`DOWN`,93:`UP`,96:`idString[vertex]`,97:`idString[class]`,98:`CALLBACKNAME`,99:`CALLBACKARGS`,100:`HREF`,101:`LINK_TARGET`,102:`STR[link]`,103:`STR[tooltip]`,105:`DEFAULT`,107:`INTERPOLATE`,108:`NUM`,109:`COMMA`,112:`NODE_STRING`,113:`UNIT`,114:`BRKT`,115:`PCT`,117:`MINUS`,118:`MULT`,119:`UNICODE_TEXT`,120:`TEXT`,121:`TAGSTART`,122:`EDGE_TEXT`,124:`direction_tb`,125:`direction_bt`,126:`direction_rl`,127:`direction_lr`,128:`direction_td`},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:(!Array.isArray(a[s])||a[s].length>0)&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 198:this.$=a[s];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:r.setDirection(`TB`),this.$=`TB`;break;case 14:r.setDirection(a[s-1]),this.$=a[s-1];break;case 32:this.$=a[s-1].nodes;break;case 38:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4],`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-6],a[s-4],o[s-8],o[s]);break;case 39:this.$=r.addSubGraph(a[s-7],a[s-1],a[s-5],`flow`),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-3],o[s-3]),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-7],a[s-5],o[s-9],o[s]);break;case 40:this.$=r.addSubGraph(a[s-3],a[s-1],{text:``,type:`text`},`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-3],{text:``,type:`text`},o[s-5],o[s]);break;case 41:this.$=r.addSubGraph(a[s-4],a[s-1],{text:``,type:`text`},`flow`),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-3],o[s-3]),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-4],{text:``,type:`text`},o[s-6],o[s]);break;case 42:this.$=r.addSubGraph(void 0,a[s-1],void 0,`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(void 0,void 0,o[s-3],o[s]);break;case 43:r.addGlobal(a[s-1]),this.$=[];break;case 44:this.$=r.addConnector(a[s-4],a[s-2]),r.addConnectorMapping&&r.addConnectorMapping(a[s-4],a[s-2],o[s-6],o[s]);break;case 45:this.$=r.addConnector(a[s-5],a[s-3]),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-1],o[s-1]),r.addConnectorMapping&&r.addConnectorMapping(a[s-5],a[s-3],o[s-7],o[s]);break;case 46:this.$=r.addConnector(a[s-1],{text:``,type:`text`}),r.addConnectorMapping&&r.addConnectorMapping(a[s-1],{text:``,type:`text`},o[s-3],o[s]);break;case 47:this.$=r.addConnector(a[s-2],{text:``,type:`text`}),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-1],o[s-1]),r.addConnectorMapping&&r.addConnectorMapping(a[s-2],{text:``,type:`text`},o[s-4],o[s]);break;case 49:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 50:case 51:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 56:this.$=a[s-1]+a[s];break;case 57:this.$=a[s];break;case 58:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s],o[s]),r.extendVertexMapping&&r.extendVertexMapping(a[s-1][a[s-1].length-1],o[s]),r.addLink(a[s-3].stmt,a[s-1],a[s-2]),r.addEdgeMapping&&r.addEdgeMapping(a[s-3].stmt,a[s-1],a[s-2],this._$),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 59:r.addLink(a[s-2].stmt,a[s],a[s-1]),r.addEdgeMapping&&r.addEdgeMapping(a[s-2].stmt,a[s],a[s-1],this._$),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 60:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),r.addEdgeMapping&&r.addEdgeMapping(a[s-3].stmt,a[s-1],a[s-2],this._$),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 61:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 62:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s],o[s]),r.extendVertexMapping&&r.extendVertexMapping(a[s-1][a[s-1].length-1],o[s]),this.$={stmt:a[s-1],nodes:a[s-1],shapeData:a[s]};break;case 63:this.$={stmt:a[s],nodes:a[s]};break;case 64:this.$=[a[s]];break;case 65:r.addVertex(a[s-5][a[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s-4],o[s-4]),r.extendVertexMapping&&r.extendVertexMapping(a[s-5][a[s-5].length-1],o[s-4]),this.$=a[s-5].concat(a[s]);break;case 66:this.$=a[s-4].concat(a[s]);break;case 67:this.$=a[s];break;case 68:this.$=a[s-2],r.setClass(a[s-2],a[s]);break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`square`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`square`,this._$);break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`doublecircle`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`doublecircle`,this._$);break;case 71:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`circle`),r.addVertexMapping&&r.addVertexMapping(a[s-5],a[s-2],`circle`,this._$);break;case 72:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`ellipse`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`ellipse`,this._$);break;case 73:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`stadium`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`stadium`,this._$);break;case 74:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`subroutine`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`subroutine`,this._$);break;case 75:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],`rect`,void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]])),r.addVertexMapping&&r.addVertexMapping(a[s-7],a[s-1],`rect`,this._$);break;case 76:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`cylinder`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`cylinder`,this._$);break;case 77:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`round`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`round`,this._$);break;case 78:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`diamond`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`diamond`,this._$);break;case 79:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`hexagon`),r.addVertexMapping&&r.addVertexMapping(a[s-5],a[s-2],`hexagon`,this._$);break;case 80:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`odd`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`odd`,this._$);break;case 81:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`trapezoid`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`trapezoid`,this._$);break;case 82:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`inv_trapezoid`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`inv_trapezoid`,this._$);break;case 83:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_right`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`lean_right`,this._$);break;case 84:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_left`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`lean_left`,this._$);break;case 85:this.$=a[s],r.addVertex(a[s]),r.addVertexMapping&&r.addVertexMapping(a[s],void 0,void 0,this._$);break;case 86:a[s-1].text=a[s],this.$=a[s-1];break;case 87:case 88:a[s-2].text=a[s-1],this.$=a[s-2];break;case 89:this.$=a[s];break;case 90:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,text:a[s-1]};break;case 91:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,text:a[s-1],id:a[s-3]};break;case 92:this.$={text:a[s],type:`text`};break;case 93:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 94:this.$={text:a[s],type:`string`};break;case 95:this.$={text:a[s],type:`markdown`};break;case 96:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic};break;case 97:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,id:a[s-1]};break;case 98:this.$=a[s-1];break;case 99:this.$={text:a[s],type:`text`};break;case 100:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 101:this.$={text:a[s],type:`string`};break;case 102:case 119:this.$={text:a[s],type:`markdown`};break;case 116:this.$={text:a[s],type:`text`};break;case 117:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 118:this.$={text:a[s],type:`text`};break;case 120:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 121:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 122:case 130:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 123:case 131:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 124:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 125:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 126:this.$=a[s-2],r.setLink(a[s-2],a[s]);break;case 127:this.$=a[s-4],r.setLink(a[s-4],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 128:this.$=a[s-4],r.setLink(a[s-4],a[s-2],a[s]);break;case 129:this.$=a[s-6],r.setLink(a[s-6],a[s-4],a[s]),r.setTooltip(a[s-6],a[s-2]);break;case 132:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 133:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 134:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 135:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 136:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 137:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 138:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 139:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 140:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 141:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 142:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 143:case 145:this.$=[a[s]];break;case 144:case 146:a[s-2].push(a[s]),this.$=a[s-2];break;case 148:this.$=a[s-1]+a[s];break;case 196:this.$=a[s];break;case 197:this.$=a[s-1]+``+a[s];break;case 199:this.$=a[s-1]+``+a[s];break;case 200:this.$={stmt:`dir`,value:`TB`};break;case 201:this.$={stmt:`dir`,value:`BT`};break;case 202:this.$={stmt:`dir`,value:`RL`};break;case 203:this.$={stmt:`dir`,value:`LR`};break;case 204:this.$={stmt:`dir`,value:`TD`}}},`anonymous`),table:[{3:1,4:2,8:n,10:r,11:i,13:a},{1:[3]},e(o,s,{5:7}),{4:8,8:n,10:r,11:i,13:a},{4:9,8:n,10:r,11:i,13:a},{4:10,8:n,10:r,11:i,13:a},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(o,[2,10]),e(o,[2,11]),e(o,[2,12]),e(o,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:L,16:59,19:62},e(R,[2,3]),e(R,[2,4]),e(R,[2,5]),e(R,[2,6]),e(R,[2,7]),e(R,[2,8]),e(R,[2,9]),{8:z,9:B,10:V,12:H,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:z,9:B,10:V,12:H,22:75},{8:z,9:B,10:V,12:H,22:76},{8:z,9:B,10:V,12:H,22:77},{8:z,9:B,10:V,12:H,22:78},{8:z,9:B,10:V,12:H,22:79},{8:z,9:B,10:V,11:[1,80],12:H,22:81},{8:z,9:B,10:V,12:H,22:82},{11:[1,83]},e(R,[2,48]),{39:[1,84]},{41:[1,85]},e(R,[2,51]),e(re,[2,63],{19:86,34:87,11:L,43:ie}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:ae,47:oe,63:se,83:[1,96],92:ce,98:[1,93],100:[1,94],104:95,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},e(R,[2,200]),e(R,[2,201]),e(R,[2,202]),e(R,[2,203]),e(R,[2,204]),e(ge,[2,64]),e(ge,[2,67],{49:[1,109]}),e(U,[2,85],{116:122,30:[1,110],47:y,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:b,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),e(W,[2,196]),e(W,[2,157]),e(W,[2,158]),e(W,[2,159]),e(W,[2,160]),e(W,[2,161]),e(W,[2,162]),e(W,[2,163]),e(W,[2,164]),e(W,[2,165]),e(W,[2,166]),e(W,[2,167]),e(o,[2,14]),e(o,[2,20]),e(o,[2,21]),{10:[1,123]},e(o,[2,23]),e(_e,[2,31],{19:124,11:L}),e(R,[2,32]),{45:125,46:44,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(R,[2,52]),e(R,[2,53]),e(R,[2,54]),e(R,[2,55]),e(ve,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:ye,84:be,119:xe,122:Se},{78:[1,135],80:[1,136]},e(Ce,[2,96]),e(R,[2,33]),e(R,[2,34]),e(R,[2,35]),e(R,[2,36]),e(R,[2,37]),{11:we,13:Te,15:Ee,28:De,29:137,33:Oe,35:ke,36:Ae,47:je,63:Me,78:Ne,83:Pe,84:Fe,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:138,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e(Ye,s,{5:165}),e(Ye,s,{5:166}),{11:we,13:Te,15:Ee,28:De,29:167,33:Oe,35:ke,36:Ae,47:je,63:Me,78:Ne,83:Pe,84:Fe,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:138,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e(R,[2,49]),e(R,[2,50]),e(re,[2,61],{47:Xe}),e(re,[2,62],{19:169,11:L,43:Ze}),e(ge,[2,57]),{47:y,50:171,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{105:[1,172],106:173,108:[1,174]},{47:y,50:175,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{47:y,50:176,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},e(G,[2,130],{123:181,11:[1,180],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,132],{11:[1,182]}),e(K,[2,198]),e(K,[2,185]),e(K,[2,186]),e(K,[2,187]),e(K,[2,188]),e(K,[2,189]),e(K,[2,190]),e(K,[2,191]),e(K,[2,192]),e(K,[2,193]),e(K,[2,194]),e(K,[2,195]),{47:y,50:183,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{31:184,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:192,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:194,53:[1,193],70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:195,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:196,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:197,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{112:[1,198]},{31:199,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:200,68:[1,201],70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:202,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:203,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:204,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(W,[2,197]),e(o,[2,22]),e(_e,[2,30]),e(re,[2,59],{34:205,19:206,11:L,43:ie}),e(ve,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{80:[1,210],82:211,119:xe,122:Se},e(Qe,[2,92]),e(Qe,[2,94]),e(Qe,[2,95]),e(Qe,[2,183]),e(Qe,[2,184]),{79:212,82:130,83:ye,84:be,119:xe,122:Se},e(Ce,[2,97]),{8:z,9:B,10:V,11:we,12:H,13:Te,15:Ee,22:214,28:De,30:[1,213],33:Oe,34:215,35:ke,36:Ae,43:ie,47:je,63:Me,78:Ne,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:216,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e($,[2,116]),e($,[2,118]),e($,[2,119]),e($,[2,172]),e($,[2,173]),e($,[2,174]),e($,[2,175]),e($,[2,176]),e($,[2,177]),e($,[2,178]),e($,[2,179]),e($,[2,180]),e($,[2,181]),e($,[2,182]),e($,[2,103]),e($,[2,104]),e($,[2,105]),e($,[2,106]),e($,[2,107]),e($,[2,108]),e($,[2,109]),e($,[2,110]),e($,[2,111]),e($,[2,112]),e($,[2,113]),e($,[2,114]),e($,[2,115]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,217],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,218],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{8:z,9:B,10:V,11:we,12:H,13:Te,15:Ee,22:220,28:De,30:[1,219],33:Oe,34:221,35:ke,36:Ae,43:ie,47:je,63:Me,78:Ne,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:216,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},{11:L,19:222},{47:[1,223]},e(ge,[2,56]),{11:[1,224],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{11:[1,225]},{11:[1,226],109:[1,227]},e($e,[2,143]),{11:[1,228],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{11:[1,229],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{83:[1,230]},e(G,[2,124],{11:[1,231]}),e(G,[2,126],{11:[1,232]}),{83:[1,233]},e(K,[2,199]),{83:[1,234],101:[1,235]},e(ge,[2,68],{116:122,47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),{32:[1,236],70:q,85:237,119:X,120:Z,121:Q},e(et,[2,99]),e(et,[2,101]),e(et,[2,102]),e(et,[2,168]),e(et,[2,169]),e(et,[2,170]),e(et,[2,171]),{52:[1,238],70:q,85:237,119:X,120:Z,121:Q},{31:239,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{54:[1,240],70:q,85:237,119:X,120:Z,121:Q},{56:[1,241],70:q,85:237,119:X,120:Z,121:Q},{58:[1,242],70:q,85:237,119:X,120:Z,121:Q},{60:[1,243],70:q,85:237,119:X,120:Z,121:Q},{63:[1,244]},{67:[1,245],70:q,85:237,119:X,120:Z,121:Q},{69:[1,246],70:q,85:237,119:X,120:Z,121:Q},{31:247,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{32:[1,248],70:q,85:237,119:X,120:Z,121:Q},{70:q,72:[1,249],74:[1,250],85:237,119:X,120:Z,121:Q},{70:q,72:[1,252],74:[1,251],85:237,119:X,120:Z,121:Q},e(re,[2,58],{19:169,11:L,43:Ze}),e(re,[2,60],{47:Xe}),e(ve,[2,88]),e(ve,[2,87]),{65:[1,253],70:q,85:237,119:X,120:Z,121:Q},e(ve,[2,90]),e(Qe,[2,93]),{80:[1,254],82:211,119:xe,122:Se},{31:255,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(Ye,s,{5:256}),{8:z,9:B,10:V,12:H,22:257,43:Ze},e($,[2,117]),e(R,[2,42]),e(R,[2,43]),{31:258,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(R,[2,46]),{8:z,9:B,10:V,12:H,22:259,43:Ze},{46:260,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{11:L,19:261},{11:tt,63:nt,87:rt,95:262,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:273,107:[1,274],108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:275,107:[1,276],108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{108:[1,277]},{11:tt,63:nt,87:rt,95:278,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{47:y,50:279,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},e(G,[2,131]),e(G,[2,133],{11:[1,283]}),e(G,[2,134]),e(U,[2,69]),e(et,[2,100]),e(U,[2,70]),{54:[1,284],70:q,85:237,119:X,120:Z,121:Q},e(U,[2,77]),e(U,[2,72]),e(U,[2,73]),e(U,[2,74]),{112:[1,285]},e(U,[2,76]),e(U,[2,78]),{69:[1,286],70:q,85:237,119:X,120:Z,121:Q},e(U,[2,80]),e(U,[2,81]),e(U,[2,83]),e(U,[2,82]),e(U,[2,84]),e([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),e(ve,[2,91]),{32:[1,287],70:q,85:237,119:X,120:Z,121:Q},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,288],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(Ye,s,{5:289}),{32:[1,290],70:q,85:237,119:X,120:Z,121:Q},e(R,[2,47]),e(ge,[2,66]),{46:291,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,136],{109:lt}),e(ut,[2,145],{111:293,11:tt,63:nt,87:rt,108:it,112:at,113:ot,114:st,115:ct}),e(dt,[2,147]),e(dt,[2,149]),e(dt,[2,150]),e(dt,[2,151]),e(dt,[2,152]),e(dt,[2,153]),e(dt,[2,154]),e(dt,[2,155]),e(dt,[2,156]),e(G,[2,137],{109:lt}),{11:[1,294]},e(G,[2,138],{109:lt}),{11:[1,295]},e($e,[2,144]),e(G,[2,120],{109:lt}),e(G,[2,121],{116:122,47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),e(G,[2,125]),e(G,[2,127],{11:[1,296]}),e(G,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:z,9:B,10:V,12:H,22:301,34:302,43:ie},e(R,[2,40]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,303],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{8:z,9:B,10:V,12:H,22:304,34:305,43:ie},e(ge,[2,65]),{11:tt,63:nt,87:rt,108:it,110:306,111:264,112:at,113:ot,114:st,115:ct},e(dt,[2,148]),{15:ae,47:oe,63:se,92:ce,104:307,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},{15:ae,47:oe,63:se,92:ce,104:308,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},{101:[1,309]},e(G,[2,135]),e(U,[2,71]),{31:310,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(U,[2,79]),e(Ye,s,{5:311}),{8:z,9:B,10:V,12:H,22:312,43:Ze},e(R,[2,41]),e(R,[2,44]),{8:z,9:B,10:V,12:H,22:313,43:Ze},e(ut,[2,146],{111:293,11:tt,63:nt,87:rt,108:it,112:at,113:ot,114:st,115:ct}),e(G,[2,141],{123:181,11:[1,314],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,142],{123:181,11:[1,315],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,129]),{32:[1,316],70:q,85:237,119:X,120:Z,121:Q},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,317],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(Ye,s,{5:318}),e(R,[2,45]),{11:tt,63:nt,87:rt,95:319,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:320,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},e(U,[2,75]),e(R,[2,38]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,321],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(G,[2,139],{109:lt}),e(G,[2,140],{109:lt}),e(R,[2,39])],defaultActions:{},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};ft.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:t(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),38;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),40;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return this.pushState(`shapeData`),t.yytext=``,43;case 8:return this.pushState(`shapeDataStr`),43;case 9:return this.popState(),43;case 10:return t.yytext=t.yytext.replace(/\n\s*/g,`
`),43;case 11:return 43;case 12:this.popState();break;case 13:this.begin(`callbackname`);break;case 14:this.popState();break;case 15:this.popState(),this.begin(`callbackargs`);break;case 16:return 98;case 17:this.popState();break;case 18:return 99;case 19:return`MD_STR`;case 20:this.popState();break;case 21:this.begin(`md_string`);break;case 22:return`STR`;case 23:this.popState();break;case 24:this.pushState(`string`);break;case 25:return 87;case 26:return 105;case 27:return 88;case 28:return 107;case 29:return 89;case 30:return 90;case 31:return 100;case 32:this.begin(`click`);break;case 33:this.popState();break;case 34:return 91;case 35:return e.lex.firstGraph()&&this.begin(`dir`),13;case 36:return 28;case 37:return 36;case 38:return 35;case 39:return 33;case 40:return 101;case 41:return 101;case 42:return 101;case 43:return 101;case 44:return this.popState(),14;case 45:return this.popState(),15;case 46:return this.popState(),15;case 47:return this.popState(),15;case 48:return this.popState(),15;case 49:return this.popState(),15;case 50:return this.popState(),15;case 51:return this.popState(),15;case 52:return this.popState(),15;case 53:return this.popState(),15;case 54:return this.popState(),15;case 55:return 124;case 56:return 125;case 57:return 126;case 58:return 127;case 59:return 128;case 60:return 81;case 61:return 108;case 62:return 114;case 63:return 49;case 64:return 63;case 65:return 47;case 66:return 9;case 67:return 109;case 68:return 118;case 69:return this.popState(),80;case 70:return this.pushState(`edgeText`),78;case 71:return 122;case 72:return 80;case 73:break;case 74:return this.popState(),56;case 75:return`TEXT`;case 76:return this.pushState(`ellipseText`),55;case 77:return this.popState(),58;case 78:return this.pushState(`text`),57;case 79:return this.popState(),60;case 80:return this.pushState(`text`),59;case 81:return 61;case 82:return this.pushState(`text`),70;case 83:return this.popState(),67;case 84:return this.pushState(`text`),66;case 85:return this.popState(),52;case 86:return this.pushState(`text`),51;case 87:break;case 88:return this.popState(),72;case 89:return this.popState(),74;case 90:return 120;case 91:return this.pushState(`trapText`),71;case 92:return this.pushState(`trapText`),73;case 93:return 121;case 94:return 70;case 95:return 93;case 96:return`SEP`;case 97:return 92;case 98:return 118;case 99:return 114;case 100:return 47;case 101:return 8;case 102:return 112;case 103:return 117;case 104:return 119;case 105:return this.popState(),65;case 106:return this.pushState(`text`),65;case 107:return this.popState(),54;case 108:return this.pushState(`text`),53;case 109:return this.popState(),32;case 110:return this.pushState(`text`),30;case 111:return this.popState(),69;case 112:return this.pushState(`text`),68;case 113:break;case 114:return`TEXT`;case 115:return`QUOTE`;case 116:return 10;case 117:return 11;case 118:return 12}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:agentflow-beta\b)/,/^(?:flow\b)/,/^(?:connector\b)/,/^(?:global\b[ \t]*)/,/^(?:end\b[ \t]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*--+[x>]\s*)/,/^(?:\s*--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*-\.+-\s*)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|(?:[^\\\[\]\(\)\{\}\/%]+|(?!))+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:[ \t]*%%(?!\{)[^\n]*)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\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\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\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\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-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\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-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\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\u2183\u2184]|[\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\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\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])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:(?:[^\[\]\(\)\{\}\|\"%]+|(?!))+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeData:{rules:[8,11,12,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackargs:{rules:[17,18,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackname:{rules:[14,15,16,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},href:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},click:{rules:[21,24,33,34,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},edgeText:{rules:[21,24,69,71,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},trapText:{rules:[21,24,76,78,80,84,86,87,88,89,90,91,92,106,108,110,112],inclusive:!1},ellipseText:{rules:[21,24,73,74,75,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},text:{rules:[21,24,76,77,78,79,80,83,84,85,86,91,92,105,106,107,108,109,110,111,112,113,114],inclusive:!1},vertex:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr:{rules:[3,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_title:{rules:[1,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},md_string:{rules:[19,20,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},string:{rules:[21,22,23,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,76,78,80,81,82,84,86,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,108,110,112,115,116,117,118],inclusive:!0}}}})();function pt(){this.yy={}}return t(pt,`Parser`),pt.prototype=ft,ft.Parser=pt,new pt})();fe.parser=fe;var pe=fe,me=Object.assign({},pe);me.parse=e=>{let t=e.replace(/}[^\S\n]*\n/g,`} -`);return pe.parse(t)};var he=me,ge=t(e=>{let{theme:n,bkgColorArray:r,borderColorArray:i}=e;if(!b(n,i))return``;let a=S(e.look),o=C(r),s=x(e.THEME_COLOR_LIMIT,i),c=t(e=>i[e%i.length],`border`),l=t(e=>o?`fill: ${r[e%r.length]};`:``,`fill`),u=``;for(let e of B){let t=L.get(e),n=`[data-look="${a}"].node.${z(e)}`;u+=` +`);return pe.parse(t)};var he=me,ge=t(e=>{let{theme:n,bkgColorArray:r,borderColorArray:i}=e;if(!x(n,i))return``;let a=C(e.look),o=w(r),s=S(e.THEME_COLOR_LIMIT,i),c=t(e=>i[e%i.length],`border`),l=t(e=>o?`fill: ${r[e%r.length]};`:``,`fill`),u=``;for(let e of B){let t=L.get(e),n=`[data-look="${a}"].node.${z(e)}`;u+=` ${n} rect, ${n} path, @@ -196,5 +196,5 @@ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on l } text-align: center; } - ${y()} + ${O()} `,`getStyles`),init:t(e=>{e.agentflow??={},e.layout&&i({layout:e.layout}),e.flowchart??={},e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,i({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},`init`)};export{W as diagram}; \ No newline at end of file diff --git a/web/dist/app-diagram-3UASUU5V.js b/web/dist/app-diagram-3UASUU5V.js index 96ce28fe0..df1505c91 100644 --- a/web/dist/app-diagram-3UASUU5V.js +++ b/web/dist/app-diagram-3UASUU5V.js @@ -1,4 +1,4 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{D as r,H as i,U as a,a as o,b as s,c,f as l,q as u,v as d,w as f,y as p}from"./app-chunk-O7XYJQB3.js";import{t as m}from"./app-ordinal.js";import{t as h}from"./app-defaultLocale.js";import{i as g}from"./app-chunk-ZIGJFQKS.js";import{t as _}from"./app-chunk-6AEJRKK7.js";import{t as v}from"./app-chunk-JWPE2WC7.js";import{n as y}from"./app-mermaid-parser.core.js";import{i as b,n as x}from"./app-chunk-7PRAP22T.js";import{t as S}from"./app-chunk-WEXAMYUT.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function j(e){for(var t=this,n=M(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function M(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function N(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function P(){return Array.from(this)}function F(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function I(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*L(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i=0;--s)i.push(a=o[s]=new W(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(U)}function z(){return R(this).eachBefore(H)}function B(e){return e.children}function V(e){return Array.isArray(e)?e[1]:null}function H(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function U(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function W(e){this.data=e,this.depth=this.height=0,this.parent=null}W.prototype=R.prototype={constructor:W,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:j,ancestors:N,descendants:P,leaves:F,links:I,copy:z,[Symbol.iterator]:L};function G(e){if(typeof e!=`function`)throw Error();return e}function K(){return 0}function q(e){return function(){return e}}function J(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ee(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++sv&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p1?t:1)},n})(ne);function ae(){var e=ie,t=!1,n=1,r=1,i=[0],a=K,o=K,s=K,c=K,l=K;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(J),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d{x(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){o(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function X(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}e(X,`buildHierarchy`);var oe=e((t,n)=>{v(t,n);let r=[];for(let e of t.TreemapRows??[])e.$type===`ClassDefStatement`&&n.addClass(e.className??``,e.styleText??``);for(let e of t.TreemapRows??[]){let t=e.item;if(!t)continue;let i=e.indent?parseInt(e.indent):0,a=se(t),o=t.classSelector?n.getStylesForClass(t.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:t.$type,value:t.value,classSelector:t.classSelector,cssCompiledStyles:s};r.push(c)}let i=X(r),a=e((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),se=e(e=>e.name?String(e.name):``,`getItemName`),Z={parser:{yy:void 0},parse:e(async e=>{try{let n=await y(`treemap`,e);t.debug(`Treemap AST:`,n);let r=Z.parser?.yy;if(!(r instanceof Y))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);oe(n,r)}catch(e){throw t.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:e((r,i,a,o)=>{let l=o.db,u=l.getConfig(),d=u.padding??ce,f=l.getDiagramTitle(),p=l.getRoot(),{themeVariables:g}=s();if(!p)return;let v=f?30:0,y=_(i),x=u.nodeWidth?u.nodeWidth*Q:960,C=u.nodeHeight?u.nodeHeight*Q:500,w=x,T=C+v;y.attr(`viewBox`,`0 0 ${w} ${T}`),c(y,T,w,u.useMaxWidth);let E;try{let t=u.valueFormat||`,`;if(t===`$0,0`)E=e(e=>`$`+h(`,`)(e),`valueFormat`);else if(t.startsWith(`$`)&&t.includes(`,`)){let n=/\.\d+/.exec(t),r=n?n[0]:``;E=e(e=>`$`+h(`,`+r)(e),`valueFormat`)}else if(t.startsWith(`$`)){let n=t.substring(1);E=e(e=>`$`+h(n||``)(e),`valueFormat`)}else E=h(t)}catch(e){t.error(`Error creating format function:`,e),E=h(`,`)}let D=m().range([`transparent`,g.cScale0,g.cScale1,g.cScale2,g.cScale3,g.cScale4,g.cScale5,g.cScale6,g.cScale7,g.cScale8,g.cScale9,g.cScale10,g.cScale11]),O=m().range([`transparent`,g.cScalePeer0,g.cScalePeer1,g.cScalePeer2,g.cScalePeer3,g.cScalePeer4,g.cScalePeer5,g.cScalePeer6,g.cScalePeer7,g.cScalePeer8,g.cScalePeer9,g.cScalePeer10,g.cScalePeer11]),k=m().range([g.cScaleLabel0,g.cScaleLabel1,g.cScaleLabel2,g.cScaleLabel3,g.cScaleLabel4,g.cScaleLabel5,g.cScaleLabel6,g.cScaleLabel7,g.cScaleLabel8,g.cScaleLabel9,g.cScaleLabel10,g.cScaleLabel11]);f&&y.append(`text`).attr(`x`,w/2).attr(`y`,v/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let A=y.append(`g`).attr(`transform`,`translate(0, ${v})`).attr(`class`,`treemapContainer`),j=R(p).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=ae().size([x,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=b({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`clip-path`,(e,t)=>`url(#clip-section-${i}-${t})`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=n(this),r=e.data.name;t.text(r);let i=e.x1-e.x0,a;a=u.showValues!==!1&&e.value?i-10-30-10-6:i-6-6;let o=Math.max(15,a),s=t.node();if(s.getComputedTextLength()>o){let e=r;for(;e.length>0;){if(e=r.substring(0,e.length-1),e.length===0){t.text(`...`),s.getComputedTextLength()>o&&t.text(``);break}if(t.text(e+`...`),s.getComputedTextLength()<=o)break}}}),u.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=F.length>20,L=I?16:38,z=I?14:28,B=I?4:8,V=I?4:6,H=I?2:4,U=I?8:10,W=I?1:2,G=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);G.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>b({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),G.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),G.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${L}px;fill:`+k(e.data.name)+`;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=n(this),r=e.x1-e.x0,i=e.y1-e.y0,a=t.node(),o=r-2*H,s=i-2*H;if(oo&&c>B;)c--,t.style(`font-size`,`${c}px`);let u=Math.max(V,Math.min(z,Math.round(c*l))),d=c+W+u;for(;d>s&&c>B&&(c--,u=Math.max(V,Math.min(z,Math.round(c*l))),!(uo||c(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${z}px;fill:`+k(e.data.name)+`;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=n(this),r=this.parentNode;if(!r){t.style(`display`,`none`);return}let i=n(r).select(`.treemapLabel`);if(i.empty()||i.style(`display`)===`none`){t.style(`display`,`none`);return}let a=parseFloat(i.style(`font-size`)),o=Math.max(V,Math.min(z,Math.round(a*.6)));t.style(`font-size`,`${o}px`);let s=(e.y1-e.y0)/2+a/2+W;t.attr(`y`,s);let c=e.x1-e.x0,l=e.y1-e.y0-4,u=c-2*H;t.node().getComputedTextLength()>u||s+o>l||o{let t=r(),n=s(),i=g(t,n.themeVariables),a=g(ue,e),o=a.titleColor??i.titleColor,c=a.labelColor??i.textColor,l=a.valueColor??i.textColor;return` +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{D as r,H as i,U as a,a as o,b as s,c,f as l,q as u,v as d,w as f,y as p}from"./app-chunk-O7XYJQB3.js";import{t as m}from"./app-ordinal.js";import{t as h}from"./app-defaultLocale.js";import{i as g}from"./app-chunk-ZIGJFQKS.js";import{t as _}from"./app-chunk-6AEJRKK7.js";import{i as v,n as y}from"./app-chunk-7PRAP22T.js";import{t as b}from"./app-chunk-JWPE2WC7.js";import{n as x}from"./app-mermaid-parser.core.js";import{t as S}from"./app-chunk-WEXAMYUT.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function j(e){for(var t=this,n=M(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function M(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function N(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function P(){return Array.from(this)}function F(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function I(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*L(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i=0;--s)i.push(a=o[s]=new W(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(U)}function z(){return R(this).eachBefore(H)}function B(e){return e.children}function V(e){return Array.isArray(e)?e[1]:null}function H(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function U(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function W(e){this.data=e,this.depth=this.height=0,this.parent=null}W.prototype=R.prototype={constructor:W,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:j,ancestors:N,descendants:P,leaves:F,links:I,copy:z,[Symbol.iterator]:L};function G(e){if(typeof e!=`function`)throw Error();return e}function K(){return 0}function q(e){return function(){return e}}function J(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ee(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++sv&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p1?t:1)},n})(ne);function ae(){var e=ie,t=!1,n=1,r=1,i=[0],a=K,o=K,s=K,c=K,l=K;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(J),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d{y(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){o(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function X(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}e(X,`buildHierarchy`);var oe=e((t,n)=>{b(t,n);let r=[];for(let e of t.TreemapRows??[])e.$type===`ClassDefStatement`&&n.addClass(e.className??``,e.styleText??``);for(let e of t.TreemapRows??[]){let t=e.item;if(!t)continue;let i=e.indent?parseInt(e.indent):0,a=se(t),o=t.classSelector?n.getStylesForClass(t.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:t.$type,value:t.value,classSelector:t.classSelector,cssCompiledStyles:s};r.push(c)}let i=X(r),a=e((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),se=e(e=>e.name?String(e.name):``,`getItemName`),Z={parser:{yy:void 0},parse:e(async e=>{try{let n=await x(`treemap`,e);t.debug(`Treemap AST:`,n);let r=Z.parser?.yy;if(!(r instanceof Y))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);oe(n,r)}catch(e){throw t.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:e((r,i,a,o)=>{let l=o.db,u=l.getConfig(),d=u.padding??ce,f=l.getDiagramTitle(),p=l.getRoot(),{themeVariables:g}=s();if(!p)return;let y=f?30:0,b=_(i),x=u.nodeWidth?u.nodeWidth*Q:960,C=u.nodeHeight?u.nodeHeight*Q:500,w=x,T=C+y;b.attr(`viewBox`,`0 0 ${w} ${T}`),c(b,T,w,u.useMaxWidth);let E;try{let t=u.valueFormat||`,`;if(t===`$0,0`)E=e(e=>`$`+h(`,`)(e),`valueFormat`);else if(t.startsWith(`$`)&&t.includes(`,`)){let n=/\.\d+/.exec(t),r=n?n[0]:``;E=e(e=>`$`+h(`,`+r)(e),`valueFormat`)}else if(t.startsWith(`$`)){let n=t.substring(1);E=e(e=>`$`+h(n||``)(e),`valueFormat`)}else E=h(t)}catch(e){t.error(`Error creating format function:`,e),E=h(`,`)}let D=m().range([`transparent`,g.cScale0,g.cScale1,g.cScale2,g.cScale3,g.cScale4,g.cScale5,g.cScale6,g.cScale7,g.cScale8,g.cScale9,g.cScale10,g.cScale11]),O=m().range([`transparent`,g.cScalePeer0,g.cScalePeer1,g.cScalePeer2,g.cScalePeer3,g.cScalePeer4,g.cScalePeer5,g.cScalePeer6,g.cScalePeer7,g.cScalePeer8,g.cScalePeer9,g.cScalePeer10,g.cScalePeer11]),k=m().range([g.cScaleLabel0,g.cScaleLabel1,g.cScaleLabel2,g.cScaleLabel3,g.cScaleLabel4,g.cScaleLabel5,g.cScaleLabel6,g.cScaleLabel7,g.cScaleLabel8,g.cScaleLabel9,g.cScaleLabel10,g.cScaleLabel11]);f&&b.append(`text`).attr(`x`,w/2).attr(`y`,y/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let A=b.append(`g`).attr(`transform`,`translate(0, ${y})`).attr(`class`,`treemapContainer`),j=R(p).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=ae().size([x,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=v({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`clip-path`,(e,t)=>`url(#clip-section-${i}-${t})`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+v({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=n(this),r=e.data.name;t.text(r);let i=e.x1-e.x0,a;a=u.showValues!==!1&&e.value?i-10-30-10-6:i-6-6;let o=Math.max(15,a),s=t.node();if(s.getComputedTextLength()>o){let e=r;for(;e.length>0;){if(e=r.substring(0,e.length-1),e.length===0){t.text(`...`),s.getComputedTextLength()>o&&t.text(``);break}if(t.text(e+`...`),s.getComputedTextLength()<=o)break}}}),u.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+v({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=F.length>20,L=I?16:38,z=I?14:28,B=I?4:8,V=I?4:6,H=I?2:4,U=I?8:10,W=I?1:2,G=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);G.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>v({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),G.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),G.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${L}px;fill:`+k(e.data.name)+`;`+v({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=n(this),r=e.x1-e.x0,i=e.y1-e.y0,a=t.node(),o=r-2*H,s=i-2*H;if(oo&&c>B;)c--,t.style(`font-size`,`${c}px`);let u=Math.max(V,Math.min(z,Math.round(c*l))),d=c+W+u;for(;d>s&&c>B&&(c--,u=Math.max(V,Math.min(z,Math.round(c*l))),!(uo||c(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${z}px;fill:`+k(e.data.name)+`;`+v({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=n(this),r=this.parentNode;if(!r){t.style(`display`,`none`);return}let i=n(r).select(`.treemapLabel`);if(i.empty()||i.style(`display`)===`none`){t.style(`display`,`none`);return}let a=parseFloat(i.style(`font-size`)),o=Math.max(V,Math.min(z,Math.round(a*.6)));t.style(`font-size`,`${o}px`);let s=(e.y1-e.y0)/2+a/2+W;t.attr(`y`,s);let c=e.x1-e.x0,l=e.y1-e.y0-4,u=c-2*H;t.node().getComputedTextLength()>u||s+o>l||o{let t=r(),n=s(),i=g(t,n.themeVariables),a=g(ue,e),o=a.titleColor??i.titleColor,c=a.labelColor??i.textColor,l=a.valueColor??i.textColor;return` .treemapNode.section { stroke: ${a.sectionStrokeColor}; stroke-width: ${a.sectionStrokeWidth}; diff --git a/web/dist/app-diagram-ATOU4E4O.js b/web/dist/app-diagram-ATOU4E4O.js index 7db725fd2..f42272035 100644 --- a/web/dist/app-diagram-ATOU4E4O.js +++ b/web/dist/app-diagram-ATOU4E4O.js @@ -1,3 +1,3 @@ -import{T as e}from"./app-chunk-FOHPRMQF.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,U as a,X as o,a as s,b as c,f as l,q as u,v as d,w as f,x as p,y as m,z as h}from"./app-chunk-O7XYJQB3.js";import{_ as g,i as ee,t as te}from"./app-chunk-ZIGJFQKS.js";import{t as ne}from"./app-chunk-JWPE2WC7.js";import{n as re}from"./app-mermaid-parser.core.js";var _=`position frame`,v=`frame positioned`,y=`position relation`,b=`relation positioned`,ie=t(function(e){n.debug(`options str`,e)},`setOptions`),ae=t(function(){return{}},`getOptions`),oe=t(function(){x(),s()},`clear`);function x(){S={}}t(x,`reset`);var se=l.eventmodeling,ce=t(()=>ee({...se,...c().eventmodeling}),`getConfig`),S={};function C(){let e=le,{ast:t}=S,r=E();if(!t)throw Error(`No data for EventModel`);return t.frames.forEach((i,a)=>{let o=N(i,t.dataEntities,r);e=q(e,{$kind:_,index:a,frame:i,textProps:o});let s;B(i)?(n.debug(`source frame`,i.sourceFrames),s=t.frames.filter(e=>i.sourceFrames.some(t=>t.$refText===e.name)),s.forEach(t=>{e=q(e,{$kind:y,index:a,frame:i,sourceFrame:t})})):e=q(e,{$kind:y,index:a,frame:i})}),e={...e,sortedSwimlanesArray:L(e.swimlanes)},e}t(C,`getState`);function w(e){S.ast=e}t(w,`setAst`);var T={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:`bold`,boxTextPadding:10,swimlaneTextFontWeight:`bold`,labelUiAutomation:`UI/Automation`,labelUiAutomationPrefix:`UI/A: `,labelCommandReadModel:`Command/Read Model`,labelCommandReadModelPrefix:`C/RM: `,labelEvents:`Events`,labelEventsPrefix:`Stream: `};function E(){return T}t(E,`getDiagramProps`);var le={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function D(e){let t=e.split(`.`);if(t.length===2)return t[0]}t(D,`extractNamespace`);function O(e){let t=e.split(`.`);return t.length===2?t[1]:e}t(O,`extractName`);function k(e,t){if(!(!t||t.length===0))return Object.values(e).find(e=>e.namespace===t)}t(k,`findSwimlaneByNamespace`);function A(e,t,n){return Math.max(t,...Object.keys(e).filter(e=>{let r=Number.parseInt(e);return r>t&&rNumber.parseInt(e)))+1}t(A,`findNextAvailableIndex`);function j(e,t){let n=D(e.entityIdentifier),r=k(t,n);switch(e.modelEntityType){case`ui`:case`pcr`:case`processor`:return r?{index:r.index,label:r.namespace||T.labelUiAutomation}:n?{index:A(t,0,100),label:T.labelUiAutomationPrefix+n}:{index:0,label:T.labelUiAutomation};case`rmo`:case`readmodel`:case`cmd`:case`command`:return r?{index:r.index,label:r.namespace||T.labelCommandReadModel}:n?{index:A(t,100,200),label:T.labelCommandReadModelPrefix+n}:{index:100,label:T.labelCommandReadModel};default:return r?{index:r.index,label:r.namespace||T.labelEvents}:n?{index:A(t,200,300),label:T.labelEventsPrefix+n}:{index:200,label:T.labelEvents}}}t(j,`calculateSwimlaneProps`);function M(e){let{themeVariables:t}=c();switch(e.modelEntityType){case`ui`:return{fill:t.emUiFill??`white`,stroke:t.emUiStroke??`#dbdada`};case`pcr`:case`processor`:return{fill:t.emProcessorFill??`#edb3f6`,stroke:t.emProcessorStroke??`#b88cbf`};case`rmo`:case`readmodel`:return{fill:t.emReadModelFill??`#d3f1a2`,stroke:t.emReadModelStroke??`#a3b732`};case`cmd`:case`command`:return{fill:t.emCommandFill??`#bcd6fe`,stroke:t.emCommandStroke??`#679ac3`};case`evt`:case`event`:return{fill:t.emEventFill??`#ffb778`,stroke:t.emEventStroke??`#c19a0f`};default:return{fill:`red`,stroke:`black`}}}t(M,`calculateEntityVisualProps`);function N(e,t,r){let i=c(),a=h(O(e.entityIdentifier)??``,i),o,s={fontSize:16,fontWeight:700,fontFamily:`"trebuchet ms", verdana, arial, sans-serif`,joinWith:`
`},l=`${g(a,r.textMaxWidth,s)}`;if(e.dataInlineValue&&(o=e.dataInlineValue,o=o.substring(o.indexOf(`{`)+1),o=o.substring(0,o.lastIndexOf(`}`)-1),o=h(o,i),o=g(o,r.textMaxWidth,s),o=o.replaceAll(` `,` `)),e.dataReference){let n=t.find(t=>t.name===e.dataReference?.$refText);n&&(o=n.dataBlockValue,o=o.substring(o.indexOf(`{ -`)+2),o=o.substring(0,o.lastIndexOf(`}`)-1),o=h(o,i),o=g(o,r.textMaxWidth,s),o=o.replaceAll(` `,` `),o+=`
`)}let u=o!==void 0;u&&(l+=`

${o}`);let d={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},f=te(l,d),p=u?f.width/3:f.width,m={content:l,width:p,height:f.height};return n.debug(`[${e.name}] ${e.entityIdentifier} text`,m),m}t(N,`calculateTextProps`);function P(e,t){let n=t,r=M(n.frame),i={width:n.textProps.width+2*T.boxTextPadding,height:n.textProps.height+2*T.boxTextPadding};return[{$kind:v,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps}]}t(P,`decidePositionFrame`);function F(e,t,n){return t===void 0?T.contentStartX:t.index===e.index&&e.r?e.r+T.boxPadding:n===void 0?T.contentStartX:n.r-T.boxOverlap+T.boxPadding}t(F,`calculateX`);function I(e,t){let n=[...e.map(e=>e.r),t];return Math.max(...n)}t(I,`calculateMaxRight`);function L(e){return Object.values(e).sort((e,t)=>e.index-t.index)}t(L,`sortedSwimlanesArray`);function R(e,t){let n=t,r=j(n.frame,e.swimlanes),i;i=r.index in e.swimlanes?e.swimlanes[r.index]:{index:r.index,label:r.label,r:0,y:r.index*T.swimlaneMinHeight+T.swimlaneGap,height:T.swimlaneMinHeight,maxHeight:T.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=e.previousSwimlaneNumber===void 0?void 0:e.swimlanes[e.previousSwimlaneNumber],s={width:Math.max(T.boxMinWidth,Math.min(T.boxMaxWidth,n.dimension.width))+2*T.boxPadding,height:Math.max(T.boxMinHeight,Math.min(T.boxMaxHeight,n.dimension.height))+2*T.boxPadding},c=F(i,o,a),l=c+s.width+T.boxPadding,u=I(Object.values(e.swimlanes),l);i.r=c+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(T.swimlaneMinHeight,i.maxHeight)+2*T.swimlanePadding;let d={x:c,y:T.swimlanePadding+i.y,r:l,dimension:s,leftSibling:!1,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},f={...e,boxes:[...e.boxes,d],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:u},p=L(f.swimlanes);p.length>0&&(p[0].y=0);for(let e=1;e0}t(B,`hasSourceFrame`);function V(e,t){if(t!=null)return e.find(e=>e.frame.name===t.name)}t(V,`findBoxByFrame`);function H(e,t,n){if(!(n<0))for(let r=n;r>=0;r--){let n=e[r];if(n.swimlane.index!==t)return n}}t(H,`findBoxByLineIndex`);function U(t,n){let r=n;if(e(r.frame)||z(r.index,r.frame))return[];let i=V(t.boxes,r.frame);if(i===void 0)throw Error(`Target box not found for frame ${r.frame.name}`);let a;return a=r.sourceFrame?V(t.boxes,r.sourceFrame):H(t.boxes,i.swimlane.index,r.index-1),a===void 0?[]:[{$kind:b,frame:r.frame,index:r.index,sourceBox:a,targetBox:i}]}t(U,`decidePositionRelation`);function W(e,t){let n=t,r={visual:{fill:`none`,stroke:`#000`},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,r]}}t(W,`evolveRelationPositioned`);var ue={[_]:P,[y]:U},de={[v]:R,[b]:W};function G(e,t){let r=ue[t.$kind];if(r==null)return[];let i=r(e,t);return n.debug(`decided events`,i),i}t(G,`decide`);function K(e,t){let r=t.reduce((e,t)=>{let n=de[t.$kind];return n==null?e:n(e,t)},e);return n.debug(`evolve events`,{state:e,newState:r,events:t}),r}t(K,`evolve`);function q(e,t){return K(e,G(e,t))}t(q,`dispatch`);var J={getConfig:ce,setOptions:ie,getOptions:ae,clear:oe,setAccTitle:a,getAccTitle:m,getAccDescription:d,setAccDescription:i,setDiagramTitle:u,getDiagramTitle:f,setAst:w,getDiagramProps:E,getState:C},fe={parse:t(async e=>{let t=await re(`eventmodeling`,e);n.debug(t),J.setAst(t),ne(t,J)},`parse`)},Y=p()?.eventmodeling;function X(e,t){return n=>{let r=n.swimlane.y+t.swimlanePadding,i=e.append(`g`).attr(`class`,`em-box`);i.append(`rect`).attr(`x`,n.x).attr(`y`,r).attr(`rx`,`3`).attr(`width`,n.dimension.width).attr(`height`,n.dimension.height).attr(`stroke`,n.visual.stroke).attr(`fill`,n.visual.fill),i.append(`foreignObject`).attr(`x`,n.x+t.boxPadding).attr(`y`,r+10).attr(`width`,n.dimension.width-2*t.boxPadding).attr(`height`,n.dimension.height-2*t.boxPadding).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`).append(`span`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(n.text)}}t(X,`renderD3Box`);function Z(e,t){return e>t}t(Z,`dirUpwards`);function Q(e,t,r,i){return a=>{let o=a.sourceBox.swimlane.y+t.swimlanePadding,s=a.targetBox.swimlane.y+t.swimlanePadding,c=Z(o,s),l=a.sourceBox.x+a.sourceBox.dimension.width*2/3,u=a.targetBox.x+a.targetBox.dimension.width/3,d,f;n.debug(`rendering relation up=${c} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),c?(d=o,f=s+a.targetBox.dimension.height):(d=o+a.sourceBox.dimension.height,f=s);let p=i.emRelationStroke??a.visual.stroke;e.append(`path`).attr(`class`,`em-relation`).attr(`fill`,a.visual.fill).attr(`stroke`,p).attr(`stroke-width`,`1`).attr(`marker-end`,`url(#${r})`).attr(`d`,`M${l} ${d} L${u} ${f}`)}}t(Q,`renderD3Relation`);function $(e,t,n,r){return i=>{let a=e.append(`g`).attr(`class`,`em-swimlane`),o=r.emSwimlaneBackgroundOdd??`rgb(250,250,250)`,s=r.emSwimlaneBackgroundStroke??`rgb(240,240,240)`;a.append(`rect`).attr(`x`,0).attr(`y`,i.y).attr(`rx`,`3`).attr(`width`,t+n.swimlanePadding).attr(`height`,i.height).attr(`fill`,o).attr(`stroke`,s),a.append(`text`).attr(`font-weight`,n.swimlaneTextFontWeight).attr(`x`,30).attr(`y`,i.y+30).text(i.label)}}t($,`renderD3Swimlane`);var pe={parser:fe,db:J,renderer:{draw:t(function(e,t,i,a){if(n.debug(`in eventmodeling renderer`,e+` -`,`id:`,t,i),!Y)throw Error(`EventModeling config not found`);let s=a.db,{themeVariables:c,eventmodeling:l}=p(),u=r(`[id="${t}"]`),d=s.getDiagramProps(),f=s.getState(),m=`em-arrowhead-${t}`,h=c.emArrowhead??`#000000`;f.sortedSwimlanesArray.forEach($(u,f.maxR,d,c)),f.boxes.forEach(X(u,d)),f.relations.forEach(Q(u,d,m,c)),u.append(`defs`).append(`marker`).attr(`id`,m).attr(`markerWidth`,`10`).attr(`markerHeight`,`7`).attr(`refX`,`10`).attr(`refY`,`3.5`).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0 0, 10 3.5, 0 7`).attr(`fill`,h),o(void 0,u,l?.padding??30,l?.useMaxWidth)},`draw`)},styles:t(e=>``,`getStyles`)};export{pe as diagram}; \ No newline at end of file +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{H as r,U as i,X as a,a as o,b as s,f as c,q as l,v as u,w as d,x as f,y as p,z as m}from"./app-chunk-O7XYJQB3.js";import{_ as h,i as g,t as ee}from"./app-chunk-ZIGJFQKS.js";import{T as te}from"./app-chunk-FOHPRMQF.js";import{t as ne}from"./app-chunk-JWPE2WC7.js";import{n as re}from"./app-mermaid-parser.core.js";var _=`position frame`,v=`frame positioned`,y=`position relation`,b=`relation positioned`,ie=e(function(e){t.debug(`options str`,e)},`setOptions`),ae=e(function(){return{}},`getOptions`),oe=e(function(){x(),o()},`clear`);function x(){S={}}e(x,`reset`);var se=c.eventmodeling,ce=e(()=>g({...se,...s().eventmodeling}),`getConfig`),S={};function C(){let e=le,{ast:n}=S,r=E();if(!n)throw Error(`No data for EventModel`);return n.frames.forEach((i,a)=>{let o=N(i,n.dataEntities,r);e=q(e,{$kind:_,index:a,frame:i,textProps:o});let s;B(i)?(t.debug(`source frame`,i.sourceFrames),s=n.frames.filter(e=>i.sourceFrames.some(t=>t.$refText===e.name)),s.forEach(t=>{e=q(e,{$kind:y,index:a,frame:i,sourceFrame:t})})):e=q(e,{$kind:y,index:a,frame:i})}),e={...e,sortedSwimlanesArray:L(e.swimlanes)},e}e(C,`getState`);function w(e){S.ast=e}e(w,`setAst`);var T={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:`bold`,boxTextPadding:10,swimlaneTextFontWeight:`bold`,labelUiAutomation:`UI/Automation`,labelUiAutomationPrefix:`UI/A: `,labelCommandReadModel:`Command/Read Model`,labelCommandReadModelPrefix:`C/RM: `,labelEvents:`Events`,labelEventsPrefix:`Stream: `};function E(){return T}e(E,`getDiagramProps`);var le={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function D(e){let t=e.split(`.`);if(t.length===2)return t[0]}e(D,`extractNamespace`);function O(e){let t=e.split(`.`);return t.length===2?t[1]:e}e(O,`extractName`);function k(e,t){if(!(!t||t.length===0))return Object.values(e).find(e=>e.namespace===t)}e(k,`findSwimlaneByNamespace`);function A(e,t,n){return Math.max(t,...Object.keys(e).filter(e=>{let r=Number.parseInt(e);return r>t&&rNumber.parseInt(e)))+1}e(A,`findNextAvailableIndex`);function j(e,t){let n=D(e.entityIdentifier),r=k(t,n);switch(e.modelEntityType){case`ui`:case`pcr`:case`processor`:return r?{index:r.index,label:r.namespace||T.labelUiAutomation}:n?{index:A(t,0,100),label:T.labelUiAutomationPrefix+n}:{index:0,label:T.labelUiAutomation};case`rmo`:case`readmodel`:case`cmd`:case`command`:return r?{index:r.index,label:r.namespace||T.labelCommandReadModel}:n?{index:A(t,100,200),label:T.labelCommandReadModelPrefix+n}:{index:100,label:T.labelCommandReadModel};default:return r?{index:r.index,label:r.namespace||T.labelEvents}:n?{index:A(t,200,300),label:T.labelEventsPrefix+n}:{index:200,label:T.labelEvents}}}e(j,`calculateSwimlaneProps`);function M(e){let{themeVariables:t}=s();switch(e.modelEntityType){case`ui`:return{fill:t.emUiFill??`white`,stroke:t.emUiStroke??`#dbdada`};case`pcr`:case`processor`:return{fill:t.emProcessorFill??`#edb3f6`,stroke:t.emProcessorStroke??`#b88cbf`};case`rmo`:case`readmodel`:return{fill:t.emReadModelFill??`#d3f1a2`,stroke:t.emReadModelStroke??`#a3b732`};case`cmd`:case`command`:return{fill:t.emCommandFill??`#bcd6fe`,stroke:t.emCommandStroke??`#679ac3`};case`evt`:case`event`:return{fill:t.emEventFill??`#ffb778`,stroke:t.emEventStroke??`#c19a0f`};default:return{fill:`red`,stroke:`black`}}}e(M,`calculateEntityVisualProps`);function N(e,n,r){let i=s(),a=m(O(e.entityIdentifier)??``,i),o,c={fontSize:16,fontWeight:700,fontFamily:`"trebuchet ms", verdana, arial, sans-serif`,joinWith:`
`},l=`${h(a,r.textMaxWidth,c)}`;if(e.dataInlineValue&&(o=e.dataInlineValue,o=o.substring(o.indexOf(`{`)+1),o=o.substring(0,o.lastIndexOf(`}`)-1),o=m(o,i),o=h(o,r.textMaxWidth,c),o=o.replaceAll(` `,` `)),e.dataReference){let t=n.find(t=>t.name===e.dataReference?.$refText);t&&(o=t.dataBlockValue,o=o.substring(o.indexOf(`{ +`)+2),o=o.substring(0,o.lastIndexOf(`}`)-1),o=m(o,i),o=h(o,r.textMaxWidth,c),o=o.replaceAll(` `,` `),o+=`
`)}let u=o!==void 0;u&&(l+=`

${o}`);let d={fontSize:c.fontSize,fontWeight:c.fontWeight,fontFamily:c.fontFamily},f=ee(l,d),p=u?f.width/3:f.width,g={content:l,width:p,height:f.height};return t.debug(`[${e.name}] ${e.entityIdentifier} text`,g),g}e(N,`calculateTextProps`);function P(e,t){let n=t,r=M(n.frame),i={width:n.textProps.width+2*T.boxTextPadding,height:n.textProps.height+2*T.boxTextPadding};return[{$kind:v,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps}]}e(P,`decidePositionFrame`);function F(e,t,n){return t===void 0?T.contentStartX:t.index===e.index&&e.r?e.r+T.boxPadding:n===void 0?T.contentStartX:n.r-T.boxOverlap+T.boxPadding}e(F,`calculateX`);function I(e,t){let n=[...e.map(e=>e.r),t];return Math.max(...n)}e(I,`calculateMaxRight`);function L(e){return Object.values(e).sort((e,t)=>e.index-t.index)}e(L,`sortedSwimlanesArray`);function R(e,t){let n=t,r=j(n.frame,e.swimlanes),i;i=r.index in e.swimlanes?e.swimlanes[r.index]:{index:r.index,label:r.label,r:0,y:r.index*T.swimlaneMinHeight+T.swimlaneGap,height:T.swimlaneMinHeight,maxHeight:T.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=e.previousSwimlaneNumber===void 0?void 0:e.swimlanes[e.previousSwimlaneNumber],s={width:Math.max(T.boxMinWidth,Math.min(T.boxMaxWidth,n.dimension.width))+2*T.boxPadding,height:Math.max(T.boxMinHeight,Math.min(T.boxMaxHeight,n.dimension.height))+2*T.boxPadding},c=F(i,o,a),l=c+s.width+T.boxPadding,u=I(Object.values(e.swimlanes),l);i.r=c+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(T.swimlaneMinHeight,i.maxHeight)+2*T.swimlanePadding;let d={x:c,y:T.swimlanePadding+i.y,r:l,dimension:s,leftSibling:!1,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},f={...e,boxes:[...e.boxes,d],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:u},p=L(f.swimlanes);p.length>0&&(p[0].y=0);for(let e=1;e0}e(B,`hasSourceFrame`);function V(e,t){if(t!=null)return e.find(e=>e.frame.name===t.name)}e(V,`findBoxByFrame`);function H(e,t,n){if(!(n<0))for(let r=n;r>=0;r--){let n=e[r];if(n.swimlane.index!==t)return n}}e(H,`findBoxByLineIndex`);function U(e,t){let n=t;if(te(n.frame)||z(n.index,n.frame))return[];let r=V(e.boxes,n.frame);if(r===void 0)throw Error(`Target box not found for frame ${n.frame.name}`);let i;return i=n.sourceFrame?V(e.boxes,n.sourceFrame):H(e.boxes,r.swimlane.index,n.index-1),i===void 0?[]:[{$kind:b,frame:n.frame,index:n.index,sourceBox:i,targetBox:r}]}e(U,`decidePositionRelation`);function W(e,t){let n=t,r={visual:{fill:`none`,stroke:`#000`},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,r]}}e(W,`evolveRelationPositioned`);var ue={[_]:P,[y]:U},de={[v]:R,[b]:W};function G(e,n){let r=ue[n.$kind];if(r==null)return[];let i=r(e,n);return t.debug(`decided events`,i),i}e(G,`decide`);function K(e,n){let r=n.reduce((e,t)=>{let n=de[t.$kind];return n==null?e:n(e,t)},e);return t.debug(`evolve events`,{state:e,newState:r,events:n}),r}e(K,`evolve`);function q(e,t){return K(e,G(e,t))}e(q,`dispatch`);var J={getConfig:ce,setOptions:ie,getOptions:ae,clear:oe,setAccTitle:i,getAccTitle:p,getAccDescription:u,setAccDescription:r,setDiagramTitle:l,getDiagramTitle:d,setAst:w,getDiagramProps:E,getState:C},fe={parse:e(async e=>{let n=await re(`eventmodeling`,e);t.debug(n),J.setAst(n),ne(n,J)},`parse`)},Y=f()?.eventmodeling;function X(e,t){return n=>{let r=n.swimlane.y+t.swimlanePadding,i=e.append(`g`).attr(`class`,`em-box`);i.append(`rect`).attr(`x`,n.x).attr(`y`,r).attr(`rx`,`3`).attr(`width`,n.dimension.width).attr(`height`,n.dimension.height).attr(`stroke`,n.visual.stroke).attr(`fill`,n.visual.fill),i.append(`foreignObject`).attr(`x`,n.x+t.boxPadding).attr(`y`,r+10).attr(`width`,n.dimension.width-2*t.boxPadding).attr(`height`,n.dimension.height-2*t.boxPadding).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`).append(`span`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(n.text)}}e(X,`renderD3Box`);function Z(e,t){return e>t}e(Z,`dirUpwards`);function Q(e,n,r,i){return a=>{let o=a.sourceBox.swimlane.y+n.swimlanePadding,s=a.targetBox.swimlane.y+n.swimlanePadding,c=Z(o,s),l=a.sourceBox.x+a.sourceBox.dimension.width*2/3,u=a.targetBox.x+a.targetBox.dimension.width/3,d,f;t.debug(`rendering relation up=${c} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),c?(d=o,f=s+a.targetBox.dimension.height):(d=o+a.sourceBox.dimension.height,f=s);let p=i.emRelationStroke??a.visual.stroke;e.append(`path`).attr(`class`,`em-relation`).attr(`fill`,a.visual.fill).attr(`stroke`,p).attr(`stroke-width`,`1`).attr(`marker-end`,`url(#${r})`).attr(`d`,`M${l} ${d} L${u} ${f}`)}}e(Q,`renderD3Relation`);function $(e,t,n,r){return i=>{let a=e.append(`g`).attr(`class`,`em-swimlane`),o=r.emSwimlaneBackgroundOdd??`rgb(250,250,250)`,s=r.emSwimlaneBackgroundStroke??`rgb(240,240,240)`;a.append(`rect`).attr(`x`,0).attr(`y`,i.y).attr(`rx`,`3`).attr(`width`,t+n.swimlanePadding).attr(`height`,i.height).attr(`fill`,o).attr(`stroke`,s),a.append(`text`).attr(`font-weight`,n.swimlaneTextFontWeight).attr(`x`,30).attr(`y`,i.y+30).text(i.label)}}e($,`renderD3Swimlane`);var pe={parser:fe,db:J,renderer:{draw:e(function(e,r,i,o){if(t.debug(`in eventmodeling renderer`,e+` +`,`id:`,r,i),!Y)throw Error(`EventModeling config not found`);let s=o.db,{themeVariables:c,eventmodeling:l}=f(),u=n(`[id="${r}"]`),d=s.getDiagramProps(),p=s.getState(),m=`em-arrowhead-${r}`,h=c.emArrowhead??`#000000`;p.sortedSwimlanesArray.forEach($(u,p.maxR,d,c)),p.boxes.forEach(X(u,d)),p.relations.forEach(Q(u,d,m,c)),u.append(`defs`).append(`marker`).attr(`id`,m).attr(`markerWidth`,`10`).attr(`markerHeight`,`7`).attr(`refX`,`10`).attr(`refY`,`3.5`).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0 0, 10 3.5, 0 7`).attr(`fill`,h),a(void 0,u,l?.padding??30,l?.useMaxWidth)},`draw`)},styles:e(e=>``,`getStyles`)};export{pe as diagram}; \ No newline at end of file diff --git a/web/dist/app-diagram-CDSNMT55.js b/web/dist/app-diagram-CDSNMT55.js index 6495a98eb..11c0962b7 100644 --- a/web/dist/app-diagram-CDSNMT55.js +++ b/web/dist/app-diagram-CDSNMT55.js @@ -1,6 +1,6 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{H as n,U as r,a as i,b as a,c as o,f as s,q as c,v as l,w as u,y as d,z as f}from"./app-chunk-O7XYJQB3.js";import{i as p}from"./app-chunk-ZIGJFQKS.js";import{t as m}from"./app-chunk-6AEJRKK7.js";import{t as h}from"./app-chunk-JWPE2WC7.js";import{n as g}from"./app-mermaid-parser.core.js";import{r as _,t as v}from"./app-chunk-742MDFTN.js";import{t as y}from"./app-chunk-2Q5K7J3B.js";var b=/[─━│┃└┗├┣]/,x=/[└┗├┣]/,S=/[─━]/,C=/^[\s│┃]+$/,w=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,T=/^\s*%%/,E=` `;function D(e){return e.some(e=>b.test(e))}e(D,`isBoxDrawingFormat`);function O(e){for(let t of e){let e=x.exec(t);if(e?.index&&e.index>0)return e.index}return 4}e(O,`inferSegmentWidth`);function k(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let r=parseInt(n,10),i=t.get(r);return i?`line ${i}`:e})}e(k,`remapErrorLines`);function A(e){let t=e.split(` +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{H as n,U as r,a as i,b as a,c as o,f as s,q as c,v as l,w as u,y as d,z as f}from"./app-chunk-O7XYJQB3.js";import{i as p}from"./app-chunk-ZIGJFQKS.js";import{t as m}from"./app-chunk-6AEJRKK7.js";import{r as h,t as g}from"./app-chunk-742MDFTN.js";import{t as _}from"./app-chunk-JWPE2WC7.js";import{n as v}from"./app-mermaid-parser.core.js";import{t as y}from"./app-chunk-2Q5K7J3B.js";var b=/[─━│┃└┗├┣]/,x=/[└┗├┣]/,S=/[─━]/,C=/^[\s│┃]+$/,w=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,T=/^\s*%%/,E=` `;function D(e){return e.some(e=>b.test(e))}e(D,`isBoxDrawingFormat`);function O(e){for(let t of e){let e=x.exec(t);if(e?.index&&e.index>0)return e.index}return 4}e(O,`inferSegmentWidth`);function k(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let r=parseInt(n,10),i=t.get(r);return i?`line ${i}`:e})}e(k,`remapErrorLines`);function A(e){let t=e.split(` `),n=new Map,r=-1;for(let[e,n]of t.entries())if(n.trim()===`treeView-beta`){r=e;break}if(r===-1)return{text:e,lineMap:n};let i=[];for(let e=r+1;e({cnt:1,stack:[{id:0,level:-1,name:`/`,nodeType:`directory`,children:[]}]})),M=e(()=>{j.reset(),i()},`clear`),N=e(()=>j.records.stack[0],`getRoot`),P=e(()=>j.records.cnt,`getCount`),F=s.treeView,I={clear:M,addNode:e((e,t,n,r,i,a)=>{for(;e<=j.records.stack[j.records.stack.length-1].level;)j.records.stack.pop();let o={id:j.records.cnt++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:a,children:[]};j.records.stack[j.records.stack.length-1].children.push(o),j.records.stack.push(o)},`addNode`),getRoot:N,getCount:P,getConfig:e(()=>p(F,a().treeView),`getConfig`),getAccTitle:d,getAccDescription:l,getDiagramTitle:u,setAccDescription:n,setAccTitle:r,setDiagramTitle:c},L=e(e=>{h(e,I);for(let t of e.nodes){let e=typeof t.indent==`number`?t.indent:0,n=t.name,r=n.endsWith(`/`);r&&(n=n.slice(0,-1));let i=r?`directory`:`file`,o=t.classAnnotation||void 0,s=t.iconAnnotation,c=s===void 0?void 0:s||`none`,l=t.descAnnotation||void 0,u=l?f(l,a()):void 0;I.addNode(e,n,i,o,c,u)}},`populate`),R={parse:e(async e=>{let{text:n,lineMap:r}=A(e);try{let e=await g(`treeView`,n);t.debug(e),L(e)}catch(e){throw r.size>0&&e instanceof Error&&(e.message=k(e.message,r)),e}},`parse`)},z={prefix:`mermaid-treeview`,height:24,width:24,icons:{folder:{body:``},file:{body:``}}};function B(e,t){let n=t?.filenameIcons?.[e];if(n)return n;let r=e.lastIndexOf(`.`);if(r>0){let n=e.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[n]??i?.[n.slice(1)]}}e(B,`detectIcon`);function V(e,t){return e.includes(`:`)?e:e in z.icons||!t?`${z.prefix}:${e}`:`${t}:${e}`}e(V,`qualifyIcon`);function H(e,t){if(e.icon!==`none`){if(e.icon)return V(e.icon,t.defaultIconPack);if(t.showIcons){if(e.nodeType===`file`){let n=B(e.name,t);if(n===`none`)return;if(n)return V(n,t.defaultIconPack)}return`${z.prefix}:${e.nodeType===`directory`?`folder`:`file`}`}}}e(H,`getNodeIcon`),_([{name:z.prefix,icons:z}]);var U=14,W=4,G=16,K=e(async(t,n)=>{let r=[],i=e(e=>{let t=H(e,n);t&&r.push({icon:t,node:e}),e.children.forEach(i)},`collect`);i(t);let a=await Promise.all(r.map(async({icon:e,node:t})=>({id:t.id,svg:await v(e,{height:U,width:U})})));return new Map(a.map(({id:e,svg:t})=>[e,t]))},`resolveNodeIcons`),q=e((e,t,n,r,i,a)=>{let o=r.append(`g`),s=`treeView-node-label`;n.nodeType===`directory`&&(s+=` treeView-node-dir`),n.cssClass&&(s+=` ${n.cssClass}`);let c=U+W,l=H(n,i),u=l!==void 0;l&&o.append(`g`).attr(`class`,`treeView-node-icon`).attr(`transform`,`translate(${e+i.paddingX}, ${t+i.paddingY})`).html(a.get(n.id)??``);let d=o.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,s),{height:f,width:p}=d.node().getBBox(),m=f+i.paddingY*2,h=e+i.paddingX+(u?c:0);d.attr(`x`,h),d.attr(`y`,t+m/2);let g=h+p;return n.BBox={x:e,y:t,width:p+i.paddingX*2+(u?c:0),height:m},n.cssClass?.split(/\s+/).includes(`highlight`)&&o.insert(`rect`,`:first-child`).attr(`x`,e).attr(`y`,t+1).attr(`width`,0).attr(`height`,m-2).attr(`rx`,3).attr(`class`,`treeView-highlight-bg`),{node:n,nodeGroup:o,labelRightEdge:g,centerY:t+m/2}},`positionLabel`),J=e((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),Y=e((t,n,r,i)=>{let a=0,o=0,s=[],c=e((e,t,n,r)=>{let c=r*(n.rowIndent+n.paddingX),l=q(c,a,t,e,n,i);s.push(l);let{height:u,width:d}=t.BBox;J(e,c-n.rowIndent,a+u/2,c,a+u/2,n.lineThickness),o=Math.max(o,c+d),a+=u},`drawNode`),l=e((e,n=0)=>{c(t,e,r,n),e.children.forEach(e=>{l(e,n+1)});let{x:i,y:a,height:o}=e.BBox;if(e.children.length){let{y:n,height:s}=e.children[e.children.length-1].BBox;J(t,i+r.paddingX,a+o,i+r.paddingX,n+s/2+r.lineThickness/2,r.lineThickness)}},`processNode`);l(n);let u=s.filter(e=>e.node.description);if(u.length>0){let e=Math.max(...s.map(e=>e.labelRightEdge))+G;for(let t of u){let n=t.nodeGroup.append(`text`).text(t.node.description).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-description`).attr(`x`,e).attr(`y`,t.centerY).node().getBBox();o=Math.max(o,e+n.width+r.paddingX)}}for(let e of s)if(e.node.cssClass?.split(/\s+/).includes(`highlight`)){let t=e.nodeGroup.select(`.treeView-highlight-bg`);if(!t.empty()){let n=o-e.node.BBox.x+8;t.attr(`width`,n),o=Math.max(o,e.node.BBox.x+n+2)}}return{totalHeight:a,totalWidth:o}},`drawTree`),X={draw:e(async(e,n,r,i)=>{t.debug(`Rendering treeView diagram +`),lineMap:n}}e(A,`preprocessBoxDrawing`);var j=new y(()=>({cnt:1,stack:[{id:0,level:-1,name:`/`,nodeType:`directory`,children:[]}]})),M=e(()=>{j.reset(),i()},`clear`),N=e(()=>j.records.stack[0],`getRoot`),P=e(()=>j.records.cnt,`getCount`),F=s.treeView,I={clear:M,addNode:e((e,t,n,r,i,a)=>{for(;e<=j.records.stack[j.records.stack.length-1].level;)j.records.stack.pop();let o={id:j.records.cnt++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:a,children:[]};j.records.stack[j.records.stack.length-1].children.push(o),j.records.stack.push(o)},`addNode`),getRoot:N,getCount:P,getConfig:e(()=>p(F,a().treeView),`getConfig`),getAccTitle:d,getAccDescription:l,getDiagramTitle:u,setAccDescription:n,setAccTitle:r,setDiagramTitle:c},L=e(e=>{_(e,I);for(let t of e.nodes){let e=typeof t.indent==`number`?t.indent:0,n=t.name,r=n.endsWith(`/`);r&&(n=n.slice(0,-1));let i=r?`directory`:`file`,o=t.classAnnotation||void 0,s=t.iconAnnotation,c=s===void 0?void 0:s||`none`,l=t.descAnnotation||void 0,u=l?f(l,a()):void 0;I.addNode(e,n,i,o,c,u)}},`populate`),R={parse:e(async e=>{let{text:n,lineMap:r}=A(e);try{let e=await v(`treeView`,n);t.debug(e),L(e)}catch(e){throw r.size>0&&e instanceof Error&&(e.message=k(e.message,r)),e}},`parse`)},z={prefix:`mermaid-treeview`,height:24,width:24,icons:{folder:{body:``},file:{body:``}}};function B(e,t){let n=t?.filenameIcons?.[e];if(n)return n;let r=e.lastIndexOf(`.`);if(r>0){let n=e.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[n]??i?.[n.slice(1)]}}e(B,`detectIcon`);function V(e,t){return e.includes(`:`)?e:e in z.icons||!t?`${z.prefix}:${e}`:`${t}:${e}`}e(V,`qualifyIcon`);function H(e,t){if(e.icon!==`none`){if(e.icon)return V(e.icon,t.defaultIconPack);if(t.showIcons){if(e.nodeType===`file`){let n=B(e.name,t);if(n===`none`)return;if(n)return V(n,t.defaultIconPack)}return`${z.prefix}:${e.nodeType===`directory`?`folder`:`file`}`}}}e(H,`getNodeIcon`),h([{name:z.prefix,icons:z}]);var U=14,W=4,G=16,K=e(async(t,n)=>{let r=[],i=e(e=>{let t=H(e,n);t&&r.push({icon:t,node:e}),e.children.forEach(i)},`collect`);i(t);let a=await Promise.all(r.map(async({icon:e,node:t})=>({id:t.id,svg:await g(e,{height:U,width:U})})));return new Map(a.map(({id:e,svg:t})=>[e,t]))},`resolveNodeIcons`),q=e((e,t,n,r,i,a)=>{let o=r.append(`g`),s=`treeView-node-label`;n.nodeType===`directory`&&(s+=` treeView-node-dir`),n.cssClass&&(s+=` ${n.cssClass}`);let c=U+W,l=H(n,i),u=l!==void 0;l&&o.append(`g`).attr(`class`,`treeView-node-icon`).attr(`transform`,`translate(${e+i.paddingX}, ${t+i.paddingY})`).html(a.get(n.id)??``);let d=o.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,s),{height:f,width:p}=d.node().getBBox(),m=f+i.paddingY*2,h=e+i.paddingX+(u?c:0);d.attr(`x`,h),d.attr(`y`,t+m/2);let g=h+p;return n.BBox={x:e,y:t,width:p+i.paddingX*2+(u?c:0),height:m},n.cssClass?.split(/\s+/).includes(`highlight`)&&o.insert(`rect`,`:first-child`).attr(`x`,e).attr(`y`,t+1).attr(`width`,0).attr(`height`,m-2).attr(`rx`,3).attr(`class`,`treeView-highlight-bg`),{node:n,nodeGroup:o,labelRightEdge:g,centerY:t+m/2}},`positionLabel`),J=e((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),Y=e((t,n,r,i)=>{let a=0,o=0,s=[],c=e((e,t,n,r)=>{let c=r*(n.rowIndent+n.paddingX),l=q(c,a,t,e,n,i);s.push(l);let{height:u,width:d}=t.BBox;J(e,c-n.rowIndent,a+u/2,c,a+u/2,n.lineThickness),o=Math.max(o,c+d),a+=u},`drawNode`),l=e((e,n=0)=>{c(t,e,r,n),e.children.forEach(e=>{l(e,n+1)});let{x:i,y:a,height:o}=e.BBox;if(e.children.length){let{y:n,height:s}=e.children[e.children.length-1].BBox;J(t,i+r.paddingX,a+o,i+r.paddingX,n+s/2+r.lineThickness/2,r.lineThickness)}},`processNode`);l(n);let u=s.filter(e=>e.node.description);if(u.length>0){let e=Math.max(...s.map(e=>e.labelRightEdge))+G;for(let t of u){let n=t.nodeGroup.append(`text`).text(t.node.description).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-description`).attr(`x`,e).attr(`y`,t.centerY).node().getBBox();o=Math.max(o,e+n.width+r.paddingX)}}for(let e of s)if(e.node.cssClass?.split(/\s+/).includes(`highlight`)){let t=e.nodeGroup.select(`.treeView-highlight-bg`);if(!t.empty()){let n=o-e.node.BBox.x+8;t.attr(`width`,n),o=Math.max(o,e.node.BBox.x+n+2)}}return{totalHeight:a,totalWidth:o}},`drawTree`),X={draw:e(async(e,n,r,i)=>{t.debug(`Rendering treeView diagram `+e);let a=i.db,s=a.getRoot(),c=a.getConfig(),l=m(n),u=l.append(`g`);u.attr(`class`,`tree-view`);let{totalHeight:d,totalWidth:f}=Y(u,s,c,await K(s,c));l.attr(`viewBox`,`-${c.lineThickness/2} 0 ${f} ${d}`),o(l,d,f,c.useMaxWidth)},`draw`)},Z={labelFontSize:`16px`,labelColor:`black`,lineColor:`black`,iconColor:`#546e7a`,descriptionColor:`#6a9955`,highlightBg:`rgba(255, 193, 7, 0.15)`,highlightStroke:`#ffc107`},Q={db:I,renderer:X,parser:R,styles:e(({treeView:e})=>{let{labelFontSize:t,labelColor:n,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:o,highlightStroke:s}=p(Z,e);return` .treeView-node-label { font-size: ${t}; diff --git a/web/dist/app-ebnfDiagram-ZINNZB2B.js b/web/dist/app-ebnfDiagram-ZINNZB2B.js index 85d12786b..0f8c1ad18 100644 --- a/web/dist/app-ebnfDiagram-ZINNZB2B.js +++ b/web/dist/app-ebnfDiagram-ZINNZB2B.js @@ -1 +1 @@ -import{n as e}from"./app-chunk-2ZTRR5NV.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=e().RailroadEbnf.parser.LangiumParser,l=t(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformChoice`),u=t(e=>{let t=e.elements.map(p);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=t(e=>{switch(e.$type){case`EbnfTerminal`:return{type:`terminal`,value:e.value};case`EbnfNonTerminal`:return{type:`nonterminal`,name:e.name};case`EbnfSpecial`:return{type:`special`,text:e.text};case`EbnfGroup`:return l(e.element);case`EbnfOptional`:return{type:`optional`,element:l(e.element)};case`EbnfRepetition`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported EBNF primary node: ${e.$type}`)}},`transformPrimary`),f=t((e,t)=>{switch(t.$type){case`EbnfOptionalPostfix`:return{type:`optional`,element:e};case`EbnfZeroOrMorePostfix`:return{type:`repetition`,element:e,min:0,max:1/0};case`EbnfOneOrMorePostfix`:return{type:`repetition`,element:e,min:1,max:1/0};case`EbnfExceptionPostfix`:return{type:`sequence`,elements:[e,{type:`terminal`,value:`-`},d(t.except)]};default:throw Error(`Unsupported EBNF postfix node: ${t.$type}`)}},`transformPostfix`),p=t(e=>e.postfixes.reduce((e,t)=>f(e,t),d(e.base)),`transformTerm`),m=t(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=t(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:t(e=>{a.clear(),n.debug(`[EBNF Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;n.debug(`[EBNF Parser] Parsed rules:`,r.rules.length),h(r),n.debug(`[EBNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{g as diagram}; \ No newline at end of file +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n}from"./app-chunk-2ZTRR5NV.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=n().RailroadEbnf.parser.LangiumParser,l=e(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformChoice`),u=e(e=>{let t=e.elements.map(p);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=e(e=>{switch(e.$type){case`EbnfTerminal`:return{type:`terminal`,value:e.value};case`EbnfNonTerminal`:return{type:`nonterminal`,name:e.name};case`EbnfSpecial`:return{type:`special`,text:e.text};case`EbnfGroup`:return l(e.element);case`EbnfOptional`:return{type:`optional`,element:l(e.element)};case`EbnfRepetition`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported EBNF primary node: ${e.$type}`)}},`transformPrimary`),f=e((e,t)=>{switch(t.$type){case`EbnfOptionalPostfix`:return{type:`optional`,element:e};case`EbnfZeroOrMorePostfix`:return{type:`repetition`,element:e,min:0,max:1/0};case`EbnfOneOrMorePostfix`:return{type:`repetition`,element:e,min:1,max:1/0};case`EbnfExceptionPostfix`:return{type:`sequence`,elements:[e,{type:`terminal`,value:`-`},d(t.except)]};default:throw Error(`Unsupported EBNF postfix node: ${t.$type}`)}},`transformPostfix`),p=e(e=>e.postfixes.reduce((e,t)=>f(e,t),d(e.base)),`transformTerm`),m=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=e(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:e(e=>{a.clear(),t.debug(`[EBNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new s(n);let r=n.value;t.debug(`[EBNF Parser] Parsed rules:`,r.rules.length),h(r),t.debug(`[EBNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{g as diagram}; \ No newline at end of file diff --git a/web/dist/app-elk-276RUBZZ.js b/web/dist/app-elk-276RUBZZ.js index 82a908df1..bd575ad2e 100644 --- a/web/dist/app-elk-276RUBZZ.js +++ b/web/dist/app-elk-276RUBZZ.js @@ -1,4 +1,4 @@ -import{i as e,r as t,t as n}from"./app-rolldown-runtime.js";import{n as r}from"./app-chunk-Y2CYZVJY.js";import"./app-src.js";import{G as i}from"./app-chunk-O7XYJQB3.js";import{rt as a}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import{o,s}from"./app-chunk-Z7XXMR3K.js";import{n as c}from"./app-chunk-UA2S7LBM.js";import{a as l,r as u}from"./app-chunk-3FUC2YCW.js";import{t as d}from"./app-chunk-NETBCI7D.js";var f=e(n(((e,n)=>{(function(t){if(typeof e==`object`&&n!==void 0)n.exports=t();else if(typeof define==`function`&&define.amd)define([],t);else{var r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this;r.ELK=t()}})(function(){return(function(){function e(n,r,i){function a(s,c){if(!r[s]){if(!n[s]){var l=typeof t==`function`&&t;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=r[s]={exports:{}};n[s][0].call(d.exports,function(e){var t=n[s][1][e];return a(t||e)},d,d.exports,e,n,r,i)}return r[s].exports}for(var o=typeof t==`function`&&t,s=0;s0&&arguments[0]!==void 0?arguments[0]:{},r=n.defaultLayoutOptions,o=r===void 0?{}:r,s=n.algorithms,c=s===void 0?[`layered`,`stress`,`mrtree`,`radial`,`force`,`disco`,`sporeOverlap`,`sporeCompaction`,`rectpacking`]:s,l=n.workerFactory,u=n.workerUrl;if(i(this,e),this.defaultLayoutOptions=o,this.initialized=!1,u===void 0&&l===void 0)throw Error(`Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.`);var d=l;u!==void 0&&l===void 0&&(d=function(e){return new Worker(e)});var f=d(u);if(typeof f.postMessage!=`function`)throw TypeError(`Created worker does not provide the required 'postMessage' function.`);this.worker=new a(f),this.worker.postMessage({cmd:`register`,algorithms:c}).then(function(e){return t.initialized=!0}).catch(console.err)}return r(e,[{key:`layout`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.layoutOptions,r=n===void 0?this.defaultLayoutOptions:n,i=t.logging,a=i!==void 0&&i,o=t.measureExecutionTime,s=o!==void 0&&o;return e?this.worker.postMessage({cmd:`layout`,graph:e,layoutOptions:r,options:{logging:a,measureExecutionTime:s}}):Promise.reject(Error(`Missing mandatory parameter 'graph'.`))}},{key:`knownLayoutAlgorithms`,value:function(){return this.worker.postMessage({cmd:`algorithms`})}},{key:`knownLayoutOptions`,value:function(){return this.worker.postMessage({cmd:`options`})}},{key:`knownLayoutCategories`,value:function(){return this.worker.postMessage({cmd:`categories`})}},{key:`terminateWorker`,value:function(){this.worker&&this.worker.terminate()}}]),e}();var a=function(){function e(t){var n=this;if(i(this,e),t===void 0)throw Error(`Missing mandatory parameter 'worker'.`);this.resolvers={},this.worker=t,this.worker.onmessage=function(e){setTimeout(function(){n.receive(n,e)},0)}}return r(e,[{key:`postMessage`,value:function(e){var t=this.id||0;this.id=t+1,e.id=t;var n=this;return new Promise(function(r,i){n.resolvers[t]=function(e,t){e?(n.convertGwtStyleError(e),i(e)):r(t)},n.worker.postMessage(e)})}},{key:`receive`,value:function(e,t){var n=t.data,r=e.resolvers[n.id];r&&(delete e.resolvers[n.id],n.error?r(n.error):r(null,n.data))}},{key:`terminate`,value:function(){this.worker&&this.worker.terminate()}},{key:`convertGwtStyleError`,value:function(e){if(e){var t=e.__java$exception;t&&(t.cause&&t.cause.backingJsObject&&(e.cause=t.cause.backingJsObject,this.convertGwtStyleError(e.cause)),delete e.__java$exception)}}}]),e}()},{}],2:[function(e,t,n){(function(e){(function(){var r;typeof window<`u`?r=window:e===void 0?typeof self<`u`&&(r=self):r=e;var i;function a(){}function o(){}function s(){}function c(){}function l(){}function u(){}function d(){}function f(){}function p(){}function m(){}function h(){}function g(){}function _(){}function v(){}function y(){}function b(){}function x(){}function S(){}function ee(){}function te(){}function ne(){}function C(){}function re(){}function ie(){}function ae(){}function oe(){}function se(){}function ce(){}function le(){}function ue(){}function de(){}function fe(){}function pe(){}function me(){}function he(){}function ge(){}function _e(){}function ve(){}function ye(){}function be(){}function xe(){}function Se(){}function Ce(){}function we(){}function Te(){}function Ee(){}function De(){}function Oe(){}function ke(){}function Ae(){}function je(){}function Me(){}function Ne(){}function Pe(){}function Fe(){}function Ie(){}function Le(){}function Re(){}function ze(){}function Be(){}function Ve(){}function He(){}function Ue(){}function We(){}function Ge(){}function Ke(){}function qe(){}function Je(){}function Ye(){}function Xe(){}function Ze(){}function Qe(){}function $e(){}function et(){}function tt(){}function nt(){}function rt(){}function it(){}function at(){}function ot(){}function st(){}function ct(){}function lt(){}function ut(){}function dt(){}function ft(){}function pt(){}function mt(){}function ht(){}function gt(){}function _t(){}function vt(){}function yt(){}function bt(){}function xt(){}function St(){}function Ct(){}function wt(){}function Tt(){}function Et(){}function Dt(){}function Ot(){}function kt(){}function At(){}function jt(){}function Mt(){}function Nt(){}function Pt(){}function Ft(){}function It(){}function Lt(){}function Rt(){}function zt(){}function Bt(){}function eee(){}function Vt(){}function tee(){}function nee(){}function Ht(){}function ree(){}function iee(){}function aee(){}function oee(){}function see(){}function cee(){}function lee(){}function uee(){}function dee(){}function fee(){}function pee(){}function mee(){}function hee(){}function Ut(){}function gee(){}function _ee(){}function vee(){}function yee(){}function bee(){}function xee(){}function See(){}function Cee(){}function wee(){}function Wt(){}function Gt(){}function Tee(){}function Eee(){}function Dee(){}function Oee(){}function kee(){}function Aee(){}function jee(){}function Mee(){}function Nee(){}function Pee(){}function Fee(){}function Iee(){}function Lee(){}function Ree(){}function zee(){}function Bee(){}function Vee(){}function Hee(){}function Uee(){}function Wee(){}function Gee(){}function Kee(){}function qee(){}function Jee(){}function Yee(){}function Xee(){}function Zee(){}function Qee(){}function $ee(){}function ete(){}function tte(){}function nte(){}function rte(){}function ite(){}function ate(){}function ote(){}function ste(){}function cte(){}function lte(){}function ute(){}function dte(){}function fte(){}function pte(){}function mte(){}function hte(){}function gte(){}function _te(){}function vte(){}function yte(){}function bte(){}function xte(){}function Ste(){}function Cte(){}function wte(){}function Tte(){}function Ete(){}function Dte(){}function Ote(){}function kte(){}function Ate(){}function jte(){}function Mte(){}function Nte(){}function Pte(){}function Fte(){}function Ite(){}function Lte(){}function Rte(){}function zte(){}function Bte(){}function Vte(){}function Hte(){}function Ute(){}function Wte(){}function Gte(){}function Kte(){}function qte(){}function Jte(){}function Yte(){}function Xte(){}function Zte(){}function Qte(){}function $te(){}function ene(){}function tne(){}function nne(){}function rne(){}function ine(){}function ane(){}function one(){}function sne(){}function cne(){}function lne(){}function une(){}function dne(){}function fne(){}function pne(){}function mne(){}function hne(){}function gne(){}function Kt(){}function _ne(){}function vne(){}function yne(){}function bne(){}function xne(){}function Sne(){}function Cne(){}function wne(){}function Tne(){}function Ene(){}function Dne(){}function One(){}function kne(){}function Ane(){}function jne(){}function Mne(){}function Nne(){}function Pne(){}function Fne(){}function Ine(){}function Lne(){}function Rne(){}function zne(){}function Bne(){}function Vne(){}function Hne(){}function Une(){}function Wne(){}function Gne(){}function Kne(){}function qne(){}function Jne(){}function Yne(){}function Xne(){}function Zne(){}function Qne(){}function $ne(){}function ere(){}function tre(){}function nre(){}function rre(){}function ire(){}function are(){}function ore(){}function sre(){}function cre(){}function lre(){}function ure(){}function dre(){}function fre(){}function pre(){}function mre(){}function hre(){}function gre(){}function _re(){}function vre(){}function yre(){}function bre(){}function xre(){}function Sre(){}function Cre(){}function wre(){}function Tre(){}function Ere(){}function Dre(){}function Ore(){}function kre(){}function Are(){}function jre(){}function Mre(){}function Nre(){}function Pre(){}function Fre(){}function qt(){}function Ire(){}function Lre(){}function Rre(){}function zre(){}function Bre(){}function Vre(){}function Hre(){}function Ure(){}function Wre(){}function Gre(){}function Kre(){}function qre(){}function Jre(){}function Yre(){}function Xre(){}function Zre(){}function Qre(){}function $re(){}function eie(){}function tie(){}function nie(){}function rie(){}function iie(){}function aie(){}function oie(){}function sie(){}function cie(){}function lie(){}function uie(){}function die(){}function fie(){}function pie(){}function mie(){}function hie(){}function gie(){}function _ie(){}function vie(){}function yie(){}function bie(){}function xie(){}function Sie(){}function Cie(){}function wie(){}function Tie(){}function Eie(){}function Die(){}function Oie(){}function kie(){}function Aie(){}function jie(){}function Mie(){}function Nie(){}function Pie(){}function Fie(){}function Iie(){}function Lie(){}function Rie(){}function zie(){}function Bie(){}function Vie(){}function Hie(){}function Uie(){}function Wie(){}function Gie(){}function Kie(){}function qie(){}function Jie(){}function Yie(){}function Xie(){}function Zie(){}function Qie(){}function $ie(){}function eae(){}function tae(){}function nae(){}function rae(){}function iae(){}function aae(){}function oae(){}function sae(){}function cae(){}function lae(){}function uae(){}function dae(){}function fae(){}function pae(){}function mae(){}function hae(){}function gae(){}function _ae(){}function vae(){}function yae(){}function bae(){}function xae(){}function Sae(){}function Cae(){}function wae(){}function Tae(){}function Eae(){}function Dae(){}function Oae(){}function kae(){}function Aae(){}function jae(){}function Mae(){}function Nae(){}function Pae(){}function Fae(){}function Iae(){}function Lae(){}function Rae(){}function zae(){}function Bae(){}function Vae(){}function Hae(){}function Uae(){}function Wae(){}function Gae(){}function Kae(){}function qae(){}function Jae(){}function Yae(){}function Xae(){}function Zae(){}function Qae(){}function $ae(){}function eoe(){}function toe(){}function noe(){}function roe(){}function ioe(){}function aoe(){}function ooe(){}function soe(){}function coe(){}function loe(){}function uoe(){}function doe(){}function foe(){}function poe(){}function moe(){}function hoe(){}function goe(){}function _oe(){}function voe(){}function yoe(){}function boe(){}function xoe(){}function Jt(){}function Yt(){}function Soe(){}function Xt(){}function Coe(){}function woe(){}function Toe(){}function Eoe(){}function Doe(){}function Ooe(){}function koe(){}function Aoe(){}function joe(){}function Moe(){}function Noe(){}function Poe(){}function Foe(){}function Ioe(){}function Loe(){}function Roe(){}function zoe(){}function Boe(){}function Voe(){}function Hoe(){}function Uoe(){}function Woe(){}function Zt(){}function Goe(){}function Qt(){}function Koe(){}function qoe(){}function Joe(){}function Yoe(){}function Xoe(){}function Zoe(){}function Qoe(){}function $oe(){}function ese(){}function tse(){}function nse(){}function rse(){}function ise(){}function ase(){}function ose(){}function sse(){}function cse(){}function lse(){}function use(){}function dse(){}function $t(){}function fse(){}function pse(){}function mse(){}function hse(){}function gse(){}function _se(){}function vse(){}function yse(){}function bse(){}function xse(){}function Sse(){}function Cse(){}function wse(){}function en(){}function Tse(){}function Ese(){}function Dse(){}function tn(){}function Ose(){}function nn(){}function rn(){}function kse(){}function Ase(){}function jse(){}function Mse(){}function Nse(){}function Pse(){}function Fse(){}function Ise(){}function an(){}function Lse(){}function Rse(){}function on(){}function zse(){}function sn(){}function Bse(){}function Vse(){}function Hse(){}function cn(){}function Use(){}function Wse(){}function Gse(){}function Kse(){}function qse(){}function Jse(){}function Yse(){}function Xse(){}function Zse(){}function Qse(){}function $se(){}function ece(){}function tce(){}function nce(){}function rce(){}function ice(){}function ln(){}function un(){}function ace(){}function oce(){}function sce(){}function cce(){}function lce(){}function uce(){}function dce(){}function fce(){}function pce(){}function mce(){}function hce(){}function gce(){}function _ce(){}function vce(){}function yce(){}function bce(){}function xce(){}function Sce(){}function Cce(){}function wce(){}function Tce(){}function Ece(){}function Dce(){}function Oce(){}function kce(){}function Ace(){}function jce(){}function Mce(){}function Nce(){}function Pce(){}function Fce(){}function Ice(){}function Lce(){}function Rce(){}function zce(){}function Bce(){}function Vce(){}function Hce(){}function Uce(){}function Wce(){}function Gce(){}function Kce(){}function qce(){}function Jce(){}function Yce(){}function Xce(){}function Zce(){}function Qce(){}function $ce(){}function ele(){}function tle(){}function nle(){}function rle(){}function ile(){}function ale(){}function ole(){}function sle(){}function cle(){}function lle(){}function ule(){}function dle(){}function fle(){}function ple(){}function mle(){}function hle(){}function gle(){}function _le(){}function vle(){}function yle(){}function ble(){}function xle(){}function Sle(){}function Cle(){}function wle(){}function Tle(){}function Ele(){}function Dle(){}function Ole(){}function kle(){}function Ale(){}function jle(){}function Mle(){}function Nle(){}function Ple(){}function Fle(){}function Ile(){}function Lle(){}function Rle(){}function zle(){}function Ble(){}function Vle(){}function Hle(){}function Ule(){}function Wle(){}function Gle(){}function Kle(){}function qle(){}function Jle(){}function Yle(){}function Xle(){}function Zle(){}function Qle(){}function $le(){}function eue(){}function dn(){fi()}function tue(){Fo()}function nue(){Rk()}function rue(){qw()}function iue(){bO()}function aue(){I9e()}function oue(){XM()}function sue(){e6e()}function cue(){Nk()}function lue(){Io()}function uue(){Ff()}function due(){Ibe()}function fue(){cC()}function pue(){sWe()}function mue(){mJe()}function hue(){DRe()}function gue(){gJe()}function _ue(){eGe()}function vue(){TRe()}function yue(){Fw()}function bue(){vJe()}function xue(){_Je()}function Sue(){HBe()}function Cue(){yJe()}function wue(){wA()}function Tue(){Ro()}function Eue(){bP()}function Due(){mP()}function Oue(){bJe()}function kue(){kYe()}function Aue(){ORe()}function jue(){o6e()}function Mue(){kRe()}function Nue(){Aut()}function Pue(){Hrt()}function Fue(){zx()}function Iue(){Q$e()}function Lue(){rN()}function Rue(){fze()}function zue(){Rx()}function Bue(){Ylt()}function Vue(){PA()}function Hue(){Qlt()}function Uue(){gM()}function Wue(){yA()}function Gue(){bM()}function Kue(){ek()}function fn(){rke()}function que(){gb()}function Jue(){bA()}function Yue(){vP()}function Xue(){Iw()}function Zue(){wD()}function Que(){uC()}function $ue(){_N()}function ede(){Odt()}function tde(e){Gh(e)}function nde(e){this.a=e}function pn(e){this.a=e}function rde(e){this.a=e}function ide(e){this.a=e}function ade(e){this.a=e}function ode(e){this.a=e}function sde(e){this.a=e}function cde(e){this.a=e}function mn(e){this.a=e}function hn(e){this.a=e}function lde(e){this.a=e}function ude(e){this.a=e}function gn(e){this.a=e}function dde(e){this.a=e}function fde(e){this.a=e}function _n(e){this.a=e}function vn(e){this.a=e}function pde(e){this.a=e}function yn(e){this.a=e}function mde(e){this.a=e}function hde(e){this.a=e}function gde(e){this.a=e}function bn(e){this.b=e}function _de(e){this.c=e}function vde(e){this.a=e}function yde(e){this.a=e}function bde(e){this.a=e}function xde(e){this.a=e}function Sde(e){this.a=e}function Cde(e){this.a=e}function wde(e){this.a=e}function Tde(e){this.a=e}function Ede(e){this.a=e}function Dde(e){this.a=e}function Ode(e){this.a=e}function kde(e){this.a=e}function Ade(e){this.a=e}function xn(e){this.a=e}function Sn(e){this.a=e}function Cn(e){this.a=e}function wn(e){this.a=e}function Tn(){this.a=[]}function jde(e,t){e.a=t}function Mde(e,t){e.a=t}function Nde(e,t){e.b=t}function Pde(e,t){e.b=t}function Fde(e,t){e.b=t}function Ide(e,t){e.j=t}function Lde(e,t){e.g=t}function Rde(e,t){e.i=t}function zde(e,t){e.c=t}function Bde(e,t){e.c=t}function Vde(e,t){e.d=t}function Hde(e,t){e.d=t}function En(e,t){e.k=t}function Ude(e,t){e.c=t}function Wde(e,t){e.c=t}function Gde(e,t){e.a=t}function Kde(e,t){e.a=t}function qde(e,t){e.f=t}function Jde(e,t){e.a=t}function Yde(e,t){e.b=t}function Dn(e,t){e.d=t}function On(e,t){e.i=t}function Xde(e,t){e.o=t}function Zde(e,t){e.r=t}function Qde(e,t){e.a=t}function $de(e,t){e.b=t}function efe(e,t){e.e=t}function tfe(e,t){e.f=t}function nfe(e,t){e.g=t}function rfe(e,t){e.e=t}function ife(e,t){e.f=t}function afe(e,t){e.f=t}function kn(e,t){e.a=t}function An(e,t){e.b=t}function ofe(e,t){e.n=t}function sfe(e,t){e.a=t}function cfe(e,t){e.c=t}function lfe(e,t){e.c=t}function ufe(e,t){e.c=t}function dfe(e,t){e.a=t}function ffe(e,t){e.a=t}function pfe(e,t){e.d=t}function mfe(e,t){e.d=t}function hfe(e,t){e.e=t}function gfe(e,t){e.e=t}function _fe(e,t){e.g=t}function vfe(e,t){e.f=t}function yfe(e,t){e.j=t}function bfe(e,t){e.a=t}function xfe(e,t){e.a=t}function Sfe(e,t){e.b=t}function Cfe(e){e.b=e.a}function wfe(e){e.c=e.d.d}function jn(e){this.a=e}function Mn(e){this.a=e}function Nn(e){this.a=e}function Pn(e){this.a=e}function Fn(e){this.a=e}function In(e){this.a=e}function Tfe(e){this.a=e}function Ln(e){this.a=e}function Rn(e){this.a=e}function zn(e){this.a=e}function Bn(e){this.a=e}function Vn(e){this.a=e}function Efe(e){this.a=e}function Dfe(e){this.a=e}function Hn(e){this.b=e}function Un(e){this.b=e}function Wn(e){this.b=e}function Gn(e){this.a=e}function Ofe(e){this.a=e}function Kn(e){this.c=e}function w(e){this.c=e}function kfe(e){this.c=e}function qn(e){this.d=e}function Jn(e){this.a=e}function Yn(e){this.a=e}function Afe(e){this.a=e}function Xn(e){this.a=e}function Zn(e){this.a=e}function Qn(e){this.a=e}function $n(e){this.a=e}function er(e){this.a=e}function tr(e){this.a=e}function nr(e){this.a=e}function jfe(e){this.a=e}function Mfe(e){this.a=e}function rr(e){this.a=e}function Nfe(e){this.a=e}function Pfe(e){this.a=e}function Ffe(e){this.a=e}function Ife(e){this.a=e}function Lfe(e){this.a=e}function Rfe(e){this.a=e}function zfe(e){this.a=e}function Bfe(e){this.a=e}function Vfe(e){this.a=e}function Hfe(e){this.a=e}function Ufe(e){this.a=e}function Wfe(e){this.a=e}function Gfe(e){this.a=e}function Kfe(e){this.a=e}function qfe(e){this.a=e}function ir(e){this.a=e}function Jfe(e){this.a=e}function Yfe(e){this.a=e}function Xfe(e){this.a=e}function Zfe(e){this.a=e}function ar(e){this.a=e}function Qfe(e){this.a=e}function $fe(e){this.a=e}function or(e){this.a=e}function sr(e){this.a=e}function epe(e){this.a=e}function tpe(e){this.a=e}function npe(e){this.a=e}function rpe(e){this.a=e}function ipe(e){this.a=e}function ape(e){this.a=e}function cr(e){this.a=e}function lr(e){this.a=e}function ur(e){this.a=e}function dr(e){this.a=e}function fr(e){this.e=e}function pr(e){this.a=e}function ope(e){this.a=e}function mr(e){this.a=e}function spe(e){this.a=e}function cpe(e){this.a=e}function lpe(e){this.a=e}function upe(e){this.a=e}function dpe(e){this.a=e}function fpe(e){this.a=e}function ppe(e){this.a=e}function mpe(e){this.a=e}function hpe(e){this.a=e}function gpe(e){this.a=e}function _pe(e){this.a=e}function vpe(e){this.a=e}function ype(e){this.a=e}function bpe(e){this.a=e}function xpe(e){this.a=e}function Spe(e){this.a=e}function Cpe(e){this.a=e}function wpe(e){this.a=e}function Tpe(e){this.a=e}function Epe(e){this.a=e}function Dpe(e){this.a=e}function Ope(e){this.a=e}function kpe(e){this.a=e}function Ape(e){this.a=e}function jpe(e){this.a=e}function Mpe(e){this.a=e}function Npe(e){this.a=e}function Ppe(e){this.a=e}function Fpe(e){this.a=e}function Ipe(e){this.a=e}function Lpe(e){this.a=e}function Rpe(e){this.a=e}function zpe(e){this.a=e}function Bpe(e){this.a=e}function Vpe(e){this.a=e}function Hpe(e){this.a=e}function Upe(e){this.a=e}function Wpe(e){this.a=e}function Gpe(e){this.a=e}function Kpe(e){this.a=e}function qpe(e){this.a=e}function Jpe(e){this.a=e}function Ype(e){this.a=e}function Xpe(e){this.a=e}function Zpe(e){this.a=e}function Qpe(e){this.a=e}function $pe(e){this.a=e}function eme(e){this.a=e}function tme(e){this.a=e}function nme(e){this.a=e}function rme(e){this.a=e}function ime(e){this.c=e}function ame(e){this.b=e}function ome(e){this.a=e}function sme(e){this.a=e}function cme(e){this.a=e}function lme(e){this.a=e}function ume(e){this.a=e}function dme(e){this.a=e}function fme(e){this.a=e}function pme(e){this.a=e}function mme(e){this.a=e}function hme(e){this.a=e}function gme(e){this.a=e}function _me(e){this.a=e}function vme(e){this.a=e}function yme(e){this.a=e}function bme(e){this.a=e}function xme(e){this.a=e}function Sme(e){this.a=e}function Cme(e){this.a=e}function wme(e){this.a=e}function Tme(e){this.a=e}function Eme(e){this.a=e}function Dme(e){this.a=e}function Ome(e){this.a=e}function kme(e){this.a=e}function Ame(e){this.a=e}function jme(e){this.a=e}function Mme(e){this.a=e}function hr(e){this.a=e}function gr(e){this.a=e}function Nme(e){this.a=e}function Pme(e){this.a=e}function Fme(e){this.a=e}function Ime(e){this.a=e}function Lme(e){this.a=e}function Rme(e){this.a=e}function zme(e){this.a=e}function Bme(e){this.a=e}function Vme(e){this.a=e}function Hme(e){this.a=e}function Ume(e){this.a=e}function Wme(e){this.a=e}function Gme(e){this.a=e}function Kme(e){this.a=e}function qme(e){this.a=e}function Jme(e){this.a=e}function Yme(e){this.a=e}function Xme(e){this.a=e}function Zme(e){this.a=e}function Qme(e){this.a=e}function $me(e){this.a=e}function ehe(e){this.a=e}function the(e){this.a=e}function nhe(e){this.a=e}function rhe(e){this.a=e}function ihe(e){this.a=e}function _r(e){this.a=e}function ahe(e){this.f=e}function ohe(e){this.a=e}function she(e){this.a=e}function che(e){this.a=e}function lhe(e){this.a=e}function uhe(e){this.a=e}function dhe(e){this.a=e}function fhe(e){this.a=e}function phe(e){this.a=e}function mhe(e){this.a=e}function hhe(e){this.a=e}function ghe(e){this.a=e}function _he(e){this.a=e}function vhe(e){this.a=e}function yhe(e){this.a=e}function bhe(e){this.a=e}function xhe(e){this.a=e}function She(e){this.a=e}function Che(e){this.a=e}function whe(e){this.a=e}function The(e){this.a=e}function Ehe(e){this.a=e}function Dhe(e){this.a=e}function Ohe(e){this.a=e}function khe(e){this.a=e}function Ahe(e){this.a=e}function jhe(e){this.a=e}function Mhe(e){this.a=e}function Nhe(e){this.a=e}function vr(e){this.a=e}function Phe(e){this.a=e}function yr(e){this.b=e}function Fhe(e){this.a=e}function Ihe(e){this.a=e}function Lhe(e){this.a=e}function Rhe(e){this.a=e}function zhe(e){this.a=e}function Bhe(e){this.a=e}function Vhe(e){this.a=e}function Hhe(e){this.b=e}function Uhe(e){this.a=e}function br(e){this.a=e}function Whe(e){this.a=e}function Ghe(e){this.a=e}function Khe(e){this.c=e}function xr(e){this.e=e}function Sr(e){this.a=e}function Cr(e){this.a=e}function wr(e){this.a=e}function qhe(e){this.d=e}function Jhe(e){this.a=e}function Yhe(e){this.a=e}function Xhe(e){this.a=e}function Tr(e){this.e=e}function Er(){this.a=0}function Dr(){Pm(this)}function T(){au(this)}function Or(){_Fe(this)}function Zhe(){}function kr(){this.c=nHt}function Qhe(e,t){e.b+=t}function $he(e,t){t.Wb(e)}function ege(e){return e.a}function tge(e){return e.a}function nge(e){return e.a}function rge(e){return e.a}function ige(e){return e.a}function E(e){return e.e}function age(){return null}function oge(){return null}function sge(){La(),P_t()}function cge(e){e.b.Of(e.e)}function lge(e){e.b=new la}function Ar(e,t){e.b=t-e.b}function jr(e,t){e.a=t-e.a}function Mr(e,t){e.push(t)}function uge(e,t){e.sort(t)}function dge(e,t){t.jd(e.a)}function fge(e,t){tj(t,e)}function pge(e,t,n){e.Yd(n,t)}function Nr(e,t){e.e=t,t.b=e}function mge(e){wf(),this.a=e}function hge(e){wf(),this.a=e}function gge(e){wf(),this.a=e}function Pr(e){gh(),this.a=e}function _ge(e){Xg(),lG.le(e)}function vge(){vge=C,new Dr}function Fr(){WTe.call(this)}function yge(){WTe.call(this)}function bge(){Fr.call(this)}function Ir(){Fr.call(this)}function xge(){Fr.call(this)}function Lr(){Fr.call(this)}function Rr(){Fr.call(this)}function zr(){Fr.call(this)}function Br(){Fr.call(this)}function Vr(){Fr.call(this)}function Sge(){Fr.call(this)}function Hr(){Fr.call(this)}function Cge(){Fr.call(this)}function wge(){this.a=this}function Ur(){this.Bb|=256}function Tge(){this.b=new lCe}function Wr(e,t){e.length=t}function Gr(e,t){M(e.a,t)}function Ege(e,t){tet(e.c,t)}function Dge(e,t){Lm(e.b,t)}function Oge(e,t){JO(e.a,t)}function kge(e,t){$T(e.a,t)}function Kr(e,t){AC(e.e,t)}function qr(e){_j(e.c,e.b)}function Age(e,t){e.kc().Nb(t)}function jge(e){this.a=y1e(e)}function Jr(){this.a=new Dr}function Mge(){this.a=new Dr}function Nge(){this.a=new gbe}function Yr(){this.a=new T}function Xr(){this.a=new T}function Pge(){this.a=new T}function Zr(){this.a=new Xe}function Qr(){this.a=new qUe}function Fge(){this.a=new Vt}function Ige(){this.a=new wRe}function Lge(){this.a=new eOe}function Rge(){this.a=new T}function zge(){this.a=new T}function Bge(){this.a=new T}function Vge(){this.a=new T}function Hge(){this.d=new T}function Uge(){this.a=new Qze}function Wge(){this.a=new Jr}function Gge(){this.a=new Dr}function Kge(){this.b=new Dr}function qge(){this.b=new T}function Jge(){this.e=new T}function Yge(){this.a=new wue}function Xge(){this.d=new T}function Zge(){QIe.call(this)}function Qge(){QIe.call(this)}function $ge(){T.call(this)}function e_e(){bge.call(this)}function $r(){Yr.call(this)}function t_e(){Qd.call(this)}function n_e(){Vge.call(this)}function ei(){Zhe.call(this)}function ti(){ei.call(this)}function ni(){Zhe.call(this)}function ri(){ni.call(this)}function r_e(){b_e.call(this)}function i_e(){b_e.call(this)}function a_e(){b_e.call(this)}function o_e(){C_e.call(this)}function ii(){Ose.call(this)}function s_e(){Ose.call(this)}function ai(){vo.call(this)}function c_e(){E_e.call(this)}function l_e(){E_e.call(this)}function u_e(){Dr.call(this)}function d_e(){Dr.call(this)}function f_e(){Dr.call(this)}function oi(){EJe.call(this)}function p_e(){Jr.call(this)}function m_e(){Ur.call(this)}function si(){gTe.call(this)}function ci(){Dr.call(this)}function li(){gTe.call(this)}function ui(){Dr.call(this)}function h_e(){Dr.call(this)}function g_e(){sn.call(this)}function __e(){g_e.call(this)}function v_e(){sn.call(this)}function y_e(){Qle.call(this)}function b_e(){this.a=new Jr}function x_e(){this.a=new Dr}function S_e(){this.a=new T}function C_e(){this.a=new Dr}function di(){this.a=new vo}function w_e(){this.j=new T}function T_e(){this.a=new bye}function E_e(){this.a=new zse}function D_e(){this.a=new goe}function fi(){fi=C,GW=new o}function pi(){pi=C,XW=new k_e}function mi(){mi=C,ZW=new O_e}function O_e(){_n.call(this,``)}function k_e(){_n.call(this,``)}function A_e(e){mqe.call(this,e)}function j_e(e){mqe.call(this,e)}function M_e(e){mn.call(this,e)}function N_e(e){nbe.call(this,e)}function P_e(e){nbe.call(this,e)}function F_e(e){N_e.call(this,e)}function I_e(e){N_e.call(this,e)}function L_e(e){N_e.call(this,e)}function R_e(e){ny.call(this,e)}function z_e(e){ny.call(this,e)}function B_e(e){VOe.call(this,e)}function V_e(e){obe.call(this,e)}function hi(e){lo.call(this,e)}function gi(e){lo.call(this,e)}function H_e(e){lo.call(this,e)}function _i(e){P9e.call(this,e)}function vi(e){_i.call(this,e)}function yi(e){KNe.call(this,e)}function U_e(e){yi.call(this,e)}function bi(){wn.call(this,{})}function W_e(){W_e=C,zTt=new te}function xi(){xi=C,tG=new Vwe}function G_e(){G_e=C,iG=new a}function Si(){Si=C,cG=new v}function Ci(){Ci=C,dG=new x}function wi(e){Bu(),this.a=e}function Ti(e){lC(),this.a=e}function Ei(e){em(),this.f=e}function Di(e){em(),this.f=e}function K_e(e){nke(),this.a=e}function q_e(e){e.b=null,e.c=0}function J_e(e,t){e.e=t,Sst(e,t)}function Y_e(e,t){e.a=t,ott(e)}function Oi(e,t,n){e.a[t.g]=n}function X_e(e,t,n){y8e(n,e,t)}function Z_e(e,t){HOe(t.i,e.n)}function Q_e(e,t){ZZe(e).Cd(t)}function $_e(e,t){e.a.ec().Mc(t)}function eve(e,t){return e.g-t.g}function tve(e,t){return e*e/t}function ki(e){return Gh(e),e}function D(e){return Gh(e),e}function Ai(e){return Gh(e),e}function nve(e){return new Cn(e)}function rve(e){return new mh(e)}function ive(e){return Gh(e),e}function ave(e){return Gh(e),e}function ji(e){yi.call(this,e)}function Mi(e){yi.call(this,e)}function ove(e){yi.call(this,e)}function Ni(e){KNe.call(this,e)}function Pi(e){yi.call(this,e)}function Fi(e){yi.call(this,e)}function Ii(e){yi.call(this,e)}function sve(e){yi.call(this,e)}function Li(e){yi.call(this,e)}function Ri(e){yi.call(this,e)}function zi(e){yi.call(this,e)}function Bi(e){yi.call(this,e)}function Vi(e){yi.call(this,e)}function Hi(e){yi.call(this,e)}function Ui(e){yi.call(this,e)}function Wi(e){Gh(e),this.a=e}function Gi(e){return Tw(e),e}function Ki(e){CPe(e,e.length)}function qi(e){return e.b==e.c}function Ji(e){return!!e&&e.b}function cve(e){return!!e&&e.k}function lve(e){return!!e&&e.j}function uve(e,t,n){e.c.Ef(t,n)}function dve(e,t){e.be(t),t.ae(e)}function Yi(e){wf(),this.a=ph(e)}function Xi(){this.a=kd(ph(PP))}function fve(){throw E(new Br)}function pve(){throw E(new Br)}function Zi(){throw E(new Br)}function mve(){throw E(new Br)}function hve(){throw E(new Br)}function gve(){throw E(new Br)}function Qi(){Qi=C,Xg()}function $i(){In.call(this,``)}function ea(){In.call(this,``)}function ta(){In.call(this,``)}function na(){In.call(this,``)}function ra(e){Mi.call(this,e)}function ia(e){Mi.call(this,e)}function aa(e){Fi.call(this,e)}function oa(e){Wn.call(this,e)}function _ve(e){oa.call(this,e)}function sa(e){qu.call(this,e)}function ca(e){sEe.call(this,e,0)}function la(){URe.call(this,12,3)}function O(e,t){return _Re(e,t)}function ua(e,t){return yb(e,t)}function vve(e,t){return e.a-t.a}function yve(e,t){return e.a-t.a}function bve(e,t){return e.a-t.a}function xve(e,t){return t in e.a}function Sve(e){return e.a?e.b:0}function Cve(e){return e.a?e.b:0}function wve(e,t,n){t.Cd(e.a[n])}function Tve(e,t,n){t.Pe(e.a[n])}function Eve(e,t){e.b=new Vl(t)}function Dve(e,t){return e.b=t,e}function Ove(e,t){return e.c=t,e}function kve(e,t){return e.f=t,e}function Ave(e,t){return e.g=t,e}function da(e,t){return e.a=t,e}function fa(e,t){return e.f=t,e}function jve(e,t){return e.k=t,e}function pa(e,t){return e.a=t,e}function Mve(e,t){return e.e=t,e}function ma(e,t){return e.e=t,e}function Nve(e,t){return e.f=t,e}function Pve(e,t){e.b=!0,e.d=t}function Fve(e,t){return e.b-t.b}function Ive(e,t){return e.g-t.g}function Lve(e,t){return e?0:t-1}function Rve(e,t){return e?0:t-1}function zve(e,t){return e?t-1:0}function Bve(e,t){return e.s-t.s}function Vve(e,t){return t.rg(e)}function ha(e,t){return e.b=t,e}function ga(e,t){return e.a=t,e}function _a(e,t){return e.c=t,e}function va(e,t){return e.d=t,e}function ya(e,t){return e.e=t,e}function ba(e,t){return e.f=t,e}function xa(e,t){return e.a=t,e}function Sa(e,t){return e.b=t,e}function Ca(e,t){return e.c=t,e}function wa(e,t){return e.c=t,e}function Ta(e,t){return e.b=t,e}function Ea(e,t){return e.d=t,e}function Da(e,t){return e.e=t,e}function Hve(e,t){return e.f=t,e}function Oa(e,t){return e.g=t,e}function ka(e,t){return e.a=t,e}function Aa(e,t){return e.i=t,e}function ja(e,t){return e.j=t,e}function Uve(e,t){wA(),G_(t,e)}function Wve(e,t,n){CNe(e.a,t,n)}function Ma(e){yf.call(this,e)}function Gve(e){L1e.call(this,e)}function Kve(e){uIe.call(this,e)}function Na(e){uIe.call(this,e)}function Pa(e){kx.call(this,e)}function qve(e){Ig.call(this,e)}function Jve(e){Ig.call(this,e)}function Yve(){Dwe.call(this,``)}function Fa(){this.a=0,this.b=0}function Xve(){this.b=0,this.a=0}function Zve(e,t){e.b=0,Qx(e,t)}function Qve(e,t){return e.k=t,e}function $ve(e,t){return e.j=t,e}function eye(e,t){e.c=t,e.b=!0}function tye(){tye=C,rEt=c5e()}function Ia(){Ia=C,iVt=X6e()}function nye(){nye=C,Y5=X5e()}function La(){La=C,h7=dS()}function Ra(){Ra=C,R7=Z6e()}function rye(){rye=C,wHt=Q6e()}function za(){za=C,b9=rtt()}function Ba(e){return e.e&&e.e()}function iye(e){return e.l|e.m<<22}function aye(e,t){return e.c._b(t)}function oye(e,t){return E$e(e.b,t)}function Va(e){return e?e.d:null}function sye(e){return e?e.g:null}function cye(e){return e?e.i:null}function Ha(e){return Ad(e),e.o}function Ua(e,t){return e.a+=t,e}function Wa(e,t){return e.a+=t,e}function Ga(e,t){return e.a+=t,e}function Ka(e,t){return e.a+=t,e}function lye(e,t){for(;e.Bd(t););}function qa(e){this.a=new go(e)}function uye(){throw E(new Br)}function dye(){throw E(new Br)}function fye(){throw E(new Br)}function pye(){throw E(new Br)}function mye(){throw E(new Br)}function hye(){throw E(new Br)}function Ja(e){this.a=new mm(e)}function gye(){this.a=new Yj(NFt)}function _ye(){this.b=new Yj(yPt)}function vye(){this.a=new Yj(kIt)}function yye(){this.b=new Yj(_3)}function bye(){this.b=new Yj(_3)}function Ya(e){this.a=0,this.b=e}function xye(e){Ngt(),tvt(this,e)}function Xa(e){return Hh(e),e.a}function Za(e){return e.b!=e.d.c}function Sye(e,t){return e.d[t.p]}function Cye(e,t){return bst(e,t)}function wye(e,t,n){e.splice(t,n)}function Qa(e,t){for(;e.Re(t););}function Tye(e){e.c?gct(e):_ct(e)}function Eye(){throw E(new Br)}function Dye(){throw E(new Br)}function Oye(){throw E(new Br)}function kye(){throw E(new Br)}function Aye(){throw E(new Br)}function jye(){throw E(new Br)}function Mye(){throw E(new Br)}function Nye(){throw E(new Br)}function Pye(){throw E(new Br)}function Fye(){throw E(new Br)}function Iye(){throw E(new Hr)}function Lye(){throw E(new Hr)}function $a(e){this.a=new Rye(e)}function Rye(e){IJe(this,e,B9e())}function eo(e){return!e||mFe(e)}function to(e){return A9[e]!=-1}function zye(){oG!=0&&(oG=0),sG=-1}function Bye(){xTt??=[]}function no(e,t){zu.call(this,e,t)}function ro(e,t){no.call(this,e,t)}function Vye(e,t){this.a=e,this.b=t}function Hye(e,t){this.a=e,this.b=t}function Uye(e,t){this.a=e,this.b=t}function Wye(e,t){this.a=e,this.b=t}function Gye(e,t){this.a=e,this.b=t}function Kye(e,t){this.a=e,this.b=t}function qye(e,t){this.a=e,this.b=t}function io(e,t){this.e=e,this.d=t}function Jye(e,t){this.b=e,this.c=t}function Yye(e,t){this.b=e,this.a=t}function Xye(e,t){this.b=e,this.a=t}function Zye(e,t){this.b=e,this.a=t}function Qye(e,t){this.b=e,this.a=t}function $ye(e,t){this.a=e,this.b=t}function ao(e,t){this.a=e,this.b=t}function ebe(e,t){this.a=e,this.f=t}function oo(e,t){this.g=e,this.i=t}function so(e,t){this.f=e,this.g=t}function tbe(e,t){this.b=e,this.c=t}function nbe(e){vTe(e.dc()),this.c=e}function rbe(e,t){this.a=e,this.b=t}function ibe(e,t){this.a=e,this.b=t}function abe(e){this.a=P(ph(e),15)}function obe(e){this.a=P(ph(e),15)}function sbe(e){this.a=P(ph(e),85)}function co(e){this.b=P(ph(e),85)}function lo(e){this.b=P(ph(e),51)}function uo(){this.q=new r.Date}function fo(e,t){this.a=e,this.b=t}function cbe(e,t){return km(e.b,t)}function po(e,t){return e.b.Hc(t)}function lbe(e,t){return e.b.Ic(t)}function ube(e,t){return e.b.Qc(t)}function dbe(e,t){return e.b.Hc(t)}function fbe(e,t){return e.c.uc(t)}function pbe(e,t){return NT(e.c,t)}function mo(e,t){return e.a._b(t)}function mbe(e,t){return e>t&&t0}function rs(e,t){return dT(e,t)<0}function exe(e,t){return Gp(e.a,t)}function txe(e,t){yRe.call(this,e,t)}function nxe(e){_h(),VOe.call(this,e)}function rxe(e,t){mNe(e,e.length,t)}function is(e,t){NPe(e,e.length,t)}function as(e,t){return e.a.get(t)}function ixe(e,t){return km(e.e,t)}function os(e){return Gh(e),!1}function ss(e){this.a=P(ph(e),229)}function cs(e){cv.call(this,e,21)}function ls(e,t){so.call(this,e,t)}function us(e,t){so.call(this,e,t)}function axe(e,t){this.b=e,this.a=t}function ds(e,t){this.d=e,this.e=t}function oxe(e,t){this.a=e,this.b=t}function sxe(e,t){this.a=e,this.b=t}function cxe(e,t){this.a=e,this.b=t}function lxe(e,t){this.a=e,this.b=t}function fs(e,t){this.a=e,this.b=t}function uxe(e,t){this.b=e,this.a=t}function dxe(e,t){this.b=e,this.a=t}function fxe(e,t){so.call(this,e,t)}function pxe(e,t){so.call(this,e,t)}function ps(e,t){so.call(this,e,t)}function ms(e,t){so.call(this,e,t)}function hs(e,t){so.call(this,e,t)}function gs(e,t){so.call(this,e,t)}function _s(e,t){so.call(this,e,t)}function vs(e,t){this.b=e,this.a=t}function ys(e,t){so.call(this,e,t)}function bs(e,t){this.b=e,this.a=t}function xs(e,t){so.call(this,e,t)}function mxe(e,t){this.b=e,this.a=t}function Ss(e,t){so.call(this,e,t)}function Cs(e,t){so.call(this,e,t)}function ws(e,t){so.call(this,e,t)}function Ts(e,t,n){e.splice(t,0,n)}function hxe(e,t,n){e.Mb(n)&&t.Cd(n)}function gxe(e,t,n){t.Pe(e.a.Ye(n))}function _xe(e,t,n){t.Dd(e.a.Ze(n))}function vxe(e,t,n){t.Cd(e.a.Kb(n))}function yxe(e,t){return $u(e.c,t)}function bxe(e,t){return $u(e.e,t)}function Es(e,t){so.call(this,e,t)}function Ds(e,t){so.call(this,e,t)}function Os(e,t){so.call(this,e,t)}function xxe(e,t){so.call(this,e,t)}function ks(e,t){so.call(this,e,t)}function As(e,t){so.call(this,e,t)}function Sxe(e,t){this.a=e,this.b=t}function Cxe(e,t){this.a=e,this.b=t}function wxe(e,t){this.a=e,this.b=t}function Txe(e,t){this.a=e,this.b=t}function Exe(e,t){this.a=e,this.b=t}function Dxe(e,t){this.a=e,this.b=t}function Oxe(e,t){this.b=e,this.a=t}function kxe(e,t){this.b=e,this.a=t}function Axe(e,t){this.b=e,this.a=t}function js(e,t){this.c=e,this.d=t}function jxe(e,t){this.e=e,this.d=t}function Mxe(e,t){this.a=e,this.b=t}function Nxe(e,t){this.a=e,this.b=t}function Pxe(e,t){this.a=e,this.b=t}function Fxe(e,t){this.b=e,this.a=t}function Ixe(e,t){this.b=t,this.c=e}function Ms(e,t){so.call(this,e,t)}function Ns(e,t){so.call(this,e,t)}function Ps(e,t){so.call(this,e,t)}function Lxe(e,t){so.call(this,e,t)}function Fs(e,t){so.call(this,e,t)}function Is(e,t){so.call(this,e,t)}function Ls(e,t){so.call(this,e,t)}function Rs(e,t){so.call(this,e,t)}function zs(e,t){so.call(this,e,t)}function Bs(e,t){so.call(this,e,t)}function Vs(e,t){so.call(this,e,t)}function Hs(e,t){so.call(this,e,t)}function Us(e,t){so.call(this,e,t)}function Ws(e,t){so.call(this,e,t)}function Gs(e,t){so.call(this,e,t)}function Ks(e,t){so.call(this,e,t)}function qs(e,t){so.call(this,e,t)}function Js(e,t){so.call(this,e,t)}function Ys(e,t){so.call(this,e,t)}function Xs(e,t){so.call(this,e,t)}function Zs(e,t){so.call(this,e,t)}function Qs(e,t){so.call(this,e,t)}function $s(e,t){so.call(this,e,t)}function ec(e,t){so.call(this,e,t)}function tc(e,t){so.call(this,e,t)}function nc(e,t){so.call(this,e,t)}function rc(e,t){so.call(this,e,t)}function ic(e,t){so.call(this,e,t)}function ac(e,t){so.call(this,e,t)}function oc(e,t){so.call(this,e,t)}function sc(e,t){so.call(this,e,t)}function cc(e,t){so.call(this,e,t)}function lc(e,t){so.call(this,e,t)}function Rxe(e,t){this.b=e,this.a=t}function zxe(e,t){so.call(this,e,t)}function Bxe(e,t){this.a=e,this.b=t}function Vxe(e,t){this.a=e,this.b=t}function Hxe(e,t){this.a=e,this.b=t}function Uxe(e,t){so.call(this,e,t)}function Wxe(e,t){so.call(this,e,t)}function Gxe(e,t){this.a=e,this.b=t}function Kxe(e,t){return Rf(),t!=e}function uc(e){return jd(e.a),e.b}function dc(e){return Drt(e,e.c),e}function qxe(){return tye(),new rEt}function Jxe(){If(),this.a=new Zd}function Yxe(){rM(),this.a=new Jr}function Xxe(){B_(),this.b=new Jr}function Zxe(e,t){this.b=e,this.d=t}function Qxe(e,t){this.a=e,this.b=t}function $xe(e,t){this.a=e,this.b=t}function eSe(e,t){this.a=e,this.b=t}function tSe(e,t){this.b=e,this.a=t}function nSe(e,t){so.call(this,e,t)}function rSe(e,t){so.call(this,e,t)}function fc(e,t){so.call(this,e,t)}function pc(e,t){so.call(this,e,t)}function mc(e,t){so.call(this,e,t)}function hc(e,t){so.call(this,e,t)}function iSe(e,t){so.call(this,e,t)}function aSe(e,t){so.call(this,e,t)}function gc(e,t){so.call(this,e,t)}function oSe(e,t){so.call(this,e,t)}function _c(e,t){so.call(this,e,t)}function vc(e,t){so.call(this,e,t)}function yc(e,t){so.call(this,e,t)}function bc(e,t){so.call(this,e,t)}function xc(e,t){so.call(this,e,t)}function Sc(e,t){so.call(this,e,t)}function sSe(e,t){so.call(this,e,t)}function Cc(e,t){so.call(this,e,t)}function cSe(e,t){so.call(this,e,t)}function wc(e,t){so.call(this,e,t)}function Tc(e,t){so.call(this,e,t)}function lSe(e,t){so.call(this,e,t)}function Ec(e,t){so.call(this,e,t)}function uSe(e,t){so.call(this,e,t)}function dSe(e,t){this.b=e,this.a=t}function fSe(e,t){this.b=e,this.a=t}function pSe(e,t){this.b=e,this.a=t}function mSe(e,t){this.b=e,this.a=t}function hSe(e,t){this.a=e,this.b=t}function gSe(e,t){this.a=e,this.b=t}function _Se(e,t){this.a=e,this.b=t}function k(e,t){this.a=e,this.b=t}function Dc(e,t){so.call(this,e,t)}function Oc(e,t){so.call(this,e,t)}function kc(e,t){so.call(this,e,t)}function Ac(e,t){so.call(this,e,t)}function jc(e,t){so.call(this,e,t)}function Mc(e,t){so.call(this,e,t)}function Nc(e,t){so.call(this,e,t)}function Pc(e,t){so.call(this,e,t)}function Fc(e,t){so.call(this,e,t)}function Ic(e,t){so.call(this,e,t)}function Lc(e,t){so.call(this,e,t)}function Rc(e,t){so.call(this,e,t)}function zc(e,t){so.call(this,e,t)}function Bc(e,t){so.call(this,e,t)}function Vc(e,t){so.call(this,e,t)}function Hc(e,t){so.call(this,e,t)}function Uc(e,t){so.call(this,e,t)}function Wc(e,t){so.call(this,e,t)}function vSe(e,t){so.call(this,e,t)}function Gc(e,t){so.call(this,e,t)}function ySe(e,t){this.a=e,this.b=t}function bSe(e,t){this.a=e,this.b=t}function xSe(e,t){this.a=e,this.b=t}function SSe(e,t){this.a=e,this.b=t}function CSe(e,t){this.a=e,this.b=t}function wSe(e,t){this.a=e,this.b=t}function Kc(e,t){this.a=e,this.b=t}function TSe(e,t){this.a=e,this.b=t}function ESe(e,t){this.a=e,this.b=t}function DSe(e,t){this.a=e,this.b=t}function OSe(e,t){this.a=e,this.b=t}function kSe(e,t){this.a=e,this.b=t}function ASe(e,t){this.a=e,this.b=t}function jSe(e,t){this.b=e,this.a=t}function MSe(e,t){this.b=e,this.a=t}function NSe(e,t){this.b=e,this.a=t}function PSe(e,t){this.b=e,this.a=t}function FSe(e,t){this.a=e,this.b=t}function ISe(e,t){this.a=e,this.b=t}function qc(e,t){so.call(this,e,t)}function LSe(e,t){this.a=e,this.b=t}function RSe(e,t){this.a=e,this.b=t}function Jc(e,t){so.call(this,e,t)}function zSe(e,t){this.f=e,this.c=t}function Yc(e,t){return $u(e.g,t)}function BSe(e,t){return $u(t.b,e)}function VSe(e,t){return uD(e.a,t)}function HSe(e,t){return-e.b.af(t)}function USe(e,t){e&&Qh(f7,e,t)}function Xc(e,t){e.i=null,OS(e,t)}function WSe(e,t,n){I8e(t,KA(e,n))}function GSe(e,t,n){I8e(t,KA(e,n))}function KSe(e,t){not(e.a,P(t,58))}function qSe(e,t){KGe(e.a,P(t,12))}function Zc(e,t){this.a=e,this.b=t}function JSe(e,t){this.a=e,this.b=t}function YSe(e,t){this.a=e,this.b=t}function XSe(e,t){this.a=e,this.b=t}function ZSe(e,t){this.a=e,this.b=t}function QSe(e,t){this.d=e,this.b=t}function $Se(e,t){this.e=e,this.a=t}function Qc(e,t){this.b=e,this.c=t}function $c(e,t){this.i=e,this.g=t}function el(e,t){this.d=e,this.e=t}function eCe(e,t){kKe(new Lu(e),t)}function tl(e){return lD(e.c,e.b)}function nl(e){return e?e.md():null}function A(e){return e??null}function rl(e){return typeof e===OP}function il(e){return typeof e===DP}function al(e){return typeof e===Vvt}function ol(e,t){return dT(e,t)==0}function sl(e,t){return dT(e,t)>=0}function cl(e,t){return dT(e,t)!=0}function ll(e,t){return VYe(e.Kc(),t)}function ul(e,t){return e.Rd().Xb(t)}function tCe(e){return RE(e),e.d.gc()}function dl(e){return bp(e==null),e}function fl(e,t){return e.a+=``+t,e}function pl(e,t){return e.a+=``+t,e}function ml(e,t){return e.a+=``+t,e}function hl(e,t){return e.a+=``+t,e}function gl(e,t){return e.a+=``+t,e}function _l(e,t){return e.a+=``+t,e}function nCe(e){return``+(Gh(e),e)}function rCe(e){Pm(this),mC(this,e)}function iCe(){ERe(),bNe.call(this)}function aCe(e,t){GNe.call(this,e,t)}function oCe(e,t){GNe.call(this,e,t)}function vl(e,t){GNe.call(this,e,t)}function yl(e,t){iy(e,t,e.c.b,e.c)}function bl(e,t){iy(e,t,e.a,e.a.a)}function xl(e){return ov(e,0),null}function sCe(){this.b=0,this.a=!1}function cCe(){this.b=0,this.a=!1}function lCe(){this.b=new go(xx(12))}function uCe(){uCe=C,oDt=nT(sO())}function dCe(){dCe=C,NOt=nT(wot())}function fCe(){fCe=C,NPt=nT(qYe())}function Sl(){Sl=C,vge(),uG=new Dr}function Cl(e){return e.a=0,e.b=0,e}function pCe(e,t){return e.a=t.g+1,e}function wl(e,t){lf.call(this,e,t)}function Tl(e,t){Wd.call(this,e,t)}function El(e,t){$c.call(this,e,t)}function mCe(e,t){ad.call(this,e,t)}function Dl(e,t){WC.call(this,e,t)}function Ol(e,t){Jo(),Qh(v7,e,t)}function hCe(e,t){e.q.setTime(Dv(t))}function gCe(e){r.clearTimeout(e)}function _Ce(e){return ph(e),new Hl(e)}function vCe(e,t){return A(e)===A(t)}function yCe(e,t){return e.a.a.a.cc(t)}function kl(e,t){return p_(e.a,0,t)}function Al(e){return zPe(P(e,74))}function jl(e){return C_((Gh(e),e))}function bCe(e){return C_((Gh(e),e))}function xCe(e){return vu(e.l,e.m,e.h)}function Ml(e,t){return _u(e.a,t.a)}function SCe(e,t){return DPe(e.a,t.a)}function CCe(e,t){return aE(e.a,t.a)}function Nl(e,t){return e.indexOf(t)}function wCe(e,t){return e.j[t.p]==2}function Pl(e,t){return e==t?0:e?1:-1}function Fl(e){return e<10?`0`+e:``+e}function Il(e){return typeof e===Vvt}function TCe(e){return e==kJ||e==MJ}function ECe(e){return e==kJ||e==AJ}function DCe(e,t){return _u(e.g,t.g)}function Ll(e){return Ab(e.b.b,e,0)}function OCe(){Np.call(this,0,0,0,0)}function Rl(){Xn.call(this,new ry)}function zl(e,t){bb(e,0,e.length,t)}function kCe(e,t){return M(e.a,t),t}function ACe(e,t){return Lf(),t.a+=e}function jCe(e,t){return Lf(),t.a+=e}function MCe(e,t){return Lf(),t.c+=e}function NCe(e,t){return M(e.c,t),e}function Bl(e,t){return OC(e.a,t),e}function PCe(e){this.a=qxe(),this.b=e}function FCe(e){this.a=qxe(),this.b=e}function Vl(e){this.a=e.a,this.b=e.b}function Hl(e){this.a=e,dn.call(this)}function ICe(e){this.a=e,dn.call(this)}function Ul(){wg.call(this,0,0,0,0)}function Wl(e){return OC(new Zh,e)}function LCe(e){return ag(P(e,123))}function Gl(e){return e.vh()&&e.wh()}function Kl(e){return e!=V8&&e!=H8}function ql(e){return e==t8||e==n8}function Jl(e){return e==i8||e==e8}function RCe(e){return e==L0||e==I0}function zCe(e,t){return _u(e.g,t.g)}function BCe(e,t){return new WC(t,e)}function VCe(e,t){return new WC(t,e)}function Yl(e){return wje(e.b.Kc(),e.a)}function Xl(e,t){Gw(e,t),eS(e,e.D)}function Zl(e,t,n){Xx(e,t),Vx(e,n)}function Ql(e,t,n){Wx(e,t),Ux(e,n)}function $l(e,t,n){Gx(e,t),Kx(e,n)}function eu(e,t,n){Hx(e,t),Jx(e,n)}function tu(e,t,n){qx(e,t),Yx(e,n)}function HCe(e,t,n){mDe.call(this,e,t,n)}function nu(e){zSe.call(this,e,!0)}function UCe(){ls.call(this,`Tail`,3)}function WCe(){ls.call(this,`Head`,1)}function ru(e){AM(),IYe.call(this,e)}function iu(e){Np.call(this,e,e,e,e)}function au(e){e.c=V(WW,FP,1,0,5,1)}function GCe(e){return e.b&&yN(e),e.a}function KCe(e){return e.b&&yN(e),e.c}function qCe(e,t){_K||(e.b=t)}function JCe(e,t){return e[e.length]=t}function YCe(e,t){return e[e.length]=t}function XCe(e,t){return Ex(t,E_(e))}function ZCe(e,t){return Ex(t,E_(e))}function QCe(e,t){return yS(uh(e.d),t)}function $Ce(e,t){return yS(uh(e.g),t)}function ewe(e,t){return yS(uh(e.j),t)}function ou(e,t){Wd.call(this,e.b,t)}function twe(e,t){tb(Jv(e.a),IRe(t))}function nwe(e,t){tb(Ib(e.a),LRe(t))}function rwe(e,t,n){$l(n,n.i+e,n.j+t)}function iwe(e,t,n){Sh(e.c[t.g],t.g,n)}function awe(e,t,n){P(e.c,71).Gi(t,n)}function su(e,t,n){return Sh(e,t,n),n}function owe(e){Dx(e.Sf(),new Zfe(e))}function cu(e){return e==null?0:US(e)}function swe(e){return e==null?0:US(e)}function lu(e){xP(),Tr.call(this,e)}function cwe(e){this.a=e,xje.call(this,e)}function uu(){uu=C,r.Math.log(2)}function du(){du=C,s9=(Xbe(),mVt)}function lwe(){lwe=C,D2=new NE(p8)}function fu(){fu=C,new uwe,new T}function uwe(){new Dr,new Dr,new Dr}function dwe(){throw E(new Ri(_Tt))}function fwe(){throw E(new Ri(_Tt))}function pwe(){throw E(new Ri(vTt))}function mwe(){throw E(new Ri(vTt))}function pu(e){this.a=e,co.call(this,e)}function mu(e){this.a=e,co.call(this,e)}function hwe(e,t){gh(),this.a=e,this.b=t}function gwe(e,t){ph(t),bg(e).Jc(new m)}function hu(e,t){qp(e.c,e.c.length,t)}function gu(e){return e.at)}function ywe(e,t){return dT(e,t)>0?e:t}function vu(e,t,n){return{l:e,m:t,h:n}}function bwe(e,t){e.a!=null&&qSe(t,e.a)}function xwe(e){U_(e,null),K_(e,null)}function Swe(e,t,n){return Qh(e.g,n,t)}function yu(e,t,n){return AD(t,n,e.c)}function Cwe(e,t,n){return Qh(e.k,n,t)}function wwe(e,t,n){return kht(e,t,n),n}function Twe(e,t){return z_(),t.n.b+=e}function Ewe(e){r_.call(this),this.b=e}function Dwe(e){$De.call(this),this.a=e}function Owe(){ls.call(this,`Range`,2)}function bu(e){this.b=e,this.a=new T}function kwe(e){this.b=new jt,this.a=e}function Awe(e){e.a=new me,e.c=new me}function jwe(e){e.a=new Dr,e.d=new Dr}function Mwe(e){q_(e,null),J_(e,null)}function Nwe(e,t){return Nht(e.a,t,null)}function Pwe(e,t){return Qh(e.a,t.a,t)}function xu(e){return new k(e.a,e.b)}function Fwe(e){return new k(e.c,e.d)}function Iwe(e){return new k(e.c,e.d)}function Su(e,t){return xmt(e.c,e.b,t)}function j(e,t){return e!=null&&kO(e,t)}function Cu(e,t){return XXe(e.Kc(),t)!=-1}function wu(e){return e.Ob()?e.Pb():null}function Lwe(e){this.b=(Vg(),new Kn(e))}function Rwe(e){this.a=e,Dr.call(this)}function zwe(){ad.call(this,null,null)}function Bwe(){od.call(this,null,null)}function Vwe(){so.call(this,`INSTANCE`,0)}function Hwe(){i8e(),this.a=new Yj(CJ)}function Uwe(e){return ND(e,0,e.length)}function Wwe(e,t){return new PTe(e.Kc(),t)}function Gwe(e,t){return e.a.Bc(t)!=null}function Kwe(e,t){RN(e),e.Gc(P(t,15))}function qwe(e,t,n){e.c.bd(t,P(n,136))}function Jwe(e,t,n){e.c.Ui(t,P(n,136))}function Ywe(e,t){e.c&&(pMe(t),LLe(t))}function Xwe(e,t){e.q.setHours(t),dN(e,t)}function Zwe(e,t){Sd(t,e.a.a.a,e.a.a.b)}function Qwe(e,t,n,r){Sh(e.a[t.g],n.g,r)}function Tu(e,t,n){return e.a[t.g][n.g]}function $we(e,t){return e.e[t.c.p][t.p]}function eTe(e,t){return e.c[t.c.p][t.p]}function Eu(e,t){return e.a[t.c.p][t.p]}function tTe(e,t){return e.j[t.p]=Aat(t)}function Du(e,t){return e.a.Bc(t)!=null}function nTe(e,t){return D(N(t.a))<=e}function rTe(e,t){return D(N(t.a))>=e}function iTe(e,t){return zUe(e.f,t.Pg())}function Ou(e,t){return e.a*t.a+e.b*t.b}function aTe(e,t){return e.a0?t/(e*e):t*100}function SEe(e,t){return e>0?t*t/e:t*t*100}function xd(e,t){return P(ix(e.a,t),34)}function CEe(e,t){return wA(),fj(e,t.e,t)}function wEe(e,t,n){return zo(),n.Mg(e,t)}function TEe(e){return zx(),e.e.a+e.f.a/2}function EEe(e,t,n){return zx(),n.e.a-e*t}function DEe(e){return zx(),e.e.b+e.f.b/2}function OEe(e,t,n){return zx(),n.e.b-e*t}function kEe(e){e.d=new gEe(e),e.e=new Dr}function AEe(){this.a=new g_,this.b=new g_}function jEe(e){this.c=e,this.a=1,this.b=1}function MEe(e){dP(),lge(this),this.Ff(e)}function NEe(e,t,n){gb(),e.pf(t)&&n.Cd(e)}function PEe(e,t,n){return M(t,Y1e(e,n))}function Sd(e,t,n){return e.a+=t,e.b+=n,e}function FEe(e,t,n){return e.a*=t,e.b*=n,e}function IEe(e,t){return e.a=t.a,e.b=t.b,e}function Cd(e){return e.a=-e.a,e.b=-e.b,e}function wd(e,t,n){return e.a-=t,e.b-=n,e}function LEe(e){vo.call(this),_S(this,e)}function REe(){so.call(this,`GROW_TREE`,0)}function zEe(){so.call(this,`POLYOMINO`,0)}function Td(e,t,n){lb.call(this,e,t,n,2)}function BEe(e,t,n){WT(Jv(e.a),t,IRe(n))}function VEe(e,t){Yo(),ad.call(this,e,t)}function HEe(e,t){Xo(),od.call(this,e,t)}function UEe(e,t){Xo(),HEe.call(this,e,t)}function WEe(e,t){Xo(),od.call(this,e,t)}function GEe(e,t){return e.c.Fc(P(t,136))}function KEe(e,t,n){WT(Ib(e.a),t,LRe(n))}function qEe(e){this.c=e,Gx(e,0),Kx(e,0)}function Ed(e,t){du(),Bp.call(this,e,t)}function JEe(e,t){du(),Ed.call(this,e,t)}function YEe(e,t){du(),Ed.call(this,e,t)}function XEe(e,t){du(),Bp.call(this,e,t)}function ZEe(e,t){du(),YEe.call(this,e,t)}function QEe(e,t){du(),XEe.call(this,e,t)}function $Ee(e,t){du(),Bp.call(this,e,t)}function eDe(e,t,n){return t.zl(e.e,e.c,n)}function tDe(e,t,n){return t.Al(e.e,e.c,n)}function nDe(e,t,n){return jN(Lb(e,t),n)}function Dd(e,t){return pT(e.e,P(t,54))}function rDe(e){return e==null?null:Fgt(e)}function iDe(e){return e==null?null:G9e(e)}function aDe(e){return e==null?null:PE(e)}function oDe(e){return e==null?null:PE(e)}function Od(e){return bp(e==null||il(e)),e}function N(e){return bp(e==null||al(e)),e}function kd(e){return bp(e==null||rl(e)),e}function Ad(e){e.o??zit(e)}function sDe(e){if(!e)throw E(new Lr)}function cDe(e){if(!e)throw E(new Ir)}function jd(e){if(!e)throw E(new Hr)}function Md(e){if(!e)throw E(new Rr)}function lDe(e){if(!e)throw E(new Vr)}function Nd(){Nd=C,_7=new c_e,new l_e}function Pd(){Pd=C,y4=new yr(`root`)}function uDe(){EJe.call(this),this.Bb|=pI}function dDe(e,t){this.d=e,wfe(this),this.b=t}function fDe(e,t){Qy.call(this,e),this.a=t}function pDe(e,t){Qy.call(this,e),this.a=t}function mDe(e,t,n){Ry.call(this,e,t,n,null)}function hDe(e,t,n){Ry.call(this,e,t,n,null)}function Fd(e,t){this.c=e,io.call(this,e,t)}function Id(e,t){this.a=e,Fd.call(this,e,t)}function gDe(e){this.q=new r.Date(Dv(e))}function _De(e){return e>8?0:e+1}function vDe(e,t){_K||M(e.a,t)}function yDe(e,t){return Io(),jC(t.d.i,e)}function bDe(e,t){return cC(),new Ilt(t,e)}function xDe(e,t,n){return e.Ne(t,n)<=0?n:t}function SDe(e,t,n){return e.Ne(t,n)<=0?t:n}function CDe(e,t){return P(ix(e.b,t),143)}function wDe(e,t){return P(ix(e.c,t),233)}function Ld(e){return P(Ep(e.a,e.b),294)}function TDe(e){return new k(e.c,e.d+e.a)}function EDe(e){return Gh(e),e?1231:1237}function DDe(e){return z_(),RCe(P(e,203))}function Rd(){Rd=C,lq=sE((TD(),x5))}function ODe(e,t){t.a?Irt(e,t):Du(e.a,t.b)}function zd(e,t,n){++e.j,e.tj(),Xy(e,t,n)}function kDe(e,t,n){++e.j,e.qj(t,e.Zi(t,n))}function ADe(e,t,n){e.fd(t).Rb(n)}function jDe(e,t,n){return n=qM(e,t,6,n),n}function Bd(e,t,n){return n=qM(e,t,3,n),n}function Vd(e,t,n){return n=qM(e,t,9,n),n}function Hd(e,t){return c_(t,Iyt),e.f=t,e}function MDe(e,t){return(t&AP)%e.d.length}function NDe(e,t,n){return Xft(e.c,e.b,t,n)}function PDe(e,t){this.c=e,kx.call(this,t)}function FDe(e,t){this.a=e,Hhe.call(this,t)}function Ud(e,t){this.a=e,Hhe.call(this,t)}function Wd(e,t){yr.call(this,e),this.a=t}function IDe(e,t){Khe.call(this,e),this.a=t}function Gd(e,t){Khe.call(this,e),this.a=t}function LDe(e){iD.call(this,0,0),this.f=e}function RDe(e,t,n){return e.a+=ND(t,0,n),e}function Kd(e){return!e.a&&(e.a=new ee),e.a}function zDe(e,t){var n=e.e;return e.e=t,n}function BDe(e,t){var n=t;return!!e.Fe(n)}function VDe(e,t){return rd(),e==t?0:e?1:-1}function qd(e,t){e.a.bd(e.b,t),++e.b,e.c=-1}function Jd(e){e.b?Jd(e.b):e.f.c.zc(e.e,e.d)}function HDe(e){Pm(e.e),e.d.b=e.d,e.d.a=e.d}function UDe(e,t,n){wo(),jde(e,t.Ve(e.a,n))}function WDe(e,t,n){return zm(e,P(t,22),n)}function Yd(e,t){return ua(Array(t),e)}function GDe(e){return nm(um(e,32))^nm(e)}function Xd(e){return String.fromCharCode(e)}function KDe(e){return e==null?null:e.message}function qDe(e,t,n){return e.apply(t,n)}function JDe(e,t){e[TI].call(e,t)}function YDe(e,t){e[TI].call(e,t)}function XDe(e,t){return Io(),!jC(t.d.i,e)}function ZDe(e,t,n,r){Np.call(this,e,t,n,r)}function QDe(){Qd.call(this),this.a=new Fa}function $De(){this.n=new Fa,this.o=new Fa}function eOe(){this.b=new Fa,this.c=new T}function tOe(){this.a=new T,this.b=new T}function nOe(){this.a=new Vt,this.b=new Tge}function Zd(){this.b=new ry,this.a=new ry}function rOe(){this.b=new Jr,this.a=new Jr}function iOe(){this.b=new Dr,this.a=new Dr}function aOe(){this.b=new _ye,this.a=new iae}function oOe(){this.a=new Tue,this.b=new Ure}function sOe(){this.a=new T,this.d=new T}function Qd(){this.n=new ni,this.i=new Ul}function cOe(e){this.a=(vS(e,hF),new Hy(e))}function lOe(e){this.a=(vS(e,hF),new Hy(e))}function uOe(e){return e<100?null:new Pa(e)}function dOe(e,t){return e.n.a=(Gh(t),t+10)}function fOe(e,t){return e.n.a=(Gh(t),t+10)}function pOe(e,t){return t==e||Uk(zj(t),e)}function mOe(e,t){return Qh(e.a,t,``)==null}function hOe(e,t){return t.qi(e.a)}function $d(e,t){return e.a+=t.a,e.b+=t.b,e}function ef(e,t){return e.a-=t.a,e.b-=t.b,e}function gOe(e){return Wr(e.j.c,0),e.a=-1,e}function tf(e,t,n){return n=qM(e,t,11,n),n}function _Oe(e,t,n){n!=null&&TS(t,dk(e,n))}function vOe(e,t,n){n!=null&&ES(t,dk(e,n))}function nf(e,t,n,r){F.call(this,e,t,n,r)}function rf(e,t,n,r){F.call(this,e,t,n,r)}function yOe(e,t,n,r){rf.call(this,e,t,n,r)}function bOe(e,t,n,r){wm.call(this,e,t,n,r)}function af(e,t,n,r){wm.call(this,e,t,n,r)}function of(e,t,n,r){wm.call(this,e,t,n,r)}function xOe(e,t,n,r){af.call(this,e,t,n,r)}function sf(e,t,n,r){af.call(this,e,t,n,r)}function cf(e,t,n,r){of.call(this,e,t,n,r)}function SOe(e,t,n,r){sf.call(this,e,t,n,r)}function COe(e,t,n,r){dPe.call(this,e,t,n,r)}function lf(e,t){Mi.call(this,PU+e+bU+t)}function uf(e,t){return e.jk().wi().ri(e,t)}function df(e,t){return e.jk().wi().ti(e,t)}function wOe(e,t){return Gh(e),A(e)===A(t)}function ff(e,t){return Gh(e),A(e)===A(t)}function TOe(e,t){return e.b.Bd(new sxe(e,t))}function EOe(e,t){return e.b.Bd(new cxe(e,t))}function DOe(e,t){return e.b.Bd(new lxe(e,t))}function OOe(e,t){return e.e=P(e.d.Kb(t),159)}function pf(e,t,n){return e.lastIndexOf(t,n)}function kOe(e,t,n){return aE(e[t.a],e[n.a])}function AOe(e,t){return W(t,(mP(),d1),e)}function jOe(e,t){return _u(t.a.d.p,e.a.d.p)}function MOe(e,t){return _u(e.a.d.p,t.a.d.p)}function NOe(e,t){return aE(e.c-e.s,t.c-t.s)}function POe(e,t){return aE(e.b.e.a,t.b.e.a)}function FOe(e,t){return aE(e.c.e.a,t.c.e.a)}function IOe(e){return e.c?Ab(e.c.a,e,0):-1}function mf(e){return e==L8||e==z8||e==R8}function LOe(e,t){this.c=e,Hm.call(this,e,t)}function ROe(e,t,n){this.a=e,sEe.call(this,t,n)}function zOe(e){this.c=e,vl.call(this,tF,0)}function BOe(e,t,n){this.c=t,this.b=n,this.a=e}function hf(e){Rf(),this.d=e,this.a=new Iu}function VOe(e){wf(),this.a=(Vg(),new oa(e))}function HOe(e,t){ql(e.f)?Ait(e,t):f7e(e,t)}function UOe(e,t){kje.call(this,e,e.length,t)}function WOe(e,t){_K||t&&(e.d=t)}function GOe(e,t){return j(t,15)&&Mct(e.c,t)}function KOe(e,t,n){return P(e.c,71).Wk(t,n)}function gf(e,t,n){return P(e.c,71).Xk(t,n)}function qOe(e,t,n){return eDe(e,P(t,343),n)}function JOe(e,t,n){return tDe(e,P(t,343),n)}function YOe(e,t,n){return E5e(e,P(t,343),n)}function XOe(e,t,n){return A7e(e,P(t,343),n)}function _f(e,t){return t==null?null:TT(e.b,t)}function ZOe(e){return al(e)?(Gh(e),e):e.ue()}function vf(e){return!isNaN(e)&&!isFinite(e)}function yf(e){Awe(this),Fg(this),XS(this,e)}function bf(e){au(this),Fje(this.c,0,e.Pc())}function xf(e,t,n){this.a=e,this.b=t,this.c=n}function QOe(e,t,n){this.a=e,this.b=t,this.c=n}function $Oe(e,t,n){this.d=e,this.b=n,this.a=t}function eke(e){this.a=e,yo(),LC(Date.now())}function tke(e){Fh(e.a),KWe(e.c,e.b),e.b=null}function Sf(){Sf=C,aK=new he,oEt=new ge}function nke(){nke=C,TVt=V(WW,FP,1,0,5,1)}function rke(){rke=C,QVt=V(WW,FP,1,0,5,1)}function Cf(){Cf=C,$Vt=V(WW,FP,1,0,5,1)}function wf(){wf=C,new mge((Vg(),Vg(),QG))}function ike(e){return Sb(),iS((TGe(),dEt),e)}function ake(e){return Zw(),iS((MWe(),vEt),e)}function oke(e){return fO(),iS((wHe(),DEt),e)}function ske(e){return dx(),iS((THe(),OEt),e)}function cke(e){return vM(),iS((CXe(),kEt),e)}function lke(e){return Ix(),iS((AWe(),MEt),e)}function uke(e){return Cb(),iS((kWe(),PEt),e)}function dke(e){return Xb(),iS((jWe(),LEt),e)}function fke(e){return SP(),iS((uCe(),oDt),e)}function pke(e){return KC(),iS((DGe(),cDt),e)}function mke(e){return TO(),iS((kGe(),uDt),e)}function hke(e){return wO(),iS((OGe(),mDt),e)}function gke(e){return No(),iS((VBe(),hDt),e)}function _ke(e){return fx(),iS((EHe(),NDt),e)}function vke(e){return Yb(),iS((NWe(),aOt),e)}function yke(e){return vA(),iS((PKe(),lOt),e)}function bke(e){return ow(),iS((jGe(),hOt),e)}function xke(e){return YD(),iS((AGe(),xOt),e)}function Tf(e,t){if(!e)throw E(new Fi(t))}function Ef(e){if(!e)throw E(new Ii(Wvt))}function Df(e,t){if(e!=t)throw E(new Vr)}function Ske(e,t,n){this.a=e,this.b=t,this.c=n}function Of(e,t,n){this.a=e,this.b=t,this.c=n}function Cke(e,t,n){this.a=e,this.b=t,this.c=n}function kf(e,t,n){this.b=e,this.a=t,this.c=n}function Af(e,t,n){this.b=e,this.c=t,this.a=n}function jf(e,t,n){this.a=e,this.b=t,this.c=n}function Mf(e,t,n){this.e=t,this.b=e,this.d=n}function wke(e,t,n){this.b=e,this.a=t,this.c=n}function Tke(e,t,n){return wo(),e.a.Yd(t,n),t}function Nf(e){var t=new Ze;return t.e=e,t}function Pf(e){var t=new Hge;return t.b=e,t}function Ff(){Ff=C,oY=new vte,sY=new yte}function If(){If=C,ROt=new Kte,LOt=new qte}function Lf(){Lf=C,UOt=new tre,WOt=new nre}function Eke(e){return kS(),iS((uWe(),ekt),e)}function Dke(e){return yP(),iS((dCe(),NOt),e)}function Oke(e){return iw(),iS((NGe(),IOt),e)}function kke(e){return aw(),iS((MGe(),qOt),e)}function Ake(e){return tA(),iS((FKe(),YOt),e)}function jke(e){return dM(),iS((KYe(),tkt),e)}function Mke(e){return GA(),iS((Eqe(),nkt),e)}function Nke(e){return Ky(),iS((NHe(),rkt),e)}function Pke(e){return bS(),iS((cWe(),ikt),e)}function Fke(e){return lS(),iS((lWe(),akt),e)}function Ike(e){return FD(),iS((IKe(),okt),e)}function Lke(e){return px(),iS((kHe(),skt),e)}function Rke(e){return TA(),iS((kqe(),pkt),e)}function zke(e){return uM(),iS((gZe(),mkt),e)}function Bke(e){return qC(),iS((fWe(),hkt),e)}function Vke(e){return Zb(),iS((pWe(),_kt),e)}function Hke(e){return Bv(),iS((OHe(),vkt),e)}function Uke(e){return qk(),iS((Oqe(),fkt),e)}function Wke(e){return _w(),iS((dWe(),lkt),e)}function Gke(e){return kA(),iS((Dqe(),ukt),e)}function Kke(e){return wb(),iS((AHe(),dkt),e)}function qke(e){return XE(),iS((RKe(),ykt),e)}function Jke(e){return Zj(),iS((bXe(),MMt),e)}function Yke(e){return hT(),iS((mWe(),FMt),e)}function Xke(e){return IO(),iS((PGe(),IMt),e)}function Zke(e){return CO(),iS((LKe(),zMt),e)}function Qke(e){return FM(),iS((_Ze(),GMt),e)}function $ke(e){return ID(),iS((FGe(),JMt),e)}function eAe(e){return Qb(),iS((jHe(),XMt),e)}function tAe(e){return uS(),iS((_We(),QMt),e)}function nAe(e){return CC(),iS((hWe(),nNt),e)}function rAe(e){return Nw(),iS((gWe(),iNt),e)}function iAe(e){return Xw(),iS((vWe(),sNt),e)}function aAe(e){return cS(),iS((yWe(),dNt),e)}function oAe(e){return sw(),iS((bWe(),pNt),e)}function sAe(e){return sS(),iS((OWe(),jNt),e)}function cAe(e){return Vv(),iS((MHe(),RNt),e)}function lAe(e){return O_(),iS((IHe(),qNt),e)}function uAe(e){return k_(),iS((LHe(),YNt),e)}function dAe(e){return Wy(),iS((RHe(),dPt),e)}function fAe(e){return D_(),iS((zHe(),vPt),e)}function pAe(e){return Ok(),iS((YGe(),bPt),e)}function mAe(e){return LM(),iS((fCe(),NPt),e)}function hAe(e){return Pw(),iS((xWe(),IPt),e)}function gAe(e){return Jw(),iS((JGe(),TFt),e)}function _Ae(e){return iv(),iS((PHe(),OFt),e)}function vAe(e){return AS(),iS((FHe(),PFt),e)}function yAe(e){return iA(),iS((zKe(),IFt),e)}function bAe(e){return Yw(),iS((SWe(),UFt),e)}function xAe(e){return _b(),iS((BHe(),zFt),e)}function SAe(e){return uk(),iS((qGe(),wIt),e)}function CAe(e){return SC(),iS((CWe(),OIt),e)}function wAe(e){return ED(),iS((wWe(),AIt),e)}function TAe(e){return LO(),iS((TWe(),MIt),e)}function EAe(e){return TE(),iS((EWe(),RIt),e)}function DAe(e){return my(),iS((VHe(),xLt),e)}function OAe(e){return dC(),iS((DHe(),AOt),e)}function kAe(e){return DA(),iS((Aqe(),TOt),e)}function AAe(e){return Tb(),iS((DWe(),TLt),e)}function jAe(e){return JC(),iS((HHe(),kLt),e)}function MAe(e){return Wj(),iS((BKe(),MLt),e)}function NAe(e){return Bo(),iS((sVe(),FLt),e)}function PAe(e){return KT(),iS((FWe(),NLt),e)}function FAe(e){return Vo(),iS((cVe(),LLt),e)}function IAe(e){return Gy(),iS((UHe(),zLt),e)}function LAe(e){return MA(),iS((VKe(),WLt),e)}function RAe(e){return Ho(),iS((lVe(),SRt),e)}function zAe(e){return cw(),iS((WHe(),TRt),e)}function BAe(e){return uO(),iS((UKe(),FRt),e)}function VAe(e){return VA(),iS((WYe(),RRt),e)}function HAe(e){return RO(),iS((jqe(),HRt),e)}function UAe(e){return eA(),iS((Mqe(),ezt),e)}function WAe(e){return GT(),iS((HKe(),nBt),e)}function GAe(e){return Lx(),iS((IWe(),iBt),e)}function KAe(e){return wE(),iS((XGe(),aBt),e)}function qAe(e){return hA(),iS((Nqe(),fBt),e)}function JAe(e){return _T(),iS((PWe(),bBt),e)}function YAe(e){return kk(),iS((ZGe(),SBt),e)}function XAe(e){return Ej(),iS((SXe(),CBt),e)}function ZAe(e){return pO(),iS((WKe(),EBt),e)}function QAe(e){return rA(),iS((Pqe(),OBt),e)}function $Ae(e){return rj(),iS((Fqe(),kBt),e)}function eje(e){return nP(),iS((GKe(),ABt),e)}function tje(e){return TD(),iS((QGe(),IBt),e)}function nje(e){return UM(),iS((xXe(),RBt),e)}function rje(e){return gT(),iS((LWe(),VBt),e)}function ije(e,t){return Gh(e),e+(Gh(t),t)}function aje(e){return zf(),iS((GHe(),WBt),e)}function oje(e){return ZE(),iS(($Ge(),YBt),e)}function sje(e){return Mw(),iS((eKe(),tVt),e)}function Rf(){Rf=C,PNt=(nP(),g5),v2=X8}function zf(){zf=C,HBt=new AMe,UBt=new cPe}function cje(e){return!e.e&&(e.e=new T),e.e}function Bf(e,t){this.c=e,this.a=t,this.b=t-e}function lje(e,t,n){this.a=e,this.b=t,this.c=n}function Vf(e,t,n){this.a=e,this.b=t,this.c=n}function Hf(e,t,n){this.a=e,this.b=t,this.c=n}function Uf(e,t,n){this.a=e,this.b=t,this.c=n}function uje(e,t,n){this.a=e,this.b=t,this.c=n}function dje(e,t,n){this.a=e,this.b=t,this.c=n}function Wf(e,t,n){this.e=e,this.a=t,this.c=n}function fje(e,t,n){du(),ILe.call(this,e,t,n)}function Gf(e,t,n){du(),Ph.call(this,e,t,n)}function pje(e,t,n){du(),Ph.call(this,e,t,n)}function mje(e,t,n){du(),Ph.call(this,e,t,n)}function hje(e,t,n){du(),Gf.call(this,e,t,n)}function gje(e,t,n){du(),Gf.call(this,e,t,n)}function _je(e,t,n){du(),gje.call(this,e,t,n)}function vje(e,t,n){du(),pje.call(this,e,t,n)}function yje(e,t,n){du(),mje.call(this,e,t,n)}function Kf(e){Np.call(this,e.d,e.c,e.a,e.b)}function bje(e){Np.call(this,e.d,e.c,e.a,e.b)}function xje(e){this.d=e,wfe(this),this.b=FNe(e.d)}function Sje(e){return Sj(),iS((GYe(),bVt),e)}function qf(e,t){return ph(e),ph(t),new Hye(e,t)}function Jf(e,t){return ph(e),ph(t),new oMe(e,t)}function Cje(e,t){return ph(e),ph(t),new sMe(e,t)}function wje(e,t){return ph(e),ph(t),new Qye(e,t)}function Yf(e){return jd(e.b!=0),Ox(e,e.a.a)}function Tje(e){return jd(e.b!=0),Ox(e,e.c.b)}function Eje(e){return!e.c&&(e.c=new ln),e.c}function Xf(e){var t=new T;return rx(t,e),t}function Dje(e){var t=new Jr;return rx(t,e),t}function Oje(e){var t=new Nge;return HS(t,e),t}function Zf(e){var t=new vo;return HS(t,e),t}function P(e,t){return bp(e==null||kO(e,t)),e}function kje(e,t,n){WNe.call(this,t,n),this.a=e}function Aje(e,t){this.c=e,this.b=t,this.a=!1}function jje(){this.a=`;,;`,this.b=``,this.c=``}function Mje(e,t,n){this.b=e,aCe.call(this,t,n)}function Nje(e,t,n){this.c=e,ds.call(this,t,n)}function Pje(e,t,n){js.call(this,e,t),this.b=n}function Fje(e,t,n){art(n,0,e,t,n.length,!1)}function Qf(e,t,n,r,i){e.b=t,e.c=n,e.d=r,e.a=i}function Ije(e,t,n,r,i){e.d=t,e.c=n,e.a=r,e.b=i}function Lje(e,t){t&&(e.b=t,e.a=(Hh(t),t.a))}function $f(e,t){if(!e)throw E(new Fi(t))}function ep(e,t){if(!e)throw E(new Ii(t))}function Rje(e,t){if(!e)throw E(new ove(t))}function zje(e,t){return Ro(),_u(e.d.p,t.d.p)}function Bje(e,t){return zx(),aE(e.e.b,t.e.b)}function Vje(e,t){return zx(),aE(e.e.a,t.e.a)}function Hje(e,t){return _u(bMe(e.d),bMe(t.d))}function tp(e,t){return t&&Lh(e,t.d)?t:null}function Uje(e,t){return t==(nP(),g5)?e.c:e.d}function Wje(e){return MC(gPe(Il(e)?zC(e):e))}function Gje(e){return new k(e.c+e.b,e.d+e.a)}function Kje(e){return e!=null&&!zE(e,y7,b7)}function qje(e,t){return(R$e(e)<<4|R$e(t))&OF}function Jje(e,t,n,r,i){e.c=t,e.d=n,e.b=r,e.a=i}function Yje(e){var t=e.b;e.b=e.c,e.c=t}function Xje(e){var t,n=e.d;t=e.a,e.d=t,e.a=n}function Zje(e,t){var n=e.c;return PJe(e,t),n}function Qje(e,t){return e.g=t<0?-1:t,e}function np(e,t){return bqe(e),e.a*=t,e.b*=t,e}function $je(e,t,n){pqe.call(this,t,n),this.d=e}function rp(e,t,n){el.call(this,e,t),this.c=n}function ip(e,t,n){el.call(this,e,t),this.c=n}function eMe(e){Cf(),sn.call(this),this.ci(e)}function tMe(){By(),uFe.call(this,(qo(),N7))}function nMe(e){return xP(),++W9,new zp(0,e)}function rMe(){rMe=C,f9=(Vg(),new Gn(xW))}function ap(){ap=C,new FO((mi(),ZW),(pi(),XW))}function iMe(){iMe=C,OG=V(DG,X,17,256,0,1)}function aMe(){this.b=D(N(hO((XM(),eJ))))}function op(e){this.b=e,this.a=am(this.b.a).Od()}function oMe(e,t){this.b=e,this.a=t,dn.call(this)}function sMe(e,t){this.a=e,this.b=t,dn.call(this)}function cMe(e,t,n){this.a=e,El.call(this,t,n)}function lMe(e,t,n){this.a=e,El.call(this,t,n)}function sp(e,t,n){hx(e,t,new mh(n))}function uMe(e,t,n){var r=e[t];return e[t]=n,r}function cp(e){return yb(e.slice(),e)}function lp(e){var t=e.n;return e.a.b+t.d+t.a}function dMe(e){var t=e.n;return e.e.b+t.d+t.a}function fMe(e){var t=e.n;return e.e.a+t.b+t.c}function pMe(e){e.a.b=e.b,e.b.a=e.a,e.a=e.b=null}function up(e,t){return iy(e,t,e.c.b,e.c),!0}function mMe(e){return e.a?e.a:xg(e)}function hMe(e){return Ug(),xA(e)==I_(SA(e))}function gMe(e){return Ug(),SA(e)==I_(xA(e))}function dp(e,t){return Bk(e,new js(t.a,t.b))}function _Me(e,t){return eg(),ik(e,t),new jFe(e,t)}function vMe(e,t){return e.c=t)throw E(new e_e)}function _m(e,t){return MT(e,(Gh(t),new jfe(t)))}function vm(e,t){return MT(e,(Gh(t),new Mfe(t)))}function XNe(e,t,n){return kvt(e,P(t,12),P(n,12))}function ZNe(e){return fC(),P(e,12).g.c.length!=0}function QNe(e){return fC(),P(e,12).e.c.length!=0}function $Ne(e,t){return cC(),aE(t.a.o.a,e.a.o.a)}function ePe(e,t){(t.Bb&GH)!=0&&!e.a.o&&(e.a.o=t)}function tPe(e,t){t.Ug(`General 'Rotator`,1),vgt(e)}function nPe(e,t,n){t.qf(n,D(N(xh(e.b,n)))*e.a)}function rPe(e,t,n){return fM(),_C(e,t)&&_C(e,n)}function ym(e){return rj(),!e.Hc(G8)&&!e.Hc(q8)}function iPe(e){return e.e?$Ue(e.e):null}function bm(e){return Il(e)?``+e:Ect(e)}function aPe(e){for(var t=e;t.f;)t=t.f;return t}function oPe(e,t,n){return Sh(t,0,Op(t[0],n[0])),t}function xm(e,t,n,r){var i=e.i;i.i=t,i.a=n,i.b=r}function F(e,t,n,r){ju.call(this,e,t,n),this.b=r}function Sm(e,t,n,r,i){ub.call(this,e,t,n,r,i,-1)}function Cm(e,t,n,r,i){db.call(this,e,t,n,r,i,-1)}function wm(e,t,n,r){rp.call(this,e,t,n),this.b=r}function sPe(e){zSe.call(this,e,!1),this.a=!1}function cPe(){vSe.call(this,`LOOKAHEAD_LAYOUT`,1)}function lPe(e){this.b=e,cd.call(this,e),CTe(this)}function uPe(e){this.b=e,ud.call(this,e),wTe(this)}function Tm(e,t,n){this.a=e,nf.call(this,t,n,5,6)}function dPe(e,t,n,r){this.b=e,ju.call(this,t,n,r)}function fPe(e,t){this.b=e,_de.call(this,e.b),this.a=t}function pPe(e){this.a=m4e(e.a),this.b=new bf(e.b)}function mPe(e,t){gh(),rbe.call(this,e,bT(new Wi(t)))}function Em(e,t){return xP(),++W9,new Nh(e,t,0)}function Dm(e,t){return xP(),++W9,new Nh(6,e,t)}function Om(e,t){for(Gh(t);e.Ob();)t.Cd(e.Pb())}function km(e,t){return rl(t)?e_(e,t):!!Kp(e.f,t)}function Am(e,t){return t.Vh()?pT(e.b,P(t,54)):t}function hPe(e,t){return ff(e.substr(0,t.length),t)}function jm(e){return new pm(new ATe(e.a.length,e.a))}function Mm(e){return new k(e.c+e.b/2,e.d+e.a/2)}function gPe(e){return vu(~e.l&QF,~e.m&QF,~e.h&$F)}function Nm(e){return typeof e===EP||typeof e===kP}function Pm(e){e.f=new PCe(e),e.i=new FCe(e),++e.g}function _Pe(e){if(!e)throw E(new Hr);return e.d}function Fm(e){var t=yw(e);return jd(t!=null),t}function vPe(e){var t=u1e(e);return jd(t!=null),t}function Im(e,t){var n=e.a.gc();return RUe(t,n),n-t}function Lm(e,t){return e.a.zc(t,e)==null}function Rm(e,t){return e.a.zc(t,(rd(),vG))==null}function yPe(e){return new Mp(null,OPe(e,e.length))}function bPe(e,t,n){return ypt(e,P(t,42),P(n,176))}function zm(e,t,n){return PS(e.a,t),uMe(e.b,t.g,n)}function xPe(e,t,n){gm(n,e.a.c.length),uy(e.a,n,t)}function I(e,t,n,r){TQe(t,n,e.length),SPe(e,t,n,r)}function SPe(e,t,n,r){var i;for(i=t;i0?r.Math.log(e/t):-100}function DPe(e,t){return dT(e,t)<0?-1:+(dT(e,t)>0)}function qm(e,t){Kwe(e,j(t,160)?t:P(t,2036).Rl())}function Jm(e,t){if(e==null)throw E(new Li(t))}function OPe(e,t){return gqe(t,e.length),new kMe(e,t)}function Ym(e,t){return t?XS(e,t):!1}function kPe(){return xi(),U(O(MTt,1),Z,549,0,[tG])}function Xm(e){return e.e==0?e:new Bm(-e.e,e.d,e.a)}function APe(e,t){return aE(e.c.c+e.c.b,t.c.c+t.c.b)}function Zm(e,t){iy(e.d,t,e.b.b,e.b),++e.a,e.c=null}function jPe(e,t){return e.c?jPe(e.c,t):M(e.b,t),e}function MPe(e,t,n){var r=ax(e,t);return Yv(e,t,n),r}function NPe(e,t,n){var r;for(r=0;r=e.g}function Sh(e,t,n){return cDe(n==null||mdt(e,n)),e[t]=n}function Ch(e,t){return sv(t,e.length+1),e.substr(t)}function wh(e,t){for(Gh(t);e.c=e?new _be:RJe(e-1)}function Bh(e){return!e.a&&e.c?e.c.b:e.a}function Vh(e){return j(e,616)?e:new KLe(e)}function Hh(e){e.c?Hh(e.c):(lE(e),e.d=!0)}function Uh(e){e.c?e.c.$e():(e.d=!0,bot(e))}function _Fe(e){e.b=!1,e.c=!1,e.d=!1,e.a=!1}function vFe(e){return e.c.i.c==e.d.i.c}function yFe(e,t){var n=e.Ih(t);n>=0?e.ki(n):Qtt(e,t)}function bFe(e,t){e.c<0||e.b.b0;)e=e<<1|e<0;return e}function BFe(e,t){var n=new Eh(e);return Mr(t.c,n),n}function VFe(e,t){e.u.Hc((rj(),G8))&&bnt(e,t),RWe(e,t)}function rg(e,t){return A(e)===A(t)||e!=null&&NT(e,t)}function ig(e,t){return Gp(e.a,t)?e.b[P(t,22).g]:null}function HFe(){return No(),U(O(Oq,1),Z,489,0,[Dq])}function UFe(){return Bo(),U(O(PLt,1),Z,490,0,[v3])}function WFe(){return Vo(),U(O(ILt,1),Z,558,0,[y3])}function GFe(){return Ho(),U(O(xRt,1),Z,539,0,[O3])}function ag(e){return!e.n&&(e.n=new F(Q5,e,1,7)),e.n}function og(e){return!e.c&&(e.c=new F(e7,e,9,9)),e.c}function sg(e){return!e.c&&(e.c=new cf(H5,e,5,8)),e.c}function KFe(e){return!e.b&&(e.b=new cf(H5,e,4,7)),e.b}function cg(e){return e.j.c.length=0,yg(e.c),gOe(e.a),e}function lg(e){return e.e==SW&&gfe(e,p2e(e.g,e.b)),e.e}function ug(e){return e.f==SW&&vfe(e,O6e(e.g,e.b)),e.f}function dg(e,t,n,r){return lXe(e,t,n,!1),LT(e,r),e}function qFe(e,t){this.b=e,Hm.call(this,e,t),CTe(this)}function JFe(e,t){this.b=e,LOe.call(this,e,t),wTe(this)}function fg(e){this.d=e,this.a=this.d.b,this.b=this.d.c}function pg(e,t){this.b=e,this.c=t,this.a=new _o(this.b)}function mg(e,t){return sv(t,e.length),e.charCodeAt(t)}function YFe(e,t){fE(e,D(nS(t,`x`)),D(nS(t,`y`)))}function XFe(e,t){fE(e,D(nS(t,`x`)),D(nS(t,`y`)))}function hg(e,t){return lE(e),new Mp(e,new UGe(t,e.a))}function gg(e,t){return lE(e),new Mp(e,new WUe(t,e.a))}function _g(e,t){return lE(e),new fDe(e,new HUe(t,e.a))}function vg(e,t){return lE(e),new pDe(e,new UUe(t,e.a))}function ZFe(e,t){return new VIe(P(ph(e),50),P(ph(t),50))}function QFe(e,t){return aE(e.d.c+e.d.b/2,t.d.c+t.d.b/2)}function $Fe(e,t,n){n.a?Kx(e,t.b-e.f/2):Gx(e,t.a-e.g/2)}function eIe(e,t){return aE(e.g.c+e.g.b/2,t.g.c+t.g.b/2)}function tIe(e,t){return Pbe(),aE((Gh(e),e),(Gh(t),t))}function nIe(e){return e!=null&&po(x7,e.toLowerCase())}function yg(e){var t;for(t=e.Kc();t.Ob();)t.Pb(),t.Qb()}function bg(e){var t=e.b;return!t&&(e.b=t=new lde(e)),t}function xg(e){return HJe(e)||null}function rIe(e,t){var n=e/t,r=C_(n);return n>r&&++r,r}function iIe(e,t,n){var r=P(e.d.Kb(n),159);r&&r.Nb(t)}function aIe(e,t,n){gpt(e.a,n),PXe(n),sit(e.b,n),Wpt(t,n)}function Sg(e,t,n,r){this.a=e,this.c=t,this.b=n,this.d=r}function Cg(e,t,n,r){this.c=e,this.b=t,this.a=n,this.d=r}function oIe(e,t,n,r){this.c=e,this.b=t,this.d=n,this.a=r}function wg(e,t,n,r){this.c=e,this.d=t,this.b=n,this.a=r}function sIe(e,t,n,r){this.a=e,this.d=t,this.c=n,this.b=r}function Tg(e,t,n,r){this.a=e,this.e=t,this.d=n,this.c=r}function cIe(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function Eg(e,t,n){this.a=ryt,this.d=e,this.b=t,this.c=n}function Dg(e,t,n,r){so.call(this,e,t),this.a=n,this.b=r}function lIe(e,t){this.d=(Gh(e),e),this.a=16449,this.c=t}function uIe(e){this.a=new T,this.e=V(q9,X,53,e,0,2)}function dIe(e){e.Ug(`No crossing minimization`,1),e.Vg()}function fIe(){yi.call(this,`There is no more element.`)}function pIe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function mIe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function Og(e,t,n,r){this.e=e,this.a=t,this.c=n,this.d=r}function hIe(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function gIe(e,t,n,r){du(),GUe.call(this,t,n,r),this.a=e}function _Ie(e,t,n,r){du(),GUe.call(this,t,n,r),this.a=e}function kg(e,t,n){var r=n_t(e);return t.ti(n,r)}function Ag(e){var t,n=(t=new kr,t);return Nx(n,e),n}function jg(e){var t,n=(t=new kr,t);return i9e(n,e),n}function vIe(e,t){return yC(t,xh(e.f,t)),null}function yIe(e){return!e.b&&(e.b=new F(U5,e,12,3)),e.b}function bIe(e){return bp(e==null||Nm(e)&&e.Tm!==ne),e}function Mg(e){return e.n&&(e.e!==eyt&&e.je(),e.j=null),e}function Ng(e){if(RE(e.d),e.d.d!=e.c)throw E(new Vr)}function Pg(e){return jd(e.b0&&d8e(this)}function xIe(e,t){this.a=e,dDe.call(this,e,P(e.d,15).fd(t))}function SIe(e,t){return aE(Lp(e)*Ip(e),Lp(t)*Ip(t))}function CIe(e,t){return aE(Lp(e)*Ip(e),Lp(t)*Ip(t))}function wIe(e){return uj(e)&&ki(Od(J(e,(mP(),A1))))}function TIe(e,t){return fj(e,P(K(t,(mP(),Y1)),17),t)}function EIe(e,t){return P(K(e,(Y(),PQ)),15).Fc(t),t}function Lg(e,t){return e.b=t.b,e.c=t.c,e.d=t.d,e.a=t.a,e}function DIe(e,t,n,r){this.b=e,this.c=r,vl.call(this,t,n)}function OIe(e,t,n){e.i=0,e.e=0,t!=n&&RZe(e,t,n)}function kIe(e,t,n){e.i=0,e.e=0,t!=n&&zZe(e,t,n)}function AIe(e,t,n){return Lo(),N1e(P(xh(e.e,t),529),n)}function Rg(e){var t;return t=e.f,t||(e.f=new io(e,e.c))}function jIe(e,t){return CT(e.j,t.s,t.c)+CT(t.e,e.s,e.c)}function MIe(e,t){e.e&&!e.e.a&&(Qhe(e.e,t),MIe(e.e,t))}function NIe(e,t){e.d&&!e.d.a&&(Qhe(e.d,t),NIe(e.d,t))}function PIe(e,t){return-aE(Lp(e)*Ip(e),Lp(t)*Ip(t))}function FIe(e){return P(e.ld(),149).Pg()+`:`+PE(e.md())}function IIe(){EA(this,new $ue),this.wb=(vh(),z7),Ra()}function LIe(e){this.b=new T,nw(this.b,this.b),this.a=e}function zg(e,t){new vo,this.a=new ai,this.b=e,this.c=t}function Bg(){Bg=C,nK=new ue,rK=new ue,iK=new de}function Vg(){Vg=C,QG=new ae,$G=new se,eK=new ce}function Hg(){Hg=C,wEt=new Ge,EEt=new yNe,TEt=new Ke}function Ug(){Ug=C,zq=new T,Rq=new Dr,Lq=new T}function Wg(e,t){if(e==null)throw E(new Li(t));return e}function Gg(e){return!e.a&&(e.a=new F($5,e,10,11)),e.a}function Kg(e){return!e.q&&(e.q=new F(M7,e,11,10)),e.q}function R(e){return!e.s&&(e.s=new F(w7,e,21,17)),e.s}function RIe(e){return ph(e),z4e(new pm(Vu(e.a.Kc(),new d)))}function zIe(e,t){return $w(e),$w(t),eve(P(e,22),P(t,22))}function qg(e,t,n){hx(e,t,new Cn(ZOe(n)))}function Jg(e,t,n,r,i,a){db.call(this,e,t,n,r,i,a?-2:-1)}function BIe(e,t,n,r){el.call(this,t,n),this.b=e,this.a=r}function VIe(e,t){F_e.call(this,new mm(e)),this.a=e,this.b=t}function Yg(e){this.b=e,this.c=e,e.e=null,e.c=null,this.a=1}function HIe(e){Lf();var t=P(e.g,10);t.n.a=e.d.c+t.d.b}function Xg(){Xg=C;var e,t=!L0e();e=new b,lG=t?new y:e}function Zg(e){return Vg(),j(e,59)?new sa(e):new qu(e)}function Qg(e){return j(e,16)?new jp(P(e,16)):Dje(e.Kc())}function UIe(e){return new DTe(e,e.e.Rd().gc()*e.c.Rd().gc())}function WIe(e){return new OTe(e,e.e.Rd().gc()*e.c.Rd().gc())}function $g(e){return e&&e.hashCode?e.hashCode():td(e)}function e_(e,t){return t==null?!!Kp(e.f,null):dNe(e.i,t)}function GIe(e,t){var n=Gwe(e.a,t);return n&&(t.d=null),n}function KIe(e,t,n){return e.f?e.f.ef(t,n):!1}function t_(e,t,n,r){Sh(e.c[t.g],n.g,r),Sh(e.c[n.g],t.g,r)}function n_(e,t,n,r){Sh(e.c[t.g],t.g,n),Sh(e.b[t.g],t.g,r)}function qIe(e,t,n){return D(N(n.a))<=e&&D(N(n.b))>=t}function JIe(e,t){this.g=e,this.d=U(O(UJ,1),jR,10,0,[t])}function YIe(e){this.c=e,this.b=new Ja(P(ph(new qe),50))}function XIe(e){this.c=e,this.b=new Ja(P(ph(new dee),50))}function ZIe(e){this.b=e,this.a=new Ja(P(ph(new At),50))}function QIe(){this.b=new Jr,this.d=new vo,this.e=new $r}function r_(){this.c=new Fa,this.d=new Fa,this.e=new Fa}function i_(){this.a=new ai,this.b=(vS(3,hF),new Hy(3))}function a_(e,t){this.e=e,this.a=WW,this.b=glt(t),this.c=t}function o_(e){this.c=e.c,this.d=e.d,this.b=e.b,this.a=e.a}function $Ie(e,t,n,r,i,a){this.a=e,xS.call(this,t,n,r,i,a)}function eLe(e,t,n,r,i,a){this.a=e,xS.call(this,t,n,r,i,a)}function s_(e,t,n,r,i,a,o){return new ey(e.e,t,n,r,i,a,o)}function tLe(e,t,n){return n>=0&&ff(e.substr(n,t.length),t)}function nLe(e,t){return j(t,149)&&ff(e.b,P(t,149).Pg())}function rLe(e,t){return e.a?t.Gh().Kc():P(t.Gh(),71).Ii()}function iLe(e,t){var n=e.b.Qc(t);return bHe(n,e.b.gc()),n}function c_(e,t){if(e==null)throw E(new Li(t));return e}function l_(e){return e.u||=(_y(e),new FDe(e,e)),e.u}function u_(e){this.a=(Vg(),j(e,59)?new sa(e):new qu(e))}function d_(e){return P(NC(e,16),29)||e.ii()}function f_(e,t){var n=Ha(e.Rm);return t==null?n:n+`: `+t}function p_(e,t,n){return Zy(t,n,e.length),e.substr(t,n-t)}function aLe(e,t){Qd.call(this),Px(this),this.a=e,this.c=t}function oLe(e){!e||f_(e,e.ie())}function sLe(e){Qi(),r.setTimeout(function(){throw e},0)}function cLe(){return fO(),U(O(DK,1),Z,436,0,[EK,TK])}function lLe(){return dx(),U(O(AK,1),Z,435,0,[OK,kK])}function uLe(){return fx(),U(O(Uq,1),Z,432,0,[Vq,Hq])}function dLe(){return dC(),U(O(kOt,1),Z,517,0,[aY,iY])}function fLe(){return Bv(),U(O(lQ,1),Z,429,0,[sQ,cQ])}function pLe(){return px(),U(O(hZ,1),Z,428,0,[pZ,mZ])}function mLe(){return Ky(),U(O(QX,1),Z,431,0,[XX,ZX])}function hLe(){return Qb(),U(O(YMt,1),Z,430,0,[e2,t2])}function gLe(){return Vv(),U(O(LNt,1),Z,531,0,[b2,y2])}function _Le(){return AS(),U(O(NFt,1),Z,501,0,[b4,x4])}function vLe(){return O_(),U(O(KNt,1),Z,523,0,[w2,C2])}function yLe(){return k_(),U(O(JNt,1),Z,522,0,[T2,E2])}function bLe(){return Wy(),U(O(uPt,1),Z,528,0,[A2,k2])}function xLe(){return wb(),U(O(OZ,1),Z,488,0,[DZ,EZ])}function SLe(){return my(),U(O(bLt,1),Z,491,0,[s3,yLt])}function CLe(){return JC(),U(O(OLt,1),Z,492,0,[ELt,DLt])}function wLe(){return iv(),U(O(DFt,1),Z,433,0,[v4,EFt])}function TLe(){return _b(),U(O(RFt,1),Z,434,0,[LFt,D4])}function ELe(){return D_(),U(O(_Pt,1),Z,465,0,[j2,M2])}function DLe(){return Gy(),U(O(RLt,1),Z,438,0,[x3,b3])}function OLe(){return cw(),U(O(wRt,1),Z,437,0,[k3,CRt])}function kLe(){return zf(),U(O(P5,1),Z,347,0,[HBt,UBt])}function m_(e,t,n,r){return n>=0?e.Uh(t,n,r):e.Ch(null,n,r)}function h_(e){return e.b.b==0?e.a.sf():Yf(e.b)}function ALe(e){if(e.p!=5)throw E(new Rr);return nm(e.f)}function jLe(e){if(e.p!=5)throw E(new Rr);return nm(e.k)}function MLe(e){return A(e.a)===A((uC(),r9))&&bmt(e),e.a}function NLe(e,t){e.b=t,e.c>0&&e.b>0&&(e.g=Pp(e.c,e.b,e.a))}function PLe(e,t){e.c=t,e.c>0&&e.b>0&&(e.g=Pp(e.c,e.b,e.a))}function FLe(e,t){Qde(this,new k(e.a,e.b)),$de(this,Zf(t))}function g_(){I_e.call(this,new go(xx(12))),vTe(!0),this.a=2}function __(e,t,n){xP(),Tr.call(this,e),this.b=t,this.a=n}function ILe(e,t,n){du(),xr.call(this,t),this.a=e,this.b=n}function LLe(e){var t=e.c.d.b;e.b=t,e.a=e.c.d,t.a=e.c.d.b=e}function RLe(e){return e.b==0?null:(jd(e.b!=0),Ox(e,e.a.a))}function v_(e,t){return t==null?nl(Kp(e.f,null)):as(e.i,t)}function zLe(e,t,n,r,i){return new IA(e,(Sb(),fK),t,n,r,i)}function y_(e,t){return dHe(t),eJe(e,V(q9,HF,28,t,15,1),t)}function b_(e,t){return Wg(e,`set1`),Wg(t,`set2`),new ibe(e,t)}function BLe(e,t){return aG[e.charCodeAt(0)]??e}function VLe(e,t){var n=t,r=new ve;return Aht(e,n,r),r.d}function x_(e,t,n,r){var i=new QDe;t.a[n.g]=i,zm(e.b,r,i)}function HLe(e,t){return $d(Cd(Bqe(e.f,t)),e.f.d)}function S_(e){var t;xJe(e.a),owe(e.a),t=new ar(e.a),KE(t)}function ULe(e,t){Uct(e,!0),Dx(e.e.Rf(),new Af(e,!0,t))}function WLe(e,t){return Ug(),e==I_(xA(t))||e==I_(SA(t))}function GLe(e,t){return zx(),P(K(t,(rN(),p4)),17).a==e}function C_(e){return Math.max(Math.min(e,AP),-2147483648)|0}function KLe(e){this.a=P(ph(e),277),this.b=(Vg(),new UTe(e))}function qLe(e,t,n){this.i=new T,this.b=e,this.g=t,this.a=n}function JLe(e,t,n){this.a=new T,this.e=e,this.f=t,this.c=n}function w_(e,t,n){this.c=new T,this.e=e,this.f=t,this.b=n}function YLe(e){Qd.call(this),Px(this),this.a=e,this.c=!0}function XLe(e){function t(){}return t.prototype=e||{},new t}function ZLe(e){if(e.Ae())return null;var t=e.n;return UW[t]}function T_(e){return e.Db>>16==3?P(e.Cb,27):null}function E_(e){return e.Db>>16==9?P(e.Cb,27):null}function QLe(e){return e.Db>>16==6?P(e.Cb,74):null}function D_(){D_=C,j2=new rSe(cL,0),M2=new rSe(lL,1)}function O_(){O_=C,w2=new Uxe(lL,0),C2=new Uxe(cL,1)}function k_(){k_=C,T2=new Wxe(hL,0),E2=new Wxe(`UP`,1)}function $Le(){$Le=C,NTt=nT((xi(),U(O(MTt,1),Z,549,0,[tG])))}function eRe(e){var t=new qa(xx(e.length));return wZe(t,e),t}function tRe(e,t){return e.b+=t.b,e.c+=t.c,e.d+=t.d,e.a+=t.a,e}function nRe(e,t){return IXe(e,t)?(oJe(e),!0):!1}function A_(e,t){if(t==null)throw E(new zr);return K0e(e,t)}function j_(e,t){var n=e.q.getHours();e.q.setDate(t),dN(e,n)}function rRe(e,t,n){var r=e.Ih(t);r>=0?e.bi(r,n):Pat(e,t,n)}function iRe(e,t){var n=e.Ih(t);return n>=0?e.Wh(n):cj(e,t)}function aRe(e,t){var n;for(ph(t),n=e.a;n;n=n.c)t.Yd(n.g,n.i)}function M_(e,t,n){e.b=new VS(kZe(e,t,n).c.length)}function N_(e,t,n){R_(),e&&Qh(p7,e,t),e&&Qh(f7,e,n)}function oRe(e,t){return If(),rd(),P(t.a,17).a0}function lRe(e){var t=e.d;return t=e.bj(e.f),tb(e,t),t.Ob()}function uRe(e,t){var n=new Ap(t);return L7e(n,e),new bf(n)}function dRe(e){if(e.p!=0)throw E(new Rr);return cl(e.f,0)}function fRe(e){if(e.p!=0)throw E(new Rr);return cl(e.k,0)}function pRe(e){return e.Db>>16==7?P(e.Cb,241):null}function F_(e){return e.Db>>16==6?P(e.Cb,241):null}function mRe(e){return e.Db>>16==7?P(e.Cb,167):null}function I_(e){return e.Db>>16==11?P(e.Cb,27):null}function L_(e){return e.Db>>16==17?P(e.Cb,29):null}function hRe(e){return e.Db>>16==3?P(e.Cb,155):null}function gRe(e){var t;return lE(e),t=new Jr,hg(e,new Wfe(t))}function _Re(e,t){var n=e.a=e.a||[];return n[t]||(n[t]=e.ve(t))}function vRe(e,t){var n=e.q.getHours();e.q.setMonth(t),dN(e,n)}function yRe(e,t){Fu(this),this.f=t,this.g=e,Mg(this),this.je()}function bRe(e,t){this.a=e,this.c=xu(this.a),this.b=new o_(t)}function xRe(e,t,n){this.a=t,this.c=e,this.b=(ph(n),new bf(n))}function SRe(e,t,n){this.a=t,this.c=e,this.b=(ph(n),new bf(n))}function CRe(e){this.a=e,this.b=V(MNt,X,2043,e.e.length,0,2)}function wRe(){this.a=new Rl,this.e=new Jr,this.g=0,this.i=0}function R_(){R_=C,p7=new Dr,f7=new Dr,USe(tEt,new Ise)}function TRe(){TRe=C,mNt=tm(new Zh,(vA(),SJ),(yP(),nX))}function ERe(){ERe=C,hNt=tm(new Zh,(vA(),SJ),(yP(),nX))}function DRe(){DRe=C,_Nt=tm(new Zh,(vA(),SJ),(yP(),nX))}function ORe(){ORe=C,zNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function z_(){z_=C,HNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function kRe(){kRe=C,GNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function B_(){B_=C,XNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function V_(e,t,n,r,i,a){return new Hb(e.e,t,e.Lj(),n,r,i,a)}function H_(e,t,n){return t==null?XA(e.f,null,n):uE(e.i,t,n)}function U_(e,t){e.c&&Db(e.c.g,e),e.c=t,e.c&&M(e.c.g,e)}function W_(e,t){e.c&&Db(e.c.a,e),e.c=t,e.c&&M(e.c.a,e)}function G_(e,t){e.i&&Db(e.i.j,e),e.i=t,e.i&&M(e.i.j,e)}function K_(e,t){e.d&&Db(e.d.e,e),e.d=t,e.d&&M(e.d.e,e)}function q_(e,t){e.a&&Db(e.a.k,e),e.a=t,e.a&&M(e.a.k,e)}function J_(e,t){e.b&&Db(e.b.f,e),e.b=t,e.b&&M(e.b.f,e)}function ARe(e,t){rFe(e,e.b,e.c),P(e.b.b,68),t&&P(t.b,68).b}function jRe(e,t){return aE(P(e.c,65).c.e.b,P(t.c,65).c.e.b)}function MRe(e,t){return aE(P(e.c,65).c.e.a,P(t.c,65).c.e.a)}function NRe(e){return Qw(),rd(),P(e.a,86).d.e!=0}function Y_(e,t){j(e.Cb,184)&&(P(e.Cb,184).tb=null),GS(e,t)}function X_(e,t){j(e.Cb,90)&&$A(_y(P(e.Cb,90)),4),GS(e,t)}function PRe(e,t){hE(e,t),j(e.Cb,90)&&$A(_y(P(e.Cb,90)),2)}function FRe(e,t){t.c!=null&&Dh(e,new mh(t.c))}function IRe(e){var t,n=(Ra(),t=new kr,t);return Nx(n,e),n}function LRe(e){var t,n=(Ra(),t=new kr,t);return Nx(n,e),n}function RRe(e){for(var t;;)if(t=e.Pb(),!e.Ob())return t}function zRe(e,t,n){return M(e.a,(eg(),ik(t,n),new oo(t,n))),e}function Z_(e,t){return Qo(),ex(t)?new hp(t,e):new Qc(t,e)}function Q_(e){return AM(),dT(e,0)>=0?yD(e):Xm(yD(kb(e)))}function BRe(e){var t=P(cp(e.b),9);return new xf(e.a,t,e.c)}function VRe(e,t){var n=P(TT(Rg(e.a),t),16);return n?n.gc():0}function HRe(e,t,n){var r;I$e(t,n,e.c.length),r=n-t,wye(e.c,t,r)}function $_(e,t,n){I$e(t,n,e.gc()),this.c=e,this.a=t,this.b=n-t}function ev(e){this.c=new vo,this.b=e.b,this.d=e.c,this.a=e.a}function tv(e){this.a=r.Math.cos(e),this.b=r.Math.sin(e)}function nv(e,t,n,r){this.c=e,this.d=r,q_(this,t),J_(this,n)}function URe(e,t){P_e.call(this,new go(xx(e))),vS(t,Jvt),this.a=t}function WRe(e,t,n){return new IA(e,(Sb(),dK),null,!1,t,n)}function GRe(e,t,n){return new IA(e,(Sb(),pK),t,n,null,!1)}function KRe(){return Zw(),U(O(xK,1),Z,108,0,[vK,yK,bK])}function qRe(){return Xb(),U(O(IEt,1),Z,472,0,[sq,oq,aq])}function JRe(){return Cb(),U(O(NEt,1),Z,471,0,[rq,nq,iq])}function YRe(){return Ix(),U(O($K,1),Z,237,0,[XK,ZK,QK])}function XRe(){return Yb(),U(O(_J,1),Z,391,0,[hJ,mJ,gJ])}function ZRe(){return kS(),U(O(MX,1),Z,372,0,[jX,AX,kX])}function QRe(){return bS(),U(O(nZ,1),Z,322,0,[eZ,$X,tZ])}function $Re(){return lS(),U(O(oZ,1),Z,351,0,[rZ,aZ,iZ])}function eze(){return _w(),U(O(ckt,1),Z,460,0,[_Z,gZ,vZ])}function tze(){return qC(),U(O(rQ,1),Z,299,0,[tQ,nQ,eQ])}function nze(){return Zb(),U(O(gkt,1),Z,311,0,[aQ,oQ,iQ])}function rze(){return hT(),U(O(PMt,1),Z,390,0,[P0,NMt,F0])}function ize(){return uS(),U(O(ZMt,1),Z,463,0,[i2,n2,r2])}function aze(){return CC(),U(O(tNt,1),Z,387,0,[$Mt,a2,eNt])}function oze(){return Nw(),U(O(rNt,1),Z,349,0,[c2,o2,s2])}function sze(){return Xw(),U(O(oNt,1),Z,350,0,[l2,aNt,u2])}function cze(){return cS(),U(O(uNt,1),Z,352,0,[lNt,d2,cNt])}function lze(){return sw(),U(O(fNt,1),Z,388,0,[p2,m2,f2])}function uze(){return sS(),U(O(ANt,1),Z,464,0,[h2,g2,_2])}function rv(e){return Sw(U(O(K3,1),X,8,0,[e.i.n,e.n,e.a]))}function dze(){return Pw(),U(O(FPt,1),Z,392,0,[PPt,B2,z2])}function fze(){fze=C,kFt=tm(new Zh,(Ok(),F2),(LM(),CPt))}function iv(){iv=C,v4=new iSe(`DFS`,0),EFt=new iSe(`BFS`,1)}function pze(e,t,n){var r=new zie;r.b=t,r.a=n,++t.b,M(e.d,r)}function mze(e,t,n){var r=new Vl(n.d);$d(r,e),fE(t,r.a,r.b)}function hze(e,t){cTe(e,nm(uv(lm(t,24),jI)),nm(uv(t,jI)))}function av(e,t){if(e<0||e>t)throw E(new Mi(HI+e+UI+t))}function ov(e,t){if(e<0||e>=t)throw E(new Mi(HI+e+UI+t))}function sv(e,t){if(e<0||e>=t)throw E(new ra(HI+e+UI+t))}function cv(e,t){this.b=(Gh(e),e),this.a=(t&uI)==0?t|64|ZP:t}function gze(e){var t;return lE(e),t=(Bg(),Bg(),rK),Cx(e,t)}function _ze(e,t,n){var r=vN(e,t,!1);return r.b<=t&&r.a<=n}function vze(){return Tb(),U(O(wLt,1),Z,439,0,[c3,CLt,SLt])}function yze(){return TE(),U(O(LIt,1),Z,394,0,[IIt,Q4,FIt])}function bze(){return ED(),U(O(kIt,1),Z,445,0,[L4,R4,z4])}function xze(){return LO(),U(O(jIt,1),Z,456,0,[B4,H4,V4])}function Sze(){return Yw(),U(O(HFt,1),Z,393,0,[O4,BFt,VFt])}function Cze(){return SC(),U(O(DIt,1),Z,300,0,[I4,EIt,TIt])}function wze(){return _T(),U(O(yBt,1),Z,346,0,[_8,g8,v8])}function Tze(){return KT(),U(O(_3,1),Z,444,0,[m3,h3,g3])}function Eze(){return Lx(),U(O(rBt,1),Z,278,0,[o8,s8,c8])}function Dze(){return gT(),U(O(BBt,1),Z,280,0,[zBt,M5,N5])}function lv(e){return ph(e),j(e,16)?new bf(P(e,16)):Xf(e.Kc())}function Oze(e,t){return e&&e.equals?e.equals(t):A(e)===A(t)}function uv(e,t){return MC(BNe(Il(e)?zC(e):e,Il(t)?zC(t):t))}function dv(e,t){return MC(VNe(Il(e)?zC(e):e,Il(t)?zC(t):t))}function fv(e,t){return MC(HNe(Il(e)?zC(e):e,Il(t)?zC(t):t))}function kze(e,t){var n=(Gh(e),e).g;return sDe(!!n),Gh(t),n(t)}function Aze(e,t){var n,r=Im(e,t);return n=e.a.fd(r),new tbe(e,n)}function jze(e){return e.Db>>16==6?P(xj(e),241):null}function Mze(e){if(e.p!=2)throw E(new Rr);return nm(e.f)&OF}function Nze(e){if(e.p!=2)throw E(new Rr);return nm(e.k)&OF}function z(e){return jd(e.ar)}function Yze(e,t){var n=jb(t);return P(xh(e.c,n),17).a}function gv(e,t,n){var r=e.d[t.p];e.d[t.p]=e.d[n.p],e.d[n.p]=r}function Xze(e,t,n){var r;e.n&&t&&n&&(r=new Ese,M(e.e,r))}function _v(e,t){if(Lm(e.a,t),t.d)throw E(new yi(xyt));t.d=e}function Zze(e,t){this.a=new T,this.d=new T,this.f=e,this.c=t}function Qze(){this.c=new Hwe,this.a=new JUe,this.b=new Kge,Fbe()}function $ze(){lw(),this.b=new Dr,this.a=new Dr,this.c=new T}function eBe(e,t,n){this.d=e,this.j=t,this.e=n,this.o=-1,this.p=3}function tBe(e,t,n){this.d=e,this.k=t,this.f=n,this.o=-1,this.p=5}function nBe(e,t,n,r,i,a){Gqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function rBe(e,t,n,r,i,a){Kqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function iBe(e,t,n,r,i,a){vUe.call(this,e,t,n,r,i),a&&(this.o=-2)}function aBe(e,t,n,r,i,a){Yqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function oBe(e,t,n,r,i,a){yUe.call(this,e,t,n,r,i),a&&(this.o=-2)}function sBe(e,t,n,r,i,a){qqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function cBe(e,t,n,r,i,a){Jqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function lBe(e,t,n,r,i,a){bUe.call(this,e,t,n,r,i),a&&(this.o=-2)}function uBe(e,t,n,r){xr.call(this,n),this.b=e,this.c=t,this.d=r}function dBe(e,t){this.f=e,this.a=(By(),u9),this.c=u9,this.b=t}function fBe(e,t){this.g=e,this.d=(By(),d9),this.a=d9,this.b=t}function pBe(e,t){!e.c&&(e.c=new DC(e,0)),ON(e.c,(UN(),w9),t)}function mBe(e,t){return Wit(e,t,j(t,102)&&(P(t,19).Bb&pI)!=0)}function hBe(e,t){return DPe(LC(e.q.getTime()),LC(t.q.getTime()))}function gBe(e){return yp(e.e.Rd().gc()*e.c.Rd().gc(),16,new ode(e))}function _Be(e){return!!e.u&&Jv(e.u.a).i!=0&&!(e.n&&QO(e.n))}function vBe(e){return!!e.a&&Ib(e.a.a).i!=0&&!(e.b&&$O(e.b))}function yBe(e,t){return t==0?!!e.o&&e.o.f!=0:mO(e,t)}function bBe(e,t,n){var r=P(e.Zb().xc(t),16);return!!r&&r.Hc(n)}function xBe(e,t,n){var r=P(e.Zb().xc(t),16);return!!r&&r.Mc(n)}function SBe(e,t){var n=1-t;return e.a[n]=FS(e.a[n],n),FS(e,t)}function CBe(e,t){var n,r=uv(e,_I);return n=cm(t,32),dv(n,r)}function wBe(e,t,n){Z3e(new xRe((ph(e),new bf(e)),t,n))}function vv(e,t,n){Q3e(new SRe((ph(e),new bf(e)),t,n))}function yv(e,t,n,r,i,a){return lXe(e,t,n,a),IT(e,r),zT(e,i),e}function TBe(e,t,n,r){return e.a+=``+p_(t==null?IP:PE(t),n,r),e}function bv(e,t){this.a=e,qn.call(this,e),av(t,e.gc()),this.b=t}function EBe(e){this.a=V(WW,FP,1,dZe(r.Math.max(8,e))<<1,5,1)}function xv(e){return P(rO(e,V(UJ,jR,10,e.c.length,0,1)),199)}function Sv(e){return P(rO(e,V(VJ,AR,18,e.c.length,0,1)),483)}function DBe(e){return e.a?e.e.length==0?e.a.a:e.a.a+(``+e.e):e.c}function Cv(e){for(;e.d>0&&e.a[--e.d]==0;);e.a[e.d++]==0&&(e.e=0)}function OBe(e){return jd(e.b.b!=e.d.a),e.c=e.b=e.b.b,--e.a,e.c.c}function kBe(e,t,n){e.a=t,e.c=n,e.b.a.$b(),Fg(e.d),Wr(e.e.a.c,0)}function ABe(e,t){var n;e.e=new D_e,n=sM(t),hu(n,e.c),pct(e,n,0)}function wv(e,t,n,r){var i=new Koe;i.a=t,i.b=n,i.c=r,up(e.a,i)}function B(e,t,n,r){var i=new Koe;i.a=t,i.b=n,i.c=r,up(e.b,i)}function jBe(e,t,n){if(e<0||tn)throw E(new Mi(yet(e,t,n)))}function Tv(e,t){if(e<0||e>=t)throw E(new Mi(jtt(e,t)));return e}function MBe(e){if(!(`stack`in e))try{throw e}catch{}return e}function Ev(e){return Lo(),j(e.g,10)?P(e.g,10):null}function NBe(e){return!bg(e).dc()&&(gwe(e,new h),!0)}function Dv(e){var t;return Il(e)?(t=e,t==-0?0:t):lKe(e)}function PBe(e,t){return j(t,44)?lk(e.a,P(t,44)):!1}function FBe(e,t){return j(t,44)?lk(e.a,P(t,44)):!1}function IBe(e,t){return j(t,44)?lk(e.a,P(t,44)):!1}function LBe(e){var t;return Hh(e),t=new fe,Qa(e.a,new Vfe(t)),t}function RBe(){var e,t=(n=(e=new kr,e),n),n;return M(fHt,t),t}function Ov(e){var t;return Hh(e),t=new pe,Qa(e.a,new Hfe(t)),t}function zBe(e,t){return e.a<=e.b&&(t.Dd(e.a++),!0)}function BBe(e){rC.call(this,e,(Sb(),uK),null,!1,null,!1)}function VBe(){VBe=C,hDt=nT((No(),U(O(Oq,1),Z,489,0,[Dq])))}function HBe(){HBe=C,wNt=LFe(G(1),G(4)),CNt=LFe(G(1),G(2))}function UBe(e,t){return new Vf(t,wd(xu(t.e),e,e),(rd(),!0))}function kv(e){return new Hy((vS(e,_F),bx(yE(yE(5,e),e/10|0))))}function WBe(e){return yp(e.e.Rd().gc()*e.c.Rd().gc(),273,new ade(e))}function GBe(e){return P(rO(e,V(EOt,Sbt,12,e.c.length,0,1)),2042)}function KBe(e){return z_(),!gy(e)&&!(!gy(e)&&e.c.i.c==e.d.i.c)}function qBe(e,t){return Rx(),P(K(t,(rN(),u4)),17).a>=e.gc()}function Av(e,t){L_t(t,e),Yje(e.d),Yje(P(K(e,(mP(),L1)),214))}function jv(e,t){R_t(t,e),Xje(e.d),Xje(P(K(e,(mP(),L1)),214))}function JBe(e,t,n){e.d&&Db(e.d.e,e),e.d=t,e.d&&Jp(e.d.e,n,e)}function YBe(e,t,n){return n.f.c.length>0?bPe(e.a,t,n):bPe(e.b,t,n)}function XBe(e,t,n){var r=b2e();try{return qDe(e,t,n)}finally{CHe(r)}}function Mv(e,t){var n=A_(e,t),r=null;return n&&(r=n.pe()),r}function Nv(e,t){var n=A_(e,t),r=null;return n&&(r=n.se()),r}function Pv(e,t){var n=ax(e,t),r=null;return n&&(r=n.se()),r}function Fv(e,t){var n=A_(e,t),r=null;return n&&(r=ket(n)),r}function ZBe(e,t,n){var r=RD(n);return PM(e.g,r,t),PM(e.i,t,n),t}function QBe(e,t,n){this.d=new nme(this),this.e=e,this.i=t,this.f=n}function $Be(e,t,n,r){this.e=null,this.c=e,this.d=t,this.a=n,this.b=r}function eVe(e,t,n,r){jwe(this),this.c=e,this.e=t,this.f=n,this.b=r}function tVe(e,t,n,r){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1}function nVe(e,t,n,r){return j(n,59)?new lEe(e,t,n,r):new qNe(e,t,n,r)}function Iv(e){return j(e,16)?P(e,16).dc():!e.Kc().Ob()}function rVe(e){if(e.e.g!=e.b)throw E(new Vr);return!!e.c&&e.d>0}function Lv(e){return jd(e.b!=e.d.c),e.c=e.b,e.b=e.b.a,++e.a,e.c.c}function iVe(e,t){Gh(t),Sh(e.a,e.c,t),e.c=e.c+1&e.a.length-1,L3e(e)}function Rv(e,t){Gh(t),e.b=e.b-1&e.a.length-1,Sh(e.a,e.b,t),L3e(e)}function aVe(e){var t=e.Gh();this.a=j(t,71)?P(t,71).Ii():t.Kc()}function oVe(e){return new cv(wqe(P(e.a.md(),16).gc(),e.a.ld()),16)}function sVe(){sVe=C,FLt=nT((Bo(),U(O(PLt,1),Z,490,0,[v3])))}function cVe(){cVe=C,LLt=nT((Vo(),U(O(ILt,1),Z,558,0,[y3])))}function lVe(){lVe=C,SRt=nT((Ho(),U(O(xRt,1),Z,539,0,[O3])))}function uVe(){return YD(),U(O(zJ,1),Z,389,0,[RJ,IJ,FJ,LJ])}function dVe(){return Sb(),U(O(mK,1),Z,304,0,[uK,dK,fK,pK])}function fVe(){return TO(),U(O(lDt,1),Z,332,0,[gq,hq,_q,vq])}function pVe(){return wO(),U(O(pDt,1),Z,406,0,[wq,Cq,Tq,Eq])}function mVe(){return KC(),U(O(sDt,1),Z,417,0,[mq,dq,fq,pq])}function hVe(){return ow(),U(O(mOt,1),Z,416,0,[kJ,MJ,AJ,jJ])}function gVe(){return aw(),U(O(KOt,1),Z,421,0,[bX,xX,SX,CX])}function _Ve(){return iw(),U(O(FOt,1),Z,371,0,[gX,mX,hX,pX])}function vVe(){return IO(),U(O(B0,1),Z,203,0,[R0,z0,L0,I0])}function yVe(){return ID(),U(O(qMt,1),Z,284,0,[Z0,KMt,Q0,$0])}function bVe(e){var t;return e.j==(nP(),m5)&&(t=krt(e),$u(t,X8))}function xVe(e,t){var n=t.a;U_(n,t.c.d),K_(n,t.d.d),vC(n.a,e.n)}function SVe(e,t){var n=P(ix(e.b,t),67);return!n&&(n=new vo),n}function zv(e){return Lo(),j(e.g,154)?P(e.g,154):null}function CVe(e){e.a=null,e.e=null,Wr(e.b.c,0),Wr(e.f.c,0),e.c=null}function Bv(){Bv=C,sQ=new Js(sL,0),cQ=new Js(`TOP_LEFT`,1)}function Vv(){Vv=C,b2=new zxe(`UPPER`,0),y2=new zxe(`LOWER`,1)}function wVe(e,t){return Ou(new k(t.e.a+t.f.a/2,t.e.b+t.f.b/2),e)}function TVe(e,t){return P(Ju(_m(P(Dy(e.k,t),15).Oc(),HX)),113)}function EVe(e,t){return P(Ju(vm(P(Dy(e.k,t),15).Oc(),HX)),113)}function DVe(){return Ok(),U(O(yPt,1),Z,405,0,[N2,P2,F2,I2])}function OVe(){return Jw(),U(O(wFt,1),Z,353,0,[_4,h4,g4,m4])}function kVe(){return uk(),U(O(CIt,1),Z,354,0,[F4,xIt,SIt,bIt])}function AVe(){return TD(),U(O(S5,1),Z,386,0,[b5,x5,y5,v5])}function jVe(){return kk(),U(O(xBt,1),Z,291,0,[S8,y8,b8,x8])}function MVe(){return wE(),U(O(p8,1),Z,223,0,[f8,u8,l8,d8])}function NVe(){return ZE(),U(O(JBt,1),Z,320,0,[F5,GBt,qBt,KBt])}function PVe(){return Mw(),U(O(eVt,1),Z,415,0,[I5,QBt,ZBt,$Bt])}function FVe(e){return R_(),km(p7,e)?P(xh(p7,e),341).Qg():null}function Hv(e,t,n){return t<0?cj(e,n):P(n,69).wk().Bk(e,e.hi(),t)}function IVe(e,t,n){var r=RD(n);return PM(e.j,r,t),Qh(e.k,t,n),t}function LVe(e,t,n){var r=RD(n);return PM(e.d,r,t),Qh(e.e,t,n),t}function RVe(e){var t=(Ia(),n=new nn,n),n;return e&&Hj(t,e),t}function zVe(e){var t=e.aj(e.i);return e.i>0&&tN(e.g,0,t,0,e.i),t}function BVe(e,t){var n;for(n=e.j.c.length;n>24}function WVe(e){if(e.p!=1)throw E(new Rr);return nm(e.k)<<24>>24}function GVe(e){if(e.p!=7)throw E(new Rr);return nm(e.k)<<16>>16}function KVe(e){if(e.p!=7)throw E(new Rr);return nm(e.f)<<16>>16}function Uv(e,t){return t.e==0||e.e==0?JG:(pM(),Xj(e,t))}function qVe(e,t){return A(t)===A(e)?`(this Map)`:t==null?IP:PE(t)}function JVe(e,t,n){return dm(N(nl(Kp(e.f,t))),N(nl(Kp(e.f,n))))}function YVe(e,t,n){var r=P(xh(e.g,n),60);M(e.a.c,new Kc(t,r))}function XVe(e,t,n){e.i=0,e.e=0,t!=n&&(zZe(e,t,n),RZe(e,t,n))}function ZVe(e,t,n,r,i){M(t,vtt(i,mat(i,n,r))),p9e(e,i,t)}function QVe(e,t,n,r,i){this.i=e,this.a=t,this.e=n,this.j=r,this.f=i}function $Ve(e,t){r_.call(this),this.a=e,this.b=t,M(this.a.b,this)}function eHe(e){this.b=new Dr,this.c=new Dr,this.d=new Dr,this.a=e}function tHe(e,t){var n=new na;return e.Gd(n),n.a+=`..`,t.Hd(n),n.a}function nHe(e,t){for(var n=t;n;)Sd(e,n.i,n.j),n=I_(n);return e}function rHe(e,t,n){var r=RD(n);return Qh(e.b,r,t),Qh(e.c,t,n),t}function Wv(e){for(var t=0;e.Ob();)e.Pb(),t=yE(t,1);return bx(t)}function Gv(e,t){Qo();var n=P(e,69).vk();return L9e(n,t),n.xl(t)}function iHe(e,t,n){if(n){var r=n.oe();e.a[t]=r(n)}else delete e.a[t]}function aHe(e,t){var n=e.q.getHours();e.q.setFullYear(t+VF),dN(e,n)}function oHe(e,t){return P(t==null?nl(Kp(e.f,null)):as(e.i,t),288)}function sHe(e,t){return e==(DA(),JJ)&&t==JJ?4:e==JJ||t==JJ?8:32}function Kv(e,t,n){return sN(e,t,n,j(t,102)&&(P(t,19).Bb&pI)!=0)}function cHe(e,t,n){return pN(e,t,n,j(t,102)&&(P(t,19).Bb&pI)!=0)}function lHe(e,t,n){return tat(e,t,n,j(t,102)&&(P(t,19).Bb&pI)!=0)}function uHe(e){e.b!=e.c&&(e.a=V(WW,FP,1,8,5,1),e.b=0,e.c=0)}function qv(e){return jd(e.a=0&&e.a[n]===t[n];n--);return n<0}function oy(e){var t;return e?new Ap(e):(t=new Rl,HS(t,e),t)}function SHe(e,t){var n,r=!1;do n=mZe(e,t),r|=n;while(n);return r}function CHe(e){e&&OKe((Si(),cG)),--oG,e&&sG!=-1&&(gCe(sG),sG=-1)}function sy(e){s7e(),cTe(this,nm(uv(lm(e,24),jI)),nm(uv(e,jI)))}function wHe(){wHe=C,DEt=nT((fO(),U(O(DK,1),Z,436,0,[EK,TK])))}function THe(){THe=C,OEt=nT((dx(),U(O(AK,1),Z,435,0,[OK,kK])))}function EHe(){EHe=C,NDt=nT((fx(),U(O(Uq,1),Z,432,0,[Vq,Hq])))}function DHe(){DHe=C,AOt=nT((dC(),U(O(kOt,1),Z,517,0,[aY,iY])))}function OHe(){OHe=C,vkt=nT((Bv(),U(O(lQ,1),Z,429,0,[sQ,cQ])))}function kHe(){kHe=C,skt=nT((px(),U(O(hZ,1),Z,428,0,[pZ,mZ])))}function AHe(){AHe=C,dkt=nT((wb(),U(O(OZ,1),Z,488,0,[DZ,EZ])))}function jHe(){jHe=C,XMt=nT((Qb(),U(O(YMt,1),Z,430,0,[e2,t2])))}function MHe(){MHe=C,RNt=nT((Vv(),U(O(LNt,1),Z,531,0,[b2,y2])))}function NHe(){NHe=C,rkt=nT((Ky(),U(O(QX,1),Z,431,0,[XX,ZX])))}function PHe(){PHe=C,OFt=nT((iv(),U(O(DFt,1),Z,433,0,[v4,EFt])))}function FHe(){FHe=C,PFt=nT((AS(),U(O(NFt,1),Z,501,0,[b4,x4])))}function IHe(){IHe=C,qNt=nT((O_(),U(O(KNt,1),Z,523,0,[w2,C2])))}function LHe(){LHe=C,YNt=nT((k_(),U(O(JNt,1),Z,522,0,[T2,E2])))}function RHe(){RHe=C,dPt=nT((Wy(),U(O(uPt,1),Z,528,0,[A2,k2])))}function zHe(){zHe=C,vPt=nT((D_(),U(O(_Pt,1),Z,465,0,[j2,M2])))}function BHe(){BHe=C,zFt=nT((_b(),U(O(RFt,1),Z,434,0,[LFt,D4])))}function VHe(){VHe=C,xLt=nT((my(),U(O(bLt,1),Z,491,0,[s3,yLt])))}function HHe(){HHe=C,kLt=nT((JC(),U(O(OLt,1),Z,492,0,[ELt,DLt])))}function UHe(){UHe=C,zLt=nT((Gy(),U(O(RLt,1),Z,438,0,[x3,b3])))}function WHe(){WHe=C,TRt=nT((cw(),U(O(wRt,1),Z,437,0,[k3,CRt])))}function GHe(){GHe=C,WBt=nT((zf(),U(O(P5,1),Z,347,0,[HBt,UBt])))}function KHe(){return GT(),U(O(a8,1),Z,88,0,[r8,n8,t8,e8,i8])}function qHe(){return nP(),U(O(_5,1),TR,64,0,[h5,Z8,X8,m5,g5])}function JHe(e,t,n){return P(t==null?XA(e.f,null,n):uE(e.i,t,n),288)}function YHe(e){return(e.k==(DA(),JJ)||e.k==GJ)&&yd(e,(Y(),bQ))}function cy(e){return e.c&&e.d?Gze(e.c)+`->`+Gze(e.d):`e_`+td(e)}function ly(e,t){var n,r;for(Gh(t),r=e.Kc();r.Ob();)n=r.Pb(),t.Cd(n)}function XHe(e,t){var n=new bi;qg(n,`x`,t.a),qg(n,`y`,t.b),Dh(e,n)}function ZHe(e,t){var n=new bi;qg(n,`x`,t.a),qg(n,`y`,t.b),Dh(e,n)}function QHe(e,t){for(var n=t;n;)Sd(e,-n.i,-n.j),n=I_(n);return e}function $He(e,t){for(var n=t,r=0;n>0;)r+=e.a[n],n-=n&-n;return r}function uy(e,t,n){var r=(ov(t,e.c.length),e.c[t]);return e.c[t]=n,r}function eUe(e,t,n){e.a.c.length=0,Tmt(e,t,n),e.a.c.length==0||Mut(e,t)}function dy(e){e.i=0,is(e.b,null),is(e.c,null),e.a=null,e.e=null,++e.g}function fy(){fy=C,_K=!0,mEt=!1,hEt=!1,_Et=!1,gEt=!1}function py(e){fy(),!_K&&(this.c=e,this.e=!0,this.a=new T)}function tUe(e,t){this.c=0,this.b=t,oCe.call(this,e,17493),this.a=this.c}function nUe(e){Cvt(),lge(this),this.a=new vo,tQe(this,e),up(this.a,e)}function rUe(){au(this),this.b=new k(cI,cI),this.a=new k(lI,lI)}function my(){my=C,s3=new sSe(YR,0),yLt=new sSe(`TARGET_WIDTH`,1)}function hy(e,t){return(lE(e),Xa(new Mp(e,new UGe(t,e.a)))).Bd(SK)}function iUe(){return vA(),U(O(CJ,1),Z,367,0,[vJ,yJ,bJ,xJ,SJ])}function aUe(){return tA(),U(O(JOt,1),Z,375,0,[TX,DX,OX,EX,wX])}function oUe(){return FD(),U(O(fZ,1),Z,348,0,[cZ,sZ,uZ,dZ,lZ])}function sUe(){return CO(),U(O(RMt,1),Z,323,0,[LMt,H0,U0,V0,W0])}function cUe(){return XE(),U(O(y$,1),Z,171,0,[v$,m$,h$,g$,_$])}function lUe(){return iA(),U(O(FFt,1),Z,368,0,[T4,S4,E4,C4,w4])}function uUe(){return Wj(),U(O(jLt,1),Z,373,0,[u3,l3,f3,d3,p3])}function dUe(){return MA(),U(O(ULt,1),Z,324,0,[BLt,S3,HLt,C3,VLt])}function fUe(){return uO(),U(O(L3,1),Z,170,0,[F3,P3,M3,I3,N3])}function pUe(){return pO(),U(O(I8,1),Z,256,0,[P8,F8,wBt,N8,TBt])}function mUe(e){return Qi(),function(){return XBe(e,this,arguments)}}function gy(e){return!e.c||!e.d?!1:!!e.c.i&&e.c.i==e.d.i}function hUe(e,t){return j(t,143)?ff(e.c,P(t,143).c):!1}function _y(e){return e.t||(e.t=new Bhe(e),WT(new K_e(e),0,e.t)),e.t}function gUe(e){this.b=e,Lu.call(this,e),this.a=P(NC(this.b.a,4),129)}function _Ue(e){this.b=e,ld.call(this,e),this.a=P(NC(this.b.a,4),129)}function vy(e,t,n,r,i){KUe.call(this,t,r,i),this.c=e,this.b=n}function vUe(e,t,n,r,i){eBe.call(this,t,r,i),this.c=e,this.a=n}function yUe(e,t,n,r,i){tBe.call(this,t,r,i),this.c=e,this.a=n}function bUe(e,t,n,r,i){KUe.call(this,t,r,i),this.c=e,this.a=n}function yy(e,t){return P(ix(e.d,t),23)||P(ix(e.e,t),23)}function xUe(e,t){var n=t.ld(),r=e.Fe(n);return!!r&&rg(r.e,t.md())}function SUe(e,t){var n=t.ld();return new oo(n,e.e.pc(n,P(t.md(),16)))}function CUe(e,t){return e.a.get(t)??V(WW,FP,1,0,5,1)}function wUe(e){var t=e.length;return ff(fI.substr(fI.length-t,t),e)}function by(e){if(Cj(e))return e.c=e.a,e.a.Pb();throw E(new Hr)}function TUe(e,t){return t==0||e.e==0?e:t>0?Cst(e,t):F0e(e,-t)}function xy(e,t){return t==0||e.e==0?e:t>0?F0e(e,t):Cst(e,-t)}function EUe(e){txe.call(this,e==null?IP:PE(e),j(e,82)?P(e,82):null)}function DUe(e){var t;return e.c||(t=e.r,j(t,90)&&(e.c=P(t,29))),e.c}function Sy(e){var t=new i_;return VC(t,e),W(t,(mP(),j1),null),t}function OUe(e){var t=e.c.i,n=e.d.i;return t.k==(DA(),GJ)&&n.k==GJ}function Cy(e){return vu(e&QF,e>>22&QF,e<0?$F:0)}function kUe(e){var t,n,r,i;for(n=e,r=0,i=n.length;r=0?e.Lh(r,n,!0):mj(e,t,n)}function jUe(e,t,n){return aE(Ou(cO(e),xu(t.b)),Ou(cO(e),xu(n.b)))}function MUe(e,t,n){return aE(Ou(cO(e),xu(t.e)),Ou(cO(e),xu(n.e)))}function NUe(e,t){return r.Math.min(ab(t.a,e.d.d.c),ab(t.b,e.d.d.c))}function Ty(e,t){e._i(e.i+1),Au(e,e.i,e.Zi(e.i,t)),e.Mi(e.i++,t),e.Ni()}function Ey(e){var t,n;++e.j,t=e.g,n=e.i,e.g=null,e.i=0,e.Oi(n,t),e.Ni()}function PUe(e,t,n){var r=new Rwe(e.a);mC(r,e.a.a),XA(r.f,t,n),e.a.a=r}function FUe(e,t,n,r){var i;for(i=0;it)throw E(new Mi(ptt(e,t,`index`)));return e}function Ay(e,t){var n=(ov(t,e.c.length),e.c[t]);return wye(e.c,t,1),n}function zUe(e,t){var n=(Gh(e),e),r=(Gh(t),t);return n==r?0:nt.p?-1:0}function tWe(e){var t;return e.a||(t=e.r,j(t,156)&&(e.a=P(t,156))),e.a}function nWe(e,t,n){var r;return++e.e,--e.f,r=P(e.d[t].gd(n),136),r.md()}function rWe(e){var t=e.ld();return qf(P(e.md(),16).Nc(),new cde(t))}function iWe(e,t){return km(e.a,t)?(My(e.a,t),!0):!1}function Iy(e,t,n){return Tv(t,e.e.Rd().gc()),Tv(n,e.c.Rd().gc()),e.a[t][n]}function Ly(e,t,n){this.a=e,this.b=t,this.c=n,M(e.t,this),M(t.i,this)}function Ry(e,t,n,r){this.f=e,this.e=t,this.d=n,this.b=r,this.c=r?r.d:null}function zy(){this.b=new vo,this.a=new vo,this.b=new vo,this.a=new vo}function By(){By=C;var e,t;u9=(Ra(),t=new Ur,t),d9=(e=new oi,e)}function aWe(e){var t;return lE(e),t=new Mje(e,e.a.e,e.a.d|4),new fDe(e,t)}function oWe(e){var t;for(Hh(e),t=0;e.a.Bd(new Be);)t=yE(t,1);return t}function Vy(e,t){return Gh(t),e.c=0,`Initial capacity must not be negative`)}function Uy(){Uy=C,G3=new yr(`org.eclipse.elk.labels.labelManager`)}function sWe(){sWe=C,fX=new Wd(`separateLayerConnections`,(iw(),gX))}function Wy(){Wy=C,A2=new nSe(`REGULAR`,0),k2=new nSe(`CRITICAL`,1)}function Gy(){Gy=C,x3=new lSe(`FIXED`,0),b3=new lSe(`CENTER_NODE`,1)}function Ky(){Ky=C,XX=new Lxe(`QUADRATIC`,0),ZX=new Lxe(`SCANLINE`,1)}function cWe(){cWe=C,ikt=nT((bS(),U(O(nZ,1),Z,322,0,[eZ,$X,tZ])))}function lWe(){lWe=C,akt=nT((lS(),U(O(oZ,1),Z,351,0,[rZ,aZ,iZ])))}function uWe(){uWe=C,ekt=nT((kS(),U(O(MX,1),Z,372,0,[jX,AX,kX])))}function dWe(){dWe=C,lkt=nT((_w(),U(O(ckt,1),Z,460,0,[_Z,gZ,vZ])))}function fWe(){fWe=C,hkt=nT((qC(),U(O(rQ,1),Z,299,0,[tQ,nQ,eQ])))}function pWe(){pWe=C,_kt=nT((Zb(),U(O(gkt,1),Z,311,0,[aQ,oQ,iQ])))}function mWe(){mWe=C,FMt=nT((hT(),U(O(PMt,1),Z,390,0,[P0,NMt,F0])))}function hWe(){hWe=C,nNt=nT((CC(),U(O(tNt,1),Z,387,0,[$Mt,a2,eNt])))}function gWe(){gWe=C,iNt=nT((Nw(),U(O(rNt,1),Z,349,0,[c2,o2,s2])))}function _We(){_We=C,QMt=nT((uS(),U(O(ZMt,1),Z,463,0,[i2,n2,r2])))}function vWe(){vWe=C,sNt=nT((Xw(),U(O(oNt,1),Z,350,0,[l2,aNt,u2])))}function yWe(){yWe=C,dNt=nT((cS(),U(O(uNt,1),Z,352,0,[lNt,d2,cNt])))}function bWe(){bWe=C,pNt=nT((sw(),U(O(fNt,1),Z,388,0,[p2,m2,f2])))}function xWe(){xWe=C,IPt=nT((Pw(),U(O(FPt,1),Z,392,0,[PPt,B2,z2])))}function SWe(){SWe=C,UFt=nT((Yw(),U(O(HFt,1),Z,393,0,[O4,BFt,VFt])))}function CWe(){CWe=C,OIt=nT((SC(),U(O(DIt,1),Z,300,0,[I4,EIt,TIt])))}function wWe(){wWe=C,AIt=nT((ED(),U(O(kIt,1),Z,445,0,[L4,R4,z4])))}function TWe(){TWe=C,MIt=nT((LO(),U(O(jIt,1),Z,456,0,[B4,H4,V4])))}function EWe(){EWe=C,RIt=nT((TE(),U(O(LIt,1),Z,394,0,[IIt,Q4,FIt])))}function DWe(){DWe=C,TLt=nT((Tb(),U(O(wLt,1),Z,439,0,[c3,CLt,SLt])))}function OWe(){OWe=C,jNt=nT((sS(),U(O(ANt,1),Z,464,0,[h2,g2,_2])))}function kWe(){kWe=C,PEt=nT((Cb(),U(O(NEt,1),Z,471,0,[rq,nq,iq])))}function AWe(){AWe=C,MEt=nT((Ix(),U(O($K,1),Z,237,0,[XK,ZK,QK])))}function jWe(){jWe=C,LEt=nT((Xb(),U(O(IEt,1),Z,472,0,[sq,oq,aq])))}function MWe(){MWe=C,vEt=nT((Zw(),U(O(xK,1),Z,108,0,[vK,yK,bK])))}function NWe(){NWe=C,aOt=nT((Yb(),U(O(_J,1),Z,391,0,[hJ,mJ,gJ])))}function PWe(){PWe=C,bBt=nT((_T(),U(O(yBt,1),Z,346,0,[_8,g8,v8])))}function FWe(){FWe=C,NLt=nT((KT(),U(O(_3,1),Z,444,0,[m3,h3,g3])))}function IWe(){IWe=C,iBt=nT((Lx(),U(O(rBt,1),Z,278,0,[o8,s8,c8])))}function LWe(){LWe=C,VBt=nT((gT(),U(O(BBt,1),Z,280,0,[zBt,M5,N5])))}function qy(e,t){return!e.o&&(e.o=new lb((lP(),Z5),n7,e,0)),uD(e.o,t)}function RWe(e,t){var n;e.C&&(n=P(ig(e.b,t),127).n,n.d=e.C.d,n.a=e.C.a)}function zWe(e){var t,n,r,i=e.d;t=e.a,n=e.b,r=e.c,e.d=n,e.a=r,e.b=i,e.c=t}function BWe(e){return!e.g&&(e.g=new on),!e.g.b&&(e.g.b=new Ihe(e)),e.g.b}function Jy(e){return!e.g&&(e.g=new on),!e.g.c&&(e.g.c=new zhe(e)),e.g.c}function VWe(e){return!e.g&&(e.g=new on),!e.g.d&&(e.g.d=new Lhe(e)),e.g.d}function HWe(e){return!e.g&&(e.g=new on),!e.g.a&&(e.g.a=new Rhe(e)),e.g.a}function UWe(e,t,n,r){return n&&(r=n.Rh(t,eD(n.Dh(),e.c.uk()),null,r)),r}function WWe(e,t,n,r){return n&&(r=n.Th(t,eD(n.Dh(),e.c.uk()),null,r)),r}function Yy(e,t,n,r){var i=V(q9,HF,28,t+1,15,1);return Gdt(i,e,t,n,r),i}function V(e,t,n,r,i,a){var o=b3e(i,r);return i!=10&&U(O(e,a),t,n,i,o),o}function GWe(e,t,n){var r,i=new WC(t,e);for(r=0;rn||t=0?e.Lh(n,!0,!0):mj(e,t,!0)}function gGe(e,t,n){var r=kZe(e,t,n);return e.b=new VS(r.c.length),Xst(e,r)}function _Ge(e){if(e.b<=0)throw E(new Hr);return--e.b,e.a-=e.c.c,G(e.a)}function vGe(e){var t;if(!e.a)throw E(new fIe);return t=e.a,e.a=I_(e.a),t}function yGe(e){for(;!e.a;)if(!DOe(e.c,new Ufe(e)))return!1;return!0}function hb(e){var t;return ph(e),j(e,204)?(t=P(e,204),t):new gde(e)}function bGe(e){gb(),P(e.of((vP(),z6)),181).Fc((rj(),K8)),e.qf(R6,null)}function gb(){gb=C,jRt=new Hoe,NRt=new Uoe,MRt=oQe((vP(),R6),jRt,D6,NRt)}function _b(){_b=C,LFt=new oSe(`LEAF_NUMBER`,0),D4=new oSe(`NODE_SIZE`,1)}function vb(e){e.a=V(q9,HF,28,e.b+1,15,1),e.c=V(q9,HF,28,e.b,15,1),e.d=0}function xGe(e,t){e.a.Ne(t.d,e.b)>0&&(M(e.c,new Pje(t.c,t.d,e.d)),e.b=t.d)}function SGe(e,t){if(e.g==null||t>=e.i)throw E(new wl(t,e.i));return e.g[t]}function CGe(e,t,n){if(Aw(e,n),n!=null&&!e.fk(n))throw E(new Ir);return n}function yb(e,t){return lx(t)!=10&&U($w(t),t.Sm,t.__elementTypeId$,lx(t),e),e}function bb(e,t,n,r){var i;r=(Bg(),r||nK),i=e.slice(t,n),mtt(i,e,t,n,-t,r)}function xb(e,t,n,r,i){return t<0?mj(e,n,r):P(n,69).wk().yk(e,e.hi(),t,r,i)}function wGe(e,t){return aE(D(N(K(e,(Y(),$Q)))),D(N(K(t,$Q))))}function TGe(){TGe=C,dEt=nT((Sb(),U(O(mK,1),Z,304,0,[uK,dK,fK,pK])))}function Sb(){Sb=C,uK=new ls(`All`,0),dK=new WCe,fK=new Owe,pK=new UCe}function Cb(){Cb=C,rq=new hs(cL,0),nq=new hs(sL,1),iq=new hs(lL,2)}function EGe(){EGe=C,_N(),VHt=cI,BHt=lI,UHt=new Rn(cI),HHt=new Rn(lI)}function DGe(){DGe=C,cDt=nT((KC(),U(O(sDt,1),Z,417,0,[mq,dq,fq,pq])))}function OGe(){OGe=C,mDt=nT((wO(),U(O(pDt,1),Z,406,0,[wq,Cq,Tq,Eq])))}function kGe(){kGe=C,uDt=nT((TO(),U(O(lDt,1),Z,332,0,[gq,hq,_q,vq])))}function AGe(){AGe=C,xOt=nT((YD(),U(O(zJ,1),Z,389,0,[RJ,IJ,FJ,LJ])))}function jGe(){jGe=C,hOt=nT((ow(),U(O(mOt,1),Z,416,0,[kJ,MJ,AJ,jJ])))}function MGe(){MGe=C,qOt=nT((aw(),U(O(KOt,1),Z,421,0,[bX,xX,SX,CX])))}function NGe(){NGe=C,IOt=nT((iw(),U(O(FOt,1),Z,371,0,[gX,mX,hX,pX])))}function PGe(){PGe=C,IMt=nT((IO(),U(O(B0,1),Z,203,0,[R0,z0,L0,I0])))}function FGe(){FGe=C,JMt=nT((ID(),U(O(qMt,1),Z,284,0,[Z0,KMt,Q0,$0])))}function wb(){wb=C,DZ=new Hs(wR,0),EZ=new Hs(`IMPROVE_STRAIGHTNESS`,1)}function IGe(e,t){var n,r=t/e.c.Rd().gc()|0;return n=t%e.c.Rd().gc(),Iy(e,r,n)}function LGe(e){var t;if(e.nl())for(t=e.i-1;t>=0;--t)H(e,t);return zVe(e)}function RGe(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[0];)n=t;return n}function zGe(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[1];)n=t;return n}function BGe(e){return j(e,180)?``+P(e,180).a:e==null?null:PE(e)}function VGe(e){return j(e,180)?``+P(e,180).a:e==null?null:PE(e)}function HGe(e,t){if(t.a)throw E(new yi(xyt));Lm(e.a,t),t.a=e,!e.j&&(e.j=t)}function UGe(e,t){vl.call(this,t.zd(),t.yd()&-16449),Gh(e),this.a=e,this.c=t}function WGe(e,t){return new Vf(t,Sd(xu(t.e),t.f.a+e,t.f.b+e),(rd(),!1))}function GGe(e,t){return Rf(),M(e,new Kc(t,G(t.e.c.length+t.g.c.length)))}function KGe(e,t){return Rf(),M(e,new Kc(t,G(t.e.c.length+t.g.c.length)))}function qGe(){qGe=C,wIt=nT((uk(),U(O(CIt,1),Z,354,0,[F4,xIt,SIt,bIt])))}function JGe(){JGe=C,TFt=nT((Jw(),U(O(wFt,1),Z,353,0,[_4,h4,g4,m4])))}function YGe(){YGe=C,bPt=nT((Ok(),U(O(yPt,1),Z,405,0,[N2,P2,F2,I2])))}function XGe(){XGe=C,aBt=nT((wE(),U(O(p8,1),Z,223,0,[f8,u8,l8,d8])))}function ZGe(){ZGe=C,SBt=nT((kk(),U(O(xBt,1),Z,291,0,[S8,y8,b8,x8])))}function QGe(){QGe=C,IBt=nT((TD(),U(O(S5,1),Z,386,0,[b5,x5,y5,v5])))}function $Ge(){$Ge=C,YBt=nT((ZE(),U(O(JBt,1),Z,320,0,[F5,GBt,qBt,KBt])))}function eKe(){eKe=C,tVt=nT((Mw(),U(O(eVt,1),Z,415,0,[I5,QBt,ZBt,$Bt])))}function Tb(){Tb=C,c3=new Cc(_xt,0),CLt=new Cc(vV,1),SLt=new Cc(wR,2)}function Eb(e,t,n,r,i){return Gh(e),Gh(t),Gh(n),Gh(r),Gh(i),new Vm(e,t,r)}function tKe(e,t){var n=P(My(e.e,t),400);return n?(pMe(n),n.e):null}function Db(e,t){var n=Ab(e,t,0);return n!=-1&&(Ay(e,n),!0)}function nKe(e,t,n){var r;return Hh(e),r=new Re,r.a=t,e.a.Nb(new uxe(r,n)),r.a}function rKe(e){var t;return Hh(e),t=V(Z9,hI,28,0,15,1),Qa(e.a,new Bfe(t)),t}function Ob(e){var t;if(!DS(e))throw E(new Hr);return e.e=1,t=e.d,e.d=null,t}function kb(e){var t;return Il(e)&&(t=0-e,!isNaN(t))?t:MC(mw(e))}function Ab(e,t,n){for(;n=0?jO(e,n,!0,!0):mj(e,t,!0)}function qb(e){var t=rS(NC(e,32));return t??=(WD(e),rS(NC(e,32))),t}function Jb(e){var t;return e.Oh()||(t=bh(e.Dh())-e.ji(),e.$h().Mk(t)),e.zh()}function fKe(e,t){bq=new Mt,fDt=t,yq=e,P(yq.b,68),ZWe(yq,bq,null),Jpt(yq)}function Yb(){Yb=C,hJ=new Cs(`XY`,0),mJ=new Cs(`X`,1),gJ=new Cs(`Y`,2)}function Xb(){Xb=C,sq=new gs(`TOP`,0),oq=new gs(sL,1),aq=new gs(Lyt,2)}function Zb(){Zb=C,aQ=new qs(wR,0),oQ=new qs(`TOP`,1),iQ=new qs(Lyt,2)}function Qb(){Qb=C,e2=new nc(`INPUT_ORDER`,0),t2=new nc(`PORT_DEGREE`,1)}function $b(){$b=C,hG=vu(QF,QF,524287),BTt=vu(0,0,eI),gG=Cy(1),Cy(2),_G=Cy(0)}function ex(e){var t;return e.d!=e.r&&(t=Ik(e),e.e=!!t&&t.lk()==xwt,e.d=t),e.e}function tx(e,t,n){var r=e.g[t];return Au(e,t,e.Zi(t,n)),e.Ri(t,n,r),e.Ni(),r}function nx(e,t){var n=e.dd(t);return n>=0&&(e.gd(n),!0)}function rx(e,t){var n;for(ph(e),ph(t),n=!1;t.Ob();)n|=e.Fc(t.Pb());return n}function ix(e,t){var n=P(xh(e.e,t),400);return n?(Ywe(e,n),n.e):null}function pKe(e){var t=e/60|0,n=e%60;return n==0?``+t:``+t+`:`+(``+n)}function ax(e,t){var n=e.a[t],r=(vw(),pG)[typeof n];return r?r(n):XQe(typeof n)}function ox(e,t){var n,r;return lE(e),r=new WUe(t,e.a),n=new zOe(r),new Mp(e,n)}function sx(e){var t=e.b.c.length==0?null:Ep(e.b,0);return t!=null&&LS(e,0),t}function mKe(e,t){var n,r,i=t.c.i;n=P(xh(e.f,i),60),r=n.d.c-n.e.c,eC(t.a,r,0)}function cx(e,t){var n;for(++e.d,++e.c[t],n=t+1;n{(function(t){if(typeof e==`object`&&n!==void 0)n.exports=t();else if(typeof define==`function`&&define.amd)define([],t);else{var r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this;r.ELK=t()}})(function(){return(function(){function e(n,r,i){function a(s,c){if(!r[s]){if(!n[s]){var l=typeof t==`function`&&t;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=r[s]={exports:{}};n[s][0].call(d.exports,function(e){var t=n[s][1][e];return a(t||e)},d,d.exports,e,n,r,i)}return r[s].exports}for(var o=typeof t==`function`&&t,s=0;s0&&arguments[0]!==void 0?arguments[0]:{},r=n.defaultLayoutOptions,o=r===void 0?{}:r,s=n.algorithms,c=s===void 0?[`layered`,`stress`,`mrtree`,`radial`,`force`,`disco`,`sporeOverlap`,`sporeCompaction`,`rectpacking`]:s,l=n.workerFactory,u=n.workerUrl;if(i(this,e),this.defaultLayoutOptions=o,this.initialized=!1,u===void 0&&l===void 0)throw Error(`Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.`);var d=l;u!==void 0&&l===void 0&&(d=function(e){return new Worker(e)});var f=d(u);if(typeof f.postMessage!=`function`)throw TypeError(`Created worker does not provide the required 'postMessage' function.`);this.worker=new a(f),this.worker.postMessage({cmd:`register`,algorithms:c}).then(function(e){return t.initialized=!0}).catch(console.err)}return r(e,[{key:`layout`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.layoutOptions,r=n===void 0?this.defaultLayoutOptions:n,i=t.logging,a=i!==void 0&&i,o=t.measureExecutionTime,s=o!==void 0&&o;return e?this.worker.postMessage({cmd:`layout`,graph:e,layoutOptions:r,options:{logging:a,measureExecutionTime:s}}):Promise.reject(Error(`Missing mandatory parameter 'graph'.`))}},{key:`knownLayoutAlgorithms`,value:function(){return this.worker.postMessage({cmd:`algorithms`})}},{key:`knownLayoutOptions`,value:function(){return this.worker.postMessage({cmd:`options`})}},{key:`knownLayoutCategories`,value:function(){return this.worker.postMessage({cmd:`categories`})}},{key:`terminateWorker`,value:function(){this.worker&&this.worker.terminate()}}]),e}();var a=function(){function e(t){var n=this;if(i(this,e),t===void 0)throw Error(`Missing mandatory parameter 'worker'.`);this.resolvers={},this.worker=t,this.worker.onmessage=function(e){setTimeout(function(){n.receive(n,e)},0)}}return r(e,[{key:`postMessage`,value:function(e){var t=this.id||0;this.id=t+1,e.id=t;var n=this;return new Promise(function(r,i){n.resolvers[t]=function(e,t){e?(n.convertGwtStyleError(e),i(e)):r(t)},n.worker.postMessage(e)})}},{key:`receive`,value:function(e,t){var n=t.data,r=e.resolvers[n.id];r&&(delete e.resolvers[n.id],n.error?r(n.error):r(null,n.data))}},{key:`terminate`,value:function(){this.worker&&this.worker.terminate()}},{key:`convertGwtStyleError`,value:function(e){if(e){var t=e.__java$exception;t&&(t.cause&&t.cause.backingJsObject&&(e.cause=t.cause.backingJsObject,this.convertGwtStyleError(e.cause)),delete e.__java$exception)}}}]),e}()},{}],2:[function(e,t,n){(function(e){(function(){var r;typeof window<`u`?r=window:e===void 0?typeof self<`u`&&(r=self):r=e;var i;function a(){}function o(){}function s(){}function c(){}function l(){}function u(){}function d(){}function f(){}function p(){}function m(){}function h(){}function g(){}function _(){}function v(){}function y(){}function b(){}function x(){}function S(){}function ee(){}function te(){}function ne(){}function C(){}function re(){}function ie(){}function ae(){}function oe(){}function se(){}function ce(){}function le(){}function ue(){}function de(){}function fe(){}function pe(){}function me(){}function he(){}function ge(){}function _e(){}function ve(){}function ye(){}function be(){}function xe(){}function Se(){}function Ce(){}function we(){}function Te(){}function Ee(){}function De(){}function Oe(){}function ke(){}function Ae(){}function je(){}function Me(){}function Ne(){}function Pe(){}function Fe(){}function Ie(){}function Le(){}function Re(){}function ze(){}function Be(){}function Ve(){}function He(){}function Ue(){}function We(){}function Ge(){}function Ke(){}function qe(){}function Je(){}function Ye(){}function Xe(){}function Ze(){}function Qe(){}function $e(){}function et(){}function tt(){}function nt(){}function rt(){}function it(){}function at(){}function ot(){}function st(){}function ct(){}function lt(){}function ut(){}function dt(){}function ft(){}function pt(){}function mt(){}function ht(){}function gt(){}function _t(){}function vt(){}function yt(){}function bt(){}function xt(){}function St(){}function Ct(){}function wt(){}function Tt(){}function Et(){}function Dt(){}function Ot(){}function kt(){}function At(){}function jt(){}function Mt(){}function Nt(){}function Pt(){}function Ft(){}function It(){}function Lt(){}function Rt(){}function zt(){}function Bt(){}function eee(){}function Vt(){}function tee(){}function nee(){}function Ht(){}function ree(){}function iee(){}function aee(){}function oee(){}function see(){}function cee(){}function lee(){}function uee(){}function dee(){}function fee(){}function pee(){}function mee(){}function hee(){}function Ut(){}function gee(){}function _ee(){}function vee(){}function yee(){}function bee(){}function xee(){}function See(){}function Cee(){}function wee(){}function Wt(){}function Gt(){}function Tee(){}function Eee(){}function Dee(){}function Oee(){}function kee(){}function Aee(){}function jee(){}function Mee(){}function Nee(){}function Pee(){}function Fee(){}function Iee(){}function Lee(){}function Ree(){}function zee(){}function Bee(){}function Vee(){}function Hee(){}function Uee(){}function Wee(){}function Gee(){}function Kee(){}function qee(){}function Jee(){}function Yee(){}function Xee(){}function Zee(){}function Qee(){}function $ee(){}function ete(){}function tte(){}function nte(){}function rte(){}function ite(){}function ate(){}function ote(){}function ste(){}function cte(){}function lte(){}function ute(){}function dte(){}function fte(){}function pte(){}function mte(){}function hte(){}function gte(){}function _te(){}function vte(){}function yte(){}function bte(){}function xte(){}function Ste(){}function Cte(){}function wte(){}function Tte(){}function Ete(){}function Dte(){}function Ote(){}function kte(){}function Ate(){}function jte(){}function Mte(){}function Nte(){}function Pte(){}function Fte(){}function Ite(){}function Lte(){}function Rte(){}function zte(){}function Bte(){}function Vte(){}function Hte(){}function Ute(){}function Wte(){}function Gte(){}function Kte(){}function qte(){}function Jte(){}function Yte(){}function Xte(){}function Zte(){}function Qte(){}function $te(){}function ene(){}function tne(){}function nne(){}function rne(){}function ine(){}function ane(){}function one(){}function sne(){}function cne(){}function lne(){}function une(){}function dne(){}function fne(){}function pne(){}function mne(){}function hne(){}function gne(){}function Kt(){}function _ne(){}function vne(){}function yne(){}function bne(){}function xne(){}function Sne(){}function Cne(){}function wne(){}function Tne(){}function Ene(){}function Dne(){}function One(){}function kne(){}function Ane(){}function jne(){}function Mne(){}function Nne(){}function Pne(){}function Fne(){}function Ine(){}function Lne(){}function Rne(){}function zne(){}function Bne(){}function Vne(){}function Hne(){}function Une(){}function Wne(){}function Gne(){}function Kne(){}function qne(){}function Jne(){}function Yne(){}function Xne(){}function Zne(){}function Qne(){}function $ne(){}function ere(){}function tre(){}function nre(){}function rre(){}function ire(){}function are(){}function ore(){}function sre(){}function cre(){}function lre(){}function ure(){}function dre(){}function fre(){}function pre(){}function mre(){}function hre(){}function gre(){}function _re(){}function vre(){}function yre(){}function bre(){}function xre(){}function Sre(){}function Cre(){}function wre(){}function Tre(){}function Ere(){}function Dre(){}function Ore(){}function kre(){}function Are(){}function jre(){}function Mre(){}function Nre(){}function Pre(){}function Fre(){}function qt(){}function Ire(){}function Lre(){}function Rre(){}function zre(){}function Bre(){}function Vre(){}function Hre(){}function Ure(){}function Wre(){}function Gre(){}function Kre(){}function qre(){}function Jre(){}function Yre(){}function Xre(){}function Zre(){}function Qre(){}function $re(){}function eie(){}function tie(){}function nie(){}function rie(){}function iie(){}function aie(){}function oie(){}function sie(){}function cie(){}function lie(){}function uie(){}function die(){}function fie(){}function pie(){}function mie(){}function hie(){}function gie(){}function _ie(){}function vie(){}function yie(){}function bie(){}function xie(){}function Sie(){}function Cie(){}function wie(){}function Tie(){}function Eie(){}function Die(){}function Oie(){}function kie(){}function Aie(){}function jie(){}function Mie(){}function Nie(){}function Pie(){}function Fie(){}function Iie(){}function Lie(){}function Rie(){}function zie(){}function Bie(){}function Vie(){}function Hie(){}function Uie(){}function Wie(){}function Gie(){}function Kie(){}function qie(){}function Jie(){}function Yie(){}function Xie(){}function Zie(){}function Qie(){}function $ie(){}function eae(){}function tae(){}function nae(){}function rae(){}function iae(){}function aae(){}function oae(){}function sae(){}function cae(){}function lae(){}function uae(){}function dae(){}function fae(){}function pae(){}function mae(){}function hae(){}function gae(){}function _ae(){}function vae(){}function yae(){}function bae(){}function xae(){}function Sae(){}function Cae(){}function wae(){}function Tae(){}function Eae(){}function Dae(){}function Oae(){}function kae(){}function Aae(){}function jae(){}function Mae(){}function Nae(){}function Pae(){}function Fae(){}function Iae(){}function Lae(){}function Rae(){}function zae(){}function Bae(){}function Vae(){}function Hae(){}function Uae(){}function Wae(){}function Gae(){}function Kae(){}function qae(){}function Jae(){}function Yae(){}function Xae(){}function Zae(){}function Qae(){}function $ae(){}function eoe(){}function toe(){}function noe(){}function roe(){}function ioe(){}function aoe(){}function ooe(){}function soe(){}function coe(){}function loe(){}function uoe(){}function doe(){}function foe(){}function poe(){}function moe(){}function hoe(){}function goe(){}function _oe(){}function voe(){}function yoe(){}function boe(){}function xoe(){}function Jt(){}function Yt(){}function Soe(){}function Xt(){}function Coe(){}function woe(){}function Toe(){}function Eoe(){}function Doe(){}function Ooe(){}function koe(){}function Aoe(){}function joe(){}function Moe(){}function Noe(){}function Poe(){}function Foe(){}function Ioe(){}function Loe(){}function Roe(){}function zoe(){}function Boe(){}function Voe(){}function Hoe(){}function Uoe(){}function Woe(){}function Zt(){}function Goe(){}function Qt(){}function Koe(){}function qoe(){}function Joe(){}function Yoe(){}function Xoe(){}function Zoe(){}function Qoe(){}function $oe(){}function ese(){}function tse(){}function nse(){}function rse(){}function ise(){}function ase(){}function ose(){}function sse(){}function cse(){}function lse(){}function use(){}function dse(){}function $t(){}function fse(){}function pse(){}function mse(){}function hse(){}function gse(){}function _se(){}function vse(){}function yse(){}function bse(){}function xse(){}function Sse(){}function Cse(){}function wse(){}function en(){}function Tse(){}function Ese(){}function Dse(){}function tn(){}function Ose(){}function nn(){}function rn(){}function kse(){}function Ase(){}function jse(){}function Mse(){}function Nse(){}function Pse(){}function Fse(){}function Ise(){}function an(){}function Lse(){}function Rse(){}function on(){}function zse(){}function sn(){}function Bse(){}function Vse(){}function Hse(){}function cn(){}function Use(){}function Wse(){}function Gse(){}function Kse(){}function qse(){}function Jse(){}function Yse(){}function Xse(){}function Zse(){}function Qse(){}function $se(){}function ece(){}function tce(){}function nce(){}function rce(){}function ice(){}function ln(){}function un(){}function ace(){}function oce(){}function sce(){}function cce(){}function lce(){}function uce(){}function dce(){}function fce(){}function pce(){}function mce(){}function hce(){}function gce(){}function _ce(){}function vce(){}function yce(){}function bce(){}function xce(){}function Sce(){}function Cce(){}function wce(){}function Tce(){}function Ece(){}function Dce(){}function Oce(){}function kce(){}function Ace(){}function jce(){}function Mce(){}function Nce(){}function Pce(){}function Fce(){}function Ice(){}function Lce(){}function Rce(){}function zce(){}function Bce(){}function Vce(){}function Hce(){}function Uce(){}function Wce(){}function Gce(){}function Kce(){}function qce(){}function Jce(){}function Yce(){}function Xce(){}function Zce(){}function Qce(){}function $ce(){}function ele(){}function tle(){}function nle(){}function rle(){}function ile(){}function ale(){}function ole(){}function sle(){}function cle(){}function lle(){}function ule(){}function dle(){}function fle(){}function ple(){}function mle(){}function hle(){}function gle(){}function _le(){}function vle(){}function yle(){}function ble(){}function xle(){}function Sle(){}function Cle(){}function wle(){}function Tle(){}function Ele(){}function Dle(){}function Ole(){}function kle(){}function Ale(){}function jle(){}function Mle(){}function Nle(){}function Ple(){}function Fle(){}function Ile(){}function Lle(){}function Rle(){}function zle(){}function Ble(){}function Vle(){}function Hle(){}function Ule(){}function Wle(){}function Gle(){}function Kle(){}function qle(){}function Jle(){}function Yle(){}function Xle(){}function Zle(){}function Qle(){}function $le(){}function eue(){}function dn(){fi()}function tue(){Fo()}function nue(){Rk()}function rue(){qw()}function iue(){bO()}function aue(){I9e()}function oue(){XM()}function sue(){e6e()}function cue(){Nk()}function lue(){Io()}function uue(){Ff()}function due(){Ibe()}function fue(){cC()}function pue(){sWe()}function mue(){mJe()}function hue(){DRe()}function gue(){gJe()}function _ue(){eGe()}function vue(){TRe()}function yue(){Fw()}function bue(){vJe()}function xue(){_Je()}function Sue(){HBe()}function Cue(){yJe()}function wue(){wA()}function Tue(){Ro()}function Eue(){bP()}function Due(){mP()}function Oue(){bJe()}function kue(){kYe()}function Aue(){ORe()}function jue(){o6e()}function Mue(){kRe()}function Nue(){Aut()}function Pue(){Hrt()}function Fue(){zx()}function Iue(){Q$e()}function Lue(){rN()}function Rue(){fze()}function zue(){Rx()}function Bue(){Ylt()}function Vue(){PA()}function Hue(){Qlt()}function Uue(){gM()}function Wue(){yA()}function Gue(){bM()}function Kue(){ek()}function fn(){rke()}function que(){gb()}function Jue(){bA()}function Yue(){vP()}function Xue(){Iw()}function Zue(){wD()}function Que(){uC()}function $ue(){_N()}function ede(){Odt()}function tde(e){Gh(e)}function nde(e){this.a=e}function pn(e){this.a=e}function rde(e){this.a=e}function ide(e){this.a=e}function ade(e){this.a=e}function ode(e){this.a=e}function sde(e){this.a=e}function cde(e){this.a=e}function mn(e){this.a=e}function hn(e){this.a=e}function lde(e){this.a=e}function ude(e){this.a=e}function gn(e){this.a=e}function dde(e){this.a=e}function fde(e){this.a=e}function _n(e){this.a=e}function vn(e){this.a=e}function pde(e){this.a=e}function yn(e){this.a=e}function mde(e){this.a=e}function hde(e){this.a=e}function gde(e){this.a=e}function bn(e){this.b=e}function _de(e){this.c=e}function vde(e){this.a=e}function yde(e){this.a=e}function bde(e){this.a=e}function xde(e){this.a=e}function Sde(e){this.a=e}function Cde(e){this.a=e}function wde(e){this.a=e}function Tde(e){this.a=e}function Ede(e){this.a=e}function Dde(e){this.a=e}function Ode(e){this.a=e}function kde(e){this.a=e}function Ade(e){this.a=e}function xn(e){this.a=e}function Sn(e){this.a=e}function Cn(e){this.a=e}function wn(e){this.a=e}function Tn(){this.a=[]}function jde(e,t){e.a=t}function Mde(e,t){e.a=t}function Nde(e,t){e.b=t}function Pde(e,t){e.b=t}function Fde(e,t){e.b=t}function Ide(e,t){e.j=t}function Lde(e,t){e.g=t}function Rde(e,t){e.i=t}function zde(e,t){e.c=t}function Bde(e,t){e.c=t}function Vde(e,t){e.d=t}function Hde(e,t){e.d=t}function En(e,t){e.k=t}function Ude(e,t){e.c=t}function Wde(e,t){e.c=t}function Gde(e,t){e.a=t}function Kde(e,t){e.a=t}function qde(e,t){e.f=t}function Jde(e,t){e.a=t}function Yde(e,t){e.b=t}function Dn(e,t){e.d=t}function On(e,t){e.i=t}function Xde(e,t){e.o=t}function Zde(e,t){e.r=t}function Qde(e,t){e.a=t}function $de(e,t){e.b=t}function efe(e,t){e.e=t}function tfe(e,t){e.f=t}function nfe(e,t){e.g=t}function rfe(e,t){e.e=t}function ife(e,t){e.f=t}function afe(e,t){e.f=t}function kn(e,t){e.a=t}function An(e,t){e.b=t}function ofe(e,t){e.n=t}function sfe(e,t){e.a=t}function cfe(e,t){e.c=t}function lfe(e,t){e.c=t}function ufe(e,t){e.c=t}function dfe(e,t){e.a=t}function ffe(e,t){e.a=t}function pfe(e,t){e.d=t}function mfe(e,t){e.d=t}function hfe(e,t){e.e=t}function gfe(e,t){e.e=t}function _fe(e,t){e.g=t}function vfe(e,t){e.f=t}function yfe(e,t){e.j=t}function bfe(e,t){e.a=t}function xfe(e,t){e.a=t}function Sfe(e,t){e.b=t}function Cfe(e){e.b=e.a}function wfe(e){e.c=e.d.d}function jn(e){this.a=e}function Mn(e){this.a=e}function Nn(e){this.a=e}function Pn(e){this.a=e}function Fn(e){this.a=e}function In(e){this.a=e}function Tfe(e){this.a=e}function Ln(e){this.a=e}function Rn(e){this.a=e}function zn(e){this.a=e}function Bn(e){this.a=e}function Vn(e){this.a=e}function Efe(e){this.a=e}function Dfe(e){this.a=e}function Hn(e){this.b=e}function Un(e){this.b=e}function Wn(e){this.b=e}function Gn(e){this.a=e}function Ofe(e){this.a=e}function Kn(e){this.c=e}function w(e){this.c=e}function kfe(e){this.c=e}function qn(e){this.d=e}function Jn(e){this.a=e}function Yn(e){this.a=e}function Afe(e){this.a=e}function Xn(e){this.a=e}function Zn(e){this.a=e}function Qn(e){this.a=e}function $n(e){this.a=e}function er(e){this.a=e}function tr(e){this.a=e}function nr(e){this.a=e}function jfe(e){this.a=e}function Mfe(e){this.a=e}function rr(e){this.a=e}function Nfe(e){this.a=e}function Pfe(e){this.a=e}function Ffe(e){this.a=e}function Ife(e){this.a=e}function Lfe(e){this.a=e}function Rfe(e){this.a=e}function zfe(e){this.a=e}function Bfe(e){this.a=e}function Vfe(e){this.a=e}function Hfe(e){this.a=e}function Ufe(e){this.a=e}function Wfe(e){this.a=e}function Gfe(e){this.a=e}function Kfe(e){this.a=e}function qfe(e){this.a=e}function ir(e){this.a=e}function Jfe(e){this.a=e}function Yfe(e){this.a=e}function Xfe(e){this.a=e}function Zfe(e){this.a=e}function ar(e){this.a=e}function Qfe(e){this.a=e}function $fe(e){this.a=e}function or(e){this.a=e}function sr(e){this.a=e}function epe(e){this.a=e}function tpe(e){this.a=e}function npe(e){this.a=e}function rpe(e){this.a=e}function ipe(e){this.a=e}function ape(e){this.a=e}function cr(e){this.a=e}function lr(e){this.a=e}function ur(e){this.a=e}function dr(e){this.a=e}function fr(e){this.e=e}function pr(e){this.a=e}function ope(e){this.a=e}function mr(e){this.a=e}function spe(e){this.a=e}function cpe(e){this.a=e}function lpe(e){this.a=e}function upe(e){this.a=e}function dpe(e){this.a=e}function fpe(e){this.a=e}function ppe(e){this.a=e}function mpe(e){this.a=e}function hpe(e){this.a=e}function gpe(e){this.a=e}function _pe(e){this.a=e}function vpe(e){this.a=e}function ype(e){this.a=e}function bpe(e){this.a=e}function xpe(e){this.a=e}function Spe(e){this.a=e}function Cpe(e){this.a=e}function wpe(e){this.a=e}function Tpe(e){this.a=e}function Epe(e){this.a=e}function Dpe(e){this.a=e}function Ope(e){this.a=e}function kpe(e){this.a=e}function Ape(e){this.a=e}function jpe(e){this.a=e}function Mpe(e){this.a=e}function Npe(e){this.a=e}function Ppe(e){this.a=e}function Fpe(e){this.a=e}function Ipe(e){this.a=e}function Lpe(e){this.a=e}function Rpe(e){this.a=e}function zpe(e){this.a=e}function Bpe(e){this.a=e}function Vpe(e){this.a=e}function Hpe(e){this.a=e}function Upe(e){this.a=e}function Wpe(e){this.a=e}function Gpe(e){this.a=e}function Kpe(e){this.a=e}function qpe(e){this.a=e}function Jpe(e){this.a=e}function Ype(e){this.a=e}function Xpe(e){this.a=e}function Zpe(e){this.a=e}function Qpe(e){this.a=e}function $pe(e){this.a=e}function eme(e){this.a=e}function tme(e){this.a=e}function nme(e){this.a=e}function rme(e){this.a=e}function ime(e){this.c=e}function ame(e){this.b=e}function ome(e){this.a=e}function sme(e){this.a=e}function cme(e){this.a=e}function lme(e){this.a=e}function ume(e){this.a=e}function dme(e){this.a=e}function fme(e){this.a=e}function pme(e){this.a=e}function mme(e){this.a=e}function hme(e){this.a=e}function gme(e){this.a=e}function _me(e){this.a=e}function vme(e){this.a=e}function yme(e){this.a=e}function bme(e){this.a=e}function xme(e){this.a=e}function Sme(e){this.a=e}function Cme(e){this.a=e}function wme(e){this.a=e}function Tme(e){this.a=e}function Eme(e){this.a=e}function Dme(e){this.a=e}function Ome(e){this.a=e}function kme(e){this.a=e}function Ame(e){this.a=e}function jme(e){this.a=e}function Mme(e){this.a=e}function hr(e){this.a=e}function gr(e){this.a=e}function Nme(e){this.a=e}function Pme(e){this.a=e}function Fme(e){this.a=e}function Ime(e){this.a=e}function Lme(e){this.a=e}function Rme(e){this.a=e}function zme(e){this.a=e}function Bme(e){this.a=e}function Vme(e){this.a=e}function Hme(e){this.a=e}function Ume(e){this.a=e}function Wme(e){this.a=e}function Gme(e){this.a=e}function Kme(e){this.a=e}function qme(e){this.a=e}function Jme(e){this.a=e}function Yme(e){this.a=e}function Xme(e){this.a=e}function Zme(e){this.a=e}function Qme(e){this.a=e}function $me(e){this.a=e}function ehe(e){this.a=e}function the(e){this.a=e}function nhe(e){this.a=e}function rhe(e){this.a=e}function ihe(e){this.a=e}function _r(e){this.a=e}function ahe(e){this.f=e}function ohe(e){this.a=e}function she(e){this.a=e}function che(e){this.a=e}function lhe(e){this.a=e}function uhe(e){this.a=e}function dhe(e){this.a=e}function fhe(e){this.a=e}function phe(e){this.a=e}function mhe(e){this.a=e}function hhe(e){this.a=e}function ghe(e){this.a=e}function _he(e){this.a=e}function vhe(e){this.a=e}function yhe(e){this.a=e}function bhe(e){this.a=e}function xhe(e){this.a=e}function She(e){this.a=e}function Che(e){this.a=e}function whe(e){this.a=e}function The(e){this.a=e}function Ehe(e){this.a=e}function Dhe(e){this.a=e}function Ohe(e){this.a=e}function khe(e){this.a=e}function Ahe(e){this.a=e}function jhe(e){this.a=e}function Mhe(e){this.a=e}function Nhe(e){this.a=e}function vr(e){this.a=e}function Phe(e){this.a=e}function yr(e){this.b=e}function Fhe(e){this.a=e}function Ihe(e){this.a=e}function Lhe(e){this.a=e}function Rhe(e){this.a=e}function zhe(e){this.a=e}function Bhe(e){this.a=e}function Vhe(e){this.a=e}function Hhe(e){this.b=e}function Uhe(e){this.a=e}function br(e){this.a=e}function Whe(e){this.a=e}function Ghe(e){this.a=e}function Khe(e){this.c=e}function xr(e){this.e=e}function Sr(e){this.a=e}function Cr(e){this.a=e}function wr(e){this.a=e}function qhe(e){this.d=e}function Jhe(e){this.a=e}function Yhe(e){this.a=e}function Xhe(e){this.a=e}function Tr(e){this.e=e}function Er(){this.a=0}function Dr(){Pm(this)}function T(){au(this)}function Or(){_Fe(this)}function Zhe(){}function kr(){this.c=nHt}function Qhe(e,t){e.b+=t}function $he(e,t){t.Wb(e)}function ege(e){return e.a}function tge(e){return e.a}function nge(e){return e.a}function rge(e){return e.a}function ige(e){return e.a}function E(e){return e.e}function age(){return null}function oge(){return null}function sge(){La(),P_t()}function cge(e){e.b.Of(e.e)}function lge(e){e.b=new la}function Ar(e,t){e.b=t-e.b}function jr(e,t){e.a=t-e.a}function Mr(e,t){e.push(t)}function uge(e,t){e.sort(t)}function dge(e,t){t.jd(e.a)}function fge(e,t){tj(t,e)}function pge(e,t,n){e.Yd(n,t)}function Nr(e,t){e.e=t,t.b=e}function mge(e){wf(),this.a=e}function hge(e){wf(),this.a=e}function gge(e){wf(),this.a=e}function Pr(e){gh(),this.a=e}function _ge(e){Xg(),lG.le(e)}function vge(){vge=C,new Dr}function Fr(){WTe.call(this)}function yge(){WTe.call(this)}function bge(){Fr.call(this)}function Ir(){Fr.call(this)}function xge(){Fr.call(this)}function Lr(){Fr.call(this)}function Rr(){Fr.call(this)}function zr(){Fr.call(this)}function Br(){Fr.call(this)}function Vr(){Fr.call(this)}function Sge(){Fr.call(this)}function Hr(){Fr.call(this)}function Cge(){Fr.call(this)}function wge(){this.a=this}function Ur(){this.Bb|=256}function Tge(){this.b=new lCe}function Wr(e,t){e.length=t}function Gr(e,t){M(e.a,t)}function Ege(e,t){tet(e.c,t)}function Dge(e,t){Lm(e.b,t)}function Oge(e,t){JO(e.a,t)}function kge(e,t){$T(e.a,t)}function Kr(e,t){AC(e.e,t)}function qr(e){_j(e.c,e.b)}function Age(e,t){e.kc().Nb(t)}function jge(e){this.a=y1e(e)}function Jr(){this.a=new Dr}function Mge(){this.a=new Dr}function Nge(){this.a=new gbe}function Yr(){this.a=new T}function Xr(){this.a=new T}function Pge(){this.a=new T}function Zr(){this.a=new Xe}function Qr(){this.a=new qUe}function Fge(){this.a=new Vt}function Ige(){this.a=new wRe}function Lge(){this.a=new eOe}function Rge(){this.a=new T}function zge(){this.a=new T}function Bge(){this.a=new T}function Vge(){this.a=new T}function Hge(){this.d=new T}function Uge(){this.a=new Qze}function Wge(){this.a=new Jr}function Gge(){this.a=new Dr}function Kge(){this.b=new Dr}function qge(){this.b=new T}function Jge(){this.e=new T}function Yge(){this.a=new wue}function Xge(){this.d=new T}function Zge(){QIe.call(this)}function Qge(){QIe.call(this)}function $ge(){T.call(this)}function e_e(){bge.call(this)}function $r(){Yr.call(this)}function t_e(){Qd.call(this)}function n_e(){Vge.call(this)}function ei(){Zhe.call(this)}function ti(){ei.call(this)}function ni(){Zhe.call(this)}function ri(){ni.call(this)}function r_e(){b_e.call(this)}function i_e(){b_e.call(this)}function a_e(){b_e.call(this)}function o_e(){C_e.call(this)}function ii(){Ose.call(this)}function s_e(){Ose.call(this)}function ai(){vo.call(this)}function c_e(){E_e.call(this)}function l_e(){E_e.call(this)}function u_e(){Dr.call(this)}function d_e(){Dr.call(this)}function f_e(){Dr.call(this)}function oi(){EJe.call(this)}function p_e(){Jr.call(this)}function m_e(){Ur.call(this)}function si(){gTe.call(this)}function ci(){Dr.call(this)}function li(){gTe.call(this)}function ui(){Dr.call(this)}function h_e(){Dr.call(this)}function g_e(){sn.call(this)}function __e(){g_e.call(this)}function v_e(){sn.call(this)}function y_e(){Qle.call(this)}function b_e(){this.a=new Jr}function x_e(){this.a=new Dr}function S_e(){this.a=new T}function C_e(){this.a=new Dr}function di(){this.a=new vo}function w_e(){this.j=new T}function T_e(){this.a=new bye}function E_e(){this.a=new zse}function D_e(){this.a=new goe}function fi(){fi=C,GW=new o}function pi(){pi=C,XW=new k_e}function mi(){mi=C,ZW=new O_e}function O_e(){_n.call(this,``)}function k_e(){_n.call(this,``)}function A_e(e){mqe.call(this,e)}function j_e(e){mqe.call(this,e)}function M_e(e){mn.call(this,e)}function N_e(e){nbe.call(this,e)}function P_e(e){nbe.call(this,e)}function F_e(e){N_e.call(this,e)}function I_e(e){N_e.call(this,e)}function L_e(e){N_e.call(this,e)}function R_e(e){ny.call(this,e)}function z_e(e){ny.call(this,e)}function B_e(e){VOe.call(this,e)}function V_e(e){obe.call(this,e)}function hi(e){lo.call(this,e)}function gi(e){lo.call(this,e)}function H_e(e){lo.call(this,e)}function _i(e){P9e.call(this,e)}function vi(e){_i.call(this,e)}function yi(e){KNe.call(this,e)}function U_e(e){yi.call(this,e)}function bi(){wn.call(this,{})}function W_e(){W_e=C,zTt=new te}function xi(){xi=C,tG=new Vwe}function G_e(){G_e=C,iG=new a}function Si(){Si=C,cG=new v}function Ci(){Ci=C,dG=new x}function wi(e){Bu(),this.a=e}function Ti(e){lC(),this.a=e}function Ei(e){em(),this.f=e}function Di(e){em(),this.f=e}function K_e(e){nke(),this.a=e}function q_e(e){e.b=null,e.c=0}function J_e(e,t){e.e=t,Sst(e,t)}function Y_e(e,t){e.a=t,ott(e)}function Oi(e,t,n){e.a[t.g]=n}function X_e(e,t,n){y8e(n,e,t)}function Z_e(e,t){HOe(t.i,e.n)}function Q_e(e,t){ZZe(e).Cd(t)}function $_e(e,t){e.a.ec().Mc(t)}function eve(e,t){return e.g-t.g}function tve(e,t){return e*e/t}function ki(e){return Gh(e),e}function D(e){return Gh(e),e}function Ai(e){return Gh(e),e}function nve(e){return new Cn(e)}function rve(e){return new mh(e)}function ive(e){return Gh(e),e}function ave(e){return Gh(e),e}function ji(e){yi.call(this,e)}function Mi(e){yi.call(this,e)}function ove(e){yi.call(this,e)}function Ni(e){KNe.call(this,e)}function Pi(e){yi.call(this,e)}function Fi(e){yi.call(this,e)}function Ii(e){yi.call(this,e)}function sve(e){yi.call(this,e)}function Li(e){yi.call(this,e)}function Ri(e){yi.call(this,e)}function zi(e){yi.call(this,e)}function Bi(e){yi.call(this,e)}function Vi(e){yi.call(this,e)}function Hi(e){yi.call(this,e)}function Ui(e){yi.call(this,e)}function Wi(e){Gh(e),this.a=e}function Gi(e){return Tw(e),e}function Ki(e){CPe(e,e.length)}function qi(e){return e.b==e.c}function Ji(e){return!!e&&e.b}function cve(e){return!!e&&e.k}function lve(e){return!!e&&e.j}function uve(e,t,n){e.c.Ef(t,n)}function dve(e,t){e.be(t),t.ae(e)}function Yi(e){wf(),this.a=ph(e)}function Xi(){this.a=kd(ph(PP))}function fve(){throw E(new Br)}function pve(){throw E(new Br)}function Zi(){throw E(new Br)}function mve(){throw E(new Br)}function hve(){throw E(new Br)}function gve(){throw E(new Br)}function Qi(){Qi=C,Xg()}function $i(){In.call(this,``)}function ea(){In.call(this,``)}function ta(){In.call(this,``)}function na(){In.call(this,``)}function ra(e){Mi.call(this,e)}function ia(e){Mi.call(this,e)}function aa(e){Fi.call(this,e)}function oa(e){Wn.call(this,e)}function _ve(e){oa.call(this,e)}function sa(e){qu.call(this,e)}function ca(e){sEe.call(this,e,0)}function la(){URe.call(this,12,3)}function O(e,t){return _Re(e,t)}function ua(e,t){return yb(e,t)}function vve(e,t){return e.a-t.a}function yve(e,t){return e.a-t.a}function bve(e,t){return e.a-t.a}function xve(e,t){return t in e.a}function Sve(e){return e.a?e.b:0}function Cve(e){return e.a?e.b:0}function wve(e,t,n){t.Cd(e.a[n])}function Tve(e,t,n){t.Pe(e.a[n])}function Eve(e,t){e.b=new Vl(t)}function Dve(e,t){return e.b=t,e}function Ove(e,t){return e.c=t,e}function kve(e,t){return e.f=t,e}function Ave(e,t){return e.g=t,e}function da(e,t){return e.a=t,e}function fa(e,t){return e.f=t,e}function jve(e,t){return e.k=t,e}function pa(e,t){return e.a=t,e}function Mve(e,t){return e.e=t,e}function ma(e,t){return e.e=t,e}function Nve(e,t){return e.f=t,e}function Pve(e,t){e.b=!0,e.d=t}function Fve(e,t){return e.b-t.b}function Ive(e,t){return e.g-t.g}function Lve(e,t){return e?0:t-1}function Rve(e,t){return e?0:t-1}function zve(e,t){return e?t-1:0}function Bve(e,t){return e.s-t.s}function Vve(e,t){return t.rg(e)}function ha(e,t){return e.b=t,e}function ga(e,t){return e.a=t,e}function _a(e,t){return e.c=t,e}function va(e,t){return e.d=t,e}function ya(e,t){return e.e=t,e}function ba(e,t){return e.f=t,e}function xa(e,t){return e.a=t,e}function Sa(e,t){return e.b=t,e}function Ca(e,t){return e.c=t,e}function wa(e,t){return e.c=t,e}function Ta(e,t){return e.b=t,e}function Ea(e,t){return e.d=t,e}function Da(e,t){return e.e=t,e}function Hve(e,t){return e.f=t,e}function Oa(e,t){return e.g=t,e}function ka(e,t){return e.a=t,e}function Aa(e,t){return e.i=t,e}function ja(e,t){return e.j=t,e}function Uve(e,t){wA(),G_(t,e)}function Wve(e,t,n){CNe(e.a,t,n)}function Ma(e){yf.call(this,e)}function Gve(e){L1e.call(this,e)}function Kve(e){uIe.call(this,e)}function Na(e){uIe.call(this,e)}function Pa(e){kx.call(this,e)}function qve(e){Ig.call(this,e)}function Jve(e){Ig.call(this,e)}function Yve(){Dwe.call(this,``)}function Fa(){this.a=0,this.b=0}function Xve(){this.b=0,this.a=0}function Zve(e,t){e.b=0,Qx(e,t)}function Qve(e,t){return e.k=t,e}function $ve(e,t){return e.j=t,e}function eye(e,t){e.c=t,e.b=!0}function tye(){tye=C,rEt=c5e()}function Ia(){Ia=C,iVt=X6e()}function nye(){nye=C,Y5=X5e()}function La(){La=C,h7=dS()}function Ra(){Ra=C,R7=Z6e()}function rye(){rye=C,wHt=Q6e()}function za(){za=C,b9=rtt()}function Ba(e){return e.e&&e.e()}function iye(e){return e.l|e.m<<22}function aye(e,t){return e.c._b(t)}function oye(e,t){return E$e(e.b,t)}function Va(e){return e?e.d:null}function sye(e){return e?e.g:null}function cye(e){return e?e.i:null}function Ha(e){return Ad(e),e.o}function Ua(e,t){return e.a+=t,e}function Wa(e,t){return e.a+=t,e}function Ga(e,t){return e.a+=t,e}function Ka(e,t){return e.a+=t,e}function lye(e,t){for(;e.Bd(t););}function qa(e){this.a=new go(e)}function uye(){throw E(new Br)}function dye(){throw E(new Br)}function fye(){throw E(new Br)}function pye(){throw E(new Br)}function mye(){throw E(new Br)}function hye(){throw E(new Br)}function Ja(e){this.a=new mm(e)}function gye(){this.a=new Yj(NFt)}function _ye(){this.b=new Yj(yPt)}function vye(){this.a=new Yj(kIt)}function yye(){this.b=new Yj(_3)}function bye(){this.b=new Yj(_3)}function Ya(e){this.a=0,this.b=e}function xye(e){Ngt(),tvt(this,e)}function Xa(e){return Hh(e),e.a}function Za(e){return e.b!=e.d.c}function Sye(e,t){return e.d[t.p]}function Cye(e,t){return bst(e,t)}function wye(e,t,n){e.splice(t,n)}function Qa(e,t){for(;e.Re(t););}function Tye(e){e.c?gct(e):_ct(e)}function Eye(){throw E(new Br)}function Dye(){throw E(new Br)}function Oye(){throw E(new Br)}function kye(){throw E(new Br)}function Aye(){throw E(new Br)}function jye(){throw E(new Br)}function Mye(){throw E(new Br)}function Nye(){throw E(new Br)}function Pye(){throw E(new Br)}function Fye(){throw E(new Br)}function Iye(){throw E(new Hr)}function Lye(){throw E(new Hr)}function $a(e){this.a=new Rye(e)}function Rye(e){IJe(this,e,B9e())}function eo(e){return!e||mFe(e)}function to(e){return A9[e]!=-1}function zye(){oG!=0&&(oG=0),sG=-1}function Bye(){xTt??=[]}function no(e,t){zu.call(this,e,t)}function ro(e,t){no.call(this,e,t)}function Vye(e,t){this.a=e,this.b=t}function Hye(e,t){this.a=e,this.b=t}function Uye(e,t){this.a=e,this.b=t}function Wye(e,t){this.a=e,this.b=t}function Gye(e,t){this.a=e,this.b=t}function Kye(e,t){this.a=e,this.b=t}function qye(e,t){this.a=e,this.b=t}function io(e,t){this.e=e,this.d=t}function Jye(e,t){this.b=e,this.c=t}function Yye(e,t){this.b=e,this.a=t}function Xye(e,t){this.b=e,this.a=t}function Zye(e,t){this.b=e,this.a=t}function Qye(e,t){this.b=e,this.a=t}function $ye(e,t){this.a=e,this.b=t}function ao(e,t){this.a=e,this.b=t}function ebe(e,t){this.a=e,this.f=t}function oo(e,t){this.g=e,this.i=t}function so(e,t){this.f=e,this.g=t}function tbe(e,t){this.b=e,this.c=t}function nbe(e){vTe(e.dc()),this.c=e}function rbe(e,t){this.a=e,this.b=t}function ibe(e,t){this.a=e,this.b=t}function abe(e){this.a=P(ph(e),15)}function obe(e){this.a=P(ph(e),15)}function sbe(e){this.a=P(ph(e),85)}function co(e){this.b=P(ph(e),85)}function lo(e){this.b=P(ph(e),51)}function uo(){this.q=new r.Date}function fo(e,t){this.a=e,this.b=t}function cbe(e,t){return km(e.b,t)}function po(e,t){return e.b.Hc(t)}function lbe(e,t){return e.b.Ic(t)}function ube(e,t){return e.b.Qc(t)}function dbe(e,t){return e.b.Hc(t)}function fbe(e,t){return e.c.uc(t)}function pbe(e,t){return NT(e.c,t)}function mo(e,t){return e.a._b(t)}function mbe(e,t){return e>t&&t0}function rs(e,t){return dT(e,t)<0}function exe(e,t){return Gp(e.a,t)}function txe(e,t){yRe.call(this,e,t)}function nxe(e){_h(),VOe.call(this,e)}function rxe(e,t){mNe(e,e.length,t)}function is(e,t){NPe(e,e.length,t)}function as(e,t){return e.a.get(t)}function ixe(e,t){return km(e.e,t)}function os(e){return Gh(e),!1}function ss(e){this.a=P(ph(e),229)}function cs(e){cv.call(this,e,21)}function ls(e,t){so.call(this,e,t)}function us(e,t){so.call(this,e,t)}function axe(e,t){this.b=e,this.a=t}function ds(e,t){this.d=e,this.e=t}function oxe(e,t){this.a=e,this.b=t}function sxe(e,t){this.a=e,this.b=t}function cxe(e,t){this.a=e,this.b=t}function lxe(e,t){this.a=e,this.b=t}function fs(e,t){this.a=e,this.b=t}function uxe(e,t){this.b=e,this.a=t}function dxe(e,t){this.b=e,this.a=t}function fxe(e,t){so.call(this,e,t)}function pxe(e,t){so.call(this,e,t)}function ps(e,t){so.call(this,e,t)}function ms(e,t){so.call(this,e,t)}function hs(e,t){so.call(this,e,t)}function gs(e,t){so.call(this,e,t)}function _s(e,t){so.call(this,e,t)}function vs(e,t){this.b=e,this.a=t}function ys(e,t){so.call(this,e,t)}function bs(e,t){this.b=e,this.a=t}function xs(e,t){so.call(this,e,t)}function mxe(e,t){this.b=e,this.a=t}function Ss(e,t){so.call(this,e,t)}function Cs(e,t){so.call(this,e,t)}function ws(e,t){so.call(this,e,t)}function Ts(e,t,n){e.splice(t,0,n)}function hxe(e,t,n){e.Mb(n)&&t.Cd(n)}function gxe(e,t,n){t.Pe(e.a.Ye(n))}function _xe(e,t,n){t.Dd(e.a.Ze(n))}function vxe(e,t,n){t.Cd(e.a.Kb(n))}function yxe(e,t){return $u(e.c,t)}function bxe(e,t){return $u(e.e,t)}function Es(e,t){so.call(this,e,t)}function Ds(e,t){so.call(this,e,t)}function Os(e,t){so.call(this,e,t)}function xxe(e,t){so.call(this,e,t)}function ks(e,t){so.call(this,e,t)}function As(e,t){so.call(this,e,t)}function Sxe(e,t){this.a=e,this.b=t}function Cxe(e,t){this.a=e,this.b=t}function wxe(e,t){this.a=e,this.b=t}function Txe(e,t){this.a=e,this.b=t}function Exe(e,t){this.a=e,this.b=t}function Dxe(e,t){this.a=e,this.b=t}function Oxe(e,t){this.b=e,this.a=t}function kxe(e,t){this.b=e,this.a=t}function Axe(e,t){this.b=e,this.a=t}function js(e,t){this.c=e,this.d=t}function jxe(e,t){this.e=e,this.d=t}function Mxe(e,t){this.a=e,this.b=t}function Nxe(e,t){this.a=e,this.b=t}function Pxe(e,t){this.a=e,this.b=t}function Fxe(e,t){this.b=e,this.a=t}function Ixe(e,t){this.b=t,this.c=e}function Ms(e,t){so.call(this,e,t)}function Ns(e,t){so.call(this,e,t)}function Ps(e,t){so.call(this,e,t)}function Lxe(e,t){so.call(this,e,t)}function Fs(e,t){so.call(this,e,t)}function Is(e,t){so.call(this,e,t)}function Ls(e,t){so.call(this,e,t)}function Rs(e,t){so.call(this,e,t)}function zs(e,t){so.call(this,e,t)}function Bs(e,t){so.call(this,e,t)}function Vs(e,t){so.call(this,e,t)}function Hs(e,t){so.call(this,e,t)}function Us(e,t){so.call(this,e,t)}function Ws(e,t){so.call(this,e,t)}function Gs(e,t){so.call(this,e,t)}function Ks(e,t){so.call(this,e,t)}function qs(e,t){so.call(this,e,t)}function Js(e,t){so.call(this,e,t)}function Ys(e,t){so.call(this,e,t)}function Xs(e,t){so.call(this,e,t)}function Zs(e,t){so.call(this,e,t)}function Qs(e,t){so.call(this,e,t)}function $s(e,t){so.call(this,e,t)}function ec(e,t){so.call(this,e,t)}function tc(e,t){so.call(this,e,t)}function nc(e,t){so.call(this,e,t)}function rc(e,t){so.call(this,e,t)}function ic(e,t){so.call(this,e,t)}function ac(e,t){so.call(this,e,t)}function oc(e,t){so.call(this,e,t)}function sc(e,t){so.call(this,e,t)}function cc(e,t){so.call(this,e,t)}function lc(e,t){so.call(this,e,t)}function Rxe(e,t){this.b=e,this.a=t}function zxe(e,t){so.call(this,e,t)}function Bxe(e,t){this.a=e,this.b=t}function Vxe(e,t){this.a=e,this.b=t}function Hxe(e,t){this.a=e,this.b=t}function Uxe(e,t){so.call(this,e,t)}function Wxe(e,t){so.call(this,e,t)}function Gxe(e,t){this.a=e,this.b=t}function Kxe(e,t){return Rf(),t!=e}function uc(e){return jd(e.a),e.b}function dc(e){return Drt(e,e.c),e}function qxe(){return tye(),new rEt}function Jxe(){If(),this.a=new Zd}function Yxe(){rM(),this.a=new Jr}function Xxe(){B_(),this.b=new Jr}function Zxe(e,t){this.b=e,this.d=t}function Qxe(e,t){this.a=e,this.b=t}function $xe(e,t){this.a=e,this.b=t}function eSe(e,t){this.a=e,this.b=t}function tSe(e,t){this.b=e,this.a=t}function nSe(e,t){so.call(this,e,t)}function rSe(e,t){so.call(this,e,t)}function fc(e,t){so.call(this,e,t)}function pc(e,t){so.call(this,e,t)}function mc(e,t){so.call(this,e,t)}function hc(e,t){so.call(this,e,t)}function iSe(e,t){so.call(this,e,t)}function aSe(e,t){so.call(this,e,t)}function gc(e,t){so.call(this,e,t)}function oSe(e,t){so.call(this,e,t)}function _c(e,t){so.call(this,e,t)}function vc(e,t){so.call(this,e,t)}function yc(e,t){so.call(this,e,t)}function bc(e,t){so.call(this,e,t)}function xc(e,t){so.call(this,e,t)}function Sc(e,t){so.call(this,e,t)}function sSe(e,t){so.call(this,e,t)}function Cc(e,t){so.call(this,e,t)}function cSe(e,t){so.call(this,e,t)}function wc(e,t){so.call(this,e,t)}function Tc(e,t){so.call(this,e,t)}function lSe(e,t){so.call(this,e,t)}function Ec(e,t){so.call(this,e,t)}function uSe(e,t){so.call(this,e,t)}function dSe(e,t){this.b=e,this.a=t}function fSe(e,t){this.b=e,this.a=t}function pSe(e,t){this.b=e,this.a=t}function mSe(e,t){this.b=e,this.a=t}function hSe(e,t){this.a=e,this.b=t}function gSe(e,t){this.a=e,this.b=t}function _Se(e,t){this.a=e,this.b=t}function k(e,t){this.a=e,this.b=t}function Dc(e,t){so.call(this,e,t)}function Oc(e,t){so.call(this,e,t)}function kc(e,t){so.call(this,e,t)}function Ac(e,t){so.call(this,e,t)}function jc(e,t){so.call(this,e,t)}function Mc(e,t){so.call(this,e,t)}function Nc(e,t){so.call(this,e,t)}function Pc(e,t){so.call(this,e,t)}function Fc(e,t){so.call(this,e,t)}function Ic(e,t){so.call(this,e,t)}function Lc(e,t){so.call(this,e,t)}function Rc(e,t){so.call(this,e,t)}function zc(e,t){so.call(this,e,t)}function Bc(e,t){so.call(this,e,t)}function Vc(e,t){so.call(this,e,t)}function Hc(e,t){so.call(this,e,t)}function Uc(e,t){so.call(this,e,t)}function Wc(e,t){so.call(this,e,t)}function vSe(e,t){so.call(this,e,t)}function Gc(e,t){so.call(this,e,t)}function ySe(e,t){this.a=e,this.b=t}function bSe(e,t){this.a=e,this.b=t}function xSe(e,t){this.a=e,this.b=t}function SSe(e,t){this.a=e,this.b=t}function CSe(e,t){this.a=e,this.b=t}function wSe(e,t){this.a=e,this.b=t}function Kc(e,t){this.a=e,this.b=t}function TSe(e,t){this.a=e,this.b=t}function ESe(e,t){this.a=e,this.b=t}function DSe(e,t){this.a=e,this.b=t}function OSe(e,t){this.a=e,this.b=t}function kSe(e,t){this.a=e,this.b=t}function ASe(e,t){this.a=e,this.b=t}function jSe(e,t){this.b=e,this.a=t}function MSe(e,t){this.b=e,this.a=t}function NSe(e,t){this.b=e,this.a=t}function PSe(e,t){this.b=e,this.a=t}function FSe(e,t){this.a=e,this.b=t}function ISe(e,t){this.a=e,this.b=t}function qc(e,t){so.call(this,e,t)}function LSe(e,t){this.a=e,this.b=t}function RSe(e,t){this.a=e,this.b=t}function Jc(e,t){so.call(this,e,t)}function zSe(e,t){this.f=e,this.c=t}function Yc(e,t){return $u(e.g,t)}function BSe(e,t){return $u(t.b,e)}function VSe(e,t){return uD(e.a,t)}function HSe(e,t){return-e.b.af(t)}function USe(e,t){e&&Qh(f7,e,t)}function Xc(e,t){e.i=null,OS(e,t)}function WSe(e,t,n){I8e(t,KA(e,n))}function GSe(e,t,n){I8e(t,KA(e,n))}function KSe(e,t){not(e.a,P(t,58))}function qSe(e,t){KGe(e.a,P(t,12))}function Zc(e,t){this.a=e,this.b=t}function JSe(e,t){this.a=e,this.b=t}function YSe(e,t){this.a=e,this.b=t}function XSe(e,t){this.a=e,this.b=t}function ZSe(e,t){this.a=e,this.b=t}function QSe(e,t){this.d=e,this.b=t}function $Se(e,t){this.e=e,this.a=t}function Qc(e,t){this.b=e,this.c=t}function $c(e,t){this.i=e,this.g=t}function el(e,t){this.d=e,this.e=t}function eCe(e,t){kKe(new Lu(e),t)}function tl(e){return lD(e.c,e.b)}function nl(e){return e?e.md():null}function A(e){return e??null}function rl(e){return typeof e===OP}function il(e){return typeof e===DP}function al(e){return typeof e===Vvt}function ol(e,t){return dT(e,t)==0}function sl(e,t){return dT(e,t)>=0}function cl(e,t){return dT(e,t)!=0}function ll(e,t){return VYe(e.Kc(),t)}function ul(e,t){return e.Rd().Xb(t)}function tCe(e){return RE(e),e.d.gc()}function dl(e){return bp(e==null),e}function fl(e,t){return e.a+=``+t,e}function pl(e,t){return e.a+=``+t,e}function ml(e,t){return e.a+=``+t,e}function hl(e,t){return e.a+=``+t,e}function gl(e,t){return e.a+=``+t,e}function _l(e,t){return e.a+=``+t,e}function nCe(e){return``+(Gh(e),e)}function rCe(e){Pm(this),mC(this,e)}function iCe(){ERe(),bNe.call(this)}function aCe(e,t){GNe.call(this,e,t)}function oCe(e,t){GNe.call(this,e,t)}function vl(e,t){GNe.call(this,e,t)}function yl(e,t){iy(e,t,e.c.b,e.c)}function bl(e,t){iy(e,t,e.a,e.a.a)}function xl(e){return ov(e,0),null}function sCe(){this.b=0,this.a=!1}function cCe(){this.b=0,this.a=!1}function lCe(){this.b=new go(xx(12))}function uCe(){uCe=C,oDt=nT(sO())}function dCe(){dCe=C,NOt=nT(wot())}function fCe(){fCe=C,NPt=nT(qYe())}function Sl(){Sl=C,vge(),uG=new Dr}function Cl(e){return e.a=0,e.b=0,e}function pCe(e,t){return e.a=t.g+1,e}function wl(e,t){lf.call(this,e,t)}function Tl(e,t){Wd.call(this,e,t)}function El(e,t){$c.call(this,e,t)}function mCe(e,t){ad.call(this,e,t)}function Dl(e,t){WC.call(this,e,t)}function Ol(e,t){Jo(),Qh(v7,e,t)}function hCe(e,t){e.q.setTime(Dv(t))}function gCe(e){r.clearTimeout(e)}function _Ce(e){return ph(e),new Hl(e)}function vCe(e,t){return A(e)===A(t)}function yCe(e,t){return e.a.a.a.cc(t)}function kl(e,t){return p_(e.a,0,t)}function Al(e){return zPe(P(e,74))}function jl(e){return C_((Gh(e),e))}function bCe(e){return C_((Gh(e),e))}function xCe(e){return vu(e.l,e.m,e.h)}function Ml(e,t){return _u(e.a,t.a)}function SCe(e,t){return DPe(e.a,t.a)}function CCe(e,t){return aE(e.a,t.a)}function Nl(e,t){return e.indexOf(t)}function wCe(e,t){return e.j[t.p]==2}function Pl(e,t){return e==t?0:e?1:-1}function Fl(e){return e<10?`0`+e:``+e}function Il(e){return typeof e===Vvt}function TCe(e){return e==kJ||e==MJ}function ECe(e){return e==kJ||e==AJ}function DCe(e,t){return _u(e.g,t.g)}function Ll(e){return Ab(e.b.b,e,0)}function OCe(){Np.call(this,0,0,0,0)}function Rl(){Xn.call(this,new ry)}function zl(e,t){bb(e,0,e.length,t)}function kCe(e,t){return M(e.a,t),t}function ACe(e,t){return Lf(),t.a+=e}function jCe(e,t){return Lf(),t.a+=e}function MCe(e,t){return Lf(),t.c+=e}function NCe(e,t){return M(e.c,t),e}function Bl(e,t){return OC(e.a,t),e}function PCe(e){this.a=qxe(),this.b=e}function FCe(e){this.a=qxe(),this.b=e}function Vl(e){this.a=e.a,this.b=e.b}function Hl(e){this.a=e,dn.call(this)}function ICe(e){this.a=e,dn.call(this)}function Ul(){wg.call(this,0,0,0,0)}function Wl(e){return OC(new Zh,e)}function LCe(e){return ag(P(e,123))}function Gl(e){return e.vh()&&e.wh()}function Kl(e){return e!=V8&&e!=H8}function ql(e){return e==t8||e==n8}function Jl(e){return e==i8||e==e8}function RCe(e){return e==L0||e==I0}function zCe(e,t){return _u(e.g,t.g)}function BCe(e,t){return new WC(t,e)}function VCe(e,t){return new WC(t,e)}function Yl(e){return wje(e.b.Kc(),e.a)}function Xl(e,t){Gw(e,t),eS(e,e.D)}function Zl(e,t,n){Xx(e,t),Vx(e,n)}function Ql(e,t,n){Wx(e,t),Ux(e,n)}function $l(e,t,n){Gx(e,t),Kx(e,n)}function eu(e,t,n){Hx(e,t),Jx(e,n)}function tu(e,t,n){qx(e,t),Yx(e,n)}function HCe(e,t,n){mDe.call(this,e,t,n)}function nu(e){zSe.call(this,e,!0)}function UCe(){ls.call(this,`Tail`,3)}function WCe(){ls.call(this,`Head`,1)}function ru(e){AM(),IYe.call(this,e)}function iu(e){Np.call(this,e,e,e,e)}function au(e){e.c=V(WW,FP,1,0,5,1)}function GCe(e){return e.b&&yN(e),e.a}function KCe(e){return e.b&&yN(e),e.c}function qCe(e,t){_K||(e.b=t)}function JCe(e,t){return e[e.length]=t}function YCe(e,t){return e[e.length]=t}function XCe(e,t){return Ex(t,E_(e))}function ZCe(e,t){return Ex(t,E_(e))}function QCe(e,t){return yS(uh(e.d),t)}function $Ce(e,t){return yS(uh(e.g),t)}function ewe(e,t){return yS(uh(e.j),t)}function ou(e,t){Wd.call(this,e.b,t)}function twe(e,t){tb(Jv(e.a),IRe(t))}function nwe(e,t){tb(Ib(e.a),LRe(t))}function rwe(e,t,n){$l(n,n.i+e,n.j+t)}function iwe(e,t,n){Sh(e.c[t.g],t.g,n)}function awe(e,t,n){P(e.c,71).Gi(t,n)}function su(e,t,n){return Sh(e,t,n),n}function owe(e){Dx(e.Sf(),new Zfe(e))}function cu(e){return e==null?0:US(e)}function swe(e){return e==null?0:US(e)}function lu(e){xP(),Tr.call(this,e)}function cwe(e){this.a=e,xje.call(this,e)}function uu(){uu=C,r.Math.log(2)}function du(){du=C,s9=(Xbe(),mVt)}function lwe(){lwe=C,D2=new NE(p8)}function fu(){fu=C,new uwe,new T}function uwe(){new Dr,new Dr,new Dr}function dwe(){throw E(new Ri(_Tt))}function fwe(){throw E(new Ri(_Tt))}function pwe(){throw E(new Ri(vTt))}function mwe(){throw E(new Ri(vTt))}function pu(e){this.a=e,co.call(this,e)}function mu(e){this.a=e,co.call(this,e)}function hwe(e,t){gh(),this.a=e,this.b=t}function gwe(e,t){ph(t),bg(e).Jc(new m)}function hu(e,t){qp(e.c,e.c.length,t)}function gu(e){return e.at)}function ywe(e,t){return dT(e,t)>0?e:t}function vu(e,t,n){return{l:e,m:t,h:n}}function bwe(e,t){e.a!=null&&qSe(t,e.a)}function xwe(e){U_(e,null),K_(e,null)}function Swe(e,t,n){return Qh(e.g,n,t)}function yu(e,t,n){return AD(t,n,e.c)}function Cwe(e,t,n){return Qh(e.k,n,t)}function wwe(e,t,n){return kht(e,t,n),n}function Twe(e,t){return z_(),t.n.b+=e}function Ewe(e){r_.call(this),this.b=e}function Dwe(e){$De.call(this),this.a=e}function Owe(){ls.call(this,`Range`,2)}function bu(e){this.b=e,this.a=new T}function kwe(e){this.b=new jt,this.a=e}function Awe(e){e.a=new me,e.c=new me}function jwe(e){e.a=new Dr,e.d=new Dr}function Mwe(e){q_(e,null),J_(e,null)}function Nwe(e,t){return Nht(e.a,t,null)}function Pwe(e,t){return Qh(e.a,t.a,t)}function xu(e){return new k(e.a,e.b)}function Fwe(e){return new k(e.c,e.d)}function Iwe(e){return new k(e.c,e.d)}function Su(e,t){return xmt(e.c,e.b,t)}function j(e,t){return e!=null&&kO(e,t)}function Cu(e,t){return XXe(e.Kc(),t)!=-1}function wu(e){return e.Ob()?e.Pb():null}function Lwe(e){this.b=(Vg(),new Kn(e))}function Rwe(e){this.a=e,Dr.call(this)}function zwe(){ad.call(this,null,null)}function Bwe(){od.call(this,null,null)}function Vwe(){so.call(this,`INSTANCE`,0)}function Hwe(){i8e(),this.a=new Yj(CJ)}function Uwe(e){return ND(e,0,e.length)}function Wwe(e,t){return new PTe(e.Kc(),t)}function Gwe(e,t){return e.a.Bc(t)!=null}function Kwe(e,t){RN(e),e.Gc(P(t,15))}function qwe(e,t,n){e.c.bd(t,P(n,136))}function Jwe(e,t,n){e.c.Ui(t,P(n,136))}function Ywe(e,t){e.c&&(pMe(t),LLe(t))}function Xwe(e,t){e.q.setHours(t),dN(e,t)}function Zwe(e,t){Sd(t,e.a.a.a,e.a.a.b)}function Qwe(e,t,n,r){Sh(e.a[t.g],n.g,r)}function Tu(e,t,n){return e.a[t.g][n.g]}function $we(e,t){return e.e[t.c.p][t.p]}function eTe(e,t){return e.c[t.c.p][t.p]}function Eu(e,t){return e.a[t.c.p][t.p]}function tTe(e,t){return e.j[t.p]=Aat(t)}function Du(e,t){return e.a.Bc(t)!=null}function nTe(e,t){return D(N(t.a))<=e}function rTe(e,t){return D(N(t.a))>=e}function iTe(e,t){return zUe(e.f,t.Pg())}function Ou(e,t){return e.a*t.a+e.b*t.b}function aTe(e,t){return e.a0?t/(e*e):t*100}function SEe(e,t){return e>0?t*t/e:t*t*100}function xd(e,t){return P(ix(e.a,t),34)}function CEe(e,t){return wA(),fj(e,t.e,t)}function wEe(e,t,n){return zo(),n.Mg(e,t)}function TEe(e){return zx(),e.e.a+e.f.a/2}function EEe(e,t,n){return zx(),n.e.a-e*t}function DEe(e){return zx(),e.e.b+e.f.b/2}function OEe(e,t,n){return zx(),n.e.b-e*t}function kEe(e){e.d=new gEe(e),e.e=new Dr}function AEe(){this.a=new g_,this.b=new g_}function jEe(e){this.c=e,this.a=1,this.b=1}function MEe(e){dP(),lge(this),this.Ff(e)}function NEe(e,t,n){gb(),e.pf(t)&&n.Cd(e)}function PEe(e,t,n){return M(t,Y1e(e,n))}function Sd(e,t,n){return e.a+=t,e.b+=n,e}function FEe(e,t,n){return e.a*=t,e.b*=n,e}function IEe(e,t){return e.a=t.a,e.b=t.b,e}function Cd(e){return e.a=-e.a,e.b=-e.b,e}function wd(e,t,n){return e.a-=t,e.b-=n,e}function LEe(e){vo.call(this),_S(this,e)}function REe(){so.call(this,`GROW_TREE`,0)}function zEe(){so.call(this,`POLYOMINO`,0)}function Td(e,t,n){lb.call(this,e,t,n,2)}function BEe(e,t,n){WT(Jv(e.a),t,IRe(n))}function VEe(e,t){Yo(),ad.call(this,e,t)}function HEe(e,t){Xo(),od.call(this,e,t)}function UEe(e,t){Xo(),HEe.call(this,e,t)}function WEe(e,t){Xo(),od.call(this,e,t)}function GEe(e,t){return e.c.Fc(P(t,136))}function KEe(e,t,n){WT(Ib(e.a),t,LRe(n))}function qEe(e){this.c=e,Gx(e,0),Kx(e,0)}function Ed(e,t){du(),Bp.call(this,e,t)}function JEe(e,t){du(),Ed.call(this,e,t)}function YEe(e,t){du(),Ed.call(this,e,t)}function XEe(e,t){du(),Bp.call(this,e,t)}function ZEe(e,t){du(),YEe.call(this,e,t)}function QEe(e,t){du(),XEe.call(this,e,t)}function $Ee(e,t){du(),Bp.call(this,e,t)}function eDe(e,t,n){return t.zl(e.e,e.c,n)}function tDe(e,t,n){return t.Al(e.e,e.c,n)}function nDe(e,t,n){return jN(Lb(e,t),n)}function Dd(e,t){return pT(e.e,P(t,54))}function rDe(e){return e==null?null:Fgt(e)}function iDe(e){return e==null?null:G9e(e)}function aDe(e){return e==null?null:PE(e)}function oDe(e){return e==null?null:PE(e)}function Od(e){return bp(e==null||il(e)),e}function N(e){return bp(e==null||al(e)),e}function kd(e){return bp(e==null||rl(e)),e}function Ad(e){e.o??zit(e)}function sDe(e){if(!e)throw E(new Lr)}function cDe(e){if(!e)throw E(new Ir)}function jd(e){if(!e)throw E(new Hr)}function Md(e){if(!e)throw E(new Rr)}function lDe(e){if(!e)throw E(new Vr)}function Nd(){Nd=C,_7=new c_e,new l_e}function Pd(){Pd=C,y4=new yr(`root`)}function uDe(){EJe.call(this),this.Bb|=pI}function dDe(e,t){this.d=e,wfe(this),this.b=t}function fDe(e,t){Qy.call(this,e),this.a=t}function pDe(e,t){Qy.call(this,e),this.a=t}function mDe(e,t,n){Ry.call(this,e,t,n,null)}function hDe(e,t,n){Ry.call(this,e,t,n,null)}function Fd(e,t){this.c=e,io.call(this,e,t)}function Id(e,t){this.a=e,Fd.call(this,e,t)}function gDe(e){this.q=new r.Date(Dv(e))}function _De(e){return e>8?0:e+1}function vDe(e,t){_K||M(e.a,t)}function yDe(e,t){return Io(),jC(t.d.i,e)}function bDe(e,t){return cC(),new Ilt(t,e)}function xDe(e,t,n){return e.Ne(t,n)<=0?n:t}function SDe(e,t,n){return e.Ne(t,n)<=0?t:n}function CDe(e,t){return P(ix(e.b,t),143)}function wDe(e,t){return P(ix(e.c,t),233)}function Ld(e){return P(Ep(e.a,e.b),294)}function TDe(e){return new k(e.c,e.d+e.a)}function EDe(e){return Gh(e),e?1231:1237}function DDe(e){return z_(),RCe(P(e,203))}function Rd(){Rd=C,lq=sE((TD(),x5))}function ODe(e,t){t.a?Irt(e,t):Du(e.a,t.b)}function zd(e,t,n){++e.j,e.tj(),Xy(e,t,n)}function kDe(e,t,n){++e.j,e.qj(t,e.Zi(t,n))}function ADe(e,t,n){e.fd(t).Rb(n)}function jDe(e,t,n){return n=qM(e,t,6,n),n}function Bd(e,t,n){return n=qM(e,t,3,n),n}function Vd(e,t,n){return n=qM(e,t,9,n),n}function Hd(e,t){return c_(t,Iyt),e.f=t,e}function MDe(e,t){return(t&AP)%e.d.length}function NDe(e,t,n){return Xft(e.c,e.b,t,n)}function PDe(e,t){this.c=e,kx.call(this,t)}function FDe(e,t){this.a=e,Hhe.call(this,t)}function Ud(e,t){this.a=e,Hhe.call(this,t)}function Wd(e,t){yr.call(this,e),this.a=t}function IDe(e,t){Khe.call(this,e),this.a=t}function Gd(e,t){Khe.call(this,e),this.a=t}function LDe(e){iD.call(this,0,0),this.f=e}function RDe(e,t,n){return e.a+=ND(t,0,n),e}function Kd(e){return!e.a&&(e.a=new ee),e.a}function zDe(e,t){var n=e.e;return e.e=t,n}function BDe(e,t){var n=t;return!!e.Fe(n)}function VDe(e,t){return rd(),e==t?0:e?1:-1}function qd(e,t){e.a.bd(e.b,t),++e.b,e.c=-1}function Jd(e){e.b?Jd(e.b):e.f.c.zc(e.e,e.d)}function HDe(e){Pm(e.e),e.d.b=e.d,e.d.a=e.d}function UDe(e,t,n){wo(),jde(e,t.Ve(e.a,n))}function WDe(e,t,n){return zm(e,P(t,22),n)}function Yd(e,t){return ua(Array(t),e)}function GDe(e){return nm(um(e,32))^nm(e)}function Xd(e){return String.fromCharCode(e)}function KDe(e){return e==null?null:e.message}function qDe(e,t,n){return e.apply(t,n)}function JDe(e,t){e[TI].call(e,t)}function YDe(e,t){e[TI].call(e,t)}function XDe(e,t){return Io(),!jC(t.d.i,e)}function ZDe(e,t,n,r){Np.call(this,e,t,n,r)}function QDe(){Qd.call(this),this.a=new Fa}function $De(){this.n=new Fa,this.o=new Fa}function eOe(){this.b=new Fa,this.c=new T}function tOe(){this.a=new T,this.b=new T}function nOe(){this.a=new Vt,this.b=new Tge}function Zd(){this.b=new ry,this.a=new ry}function rOe(){this.b=new Jr,this.a=new Jr}function iOe(){this.b=new Dr,this.a=new Dr}function aOe(){this.b=new _ye,this.a=new iae}function oOe(){this.a=new Tue,this.b=new Ure}function sOe(){this.a=new T,this.d=new T}function Qd(){this.n=new ni,this.i=new Ul}function cOe(e){this.a=(vS(e,hF),new Hy(e))}function lOe(e){this.a=(vS(e,hF),new Hy(e))}function uOe(e){return e<100?null:new Pa(e)}function dOe(e,t){return e.n.a=(Gh(t),t+10)}function fOe(e,t){return e.n.a=(Gh(t),t+10)}function pOe(e,t){return t==e||Uk(zj(t),e)}function mOe(e,t){return Qh(e.a,t,``)==null}function hOe(e,t){return t.qi(e.a)}function $d(e,t){return e.a+=t.a,e.b+=t.b,e}function ef(e,t){return e.a-=t.a,e.b-=t.b,e}function gOe(e){return Wr(e.j.c,0),e.a=-1,e}function tf(e,t,n){return n=qM(e,t,11,n),n}function _Oe(e,t,n){n!=null&&TS(t,dk(e,n))}function vOe(e,t,n){n!=null&&ES(t,dk(e,n))}function nf(e,t,n,r){F.call(this,e,t,n,r)}function rf(e,t,n,r){F.call(this,e,t,n,r)}function yOe(e,t,n,r){rf.call(this,e,t,n,r)}function bOe(e,t,n,r){wm.call(this,e,t,n,r)}function af(e,t,n,r){wm.call(this,e,t,n,r)}function of(e,t,n,r){wm.call(this,e,t,n,r)}function xOe(e,t,n,r){af.call(this,e,t,n,r)}function sf(e,t,n,r){af.call(this,e,t,n,r)}function cf(e,t,n,r){of.call(this,e,t,n,r)}function SOe(e,t,n,r){sf.call(this,e,t,n,r)}function COe(e,t,n,r){dPe.call(this,e,t,n,r)}function lf(e,t){Mi.call(this,PU+e+bU+t)}function uf(e,t){return e.jk().wi().ri(e,t)}function df(e,t){return e.jk().wi().ti(e,t)}function wOe(e,t){return Gh(e),A(e)===A(t)}function ff(e,t){return Gh(e),A(e)===A(t)}function TOe(e,t){return e.b.Bd(new sxe(e,t))}function EOe(e,t){return e.b.Bd(new cxe(e,t))}function DOe(e,t){return e.b.Bd(new lxe(e,t))}function OOe(e,t){return e.e=P(e.d.Kb(t),159)}function pf(e,t,n){return e.lastIndexOf(t,n)}function kOe(e,t,n){return aE(e[t.a],e[n.a])}function AOe(e,t){return W(t,(mP(),d1),e)}function jOe(e,t){return _u(t.a.d.p,e.a.d.p)}function MOe(e,t){return _u(e.a.d.p,t.a.d.p)}function NOe(e,t){return aE(e.c-e.s,t.c-t.s)}function POe(e,t){return aE(e.b.e.a,t.b.e.a)}function FOe(e,t){return aE(e.c.e.a,t.c.e.a)}function IOe(e){return e.c?Ab(e.c.a,e,0):-1}function mf(e){return e==L8||e==z8||e==R8}function LOe(e,t){this.c=e,Hm.call(this,e,t)}function ROe(e,t,n){this.a=e,sEe.call(this,t,n)}function zOe(e){this.c=e,vl.call(this,tF,0)}function BOe(e,t,n){this.c=t,this.b=n,this.a=e}function hf(e){Rf(),this.d=e,this.a=new Iu}function VOe(e){wf(),this.a=(Vg(),new oa(e))}function HOe(e,t){ql(e.f)?Ait(e,t):f7e(e,t)}function UOe(e,t){kje.call(this,e,e.length,t)}function WOe(e,t){_K||t&&(e.d=t)}function GOe(e,t){return j(t,15)&&Mct(e.c,t)}function KOe(e,t,n){return P(e.c,71).Wk(t,n)}function gf(e,t,n){return P(e.c,71).Xk(t,n)}function qOe(e,t,n){return eDe(e,P(t,343),n)}function JOe(e,t,n){return tDe(e,P(t,343),n)}function YOe(e,t,n){return E5e(e,P(t,343),n)}function XOe(e,t,n){return A7e(e,P(t,343),n)}function _f(e,t){return t==null?null:TT(e.b,t)}function ZOe(e){return al(e)?(Gh(e),e):e.ue()}function vf(e){return!isNaN(e)&&!isFinite(e)}function yf(e){Awe(this),Fg(this),XS(this,e)}function bf(e){au(this),Fje(this.c,0,e.Pc())}function xf(e,t,n){this.a=e,this.b=t,this.c=n}function QOe(e,t,n){this.a=e,this.b=t,this.c=n}function $Oe(e,t,n){this.d=e,this.b=n,this.a=t}function eke(e){this.a=e,yo(),LC(Date.now())}function tke(e){Fh(e.a),KWe(e.c,e.b),e.b=null}function Sf(){Sf=C,aK=new he,oEt=new ge}function nke(){nke=C,TVt=V(WW,FP,1,0,5,1)}function rke(){rke=C,QVt=V(WW,FP,1,0,5,1)}function Cf(){Cf=C,$Vt=V(WW,FP,1,0,5,1)}function wf(){wf=C,new mge((Vg(),Vg(),QG))}function ike(e){return Sb(),iS((TGe(),dEt),e)}function ake(e){return Zw(),iS((MWe(),vEt),e)}function oke(e){return fO(),iS((wHe(),DEt),e)}function ske(e){return dx(),iS((THe(),OEt),e)}function cke(e){return vM(),iS((CXe(),kEt),e)}function lke(e){return Ix(),iS((AWe(),MEt),e)}function uke(e){return Cb(),iS((kWe(),PEt),e)}function dke(e){return Xb(),iS((jWe(),LEt),e)}function fke(e){return SP(),iS((uCe(),oDt),e)}function pke(e){return KC(),iS((DGe(),cDt),e)}function mke(e){return TO(),iS((kGe(),uDt),e)}function hke(e){return wO(),iS((OGe(),mDt),e)}function gke(e){return No(),iS((VBe(),hDt),e)}function _ke(e){return fx(),iS((EHe(),NDt),e)}function vke(e){return Yb(),iS((NWe(),aOt),e)}function yke(e){return vA(),iS((PKe(),lOt),e)}function bke(e){return ow(),iS((jGe(),hOt),e)}function xke(e){return YD(),iS((AGe(),xOt),e)}function Tf(e,t){if(!e)throw E(new Fi(t))}function Ef(e){if(!e)throw E(new Ii(Wvt))}function Df(e,t){if(e!=t)throw E(new Vr)}function Ske(e,t,n){this.a=e,this.b=t,this.c=n}function Of(e,t,n){this.a=e,this.b=t,this.c=n}function Cke(e,t,n){this.a=e,this.b=t,this.c=n}function kf(e,t,n){this.b=e,this.a=t,this.c=n}function Af(e,t,n){this.b=e,this.c=t,this.a=n}function jf(e,t,n){this.a=e,this.b=t,this.c=n}function Mf(e,t,n){this.e=t,this.b=e,this.d=n}function wke(e,t,n){this.b=e,this.a=t,this.c=n}function Tke(e,t,n){return wo(),e.a.Yd(t,n),t}function Nf(e){var t=new Ze;return t.e=e,t}function Pf(e){var t=new Hge;return t.b=e,t}function Ff(){Ff=C,oY=new vte,sY=new yte}function If(){If=C,ROt=new Kte,LOt=new qte}function Lf(){Lf=C,UOt=new tre,WOt=new nre}function Eke(e){return kS(),iS((uWe(),ekt),e)}function Dke(e){return yP(),iS((dCe(),NOt),e)}function Oke(e){return iw(),iS((NGe(),IOt),e)}function kke(e){return aw(),iS((MGe(),qOt),e)}function Ake(e){return tA(),iS((FKe(),YOt),e)}function jke(e){return dM(),iS((KYe(),tkt),e)}function Mke(e){return GA(),iS((Eqe(),nkt),e)}function Nke(e){return Ky(),iS((NHe(),rkt),e)}function Pke(e){return bS(),iS((cWe(),ikt),e)}function Fke(e){return lS(),iS((lWe(),akt),e)}function Ike(e){return FD(),iS((IKe(),okt),e)}function Lke(e){return px(),iS((kHe(),skt),e)}function Rke(e){return TA(),iS((kqe(),pkt),e)}function zke(e){return uM(),iS((gZe(),mkt),e)}function Bke(e){return qC(),iS((fWe(),hkt),e)}function Vke(e){return Zb(),iS((pWe(),_kt),e)}function Hke(e){return Bv(),iS((OHe(),vkt),e)}function Uke(e){return qk(),iS((Oqe(),fkt),e)}function Wke(e){return _w(),iS((dWe(),lkt),e)}function Gke(e){return kA(),iS((Dqe(),ukt),e)}function Kke(e){return wb(),iS((AHe(),dkt),e)}function qke(e){return XE(),iS((RKe(),ykt),e)}function Jke(e){return Zj(),iS((bXe(),MMt),e)}function Yke(e){return hT(),iS((mWe(),FMt),e)}function Xke(e){return IO(),iS((PGe(),IMt),e)}function Zke(e){return CO(),iS((LKe(),zMt),e)}function Qke(e){return FM(),iS((_Ze(),GMt),e)}function $ke(e){return ID(),iS((FGe(),JMt),e)}function eAe(e){return Qb(),iS((jHe(),XMt),e)}function tAe(e){return uS(),iS((_We(),QMt),e)}function nAe(e){return CC(),iS((hWe(),nNt),e)}function rAe(e){return Nw(),iS((gWe(),iNt),e)}function iAe(e){return Xw(),iS((vWe(),sNt),e)}function aAe(e){return cS(),iS((yWe(),dNt),e)}function oAe(e){return sw(),iS((bWe(),pNt),e)}function sAe(e){return sS(),iS((OWe(),jNt),e)}function cAe(e){return Vv(),iS((MHe(),RNt),e)}function lAe(e){return O_(),iS((IHe(),qNt),e)}function uAe(e){return k_(),iS((LHe(),YNt),e)}function dAe(e){return Wy(),iS((RHe(),dPt),e)}function fAe(e){return D_(),iS((zHe(),vPt),e)}function pAe(e){return Ok(),iS((YGe(),bPt),e)}function mAe(e){return LM(),iS((fCe(),NPt),e)}function hAe(e){return Pw(),iS((xWe(),IPt),e)}function gAe(e){return Jw(),iS((JGe(),TFt),e)}function _Ae(e){return iv(),iS((PHe(),OFt),e)}function vAe(e){return AS(),iS((FHe(),PFt),e)}function yAe(e){return iA(),iS((zKe(),IFt),e)}function bAe(e){return Yw(),iS((SWe(),UFt),e)}function xAe(e){return _b(),iS((BHe(),zFt),e)}function SAe(e){return uk(),iS((qGe(),wIt),e)}function CAe(e){return SC(),iS((CWe(),OIt),e)}function wAe(e){return ED(),iS((wWe(),AIt),e)}function TAe(e){return LO(),iS((TWe(),MIt),e)}function EAe(e){return TE(),iS((EWe(),RIt),e)}function DAe(e){return my(),iS((VHe(),xLt),e)}function OAe(e){return dC(),iS((DHe(),AOt),e)}function kAe(e){return DA(),iS((Aqe(),TOt),e)}function AAe(e){return Tb(),iS((DWe(),TLt),e)}function jAe(e){return JC(),iS((HHe(),kLt),e)}function MAe(e){return Wj(),iS((BKe(),MLt),e)}function NAe(e){return Bo(),iS((sVe(),FLt),e)}function PAe(e){return KT(),iS((FWe(),NLt),e)}function FAe(e){return Vo(),iS((cVe(),LLt),e)}function IAe(e){return Gy(),iS((UHe(),zLt),e)}function LAe(e){return MA(),iS((VKe(),WLt),e)}function RAe(e){return Ho(),iS((lVe(),SRt),e)}function zAe(e){return cw(),iS((WHe(),TRt),e)}function BAe(e){return uO(),iS((UKe(),FRt),e)}function VAe(e){return VA(),iS((WYe(),RRt),e)}function HAe(e){return RO(),iS((jqe(),HRt),e)}function UAe(e){return eA(),iS((Mqe(),ezt),e)}function WAe(e){return GT(),iS((HKe(),nBt),e)}function GAe(e){return Lx(),iS((IWe(),iBt),e)}function KAe(e){return wE(),iS((XGe(),aBt),e)}function qAe(e){return hA(),iS((Nqe(),fBt),e)}function JAe(e){return _T(),iS((PWe(),bBt),e)}function YAe(e){return kk(),iS((ZGe(),SBt),e)}function XAe(e){return Ej(),iS((SXe(),CBt),e)}function ZAe(e){return pO(),iS((WKe(),EBt),e)}function QAe(e){return rA(),iS((Pqe(),OBt),e)}function $Ae(e){return rj(),iS((Fqe(),kBt),e)}function eje(e){return nP(),iS((GKe(),ABt),e)}function tje(e){return TD(),iS((QGe(),IBt),e)}function nje(e){return UM(),iS((xXe(),RBt),e)}function rje(e){return gT(),iS((LWe(),VBt),e)}function ije(e,t){return Gh(e),e+(Gh(t),t)}function aje(e){return zf(),iS((GHe(),WBt),e)}function oje(e){return ZE(),iS(($Ge(),YBt),e)}function sje(e){return Mw(),iS((eKe(),tVt),e)}function Rf(){Rf=C,PNt=(nP(),g5),v2=X8}function zf(){zf=C,HBt=new AMe,UBt=new cPe}function cje(e){return!e.e&&(e.e=new T),e.e}function Bf(e,t){this.c=e,this.a=t,this.b=t-e}function lje(e,t,n){this.a=e,this.b=t,this.c=n}function Vf(e,t,n){this.a=e,this.b=t,this.c=n}function Hf(e,t,n){this.a=e,this.b=t,this.c=n}function Uf(e,t,n){this.a=e,this.b=t,this.c=n}function uje(e,t,n){this.a=e,this.b=t,this.c=n}function dje(e,t,n){this.a=e,this.b=t,this.c=n}function Wf(e,t,n){this.e=e,this.a=t,this.c=n}function fje(e,t,n){du(),ILe.call(this,e,t,n)}function Gf(e,t,n){du(),Ph.call(this,e,t,n)}function pje(e,t,n){du(),Ph.call(this,e,t,n)}function mje(e,t,n){du(),Ph.call(this,e,t,n)}function hje(e,t,n){du(),Gf.call(this,e,t,n)}function gje(e,t,n){du(),Gf.call(this,e,t,n)}function _je(e,t,n){du(),gje.call(this,e,t,n)}function vje(e,t,n){du(),pje.call(this,e,t,n)}function yje(e,t,n){du(),mje.call(this,e,t,n)}function Kf(e){Np.call(this,e.d,e.c,e.a,e.b)}function bje(e){Np.call(this,e.d,e.c,e.a,e.b)}function xje(e){this.d=e,wfe(this),this.b=FNe(e.d)}function Sje(e){return Sj(),iS((GYe(),bVt),e)}function qf(e,t){return ph(e),ph(t),new Hye(e,t)}function Jf(e,t){return ph(e),ph(t),new oMe(e,t)}function Cje(e,t){return ph(e),ph(t),new sMe(e,t)}function wje(e,t){return ph(e),ph(t),new Qye(e,t)}function Yf(e){return jd(e.b!=0),Ox(e,e.a.a)}function Tje(e){return jd(e.b!=0),Ox(e,e.c.b)}function Eje(e){return!e.c&&(e.c=new ln),e.c}function Xf(e){var t=new T;return rx(t,e),t}function Dje(e){var t=new Jr;return rx(t,e),t}function Oje(e){var t=new Nge;return HS(t,e),t}function Zf(e){var t=new vo;return HS(t,e),t}function P(e,t){return bp(e==null||kO(e,t)),e}function kje(e,t,n){WNe.call(this,t,n),this.a=e}function Aje(e,t){this.c=e,this.b=t,this.a=!1}function jje(){this.a=`;,;`,this.b=``,this.c=``}function Mje(e,t,n){this.b=e,aCe.call(this,t,n)}function Nje(e,t,n){this.c=e,ds.call(this,t,n)}function Pje(e,t,n){js.call(this,e,t),this.b=n}function Fje(e,t,n){art(n,0,e,t,n.length,!1)}function Qf(e,t,n,r,i){e.b=t,e.c=n,e.d=r,e.a=i}function Ije(e,t,n,r,i){e.d=t,e.c=n,e.a=r,e.b=i}function Lje(e,t){t&&(e.b=t,e.a=(Hh(t),t.a))}function $f(e,t){if(!e)throw E(new Fi(t))}function ep(e,t){if(!e)throw E(new Ii(t))}function Rje(e,t){if(!e)throw E(new ove(t))}function zje(e,t){return Ro(),_u(e.d.p,t.d.p)}function Bje(e,t){return zx(),aE(e.e.b,t.e.b)}function Vje(e,t){return zx(),aE(e.e.a,t.e.a)}function Hje(e,t){return _u(bMe(e.d),bMe(t.d))}function tp(e,t){return t&&Lh(e,t.d)?t:null}function Uje(e,t){return t==(nP(),g5)?e.c:e.d}function Wje(e){return MC(gPe(Il(e)?zC(e):e))}function Gje(e){return new k(e.c+e.b,e.d+e.a)}function Kje(e){return e!=null&&!zE(e,y7,b7)}function qje(e,t){return(R$e(e)<<4|R$e(t))&OF}function Jje(e,t,n,r,i){e.c=t,e.d=n,e.b=r,e.a=i}function Yje(e){var t=e.b;e.b=e.c,e.c=t}function Xje(e){var t,n=e.d;t=e.a,e.d=t,e.a=n}function Zje(e,t){var n=e.c;return PJe(e,t),n}function Qje(e,t){return e.g=t<0?-1:t,e}function np(e,t){return bqe(e),e.a*=t,e.b*=t,e}function $je(e,t,n){pqe.call(this,t,n),this.d=e}function rp(e,t,n){el.call(this,e,t),this.c=n}function ip(e,t,n){el.call(this,e,t),this.c=n}function eMe(e){Cf(),sn.call(this),this.ci(e)}function tMe(){By(),uFe.call(this,(qo(),N7))}function nMe(e){return xP(),++W9,new zp(0,e)}function rMe(){rMe=C,f9=(Vg(),new Gn(xW))}function ap(){ap=C,new FO((mi(),ZW),(pi(),XW))}function iMe(){iMe=C,OG=V(DG,X,17,256,0,1)}function aMe(){this.b=D(N(hO((XM(),eJ))))}function op(e){this.b=e,this.a=am(this.b.a).Od()}function oMe(e,t){this.b=e,this.a=t,dn.call(this)}function sMe(e,t){this.a=e,this.b=t,dn.call(this)}function cMe(e,t,n){this.a=e,El.call(this,t,n)}function lMe(e,t,n){this.a=e,El.call(this,t,n)}function sp(e,t,n){hx(e,t,new mh(n))}function uMe(e,t,n){var r=e[t];return e[t]=n,r}function cp(e){return yb(e.slice(),e)}function lp(e){var t=e.n;return e.a.b+t.d+t.a}function dMe(e){var t=e.n;return e.e.b+t.d+t.a}function fMe(e){var t=e.n;return e.e.a+t.b+t.c}function pMe(e){e.a.b=e.b,e.b.a=e.a,e.a=e.b=null}function up(e,t){return iy(e,t,e.c.b,e.c),!0}function mMe(e){return e.a?e.a:xg(e)}function hMe(e){return Ug(),xA(e)==I_(SA(e))}function gMe(e){return Ug(),SA(e)==I_(xA(e))}function dp(e,t){return Bk(e,new js(t.a,t.b))}function _Me(e,t){return eg(),ik(e,t),new jFe(e,t)}function vMe(e,t){return e.c=t)throw E(new e_e)}function _m(e,t){return MT(e,(Gh(t),new jfe(t)))}function vm(e,t){return MT(e,(Gh(t),new Mfe(t)))}function XNe(e,t,n){return kvt(e,P(t,12),P(n,12))}function ZNe(e){return fC(),P(e,12).g.c.length!=0}function QNe(e){return fC(),P(e,12).e.c.length!=0}function $Ne(e,t){return cC(),aE(t.a.o.a,e.a.o.a)}function ePe(e,t){(t.Bb&GH)!=0&&!e.a.o&&(e.a.o=t)}function tPe(e,t){t.Ug(`General 'Rotator`,1),vgt(e)}function nPe(e,t,n){t.qf(n,D(N(xh(e.b,n)))*e.a)}function rPe(e,t,n){return fM(),_C(e,t)&&_C(e,n)}function ym(e){return rj(),!e.Hc(G8)&&!e.Hc(q8)}function iPe(e){return e.e?$Ue(e.e):null}function bm(e){return Il(e)?``+e:Ect(e)}function aPe(e){for(var t=e;t.f;)t=t.f;return t}function oPe(e,t,n){return Sh(t,0,Op(t[0],n[0])),t}function xm(e,t,n,r){var i=e.i;i.i=t,i.a=n,i.b=r}function F(e,t,n,r){ju.call(this,e,t,n),this.b=r}function Sm(e,t,n,r,i){ub.call(this,e,t,n,r,i,-1)}function Cm(e,t,n,r,i){db.call(this,e,t,n,r,i,-1)}function wm(e,t,n,r){rp.call(this,e,t,n),this.b=r}function sPe(e){zSe.call(this,e,!1),this.a=!1}function cPe(){vSe.call(this,`LOOKAHEAD_LAYOUT`,1)}function lPe(e){this.b=e,cd.call(this,e),CTe(this)}function uPe(e){this.b=e,ud.call(this,e),wTe(this)}function Tm(e,t,n){this.a=e,nf.call(this,t,n,5,6)}function dPe(e,t,n,r){this.b=e,ju.call(this,t,n,r)}function fPe(e,t){this.b=e,_de.call(this,e.b),this.a=t}function pPe(e){this.a=m4e(e.a),this.b=new bf(e.b)}function mPe(e,t){gh(),rbe.call(this,e,bT(new Wi(t)))}function Em(e,t){return xP(),++W9,new Nh(e,t,0)}function Dm(e,t){return xP(),++W9,new Nh(6,e,t)}function Om(e,t){for(Gh(t);e.Ob();)t.Cd(e.Pb())}function km(e,t){return rl(t)?e_(e,t):!!Kp(e.f,t)}function Am(e,t){return t.Vh()?pT(e.b,P(t,54)):t}function hPe(e,t){return ff(e.substr(0,t.length),t)}function jm(e){return new pm(new ATe(e.a.length,e.a))}function Mm(e){return new k(e.c+e.b/2,e.d+e.a/2)}function gPe(e){return vu(~e.l&QF,~e.m&QF,~e.h&$F)}function Nm(e){return typeof e===EP||typeof e===kP}function Pm(e){e.f=new PCe(e),e.i=new FCe(e),++e.g}function _Pe(e){if(!e)throw E(new Hr);return e.d}function Fm(e){var t=yw(e);return jd(t!=null),t}function vPe(e){var t=u1e(e);return jd(t!=null),t}function Im(e,t){var n=e.a.gc();return RUe(t,n),n-t}function Lm(e,t){return e.a.zc(t,e)==null}function Rm(e,t){return e.a.zc(t,(rd(),vG))==null}function yPe(e){return new Mp(null,OPe(e,e.length))}function bPe(e,t,n){return ypt(e,P(t,42),P(n,176))}function zm(e,t,n){return PS(e.a,t),uMe(e.b,t.g,n)}function xPe(e,t,n){gm(n,e.a.c.length),uy(e.a,n,t)}function I(e,t,n,r){TQe(t,n,e.length),SPe(e,t,n,r)}function SPe(e,t,n,r){var i;for(i=t;i0?r.Math.log(e/t):-100}function DPe(e,t){return dT(e,t)<0?-1:+(dT(e,t)>0)}function qm(e,t){Kwe(e,j(t,160)?t:P(t,2036).Rl())}function Jm(e,t){if(e==null)throw E(new Li(t))}function OPe(e,t){return gqe(t,e.length),new kMe(e,t)}function Ym(e,t){return t?XS(e,t):!1}function kPe(){return xi(),U(O(MTt,1),Z,549,0,[tG])}function Xm(e){return e.e==0?e:new Bm(-e.e,e.d,e.a)}function APe(e,t){return aE(e.c.c+e.c.b,t.c.c+t.c.b)}function Zm(e,t){iy(e.d,t,e.b.b,e.b),++e.a,e.c=null}function jPe(e,t){return e.c?jPe(e.c,t):M(e.b,t),e}function MPe(e,t,n){var r=ax(e,t);return Yv(e,t,n),r}function NPe(e,t,n){var r;for(r=0;r=e.g}function Sh(e,t,n){return cDe(n==null||mdt(e,n)),e[t]=n}function Ch(e,t){return sv(t,e.length+1),e.substr(t)}function wh(e,t){for(Gh(t);e.c=e?new _be:RJe(e-1)}function Bh(e){return!e.a&&e.c?e.c.b:e.a}function Vh(e){return j(e,616)?e:new KLe(e)}function Hh(e){e.c?Hh(e.c):(lE(e),e.d=!0)}function Uh(e){e.c?e.c.$e():(e.d=!0,bot(e))}function _Fe(e){e.b=!1,e.c=!1,e.d=!1,e.a=!1}function vFe(e){return e.c.i.c==e.d.i.c}function yFe(e,t){var n=e.Ih(t);n>=0?e.ki(n):Qtt(e,t)}function bFe(e,t){e.c<0||e.b.b0;)e=e<<1|e<0;return e}function BFe(e,t){var n=new Eh(e);return Mr(t.c,n),n}function VFe(e,t){e.u.Hc((rj(),G8))&&bnt(e,t),RWe(e,t)}function rg(e,t){return A(e)===A(t)||e!=null&&NT(e,t)}function ig(e,t){return Gp(e.a,t)?e.b[P(t,22).g]:null}function HFe(){return No(),U(O(Oq,1),Z,489,0,[Dq])}function UFe(){return Bo(),U(O(PLt,1),Z,490,0,[v3])}function WFe(){return Vo(),U(O(ILt,1),Z,558,0,[y3])}function GFe(){return Ho(),U(O(xRt,1),Z,539,0,[O3])}function ag(e){return!e.n&&(e.n=new F(Q5,e,1,7)),e.n}function og(e){return!e.c&&(e.c=new F(e7,e,9,9)),e.c}function sg(e){return!e.c&&(e.c=new cf(H5,e,5,8)),e.c}function KFe(e){return!e.b&&(e.b=new cf(H5,e,4,7)),e.b}function cg(e){return e.j.c.length=0,yg(e.c),gOe(e.a),e}function lg(e){return e.e==SW&&gfe(e,p2e(e.g,e.b)),e.e}function ug(e){return e.f==SW&&vfe(e,O6e(e.g,e.b)),e.f}function dg(e,t,n,r){return lXe(e,t,n,!1),LT(e,r),e}function qFe(e,t){this.b=e,Hm.call(this,e,t),CTe(this)}function JFe(e,t){this.b=e,LOe.call(this,e,t),wTe(this)}function fg(e){this.d=e,this.a=this.d.b,this.b=this.d.c}function pg(e,t){this.b=e,this.c=t,this.a=new _o(this.b)}function mg(e,t){return sv(t,e.length),e.charCodeAt(t)}function YFe(e,t){fE(e,D(nS(t,`x`)),D(nS(t,`y`)))}function XFe(e,t){fE(e,D(nS(t,`x`)),D(nS(t,`y`)))}function hg(e,t){return lE(e),new Mp(e,new UGe(t,e.a))}function gg(e,t){return lE(e),new Mp(e,new WUe(t,e.a))}function _g(e,t){return lE(e),new fDe(e,new HUe(t,e.a))}function vg(e,t){return lE(e),new pDe(e,new UUe(t,e.a))}function ZFe(e,t){return new VIe(P(ph(e),50),P(ph(t),50))}function QFe(e,t){return aE(e.d.c+e.d.b/2,t.d.c+t.d.b/2)}function $Fe(e,t,n){n.a?Kx(e,t.b-e.f/2):Gx(e,t.a-e.g/2)}function eIe(e,t){return aE(e.g.c+e.g.b/2,t.g.c+t.g.b/2)}function tIe(e,t){return Pbe(),aE((Gh(e),e),(Gh(t),t))}function nIe(e){return e!=null&&po(x7,e.toLowerCase())}function yg(e){var t;for(t=e.Kc();t.Ob();)t.Pb(),t.Qb()}function bg(e){var t=e.b;return!t&&(e.b=t=new lde(e)),t}function xg(e){return HJe(e)||null}function rIe(e,t){var n=e/t,r=C_(n);return n>r&&++r,r}function iIe(e,t,n){var r=P(e.d.Kb(n),159);r&&r.Nb(t)}function aIe(e,t,n){gpt(e.a,n),PXe(n),sit(e.b,n),Wpt(t,n)}function Sg(e,t,n,r){this.a=e,this.c=t,this.b=n,this.d=r}function Cg(e,t,n,r){this.c=e,this.b=t,this.a=n,this.d=r}function oIe(e,t,n,r){this.c=e,this.b=t,this.d=n,this.a=r}function wg(e,t,n,r){this.c=e,this.d=t,this.b=n,this.a=r}function sIe(e,t,n,r){this.a=e,this.d=t,this.c=n,this.b=r}function Tg(e,t,n,r){this.a=e,this.e=t,this.d=n,this.c=r}function cIe(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function Eg(e,t,n){this.a=ryt,this.d=e,this.b=t,this.c=n}function Dg(e,t,n,r){so.call(this,e,t),this.a=n,this.b=r}function lIe(e,t){this.d=(Gh(e),e),this.a=16449,this.c=t}function uIe(e){this.a=new T,this.e=V(q9,X,53,e,0,2)}function dIe(e){e.Ug(`No crossing minimization`,1),e.Vg()}function fIe(){yi.call(this,`There is no more element.`)}function pIe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function mIe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function Og(e,t,n,r){this.e=e,this.a=t,this.c=n,this.d=r}function hIe(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function gIe(e,t,n,r){du(),GUe.call(this,t,n,r),this.a=e}function _Ie(e,t,n,r){du(),GUe.call(this,t,n,r),this.a=e}function kg(e,t,n){var r=n_t(e);return t.ti(n,r)}function Ag(e){var t,n=(t=new kr,t);return Nx(n,e),n}function jg(e){var t,n=(t=new kr,t);return i9e(n,e),n}function vIe(e,t){return yC(t,xh(e.f,t)),null}function yIe(e){return!e.b&&(e.b=new F(U5,e,12,3)),e.b}function bIe(e){return bp(e==null||Nm(e)&&e.Tm!==ne),e}function Mg(e){return e.n&&(e.e!==eyt&&e.je(),e.j=null),e}function Ng(e){if(RE(e.d),e.d.d!=e.c)throw E(new Vr)}function Pg(e){return jd(e.b0&&d8e(this)}function xIe(e,t){this.a=e,dDe.call(this,e,P(e.d,15).fd(t))}function SIe(e,t){return aE(Lp(e)*Ip(e),Lp(t)*Ip(t))}function CIe(e,t){return aE(Lp(e)*Ip(e),Lp(t)*Ip(t))}function wIe(e){return uj(e)&&ki(Od(J(e,(mP(),A1))))}function TIe(e,t){return fj(e,P(K(t,(mP(),Y1)),17),t)}function EIe(e,t){return P(K(e,(Y(),PQ)),15).Fc(t),t}function Lg(e,t){return e.b=t.b,e.c=t.c,e.d=t.d,e.a=t.a,e}function DIe(e,t,n,r){this.b=e,this.c=r,vl.call(this,t,n)}function OIe(e,t,n){e.i=0,e.e=0,t!=n&&RZe(e,t,n)}function kIe(e,t,n){e.i=0,e.e=0,t!=n&&zZe(e,t,n)}function AIe(e,t,n){return Lo(),N1e(P(xh(e.e,t),529),n)}function Rg(e){var t;return t=e.f,t||(e.f=new io(e,e.c))}function jIe(e,t){return CT(e.j,t.s,t.c)+CT(t.e,e.s,e.c)}function MIe(e,t){e.e&&!e.e.a&&(Qhe(e.e,t),MIe(e.e,t))}function NIe(e,t){e.d&&!e.d.a&&(Qhe(e.d,t),NIe(e.d,t))}function PIe(e,t){return-aE(Lp(e)*Ip(e),Lp(t)*Ip(t))}function FIe(e){return P(e.ld(),149).Pg()+`:`+PE(e.md())}function IIe(){EA(this,new $ue),this.wb=(vh(),z7),Ra()}function LIe(e){this.b=new T,nw(this.b,this.b),this.a=e}function zg(e,t){new vo,this.a=new ai,this.b=e,this.c=t}function Bg(){Bg=C,nK=new ue,rK=new ue,iK=new de}function Vg(){Vg=C,QG=new ae,$G=new se,eK=new ce}function Hg(){Hg=C,wEt=new Ge,EEt=new yNe,TEt=new Ke}function Ug(){Ug=C,zq=new T,Rq=new Dr,Lq=new T}function Wg(e,t){if(e==null)throw E(new Li(t));return e}function Gg(e){return!e.a&&(e.a=new F($5,e,10,11)),e.a}function Kg(e){return!e.q&&(e.q=new F(M7,e,11,10)),e.q}function R(e){return!e.s&&(e.s=new F(w7,e,21,17)),e.s}function RIe(e){return ph(e),z4e(new pm(Vu(e.a.Kc(),new d)))}function zIe(e,t){return $w(e),$w(t),eve(P(e,22),P(t,22))}function qg(e,t,n){hx(e,t,new Cn(ZOe(n)))}function Jg(e,t,n,r,i,a){db.call(this,e,t,n,r,i,a?-2:-1)}function BIe(e,t,n,r){el.call(this,t,n),this.b=e,this.a=r}function VIe(e,t){F_e.call(this,new mm(e)),this.a=e,this.b=t}function Yg(e){this.b=e,this.c=e,e.e=null,e.c=null,this.a=1}function HIe(e){Lf();var t=P(e.g,10);t.n.a=e.d.c+t.d.b}function Xg(){Xg=C;var e,t=!L0e();e=new b,lG=t?new y:e}function Zg(e){return Vg(),j(e,59)?new sa(e):new qu(e)}function Qg(e){return j(e,16)?new jp(P(e,16)):Dje(e.Kc())}function UIe(e){return new DTe(e,e.e.Rd().gc()*e.c.Rd().gc())}function WIe(e){return new OTe(e,e.e.Rd().gc()*e.c.Rd().gc())}function $g(e){return e&&e.hashCode?e.hashCode():td(e)}function e_(e,t){return t==null?!!Kp(e.f,null):dNe(e.i,t)}function GIe(e,t){var n=Gwe(e.a,t);return n&&(t.d=null),n}function KIe(e,t,n){return e.f?e.f.ef(t,n):!1}function t_(e,t,n,r){Sh(e.c[t.g],n.g,r),Sh(e.c[n.g],t.g,r)}function n_(e,t,n,r){Sh(e.c[t.g],t.g,n),Sh(e.b[t.g],t.g,r)}function qIe(e,t,n){return D(N(n.a))<=e&&D(N(n.b))>=t}function JIe(e,t){this.g=e,this.d=U(O(UJ,1),jR,10,0,[t])}function YIe(e){this.c=e,this.b=new Ja(P(ph(new qe),50))}function XIe(e){this.c=e,this.b=new Ja(P(ph(new dee),50))}function ZIe(e){this.b=e,this.a=new Ja(P(ph(new At),50))}function QIe(){this.b=new Jr,this.d=new vo,this.e=new $r}function r_(){this.c=new Fa,this.d=new Fa,this.e=new Fa}function i_(){this.a=new ai,this.b=(vS(3,hF),new Hy(3))}function a_(e,t){this.e=e,this.a=WW,this.b=glt(t),this.c=t}function o_(e){this.c=e.c,this.d=e.d,this.b=e.b,this.a=e.a}function $Ie(e,t,n,r,i,a){this.a=e,xS.call(this,t,n,r,i,a)}function eLe(e,t,n,r,i,a){this.a=e,xS.call(this,t,n,r,i,a)}function s_(e,t,n,r,i,a,o){return new ey(e.e,t,n,r,i,a,o)}function tLe(e,t,n){return n>=0&&ff(e.substr(n,t.length),t)}function nLe(e,t){return j(t,149)&&ff(e.b,P(t,149).Pg())}function rLe(e,t){return e.a?t.Gh().Kc():P(t.Gh(),71).Ii()}function iLe(e,t){var n=e.b.Qc(t);return bHe(n,e.b.gc()),n}function c_(e,t){if(e==null)throw E(new Li(t));return e}function l_(e){return e.u||=(_y(e),new FDe(e,e)),e.u}function u_(e){this.a=(Vg(),j(e,59)?new sa(e):new qu(e))}function d_(e){return P(NC(e,16),29)||e.ii()}function f_(e,t){var n=Ha(e.Rm);return t==null?n:n+`: `+t}function p_(e,t,n){return Zy(t,n,e.length),e.substr(t,n-t)}function aLe(e,t){Qd.call(this),Px(this),this.a=e,this.c=t}function oLe(e){!e||f_(e,e.ie())}function sLe(e){Qi(),r.setTimeout(function(){throw e},0)}function cLe(){return fO(),U(O(DK,1),Z,436,0,[EK,TK])}function lLe(){return dx(),U(O(AK,1),Z,435,0,[OK,kK])}function uLe(){return fx(),U(O(Uq,1),Z,432,0,[Vq,Hq])}function dLe(){return dC(),U(O(kOt,1),Z,517,0,[aY,iY])}function fLe(){return Bv(),U(O(lQ,1),Z,429,0,[sQ,cQ])}function pLe(){return px(),U(O(hZ,1),Z,428,0,[pZ,mZ])}function mLe(){return Ky(),U(O(QX,1),Z,431,0,[XX,ZX])}function hLe(){return Qb(),U(O(YMt,1),Z,430,0,[e2,t2])}function gLe(){return Vv(),U(O(LNt,1),Z,531,0,[b2,y2])}function _Le(){return AS(),U(O(NFt,1),Z,501,0,[b4,x4])}function vLe(){return O_(),U(O(KNt,1),Z,523,0,[w2,C2])}function yLe(){return k_(),U(O(JNt,1),Z,522,0,[T2,E2])}function bLe(){return Wy(),U(O(uPt,1),Z,528,0,[A2,k2])}function xLe(){return wb(),U(O(OZ,1),Z,488,0,[DZ,EZ])}function SLe(){return my(),U(O(bLt,1),Z,491,0,[s3,yLt])}function CLe(){return JC(),U(O(OLt,1),Z,492,0,[ELt,DLt])}function wLe(){return iv(),U(O(DFt,1),Z,433,0,[v4,EFt])}function TLe(){return _b(),U(O(RFt,1),Z,434,0,[LFt,D4])}function ELe(){return D_(),U(O(_Pt,1),Z,465,0,[j2,M2])}function DLe(){return Gy(),U(O(RLt,1),Z,438,0,[x3,b3])}function OLe(){return cw(),U(O(wRt,1),Z,437,0,[k3,CRt])}function kLe(){return zf(),U(O(P5,1),Z,347,0,[HBt,UBt])}function m_(e,t,n,r){return n>=0?e.Uh(t,n,r):e.Ch(null,n,r)}function h_(e){return e.b.b==0?e.a.sf():Yf(e.b)}function ALe(e){if(e.p!=5)throw E(new Rr);return nm(e.f)}function jLe(e){if(e.p!=5)throw E(new Rr);return nm(e.k)}function MLe(e){return A(e.a)===A((uC(),r9))&&bmt(e),e.a}function NLe(e,t){e.b=t,e.c>0&&e.b>0&&(e.g=Pp(e.c,e.b,e.a))}function PLe(e,t){e.c=t,e.c>0&&e.b>0&&(e.g=Pp(e.c,e.b,e.a))}function FLe(e,t){Qde(this,new k(e.a,e.b)),$de(this,Zf(t))}function g_(){I_e.call(this,new go(xx(12))),vTe(!0),this.a=2}function __(e,t,n){xP(),Tr.call(this,e),this.b=t,this.a=n}function ILe(e,t,n){du(),xr.call(this,t),this.a=e,this.b=n}function LLe(e){var t=e.c.d.b;e.b=t,e.a=e.c.d,t.a=e.c.d.b=e}function RLe(e){return e.b==0?null:(jd(e.b!=0),Ox(e,e.a.a))}function v_(e,t){return t==null?nl(Kp(e.f,null)):as(e.i,t)}function zLe(e,t,n,r,i){return new IA(e,(Sb(),fK),t,n,r,i)}function y_(e,t){return dHe(t),eJe(e,V(q9,HF,28,t,15,1),t)}function b_(e,t){return Wg(e,`set1`),Wg(t,`set2`),new ibe(e,t)}function BLe(e,t){return aG[e.charCodeAt(0)]??e}function VLe(e,t){var n=t,r=new ve;return Aht(e,n,r),r.d}function x_(e,t,n,r){var i=new QDe;t.a[n.g]=i,zm(e.b,r,i)}function HLe(e,t){return $d(Cd(Bqe(e.f,t)),e.f.d)}function S_(e){var t;xJe(e.a),owe(e.a),t=new ar(e.a),KE(t)}function ULe(e,t){Uct(e,!0),Dx(e.e.Rf(),new Af(e,!0,t))}function WLe(e,t){return Ug(),e==I_(xA(t))||e==I_(SA(t))}function GLe(e,t){return zx(),P(K(t,(rN(),p4)),17).a==e}function C_(e){return Math.max(Math.min(e,AP),-2147483648)|0}function KLe(e){this.a=P(ph(e),277),this.b=(Vg(),new UTe(e))}function qLe(e,t,n){this.i=new T,this.b=e,this.g=t,this.a=n}function JLe(e,t,n){this.a=new T,this.e=e,this.f=t,this.c=n}function w_(e,t,n){this.c=new T,this.e=e,this.f=t,this.b=n}function YLe(e){Qd.call(this),Px(this),this.a=e,this.c=!0}function XLe(e){function t(){}return t.prototype=e||{},new t}function ZLe(e){if(e.Ae())return null;var t=e.n;return UW[t]}function T_(e){return e.Db>>16==3?P(e.Cb,27):null}function E_(e){return e.Db>>16==9?P(e.Cb,27):null}function QLe(e){return e.Db>>16==6?P(e.Cb,74):null}function D_(){D_=C,j2=new rSe(cL,0),M2=new rSe(lL,1)}function O_(){O_=C,w2=new Uxe(lL,0),C2=new Uxe(cL,1)}function k_(){k_=C,T2=new Wxe(hL,0),E2=new Wxe(`UP`,1)}function $Le(){$Le=C,NTt=nT((xi(),U(O(MTt,1),Z,549,0,[tG])))}function eRe(e){var t=new qa(xx(e.length));return wZe(t,e),t}function tRe(e,t){return e.b+=t.b,e.c+=t.c,e.d+=t.d,e.a+=t.a,e}function nRe(e,t){return IXe(e,t)?(oJe(e),!0):!1}function A_(e,t){if(t==null)throw E(new zr);return K0e(e,t)}function j_(e,t){var n=e.q.getHours();e.q.setDate(t),dN(e,n)}function rRe(e,t,n){var r=e.Ih(t);r>=0?e.bi(r,n):Pat(e,t,n)}function iRe(e,t){var n=e.Ih(t);return n>=0?e.Wh(n):cj(e,t)}function aRe(e,t){var n;for(ph(t),n=e.a;n;n=n.c)t.Yd(n.g,n.i)}function M_(e,t,n){e.b=new VS(kZe(e,t,n).c.length)}function N_(e,t,n){R_(),e&&Qh(p7,e,t),e&&Qh(f7,e,n)}function oRe(e,t){return If(),rd(),P(t.a,17).a0}function lRe(e){var t=e.d;return t=e.bj(e.f),tb(e,t),t.Ob()}function uRe(e,t){var n=new Ap(t);return L7e(n,e),new bf(n)}function dRe(e){if(e.p!=0)throw E(new Rr);return cl(e.f,0)}function fRe(e){if(e.p!=0)throw E(new Rr);return cl(e.k,0)}function pRe(e){return e.Db>>16==7?P(e.Cb,241):null}function F_(e){return e.Db>>16==6?P(e.Cb,241):null}function mRe(e){return e.Db>>16==7?P(e.Cb,167):null}function I_(e){return e.Db>>16==11?P(e.Cb,27):null}function L_(e){return e.Db>>16==17?P(e.Cb,29):null}function hRe(e){return e.Db>>16==3?P(e.Cb,155):null}function gRe(e){var t;return lE(e),t=new Jr,hg(e,new Wfe(t))}function _Re(e,t){var n=e.a=e.a||[];return n[t]||(n[t]=e.ve(t))}function vRe(e,t){var n=e.q.getHours();e.q.setMonth(t),dN(e,n)}function yRe(e,t){Fu(this),this.f=t,this.g=e,Mg(this),this.je()}function bRe(e,t){this.a=e,this.c=xu(this.a),this.b=new o_(t)}function xRe(e,t,n){this.a=t,this.c=e,this.b=(ph(n),new bf(n))}function SRe(e,t,n){this.a=t,this.c=e,this.b=(ph(n),new bf(n))}function CRe(e){this.a=e,this.b=V(MNt,X,2043,e.e.length,0,2)}function wRe(){this.a=new Rl,this.e=new Jr,this.g=0,this.i=0}function R_(){R_=C,p7=new Dr,f7=new Dr,USe(tEt,new Ise)}function TRe(){TRe=C,mNt=tm(new Zh,(vA(),SJ),(yP(),nX))}function ERe(){ERe=C,hNt=tm(new Zh,(vA(),SJ),(yP(),nX))}function DRe(){DRe=C,_Nt=tm(new Zh,(vA(),SJ),(yP(),nX))}function ORe(){ORe=C,zNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function z_(){z_=C,HNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function kRe(){kRe=C,GNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function B_(){B_=C,XNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function V_(e,t,n,r,i,a){return new Hb(e.e,t,e.Lj(),n,r,i,a)}function H_(e,t,n){return t==null?XA(e.f,null,n):uE(e.i,t,n)}function U_(e,t){e.c&&Db(e.c.g,e),e.c=t,e.c&&M(e.c.g,e)}function W_(e,t){e.c&&Db(e.c.a,e),e.c=t,e.c&&M(e.c.a,e)}function G_(e,t){e.i&&Db(e.i.j,e),e.i=t,e.i&&M(e.i.j,e)}function K_(e,t){e.d&&Db(e.d.e,e),e.d=t,e.d&&M(e.d.e,e)}function q_(e,t){e.a&&Db(e.a.k,e),e.a=t,e.a&&M(e.a.k,e)}function J_(e,t){e.b&&Db(e.b.f,e),e.b=t,e.b&&M(e.b.f,e)}function ARe(e,t){rFe(e,e.b,e.c),P(e.b.b,68),t&&P(t.b,68).b}function jRe(e,t){return aE(P(e.c,65).c.e.b,P(t.c,65).c.e.b)}function MRe(e,t){return aE(P(e.c,65).c.e.a,P(t.c,65).c.e.a)}function NRe(e){return Qw(),rd(),P(e.a,86).d.e!=0}function Y_(e,t){j(e.Cb,184)&&(P(e.Cb,184).tb=null),GS(e,t)}function X_(e,t){j(e.Cb,90)&&$A(_y(P(e.Cb,90)),4),GS(e,t)}function PRe(e,t){hE(e,t),j(e.Cb,90)&&$A(_y(P(e.Cb,90)),2)}function FRe(e,t){t.c!=null&&Dh(e,new mh(t.c))}function IRe(e){var t,n=(Ra(),t=new kr,t);return Nx(n,e),n}function LRe(e){var t,n=(Ra(),t=new kr,t);return Nx(n,e),n}function RRe(e){for(var t;;)if(t=e.Pb(),!e.Ob())return t}function zRe(e,t,n){return M(e.a,(eg(),ik(t,n),new oo(t,n))),e}function Z_(e,t){return Qo(),ex(t)?new hp(t,e):new Qc(t,e)}function Q_(e){return AM(),dT(e,0)>=0?yD(e):Xm(yD(kb(e)))}function BRe(e){var t=P(cp(e.b),9);return new xf(e.a,t,e.c)}function VRe(e,t){var n=P(TT(Rg(e.a),t),16);return n?n.gc():0}function HRe(e,t,n){var r;I$e(t,n,e.c.length),r=n-t,wye(e.c,t,r)}function $_(e,t,n){I$e(t,n,e.gc()),this.c=e,this.a=t,this.b=n-t}function ev(e){this.c=new vo,this.b=e.b,this.d=e.c,this.a=e.a}function tv(e){this.a=r.Math.cos(e),this.b=r.Math.sin(e)}function nv(e,t,n,r){this.c=e,this.d=r,q_(this,t),J_(this,n)}function URe(e,t){P_e.call(this,new go(xx(e))),vS(t,Jvt),this.a=t}function WRe(e,t,n){return new IA(e,(Sb(),dK),null,!1,t,n)}function GRe(e,t,n){return new IA(e,(Sb(),pK),t,n,null,!1)}function KRe(){return Zw(),U(O(xK,1),Z,108,0,[vK,yK,bK])}function qRe(){return Xb(),U(O(IEt,1),Z,472,0,[sq,oq,aq])}function JRe(){return Cb(),U(O(NEt,1),Z,471,0,[rq,nq,iq])}function YRe(){return Ix(),U(O($K,1),Z,237,0,[XK,ZK,QK])}function XRe(){return Yb(),U(O(_J,1),Z,391,0,[hJ,mJ,gJ])}function ZRe(){return kS(),U(O(MX,1),Z,372,0,[jX,AX,kX])}function QRe(){return bS(),U(O(nZ,1),Z,322,0,[eZ,$X,tZ])}function $Re(){return lS(),U(O(oZ,1),Z,351,0,[rZ,aZ,iZ])}function eze(){return _w(),U(O(ckt,1),Z,460,0,[_Z,gZ,vZ])}function tze(){return qC(),U(O(rQ,1),Z,299,0,[tQ,nQ,eQ])}function nze(){return Zb(),U(O(gkt,1),Z,311,0,[aQ,oQ,iQ])}function rze(){return hT(),U(O(PMt,1),Z,390,0,[P0,NMt,F0])}function ize(){return uS(),U(O(ZMt,1),Z,463,0,[i2,n2,r2])}function aze(){return CC(),U(O(tNt,1),Z,387,0,[$Mt,a2,eNt])}function oze(){return Nw(),U(O(rNt,1),Z,349,0,[c2,o2,s2])}function sze(){return Xw(),U(O(oNt,1),Z,350,0,[l2,aNt,u2])}function cze(){return cS(),U(O(uNt,1),Z,352,0,[lNt,d2,cNt])}function lze(){return sw(),U(O(fNt,1),Z,388,0,[p2,m2,f2])}function uze(){return sS(),U(O(ANt,1),Z,464,0,[h2,g2,_2])}function rv(e){return Sw(U(O(K3,1),X,8,0,[e.i.n,e.n,e.a]))}function dze(){return Pw(),U(O(FPt,1),Z,392,0,[PPt,B2,z2])}function fze(){fze=C,kFt=tm(new Zh,(Ok(),F2),(LM(),CPt))}function iv(){iv=C,v4=new iSe(`DFS`,0),EFt=new iSe(`BFS`,1)}function pze(e,t,n){var r=new zie;r.b=t,r.a=n,++t.b,M(e.d,r)}function mze(e,t,n){var r=new Vl(n.d);$d(r,e),fE(t,r.a,r.b)}function hze(e,t){cTe(e,nm(uv(lm(t,24),jI)),nm(uv(t,jI)))}function av(e,t){if(e<0||e>t)throw E(new Mi(HI+e+UI+t))}function ov(e,t){if(e<0||e>=t)throw E(new Mi(HI+e+UI+t))}function sv(e,t){if(e<0||e>=t)throw E(new ra(HI+e+UI+t))}function cv(e,t){this.b=(Gh(e),e),this.a=(t&uI)==0?t|64|ZP:t}function gze(e){var t;return lE(e),t=(Bg(),Bg(),rK),Cx(e,t)}function _ze(e,t,n){var r=vN(e,t,!1);return r.b<=t&&r.a<=n}function vze(){return Tb(),U(O(wLt,1),Z,439,0,[c3,CLt,SLt])}function yze(){return TE(),U(O(LIt,1),Z,394,0,[IIt,Q4,FIt])}function bze(){return ED(),U(O(kIt,1),Z,445,0,[L4,R4,z4])}function xze(){return LO(),U(O(jIt,1),Z,456,0,[B4,H4,V4])}function Sze(){return Yw(),U(O(HFt,1),Z,393,0,[O4,BFt,VFt])}function Cze(){return SC(),U(O(DIt,1),Z,300,0,[I4,EIt,TIt])}function wze(){return _T(),U(O(yBt,1),Z,346,0,[_8,g8,v8])}function Tze(){return KT(),U(O(_3,1),Z,444,0,[m3,h3,g3])}function Eze(){return Lx(),U(O(rBt,1),Z,278,0,[o8,s8,c8])}function Dze(){return gT(),U(O(BBt,1),Z,280,0,[zBt,M5,N5])}function lv(e){return ph(e),j(e,16)?new bf(P(e,16)):Xf(e.Kc())}function Oze(e,t){return e&&e.equals?e.equals(t):A(e)===A(t)}function uv(e,t){return MC(BNe(Il(e)?zC(e):e,Il(t)?zC(t):t))}function dv(e,t){return MC(VNe(Il(e)?zC(e):e,Il(t)?zC(t):t))}function fv(e,t){return MC(HNe(Il(e)?zC(e):e,Il(t)?zC(t):t))}function kze(e,t){var n=(Gh(e),e).g;return sDe(!!n),Gh(t),n(t)}function Aze(e,t){var n,r=Im(e,t);return n=e.a.fd(r),new tbe(e,n)}function jze(e){return e.Db>>16==6?P(xj(e),241):null}function Mze(e){if(e.p!=2)throw E(new Rr);return nm(e.f)&OF}function Nze(e){if(e.p!=2)throw E(new Rr);return nm(e.k)&OF}function z(e){return jd(e.ar)}function Yze(e,t){var n=jb(t);return P(xh(e.c,n),17).a}function gv(e,t,n){var r=e.d[t.p];e.d[t.p]=e.d[n.p],e.d[n.p]=r}function Xze(e,t,n){var r;e.n&&t&&n&&(r=new Ese,M(e.e,r))}function _v(e,t){if(Lm(e.a,t),t.d)throw E(new yi(xyt));t.d=e}function Zze(e,t){this.a=new T,this.d=new T,this.f=e,this.c=t}function Qze(){this.c=new Hwe,this.a=new JUe,this.b=new Kge,Fbe()}function $ze(){lw(),this.b=new Dr,this.a=new Dr,this.c=new T}function eBe(e,t,n){this.d=e,this.j=t,this.e=n,this.o=-1,this.p=3}function tBe(e,t,n){this.d=e,this.k=t,this.f=n,this.o=-1,this.p=5}function nBe(e,t,n,r,i,a){Gqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function rBe(e,t,n,r,i,a){Kqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function iBe(e,t,n,r,i,a){vUe.call(this,e,t,n,r,i),a&&(this.o=-2)}function aBe(e,t,n,r,i,a){Yqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function oBe(e,t,n,r,i,a){yUe.call(this,e,t,n,r,i),a&&(this.o=-2)}function sBe(e,t,n,r,i,a){qqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function cBe(e,t,n,r,i,a){Jqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function lBe(e,t,n,r,i,a){bUe.call(this,e,t,n,r,i),a&&(this.o=-2)}function uBe(e,t,n,r){xr.call(this,n),this.b=e,this.c=t,this.d=r}function dBe(e,t){this.f=e,this.a=(By(),u9),this.c=u9,this.b=t}function fBe(e,t){this.g=e,this.d=(By(),d9),this.a=d9,this.b=t}function pBe(e,t){!e.c&&(e.c=new DC(e,0)),ON(e.c,(UN(),w9),t)}function mBe(e,t){return Wit(e,t,j(t,102)&&(P(t,19).Bb&pI)!=0)}function hBe(e,t){return DPe(LC(e.q.getTime()),LC(t.q.getTime()))}function gBe(e){return yp(e.e.Rd().gc()*e.c.Rd().gc(),16,new ode(e))}function _Be(e){return!!e.u&&Jv(e.u.a).i!=0&&!(e.n&&QO(e.n))}function vBe(e){return!!e.a&&Ib(e.a.a).i!=0&&!(e.b&&$O(e.b))}function yBe(e,t){return t==0?!!e.o&&e.o.f!=0:mO(e,t)}function bBe(e,t,n){var r=P(e.Zb().xc(t),16);return!!r&&r.Hc(n)}function xBe(e,t,n){var r=P(e.Zb().xc(t),16);return!!r&&r.Mc(n)}function SBe(e,t){var n=1-t;return e.a[n]=FS(e.a[n],n),FS(e,t)}function CBe(e,t){var n,r=uv(e,_I);return n=cm(t,32),dv(n,r)}function wBe(e,t,n){Z3e(new xRe((ph(e),new bf(e)),t,n))}function vv(e,t,n){Q3e(new SRe((ph(e),new bf(e)),t,n))}function yv(e,t,n,r,i,a){return lXe(e,t,n,a),IT(e,r),zT(e,i),e}function TBe(e,t,n,r){return e.a+=``+p_(t==null?IP:PE(t),n,r),e}function bv(e,t){this.a=e,qn.call(this,e),av(t,e.gc()),this.b=t}function EBe(e){this.a=V(WW,FP,1,dZe(r.Math.max(8,e))<<1,5,1)}function xv(e){return P(rO(e,V(UJ,jR,10,e.c.length,0,1)),199)}function Sv(e){return P(rO(e,V(VJ,AR,18,e.c.length,0,1)),483)}function DBe(e){return e.a?e.e.length==0?e.a.a:e.a.a+(``+e.e):e.c}function Cv(e){for(;e.d>0&&e.a[--e.d]==0;);e.a[e.d++]==0&&(e.e=0)}function OBe(e){return jd(e.b.b!=e.d.a),e.c=e.b=e.b.b,--e.a,e.c.c}function kBe(e,t,n){e.a=t,e.c=n,e.b.a.$b(),Fg(e.d),Wr(e.e.a.c,0)}function ABe(e,t){var n;e.e=new D_e,n=sM(t),hu(n,e.c),pct(e,n,0)}function wv(e,t,n,r){var i=new Koe;i.a=t,i.b=n,i.c=r,up(e.a,i)}function B(e,t,n,r){var i=new Koe;i.a=t,i.b=n,i.c=r,up(e.b,i)}function jBe(e,t,n){if(e<0||tn)throw E(new Mi(yet(e,t,n)))}function Tv(e,t){if(e<0||e>=t)throw E(new Mi(jtt(e,t)));return e}function MBe(e){if(!(`stack`in e))try{throw e}catch{}return e}function Ev(e){return Lo(),j(e.g,10)?P(e.g,10):null}function NBe(e){return!bg(e).dc()&&(gwe(e,new h),!0)}function Dv(e){var t;return Il(e)?(t=e,t==-0?0:t):lKe(e)}function PBe(e,t){return j(t,44)?lk(e.a,P(t,44)):!1}function FBe(e,t){return j(t,44)?lk(e.a,P(t,44)):!1}function IBe(e,t){return j(t,44)?lk(e.a,P(t,44)):!1}function LBe(e){var t;return Hh(e),t=new fe,Qa(e.a,new Vfe(t)),t}function RBe(){var e,t=(n=(e=new kr,e),n),n;return M(fHt,t),t}function Ov(e){var t;return Hh(e),t=new pe,Qa(e.a,new Hfe(t)),t}function zBe(e,t){return e.a<=e.b&&(t.Dd(e.a++),!0)}function BBe(e){rC.call(this,e,(Sb(),uK),null,!1,null,!1)}function VBe(){VBe=C,hDt=nT((No(),U(O(Oq,1),Z,489,0,[Dq])))}function HBe(){HBe=C,wNt=LFe(G(1),G(4)),CNt=LFe(G(1),G(2))}function UBe(e,t){return new Vf(t,wd(xu(t.e),e,e),(rd(),!0))}function kv(e){return new Hy((vS(e,_F),bx(yE(yE(5,e),e/10|0))))}function WBe(e){return yp(e.e.Rd().gc()*e.c.Rd().gc(),273,new ade(e))}function GBe(e){return P(rO(e,V(EOt,Sbt,12,e.c.length,0,1)),2042)}function KBe(e){return z_(),!gy(e)&&!(!gy(e)&&e.c.i.c==e.d.i.c)}function qBe(e,t){return Rx(),P(K(t,(rN(),u4)),17).a>=e.gc()}function Av(e,t){L_t(t,e),Yje(e.d),Yje(P(K(e,(mP(),L1)),214))}function jv(e,t){R_t(t,e),Xje(e.d),Xje(P(K(e,(mP(),L1)),214))}function JBe(e,t,n){e.d&&Db(e.d.e,e),e.d=t,e.d&&Jp(e.d.e,n,e)}function YBe(e,t,n){return n.f.c.length>0?bPe(e.a,t,n):bPe(e.b,t,n)}function XBe(e,t,n){var r=b2e();try{return qDe(e,t,n)}finally{CHe(r)}}function Mv(e,t){var n=A_(e,t),r=null;return n&&(r=n.pe()),r}function Nv(e,t){var n=A_(e,t),r=null;return n&&(r=n.se()),r}function Pv(e,t){var n=ax(e,t),r=null;return n&&(r=n.se()),r}function Fv(e,t){var n=A_(e,t),r=null;return n&&(r=ket(n)),r}function ZBe(e,t,n){var r=RD(n);return PM(e.g,r,t),PM(e.i,t,n),t}function QBe(e,t,n){this.d=new nme(this),this.e=e,this.i=t,this.f=n}function $Be(e,t,n,r){this.e=null,this.c=e,this.d=t,this.a=n,this.b=r}function eVe(e,t,n,r){jwe(this),this.c=e,this.e=t,this.f=n,this.b=r}function tVe(e,t,n,r){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1}function nVe(e,t,n,r){return j(n,59)?new lEe(e,t,n,r):new qNe(e,t,n,r)}function Iv(e){return j(e,16)?P(e,16).dc():!e.Kc().Ob()}function rVe(e){if(e.e.g!=e.b)throw E(new Vr);return!!e.c&&e.d>0}function Lv(e){return jd(e.b!=e.d.c),e.c=e.b,e.b=e.b.a,++e.a,e.c.c}function iVe(e,t){Gh(t),Sh(e.a,e.c,t),e.c=e.c+1&e.a.length-1,L3e(e)}function Rv(e,t){Gh(t),e.b=e.b-1&e.a.length-1,Sh(e.a,e.b,t),L3e(e)}function aVe(e){var t=e.Gh();this.a=j(t,71)?P(t,71).Ii():t.Kc()}function oVe(e){return new cv(wqe(P(e.a.md(),16).gc(),e.a.ld()),16)}function sVe(){sVe=C,FLt=nT((Bo(),U(O(PLt,1),Z,490,0,[v3])))}function cVe(){cVe=C,LLt=nT((Vo(),U(O(ILt,1),Z,558,0,[y3])))}function lVe(){lVe=C,SRt=nT((Ho(),U(O(xRt,1),Z,539,0,[O3])))}function uVe(){return YD(),U(O(zJ,1),Z,389,0,[RJ,IJ,FJ,LJ])}function dVe(){return Sb(),U(O(mK,1),Z,304,0,[uK,dK,fK,pK])}function fVe(){return TO(),U(O(lDt,1),Z,332,0,[gq,hq,_q,vq])}function pVe(){return wO(),U(O(pDt,1),Z,406,0,[wq,Cq,Tq,Eq])}function mVe(){return KC(),U(O(sDt,1),Z,417,0,[mq,dq,fq,pq])}function hVe(){return ow(),U(O(mOt,1),Z,416,0,[kJ,MJ,AJ,jJ])}function gVe(){return aw(),U(O(KOt,1),Z,421,0,[bX,xX,SX,CX])}function _Ve(){return iw(),U(O(FOt,1),Z,371,0,[gX,mX,hX,pX])}function vVe(){return IO(),U(O(B0,1),Z,203,0,[R0,z0,L0,I0])}function yVe(){return ID(),U(O(qMt,1),Z,284,0,[Z0,KMt,Q0,$0])}function bVe(e){var t;return e.j==(nP(),m5)&&(t=krt(e),$u(t,X8))}function xVe(e,t){var n=t.a;U_(n,t.c.d),K_(n,t.d.d),vC(n.a,e.n)}function SVe(e,t){var n=P(ix(e.b,t),67);return!n&&(n=new vo),n}function zv(e){return Lo(),j(e.g,154)?P(e.g,154):null}function CVe(e){e.a=null,e.e=null,Wr(e.b.c,0),Wr(e.f.c,0),e.c=null}function Bv(){Bv=C,sQ=new Js(sL,0),cQ=new Js(`TOP_LEFT`,1)}function Vv(){Vv=C,b2=new zxe(`UPPER`,0),y2=new zxe(`LOWER`,1)}function wVe(e,t){return Ou(new k(t.e.a+t.f.a/2,t.e.b+t.f.b/2),e)}function TVe(e,t){return P(Ju(_m(P(Dy(e.k,t),15).Oc(),HX)),113)}function EVe(e,t){return P(Ju(vm(P(Dy(e.k,t),15).Oc(),HX)),113)}function DVe(){return Ok(),U(O(yPt,1),Z,405,0,[N2,P2,F2,I2])}function OVe(){return Jw(),U(O(wFt,1),Z,353,0,[_4,h4,g4,m4])}function kVe(){return uk(),U(O(CIt,1),Z,354,0,[F4,xIt,SIt,bIt])}function AVe(){return TD(),U(O(S5,1),Z,386,0,[b5,x5,y5,v5])}function jVe(){return kk(),U(O(xBt,1),Z,291,0,[S8,y8,b8,x8])}function MVe(){return wE(),U(O(p8,1),Z,223,0,[f8,u8,l8,d8])}function NVe(){return ZE(),U(O(JBt,1),Z,320,0,[F5,GBt,qBt,KBt])}function PVe(){return Mw(),U(O(eVt,1),Z,415,0,[I5,QBt,ZBt,$Bt])}function FVe(e){return R_(),km(p7,e)?P(xh(p7,e),341).Qg():null}function Hv(e,t,n){return t<0?cj(e,n):P(n,69).wk().Bk(e,e.hi(),t)}function IVe(e,t,n){var r=RD(n);return PM(e.j,r,t),Qh(e.k,t,n),t}function LVe(e,t,n){var r=RD(n);return PM(e.d,r,t),Qh(e.e,t,n),t}function RVe(e){var t=(Ia(),n=new nn,n),n;return e&&Hj(t,e),t}function zVe(e){var t=e.aj(e.i);return e.i>0&&tN(e.g,0,t,0,e.i),t}function BVe(e,t){var n;for(n=e.j.c.length;n>24}function WVe(e){if(e.p!=1)throw E(new Rr);return nm(e.k)<<24>>24}function GVe(e){if(e.p!=7)throw E(new Rr);return nm(e.k)<<16>>16}function KVe(e){if(e.p!=7)throw E(new Rr);return nm(e.f)<<16>>16}function Uv(e,t){return t.e==0||e.e==0?JG:(pM(),Xj(e,t))}function qVe(e,t){return A(t)===A(e)?`(this Map)`:t==null?IP:PE(t)}function JVe(e,t,n){return dm(N(nl(Kp(e.f,t))),N(nl(Kp(e.f,n))))}function YVe(e,t,n){var r=P(xh(e.g,n),60);M(e.a.c,new Kc(t,r))}function XVe(e,t,n){e.i=0,e.e=0,t!=n&&(zZe(e,t,n),RZe(e,t,n))}function ZVe(e,t,n,r,i){M(t,vtt(i,mat(i,n,r))),p9e(e,i,t)}function QVe(e,t,n,r,i){this.i=e,this.a=t,this.e=n,this.j=r,this.f=i}function $Ve(e,t){r_.call(this),this.a=e,this.b=t,M(this.a.b,this)}function eHe(e){this.b=new Dr,this.c=new Dr,this.d=new Dr,this.a=e}function tHe(e,t){var n=new na;return e.Gd(n),n.a+=`..`,t.Hd(n),n.a}function nHe(e,t){for(var n=t;n;)Sd(e,n.i,n.j),n=I_(n);return e}function rHe(e,t,n){var r=RD(n);return Qh(e.b,r,t),Qh(e.c,t,n),t}function Wv(e){for(var t=0;e.Ob();)e.Pb(),t=yE(t,1);return bx(t)}function Gv(e,t){Qo();var n=P(e,69).vk();return L9e(n,t),n.xl(t)}function iHe(e,t,n){if(n){var r=n.oe();e.a[t]=r(n)}else delete e.a[t]}function aHe(e,t){var n=e.q.getHours();e.q.setFullYear(t+VF),dN(e,n)}function oHe(e,t){return P(t==null?nl(Kp(e.f,null)):as(e.i,t),288)}function sHe(e,t){return e==(DA(),JJ)&&t==JJ?4:e==JJ||t==JJ?8:32}function Kv(e,t,n){return sN(e,t,n,j(t,102)&&(P(t,19).Bb&pI)!=0)}function cHe(e,t,n){return pN(e,t,n,j(t,102)&&(P(t,19).Bb&pI)!=0)}function lHe(e,t,n){return tat(e,t,n,j(t,102)&&(P(t,19).Bb&pI)!=0)}function uHe(e){e.b!=e.c&&(e.a=V(WW,FP,1,8,5,1),e.b=0,e.c=0)}function qv(e){return jd(e.a=0&&e.a[n]===t[n];n--);return n<0}function oy(e){var t;return e?new Ap(e):(t=new Rl,HS(t,e),t)}function SHe(e,t){var n,r=!1;do n=mZe(e,t),r|=n;while(n);return r}function CHe(e){e&&OKe((Si(),cG)),--oG,e&&sG!=-1&&(gCe(sG),sG=-1)}function sy(e){s7e(),cTe(this,nm(uv(lm(e,24),jI)),nm(uv(e,jI)))}function wHe(){wHe=C,DEt=nT((fO(),U(O(DK,1),Z,436,0,[EK,TK])))}function THe(){THe=C,OEt=nT((dx(),U(O(AK,1),Z,435,0,[OK,kK])))}function EHe(){EHe=C,NDt=nT((fx(),U(O(Uq,1),Z,432,0,[Vq,Hq])))}function DHe(){DHe=C,AOt=nT((dC(),U(O(kOt,1),Z,517,0,[aY,iY])))}function OHe(){OHe=C,vkt=nT((Bv(),U(O(lQ,1),Z,429,0,[sQ,cQ])))}function kHe(){kHe=C,skt=nT((px(),U(O(hZ,1),Z,428,0,[pZ,mZ])))}function AHe(){AHe=C,dkt=nT((wb(),U(O(OZ,1),Z,488,0,[DZ,EZ])))}function jHe(){jHe=C,XMt=nT((Qb(),U(O(YMt,1),Z,430,0,[e2,t2])))}function MHe(){MHe=C,RNt=nT((Vv(),U(O(LNt,1),Z,531,0,[b2,y2])))}function NHe(){NHe=C,rkt=nT((Ky(),U(O(QX,1),Z,431,0,[XX,ZX])))}function PHe(){PHe=C,OFt=nT((iv(),U(O(DFt,1),Z,433,0,[v4,EFt])))}function FHe(){FHe=C,PFt=nT((AS(),U(O(NFt,1),Z,501,0,[b4,x4])))}function IHe(){IHe=C,qNt=nT((O_(),U(O(KNt,1),Z,523,0,[w2,C2])))}function LHe(){LHe=C,YNt=nT((k_(),U(O(JNt,1),Z,522,0,[T2,E2])))}function RHe(){RHe=C,dPt=nT((Wy(),U(O(uPt,1),Z,528,0,[A2,k2])))}function zHe(){zHe=C,vPt=nT((D_(),U(O(_Pt,1),Z,465,0,[j2,M2])))}function BHe(){BHe=C,zFt=nT((_b(),U(O(RFt,1),Z,434,0,[LFt,D4])))}function VHe(){VHe=C,xLt=nT((my(),U(O(bLt,1),Z,491,0,[s3,yLt])))}function HHe(){HHe=C,kLt=nT((JC(),U(O(OLt,1),Z,492,0,[ELt,DLt])))}function UHe(){UHe=C,zLt=nT((Gy(),U(O(RLt,1),Z,438,0,[x3,b3])))}function WHe(){WHe=C,TRt=nT((cw(),U(O(wRt,1),Z,437,0,[k3,CRt])))}function GHe(){GHe=C,WBt=nT((zf(),U(O(P5,1),Z,347,0,[HBt,UBt])))}function KHe(){return GT(),U(O(a8,1),Z,88,0,[r8,n8,t8,e8,i8])}function qHe(){return nP(),U(O(_5,1),TR,64,0,[h5,Z8,X8,m5,g5])}function JHe(e,t,n){return P(t==null?XA(e.f,null,n):uE(e.i,t,n),288)}function YHe(e){return(e.k==(DA(),JJ)||e.k==GJ)&&yd(e,(Y(),bQ))}function cy(e){return e.c&&e.d?Gze(e.c)+`->`+Gze(e.d):`e_`+td(e)}function ly(e,t){var n,r;for(Gh(t),r=e.Kc();r.Ob();)n=r.Pb(),t.Cd(n)}function XHe(e,t){var n=new bi;qg(n,`x`,t.a),qg(n,`y`,t.b),Dh(e,n)}function ZHe(e,t){var n=new bi;qg(n,`x`,t.a),qg(n,`y`,t.b),Dh(e,n)}function QHe(e,t){for(var n=t;n;)Sd(e,-n.i,-n.j),n=I_(n);return e}function $He(e,t){for(var n=t,r=0;n>0;)r+=e.a[n],n-=n&-n;return r}function uy(e,t,n){var r=(ov(t,e.c.length),e.c[t]);return e.c[t]=n,r}function eUe(e,t,n){e.a.c.length=0,Tmt(e,t,n),e.a.c.length==0||Mut(e,t)}function dy(e){e.i=0,is(e.b,null),is(e.c,null),e.a=null,e.e=null,++e.g}function fy(){fy=C,_K=!0,mEt=!1,hEt=!1,_Et=!1,gEt=!1}function py(e){fy(),!_K&&(this.c=e,this.e=!0,this.a=new T)}function tUe(e,t){this.c=0,this.b=t,oCe.call(this,e,17493),this.a=this.c}function nUe(e){Cvt(),lge(this),this.a=new vo,tQe(this,e),up(this.a,e)}function rUe(){au(this),this.b=new k(cI,cI),this.a=new k(lI,lI)}function my(){my=C,s3=new sSe(YR,0),yLt=new sSe(`TARGET_WIDTH`,1)}function hy(e,t){return(lE(e),Xa(new Mp(e,new UGe(t,e.a)))).Bd(SK)}function iUe(){return vA(),U(O(CJ,1),Z,367,0,[vJ,yJ,bJ,xJ,SJ])}function aUe(){return tA(),U(O(JOt,1),Z,375,0,[TX,DX,OX,EX,wX])}function oUe(){return FD(),U(O(fZ,1),Z,348,0,[cZ,sZ,uZ,dZ,lZ])}function sUe(){return CO(),U(O(RMt,1),Z,323,0,[LMt,H0,U0,V0,W0])}function cUe(){return XE(),U(O(y$,1),Z,171,0,[v$,m$,h$,g$,_$])}function lUe(){return iA(),U(O(FFt,1),Z,368,0,[T4,S4,E4,C4,w4])}function uUe(){return Wj(),U(O(jLt,1),Z,373,0,[u3,l3,f3,d3,p3])}function dUe(){return MA(),U(O(ULt,1),Z,324,0,[BLt,S3,HLt,C3,VLt])}function fUe(){return uO(),U(O(L3,1),Z,170,0,[F3,P3,M3,I3,N3])}function pUe(){return pO(),U(O(I8,1),Z,256,0,[P8,F8,wBt,N8,TBt])}function mUe(e){return Qi(),function(){return XBe(e,this,arguments)}}function gy(e){return!e.c||!e.d?!1:!!e.c.i&&e.c.i==e.d.i}function hUe(e,t){return j(t,143)?ff(e.c,P(t,143).c):!1}function _y(e){return e.t||(e.t=new Bhe(e),WT(new K_e(e),0,e.t)),e.t}function gUe(e){this.b=e,Lu.call(this,e),this.a=P(NC(this.b.a,4),129)}function _Ue(e){this.b=e,ld.call(this,e),this.a=P(NC(this.b.a,4),129)}function vy(e,t,n,r,i){KUe.call(this,t,r,i),this.c=e,this.b=n}function vUe(e,t,n,r,i){eBe.call(this,t,r,i),this.c=e,this.a=n}function yUe(e,t,n,r,i){tBe.call(this,t,r,i),this.c=e,this.a=n}function bUe(e,t,n,r,i){KUe.call(this,t,r,i),this.c=e,this.a=n}function yy(e,t){return P(ix(e.d,t),23)||P(ix(e.e,t),23)}function xUe(e,t){var n=t.ld(),r=e.Fe(n);return!!r&&rg(r.e,t.md())}function SUe(e,t){var n=t.ld();return new oo(n,e.e.pc(n,P(t.md(),16)))}function CUe(e,t){return e.a.get(t)??V(WW,FP,1,0,5,1)}function wUe(e){var t=e.length;return ff(fI.substr(fI.length-t,t),e)}function by(e){if(Cj(e))return e.c=e.a,e.a.Pb();throw E(new Hr)}function TUe(e,t){return t==0||e.e==0?e:t>0?Cst(e,t):F0e(e,-t)}function xy(e,t){return t==0||e.e==0?e:t>0?F0e(e,t):Cst(e,-t)}function EUe(e){txe.call(this,e==null?IP:PE(e),j(e,82)?P(e,82):null)}function DUe(e){var t;return e.c||(t=e.r,j(t,90)&&(e.c=P(t,29))),e.c}function Sy(e){var t=new i_;return VC(t,e),W(t,(mP(),j1),null),t}function OUe(e){var t=e.c.i,n=e.d.i;return t.k==(DA(),GJ)&&n.k==GJ}function Cy(e){return vu(e&QF,e>>22&QF,e<0?$F:0)}function kUe(e){var t,n,r,i;for(n=e,r=0,i=n.length;r=0?e.Lh(r,n,!0):mj(e,t,n)}function jUe(e,t,n){return aE(Ou(cO(e),xu(t.b)),Ou(cO(e),xu(n.b)))}function MUe(e,t,n){return aE(Ou(cO(e),xu(t.e)),Ou(cO(e),xu(n.e)))}function NUe(e,t){return r.Math.min(ab(t.a,e.d.d.c),ab(t.b,e.d.d.c))}function Ty(e,t){e._i(e.i+1),Au(e,e.i,e.Zi(e.i,t)),e.Mi(e.i++,t),e.Ni()}function Ey(e){var t,n;++e.j,t=e.g,n=e.i,e.g=null,e.i=0,e.Oi(n,t),e.Ni()}function PUe(e,t,n){var r=new Rwe(e.a);mC(r,e.a.a),XA(r.f,t,n),e.a.a=r}function FUe(e,t,n,r){var i;for(i=0;it)throw E(new Mi(ptt(e,t,`index`)));return e}function Ay(e,t){var n=(ov(t,e.c.length),e.c[t]);return wye(e.c,t,1),n}function zUe(e,t){var n=(Gh(e),e),r=(Gh(t),t);return n==r?0:nt.p?-1:0}function tWe(e){var t;return e.a||(t=e.r,j(t,156)&&(e.a=P(t,156))),e.a}function nWe(e,t,n){var r;return++e.e,--e.f,r=P(e.d[t].gd(n),136),r.md()}function rWe(e){var t=e.ld();return qf(P(e.md(),16).Nc(),new cde(t))}function iWe(e,t){return km(e.a,t)?(My(e.a,t),!0):!1}function Iy(e,t,n){return Tv(t,e.e.Rd().gc()),Tv(n,e.c.Rd().gc()),e.a[t][n]}function Ly(e,t,n){this.a=e,this.b=t,this.c=n,M(e.t,this),M(t.i,this)}function Ry(e,t,n,r){this.f=e,this.e=t,this.d=n,this.b=r,this.c=r?r.d:null}function zy(){this.b=new vo,this.a=new vo,this.b=new vo,this.a=new vo}function By(){By=C;var e,t;u9=(Ra(),t=new Ur,t),d9=(e=new oi,e)}function aWe(e){var t;return lE(e),t=new Mje(e,e.a.e,e.a.d|4),new fDe(e,t)}function oWe(e){var t;for(Hh(e),t=0;e.a.Bd(new Be);)t=yE(t,1);return t}function Vy(e,t){return Gh(t),e.c=0,`Initial capacity must not be negative`)}function Uy(){Uy=C,G3=new yr(`org.eclipse.elk.labels.labelManager`)}function sWe(){sWe=C,fX=new Wd(`separateLayerConnections`,(iw(),gX))}function Wy(){Wy=C,A2=new nSe(`REGULAR`,0),k2=new nSe(`CRITICAL`,1)}function Gy(){Gy=C,x3=new lSe(`FIXED`,0),b3=new lSe(`CENTER_NODE`,1)}function Ky(){Ky=C,XX=new Lxe(`QUADRATIC`,0),ZX=new Lxe(`SCANLINE`,1)}function cWe(){cWe=C,ikt=nT((bS(),U(O(nZ,1),Z,322,0,[eZ,$X,tZ])))}function lWe(){lWe=C,akt=nT((lS(),U(O(oZ,1),Z,351,0,[rZ,aZ,iZ])))}function uWe(){uWe=C,ekt=nT((kS(),U(O(MX,1),Z,372,0,[jX,AX,kX])))}function dWe(){dWe=C,lkt=nT((_w(),U(O(ckt,1),Z,460,0,[_Z,gZ,vZ])))}function fWe(){fWe=C,hkt=nT((qC(),U(O(rQ,1),Z,299,0,[tQ,nQ,eQ])))}function pWe(){pWe=C,_kt=nT((Zb(),U(O(gkt,1),Z,311,0,[aQ,oQ,iQ])))}function mWe(){mWe=C,FMt=nT((hT(),U(O(PMt,1),Z,390,0,[P0,NMt,F0])))}function hWe(){hWe=C,nNt=nT((CC(),U(O(tNt,1),Z,387,0,[$Mt,a2,eNt])))}function gWe(){gWe=C,iNt=nT((Nw(),U(O(rNt,1),Z,349,0,[c2,o2,s2])))}function _We(){_We=C,QMt=nT((uS(),U(O(ZMt,1),Z,463,0,[i2,n2,r2])))}function vWe(){vWe=C,sNt=nT((Xw(),U(O(oNt,1),Z,350,0,[l2,aNt,u2])))}function yWe(){yWe=C,dNt=nT((cS(),U(O(uNt,1),Z,352,0,[lNt,d2,cNt])))}function bWe(){bWe=C,pNt=nT((sw(),U(O(fNt,1),Z,388,0,[p2,m2,f2])))}function xWe(){xWe=C,IPt=nT((Pw(),U(O(FPt,1),Z,392,0,[PPt,B2,z2])))}function SWe(){SWe=C,UFt=nT((Yw(),U(O(HFt,1),Z,393,0,[O4,BFt,VFt])))}function CWe(){CWe=C,OIt=nT((SC(),U(O(DIt,1),Z,300,0,[I4,EIt,TIt])))}function wWe(){wWe=C,AIt=nT((ED(),U(O(kIt,1),Z,445,0,[L4,R4,z4])))}function TWe(){TWe=C,MIt=nT((LO(),U(O(jIt,1),Z,456,0,[B4,H4,V4])))}function EWe(){EWe=C,RIt=nT((TE(),U(O(LIt,1),Z,394,0,[IIt,Q4,FIt])))}function DWe(){DWe=C,TLt=nT((Tb(),U(O(wLt,1),Z,439,0,[c3,CLt,SLt])))}function OWe(){OWe=C,jNt=nT((sS(),U(O(ANt,1),Z,464,0,[h2,g2,_2])))}function kWe(){kWe=C,PEt=nT((Cb(),U(O(NEt,1),Z,471,0,[rq,nq,iq])))}function AWe(){AWe=C,MEt=nT((Ix(),U(O($K,1),Z,237,0,[XK,ZK,QK])))}function jWe(){jWe=C,LEt=nT((Xb(),U(O(IEt,1),Z,472,0,[sq,oq,aq])))}function MWe(){MWe=C,vEt=nT((Zw(),U(O(xK,1),Z,108,0,[vK,yK,bK])))}function NWe(){NWe=C,aOt=nT((Yb(),U(O(_J,1),Z,391,0,[hJ,mJ,gJ])))}function PWe(){PWe=C,bBt=nT((_T(),U(O(yBt,1),Z,346,0,[_8,g8,v8])))}function FWe(){FWe=C,NLt=nT((KT(),U(O(_3,1),Z,444,0,[m3,h3,g3])))}function IWe(){IWe=C,iBt=nT((Lx(),U(O(rBt,1),Z,278,0,[o8,s8,c8])))}function LWe(){LWe=C,VBt=nT((gT(),U(O(BBt,1),Z,280,0,[zBt,M5,N5])))}function qy(e,t){return!e.o&&(e.o=new lb((lP(),Z5),n7,e,0)),uD(e.o,t)}function RWe(e,t){var n;e.C&&(n=P(ig(e.b,t),127).n,n.d=e.C.d,n.a=e.C.a)}function zWe(e){var t,n,r,i=e.d;t=e.a,n=e.b,r=e.c,e.d=n,e.a=r,e.b=i,e.c=t}function BWe(e){return!e.g&&(e.g=new on),!e.g.b&&(e.g.b=new Ihe(e)),e.g.b}function Jy(e){return!e.g&&(e.g=new on),!e.g.c&&(e.g.c=new zhe(e)),e.g.c}function VWe(e){return!e.g&&(e.g=new on),!e.g.d&&(e.g.d=new Lhe(e)),e.g.d}function HWe(e){return!e.g&&(e.g=new on),!e.g.a&&(e.g.a=new Rhe(e)),e.g.a}function UWe(e,t,n,r){return n&&(r=n.Rh(t,eD(n.Dh(),e.c.uk()),null,r)),r}function WWe(e,t,n,r){return n&&(r=n.Th(t,eD(n.Dh(),e.c.uk()),null,r)),r}function Yy(e,t,n,r){var i=V(q9,HF,28,t+1,15,1);return Gdt(i,e,t,n,r),i}function V(e,t,n,r,i,a){var o=b3e(i,r);return i!=10&&U(O(e,a),t,n,i,o),o}function GWe(e,t,n){var r,i=new WC(t,e);for(r=0;rn||t=0?e.Lh(n,!0,!0):mj(e,t,!0)}function gGe(e,t,n){var r=kZe(e,t,n);return e.b=new VS(r.c.length),Xst(e,r)}function _Ge(e){if(e.b<=0)throw E(new Hr);return--e.b,e.a-=e.c.c,G(e.a)}function vGe(e){var t;if(!e.a)throw E(new fIe);return t=e.a,e.a=I_(e.a),t}function yGe(e){for(;!e.a;)if(!DOe(e.c,new Ufe(e)))return!1;return!0}function hb(e){var t;return ph(e),j(e,204)?(t=P(e,204),t):new gde(e)}function bGe(e){gb(),P(e.of((vP(),z6)),181).Fc((rj(),K8)),e.qf(R6,null)}function gb(){gb=C,jRt=new Hoe,NRt=new Uoe,MRt=oQe((vP(),R6),jRt,D6,NRt)}function _b(){_b=C,LFt=new oSe(`LEAF_NUMBER`,0),D4=new oSe(`NODE_SIZE`,1)}function vb(e){e.a=V(q9,HF,28,e.b+1,15,1),e.c=V(q9,HF,28,e.b,15,1),e.d=0}function xGe(e,t){e.a.Ne(t.d,e.b)>0&&(M(e.c,new Pje(t.c,t.d,e.d)),e.b=t.d)}function SGe(e,t){if(e.g==null||t>=e.i)throw E(new wl(t,e.i));return e.g[t]}function CGe(e,t,n){if(Aw(e,n),n!=null&&!e.fk(n))throw E(new Ir);return n}function yb(e,t){return lx(t)!=10&&U($w(t),t.Sm,t.__elementTypeId$,lx(t),e),e}function bb(e,t,n,r){var i;r=(Bg(),r||nK),i=e.slice(t,n),mtt(i,e,t,n,-t,r)}function xb(e,t,n,r,i){return t<0?mj(e,n,r):P(n,69).wk().yk(e,e.hi(),t,r,i)}function wGe(e,t){return aE(D(N(K(e,(Y(),$Q)))),D(N(K(t,$Q))))}function TGe(){TGe=C,dEt=nT((Sb(),U(O(mK,1),Z,304,0,[uK,dK,fK,pK])))}function Sb(){Sb=C,uK=new ls(`All`,0),dK=new WCe,fK=new Owe,pK=new UCe}function Cb(){Cb=C,rq=new hs(cL,0),nq=new hs(sL,1),iq=new hs(lL,2)}function EGe(){EGe=C,_N(),VHt=cI,BHt=lI,UHt=new Rn(cI),HHt=new Rn(lI)}function DGe(){DGe=C,cDt=nT((KC(),U(O(sDt,1),Z,417,0,[mq,dq,fq,pq])))}function OGe(){OGe=C,mDt=nT((wO(),U(O(pDt,1),Z,406,0,[wq,Cq,Tq,Eq])))}function kGe(){kGe=C,uDt=nT((TO(),U(O(lDt,1),Z,332,0,[gq,hq,_q,vq])))}function AGe(){AGe=C,xOt=nT((YD(),U(O(zJ,1),Z,389,0,[RJ,IJ,FJ,LJ])))}function jGe(){jGe=C,hOt=nT((ow(),U(O(mOt,1),Z,416,0,[kJ,MJ,AJ,jJ])))}function MGe(){MGe=C,qOt=nT((aw(),U(O(KOt,1),Z,421,0,[bX,xX,SX,CX])))}function NGe(){NGe=C,IOt=nT((iw(),U(O(FOt,1),Z,371,0,[gX,mX,hX,pX])))}function PGe(){PGe=C,IMt=nT((IO(),U(O(B0,1),Z,203,0,[R0,z0,L0,I0])))}function FGe(){FGe=C,JMt=nT((ID(),U(O(qMt,1),Z,284,0,[Z0,KMt,Q0,$0])))}function wb(){wb=C,DZ=new Hs(wR,0),EZ=new Hs(`IMPROVE_STRAIGHTNESS`,1)}function IGe(e,t){var n,r=t/e.c.Rd().gc()|0;return n=t%e.c.Rd().gc(),Iy(e,r,n)}function LGe(e){var t;if(e.nl())for(t=e.i-1;t>=0;--t)H(e,t);return zVe(e)}function RGe(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[0];)n=t;return n}function zGe(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[1];)n=t;return n}function BGe(e){return j(e,180)?``+P(e,180).a:e==null?null:PE(e)}function VGe(e){return j(e,180)?``+P(e,180).a:e==null?null:PE(e)}function HGe(e,t){if(t.a)throw E(new yi(xyt));Lm(e.a,t),t.a=e,!e.j&&(e.j=t)}function UGe(e,t){vl.call(this,t.zd(),t.yd()&-16449),Gh(e),this.a=e,this.c=t}function WGe(e,t){return new Vf(t,Sd(xu(t.e),t.f.a+e,t.f.b+e),(rd(),!1))}function GGe(e,t){return Rf(),M(e,new Kc(t,G(t.e.c.length+t.g.c.length)))}function KGe(e,t){return Rf(),M(e,new Kc(t,G(t.e.c.length+t.g.c.length)))}function qGe(){qGe=C,wIt=nT((uk(),U(O(CIt,1),Z,354,0,[F4,xIt,SIt,bIt])))}function JGe(){JGe=C,TFt=nT((Jw(),U(O(wFt,1),Z,353,0,[_4,h4,g4,m4])))}function YGe(){YGe=C,bPt=nT((Ok(),U(O(yPt,1),Z,405,0,[N2,P2,F2,I2])))}function XGe(){XGe=C,aBt=nT((wE(),U(O(p8,1),Z,223,0,[f8,u8,l8,d8])))}function ZGe(){ZGe=C,SBt=nT((kk(),U(O(xBt,1),Z,291,0,[S8,y8,b8,x8])))}function QGe(){QGe=C,IBt=nT((TD(),U(O(S5,1),Z,386,0,[b5,x5,y5,v5])))}function $Ge(){$Ge=C,YBt=nT((ZE(),U(O(JBt,1),Z,320,0,[F5,GBt,qBt,KBt])))}function eKe(){eKe=C,tVt=nT((Mw(),U(O(eVt,1),Z,415,0,[I5,QBt,ZBt,$Bt])))}function Tb(){Tb=C,c3=new Cc(_xt,0),CLt=new Cc(vV,1),SLt=new Cc(wR,2)}function Eb(e,t,n,r,i){return Gh(e),Gh(t),Gh(n),Gh(r),Gh(i),new Vm(e,t,r)}function tKe(e,t){var n=P(My(e.e,t),400);return n?(pMe(n),n.e):null}function Db(e,t){var n=Ab(e,t,0);return n!=-1&&(Ay(e,n),!0)}function nKe(e,t,n){var r;return Hh(e),r=new Re,r.a=t,e.a.Nb(new uxe(r,n)),r.a}function rKe(e){var t;return Hh(e),t=V(Z9,hI,28,0,15,1),Qa(e.a,new Bfe(t)),t}function Ob(e){var t;if(!DS(e))throw E(new Hr);return e.e=1,t=e.d,e.d=null,t}function kb(e){var t;return Il(e)&&(t=0-e,!isNaN(t))?t:MC(mw(e))}function Ab(e,t,n){for(;n=0?jO(e,n,!0,!0):mj(e,t,!0)}function qb(e){var t=rS(NC(e,32));return t??=(WD(e),rS(NC(e,32))),t}function Jb(e){var t;return e.Oh()||(t=bh(e.Dh())-e.ji(),e.$h().Mk(t)),e.zh()}function fKe(e,t){bq=new Mt,fDt=t,yq=e,P(yq.b,68),ZWe(yq,bq,null),Jpt(yq)}function Yb(){Yb=C,hJ=new Cs(`XY`,0),mJ=new Cs(`X`,1),gJ=new Cs(`Y`,2)}function Xb(){Xb=C,sq=new gs(`TOP`,0),oq=new gs(sL,1),aq=new gs(Lyt,2)}function Zb(){Zb=C,aQ=new qs(wR,0),oQ=new qs(`TOP`,1),iQ=new qs(Lyt,2)}function Qb(){Qb=C,e2=new nc(`INPUT_ORDER`,0),t2=new nc(`PORT_DEGREE`,1)}function $b(){$b=C,hG=vu(QF,QF,524287),BTt=vu(0,0,eI),gG=Cy(1),Cy(2),_G=Cy(0)}function ex(e){var t;return e.d!=e.r&&(t=Ik(e),e.e=!!t&&t.lk()==xwt,e.d=t),e.e}function tx(e,t,n){var r=e.g[t];return Au(e,t,e.Zi(t,n)),e.Ri(t,n,r),e.Ni(),r}function nx(e,t){var n=e.dd(t);return n>=0&&(e.gd(n),!0)}function rx(e,t){var n;for(ph(e),ph(t),n=!1;t.Ob();)n|=e.Fc(t.Pb());return n}function ix(e,t){var n=P(xh(e.e,t),400);return n?(Ywe(e,n),n.e):null}function pKe(e){var t=e/60|0,n=e%60;return n==0?``+t:``+t+`:`+(``+n)}function ax(e,t){var n=e.a[t],r=(vw(),pG)[typeof n];return r?r(n):XQe(typeof n)}function ox(e,t){var n,r;return lE(e),r=new WUe(t,e.a),n=new zOe(r),new Mp(e,n)}function sx(e){var t=e.b.c.length==0?null:Ep(e.b,0);return t!=null&&LS(e,0),t}function mKe(e,t){var n,r,i=t.c.i;n=P(xh(e.f,i),60),r=n.d.c-n.e.c,eC(t.a,r,0)}function cx(e,t){var n;for(++e.d,++e.c[t],n=t+1;n=0;)++t[0]}function _Ke(e,t){Gx(e,t==null||vf((Gh(t),t))||isNaN((Gh(t),t))?0:(Gh(t),t))}function vKe(e,t){Kx(e,t==null||vf((Gh(t),t))||isNaN((Gh(t),t))?0:(Gh(t),t))}function yKe(e,t){Wx(e,t==null||vf((Gh(t),t))||isNaN((Gh(t),t))?0:(Gh(t),t))}function bKe(e,t){Ux(e,t==null||vf((Gh(t),t))||isNaN((Gh(t),t))?0:(Gh(t),t))}function xKe(e,t,n){return Ou(new k(n.e.a+n.f.a/2,n.e.b+n.f.b/2),e)==(Gh(t),t)}function SKe(e,t){return j(t,102)&&(P(t,19).Bb&pI)!=0?new Dl(t,e):new WC(t,e)}function CKe(e,t){return j(t,102)&&(P(t,19).Bb&pI)!=0?new Dl(t,e):new WC(t,e)}function lx(e){return e.__elementTypeCategory$==null?10:e.__elementTypeCategory$}function wKe(e,t){return t==(Sf(),Sf(),oEt)?e.toLocaleLowerCase():e.toLowerCase()}function TKe(e){if(!e.e)throw E(new Hr);return e.c=e.a=e.e,e.e=e.e.e,--e.d,e.a.f}function ux(e){if(!e.c)throw E(new Hr);return e.e=e.a=e.c,e.c=e.c.c,++e.d,e.a.f}function EKe(e){var t;for(++e.a,t=e.c.a.length;e.ae.a[r]&&(r=n);return r}function MKe(e){var t=P(K(e,(Y(),fQ)),313);return t?t.a==e:!1}function NKe(e){var t=P(K(e,(Y(),fQ)),313);return t?t.i==e:!1}function PKe(){PKe=C,lOt=nT((vA(),U(O(CJ,1),Z,367,0,[vJ,yJ,bJ,xJ,SJ])))}function FKe(){FKe=C,YOt=nT((tA(),U(O(JOt,1),Z,375,0,[TX,DX,OX,EX,wX])))}function IKe(){IKe=C,okt=nT((FD(),U(O(fZ,1),Z,348,0,[cZ,sZ,uZ,dZ,lZ])))}function LKe(){LKe=C,zMt=nT((CO(),U(O(RMt,1),Z,323,0,[LMt,H0,U0,V0,W0])))}function RKe(){RKe=C,ykt=nT((XE(),U(O(y$,1),Z,171,0,[v$,m$,h$,g$,_$])))}function zKe(){zKe=C,IFt=nT((iA(),U(O(FFt,1),Z,368,0,[T4,S4,E4,C4,w4])))}function BKe(){BKe=C,MLt=nT((Wj(),U(O(jLt,1),Z,373,0,[u3,l3,f3,d3,p3])))}function VKe(){VKe=C,WLt=nT((MA(),U(O(ULt,1),Z,324,0,[BLt,S3,HLt,C3,VLt])))}function HKe(){HKe=C,nBt=nT((GT(),U(O(a8,1),Z,88,0,[r8,n8,t8,e8,i8])))}function UKe(){UKe=C,FRt=nT((uO(),U(O(L3,1),Z,170,0,[F3,P3,M3,I3,N3])))}function WKe(){WKe=C,EBt=nT((pO(),U(O(I8,1),Z,256,0,[P8,F8,wBt,N8,TBt])))}function GKe(){GKe=C,ABt=nT((nP(),U(O(_5,1),TR,64,0,[h5,Z8,X8,m5,g5])))}function dx(){dx=C,OK=new pxe(`BY_SIZE`,0),kK=new pxe(`BY_SIZE_AND_SHAPE`,1)}function fx(){fx=C,Vq=new Ss(`EADES`,0),Hq=new Ss(`FRUCHTERMAN_REINGOLD`,1)}function px(){px=C,pZ=new zs(`READING_DIRECTION`,0),mZ=new zs(`ROTATION`,1)}function mx(){mx=C,vOt=new mee,yOt=new _ee,gOt=new vee,_Ot=new gee,bOt=new yee}function KKe(e){this.b=new T,this.a=new T,this.c=new T,this.d=new T,this.e=e}function qKe(e){this.g=e,this.f=new T,this.a=r.Math.min(this.g.c.c,this.g.d.c)}function JKe(e,t,n){Qd.call(this),Px(this),this.a=e,this.c=n,this.b=t.d,this.f=t.e}function YKe(e,t,n){var r,i;for(i=new w(n);i.a=0&&t0?t-1:t;return Qve($ve(Uqe(Qje(new di,n),e.n),e.j),e.k)}function vx(e){var t,n=(t=new si,t);tb((!e.q&&(e.q=new F(M7,e,11,10)),e.q),n)}function yx(e){return(e.i&2?`interface `:e.i&1?``:`class `)+(Ad(e),e.o)}function bx(e){return dT(e,AP)>0?AP:dT(e,xF)<0?xF:nm(e)}function xx(e){return e<3?(vS(e,Qvt),e+1):e=-.01&&e.a<=fL&&(e.a=0),e.b>=-.01&&e.b<=fL&&(e.b=0),e}function Tx(e){fM();var t,n=zV;for(t=0;tn&&(n=e[t]);return n}function lqe(e,t){var n=Qj(e.Dh(),t);if(!n)throw E(new Fi(HH+t+WH));return n}function Ex(e,t){for(var n=e;I_(n);)if(n=I_(n),n==t)return!0;return!1}function uqe(e,t){var n,r=t.a.ld(),i;for(n=P(t.a.md(),16).gc(),i=0;ie||e>t)throw E(new ia(`fromIndex: 0, toIndex: `+e+MI+t))}function kx(e){if(e<0)throw E(new Fi(`Illegal Capacity: `+e));this.g=this.aj(e)}function Ax(e,t){return uu(),fS(bF),r.Math.abs(e-t)<=bF||e==t||isNaN(e)&&isNaN(t)}function jx(e,t){var n,r,i,a;for(r=e.d,i=0,a=r.length;i0&&(e.a/=t,e.b/=t),e}function Mx(e){var t;return e.w?e.w:(t=jze(e),t&&!t.Vh()&&(e.w=t),t)}function Nx(e,t){var n,r=e.a;n=V$e(e,t,null),r!=t&&!e.e&&(n=JN(e,t,n)),n&&n.oj()}function xqe(e,t,n){var r=t,i;do i=D(e.p[r.p])+n,e.p[r.p]=i,r=e.a[r.p];while(r!=t)}function Sqe(e,t,n){var r=function(){return e.apply(r,arguments)};return t.apply(r,n),r}function Cqe(e){var t;return e==null?null:(t=P(e,195),E7e(t,t.length))}function H(e,t){if(e.g==null||t>=e.i)throw E(new wl(t,e.i));return e.Wi(t,e.g[t])}function wqe(e,t){Vg();var n,r=new T;for(n=0;n=14&&t<=16))),e}function iS(e,t){var n;return Gh(t),n=e[`:`+t],$f(!!n,`Enum constant undefined: `+t),n}function aS(e,t,n,r,i,a){var o=fh(e,t);return Wqe(n,o),o.i=i?8:0,o.f=r,o.e=i,o.g=a,o}function Gqe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=1,this.c=e,this.a=n}function Kqe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=2,this.c=e,this.a=n}function qqe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=6,this.c=e,this.a=n}function Jqe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=7,this.c=e,this.a=n}function Yqe(e,t,n,r,i){this.d=t,this.j=r,this.e=i,this.o=-1,this.p=4,this.c=e,this.a=n}function Xqe(e,t){var n,r,i,a;for(r=t,i=0,a=r.length;i=0))throw E(new Fi(`tolerance (`+e+`) must be >= 0`));return e}function aJe(e,t){var n;return j(t,44)?e.c.Mc(t):(n=uD(e,t),BD(e,t),n)}function pS(e,t,n){return aT(e,t),GS(e,n),Zx(e,0),Qx(e,1),RT(e,!0),FT(e,!0),e}function mS(e,t){var n=e.gc();if(t<0||t>n)throw E(new lf(t,n));return new LOe(e,t)}function hS(e,t){e.b=r.Math.max(e.b,t.d),e.e+=t.r+(e.a.c.length==0?0:e.c),M(e.a,t)}function oJe(e){Md(e.c>=0),Q0e(e.d,e.c)<0&&(e.a=e.a-1&e.d.a.length-1,e.b=e.d.c),e.c=-1}function gS(e){var t,n;for(n=e.c.Cc().Kc();n.Ob();)t=P(n.Pb(),16),t.$b();e.c.$b(),e.d=0}function sJe(e){var t,n,r,i;for(n=e.a,r=0,i=n.length;r=0}function kJe(e,t){e.r>0&&e.c0&&e.g!=0&&kJe(e.i,t/e.r*e.i.d))}function AJe(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,1,n,e.c))}function SS(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,4,n,e.c))}function CS(e,t){var n=e.k;e.k=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,2,n,e.k))}function wS(e,t){var n=e.D;e.D=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,2,n,e.D))}function TS(e,t){var n=e.f;e.f=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,8,n,e.f))}function ES(e,t){var n=e.i;e.i=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,7,n,e.i))}function jJe(e,t){var n=e.a;e.a=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,8,n,e.a))}function MJe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,0,n,e.b))}function NJe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,0,n,e.b))}function PJe(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,1,n,e.c))}function FJe(e,t){var n=e.d;e.d=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,1,n,e.d))}function IJe(e,t,n){var r;e.b=t,e.a=n,r=(e.a&512)==512?new y_e:new Qle,e.c=Ust(r,e.b,e.a)}function LJe(e,t){return aM(e.e,t)?(Qo(),ex(t)?new hp(t,e):new Qc(t,e)):new ZSe(t,e)}function RJe(e){var t,n;return 0>e?new _be:(t=e+1,n=new tUe(t,e),new pDe(null,n))}function zJe(e,t){Vg();var n=new go(1);return rl(e)?H_(n,e,t):XA(n.f,e,t),new Kn(n)}function BJe(e,t){var n=e.c,r=t.e[e.p];return r>0?P(Ep(n.a,r-1),10):null}function VJe(e,t){var n=e.o+e.p,r=t.o+t.p;return nt?(t<<=1,t>0?t:mF):t}function DS(e){switch(yTe(e.e!=3),e.e){case 2:return!1;case 0:return!0}return VUe(e)}function WJe(e,t){var n;return j(t,8)?(n=P(t,8),e.a==n.a&&e.b==n.b):!1}function GJe(e,t){var n=new Mt;P(t.b,68),P(t.b,68),P(t.b,68),Dx(t.a,new Uf(e,n,t))}function KJe(e,t){var n,r;for(r=t.vc().Kc();r.Ob();)n=P(r.Pb(),44),Hk(e,n.ld(),n.md())}function qJe(e,t){var n=e.d;e.d=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,11,n,e.d))}function OS(e,t){var n=e.j;e.j=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,13,n,e.j))}function JJe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,21,n,e.b))}function YJe(e,t){(fy(),_K?null:t.c).length==0&&vDe(t,new xe),H_(e.a,_K?null:t.c,t)}function XJe(e,t){t.Ug(`Hierarchical port constraint processing`,1),G2e(e),pvt(e),t.Vg()}function kS(){kS=C,jX=new Ps(`START`,0),AX=new Ps(`MIDDLE`,1),kX=new Ps(`END`,2)}function AS(){AS=C,b4=new aSe(`P1_NODE_PLACEMENT`,0),x4=new aSe(`P2_EDGE_ROUTING`,1)}function jS(){jS=C,iJ=new yr(sbt),aJ=new yr(cbt),rJ=new yr(lbt),nJ=new yr(ubt)}function MS(e){var t;return Df(e.f.g,e.d),jd(e.b),e.c=e.a,t=P(e.a.Pb(),44),e.b=FXe(e),t}function NS(e){var t;return e.b==null?(Xo(),Xo(),a9):(t=e.ul()?e.tl():e.sl(),t)}function ZJe(e,t){var n=t==null?-1:Ab(e.b,t,0);return n<0?!1:(LS(e,n),!0)}function PS(e,t){var n;return Gh(t),n=t.g,!e.b[n]&&(Sh(e.b,n,t),++e.c,!0)}function FS(e,t){var n=1-t,r=e.a[n];return e.a[n]=r.a[t],r.a[t]=e,e.b=!0,r.b=!1,r}function QJe(e,t){var n,r;for(r=t.Kc();r.Ob();)n=P(r.Pb(),272),e.b=!0,Lm(e.e,n),n.b=e}function $Je(e,t){var n=P(K(e,(mP(),n0)),8),r=P(K(t,n0),8);return aE(n.b,r.b)}function IS(e,t,n){var r,i,a=t>>5;return i=t&31,r=uv(um(e.n[n][a],nm(cm(i,1))),3),r}function eYe(e,t,n){var r,i,a=e.a.length-1;for(i=e.b,r=0;r0):(!e.c&&(e.c=Q_(LC(e.f))),e.c).e}function fYe(e,t){t?e.B??(e.B=e.D,e.D=null):e.B!=null&&(e.D=e.B,e.B=null)}function pYe(e,t){return ow(),e==kJ&&t==MJ||e==MJ&&t==kJ||e==jJ&&t==AJ||e==AJ&&t==jJ}function mYe(e,t){return ow(),e==kJ&&t==AJ||e==kJ&&t==jJ||e==MJ&&t==jJ||e==MJ&&t==AJ}function hYe(e,t){return uu(),fS(fL),r.Math.abs(0-t)<=fL||t==0?0:e/t}function gYe(e,t){return D(N(Ju(MT(gg(new Mp(null,new cv(e.c.b,16)),new Zpe(e)),t))))}function $S(e,t){return D(N(Ju(MT(gg(new Mp(null,new cv(e.c.b,16)),new Xpe(e)),t))))}function _Ye(){return uM(),U(O($Z,1),Z,259,0,[WZ,KZ,qZ,JZ,YZ,XZ,QZ,UZ,GZ,ZZ])}function vYe(){return FM(),U(O(WMt,1),Z,243,0,[Y0,q0,J0,VMt,HMt,BMt,UMt,X0,G0,K0])}function yYe(e,t){var n;t.Ug(`General Compactor`,1),n=$1e(P(J(e,(PA(),A4)),393)),n.Cg(e)}function bYe(e,t){var n=P(J(e,(PA(),j4)),17),r=P(J(t,j4),17);return _u(n.a,r.a)}function eC(e,t,n){var r,i;for(i=dO(e,0);i.b!=i.d.c;)r=P(Lv(i),8),r.a+=t,r.b+=n;return e}function tC(e,t,n){var r;for(r=e.b[n&e.f];r;r=r.b)if(n==r.a&&zh(t,r.g))return r;return null}function nC(e,t,n){var r;for(r=e.c[n&e.f];r;r=r.d)if(n==r.f&&zh(t,r.i))return r;return null}function xYe(e,t,n){var r=0,i,a;for(i=0;i>>31;r!=0&&(e[n]=r)}function rC(e,t,n,r,i,a){var o;this.c=e,o=new T,t3e(e,o,t,e.b,n,r,i,a),this.a=new bv(o,0)}function SYe(){this.c=new Ya(0),this.b=new Ya(PV),this.d=new Ya(txt),this.a=new Ya(RL)}function iC(e,t,n,r,i,a,o){so.call(this,e,t),this.d=n,this.e=r,this.c=i,this.b=a,this.a=Oy(o)}function aC(e,t,n,r,i,a,o,s,c,l,u,d,f){return ftt(e,t,n,r,i,a,o,s,c,l,u,d,f),mE(e,!1),e}function CYe(e){return e.b.c.i.k==(DA(),GJ)?P(K(e.b.c.i,(Y(),WQ)),12):e.b.c}function wYe(e){return e.b.d.i.k==(DA(),GJ)?P(K(e.b.d.i,(Y(),WQ)),12):e.b.d}function TYe(e){var t=Ov(e);return ol(t.a,0)?(So(),So(),sEt):(So(),new _Ee(t.b))}function oC(e){var t=LBe(e);return ol(t.a,0)?(xo(),xo(),sK):(xo(),new gd(t.b))}function sC(e){var t=LBe(e);return ol(t.a,0)?(xo(),xo(),sK):(xo(),new gd(t.c))}function EYe(e){switch(e.g){case 2:return nP(),g5;case 4:return nP(),X8;default:return e}}function DYe(e){switch(e.g){case 1:return nP(),m5;case 3:return nP(),Z8;default:return e}}function OYe(e){switch(e.g){case 0:return new Doe;case 1:return new Ooe;default:return null}}function cC(){cC=C,dX=new Wd(`edgelabelcenterednessanalysis.includelabel`,(rd(),vG))}function lC(){lC=C,kNt=HD(pCe(vp(vp(new Zh,(vA(),bJ),(yP(),KY)),xJ,IY),SJ),GY)}function kYe(){kYe=C,NNt=HD(pCe(vp(vp(new Zh,(vA(),bJ),(yP(),KY)),xJ,IY),SJ),GY)}function uC(){uC=C,n9=new p_e,r9=U(O(w7,1),qU,179,0,[]),eHt=U(O(M7,1),Cwt,62,0,[])}function dC(){dC=C,aY=new xxe(`TO_INTERNAL_LTR`,0),iY=new xxe(`TO_INPUT_DIRECTION`,1)}function fC(){fC=C,tY=new Tee,$J=new Eee,eY=new Dee,QJ=new Oee,nY=new kee,rY=new Aee}function AYe(e,t){t.Ug(Mbt,1),KE(kbe(new ar((Po(),new Tg(e,!1,!1,new Wt))))),t.Vg()}function jYe(e,t,n){n.Ug(`DFS Treeifying phase`,1),k0e(e,t),Yot(e,t),e.a=null,e.b=null,n.Vg()}function pC(e,t){return rd(),rl(e)?zUe(e,kd(t)):al(e)?dm(e,N(t)):il(e)?UNe(e,Od(t)):e.Fd(t)}function mC(e,t){var n,r;for(Gh(t),r=t.vc().Kc();r.Ob();)n=P(r.Pb(),44),e.zc(n.ld(),n.md())}function MYe(e,t,n){var r;for(r=n.Kc();r.Ob();)if(!Kv(e,t,r.Pb()))return!1;return!0}function NYe(e,t,n,r,i){var a;return n&&(a=eD(t.Dh(),e.c),i=n.Rh(t,-1-(a==-1?r:a),null,i)),i}function PYe(e,t,n,r,i){var a;return n&&(a=eD(t.Dh(),e.c),i=n.Th(t,-1-(a==-1?r:a),null,i)),i}function FYe(e){var t;if(e.b==-2){if(e.e==0)t=-1;else for(t=0;e.a[t]==0;t++);e.b=t}return e.b}function IYe(e){if(Gh(e),e.length==0)throw E(new aa(`Zero length BigInteger`));uut(this,e)}function hC(e){this.i=e.gc(),this.i>0&&(this.g=this.aj(this.i+(this.i/8|0)+1),e.Qc(this.g))}function LYe(e,t,n){this.g=e,this.d=t,this.e=n,this.a=new T,Utt(this),Vg(),hu(this.a,null)}function gC(e,t){t.q=e,e.d=r.Math.max(e.d,t.r),e.b+=t.d+(e.a.c.length==0?0:e.c),M(e.a,t)}function _C(e,t){var n,r,i=e.c,a;return n=e.c+e.b,a=e.d,r=e.d+e.a,t.a>i&&t.aa&&t.bi?n=i:sv(t,n+1),e.a=p_(e.a,0,t)+(``+r)+Ch(e.a,n)}function QYe(e,t){e.a=yE(e.a,1),e.c=r.Math.min(e.c,t),e.b=r.Math.max(e.b,t),e.d=yE(e.d,t)}function $Ye(e,t){return t1||e.Ob())return++e.a,e.g=0,t=e.i,e.Ob(),t;throw E(new Hr)}function fXe(e){switch(e.a.g){case 1:return new Yxe;case 3:return new P3e;default:return new Nue}}function pXe(e,t){switch(t){case 1:return!!e.n&&e.n.i!=0;case 2:return e.k!=null}return yBe(e,t)}function LC(e){return iI>22),i=e.h+t.h+(r>>22);return vu(n&QF,r&QF,i&$F)}function NXe(e,t){var n=e.l-t.l,r=e.m-t.m+(n>>22),i=e.h-t.h+(r>>22);return vu(n&QF,r&QF,i&$F)}function PXe(e){var t,n;for(Wgt(e),n=new w(e.d);n.ar)throw E(new lf(t,r));return e.Si()&&(n=uRe(e,n)),e.Ei(t,n)}function pw(e,t,n,r,i){var a,o;for(o=n;o<=i;o++)for(a=t;a<=r;a++)sk(e,a,o)||EM(e,a,o,!0,!1)}function uZe(e){fM();var t,n=V(K3,X,8,2,0,1),r=0;for(t=0;t<2;t++)r+=.5,n[t]=Y4e(r,e);return n}function mw(e){var t=~e.l+1&QF,n=~e.m+ +(t==0)&QF;return vu(t,n,~e.h+ +(t==0&&n==0)&$F)}function dZe(e){var t;if(e<0)return xF;if(e==0)return 0;for(t=mF;(t&e)==0;t>>=1);return t}function hw(e,t,n){return e>=128?!1:cl(e<64?uv(cm(1,e),n):uv(cm(1,e-64),t),0)}function gw(e,t,n){return n==null?(!e.q&&(e.q=new Dr),My(e.q,t)):(!e.q&&(e.q=new Dr),Qh(e.q,t,n)),e}function W(e,t,n){return n==null?(!e.q&&(e.q=new Dr),My(e.q,t)):(!e.q&&(e.q=new Dr),Qh(e.q,t,n)),e}function fZe(e){var t,n=new Py;return VC(n,e),W(n,(jS(),iJ),e),t=new Dr,gft(e,n,t),$ht(e,n,t),n}function pZe(e){var t=e.t-e.k[e.o.p]*e.d+e.j[e.o.p]>e.f,n=e.u+e.e[e.o.p]*e.d>e.f*e.s*e.d;return t||n}function mZe(e,t){var n=!1,r=e.a[t].length,i,a;for(a=0;a=0,`Negative initial capacity`),$f(t>=0,`Non-positive load factor`),Pm(this)}function CZe(e,t,n,r,i){var a,o=e.length;if(a=n.length,t<0||r<0||i<0||t+i>o||r+i>a)throw E(new bge)}function wZe(e,t){Vg();var n,r,i,a,o=!1;for(r=t,i=0,a=r.length;i1||t>=0&&e.b<3)}function ww(e){var t=~e.l+1&QF,n=~e.m+ +(t==0)&QF,r=~e.h+ +(t==0&&n==0)&$F;e.l=t,e.m=n,e.h=r}function IZe(e){Vg();var t,n,r=1;for(n=e.Kc();n.Ob();)t=n.Pb(),r=31*r+(t==null?0:US(t)),r|=0;return r}function LZe(e,t,n,r,i){var a=$rt(e,t);return n&&ww(a),i&&(e=s3e(e,t),mG=r?mw(e):vu(e.l,e.m,e.h)),a}function RZe(e,t,n){e.g=WA(e,t,(nP(),X8),e.b),e.d=WA(e,n,X8,e.b),e.g.c!=0&&e.d.c!=0&&f9e(e)}function zZe(e,t,n){e.g=WA(e,t,(nP(),g5),e.j),e.d=WA(e,n,g5,e.j),e.g.c!=0&&e.d.c!=0&&f9e(e)}function BZe(e,t){switch(t){case 7:return!!e.e&&e.e.i!=0;case 8:return!!e.d&&e.d.i!=0}return JE(e,t)}function VZe(e,t){switch(t.g){case 0:j(e.b,641)||(e.b=new XYe);break;case 1:j(e.b,642)||(e.b=new aMe)}}function HZe(e){switch(e.g){case 0:return new Poe;default:throw E(new Fi(fH+(e.f==null?``+e.g:e.f)))}}function UZe(e){switch(e.g){case 0:return new Moe;default:throw E(new Fi(fH+(e.f==null?``+e.g:e.f)))}}function WZe(e,t,n){return!Xa(hg(new Mp(null,new cv(e.c,16)),new rr(new bSe(t,n)))).Bd((wo(),SK))}function GZe(e,t){return Ou(cO(P(K(t,(rN(),c4)),88)),new k(e.c.e.a-e.b.e.a,e.c.e.b-e.b.e.b))<=0}function KZe(e,t){for(;e.g==null&&!e.c?lRe(e):e.g==null||e.i!=0&&P(e.g[e.i-1],51).Ob();)KSe(t,Pj(e))}function Tw(e){var t,n;for(n=new w(e.a.b);n.ar)}function ZZe(e){return M(e.c,(lw(),ORt)),Ax(e.a,D(N(hO((aD(),O0)))))?new Sse:new nhe(e)}function QZe(e){for(;!e.d||!e.d.Ob();)if(e.b&&!qi(e.b))e.d=P(Fm(e.b),51);else return null;return e.d}function $Ze(e){switch(e.g){case 1:return txt;default:case 2:return 0;case 3:return RL;case 4:return PV}}function eQe(){xP();var e;return JHt||(e=uEe(oP(`M`,!0)),e=Rp(oP(`M`,!1),e),JHt=e,JHt)}function Mw(){Mw=C,I5=new qc(`ELK`,0),QBt=new qc(`JSON`,1),ZBt=new qc(`DOT`,2),$Bt=new qc(`SVG`,3)}function Nw(){Nw=C,c2=new ac(`STACKED`,0),o2=new ac(`REVERSE_STACKED`,1),s2=new ac(`SEQUENCED`,2)}function Pw(){Pw=C,PPt=new mc(wR,0),B2=new mc(`MIDDLE_TO_MIDDLE`,1),z2=new mc(`AVOID_OVERLAP`,2)}function Fw(){Fw=C,vX=new cne,yX=new lne,VOt=new one,BOt=new une,zOt=new sne,_X=(Gh(zOt),new le)}function Iw(){Iw=C,vBt=new iu(15),_Bt=new ou((vP(),A6),vBt),h8=V6,pBt=rzt,mBt=w6,gBt=E6,hBt=T6}function Lw(e,t){var n,r,i,a,o;for(r=t,i=0,a=r.length;i=e.b.c.length||(sQe(e,2*t+1),n=2*t+2,n0&&(t.Cd(n),n.i&&n1e(n))}function lQe(e,t,n){var r;for(r=n-1;r>=0&&e[r]===t[r];r--);return r<0?0:rs(uv(e[r],_I),uv(t[r],_I))?-1:1}function uQe(e,t,n){var r,i;this.g=e,this.c=t,this.a=this,this.d=this,i=UJe(n),r=V(PTt,fF,227,i,0,1),this.b=r}function Vw(e,t,n,r,i){var a,o;for(o=n;o<=i;o++)for(a=t;a<=r;a++)if(sk(e,a,o))return!0;return!1}function dQe(e,t){var n,r;for(r=e.Zb().Cc().Kc();r.Ob();)if(n=P(r.Pb(),16),n.Hc(t))return!0;return!1}function fQe(e,t,n){var r,i,a,o;for(Gh(n),o=!1,a=e.fd(t),i=n.Kc();i.Ob();)r=i.Pb(),a.Rb(r),o=!0;return o}function Hw(e,t){var n,r=P(NC(e.a,4),129);return n=V(g7,FU,424,t,0,1),r!=null&&tN(r,0,n,0,r.length),n}function pQe(e,t){var n=new yM(!!(e.f&256),e.i,e.a,e.d,!!(e.f&16),e.j,e.g,t);return e.e??(n.c=e),n}function mQe(e,t){var n;return e===t?!0:j(t,85)?(n=P(t,85),eet(am(e),n.vc())):!1}function hQe(e,t,n){var r,i;for(i=n.Kc();i.Ob();)if(r=P(i.Pb(),44),e.Be(t,r.md()))return!0;return!1}function gQe(e,t,n){return e.d[t.p][n.p]||(p4e(e,t,n),e.d[t.p][n.p]=!0,e.d[n.p][t.p]=!0),e.a[t.p][n.p]}function _Qe(e,t){var n;return!e||e==t||!yd(t,(Y(),NQ))?!1:(n=P(K(t,(Y(),NQ)),10),n!=e)}function Uw(e){switch(e.i){case 2:return!0;case 1:return!1;case-1:++e.c;default:return e.$l()}}function vQe(e){switch(e.i){case-2:return!0;case-1:return!1;case 1:--e.c;default:return e._l()}}function yQe(e){yRe.call(this,`The given string does not match the expected format for individual spacings.`,e)}function bQe(e,t){var n;t.Ug(`Min Size Preprocessing`,1),n=Zet(e),OO(e,(xM(),Y4),n.a),OO(e,K4,n.b),t.Vg()}function xQe(e){var t=0,n,r=V(K3,X,8,e.b,0,1);for(n=dO(e,0);n.b!=n.d.c;)r[t++]=P(Lv(n),8);return r}function Ww(e,t,n){var r=new vo,i,a;for(a=dO(n,0);a.b!=a.d.c;)i=P(Lv(a),8),up(r,new Vl(i));fQe(e,t,r)}function SQe(e,t){var n=yE(e,t);return rs(fv(e,t),0)|sl(fv(e,n),0)?n:yE(tF,fv(um(n,63),1))}function CQe(e,t){var n=P(e.d.Bc(t),16),r;return n?(r=e.e.hc(),r.Gc(n),e.e.d-=n.gc(),n.$b(),r):null}function wQe(e){var t=e.a.c.length;if(t>0)return gm(t-1,e.a.c.length),Ay(e.a,t-1);throw E(new Sge)}function TQe(e,t,n){if(e>t)throw E(new Fi(BI+e+vyt+t));if(e<0||t>n)throw E(new ia(BI+e+VI+t+MI+n))}function Gw(e,t){e.D==null&&e.B!=null&&(e.D=e.B,e.B=null),wS(e,t==null?null:(Gh(t),t)),e.C&&e.hl(null)}function EQe(e,t){var n=hO((aD(),O0))!=null&&t.Sg()!=null?D(N(t.Sg()))/D(N(hO(O0))):1;Qh(e.b,t,n)}function DQe(e,t){var n,r=e.c[t];if(r!=0)for(e.c[t]=0,e.d-=r,n=t+1;nNV?e-n>NV:n-e>NV}function ZQe(e,t){var n;for(n=0;ni&&(Z8e(t.q,i),r=n!=t.q.d)),r}function e$e(e,t){var n,i,a,o,s,c,l=t.i,u=t.j;return i=e.f,a=i.i,o=i.j,s=l-a,c=u-o,n=r.Math.sqrt(s*s+c*c),n}function t$e(e,t){var n,r=KD(e);return r||(!_Vt&&(_Vt=new Jse),n=(NN(),Vit(t)),r=new qhe(n),tb(r.El(),e)),r}function sT(e,t){var n=P(e.c.Bc(t),16),r;return n?(r=e.hc(),r.Gc(n),e.d-=n.gc(),n.$b(),e.mc(r)):e.jc()}function n$e(e,t){var n,r=Lj(e.d,1)!=0;for(n=!0;n;)n=!1,n=t.c.mg(t.e,r),n|=$j(e,t,r,!1),r=!r;WS(e)}function r$e(e,t,n,r){var i,a;e.a=t,a=+!r,e.f=(i=new uet(e.c,e.a,n,a),new Hct(n,e.a,i,e.e,e.b,e.c==(sS(),g2)))}function cT(e){var t;return jd(e.a!=e.b),t=e.d.a[e.a],lDe(e.b==e.d.c&&t!=null),e.c=e.a,e.a=e.a+1&e.d.a.length-1,t}function i$e(e){var t;if(e.c!=0)return e.c;for(t=0;t=e.c.b:e.a<=e.c.b))throw E(new Hr);return t=e.a,e.a+=e.c.c,++e.b,G(t)}function lT(e){var t=new Dwe(e.a);return VC(t,e),W(t,(Y(),WQ),e),t.o.a=e.g,t.o.b=e.f,t.n.a=e.i,t.n.b=e.j,t}function uT(e){return(nP(),c5).Hc(e.j)?D(N(K(e,(Y(),c$)))):Sw(U(O(K3,1),X,8,0,[e.i.n,e.n,e.a])).b}function o$e(e){var t=Wl(ONt);return P(K(e,(Y(),OQ)),21).Hc((uM(),YZ))&&vp(t,(vA(),bJ),(yP(),eX)),t}function s$e(e){var t,n,r,i=new Jr;for(r=new w(e);r.a=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,--r);return t<0?1/i:i}function f$e(e,t){var n,r,i=1;for(n=e,r=t>=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,--r);return t<0?1/i:i}function pT(e,t){var n,r,i,a=(i=e?KD(e):null,btt((r=t,i&&i.Gl(),r)));return a==t&&(n=KD(e),n&&n.Gl()),a}function p$e(e,t,n){var r,i=e.f;return e.f=t,e.Db&4&&!(e.Db&1)&&(r=new Sm(e,1,0,i,t),n?n.nj(r):n=r),n}function m$e(e,t,n){var r,i=e.b;return e.b=t,e.Db&4&&!(e.Db&1)&&(r=new Sm(e,1,3,i,t),n?n.nj(r):n=r),n}function mT(e,t,n){var r,i=e.a;return e.a=t,e.Db&4&&!(e.Db&1)&&(r=new Sm(e,1,1,i,t),n?n.nj(r):n=r),n}function h$e(e){var t,n,r,i;if(e!=null){for(n=0;n=r||t-129&&e<128?(iMe(),t=e+128,n=OG[t],!n&&(n=OG[t]=new jn(e)),n):new jn(e)}function xT(e){var t,n;return e>-129&&e<128?(GMe(),t=e+128,n=FG[t],!n&&(n=FG[t]=new Nn(e)),n):new Nn(e)}function C$e(e,t){var n;e.a.c.length>0&&(n=P(Ep(e.a,e.a.c.length-1),579),tQe(n,t))||M(e.a,new nUe(t))}function w$e(e){Lf();var t=e.d.c-e.e.c,n=P(e.g,154);Dx(n.b,new Rpe(t)),Dx(n.c,new zpe(t)),ly(n.i,new Bpe(t))}function T$e(e){var t=new ta;return t.a+=`VerticalSegment `,hl(t,e.e),t.a+=` `,gl(t,_Te(new Xi,new w(e.k))),t.a}function ST(e,t){var n=0,r,i;for(i=SE(e,t).Kc();i.Ob();)r=P(i.Pb(),12),n+=K(r,(Y(),QQ))==null?0:1;return n}function CT(e,t,n){var r=0,i,a;for(a=dO(e,0);a.b!=a.d.c&&(i=D(N(Lv(a))),!(i>n));)i>=t&&++r;return r}function E$e(e,t){ph(e);try{return e._b(t)}catch(e){if(e=ew(e),j(e,212)||j(e,169))return!1;throw E(e)}}function wT(e,t){ph(e);try{return e.Hc(t)}catch(e){if(e=ew(e),j(e,212)||j(e,169))return!1;throw E(e)}}function D$e(e,t){ph(e);try{return e.Mc(t)}catch(e){if(e=ew(e),j(e,212)||j(e,169))return!1;throw E(e)}}function TT(e,t){ph(e);try{return e.xc(t)}catch(e){if(e=ew(e),j(e,212)||j(e,169))return null;throw E(e)}}function O$e(e,t){ph(e);try{return e.Bc(t)}catch(e){if(e=ew(e),j(e,212)||j(e,169))return null;throw E(e)}}function ET(e,t){switch(t.g){case 2:case 1:return SE(e,t);case 3:case 4:return UE(SE(e,t))}return Vg(),Vg(),QG}function DT(e){var t;return e.Db&64?Aj(e):(t=new Wu(Aj(e)),t.a+=` (name: `,pl(t,e.zb),t.a+=`)`,t.a)}function k$e(e){var t=P(ix(e.c.c,``),233);return t||(t=new ev(Ca(Sa(new Qt,``),`Other`)),oO(e.c.c,``,t)),t}function OT(e,t,n){var r,i=e.sb;return e.sb=t,e.Db&4&&!(e.Db&1)&&(r=new Sm(e,1,4,i,t),n?n.nj(r):n=r),n}function kT(e,t,n){var r,i=e.r;return e.r=t,e.Db&4&&!(e.Db&1)&&(r=new Sm(e,1,8,i,e.r),n?n.nj(r):n=r),n}function A$e(e,t,n){var r=new Hb(e.e,4,13,(i=t.c,i||(CP(),q7)),null,NO(e,t),!1),i;return n?n.nj(r):n=r,n}function j$e(e,t,n){var r=new Hb(e.e,3,13,null,(i=t.c,i||(CP(),q7)),NO(e,t),!1),i;return n?n.nj(r):n=r,n}function AT(e,t){var n=P(t,691),r=n.el();return!r&&n.fl(r=j(t,90)?new QSe(e,P(t,29)):new dBe(e,P(t,156))),r}function jT(e,t,n){var r;e._i(e.i+1),r=e.Zi(t,n),t!=e.i&&tN(e.g,t,e.g,t+1,e.i-t),Sh(e.g,t,r),++e.i,e.Mi(t,n),e.Ni()}function M$e(e,t){var n;return t.a&&(n=t.a.a.length,e.a?gl(e.a,e.b):e.a=new Gu(e.d),TBe(e.a,t.a,t.d.length,n)),e}function N$e(e,t){var n;e.c=t,e.a=a0e(t),e.a<54&&(e.f=(n=t.d>1?CBe(t.a[0],t.a[1]):CBe(t.a[0],0),Dv(t.e>0?n:kb(n))))}function MT(e,t){var n=new Re;return e.a.Bd(n)?(Bu(),new wi(Gh(nKe(e,n.a,t)))):(Hh(e),Bu(),Bu(),oK)}function P$e(e,t){var n;e.c.length!=0&&(n=P(rO(e,V(UJ,jR,10,e.c.length,0,1)),199),zl(n,new mte),Unt(n,t))}function F$e(e,t){var n;e.c.length!=0&&(n=P(rO(e,V(UJ,jR,10,e.c.length,0,1)),199),zl(n,new hte),Unt(n,t))}function NT(e,t){return rl(e)?ff(e,t):al(e)?wOe(e,t):il(e)?(Gh(e),A(e)===A(t)):RNe(e)?e.Fb(t):Wp(e)?vCe(e,t):Oze(e,t)}function PT(e,t,n){if(t<0)Qtt(e,n);else{if(!n.rk())throw E(new Fi(HH+n.xe()+UH));P(n,69).wk().Ek(e,e.hi(),t)}}function I$e(e,t,n){if(e<0||t>n)throw E(new Mi(BI+e+VI+t+`, size: `+n));if(e>t)throw E(new Fi(BI+e+vyt+t))}function L$e(e){var t;return e.Db&64?Aj(e):(t=new Wu(Aj(e)),t.a+=` (source: `,pl(t,e.d),t.a+=`)`,t.a)}function R$e(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e>=48&&e<=57?e-48:0}function z$e(e){SP();var t,n,r,i;for(n=sO(),r=0,i=n.length;r=0?yD(e):Xm(yD(kb(e))))}function W$e(e,t,n,r,i,a){this.e=new T,this.f=(uS(),i2),M(this.e,e),this.d=t,this.a=n,this.b=r,this.f=i,this.c=a}function G$e(e,t,n){e.n=Dp(Y9,[X,dI],[376,28],14,[n,C_(r.Math.ceil(t/32))],2),e.o=t,e.p=n,e.j=t-1>>1,e.k=n-1>>1}function K$e(e){return e-=e>>1&1431655765,e=(e>>2&858993459)+(e&858993459),e=(e>>4)+e&252645135,e+=e>>8,e+=e>>16,e&63}function q$e(e,t){var n,r;for(r=new Lu(e);r.e!=r.i.gc();)if(n=P(gO(r),142),A(t)===A(n))return!0;return!1}function J$e(e,t,n){var r,i,a=(i=Mj(e.b,t),i);return a&&(r=P(jN(Lb(e,a),``),29),r)?Hit(e,r,t,n):null}function UT(e,t,n){var r,i,a=(i=Mj(e.b,t),i);return a&&(r=P(jN(Lb(e,a),``),29),r)?Uit(e,r,t,n):null}function Y$e(e,t){var n=Bx(e.i,t);if(n==null)throw E(new Vi(`Node did not exist in input.`));return yC(t,n),null}function X$e(e,t){var n=Qj(e,t);if(j(n,331))return P(n,35);throw E(new Fi(HH+t+`' is not a valid attribute`))}function WT(e,t,n){var r=e.gc();if(t>r)throw E(new lf(t,r));if(e.Si()&&e.Hc(n))throw E(new Fi(vU));e.Gi(t,n)}function Z$e(e,t){t.Ug(`Sort end labels`,1),To(hg(ox(new Mp(null,new cv(e.b,16)),new Qee),new $ee),new ete),t.Vg()}function GT(){GT=C,r8=new jc(dL,0),n8=new jc(lL,1),t8=new jc(cL,2),e8=new jc(hL,3),i8=new jc(`UP`,4)}function KT(){KT=C,m3=new Tc(`P1_STRUCTURE`,0),h3=new Tc(`P2_PROCESSING_ORDER`,1),g3=new Tc(`P3_EXECUTION`,2)}function Q$e(){Q$e=C,jFt=HD(HD(Go(HD(HD(Go(vp(new Zh,(Ok(),P2),(LM(),R2)),F2),OPt),APt),I2),wPt),jPt)}function $$e(e){switch(P(K(e,(Y(),MQ)),311).g){case 1:W(e,MQ,(Zb(),iQ));break;case 2:W(e,MQ,(Zb(),oQ))}}function e1e(e){switch(e){case 0:return new a_e;case 1:return new r_e;case 2:return new i_e;default:throw E(new Lr)}}function t1e(e){switch(e.g){case 2:return n8;case 1:return t8;case 4:return e8;case 3:return i8;default:return r8}}function qT(e,t){switch(e.b.g){case 0:case 1:return t;case 2:case 3:return new wg(t.d,0,t.a,t.b);default:return null}}function JT(e){switch(e.g){case 1:return g5;case 2:return Z8;case 3:return X8;case 4:return m5;default:return h5}}function YT(e){switch(e.g){case 1:return m5;case 2:return g5;case 3:return Z8;case 4:return X8;default:return h5}}function XT(e){switch(e.g){case 1:return X8;case 2:return m5;case 3:return g5;case 4:return Z8;default:return h5}}function ZT(e,t,n,r){switch(t){case 1:return!e.n&&(e.n=new F(Q5,e,1,7)),e.n;case 2:return e.k}return W3e(e,t,n,r)}function QT(e,t,n){var r,i;return e.Pj()?(i=e.Qj(),r=dj(e,t,n),e.Jj(e.Ij(7,G(n),r,t,i)),r):dj(e,t,n)}function $T(e,t){var n,r,i;e.d==null?(++e.e,--e.f):(i=t.ld(),n=t.Bi(),r=(n&AP)%e.d.length,nWe(e,r,Zit(e,r,n,i)))}function eE(e,t){var n=(e.Bb&pF)!=0;t?e.Bb|=pF:e.Bb&=-1025,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,10,n,t))}function tE(e,t){var n=(e.Bb&uI)!=0;t?e.Bb|=uI:e.Bb&=-4097,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,12,n,t))}function nE(e,t){var n=(e.Bb&RU)!=0;t?e.Bb|=RU:e.Bb&=-8193,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,15,n,t))}function rE(e,t){var n=(e.Bb&zU)!=0;t?e.Bb|=zU:e.Bb&=-2049,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,11,n,t))}function n1e(e){var t;e.g&&(t=e.c.kg()?e.f:e.a,Ost(t.a,e.o,!0),Ost(t.a,e.o,!1),W(e.o,(mP(),Q1),(rA(),L8)))}function r1e(e){var t;if(!e.a)throw E(new Ii(`Cannot offset an unassigned cut.`));t=e.c-e.b,e.b+=t,NIe(e,t),MIe(e,t)}function i1e(e,t){var n=xh(e.k,t);if(n==null)throw E(new Vi(`Port did not exist in input.`));return yC(t,n),null}function a1e(e){var t,n;for(n=Git(Mx(e)).Kc();n.Ob();)if(t=kd(n.Pb()),JM(e,t))return _He((Zbe(),VVt),t);return null}function o1e(e){var t,n;for(n=e.p.a.ec().Kc();n.Ob();)if(t=P(n.Pb(),218),t.f&&e.b[t.c]<-1e-10)return t;return null}function s1e(e){var t,n=jh(new ta,91);for(t=!0;e.Ob();)t||(n.a+=PP),t=!1,hl(n,e.Pb());return(n.a+=`]`,n).a}function c1e(e){var t=new T,n,r;for(r=new w(e.b);r.at?1:e==t?e==0?aE(1/e,1/t):0:isNaN(e)?+!isNaN(t):-1}function u1e(e){var t=e.a[e.c-1&e.a.length-1];return t==null?null:(e.c=e.c-1&e.a.length-1,Sh(e.a,e.c,null),t)}function d1e(e){var t,n,r=0;for(n=e.length,t=0;t=1?n8:e8):n}function g1e(e){switch(P(K(e,(mP(),S1)),223).g){case 1:return new zre;case 3:return new Wre;default:return new Rre}}function lE(e){if(e.c)lE(e.c);else if(e.d)throw E(new Ii(`Stream already terminated, can't be modified or used`))}function uE(e,t,n){var r=e.a.get(t);return e.a.set(t,n===void 0?null:n),r===void 0?(++e.c,++e.b.g):++e.d,r}function _1e(e,t,n){var r,i;for(i=e.a.ec().Kc();i.Ob();)if(r=P(i.Pb(),10),$C(n,P(Ep(t,r.p),16)))return r;return null}function dE(e,t,n){var r=0;return t&&(Jl(e.a)?r+=t.f.a/2:r+=t.f.b/2),n&&(Jl(e.a)?r+=n.f.a/2:r+=n.f.b/2),r}function v1e(e,t,n){var r=n;!r&&(r=Qje(new di,0)),r.Ug(_bt,2),v4e(e.b,t,r.eh(1)),fmt(e,t,r.eh(1)),u_t(t,r.eh(1)),r.Vg()}function fE(e,t,n){var r=(Ia(),i=new tn,i),i;return Xx(r,t),Vx(r,n),e&&tb((!e.a&&(e.a=new ju(z5,e,5)),e.a),r),r}function pE(e){var t;return e.Db&64?Aj(e):(t=new Wu(Aj(e)),t.a+=` (identifier: `,pl(t,e.k),t.a+=`)`,t.a)}function mE(e,t){var n=(e.Bb&GH)!=0;t?e.Bb|=GH:e.Bb&=-32769,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,18,n,t))}function hE(e,t){var n=(e.Bb&GH)!=0;t?e.Bb|=GH:e.Bb&=-32769,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,18,n,t))}function gE(e,t){var n=(e.Bb&ZP)!=0;t?e.Bb|=ZP:e.Bb&=-16385,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,16,n,t))}function _E(e,t){var n=(e.Bb&pI)!=0;t?e.Bb|=pI:e.Bb&=-65537,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,20,n,t))}function vE(e){var t=V(K9,EF,28,2,15,1);return e-=pI,t[0]=(e>>10)+mI&OF,t[1]=(e&1023)+56320&OF,ND(t,0,t.length)}function y1e(e){var t=OA(e);return t>34028234663852886e22?cI:t<-34028234663852886e22?lI:t}function yE(e,t){var n;return Il(e)&&Il(t)&&(n=e+t,iI`+hv(t.c):`e_`+US(t),e.b&&e.c?hv(e.b)+`->`+hv(e.c):`e_`+US(e))}function S1e(e,t){return ff(t.b&&t.c?hv(t.b)+`->`+hv(t.c):`e_`+US(t),e.b&&e.c?hv(e.b)+`->`+hv(e.c):`e_`+US(e))}function CE(e,t){return uu(),fS(bF),r.Math.abs(e-t)<=bF||e==t||isNaN(e)&&isNaN(t)?0:et?1:Pl(isNaN(e),isNaN(t))}function wE(){wE=C,f8=new Nc(dL,0),u8=new Nc(`POLYLINE`,1),l8=new Nc(`ORTHOGONAL`,2),d8=new Nc(`SPLINES`,3)}function TE(){TE=C,IIt=new Sc(`ASPECT_RATIO_DRIVEN`,0),Q4=new Sc(`MAX_SCALE_DRIVEN`,1),FIt=new Sc(`AREA_DRIVEN`,2)}function C1e(e,t,n){var r;try{MZe(e,t,n)}catch(e){throw e=ew(e),j(e,606)?(r=e,E(new EUe(r))):E(e)}return t}function w1e(e){var t,n,r;for(n=0,r=e.length;nt&&r.Ne(e[a-1],e[a])>0;--a)o=e[a],Sh(e,a,e[a-1]),Sh(e,a-1,o)}function jE(e,t){var n=t.f,r,i,a,o;if(oO(e.c.d,n,t),t.g!=null)for(i=t.g,a=0,o=i.length;at){OBe(n);break}}Zm(n,t)}function A1e(e,t){var n,i=D(N(gD(Ev(t),(mP(),c0))));n=r.Math.max(0,i/2-.5),zk(t,n,1),M(e,new Oxe(t,n))}function j1e(e,t,n){var r;n.Ug(`Straight Line Edge Routing`,1),n.dh(t,mxt),r=P(J(t,(Pd(),y4)),27),ppt(e,r),n.dh(t,YV)}function ME(e,t){e.n.c.length==0&&M(e.n,new w_(e.s,e.t,e.i)),M(e.b,t),q4e(P(Ep(e.n,e.n.c.length-1),209),t),tft(e,t)}function NE(e){var t;this.a=(t=P(e.e&&e.e(),9),new xf(t,P(Yd(t,t.length),9),0)),this.b=V(WW,FP,1,this.a.a.length,5,1)}function PE(e){var t;return Array.isArray(e)&&e.Tm===ne?Ha($w(e))+`@`+(t=US(e)>>>0,t.toString(16)):e.toString()}function M1e(e,t){return e.h==eI&&e.m==0&&e.l==0?(t&&(mG=vu(0,0,0)),xCe(($b(),gG))):(t&&(mG=vu(e.l,e.m,e.h)),vu(0,0,0))}function N1e(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function P1e(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function FE(e,t,n,r){switch(t){case 3:return e.f;case 4:return e.g;case 5:return e.i;case 6:return e.j}return ZT(e,t,n,r)}function IE(e,t){if(t==e.d)return e.e;if(t==e.e)return e.d;throw E(new Fi(`Node `+t+` not part of edge `+e))}function F1e(e,t){var n=Qj(e.Dh(),t);if(j(n,102))return P(n,19);throw E(new Fi(HH+t+`' is not a valid reference`))}function LE(e,t,n,r){if(t<0)Pat(e,n,r);else{if(!n.rk())throw E(new Fi(HH+n.xe()+UH));P(n,69).wk().Ck(e,e.hi(),t,r)}}function RE(e){var t;if(e.b){if(RE(e.b),e.b.d!=e.c)throw E(new Vr)}else e.d.dc()&&(t=P(e.f.c.xc(e.e),16),t&&(e.d=t))}function I1e(e){Rd();var t=e.o.b,n,r,i;for(r=P(P(Dy(e.r,(nP(),m5)),21),87).Kc();r.Ob();)n=P(r.Pb(),117),i=n.e,i.b+=t}function L1e(e){var t,n,r;for(this.a=new Rl,r=new w(e);r.a=i)return t.c+n;return t.c+t.b.gc()}function z1e(e,t){Nd();var n,r=LGe(e),i=t,a;for(bb(r,0,r.length,i),n=0;n0&&(r+=i,++n);return n>1&&(r+=e.d*(n-1)),r}function V1e(e){var t,n,r,i,a=m7e(e);return n=eo(e.c),r=!n,r&&(i=new Tn,hx(a,`knownLayouters`,i),t=new Mhe(i),ly(e.c,t)),a}function HE(e){var t,n,r=new $i;for(r.a+=`[`,t=0,n=e.gc();t0&&(sv(t-1,e.length),e.charCodeAt(t-1)==58)&&!zE(e,y7,b7))}function WE(e,t){var n;return A(e)===A(t)?!0:j(t,92)?(n=P(t,92),e.e==n.e&&e.d==n.d&&xHe(e,n.a)):!1}function GE(e){switch(nP(),e.g){case 4:return Z8;case 1:return X8;case 3:return m5;case 2:return g5;default:return h5}}function G1e(e){var t,n;if(e.b)return e.b;for(n=_K?null:e.d;n;){if(t=_K?null:n.b,t)return t;n=_K?null:n.d}return Co(),hK}function KE(e){var t,n,r=D(N(e.a.of((vP(),q6))));for(n=new w(e.a.Sf());n.a>5,t=e&31,r=V(q9,HF,28,n+1,15,1),r[n]=1<3;)i*=10,--a;e=(e+(i>>1))/i|0}return r.i=e,!0}function eD(e,t){var n=(e.i??aN(e),e.i),r=t.Lj(),i;if(r!=-1){for(i=n.length;r=0;--r)for(t=n[r],i=0;i>1,this.k=t-1>>1}function f0e(e){gb(),P(e.of((vP(),D6)),181).Hc((UM(),A5))&&(P(e.of(z6),181).Fc((rj(),J8)),P(e.of(D6),181).Mc(A5))}function p0e(e){var t=e.d==(GA(),WX),n=x5e(e);t&&!n||!t&&n?W(e.a,(mP(),J$),(RO(),Z3)):W(e.a,(mP(),J$),(RO(),X3))}function aD(){aD=C,zo(),O0=(mP(),v0),EMt=Oy(U(O(j3,1),_V,149,0,[s0,c0,u0,d0,m0,h0,g0,_0,b0,S0,l0,f0,y0]))}function m0e(e,t){var n=P(ay(e,cb(new Te,new we,new Ne,U(O(xK,1),Z,108,0,[(Zw(),yK)]))),15);return n.Qc(MMe(n.gc()))}function h0e(e,t){var n,r=new nr(e.a.ad(t,!0));if(r.a.gc()<=1)throw E(new zr);return n=r.a.ec().Kc(),n.Pb(),P(n.Pb(),40)}function g0e(e,t,n){var r=D(e.p[t.i.p])+D(e.d[t.i.p])+t.n.b+t.a.b;return D(e.p[n.i.p])+D(e.d[n.i.p])+n.n.b+n.a.b-r}function oD(e,t){var n;return e.i>0&&(t.lengthe.i&&Sh(t,e.i,null),t}function sD(e){var t;return e.Db&64?DT(e):(t=new Wu(DT(e)),t.a+=` (instanceClassName: `,pl(t,e.D),t.a+=`)`,t.a)}function cD(e){var t,n,r,i=0;for(n=0,r=e.length;n0&&(e._j(),r=t==null?0:US(t),i=(r&AP)%e.d.length,n=Zit(e,i,r,t),n!=-1)}function v0e(e,t){var n,i;e.a=yE(e.a,1),e.c=r.Math.min(e.c,t),e.b=r.Math.max(e.b,t),e.d+=t,n=t-e.f,i=e.e+n,e.f=i-e.e-n,e.e=i}function dD(e,t){switch(t){case 3:Ux(e,0);return;case 4:Wx(e,0);return;case 5:Gx(e,0);return;case 6:Kx(e,0);return}vT(e,t)}function fD(e,t){switch(t.g){case 1:return Jf(e.j,(fC(),$J));case 2:return Jf(e.j,(fC(),tY));default:return Vg(),Vg(),QG}}function pD(e){gh();var t=e.Pc();switch(t.length){case 0:return QW;case 1:return new wp(ph(t[0]));default:return new u_(w1e(t))}}function y0e(e,t){e.Xj();try{e.d.bd(e.e++,t),e.f=e.d.j,e.g=-1}catch(e){throw e=ew(e),j(e,77)?E(new Vr):E(e)}}function mD(){mD=C,c9=new Xse,iHt=new Zse,aHt=new Qse,oHt=new $se,sHt=new ece,cHt=new tce,lHt=new nce,uHt=new rce,dHt=new ice}function hD(e,t){Sl();var n=Kd((Ci(),Ci(),dG)),r=null;return t==n&&(r=P(v_(uG,e),624)),r||(r=new ZPe(e),t==n&&H_(uG,e,r)),r}function b0e(e){return IO(),(e.q?e.q:(Vg(),Vg(),$G))._b((mP(),V1))?P(K(e,V1),203):P(K(Bh(e),H1),203)}function gD(e,t){var n,r=null;return yd(e,(mP(),p0))&&(n=P(K(e,p0),96),n.pf(t)&&(r=n.of(t))),r??=K(Bh(e),t),r}function x0e(e,t){var n,r,i;return j(t,44)?(n=P(t,44),r=n.ld(),i=TT(e.Rc(),r),zh(i,n.md())&&(i!=null||e.Rc()._b(r))):!1}function _D(e,t){var n,r,i;return e.f>0&&(e._j(),r=t==null?0:US(t),i=(r&AP)%e.d.length,n=Knt(e,i,r,t),n)?n.md():null}function vD(e,t,n){var r,i,a;return e.Pj()?(r=e.i,a=e.Qj(),jT(e,r,t),i=e.Ij(3,null,t,r,a),n?n.nj(i):n=i):jT(e,e.i,t),n}function S0e(e,t,n){var r=new Hb(e.e,4,10,(i=t.c,j(i,90)?P(i,29):(CP(),J7)),null,NO(e,t),!1),i;return n?n.nj(r):n=r,n}function C0e(e,t,n){var r=new Hb(e.e,3,10,null,(i=t.c,j(i,90)?P(i,29):(CP(),J7)),NO(e,t),!1),i;return n?n.nj(r):n=r,n}function w0e(e){Rd();var t=new Vl(P(e.e.of((vP(),E6)),8));return e.B.Hc((UM(),T5))&&(t.a<=0&&(t.a=20),t.b<=0&&(t.b=20)),t}function yD(e){AM();var t,n=nm(e);return t=nm(um(e,32)),t==0?n>10||n<0?new Xv(1,n):YTt[n]:new Ize(n,t)}function bD(e,t){var n;return Il(e)&&Il(t)&&(n=e%t,iI=0?a=a.a[1]:(i=a,a=a.a[0])}return i}function OD(e,t,n){for(var r,i=null,a=e.b;a;){if(r=e.a.Ne(t,a.d),n&&r==0)return a;r<=0?a=a.a[0]:(i=a,a=a.a[1])}return i}function N0e(e,t,n,r){var i=!1,a,o;return mht(e.f,n,r)&&(_2e(e.f,e.a[t][n],e.a[t][r]),a=e.a[t],o=a[r],a[r]=a[n],a[n]=o,i=!0),i}function P0e(e,t,n){var r,i=P(xh(e.b,n),183),a,o;for(r=0,o=new w(t.j);o.a>5,r,i,a;return t&=31,i=e.d+n+(t==0?0:1),r=V(q9,HF,28,i,15,1),v7e(r,e.a,n,t),a=new Bm(e.e,i,r),Cv(a),a}function I0e(e,t){var n,r,i;for(r=new pm(Vu(OE(e).a.Kc(),new d));Cj(r);)if(n=P(by(r),18),i=n.d.i,i.c==t)return!1;return!0}function AD(e,t,n){var i,a,o,s=e.k,c=t.k;return i=n[s.g][c.g],a=N(gD(e,i)),o=N(gD(t,i)),r.Math.max((Gh(a),a),(Gh(o),o))}function L0e(){return Error.stackTraceLimit>0?(r.Error.stackTraceLimit=Error.stackTraceLimit=64,!0):`stack`in Error()}function R0e(e,t){return uu(),uu(),fS(bF),(r.Math.abs(e-t)<=bF||e==t||isNaN(e)&&isNaN(t)?0:et?1:Pl(isNaN(e),isNaN(t)))>0}function jD(e,t){return uu(),uu(),fS(bF),(r.Math.abs(e-t)<=bF||e==t||isNaN(e)&&isNaN(t)?0:et?1:Pl(isNaN(e),isNaN(t)))<0}function z0e(e,t){return uu(),uu(),fS(bF),(r.Math.abs(e-t)<=bF||e==t||isNaN(e)&&isNaN(t)?0:et?1:Pl(isNaN(e),isNaN(t)))<=0}function MD(e,t){for(var n=0;!t[n]||t[n]==``;)n++;for(var r=t[n++];n0&&this.b>0&&(this.g=Pp(this.c,this.b,this.a))}function K0e(e,t){var n=e.a,r;t=String(t),n.hasOwnProperty(t)&&(r=n[t]);var i=(vw(),pG)[typeof r];return i?i(r):XQe(typeof r)}function RD(e){var t,n,r=null;if(t=dU in e.a,n=!t,n)throw E(new Vi(`Every element must have an id.`));return r=ij(A_(e,dU)),r}function zD(e){var t,n=vet(e);for(t=null;e.c==2;)hP(e),t||(t=(xP(),xP(),++W9,new lu(2)),LN(t,n),n=t),n.Jm(vet(e));return n}function BD(e,t){var n,r,i;return e._j(),r=t==null?0:US(t),i=(r&AP)%e.d.length,n=Knt(e,i,r,t),n?(aJe(e,n),n.md()):null}function q0e(e,t){return e.e>t.e?1:e.et.d?e.e:e.d=48&&e<48+r.Math.min(10,10)?e-48:e>=97&&e<97?e-97+10:e>=65&&e<65?e-65+10:-1}function Y0e(e,t){if(t.c==e)return t.d;if(t.d==e)return t.c;throw E(new Fi(`Input edge is not connected to the input port.`))}function X0e(e){if(qD(DH,e))return rd(),yG;if(qD(OH,e))return rd(),vG;throw E(new Fi(`Expecting true or false`))}function VD(e){switch(typeof e){case OP:return jw(e);case Vvt:return jl(e);case DP:return EDe(e);default:return e==null?0:td(e)}}function HD(e,t){if(e.a<0)throw E(new Ii(`Did not call before(...) or after(...) before calling add(...).`));return mEe(e,e.a,t),e}function UD(e){return R_(),j(e,162)?P(xh(f7,tEt),295).Rg(e):km(f7,$w(e))?P(xh(f7,$w(e)),295).Rg(e):null}function WD(e){var t,n;return e.Db&32||(n=(t=P(NC(e,16),29),bh(t||e.ii())-bh(e.ii())),n!=0&&GD(e,32,V(WW,FP,1,n,5,1))),e}function GD(e,t,n){var r;(e.Db&t)==0?n!=null&&pst(e,t,n):n==null?jrt(e,t):(r=pk(e,t),r==-1?e.Eb=n:Sh(rS(e.Eb),r,n))}function Z0e(e,t,n,r){var i,a;t.c.length!=0&&(i=Lat(n,r),a=ent(t),To(Cx(new Mp(null,new cv(a,1)),new Yie),new sIe(e,n,i,r)))}function Q0e(e,t){var n,r=e.a.length-1,i,a;return n=t-e.b&r,a=e.c-t&r,i=e.c-e.b&r,lDe(n=a?(PQe(e,t),-1):(NQe(e,t),1)}function KD(e){var t,n,r=e.Jh();if(!r)for(t=0,n=e.Ph();n;n=n.Ph()){if(++t>gI)return n.Qh();if(r=n.Jh(),r||n==e)break}return r}function $0e(e,t){var n;return A(t)===A(e)?!0:!j(t,21)||(n=P(t,21),n.gc()!=e.gc())?!1:e.Ic(n)}function e2e(e,t){return e.et.e?1:e.ft.f?1:US(e)-US(t)}function qD(e,t){return Gh(e),t==null?!1:ff(e,t)?!0:e.length==t.length&&ff(e.toLowerCase(),t.toLowerCase())}function JD(e){var t,n;return dT(e,-129)>0&&dT(e,128)<0?(WMe(),t=nm(e)+128,n=AG[t],!n&&(n=AG[t]=new Mn(e)),n):new Mn(e)}function YD(){YD=C,RJ=new Ds(wR,0),IJ=new Ds(`INSIDE_PORT_SIDE_GROUPS`,1),FJ=new Ds(`GROUP_MODEL_ORDER`,2),LJ=new Ds(vbt,3)}function t2e(e){var t;return e.b||eye(e,(t=hOe(e.e,e.a),!t||!ff(OH,_D((!t.b&&(t.b=new Td((CP(),$7),o9,t)),t.b),`qualified`)))),e.c}function n2e(e,t){for(var n=(sv(t,e.length),e.charCodeAt(t)),r=t+1;r2e3&&(ITt=e,sG=r.setTimeout(zye,10))),oG++==0&&(DKe((Si(),cG)),!0)}function x2e(e,t,n){var r;(mEt?(G1e(e),!0):hEt||_Et?(Co(),!0):gEt&&(Co(),!1))&&(r=new eke(t),r.b=n,w9e(e,r))}function eO(e,t){var n=!e.A.Hc((TD(),x5))||e.q==(rA(),R8);e.u.Hc((rj(),G8))?n?Qgt(e,t):Dgt(e,t):e.u.Hc(q8)&&(n?igt(e,t):x_t(e,t))}function S2e(e){var t;A(J(e,(vP(),g6)))===A((_T(),_8))&&(I_(e)?(t=P(J(I_(e),g6),346),OO(e,g6,t)):OO(e,g6,v8))}function C2e(e){var t,n;return yd(e.d.i,(mP(),Y1))?(t=P(K(e.c.i,Y1),17),n=P(K(e.d.i,Y1),17),_u(t.a,n.a)>0):!1}function w2e(e,t,n){return new wg(r.Math.min(e.a,t.a)-n/2,r.Math.min(e.b,t.b)-n/2,r.Math.abs(e.a-t.a)+n,r.Math.abs(e.b-t.b)+n)}function T2e(e){var t;this.d=new T,this.j=new Fa,this.g=new Fa,t=e.g.b,this.f=P(K(Bh(t),(mP(),_1)),88),this.e=D(N(yO(t,m0)))}function E2e(e){this.d=new T,this.e=new ry,this.c=V(q9,HF,28,(nP(),U(O(_5,1),TR,64,0,[h5,Z8,X8,m5,g5])).length,15,1),this.b=e}function tO(e,t,n){var r=n[e.g][t];switch(e.g){case 1:case 3:return new k(0,r);case 2:case 4:return new k(r,0);default:return null}}function D2e(e,t,n){var r,i=P(h_(t.f),205);try{i.rf(e,n),bFe(t.f,i)}catch(e){throw e=ew(e),j(e,103)?(r=e,E(r)):E(e)}}function O2e(e,t,n){var r=null,i,a,o,s=Ymt(dS(),t),c;return a=null,s&&(i=null,c=Pmt(s,n),o=null,c!=null&&(o=e.qf(s,c)),i=o,a=i),r=a,r}function nO(e,t,n,r){var i=e.length;if(t>=i)return i;for(t=t>0?t:0;tr&&Sh(t,r,null),t}function k2e(e,t){var n,r=e.a.length;for(t.lengthr&&Sh(t,r,null),t}function iO(e,t){var n,r;if(++e.j,t!=null&&(n=(r=e.a.Cb,j(r,99)?P(r,99).th():null),Jnt(t,n))){GD(e.a,4,n);return}GD(e.a,4,P(t,129))}function A2e(e){var t;if(e==null)return null;if(t=Qit(EN(e,!0)),t==null)throw E(new Hi(`Invalid hexBinary value: '`+e+`'`));return t}function aO(e,t,n){var r;t.a.length>0&&(M(e.b,new Aje(t.a,n)),r=t.a.length,0r&&(t.a+=Uwe(V(K9,EF,28,-r,15,1))))}function j2e(e,t,n){var r,i,a;if(!n[t.d])for(n[t.d]=!0,i=new w(eT(t));i.a=e.b>>1)for(r=e.c,n=e.b;n>t;--n)r=r.b;else for(r=e.a.a,n=0;n=0?e.Wh(i):cj(e,r)):n<0?cj(e,r):P(r,69).wk().Bk(e,e.hi(),n)}function H2e(e){var t,n,r=(!e.o&&(e.o=new lb((lP(),Z5),n7,e,0)),e.o);for(n=r.c.Kc();n.e!=n.i.gc();)t=P(n.Yj(),44),t.md();return Jy(r)}function hO(e){var t;if(j(e.a,4)){if(t=UD(e.a),t==null)throw E(new Ii(lSt+e.b+`'. `+sSt+(Ad(m7),m7.k)+cSt));return t}return e.a}function U2e(e,t){var n,r;if(e.j.length!=t.j.length)return!1;for(n=0,r=e.j.length;n=64&&t<128&&(i=dv(i,cm(1,t-64)));return i}function yO(e,t){var n,r=null;return yd(e,(vP(),K6))&&(n=P(K(e,K6),96),n.pf(t)&&(r=n.of(t))),r==null&&Bh(e)&&(r=K(Bh(e),t)),r}function W2e(e,t){var n=P(K(e,(mP(),j1)),75);return Cu(t,SOt)?n?Fg(n):(n=new ai,W(e,j1,n)):n&&W(e,j1,null),n}function bO(){bO=C,Iq=(vP(),Bzt),Pq=fzt,yDt=c6,Fq=A6,CDt=(Rk(),FK),SDt=NK,wDt=LK,xDt=MK,bDt=(qw(),kq),jq=gDt,Mq=_Dt,Nq=vDt}function xO(e){switch(Pbe(),this.c=new T,this.d=e,e.g){case 0:case 2:this.a=$h(NJ),this.b=cI;break;case 3:case 1:this.a=NJ,this.b=lI}}function G2e(e){var t;mf(P(K(e,(mP(),Q1)),101))&&(t=e.b,Znt((ov(0,t.c.length),P(t.c[0],30))),Znt(P(Ep(t,t.c.length-1),30)))}function K2e(e,t){t.Ug(`Self-Loop post-processing`,1),To(hg(hg(ox(new Mp(null,new cv(e.b,16)),new vne),new yne),new bne),new xne),t.Vg()}function q2e(e,t,n){var r,i;if(e.c)Gx(e.c,e.c.i+t),Kx(e.c,e.c.j+n);else for(i=new w(e.b);i.a=0&&(n.d=e.t);break;case 3:e.t>=0&&(n.a=e.t)}e.C&&(n.b=e.C.b,n.c=e.C.c)}function CO(){CO=C,LMt=new $s(vV,0),H0=new $s(JR,1),U0=new $s(`LINEAR_SEGMENTS`,2),V0=new $s(`BRANDES_KOEPF`,3),W0=new $s(Qbt,4)}function wO(){wO=C,wq=new xs(_L,0),Cq=new xs(vL,1),Tq=new xs(yL,2),Eq=new xs(bL,3),wq.a=!1,Cq.a=!0,Tq.a=!1,Eq.a=!0}function TO(){TO=C,gq=new ys(_L,0),hq=new ys(vL,1),_q=new ys(yL,2),vq=new ys(bL,3),gq.a=!1,hq.a=!0,_q.a=!1,vq.a=!0}function EO(e,t,n,r){var i;return n>=0?e.Sh(t,n,r):(e.Ph()&&(r=(i=e.Fh(),i>=0?e.Ah(r):e.Ph().Th(e,-1-i,null,r))),e.Ch(t,n,r))}function DO(e,t){switch(t){case 7:!e.e&&(e.e=new cf(U5,e,7,4)),RN(e.e);return;case 8:!e.d&&(e.d=new cf(U5,e,8,5)),RN(e.d);return}dD(e,t)}function OO(e,t,n){return n==null?(!e.o&&(e.o=new lb((lP(),Z5),n7,e,0)),BD(e.o,t)):(!e.o&&(e.o=new lb((lP(),Z5),n7,e,0)),Hk(e.o,t,n)),e}function t4e(e,t){Vg();var n=e,r,i,a=t;for(j(e,21)&&!j(t,21)&&(n=t,a=e),i=n.Kc();i.Ob();)if(r=i.Pb(),a.Hc(r))return!1;return!0}function n4e(e,t,n,r){return t.an.b)}function kO(e,t){return rl(e)?!!TTt[t]:e.Sm?!!e.Sm[t]:al(e)?!!wTt[t]:il(e)?!!CTt[t]:!1}function r4e(e){var t=e.a;do t=P(by(new pm(Vu(DE(t).a.Kc(),new d))),18).c.i,t.k==(DA(),qJ)&&e.b.Fc(t);while(t.k==(DA(),qJ));e.b=UE(e.b)}function i4e(e,t){var n,i,a=e;for(i=new pm(Vu(DE(t).a.Kc(),new d));Cj(i);)n=P(by(i),18),n.c.i.c&&(a=r.Math.max(a,n.c.i.c.p));return a}function a4e(e,t){var n,r,i=0;for(r=P(P(Dy(e.r,t),21),87).Kc();r.Ob();)n=P(r.Pb(),117),i+=n.d.d+n.b.Mf().b+n.d.a,r.Ob()&&(i+=e.w);return i}function o4e(e,t){var n,r,i=0;for(r=P(P(Dy(e.r,t),21),87).Kc();r.Ob();)n=P(r.Pb(),117),i+=n.d.b+n.b.Mf().a+n.d.c,r.Ob()&&(i+=e.w);return i}function s4e(e){var t,n,r=0,i=sM(e);if(i.c.length==0)return 1;for(n=new w(i);n.a=0?e.Lh(o,n,!0):mj(e,a,n)):P(a,69).wk().yk(e,e.hi(),i,n,r)}function d4e(e,t,n,r){var i=z$e(t.pf((vP(),C6))?P(t.of(C6),21):e.j);i!=(SP(),cq)&&(n&&!PD(i)||tet($it(e,i,r),t))}function f4e(e){switch(e.g){case 1:return KC(),mq;case 3:return KC(),dq;case 2:return KC(),pq;case 4:return KC(),fq;default:return null}}function p4e(e,t,n){if(e.e)switch(e.b){case 1:OIe(e.c,t,n);break;case 0:kIe(e.c,t,n)}else XVe(e.c,t,n);e.a[t.p][n.p]=e.c.i,e.a[n.p][t.p]=e.c.e}function m4e(e){var t,n;if(e==null)return null;for(n=V(UJ,X,199,e.length,0,2),t=0;t=0)return i;if(e.ol()){for(r=0;r=i)throw E(new lf(t,i));if(e.Si()&&(r=e.dd(n),r>=0&&r!=t))throw E(new Fi(vU));return e.Xi(t,n)}function FO(e,t){if(this.a=P(ph(e),253),this.b=P(ph(t),253),e.Ed(t)>0||e==(pi(),XW)||t==(mi(),ZW))throw E(new Fi(`Invalid range: `+tHe(e,t)))}function g4e(e){var t,n;for(this.b=new T,this.c=e,this.a=!1,n=new w(e.a);n.a0),(t&-t)==t)return C_(t*Lj(e,31)*4656612873077393e-25);do n=Lj(e,31),r=n%t;while(n-r+(t-1)<0);return C_(r)}function C4e(e,t,n){switch(n.g){case 1:e.a=t.a/2,e.b=0;break;case 2:e.a=t.a,e.b=t.b/2;break;case 3:e.a=t.a/2,e.b=t.b;break;case 4:e.a=0,e.b=t.b/2}}function HO(e,t,n,r){var i,a;for(i=t;i1&&(a=_4e(e,t)),a}function T4e(e){var t=D(N(J(e,(vP(),X6))))*r.Math.sqrt((!e.a&&(e.a=new F($5,e,10,11)),e.a).i);return new k(t,t/D(N(J(e,Y6))))}function GO(e){var t;return e.f&&e.f.Vh()&&(t=P(e.f,54),e.f=P(pT(e,t),84),e.f!=t&&e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,9,8,t,e.f))),e.f}function KO(e){var t;return e.i&&e.i.Vh()&&(t=P(e.i,54),e.i=P(pT(e,t),84),e.i!=t&&e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,9,7,t,e.i))),e.i}function qO(e){var t;return e.b&&e.b.Db&64&&(t=e.b,e.b=P(pT(e,t),19),e.b!=t&&e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,9,21,t,e.b))),e.b}function JO(e,t){var n,r,i;e.d==null?(++e.e,++e.f):(r=t.Bi(),hot(e,e.f+1),i=(r&AP)%e.d.length,n=e.d[i],!n&&(n=e.d[i]=e.dk()),n.Fc(t),++e.f)}function YO(e,t,n){var r;return t.tk()?!1:t.Ik()==-2?t.qk()==e.e.Dh()&&n==null:(r=t.ik(),r==null?n==null:NT(r,n))}function XO(){var e;vS(16,Qvt),e=UJe(16),this.b=V($W,fF,303,e,0,1),this.c=V($W,fF,303,e,0,1),this.a=null,this.e=null,this.i=0,this.f=e-1,this.g=0}function ZO(e){$De.call(this),this.k=(DA(),JJ),this.j=(vS(6,hF),new Hy(6)),this.b=(vS(2,hF),new Hy(2)),this.d=new ti,this.f=new ri,this.a=e}function E4e(e){var t,n;e.c.length<=1||(t=oct(e,(nP(),m5)),Tet(e,P(t.a,17).a,P(t.b,17).a),n=oct(e,g5),Tet(e,P(n.a,17).a,P(n.b,17).a))}function D4e(e,t,n){var r,i=e.a.b;for(r=i.c.length;r102?-1:e<=57?e-48:e<65?-1:e<=70?e-65+10:e<97?-1:e-97+10}function ik(e,t){if(e==null)throw E(new Li(`null key in entry: null=`+t));if(t==null)throw E(new Li(`null value in entry: `+e+`=null`))}function M4e(e,t){for(var n,r;e.Ob();)if(!t.Ob()||(n=e.Pb(),r=t.Pb(),!(A(n)===A(r)||n!=null&&NT(n,r))))return!1;return!t.Ob()}function N4e(e,t){var n=U(O(Z9,1),hI,28,15,[rT(e.a[0],t),rT(e.a[1],t),rT(e.a[2],t)]);return e.d&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function P4e(e,t){var n=U(O(Z9,1),hI,28,15,[iT(e.a[0],t),iT(e.a[1],t),iT(e.a[2],t)]);return e.d&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function ak(e,t,n){mf(P(K(t,(mP(),Q1)),101))||(eUe(e,t,NA(t,n)),eUe(e,t,NA(t,(nP(),m5))),eUe(e,t,NA(t,Z8)),Vg(),hu(t.j,new tme(e)))}function F4e(e){var t,n;for(e.c||wmt(e),n=new ai,t=new w(e.a),z(t);t.a0&&(sv(0,t.length),t.charCodeAt(0)==43)?(sv(1,t.length+1),t.substr(1)):t))}function e3e(e){var t;return e==null?null:new ru((t=EN(e,!0),t.length>0&&(sv(0,t.length),t.charCodeAt(0)==43)?(sv(1,t.length+1),t.substr(1)):t))}function t3e(e,t,n,r,i,a,o,s){var c,l;r&&(c=r.a[0],c&&t3e(e,t,n,c,i,a,o,s),Tk(e,n,r.d,i,a,o,s)&&t.Fc(r),l=r.a[1],l&&t3e(e,t,n,l,i,a,o,s))}function sk(e,t,n){try{return ol(IS(e,t,n),1)}catch(r){throw r=ew(r),j(r,333)?E(new Mi(SL+e.o+`*`+e.p+CL+t+PP+n+wL)):E(r)}}function n3e(e,t,n){try{return ol(IS(e,t,n),0)}catch(r){throw r=ew(r),j(r,333)?E(new Mi(SL+e.o+`*`+e.p+CL+t+PP+n+wL)):E(r)}}function r3e(e,t,n){try{return ol(IS(e,t,n),2)}catch(r){throw r=ew(r),j(r,333)?E(new Mi(SL+e.o+`*`+e.p+CL+t+PP+n+wL)):E(r)}}function i3e(e,t){if(e.g==-1)throw E(new Rr);e.Xj();try{e.d.hd(e.g,t),e.f=e.d.j}catch(e){throw e=ew(e),j(e,77)?E(new Vr):E(e)}}function a3e(e){var t,n,r,i,a;for(r=new w(e.b);r.aa&&Sh(t,a,null),t}function o3e(e,t){var n,r=e.gc();if(t==null){for(n=0;n0&&(c+=i),l[u]=o,o+=s*(c+r)}function _3e(e){var t,n,r=e.f;for(e.n=V(Z9,hI,28,r,15,1),e.d=V(Z9,hI,28,r,15,1),t=0;t0?e.c:0),++a;e.b=i,e.d=o}function S3e(e,t){var n=U(O(Z9,1),hI,28,15,[BO(e,(Ix(),XK),t),BO(e,ZK,t),BO(e,QK,t)]);return e.f&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function C3e(e,t,n){var r;try{EM(e,t+e.j,n+e.k,!1,!0)}catch(e){throw e=ew(e),j(e,77)?(r=e,E(new Mi(r.g+TL+t+PP+n+`).`))):E(e)}}function w3e(e,t,n){var r;try{EM(e,t+e.j,n+e.k,!0,!1)}catch(e){throw e=ew(e),j(e,77)?(r=e,E(new Mi(r.g+TL+t+PP+n+`).`))):E(e)}}function T3e(e){var t;yd(e,(mP(),R1))&&(t=P(K(e,R1),21),t.Hc((Ej(),w8))?(t.Mc(w8),t.Fc(E8)):t.Hc(E8)&&(t.Mc(E8),t.Fc(w8)))}function E3e(e){var t;yd(e,(mP(),R1))&&(t=P(K(e,R1),21),t.Hc((Ej(),j8))?(t.Mc(j8),t.Fc(k8)):t.Hc(k8)&&(t.Mc(k8),t.Fc(j8)))}function gk(e,t,n,r){var i,a,o,s;return e.a??j9e(e,t),o=t.b.j.c.length,a=n.d.p,s=r.d.p,i=s-1,i<0&&(i=o-1),a<=i?e.a[i]-e.a[a]:e.a[o-1]-e.a[a]+e.a[i]}function D3e(e){var t,n;if(!e.b)for(e.b=kv(P(e.f,27).kh().i),n=new Lu(P(e.f,27).kh());n.e!=n.i.gc();)t=P(gO(n),135),M(e.b,new Di(t));return e.b}function O3e(e){var t,n;if(!e.e)for(e.e=kv(og(P(e.f,27)).i),n=new Lu(og(P(e.f,27)));n.e!=n.i.gc();)t=P(gO(n),123),M(e.e,new ahe(t));return e.e}function k3e(e){var t,n;if(!e.a)for(e.a=kv(Gg(P(e.f,27)).i),n=new Lu(Gg(P(e.f,27)));n.e!=n.i.gc();)t=P(gO(n),27),M(e.a,new sd(e,t));return e.a}function _k(e){var t;if(!e.C&&(e.D!=null||e.B!=null))if(t=qht(e),t)e.hl(t);else try{e.hl(null)}catch(e){if(e=ew(e),!j(e,63))throw E(e)}return e.C}function A3e(e){switch(e.q.g){case 5:h8e(e,(nP(),Z8)),h8e(e,m5);break;case 4:Lmt(e,(nP(),Z8)),Lmt(e,m5);break;default:Het(e,(nP(),Z8)),Het(e,m5)}}function j3e(e){switch(e.q.g){case 5:g8e(e,(nP(),X8)),g8e(e,g5);break;case 4:Rmt(e,(nP(),X8)),Rmt(e,g5);break;default:Uet(e,(nP(),X8)),Uet(e,g5)}}function vk(e,t){var n,i,a=new Fa;for(i=e.Kc();i.Ob();)n=P(i.Pb(),36),kM(n,a.a,0),a.a+=n.f.a+t,a.b=r.Math.max(a.b,n.f.b);return a.b>0&&(a.b+=t),a}function yk(e,t){var n,i,a=new Fa;for(i=e.Kc();i.Ob();)n=P(i.Pb(),36),kM(n,0,a.b),a.b+=n.f.b+t,a.a=r.Math.max(a.a,n.f.a);return a.a>0&&(a.a+=t),a}function M3e(e){var t,n,i=AP;for(n=new w(e.a);n.a>16==6?e.Cb.Th(e,5,J5,t):(r=qO(P(_x((n=P(NC(e,16),29),n||e.ii()),e.Db>>16),19)),e.Cb.Th(e,r.n,r.f,t))}function F3e(e){Xg();var t=e.e;if(t&&t.stack){var n=t.stack,r=t+` `;return n.substring(0,r.length)==r&&(n=n.substring(r.length)),n.split(` @@ -23,5 +23,5 @@ import{i as e,r as t,t as n}from"./app-rolldown-runtime.js";import{n as r}from". `),i.length!=2)throw E(new Fi(`Exactly two numbers are expected, `+i.length+` were found.`));try{this.a=OA(qA(i[0])),this.b=OA(qA(i[1]))}catch(e){throw e=ew(e),j(e,130)?(n=e,E(new Fi(Tbt+n))):E(e)}},Q.Ib=function(){return`(`+this.a+`,`+this.b+`)`},Q.a=0,Q.b=0;var K3=L(MR,`KVector`,8);q(75,67,{3:1,4:1,20:1,31:1,56:1,16:1,67:1,15:1,75:1,423:1},ai,Ma,LEe),Q.Pc=function(){return xQe(this)},Q.cg=function(e){var t,n,r=nN(e,`,|;|\\(|\\)|\\[|\\]|\\{|\\}| | | `),i,a,o;Fg(this);try{for(n=0,a=0,i=0,o=0;n0&&(a%2==0?i=OA(r[n]):o=OA(r[n]),a>0&&a%2!=0&&up(this,new k(i,o)),++a),++n}catch(e){throw e=ew(e),j(e,130)?(t=e,E(new Fi(`The given string does not match the expected format for vectors.`+t))):E(e)}},Q.Ib=function(){for(var e=new Gu(`(`),t=dO(this,0),n;t.b!=t.d.c;)n=P(Lv(t),8),gl(e,n.a+`,`+n.b),t.b!=t.d.c&&(e.a+=`; `);return(e.a+=`)`,e).a};var BRt=L(MR,`KVectorChain`,75);q(255,22,{3:1,34:1,22:1,255:1},Dc);var q3,J3,Y3,X3,Z3,Q3,VRt=aS(AH,`Alignment`,255,eG,lGe,HAe),HRt;q(991,1,nL,Jue),Q.hf=function(e){cdt(e)};var URt,$3,WRt,GRt,KRt,qRt,JRt,YRt,XRt,ZRt,QRt,$Rt;L(AH,`BoxLayouterOptions`,991),q(992,1,{},fse),Q.sf=function(){var e;return e=new hse,e},Q.tf=function(e){},L(AH,`BoxLayouterOptions/BoxFactory`,992),q(298,22,{3:1,34:1,22:1,298:1},Ac);var e6,t6,n6,r6,i6,a6,o6=aS(AH,`ContentAlignment`,298,eG,uGe,UAe),ezt;q(699,1,nL,Yue),Q.hf=function(e){jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,pSt),``),`Layout Algorithm`),`Select a specific layout algorithm.`),(VA(),W3)),LG),sE((uO(),F3))))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,mSt),``),`Resolved Layout Algorithm`),`Meta data associated with the selected algorithm.`),U3),PRt),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,GB),``),`Alignment`),`Alignment of the selected node relative to other nodes; the exact meaning depends on the used algorithm.`),nzt),B3),VRt),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,FL),``),`Aspect Ratio`),`The desired aspect ratio of the drawing, that is the quotient of width by height.`),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,hSt),``),`Bend Points`),`A fixed list of bend points for the edge. This is used by the 'Fixed Layout' algorithm to specify a pre-defined routing for an edge. The vector chain must include the source point, any bend points, and the target point, so it must have at least two points.`),U3),BRt),sE(M3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,rV),``),`Content Alignment`),`Specifies how the content of a node are aligned. Each node can individually control the alignment of its contents. I.e. if a node should be aligned top left in its parent node, the parent node should specify that option.`),szt),V3),o6),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,WB),``),`Debug Mode`),`Whether additional debug information shall be generated.`),(rd(),!1)),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,JB),``),Vyt),`Overall direction of edges: horizontal (right / left) or vertical (down / up).`),czt),B3),a8),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,xB),``),`Edge Routing`),`What kind of edge routing style should be applied for the content of a parent node. Algorithms may also set this option to single edges in order to mark them as splines. The bend point list of edges with this option set to SPLINES must be interpreted as control points for a piecewise cubic spline.`),dzt),B3),p8),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,dSt),``),`Expand Nodes`),`If active, nodes are expanded to fill the area of their parent.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,bB),``),`Hierarchy Handling`),"Determines whether separate layout runs are triggered for different compound nodes in a hierarchical graph. Setting a node's hierarchy handling to `INCLUDE_CHILDREN` will lay out that node and all of its descendants in a single layout run, until a descendant is encountered which has its hierarchy handling set to `SEPARATE_CHILDREN`. In general, `SEPARATE_CHILDREN` will ensure that a new layout run is triggered for a node with that setting. Including multiple levels of hierarchy in a single layout run may allow cross-hierarchical edges to be laid out properly. If the root node is set to `INHERIT` (or not set at all), the default behavior is `SEPARATE_CHILDREN`."),hzt),B3),yBt),Zp(F3,U(O(L3,1),Z,170,0,[P3]))))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,IL),``),`Padding`),`The padding to be left to a parent element's border when placing child elements. This can also serve as an output option of a layout algorithm if node size calculation is setup appropriately.`),Tzt),U3),ZJ),Zp(F3,U(O(L3,1),Z,170,0,[P3]))))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,tR),``),`Interactive`),`Whether the algorithm should be run in interactive mode for the content of a parent node. What this means exactly depends on how the specific algorithm interprets this option. Usually in the interactive mode algorithms try to modify the current layout as little as possible.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,hV),``),`interactive Layout`),`Whether the graph should be changeable interactively and by setting constraints`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,iR),``),`Omit Node Micro Layout`),`Node micro layout comprises the computation of node dimensions (if requested), the placement of ports and their labels, and the placement of node labels. The functionality is implemented independent of any specific layout algorithm and shouldn't have any negative impact on the layout algorithm's performance itself. Yet, if any unforeseen behavior occurs, this option allows to deactivate the micro layout.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,nR),``),`Port Constraints`),`Defines constraints of the position of the ports of a node.`),Nzt),B3),DBt),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,fV),``),`Position`),`The position of a node, port, or label. This is used by the 'Fixed Layout' algorithm to specify a pre-defined position.`),U3),K3),Zp(P3,U(O(L3,1),Z,170,0,[I3,N3]))))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,XL),``),`Priority`),`Defines the priority of an object; its meaning depends on the specific layout algorithm and the context where it is used.`),H3),DG),Zp(P3,U(O(L3,1),Z,170,0,[M3]))))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,$L),``),`Randomization Seed`),`Seed used for pseudo-random number generators to control the layout algorithm. If the value is 0, the seed shall be determined pseudo-randomly (e.g. from the system time).`),H3),DG),sE(F3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,eR),``),`Separate Connected Components`),`Whether each connected component should be processed separately.`),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,iV),``),`Junction Points`),`This option is not used as option, but as output of the layout algorithms. It is attached to edges and determines the points where junction symbols should be drawn in order to represent hyperedges with orthogonal routing. Whether such points are computed depends on the chosen layout algorithm and edge routing style. The points are put into the vector chain with no specific order.`),_zt),U3),BRt),sE(M3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,sV),``),`Comment Box`),`Whether the node should be regarded as a comment box instead of a regular node. In that case its placement should be similar to how labels are handled. Any edges incident to a comment box specify to which graph elements the comment is related.`),!1),R3),bG),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,cV),``),`Hypernode`),`Whether the node should be handled as a hypernode.`),!1),R3),bG),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,gSt),``),`Label Manager`),`Label managers can shorten labels upon a layout algorithm's request.`),U3),uUt),Zp(F3,U(O(L3,1),Z,170,0,[N3]))))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,pV),``),`Margins`),`Margins define additional space around the actual bounds of a graph element. For instance, ports or labels being placed on the outside of a node's border might introduce such a margin. The margin is used to guarantee non-overlap of other graph elements with those ports or labels.`),vzt),U3),HJ),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,HB),``),`No Layout`),`No layout is done for the associated element. This is used to mark parts of a diagram to avoid their inclusion in the layout graph, or to mark parts of the layout graph to prevent layout engines from processing them. If you wish to exclude the contents of a compound node from automatic layout, while the node itself is still considered on its own layer, use the 'Fixed Layout' algorithm for that node.`),!1),R3),bG),Zp(P3,U(O(L3,1),Z,170,0,[M3,I3,N3]))))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,_St),``),`Scale Factor`),`The scaling factor to be applied to the corresponding node in recursive layout. It causes the corresponding node's size to be adjusted, and its ports and labels to be sized and placed accordingly after the layout of that node has been determined (and before the node itself and its siblings are arranged). The scaling is not reverted afterwards, so the resulting layout graph contains the adjusted size and position data. This option is currently not supported if 'Layout Hierarchy' is set.`),1),z3),TG),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,vSt),``),`Child Area Width`),`The width of the area occupied by the laid out children of a node.`),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,ySt),``),`Child Area Height`),`The height of the area occupied by the laid out children of a node.`),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,uR),``),aSt),`Turns topdown layout on and off. If this option is enabled, hierarchical layout will be computed first for the root node and then for its children recursively. Layouts are then scaled down to fit the area provided by their parents. Graphs must follow a certain structure for topdown layout to work properly. {@link TopdownNodeTypes.PARALLEL_NODE} nodes must have children of type {@link TopdownNodeTypes.HIERARCHICAL_NODE} and must define {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} for their children. Furthermore they need to be laid out using an algorithm that is a {@link TopdownLayoutProvider}. Hierarchical nodes can also be parents of other hierarchical nodes and can optionally use a {@link TopdownSizeApproximator} to dynamically set sizes during topdown layout. In this case {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} should be set on the node itself rather than the parent. The values are then used by the size approximator as base values. Hierarchical nodes require the layout option {@link nodeSize.fixedGraphSize} to be true to prevent the algorithm used there from resizing the hierarchical node. This option is not supported if 'Hierarchy Handling' is set to 'INCLUDE_CHILDREN'`),!1),R3),bG),sE(F3)))),wv(e,uR,mR,null),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,bSt),``),`Animate`),`Whether the shift from the old layout to the new computed layout shall be animated.`),!0),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,xSt),``),`Animation Time Factor`),`Factor for computation of animation time. The higher the value, the longer the animation time. If the value is 0, the resulting time is always equal to the minimum defined by 'Minimal Animation Time'.`),G(100)),H3),DG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,SSt),``),`Layout Ancestors`),`Whether the hierarchy levels on the path from the selected element to the root of the diagram shall be included in the layout process.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,CSt),``),`Maximal Animation Time`),`The maximal time for animations, in milliseconds.`),G(4e3)),H3),DG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,wSt),``),`Minimal Animation Time`),`The minimal time for animations, in milliseconds.`),G(400)),H3),DG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,TSt),``),`Progress Bar`),`Whether a progress bar shall be displayed during layout computations.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,ESt),``),`Validate Graph`),`Whether the graph shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,DSt),``),`Validate Options`),`Whether layout options shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user.`),!0),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,OSt),``),`Zoom to Fit`),`Whether the zoom level shall be set to view the whole diagram after layout.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,fSt),`box`),`Box Layout Mode`),`Configures the packing mode used by the {@link BoxLayoutProvider}. If SIMPLE is not required (neither priorities are used nor the interactive mode), GROUP_DEC can improve the packing and decrease the area. GROUP_MIXED and GROUP_INC may, in very specific scenarios, work better.`),azt),B3),JBt),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,AB),SB),`Comment Comment Spacing`),`Spacing to be preserved between a comment box and other comment boxes connected to the same node. The space left between comment boxes of different nodes is controlled by the node-node spacing.`),10),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,jB),SB),`Comment Node Spacing`),`Spacing to be preserved between a node and its connected comment boxes. The space left between a node and the comments of another node is controlled by the node-node spacing.`),10),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,NL),SB),`Components Spacing`),`Spacing to be preserved between pairs of connected components. This option is only relevant if 'separateConnectedComponents' is activated.`),20),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,MB),SB),`Edge Spacing`),`Spacing to be preserved between any two edges. Note that while this can somewhat easily be satisfied for the segments of orthogonally drawn edges, it is harder for general polylines or splines.`),10),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,QL),SB),`Edge Label Spacing`),`The minimal distance to be preserved between a label and the edge it is associated with. Note that the placement of a label is influenced by the 'edgelabels.placement' option.`),2),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,NB),SB),`Edge Node Spacing`),`Spacing to be preserved between nodes and edges.`),10),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,PB),SB),`Label Spacing`),`Determines the amount of space to be left between two labels of the same graph element.`),0),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,LB),SB),`Label Node Spacing`),`Spacing to be preserved between labels and the border of node they are associated with. Note that the placement of a label is influenced by the 'nodelabels.placement' option.`),5),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,FB),SB),`Horizontal spacing between Label and Port`),`Horizontal spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option.`),1),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,IB),SB),`Vertical spacing between Label and Port`),`Vertical spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option.`),1),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,ZL),SB),`Node Spacing`),`The minimal distance to be preserved between each two nodes.`),20),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,RB),SB),`Node Self Loop Spacing`),`Spacing to be preserved between a node and its self loops.`),10),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,zB),SB),`Port Spacing`),`Spacing between pairs of ports of the same node.`),10),z3),TG),Zp(F3,U(O(L3,1),Z,170,0,[P3]))))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,BB),SB),`Individual Spacing`),`Allows to specify individual spacing values for graph elements that shall be different from the value specified for the element's parent.`),U3),XBt),Zp(P3,U(O(L3,1),Z,170,0,[M3,I3,N3]))))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,mV),SB),`Additional Port Space`),`Additional space around the sets of ports on each node side. For each side of a node, this option can reserve additional space before and after the ports on each side. For example, a top spacing of 20 makes sure that the first port on the western and eastern side is 20 units away from the northern border.`),Yzt),U3),HJ),sE(F3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,dV),PSt),`Layout Partition`),`Partition to which the node belongs. This requires Layout Partitioning to be active. Nodes with lower partition IDs will appear to the left of nodes with higher partition IDs (assuming a left-to-right layout direction).`),H3),DG),Zp(F3,U(O(L3,1),Z,170,0,[P3]))))),wv(e,dV,uV,kzt),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,uV),PSt),`Layout Partitioning`),`Whether to activate partitioned layout. This will allow to group nodes through the Layout Partition option. a pair of nodes with different partition indices is then placed such that the node with lower index is placed to the left of the other node (with left-to-right layout direction). Depending on the layout algorithm, this may only be guaranteed to work if all nodes have a layout partition configured, or at least if edges that cross partitions are not part of a partition-crossing cycle.`),Dzt),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,YB),FSt),`Node Label Padding`),`Define padding for node labels that are placed inside of a node.`),bzt),U3),ZJ),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,cR),FSt),`Node Label Placement`),`Hints for where node labels are to be placed; if empty, the node label's position is not modified.`),xzt),V3),M8),Zp(P3,U(O(L3,1),Z,170,0,[N3]))))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,QB),MH),`Port Alignment`),`Defines the default port distribution for a node. May be overridden for each side individually.`),jzt),B3),I8),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,$B),MH),`Port Alignment (North)`),`Defines how ports on the northern side are placed, overriding the node's general port alignment.`),B3),I8),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,eV),MH),`Port Alignment (South)`),`Defines how ports on the southern side are placed, overriding the node's general port alignment.`),B3),I8),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,tV),MH),`Port Alignment (West)`),`Defines how ports on the western side are placed, overriding the node's general port alignment.`),B3),I8),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,nV),MH),`Port Alignment (East)`),`Defines how ports on the eastern side are placed, overriding the node's general port alignment.`),B3),I8),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,sR),NH),`Node Size Constraints`),`What should be taken into account when calculating a node's size. Empty size constraints specify that a node's size is already fixed and should not be changed.`),Szt),V3),S5),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,oR),NH),`Node Size Options`),`Options modifying the behavior of the size constraints set on a node. Each member of the set specifies something that should be taken into account when calculating node sizes. The empty set corresponds to no further modifications.`),wzt),V3),LBt),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,gR),NH),`Node Size Minimum`),`The minimal size to which a node can be reduced.`),Czt),U3),K3),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,aR),NH),`Fixed Graph Size`),`By default, the fixed layout provider will enlarge a graph until it is large enough to contain its children. If this option is set, it won't do so.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,aV),OB),`Edge Label Placement`),`Gives a hint on where to put edge labels.`),lzt),B3),rBt),sE(N3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,rR),OB),`Inline Edge Labels`),`If true, an edge label is placed directly on its edge. May only apply to center edge labels. This kind of label placement is only advisable if the label's rendering is such that it is not crossed by its edge and thus stays legible.`),!1),R3),bG),sE(N3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,kSt),`font`),`Font Name`),`Font name used for a label.`),W3),LG),sE(N3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,ASt),`font`),`Font Size`),`Font size used for a label.`),H3),DG),sE(N3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,lV),PH),`Port Anchor Offset`),`The offset to the port position where connections shall be attached.`),U3),K3),sE(I3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,oV),PH),`Port Index`),`The index of a port in the fixed order around a node. The order is assumed as clockwise, starting with the leftmost port on the top side. This option must be set if 'Port Constraints' is set to FIXED_ORDER and no specific positions are given for the ports. Additionally, the option 'Port Side' must be defined in this case.`),H3),DG),sE(I3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,UB),PH),`Port Side`),`The side of a node on which a port is situated. This option must be set if 'Port Constraints' is set to FIXED_SIDE or FIXED_ORDER and no specific positions are given for the ports.`),Izt),B3),_5),sE(I3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,VB),PH),`Port Border Offset`),`The offset of ports on the node border. With a positive offset the port is moved outside of the node, while with a negative offset the port is moved towards the inside. An offset of 0 means that the port is placed directly on the node border, i.e. if the port side is north, the port's south border touches the nodes's north border; if the port side is east, the port's west border touches the nodes's east border; if the port side is south, the port's north border touches the node's south border; if the port side is west, the port's east border touches the node's west border.`),z3),TG),sE(I3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,lR),ISt),`Port Label Placement`),`Decides on a placement method for port labels; if empty, the node label's position is not modified.`),Pzt),V3),Y8),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,XB),ISt),`Port Labels Next to Port`),`Use 'portLabels.placement': NEXT_TO_PORT_OF_POSSIBLE.`),!1),R3),bG),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,ZB),ISt),`Treat Port Labels as Group`),`If this option is true (default), the labels of a port will be treated as a group when it comes to centering them next to their port. If this option is false, only the first label will be centered next to the port, with the others being placed below. This only applies to labels of eastern and western ports and will have no effect if labels are not placed next to their port.`),!0),R3),bG),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,dR),FH),`Topdown Scale Factor`),`The scaling factor to be applied to the nodes laid out within the node in recursive topdown layout. The difference to 'Scale Factor' is that the node itself is not scaled. This value has to be set on hierarchical nodes.`),1),z3),TG),sE(F3)))),wv(e,dR,mR,$zt),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,jSt),FH),`Topdown Size Approximator`),`The size approximator to be used to set sizes of hierarchical nodes during topdown layout. The default value is null, which results in nodes keeping whatever size is defined for them e.g. through parent parallel node or by manually setting the size.`),null),B3),P5),sE(P3)))),wv(e,jSt,mR,tBt),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,fR),FH),`Topdown Hierarchical Node Width`),`The fixed size of a hierarchical node when using topdown layout. If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself.`),150),z3),TG),Zp(F3,U(O(L3,1),Z,170,0,[P3]))))),wv(e,fR,mR,null),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,pR),FH),`Topdown Hierarchical Node Aspect Ratio`),`The fixed aspect ratio of a hierarchical node when using topdown layout. Default is 1/sqrt(2). If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself.`),1.414),z3),TG),Zp(F3,U(O(L3,1),Z,170,0,[P3]))))),wv(e,pR,mR,null),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,mR),FH),`Topdown Node Type`),`The different node types used for topdown layout. If the node type is set to {@link TopdownNodeTypes.PARALLEL_NODE} the algorithm must be set to a {@link TopdownLayoutProvider} such as {@link TopdownPacking}. The {@link nodeSize.fixedGraphSize} option is technically only required for hierarchical nodes.`),null),B3),BBt),sE(P3)))),wv(e,mR,aR,null),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,MSt),FH),`Topdown Scale Cap`),`Determines the upper limit for the topdown scale factor. The default value is 1.0 which ensures that nested children never end up appearing larger than their parents in terms of unit sizes such as the font size. If the limit is larger, nodes will fully utilize the available space, but it is counteriniuitive for inner nodes to have a larger scale than outer nodes.`),1),z3),TG),sE(F3)))),wv(e,MSt,mR,Qzt),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,KB),LSt),`Activate Inside Self Loops`),`Whether this node allows to route self loops inside of it instead of around it. If set to true, this will make the node a compound node if it isn't already, and will require the layout algorithm to support compound nodes with hierarchical ports.`),!1),R3),bG),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,qB),LSt),`Inside Self Loop`),`Whether a self loop should be routed inside a node instead of around that node.`),!1),R3),bG),sE(M3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,PL),`edge`),`Edge Thickness`),`The thickness of an edge. This is a hint on the line width used to draw an edge, possibly requiring more space to be reserved for it.`),1),z3),TG),sE(M3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,NSt),`edge`),`Edge Type`),`The type of an edge. This is usually used for UML class diagrams, where associations must be handled differently from generalizations.`),pzt),B3),dBt),sE(M3)))),Uo(e,new ev(xa(Ca(Sa(new Qt,fI),`Layered`),`The layer-based method was introduced by Sugiyama, Tagawa and Toda in 1981. It emphasizes the direction of edges by pointing as many edges as possible into the same direction. The nodes are arranged in layers, which are sometimes called "hierarchies", and then reordered such that the number of edge crossings is minimized. Afterwards, concrete coordinates are computed for the nodes and edge bend points.`))),Uo(e,new ev(xa(Ca(Sa(new Qt,`org.eclipse.elk.orthogonal`),`Orthogonal`),`Orthogonal methods that follow the "topology-shape-metrics" approach by Batini, Nardelli and Tamassia '86. The first phase determines the topology of the drawing by applying a planarization technique, which results in a planar representation of the graph. The orthogonal shape is computed in the second phase, which aims at minimizing the number of edge bends, and is called orthogonalization. The third phase leads to concrete coordinates for nodes and edge bend points by applying a compaction method, thus defining the metrics.`))),Uo(e,new ev(xa(Ca(Sa(new Qt,YL),`Force`),`Layout algorithms that follow physical analogies by simulating a system of attractive and repulsive forces. The first successful method of this kind was proposed by Eades in 1984.`))),Uo(e,new ev(xa(Ca(Sa(new Qt,`org.eclipse.elk.circle`),`Circle`),`Circular layout algorithms emphasize cycles or biconnected components of a graph by arranging them in circles. This is useful if a drawing is desired where such components are clearly grouped, or where cycles are shown as prominent OPTIONS of the graph.`))),Uo(e,new ev(xa(Ca(Sa(new Qt,dxt),`Tree`),`Specialized layout methods for trees, i.e. acyclic graphs. The regular structure of graphs that have no undirected cycles can be emphasized using an algorithm of this type.`))),Uo(e,new ev(xa(Ca(Sa(new Qt,`org.eclipse.elk.planar`),`Planar`),`Algorithms that require a planar or upward planar graph. Most of these algorithms are theoretically interesting, but not practically usable.`))),Uo(e,new ev(xa(Ca(Sa(new Qt,iH),`Radial`),`Radial layout algorithms usually position the nodes of the graph on concentric circles.`))),Klt((new Xue,e)),cdt((new Jue,e)),bct((new Zue,e))};var s6,tzt,nzt,c6,rzt,izt,azt,l6,u6,ozt,d6,szt,f6,p6,czt,m6,h6,lzt,uzt,dzt,fzt,pzt,mzt,g6,hzt,gzt,_6,v6,y6,b6,x6,_zt,S6,vzt,yzt,bzt,C6,xzt,w6,Szt,T6,E6,Czt,D6,wzt,O6,k6,A6,Tzt,Ezt,Dzt,Ozt,kzt,Azt,jzt,j6,M6,N6,P6,Mzt,F6,I6,Nzt,L6,R6,z6,Pzt,Fzt,B6,Izt,V6,H6,U6,W6,Lzt,G6,Rzt,zzt,Bzt,Vzt,Hzt,Uzt,K6,Wzt,q6,Gzt,Kzt,J6,qzt,Jzt,Yzt,Xzt,Y6,X6,Z6,Q6,Zzt,Qzt,$6,$zt,eBt,tBt;L(AH,`CoreOptions`,699),q(88,22,{3:1,34:1,22:1,88:1},jc);var e8,t8,n8,r8,i8,a8=aS(AH,Vyt,88,eG,KHe,WAe),nBt;q(278,22,{3:1,34:1,22:1,278:1},Mc);var o8,s8,c8,rBt=aS(AH,`EdgeLabelPlacement`,278,eG,Eze,GAe),iBt;q(223,22,{3:1,34:1,22:1,223:1},Nc);var l8,u8,d8,f8,p8=aS(AH,`EdgeRouting`,223,eG,MVe,KAe),aBt;q(321,22,{3:1,34:1,22:1,321:1},Pc);var oBt,sBt,cBt,lBt,m8,uBt,dBt=aS(AH,`EdgeType`,321,eG,cGe,qAe),fBt;q(989,1,nL,Xue),Q.hf=function(e){Klt(e)};var pBt,mBt,hBt,gBt,_Bt,vBt,h8;L(AH,`FixedLayouterOptions`,989),q(990,1,{},pse),Q.sf=function(){var e;return e=new wse,e},Q.tf=function(e){},L(AH,`FixedLayouterOptions/FixedFactory`,990),q(346,22,{3:1,34:1,22:1,346:1},Fc);var g8,_8,v8,yBt=aS(AH,`HierarchyHandling`,346,eG,wze,JAe),bBt;q(291,22,{3:1,34:1,22:1,291:1},Ic);var y8,b8,x8,S8,xBt=aS(AH,`LabelSide`,291,eG,jVe,YAe),SBt;q(95,22,{3:1,34:1,22:1,95:1},Lc);var C8,w8,T8,E8,D8,O8,k8,A8,j8,M8=aS(AH,`NodeLabelPlacement`,95,eG,Lqe,XAe),CBt;q(256,22,{3:1,34:1,22:1,256:1},Rc);var wBt,N8,P8,TBt,F8,I8=aS(AH,`PortAlignment`,256,eG,pUe,ZAe),EBt;q(101,22,{3:1,34:1,22:1,101:1},zc);var L8,R8,z8,B8,V8,H8,DBt=aS(AH,`PortConstraints`,101,eG,sGe,QAe),OBt;q(279,22,{3:1,34:1,22:1,279:1},Bc);var U8,W8,G8,K8,q8,J8,Y8=aS(AH,`PortLabelPlacement`,279,eG,oGe,$Ae),kBt;q(64,22,{3:1,34:1,22:1,64:1},Vc);var X8,Z8,Q8,$8,e5,t5,n5,r5,i5,a5,o5,s5,c5,l5,u5,d5,f5,p5,m5,h5,g5,_5=aS(AH,`PortSide`,64,eG,qHe,eje),ABt;q(993,1,nL,Zue),Q.hf=function(e){bct(e)};var jBt,MBt,NBt,PBt,FBt;L(AH,`RandomLayouterOptions`,993),q(994,1,{},mse),Q.sf=function(){var e;return e=new xse,e},Q.tf=function(e){},L(AH,`RandomLayouterOptions/RandomFactory`,994),q(386,22,{3:1,34:1,22:1,386:1},Hc);var v5,y5,b5,x5,S5=aS(AH,`SizeConstraint`,386,eG,AVe,tje),IBt;q(264,22,{3:1,34:1,22:1,264:1},Uc);var C5,w5,T5,E5,D5,O5,k5,A5,j5,LBt=aS(AH,`SizeOptions`,264,eG,fJe,nje),RBt;q(280,22,{3:1,34:1,22:1,280:1},Wc);var M5,zBt,N5,BBt=aS(AH,`TopdownNodeTypes`,280,eG,Dze,rje),VBt;q(347,22,RSt);var HBt,UBt,P5=aS(AH,`TopdownSizeApproximator`,347,eG,kLe,aje);q(987,347,RSt,AMe),Q.Tg=function(e){return T4e(e)},aS(AH,`TopdownSizeApproximator/1`,987,P5,null,null),q(988,347,RSt,cPe),Q.Tg=function(e){var t=P(J(e,(vP(),W6)),143),n,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,ee=(Ia(),m=new ii,m),te,ne,C;for(qj(ee,e),te=new Dr,o=new Lu((!e.a&&(e.a=new F($5,e,10,11)),e.a));o.e!=o.i.gc();)i=P(gO(o),27),y=(p=new ii,p),Gj(y,ee),qj(y,i),C=T4e(i),Ql(y,r.Math.max(i.g,C.a),r.Math.max(i.f,C.b)),XA(te.f,i,y);for(a=new Lu((!e.a&&(e.a=new F($5,e,10,11)),e.a));a.e!=a.i.gc();)for(i=P(gO(a),27),d=new Lu((!i.e&&(i.e=new cf(U5,i,7,4)),i.e));d.e!=d.i.gc();)u=P(gO(d),74),x=P(nl(Kp(te.f,i)),27),S=P(xh(te,H((!u.c&&(u.c=new cf(H5,u,5,8)),u.c),0)),27),b=(f=new nn,f),tb((!b.b&&(b.b=new cf(H5,b,4,7)),b.b),x),tb((!b.c&&(b.c=new cf(H5,b,5,8)),b.c),S),Hj(b,I_(x)),qj(b,u);g=P(h_(t.f),205);try{g.rf(ee,new Dse),bFe(t.f,g)}catch(e){throw e=ew(e),j(e,103)?(h=e,E(h)):E(e)}return qy(ee,u6)||qy(ee,l6)||G_t(ee),l=D(N(J(ee,u6))),c=D(N(J(ee,l6))),s=l/c,n=D(N(J(ee,X6)))*r.Math.sqrt((!ee.a&&(ee.a=new F($5,ee,10,11)),ee.a).i),ne=P(J(ee,A6),107),v=ne.b+ne.c+1,_=ne.d+ne.a+1,new k(r.Math.max(v,n),r.Math.max(_,n/s))},aS(AH,`TopdownSizeApproximator/2`,988,P5,null,null);var WBt;q(344,1,{871:1},di),Q.Ug=function(e,t){return p7e(this,e,t)},Q.Vg=function(){Q9e(this)},Q.Wg=function(){return this.q},Q.Xg=function(){return this.f?Zg(this.f):null},Q.Yg=function(){return Zg(this.a)},Q.Zg=function(){return this.p},Q.$g=function(){return!1},Q._g=function(){return this.n},Q.ah=function(){return this.p!=null&&!this.b},Q.bh=function(e){var t;this.n&&(t=e,M(this.f,t))},Q.dh=function(e,t){var n,r;this.n&&e&&Xze(this,(n=new GPe,r=WM(n,e),Yht(n),r),(Mw(),I5))},Q.eh=function(e){var t;return this.b?null:(t=XKe(this,this.g),up(this.a,t),t.i=this,this.d=e,t)},Q.fh=function(e){e>0&&!this.b&&kJe(this,e)},Q.b=!1,Q.c=0,Q.d=-1,Q.e=null,Q.f=null,Q.g=-1,Q.j=!1,Q.k=!1,Q.n=!1,Q.o=0,Q.q=0,Q.r=0,L(gV,`BasicProgressMonitor`,344),q(717,205,OL,hse),Q.rf=function(e,t){Xdt(e,t)},L(gV,`BoxLayoutProvider`,717),q(983,1,GI,ehe),Q.Ne=function(e,t){return mot(this,P(e,27),P(t,27))},Q.Fb=function(e){return this===e},Q.Oe=function(){return new Yn(this)},Q.a=!1,L(gV,`BoxLayoutProvider/1`,983),q(163,1,{163:1},Fx,qEe),Q.Ib=function(){return this.c?Elt(this.c):CA(this.b)},L(gV,`BoxLayoutProvider/Group`,163),q(320,22,{3:1,34:1,22:1,320:1},Gc);var GBt,KBt,qBt,F5,JBt=aS(gV,`BoxLayoutProvider/PackingMode`,320,eG,NVe,oje),YBt;q(984,1,GI,gse),Q.Ne=function(e,t){return PIe(P(e,163),P(t,163))},Q.Fb=function(e){return this===e},Q.Oe=function(){return new Yn(this)},L(gV,`BoxLayoutProvider/lambda$0$Type`,984),q(985,1,GI,_se),Q.Ne=function(e,t){return SIe(P(e,163),P(t,163))},Q.Fb=function(e){return this===e},Q.Oe=function(){return new Yn(this)},L(gV,`BoxLayoutProvider/lambda$1$Type`,985),q(986,1,GI,vse),Q.Ne=function(e,t){return CIe(P(e,163),P(t,163))},Q.Fb=function(e){return this===e},Q.Oe=function(){return new Yn(this)},L(gV,`BoxLayoutProvider/lambda$2$Type`,986),q(1384,1,{845:1},yse),Q.Mg=function(e,t){return zo(),!j(t,167)||Cye((lw(),P(e,167)),t)},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$0$Type`,1384),q(1385,1,$P,the),Q.Cd=function(e){EQe(this.a,P(e,149))},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$1$Type`,1385),q(1386,1,$P,Sse),Q.Cd=function(e){P(e,96),zo()},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$2$Type`,1386),q(1390,1,$P,nhe),Q.Cd=function(e){sYe(this.a,P(e,96))},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$3$Type`,1390),q(1388,1,vF,ySe),Q.Mb=function(e){return WZe(this.a,this.b,P(e,149))},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$4$Type`,1388),q(1387,1,vF,bSe),Q.Mb=function(e){return wEe(this.a,this.b,P(e,845))},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$5$Type`,1387),q(1389,1,$P,xSe),Q.Cd=function(e){nPe(this.a,this.b,P(e,149))},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$6$Type`,1389),q(947,1,{},Cse),Q.Kb=function(e){return LCe(e)},Q.Fb=function(e){return this===e},L(gV,`ElkUtil/lambda$0$Type`,947),q(948,1,$P,SSe),Q.Cd=function(e){Gnt(this.a,this.b,P(e,74))},Q.a=0,Q.b=0,L(gV,`ElkUtil/lambda$1$Type`,948),q(949,1,$P,CSe),Q.Cd=function(e){X_e(this.a,this.b,P(e,166))},Q.a=0,Q.b=0,L(gV,`ElkUtil/lambda$2$Type`,949),q(950,1,$P,wSe),Q.Cd=function(e){rwe(this.a,this.b,P(e,135))},Q.a=0,Q.b=0,L(gV,`ElkUtil/lambda$3$Type`,950),q(951,1,$P,rhe),Q.Cd=function(e){jMe(this.a,P(e,377))},L(gV,`ElkUtil/lambda$4$Type`,951),q(325,1,{34:1,325:1},Er),Q.Fd=function(e){return aTe(this,P(e,242))},Q.Fb=function(e){var t;return j(e,325)?(t=P(e,325),this.a==t.a):!1},Q.Hb=function(){return C_(this.a)},Q.Ib=function(){return this.a+` (exclusive)`},Q.a=0,L(gV,`ExclusiveBounds/ExclusiveLowerBound`,325),q(1119,205,OL,wse),Q.rf=function(e,t){var n,i,a,o,s,c,l,u,f,p,m,h,g,_,v,y,b,x,S,ee,te,ne,C;for(t.Ug(`Fixed Layout`,1),o=P(J(e,(vP(),uzt)),223),p=0,m=0,b=new Lu((!e.a&&(e.a=new F($5,e,10,11)),e.a));b.e!=b.i.gc();){for(v=P(gO(b),27),C=P(J(v,(Iw(),h8)),8),C&&($l(v,C.a,C.b),P(J(v,mBt),181).Hc((TD(),v5))&&(h=P(J(v,gBt),8),h.a>0&&h.b>0&&iP(v,h.a,h.b,!0,!0))),p=r.Math.max(p,v.i+v.g),m=r.Math.max(m,v.j+v.f),u=new Lu((!v.n&&(v.n=new F(Q5,v,1,7)),v.n));u.e!=u.i.gc();)c=P(gO(u),135),C=P(J(c,h8),8),C&&$l(c,C.a,C.b),p=r.Math.max(p,v.i+c.i+c.g),m=r.Math.max(m,v.j+c.j+c.f);for(ee=new Lu((!v.c&&(v.c=new F(e7,v,9,9)),v.c));ee.e!=ee.i.gc();)for(S=P(gO(ee),123),C=P(J(S,h8),8),C&&$l(S,C.a,C.b),te=v.i+S.i,ne=v.j+S.j,p=r.Math.max(p,te+S.g),m=r.Math.max(m,ne+S.f),l=new Lu((!S.n&&(S.n=new F(Q5,S,1,7)),S.n));l.e!=l.i.gc();)c=P(gO(l),135),C=P(J(c,h8),8),C&&$l(c,C.a,C.b),p=r.Math.max(p,te+c.i+c.g),m=r.Math.max(m,ne+c.j+c.f);for(a=new pm(Vu(Ij(v).a.Kc(),new d));Cj(a);)n=P(by(a),74),f=r_t(n),p=r.Math.max(p,f.a),m=r.Math.max(m,f.b);for(i=new pm(Vu(Fj(v).a.Kc(),new d));Cj(i);)n=P(by(i),74),I_(xA(n))!=e&&(f=r_t(n),p=r.Math.max(p,f.a),m=r.Math.max(m,f.b))}if(o==(wE(),l8))for(y=new Lu((!e.a&&(e.a=new F($5,e,10,11)),e.a));y.e!=y.i.gc();)for(v=P(gO(y),27),i=new pm(Vu(Ij(v).a.Kc(),new d));Cj(i);)n=P(by(i),74),s=Sdt(n),s.b==0?OO(n,x6,null):OO(n,x6,s);ki(Od(J(e,(Iw(),hBt))))||(x=P(J(e,_Bt),107),_=p+x.b+x.c,g=m+x.d+x.a,iP(e,_,g,!0,!0)),t.Vg()},L(gV,`FixedLayoutProvider`,1119),q(385,137,{3:1,423:1,385:1,96:1,137:1},en,uKe),Q.cg=function(e){var t,n,r,i,a,o,s,c,l;if(e)try{for(c=nN(e,`;,;`),a=c,o=0,s=a.length;o>16&OF|t^r<<16},Q.Kc=function(){return new ihe(this)},Q.Ib=function(){return this.a==null&&this.b==null?`pair(null,null)`:this.a==null?`pair(null,`+PE(this.b)+`)`:this.b==null?`pair(`+PE(this.a)+`,null)`:`pair(`+PE(this.a)+`,`+PE(this.b)+`)`},L(gV,`Pair`,42),q(995,1,VP,ihe),Q.Nb=function(e){Om(this,e)},Q.Ob=function(){return!this.c&&(!this.b&&this.a.a!=null||this.a.b!=null)},Q.Pb=function(){if(!this.c&&!this.b&&this.a.a!=null)return this.b=!0,this.a.a;if(!this.c&&this.a.b!=null)return this.c=!0,this.a.b;throw E(new Hr)},Q.Qb=function(){throw this.c&&this.a.b!=null?this.a.b=null:this.b&&this.a.a!=null&&(this.a.a=null),E(new Rr)},Q.b=!1,Q.c=!1,L(gV,`Pair/1`,995),q(455,1,{455:1},cIe),Q.Fb=function(e){return rg(this.a,P(e,455).a)&&rg(this.c,P(e,455).c)&&rg(this.d,P(e,455).d)&&rg(this.b,P(e,455).b)},Q.Hb=function(){return tT(U(O(WW,1),FP,1,5,[this.a,this.c,this.d,this.b]))},Q.Ib=function(){return`(`+this.a+PP+this.c+PP+this.d+PP+this.b+`)`},L(gV,`Quadruple`,455),q(1108,205,OL,xse),Q.rf=function(e,t){var n,r,i,a,o;if(t.Ug(`Random Layout`,1),(!e.a&&(e.a=new F($5,e,10,11)),e.a).i==0){t.Vg();return}a=P(J(e,(wD(),PBt)),17),i=a&&a.a!=0?new sy(a.a):new YE,n=Ai(N(J(e,jBt))),o=Ai(N(J(e,FBt))),r=P(J(e,MBt),107),wgt(e,i,n,o,r),t.Vg()},L(gV,`RandomLayoutProvider`,1108),q(240,1,{240:1},Vf),Q.Fb=function(e){return rg(this.a,P(e,240).a)&&rg(this.b,P(e,240).b)&&rg(this.c,P(e,240).c)},Q.Hb=function(){return tT(U(O(WW,1),FP,1,5,[this.a,this.b,this.c]))},Q.Ib=function(){return`(`+this.a+PP+this.b+PP+this.c+`)`},L(gV,`Triple`,240);var nVt;q(562,1,{}),Q.Lf=function(){return new k(this.f.i,this.f.j)},Q.of=function(e){return nLe(e,(vP(),F6))?J(this.f,rVt):J(this.f,e)},Q.Mf=function(){return new k(this.f.g,this.f.f)},Q.Nf=function(){return this.g},Q.pf=function(e){return qy(this.f,e)},Q.Of=function(e){Gx(this.f,e.a),Kx(this.f,e.b)},Q.Pf=function(e){Wx(this.f,e.a),Ux(this.f,e.b)},Q.Qf=function(e){this.g=e},Q.g=0;var rVt;L(RH,`ElkGraphAdapters/AbstractElkGraphElementAdapter`,562),q(563,1,{853:1},_r),Q.Rf=function(){var e,t;if(!this.b)for(this.b=kv(ag(this.a).i),t=new Lu(ag(this.a));t.e!=t.i.gc();)e=P(gO(t),135),M(this.b,new Di(e));return this.b},Q.b=null,L(RH,`ElkGraphAdapters/ElkEdgeAdapter`,563),q(289,562,{},Ei),Q.Sf=function(){return k3e(this)},Q.a=null,L(RH,`ElkGraphAdapters/ElkGraphAdapter`,289),q(640,562,{187:1},Di),L(RH,`ElkGraphAdapters/ElkLabelAdapter`,640),q(639,562,{695:1},sd),Q.Rf=function(){return D3e(this)},Q.Vf=function(){var e;return e=P(J(this.f,(vP(),S6)),140),!e&&(e=new ei),e},Q.Xf=function(){return O3e(this)},Q.Zf=function(e){var t=new Kf(e);OO(this.f,(vP(),S6),t)},Q.$f=function(e){OO(this.f,(vP(),A6),new bje(e))},Q.Tf=function(){return this.d},Q.Uf=function(){var e,t;if(!this.a)for(this.a=new T,t=new pm(Vu(Fj(P(this.f,27)).a.Kc(),new d));Cj(t);)e=P(by(t),74),M(this.a,new _r(e));return this.a},Q.Wf=function(){var e,t;if(!this.c)for(this.c=new T,t=new pm(Vu(Ij(P(this.f,27)).a.Kc(),new d));Cj(t);)e=P(by(t),74),M(this.c,new _r(e));return this.c},Q.Yf=function(){return Gg(P(this.f,27)).i!=0||ki(Od(P(this.f,27).of((vP(),_6))))},Q._f=function(){dKe(this,(Ko(),nVt))},Q.a=null,Q.b=null,Q.c=null,Q.d=null,Q.e=null,L(RH,`ElkGraphAdapters/ElkNodeAdapter`,639),q(1284,562,{852:1},ahe),Q.Rf=function(){return H3e(this)},Q.Uf=function(){var e,t;if(!this.a)for(this.a=dd(P(this.f,123).hh().i),t=new Lu(P(this.f,123).hh());t.e!=t.i.gc();)e=P(gO(t),74),M(this.a,new _r(e));return this.a},Q.Wf=function(){var e,t;if(!this.c)for(this.c=dd(P(this.f,123).ih().i),t=new Lu(P(this.f,123).ih());t.e!=t.i.gc();)e=P(gO(t),74),M(this.c,new _r(e));return this.c},Q.ag=function(){return P(P(this.f,123).of((vP(),B6)),64)},Q.bg=function(){var e,t,n,r=E_(P(this.f,123)),i,a,o,s;for(n=new Lu(P(this.f,123).ih());n.e!=n.i.gc();)for(e=P(gO(n),74),s=new Lu((!e.c&&(e.c=new cf(H5,e,5,8)),e.c));s.e!=s.i.gc();)if(o=P(gO(s),84),Ex(cA(o),r)||cA(o)==r&&ki(Od(J(e,(vP(),v6)))))return!0;for(t=new Lu(P(this.f,123).hh());t.e!=t.i.gc();)for(e=P(gO(t),74),a=new Lu((!e.b&&(e.b=new cf(H5,e,4,7)),e.b));a.e!=a.i.gc();)if(i=P(gO(a),84),Ex(cA(i),r))return!0;return!1},Q.a=null,Q.b=null,Q.c=null,L(RH,`ElkGraphAdapters/ElkPortAdapter`,1284),q(1285,1,GI,bse),Q.Ne=function(e,t){return Tlt(P(e,123),P(t,123))},Q.Fb=function(e){return this===e},Q.Oe=function(){return new Yn(this)},L(RH,`ElkGraphAdapters/PortComparator`,1285);var L5=gp(zH,`EObject`),R5=gp(BH,VSt),z5=gp(BH,HSt),B5=gp(BH,USt),V5=gp(BH,`ElkShape`),H5=gp(BH,WSt),U5=gp(BH,GSt),W5=gp(BH,KSt),G5=gp(zH,qSt),K5=gp(zH,`EFactory`),iVt,q5=gp(zH,JSt),J5=gp(zH,`EPackage`),Y5,aVt,oVt,sVt,X5,cVt,lVt,uVt,dVt,Z5,fVt,pVt,Q5=gp(BH,YSt),$5=gp(BH,XSt),e7=gp(BH,ZSt);q(93,1,QSt),Q.th=function(){return this.uh(),null},Q.uh=function(){return null},Q.vh=function(){return this.uh(),!1},Q.wh=function(){return!1},Q.xh=function(e){AC(this,e)},L(VH,`BasicNotifierImpl`,93),q(99,93,nCt),Q.Yh=function(){return Gl(this)},Q.yh=function(e,t){return e},Q.zh=function(){throw E(new Br)},Q.Ah=function(e){var t;return t=qO(P(_x(this.Dh(),this.Fh()),19)),this.Ph().Th(this,t.n,t.f,e)},Q.Bh=function(e,t){throw E(new Br)},Q.Ch=function(e,t,n){return qM(this,e,t,n)},Q.Dh=function(){var e;return this.zh()&&(e=this.zh().Nk(),e)?e:this.ii()},Q.Eh=function(){return xj(this)},Q.Fh=function(){throw E(new Br)},Q.Gh=function(){var e,t=this.$h().Ok();return!t&&this.zh().Tk(t=(Yo(),e=MLe(aN(this.Dh())),e==null?i9:new ad(this,e))),t},Q.Hh=function(e,t){return e},Q.Ih=function(e){return e.pk()?e.Lj():eD(this.Dh(),e)},Q.Jh=function(){var e=this.zh();return e?e.Qk():null},Q.Kh=function(){return this.zh()?this.zh().Nk():null},Q.Lh=function(e,t,n){return jO(this,e,t,n)},Q.Mh=function(e){return mb(this,e)},Q.Nh=function(e,t){return wy(this,e,t)},Q.Oh=function(){var e=this.zh();return!!e&&e.Rk()},Q.Ph=function(){throw E(new Br)},Q.Qh=function(){return KD(this)},Q.Rh=function(e,t,n,r){return EO(this,e,t,r)},Q.Sh=function(e,t,n){var r;return r=P(_x(this.Dh(),t),69),r.wk().zk(this,this.hi(),t-this.ji(),e,n)},Q.Th=function(e,t,n,r){return m_(this,e,t,r)},Q.Uh=function(e,t,n){var r;return r=P(_x(this.Dh(),t),69),r.wk().Ak(this,this.hi(),t-this.ji(),e,n)},Q.Vh=function(){return!!this.zh()&&!!this.zh().Pk()},Q.Wh=function(e){return mO(this,e)},Q.Xh=function(e){return iRe(this,e)},Q.Zh=function(e){return Iht(this,e)},Q.$h=function(){throw E(new Br)},Q._h=function(){return this.zh()?this.zh().Pk():null},Q.ai=function(){return KD(this)},Q.bi=function(e,t){QA(this,e,t)},Q.ci=function(e){this.$h().Sk(e)},Q.di=function(e){this.$h().Vk(e)},Q.ei=function(e){this.$h().Uk(e)},Q.fi=function(e,t){var n,r,i,a=this.Jh();return a&&e&&(t=AO(a.El(),this,t),a.Il(this)),r=this.Ph(),r&&((IM(this,this.Ph(),this.Fh()).Bb&pI)==0?(t=(n=this.Fh(),n>=0?this.Ah(t):this.Ph().Th(this,-1-n,null,t)),t=this.Ch(null,-1,t)):(i=r.Qh(),i&&(e?!a&&i.Il(this):i.Hl(this)))),this.di(e),t},Q.gi=function(e){var t,n=this.Dh(),r,i,a=eD(n,e),o,s,c;if(t=this.ji(),a>=t)return P(e,69).wk().Dk(this,this.hi(),a-t);if(a<=-1)if(o=HN((UA(),l9),n,e),o){if(Qo(),P(o,69).xk()||(o=mv(Rb(l9,o))),i=(r=this.Ih(o),P(r>=0?this.Lh(r,!0,!0):mj(this,o,!0),160)),c=o.Ik(),c>1||c==-1)return P(P(i,220).Sl(e,!1),79)}else throw E(new Fi(HH+e.xe()+WH));else if(e.Jk())return r=this.Ih(e),P(r>=0?this.Lh(r,!1,!0):mj(this,e,!1),79);return s=new JSe(this,e),s},Q.hi=function(){return Jb(this)},Q.ii=function(){return(vh(),z7).S},Q.ji=function(){return bh(this.ii())},Q.ki=function(e){BA(this,e)},Q.Ib=function(){return Aj(this)},L(KH,`BasicEObjectImpl`,99);var mVt;q(119,99,{110:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1}),Q.li=function(e){return qb(this)[e]},Q.mi=function(e,t){Sh(qb(this),e,t)},Q.ni=function(e){Sh(qb(this),e,null)},Q.th=function(){return P(NC(this,4),129)},Q.uh=function(){throw E(new Br)},Q.vh=function(){return!!(this.Db&4)},Q.zh=function(){throw E(new Br)},Q.oi=function(e){GD(this,2,e)},Q.Bh=function(e,t){this.Db=t<<16|this.Db&255,this.oi(e)},Q.Dh=function(){return d_(this)},Q.Fh=function(){return this.Db>>16},Q.Gh=function(){var e,t;return Yo(),t=MLe(aN((e=P(NC(this,16),29),e||this.ii()))),t==null?i9:new ad(this,t)},Q.wh=function(){return!(this.Db&1)},Q.Jh=function(){return P(NC(this,128),2034)},Q.Kh=function(){return P(NC(this,16),29)},Q.Oh=function(){return!!(this.Db&32)},Q.Ph=function(){return P(NC(this,2),54)},Q.Vh=function(){return!!(this.Db&64)},Q.$h=function(){throw E(new Br)},Q._h=function(){return P(NC(this,64),288)},Q.ci=function(e){GD(this,16,e)},Q.di=function(e){GD(this,128,e)},Q.ei=function(e){GD(this,64,e)},Q.hi=function(){return WD(this)},Q.Db=0,L(KH,`MinimalEObjectImpl`,119),q(120,119,{110:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1}),Q.oi=function(e){this.Cb=e},Q.Ph=function(){return this.Cb},L(KH,`MinimalEObjectImpl/Container`,120),q(2083,120,{110:1,342:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1}),Q.Lh=function(e,t,n){return W3e(this,e,t,n)},Q.Uh=function(e,t,n){return x9e(this,e,t,n)},Q.Wh=function(e){return yBe(this,e)},Q.bi=function(e,t){qZe(this,e,t)},Q.ii=function(){return lP(),pVt},Q.ki=function(e){sZe(this,e)},Q.nf=function(){return H2e(this)},Q.gh=function(){return!this.o&&(this.o=new lb((lP(),Z5),n7,this,0)),this.o},Q.of=function(e){return J(this,e)},Q.pf=function(e){return qy(this,e)},Q.qf=function(e,t){return OO(this,e,t)},L(qH,`EMapPropertyHolderImpl`,2083),q(572,120,{110:1,377:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1},tn),Q.Lh=function(e,t,n){switch(e){case 0:return this.a;case 1:return this.b}return jO(this,e,t,n)},Q.Wh=function(e){switch(e){case 0:return this.a!=0;case 1:return this.b!=0}return mO(this,e)},Q.bi=function(e,t){switch(e){case 0:Xx(this,D(N(t)));return;case 1:Vx(this,D(N(t)));return}QA(this,e,t)},Q.ii=function(){return lP(),aVt},Q.ki=function(e){switch(e){case 0:Xx(this,0);return;case 1:Vx(this,0);return}BA(this,e)},Q.Ib=function(){var e;return this.Db&64?Aj(this):(e=new Wu(Aj(this)),e.a+=` (x: `,Ua(e,this.a),e.a+=`, y: `,Ua(e,this.b),e.a+=`)`,e.a)},Q.a=0,Q.b=0,L(qH,`ElkBendPointImpl`,572),q(739,2083,{110:1,342:1,167:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1}),Q.Lh=function(e,t,n){return ZT(this,e,t,n)},Q.Sh=function(e,t,n){return uA(this,e,t,n)},Q.Uh=function(e,t,n){return XC(this,e,t,n)},Q.Wh=function(e){return pXe(this,e)},Q.bi=function(e,t){V8e(this,e,t)},Q.ii=function(){return lP(),cVt},Q.ki=function(e){vT(this,e)},Q.jh=function(){return this.k},Q.kh=function(){return ag(this)},Q.Ib=function(){return pE(this)},Q.k=null,L(qH,`ElkGraphElementImpl`,739),q(740,739,{110:1,342:1,167:1,422:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1}),Q.Lh=function(e,t,n){return FE(this,e,t,n)},Q.Wh=function(e){return JE(this,e)},Q.bi=function(e,t){H8e(this,e,t)},Q.ii=function(){return lP(),fVt},Q.ki=function(e){dD(this,e)},Q.lh=function(){return this.f},Q.mh=function(){return this.g},Q.nh=function(){return this.i},Q.oh=function(){return this.j},Q.ph=function(e,t){Ql(this,e,t)},Q.qh=function(e,t){$l(this,e,t)},Q.rh=function(e){Gx(this,e)},Q.sh=function(e){Kx(this,e)},Q.Ib=function(){return AA(this)},Q.f=0,Q.g=0,Q.i=0,Q.j=0,L(qH,`ElkShapeImpl`,740),q(741,740,{110:1,342:1,84:1,167:1,422:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1}),Q.Lh=function(e,t,n){return tk(this,e,t,n)},Q.Sh=function(e,t,n){return b8e(this,e,t,n)},Q.Uh=function(e,t,n){return x8e(this,e,t,n)},Q.Wh=function(e){return BZe(this,e)},Q.bi=function(e,t){cit(this,e,t)},Q.ii=function(){return lP(),oVt},Q.ki=function(e){DO(this,e)},Q.hh=function(){return!this.d&&(this.d=new cf(U5,this,8,5)),this.d},Q.ih=function(){return!this.e&&(this.e=new cf(U5,this,7,4)),this.e},L(qH,`ElkConnectableShapeImpl`,741),q(326,739,{110:1,342:1,74:1,167:1,326:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1},nn),Q.Ah=function(e){return P6e(this,e)},Q.Lh=function(e,t,n){switch(e){case 3:return T_(this);case 4:return!this.b&&(this.b=new cf(H5,this,4,7)),this.b;case 5:return!this.c&&(this.c=new cf(H5,this,5,8)),this.c;case 6:return!this.a&&(this.a=new F(W5,this,6,6)),this.a;case 7:return rd(),!this.b&&(this.b=new cf(H5,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new cf(H5,this,5,8)),this.c.i<=1));case 8:return rd(),!!yj(this);case 9:return rd(),!!uj(this);case 10:return rd(),!this.b&&(this.b=new cf(H5,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new cf(H5,this,5,8)),this.c.i!=0)}return ZT(this,e,t,n)},Q.Sh=function(e,t,n){var r;switch(t){case 3:return this.Cb&&(n=(r=this.Db>>16,r>=0?P6e(this,n):this.Cb.Th(this,-1-r,null,n))),Bd(this,P(e,27),n);case 4:return!this.b&&(this.b=new cf(H5,this,4,7)),vD(this.b,e,n);case 5:return!this.c&&(this.c=new cf(H5,this,5,8)),vD(this.c,e,n);case 6:return!this.a&&(this.a=new F(W5,this,6,6)),vD(this.a,e,n)}return uA(this,e,t,n)},Q.Uh=function(e,t,n){switch(t){case 3:return Bd(this,null,n);case 4:return!this.b&&(this.b=new cf(H5,this,4,7)),AO(this.b,e,n);case 5:return!this.c&&(this.c=new cf(H5,this,5,8)),AO(this.c,e,n);case 6:return!this.a&&(this.a=new F(W5,this,6,6)),AO(this.a,e,n)}return XC(this,e,t,n)},Q.Wh=function(e){switch(e){case 3:return!!T_(this);case 4:return!!this.b&&this.b.i!=0;case 5:return!!this.c&&this.c.i!=0;case 6:return!!this.a&&this.a.i!=0;case 7:return!this.b&&(this.b=new cf(H5,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new cf(H5,this,5,8)),this.c.i<=1));case 8:return yj(this);case 9:return uj(this);case 10:return!this.b&&(this.b=new cf(H5,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new cf(H5,this,5,8)),this.c.i!=0)}return pXe(this,e)},Q.bi=function(e,t){switch(e){case 3:Hj(this,P(t,27));return;case 4:!this.b&&(this.b=new cf(H5,this,4,7)),RN(this.b),!this.b&&(this.b=new cf(H5,this,4,7)),th(this.b,P(t,16));return;case 5:!this.c&&(this.c=new cf(H5,this,5,8)),RN(this.c),!this.c&&(this.c=new cf(H5,this,5,8)),th(this.c,P(t,16));return;case 6:!this.a&&(this.a=new F(W5,this,6,6)),RN(this.a),!this.a&&(this.a=new F(W5,this,6,6)),th(this.a,P(t,16));return}V8e(this,e,t)},Q.ii=function(){return lP(),sVt},Q.ki=function(e){switch(e){case 3:Hj(this,null);return;case 4:!this.b&&(this.b=new cf(H5,this,4,7)),RN(this.b);return;case 5:!this.c&&(this.c=new cf(H5,this,5,8)),RN(this.c);return;case 6:!this.a&&(this.a=new F(W5,this,6,6)),RN(this.a);return}vT(this,e)},Q.Ib=function(){return ipt(this)},L(qH,`ElkEdgeImpl`,326),q(452,2083,{110:1,342:1,166:1,452:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1},rn),Q.Ah=function(e){return b6e(this,e)},Q.Lh=function(e,t,n){switch(e){case 1:return this.j;case 2:return this.k;case 3:return this.b;case 4:return this.c;case 5:return!this.a&&(this.a=new ju(z5,this,5)),this.a;case 6:return QLe(this);case 7:return t?KO(this):this.i;case 8:return t?GO(this):this.f;case 9:return!this.g&&(this.g=new cf(W5,this,9,10)),this.g;case 10:return!this.e&&(this.e=new cf(W5,this,10,9)),this.e;case 11:return this.d}return W3e(this,e,t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 6:return this.Cb&&(n=(i=this.Db>>16,i>=0?b6e(this,n):this.Cb.Th(this,-1-i,null,n))),jDe(this,P(e,74),n);case 9:return!this.g&&(this.g=new cf(W5,this,9,10)),vD(this.g,e,n);case 10:return!this.e&&(this.e=new cf(W5,this,10,9)),vD(this.e,e,n)}return a=P(_x((r=P(NC(this,16),29),r||(lP(),X5)),t),69),a.wk().zk(this,WD(this),t-bh((lP(),X5)),e,n)},Q.Uh=function(e,t,n){switch(t){case 5:return!this.a&&(this.a=new ju(z5,this,5)),AO(this.a,e,n);case 6:return jDe(this,null,n);case 9:return!this.g&&(this.g=new cf(W5,this,9,10)),AO(this.g,e,n);case 10:return!this.e&&(this.e=new cf(W5,this,10,9)),AO(this.e,e,n)}return x9e(this,e,t,n)},Q.Wh=function(e){switch(e){case 1:return this.j!=0;case 2:return this.k!=0;case 3:return this.b!=0;case 4:return this.c!=0;case 5:return!!this.a&&this.a.i!=0;case 6:return!!QLe(this);case 7:return!!this.i;case 8:return!!this.f;case 9:return!!this.g&&this.g.i!=0;case 10:return!!this.e&&this.e.i!=0;case 11:return this.d!=null}return yBe(this,e)},Q.bi=function(e,t){switch(e){case 1:qx(this,D(N(t)));return;case 2:Yx(this,D(N(t)));return;case 3:Hx(this,D(N(t)));return;case 4:Jx(this,D(N(t)));return;case 5:!this.a&&(this.a=new ju(z5,this,5)),RN(this.a),!this.a&&(this.a=new ju(z5,this,5)),th(this.a,P(t,16));return;case 6:Jat(this,P(t,74));return;case 7:ES(this,P(t,84));return;case 8:TS(this,P(t,84));return;case 9:!this.g&&(this.g=new cf(W5,this,9,10)),RN(this.g),!this.g&&(this.g=new cf(W5,this,9,10)),th(this.g,P(t,16));return;case 10:!this.e&&(this.e=new cf(W5,this,10,9)),RN(this.e),!this.e&&(this.e=new cf(W5,this,10,9)),th(this.e,P(t,16));return;case 11:qJe(this,kd(t));return}qZe(this,e,t)},Q.ii=function(){return lP(),X5},Q.ki=function(e){switch(e){case 1:qx(this,0);return;case 2:Yx(this,0);return;case 3:Hx(this,0);return;case 4:Jx(this,0);return;case 5:!this.a&&(this.a=new ju(z5,this,5)),RN(this.a);return;case 6:Jat(this,null);return;case 7:ES(this,null);return;case 8:TS(this,null);return;case 9:!this.g&&(this.g=new cf(W5,this,9,10)),RN(this.g);return;case 10:!this.e&&(this.e=new cf(W5,this,10,9)),RN(this.e);return;case 11:qJe(this,null);return}sZe(this,e)},Q.Ib=function(){return xrt(this)},Q.b=0,Q.c=0,Q.d=null,Q.j=0,Q.k=0,L(qH,`ElkEdgeSectionImpl`,452),q(158,120,{110:1,94:1,93:1,155:1,58:1,114:1,54:1,99:1,158:1,119:1,120:1}),Q.Lh=function(e,t,n){var r;return e==0?(!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab):xb(this,e-bh(this.ii()),_x((r=P(NC(this,16),29),r||this.ii()),e),t,n)},Q.Sh=function(e,t,n){var r,i;return t==0?(!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n)):(i=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),i.wk().zk(this,WD(this),t-bh(this.ii()),e,n))},Q.Uh=function(e,t,n){var r,i;return t==0?(!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n)):(i=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),i.wk().Ak(this,WD(this),t-bh(this.ii()),e,n))},Q.Wh=function(e){var t;return e==0?!!this.Ab&&this.Ab.i!=0:Hv(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.Zh=function(e){return rP(this,e)},Q.bi=function(e,t){var n;if(e===0){!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return}LE(this,e-bh(this.ii()),_x((n=P(NC(this,16),29),n||this.ii()),e),t)},Q.di=function(e){GD(this,128,e)},Q.ii=function(){return CP(),qVt},Q.ki=function(e){var t;if(e===0){!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return}PT(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.pi=function(){this.Bb|=1},Q.qi=function(e){return JM(this,e)},Q.Bb=0,L(KH,`EModelElementImpl`,158),q(720,158,{110:1,94:1,93:1,480:1,155:1,58:1,114:1,54:1,99:1,158:1,119:1,120:1},$ue),Q.ri=function(e,t){return yht(this,e,t)},Q.si=function(e){var t,n,r,i,a;if(this.a!=Mx(e)||e.Bb&256)throw E(new Fi($H+e.zb+XH));for(r=l_(e);Jv(r.a).i!=0;){if(n=P(GN(r,0,(t=P(H(Jv(r.a),0),89),a=t.c,j(a,90)?P(a,29):(CP(),J7))),29),_k(n))return i=Mx(n).wi().si(n),P(i,54).ci(e),i;r=l_(n)}return(e.D==null?e.B:e.D)==`java.util.Map$Entry`?new OMe(e):new eMe(e)},Q.ti=function(e,t){return uP(this,e,t)},Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.a}return xb(this,e-bh((CP(),G7)),_x((r=P(NC(this,16),29),r||G7),e),t,n)},Q.Sh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 1:return this.a&&(n=P(this.a,54).Th(this,4,J5,n)),mT(this,P(e,241),n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),G7)),t),69),i.wk().zk(this,WD(this),t-bh((CP(),G7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 1:return mT(this,null,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),G7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),G7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return!!this.a}return Hv(this,e-bh((CP(),G7)),_x((t=P(NC(this,16),29),t||G7),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:r9e(this,P(t,241));return}LE(this,e-bh((CP(),G7)),_x((n=P(NC(this,16),29),n||G7),e),t)},Q.ii=function(){return CP(),G7},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:r9e(this,null);return}PT(this,e-bh((CP(),G7)),_x((t=P(NC(this,16),29),t||G7),e))};var t7,hVt,gVt;L(KH,`EFactoryImpl`,720),q(1037,720,{110:1,2113:1,94:1,93:1,480:1,155:1,58:1,114:1,54:1,99:1,158:1,119:1,120:1},kse),Q.ri=function(e,t){switch(e.hk()){case 12:return P(t,149).Pg();case 13:return PE(t);default:throw E(new Fi(YH+e.xe()+XH))}},Q.si=function(e){var t,n,r,i,a,o,s,c;switch(e.G==-1&&(e.G=(t=Mx(e),t?NO(t.vi(),e):-1)),e.G){case 4:return a=new Ase,a;case 6:return o=new ii,o;case 7:return s=new s_e,s;case 8:return r=new nn,r;case 9:return n=new tn,n;case 10:return i=new rn,i;case 11:return c=new jse,c;default:throw E(new Fi($H+e.zb+XH))}},Q.ti=function(e,t){switch(e.hk()){case 13:case 12:return null;default:throw E(new Fi(YH+e.xe()+XH))}},L(qH,`ElkGraphFactoryImpl`,1037),q(448,158,{110:1,94:1,93:1,155:1,197:1,58:1,114:1,54:1,99:1,158:1,119:1,120:1}),Q.Gh=function(){var e,t=(e=P(NC(this,16),29),MLe(aN(e||this.ii())));return t==null?(Yo(),Yo(),i9):new VEe(this,t)},Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.xe()}return xb(this,e-bh(this.ii()),_x((r=P(NC(this,16),29),r||this.ii()),e),t,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null}return Hv(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:this.ui(kd(t));return}LE(this,e-bh(this.ii()),_x((n=P(NC(this,16),29),n||this.ii()),e),t)},Q.ii=function(){return CP(),JVt},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:this.ui(null);return}PT(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.xe=function(){return this.zb},Q.ui=function(e){GS(this,e)},Q.Ib=function(){return DT(this)},Q.zb=null,L(KH,`ENamedElementImpl`,448),q(184,448,{110:1,94:1,93:1,155:1,197:1,58:1,241:1,114:1,54:1,99:1,158:1,184:1,119:1,120:1,690:1},IIe),Q.Ah=function(e){return w6e(this,e)},Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.yb;case 3:return this.xb;case 4:return this.sb;case 5:return!this.rb&&(this.rb=new Tm(this,E7,this)),this.rb;case 6:return!this.vb&&(this.vb=new nf(J5,this,6,7)),this.vb;case 7:return t?this.Db>>16==7?P(this.Cb,241):null:pRe(this)}return xb(this,e-bh((CP(),X7)),_x((r=P(NC(this,16),29),r||X7),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 4:return this.sb&&(n=P(this.sb,54).Th(this,1,K5,n)),OT(this,P(e,480),n);case 5:return!this.rb&&(this.rb=new Tm(this,E7,this)),vD(this.rb,e,n);case 6:return!this.vb&&(this.vb=new nf(J5,this,6,7)),vD(this.vb,e,n);case 7:return this.Cb&&(n=(i=this.Db>>16,i>=0?w6e(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,7,n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),X7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),X7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 4:return OT(this,null,n);case 5:return!this.rb&&(this.rb=new Tm(this,E7,this)),AO(this.rb,e,n);case 6:return!this.vb&&(this.vb=new nf(J5,this,6,7)),AO(this.vb,e,n);case 7:return qM(this,null,7,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),X7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),X7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.yb!=null;case 3:return this.xb!=null;case 4:return!!this.sb;case 5:return!!this.rb&&this.rb.i!=0;case 6:return!!this.vb&&this.vb.i!=0;case 7:return!!pRe(this)}return Hv(this,e-bh((CP(),X7)),_x((t=P(NC(this,16),29),t||X7),e))},Q.Zh=function(e){return Mot(this,e)||rP(this,e)},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:GS(this,kd(t));return;case 2:qS(this,kd(t));return;case 3:KS(this,kd(t));return;case 4:EA(this,P(t,480));return;case 5:!this.rb&&(this.rb=new Tm(this,E7,this)),RN(this.rb),!this.rb&&(this.rb=new Tm(this,E7,this)),th(this.rb,P(t,16));return;case 6:!this.vb&&(this.vb=new nf(J5,this,6,7)),RN(this.vb),!this.vb&&(this.vb=new nf(J5,this,6,7)),th(this.vb,P(t,16));return}LE(this,e-bh((CP(),X7)),_x((n=P(NC(this,16),29),n||X7),e),t)},Q.ei=function(e){var t,n;if(e&&this.rb)for(n=new Lu(this.rb);n.e!=n.i.gc();)t=gO(n),j(t,364)&&(P(t,364).w=null);GD(this,64,e)},Q.ii=function(){return CP(),X7},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:GS(this,null);return;case 2:qS(this,null);return;case 3:KS(this,null);return;case 4:EA(this,null);return;case 5:!this.rb&&(this.rb=new Tm(this,E7,this)),RN(this.rb);return;case 6:!this.vb&&(this.vb=new nf(J5,this,6,7)),RN(this.vb);return}PT(this,e-bh((CP(),X7)),_x((t=P(NC(this,16),29),t||X7),e))},Q.pi=function(){Ck(this)},Q.vi=function(){return!this.rb&&(this.rb=new Tm(this,E7,this)),this.rb},Q.wi=function(){return this.sb},Q.xi=function(){return this.ub},Q.yi=function(){return this.xb},Q.zi=function(){return this.yb},Q.Ai=function(e){this.ub=e},Q.Ib=function(){var e;return this.Db&64?DT(this):(e=new Wu(DT(this)),e.a+=` (nsURI: `,pl(e,this.yb),e.a+=`, nsPrefix: `,pl(e,this.xb),e.a+=`)`,e.a)},Q.xb=null,Q.yb=null;var _Vt;L(KH,`EPackageImpl`,184),q(569,184,{110:1,2115:1,569:1,94:1,93:1,155:1,197:1,58:1,241:1,114:1,54:1,99:1,158:1,184:1,119:1,120:1,690:1},Urt),Q.q=!1,Q.r=!1;var vVt=!1;L(qH,`ElkGraphPackageImpl`,569),q(366,740,{110:1,342:1,167:1,135:1,422:1,366:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1},Ase),Q.Ah=function(e){return x6e(this,e)},Q.Lh=function(e,t,n){switch(e){case 7:return mRe(this);case 8:return this.a}return FE(this,e,t,n)},Q.Sh=function(e,t,n){var r;return t===7?(this.Cb&&(n=(r=this.Db>>16,r>=0?x6e(this,n):this.Cb.Th(this,-1-r,null,n))),jNe(this,P(e,167),n)):uA(this,e,t,n)},Q.Uh=function(e,t,n){return t==7?jNe(this,null,n):XC(this,e,t,n)},Q.Wh=function(e){switch(e){case 7:return!!mRe(this);case 8:return!ff(``,this.a)}return JE(this,e)},Q.bi=function(e,t){switch(e){case 7:kot(this,P(t,167));return;case 8:jJe(this,kd(t));return}H8e(this,e,t)},Q.ii=function(){return lP(),lVt},Q.ki=function(e){switch(e){case 7:kot(this,null);return;case 8:jJe(this,``);return}dD(this,e)},Q.Ib=function(){return get(this)},Q.a=``,L(qH,`ElkLabelImpl`,366),q(207,741,{110:1,342:1,84:1,167:1,27:1,422:1,207:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1},ii),Q.Ah=function(e){return F6e(this,e)},Q.Lh=function(e,t,n){switch(e){case 9:return!this.c&&(this.c=new F(e7,this,9,9)),this.c;case 10:return!this.a&&(this.a=new F($5,this,10,11)),this.a;case 11:return I_(this);case 12:return!this.b&&(this.b=new F(U5,this,12,3)),this.b;case 13:return rd(),!this.a&&(this.a=new F($5,this,10,11)),this.a.i>0}return tk(this,e,t,n)},Q.Sh=function(e,t,n){var r;switch(t){case 9:return!this.c&&(this.c=new F(e7,this,9,9)),vD(this.c,e,n);case 10:return!this.a&&(this.a=new F($5,this,10,11)),vD(this.a,e,n);case 11:return this.Cb&&(n=(r=this.Db>>16,r>=0?F6e(this,n):this.Cb.Th(this,-1-r,null,n))),tf(this,P(e,27),n);case 12:return!this.b&&(this.b=new F(U5,this,12,3)),vD(this.b,e,n)}return b8e(this,e,t,n)},Q.Uh=function(e,t,n){switch(t){case 9:return!this.c&&(this.c=new F(e7,this,9,9)),AO(this.c,e,n);case 10:return!this.a&&(this.a=new F($5,this,10,11)),AO(this.a,e,n);case 11:return tf(this,null,n);case 12:return!this.b&&(this.b=new F(U5,this,12,3)),AO(this.b,e,n)}return x8e(this,e,t,n)},Q.Wh=function(e){switch(e){case 9:return!!this.c&&this.c.i!=0;case 10:return!!this.a&&this.a.i!=0;case 11:return!!I_(this);case 12:return!!this.b&&this.b.i!=0;case 13:return!this.a&&(this.a=new F($5,this,10,11)),this.a.i>0}return BZe(this,e)},Q.bi=function(e,t){switch(e){case 9:!this.c&&(this.c=new F(e7,this,9,9)),RN(this.c),!this.c&&(this.c=new F(e7,this,9,9)),th(this.c,P(t,16));return;case 10:!this.a&&(this.a=new F($5,this,10,11)),RN(this.a),!this.a&&(this.a=new F($5,this,10,11)),th(this.a,P(t,16));return;case 11:Gj(this,P(t,27));return;case 12:!this.b&&(this.b=new F(U5,this,12,3)),RN(this.b),!this.b&&(this.b=new F(U5,this,12,3)),th(this.b,P(t,16));return}cit(this,e,t)},Q.ii=function(){return lP(),uVt},Q.ki=function(e){switch(e){case 9:!this.c&&(this.c=new F(e7,this,9,9)),RN(this.c);return;case 10:!this.a&&(this.a=new F($5,this,10,11)),RN(this.a);return;case 11:Gj(this,null);return;case 12:!this.b&&(this.b=new F(U5,this,12,3)),RN(this.b);return}DO(this,e)},Q.Ib=function(){return Elt(this)},L(qH,`ElkNodeImpl`,207),q(193,741,{110:1,342:1,84:1,167:1,123:1,422:1,193:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1},s_e),Q.Ah=function(e){return S6e(this,e)},Q.Lh=function(e,t,n){return e==9?E_(this):tk(this,e,t,n)},Q.Sh=function(e,t,n){var r;return t===9?(this.Cb&&(n=(r=this.Db>>16,r>=0?S6e(this,n):this.Cb.Th(this,-1-r,null,n))),Vd(this,P(e,27),n)):b8e(this,e,t,n)},Q.Uh=function(e,t,n){return t==9?Vd(this,null,n):x8e(this,e,t,n)},Q.Wh=function(e){return e==9?!!E_(this):BZe(this,e)},Q.bi=function(e,t){if(e===9){Yat(this,P(t,27));return}cit(this,e,t)},Q.ii=function(){return lP(),dVt},Q.ki=function(e){if(e===9){Yat(this,null);return}DO(this,e)},Q.Ib=function(){return Dlt(this)},L(qH,`ElkPortImpl`,193);var yVt=gp(uU,`BasicEMap/Entry`);q(1122,120,{110:1,44:1,94:1,93:1,136:1,58:1,114:1,54:1,99:1,119:1,120:1},jse),Q.Fb=function(e){return this===e},Q.ld=function(){return this.b},Q.Hb=function(){return td(this)},Q.Di=function(e){MJe(this,P(e,149))},Q.Lh=function(e,t,n){switch(e){case 0:return this.b;case 1:return this.c}return jO(this,e,t,n)},Q.Wh=function(e){switch(e){case 0:return!!this.b;case 1:return this.c!=null}return mO(this,e)},Q.bi=function(e,t){switch(e){case 0:MJe(this,P(t,149));return;case 1:AJe(this,t);return}QA(this,e,t)},Q.ii=function(){return lP(),Z5},Q.ki=function(e){switch(e){case 0:MJe(this,null);return;case 1:AJe(this,null);return}BA(this,e)},Q.Bi=function(){var e;return this.a==-1&&(e=this.b,this.a=e?US(e):0),this.a},Q.md=function(){return this.c},Q.Ci=function(e){this.a=e},Q.nd=function(e){var t=this.c;return AJe(this,e),t},Q.Ib=function(){var e;return this.Db&64?Aj(this):(e=new ta,gl(gl(gl(e,this.b?this.b.Pg():IP),kR),Uu(this.c)),e.a)},Q.a=-1,Q.c=null;var n7=L(qH,`ElkPropertyToValueMapEntryImpl`,1122);q(996,1,{},Pse),L(fU,`JsonAdapter`,996),q(216,63,SF,Vi),L(fU,`JsonImportException`,216),q(868,1,{},E6e),L(fU,`JsonImporter`,868),q(903,1,{},TSe),L(fU,`JsonImporter/lambda$0$Type`,903),q(904,1,{},ESe),L(fU,`JsonImporter/lambda$1$Type`,904),q(912,1,{},ohe),L(fU,`JsonImporter/lambda$10$Type`,912),q(914,1,{},DSe),L(fU,`JsonImporter/lambda$11$Type`,914),q(915,1,{},OSe),L(fU,`JsonImporter/lambda$12$Type`,915),q(921,1,{},pIe),L(fU,`JsonImporter/lambda$13$Type`,921),q(920,1,{},mIe),L(fU,`JsonImporter/lambda$14$Type`,920),q(916,1,{},kSe),L(fU,`JsonImporter/lambda$15$Type`,916),q(917,1,{},ASe),L(fU,`JsonImporter/lambda$16$Type`,917),q(918,1,{},jSe),L(fU,`JsonImporter/lambda$17$Type`,918),q(919,1,{},MSe),L(fU,`JsonImporter/lambda$18$Type`,919),q(924,1,{},she),L(fU,`JsonImporter/lambda$19$Type`,924),q(905,1,{},che),L(fU,`JsonImporter/lambda$2$Type`,905),q(922,1,{},lhe),L(fU,`JsonImporter/lambda$20$Type`,922),q(923,1,{},uhe),L(fU,`JsonImporter/lambda$21$Type`,923),q(927,1,{},dhe),L(fU,`JsonImporter/lambda$22$Type`,927),q(925,1,{},fhe),L(fU,`JsonImporter/lambda$23$Type`,925),q(926,1,{},phe),L(fU,`JsonImporter/lambda$24$Type`,926),q(929,1,{},mhe),L(fU,`JsonImporter/lambda$25$Type`,929),q(928,1,{},hhe),L(fU,`JsonImporter/lambda$26$Type`,928),q(930,1,$P,NSe),Q.Cd=function(e){mGe(this.b,this.a,kd(e))},L(fU,`JsonImporter/lambda$27$Type`,930),q(931,1,$P,PSe),Q.Cd=function(e){hGe(this.b,this.a,kd(e))},L(fU,`JsonImporter/lambda$28$Type`,931),q(932,1,{},FSe),L(fU,`JsonImporter/lambda$29$Type`,932),q(908,1,{},ghe),L(fU,`JsonImporter/lambda$3$Type`,908),q(933,1,{},ISe),L(fU,`JsonImporter/lambda$30$Type`,933),q(934,1,{},_he),L(fU,`JsonImporter/lambda$31$Type`,934),q(935,1,{},vhe),L(fU,`JsonImporter/lambda$32$Type`,935),q(936,1,{},yhe),L(fU,`JsonImporter/lambda$33$Type`,936),q(937,1,{},bhe),L(fU,`JsonImporter/lambda$34$Type`,937),q(870,1,{},xhe),L(fU,`JsonImporter/lambda$35$Type`,870),q(941,1,{},uje),L(fU,`JsonImporter/lambda$36$Type`,941),q(938,1,$P,She),Q.Cd=function(e){XHe(this.a,P(e,377))},L(fU,`JsonImporter/lambda$37$Type`,938),q(939,1,$P,LSe),Q.Cd=function(e){WSe(this.a,this.b,P(e,166))},L(fU,`JsonImporter/lambda$38$Type`,939),q(940,1,$P,RSe),Q.Cd=function(e){GSe(this.a,this.b,P(e,166))},L(fU,`JsonImporter/lambda$39$Type`,940),q(906,1,{},Che),L(fU,`JsonImporter/lambda$4$Type`,906),q(942,1,$P,whe),Q.Cd=function(e){ZHe(this.a,P(e,8))},L(fU,`JsonImporter/lambda$40$Type`,942),q(907,1,{},The),L(fU,`JsonImporter/lambda$5$Type`,907),q(911,1,{},Ehe),L(fU,`JsonImporter/lambda$6$Type`,911),q(909,1,{},Dhe),L(fU,`JsonImporter/lambda$7$Type`,909),q(910,1,{},Ohe),L(fU,`JsonImporter/lambda$8$Type`,910),q(913,1,{},khe),L(fU,`JsonImporter/lambda$9$Type`,913),q(961,1,$P,Ahe),Q.Cd=function(e){Dh(this.a,new mh(kd(e)))},L(fU,`JsonMetaDataConverter/lambda$0$Type`,961),q(962,1,$P,jhe),Q.Cd=function(e){VPe(this.a,P(e,245))},L(fU,`JsonMetaDataConverter/lambda$1$Type`,962),q(963,1,$P,Mhe),Q.Cd=function(e){FRe(this.a,P(e,143))},L(fU,`JsonMetaDataConverter/lambda$2$Type`,963),q(964,1,$P,Nhe),Q.Cd=function(e){HPe(this.a,P(e,170))},L(fU,`JsonMetaDataConverter/lambda$3$Type`,964),q(245,22,{3:1,34:1,22:1,245:1},Jc);var r7,i7,a7,o7,s7,c7,l7,u7,d7=aS(EL,`GraphFeature`,245,eG,nqe,Sje),bVt;q(11,1,{34:1,149:1},yr,Wd,Tl,ou),Q.Fd=function(e){return oTe(this,P(e,149))},Q.Fb=function(e){return nLe(this,e)},Q.Sg=function(){return hO(this)},Q.Pg=function(){return this.b},Q.Hb=function(){return jw(this.b)},Q.Ib=function(){return this.b},L(EL,`Property`,11),q(671,1,GI,vr),Q.Ne=function(e,t){return h1e(this,P(e,96),P(t,96))},Q.Fb=function(e){return this===e},Q.Oe=function(){return new Yn(this)},L(EL,`PropertyHolderComparator`,671),q(709,1,VP,Phe),Q.Nb=function(e){Om(this,e)},Q.Pb=function(){return vGe(this)},Q.Qb=function(){uye()},Q.Ob=function(){return!!this.a},L(_U,`ElkGraphUtil/AncestorIterator`,709);var xVt=gp(uU,`EList`);q(70,56,{20:1,31:1,56:1,16:1,15:1,70:1,61:1}),Q.bd=function(e,t){WT(this,e,t)},Q.Fc=function(e){return tb(this,e)},Q.cd=function(e,t){return lZe(this,e,t)},Q.Gc=function(e){return th(this,e)},Q.Ii=function(){return new ld(this)},Q.Ji=function(){return new ud(this)},Q.Ki=function(e){return mS(this,e)},Q.Li=function(){return!0},Q.Mi=function(e,t){},Q.Ni=function(){},Q.Oi=function(e,t){Xy(this,e,t)},Q.Pi=function(e,t,n){},Q.Qi=function(e,t){},Q.Ri=function(e,t,n){},Q.Fb=function(e){return Mct(this,e)},Q.Hb=function(){return qXe(this)},Q.Si=function(){return!1},Q.Kc=function(){return new Lu(this)},Q.ed=function(){return new cd(this)},Q.fd=function(e){var t=this.gc();if(e<0||e>t)throw E(new lf(e,t));return new Hm(this,e)},Q.Ui=function(e,t){this.Ti(e,this.dd(t))},Q.Mc=function(e){return nx(this,e)},Q.Wi=function(e,t){return t},Q.hd=function(e,t){return PO(this,e,t)},Q.Ib=function(){return HE(this)},Q.Yi=function(){return!0},Q.Zi=function(e,t){return Aw(this,t)},L(uU,`AbstractEList`,70),q(66,70,SU,an,kx,hC),Q.Ei=function(e,t){return dA(this,e,t)},Q.Fi=function(e){return X4e(this,e)},Q.Gi=function(e,t){jT(this,e,t)},Q.Hi=function(e){Ty(this,e)},Q.$i=function(e){return SGe(this,e)},Q.$b=function(){Ey(this)},Q.Hc=function(e){return Uk(this,e)},Q.Xb=function(e){return H(this,e)},Q._i=function(e){var t,n,r;++this.j,n=this.g==null?0:this.g.length,e>n&&(r=this.g,t=n+(n/2|0)+4,t=0&&(this.gd(t),!0)},Q.Xi=function(e,t){return this.Dj(e,this.Zi(e,t))},Q.gc=function(){return this.Ej()},Q.Pc=function(){return this.Fj()},Q.Qc=function(e){return this.Gj(e)},Q.Ib=function(){return this.Hj()},L(uU,`DelegatingEList`,2093),q(2094,2093,rwt),Q.Ei=function(e,t){return wdt(this,e,t)},Q.Fi=function(e){return this.Ei(this.Ej(),e)},Q.Gi=function(e,t){Wrt(this,e,t)},Q.Hi=function(e){_rt(this,e)},Q.Li=function(){return!this.Mj()},Q.$b=function(){zN(this)},Q.Ij=function(e,t,n,r,i){return new eLe(this,e,t,n,r,i)},Q.Jj=function(e){AC(this.jj(),e)},Q.Kj=function(){return null},Q.Lj=function(){return-1},Q.jj=function(){return null},Q.Mj=function(){return!1},Q.Nj=function(e,t){return t},Q.Oj=function(e,t){return t},Q.Pj=function(){return!1},Q.Qj=function(){return!this.Aj()},Q.Ti=function(e,t){var n,r;return this.Pj()?(r=this.Qj(),n=e9e(this,e,t),this.Jj(this.Ij(7,G(t),n,e,r)),n):e9e(this,e,t)},Q.gd=function(e){var t,n,r,i;return this.Pj()?(n=null,r=this.Qj(),t=this.Ij(4,i=_p(this,e),null,e,r),this.Mj()&&i&&(n=this.Oj(i,n)),n?(n.nj(t),n.oj()):this.Jj(t),i):(i=_p(this,e),this.Mj()&&i&&(n=this.Oj(i,null),n&&n.oj()),i)},Q.Xi=function(e,t){return Tdt(this,e,t)},L(VH,`DelegatingNotifyingListImpl`,2094),q(152,1,NU),Q.nj=function(e){return T5e(this,e)},Q.oj=function(){Pb(this)},Q.gj=function(){return this.d},Q.Kj=function(){return null},Q.Rj=function(){return null},Q.hj=function(e){return-1},Q.ij=function(){return Ast(this)},Q.jj=function(){return null},Q.kj=function(){return jst(this)},Q.lj=function(){return this.o<0?this.o<-2?-2-this.o-1:-1:this.o},Q.Sj=function(){return!1},Q.mj=function(e){var t,n,r,i,a,o,s,c,l,u,d;switch(this.d){case 1:case 2:switch(i=e.gj(),i){case 1:case 2:if(a=e.jj(),A(a)===A(this.jj())&&this.hj(null)==e.hj(null))return this.g=e.ij(),e.gj()==1&&(this.d=1),!0}case 4:if(i=e.gj(),i===4&&(a=e.jj(),A(a)===A(this.jj())&&this.hj(null)==e.hj(null)))return l=Fmt(this),c=this.o<0?this.o<-2?-2-this.o-1:-1:this.o,o=e.lj(),this.d=6,d=new kx(2),c<=o?(tb(d,this.n),tb(d,e.kj()),this.g=U(O(q9,1),HF,28,15,[this.o=c,o+1])):(tb(d,e.kj()),tb(d,this.n),this.g=U(O(q9,1),HF,28,15,[this.o=o,c])),this.n=d,l||(this.o=-2-this.o-1),!0;break;case 6:if(i=e.gj(),i===4&&(a=e.jj(),A(a)===A(this.jj())&&this.hj(null)==e.hj(null))){for(l=Fmt(this),o=e.lj(),u=P(this.g,53),r=V(q9,HF,28,u.length+1,15,1),t=0;t>>0,t.toString(16)));switch(r.a+=` (eventType: `,this.d){case 1:r.a+=`SET`;break;case 2:r.a+=`UNSET`;break;case 3:r.a+=`ADD`;break;case 5:r.a+=`ADD_MANY`;break;case 4:r.a+=`REMOVE`;break;case 6:r.a+=`REMOVE_MANY`;break;case 7:r.a+=`MOVE`;break;case 8:r.a+=`REMOVING_ADAPTER`;break;case 9:r.a+=`RESOLVE`;break;default:Wa(r,this.d)}if(Ult(this)&&(r.a+=`, touch: true`),r.a+=`, position: `,Wa(r,this.o<0?this.o<-2?-2-this.o-1:-1:this.o),r.a+=`, notifier: `,fl(r,this.jj()),r.a+=`, feature: `,fl(r,this.Kj()),r.a+=`, oldValue: `,fl(r,jst(this)),r.a+=`, newValue: `,this.d==6&&j(this.g,53)){for(n=P(this.g,53),r.a+=`[`,e=0;e10?((!this.b||this.c.j!=this.a)&&(this.b=new jp(this),this.a=this.j),mo(this.b,e)):Uk(this,e)},Q.Yi=function(){return!0},Q.a=0,L(uU,`AbstractEList/1`,966),q(302,77,oI,lf),L(uU,`AbstractEList/BasicIndexOutOfBoundsException`,302),q(37,1,VP,Lu),Q.Nb=function(e){Om(this,e)},Q.Xj=function(){if(this.i.j!=this.f)throw E(new Vr)},Q.Yj=function(){return gO(this)},Q.Ob=function(){return this.e!=this.i.gc()},Q.Pb=function(){return this.Yj()},Q.Qb=function(){Yk(this)},Q.e=0,Q.f=0,Q.g=-1,L(uU,`AbstractEList/EIterator`,37),q(286,37,YP,cd,Hm),Q.Qb=function(){Yk(this)},Q.Rb=function(e){y0e(this,e)},Q.Zj=function(){var e;try{return e=this.d.Xb(--this.e),this.Xj(),this.g=this.e,e}catch(e){throw e=ew(e),j(e,77)?(this.Xj(),E(new Hr)):E(e)}},Q.$j=function(e){i3e(this,e)},Q.Sb=function(){return this.e!=0},Q.Tb=function(){return this.e},Q.Ub=function(){return this.Zj()},Q.Vb=function(){return this.e-1},Q.Wb=function(e){this.$j(e)},L(uU,`AbstractEList/EListIterator`,286),q(355,37,VP,ld),Q.Yj=function(){return _O(this)},Q.Qb=function(){throw E(new Br)},L(uU,`AbstractEList/NonResolvingEIterator`,355),q(398,286,YP,ud,LOe),Q.Rb=function(e){throw E(new Br)},Q.Yj=function(){var e;try{return e=this.c.Vi(this.e),this.Xj(),this.g=this.e++,e}catch(e){throw e=ew(e),j(e,77)?(this.Xj(),E(new Hr)):E(e)}},Q.Zj=function(){var e;try{return e=this.c.Vi(--this.e),this.Xj(),this.g=this.e,e}catch(e){throw e=ew(e),j(e,77)?(this.Xj(),E(new Hr)):E(e)}},Q.Qb=function(){throw E(new Br)},Q.Wb=function(e){throw E(new Br)},L(uU,`AbstractEList/NonResolvingEListIterator`,398),q(2080,70,iwt),Q.Ei=function(e,t){var n,r,i=t.gc(),a,o,s,c,l,u,d,f;if(i!=0){for(l=P(NC(this.a,4),129),u=l==null?0:l.length,f=u+i,r=Hw(this,f),d=u-e,d>0&&tN(l,e,r,e+i,d),c=t.Kc(),o=0;on)throw E(new lf(e,n));return new JFe(this,e)},Q.$b=function(){var e,t;++this.j,e=P(NC(this.a,4),129),t=e==null?0:e.length,iO(this,null),Xy(this,t,e)},Q.Hc=function(e){var t=P(NC(this.a,4),129),n,r,i,a;if(t!=null){if(e!=null){for(r=t,i=0,a=r.length;i=n)throw E(new lf(e,n));return t[e]},Q.dd=function(e){var t=P(NC(this.a,4),129),n,r;if(t!=null){if(e!=null){for(n=0,r=t.length;nn)throw E(new lf(e,n));return new qFe(this,e)},Q.Ti=function(e,t){var n=B0e(this),r,i=n==null?0:n.length;if(e>=i)throw E(new Mi(yU+e+bU+i));if(t>=i)throw E(new Mi(xU+t+bU+i));return r=n[t],e!=t&&(e0&&tN(e,0,t,0,n),t},Q.Qc=function(e){var t=P(NC(this.a,4),129),n,r=t==null?0:t.length;return r>0&&(e.lengthr&&Sh(e,r,null),e};var TVt;L(uU,`ArrayDelegatingEList`,2080),q(1051,37,VP,gUe),Q.Xj=function(){if(this.b.j!=this.f||A(P(NC(this.b.a,4),129))!==A(this.a))throw E(new Vr)},Q.Qb=function(){Yk(this),this.a=P(NC(this.b.a,4),129)},L(uU,`ArrayDelegatingEList/EIterator`,1051),q(722,286,YP,lPe,qFe),Q.Xj=function(){if(this.b.j!=this.f||A(P(NC(this.b.a,4),129))!==A(this.a))throw E(new Vr)},Q.$j=function(e){i3e(this,e),this.a=P(NC(this.b.a,4),129)},Q.Qb=function(){Yk(this),this.a=P(NC(this.b.a,4),129)},L(uU,`ArrayDelegatingEList/EListIterator`,722),q(1052,355,VP,_Ue),Q.Xj=function(){if(this.b.j!=this.f||A(P(NC(this.b.a,4),129))!==A(this.a))throw E(new Vr)},L(uU,`ArrayDelegatingEList/NonResolvingEIterator`,1052),q(723,398,YP,uPe,JFe),Q.Xj=function(){if(this.b.j!=this.f||A(P(NC(this.b.a,4),129))!==A(this.a))throw E(new Vr)},L(uU,`ArrayDelegatingEList/NonResolvingEListIterator`,723),q(615,302,oI,wl),L(uU,`BasicEList/BasicIndexOutOfBoundsException`,615),q(710,66,SU,$c),Q.bd=function(e,t){throw E(new Br)},Q.Fc=function(e){throw E(new Br)},Q.cd=function(e,t){throw E(new Br)},Q.Gc=function(e){throw E(new Br)},Q.$b=function(){throw E(new Br)},Q._i=function(e){throw E(new Br)},Q.Kc=function(){return this.Ii()},Q.ed=function(){return this.Ji()},Q.fd=function(e){return this.Ki(e)},Q.Ti=function(e,t){throw E(new Br)},Q.Ui=function(e,t){throw E(new Br)},Q.gd=function(e){throw E(new Br)},Q.Mc=function(e){throw E(new Br)},Q.hd=function(e,t){throw E(new Br)},L(uU,`BasicEList/UnmodifiableEList`,710),q(721,1,{3:1,20:1,16:1,15:1,61:1,597:1}),Q.bd=function(e,t){qwe(this,e,P(t,44))},Q.Fc=function(e){return GEe(this,P(e,44))},Q.Jc=function(e){ly(this,e)},Q.Xb=function(e){return P(H(this.c,e),136)},Q.Ti=function(e,t){return P(this.c.Ti(e,t),44)},Q.Ui=function(e,t){Jwe(this,e,P(t,44))},Q.Lc=function(){return new Mp(null,new cv(this,16))},Q.gd=function(e){return P(this.c.gd(e),44)},Q.hd=function(e,t){return BPe(this,e,P(t,44))},Q.jd=function(e){zS(this,e)},Q.Nc=function(){return new cv(this,16)},Q.Oc=function(){return new Mp(null,new cv(this,16))},Q.cd=function(e,t){return this.c.cd(e,t)},Q.Gc=function(e){return this.c.Gc(e)},Q.$b=function(){this.c.$b()},Q.Hc=function(e){return this.c.Hc(e)},Q.Ic=function(e){return $C(this.c,e)},Q._j=function(){var e,t,n;if(this.d==null){for(this.d=V(SVt,awt,66,2*this.f+1,0,1),n=this.e,this.f=0,t=this.c.Kc();t.e!=t.i.gc();)e=P(t.Yj(),136),JO(this,e);this.e=n}},Q.Fb=function(e){return GOe(this,e)},Q.Hb=function(){return qXe(this.c)},Q.dd=function(e){return this.c.dd(e)},Q.ak=function(){this.c=new Fhe(this)},Q.dc=function(){return this.f==0},Q.Kc=function(){return this.c.Kc()},Q.ed=function(){return this.c.ed()},Q.fd=function(e){return this.c.fd(e)},Q.bk=function(){return Jy(this)},Q.ck=function(e,t,n){return new dje(e,t,n)},Q.dk=function(){return new Rse},Q.Mc=function(e){return aJe(this,e)},Q.gc=function(){return this.f},Q.kd=function(e,t){return new $_(this.c,e,t)},Q.Pc=function(){return this.c.Pc()},Q.Qc=function(e){return this.c.Qc(e)},Q.Ib=function(){return HE(this.c)},Q.e=0,Q.f=0,L(uU,`BasicEMap`,721),q(1046,66,SU,Fhe),Q.Mi=function(e,t){Oge(this,P(t,136))},Q.Pi=function(e,t,n){var r;++(r=this,P(t,136),r).a.e},Q.Qi=function(e,t){kge(this,P(t,136))},Q.Ri=function(e,t,n){hEe(this,P(t,136),P(n,136))},Q.Oi=function(e,t){sXe(this.a)},L(uU,`BasicEMap/1`,1046),q(1047,66,SU,Rse),Q.aj=function(e){return V(EVt,owt,621,e,0,1)},L(uU,`BasicEMap/2`,1047),q(1048,GP,KP,Ihe),Q.$b=function(){this.a.c.$b()},Q.Hc=function(e){return uD(this.a,e)},Q.Kc=function(){return this.a.f==0?(Nd(),_7.a):new qve(this.a)},Q.Mc=function(e){var t=this.a.f;return BD(this.a,e),this.a.f!=t},Q.gc=function(){return this.a.f},L(uU,`BasicEMap/3`,1048),q(1049,31,WP,Lhe),Q.$b=function(){this.a.c.$b()},Q.Hc=function(e){return Nct(this.a,e)},Q.Kc=function(){return this.a.f==0?(Nd(),_7.a):new Jve(this.a)},Q.gc=function(){return this.a.f},L(uU,`BasicEMap/4`,1049),q(1050,GP,KP,Rhe),Q.$b=function(){this.a.c.$b()},Q.Hc=function(e){var t,n,r,i,a,o,s,c,l;if(this.a.f>0&&j(e,44)&&(this.a._j(),c=P(e,44),s=c.ld(),i=s==null?0:US(s),a=MDe(this.a,i),t=this.a.d[a],t)){for(n=P(t.g,379),l=t.i,o=0;o`+this.c},Q.a=0;var EVt=L(uU,`BasicEMap/EntryImpl`,621);q(546,1,{},on),L(uU,`BasicEMap/View`,546);var _7;q(783,1,{}),Q.Fb=function(e){return lit((Vg(),QG),e)},Q.Hb=function(){return IZe((Vg(),QG))},Q.Ib=function(){return CA((Vg(),QG))},L(uU,`ECollections/BasicEmptyUnmodifiableEList`,783),q(1348,1,YP,zse),Q.Nb=function(e){Om(this,e)},Q.Rb=function(e){throw E(new Br)},Q.Ob=function(){return!1},Q.Sb=function(){return!1},Q.Pb=function(){throw E(new Hr)},Q.Tb=function(){return 0},Q.Ub=function(){throw E(new Hr)},Q.Vb=function(){return-1},Q.Qb=function(){throw E(new Br)},Q.Wb=function(e){throw E(new Br)},L(uU,`ECollections/BasicEmptyUnmodifiableEList/1`,1348),q(1346,783,{20:1,16:1,15:1,61:1},c_e),Q.bd=function(e,t){Eye()},Q.Fc=function(e){return Dye()},Q.cd=function(e,t){return Oye()},Q.Gc=function(e){return kye()},Q.$b=function(){Aye()},Q.Hc=function(e){return!1},Q.Ic=function(e){return!1},Q.Jc=function(e){ly(this,e)},Q.Xb=function(e){return xl((Vg(),e)),null},Q.dd=function(e){return-1},Q.dc=function(){return!0},Q.Kc=function(){return this.a},Q.ed=function(){return this.a},Q.fd=function(e){return this.a},Q.Ti=function(e,t){return jye()},Q.Ui=function(e,t){Mye()},Q.Lc=function(){return new Mp(null,new cv(this,16))},Q.gd=function(e){return Nye()},Q.Mc=function(e){return Pye()},Q.hd=function(e,t){return Fye()},Q.gc=function(){return 0},Q.jd=function(e){zS(this,e)},Q.Nc=function(){return new cv(this,16)},Q.Oc=function(){return new Mp(null,new cv(this,16))},Q.kd=function(e,t){return Vg(),new $_(QG,e,t)},Q.Pc=function(){return INe((Vg(),QG))},Q.Qc=function(e){return Vg(),ck(QG,e)},L(uU,`ECollections/EmptyUnmodifiableEList`,1346),q(1347,783,{20:1,16:1,15:1,61:1,597:1},l_e),Q.bd=function(e,t){Eye()},Q.Fc=function(e){return Dye()},Q.cd=function(e,t){return Oye()},Q.Gc=function(e){return kye()},Q.$b=function(){Aye()},Q.Hc=function(e){return!1},Q.Ic=function(e){return!1},Q.Jc=function(e){ly(this,e)},Q.Xb=function(e){return xl((Vg(),e)),null},Q.dd=function(e){return-1},Q.dc=function(){return!0},Q.Kc=function(){return this.a},Q.ed=function(){return this.a},Q.fd=function(e){return this.a},Q.Ti=function(e,t){return jye()},Q.Ui=function(e,t){Mye()},Q.Lc=function(){return new Mp(null,new cv(this,16))},Q.gd=function(e){return Nye()},Q.Mc=function(e){return Pye()},Q.hd=function(e,t){return Fye()},Q.gc=function(){return 0},Q.jd=function(e){zS(this,e)},Q.Nc=function(){return new cv(this,16)},Q.Oc=function(){return new Mp(null,new cv(this,16))},Q.kd=function(e,t){return Vg(),new $_(QG,e,t)},Q.Pc=function(){return INe((Vg(),QG))},Q.Qc=function(e){return Vg(),ck(QG,e)},Q.bk=function(){return Vg(),Vg(),$G},L(uU,`ECollections/EmptyUnmodifiableEMap`,1347);var DVt=gp(uU,`Enumerator`),v7;q(288,1,{288:1},yM),Q.Fb=function(e){var t;return this===e?!0:j(e,288)?(t=P(e,288),this.f==t.f&&rNe(this.i,t.i)&&Fp(this.a,this.f&256?t.f&256?t.a:null:t.f&256?null:t.a)&&Fp(this.d,t.d)&&Fp(this.g,t.g)&&Fp(this.e,t.e)&&U2e(this,t)):!1},Q.Hb=function(){return this.f},Q.Ib=function(){return qut(this)},Q.f=0;var OVt=0,kVt=0,AVt=0,jVt=0,MVt=0,NVt=0,PVt=0,FVt=0,IVt=0,LVt,y7=0,b7=0,RVt=0,zVt=0,x7,BVt;L(uU,`URI`,288),q(1121,45,CI,u_e),Q.zc=function(e,t){return P(H_(this,kd(e),P(t,288)),288)},L(uU,`URI/URICache`,1121),q(506,66,SU,Nse,Hp),Q.Si=function(){return!0},L(uU,`UniqueEList`,506),q(590,63,SF,Nb),L(uU,`WrappedException`,590);var S7=gp(zH,lwt),C7=gp(zH,uwt),w7=gp(zH,dwt),T7=gp(zH,fwt),E7=gp(zH,pwt),D7=gp(zH,`EClass`),O7=gp(zH,`EDataType`),VVt;q(1233,45,CI,d_e),Q.xc=function(e){return rl(e)?v_(this,e):nl(Kp(this.f,e))},L(zH,`EDataType/Internal/ConversionDelegate/Factory/Registry/Impl`,1233);var k7=gp(zH,`EEnum`),A7=gp(zH,mwt),j7=gp(zH,hwt),M7=gp(zH,gwt),N7,P7=gp(zH,_wt),F7=gp(zH,vwt);q(1042,1,{},Mse),Q.Ib=function(){return`NIL`},L(zH,`EStructuralFeature/Internal/DynamicValueHolder/1`,1042);var HVt;q(1041,45,CI,f_e),Q.xc=function(e){return rl(e)?v_(this,e):nl(Kp(this.f,e))},L(zH,`EStructuralFeature/Internal/SettingDelegate/Factory/Registry/Impl`,1041);var I7=gp(zH,ywt),L7=gp(zH,`EValidator/PatternMatcher`),UVt,R7,z7,B7,V7,H7,WVt,GVt,KVt,U7,W7,G7,K7,q7,qVt,JVt,J7,Y7,YVt,X7,Z7,Q7,$7,XVt,ZVt,e9,t9=gp(IU,`FeatureMap/Entry`);q(545,1,{76:1},Zc),Q.Lk=function(){return this.a},Q.md=function(){return this.b},L(KH,`BasicEObjectImpl/1`,545),q(1040,1,LU,JSe),Q.Fk=function(e){return wy(this.a,this.b,e)},Q.Qj=function(){return iRe(this.a,this.b)},Q.Wb=function(e){rRe(this.a,this.b,e)},Q.Gk=function(){yFe(this.a,this.b)},L(KH,`BasicEObjectImpl/4`,1040),q(2081,1,{114:1}),Q.Mk=function(e){this.e=e==0?QVt:V(WW,FP,1,e,5,1)},Q.li=function(e){return this.e[e]},Q.mi=function(e,t){this.e[e]=t},Q.ni=function(e){this.e[e]=null},Q.Nk=function(){return this.c},Q.Ok=function(){throw E(new Br)},Q.Pk=function(){throw E(new Br)},Q.Qk=function(){return this.d},Q.Rk=function(){return this.e!=null},Q.Sk=function(e){this.c=e},Q.Tk=function(e){throw E(new Br)},Q.Uk=function(e){throw E(new Br)},Q.Vk=function(e){this.d=e};var QVt;L(KH,`BasicEObjectImpl/EPropertiesHolderBaseImpl`,2081),q(192,2081,{114:1},fn),Q.Ok=function(){return this.a},Q.Pk=function(){return this.b},Q.Tk=function(e){this.a=e},Q.Uk=function(e){this.b=e},L(KH,`BasicEObjectImpl/EPropertiesHolderImpl`,192),q(516,99,nCt,sn),Q.uh=function(){return this.f},Q.zh=function(){return this.k},Q.Bh=function(e,t){this.g=e,this.i=t},Q.Dh=function(){return this.j&2?this.$h().Nk():this.ii()},Q.Fh=function(){return this.i},Q.wh=function(){return!!(this.j&1)},Q.Ph=function(){return this.g},Q.Vh=function(){return!!(this.j&4)},Q.$h=function(){return!this.k&&(this.k=new fn),this.k},Q.ci=function(e){this.$h().Sk(e),e?this.j|=2:this.j&=-3},Q.ei=function(e){this.$h().Uk(e),e?this.j|=4:this.j&=-5},Q.ii=function(){return(vh(),z7).S},Q.i=0,Q.j=1,L(KH,`EObjectImpl`,516),q(798,516,{110:1,94:1,93:1,58:1,114:1,54:1,99:1},eMe),Q.li=function(e){return this.e[e]},Q.mi=function(e,t){this.e[e]=t},Q.ni=function(e){this.e[e]=null},Q.Dh=function(){return this.d},Q.Ih=function(e){return eD(this.d,e)},Q.Kh=function(){return this.d},Q.Oh=function(){return this.e!=null},Q.$h=function(){return!this.k&&(this.k=new Bse),this.k},Q.ci=function(e){this.d=e},Q.hi=function(){var e;return this.e??=(e=bh(this.d),e==0?$Vt:V(WW,FP,1,e,5,1)),this},Q.ji=function(){return 0};var $Vt;L(KH,`DynamicEObjectImpl`,798),q(1522,798,{110:1,44:1,94:1,93:1,136:1,58:1,114:1,54:1,99:1},OMe),Q.Fb=function(e){return this===e},Q.Hb=function(){return td(this)},Q.ci=function(e){this.d=e,this.b=Qj(e,`key`),this.c=Qj(e,tU)},Q.Bi=function(){var e;return this.a==-1&&(e=Kb(this,this.b),this.a=e==null?0:US(e)),this.a},Q.ld=function(){return Kb(this,this.b)},Q.md=function(){return Kb(this,this.c)},Q.Ci=function(e){this.a=e},Q.Di=function(e){rRe(this,this.b,e)},Q.nd=function(e){var t=Kb(this,this.c);return rRe(this,this.c,e),t},Q.a=0,L(KH,`DynamicEObjectImpl/BasicEMapEntry`,1522),q(1523,1,{114:1},Bse),Q.Mk=function(e){throw E(new Br)},Q.li=function(e){throw E(new Br)},Q.mi=function(e,t){throw E(new Br)},Q.ni=function(e){throw E(new Br)},Q.Nk=function(){throw E(new Br)},Q.Ok=function(){return this.a},Q.Pk=function(){return this.b},Q.Qk=function(){return this.c},Q.Rk=function(){throw E(new Br)},Q.Sk=function(e){throw E(new Br)},Q.Tk=function(e){this.a=e},Q.Uk=function(e){this.b=e},Q.Vk=function(e){this.c=e},L(KH,`DynamicEObjectImpl/DynamicEPropertiesHolderImpl`,1523),q(519,158,{110:1,94:1,93:1,598:1,155:1,58:1,114:1,54:1,99:1,519:1,158:1,119:1,120:1},Vse),Q.Ah=function(e){return T6e(this,e)},Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.d;case 2:return n?(!this.b&&(this.b=new Td((CP(),$7),o9,this)),this.b):(!this.b&&(this.b=new Td((CP(),$7),o9,this)),Jy(this.b));case 3:return hRe(this);case 4:return!this.a&&(this.a=new ju(L5,this,4)),this.a;case 5:return!this.c&&(this.c=new Pu(L5,this,5)),this.c}return xb(this,e-bh((CP(),B7)),_x((r=P(NC(this,16),29),r||B7),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 3:return this.Cb&&(n=(i=this.Db>>16,i>=0?T6e(this,n):this.Cb.Th(this,-1-i,null,n))),MNe(this,P(e,155),n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),B7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),B7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 2:return!this.b&&(this.b=new Td((CP(),$7),o9,this)),gf(this.b,e,n);case 3:return MNe(this,null,n);case 4:return!this.a&&(this.a=new ju(L5,this,4)),AO(this.a,e,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),B7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),B7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.d!=null;case 2:return!!this.b&&this.b.f!=0;case 3:return!!hRe(this);case 4:return!!this.a&&this.a.i!=0;case 5:return!!this.c&&this.c.i!=0}return Hv(this,e-bh((CP(),B7)),_x((t=P(NC(this,16),29),t||B7),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:PMe(this,kd(t));return;case 2:!this.b&&(this.b=new Td((CP(),$7),o9,this)),bC(this.b,t);return;case 3:Aot(this,P(t,155));return;case 4:!this.a&&(this.a=new ju(L5,this,4)),RN(this.a),!this.a&&(this.a=new ju(L5,this,4)),th(this.a,P(t,16));return;case 5:!this.c&&(this.c=new Pu(L5,this,5)),RN(this.c),!this.c&&(this.c=new Pu(L5,this,5)),th(this.c,P(t,16));return}LE(this,e-bh((CP(),B7)),_x((n=P(NC(this,16),29),n||B7),e),t)},Q.ii=function(){return CP(),B7},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:FJe(this,null);return;case 2:!this.b&&(this.b=new Td((CP(),$7),o9,this)),this.b.c.$b();return;case 3:Aot(this,null);return;case 4:!this.a&&(this.a=new ju(L5,this,4)),RN(this.a);return;case 5:!this.c&&(this.c=new Pu(L5,this,5)),RN(this.c);return}PT(this,e-bh((CP(),B7)),_x((t=P(NC(this,16),29),t||B7),e))},Q.Ib=function(){return L$e(this)},Q.d=null,L(KH,`EAnnotationImpl`,519),q(141,721,bwt,lb),Q.Gi=function(e,t){awe(this,e,P(t,44))},Q.Wk=function(e,t){return KOe(this,P(e,44),t)},Q.$i=function(e){return P(P(this.c,71).$i(e),136)},Q.Ii=function(){return P(this.c,71).Ii()},Q.Ji=function(){return P(this.c,71).Ji()},Q.Ki=function(e){return P(this.c,71).Ki(e)},Q.Xk=function(e,t){return gf(this,e,t)},Q.Fk=function(e){return P(this.c,79).Fk(e)},Q.ak=function(){},Q.Qj=function(){return P(this.c,79).Qj()},Q.ck=function(e,t,n){var r=P(Mx(this.b).wi().si(this.b),136);return r.Ci(e),r.Di(t),r.nd(n),r},Q.dk=function(){return new Yhe(this)},Q.Wb=function(e){bC(this,e)},Q.Gk=function(){P(this.c,79).Gk()},L(IU,`EcoreEMap`,141),q(165,141,bwt,Td),Q._j=function(){var e,t,n,r,i,a;if(this.d==null){for(a=V(SVt,awt,66,2*this.f+1,0,1),n=this.c.Kc();n.e!=n.i.gc();)t=P(n.Yj(),136),r=t.Bi(),i=(r&AP)%a.length,e=a[i],!e&&(e=a[i]=new Yhe(this)),e.Fc(t);this.d=a}},L(KH,`EAnnotationImpl/1`,165),q(292,448,{110:1,94:1,93:1,155:1,197:1,58:1,114:1,481:1,54:1,99:1,158:1,292:1,119:1,120:1}),Q.Lh=function(e,t,n){var r,i;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return rd(),!!(this.Bb&256);case 3:return rd(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return rd(),!!this.Jk();case 7:return rd(),i=this.s,i>=1;case 8:return t?Ik(this):this.r;case 9:return this.q}return xb(this,e-bh(this.ii()),_x((r=P(NC(this,16),29),r||this.ii()),e),t,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 9:return nh(this,n)}return i=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),i.wk().Ak(this,WD(this),t-bh(this.ii()),e,n)},Q.Wh=function(e){var t,n;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return this.Jk();case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&kh(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&kh(this.q).i==0)}return Hv(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.bi=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:this.ui(kd(t));return;case 2:FT(this,ki(Od(t)));return;case 3:RT(this,ki(Od(t)));return;case 4:Zx(this,P(t,17).a);return;case 5:this.Zk(P(t,17).a);return;case 8:aT(this,P(t,142));return;case 9:r=fA(this,P(t,89),null),r&&r.oj();return}LE(this,e-bh(this.ii()),_x((n=P(NC(this,16),29),n||this.ii()),e),t)},Q.ii=function(){return CP(),ZVt},Q.ki=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:this.ui(null);return;case 2:FT(this,!0);return;case 3:RT(this,!0);return;case 4:Zx(this,0);return;case 5:this.Zk(1);return;case 8:aT(this,null);return;case 9:n=fA(this,null,null),n&&n.oj();return}PT(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.pi=function(){Ik(this),this.Bb|=1},Q.Hk=function(){return Ik(this)},Q.Ik=function(){return this.t},Q.Jk=function(){var e;return e=this.t,e>1||e==-1},Q.Si=function(){return!!(this.Bb&512)},Q.Yk=function(e,t){return kT(this,e,t)},Q.Zk=function(e){Qx(this,e)},Q.Ib=function(){return Srt(this)},Q.s=0,Q.t=1,L(KH,`ETypedElementImpl`,292),q(462,292,{110:1,94:1,93:1,155:1,197:1,58:1,179:1,69:1,114:1,481:1,54:1,99:1,158:1,462:1,292:1,119:1,120:1,692:1}),Q.Ah=function(e){return X3e(this,e)},Q.Lh=function(e,t,n){var r,i;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return rd(),!!(this.Bb&256);case 3:return rd(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return rd(),!!this.Jk();case 7:return rd(),i=this.s,i>=1;case 8:return t?Ik(this):this.r;case 9:return this.q;case 10:return rd(),(this.Bb&pF)!=0;case 11:return rd(),(this.Bb&zU)!=0;case 12:return rd(),(this.Bb&uI)!=0;case 13:return this.j;case 14:return Uj(this);case 15:return rd(),(this.Bb&RU)!=0;case 16:return rd(),(this.Bb&ZP)!=0;case 17:return L_(this)}return xb(this,e-bh(this.ii()),_x((r=P(NC(this,16),29),r||this.ii()),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 17:return this.Cb&&(n=(i=this.Db>>16,i>=0?X3e(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,17,n)}return a=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),a.wk().zk(this,WD(this),t-bh(this.ii()),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 9:return nh(this,n);case 17:return qM(this,null,17,n)}return i=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),i.wk().Ak(this,WD(this),t-bh(this.ii()),e,n)},Q.Wh=function(e){var t,n;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return this.Jk();case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&kh(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&kh(this.q).i==0);case 10:return(this.Bb&pF)==0;case 11:return(this.Bb&zU)!=0;case 12:return(this.Bb&uI)!=0;case 13:return this.j!=null;case 14:return Uj(this)!=null;case 15:return(this.Bb&RU)!=0;case 16:return(this.Bb&ZP)!=0;case 17:return!!L_(this)}return Hv(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.bi=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:X_(this,kd(t));return;case 2:FT(this,ki(Od(t)));return;case 3:RT(this,ki(Od(t)));return;case 4:Zx(this,P(t,17).a);return;case 5:this.Zk(P(t,17).a);return;case 8:aT(this,P(t,142));return;case 9:r=fA(this,P(t,89),null),r&&r.oj();return;case 10:eE(this,ki(Od(t)));return;case 11:rE(this,ki(Od(t)));return;case 12:tE(this,ki(Od(t)));return;case 13:Xc(this,kd(t));return;case 15:nE(this,ki(Od(t)));return;case 16:gE(this,ki(Od(t)));return}LE(this,e-bh(this.ii()),_x((n=P(NC(this,16),29),n||this.ii()),e),t)},Q.ii=function(){return CP(),XVt},Q.ki=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:j(this.Cb,90)&&$A(_y(P(this.Cb,90)),4),GS(this,null);return;case 2:FT(this,!0);return;case 3:RT(this,!0);return;case 4:Zx(this,0);return;case 5:this.Zk(1);return;case 8:aT(this,null);return;case 9:n=fA(this,null,null),n&&n.oj();return;case 10:eE(this,!0);return;case 11:rE(this,!1);return;case 12:tE(this,!1);return;case 13:this.i=null,OS(this,null);return;case 15:nE(this,!1);return;case 16:gE(this,!1);return}PT(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.pi=function(){lg(Rb((UA(),l9),this)),Ik(this),this.Bb|=1},Q.pk=function(){return this.f},Q.ik=function(){return Uj(this)},Q.qk=function(){return L_(this)},Q.uk=function(){return null},Q.$k=function(){return this.k},Q.Lj=function(){return this.n},Q.vk=function(){return $k(this)},Q.wk=function(){var e,t,n,r,i,a,o,s,c;return this.p||(n=L_(this),(n.i??aN(n),n.i).length,r=this.uk(),r&&bh(L_(r)),i=Ik(this),o=i.kk(),e=o?o.i&1?o==J9?bG:o==q9?DG:o==Q9?EG:o==Z9?TG:o==Y9?kG:o==$9?PG:o==X9?xG:CG:o:null,t=Uj(this),s=i.ik(),E1e(this),(this.Bb&ZP)!=0&&((a=C8e((UA(),l9),n))&&a!=this||(a=mv(Rb(l9,this))))?this.p=new XSe(this,a):this.Jk()?this.al()?this.p=r?(this.Bb&RU)==0?e?this.bl()?new Og(49,e,this,r):new Og(7,e,this,r):this.bl()?new ty(48,this,r):new ty(6,this,r):e?this.bl()?new Og(47,e,this,r):new Og(5,e,this,r):this.bl()?new ty(46,this,r):new ty(4,this,r):(this.Bb&RU)==0?e?e==YW?new Wf(41,yVt,this):this.bl()?new Wf(45,e,this):new Wf(3,e,this):this.bl()?new a_(44,this):new a_(2,this):e?e==YW?new Wf(50,yVt,this):this.bl()?new Wf(43,e,this):new Wf(1,e,this):this.bl()?new a_(42,this):new a_(0,this):j(i,156)?this.p=e==t9?new a_(40,this):this.Bb&512?(this.Bb&RU)==0?e?new Wf(11,e,this):new a_(10,this):e?new Wf(9,e,this):new a_(8,this):(this.Bb&RU)==0?e?new Wf(15,e,this):new a_(14,this):e?new Wf(13,e,this):new a_(12,this):r?(c=r.t,this.p=c>1||c==-1?this.bl()?(this.Bb&RU)==0?e?new Og(27,e,this,r):new ty(26,this,r):e?new Og(25,e,this,r):new ty(24,this,r):(this.Bb&RU)==0?e?new Og(31,e,this,r):new ty(30,this,r):e?new Og(29,e,this,r):new ty(28,this,r):this.bl()?(this.Bb&RU)==0?e?new Og(35,e,this,r):new ty(34,this,r):e?new Og(33,e,this,r):new ty(32,this,r):(this.Bb&RU)==0?e?new Og(39,e,this,r):new ty(38,this,r):e?new Og(37,e,this,r):new ty(36,this,r)):this.p=this.bl()?(this.Bb&RU)==0?e?new Wf(19,e,this):new a_(18,this):e?new Wf(17,e,this):new a_(16,this):(this.Bb&RU)==0?e?new Wf(23,e,this):new a_(22,this):e?new Wf(21,e,this):new a_(20,this):this.p=this._k()?this.bl()?new fje(P(i,29),this,r):new ILe(P(i,29),this,r):j(i,156)?e==t9?new a_(40,this):(this.Bb&RU)==0?e?new kNe(t,s,this,(mD(),o==q9?lHt:o==J9?iHt:o==Y9?uHt:o==Q9?cHt:o==Z9?sHt:o==$9?dHt:o==X9?aHt:o==K9?oHt:c9)):new gIe(P(i,156),t,s,this):e?new ANe(t,s,this,(mD(),o==q9?lHt:o==J9?iHt:o==Y9?uHt:o==Q9?cHt:o==Z9?sHt:o==$9?dHt:o==X9?aHt:o==K9?oHt:c9)):new _Ie(P(i,156),t,s,this):this.al()?r?(this.Bb&RU)==0?this.bl()?new hje(P(i,29),this,r):new Gf(P(i,29),this,r):this.bl()?new _je(P(i,29),this,r):new gje(P(i,29),this,r):(this.Bb&RU)==0?this.bl()?new JEe(P(i,29),this):new Ed(P(i,29),this):this.bl()?new ZEe(P(i,29),this):new YEe(P(i,29),this):this.bl()?r?(this.Bb&RU)==0?new pje(P(i,29),this,r):new vje(P(i,29),this,r):(this.Bb&RU)==0?new XEe(P(i,29),this):new QEe(P(i,29),this):r?(this.Bb&RU)==0?new mje(P(i,29),this,r):new yje(P(i,29),this,r):(this.Bb&RU)==0?new Bp(P(i,29),this):new $Ee(P(i,29),this)),this.p},Q.rk=function(){return(this.Bb&pF)!=0},Q._k=function(){return!1},Q.al=function(){return!1},Q.sk=function(){return(this.Bb&ZP)!=0},Q.xk=function(){return ex(this)},Q.bl=function(){return!1},Q.tk=function(){return(this.Bb&RU)!=0},Q.cl=function(e){this.k=e},Q.ui=function(e){X_(this,e)},Q.Ib=function(){return SM(this)},Q.e=!1,Q.n=0,L(KH,`EStructuralFeatureImpl`,462),q(331,462,{110:1,94:1,93:1,35:1,155:1,197:1,58:1,179:1,69:1,114:1,481:1,54:1,99:1,331:1,158:1,462:1,292:1,119:1,120:1,692:1},oi),Q.Lh=function(e,t,n){var r,i;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return rd(),!!(this.Bb&256);case 3:return rd(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return rd(),!!Dnt(this);case 7:return rd(),i=this.s,i>=1;case 8:return t?Ik(this):this.r;case 9:return this.q;case 10:return rd(),(this.Bb&pF)!=0;case 11:return rd(),(this.Bb&zU)!=0;case 12:return rd(),(this.Bb&uI)!=0;case 13:return this.j;case 14:return Uj(this);case 15:return rd(),(this.Bb&RU)!=0;case 16:return rd(),(this.Bb&ZP)!=0;case 17:return L_(this);case 18:return rd(),(this.Bb&GH)!=0;case 19:return t?QC(this):tWe(this)}return xb(this,e-bh((CP(),V7)),_x((r=P(NC(this,16),29),r||V7),e),t,n)},Q.Wh=function(e){var t,n;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return Dnt(this);case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&kh(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&kh(this.q).i==0);case 10:return(this.Bb&pF)==0;case 11:return(this.Bb&zU)!=0;case 12:return(this.Bb&uI)!=0;case 13:return this.j!=null;case 14:return Uj(this)!=null;case 15:return(this.Bb&RU)!=0;case 16:return(this.Bb&ZP)!=0;case 17:return!!L_(this);case 18:return(this.Bb&GH)!=0;case 19:return!!tWe(this)}return Hv(this,e-bh((CP(),V7)),_x((t=P(NC(this,16),29),t||V7),e))},Q.bi=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:X_(this,kd(t));return;case 2:FT(this,ki(Od(t)));return;case 3:RT(this,ki(Od(t)));return;case 4:Zx(this,P(t,17).a);return;case 5:Zve(this,P(t,17).a);return;case 8:aT(this,P(t,142));return;case 9:r=fA(this,P(t,89),null),r&&r.oj();return;case 10:eE(this,ki(Od(t)));return;case 11:rE(this,ki(Od(t)));return;case 12:tE(this,ki(Od(t)));return;case 13:Xc(this,kd(t));return;case 15:nE(this,ki(Od(t)));return;case 16:gE(this,ki(Od(t)));return;case 18:mE(this,ki(Od(t)));return}LE(this,e-bh((CP(),V7)),_x((n=P(NC(this,16),29),n||V7),e),t)},Q.ii=function(){return CP(),V7},Q.ki=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:j(this.Cb,90)&&$A(_y(P(this.Cb,90)),4),GS(this,null);return;case 2:FT(this,!0);return;case 3:RT(this,!0);return;case 4:Zx(this,0);return;case 5:this.b=0,Qx(this,1);return;case 8:aT(this,null);return;case 9:n=fA(this,null,null),n&&n.oj();return;case 10:eE(this,!0);return;case 11:rE(this,!1);return;case 12:tE(this,!1);return;case 13:this.i=null,OS(this,null);return;case 15:nE(this,!1);return;case 16:gE(this,!1);return;case 18:mE(this,!1);return}PT(this,e-bh((CP(),V7)),_x((t=P(NC(this,16),29),t||V7),e))},Q.pi=function(){QC(this),lg(Rb((UA(),l9),this)),Ik(this),this.Bb|=1},Q.Jk=function(){return Dnt(this)},Q.Yk=function(e,t){return this.b=0,this.a=null,kT(this,e,t)},Q.Zk=function(e){Zve(this,e)},Q.Ib=function(){var e;return this.Db&64?SM(this):(e=new Wu(SM(this)),e.a+=` (iD: `,Ga(e,(this.Bb&GH)!=0),e.a+=`)`,e.a)},Q.b=0,L(KH,`EAttributeImpl`,331),q(364,448,{110:1,94:1,93:1,142:1,155:1,197:1,58:1,114:1,54:1,99:1,364:1,158:1,119:1,120:1,691:1}),Q.dl=function(e){return e.Dh()==this},Q.Ah=function(e){return bk(this,e)},Q.Bh=function(e,t){this.w=null,this.Db=t<<16|this.Db&255,this.Cb=e},Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D==null?this.B:this.D;case 3:return _k(this);case 4:return this.ik();case 5:return this.F;case 6:return t?Mx(this):F_(this);case 7:return!this.A&&(this.A=new Nu(I7,this,7)),this.A}return xb(this,e-bh(this.ii()),_x((r=P(NC(this,16),29),r||this.ii()),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 6:return this.Cb&&(n=(i=this.Db>>16,i>=0?bk(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,6,n)}return a=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),a.wk().zk(this,WD(this),t-bh(this.ii()),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 6:return qM(this,null,6,n);case 7:return!this.A&&(this.A=new Nu(I7,this,7)),AO(this.A,e,n)}return i=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),i.wk().Ak(this,WD(this),t-bh(this.ii()),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!_k(this);case 4:return this.ik()!=null;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!F_(this);case 7:return!!this.A&&this.A.i!=0}return Hv(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:Y_(this,kd(t));return;case 2:Xl(this,kd(t));return;case 5:qN(this,kd(t));return;case 7:!this.A&&(this.A=new Nu(I7,this,7)),RN(this.A),!this.A&&(this.A=new Nu(I7,this,7)),th(this.A,P(t,16));return}LE(this,e-bh(this.ii()),_x((n=P(NC(this,16),29),n||this.ii()),e),t)},Q.ii=function(){return CP(),WVt},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:j(this.Cb,184)&&(P(this.Cb,184).tb=null),GS(this,null);return;case 2:Gw(this,null),eS(this,this.D);return;case 5:qN(this,null);return;case 7:!this.A&&(this.A=new Nu(I7,this,7)),RN(this.A);return}PT(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.hk=function(){var e;return this.G==-1&&(this.G=(e=Mx(this),e?NO(e.vi(),this):-1)),this.G},Q.ik=function(){return null},Q.jk=function(){return Mx(this)},Q.el=function(){return this.v},Q.kk=function(){return _k(this)},Q.lk=function(){return this.D==null?this.B:this.D},Q.mk=function(){return this.F},Q.fk=function(e){return QM(this,e)},Q.fl=function(e){this.v=e},Q.gl=function(e){fYe(this,e)},Q.hl=function(e){this.C=e},Q.ui=function(e){Y_(this,e)},Q.Ib=function(){return sD(this)},Q.C=null,Q.D=null,Q.G=-1,L(KH,`EClassifierImpl`,364),q(90,364,{110:1,94:1,93:1,29:1,142:1,155:1,197:1,58:1,114:1,54:1,99:1,90:1,364:1,158:1,482:1,119:1,120:1,691:1},Que),Q.dl=function(e){return pOe(this,e.Dh())},Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D==null?this.B:this.D;case 3:return _k(this);case 4:return null;case 5:return this.F;case 6:return t?Mx(this):F_(this);case 7:return!this.A&&(this.A=new Nu(I7,this,7)),this.A;case 8:return rd(),!!(this.Bb&256);case 9:return rd(),!!(this.Bb&512);case 10:return l_(this);case 11:return!this.q&&(this.q=new F(M7,this,11,10)),this.q;case 12:return bN(this);case 13:return gN(this);case 14:return gN(this),this.r;case 15:return bN(this),this.k;case 16:return Qet(this);case 17:return fN(this);case 18:return aN(this);case 19:return zj(this);case 20:return bN(this),this.o;case 21:return!this.s&&(this.s=new F(w7,this,21,17)),this.s;case 22:return Jv(this);case 23:return _M(this)}return xb(this,e-bh((CP(),H7)),_x((r=P(NC(this,16),29),r||H7),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 6:return this.Cb&&(n=(i=this.Db>>16,i>=0?bk(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,6,n);case 11:return!this.q&&(this.q=new F(M7,this,11,10)),vD(this.q,e,n);case 21:return!this.s&&(this.s=new F(w7,this,21,17)),vD(this.s,e,n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),H7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),H7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 6:return qM(this,null,6,n);case 7:return!this.A&&(this.A=new Nu(I7,this,7)),AO(this.A,e,n);case 11:return!this.q&&(this.q=new F(M7,this,11,10)),AO(this.q,e,n);case 21:return!this.s&&(this.s=new F(w7,this,21,17)),AO(this.s,e,n);case 22:return AO(Jv(this),e,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),H7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),H7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!_k(this);case 4:return!1;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!F_(this);case 7:return!!this.A&&this.A.i!=0;case 8:return!!(this.Bb&256);case 9:return!!(this.Bb&512);case 10:return!!this.u&&Jv(this.u.a).i!=0&&!(this.n&&QO(this.n));case 11:return!!this.q&&this.q.i!=0;case 12:return bN(this).i!=0;case 13:return gN(this).i!=0;case 14:return gN(this),this.r.i!=0;case 15:return bN(this),this.k.i!=0;case 16:return Qet(this).i!=0;case 17:return fN(this).i!=0;case 18:return aN(this).i!=0;case 19:return zj(this).i!=0;case 20:return bN(this),!!this.o;case 21:return!!this.s&&this.s.i!=0;case 22:return!!this.n&&QO(this.n);case 23:return _M(this).i!=0}return Hv(this,e-bh((CP(),H7)),_x((t=P(NC(this,16),29),t||H7),e))},Q.Zh=function(e){return(this.i==null||this.q&&this.q.i!=0?null:Qj(this,e))||rP(this,e)},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:Y_(this,kd(t));return;case 2:Xl(this,kd(t));return;case 5:qN(this,kd(t));return;case 7:!this.A&&(this.A=new Nu(I7,this,7)),RN(this.A),!this.A&&(this.A=new Nu(I7,this,7)),th(this.A,P(t,16));return;case 8:IT(this,ki(Od(t)));return;case 9:zT(this,ki(Od(t)));return;case 10:zN(l_(this)),th(l_(this),P(t,16));return;case 11:!this.q&&(this.q=new F(M7,this,11,10)),RN(this.q),!this.q&&(this.q=new F(M7,this,11,10)),th(this.q,P(t,16));return;case 21:!this.s&&(this.s=new F(w7,this,21,17)),RN(this.s),!this.s&&(this.s=new F(w7,this,21,17)),th(this.s,P(t,16));return;case 22:RN(Jv(this)),th(Jv(this),P(t,16));return}LE(this,e-bh((CP(),H7)),_x((n=P(NC(this,16),29),n||H7),e),t)},Q.ii=function(){return CP(),H7},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:j(this.Cb,184)&&(P(this.Cb,184).tb=null),GS(this,null);return;case 2:Gw(this,null),eS(this,this.D);return;case 5:qN(this,null);return;case 7:!this.A&&(this.A=new Nu(I7,this,7)),RN(this.A);return;case 8:IT(this,!1);return;case 9:zT(this,!1);return;case 10:this.u&&zN(this.u);return;case 11:!this.q&&(this.q=new F(M7,this,11,10)),RN(this.q);return;case 21:!this.s&&(this.s=new F(w7,this,21,17)),RN(this.s);return;case 22:this.n&&RN(this.n);return}PT(this,e-bh((CP(),H7)),_x((t=P(NC(this,16),29),t||H7),e))},Q.pi=function(){var e,t;if(bN(this),gN(this),Qet(this),fN(this),aN(this),zj(this),_M(this),Ey(Eje(_y(this))),this.s)for(e=0,t=this.s.i;e=0;--t)H(this,t);return oD(this,e)},Q.Gk=function(){RN(this)},Q.Zi=function(e,t){return Hqe(this,e,t)},L(IU,`EcoreEList`,632),q(505,632,JU,rp),Q.Li=function(){return!1},Q.Lj=function(){return this.c},Q.Mj=function(){return!1},Q.ol=function(){return!0},Q.Si=function(){return!0},Q.Wi=function(e,t){return t},Q.Yi=function(){return!1},Q.c=0,L(IU,`EObjectEList`,505),q(83,505,JU,ju),Q.Mj=function(){return!0},Q.ml=function(){return!1},Q.al=function(){return!0},L(IU,`EObjectContainmentEList`,83),q(555,83,JU,Mu),Q.Ni=function(){this.b=!0},Q.Qj=function(){return this.b},Q.Gk=function(){var e;RN(this),Gl(this.e)?(e=this.b,this.b=!1,AC(this.e,new vy(this.e,2,this.c,e,!1))):this.b=!1},Q.b=!1,L(IU,`EObjectContainmentEList/Unsettable`,555),q(1161,555,JU,DNe),Q.Ti=function(e,t){var n,r;return n=P(QT(this,e,t),89),Gl(this.e)&&Kr(this,new db(this.a,7,(CP(),GVt),G(t),(r=n.c,j(r,90)?P(r,29):J7),e)),n},Q.Uj=function(e,t){return C0e(this,P(e,89),t)},Q.Vj=function(e,t){return S0e(this,P(e,89),t)},Q.Wj=function(e,t,n){return L8e(this,P(e,89),P(t,89),n)},Q.Ij=function(e,t,n,r,i){switch(e){case 3:return V_(this,e,t,n,r,this.i>1);case 5:return V_(this,e,t,n,r,this.i-P(n,15).gc()>0);default:return new Hb(this.e,e,this.c,t,n,r,!0)}},Q.Tj=function(){return!0},Q.Qj=function(){return QO(this)},Q.Gk=function(){RN(this)},L(KH,`EClassImpl/1`,1161),q(1175,1174,nwt),Q.dj=function(e){var t,n=e.gj(),r,i,a,o,s;if(n!=8){if(r=N2e(e),r==0)switch(n){case 1:case 9:s=e.kj(),s!=null&&(t=_y(P(s,482)),!t.c&&(t.c=new ln),nx(t.c,e.jj())),o=e.ij(),o!=null&&(i=P(o,482),i.Bb&1||(t=_y(i),!t.c&&(t.c=new ln),tb(t.c,P(e.jj(),29))));break;case 3:o=e.ij(),o!=null&&(i=P(o,482),i.Bb&1||(t=_y(i),!t.c&&(t.c=new ln),tb(t.c,P(e.jj(),29))));break;case 5:if(o=e.ij(),o!=null)for(a=P(o,16).Kc();a.Ob();)i=P(a.Pb(),482),i.Bb&1||(t=_y(i),!t.c&&(t.c=new ln),tb(t.c,P(e.jj(),29)));break;case 4:s=e.kj(),s!=null&&(i=P(s,482),i.Bb&1||(t=_y(i),!t.c&&(t.c=new ln),nx(t.c,e.jj())));break;case 6:if(s=e.kj(),s!=null)for(a=P(s,16).Kc();a.Ob();)i=P(a.Pb(),482),i.Bb&1||(t=_y(i),!t.c&&(t.c=new ln),nx(t.c,e.jj()))}this.ql(r)}},Q.ql=function(e){Zct(this,e)},Q.b=63,L(KH,`ESuperAdapter`,1175),q(1176,1175,nwt,Bhe),Q.ql=function(e){$A(this,e)},L(KH,`EClassImpl/10`,1176),q(1165,710,JU),Q.Ei=function(e,t){return dA(this,e,t)},Q.Fi=function(e){return X4e(this,e)},Q.Gi=function(e,t){jT(this,e,t)},Q.Hi=function(e){Ty(this,e)},Q.$i=function(e){return SGe(this,e)},Q.Xi=function(e,t){return tx(this,e,t)},Q.Wk=function(e,t){throw E(new Br)},Q.Ii=function(){return new ld(this)},Q.Ji=function(){return new ud(this)},Q.Ki=function(e){return mS(this,e)},Q.Xk=function(e,t){throw E(new Br)},Q.Fk=function(e){return this},Q.Qj=function(){return this.i!=0},Q.Wb=function(e){throw E(new Br)},Q.Gk=function(){throw E(new Br)},L(IU,`EcoreEList/UnmodifiableEList`,1165),q(328,1165,JU,El),Q.Yi=function(){return!1},L(IU,`EcoreEList/UnmodifiableEList/FastCompare`,328),q(1168,328,JU,bZe),Q.dd=function(e){var t,n,r;if(j(e,179)&&(t=P(e,179),n=t.Lj(),n!=-1)){for(r=this.i;n4)if(this.fk(e)){if(this.al()){if(r=P(e,54),n=r.Eh(),s=n==this.b&&(this.ml()?r.yh(r.Fh(),P(_x(d_(this.b),this.Lj()).Hk(),29).kk())==qO(P(_x(d_(this.b),this.Lj()),19)).n:-1-r.Fh()==this.Lj()),this.nl()&&!s&&!n&&r.Jh()){for(i=0;i1||r==-1)):!1},Q.ml=function(){var e,t=_x(d_(this.b),this.Lj()),n;return j(t,102)?(e=P(t,19),n=qO(e),!!n):!1},Q.nl=function(){var e,t=_x(d_(this.b),this.Lj());return j(t,102)?(e=P(t,19),(e.Bb&pI)!=0):!1},Q.dd=function(e){var t,n,r=this.zj(e),i;if(r>=0)return r;if(this.ol()){for(n=0,i=this.Ej();n=0;--e)GN(this,e,this.xj(e));return this.Fj()},Q.Qc=function(e){var t;if(this.nl())for(t=this.Ej()-1;t>=0;--t)GN(this,t,this.xj(t));return this.Gj(e)},Q.Gk=function(){zN(this)},Q.Zi=function(e,t){return CGe(this,e,t)},L(IU,`DelegatingEcoreEList`,756),q(1171,756,Ewt,FDe),Q.qj=function(e,t){BEe(this,e,P(t,29))},Q.rj=function(e){twe(this,P(e,29))},Q.xj=function(e){var t,n;return t=P(H(Jv(this.a),e),89),n=t.c,j(n,90)?P(n,29):(CP(),J7)},Q.Cj=function(e){var t,n;return t=P(lM(Jv(this.a),e),89),n=t.c,j(n,90)?P(n,29):(CP(),J7)},Q.Dj=function(e,t){return Q4e(this,e,P(t,29))},Q.Li=function(){return!1},Q.Ij=function(e,t,n,r,i){return null},Q.sj=function(){return new Uhe(this)},Q.tj=function(){RN(Jv(this.a))},Q.uj=function(e){return H$e(this,e)},Q.vj=function(e){var t,n;for(n=e.Kc();n.Ob();)if(t=n.Pb(),!H$e(this,t))return!1;return!0},Q.wj=function(e){var t,n,r;if(j(e,15)&&(r=P(e,15),r.gc()==Jv(this.a).i)){for(t=r.Kc(),n=new Lu(this);t.Ob();)if(A(t.Pb())!==A(gO(n)))return!1;return!0}return!1},Q.yj=function(){var e,t,n=1,r,i;for(t=new Lu(Jv(this.a));t.e!=t.i.gc();)e=P(gO(t),89),r=(i=e.c,j(i,90)?P(i,29):(CP(),J7)),n=31*n+(r?td(r):0);return n},Q.zj=function(e){var t,n,r=0,i;for(n=new Lu(Jv(this.a));n.e!=n.i.gc();){if(t=P(gO(n),89),A(e)===A((i=t.c,j(i,90)?P(i,29):(CP(),J7))))return r;++r}return-1},Q.Aj=function(){return Jv(this.a).i==0},Q.Bj=function(){return null},Q.Ej=function(){return Jv(this.a).i},Q.Fj=function(){var e,t,n,r,i,a=Jv(this.a).i;for(i=V(WW,FP,1,a,5,1),n=0,t=new Lu(Jv(this.a));t.e!=t.i.gc();)e=P(gO(t),89),i[n++]=(r=e.c,j(r,90)?P(r,29):(CP(),J7));return i},Q.Gj=function(e){var t,n,r,i,a,o,s=Jv(this.a).i;for(e.lengths&&Sh(e,s,null),r=0,n=new Lu(Jv(this.a));n.e!=n.i.gc();)t=P(gO(n),89),a=(o=t.c,j(o,90)?P(o,29):(CP(),J7)),Sh(e,r++,a);return e},Q.Hj=function(){var e,t,n,r,i=new $i;for(i.a+=`[`,e=Jv(this.a),t=0,r=Jv(this.a).i;t>16,i>=0?bk(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,6,n);case 9:return!this.a&&(this.a=new F(A7,this,9,5)),vD(this.a,e,n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),U7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),U7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 6:return qM(this,null,6,n);case 7:return!this.A&&(this.A=new Nu(I7,this,7)),AO(this.A,e,n);case 9:return!this.a&&(this.a=new F(A7,this,9,5)),AO(this.a,e,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),U7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),U7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!_k(this);case 4:return!!AQe(this);case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!F_(this);case 7:return!!this.A&&this.A.i!=0;case 8:return!(this.Bb&256);case 9:return!!this.a&&this.a.i!=0}return Hv(this,e-bh((CP(),U7)),_x((t=P(NC(this,16),29),t||U7),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:Y_(this,kd(t));return;case 2:Xl(this,kd(t));return;case 5:qN(this,kd(t));return;case 7:!this.A&&(this.A=new Nu(I7,this,7)),RN(this.A),!this.A&&(this.A=new Nu(I7,this,7)),th(this.A,P(t,16));return;case 8:LT(this,ki(Od(t)));return;case 9:!this.a&&(this.a=new F(A7,this,9,5)),RN(this.a),!this.a&&(this.a=new F(A7,this,9,5)),th(this.a,P(t,16));return}LE(this,e-bh((CP(),U7)),_x((n=P(NC(this,16),29),n||U7),e),t)},Q.ii=function(){return CP(),U7},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:j(this.Cb,184)&&(P(this.Cb,184).tb=null),GS(this,null);return;case 2:Gw(this,null),eS(this,this.D);return;case 5:qN(this,null);return;case 7:!this.A&&(this.A=new Nu(I7,this,7)),RN(this.A);return;case 8:LT(this,!0);return;case 9:!this.a&&(this.a=new F(A7,this,9,5)),RN(this.a);return}PT(this,e-bh((CP(),U7)),_x((t=P(NC(this,16),29),t||U7),e))},Q.pi=function(){var e,t;if(this.a)for(e=0,t=this.a.i;e>16==5?P(this.Cb,685):null}return xb(this,e-bh((CP(),W7)),_x((r=P(NC(this,16),29),r||W7),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 5:return this.Cb&&(n=(i=this.Db>>16,i>=0?C6e(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,5,n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),W7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),W7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 5:return qM(this,null,5,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),W7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),W7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.d!=0;case 3:return!!this.b;case 4:return this.c!=null;case 5:return!!(this.Db>>16==5&&P(this.Cb,685))}return Hv(this,e-bh((CP(),W7)),_x((t=P(NC(this,16),29),t||W7),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:GS(this,kd(t));return;case 2:$x(this,P(t,17).a);return;case 3:nrt(this,P(t,2039));return;case 4:SS(this,kd(t));return}LE(this,e-bh((CP(),W7)),_x((n=P(NC(this,16),29),n||W7),e),t)},Q.ii=function(){return CP(),W7},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:GS(this,null);return;case 2:$x(this,0);return;case 3:nrt(this,null);return;case 4:SS(this,null);return}PT(this,e-bh((CP(),W7)),_x((t=P(NC(this,16),29),t||W7),e))},Q.Ib=function(){var e;return e=this.c,e??this.zb},Q.b=null,Q.c=null,Q.d=0,L(KH,`EEnumLiteralImpl`,582);var tHt=gp(KH,`EFactoryImpl/InternalEDateTimeFormat`);q(499,1,{2114:1},br),L(KH,`EFactoryImpl/1ClientInternalEDateTimeFormat`,499),q(248,120,{110:1,94:1,93:1,89:1,58:1,114:1,54:1,99:1,248:1,119:1,120:1},kr),Q.Ch=function(e,t,n){var r;return n=qM(this,e,t,n),this.e&&j(e,179)&&(r=Rj(this,this.e),r!=this.c&&(n=JN(this,r,n))),n},Q.Lh=function(e,t,n){var r;switch(e){case 0:return this.f;case 1:return!this.d&&(this.d=new ju(j7,this,1)),this.d;case 2:return t?ZM(this):this.c;case 3:return this.b;case 4:return this.e;case 5:return t?nk(this):this.a}return xb(this,e-bh((CP(),K7)),_x((r=P(NC(this,16),29),r||K7),e),t,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return p$e(this,null,n);case 1:return!this.d&&(this.d=new ju(j7,this,1)),AO(this.d,e,n);case 3:return m$e(this,null,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),K7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),K7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.f;case 1:return!!this.d&&this.d.i!=0;case 2:return!!this.c;case 3:return!!this.b;case 4:return!!this.e;case 5:return!!this.a}return Hv(this,e-bh((CP(),K7)),_x((t=P(NC(this,16),29),t||K7),e))},Q.bi=function(e,t){var n;switch(e){case 0:d5e(this,P(t,89));return;case 1:!this.d&&(this.d=new ju(j7,this,1)),RN(this.d),!this.d&&(this.d=new ju(j7,this,1)),th(this.d,P(t,16));return;case 3:u5e(this,P(t,89));return;case 4:i9e(this,P(t,850));return;case 5:Nx(this,P(t,142));return}LE(this,e-bh((CP(),K7)),_x((n=P(NC(this,16),29),n||K7),e),t)},Q.ii=function(){return CP(),K7},Q.ki=function(e){var t;switch(e){case 0:d5e(this,null);return;case 1:!this.d&&(this.d=new ju(j7,this,1)),RN(this.d);return;case 3:u5e(this,null);return;case 4:i9e(this,null);return;case 5:Nx(this,null);return}PT(this,e-bh((CP(),K7)),_x((t=P(NC(this,16),29),t||K7),e))},Q.Ib=function(){var e=new Gu(Aj(this));return e.a+=` (expression: `,kN(this,e),e.a+=`)`,e.a};var nHt;L(KH,`EGenericTypeImpl`,248),q(2067,2062,QU),Q.Gi=function(e,t){ADe(this,e,t)},Q.Wk=function(e,t){return ADe(this,this.gc(),e),t},Q.$i=function(e){return SO(this.pj(),e)},Q.Ii=function(){return this.Ji()},Q.pj=function(){return new Jhe(this)},Q.Ji=function(){return this.Ki(0)},Q.Ki=function(e){return this.pj().fd(e)},Q.Xk=function(e,t){return QE(this,e,!0),t},Q.Ti=function(e,t){var n,r=Mk(this,t);return n=this.fd(e),n.Rb(r),r},Q.Ui=function(e,t){var n;QE(this,t,!0),n=this.fd(e),n.Rb(t)},L(IU,`AbstractSequentialInternalEList`,2067),q(496,2067,QU,ad),Q.$i=function(e){return SO(this.pj(),e)},Q.Ii=function(){return this.b==null?(Xo(),Xo(),a9):this.sl()},Q.pj=function(){return new mCe(this.a,this.b)},Q.Ji=function(){return this.b==null?(Xo(),Xo(),a9):this.sl()},Q.Ki=function(e){var t,n;if(this.b==null){if(e<0||e>1)throw E(new Mi(PU+e+`, size=0`));return Xo(),Xo(),a9}for(n=this.sl(),t=0;t0;)if(t=this.c[--this.d],(!this.e||t.pk()!=R5||t.Lj()!=0)&&(!this.vl()||this.b.Xh(t))){if(a=this.b.Nh(t,this.ul()),this.f=(Qo(),P(t,69).xk()),this.f||t.Jk()){if(this.ul()?(r=P(a,15),this.k=r):(r=P(a,71),this.k=this.j=r),j(this.k,59)?(this.o=this.k.gc(),this.n=this.o):this.p=this.j?this.j.Ki(this.k.gc()):this.k.fd(this.k.gc()),this.p?Pet(this,this.p):ytt(this))return i=this.p?this.p.Ub():this.j?this.j.$i(--this.n):this.k.Xb(--this.n),this.f?(e=P(i,76),e.Lk(),n=e.md(),this.i=n):(n=i,this.i=n),this.g=-3,!0}else if(a!=null)return this.k=null,this.p=null,n=a,this.i=n,this.g=-2,!0}return this.k=null,this.p=null,this.g=-1,!1}return i=this.p?this.p.Ub():this.j?this.j.$i(--this.n):this.k.Xb(--this.n),this.f?(e=P(i,76),e.Lk(),n=e.md(),this.i=n):(n=i,this.i=n),this.g=-3,!0}},Q.Pb=function(){return IC(this)},Q.Tb=function(){return this.a},Q.Ub=function(){var e;if(this.g<-1||this.Sb())return--this.a,this.g=0,e=this.i,this.Sb(),e;throw E(new Hr)},Q.Vb=function(){return this.a-1},Q.Qb=function(){throw E(new Br)},Q.ul=function(){return!1},Q.Wb=function(e){throw E(new Br)},Q.vl=function(){return!0},Q.a=0,Q.d=0,Q.f=!1,Q.g=0,Q.n=0,Q.o=0;var a9;L(IU,`EContentsEList/FeatureIteratorImpl`,287),q(711,287,$U,HEe),Q.ul=function(){return!0},L(IU,`EContentsEList/ResolvingFeatureIteratorImpl`,711),q(1178,711,$U,UEe),Q.vl=function(){return!1},L(KH,`ENamedElementImpl/1/1`,1178),q(1179,287,$U,WEe),Q.vl=function(){return!1},L(KH,`ENamedElementImpl/1/2`,1179),q(39,152,NU,Qv,$v,Sm,ub,Hb,vy,Gqe,nBe,Kqe,rBe,vUe,iBe,Yqe,aBe,yUe,oBe,qqe,sBe,Cm,db,Jg,Jqe,cBe,bUe,lBe),Q.Kj=function(){return eb(this)},Q.Rj=function(){var e=eb(this);return e?e.ik():null},Q.hj=function(e){return this.b==-1&&this.a&&(this.b=this.c.Hh(this.a.Lj(),this.a.pk())),this.c.yh(this.b,e)},Q.jj=function(){return this.c},Q.Sj=function(){var e=eb(this);return e?e.tk():!1},Q.b=-1,L(KH,`ENotificationImpl`,39),q(411,292,{110:1,94:1,93:1,155:1,197:1,58:1,62:1,114:1,481:1,54:1,99:1,158:1,411:1,292:1,119:1,120:1},si),Q.Ah=function(e){return I6e(this,e)},Q.Lh=function(e,t,n){var r,i,a;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return rd(),!!(this.Bb&256);case 3:return rd(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return rd(),a=this.t,a>1||a==-1;case 7:return rd(),i=this.s,i>=1;case 8:return t?Ik(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?P(this.Cb,29):null;case 11:return!this.d&&(this.d=new Nu(I7,this,11)),this.d;case 12:return!this.c&&(this.c=new F(P7,this,12,10)),this.c;case 13:return!this.a&&(this.a=new Ud(this,this)),this.a;case 14:return Ib(this)}return xb(this,e-bh((CP(),Y7)),_x((r=P(NC(this,16),29),r||Y7),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 10:return this.Cb&&(n=(i=this.Db>>16,i>=0?I6e(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,10,n);case 12:return!this.c&&(this.c=new F(P7,this,12,10)),vD(this.c,e,n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),Y7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),Y7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 9:return nh(this,n);case 10:return qM(this,null,10,n);case 11:return!this.d&&(this.d=new Nu(I7,this,11)),AO(this.d,e,n);case 12:return!this.c&&(this.c=new F(P7,this,12,10)),AO(this.c,e,n);case 14:return AO(Ib(this),e,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),Y7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),Y7)),e,n)},Q.Wh=function(e){var t,n,r;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return r=this.t,r>1||r==-1;case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&kh(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&kh(this.q).i==0);case 10:return!!(this.Db>>16==10&&P(this.Cb,29));case 11:return!!this.d&&this.d.i!=0;case 12:return!!this.c&&this.c.i!=0;case 13:return!!this.a&&Ib(this.a.a).i!=0&&!(this.b&&$O(this.b));case 14:return!!this.b&&$O(this.b)}return Hv(this,e-bh((CP(),Y7)),_x((t=P(NC(this,16),29),t||Y7),e))},Q.bi=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:GS(this,kd(t));return;case 2:FT(this,ki(Od(t)));return;case 3:RT(this,ki(Od(t)));return;case 4:Zx(this,P(t,17).a);return;case 5:Qx(this,P(t,17).a);return;case 8:aT(this,P(t,142));return;case 9:r=fA(this,P(t,89),null),r&&r.oj();return;case 11:!this.d&&(this.d=new Nu(I7,this,11)),RN(this.d),!this.d&&(this.d=new Nu(I7,this,11)),th(this.d,P(t,16));return;case 12:!this.c&&(this.c=new F(P7,this,12,10)),RN(this.c),!this.c&&(this.c=new F(P7,this,12,10)),th(this.c,P(t,16));return;case 13:!this.a&&(this.a=new Ud(this,this)),zN(this.a),!this.a&&(this.a=new Ud(this,this)),th(this.a,P(t,16));return;case 14:RN(Ib(this)),th(Ib(this),P(t,16));return}LE(this,e-bh((CP(),Y7)),_x((n=P(NC(this,16),29),n||Y7),e),t)},Q.ii=function(){return CP(),Y7},Q.ki=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:GS(this,null);return;case 2:FT(this,!0);return;case 3:RT(this,!0);return;case 4:Zx(this,0);return;case 5:Qx(this,1);return;case 8:aT(this,null);return;case 9:n=fA(this,null,null),n&&n.oj();return;case 11:!this.d&&(this.d=new Nu(I7,this,11)),RN(this.d);return;case 12:!this.c&&(this.c=new F(P7,this,12,10)),RN(this.c);return;case 13:this.a&&zN(this.a);return;case 14:this.b&&RN(this.b);return}PT(this,e-bh((CP(),Y7)),_x((t=P(NC(this,16),29),t||Y7),e))},Q.pi=function(){var e,t;if(this.c)for(e=0,t=this.c.i;es&&Sh(e,s,null),r=0,n=new Lu(Ib(this.a));n.e!=n.i.gc();)t=P(gO(n),89),a=(o=t.c,o||(CP(),q7)),Sh(e,r++,a);return e},Q.Hj=function(){var e,t,n,r,i=new $i;for(i.a+=`[`,e=Ib(this.a),t=0,r=Ib(this.a).i;t1);case 5:return V_(this,e,t,n,r,this.i-P(n,15).gc()>0);default:return new Hb(this.e,e,this.c,t,n,r,!0)}},Q.Tj=function(){return!0},Q.Qj=function(){return $O(this)},Q.Gk=function(){RN(this)},L(KH,`EOperationImpl/2`,1377),q(507,1,{2037:1,507:1},YSe),L(KH,`EPackageImpl/1`,507),q(14,83,JU,F),Q.il=function(){return this.d},Q.jl=function(){return this.b},Q.ml=function(){return!0},Q.b=0,L(IU,`EObjectContainmentWithInverseEList`,14),q(365,14,JU,nf),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectContainmentWithInverseEList/Resolving`,365),q(308,365,JU,Tm),Q.Ni=function(){this.a.tb=null},L(KH,`EPackageImpl/2`,308),q(1278,1,{},Jse),L(KH,`EPackageImpl/3`,1278),q(733,45,CI,ci),Q._b=function(e){return rl(e)?e_(this,e):!!Kp(this.f,e)},L(KH,`EPackageRegistryImpl`,733),q(518,292,{110:1,94:1,93:1,155:1,197:1,58:1,2116:1,114:1,481:1,54:1,99:1,158:1,518:1,292:1,119:1,120:1},li),Q.Ah=function(e){return L6e(this,e)},Q.Lh=function(e,t,n){var r,i,a;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return rd(),!!(this.Bb&256);case 3:return rd(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return rd(),a=this.t,a>1||a==-1;case 7:return rd(),i=this.s,i>=1;case 8:return t?Ik(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?P(this.Cb,62):null}return xb(this,e-bh((CP(),Z7)),_x((r=P(NC(this,16),29),r||Z7),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 10:return this.Cb&&(n=(i=this.Db>>16,i>=0?L6e(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,10,n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),Z7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),Z7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 9:return nh(this,n);case 10:return qM(this,null,10,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),Z7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),Z7)),e,n)},Q.Wh=function(e){var t,n,r;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return r=this.t,r>1||r==-1;case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&kh(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&kh(this.q).i==0);case 10:return!!(this.Db>>16==10&&P(this.Cb,62))}return Hv(this,e-bh((CP(),Z7)),_x((t=P(NC(this,16),29),t||Z7),e))},Q.ii=function(){return CP(),Z7},L(KH,`EParameterImpl`,518),q(102,462,{110:1,94:1,93:1,155:1,197:1,58:1,19:1,179:1,69:1,114:1,481:1,54:1,99:1,158:1,102:1,462:1,292:1,119:1,120:1,692:1},uDe),Q.Lh=function(e,t,n){var r,i,a,o;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return rd(),!!(this.Bb&256);case 3:return rd(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return rd(),o=this.t,o>1||o==-1;case 7:return rd(),i=this.s,i>=1;case 8:return t?Ik(this):this.r;case 9:return this.q;case 10:return rd(),(this.Bb&pF)!=0;case 11:return rd(),(this.Bb&zU)!=0;case 12:return rd(),(this.Bb&uI)!=0;case 13:return this.j;case 14:return Uj(this);case 15:return rd(),(this.Bb&RU)!=0;case 16:return rd(),(this.Bb&ZP)!=0;case 17:return L_(this);case 18:return rd(),(this.Bb&GH)!=0;case 19:return rd(),a=qO(this),!!(a&&(a.Bb&GH)!=0);case 20:return rd(),(this.Bb&pI)!=0;case 21:return t?qO(this):this.b;case 22:return t?DZe(this):DUe(this);case 23:return!this.a&&(this.a=new Pu(T7,this,23)),this.a}return xb(this,e-bh((CP(),Q7)),_x((r=P(NC(this,16),29),r||Q7),e),t,n)},Q.Wh=function(e){var t,n,r,i;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return i=this.t,i>1||i==-1;case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&kh(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&kh(this.q).i==0);case 10:return(this.Bb&pF)==0;case 11:return(this.Bb&zU)!=0;case 12:return(this.Bb&uI)!=0;case 13:return this.j!=null;case 14:return Uj(this)!=null;case 15:return(this.Bb&RU)!=0;case 16:return(this.Bb&ZP)!=0;case 17:return!!L_(this);case 18:return(this.Bb&GH)!=0;case 19:return r=qO(this),!!r&&(r.Bb&GH)!=0;case 20:return(this.Bb&pI)==0;case 21:return!!this.b;case 22:return!!DUe(this);case 23:return!!this.a&&this.a.i!=0}return Hv(this,e-bh((CP(),Q7)),_x((t=P(NC(this,16),29),t||Q7),e))},Q.bi=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:X_(this,kd(t));return;case 2:FT(this,ki(Od(t)));return;case 3:RT(this,ki(Od(t)));return;case 4:Zx(this,P(t,17).a);return;case 5:Qx(this,P(t,17).a);return;case 8:aT(this,P(t,142));return;case 9:r=fA(this,P(t,89),null),r&&r.oj();return;case 10:eE(this,ki(Od(t)));return;case 11:rE(this,ki(Od(t)));return;case 12:tE(this,ki(Od(t)));return;case 13:Xc(this,kd(t));return;case 15:nE(this,ki(Od(t)));return;case 16:gE(this,ki(Od(t)));return;case 18:PRe(this,ki(Od(t)));return;case 20:_E(this,ki(Od(t)));return;case 21:JJe(this,P(t,19));return;case 23:!this.a&&(this.a=new Pu(T7,this,23)),RN(this.a),!this.a&&(this.a=new Pu(T7,this,23)),th(this.a,P(t,16));return}LE(this,e-bh((CP(),Q7)),_x((n=P(NC(this,16),29),n||Q7),e),t)},Q.ii=function(){return CP(),Q7},Q.ki=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:j(this.Cb,90)&&$A(_y(P(this.Cb,90)),4),GS(this,null);return;case 2:FT(this,!0);return;case 3:RT(this,!0);return;case 4:Zx(this,0);return;case 5:Qx(this,1);return;case 8:aT(this,null);return;case 9:n=fA(this,null,null),n&&n.oj();return;case 10:eE(this,!0);return;case 11:rE(this,!1);return;case 12:tE(this,!1);return;case 13:this.i=null,OS(this,null);return;case 15:nE(this,!1);return;case 16:gE(this,!1);return;case 18:hE(this,!1),j(this.Cb,90)&&$A(_y(P(this.Cb,90)),2);return;case 20:_E(this,!0);return;case 21:JJe(this,null);return;case 23:!this.a&&(this.a=new Pu(T7,this,23)),RN(this.a);return}PT(this,e-bh((CP(),Q7)),_x((t=P(NC(this,16),29),t||Q7),e))},Q.pi=function(){DZe(this),lg(Rb((UA(),l9),this)),Ik(this),this.Bb|=1},Q.uk=function(){return qO(this)},Q._k=function(){var e;return e=qO(this),!!e&&(e.Bb&GH)!=0},Q.al=function(){return(this.Bb&GH)!=0},Q.bl=function(){return(this.Bb&pI)!=0},Q.Yk=function(e,t){return this.c=null,kT(this,e,t)},Q.Ib=function(){var e;return this.Db&64?SM(this):(e=new Wu(SM(this)),e.a+=` (containment: `,Ga(e,(this.Bb&GH)!=0),e.a+=`, resolveProxies: `,Ga(e,(this.Bb&pI)!=0),e.a+=`)`,e.a)},L(KH,`EReferenceImpl`,102),q(561,120,{110:1,44:1,94:1,93:1,136:1,58:1,114:1,54:1,99:1,561:1,119:1,120:1},Yse),Q.Fb=function(e){return this===e},Q.ld=function(){return this.b},Q.md=function(){return this.c},Q.Hb=function(){return td(this)},Q.Di=function(e){FMe(this,kd(e))},Q.nd=function(e){return Zje(this,kd(e))},Q.Lh=function(e,t,n){var r;switch(e){case 0:return this.b;case 1:return this.c}return xb(this,e-bh((CP(),$7)),_x((r=P(NC(this,16),29),r||$7),e),t,n)},Q.Wh=function(e){var t;switch(e){case 0:return this.b!=null;case 1:return this.c!=null}return Hv(this,e-bh((CP(),$7)),_x((t=P(NC(this,16),29),t||$7),e))},Q.bi=function(e,t){var n;switch(e){case 0:IMe(this,kd(t));return;case 1:PJe(this,kd(t));return}LE(this,e-bh((CP(),$7)),_x((n=P(NC(this,16),29),n||$7),e),t)},Q.ii=function(){return CP(),$7},Q.ki=function(e){var t;switch(e){case 0:NJe(this,null);return;case 1:PJe(this,null);return}PT(this,e-bh((CP(),$7)),_x((t=P(NC(this,16),29),t||$7),e))},Q.Bi=function(){var e;return this.a==-1&&(e=this.b,this.a=e==null?0:jw(e)),this.a},Q.Ci=function(e){this.a=e},Q.Ib=function(){var e;return this.Db&64?Aj(this):(e=new Wu(Aj(this)),e.a+=` (key: `,pl(e,this.b),e.a+=`, value: `,pl(e,this.c),e.a+=`)`,e.a)},Q.a=-1,Q.b=null,Q.c=null;var o9=L(KH,`EStringToStringMapEntryImpl`,561),rHt=gp(IU,`FeatureMap/Entry/Internal`);q(576,1,eW),Q.xl=function(e){return this.yl(P(e,54))},Q.yl=function(e){return this.xl(e)},Q.Fb=function(e){var t,n;return this===e?!0:j(e,76)?(t=P(e,76),t.Lk()==this.c&&(n=this.md(),n==null?t.md()==null:NT(n,t.md()))):!1},Q.Lk=function(){return this.c},Q.Hb=function(){var e=this.md();return US(this.c)^(e==null?0:US(e))},Q.Ib=function(){var e=this.c,t=Mx(e.qk()).yi();return e.xe(),(t!=null&&t.length!=0?t+`:`+e.xe():e.xe())+`=`+this.md()},L(KH,`EStructuralFeatureImpl/BasicFeatureMapEntry`,576),q(791,576,eW,IDe),Q.yl=function(e){return new IDe(this.c,e)},Q.md=function(){return this.a},Q.zl=function(e,t,n){return NYe(this,e,this.a,t,n)},Q.Al=function(e,t,n){return PYe(this,e,this.a,t,n)},L(KH,`EStructuralFeatureImpl/ContainmentUpdatingFeatureMapEntry`,791),q(1350,1,{},XSe),Q.yk=function(e,t,n,r,i){return P(mb(e,this.b),220).Yl(this.a).Fk(r)},Q.zk=function(e,t,n,r,i){return P(mb(e,this.b),220).Pl(this.a,r,i)},Q.Ak=function(e,t,n,r,i){return P(mb(e,this.b),220).Ql(this.a,r,i)},Q.Bk=function(e,t,n){return P(mb(e,this.b),220).Yl(this.a).Qj()},Q.Ck=function(e,t,n,r){P(mb(e,this.b),220).Yl(this.a).Wb(r)},Q.Dk=function(e,t,n){return P(mb(e,this.b),220).Yl(this.a)},Q.Ek=function(e,t,n){P(mb(e,this.b),220).Yl(this.a).Gk()},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateFeatureMapDelegator`,1350),q(91,1,{},Wf,Og,a_,ty),Q.yk=function(e,t,n,r,i){var a=t.li(n);if(a??t.mi(n,a=gP(this,e)),!i)switch(this.e){case 50:case 41:return P(a,597).bk();case 40:return P(a,220).Vl()}return a},Q.zk=function(e,t,n,r,i){var a,o=t.li(n);return o??t.mi(n,o=gP(this,e)),a=P(o,71).Wk(r,i),a},Q.Ak=function(e,t,n,r,i){var a=t.li(n);return a!=null&&(i=P(a,71).Xk(r,i)),i},Q.Bk=function(e,t,n){var r=t.li(n);return r!=null&&P(r,79).Qj()},Q.Ck=function(e,t,n,r){var i=P(t.li(n),79);!i&&t.mi(n,i=gP(this,e)),i.Wb(r)},Q.Dk=function(e,t,n){var r,i=t.li(n);return i??t.mi(n,i=gP(this,e)),j(i,79)?P(i,79):(r=P(t.li(n),15),new Ghe(r))},Q.Ek=function(e,t,n){var r=P(t.li(n),79);!r&&t.mi(n,r=gP(this,e)),r.Gk()},Q.b=0,Q.e=0,L(KH,`EStructuralFeatureImpl/InternalSettingDelegateMany`,91),q(512,1,{}),Q.zk=function(e,t,n,r,i){throw E(new Br)},Q.Ak=function(e,t,n,r,i){throw E(new Br)},Q.Dk=function(e,t,n){return new hIe(this,e,t,n)};var s9;L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingle`,512),q(1367,1,LU,hIe),Q.Fk=function(e){return this.a.yk(this.c,this.d,this.b,e,!0)},Q.Qj=function(){return this.a.Bk(this.c,this.d,this.b)},Q.Wb=function(e){this.a.Ck(this.c,this.d,this.b,e)},Q.Gk=function(){this.a.Ek(this.c,this.d,this.b)},Q.b=0,L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingle/1`,1367),q(784,512,{},ILe),Q.yk=function(e,t,n,r,i){return IM(e,e.Ph(),e.Fh())==this.b?this.bl()&&r?xj(e):e.Ph():null},Q.zk=function(e,t,n,r,i){var a,o;return e.Ph()&&(i=(a=e.Fh(),a>=0?e.Ah(i):e.Ph().Th(e,-1-a,null,i))),o=eD(e.Dh(),this.e),e.Ch(r,o,i)},Q.Ak=function(e,t,n,r,i){var a=eD(e.Dh(),this.e);return e.Ch(null,a,i)},Q.Bk=function(e,t,n){var r=eD(e.Dh(),this.e);return!!e.Ph()&&e.Fh()==r},Q.Ck=function(e,t,n,r){var i,a,o,s,c;if(r!=null&&!QM(this.a,r))throw E(new Pi(tW+(j(r,58)?o5e(P(r,58).Dh()):yx($w(r)))+nW+this.a+`'`));if(i=e.Ph(),o=eD(e.Dh(),this.e),A(r)!==A(i)||e.Fh()!=o&&r!=null){if(Pk(e,P(r,58)))throw E(new Fi(JH+e.Ib()));c=null,i&&(c=(a=e.Fh(),a>=0?e.Ah(c):e.Ph().Th(e,-1-a,null,c))),s=P(r,54),s&&(c=s.Rh(e,eD(s.Dh(),this.b),null,c)),c=e.Ch(s,o,c),c&&c.oj()}else e.vh()&&e.wh()&&AC(e,new Sm(e,1,o,r,r))},Q.Ek=function(e,t,n){var r=e.Ph(),i,a,o;r?(o=(i=e.Fh(),i>=0?e.Ah(null):e.Ph().Th(e,-1-i,null,null)),a=eD(e.Dh(),this.e),o=e.Ch(null,a,o),o&&o.oj()):e.vh()&&e.wh()&&AC(e,new Cm(e,1,this.e,null,null))},Q.bl=function(){return!1},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleContainer`,784),q(1351,784,{},fje),Q.bl=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleContainerResolving`,1351),q(574,512,{}),Q.yk=function(e,t,n,r,i){var a;return a=t.li(n),a==null?this.b:A(a)===A(s9)?null:a},Q.Bk=function(e,t,n){var r=t.li(n);return r!=null&&(A(r)===A(s9)||!NT(r,this.b))},Q.Ck=function(e,t,n,r){var i,a;e.vh()&&e.wh()?(i=(a=t.li(n),a==null?this.b:A(a)===A(s9)?null:a),r==null?this.c==null?this.b==null?t.mi(n,null):t.mi(n,s9):(t.mi(n,null),r=this.b):(this.Bl(r),t.mi(n,r)),AC(e,this.d.Cl(e,1,this.e,i,r))):r==null?this.c==null?this.b==null?t.mi(n,null):t.mi(n,s9):t.mi(n,null):(this.Bl(r),t.mi(n,r))},Q.Ek=function(e,t,n){var r,i;e.vh()&&e.wh()?(r=(i=t.li(n),i==null?this.b:A(i)===A(s9)?null:i),t.ni(n),AC(e,this.d.Cl(e,1,this.e,r,this.b))):t.ni(n)},Q.Bl=function(e){throw E(new xge)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData`,574),q(rW,1,{},Xse),Q.Cl=function(e,t,n,r,i){return new Cm(e,t,n,r,i)},Q.Dl=function(e,t,n,r,i,a){return new Jg(e,t,n,r,i,a)};var iHt,aHt,oHt,sHt,cHt,lHt,uHt,c9,dHt;L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator`,rW),q(1368,rW,{},Zse),Q.Cl=function(e,t,n,r,i){return new bUe(e,t,n,ki(Od(r)),ki(Od(i)))},Q.Dl=function(e,t,n,r,i,a){return new lBe(e,t,n,ki(Od(r)),ki(Od(i)),a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/1`,1368),q(1369,rW,{},Qse),Q.Cl=function(e,t,n,r,i){return new Gqe(e,t,n,P(r,222).a,P(i,222).a)},Q.Dl=function(e,t,n,r,i,a){return new nBe(e,t,n,P(r,222).a,P(i,222).a,a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/2`,1369),q(1370,rW,{},$se),Q.Cl=function(e,t,n,r,i){return new Kqe(e,t,n,P(r,180).a,P(i,180).a)},Q.Dl=function(e,t,n,r,i,a){return new rBe(e,t,n,P(r,180).a,P(i,180).a,a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/3`,1370),q(1371,rW,{},ece),Q.Cl=function(e,t,n,r,i){return new vUe(e,t,n,D(N(r)),D(N(i)))},Q.Dl=function(e,t,n,r,i,a){return new iBe(e,t,n,D(N(r)),D(N(i)),a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/4`,1371),q(1372,rW,{},tce),Q.Cl=function(e,t,n,r,i){return new Yqe(e,t,n,P(r,161).a,P(i,161).a)},Q.Dl=function(e,t,n,r,i,a){return new aBe(e,t,n,P(r,161).a,P(i,161).a,a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/5`,1372),q(1373,rW,{},nce),Q.Cl=function(e,t,n,r,i){return new yUe(e,t,n,P(r,17).a,P(i,17).a)},Q.Dl=function(e,t,n,r,i,a){return new oBe(e,t,n,P(r,17).a,P(i,17).a,a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/6`,1373),q(1374,rW,{},rce),Q.Cl=function(e,t,n,r,i){return new qqe(e,t,n,P(r,168).a,P(i,168).a)},Q.Dl=function(e,t,n,r,i,a){return new sBe(e,t,n,P(r,168).a,P(i,168).a,a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/7`,1374),q(1375,rW,{},ice),Q.Cl=function(e,t,n,r,i){return new Jqe(e,t,n,P(r,191).a,P(i,191).a)},Q.Dl=function(e,t,n,r,i,a){return new cBe(e,t,n,P(r,191).a,P(i,191).a,a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/8`,1375),q(1353,574,{},gIe),Q.Bl=function(e){if(!this.a.fk(e))throw E(new Pi(tW+$w(e)+nW+this.a+`'`))},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataDynamic`,1353),q(1354,574,{},kNe),Q.Bl=function(e){},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataStatic`,1354),q(785,574,{}),Q.Bk=function(e,t,n){return t.li(n)!=null},Q.Ck=function(e,t,n,r){var i,a;e.vh()&&e.wh()?(i=!0,a=t.li(n),a==null?(i=!1,a=this.b):A(a)===A(s9)&&(a=null),r==null?this.c==null?t.mi(n,s9):(t.mi(n,null),r=this.b):(this.Bl(r),t.mi(n,r)),AC(e,this.d.Dl(e,1,this.e,a,r,!i))):r==null?this.c==null?t.mi(n,s9):t.mi(n,null):(this.Bl(r),t.mi(n,r))},Q.Ek=function(e,t,n){var r,i;e.vh()&&e.wh()?(r=!0,i=t.li(n),i==null?(r=!1,i=this.b):A(i)===A(s9)&&(i=null),t.ni(n),AC(e,this.d.Dl(e,2,this.e,i,this.b,r))):t.ni(n)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettable`,785),q(1355,785,{},_Ie),Q.Bl=function(e){if(!this.a.fk(e))throw E(new Pi(tW+$w(e)+nW+this.a+`'`))},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableDynamic`,1355),q(1356,785,{},ANe),Q.Bl=function(e){},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableStatic`,1356),q(410,512,{},Bp),Q.yk=function(e,t,n,r,i){var a,o,s,c,l=t.li(n);if(this.tk()&&A(l)===A(s9))return null;if(this.bl()&&r&&l!=null){if(s=P(l,54),s.Vh()&&(c=pT(e,s),s!=c)){if(!QM(this.a,c))throw E(new Pi(tW+$w(c)+nW+this.a+`'`));t.mi(n,l=c),this.al()&&(a=P(c,54),o=s.Th(e,this.b?eD(s.Dh(),this.b):-1-eD(e.Dh(),this.e),null,null),!a.Ph()&&(o=a.Rh(e,this.b?eD(a.Dh(),this.b):-1-eD(e.Dh(),this.e),null,o)),o&&o.oj()),e.vh()&&e.wh()&&AC(e,new Cm(e,9,this.e,s,c))}return l}return l},Q.zk=function(e,t,n,r,i){var a,o=t.li(n);return A(o)===A(s9)&&(o=null),t.mi(n,r),this.Mj()?A(o)!==A(r)&&o!=null&&(a=P(o,54),i=a.Th(e,eD(a.Dh(),this.b),null,i)):this.al()&&o!=null&&(i=P(o,54).Th(e,-1-eD(e.Dh(),this.e),null,i)),e.vh()&&e.wh()&&(!i&&(i=new Pa(4)),i.nj(new Cm(e,1,this.e,o,r))),i},Q.Ak=function(e,t,n,r,i){var a=t.li(n);return A(a)===A(s9)&&(a=null),t.ni(n),e.vh()&&e.wh()&&(!i&&(i=new Pa(4)),this.tk()?i.nj(new Cm(e,2,this.e,a,null)):i.nj(new Cm(e,1,this.e,a,null))),i},Q.Bk=function(e,t,n){return t.li(n)!=null},Q.Ck=function(e,t,n,r){var i,a,o,s,c;if(r!=null&&!QM(this.a,r))throw E(new Pi(tW+(j(r,58)?o5e(P(r,58).Dh()):yx($w(r)))+nW+this.a+`'`));c=t.li(n),s=c!=null,this.tk()&&A(c)===A(s9)&&(c=null),o=null,this.Mj()?A(c)!==A(r)&&(c!=null&&(i=P(c,54),o=i.Th(e,eD(i.Dh(),this.b),null,o)),r!=null&&(i=P(r,54),o=i.Rh(e,eD(i.Dh(),this.b),null,o))):this.al()&&A(c)!==A(r)&&(c!=null&&(o=P(c,54).Th(e,-1-eD(e.Dh(),this.e),null,o)),r!=null&&(o=P(r,54).Rh(e,-1-eD(e.Dh(),this.e),null,o))),r==null&&this.tk()?t.mi(n,s9):t.mi(n,r),e.vh()&&e.wh()?(a=new Jg(e,1,this.e,c,r,this.tk()&&!s),o?(o.nj(a),o.oj()):AC(e,a)):o&&o.oj()},Q.Ek=function(e,t,n){var r,i,a,o,s=t.li(n);o=s!=null,this.tk()&&A(s)===A(s9)&&(s=null),a=null,s!=null&&(this.Mj()?(r=P(s,54),a=r.Th(e,eD(r.Dh(),this.b),null,a)):this.al()&&(a=P(s,54).Th(e,-1-eD(e.Dh(),this.e),null,a))),t.ni(n),e.vh()&&e.wh()?(i=new Jg(e,this.tk()?2:1,this.e,s,null,o),a?(a.nj(i),a.oj()):AC(e,i)):a&&a.oj()},Q.Mj=function(){return!1},Q.al=function(){return!1},Q.bl=function(){return!1},Q.tk=function(){return!1},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObject`,410),q(575,410,{},Ed),Q.al=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainment`,575),q(1359,575,{},JEe),Q.bl=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentResolving`,1359),q(787,575,{},YEe),Q.tk=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettable`,787),q(1361,787,{},ZEe),Q.bl=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettableResolving`,1361),q(650,575,{},Gf),Q.Mj=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverse`,650),q(1360,650,{},hje),Q.bl=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseResolving`,1360),q(788,650,{},gje),Q.tk=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettable`,788),q(1362,788,{},_je),Q.bl=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettableResolving`,1362),q(651,410,{},XEe),Q.bl=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolving`,651),q(1363,651,{},QEe),Q.tk=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingUnsettable`,1363),q(789,651,{},pje),Q.Mj=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverse`,789),q(1364,789,{},vje),Q.tk=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverseUnsettable`,1364),q(1357,410,{},$Ee),Q.tk=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectUnsettable`,1357),q(786,410,{},mje),Q.Mj=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverse`,786),q(1358,786,{},yje),Q.tk=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverseUnsettable`,1358),q(790,576,eW,Mh),Q.yl=function(e){return new Mh(this.a,this.c,e)},Q.md=function(){return this.b},Q.zl=function(e,t,n){return UWe(this,e,this.b,n)},Q.Al=function(e,t,n){return WWe(this,e,this.b,n)},L(KH,`EStructuralFeatureImpl/InverseUpdatingFeatureMapEntry`,790),q(1365,1,LU,Ghe),Q.Fk=function(e){return this.a},Q.Qj=function(){return j(this.a,97)?P(this.a,97).Qj():!this.a.dc()},Q.Wb=function(e){this.a.$b(),this.a.Gc(P(e,15))},Q.Gk=function(){j(this.a,97)?P(this.a,97).Gk():this.a.$b()},L(KH,`EStructuralFeatureImpl/SettingMany`,1365),q(1366,576,eW,gHe),Q.xl=function(e){return new Gd((UN(),k9),this.b.ri(this.a,e))},Q.md=function(){return null},Q.zl=function(e,t,n){return n},Q.Al=function(e,t,n){return n},L(KH,`EStructuralFeatureImpl/SimpleContentFeatureMapEntry`,1366),q(652,576,eW,Gd),Q.xl=function(e){return new Gd(this.c,e)},Q.md=function(){return this.a},Q.zl=function(e,t,n){return n},Q.Al=function(e,t,n){return n},L(KH,`EStructuralFeatureImpl/SimpleFeatureMapEntry`,652),q(403,506,SU,ln),Q.aj=function(e){return V(D7,FP,29,e,0,1)},Q.Yi=function(){return!1},L(KH,`ESuperAdapter/1`,403),q(457,448,{110:1,94:1,93:1,155:1,197:1,58:1,114:1,850:1,54:1,99:1,158:1,457:1,119:1,120:1},un),Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return!this.a&&(this.a=new Vp(this,j7,this)),this.a}return xb(this,e-bh((CP(),e9)),_x((r=P(NC(this,16),29),r||e9),e),t,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 2:return!this.a&&(this.a=new Vp(this,j7,this)),AO(this.a,e,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),e9)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),e9)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!!this.a&&this.a.i!=0}return Hv(this,e-bh((CP(),e9)),_x((t=P(NC(this,16),29),t||e9),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:GS(this,kd(t));return;case 2:!this.a&&(this.a=new Vp(this,j7,this)),RN(this.a),!this.a&&(this.a=new Vp(this,j7,this)),th(this.a,P(t,16));return}LE(this,e-bh((CP(),e9)),_x((n=P(NC(this,16),29),n||e9),e),t)},Q.ii=function(){return CP(),e9},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:GS(this,null);return;case 2:!this.a&&(this.a=new Vp(this,j7,this)),RN(this.a);return}PT(this,e-bh((CP(),e9)),_x((t=P(NC(this,16),29),t||e9),e))},L(KH,`ETypeParameterImpl`,457),q(458,83,JU,Vp),Q.Nj=function(e,t){return g7e(this,P(e,89),t)},Q.Oj=function(e,t){return _7e(this,P(e,89),t)},L(KH,`ETypeParameterImpl/1`,458),q(647,45,CI,ui),Q.ec=function(){return new Sr(this)},L(KH,`ETypeParameterImpl/2`,647),q(570,GP,KP,Sr),Q.Fc=function(e){return mOe(this,P(e,89))},Q.Gc=function(e){var t,n,r=!1;for(n=e.Kc();n.Ob();)t=P(n.Pb(),89),Qh(this.a,t,``)??(r=!0);return r},Q.$b=function(){Pm(this.a)},Q.Hc=function(e){return km(this.a,e)},Q.Kc=function(){var e;return e=new EC(new Fn(this.a).a),new Cr(e)},Q.Mc=function(e){return iWe(this,e)},Q.gc=function(){return ho(this.a)},L(KH,`ETypeParameterImpl/2/1`,570),q(571,1,VP,Cr),Q.Nb=function(e){Om(this,e)},Q.Pb=function(){return P(MS(this.a).ld(),89)},Q.Ob=function(){return this.a.b},Q.Qb=function(){aKe(this.a)},L(KH,`ETypeParameterImpl/2/1/1`,571),q(1329,45,CI,h_e),Q._b=function(e){return rl(e)?e_(this,e):!!Kp(this.f,e)},Q.xc=function(e){var t=rl(e)?v_(this,e):nl(Kp(this.f,e)),n;return j(t,851)?(n=P(t,851),t=n.Kk(),Qh(this,P(e,241),t),t):t??(e==null?(Zo(),yHt):null)},L(KH,`EValidatorRegistryImpl`,1329),q(1349,720,{110:1,94:1,93:1,480:1,155:1,58:1,114:1,2040:1,54:1,99:1,158:1,119:1,120:1},ace),Q.ri=function(e,t){switch(e.hk()){case 21:case 22:case 23:case 24:case 26:case 31:case 32:case 37:case 38:case 39:case 40:case 43:case 44:case 48:case 49:case 20:return t==null?null:PE(t);case 25:return Cqe(t);case 27:return BGe(t);case 28:return VGe(t);case 29:return t==null?null:Nwe(t7[0],P(t,206));case 41:return t==null?``:Ha(P(t,297));case 42:return PE(t);case 50:return kd(t);default:throw E(new Fi(YH+e.xe()+XH))}},Q.si=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;switch(e.G==-1&&(e.G=(f=Mx(e),f?NO(f.vi(),e):-1)),e.G){case 0:return n=new oi,n;case 1:return t=new Vse,t;case 2:return r=new Que,r;case 4:return i=new Ur,i;case 5:return a=new m_e,a;case 6:return o=new wge,o;case 7:return s=new $ue,s;case 10:return l=new sn,l;case 11:return u=new si,u;case 12:return d=new IIe,d;case 13:return p=new li,p;case 14:return m=new uDe,m;case 17:return h=new Yse,h;case 18:return c=new kr,c;case 19:return g=new un,g;default:throw E(new Fi($H+e.zb+XH))}},Q.ti=function(e,t){switch(e.hk()){case 20:return t==null?null:new xye(t);case 21:return t==null?null:new ru(t);case 23:case 22:return t==null?null:X0e(t);case 26:case 24:return t==null?null:Gb(GM(t,-128,127)<<24>>24);case 25:return Rit(t);case 27:return G3e(t);case 28:return K3e(t);case 29:return q7e(t);case 32:case 31:return t==null?null:OA(t);case 38:case 37:return t==null?null:new jge(t);case 40:case 39:return t==null?null:G(GM(t,xF,AP));case 41:return null;case 42:return null;case 44:case 43:return t==null?null:JD(aP(t));case 49:case 48:return t==null?null:xT(GM(t,aW,32767)<<16>>16);case 50:return t;default:throw E(new Fi(YH+e.xe()+XH))}},L(KH,`EcoreFactoryImpl`,1349),q(560,184,{110:1,94:1,93:1,155:1,197:1,58:1,241:1,114:1,2038:1,54:1,99:1,158:1,184:1,560:1,119:1,120:1,690:1},MFe),Q.gb=!1,Q.hb=!1;var fHt,pHt=!1;L(KH,`EcorePackageImpl`,560),q(1234,1,{851:1},oce),Q.Kk=function(){return xTe(),bHt},L(KH,`EcorePackageImpl/1`,1234),q(1243,1,lW,sce),Q.fk=function(e){return j(e,155)},Q.gk=function(e){return V(G5,FP,155,e,0,1)},L(KH,`EcorePackageImpl/10`,1243),q(1244,1,lW,cce),Q.fk=function(e){return j(e,197)},Q.gk=function(e){return V(q5,FP,197,e,0,1)},L(KH,`EcorePackageImpl/11`,1244),q(1245,1,lW,lce),Q.fk=function(e){return j(e,58)},Q.gk=function(e){return V(L5,FP,58,e,0,1)},L(KH,`EcorePackageImpl/12`,1245),q(1246,1,lW,uce),Q.fk=function(e){return j(e,411)},Q.gk=function(e){return V(M7,Cwt,62,e,0,1)},L(KH,`EcorePackageImpl/13`,1246),q(1247,1,lW,dce),Q.fk=function(e){return j(e,241)},Q.gk=function(e){return V(J5,FP,241,e,0,1)},L(KH,`EcorePackageImpl/14`,1247),q(1248,1,lW,fce),Q.fk=function(e){return j(e,518)},Q.gk=function(e){return V(P7,FP,2116,e,0,1)},L(KH,`EcorePackageImpl/15`,1248),q(1249,1,lW,pce),Q.fk=function(e){return j(e,102)},Q.gk=function(e){return V(F7,qU,19,e,0,1)},L(KH,`EcorePackageImpl/16`,1249),q(1250,1,lW,mce),Q.fk=function(e){return j(e,179)},Q.gk=function(e){return V(w7,qU,179,e,0,1)},L(KH,`EcorePackageImpl/17`,1250),q(1251,1,lW,hce),Q.fk=function(e){return j(e,481)},Q.gk=function(e){return V(C7,FP,481,e,0,1)},L(KH,`EcorePackageImpl/18`,1251),q(1252,1,lW,gce),Q.fk=function(e){return j(e,561)},Q.gk=function(e){return V(o9,owt,561,e,0,1)},L(KH,`EcorePackageImpl/19`,1252),q(1235,1,lW,_ce),Q.fk=function(e){return j(e,331)},Q.gk=function(e){return V(T7,qU,35,e,0,1)},L(KH,`EcorePackageImpl/2`,1235),q(1253,1,lW,vce),Q.fk=function(e){return j(e,248)},Q.gk=function(e){return V(j7,Twt,89,e,0,1)},L(KH,`EcorePackageImpl/20`,1253),q(1254,1,lW,yce),Q.fk=function(e){return j(e,457)},Q.gk=function(e){return V(I7,FP,850,e,0,1)},L(KH,`EcorePackageImpl/21`,1254),q(1255,1,lW,bce),Q.fk=function(e){return il(e)},Q.gk=function(e){return V(bG,X,485,e,8,1)},L(KH,`EcorePackageImpl/22`,1255),q(1256,1,lW,xce),Q.fk=function(e){return j(e,195)},Q.gk=function(e){return V(X9,X,195,e,0,2)},L(KH,`EcorePackageImpl/23`,1256),q(1257,1,lW,Sce),Q.fk=function(e){return j(e,222)},Q.gk=function(e){return V(xG,X,222,e,0,1)},L(KH,`EcorePackageImpl/24`,1257),q(1258,1,lW,Cce),Q.fk=function(e){return j(e,180)},Q.gk=function(e){return V(CG,X,180,e,0,1)},L(KH,`EcorePackageImpl/25`,1258),q(1259,1,lW,wce),Q.fk=function(e){return j(e,206)},Q.gk=function(e){return V(fG,X,206,e,0,1)},L(KH,`EcorePackageImpl/26`,1259),q(1260,1,lW,Tce),Q.fk=function(e){return!1},Q.gk=function(e){return V(dUt,FP,2215,e,0,1)},L(KH,`EcorePackageImpl/27`,1260),q(1261,1,lW,Ece),Q.fk=function(e){return al(e)},Q.gk=function(e){return V(TG,X,345,e,7,1)},L(KH,`EcorePackageImpl/28`,1261),q(1262,1,lW,Dce),Q.fk=function(e){return j(e,61)},Q.gk=function(e){return V(xVt,BL,61,e,0,1)},L(KH,`EcorePackageImpl/29`,1262),q(1236,1,lW,Oce),Q.fk=function(e){return j(e,519)},Q.gk=function(e){return V(S7,{3:1,4:1,5:1,2033:1},598,e,0,1)},L(KH,`EcorePackageImpl/3`,1236),q(1263,1,lW,kce),Q.fk=function(e){return j(e,582)},Q.gk=function(e){return V(DVt,FP,2039,e,0,1)},L(KH,`EcorePackageImpl/30`,1263),q(1264,1,lW,Ace),Q.fk=function(e){return j(e,160)},Q.gk=function(e){return V(vHt,BL,160,e,0,1)},L(KH,`EcorePackageImpl/31`,1264),q(1265,1,lW,jce),Q.fk=function(e){return j(e,76)},Q.gk=function(e){return V(t9,Iwt,76,e,0,1)},L(KH,`EcorePackageImpl/32`,1265),q(1266,1,lW,Mce),Q.fk=function(e){return j(e,161)},Q.gk=function(e){return V(EG,X,161,e,0,1)},L(KH,`EcorePackageImpl/33`,1266),q(1267,1,lW,Nce),Q.fk=function(e){return j(e,17)},Q.gk=function(e){return V(DG,X,17,e,0,1)},L(KH,`EcorePackageImpl/34`,1267),q(1268,1,lW,Pce),Q.fk=function(e){return j(e,297)},Q.gk=function(e){return V(DTt,FP,297,e,0,1)},L(KH,`EcorePackageImpl/35`,1268),q(1269,1,lW,Fce),Q.fk=function(e){return j(e,168)},Q.gk=function(e){return V(kG,X,168,e,0,1)},L(KH,`EcorePackageImpl/36`,1269),q(1270,1,lW,Ice),Q.fk=function(e){return j(e,85)},Q.gk=function(e){return V(kTt,FP,85,e,0,1)},L(KH,`EcorePackageImpl/37`,1270),q(1271,1,lW,Lce),Q.fk=function(e){return j(e,599)},Q.gk=function(e){return V(mHt,FP,599,e,0,1)},L(KH,`EcorePackageImpl/38`,1271),q(1272,1,lW,Rce),Q.fk=function(e){return!1},Q.gk=function(e){return V(fUt,FP,2216,e,0,1)},L(KH,`EcorePackageImpl/39`,1272),q(1237,1,lW,zce),Q.fk=function(e){return j(e,90)},Q.gk=function(e){return V(D7,FP,29,e,0,1)},L(KH,`EcorePackageImpl/4`,1237),q(1273,1,lW,Bce),Q.fk=function(e){return j(e,191)},Q.gk=function(e){return V(PG,X,191,e,0,1)},L(KH,`EcorePackageImpl/40`,1273),q(1274,1,lW,Vce),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(KH,`EcorePackageImpl/41`,1274),q(1275,1,lW,Hce),Q.fk=function(e){return j(e,596)},Q.gk=function(e){return V(CVt,FP,596,e,0,1)},L(KH,`EcorePackageImpl/42`,1275),q(1276,1,lW,Uce),Q.fk=function(e){return!1},Q.gk=function(e){return V(pUt,X,2217,e,0,1)},L(KH,`EcorePackageImpl/43`,1276),q(1277,1,lW,Wce),Q.fk=function(e){return j(e,44)},Q.gk=function(e){return V(YW,oF,44,e,0,1)},L(KH,`EcorePackageImpl/44`,1277),q(1238,1,lW,Gce),Q.fk=function(e){return j(e,142)},Q.gk=function(e){return V(E7,FP,142,e,0,1)},L(KH,`EcorePackageImpl/5`,1238),q(1239,1,lW,Kce),Q.fk=function(e){return j(e,156)},Q.gk=function(e){return V(O7,FP,156,e,0,1)},L(KH,`EcorePackageImpl/6`,1239),q(1240,1,lW,qce),Q.fk=function(e){return j(e,469)},Q.gk=function(e){return V(k7,FP,685,e,0,1)},L(KH,`EcorePackageImpl/7`,1240),q(1241,1,lW,Jce),Q.fk=function(e){return j(e,582)},Q.gk=function(e){return V(A7,FP,694,e,0,1)},L(KH,`EcorePackageImpl/8`,1241),q(1242,1,lW,Yce),Q.fk=function(e){return j(e,480)},Q.gk=function(e){return V(K5,FP,480,e,0,1)},L(KH,`EcorePackageImpl/9`,1242),q(1038,2080,iwt,K_e),Q.Mi=function(e,t){B$e(this,P(t,424))},Q.Qi=function(e,t){ntt(this,e,P(t,424))},L(KH,`MinimalEObjectImpl/1ArrayDelegatingAdapterList`,1038),q(1039,152,NU,cFe),Q.jj=function(){return this.a.a},L(KH,`MinimalEObjectImpl/1ArrayDelegatingAdapterList/1`,1039),q(1067,1066,{},uwe),L(`org.eclipse.emf.ecore.plugin`,`EcorePlugin`,1067);var mHt=gp(Lwt,`Resource`);q(799,1524,Rwt),Q.Hl=function(e){},Q.Il=function(e){},Q.El=function(){return!this.a&&(this.a=new wr(this)),this.a},Q.Fl=function(e){var t,n,r=e.length,i,a;if(r>0){if(sv(0,e.length),e.charCodeAt(0)==47){for(a=new Hy(4),i=1,t=1;t0&&(e=(Zy(0,n,e.length),e.substr(0,n))))}return hnt(this,e)},Q.Gl=function(){return this.c},Q.Ib=function(){var e;return Ha(this.Rm)+`@`+(e=US(this)>>>0,e.toString(16))+` uri='`+this.d+`'`},Q.b=!1,L(uW,`ResourceImpl`,799),q(1525,799,Rwt,qhe),L(uW,`BinaryResourceImpl`,1525),q(1190,708,CU),Q.bj=function(e){return j(e,58)?rLe(this,P(e,58)):j(e,599)?new Lu(P(e,599).El()):A(e)===A(this.f)?P(e,16).Kc():(Nd(),_7.a)},Q.Ob=function(){return ert(this)},Q.a=!1,L(IU,`EcoreUtil/ContentTreeIterator`,1190),q(1526,1190,CU,sPe),Q.bj=function(e){return A(e)===A(this.f)?P(e,15).Kc():new aVe(P(e,58))},L(uW,`ResourceImpl/5`,1526),q(658,2092,wwt,wr),Q.Hc=function(e){return this.i<=4?Uk(this,e):j(e,54)&&P(e,54).Jh()==this.a},Q.Mi=function(e,t){e==this.i-1&&(this.a.b||(this.a.b=!0))},Q.Oi=function(e,t){e==0?this.a.b||(this.a.b=!0):Xy(this,e,t)},Q.Qi=function(e,t){},Q.Ri=function(e,t,n){},Q.Lj=function(){return 2},Q.jj=function(){return this.a},Q.Mj=function(){return!0},Q.Nj=function(e,t){return t=P(e,54).fi(this.a,t),t},Q.Oj=function(e,t){return P(e,54).fi(null,t)},Q.Pj=function(){return!1},Q.Si=function(){return!0},Q.aj=function(e){return V(L5,FP,58,e,0,1)},Q.Yi=function(){return!1},L(uW,`ResourceImpl/ContentsEList`,658),q(970,2062,gF,Jhe),Q.fd=function(e){return this.a.Ki(e)},Q.gc=function(){return this.a.gc()},L(IU,`AbstractSequentialInternalEList/1`,970);var hHt,gHt,l9,_Ht;q(634,1,{},tMe);var u9,d9;L(IU,`BasicExtendedMetaData`,634),q(1181,1,{},QSe),Q.Jl=function(){return null},Q.Kl=function(){return this.a==-2&&sfe(this,F7e(this.d,this.b)),this.a},Q.Ll=function(){return null},Q.Ml=function(){return Vg(),Vg(),QG},Q.xe=function(){return this.c==SW&&cfe(this,f2e(this.d,this.b)),this.c},Q.Nl=function(){return 0},Q.a=-2,Q.c=SW,L(IU,`BasicExtendedMetaData/EClassExtendedMetaDataImpl`,1181),q(1182,1,{},dBe),Q.Jl=function(){return this.a==(By(),u9)&&dfe(this,olt(this.f,this.b)),this.a},Q.Kl=function(){return 0},Q.Ll=function(){return this.c==(By(),u9)&&lfe(this,slt(this.f,this.b)),this.c},Q.Ml=function(){return!this.d&&pfe(this,rft(this.f,this.b)),this.d},Q.xe=function(){return this.e==SW&&hfe(this,f2e(this.f,this.b)),this.e},Q.Nl=function(){return this.g==-2&&_fe(this,R5e(this.f,this.b)),this.g},Q.e=SW,Q.g=-2,L(IU,`BasicExtendedMetaData/EDataTypeExtendedMetaDataImpl`,1182),q(1180,1,{},$Se),Q.b=!1,Q.c=!1,L(IU,`BasicExtendedMetaData/EPackageExtendedMetaDataImpl`,1180),q(1183,1,{},fBe),Q.c=-2,Q.e=SW,Q.f=SW,L(IU,`BasicExtendedMetaData/EStructuralFeatureExtendedMetaDataImpl`,1183),q(593,632,JU,ip),Q.Lj=function(){return this.c},Q.ol=function(){return!1},Q.Wi=function(e,t){return t},Q.c=0,L(IU,`EDataTypeEList`,593);var vHt=gp(IU,`FeatureMap`);q(78,593,{3:1,4:1,20:1,31:1,56:1,16:1,15:1,59:1,70:1,66:1,61:1,79:1,160:1,220:1,2036:1,71:1,97:1},DC),Q.bd=function(e,t){got(this,e,P(t,76))},Q.Fc=function(e){return xat(this,P(e,76))},Q.Hi=function(e){UPe(this,P(e,76))},Q.Nj=function(e,t){return qOe(this,P(e,76),t)},Q.Oj=function(e,t){return JOe(this,P(e,76),t)},Q.Ti=function(e,t){return Dut(this,e,t)},Q.Wi=function(e,t){return Umt(this,e,P(t,76))},Q.hd=function(e,t){return xst(this,e,P(t,76))},Q.Uj=function(e,t){return YOe(this,P(e,76),t)},Q.Vj=function(e,t){return XOe(this,P(e,76),t)},Q.Wj=function(e,t,n){return f5e(this,P(e,76),P(t,76),n)},Q.Zi=function(e,t){return aA(this,e,P(t,76))},Q.Ol=function(e,t){return cut(this,e,t)},Q.cd=function(e,t){var n,r,i,a,o,s,c,l=new kx(t.gc()),u;for(i=t.Kc();i.Ob();)if(r=P(i.Pb(),76),a=r.Lk(),aM(this.e,a))(!a.Si()||!Kv(this,a,r.md())&&!Uk(l,r))&&tb(l,r);else{for(u=nM(this.e.Dh(),a),n=P(this.g,124),o=!0,s=0;s=0;)if(t=e[this.c],this.k.am(t.Lk()))return this.j=this.f?t:t.md(),this.i=-2,!0;return this.i=-1,this.g=-1,!1},L(IU,`BasicFeatureMap/FeatureEIterator`,420),q(676,420,YP,Dl),Q.ul=function(){return!0},L(IU,`BasicFeatureMap/ResolvingFeatureEIterator`,676),q(968,496,QU,zwe),Q.pj=function(){return this},L(IU,`EContentsEList/1`,968),q(969,496,QU,mCe),Q.ul=function(){return!1},L(IU,`EContentsEList/2`,969),q(967,287,$U,Bwe),Q.wl=function(e){},Q.Ob=function(){return!1},Q.Sb=function(){return!1},L(IU,`EContentsEList/FeatureIteratorImpl/1`,967),q(840,593,JU,uTe),Q.Ni=function(){this.a=!0},Q.Qj=function(){return this.a},Q.Gk=function(){var e;RN(this),Gl(this.e)?(e=this.a,this.a=!1,AC(this.e,new vy(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(IU,`EDataTypeEList/Unsettable`,840),q(1958,593,JU,dTe),Q.Si=function(){return!0},L(IU,`EDataTypeUniqueEList`,1958),q(1959,840,JU,fTe),Q.Si=function(){return!0},L(IU,`EDataTypeUniqueEList/Unsettable`,1959),q(147,83,JU,Nu),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectContainmentEList/Resolving`,147),q(1184,555,JU,pTe),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectContainmentEList/Unsettable/Resolving`,1184),q(766,14,JU,rf),Q.Ni=function(){this.a=!0},Q.Qj=function(){return this.a},Q.Gk=function(){var e;RN(this),Gl(this.e)?(e=this.a,this.a=!1,AC(this.e,new vy(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(IU,`EObjectContainmentWithInverseEList/Unsettable`,766),q(1222,766,JU,yOe),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectContainmentWithInverseEList/Unsettable/Resolving`,1222),q(757,505,JU,mTe),Q.Ni=function(){this.a=!0},Q.Qj=function(){return this.a},Q.Gk=function(){var e;RN(this),Gl(this.e)?(e=this.a,this.a=!1,AC(this.e,new vy(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(IU,`EObjectEList/Unsettable`,757),q(338,505,JU,Pu),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectResolvingEList`,338),q(1844,757,JU,hTe),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectResolvingEList/Unsettable`,1844),q(1527,1,{},Xce);var yHt;L(IU,`EObjectValidator`,1527),q(559,505,JU,wm),Q.il=function(){return this.d},Q.jl=function(){return this.b},Q.Mj=function(){return!0},Q.ml=function(){return!0},Q.b=0,L(IU,`EObjectWithInverseEList`,559),q(1225,559,JU,bOe),Q.ll=function(){return!0},L(IU,`EObjectWithInverseEList/ManyInverse`,1225),q(635,559,JU,af),Q.Ni=function(){this.a=!0},Q.Qj=function(){return this.a},Q.Gk=function(){var e;RN(this),Gl(this.e)?(e=this.a,this.a=!1,AC(this.e,new vy(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(IU,`EObjectWithInverseEList/Unsettable`,635),q(1224,635,JU,xOe),Q.ll=function(){return!0},L(IU,`EObjectWithInverseEList/Unsettable/ManyInverse`,1224),q(767,559,JU,of),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectWithInverseResolvingEList`,767),q(32,767,JU,cf),Q.ll=function(){return!0},L(IU,`EObjectWithInverseResolvingEList/ManyInverse`,32),q(768,635,JU,sf),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectWithInverseResolvingEList/Unsettable`,768),q(1223,768,JU,SOe),Q.ll=function(){return!0},L(IU,`EObjectWithInverseResolvingEList/Unsettable/ManyInverse`,1223),q(1185,632,JU),Q.Li=function(){return!(this.b&1792)},Q.Ni=function(){this.b|=1},Q.kl=function(){return!!(this.b&4)},Q.Mj=function(){return!!(this.b&40)},Q.ll=function(){return!!(this.b&16)},Q.ml=function(){return!!(this.b&8)},Q.nl=function(){return(this.b&zU)!=0},Q.al=function(){return!!(this.b&32)},Q.ol=function(){return(this.b&pF)!=0},Q.fk=function(e){return this.d?HVe(this.d,e):this.Lk().Hk().fk(e)},Q.Qj=function(){return this.b&2?!!(this.b&1):this.i!=0},Q.Si=function(){return!!(this.b&128)},Q.Gk=function(){var e;RN(this),this.b&2&&(Gl(this.e)?(e=!!(this.b&1),this.b&=-2,Kr(this,new vy(this.e,2,eD(this.e.Dh(),this.Lk()),e,!1))):this.b&=-2)},Q.Yi=function(){return!(this.b&1536)},Q.b=0,L(IU,`EcoreEList/Generic`,1185),q(1186,1185,JU,BIe),Q.Lk=function(){return this.a},L(IU,`EcoreEList/Dynamic`,1186),q(765,66,SU,Yhe),Q.aj=function(e){return tS(this.a.a,e)},L(IU,`EcoreEMap/1`,765),q(764,83,JU,dPe),Q.Mi=function(e,t){JO(this.b,P(t,136))},Q.Oi=function(e,t){sXe(this.b)},Q.Pi=function(e,t,n){var r;++(r=this.b,P(t,136),r).e},Q.Qi=function(e,t){$T(this.b,P(t,136))},Q.Ri=function(e,t,n){$T(this.b,P(n,136)),A(n)===A(t)&&P(n,136).Ci(swe(P(t,136).ld())),JO(this.b,P(t,136))},L(IU,`EcoreEMap/DelegateEObjectContainmentEList`,764),q(1220,141,bwt,TJe),L(IU,`EcoreEMap/Unsettable`,1220),q(1221,764,JU,COe),Q.Ni=function(){this.a=!0},Q.Qj=function(){return this.a},Q.Gk=function(){var e;RN(this),Gl(this.e)?(e=this.a,this.a=!1,AC(this.e,new vy(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(IU,`EcoreEMap/Unsettable/UnsettableDelegateEObjectContainmentEList`,1221),q(1189,215,CI,GPe),Q.a=!1,Q.b=!1,L(IU,`EcoreUtil/Copier`,1189),q(759,1,VP,aVe),Q.Nb=function(e){Om(this,e)},Q.Ob=function(){return M0e(this)},Q.Pb=function(){var e;return M0e(this),e=this.b,this.b=null,e},Q.Qb=function(){this.a.Qb()},L(IU,`EcoreUtil/ProperContentIterator`,759),q(1528,1527,{},ede);var bHt;L(IU,`EcoreValidator`,1528);var xHt;gp(IU,`FeatureMapUtil/Validator`),q(1295,1,{2041:1},Zce),Q.am=function(e){return!0},L(IU,`FeatureMapUtil/1`,1295),q(773,1,{2041:1},Egt),Q.am=function(e){var t;return this.c==e||(t=Od(xh(this.a,e)),t==null?_lt(this,e)?(PUe(this.a,e,(rd(),yG)),!0):(PUe(this.a,e,(rd(),vG)),!1):t==(rd(),yG))},Q.e=!1;var f9;L(IU,`FeatureMapUtil/BasicValidator`,773),q(774,45,CI,Rwe),L(IU,`FeatureMapUtil/BasicValidator/Cache`,774),q(509,56,{20:1,31:1,56:1,16:1,15:1,61:1,79:1,71:1,97:1},Qc),Q.bd=function(e,t){Mst(this.c,this.b,e,t)},Q.Fc=function(e){return cut(this.c,this.b,e)},Q.cd=function(e,t){return vpt(this.c,this.b,e,t)},Q.Gc=function(e){return Su(this,e)},Q.Gi=function(e,t){$Ke(this.c,this.b,e,t)},Q.Wk=function(e,t){return plt(this.c,this.b,e,t)},Q.$i=function(e){return CN(this.c,this.b,e,!1)},Q.Ii=function(){return BCe(this.c,this.b)},Q.Ji=function(){return VCe(this.c,this.b)},Q.Ki=function(e){return GWe(this.c,this.b,e)},Q.Xk=function(e,t){return NDe(this,e,t)},Q.$b=function(){qr(this)},Q.Hc=function(e){return Kv(this.c,this.b,e)},Q.Ic=function(e){return MYe(this.c,this.b,e)},Q.Xb=function(e){return CN(this.c,this.b,e,!0)},Q.Fk=function(e){return this},Q.dd=function(e){return cHe(this.c,this.b,e)},Q.dc=function(){return tl(this)},Q.Qj=function(){return!lD(this.c,this.b)},Q.Kc=function(){return SKe(this.c,this.b)},Q.ed=function(){return CKe(this.c,this.b)},Q.fd=function(e){return p1e(this.c,this.b,e)},Q.Ti=function(e,t){return Ndt(this.c,this.b,e,t)},Q.Ui=function(e,t){XWe(this.c,this.b,e,t)},Q.gd=function(e){return _et(this.c,this.b,e)},Q.Mc=function(e){return eut(this.c,this.b,e)},Q.hd=function(e,t){return sft(this.c,this.b,e,t)},Q.Wb=function(e){_j(this.c,this.b),Su(this,P(e,15))},Q.gc=function(){return f1e(this.c,this.b)},Q.Pc=function(){return mBe(this.c,this.b)},Q.Qc=function(e){return lHe(this.c,this.b,e)},Q.Ib=function(){var e,t=new $i;for(t.a+=`[`,e=BCe(this.c,this.b);Uw(e);)pl(t,Uu(MO(e))),Uw(e)&&(t.a+=PP);return t.a+=`]`,t.a},Q.Gk=function(){_j(this.c,this.b)},L(IU,`FeatureMapUtil/FeatureEList`,509),q(644,39,NU,ey),Q.hj=function(e){return BT(this,e)},Q.mj=function(e){var t,n,r,i,a,o,s;switch(this.d){case 1:case 2:if(a=e.jj(),A(a)===A(this.c)&&BT(this,null)==e.hj(null))return this.g=e.ij(),e.gj()==1&&(this.d=1),!0;break;case 3:if(i=e.gj(),i===3&&(a=e.jj(),A(a)===A(this.c)&&BT(this,null)==e.hj(null)))return this.d=5,t=new kx(2),tb(t,this.g),tb(t,e.ij()),this.g=t,!0;break;case 5:if(i=e.gj(),i===3&&(a=e.jj(),A(a)===A(this.c)&&BT(this,null)==e.hj(null)))return n=P(this.g,16),n.Fc(e.ij()),!0;break;case 4:switch(i=e.gj(),i){case 3:if(a=e.jj(),A(a)===A(this.c)&&BT(this,null)==e.hj(null))return this.d=1,this.g=e.ij(),!0;break;case 4:if(a=e.jj(),A(a)===A(this.c)&&BT(this,null)==e.hj(null))return this.d=6,s=new kx(2),tb(s,this.n),tb(s,e.kj()),this.n=s,o=U(O(q9,1),HF,28,15,[this.o,e.lj()]),this.g=o,!0}break;case 6:if(i=e.gj(),i===4&&(a=e.jj(),A(a)===A(this.c)&&BT(this,null)==e.hj(null)))return n=P(this.n,16),n.Fc(e.kj()),o=P(this.g,53),r=V(q9,HF,28,o.length+1,15,1),tN(o,0,r,0,o.length),r[o.length]=e.lj(),this.g=r,!0}return!1},L(IU,`FeatureMapUtil/FeatureENotificationImpl`,644),q(564,509,{20:1,31:1,56:1,16:1,15:1,61:1,79:1,160:1,220:1,2036:1,71:1,97:1},hp),Q.Ol=function(e,t){return cut(this.c,e,t)},Q.Pl=function(e,t,n){return plt(this.c,e,t,n)},Q.Ql=function(e,t,n){return Xft(this.c,e,t,n)},Q.Rl=function(){return this},Q.Sl=function(e,t){return SN(this.c,e,t)},Q.Tl=function(e){return P(CN(this.c,this.b,e,!1),76).Lk()},Q.Ul=function(e){return P(CN(this.c,this.b,e,!1),76).md()},Q.Vl=function(){return this.a},Q.Wl=function(e){return!lD(this.c,e)},Q.Xl=function(e,t){ON(this.c,e,t)},Q.Yl=function(e){return LJe(this.c,e)},Q.Zl=function(e){v3e(this.c,e)},L(IU,`FeatureMapUtil/FeatureFeatureMap`,564),q(1294,1,LU,ZSe),Q.Fk=function(e){return CN(this.b,this.a,-1,e)},Q.Qj=function(){return!lD(this.b,this.a)},Q.Wb=function(e){ON(this.b,this.a,e)},Q.Gk=function(){_j(this.b,this.a)},L(IU,`FeatureMapUtil/FeatureValue`,1294);var p9,m9,h9,g9,SHt,_9=gp(wW,`AnyType`);q(680,63,SF,Hi),L(wW,`InvalidDatatypeValueException`,680);var v9=gp(wW,Hwt),y9=gp(wW,Uwt),CHt=gp(wW,Wwt),wHt,b9,THt,x9,EHt,DHt,OHt,kHt,AHt,jHt,MHt,NHt,PHt,FHt,IHt,S9,LHt,C9,w9,RHt,T9,E9,D9,zHt,O9,k9;q(844,516,{110:1,94:1,93:1,58:1,54:1,99:1,857:1},g_e),Q.Lh=function(e,t,n){switch(e){case 0:return n?(!this.c&&(this.c=new DC(this,0)),this.c):(!this.c&&(this.c=new DC(this,0)),this.c.b);case 1:return n?(!this.c&&(this.c=new DC(this,0)),P(Z_(this.c,(UN(),x9)),160)):(!this.c&&(this.c=new DC(this,0)),P(P(Z_(this.c,(UN(),x9)),160),220)).Vl();case 2:return n?(!this.b&&(this.b=new DC(this,2)),this.b):(!this.b&&(this.b=new DC(this,2)),this.b.b)}return xb(this,e-bh(this.ii()),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():this.ii(),e),t,n)},Q.Uh=function(e,t,n){var r;switch(t){case 0:return!this.c&&(this.c=new DC(this,0)),zM(this.c,e,n);case 1:return(!this.c&&(this.c=new DC(this,0)),P(P(Z_(this.c,(UN(),x9)),160),71)).Xk(e,n);case 2:return!this.b&&(this.b=new DC(this,2)),zM(this.b,e,n)}return r=P(_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():this.ii(),t),69),r.wk().Ak(this,Jb(this),t-bh(this.ii()),e,n)},Q.Wh=function(e){switch(e){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new DC(this,0)),P(Z_(this.c,(UN(),x9)),160)).dc();case 2:return!!this.b&&this.b.i!=0}return Hv(this,e-bh(this.ii()),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():this.ii(),e))},Q.bi=function(e,t){switch(e){case 0:!this.c&&(this.c=new DC(this,0)),qm(this.c,t);return;case 1:(!this.c&&(this.c=new DC(this,0)),P(P(Z_(this.c,(UN(),x9)),160),220)).Wb(t);return;case 2:!this.b&&(this.b=new DC(this,2)),qm(this.b,t);return}LE(this,e-bh(this.ii()),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():this.ii(),e),t)},Q.ii=function(){return UN(),THt},Q.ki=function(e){switch(e){case 0:!this.c&&(this.c=new DC(this,0)),RN(this.c);return;case 1:(!this.c&&(this.c=new DC(this,0)),P(Z_(this.c,(UN(),x9)),160)).$b();return;case 2:!this.b&&(this.b=new DC(this,2)),RN(this.b);return}PT(this,e-bh(this.ii()),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():this.ii(),e))},Q.Ib=function(){var e;return this.j&4?Aj(this):(e=new Wu(Aj(this)),e.a+=` (mixed: `,fl(e,this.c),e.a+=`, anyAttribute: `,fl(e,this.b),e.a+=`)`,e.a)},L(TW,`AnyTypeImpl`,844),q(681,516,{110:1,94:1,93:1,58:1,54:1,99:1,2119:1,681:1},cle),Q.Lh=function(e,t,n){switch(e){case 0:return this.a;case 1:return this.b}return xb(this,e-bh((UN(),S9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():S9,e),t,n)},Q.Wh=function(e){switch(e){case 0:return this.a!=null;case 1:return this.b!=null}return Hv(this,e-bh((UN(),S9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():S9,e))},Q.bi=function(e,t){switch(e){case 0:bfe(this,kd(t));return;case 1:Sfe(this,kd(t));return}LE(this,e-bh((UN(),S9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():S9,e),t)},Q.ii=function(){return UN(),S9},Q.ki=function(e){switch(e){case 0:this.a=null;return;case 1:this.b=null;return}PT(this,e-bh((UN(),S9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():S9,e))},Q.Ib=function(){var e;return this.j&4?Aj(this):(e=new Wu(Aj(this)),e.a+=` (data: `,pl(e,this.a),e.a+=`, target: `,pl(e,this.b),e.a+=`)`,e.a)},Q.a=null,Q.b=null,L(TW,`ProcessingInstructionImpl`,681),q(682,844,{110:1,94:1,93:1,58:1,54:1,99:1,857:1,2120:1,682:1},__e),Q.Lh=function(e,t,n){switch(e){case 0:return n?(!this.c&&(this.c=new DC(this,0)),this.c):(!this.c&&(this.c=new DC(this,0)),this.c.b);case 1:return n?(!this.c&&(this.c=new DC(this,0)),P(Z_(this.c,(UN(),x9)),160)):(!this.c&&(this.c=new DC(this,0)),P(P(Z_(this.c,(UN(),x9)),160),220)).Vl();case 2:return n?(!this.b&&(this.b=new DC(this,2)),this.b):(!this.b&&(this.b=new DC(this,2)),this.b.b);case 3:return!this.c&&(this.c=new DC(this,0)),kd(SN(this.c,(UN(),w9),!0));case 4:return df(this.a,(!this.c&&(this.c=new DC(this,0)),kd(SN(this.c,(UN(),w9),!0))));case 5:return this.a}return xb(this,e-bh((UN(),C9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():C9,e),t,n)},Q.Wh=function(e){switch(e){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new DC(this,0)),P(Z_(this.c,(UN(),x9)),160)).dc();case 2:return!!this.b&&this.b.i!=0;case 3:return!this.c&&(this.c=new DC(this,0)),kd(SN(this.c,(UN(),w9),!0))!=null;case 4:return df(this.a,(!this.c&&(this.c=new DC(this,0)),kd(SN(this.c,(UN(),w9),!0))))!=null;case 5:return!!this.a}return Hv(this,e-bh((UN(),C9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():C9,e))},Q.bi=function(e,t){switch(e){case 0:!this.c&&(this.c=new DC(this,0)),qm(this.c,t);return;case 1:(!this.c&&(this.c=new DC(this,0)),P(P(Z_(this.c,(UN(),x9)),160),220)).Wb(t);return;case 2:!this.b&&(this.b=new DC(this,2)),qm(this.b,t);return;case 3:pBe(this,kd(t));return;case 4:pBe(this,uf(this.a,t));return;case 5:xfe(this,P(t,156));return}LE(this,e-bh((UN(),C9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():C9,e),t)},Q.ii=function(){return UN(),C9},Q.ki=function(e){switch(e){case 0:!this.c&&(this.c=new DC(this,0)),RN(this.c);return;case 1:(!this.c&&(this.c=new DC(this,0)),P(Z_(this.c,(UN(),x9)),160)).$b();return;case 2:!this.b&&(this.b=new DC(this,2)),RN(this.b);return;case 3:!this.c&&(this.c=new DC(this,0)),ON(this.c,(UN(),w9),null);return;case 4:pBe(this,uf(this.a,null));return;case 5:this.a=null;return}PT(this,e-bh((UN(),C9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():C9,e))},L(TW,`SimpleAnyTypeImpl`,682),q(683,516,{110:1,94:1,93:1,58:1,54:1,99:1,2121:1,683:1},v_e),Q.Lh=function(e,t,n){switch(e){case 0:return n?(!this.a&&(this.a=new DC(this,0)),this.a):(!this.a&&(this.a=new DC(this,0)),this.a.b);case 1:return n?(!this.b&&(this.b=new lb((CP(),$7),o9,this,1)),this.b):(!this.b&&(this.b=new lb((CP(),$7),o9,this,1)),Jy(this.b));case 2:return n?(!this.c&&(this.c=new lb((CP(),$7),o9,this,2)),this.c):(!this.c&&(this.c=new lb((CP(),$7),o9,this,2)),Jy(this.c));case 3:return!this.a&&(this.a=new DC(this,0)),Z_(this.a,(UN(),E9));case 4:return!this.a&&(this.a=new DC(this,0)),Z_(this.a,(UN(),D9));case 5:return!this.a&&(this.a=new DC(this,0)),Z_(this.a,(UN(),O9));case 6:return!this.a&&(this.a=new DC(this,0)),Z_(this.a,(UN(),k9))}return xb(this,e-bh((UN(),T9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():T9,e),t,n)},Q.Uh=function(e,t,n){var r;switch(t){case 0:return!this.a&&(this.a=new DC(this,0)),zM(this.a,e,n);case 1:return!this.b&&(this.b=new lb((CP(),$7),o9,this,1)),gf(this.b,e,n);case 2:return!this.c&&(this.c=new lb((CP(),$7),o9,this,2)),gf(this.c,e,n);case 5:return!this.a&&(this.a=new DC(this,0)),NDe(Z_(this.a,(UN(),O9)),e,n)}return r=P(_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():(UN(),T9),t),69),r.wk().Ak(this,Jb(this),t-bh((UN(),T9)),e,n)},Q.Wh=function(e){switch(e){case 0:return!!this.a&&this.a.i!=0;case 1:return!!this.b&&this.b.f!=0;case 2:return!!this.c&&this.c.f!=0;case 3:return!this.a&&(this.a=new DC(this,0)),!tl(Z_(this.a,(UN(),E9)));case 4:return!this.a&&(this.a=new DC(this,0)),!tl(Z_(this.a,(UN(),D9)));case 5:return!this.a&&(this.a=new DC(this,0)),!tl(Z_(this.a,(UN(),O9)));case 6:return!this.a&&(this.a=new DC(this,0)),!tl(Z_(this.a,(UN(),k9)))}return Hv(this,e-bh((UN(),T9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():T9,e))},Q.bi=function(e,t){switch(e){case 0:!this.a&&(this.a=new DC(this,0)),qm(this.a,t);return;case 1:!this.b&&(this.b=new lb((CP(),$7),o9,this,1)),bC(this.b,t);return;case 2:!this.c&&(this.c=new lb((CP(),$7),o9,this,2)),bC(this.c,t);return;case 3:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),E9))),!this.a&&(this.a=new DC(this,0)),Su(Z_(this.a,E9),P(t,16));return;case 4:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),D9))),!this.a&&(this.a=new DC(this,0)),Su(Z_(this.a,D9),P(t,16));return;case 5:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),O9))),!this.a&&(this.a=new DC(this,0)),Su(Z_(this.a,O9),P(t,16));return;case 6:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),k9))),!this.a&&(this.a=new DC(this,0)),Su(Z_(this.a,k9),P(t,16));return}LE(this,e-bh((UN(),T9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():T9,e),t)},Q.ii=function(){return UN(),T9},Q.ki=function(e){switch(e){case 0:!this.a&&(this.a=new DC(this,0)),RN(this.a);return;case 1:!this.b&&(this.b=new lb((CP(),$7),o9,this,1)),this.b.c.$b();return;case 2:!this.c&&(this.c=new lb((CP(),$7),o9,this,2)),this.c.c.$b();return;case 3:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),E9)));return;case 4:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),D9)));return;case 5:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),O9)));return;case 6:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),k9)));return}PT(this,e-bh((UN(),T9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():T9,e))},Q.Ib=function(){var e;return this.j&4?Aj(this):(e=new Wu(Aj(this)),e.a+=` (mixed: `,fl(e,this.a),e.a+=`)`,e.a)},L(TW,`XMLTypeDocumentRootImpl`,683),q(2028,720,{110:1,94:1,93:1,480:1,155:1,58:1,114:1,54:1,99:1,158:1,119:1,120:1,2122:1},Qce),Q.ri=function(e,t){switch(e.hk()){case 7:case 8:case 9:case 10:case 16:case 22:case 23:case 24:case 25:case 26:case 32:case 33:case 34:case 36:case 37:case 44:case 45:case 50:case 51:case 53:case 55:case 56:case 57:case 58:case 60:case 61:case 4:return t==null?null:PE(t);case 19:case 28:case 29:case 35:case 38:case 39:case 41:case 46:case 52:case 54:case 5:return kd(t);case 6:return rDe(P(t,195));case 12:case 47:case 49:case 11:return yht(this,e,t);case 13:return t==null?null:Cpt(P(t,247));case 15:case 14:return t==null?null:LPe(D(N(t)));case 17:return p5e((UN(),t));case 18:return p5e(t);case 21:case 20:return t==null?null:RPe(P(t,161).a);case 27:return iDe(P(t,195));case 30:return y3e((UN(),P(t,15)));case 31:return y3e(P(t,15));case 40:return oDe((UN(),t));case 42:return m5e((UN(),t));case 43:return m5e(t);case 59:case 48:return aDe((UN(),t));default:throw E(new Fi(YH+e.xe()+XH))}},Q.si=function(e){var t,n,r,i,a;switch(e.G==-1&&(e.G=(n=Mx(e),n?NO(n.vi(),e):-1)),e.G){case 0:return t=new g_e,t;case 1:return r=new cle,r;case 2:return i=new __e,i;case 3:return a=new v_e,a;default:throw E(new Fi($H+e.zb+XH))}},Q.ti=function(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_;switch(e.hk()){case 5:case 52:case 4:return t;case 6:return J2e(t);case 8:case 7:return t==null?null:D5e(t);case 9:return t==null?null:Gb(GM((r=EN(t,!0),r.length>0&&(sv(0,r.length),r.charCodeAt(0)==43)?(sv(1,r.length+1),r.substr(1)):r),-128,127)<<24>>24);case 10:return t==null?null:Gb(GM((i=EN(t,!0),i.length>0&&(sv(0,i.length),i.charCodeAt(0)==43)?(sv(1,i.length+1),i.substr(1)):i),-128,127)<<24>>24);case 11:return kd(uP(this,(UN(),OHt),t));case 12:return kd(uP(this,(UN(),kHt),t));case 13:return t==null?null:new xye(EN(t,!0));case 15:case 14:return Eat(t);case 16:return kd(uP(this,(UN(),AHt),t));case 17:return V0e((UN(),t));case 18:return V0e(t);case 28:case 29:case 35:case 38:case 39:case 41:case 54:case 19:return EN(t,!0);case 21:case 20:return zat(t);case 22:return kd(uP(this,(UN(),jHt),t));case 23:return kd(uP(this,(UN(),MHt),t));case 24:return kd(uP(this,(UN(),NHt),t));case 25:return kd(uP(this,(UN(),PHt),t));case 26:return kd(uP(this,(UN(),FHt),t));case 27:return A2e(t);case 30:return H0e((UN(),t));case 31:return H0e(t);case 32:return t==null?null:G(GM((u=EN(t,!0),u.length>0&&(sv(0,u.length),u.charCodeAt(0)==43)?(sv(1,u.length+1),u.substr(1)):u),xF,AP));case 33:return t==null?null:new ru((d=EN(t,!0),d.length>0&&(sv(0,d.length),d.charCodeAt(0)==43)?(sv(1,d.length+1),d.substr(1)):d));case 34:return t==null?null:G(GM((f=EN(t,!0),f.length>0&&(sv(0,f.length),f.charCodeAt(0)==43)?(sv(1,f.length+1),f.substr(1)):f),xF,AP));case 36:return t==null?null:JD(aP((p=EN(t,!0),p.length>0&&(sv(0,p.length),p.charCodeAt(0)==43)?(sv(1,p.length+1),p.substr(1)):p)));case 37:return t==null?null:JD(aP((m=EN(t,!0),m.length>0&&(sv(0,m.length),m.charCodeAt(0)==43)?(sv(1,m.length+1),m.substr(1)):m)));case 40:return e3e((UN(),t));case 42:return U0e((UN(),t));case 43:return U0e(t);case 44:return t==null?null:new ru((h=EN(t,!0),h.length>0&&(sv(0,h.length),h.charCodeAt(0)==43)?(sv(1,h.length+1),h.substr(1)):h));case 45:return t==null?null:new ru((g=EN(t,!0),g.length>0&&(sv(0,g.length),g.charCodeAt(0)==43)?(sv(1,g.length+1),g.substr(1)):g));case 46:return EN(t,!1);case 47:return kd(uP(this,(UN(),IHt),t));case 59:case 48:return $4e((UN(),t));case 49:return kd(uP(this,(UN(),LHt),t));case 50:return t==null?null:xT(GM((_=EN(t,!0),_.length>0&&(sv(0,_.length),_.charCodeAt(0)==43)?(sv(1,_.length+1),_.substr(1)):_),aW,32767)<<16>>16);case 51:return t==null?null:xT(GM((a=EN(t,!0),a.length>0&&(sv(0,a.length),a.charCodeAt(0)==43)?(sv(1,a.length+1),a.substr(1)):a),aW,32767)<<16>>16);case 53:return kd(uP(this,(UN(),RHt),t));case 55:return t==null?null:xT(GM((o=EN(t,!0),o.length>0&&(sv(0,o.length),o.charCodeAt(0)==43)?(sv(1,o.length+1),o.substr(1)):o),aW,32767)<<16>>16);case 56:return t==null?null:xT(GM((s=EN(t,!0),s.length>0&&(sv(0,s.length),s.charCodeAt(0)==43)?(sv(1,s.length+1),s.substr(1)):s),aW,32767)<<16>>16);case 57:return t==null?null:JD(aP((c=EN(t,!0),c.length>0&&(sv(0,c.length),c.charCodeAt(0)==43)?(sv(1,c.length+1),c.substr(1)):c)));case 58:return t==null?null:JD(aP((l=EN(t,!0),l.length>0&&(sv(0,l.length),l.charCodeAt(0)==43)?(sv(1,l.length+1),l.substr(1)):l)));case 60:return t==null?null:G(GM((n=EN(t,!0),n.length>0&&(sv(0,n.length),n.charCodeAt(0)==43)?(sv(1,n.length+1),n.substr(1)):n),xF,AP));case 61:return t==null?null:G(GM(EN(t,!0),xF,AP));default:throw E(new Fi(YH+e.xe()+XH))}};var BHt,VHt,HHt,UHt;L(TW,`XMLTypeFactoryImpl`,2028),q(594,184,{110:1,94:1,93:1,155:1,197:1,58:1,241:1,114:1,54:1,99:1,158:1,184:1,119:1,120:1,690:1,2044:1,594:1},NFe),Q.N=!1,Q.O=!1;var WHt=!1;L(TW,`XMLTypePackageImpl`,594),q(1961,1,{851:1},$ce),Q.Kk=function(){return Odt(),lUt},L(TW,`XMLTypePackageImpl/1`,1961),q(1970,1,lW,ele),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/10`,1970),q(1971,1,lW,tle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/11`,1971),q(1972,1,lW,nle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/12`,1972),q(1973,1,lW,rle),Q.fk=function(e){return al(e)},Q.gk=function(e){return V(TG,X,345,e,7,1)},L(TW,`XMLTypePackageImpl/13`,1973),q(1974,1,lW,ile),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/14`,1974),q(1975,1,lW,ale),Q.fk=function(e){return j(e,15)},Q.gk=function(e){return V(JW,BL,15,e,0,1)},L(TW,`XMLTypePackageImpl/15`,1975),q(1976,1,lW,ole),Q.fk=function(e){return j(e,15)},Q.gk=function(e){return V(JW,BL,15,e,0,1)},L(TW,`XMLTypePackageImpl/16`,1976),q(1977,1,lW,sle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/17`,1977),q(1978,1,lW,lle),Q.fk=function(e){return j(e,161)},Q.gk=function(e){return V(EG,X,161,e,0,1)},L(TW,`XMLTypePackageImpl/18`,1978),q(1979,1,lW,ule),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/19`,1979),q(1962,1,lW,dle),Q.fk=function(e){return j(e,857)},Q.gk=function(e){return V(_9,FP,857,e,0,1)},L(TW,`XMLTypePackageImpl/2`,1962),q(1980,1,lW,fle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/20`,1980),q(1981,1,lW,ple),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/21`,1981),q(1982,1,lW,mle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/22`,1982),q(1983,1,lW,hle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/23`,1983),q(1984,1,lW,gle),Q.fk=function(e){return j(e,195)},Q.gk=function(e){return V(X9,X,195,e,0,2)},L(TW,`XMLTypePackageImpl/24`,1984),q(1985,1,lW,_le),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/25`,1985),q(1986,1,lW,vle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/26`,1986),q(1987,1,lW,yle),Q.fk=function(e){return j(e,15)},Q.gk=function(e){return V(JW,BL,15,e,0,1)},L(TW,`XMLTypePackageImpl/27`,1987),q(1988,1,lW,ble),Q.fk=function(e){return j(e,15)},Q.gk=function(e){return V(JW,BL,15,e,0,1)},L(TW,`XMLTypePackageImpl/28`,1988),q(1989,1,lW,xle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/29`,1989),q(1963,1,lW,Sle),Q.fk=function(e){return j(e,681)},Q.gk=function(e){return V(v9,FP,2119,e,0,1)},L(TW,`XMLTypePackageImpl/3`,1963),q(1990,1,lW,Cle),Q.fk=function(e){return j(e,17)},Q.gk=function(e){return V(DG,X,17,e,0,1)},L(TW,`XMLTypePackageImpl/30`,1990),q(1991,1,lW,wle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/31`,1991),q(1992,1,lW,Tle),Q.fk=function(e){return j(e,168)},Q.gk=function(e){return V(kG,X,168,e,0,1)},L(TW,`XMLTypePackageImpl/32`,1992),q(1993,1,lW,Ele),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/33`,1993),q(1994,1,lW,Dle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/34`,1994),q(1995,1,lW,Ole),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/35`,1995),q(1996,1,lW,kle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/36`,1996),q(1997,1,lW,Ale),Q.fk=function(e){return j(e,15)},Q.gk=function(e){return V(JW,BL,15,e,0,1)},L(TW,`XMLTypePackageImpl/37`,1997),q(1998,1,lW,jle),Q.fk=function(e){return j(e,15)},Q.gk=function(e){return V(JW,BL,15,e,0,1)},L(TW,`XMLTypePackageImpl/38`,1998),q(1999,1,lW,Mle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/39`,1999),q(1964,1,lW,Nle),Q.fk=function(e){return j(e,682)},Q.gk=function(e){return V(y9,FP,2120,e,0,1)},L(TW,`XMLTypePackageImpl/4`,1964),q(2e3,1,lW,Ple),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/40`,2e3),q(2001,1,lW,Fle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/41`,2001),q(2002,1,lW,Ile),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/42`,2002),q(2003,1,lW,Lle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/43`,2003),q(2004,1,lW,Rle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/44`,2004),q(2005,1,lW,zle),Q.fk=function(e){return j(e,191)},Q.gk=function(e){return V(PG,X,191,e,0,1)},L(TW,`XMLTypePackageImpl/45`,2005),q(2006,1,lW,Ble),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/46`,2006),q(2007,1,lW,Vle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/47`,2007),q(2008,1,lW,Hle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/48`,2008),q(2009,1,lW,Ule),Q.fk=function(e){return j(e,191)},Q.gk=function(e){return V(PG,X,191,e,0,1)},L(TW,`XMLTypePackageImpl/49`,2009),q(1965,1,lW,Wle),Q.fk=function(e){return j(e,683)},Q.gk=function(e){return V(CHt,FP,2121,e,0,1)},L(TW,`XMLTypePackageImpl/5`,1965),q(2010,1,lW,Gle),Q.fk=function(e){return j(e,168)},Q.gk=function(e){return V(kG,X,168,e,0,1)},L(TW,`XMLTypePackageImpl/50`,2010),q(2011,1,lW,Kle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/51`,2011),q(2012,1,lW,qle),Q.fk=function(e){return j(e,17)},Q.gk=function(e){return V(DG,X,17,e,0,1)},L(TW,`XMLTypePackageImpl/52`,2012),q(1966,1,lW,Jle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/6`,1966),q(1967,1,lW,Yle),Q.fk=function(e){return j(e,195)},Q.gk=function(e){return V(X9,X,195,e,0,2)},L(TW,`XMLTypePackageImpl/7`,1967),q(1968,1,lW,Xle),Q.fk=function(e){return il(e)},Q.gk=function(e){return V(bG,X,485,e,8,1)},L(TW,`XMLTypePackageImpl/8`,1968),q(1969,1,lW,Zle),Q.fk=function(e){return j(e,222)},Q.gk=function(e){return V(xG,X,222,e,0,1)},L(TW,`XMLTypePackageImpl/9`,1969);var A9,j9,M9,N9,$;q(55,63,SF,Ui),L(MW,`RegEx/ParseException`,55),q(836,1,{},Qle),Q.bm=function(e){return en*16)throw E(new Ui(TP((fu(),KCt))));n=n*16+i}while(!0);if(this.a!=125)throw E(new Ui(TP((fu(),qCt))));if(n>NW)throw E(new Ui(TP((fu(),JCt))));e=n}else{if(i=0,this.c!=0||(i=rk(this.a))<0||(n=i,hP(this),this.c!=0||(i=rk(this.a))<0))throw E(new Ui(TP((fu(),jU))));n=n*16+i,e=n}break;case 117:if(r=0,hP(this),this.c!=0||(r=rk(this.a))<0||(t=r,hP(this),this.c!=0||(r=rk(this.a))<0)||(t=t*16+r,hP(this),this.c!=0||(r=rk(this.a))<0)||(t=t*16+r,hP(this),this.c!=0||(r=rk(this.a))<0))throw E(new Ui(TP((fu(),jU))));t=t*16+r,e=t;break;case 118:if(hP(this),this.c!=0||(r=rk(this.a))<0||(t=r,hP(this),this.c!=0||(r=rk(this.a))<0)||(t=t*16+r,hP(this),this.c!=0||(r=rk(this.a))<0)||(t=t*16+r,hP(this),this.c!=0||(r=rk(this.a))<0)||(t=t*16+r,hP(this),this.c!=0||(r=rk(this.a))<0)||(t=t*16+r,hP(this),this.c!=0||(r=rk(this.a))<0))throw E(new Ui(TP((fu(),jU))));if(t=t*16+r,t>NW)throw E(new Ui(TP((fu(),`parser.descappe.4`))));e=t;break;case 65:case 90:case 122:throw E(new Ui(TP((fu(),YCt))))}return e},Q.dm=function(e){var t,n;switch(e){case 100:n=(this.e&32)==32?oP(`Nd`,!0):(xP(),z9);break;case 68:n=(this.e&32)==32?oP(`Nd`,!1):(xP(),QHt);break;case 119:n=(this.e&32)==32?oP(`IsWord`,!0):(xP(),U9);break;case 87:n=(this.e&32)==32?oP(`IsWord`,!1):(xP(),eUt);break;case 115:n=(this.e&32)==32?oP(`IsSpace`,!0):(xP(),H9);break;case 83:n=(this.e&32)==32?oP(`IsSpace`,!1):(xP(),$Ht);break;default:throw E(new yi((t=e,uTt+t.toString(16))))}return n},Q.em=function(e){var t,n,r,i,a,o,s,c,l,u,d,f;for(this.b=1,hP(this),t=null,this.c==0&&this.a==94?(hP(this),e?u=(xP(),xP(),++W9,new pv(5)):(t=(xP(),xP(),++W9,new pv(4)),oM(t,0,NW),u=(++W9,new pv(4)))):u=(xP(),xP(),++W9,new pv(4)),i=!0;(f=this.c)!=1&&!(f==0&&this.a==93&&!i);){if(i=!1,n=this.a,r=!1,f==10)switch(n){case 100:case 68:case 119:case 87:case 115:case 83:DN(u,this.dm(n)),r=!0;break;case 105:case 73:case 99:case 67:n=this.um(u,n),n<0&&(r=!0);break;case 112:case 80:if(d=Ont(this,n),!d)throw E(new Ui(TP((fu(),OU))));DN(u,d),r=!0;break;default:n=this.cm()}else if(f==20){if(o=fd(this.i,58,this.d),o<0)throw E(new Ui(TP((fu(),RCt))));if(s=!0,mg(this.i,this.d)==94&&(++this.d,s=!1),a=p_(this.i,this.d,o),c=dGe(a,s,(this.e&512)==512),!c)throw E(new Ui(TP((fu(),zCt))));if(DN(u,c),r=!0,o+1>=this.j||mg(this.i,o+1)!=93)throw E(new Ui(TP((fu(),RCt))));this.d=o+2}if(hP(this),!r)if(this.c!=0||this.a!=45)oM(u,n,n);else{if(hP(this),(f=this.c)==1)throw E(new Ui(TP((fu(),kU))));f==0&&this.a==93?(oM(u,n,n),oM(u,45,45)):(l=this.a,f==10&&(l=this.cm()),hP(this),oM(u,n,l))}(this.e&pF)==pF&&this.c==0&&this.a==44&&hP(this)}if(this.c==1)throw E(new Ui(TP((fu(),kU))));return t&&(KN(t,u),u=t),kj(u),FN(u),this.b=0,hP(this),u},Q.fm=function(){for(var e,t,n=this.em(!1),r;(r=this.c)!=7;)if(e=this.a,r==0&&(e==45||e==38)||r==4){if(hP(this),this.c!=9)throw E(new Ui(TP((fu(),UCt))));if(t=this.em(!1),r==4)DN(n,t);else if(e==45)KN(n,t);else if(e==38)iht(n,t);else throw E(new yi(`ASSERT`))}else throw E(new Ui(TP((fu(),WCt))));return hP(this),n},Q.gm=function(){var e=this.a-48,t=(xP(),xP(),++W9,new __(12,null,e));return!this.g&&(this.g=new Yr),Gr(this.g,new Xhe(e)),hP(this),t},Q.hm=function(){return hP(this),xP(),nUt},Q.im=function(){return hP(this),xP(),tUt},Q.jm=function(){throw E(new Ui(TP((fu(),MU))))},Q.km=function(){throw E(new Ui(TP((fu(),MU))))},Q.lm=function(){return hP(this),eQe()},Q.mm=function(){return hP(this),xP(),iUt},Q.nm=function(){return hP(this),xP(),oUt},Q.om=function(){var e;if(this.d>=this.j||((e=mg(this.i,this.d++))&65504)!=64)throw E(new Ui(TP((fu(),PCt))));return hP(this),xP(),xP(),++W9,new zp(0,e-64)},Q.pm=function(){return hP(this),Qdt()},Q.qm=function(){return hP(this),xP(),sUt},Q.rm=function(){var e=(xP(),xP(),++W9,new zp(0,105));return hP(this),e},Q.sm=function(){return hP(this),xP(),aUt},Q.tm=function(){return hP(this),xP(),rUt},Q.um=function(e,t){return this.cm()},Q.vm=function(){return hP(this),xP(),XHt},Q.wm=function(){var e,t,n,r,i;if(this.d+1>=this.j)throw E(new Ui(TP((fu(),jCt))));if(r=-1,t=null,e=mg(this.i,this.d),49<=e&&e<=57){if(r=e-48,!this.g&&(this.g=new Yr),Gr(this.g,new Xhe(r)),++this.d,mg(this.i,this.d)!=41)throw E(new Ui(TP((fu(),DU))));++this.d}else switch(e==63&&--this.d,hP(this),t=Q_t(this),t.e){case 20:case 21:case 22:case 23:break;case 8:if(this.c!=7)throw E(new Ui(TP((fu(),DU))));break;default:throw E(new Ui(TP((fu(),MCt))))}if(hP(this),i=zD(this),n=null,i.e==2){if(i.Pm()!=2)throw E(new Ui(TP((fu(),NCt))));n=i.Lm(1),i=i.Lm(0)}if(this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),xP(),xP(),++W9,new hKe(r,t,i,n)},Q.xm=function(){return hP(this),xP(),ZHt},Q.ym=function(){var e;if(hP(this),e=Em(24,zD(this)),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.zm=function(){var e;if(hP(this),e=Em(20,zD(this)),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.Am=function(){var e;if(hP(this),e=Em(22,zD(this)),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.Bm=function(){var e=0,t,n=0,r,i;for(t=-1;this.d=this.j)throw E(new Ui(TP((fu(),kCt))));if(t==45){for(++this.d;this.d=this.j)throw E(new Ui(TP((fu(),kCt))))}if(t==58){if(++this.d,hP(this),r=YPe(zD(this),e,n),this.c!=7)throw E(new Ui(TP((fu(),DU))));hP(this)}else if(t==41)++this.d,hP(this),r=YPe(zD(this),e,n);else throw E(new Ui(TP((fu(),ACt))));return r},Q.Cm=function(){var e;if(hP(this),e=Em(21,zD(this)),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.Dm=function(){var e;if(hP(this),e=Em(23,zD(this)),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.Em=function(){var e,t;if(hP(this),e=this.f++,t=Dm(zD(this),e),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),t},Q.Fm=function(){var e;if(hP(this),e=Dm(zD(this),0),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.Gm=function(e){return hP(this),this.c==5?(hP(this),Rp(e,(xP(),xP(),++W9,new Zv(9,e)))):Rp(e,(xP(),xP(),++W9,new Zv(3,e)))},Q.Hm=function(e){var t;return hP(this),t=(xP(),xP(),++W9,new lu(2)),this.c==5?(hP(this),LN(t,B9),LN(t,e)):(LN(t,e),LN(t,B9)),t},Q.Im=function(e){return hP(this),this.c==5?(hP(this),xP(),xP(),++W9,new Zv(9,e)):(xP(),xP(),++W9,new Zv(3,e))},Q.a=0,Q.b=0,Q.c=0,Q.d=0,Q.e=0,Q.f=1,Q.g=null,Q.j=0,L(MW,`RegEx/RegexParser`,836),q(1947,836,{},y_e),Q.bm=function(e){return!1},Q.cm=function(){return Tct(this)},Q.dm=function(e){return KM(e)},Q.em=function(e){return _vt(this)},Q.fm=function(){throw E(new Ui(TP((fu(),MU))))},Q.gm=function(){throw E(new Ui(TP((fu(),MU))))},Q.hm=function(){throw E(new Ui(TP((fu(),MU))))},Q.im=function(){throw E(new Ui(TP((fu(),MU))))},Q.jm=function(){return hP(this),KM(67)},Q.km=function(){return hP(this),KM(73)},Q.lm=function(){throw E(new Ui(TP((fu(),MU))))},Q.mm=function(){throw E(new Ui(TP((fu(),MU))))},Q.nm=function(){throw E(new Ui(TP((fu(),MU))))},Q.om=function(){return hP(this),KM(99)},Q.pm=function(){throw E(new Ui(TP((fu(),MU))))},Q.qm=function(){throw E(new Ui(TP((fu(),MU))))},Q.rm=function(){return hP(this),KM(105)},Q.sm=function(){throw E(new Ui(TP((fu(),MU))))},Q.tm=function(){throw E(new Ui(TP((fu(),MU))))},Q.um=function(e,t){return DN(e,KM(t)),-1},Q.vm=function(){return hP(this),xP(),xP(),++W9,new zp(0,94)},Q.wm=function(){throw E(new Ui(TP((fu(),MU))))},Q.xm=function(){return hP(this),xP(),xP(),++W9,new zp(0,36)},Q.ym=function(){throw E(new Ui(TP((fu(),MU))))},Q.zm=function(){throw E(new Ui(TP((fu(),MU))))},Q.Am=function(){throw E(new Ui(TP((fu(),MU))))},Q.Bm=function(){throw E(new Ui(TP((fu(),MU))))},Q.Cm=function(){throw E(new Ui(TP((fu(),MU))))},Q.Dm=function(){throw E(new Ui(TP((fu(),MU))))},Q.Em=function(){var e;if(hP(this),e=Dm(zD(this),0),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.Fm=function(){throw E(new Ui(TP((fu(),MU))))},Q.Gm=function(e){return hP(this),Rp(e,(xP(),xP(),++W9,new Zv(3,e)))},Q.Hm=function(e){var t;return hP(this),t=(xP(),xP(),++W9,new lu(2)),LN(t,e),LN(t,B9),t},Q.Im=function(e){return hP(this),xP(),xP(),++W9,new Zv(3,e)};var P9=null,F9=null;L(MW,`RegEx/ParserForXMLSchema`,1947),q(122,1,VW,Tr),Q.Jm=function(e){throw E(new yi(`Not supported.`))},Q.Km=function(){return-1},Q.Lm=function(e){return null},Q.Mm=function(){return null},Q.Nm=function(e){},Q.Om=function(e){},Q.Pm=function(){return 0},Q.Ib=function(){return this.Qm(0)},Q.Qm=function(e){return this.e==11?`.`:``},Q.e=0;var GHt,I9,L9,KHt,qHt,R9=null,z9,JHt=null,YHt,B9,V9=null,XHt,ZHt,QHt,$Ht,eUt,tUt,H9,nUt,rUt,iUt,aUt,U9,oUt,sUt,W9=0,cUt=L(MW,`RegEx/Token`,122);q(138,122,{3:1,138:1,122:1},pv),Q.Qm=function(e){var t,n,r;if(this.e==4)if(this==YHt)n=`.`;else if(this==z9)n=`\\d`;else if(this==U9)n=`\\w`;else if(this==H9)n=`\\s`;else{for(r=new $i,r.a+=`[`,t=0;t0&&(r.a+=`,`),this.b[t]===this.b[t+1]?pl(r,uN(this.b[t])):(pl(r,uN(this.b[t])),r.a+=`-`,pl(r,uN(this.b[t+1])));r.a+=`]`,n=r.a}else if(this==QHt)n=`\\D`;else if(this==eUt)n=`\\W`;else if(this==$Ht)n=`\\S`;else{for(r=new $i,r.a+=`[^`,t=0;t0&&(r.a+=`,`),this.b[t]===this.b[t+1]?pl(r,uN(this.b[t])):(pl(r,uN(this.b[t])),r.a+=`-`,pl(r,uN(this.b[t+1])));r.a+=`]`,n=r.a}return n},Q.a=!1,Q.c=!1,L(MW,`RegEx/RangeToken`,138),q(592,1,{592:1},Xhe),Q.a=0,L(MW,`RegEx/RegexParser/ReferencePosition`,592),q(591,1,{3:1,591:1},Rye),Q.Fb=function(e){var t;return e==null||!j(e,591)?!1:(t=P(e,591),ff(this.b,t.b)&&this.a==t.a)},Q.Hb=function(){return jw(this.b+`/`+Xot(this.a))},Q.Ib=function(){return this.c.Qm(this.a)},Q.a=0,L(MW,`RegEx/RegularExpression`,591),q(228,122,VW,zp),Q.Km=function(){return this.a},Q.Qm=function(e){var t,n,r;switch(this.e){case 0:switch(this.a){case 124:case 42:case 43:case 63:case 40:case 41:case 46:case 91:case 123:case 92:r=`\\`+Xd(this.a&OF);break;case 12:r=`\\f`;break;case 10:r=`\\n`;break;case 13:r=`\\r`;break;case 9:r=`\\t`;break;case 27:r=`\\e`;break;default:this.a>=pI?(n=(t=this.a>>>0,`0`+t.toString(16)),r=`\\v`+p_(n,n.length-6,n.length)):r=``+Xd(this.a&OF)}break;case 8:r=this==XHt||this==ZHt?``+Xd(this.a&OF):`\\`+Xd(this.a&OF);break;default:r=null}return r},Q.a=0,L(MW,`RegEx/Token/CharToken`,228),q(318,122,VW,Zv),Q.Lm=function(e){return this.a},Q.Nm=function(e){this.b=e},Q.Om=function(e){this.c=e},Q.Pm=function(){return 1},Q.Qm=function(e){var t;if(this.e==3)if(this.c<0&&this.b<0)t=this.a.Qm(e)+`*`;else if(this.c==this.b)t=this.a.Qm(e)+`{`+this.c+`}`;else if(this.c>=0&&this.b>=0)t=this.a.Qm(e)+`{`+this.c+`,`+this.b+`}`;else if(this.c>=0&&this.b<0)t=this.a.Qm(e)+`{`+this.c+`,}`;else throw E(new yi(`Token#toString(): CLOSURE `+this.c+PP+this.b));else if(this.c<0&&this.b<0)t=this.a.Qm(e)+`*?`;else if(this.c==this.b)t=this.a.Qm(e)+`{`+this.c+`}?`;else if(this.c>=0&&this.b>=0)t=this.a.Qm(e)+`{`+this.c+`,`+this.b+`}?`;else if(this.c>=0&&this.b<0)t=this.a.Qm(e)+`{`+this.c+`,}?`;else throw E(new yi(`Token#toString(): NONGREEDYCLOSURE `+this.c+PP+this.b));return t},Q.b=0,Q.c=0,L(MW,`RegEx/Token/ClosureToken`,318),q(837,122,VW,Km),Q.Lm=function(e){return e==0?this.a:this.b},Q.Pm=function(){return 2},Q.Qm=function(e){return this.b.e==3&&this.b.Lm(0)==this.a?this.a.Qm(e)+`+`:this.b.e==9&&this.b.Lm(0)==this.a?this.a.Qm(e)+`+?`:this.a.Qm(e)+(``+this.b.Qm(e))},L(MW,`RegEx/Token/ConcatToken`,837),q(1945,122,VW,hKe),Q.Lm=function(e){if(e==0)return this.d;if(e==1)return this.b;throw E(new yi(`Internal Error: `+e))},Q.Pm=function(){return this.b?2:1},Q.Qm=function(e){var t=this.c>0?`(?(`+this.c+`)`:this.a.e==8?`(?(`+this.a+`)`:`(?`+this.a;return this.b?t+=this.d+`|`+this.b+`)`:t+=this.d+`)`,t},Q.c=0,L(MW,`RegEx/Token/ConditionToken`,1945),q(1946,122,VW,Lze),Q.Lm=function(e){return this.b},Q.Pm=function(){return 1},Q.Qm=function(e){return`(?`+(this.a==0?``:Xot(this.a))+(this.c==0?``:Xot(this.c))+`:`+this.b.Qm(e)+`)`},Q.a=0,Q.c=0,L(MW,`RegEx/Token/ModifierToken`,1946),q(838,122,VW,Nh),Q.Lm=function(e){return this.a},Q.Pm=function(){return 1},Q.Qm=function(e){var t=null;switch(this.e){case 6:t=this.b==0?`(?:`+this.a.Qm(e)+`)`:`(`+this.a.Qm(e)+`)`;break;case 20:t=`(?=`+this.a.Qm(e)+`)`;break;case 21:t=`(?!`+this.a.Qm(e)+`)`;break;case 22:t=`(?<=`+this.a.Qm(e)+`)`;break;case 23:t=`(?`+this.a.Qm(e)+`)`}return t},Q.b=0,L(MW,`RegEx/Token/ParenToken`,838),q(530,122,{3:1,122:1,530:1},__),Q.Mm=function(){return this.b},Q.Qm=function(e){return this.e==12?`\\`+this.a:oat(this.b)},Q.a=0,L(MW,`RegEx/Token/StringToken`,530),q(477,122,VW,lu),Q.Jm=function(e){LN(this,e)},Q.Lm=function(e){return P(Rh(this.a,e),122)},Q.Pm=function(){return this.a?this.a.a.c.length:0},Q.Qm=function(e){var t,n,r,i,a;if(this.e==1){if(this.a.a.c.length==2)t=P(Rh(this.a,0),122),n=P(Rh(this.a,1),122),i=n.e==3&&n.Lm(0)==t?t.Qm(e)+`+`:n.e==9&&n.Lm(0)==t?t.Qm(e)+`+?`:t.Qm(e)+(``+n.Qm(e));else{for(a=new $i,r=0;r=this.c.b:this.a<=this.c.b},Q.Sb=function(){return this.b>0},Q.Tb=function(){return this.b},Q.Vb=function(){return this.b-1},Q.Qb=function(){throw E(new Ri(yTt))},Q.a=0,Q.b=0,L(gTt,`ExclusiveRange/RangeIterator`,258);var K9=Jh(VU,`C`),q9=Jh(WU,`I`),J9=Jh(DP,`Z`),Y9=Jh(GU,`J`),X9=Jh(BU,`B`),Z9=Jh(HU,`D`),Q9=Jh(UU,`F`),$9=Jh(KU,`S`),uUt=gp(`org.eclipse.elk.core.labels`,`ILabelManager`),dUt=gp(uU,`DiagnosticChain`),fUt=gp(Lwt,`ResourceSet`),pUt=L(uU,`InvocationTargetException`,null),mUt=(Qi(),mUe),hUt=hUt=e5e;SJe(sge),uJe(`permProps`,[[[`locale`,`default`],[bTt,`gecko1_8`]],[[`locale`,`default`],[bTt,`safari`]]]),hUt(null,`elk`,null)}).call(this)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}],3:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function i(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function a(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=function(t){a(n,t);function n(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,n);var a=Object.assign({},t),o=!1;try{e.resolve(`web-worker`),o=!0}catch{}if(t.workerUrl)if(o){var s=e("web-worker");a.workerFactory=function(e){return new s(e)}}else console.warn(`Web worker requested but 'web-worker' package not installed. Consider installing the package or pass your own 'workerFactory' to ELK's constructor. -... Falling back to non-web worker version.`);if(!a.workerFactory){var c=e("./elk-worker.min.js").Worker;a.workerFactory=function(e){return new c(e)}}return i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,a))}return n}(e("./elk-api.js").default);Object.defineProperty(t.exports,"__esModule",{value:!0}),t.exports=o,o.default=o},{"./elk-api.js":1,"./elk-worker.min.js":2,"web-worker":4}],4:[function(e,t,n){t.exports=Worker},{}]},{},[3])(3)})}))(),1),p=r((e,t,{parentById:n})=>{let r=new Set,i=e;if(e===t)return n[e]||`root`;for(;i;){if(r.add(i),i===t)return i;i=n[i]}for(i=t;i;){if(r.has(i))return i;i=n[i]}return`root`},`findCommonAncestor`),m=6;function h(e,{measure:t}){let n=e.config?.elk?.lineHops;if(n===!1)return;let r=e.edges.filter(e=>Array.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));d(t.groups.edgePaths,r,{enabled:!0,jumpRadius:m,jumpStyle:n===`gap`?`gap`:`arc`})}r(h,`applyElkLineJumps`);var g={},_={},v={},y={},b=1,x=10,S=r((e,t,n=.5)=>{let r=e.width/2,i=e.height/2,a=e.x-r,o=e.x+r,s=e.y-i,c=e.y+i,l=Math.abs(t.x-a)<=n&&t.y>=s-n&&t.y<=c+n,u=Math.abs(t.x-o)<=n&&t.y>=s-n&&t.y<=c+n,d=Math.abs(t.y-s)<=n&&t.x>=a-n&&t.x<=o+n,f=Math.abs(t.y-c)<=n&&t.x>=a-n&&t.x<=o+n;return l||u||d||f},`onBorder`),ee=r((e,t,n)=>{let r=e.x,i=e.y,a=Math.abs(r-n.x),o=e.width/2,s=n.xMath.abs(r-t.x)*c){let e=n.y{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),ne=r((e,t,n=x)=>{let r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y),a=e.width/2,o=e.height/2;if(Math.abs(r-a)0)return{x:e.x+r/a*(a+n),y:e.y+i/a*(a+n)}}return t},`ensureTrulyOutside`),C=r((e,t,n)=>{let r=Math.abs(t.x-e.x){if(!e?.intersect)return null;let r=e.intersect(n);return!r||n.xt.x||n.x>t.x&&r.xee(e,t,C(e,t,n)),`fallbackIntersection`),ae=20,oe=1e-6,se=r((e,t,n)=>{let r=e.intersect?.(n);return r?Math.hypot(n.x-t.x,n.y-t.y)<=Math.hypot(r.x-t.x,r.y-t.y)+1e-9:!1},`insideOutline`),ce=r((e,t,n,i)=>{if(!e?.intersect)return null;let a=i.x-n.x,o=i.y-n.y;if(a===0&&o===0||Math.abs(a)>oe&&Math.abs(o)>oe)return null;let s={x:t.x,y:t.y},c=Math.abs(a)>Math.abs(o),l=r(e=>c?{x:e,y:n.y}:{x:n.x,y:e},`along`),u=c?s.x:s.y,d=c?n.x:n.y;if(!se(e,s,l(u)))return null;if(se(e,s,l(d)))return{...n};for(let t=0;t{let i=ne(t,n);return re(e,t,i)??ie(t,i,r)},`computeNodeIntersection`),ue=r((e,t,n,r=.1)=>{if(!(!n||e.length===0))if(t===`start`)e.length>0&&Math.abs(e[0].x-n.x)0&&Math.abs(e[t].x-n.x)typeof e==`string`?Math.max(o[e]??0,s[e]??0):0,`markerPathOffset`),pe={arrow_open:[`none`,`none`],arrow_cross:[`none`,`arrow_cross`],double_arrow_cross:[`arrow_cross`,`arrow_cross`],arrow_point:[`none`,`arrow_point`],double_arrow_point:[`arrow_point`,`arrow_point`],arrow_circle:[`none`,`arrow_circle`],double_arrow_circle:[`arrow_circle`,`arrow_circle`]},me=12,he=`[top=${me},left=${me},bottom=${me},right=${me}]`,ge=24,_e=24,ve=50,ye=15,be=10,xe={"spacing.baseValue":15,"spacing.nodeNode":15,"elk.aspectRatio":`1.6`,"elk.expandNodes":`true`,"elk.rectpacking.trybox":`true`,"elk.rectpacking.packing.compaction.rowHeightReevaluation":`true`,"elk.rectpacking.packing.compaction.iterations":10,"elk.rectpacking.whiteSpaceElimination.strategy":`EQUAL_BETWEEN_STRUCTURES`,"elk.rectpacking.widthApproximation.strategy":`SCANLINE`},Se=[`nodeSize.constraints`,`nodeSize.minimum`,`elk.algorithm`,`elk.aspectRatio`,`elk.contentAlignment`,`elk.expandNodes`,`elk.padding`,...Object.keys(xe)];function Ce(e){for(let t of Se)delete e[t];e[`spacing.baseValue`]=_e,e[`spacing.nodeNode`]=ve}r(Ce,`clearContainerAlgorithmOptions`);var we=new Set([`elk.layered`,`elk.box`,`elk.rectpacking`,`elk.stress`,`elk.force`,`elk.mrtree`,`elk.radial`,`elk.sporeOverlap`]);function Te(e,t){if(typeof e==`string`){if(!we.has(e)){t?.warn(`Unknown container layout algorithm "${e}". Supported values: ${[...we].join(`, `)}. Falling back to the diagram's layout algorithm.`);return}return e}}r(Te,`resolveContainerAlgorithm`);function Ee(e){switch(e){case`LR`:return`RIGHT`;case`RL`:return`LEFT`;case`TB`:case`TD`:return`DOWN`;case`BT`:return`UP`;default:return`DOWN`}}r(Ee,`dir2ElkDirection`);function De(e){return c(e.shape)?(e.labelData?.width??e.labels?.[0]?.width??0)+(e.padding??0):0}r(De,`groupTitleWidth`);function Oe(e){return c(e.shape)?{"nodeSize.constraints":`[MINIMUM_SIZE, NODE_LABELS]`,"nodeSize.minimum":`(${De(e)}, 0)`}:{}}r(Oe,`groupTitleSizeOptions`);function ke(e,t,n,r){let i=(e.labelData?.width??0)+2*(e.padding??0),a=e.labelData?.height??0,o=Ve(t?.preset),s={...Oe(e),"spacing.baseValue":_e,"elk.layered.spacing.edgeNodeBetweenLayers":30,"elk.spacing.edgeEdge":20,"spacing.nodeNode":ve,"elk.padding":`[top=${ge},left=${ge},bottom=${ge},right=${ge}]`,"nodeLabels.placement":`[H_CENTER V_TOP, INSIDE]`,"elk.layered.mergeEdges":t?.mergeEdges,"elk.layered.nodePlacement.bk.fixedAlignment":t?.nodePlacementAlignment??o.alignment,"elk.layered.nodePlacement.strategy":t?.nodePlacementStrategy??o.containerPlacement,"elk.layered.cycleBreaking.strategy":t?.cycleBreakingStrategy??o.cycleBreaking,"elk.layered.nodePlacement.networkSimplex.nodeFlexibility":`PORT_POSITION`,"elk.spacing.portsSurrounding":he},c=Te(e.metadata?.algorithm,r);if(c){let e=a+ye;if(s[`nodeSize.constraints`]=`[MINIMUM_SIZE, NODE_LABELS]`,s[`nodeSize.minimum`]=`(${i}, ${e+ye})`,s[`elk.algorithm`]=c,s[`elk.hierarchyHandling`]=`SEPARATE_CHILDREN`,s[`elk.aspectRatio`]=`2.0`,s[`elk.contentAlignment`]=`H_CENTER V_TOP`,s[`elk.expandNodes`]=`true`,s[`elk.padding`]=`[top=${e},left=${ye},bottom=${ye},right=${ye}]`,c===`elk.rectpacking`){let e=a+be;Object.assign(s,xe,{"elk.padding":`[top=${e},left=${be},bottom=${be},right=${be}]`,"nodeSize.minimum":`(${i}, ${e+be})`})}}else e.dir&&(s[`elk.algorithm`]=n,s[`elk.direction`]=Ee(e.dir),s[`elk.hierarchyHandling`]=`SEPARATE_CHILDREN`);return Object.assign(s,y),s}r(ke,`buildSubgraphLayoutOptions`);function Ae(e,t){let n=new Set,i=new Map;for(let{id:t,parentId:n}of e){let e=i.get(n);e?e.push(t):i.set(n,[t])}for(let e of i.values()){let i=new Set(e),a=new Map(e.map(e=>[e,0])),o=new Map(e.map(e=>[e,[]])),s=[];for(let e of t){let t=e.source==null?void 0:String(e.source),n=e.target==null?void 0:String(e.target);!t||!n||t===n||!i.has(t)||!i.has(n)||(a.set(n,(a.get(n)??0)+1),o.get(t).push(n),o.get(n).push(t),s.push([t,n]))}let c=new Map,l=0;for(let t of e){if(c.has(t))continue;let e=[t];for(c.set(t,l);e.length>0;){let t=e.pop();for(let n of o.get(t))c.has(n)||(c.set(n,l),e.push(n))}l++}let u=Array(l).fill(!1);for(let t of e)(a.get(t)??0)===0&&(u[c.get(t)]=!0);if(!u.includes(!1))continue;let d=new Map(e.map(e=>[e,[]])),f=new Map(e.map(e=>[e,0])),p=r((e,t)=>{let n=new Set([e]),r=[e];for(;r.length>0;){let e=r.pop();if(e===t)return!0;for(let t of d.get(e))n.has(t)||(n.add(t),r.push(t))}return!1},`reaches`);for(let[e,t]of s)p(t,e)||(d.get(e).push(t),f.set(t,(f.get(t)??0)+1));let m=Array(l).fill(!1);for(let t of e){let e=c.get(t);!u[e]&&!m[e]&&f.get(t)===0&&(n.add(t),m[e]=!0)}}return n}r(Ae,`findCyclicEntryNodes`);function je(e,t){if(!e.config.elk?.keepEntryNodeOnTop)return;let n=Ae(e.nodes,e.edges.map(e=>({source:e.start,target:e.end})));for(let e of n){let n=t[e];n&&(n.layoutOptions={...n.layoutOptions,"elk.layered.layering.layerConstraint":`FIRST`})}}r(je,`applyCyclicEntryConstraint`);function Me(e,t){let n=ze(t);return Ie(n),Tt(e,n),{algorithm:n.algorithm}}r(Me,`prepareLayoutForElk`);async function Ne(e,t){let n=ze(t),r=Pe(e,n),i=new f.default;n.log.info(`Drawing flowchart using v4 renderer`,i);let a=await $e(i,r.elkGraph,n.log);return et(e,a,r,n.log),Le(e.nodes),a}r(Ne,`runElkLayoutCore`);function Pe(e,t){let n={},r=He(e,t.algorithm,t.rootLayoutOptions),i=e.direction??`DOWN`;r.layoutOptions[`elk.direction`]=Ee(i);let a=Ue(e.nodes,t.log);return We(e.nodes,r,n,t),Je(e,r,n,t),Xe(e,n,a,t),Ze(r,n,a,t.log),je(e,n),{elkGraph:r,nodeDb:n,parentLookupDb:a}}r(Pe,`buildElkGraphFromLayoutData`);var Fe=u({afterPaint:h,prepareLayout:Me,measureLayout:r((e,t)=>l(e,t,{unwrapGroupLabels:!0}),`measureLayout`),runLayoutCore:Ne,paintOptions:{skipIntersect:!0}});function Ie(e){i(e.getConfig())}r(Ie,`syncHostConfig`);function Le(e){let t=new Map(e.map(e=>[e.id,e]));e.sort((e,n)=>e.isGroup===n.isGroup?e.isGroup&&n.isGroup?Re(e,t)-Re(n,t):0:e.isGroup?-1:1)}r(Le,`orderNodesForElkPaint`);function Re(e,t){let n=0,r=new Set,i=e.parentId;for(;i&&!r.has(i);){r.add(i);let e=t.get(i);if(!e?.isGroup)break;n++,i=e.parentId}return n}r(Re,`getGroupDepth`);function ze(e){let t=e.helpers;if(!t)throw Error(`ELK layout requires Mermaid internal helpers`);return{algorithm:e.preparedLayout?.algorithm??e.options?.algorithm,rootLayoutOptions:e.options?.rootLayoutOptions,common:t.common,getConfig:t.getConfig,interpolateToCurve:t.interpolateToCurve,log:t.log}}r(ze,`getElkLayoutContext`);var Be={default:{layering:`NETWORK_SIMPLEX`,placement:`BRANDES_KOEPF`,containerPlacement:`BRANDES_KOEPF`,alignment:`BALANCED`,cycleBreaking:`DEPTH_FIRST`},legacy:{layering:`NETWORK_SIMPLEX`,placement:`BRANDES_KOEPF`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`GREEDY`},modelOrder:{layering:`NETWORK_SIMPLEX`,placement:`NETWORK_SIMPLEX`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`GREEDY_MODEL_ORDER`},depthFirst:{layering:`NETWORK_SIMPLEX`,placement:`NETWORK_SIMPLEX`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`DEPTH_FIRST`}};function Ve(e){return e!==void 0&&Object.hasOwn(Be,e)?Be[e]:Be.default}r(Ve,`resolveElkPreset`);function He(e,t,n){let r=Ve(e.config.elk?.preset),i={id:`root`,layoutOptions:{"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.algorithm":t,"elk.layered.nodePlacement.strategy":e.config.elk?.nodePlacementStrategy??r.placement,"elk.layered.nodePlacement.bk.fixedAlignment":e.config.elk?.nodePlacementAlignment??r.alignment,"elk.layered.mergeEdges":e.config.elk?.mergeEdges,"elk.direction":`DOWN`,"spacing.baseValue":40,"elk.layered.crossingMinimization.forceNodeModelOrder":e.config.elk?.forceNodeModelOrder,"elk.layered.considerModelOrder.strategy":e.config.elk?.considerModelOrder,"elk.layered.unnecessaryBendpoints":!0,"elk.layered.cycleBreaking.strategy":e.config.elk?.cycleBreakingStrategy??r.cycleBreaking,"elk.layered.layering.strategy":e.config.elk?.layeringStrategy??r.layering,"elk.layered.layering.coffmanGraham.layerBound":e.config.elk?.layeringLayerBound,"elk.layered.wrapping.multiEdge.improveCuts":!0,"elk.layered.wrapping.multiEdge.improveWrappedEdges":!0,"elk.layered.edgeRouting.selfLoopDistribution":`EQUALLY`,"elk.layered.mergeHierarchyEdges":!0,"elk.spacing.portsSurrounding":he},children:[],edges:[]};return t===`elk.rectpacking`&&Object.assign(i.layoutOptions,xe,{"elk.contentAlignment":`H_CENTER V_TOP`,"elk.padding":`[top=15,left=15,bottom=15,right=15]`}),n&&Object.assign(i.layoutOptions,n),Object.assign(i.layoutOptions,g,_,v),i}r(He,`createRootElkGraph`);function Ue(e,t){let n={parentById:{},childrenById:{}},r=e.filter(e=>e.isGroup);return t.info(`Subgraphs - `,r),r.forEach(t=>{e.filter(e=>e.parentId===t.id).forEach(e=>{n.parentById[e.id]=t.id,n.childrenById[t.id]??=[],n.childrenById[t.id].push(e.id)})}),n}r(Ue,`addSubGraphs`);function We(e,t,n,r,i){let a=e.filter(e=>e?.parentId===i);return r.log.info(`addVertices APA12`,a,i),a.forEach(i=>{Ge(t,e,i,n,r)}),t}r(We,`addVertices`);function Ge(e,t,n,r,i){let a=Ke(n);e.children.push(a),r[n.id]=a,n.isGroup&&(a.children=[],We(t,a,r,i,n.id),a.labelData=qe(n,i.getConfig()))}r(Ge,`addVertex`);function Ke(e){let t={...e};return delete t.domId,e.isGroup?t.children=[]:(t.width=e.width??0,t.height=e.height??0,e.spreadPorts&&(t.layoutOptions={...t.layoutOptions,"elk.portAlignment.default":`CENTER`})),t}r(Ke,`createElkNode`);function qe(e,t){return e.labelData||(e.labelBBox?{width:e.labelBBox.width,height:Math.max(0,e.labelBBox.height-2),wrappingWidth:e.wrappingWidth??t.flowchart?.wrappingWidth}:{width:0,height:0,wrappingWidth:e.wrappingWidth??t.flowchart?.wrappingWidth})}r(qe,`getMeasuredLabelData`);function Je(e,t,n,r){r.log.info(`abc78 DAGA edges = `,e);let i={};return e.edges.forEach(e=>{let a=e.id;i[a]=(i[a]??-1)+1;let o=a;e.id=o,r.log.info(`abc78 new link id to be used is`,a,o,i[a]);let{source:s,target:c,sourceId:l,targetId:u}=Ye(e,n);r.log.debug(`abc78 source and target`,s,c),t.edges.push({...e,sources:[s],targets:[c],sourceId:l,targetId:u,labels:[{width:e.width??0,height:e.height??0,orgWidth:e.width??0,orgHeight:e.height??0,text:e.label??``,layoutOptions:{"edgeLabels.inline":`true`,"edgeLabels.placement":`CENTER`}}]})}),t}r(Je,`addEdgesToElkGraph`);function Ye(e,t){let n=e.start,r=e.end,i=n,a=r,o=n?t[n]:void 0,s=r?t[r]:void 0;return!o||!s?{source:i,target:a}:{source:i,target:a,sourceId:n,targetId:r}}r(Ye,`getEdgeStartEndPoint`);function Xe(e,t,n,r){e.nodes.forEach(i=>{let a=t[i.id];!a||n.childrenById[a.id]===void 0||(a.labels=[{text:a.label,width:a?.labelData?.width??50,height:a?.labelData?.height??50}],r.log.debug(`UIO node label`,a?.labelData?.width,a.padding),a.layoutOptions=ke(a,e.config.elk,r.algorithm,r.log),delete a.x,delete a.y,delete a.width,delete a.height)})}r(Xe,`configureSubgraphNodes`);function Ze(e,t,n,r){r.debug(`APA01 processing edges, count:`,e.edges.length),e.edges.forEach((e,i)=>{r.debug(`APA01 processing edge`,i,`:`,e);let a=e.sources[0],o=e.targets[0];if(r.debug(`APA01 source:`,a,`target:`,o),r.debug(`APA01 nodeDb[source]:`,t[a]),r.debug(`APA01 nodeDb[target]:`,t[o]),t[a]&&t[o]&&t[a].parentId!==t[o].parentId){let e=p(a,o,n);Qe(t,a,e,r),Qe(t,o,e,r)}})}r(Ze,`configureCrossHierarchyEdges`);function Qe(e,t,n,r){let i=e[t];i&&(i.layoutOptions??={},i.layoutOptions[`elk.hierarchyHandling`]===`SEPARATE_CHILDREN`&&Te(i.metadata?.algorithm)&&(r.debug(`Dropping explicit algorithm for node`,i.id,`due to cross-boundary edges`),Ce(i.layoutOptions),Object.assign(i.layoutOptions,Oe(i))),i.layoutOptions[`elk.hierarchyHandling`]=`INCLUDE_CHILDREN`,i.id!==n&&i.parentId&&Qe(e,i.parentId,n,r))}r(Qe,`setIncludeChildrenPolicy`);async function $e(e,t,n){let r=globalThis.__mermaidProfiler;try{r?.begin(`layoutCore`);let i;try{i=await e.layout(t)}finally{r?.end()}return n.debug(`APA01 after - success`),n.debug(`APA01 layout result:`,i),i}catch(e){throw n.error(`ELK layout error:`,e),e}}r($e,`runElkLayout`);function et(e,t,n,r){let i=new Map(e.nodes.map(e=>[e.id,e]));it(t.children??[],n,i,0,0,0,r),rt(t.children??[],n,i,t),mt(e,t,n,r)}r(et,`applyElkLayoutResult`);function tt(e,t=new Set){for(let n of e.children??[])t.add(n.id),tt(n,t);return t}r(tt,`collectDescendantIds`);function nt(e,t,n,r){let i=[];for(let a of e.edges??[]){let e=a.sources?.[0]??a.start,o=a.targets?.[0]??a.end,s=t.has(e)&&t.has(o),c=e===r,l=o===r;if(!s&&!c&&!l)continue;let u=_t(e,o,n.parentLookupDb,n.nodeDb);for(let e of a.sections??[]){let t=s?[e.startPoint,...e.bendPoints??[],e.endPoint]:[c?e.startPoint:null,l?e.endPoint:null];for(let e of t)e&&i.push({x:e.x+u.x,y:e.y+u.y})}}return i}r(nt,`internalEdgePoints`);function rt(e,t,n,r={}){for(let i of e){if(!i?.isGroup)continue;let e=i.children??[];rt(e,t,n,r);let a=t.nodeDb[i.id],o=e.map(e=>t.nodeDb[e.id]).filter(e=>e?.offset&&e.width&&e.height);if(!a?.offset||o.length===0)continue;let s=nt(r,tt(i),t,i.id),c=[...o.map(e=>e.offset.posX),...o.map(e=>e.offset.posX+e.width),...s.map(e=>e.x)],l=[...o.map(e=>e.offset.posY),...o.map(e=>e.offset.posY+e.height),...s.map(e=>e.y)],u=a.offset,d=Math.max(u.posX,Math.min(...c)-ge),f=Math.min(u.posX+a.width,Math.max(...c)+ge),p=Math.min(u.posY+a.height,Math.max(...l)+ge),m=u.posY,h=De(i),g=d,_=f-d;if(_{if(!e)return;let s=t.nodeDb[e.id]??e,c=Math.max(e.width,e.labels&&e.labels[0]?.width||0),l={posX:e.x+r,posY:e.y+i,x:r,y:i,depth:a,width:c,height:e.height};s.offset=l,s.x=l.posX+e.width/2,s.y=l.posY+e.height/2,s.width=e.width,s.height=e.height;let u=n.get(e.id);if(u){u.x=s.x,u.y=s.y,u.width=e.isGroup?Math.max(e.width,e.labelData?.width??0):e.width,u.height=e.height;let t=u;t.labelData=e.labelData,t.labels=e.labels}e.isGroup?(o.debug(`Id abc88 subgraph = `,e.id,e.x,e.y,e.labelData),it(e.children??[],t,n,l.posX,l.posY,a+1,o)):o.info(`Id NODE = `,e.id,e.x,e.y,r,i,`translate(${s.x}, ${s.y})`)})}r(it,`applyElkNodePositions`);var at=16,ot=30,st=.01;function ct(e,t){let n=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y);if(n>st&&r<=st)return`h`;if(r>st&&n<=st)return`v`}r(ct,`axisOf`);function lt(e){let t=ut(e)??e,n=ut([...t].reverse());return n&&(t=n.reverse()),t}r(lt,`straightenTerminalJogs`);function ut(e){if(e.length<5)return null;let[t,n,r,i]=e,a=ct(t,n);if(!a||ct(r,i)!==a||ct(n,r)!==(a===`h`?`v`:`h`)||Math.hypot(n.x-t.x,n.y-t.y)>ot)return null;let o=Math.abs(a===`h`?r.y-n.y:r.x-n.x);if(oat||!(a===`h`?Math.sign(n.x-t.x)===Math.sign(i.x-r.x):Math.sign(n.y-t.y)===Math.sign(i.y-r.y)))return null;let s=3;for(;s+1(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),`side`),o=a(n,i,e),s=a(n,i,t),c=a(e,t,n),l=a(e,t,i);return(o>0&&s<0||o<0&&s>0)&&(c>0&&l<0||c<0&&l>0)}r(dt,`segmentsCrossStrict`);function ft(e,t){let n=0;for(let r=0;re.points??[]);for(let[n,r]of e.entries()){let e=t[n];if(e.length<5)continue;let i=lt(e);if(i===e)continue;let a=0,o=0;for(let[r,s]of t.entries())r===n||s.length<2||(a+=ft(e,s),o+=ft(i,s));o>a||(r.points=i,t[n]=i)}}r(pt,`straightenEdgeTerminals`);function mt(e,t,n,i){let a=new Map(e.edges.map(e=>[e.id,e])),o=e.config.elk?.straightenEdges!==!1,s=new Map(e.nodes.map(e=>[e.id,e])),c=new Set;t.edges?.forEach(e=>{if(!e.sections?.length)return;let t=n.nodeDb[e.sources?.[0]??e.start],r=n.nodeDb[e.targets?.[0]??e.end];if(!t||!r)return;let i=_t(e.start??e.sourceId??e.sources?.[0],e.end??e.targetId??e.targets?.[0],n.parentLookupDb,n.nodeDb),a=e.sections[0];t.shape!==`rect33`&&ht(t,{x:a.startPoint.x+i.x,y:a.startPoint.y+i.y},s,c),r.shape!==`rect33`&&ht(r,{x:a.endPoint.x+i.x,y:a.endPoint.y+i.y},s,c)}),t.edges?.forEach(e=>{let t=a.get(e.id);if(!t)return;let o=e.sources?.[0]??e.start,s=e.targets?.[0]??e.end,c=n.nodeDb[o],l=n.nodeDb[s];if(!c||!l)return;if(!e.sections?.length){let n=r(e=>({x:(e.offset?.posX??e.x??0)+(e.width??0)/2,y:(e.offset?.posY??e.y??0)+(e.height??0)/2}),`centre`),a=n(c),o=n(l);c.x=a.x,c.y=a.y,l.x=o.x,l.y=o.y;let s=vt([a,o],c,l,i);t.points=s,t.curve=`linear`;let u=s[0],d=s[s.length-1];t.x=(u.x+d.x)/2,t.y=(u.y+d.y)/2,i.debug(`APA18 no edge sections, using a straight line`,e.id,t.points);return}let u=e.start??e.sourceId??o,d=e.end??e.targetId??s,f=_t(u,d,n.parentLookupDb,n.nodeDb);i.debug(`APA18 offset`,f,u,` ==> `,d,`edge:`,e,c);let p=e.sections[0],m=gt(p,f);c.x=c.offset.posX+c.width/2,c.y=c.offset.posY+c.height/2,l.x=l.offset.posX+l.width/2,l.y=l.offset.posY+l.height/2,c.shape!==`rect33`&&m.unshift({x:c.x,y:c.y}),l.shape!==`rect33`&&m.push({x:l.x,y:l.y}),t.points=Ct(wt(vt(m,c,l,i),jt(l),xt(t),i),jt(c),St(t),i),t.curve=`rounded`;let h=e.labels?.[0];h&&(t.x=h.x+f.x+h.width/2,t.y=h.y+f.y+h.height/2)}),o&&pt(e.edges)}r(mt,`applyElkEdgeLayout`);function ht(e,t,n,r){let i=e.width??0,a=e.height??0,o=e.offset.posY,s=o+a,c=.5,l=Math.abs(t.y-o)<=c||Math.abs(t.y-s)<=c;if((l?i:a)>=2*me||r.has(e.id))return;r.add(e.id);let u=l?t.x-(e.offset.posX+i/2):t.y-(e.offset.posY+a/2);if(Math.abs(u)<.01)return;l?(e.offset.posX+=u,e.x=e.offset.posX+i/2):(e.offset.posY+=u,e.y=e.offset.posY+a/2);let d=n.get(e.id);d&&(d.x=e.offset.posX+i/2,d.y=e.offset.posY+a/2)}r(ht,`alignDegenerateNodeToAnchor`);function gt(e,t){let n=e.startPoint,r=e.endPoint,i=(e.bendPoints?e.bendPoints:[]).map(e=>({x:e.x+t.x,y:e.y+t.y}));return[{x:n.x+t.x,y:n.y+t.y},...i,{x:r.x+t.x,y:r.y+t.y}]}r(gt,`createEdgePointsFromSection`);function _t(e,t,n,r){let i=p(e,t,n);if(i===void 0||i===`root`)return{x:0,y:0};let a=r[i],o=a?.elkOrigin??a?.offset;return{x:o?.posX??0,y:o?.posY??0}}r(_t,`calcOffset`);function vt(e,t,n,r){let i=Array.isArray(e)?[...e]:[],a=jt(n);r.debug(`PPP cutter2: Points before cutter2:`,JSON.stringify(e),`endBounds:`,a,S(a,e[e.length-1]));let o;{let e=jt(t),a=jt(n),s=!!t?.isGroup,c=!!n?.isGroup,{candidate:l,centerApprox:u}=Pt(i,t,`start`),{candidate:d,centerApprox:f}=Pt(i,n,`end`),p=s&&S(e,l),m=c&&S(a,d);Ft(i,`start`,p&&u),Ft(i,`end`,m&&f),s&&!p&&(p=It(i,e,`start`)),c&&!m&&(m=It(i,a,`end`)),p||m?(p||Lt(i,t,e,r),m||Rt(i,n,a,r),r.debug(`PPP cutter2: skipping cutter2 due to on-border group endpoint(s)`,{skipStart:p,skipEnd:m,startCenterApprox:u,endCenterApprox:f,startCandidate:l,endCandidate:d}),o=i):o=Bt(t,n,i,r)}if(r.debug(`PPP cutter2: Points after cutter2:`,JSON.stringify(o)),!Array.isArray(o)||o.length<2||yt(o)){r.warn(`POI cutter2: Invalid points from cutter2, falling back to prevPoints`,o);let e=i.filter(e=>Number.isFinite(e?.x)&&Number.isFinite(e?.y));o=e.length>=2?e:i}return r.debug(`UIO cutter2: Points after cutter2 (sanitized):`,o),bt(o,r)}r(vt,`sanitizeElkEdgePoints`);function yt(e){return e?.some(e=>!Number.isFinite(e?.x)||!Number.isFinite(e?.y))}r(yt,`hasInvalidPoint`);function bt(e,t){let n=e.filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return Math.abs(e.x-r.x)>1e-6||Math.abs(e.y-r.y)>1e-6});return n.length!==e.length&&t.debug(`UIO cutter2: removed consecutive duplicate points`,{before:e,after:n}),n}r(bt,`dedupeConsecutivePoints`);function xt(e){return fe(e.arrowTypeEnd)}r(xt,`getEndMarkerPathOffset`);function St(e){return fe(e.arrowTypeStart)}r(St,`getStartMarkerPathOffset`);function Ct(e,t,n,r){if(n<=0||e.length<3)return e;let i=e[0],a=e[1],o=Math.hypot(a.x-i.x,a.y-i.y);if(o>=Math.max(de,n*2)||!S(t,a,1))return e;let s=[i,...e.slice(2)];return r.debug(`UIO cutter2: removed short start marker segment`,{before:e,after:s,markerOffset:n,segmentLength:o}),s}r(Ct,`ensureStartMarkerSegmentLength`);function wt(e,t,n,r){if(n<=0||e.length<3)return e;let i=e[e.length-1],a=e[e.length-2],o=Math.hypot(i.x-a.x,i.y-a.y);if(o>=Math.max(de,n*2)||!S(t,a,1))return e;let s=[...e.slice(0,-2),i];return r.debug(`UIO cutter2: removed short end marker segment`,{before:e,after:s,markerOffset:n,segmentLength:o}),s}r(wt,`ensureEndMarkerSegmentLength`);function Tt(e,t){let n=e.edges.defaultInterpolate,r=e.edges.defaultStyle,i=t.getConfig();e.edges.forEach(e=>{let a=kt(e,{defaultStyle:r,defaultInterpolate:n,confCurve:i.curve},t);Object.assign(e,a)})}r(Tt,`applyElkEdgeRenderData`);function Et(e){if(e.classes!==void 0)return e.classes;if(e.start&&e.end)return`flowchart-link LS_${e.start} LE_${e.end}`}r(Et,`buildFallbackEdgeClasses`);function Dt(e,t,n){let r=`normal`,i=`solid`,a=[],o=[];return e===`dotted`?(i=`dotted`,a=[`fill:none`,`stroke-width:2px`,`stroke-dasharray:3`]):e===`thick`?(r=`thick`,a=[`stroke-width: 3.5px`,`fill:none`]):(a=t??[`fill:none`],n!==void 0&&(o=n)),{thickness:r,pattern:i,style:a,labelStyle:o}}r(Dt,`computeStroke`);function Ot(e,t,n){return e===void 0?t===void 0?n:t:e}r(Ot,`getCurve`);function kt(e,t,n){let r={};r.minlen=e.minlen??e.length??1,r.text=e.text??e.label,r.arrowhead=e.arrowhead??(e.type===`arrow_open`?`none`:`normal`);let i=pe[e.type??`arrow_open`]??pe.arrow_open;r.arrowTypeStart=e.arrowTypeStart??i[0],r.arrowTypeEnd=e.arrowTypeEnd??i[1],r.startLabelRight=e.startLabelRight,r.endLabelLeft=e.endLabelLeft;let o=Dt(e.stroke,t.defaultStyle,t.defaultLabelStyle);r.thickness=e.thickness??o.thickness,r.pattern=e.pattern??o.pattern,r.style=e.style??o.style,r.labelStyle=e.labelStyle??o.labelStyle,r.classes=Et(e),r.curve=n.interpolateToCurve(Ot(e.curve??e.interpolate,t.defaultInterpolate,t.confCurve),a);let s=(r.text??``)!==``;return e.arrowheadStyle===void 0?(s||e.style!==void 0)&&(r.arrowheadStyle=`fill: #333`):r.arrowheadStyle=e.arrowheadStyle,r.labelpos=e.labelpos??(s?`c`:void 0),r.labelType=e.labelType,r.label=(e.label??r.text??``).replace(n.common.lineBreakRegex,` +... Falling back to non-web worker version.`);if(!a.workerFactory){var c=e("./elk-worker.min.js").Worker;a.workerFactory=function(e){return new c(e)}}return i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,a))}return n}(e("./elk-api.js").default);Object.defineProperty(t.exports,"__esModule",{value:!0}),t.exports=o,o.default=o},{"./elk-api.js":1,"./elk-worker.min.js":2,"web-worker":4}],4:[function(e,t,n){t.exports=Worker},{}]},{},[3])(3)})}))(),1),p=r((e,t,{parentById:n})=>{let r=new Set,i=e;if(e===t)return n[e]||`root`;for(;i;){if(r.add(i),i===t)return i;i=n[i]}for(i=t;i;){if(r.has(i))return i;i=n[i]}return`root`},`findCommonAncestor`),m=6;function h(e,{measure:t}){let n=e.config?.elk?.lineHops;if(n===!1)return;let r=e.edges.filter(e=>Array.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));d(t.groups.edgePaths,r,{enabled:!0,jumpRadius:m,jumpStyle:n===`gap`?`gap`:`arc`})}r(h,`applyElkLineJumps`);var g={},_={},v={},y={},b=1,x=10,S=r((e,t,n=.5)=>{let r=e.width/2,i=e.height/2,a=e.x-r,o=e.x+r,s=e.y-i,c=e.y+i,l=Math.abs(t.x-a)<=n&&t.y>=s-n&&t.y<=c+n,u=Math.abs(t.x-o)<=n&&t.y>=s-n&&t.y<=c+n,d=Math.abs(t.y-s)<=n&&t.x>=a-n&&t.x<=o+n,f=Math.abs(t.y-c)<=n&&t.x>=a-n&&t.x<=o+n;return l||u||d||f},`onBorder`),ee=r((e,t,n)=>{let r=e.x,i=e.y,a=Math.abs(r-n.x),o=e.width/2,s=n.xMath.abs(r-t.x)*c){let e=n.y{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),ne=r((e,t,n=x)=>{let r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y),a=e.width/2,o=e.height/2;if(Math.abs(r-a)0)return{x:e.x+r/a*(a+n),y:e.y+i/a*(a+n)}}return t},`ensureTrulyOutside`),C=r((e,t,n)=>{let r=Math.abs(t.x-e.x){if(!e?.intersect)return null;let r=e.intersect(n);return!r||n.xt.x||n.x>t.x&&r.xee(e,t,C(e,t,n)),`fallbackIntersection`),ae=20,oe=1e-6,se=r((e,t,n)=>{let r=e.intersect?.(n);return r?Math.hypot(n.x-t.x,n.y-t.y)<=Math.hypot(r.x-t.x,r.y-t.y)+1e-9:!1},`insideOutline`),ce=r((e,t,n,i)=>{if(!e?.intersect)return null;let a=i.x-n.x,o=i.y-n.y;if(a===0&&o===0||Math.abs(a)>oe&&Math.abs(o)>oe)return null;let s={x:t.x,y:t.y},c=Math.abs(a)>Math.abs(o),l=r(e=>c?{x:e,y:n.y}:{x:n.x,y:e},`along`),u=c?s.x:s.y,d=c?n.x:n.y;if(!se(e,s,l(u)))return null;if(se(e,s,l(d)))return{...n};for(let t=0;t{let i=ne(t,n);return re(e,t,i)??ie(t,i,r)},`computeNodeIntersection`),ue=r((e,t,n,r=.1)=>{if(!(!n||e.length===0))if(t===`start`)e.length>0&&Math.abs(e[0].x-n.x)0&&Math.abs(e[t].x-n.x)typeof e==`string`?Math.max(s[e]??0,c[e]??0):0,`markerPathOffset`),pe={arrow_open:[`none`,`none`],arrow_cross:[`none`,`arrow_cross`],double_arrow_cross:[`arrow_cross`,`arrow_cross`],arrow_point:[`none`,`arrow_point`],double_arrow_point:[`arrow_point`,`arrow_point`],arrow_circle:[`none`,`arrow_circle`],double_arrow_circle:[`arrow_circle`,`arrow_circle`]},me=12,he=`[top=${me},left=${me},bottom=${me},right=${me}]`,ge=24,_e=24,ve=50,ye=15,be=10,xe={"spacing.baseValue":15,"spacing.nodeNode":15,"elk.aspectRatio":`1.6`,"elk.expandNodes":`true`,"elk.rectpacking.trybox":`true`,"elk.rectpacking.packing.compaction.rowHeightReevaluation":`true`,"elk.rectpacking.packing.compaction.iterations":10,"elk.rectpacking.whiteSpaceElimination.strategy":`EQUAL_BETWEEN_STRUCTURES`,"elk.rectpacking.widthApproximation.strategy":`SCANLINE`},Se=[`nodeSize.constraints`,`nodeSize.minimum`,`elk.algorithm`,`elk.aspectRatio`,`elk.contentAlignment`,`elk.expandNodes`,`elk.padding`,...Object.keys(xe)];function Ce(e){for(let t of Se)delete e[t];e[`spacing.baseValue`]=_e,e[`spacing.nodeNode`]=ve}r(Ce,`clearContainerAlgorithmOptions`);var we=new Set([`elk.layered`,`elk.box`,`elk.rectpacking`,`elk.stress`,`elk.force`,`elk.mrtree`,`elk.radial`,`elk.sporeOverlap`]);function Te(e,t){if(typeof e==`string`){if(!we.has(e)){t?.warn(`Unknown container layout algorithm "${e}". Supported values: ${[...we].join(`, `)}. Falling back to the diagram's layout algorithm.`);return}return e}}r(Te,`resolveContainerAlgorithm`);function Ee(e){switch(e){case`LR`:return`RIGHT`;case`RL`:return`LEFT`;case`TB`:case`TD`:return`DOWN`;case`BT`:return`UP`;default:return`DOWN`}}r(Ee,`dir2ElkDirection`);function De(e){return o(e.shape)?(e.labelData?.width??e.labels?.[0]?.width??0)+(e.padding??0):0}r(De,`groupTitleWidth`);function Oe(e){return o(e.shape)?{"nodeSize.constraints":`[MINIMUM_SIZE, NODE_LABELS]`,"nodeSize.minimum":`(${De(e)}, 0)`}:{}}r(Oe,`groupTitleSizeOptions`);function ke(e,t,n,r){let i=(e.labelData?.width??0)+2*(e.padding??0),a=e.labelData?.height??0,o=Ve(t?.preset),s={...Oe(e),"spacing.baseValue":_e,"elk.layered.spacing.edgeNodeBetweenLayers":30,"elk.spacing.edgeEdge":20,"spacing.nodeNode":ve,"elk.padding":`[top=${ge},left=${ge},bottom=${ge},right=${ge}]`,"nodeLabels.placement":`[H_CENTER V_TOP, INSIDE]`,"elk.layered.mergeEdges":t?.mergeEdges,"elk.layered.nodePlacement.bk.fixedAlignment":t?.nodePlacementAlignment??o.alignment,"elk.layered.nodePlacement.strategy":t?.nodePlacementStrategy??o.containerPlacement,"elk.layered.cycleBreaking.strategy":t?.cycleBreakingStrategy??o.cycleBreaking,"elk.layered.nodePlacement.networkSimplex.nodeFlexibility":`PORT_POSITION`,"elk.spacing.portsSurrounding":he},c=Te(e.metadata?.algorithm,r);if(c){let e=a+ye;if(s[`nodeSize.constraints`]=`[MINIMUM_SIZE, NODE_LABELS]`,s[`nodeSize.minimum`]=`(${i}, ${e+ye})`,s[`elk.algorithm`]=c,s[`elk.hierarchyHandling`]=`SEPARATE_CHILDREN`,s[`elk.aspectRatio`]=`2.0`,s[`elk.contentAlignment`]=`H_CENTER V_TOP`,s[`elk.expandNodes`]=`true`,s[`elk.padding`]=`[top=${e},left=${ye},bottom=${ye},right=${ye}]`,c===`elk.rectpacking`){let e=a+be;Object.assign(s,xe,{"elk.padding":`[top=${e},left=${be},bottom=${be},right=${be}]`,"nodeSize.minimum":`(${i}, ${e+be})`})}}else e.dir&&(s[`elk.algorithm`]=n,s[`elk.direction`]=Ee(e.dir),s[`elk.hierarchyHandling`]=`SEPARATE_CHILDREN`);return Object.assign(s,y),s}r(ke,`buildSubgraphLayoutOptions`);function Ae(e,t){let n=new Set,i=new Map;for(let{id:t,parentId:n}of e){let e=i.get(n);e?e.push(t):i.set(n,[t])}for(let e of i.values()){let i=new Set(e),a=new Map(e.map(e=>[e,0])),o=new Map(e.map(e=>[e,[]])),s=[];for(let e of t){let t=e.source==null?void 0:String(e.source),n=e.target==null?void 0:String(e.target);!t||!n||t===n||!i.has(t)||!i.has(n)||(a.set(n,(a.get(n)??0)+1),o.get(t).push(n),o.get(n).push(t),s.push([t,n]))}let c=new Map,l=0;for(let t of e){if(c.has(t))continue;let e=[t];for(c.set(t,l);e.length>0;){let t=e.pop();for(let n of o.get(t))c.has(n)||(c.set(n,l),e.push(n))}l++}let u=Array(l).fill(!1);for(let t of e)(a.get(t)??0)===0&&(u[c.get(t)]=!0);if(!u.includes(!1))continue;let d=new Map(e.map(e=>[e,[]])),f=new Map(e.map(e=>[e,0])),p=r((e,t)=>{let n=new Set([e]),r=[e];for(;r.length>0;){let e=r.pop();if(e===t)return!0;for(let t of d.get(e))n.has(t)||(n.add(t),r.push(t))}return!1},`reaches`);for(let[e,t]of s)p(t,e)||(d.get(e).push(t),f.set(t,(f.get(t)??0)+1));let m=Array(l).fill(!1);for(let t of e){let e=c.get(t);!u[e]&&!m[e]&&f.get(t)===0&&(n.add(t),m[e]=!0)}}return n}r(Ae,`findCyclicEntryNodes`);function je(e,t){if(!e.config.elk?.keepEntryNodeOnTop)return;let n=Ae(e.nodes,e.edges.map(e=>({source:e.start,target:e.end})));for(let e of n){let n=t[e];n&&(n.layoutOptions={...n.layoutOptions,"elk.layered.layering.layerConstraint":`FIRST`})}}r(je,`applyCyclicEntryConstraint`);function Me(e,t){let n=ze(t);return Ie(n),Tt(e,n),{algorithm:n.algorithm}}r(Me,`prepareLayoutForElk`);async function Ne(e,t){let n=ze(t),r=Pe(e,n),i=new f.default;n.log.info(`Drawing flowchart using v4 renderer`,i);let a=await $e(i,r.elkGraph,n.log);return et(e,a,r,n.log),Le(e.nodes),a}r(Ne,`runElkLayoutCore`);function Pe(e,t){let n={},r=He(e,t.algorithm,t.rootLayoutOptions),i=e.direction??`DOWN`;r.layoutOptions[`elk.direction`]=Ee(i);let a=Ue(e.nodes,t.log);return We(e.nodes,r,n,t),Je(e,r,n,t),Xe(e,n,a,t),Ze(r,n,a,t.log),je(e,n),{elkGraph:r,nodeDb:n,parentLookupDb:a}}r(Pe,`buildElkGraphFromLayoutData`);var Fe=u({afterPaint:h,prepareLayout:Me,measureLayout:r((e,t)=>l(e,t,{unwrapGroupLabels:!0}),`measureLayout`),runLayoutCore:Ne,paintOptions:{skipIntersect:!0}});function Ie(e){i(e.getConfig())}r(Ie,`syncHostConfig`);function Le(e){let t=new Map(e.map(e=>[e.id,e]));e.sort((e,n)=>e.isGroup===n.isGroup?e.isGroup&&n.isGroup?Re(e,t)-Re(n,t):0:e.isGroup?-1:1)}r(Le,`orderNodesForElkPaint`);function Re(e,t){let n=0,r=new Set,i=e.parentId;for(;i&&!r.has(i);){r.add(i);let e=t.get(i);if(!e?.isGroup)break;n++,i=e.parentId}return n}r(Re,`getGroupDepth`);function ze(e){let t=e.helpers;if(!t)throw Error(`ELK layout requires Mermaid internal helpers`);return{algorithm:e.preparedLayout?.algorithm??e.options?.algorithm,rootLayoutOptions:e.options?.rootLayoutOptions,common:t.common,getConfig:t.getConfig,interpolateToCurve:t.interpolateToCurve,log:t.log}}r(ze,`getElkLayoutContext`);var Be={default:{layering:`NETWORK_SIMPLEX`,placement:`BRANDES_KOEPF`,containerPlacement:`BRANDES_KOEPF`,alignment:`BALANCED`,cycleBreaking:`DEPTH_FIRST`},legacy:{layering:`NETWORK_SIMPLEX`,placement:`BRANDES_KOEPF`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`GREEDY`},modelOrder:{layering:`NETWORK_SIMPLEX`,placement:`NETWORK_SIMPLEX`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`GREEDY_MODEL_ORDER`},depthFirst:{layering:`NETWORK_SIMPLEX`,placement:`NETWORK_SIMPLEX`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`DEPTH_FIRST`}};function Ve(e){return e!==void 0&&Object.hasOwn(Be,e)?Be[e]:Be.default}r(Ve,`resolveElkPreset`);function He(e,t,n){let r=Ve(e.config.elk?.preset),i={id:`root`,layoutOptions:{"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.algorithm":t,"elk.layered.nodePlacement.strategy":e.config.elk?.nodePlacementStrategy??r.placement,"elk.layered.nodePlacement.bk.fixedAlignment":e.config.elk?.nodePlacementAlignment??r.alignment,"elk.layered.mergeEdges":e.config.elk?.mergeEdges,"elk.direction":`DOWN`,"spacing.baseValue":40,"elk.layered.crossingMinimization.forceNodeModelOrder":e.config.elk?.forceNodeModelOrder,"elk.layered.considerModelOrder.strategy":e.config.elk?.considerModelOrder,"elk.layered.unnecessaryBendpoints":!0,"elk.layered.cycleBreaking.strategy":e.config.elk?.cycleBreakingStrategy??r.cycleBreaking,"elk.layered.layering.strategy":e.config.elk?.layeringStrategy??r.layering,"elk.layered.layering.coffmanGraham.layerBound":e.config.elk?.layeringLayerBound,"elk.layered.wrapping.multiEdge.improveCuts":!0,"elk.layered.wrapping.multiEdge.improveWrappedEdges":!0,"elk.layered.edgeRouting.selfLoopDistribution":`EQUALLY`,"elk.layered.mergeHierarchyEdges":!0,"elk.spacing.portsSurrounding":he},children:[],edges:[]};return t===`elk.rectpacking`&&Object.assign(i.layoutOptions,xe,{"elk.contentAlignment":`H_CENTER V_TOP`,"elk.padding":`[top=15,left=15,bottom=15,right=15]`}),n&&Object.assign(i.layoutOptions,n),Object.assign(i.layoutOptions,g,_,v),i}r(He,`createRootElkGraph`);function Ue(e,t){let n={parentById:{},childrenById:{}},r=e.filter(e=>e.isGroup);return t.info(`Subgraphs - `,r),r.forEach(t=>{e.filter(e=>e.parentId===t.id).forEach(e=>{n.parentById[e.id]=t.id,n.childrenById[t.id]??=[],n.childrenById[t.id].push(e.id)})}),n}r(Ue,`addSubGraphs`);function We(e,t,n,r,i){let a=e.filter(e=>e?.parentId===i);return r.log.info(`addVertices APA12`,a,i),a.forEach(i=>{Ge(t,e,i,n,r)}),t}r(We,`addVertices`);function Ge(e,t,n,r,i){let a=Ke(n);e.children.push(a),r[n.id]=a,n.isGroup&&(a.children=[],We(t,a,r,i,n.id),a.labelData=qe(n,i.getConfig()))}r(Ge,`addVertex`);function Ke(e){let t={...e};return delete t.domId,e.isGroup?t.children=[]:(t.width=e.width??0,t.height=e.height??0,e.spreadPorts&&(t.layoutOptions={...t.layoutOptions,"elk.portAlignment.default":`CENTER`})),t}r(Ke,`createElkNode`);function qe(e,t){return e.labelData||(e.labelBBox?{width:e.labelBBox.width,height:Math.max(0,e.labelBBox.height-2),wrappingWidth:e.wrappingWidth??t.flowchart?.wrappingWidth}:{width:0,height:0,wrappingWidth:e.wrappingWidth??t.flowchart?.wrappingWidth})}r(qe,`getMeasuredLabelData`);function Je(e,t,n,r){r.log.info(`abc78 DAGA edges = `,e);let i={};return e.edges.forEach(e=>{let a=e.id;i[a]=(i[a]??-1)+1;let o=a;e.id=o,r.log.info(`abc78 new link id to be used is`,a,o,i[a]);let{source:s,target:c,sourceId:l,targetId:u}=Ye(e,n);r.log.debug(`abc78 source and target`,s,c),t.edges.push({...e,sources:[s],targets:[c],sourceId:l,targetId:u,labels:[{width:e.width??0,height:e.height??0,orgWidth:e.width??0,orgHeight:e.height??0,text:e.label??``,layoutOptions:{"edgeLabels.inline":`true`,"edgeLabels.placement":`CENTER`}}]})}),t}r(Je,`addEdgesToElkGraph`);function Ye(e,t){let n=e.start,r=e.end,i=n,a=r,o=n?t[n]:void 0,s=r?t[r]:void 0;return!o||!s?{source:i,target:a}:{source:i,target:a,sourceId:n,targetId:r}}r(Ye,`getEdgeStartEndPoint`);function Xe(e,t,n,r){e.nodes.forEach(i=>{let a=t[i.id];!a||n.childrenById[a.id]===void 0||(a.labels=[{text:a.label,width:a?.labelData?.width??50,height:a?.labelData?.height??50}],r.log.debug(`UIO node label`,a?.labelData?.width,a.padding),a.layoutOptions=ke(a,e.config.elk,r.algorithm,r.log),delete a.x,delete a.y,delete a.width,delete a.height)})}r(Xe,`configureSubgraphNodes`);function Ze(e,t,n,r){r.debug(`APA01 processing edges, count:`,e.edges.length),e.edges.forEach((e,i)=>{r.debug(`APA01 processing edge`,i,`:`,e);let a=e.sources[0],o=e.targets[0];if(r.debug(`APA01 source:`,a,`target:`,o),r.debug(`APA01 nodeDb[source]:`,t[a]),r.debug(`APA01 nodeDb[target]:`,t[o]),t[a]&&t[o]&&t[a].parentId!==t[o].parentId){let e=p(a,o,n);Qe(t,a,e,r),Qe(t,o,e,r)}})}r(Ze,`configureCrossHierarchyEdges`);function Qe(e,t,n,r){let i=e[t];i&&(i.layoutOptions??={},i.layoutOptions[`elk.hierarchyHandling`]===`SEPARATE_CHILDREN`&&Te(i.metadata?.algorithm)&&(r.debug(`Dropping explicit algorithm for node`,i.id,`due to cross-boundary edges`),Ce(i.layoutOptions),Object.assign(i.layoutOptions,Oe(i))),i.layoutOptions[`elk.hierarchyHandling`]=`INCLUDE_CHILDREN`,i.id!==n&&i.parentId&&Qe(e,i.parentId,n,r))}r(Qe,`setIncludeChildrenPolicy`);async function $e(e,t,n){let r=globalThis.__mermaidProfiler;try{r?.begin(`layoutCore`);let i;try{i=await e.layout(t)}finally{r?.end()}return n.debug(`APA01 after - success`),n.debug(`APA01 layout result:`,i),i}catch(e){throw n.error(`ELK layout error:`,e),e}}r($e,`runElkLayout`);function et(e,t,n,r){let i=new Map(e.nodes.map(e=>[e.id,e]));it(t.children??[],n,i,0,0,0,r),rt(t.children??[],n,i,t),mt(e,t,n,r)}r(et,`applyElkLayoutResult`);function tt(e,t=new Set){for(let n of e.children??[])t.add(n.id),tt(n,t);return t}r(tt,`collectDescendantIds`);function nt(e,t,n,r){let i=[];for(let a of e.edges??[]){let e=a.sources?.[0]??a.start,o=a.targets?.[0]??a.end,s=t.has(e)&&t.has(o),c=e===r,l=o===r;if(!s&&!c&&!l)continue;let u=_t(e,o,n.parentLookupDb,n.nodeDb);for(let e of a.sections??[]){let t=s?[e.startPoint,...e.bendPoints??[],e.endPoint]:[c?e.startPoint:null,l?e.endPoint:null];for(let e of t)e&&i.push({x:e.x+u.x,y:e.y+u.y})}}return i}r(nt,`internalEdgePoints`);function rt(e,t,n,r={}){for(let i of e){if(!i?.isGroup)continue;let e=i.children??[];rt(e,t,n,r);let a=t.nodeDb[i.id],o=e.map(e=>t.nodeDb[e.id]).filter(e=>e?.offset&&e.width&&e.height);if(!a?.offset||o.length===0)continue;let s=nt(r,tt(i),t,i.id),c=[...o.map(e=>e.offset.posX),...o.map(e=>e.offset.posX+e.width),...s.map(e=>e.x)],l=[...o.map(e=>e.offset.posY),...o.map(e=>e.offset.posY+e.height),...s.map(e=>e.y)],u=a.offset,d=Math.max(u.posX,Math.min(...c)-ge),f=Math.min(u.posX+a.width,Math.max(...c)+ge),p=Math.min(u.posY+a.height,Math.max(...l)+ge),m=u.posY,h=De(i),g=d,_=f-d;if(_{if(!e)return;let s=t.nodeDb[e.id]??e,c=Math.max(e.width,e.labels&&e.labels[0]?.width||0),l={posX:e.x+r,posY:e.y+i,x:r,y:i,depth:a,width:c,height:e.height};s.offset=l,s.x=l.posX+e.width/2,s.y=l.posY+e.height/2,s.width=e.width,s.height=e.height;let u=n.get(e.id);if(u){u.x=s.x,u.y=s.y,u.width=e.isGroup?Math.max(e.width,e.labelData?.width??0):e.width,u.height=e.height;let t=u;t.labelData=e.labelData,t.labels=e.labels}e.isGroup?(o.debug(`Id abc88 subgraph = `,e.id,e.x,e.y,e.labelData),it(e.children??[],t,n,l.posX,l.posY,a+1,o)):o.info(`Id NODE = `,e.id,e.x,e.y,r,i,`translate(${s.x}, ${s.y})`)})}r(it,`applyElkNodePositions`);var at=16,ot=30,st=.01;function ct(e,t){let n=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y);if(n>st&&r<=st)return`h`;if(r>st&&n<=st)return`v`}r(ct,`axisOf`);function lt(e){let t=ut(e)??e,n=ut([...t].reverse());return n&&(t=n.reverse()),t}r(lt,`straightenTerminalJogs`);function ut(e){if(e.length<5)return null;let[t,n,r,i]=e,a=ct(t,n);if(!a||ct(r,i)!==a||ct(n,r)!==(a===`h`?`v`:`h`)||Math.hypot(n.x-t.x,n.y-t.y)>ot)return null;let o=Math.abs(a===`h`?r.y-n.y:r.x-n.x);if(oat||!(a===`h`?Math.sign(n.x-t.x)===Math.sign(i.x-r.x):Math.sign(n.y-t.y)===Math.sign(i.y-r.y)))return null;let s=3;for(;s+1(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),`side`),o=a(n,i,e),s=a(n,i,t),c=a(e,t,n),l=a(e,t,i);return(o>0&&s<0||o<0&&s>0)&&(c>0&&l<0||c<0&&l>0)}r(dt,`segmentsCrossStrict`);function ft(e,t){let n=0;for(let r=0;re.points??[]);for(let[n,r]of e.entries()){let e=t[n];if(e.length<5)continue;let i=lt(e);if(i===e)continue;let a=0,o=0;for(let[r,s]of t.entries())r===n||s.length<2||(a+=ft(e,s),o+=ft(i,s));o>a||(r.points=i,t[n]=i)}}r(pt,`straightenEdgeTerminals`);function mt(e,t,n,i){let a=new Map(e.edges.map(e=>[e.id,e])),o=e.config.elk?.straightenEdges!==!1,s=new Map(e.nodes.map(e=>[e.id,e])),c=new Set;t.edges?.forEach(e=>{if(!e.sections?.length)return;let t=n.nodeDb[e.sources?.[0]??e.start],r=n.nodeDb[e.targets?.[0]??e.end];if(!t||!r)return;let i=_t(e.start??e.sourceId??e.sources?.[0],e.end??e.targetId??e.targets?.[0],n.parentLookupDb,n.nodeDb),a=e.sections[0];t.shape!==`rect33`&&ht(t,{x:a.startPoint.x+i.x,y:a.startPoint.y+i.y},s,c),r.shape!==`rect33`&&ht(r,{x:a.endPoint.x+i.x,y:a.endPoint.y+i.y},s,c)}),t.edges?.forEach(e=>{let t=a.get(e.id);if(!t)return;let o=e.sources?.[0]??e.start,s=e.targets?.[0]??e.end,c=n.nodeDb[o],l=n.nodeDb[s];if(!c||!l)return;if(!e.sections?.length){let n=r(e=>({x:(e.offset?.posX??e.x??0)+(e.width??0)/2,y:(e.offset?.posY??e.y??0)+(e.height??0)/2}),`centre`),a=n(c),o=n(l);c.x=a.x,c.y=a.y,l.x=o.x,l.y=o.y;let s=vt([a,o],c,l,i);t.points=s,t.curve=`linear`;let u=s[0],d=s[s.length-1];t.x=(u.x+d.x)/2,t.y=(u.y+d.y)/2,i.debug(`APA18 no edge sections, using a straight line`,e.id,t.points);return}let u=e.start??e.sourceId??o,d=e.end??e.targetId??s,f=_t(u,d,n.parentLookupDb,n.nodeDb);i.debug(`APA18 offset`,f,u,` ==> `,d,`edge:`,e,c);let p=e.sections[0],m=gt(p,f);c.x=c.offset.posX+c.width/2,c.y=c.offset.posY+c.height/2,l.x=l.offset.posX+l.width/2,l.y=l.offset.posY+l.height/2,c.shape!==`rect33`&&m.unshift({x:c.x,y:c.y}),l.shape!==`rect33`&&m.push({x:l.x,y:l.y}),t.points=Ct(wt(vt(m,c,l,i),jt(l),xt(t),i),jt(c),St(t),i),t.curve=`rounded`;let h=e.labels?.[0];h&&(t.x=h.x+f.x+h.width/2,t.y=h.y+f.y+h.height/2)}),o&&pt(e.edges)}r(mt,`applyElkEdgeLayout`);function ht(e,t,n,r){let i=e.width??0,a=e.height??0,o=e.offset.posY,s=o+a,c=.5,l=Math.abs(t.y-o)<=c||Math.abs(t.y-s)<=c;if((l?i:a)>=2*me||r.has(e.id))return;r.add(e.id);let u=l?t.x-(e.offset.posX+i/2):t.y-(e.offset.posY+a/2);if(Math.abs(u)<.01)return;l?(e.offset.posX+=u,e.x=e.offset.posX+i/2):(e.offset.posY+=u,e.y=e.offset.posY+a/2);let d=n.get(e.id);d&&(d.x=e.offset.posX+i/2,d.y=e.offset.posY+a/2)}r(ht,`alignDegenerateNodeToAnchor`);function gt(e,t){let n=e.startPoint,r=e.endPoint,i=(e.bendPoints?e.bendPoints:[]).map(e=>({x:e.x+t.x,y:e.y+t.y}));return[{x:n.x+t.x,y:n.y+t.y},...i,{x:r.x+t.x,y:r.y+t.y}]}r(gt,`createEdgePointsFromSection`);function _t(e,t,n,r){let i=p(e,t,n);if(i===void 0||i===`root`)return{x:0,y:0};let a=r[i],o=a?.elkOrigin??a?.offset;return{x:o?.posX??0,y:o?.posY??0}}r(_t,`calcOffset`);function vt(e,t,n,r){let i=Array.isArray(e)?[...e]:[],a=jt(n);r.debug(`PPP cutter2: Points before cutter2:`,JSON.stringify(e),`endBounds:`,a,S(a,e[e.length-1]));let o;{let e=jt(t),a=jt(n),s=!!t?.isGroup,c=!!n?.isGroup,{candidate:l,centerApprox:u}=Pt(i,t,`start`),{candidate:d,centerApprox:f}=Pt(i,n,`end`),p=s&&S(e,l),m=c&&S(a,d);Ft(i,`start`,p&&u),Ft(i,`end`,m&&f),s&&!p&&(p=It(i,e,`start`)),c&&!m&&(m=It(i,a,`end`)),p||m?(p||Lt(i,t,e,r),m||Rt(i,n,a,r),r.debug(`PPP cutter2: skipping cutter2 due to on-border group endpoint(s)`,{skipStart:p,skipEnd:m,startCenterApprox:u,endCenterApprox:f,startCandidate:l,endCandidate:d}),o=i):o=Bt(t,n,i,r)}if(r.debug(`PPP cutter2: Points after cutter2:`,JSON.stringify(o)),!Array.isArray(o)||o.length<2||yt(o)){r.warn(`POI cutter2: Invalid points from cutter2, falling back to prevPoints`,o);let e=i.filter(e=>Number.isFinite(e?.x)&&Number.isFinite(e?.y));o=e.length>=2?e:i}return r.debug(`UIO cutter2: Points after cutter2 (sanitized):`,o),bt(o,r)}r(vt,`sanitizeElkEdgePoints`);function yt(e){return e?.some(e=>!Number.isFinite(e?.x)||!Number.isFinite(e?.y))}r(yt,`hasInvalidPoint`);function bt(e,t){let n=e.filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return Math.abs(e.x-r.x)>1e-6||Math.abs(e.y-r.y)>1e-6});return n.length!==e.length&&t.debug(`UIO cutter2: removed consecutive duplicate points`,{before:e,after:n}),n}r(bt,`dedupeConsecutivePoints`);function xt(e){return fe(e.arrowTypeEnd)}r(xt,`getEndMarkerPathOffset`);function St(e){return fe(e.arrowTypeStart)}r(St,`getStartMarkerPathOffset`);function Ct(e,t,n,r){if(n<=0||e.length<3)return e;let i=e[0],a=e[1],o=Math.hypot(a.x-i.x,a.y-i.y);if(o>=Math.max(de,n*2)||!S(t,a,1))return e;let s=[i,...e.slice(2)];return r.debug(`UIO cutter2: removed short start marker segment`,{before:e,after:s,markerOffset:n,segmentLength:o}),s}r(Ct,`ensureStartMarkerSegmentLength`);function wt(e,t,n,r){if(n<=0||e.length<3)return e;let i=e[e.length-1],a=e[e.length-2],o=Math.hypot(i.x-a.x,i.y-a.y);if(o>=Math.max(de,n*2)||!S(t,a,1))return e;let s=[...e.slice(0,-2),i];return r.debug(`UIO cutter2: removed short end marker segment`,{before:e,after:s,markerOffset:n,segmentLength:o}),s}r(wt,`ensureEndMarkerSegmentLength`);function Tt(e,t){let n=e.edges.defaultInterpolate,r=e.edges.defaultStyle,i=t.getConfig();e.edges.forEach(e=>{let a=kt(e,{defaultStyle:r,defaultInterpolate:n,confCurve:i.curve},t);Object.assign(e,a)})}r(Tt,`applyElkEdgeRenderData`);function Et(e){if(e.classes!==void 0)return e.classes;if(e.start&&e.end)return`flowchart-link LS_${e.start} LE_${e.end}`}r(Et,`buildFallbackEdgeClasses`);function Dt(e,t,n){let r=`normal`,i=`solid`,a=[],o=[];return e===`dotted`?(i=`dotted`,a=[`fill:none`,`stroke-width:2px`,`stroke-dasharray:3`]):e===`thick`?(r=`thick`,a=[`stroke-width: 3.5px`,`fill:none`]):(a=t??[`fill:none`],n!==void 0&&(o=n)),{thickness:r,pattern:i,style:a,labelStyle:o}}r(Dt,`computeStroke`);function Ot(e,t,n){return e===void 0?t===void 0?n:t:e}r(Ot,`getCurve`);function kt(e,t,n){let r={};r.minlen=e.minlen??e.length??1,r.text=e.text??e.label,r.arrowhead=e.arrowhead??(e.type===`arrow_open`?`none`:`normal`);let i=pe[e.type??`arrow_open`]??pe.arrow_open;r.arrowTypeStart=e.arrowTypeStart??i[0],r.arrowTypeEnd=e.arrowTypeEnd??i[1],r.startLabelRight=e.startLabelRight,r.endLabelLeft=e.endLabelLeft;let o=Dt(e.stroke,t.defaultStyle,t.defaultLabelStyle);r.thickness=e.thickness??o.thickness,r.pattern=e.pattern??o.pattern,r.style=e.style??o.style,r.labelStyle=e.labelStyle??o.labelStyle,r.classes=Et(e),r.curve=n.interpolateToCurve(Ot(e.curve??e.interpolate,t.defaultInterpolate,t.confCurve),a);let s=(r.text??``)!==``;return e.arrowheadStyle===void 0?(s||e.style!==void 0)&&(r.arrowheadStyle=`fill: #333`):r.arrowheadStyle=e.arrowheadStyle,r.labelpos=e.labelpos??(s?`c`:void 0),r.labelType=e.labelType,r.label=(e.label??r.text??``).replace(n.common.lineBreakRegex,` `),r}r(kt,`buildEdgeData`);function At(e){return Math.max(e.width??0,De(e))}r(At,`getEffectiveGroupWidth`);function jt(e){let t=e?.isGroup?At(e):e.width;return{x:e.offset.posX+e.width/2,y:e.offset.posY+e.height/2,width:t??0,height:e.height??0,padding:e.padding}}r(jt,`boundsFor`);function Mt(e,t,n=1e-6){return Math.abs(e-t)1?e[1]:n,centerApprox:r}}{let n=e[e.length-1],r=Nt(n,t);return{candidate:r&&e.length>1?e[e.length-2]:n,centerApprox:r}}}r(Pt,`getCandidateBorderPoint`);function Ft(e,t,n){n&&(t===`start`?e.length>0&&e.shift():e.length>0&&e.pop())}r(Ft,`dropAutoCenterPoint`);function It(e,t,n){let r=n===`start`?1:-1,i=n===`start`?0:e.length-1,a=i;for(;i>=0&&i=e.length)return!1;let o=e[i],s=e[i-r],c=o.x-s.x,l=o.y-s.y,u=c===0?1/0:(t.x+Math.sign(c)*t.width/2-s.x)/c,d=l===0?1/0:(t.y+Math.sign(l)*t.height/2-s.y)/l,f=Math.min(u,d),p={x:s.x+f*c,y:s.y+f*l};return n===`start`?e.splice(0,i,p):e.splice(i+1,e.length-i-1,p),!0}r(It,`clipGroupEndpoint`);function Lt(e,t,n,r){let i=-1;for(let[t,r]of e.entries())if(te(n,r)){i=t;break}if(i!==-1){let a=e[i],o=e[0],s=le(t,n,a,o);ue(e,`start`,s),r.debug(`UIO cutter2: start-only intersection applied`,{startIntersection:s})}}r(Lt,`applyStartIntersectionIfNeeded`);function Rt(e,t,n,r){let i=-1;for(let t=e.length-1;t>=0;t--)if(te(n,e[t])){i=t;break}if(i!==-1){let a=e[i],o=e[e.length-1],s=le(t,n,a,o);ue(e,`end`,s),r.debug(`UIO cutter2: end-only intersection applied`,{endIntersection:s})}}r(Rt,`applyEndIntersectionIfNeeded`);function zt(e,t,n,r,i){if(e?.isGroup)return null;let a=n[r],o=n[r+i];return!a||!o?null:ce(e,t,a,o)}r(zt,`attachAlongDepartureAxis`);function Bt(e,t,n,r){let i=jt(e),a=jt(t);if(n.length===0)return[];let o=[...n],s=o[0],c=o[o.length-1];r.debug(`PPP cutter2: bounds`,{startBounds:i,endBounds:a}),r.debug(`PPP cutter2: original points`,n);let l=-1;for(let[e,t]of o.entries())l===-1&&te(i,t)&&(l=e);if(l!==-1){let t=o[l],n=zt(e,i,o,l,1)??le(e,i,t,s);r.debug(`UIO cutter2: start intersection`,n),ue(o,`start`,n)}let u=null,d=-1;for(let e=o.length-1;e>=0;e--)if(te(a,o[e])){u=o[e],d=e;break}if(!u&&o.length>1&&(u=o[o.length-2],d=o.length-2),u){let e=zt(t,a,o,d,-1)??le(t,a,u,c);r.debug(`UIO cutter2: end intersection`,{endIntersection:e,outsideIndexForEnd:d}),ue(o,`end`,e)}if(o.length>1){let e=o[o.length-1],t=o[o.length-2],n=Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2);n<2&&(r.debug(`UIO cutter2: trimming tail point (too close)`,{distance:n,lastPoint:e,secondLastPoint:t}),o.pop())}return r.debug(`UIO cutter2: final points`,o),o}r(Bt,`cutter2`);export{Fe as render}; \ No newline at end of file diff --git a/web/dist/app-erDiagram-OPXOYQCR.js b/web/dist/app-erDiagram-OPXOYQCR.js index f7ca1557f..cdeb480fb 100644 --- a/web/dist/app-erDiagram-OPXOYQCR.js +++ b/web/dist/app-erDiagram-OPXOYQCR.js @@ -1,9 +1,9 @@ -import{n as e,t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,U as a,a as o,it as s,q as c,s as l,v as u,w as d,x as f,y as p}from"./app-chunk-O7XYJQB3.js";import{t as m}from"./app-channel.js";import{c as h,g}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import{a as _,i as v,o as y,r as b,t as x}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import{t as S}from"./app-chunk-XXDRQBXY.js";import{t as C}from"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import{r as w,t as T}from"./app-chunk-GNY47TPC.js";var E=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],r=[2,2],i=[1,7],a=[1,9],o=[1,10],s=[1,11],c=[1,12],l=[1,30],u=[1,23],d=[1,24],f=[1,25],p=[1,26],m=[1,27],h=[1,19],g=[1,28],_=[1,29],v=[1,20],y=[1,18],b=[1,21],x=[1,22],S=[2,6],C=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],w=[1,36],T=[1,37],E=[1,38],D=[1,39],O=[1,40],k=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],A=[1,46],j=[1,47],M=[1,57],N=[43,51,53,54,55,74,75],P=[1,70],F=[1,68],I=[1,65],L=[1,69],R=[1,71],z=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],B=[1,78],V=[1,77],H=[1,76],U=[69,70,71,72,73],W=[1,91],G=[6,9,45,50],K=[6,9,12,44,45,50,51,52],q=[1,101],J=[1,100],Y=[1,99],X=[18,61],ee=[1,110],te=[1,109],ne=[20,43,51,53,54,55],Z=[18,61,64,66],Q={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:`error`,4:`ER_DIAGRAM`,6:`EOF`,9:`NEWLINE`,12:`COLON`,14:`STYLE_SEPARATOR`,16:`BLOCK_START`,18:`BLOCK_STOP`,19:`SQS`,20:`SQE`,21:`title`,22:`title_value`,23:`acc_title`,24:`acc_title_value`,25:`acc_descr`,26:`acc_descr_value`,27:`acc_descr_multiline_value`,33:`END`,34:`SUBGRAPH`,37:`direction_tb`,38:`direction_bt`,39:`direction_rl`,40:`direction_lr`,41:`CLASSDEF`,43:`UNICODE_TEXT`,44:`STYLE_TEXT`,45:`COMMA`,46:`CLASS`,47:`STYLE`,50:`SEMI`,51:`NUM`,52:`BRKT`,53:`ENTITY_NAME`,54:`DECIMAL_NUM`,55:`ENTITY_ONE`,61:`ATTRIBUTE_WORD`,62:`?`,64:`,`,65:`ATTRIBUTE_KEY`,66:`COMMENT`,69:`ZERO_OR_ONE`,70:`ZERO_OR_MORE`,71:`ONE_OR_MORE`,72:`ONLY_ONE`,73:`MD_PARENT`,74:`NON_IDENTIFYING`,75:`IDENTIFYING`,76:`WORD`},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:this.$=[];break;case 3:this.$=a[s-1].concat(a[s]);break;case 4:this.$=a[s];break;case 5:case 6:this.$=[];break;case 7:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]),this.$=[a[s-4],a[s-2]];break;case 8:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-8],a[s-4]];break;case 9:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]),this.$=[a[s-6],a[s-2]];break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-6],a[s-4]];break;case 11:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]),this.$=[a[s-3]];break;case 12:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]),this.$=[a[s-5]];break;case 13:r.addEntity(a[s-2]),this.$=[a[s-2]];break;case 14:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-4]];break;case 15:r.addEntity(a[s]),this.$=[a[s]];break;case 16:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]),this.$=[a[s-2]];break;case 17:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]),this.$=[a[s-6]];break;case 18:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]),this.$=[a[s-8]];break;case 19:r.addEntity(a[s-5],a[s-3]),this.$=[a[s-5]];break;case 20:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]),this.$=[a[s-7]];break;case 21:r.addEntity(a[s-3],a[s-1]);break;case 22:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 23:case 24:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 25:case 26:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 27:r.subgraphDepth?this.$=a[s]:(r.setDirection(a[s].value),this.$=[]);break;case 31:r.subgraphDepth=(r.subgraphDepth||1)-1,this.$=r.addSubGraph({text:a[s-2].id},a[s-1],{text:a[s-2].text});break;case 32:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-1],text:a[s-1]};break;case 33:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-4],text:a[s-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=a[s];break;case 35:this.$=a[s-1]+` `+a[s];break;case 36:this.$={stmt:`dir`,value:`TB`};break;case 37:this.$={stmt:`dir`,value:`BT`};break;case 38:this.$={stmt:`dir`,value:`RL`};break;case 39:this.$={stmt:`dir`,value:`LR`};break;case 40:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 41:case 42:case 63:case 72:this.$=[a[s]];break;case 43:case 44:this.$=a[s-2].concat([a[s]]);break;case 45:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 46:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 47:this.$=[a[s]];break;case 48:a[s-2].push(a[s]),this.$=a[s-2];break;case 50:this.$=a[s-1]+a[s];break;case 58:case 84:case 85:this.$=a[s].replace(/"/g,``);break;case 64:a[s].push(a[s-1]),this.$=a[s];break;case 65:this.$={type:a[s-1],name:a[s]};break;case 66:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 67:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 68:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 69:case 71:case 74:this.$=a[s];break;case 70:this.$=a[s-1]+a[s];break;case 73:a[s-2].push(a[s]),this.$=a[s-2];break;case 75:this.$=a[s].replace(/"/g,``);break;case 76:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 77:this.$=r.Cardinality.ZERO_OR_ONE;break;case 78:this.$=r.Cardinality.ZERO_OR_MORE;break;case 79:this.$=r.Cardinality.ONE_OR_MORE;break;case 80:this.$=r.Cardinality.ONLY_ONE;break;case 81:this.$=r.Cardinality.MD_PARENT;break;case 82:this.$=r.Identification.NON_IDENTIFYING;break;case 83:this.$=r.Identification.IDENTIFYING}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,r,{5:3}),{6:[1,4],7:5,8:6,9:i,10:8,21:a,23:o,25:s,27:c,28:13,29:14,30:15,31:16,32:17,34:l,37:u,38:d,39:f,40:p,41:m,43:h,46:g,47:_,51:v,53:y,54:b,55:x},t(n,S,{1:[2,1]}),t(C,[2,3]),t(C,[2,4]),t(C,[2,5]),t(C,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:w,70:T,71:E,72:D,73:O}),{22:[1,41]},{24:[1,42]},{26:[1,43]},t(C,[2,26]),t(C,[2,27]),t(C,[2,28]),t(C,[2,29]),t(C,[2,30]),t(C,r,{5:44}),t(k,[2,58]),t(k,[2,59]),t(k,[2,60]),t(k,[2,61]),t(k,[2,62]),t(C,[2,36]),t(C,[2,37]),t(C,[2,38]),t(C,[2,39]),{15:45,43:A,44:j},{15:48,43:A,44:j},{15:49,43:A,44:j},{10:50,43:h,51:v,53:y,54:b,55:x},{10:51,43:h,51:v,53:y,54:b,55:x},{15:52,43:A,44:j},{17:53,18:[1,54],56:55,57:56,61:M},{10:58,43:h,51:v,53:y,54:b,55:x},{68:59,74:[1,60],75:[1,61]},t(N,[2,77]),t(N,[2,78]),t(N,[2,79]),t(N,[2,80]),t(N,[2,81]),t(C,[2,23]),t(C,[2,24]),t(C,[2,25]),{6:[1,63],7:5,8:6,9:i,10:8,21:a,23:o,25:s,27:c,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:l,37:u,38:d,39:f,40:p,41:m,43:h,46:g,47:_,51:v,53:y,54:b,55:x},{12:P,42:64,44:F,45:I,48:66,49:67,51:L,52:R},t(z,[2,41]),t(z,[2,42]),{15:72,43:A,44:j,45:I},{12:P,42:73,44:F,45:I,48:66,49:67,51:L,52:R},{6:B,9:V,19:[1,75],35:74,50:H},{12:[1,79],14:[1,80]},t(C,[2,16],{67:35,11:81,16:[1,82],45:I,69:w,70:T,71:E,72:D,73:O}),{18:[1,83]},t(C,[2,13]),{17:84,18:[2,63],56:55,57:56,61:M},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:w,70:T,71:E,72:D,73:O},t(U,[2,82]),t(U,[2,83]),t(C,[2,31]),t(C,S),{6:B,9:V,35:90,45:W,50:H},{43:[1,92],44:[1,93]},t(G,[2,47],{49:94,12:P,44:F,51:L,52:R}),t(K,[2,49]),t(K,[2,54]),t(K,[2,55]),t(K,[2,56]),t(K,[2,57]),t(C,[2,45],{45:I}),{6:B,9:V,35:95,45:W,50:H},t(C,[2,32]),{10:97,36:96,43:h,51:v,53:y,54:b,55:x},t(C,[2,51]),t(C,[2,52]),t(C,[2,53]),{13:98,43:q,53:J,76:Y},{15:102,43:A,44:j},{10:103,43:h,51:v,53:y,54:b,55:x},{17:104,18:[1,105],56:55,57:56,61:M},t(C,[2,11]),{18:[2,64]},t(X,[2,65],{59:106,60:107,63:108,65:ee,66:te}),t([18,61,65,66],[2,71]),{61:[2,70]},t(C,[2,21],{14:[1,112],16:[1,111]}),t([43,51,53,54,55],[2,76]),t(C,[2,40]),{12:P,44:F,48:113,49:67,51:L,52:R},t(z,[2,43]),t(z,[2,44]),t(K,[2,50]),t(C,[2,46]),{10:115,20:[1,114],43:h,51:v,53:y,54:b,55:x},t(ne,[2,34]),t(C,[2,7]),t(C,[2,84]),t(C,[2,85]),t(C,[2,86]),{12:[1,116],45:I},{12:[1,118],14:[1,117]},{18:[1,119]},t(C,[2,14]),t(X,[2,66],{60:120,64:[1,121],66:te}),t(X,[2,67]),t(Z,[2,72]),t(X,[2,75]),t(Z,[2,74]),{17:122,18:[1,123],56:55,57:56,61:M},{15:124,43:A,44:j},t(G,[2,48],{49:94,12:P,44:F,51:L,52:R}),{6:B,9:V,35:125,50:H},t(ne,[2,35]),{13:126,43:q,53:J,76:Y},{15:127,43:A,44:j},{13:128,43:q,53:J,76:Y},t(C,[2,12]),t(X,[2,68]),{63:129,65:ee},{18:[1,130]},t(C,[2,19]),t(C,[2,22],{16:[1,131],45:I}),t(C,[2,33]),t(C,[2,10]),{12:[1,132],45:I},t(C,[2,9]),t(Z,[2,73]),t(C,[2,17]),{17:133,18:[1,134],56:55,57:56,61:M},{13:135,43:q,53:J,76:Y},{18:[1,136]},t(C,[2,20]),t(C,[2,8]),t(C,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{n as e,t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,U as a,a as o,it as s,q as c,s as l,v as u,w as d,x as f,y as p}from"./app-chunk-O7XYJQB3.js";import{t as m}from"./app-channel.js";import{c as h,g}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{a as _,i as v,o as y,r as b,t as x}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as S,t as C}from"./app-chunk-GNY47TPC.js";import{t as w}from"./app-chunk-XXDRQBXY.js";import{t as T}from"./app-chunk-WEXAMYUT.js";var E=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],r=[2,2],i=[1,7],a=[1,9],o=[1,10],s=[1,11],c=[1,12],l=[1,30],u=[1,23],d=[1,24],f=[1,25],p=[1,26],m=[1,27],h=[1,19],g=[1,28],_=[1,29],v=[1,20],y=[1,18],b=[1,21],x=[1,22],S=[2,6],C=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],w=[1,36],T=[1,37],E=[1,38],D=[1,39],O=[1,40],k=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],A=[1,46],j=[1,47],M=[1,57],N=[43,51,53,54,55,74,75],P=[1,70],F=[1,68],I=[1,65],L=[1,69],R=[1,71],z=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],B=[1,78],V=[1,77],H=[1,76],U=[69,70,71,72,73],W=[1,91],G=[6,9,45,50],K=[6,9,12,44,45,50,51,52],q=[1,101],J=[1,100],Y=[1,99],X=[18,61],ee=[1,110],te=[1,109],ne=[20,43,51,53,54,55],Z=[18,61,64,66],Q={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:`error`,4:`ER_DIAGRAM`,6:`EOF`,9:`NEWLINE`,12:`COLON`,14:`STYLE_SEPARATOR`,16:`BLOCK_START`,18:`BLOCK_STOP`,19:`SQS`,20:`SQE`,21:`title`,22:`title_value`,23:`acc_title`,24:`acc_title_value`,25:`acc_descr`,26:`acc_descr_value`,27:`acc_descr_multiline_value`,33:`END`,34:`SUBGRAPH`,37:`direction_tb`,38:`direction_bt`,39:`direction_rl`,40:`direction_lr`,41:`CLASSDEF`,43:`UNICODE_TEXT`,44:`STYLE_TEXT`,45:`COMMA`,46:`CLASS`,47:`STYLE`,50:`SEMI`,51:`NUM`,52:`BRKT`,53:`ENTITY_NAME`,54:`DECIMAL_NUM`,55:`ENTITY_ONE`,61:`ATTRIBUTE_WORD`,62:`?`,64:`,`,65:`ATTRIBUTE_KEY`,66:`COMMENT`,69:`ZERO_OR_ONE`,70:`ZERO_OR_MORE`,71:`ONE_OR_MORE`,72:`ONLY_ONE`,73:`MD_PARENT`,74:`NON_IDENTIFYING`,75:`IDENTIFYING`,76:`WORD`},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:this.$=[];break;case 3:this.$=a[s-1].concat(a[s]);break;case 4:this.$=a[s];break;case 5:case 6:this.$=[];break;case 7:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]),this.$=[a[s-4],a[s-2]];break;case 8:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-8],a[s-4]];break;case 9:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]),this.$=[a[s-6],a[s-2]];break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-6],a[s-4]];break;case 11:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]),this.$=[a[s-3]];break;case 12:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]),this.$=[a[s-5]];break;case 13:r.addEntity(a[s-2]),this.$=[a[s-2]];break;case 14:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-4]];break;case 15:r.addEntity(a[s]),this.$=[a[s]];break;case 16:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]),this.$=[a[s-2]];break;case 17:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]),this.$=[a[s-6]];break;case 18:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]),this.$=[a[s-8]];break;case 19:r.addEntity(a[s-5],a[s-3]),this.$=[a[s-5]];break;case 20:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]),this.$=[a[s-7]];break;case 21:r.addEntity(a[s-3],a[s-1]);break;case 22:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 23:case 24:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 25:case 26:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 27:r.subgraphDepth?this.$=a[s]:(r.setDirection(a[s].value),this.$=[]);break;case 31:r.subgraphDepth=(r.subgraphDepth||1)-1,this.$=r.addSubGraph({text:a[s-2].id},a[s-1],{text:a[s-2].text});break;case 32:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-1],text:a[s-1]};break;case 33:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-4],text:a[s-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=a[s];break;case 35:this.$=a[s-1]+` `+a[s];break;case 36:this.$={stmt:`dir`,value:`TB`};break;case 37:this.$={stmt:`dir`,value:`BT`};break;case 38:this.$={stmt:`dir`,value:`RL`};break;case 39:this.$={stmt:`dir`,value:`LR`};break;case 40:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 41:case 42:case 63:case 72:this.$=[a[s]];break;case 43:case 44:this.$=a[s-2].concat([a[s]]);break;case 45:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 46:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 47:this.$=[a[s]];break;case 48:a[s-2].push(a[s]),this.$=a[s-2];break;case 50:this.$=a[s-1]+a[s];break;case 58:case 84:case 85:this.$=a[s].replace(/"/g,``);break;case 64:a[s].push(a[s-1]),this.$=a[s];break;case 65:this.$={type:a[s-1],name:a[s]};break;case 66:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 67:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 68:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 69:case 71:case 74:this.$=a[s];break;case 70:this.$=a[s-1]+a[s];break;case 73:a[s-2].push(a[s]),this.$=a[s-2];break;case 75:this.$=a[s].replace(/"/g,``);break;case 76:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 77:this.$=r.Cardinality.ZERO_OR_ONE;break;case 78:this.$=r.Cardinality.ZERO_OR_MORE;break;case 79:this.$=r.Cardinality.ONE_OR_MORE;break;case 80:this.$=r.Cardinality.ONLY_ONE;break;case 81:this.$=r.Cardinality.MD_PARENT;break;case 82:this.$=r.Identification.NON_IDENTIFYING;break;case 83:this.$=r.Identification.IDENTIFYING}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,r,{5:3}),{6:[1,4],7:5,8:6,9:i,10:8,21:a,23:o,25:s,27:c,28:13,29:14,30:15,31:16,32:17,34:l,37:u,38:d,39:f,40:p,41:m,43:h,46:g,47:_,51:v,53:y,54:b,55:x},t(n,S,{1:[2,1]}),t(C,[2,3]),t(C,[2,4]),t(C,[2,5]),t(C,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:w,70:T,71:E,72:D,73:O}),{22:[1,41]},{24:[1,42]},{26:[1,43]},t(C,[2,26]),t(C,[2,27]),t(C,[2,28]),t(C,[2,29]),t(C,[2,30]),t(C,r,{5:44}),t(k,[2,58]),t(k,[2,59]),t(k,[2,60]),t(k,[2,61]),t(k,[2,62]),t(C,[2,36]),t(C,[2,37]),t(C,[2,38]),t(C,[2,39]),{15:45,43:A,44:j},{15:48,43:A,44:j},{15:49,43:A,44:j},{10:50,43:h,51:v,53:y,54:b,55:x},{10:51,43:h,51:v,53:y,54:b,55:x},{15:52,43:A,44:j},{17:53,18:[1,54],56:55,57:56,61:M},{10:58,43:h,51:v,53:y,54:b,55:x},{68:59,74:[1,60],75:[1,61]},t(N,[2,77]),t(N,[2,78]),t(N,[2,79]),t(N,[2,80]),t(N,[2,81]),t(C,[2,23]),t(C,[2,24]),t(C,[2,25]),{6:[1,63],7:5,8:6,9:i,10:8,21:a,23:o,25:s,27:c,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:l,37:u,38:d,39:f,40:p,41:m,43:h,46:g,47:_,51:v,53:y,54:b,55:x},{12:P,42:64,44:F,45:I,48:66,49:67,51:L,52:R},t(z,[2,41]),t(z,[2,42]),{15:72,43:A,44:j,45:I},{12:P,42:73,44:F,45:I,48:66,49:67,51:L,52:R},{6:B,9:V,19:[1,75],35:74,50:H},{12:[1,79],14:[1,80]},t(C,[2,16],{67:35,11:81,16:[1,82],45:I,69:w,70:T,71:E,72:D,73:O}),{18:[1,83]},t(C,[2,13]),{17:84,18:[2,63],56:55,57:56,61:M},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:w,70:T,71:E,72:D,73:O},t(U,[2,82]),t(U,[2,83]),t(C,[2,31]),t(C,S),{6:B,9:V,35:90,45:W,50:H},{43:[1,92],44:[1,93]},t(G,[2,47],{49:94,12:P,44:F,51:L,52:R}),t(K,[2,49]),t(K,[2,54]),t(K,[2,55]),t(K,[2,56]),t(K,[2,57]),t(C,[2,45],{45:I}),{6:B,9:V,35:95,45:W,50:H},t(C,[2,32]),{10:97,36:96,43:h,51:v,53:y,54:b,55:x},t(C,[2,51]),t(C,[2,52]),t(C,[2,53]),{13:98,43:q,53:J,76:Y},{15:102,43:A,44:j},{10:103,43:h,51:v,53:y,54:b,55:x},{17:104,18:[1,105],56:55,57:56,61:M},t(C,[2,11]),{18:[2,64]},t(X,[2,65],{59:106,60:107,63:108,65:ee,66:te}),t([18,61,65,66],[2,71]),{61:[2,70]},t(C,[2,21],{14:[1,112],16:[1,111]}),t([43,51,53,54,55],[2,76]),t(C,[2,40]),{12:P,44:F,48:113,49:67,51:L,52:R},t(z,[2,43]),t(z,[2,44]),t(K,[2,50]),t(C,[2,46]),{10:115,20:[1,114],43:h,51:v,53:y,54:b,55:x},t(ne,[2,34]),t(C,[2,7]),t(C,[2,84]),t(C,[2,85]),t(C,[2,86]),{12:[1,116],45:I},{12:[1,118],14:[1,117]},{18:[1,119]},t(C,[2,14]),t(X,[2,66],{60:120,64:[1,121],66:te}),t(X,[2,67]),t(Z,[2,72]),t(X,[2,75]),t(Z,[2,74]),{17:122,18:[1,123],56:55,57:56,61:M},{15:124,43:A,44:j},t(G,[2,48],{49:94,12:P,44:F,51:L,52:R}),{6:B,9:V,35:125,50:H},t(ne,[2,35]),{13:126,43:q,53:J,76:Y},{15:127,43:A,44:j},{13:128,43:q,53:J,76:Y},t(C,[2,12]),t(X,[2,68]),{63:129,65:ee},{18:[1,130]},t(C,[2,19]),t(C,[2,22],{16:[1,131],45:I}),t(C,[2,33]),t(C,[2,10]),{12:[1,132],45:I},t(C,[2,9]),t(Z,[2,73]),t(C,[2,17]),{17:133,18:[1,134],56:55,57:56,61:M},{13:135,43:q,53:J,76:Y},{18:[1,136]},t(C,[2,20]),t(C,[2,8]),t(C,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};Q.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),23;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),25;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin(`block`),16;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin(`block_bq`);break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;case 32:return t.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin(`style`),47;case 36:return this.popState(),9;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin(`style`),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return t.yytext[0];case 82:return 6}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}}})();function $(){this.yy={}}return e($,`Parser`),$.prototype=Q,Q.Parser=$,new $})();E.parser=E;var D=E,O=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction=`TB`,this.Cardinality={ZERO_OR_ONE:`ZERO_OR_ONE`,ZERO_OR_MORE:`ZERO_OR_MORE`,ONE_OR_MORE:`ONE_OR_MORE`,ONLY_ONE:`ONLY_ONE`,MD_PARENT:`MD_PARENT`},this.Identification={NON_IDENTIFYING:`NON_IDENTIFYING`,IDENTIFYING:`IDENTIFYING`},this.setAccTitle=a,this.getAccTitle=p,this.setAccDescription=i,this.getAccDescription=u,this.setDiagramTitle=c,this.getDiagramTitle=d,this.getConfig=e(()=>f().er,`getConfig`),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{e(this,`ErDB`)}addEntity(e,t=``){return this.entities.has(e)?!this.entities.get(e)?.alias&&t&&(this.entities.get(e).alias=t,n.info(`Add alias '${t}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:t,shape:`erBox`,look:f().look??`default`,cssClasses:`default`,cssStyles:[],labelType:`markdown`}),n.info(`Added new entity :`,e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,t){let r=this.addEntity(e),i;for(i=t.length-1;i>=0;i--)t[i].keys||(t[i].keys=[]),t[i].comment||(t[i].comment=``),r.attributes.push(t[i]),n.debug(`Added attribute `,t[i].name)}addRelationship(e,t,r,i){let a;if(this.subGraphLookup.has(e))a=e;else{let t=this.addEntity(e);if(!t)return;a=t.id}let o;if(this.subGraphLookup.has(r))o=r;else{let e=this.addEntity(r);if(!e)return;o=e.id}let s={entityA:a,roleA:t,entityB:o,relSpec:i};this.relationships.push(s),n.debug(`Added new relationship :`,s)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}addCssStyles(e,t){for(let n of e){let e=this.entities.get(n),r=this.subGraphLookup.get(n);if(t){if(e)for(let n of t)e.cssStyles.push(n);if(r){r.cssStyles||=[];for(let e of t)r.cssStyles.push(e)}}}}addClass(e,t){e.forEach(e=>{let n=this.classes.get(e);n===void 0&&(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n)),t&&t.forEach(function(e){if(/color/.exec(e)){let t=e.replace(`fill`,`bgFill`);n.textStyles.push(t)}n.styles.push(e)})})}addSubGraph(t,r,i){let a=t.text.trim(),o=i.text,s=e(e=>{let t=new Set,n;return{nodeList:e.filter(e=>{if(e?.stmt)return e.stmt===`dir`&&(n=e.value),!1;if(typeof e!=`string`)return!1;let r=e.trim();return!r||t.has(r)?!1:(t.add(r),!0)}),dir:n}},`uniq`)(r.flat()),c=s.nodeList,l=s.dir;a??=`subGraph`+this.subCount,o||=``,o=this.sanitizeText(o),this.subCount+=1;let u={id:a,nodes:c,title:o.trim(),classes:[],cssStyles:[],dir:l,labelType:this.sanitizeNodeLabelType(i?.type)};return n.info(`Adding`,u.id,u.nodes,u.dir),u.nodes=this.makeUniq(u,this.subGraphs).nodes,this.subGraphs.push(u),this.subGraphLookup.set(a,u),a}getSubGraphs(){return this.subGraphs}setClass(e,t){for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssClasses+=` `+n;let r=this.subGraphLookup.get(n);if(r)for(let e of t)r.classes.push(e)}}subgraphNodeCache(e){let t=new Set;for(let n of e)for(let e of n.nodes)t.add(e);return t}makeUniq(e,t){let r=this.subgraphNodeCache(t),i=[];return e.nodes.forEach((t,a)=>{r.has(t)?n.warn(`Entity '${t}' already belongs to another subgraph and will be ignored`):i.push(e.nodes[a])}),{nodes:i}}sanitizeText(e){return l.sanitizeText(e,f())}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,o()}getData(){let e=[],t=[],n=f(),r=this.getSubGraphs(),i=new Map,a=new Map;for(let e=r.length-1;e>=0;e--){let t=r[e];t.nodes.length>0&&a.set(t.id,!0);for(let e of t.nodes)i.set(e,t.id)}for(let t=r.length-1;t>=0;t--){let a=r[t];e.push({id:a.id,label:a.title,labelStyle:``,labelType:a.labelType,parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssStyles:a.cssStyles,cssClasses:a.classes.join(` `),shape:`rect`,dir:a.dir,isGroup:!0,look:n.look})}let o=new Set(r.map(e=>e.id)),s=0;for(let t of this.entities.keys()){if(o.has(t))continue;let n=this.entities.get(t);n&&(n.cssCompiledStyles=this.getCompiledStyles(n.cssClasses.split(` `)),n.colorIndex=s++,e.push({...n,parentId:i.get(t),isGroup:!1}))}let c=0;for(let e of this.relationships){let r={id:h(e.entityA,e.entityB,{prefix:`id`,counter:c++}),type:`normal`,curve:`basis`,start:e.entityA,end:e.entityB,label:e.roleA,labelpos:`c`,thickness:`normal`,classes:`relationshipLine`,arrowTypeStart:e.relSpec.cardB.toLowerCase(),arrowTypeEnd:e.relSpec.cardA.toLowerCase(),pattern:e.relSpec.relType==`IDENTIFYING`?`solid`:`dashed`,look:n.look,labelType:`markdown`};t.push(r)}return{nodes:e,edges:t,other:{},config:n,direction:this.direction}}},k={};t(k,{draw:()=>A});var A=e(async function(e,t,i,a){n.info(`REF0:`),n.info(`Drawing er diagram (unified)`,t);let{securityLevel:o,er:s,layout:c}=f(),l=a.db.getData(),u=S(t,o);l.type=a.type,l.layoutAlgorithm=T(c),l.config.flowchart.nodeSpacing=s?.nodeSpacing||140,l.config.flowchart.rankSpacing=s?.rankSpacing||80,l.direction=a.db.getDirection();let{config:d}=l,{look:p}=d;l.markers=p===`neo`?[`only_one_neo`,`zero_or_one_neo`,`one_or_more_neo`,`zero_or_more_neo`]:[`only_one`,`zero_or_one`,`one_or_more`,`zero_or_more`],l.diagramId=t,await w(l,u);let m=u.selectAll(`[id*="-background"]`);Array.from(m).length>0&&m.each(function(){let e=r(this),t=e.attr(`id`).replace(`-background`,``),n=u.select(`#${CSS.escape(t)}`);if(!n.empty()){let t=n.attr(`transform`);e.attr(`transform`,t)}}),g.insertTitle(u,`erDiagramTitleText`,s?.titleTopMargin??25,a.db.getDiagramTitle()),C(u,8,`erDiagram`,s?.useMaxWidth??!0)},`draw`),j=e((e,t)=>{let n=m,r=n(e,`r`),i=n(e,`g`),a=n(e,`b`);return s(r,i,a,t)},`fade`),M=e(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!v(t,r))return``;let i=y(e.look),a=b(n),o=``;for(let e=0;e<_(r);e++){let t=r[e],s=a?`fill: ${n[e%n.length]};`:``;o+=` +`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),23;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),25;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin(`block`),16;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin(`block_bq`);break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;case 32:return t.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin(`style`),47;case 36:return this.popState(),9;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin(`style`),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return t.yytext[0];case 82:return 6}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}}})();function $(){this.yy={}}return e($,`Parser`),$.prototype=Q,Q.Parser=$,new $})();E.parser=E;var D=E,O=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction=`TB`,this.Cardinality={ZERO_OR_ONE:`ZERO_OR_ONE`,ZERO_OR_MORE:`ZERO_OR_MORE`,ONE_OR_MORE:`ONE_OR_MORE`,ONLY_ONE:`ONLY_ONE`,MD_PARENT:`MD_PARENT`},this.Identification={NON_IDENTIFYING:`NON_IDENTIFYING`,IDENTIFYING:`IDENTIFYING`},this.setAccTitle=a,this.getAccTitle=p,this.setAccDescription=i,this.getAccDescription=u,this.setDiagramTitle=c,this.getDiagramTitle=d,this.getConfig=e(()=>f().er,`getConfig`),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{e(this,`ErDB`)}addEntity(e,t=``){return this.entities.has(e)?!this.entities.get(e)?.alias&&t&&(this.entities.get(e).alias=t,n.info(`Add alias '${t}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:t,shape:`erBox`,look:f().look??`default`,cssClasses:`default`,cssStyles:[],labelType:`markdown`}),n.info(`Added new entity :`,e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,t){let r=this.addEntity(e),i;for(i=t.length-1;i>=0;i--)t[i].keys||(t[i].keys=[]),t[i].comment||(t[i].comment=``),r.attributes.push(t[i]),n.debug(`Added attribute `,t[i].name)}addRelationship(e,t,r,i){let a;if(this.subGraphLookup.has(e))a=e;else{let t=this.addEntity(e);if(!t)return;a=t.id}let o;if(this.subGraphLookup.has(r))o=r;else{let e=this.addEntity(r);if(!e)return;o=e.id}let s={entityA:a,roleA:t,entityB:o,relSpec:i};this.relationships.push(s),n.debug(`Added new relationship :`,s)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}addCssStyles(e,t){for(let n of e){let e=this.entities.get(n),r=this.subGraphLookup.get(n);if(t){if(e)for(let n of t)e.cssStyles.push(n);if(r){r.cssStyles||=[];for(let e of t)r.cssStyles.push(e)}}}}addClass(e,t){e.forEach(e=>{let n=this.classes.get(e);n===void 0&&(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n)),t&&t.forEach(function(e){if(/color/.exec(e)){let t=e.replace(`fill`,`bgFill`);n.textStyles.push(t)}n.styles.push(e)})})}addSubGraph(t,r,i){let a=t.text.trim(),o=i.text,s=e(e=>{let t=new Set,n;return{nodeList:e.filter(e=>{if(e?.stmt)return e.stmt===`dir`&&(n=e.value),!1;if(typeof e!=`string`)return!1;let r=e.trim();return!r||t.has(r)?!1:(t.add(r),!0)}),dir:n}},`uniq`)(r.flat()),c=s.nodeList,l=s.dir;a??=`subGraph`+this.subCount,o||=``,o=this.sanitizeText(o),this.subCount+=1;let u={id:a,nodes:c,title:o.trim(),classes:[],cssStyles:[],dir:l,labelType:this.sanitizeNodeLabelType(i?.type)};return n.info(`Adding`,u.id,u.nodes,u.dir),u.nodes=this.makeUniq(u,this.subGraphs).nodes,this.subGraphs.push(u),this.subGraphLookup.set(a,u),a}getSubGraphs(){return this.subGraphs}setClass(e,t){for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssClasses+=` `+n;let r=this.subGraphLookup.get(n);if(r)for(let e of t)r.classes.push(e)}}subgraphNodeCache(e){let t=new Set;for(let n of e)for(let e of n.nodes)t.add(e);return t}makeUniq(e,t){let r=this.subgraphNodeCache(t),i=[];return e.nodes.forEach((t,a)=>{r.has(t)?n.warn(`Entity '${t}' already belongs to another subgraph and will be ignored`):i.push(e.nodes[a])}),{nodes:i}}sanitizeText(e){return l.sanitizeText(e,f())}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,o()}getData(){let e=[],t=[],n=f(),r=this.getSubGraphs(),i=new Map,a=new Map;for(let e=r.length-1;e>=0;e--){let t=r[e];t.nodes.length>0&&a.set(t.id,!0);for(let e of t.nodes)i.set(e,t.id)}for(let t=r.length-1;t>=0;t--){let a=r[t];e.push({id:a.id,label:a.title,labelStyle:``,labelType:a.labelType,parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssStyles:a.cssStyles,cssClasses:a.classes.join(` `),shape:`rect`,dir:a.dir,isGroup:!0,look:n.look})}let o=new Set(r.map(e=>e.id)),s=0;for(let t of this.entities.keys()){if(o.has(t))continue;let n=this.entities.get(t);n&&(n.cssCompiledStyles=this.getCompiledStyles(n.cssClasses.split(` `)),n.colorIndex=s++,e.push({...n,parentId:i.get(t),isGroup:!1}))}let c=0;for(let e of this.relationships){let r={id:h(e.entityA,e.entityB,{prefix:`id`,counter:c++}),type:`normal`,curve:`basis`,start:e.entityA,end:e.entityB,label:e.roleA,labelpos:`c`,thickness:`normal`,classes:`relationshipLine`,arrowTypeStart:e.relSpec.cardB.toLowerCase(),arrowTypeEnd:e.relSpec.cardA.toLowerCase(),pattern:e.relSpec.relType==`IDENTIFYING`?`solid`:`dashed`,look:n.look,labelType:`markdown`};t.push(r)}return{nodes:e,edges:t,other:{},config:n,direction:this.direction}}},k={};t(k,{draw:()=>A});var A=e(async function(e,t,i,a){n.info(`REF0:`),n.info(`Drawing er diagram (unified)`,t);let{securityLevel:o,er:s,layout:c}=f(),l=a.db.getData(),u=w(t,o);l.type=a.type,l.layoutAlgorithm=C(c),l.config.flowchart.nodeSpacing=s?.nodeSpacing||140,l.config.flowchart.rankSpacing=s?.rankSpacing||80,l.direction=a.db.getDirection();let{config:d}=l,{look:p}=d;l.markers=p===`neo`?[`only_one_neo`,`zero_or_one_neo`,`one_or_more_neo`,`zero_or_more_neo`]:[`only_one`,`zero_or_one`,`one_or_more`,`zero_or_more`],l.diagramId=t,await S(l,u);let m=u.selectAll(`[id*="-background"]`);Array.from(m).length>0&&m.each(function(){let e=r(this),t=e.attr(`id`).replace(`-background`,``),n=u.select(`#${CSS.escape(t)}`);if(!n.empty()){let t=n.attr(`transform`);e.attr(`transform`,t)}}),g.insertTitle(u,`erDiagramTitleText`,s?.titleTopMargin??25,a.db.getDiagramTitle()),T(u,8,`erDiagram`,s?.useMaxWidth??!0)},`draw`),j=e((e,t)=>{let n=m,r=n(e,`r`),i=n(e,`g`),a=n(e,`b`);return s(r,i,a,t)},`fade`),M=e(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!v(t,r))return``;let i=y(e.look),a=b(n),o=``;for(let e=0;e<_(r);e++){let t=r[e],s=a?`fill: ${n[e%n.length]};`:``;o+=` [data-look="${i}"][data-color-id="color-${e}"].node path { stroke: ${t}; diff --git a/web/dist/app-flowDiagram-KWPJA3E3.js b/web/dist/app-flowDiagram-KWPJA3E3.js index 084282984..ae835a6e3 100644 --- a/web/dist/app-flowDiagram-KWPJA3E3.js +++ b/web/dist/app-flowDiagram-KWPJA3E3.js @@ -1 +1 @@ -import"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import"./app-chunk-GWA4HPMP.js";import"./app-chunk-XXDRQBXY.js";import"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-GNY47TPC.js";import"./app-chunk-LNGE3PJU.js";import{n as e}from"./app-chunk-7M6MHVWA.js";export{e as diagram}; \ No newline at end of file +import"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-LNGE3PJU.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import"./app-chunk-GNY47TPC.js";import"./app-chunk-GWA4HPMP.js";import"./app-chunk-XXDRQBXY.js";import"./app-chunk-WEXAMYUT.js";import{n as e}from"./app-chunk-7M6MHVWA.js";export{e as diagram}; \ No newline at end of file diff --git a/web/dist/app-kanban-definition-PNTS6WVX.js b/web/dist/app-kanban-definition-PNTS6WVX.js index 8c1bf55ea..e0283a7fe 100644 --- a/web/dist/app-kanban-definition-PNTS6WVX.js +++ b/web/dist/app-kanban-definition-PNTS6WVX.js @@ -1,14 +1,14 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{Y as n,et as r,f as i,rt as a,tt as o,x as s,z as c}from"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import{t as l}from"./app-chunk-6AEJRKK7.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{t as u}from"./app-chunk-5VM5RSS4.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-7INBJB4K.js";import{i as d,r as f}from"./app-chunk-5DYCD2WN.js";import{r as p}from"./app-chunk-UA2S7LBM.js";import{n as m,t as h}from"./app-chunk-LNGE3PJU.js";var g=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,13],i=[1,12],a=[1,15],o=[1,16],s=[1,20],c=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],p=[6,7,11],m=[1,31],h=[6,7,11,24],g=[1,6,13,16,17,20,23],_=[1,35],v=[1,36],y=[1,6,7,11,13,16,17,20,23],b=[1,38],x={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`KANBAN`,11:`EOF`,13:`SPACELIST`,16:`ICON`,17:`CLASS`,20:`NODE_DSTART`,21:`NODE_DESCR`,22:`NODE_DEND`,23:`NODE_ID`,24:`SHAPE_DATA`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s-1].id),r.addNode(a[s-2].length,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 16:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 17:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 18:case 23:r.decorateNode({class:a[s]});break;case 19:r.getLogger().trace(`SPACELIST`);break;case 20:r.getLogger().trace(`Node: `,a[s-1].id),r.addNode(0,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 21:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 22:r.decorateNode({icon:a[s]});break;case 27:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 28:this.$={id:a[s],descr:a[s],type:0};break;case 29:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 30:this.$=a[s-1]+a[s];break;case 31:this.$=a[s]}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},{6:r,9:22,12:11,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},{6:u,7:d,10:23,11:f},t(p,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:c}),t(p,[2,19]),t(p,[2,21],{15:30,24:m}),t(p,[2,22]),t(p,[2,23]),t(h,[2,25]),t(h,[2,26]),t(h,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:d,10:34,11:f},{1:[2,7],6:r,12:21,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},t(g,[2,14],{7:_,11:v}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(p,[2,16],{15:37,24:m}),t(p,[2,17]),t(p,[2,18]),t(p,[2,20],{24:b}),t(h,[2,31]),{21:[1,39]},{22:[1,40]},t(g,[2,13],{7:_,11:v}),t(y,[2,11]),t(y,[2,12]),t(p,[2,15],{24:b}),t(h,[2,30]),{22:[1,41]},t(h,[2,27]),t(h,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{Y as n,et as r,f as i,rt as a,tt as o,x as s,z as c}from"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import{t as l}from"./app-chunk-6AEJRKK7.js";import{n as u,t as d}from"./app-chunk-LNGE3PJU.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7INBJB4K.js";import{i as f,r as p}from"./app-chunk-5DYCD2WN.js";import{r as m}from"./app-chunk-UA2S7LBM.js";import{t as h}from"./app-chunk-5VM5RSS4.js";var g=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,13],i=[1,12],a=[1,15],o=[1,16],s=[1,20],c=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],p=[6,7,11],m=[1,31],h=[6,7,11,24],g=[1,6,13,16,17,20,23],_=[1,35],v=[1,36],y=[1,6,7,11,13,16,17,20,23],b=[1,38],x={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`KANBAN`,11:`EOF`,13:`SPACELIST`,16:`ICON`,17:`CLASS`,20:`NODE_DSTART`,21:`NODE_DESCR`,22:`NODE_DEND`,23:`NODE_ID`,24:`SHAPE_DATA`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s-1].id),r.addNode(a[s-2].length,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 16:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 17:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 18:case 23:r.decorateNode({class:a[s]});break;case 19:r.getLogger().trace(`SPACELIST`);break;case 20:r.getLogger().trace(`Node: `,a[s-1].id),r.addNode(0,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 21:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 22:r.decorateNode({icon:a[s]});break;case 27:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 28:this.$={id:a[s],descr:a[s],type:0};break;case 29:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 30:this.$=a[s-1]+a[s];break;case 31:this.$=a[s]}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},{6:r,9:22,12:11,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},{6:u,7:d,10:23,11:f},t(p,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:c}),t(p,[2,19]),t(p,[2,21],{15:30,24:m}),t(p,[2,22]),t(p,[2,23]),t(h,[2,25]),t(h,[2,26]),t(h,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:d,10:34,11:f},{1:[2,7],6:r,12:21,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},t(g,[2,14],{7:_,11:v}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(p,[2,16],{15:37,24:m}),t(p,[2,17]),t(p,[2,18]),t(p,[2,20],{24:b}),t(h,[2,31]),{21:[1,39]},{22:[1,40]},t(g,[2,13],{7:_,11:v}),t(y,[2,11]),t(y,[2,12]),t(p,[2,15],{24:b}),t(h,[2,30]),{22:[1,41]},t(h,[2,27]),t(h,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};x.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return this.pushState(`shapeData`),t.yytext=``,24;case 1:return this.pushState(`shapeDataStr`),24;case 2:return this.popState(),24;case 3:return t.yytext=t.yytext.replace(/\n\s*/g,`
`),24;case 4:return 24;case 5:this.popState();break;case 6:return e.getLogger().trace(`Found comment`,t.yytext),6;case 7:return 8;case 8:this.begin(`CLASS`);break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:e.getLogger().trace(`Begin icon`),this.begin(`ICON`);break;case 12:return e.getLogger().trace(`SPACELINE`),6;case 13:return 7;case 14:return 16;case 15:e.getLogger().trace(`end icon`),this.popState();break;case 16:return e.getLogger().trace(`Exploding node`),this.begin(`NODE`),20;case 17:return e.getLogger().trace(`Cloud`),this.begin(`NODE`),20;case 18:return e.getLogger().trace(`Explosion Bang`),this.begin(`NODE`),20;case 19:return e.getLogger().trace(`Cloud Bang`),this.begin(`NODE`),20;case 20:return this.begin(`NODE`),20;case 21:return this.begin(`NODE`),20;case 22:return this.begin(`NODE`),20;case 23:return this.begin(`NODE`),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin(`NSTR2`);break;case 28:return`NODE_DESCR`;case 29:this.popState();break;case 30:e.getLogger().trace(`Starting NSTR`),this.begin(`NSTR`);break;case 31:return e.getLogger().trace(`description:`,t.yytext),`NODE_DESCR`;case 32:this.popState();break;case 33:return this.popState(),e.getLogger().trace(`node end ))`),`NODE_DEND`;case 34:return this.popState(),e.getLogger().trace(`node end )`),`NODE_DEND`;case 35:return this.popState(),e.getLogger().trace(`node end ...`,t.yytext),`NODE_DEND`;case 36:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 37:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 38:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 39:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 40:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 41:return e.getLogger().trace(`Long description:`,t.yytext),21;case 42:return e.getLogger().trace(`Long description:`,t.yytext),21}},`anonymous`),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}})();function S(){this.yy={}}return e(S,`Parser`),S.prototype=x,x.Parser=S,new S})();g.parser=g;var _=g,v=[],y=[],b=0,x={},S=e(()=>{v=[],y=[],b=0,x={}},`clear`),C=e(e=>{if(v.length===0)return null;let t=v[0].level,n=null;for(let e=v.length-1;e>=0;e--)if(v[e].level===t&&!n&&(n=v[e]),v[e].levelt.parentId===e.id);for(let n of i){let i={id:n.id,parentId:e.id,label:c(n.label??``,r),labelType:`markdown`,isGroup:!1,ticket:n?.ticket,priority:n?.priority,assigned:n?.assigned,icon:n?.icon,shape:`kanbanItem`,level:n.level,rx:5,ry:5,cssStyles:[`text-align: left`]};t.push(i)}}return{nodes:t,edges:e,other:{},config:s()}},`getData`),E=e((e,t,n,r,a)=>{let o=s(),l=o.mindmap?.padding??i.mindmap.padding;switch(r){case D.ROUNDED_RECT:case D.RECT:case D.HEXAGON:l*=2}let u={id:c(t,o)||`kbn`+b++,level:e,label:c(n,o),width:o.mindmap?.maxNodeWidth??i.mindmap.maxNodeWidth,padding:l,isGroup:!1};if(a!==void 0){let e;e=a.includes(` +`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return this.pushState(`shapeData`),t.yytext=``,24;case 1:return this.pushState(`shapeDataStr`),24;case 2:return this.popState(),24;case 3:return t.yytext=t.yytext.replace(/\n\s*/g,`
`),24;case 4:return 24;case 5:this.popState();break;case 6:return e.getLogger().trace(`Found comment`,t.yytext),6;case 7:return 8;case 8:this.begin(`CLASS`);break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:e.getLogger().trace(`Begin icon`),this.begin(`ICON`);break;case 12:return e.getLogger().trace(`SPACELINE`),6;case 13:return 7;case 14:return 16;case 15:e.getLogger().trace(`end icon`),this.popState();break;case 16:return e.getLogger().trace(`Exploding node`),this.begin(`NODE`),20;case 17:return e.getLogger().trace(`Cloud`),this.begin(`NODE`),20;case 18:return e.getLogger().trace(`Explosion Bang`),this.begin(`NODE`),20;case 19:return e.getLogger().trace(`Cloud Bang`),this.begin(`NODE`),20;case 20:return this.begin(`NODE`),20;case 21:return this.begin(`NODE`),20;case 22:return this.begin(`NODE`),20;case 23:return this.begin(`NODE`),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin(`NSTR2`);break;case 28:return`NODE_DESCR`;case 29:this.popState();break;case 30:e.getLogger().trace(`Starting NSTR`),this.begin(`NSTR`);break;case 31:return e.getLogger().trace(`description:`,t.yytext),`NODE_DESCR`;case 32:this.popState();break;case 33:return this.popState(),e.getLogger().trace(`node end ))`),`NODE_DEND`;case 34:return this.popState(),e.getLogger().trace(`node end )`),`NODE_DEND`;case 35:return this.popState(),e.getLogger().trace(`node end ...`,t.yytext),`NODE_DEND`;case 36:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 37:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 38:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 39:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 40:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 41:return e.getLogger().trace(`Long description:`,t.yytext),21;case 42:return e.getLogger().trace(`Long description:`,t.yytext),21}},`anonymous`),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}})();function S(){this.yy={}}return e(S,`Parser`),S.prototype=x,x.Parser=S,new S})();g.parser=g;var _=g,v=[],y=[],b=0,x={},S=e(()=>{v=[],y=[],b=0,x={}},`clear`),C=e(e=>{if(v.length===0)return null;let t=v[0].level,n=null;for(let e=v.length-1;e>=0;e--)if(v[e].level===t&&!n&&(n=v[e]),v[e].levelt.parentId===e.id);for(let n of i){let i={id:n.id,parentId:e.id,label:c(n.label??``,r),labelType:`markdown`,isGroup:!1,ticket:n?.ticket,priority:n?.priority,assigned:n?.assigned,icon:n?.icon,shape:`kanbanItem`,level:n.level,rx:5,ry:5,cssStyles:[`text-align: left`]};t.push(i)}}return{nodes:t,edges:e,other:{},config:s()}},`getData`),E=e((e,t,n,r,a)=>{let o=s(),l=o.mindmap?.padding??i.mindmap.padding;switch(r){case D.ROUNDED_RECT:case D.RECT:case D.HEXAGON:l*=2}let f={id:c(t,o)||`kbn`+b++,level:e,label:c(n,o),width:o.mindmap?.maxNodeWidth??i.mindmap.maxNodeWidth,padding:l,isGroup:!1};if(a!==void 0){let e;e=a.includes(` `)?a+` `:`{ `+a+` -}`;let t=m(e,{schema:h});if(t.shape&&(t.shape!==t.shape.toLowerCase()||t.shape.includes(`_`)))throw Error(`No such shape: ${t.shape}. Shape names should be lowercase.`);t?.shape&&t.shape===`kanbanItem`&&(u.shape=t?.shape),t?.label&&(u.label=t?.label),t?.icon&&(u.icon=t?.icon.toString()),t?.assigned&&(u.assigned=t?.assigned.toString()),t?.ticket&&(u.ticket=t?.ticket.toString()),t?.priority&&(u.priority=t?.priority)}let d=C(e);d?u.parentId=d.id||`kbn`+b++:y.push(u),v.push(u)},`addNode`),D={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},O={clear:S,addNode:E,getSections:w,getData:T,nodeType:D,getType:e((e,n)=>{switch(t.debug(`In get type`,e,n),e){case`[`:return D.RECT;case`(`:return n===`)`?D.ROUNDED_RECT:D.CLOUD;case`((`:return D.CIRCLE;case`)`:return D.CLOUD;case`))`:return D.BANG;case`{{`:return D.HEXAGON;default:return D.DEFAULT}},`getType`),setElementForId:e((e,t)=>{x[e]=t},`setElementForId`),decorateNode:e(e=>{if(!e)return;let t=s(),n=v[v.length-1];e.icon&&(n.icon=c(e.icon,t)),e.class&&(n.cssClasses=c(e.class,t))},`decorateNode`),type2Str:e(e=>{switch(e){case D.DEFAULT:return`no-border`;case D.RECT:return`rect`;case D.ROUNDED_RECT:return`rounded-rect`;case D.CIRCLE:return`circle`;case D.CLOUD:return`cloud`;case D.BANG:return`bang`;case D.HEXAGON:return`hexgon`;default:return`no-border`}},`type2Str`),getLogger:e(()=>t,`getLogger`),getElementById:e(e=>x[e],`getElementById`)},k={draw:e(async(e,r,a,o)=>{t.debug(`Rendering kanban diagram -`+e);let c=o.db.getData(),u=s();u.htmlLabels=!1;let m=l(r);for(let e of c.nodes)e.domId=`${r}-${e.id}`;let h=m.append(`g`);h.attr(`class`,`sections`);let g=m.append(`g`);g.attr(`class`,`items`);let _=c.nodes.filter(e=>e.isGroup),v=0,y=[],b=25;for(let e of _){let t=u?.kanban?.sectionWidth||200;v+=1,e.x=t*v+(v-1)*10/2,e.width=t,e.y=0,e.height=t*3,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+` section-`+v;let n=await p(h,e);b=Math.max(b,n?.labelBBox?.height),y.push(n)}let x=0;for(let e of _){let t=y[x];x+=1;let n=u?.kanban?.sectionWidth||200,r=-n*3/2+b,i=r,a=c.nodes.filter(t=>t.parentId===e.id);for(let t of a){if(t.isGroup)throw Error(`Groups within groups are not allowed in Kanban diagrams`);t.x=e.x,t.width=n-15;let r=(await f(g,t,{config:u})).node().getBBox();t.y=i+r.height/2,await d(t),i=t.y+r.height/2+10/2}let o=t.cluster.select(`rect`),s=Math.max(i-r+30,50)+(b-25);o.attr(`height`,s)}n(void 0,m,u.mindmap?.padding??i.kanban.padding,u.mindmap?.useMaxWidth??i.kanban.useMaxWidth)},`draw`)},A=e(t=>{let n=``;for(let e=0;et.darkMode?r(e,n):o(e,n),`adjuster`);for(let e=0;e{switch(t.debug(`In get type`,e,n),e){case`[`:return D.RECT;case`(`:return n===`)`?D.ROUNDED_RECT:D.CLOUD;case`((`:return D.CIRCLE;case`)`:return D.CLOUD;case`))`:return D.BANG;case`{{`:return D.HEXAGON;default:return D.DEFAULT}},`getType`),setElementForId:e((e,t)=>{x[e]=t},`setElementForId`),decorateNode:e(e=>{if(!e)return;let t=s(),n=v[v.length-1];e.icon&&(n.icon=c(e.icon,t)),e.class&&(n.cssClasses=c(e.class,t))},`decorateNode`),type2Str:e(e=>{switch(e){case D.DEFAULT:return`no-border`;case D.RECT:return`rect`;case D.ROUNDED_RECT:return`rounded-rect`;case D.CIRCLE:return`circle`;case D.CLOUD:return`cloud`;case D.BANG:return`bang`;case D.HEXAGON:return`hexgon`;default:return`no-border`}},`type2Str`),getLogger:e(()=>t,`getLogger`),getElementById:e(e=>x[e],`getElementById`)},k={draw:e(async(e,r,a,o)=>{t.debug(`Rendering kanban diagram +`+e);let c=o.db.getData(),u=s();u.htmlLabels=!1;let d=l(r);for(let e of c.nodes)e.domId=`${r}-${e.id}`;let h=d.append(`g`);h.attr(`class`,`sections`);let g=d.append(`g`);g.attr(`class`,`items`);let _=c.nodes.filter(e=>e.isGroup),v=0,y=[],b=25;for(let e of _){let t=u?.kanban?.sectionWidth||200;v+=1,e.x=t*v+(v-1)*10/2,e.width=t,e.y=0,e.height=t*3,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+` section-`+v;let n=await m(h,e);b=Math.max(b,n?.labelBBox?.height),y.push(n)}let x=0;for(let e of _){let t=y[x];x+=1;let n=u?.kanban?.sectionWidth||200,r=-n*3/2+b,i=r,a=c.nodes.filter(t=>t.parentId===e.id);for(let t of a){if(t.isGroup)throw Error(`Groups within groups are not allowed in Kanban diagrams`);t.x=e.x,t.width=n-15;let r=(await p(g,t,{config:u})).node().getBBox();t.y=i+r.height/2,await f(t),i=t.y+r.height/2+10/2}let o=t.cluster.select(`rect`),s=Math.max(i-r+30,50)+(b-25);o.attr(`height`,s)}n(void 0,d,u.mindmap?.padding??i.kanban.padding,u.mindmap?.useMaxWidth??i.kanban.useMaxWidth)},`draw`)},A=e(t=>{let n=``;for(let e=0;et.darkMode?r(e,n):o(e,n),`adjuster`);for(let e=0;e= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return h(r)}var b=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,13],i=[1,12],a=[1,15],o=[1,16],s=[1,20],c=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],p=[6,7,11],m=[1,6,13,15,16,19,22],h=[1,33],g=[1,34],_=[1,6,7,11,13,15,16,19,22],v={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`MINDMAP`,11:`EOF`,13:`SPACELIST`,15:`ICON`,16:`CLASS`,19:`NODE_DSTART`,20:`NODE_DESCR`,21:`NODE_DEND`,22:`NODE_ID`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 16:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 17:case 21:r.decorateNode({class:a[s]});break;case 18:r.getLogger().trace(`SPACELIST`);break;case 19:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 20:r.decorateNode({icon:a[s]});break;case 25:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 26:this.$={id:a[s],descr:a[s],type:r.nodeType.DEFAULT};break;case 27:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])}}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},{6:r,9:22,12:11,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},{6:u,7:d,10:23,11:f},t(p,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:c}),t(p,[2,18]),t(p,[2,19]),t(p,[2,20]),t(p,[2,21]),t(p,[2,23]),t(p,[2,24]),t(p,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:d,10:32,11:f},{1:[2,7],6:r,12:21,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},t(m,[2,14],{7:h,11:g}),t(_,[2,8]),t(_,[2,9]),t(_,[2,10]),t(p,[2,15]),t(p,[2,16]),t(p,[2,17]),{20:[1,35]},{21:[1,36]},t(m,[2,13],{7:h,11:g}),t(_,[2,11]),t(_,[2,12]),{21:[1,37]},t(p,[2,25]),t(p,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{b as n,et as r,f as i,k as a,rt as o,tt as s,x as c,z as l}from"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as u,t as d}from"./app-chunk-GNY47TPC.js";import{t as f}from"./app-chunk-XXDRQBXY.js";import{t as p}from"./app-chunk-WEXAMYUT.js";var m=[];for(let e=0;e<256;++e)m.push((e+256).toString(16).slice(1));function h(e,t=0){return(m[e[t+0]]+m[e[t+1]]+m[e[t+2]]+m[e[t+3]]+`-`+m[e[t+4]]+m[e[t+5]]+`-`+m[e[t+6]]+m[e[t+7]]+`-`+m[e[t+8]]+m[e[t+9]]+`-`+m[e[t+10]]+m[e[t+11]]+m[e[t+12]]+m[e[t+13]]+m[e[t+14]]+m[e[t+15]]).toLowerCase()}var g=new Uint8Array(16);function _(){return crypto.getRandomValues(g)}function v(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():y(e,t,n)}function y(e,t,n){e||={};let r=e.random??e.rng?.()??_();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return h(r)}var b=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,13],i=[1,12],a=[1,15],o=[1,16],s=[1,20],c=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],p=[6,7,11],m=[1,6,13,15,16,19,22],h=[1,33],g=[1,34],_=[1,6,7,11,13,15,16,19,22],v={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`MINDMAP`,11:`EOF`,13:`SPACELIST`,15:`ICON`,16:`CLASS`,19:`NODE_DSTART`,20:`NODE_DESCR`,21:`NODE_DEND`,22:`NODE_ID`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 16:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 17:case 21:r.decorateNode({class:a[s]});break;case 18:r.getLogger().trace(`SPACELIST`);break;case 19:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 20:r.decorateNode({icon:a[s]});break;case 25:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 26:this.$={id:a[s],descr:a[s],type:r.nodeType.DEFAULT};break;case 27:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])}}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},{6:r,9:22,12:11,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},{6:u,7:d,10:23,11:f},t(p,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:c}),t(p,[2,18]),t(p,[2,19]),t(p,[2,20]),t(p,[2,21]),t(p,[2,23]),t(p,[2,24]),t(p,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:d,10:32,11:f},{1:[2,7],6:r,12:21,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},t(m,[2,14],{7:h,11:g}),t(_,[2,8]),t(_,[2,9]),t(_,[2,10]),t(p,[2,15]),t(p,[2,16]),t(p,[2,17]),{20:[1,35]},{21:[1,36]},t(m,[2,13],{7:h,11:g}),t(_,[2,11]),t(_,[2,12]),{21:[1,37]},t(p,[2,25]),t(p,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};v.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return e.getLogger().trace(`Found comment`,t.yytext),6;case 1:return 8;case 2:this.begin(`CLASS`);break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:e.getLogger().trace(`Begin icon`),this.begin(`ICON`);break;case 6:return e.getLogger().trace(`SPACELINE`),6;case 7:return 7;case 8:return 15;case 9:e.getLogger().trace(`end icon`),this.popState();break;case 10:return e.getLogger().trace(`Exploding node`),this.begin(`NODE`),19;case 11:return e.getLogger().trace(`Cloud`),this.begin(`NODE`),19;case 12:return e.getLogger().trace(`Explosion Bang`),this.begin(`NODE`),19;case 13:return e.getLogger().trace(`Cloud Bang`),this.begin(`NODE`),19;case 14:return this.begin(`NODE`),19;case 15:return this.begin(`NODE`),19;case 16:return this.begin(`NODE`),19;case 17:return this.begin(`NODE`),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin(`NSTR2`);break;case 22:return`NODE_DESCR`;case 23:this.popState();break;case 24:e.getLogger().trace(`Starting NSTR`),this.begin(`NSTR`);break;case 25:return e.getLogger().trace(`description:`,t.yytext),`NODE_DESCR`;case 26:this.popState();break;case 27:return this.popState(),e.getLogger().trace(`node end ))`),`NODE_DEND`;case 28:return this.popState(),e.getLogger().trace(`node end )`),`NODE_DEND`;case 29:return this.popState(),e.getLogger().trace(`node end ...`,t.yytext),`NODE_DEND`;case 30:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 31:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 32:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 33:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 34:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 35:return e.getLogger().trace(`Long description:`,t.yytext),20;case 36:return e.getLogger().trace(`Long description:`,t.yytext),20}},`anonymous`),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}}})();function y(){this.yy={}}return e(y,`Parser`),y.prototype=v,v.Parser=y,new y})();b.parser=b;var x=b,S=12,C={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},w=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=C,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{e(this,`MindmapDB`)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let t=this.nodes.length-1;t>=0;t--)if(this.nodes[t].level0?this.nodes[0]:null}addNode(e,n,r,a){t.info(`addNode`,e,n,r,a);let o=!1;this.nodes.length===0?(this.baseLevel=e,e=0,o=!0):this.baseLevel!==void 0&&(e-=this.baseLevel,o=!1);let s=c(),u=s.mindmap?.padding??i.mindmap.padding;switch(a){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:u*=2}let d={id:this.count++,nodeId:l(n,s),level:e,descr:l(r,s),type:a,children:[],width:s.mindmap?.maxNodeWidth??i.mindmap.maxNodeWidth,padding:u,isRoot:o},f=this.getParent(e);if(f)f.children.push(d),this.nodes.push(d);else if(o)this.nodes.push(d);else throw Error(`There can be only one root. No parent could be found for ("${d.descr}")`)}getType(e,n){switch(t.debug(`In get type`,e,n),e){case`[`:return this.nodeType.RECT;case`(`:return n===`)`?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case`((`:return this.nodeType.CIRCLE;case`)`:return this.nodeType.CLOUD;case`))`:return this.nodeType.BANG;case`{{`:return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,t){this.elements[e]=t}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;let t=c(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=l(e.icon,t)),e.class&&(n.class=l(e.class,t))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return`no-border`;case this.nodeType.RECT:return`rect`;case this.nodeType.ROUNDED_RECT:return`rounded-rect`;case this.nodeType.CIRCLE:return`circle`;case this.nodeType.CLOUD:return`cloud`;case this.nodeType.BANG:return`bang`;case this.nodeType.HEXAGON:return`hexgon`;default:return`no-border`}}assignSections(e,t){if(e.section=e.level===0?void 0:t,e.children)for(let[n,r]of e.children.entries()){let i=e.level===0?n%(S-1):t;this.assignSections(r,i)}}flattenNodes(t,n){let r=c(),i=[`mindmap-node`];t.isRoot===!0?i.push(`section-root`,`section--1`):t.section!==void 0&&i.push(`section-${t.section}`),t.class&&i.push(t.class);let a=i.join(` `),o=e(e=>{let t=(r.theme?.toLowerCase()??``).includes(`redux`);switch(e){case C.CIRCLE:return`mindmapCircle`;case C.RECT:return`rect`;case C.ROUNDED_RECT:return`rounded`;case C.CLOUD:return`cloud`;case C.BANG:return`bang`;case C.HEXAGON:return`hexagon`;case C.DEFAULT:return t?`rounded`:`defaultMindmapNode`;case C.NO_BORDER:default:return`rect`}},`getShapeFromType`),s={id:t.id.toString(),domId:`node_`+t.id.toString(),label:t.descr,labelType:`markdown`,isGroup:!1,shape:o(t.type),width:t.width,height:t.height??0,padding:t.padding,cssClasses:a,cssStyles:[],look:r.look,icon:t.icon,x:t.x,y:t.y,level:t.level,nodeId:t.nodeId,type:t.type,section:t.section};if(n.push(s),t.children)for(let e of t.children)this.flattenNodes(e,n)}generateEdges(e,t){if(!e.children)return;let n=c();for(let r of e.children){let i=`edge`;r.section!==void 0&&(i+=` section-edge-${r.section}`);let a=e.level+1;i+=` edge-depth-${a}`;let o={id:`edge_${e.id}_${r.id}`,start:e.id.toString(),end:r.id.toString(),type:`normal`,curve:`basis`,thickness:`normal`,look:n.look,classes:i,depth:e.level,section:r.section};t.push(o),this.generateEdges(r,t)}}getData(){let e=this.getMindmap(),n=c(),r=a().layout!==void 0,i=n;if(r||(i.layout=`cose-bilkent`),!e)return{nodes:[],edges:[],config:i};t.debug(`getData: mindmapRoot`,e,n),this.assignSections(e);let o=[],s=[];this.flattenNodes(e,o),this.generateEdges(e,s),t.debug(`getData: processed ${o.length} nodes and ${s.length} edges`);let l=new Map;for(let e of o)l.set(e.id,{shape:e.shape,width:e.width,height:e.height,padding:e.padding});return{nodes:o,edges:s,config:i,rootNode:e,markers:[`point`],direction:`TB`,nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:`mindmap`,diagramId:`mindmap-`+v()}}getLogger(){return t}},T={draw:e(async(e,r,a,o)=>{t.debug(`Rendering mindmap diagram -`+e);let s=o.db,c=s.getData(),l=u(r,c.config.securityLevel);if(c.type=o.type,c.layoutAlgorithm=p(c.config.layout,{fallback:`cose-bilkent`}),c.diagramId=r,!s.getMindmap())return;c.nodes.forEach(e=>{e.shape===`rounded`?(e.radius=15,e.taper=15,e.stroke=`none`,e.width=0,e.padding=15):e.shape===`circle`?e.padding=10:e.shape===`rect`?(e.width=0,e.padding=10):e.shape===`hexagon`&&(e.width=0,e.height=0)}),await f(c,l);let{themeVariables:m}=n(),{useGradient:h,gradientStart:g,gradientStop:_}=m;if(h&&g&&_){let e=l.attr(`id`),t=l.append(`defs`).append(`linearGradient`).attr(`id`,`${e}-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,g).attr(`stop-opacity`,1),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,_).attr(`stop-opacity`,1)}d(l,c.config.mindmap?.padding??i.mindmap.padding,`mindmapDiagram`,c.config.mindmap?.useMaxWidth??i.mindmap.useMaxWidth)},`draw`)},E=e(e=>{let{theme:t,look:n}=e,i=``;for(let t=0;t{e.shape===`rounded`?(e.radius=15,e.taper=15,e.stroke=`none`,e.width=0,e.padding=15):e.shape===`circle`?e.padding=10:e.shape===`rect`?(e.width=0,e.padding=10):e.shape===`hexagon`&&(e.width=0,e.height=0)}),await u(c,l);let{themeVariables:m}=n(),{useGradient:h,gradientStart:g,gradientStop:_}=m;if(h&&g&&_){let e=l.attr(`id`),t=l.append(`defs`).append(`linearGradient`).attr(`id`,`${e}-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,g).attr(`stop-opacity`,1),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,_).attr(`stop-opacity`,1)}p(l,c.config.mindmap?.padding??i.mindmap.padding,`mindmapDiagram`,c.config.mindmap?.useMaxWidth??i.mindmap.useMaxWidth)},`draw`)},E=e(e=>{let{theme:t,look:n}=e,i=``;for(let t=0;t{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformOrderedChoice`),u=t(e=>{let t=e.elements.map(d);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=t(e=>{let t=p(e.suffix);return e.operator?{type:`special`,text:e.operator===`&`?`&${f(t)}`:`!${f(t)}`}:t},`transformPrefix`),f=t(e=>{switch(e.type){case`terminal`:return`"${e.value}"`;case`nonterminal`:return e.name;case`special`:return e.text;default:return`(...)`}},`nodeToLabel`),p=t(e=>{let t=m(e.primary);if(!e.operator)return t;switch(e.operator){case`?`:return{type:`optional`,element:t};case`*`:return{type:`repetition`,element:t,min:0,max:1/0};case`+`:return{type:`repetition`,element:t,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${e.operator}`)}},`transformSuffix`),m=t(e=>{switch(e.$type){case`PegLiteral`:return{type:`terminal`,value:e.value};case`PegIdentifier`:return{type:`nonterminal`,name:e.name};case`PegGroup`:return l(e.element);case`PegAny`:return{type:`special`,text:e.dot};default:throw Error(`Unsupported PEG primary node: ${e.$type}`)}},`transformPrimary`),h=t(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),g=t(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(h(e)))},`populateDb`),_={parser:{parse:t(e=>{a.clear(),n.debug(`[PEG Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;n.debug(`[PEG Parser] Parsed rules:`,r.rules.length),g(r),n.debug(`[PEG Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{_ as diagram}; \ No newline at end of file +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n}from"./app-chunk-747NJXEK.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=n().RailroadPeg.parser.LangiumParser,l=e(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformOrderedChoice`),u=e(e=>{let t=e.elements.map(d);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=e(e=>{let t=p(e.suffix);return e.operator?{type:`special`,text:e.operator===`&`?`&${f(t)}`:`!${f(t)}`}:t},`transformPrefix`),f=e(e=>{switch(e.type){case`terminal`:return`"${e.value}"`;case`nonterminal`:return e.name;case`special`:return e.text;default:return`(...)`}},`nodeToLabel`),p=e(e=>{let t=m(e.primary);if(!e.operator)return t;switch(e.operator){case`?`:return{type:`optional`,element:t};case`*`:return{type:`repetition`,element:t,min:0,max:1/0};case`+`:return{type:`repetition`,element:t,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${e.operator}`)}},`transformSuffix`),m=e(e=>{switch(e.$type){case`PegLiteral`:return{type:`terminal`,value:e.value};case`PegIdentifier`:return{type:`nonterminal`,name:e.name};case`PegGroup`:return l(e.element);case`PegAny`:return{type:`special`,text:e.dot};default:throw Error(`Unsupported PEG primary node: ${e.$type}`)}},`transformPrimary`),h=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),g=e(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(h(e)))},`populateDb`),_={parser:{parse:e(e=>{a.clear(),t.debug(`[PEG Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new s(n);let r=n.value;t.debug(`[PEG Parser] Parsed rules:`,r.rules.length),g(r),t.debug(`[PEG Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{_ as diagram}; \ No newline at end of file diff --git a/web/dist/app-railroadDiagram-XR7U4H2S.js b/web/dist/app-railroadDiagram-XR7U4H2S.js index f243f535a..1c28847b3 100644 --- a/web/dist/app-railroadDiagram-XR7U4H2S.js +++ b/web/dist/app-railroadDiagram-XR7U4H2S.js @@ -1 +1 @@ -import{n as e}from"./app-chunk-OUJLGHUK.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=e().Railroad.parser.LangiumParser,l=t(e=>{switch(e.$type){case`RailroadTerminalExpr`:return{type:`terminal`,value:e.value};case`RailroadNonTerminalExpr`:return{type:`nonterminal`,name:e.name};case`RailroadSpecialExpr`:return{type:`special`,text:e.text};case`RailroadSequenceExpr`:{let t=e.elements.map(l);return t.length===1?t[0]:{type:`sequence`,elements:t}}case`RailroadChoiceExpr`:{let t=e.alternatives.map(l);return t.length===1?t[0]:{type:`choice`,alternatives:t}}case`RailroadOptionalExpr`:return{type:`optional`,element:l(e.element)};case`RailroadOneOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:1,max:1/0};case`RailroadZeroOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported railroad expression: ${e.$type}`)}},`transformExpression`),u=t(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),d=t(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(u(e)))},`populateDb`),f={parser:{parse:t(e=>{a.clear(),n.debug(`[Railroad Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;n.debug(`[Railroad Parser] Parsed rules:`,r.rules.length),d(r),n.debug(`[Railroad Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{f as diagram}; \ No newline at end of file +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n}from"./app-chunk-OUJLGHUK.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=n().Railroad.parser.LangiumParser,l=e(e=>{switch(e.$type){case`RailroadTerminalExpr`:return{type:`terminal`,value:e.value};case`RailroadNonTerminalExpr`:return{type:`nonterminal`,name:e.name};case`RailroadSpecialExpr`:return{type:`special`,text:e.text};case`RailroadSequenceExpr`:{let t=e.elements.map(l);return t.length===1?t[0]:{type:`sequence`,elements:t}}case`RailroadChoiceExpr`:{let t=e.alternatives.map(l);return t.length===1?t[0]:{type:`choice`,alternatives:t}}case`RailroadOptionalExpr`:return{type:`optional`,element:l(e.element)};case`RailroadOneOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:1,max:1/0};case`RailroadZeroOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported railroad expression: ${e.$type}`)}},`transformExpression`),u=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),d=e(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(u(e)))},`populateDb`),f={parser:{parse:e(e=>{a.clear(),t.debug(`[Railroad Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new s(n);let r=n.value;t.debug(`[Railroad Parser] Parsed rules:`,r.rules.length),d(r),t.debug(`[Railroad Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{f as diagram}; \ No newline at end of file diff --git a/web/dist/app-requirementDiagram-PLB6GJNP.js b/web/dist/app-requirementDiagram-PLB6GJNP.js index 2bde92b74..94e28e2a7 100644 --- a/web/dist/app-requirementDiagram-PLB6GJNP.js +++ b/web/dist/app-requirementDiagram-PLB6GJNP.js @@ -1,4 +1,4 @@ -import{n as e,t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import{H as r,U as i,a,b as o,q as s,v as c,w as l,x as u,y as d}from"./app-chunk-O7XYJQB3.js";import{g as f}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import{a as p,i as m,o as h,r as g}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import{t as _}from"./app-chunk-XXDRQBXY.js";import{t as v}from"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import{r as y,t as b}from"./app-chunk-GNY47TPC.js";var x=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],c=[2,7],l=[1,26],u=[1,27],d=[1,28],f=[1,29],p=[1,33],m=[1,34],h=[1,35],g=[1,36],_=[1,37],v=[1,38],y=[1,24],b=[1,31],x=[1,32],S=[1,30],C=[1,39],w=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,61],D=[89,90],O=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],k=[27,29],ee=[1,70],A=[1,71],te=[1,72],ne=[1,73],re=[1,74],ie=[1,75],ae=[1,76],j=[1,83],M=[1,80],N=[1,84],P=[1,85],F=[1,86],I=[1,87],L=[1,88],R=[1,89],z=[1,90],B=[1,91],V=[1,92],oe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],H=[63,64],se=[1,101],ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],U=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],W=[1,110],G=[1,106],K=[1,107],q=[1,108],J=[1,109],Y=[1,111],X=[1,116],Z=[1,117],Q=[1,114],$=[1,115],le={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:`error`,5:`NEWLINE`,6:`RD`,8:`EOF`,9:`acc_title`,10:`acc_title_value`,11:`acc_descr`,12:`acc_descr_value`,13:`acc_descr_multiline_value`,21:`direction_tb`,22:`direction_bt`,23:`direction_rl`,24:`direction_lr`,27:`STRUCT_START`,29:`STYLE_SEPARATOR`,31:`ID`,32:`COLONSEP`,34:`TEXT`,36:`RISK`,38:`VERIFYMTHD`,40:`STRUCT_STOP`,41:`REQUIREMENT`,42:`FUNCTIONAL_REQUIREMENT`,43:`INTERFACE_REQUIREMENT`,44:`PERFORMANCE_REQUIREMENT`,45:`PHYSICAL_REQUIREMENT`,46:`DESIGN_CONSTRAINT`,47:`LOW_RISK`,48:`MED_RISK`,49:`HIGH_RISK`,50:`VERIFY_ANALYSIS`,51:`VERIFY_DEMONSTRATION`,52:`VERIFY_INSPECTION`,53:`VERIFY_TEST`,54:`ELEMENT`,57:`TYPE`,59:`DOCREF`,61:`END_ARROW_L`,63:`LINE`,64:`END_ARROW_R`,65:`CONTAINS`,66:`COPIES`,67:`DERIVES`,68:`SATISFIES`,69:`VERIFIES`,70:`REFINES`,71:`TRACES`,72:`CLASSDEF`,74:`CLASS`,75:`ALPHA`,76:`COMMA`,77:`STYLE`,80:`NUM`,81:`COLON`,82:`UNIT`,83:`SPACE`,84:`BRKT`,85:`PCT`,86:`MINUS`,87:`LABEL`,88:`SEMICOLON`,89:`unqString`,90:`qString`},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection(`TB`);break;case 18:r.setDirection(`BT`);break;case 19:r.setDirection(`RL`);break;case 20:r.setDirection(`LR`);break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 65:this.$=[a[s]];break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s]}},`anonymous`),table:[{3:1,4:2,6:n,9:r,11:i,13:a},{1:[3]},{3:8,4:2,5:[1,7],6:n,9:r,11:i,13:a},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(o,[2,6]),{3:12,4:2,6:n,9:r,11:i,13:a},{1:[2,2]},{4:17,5:s,7:13,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},t(o,[2,4]),t(o,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:43,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:44,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:45,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:46,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:47,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:48,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:49,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:50,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(T,[2,17]),t(T,[2,18]),t(T,[2,19]),t(T,[2,20]),{30:60,33:62,75:E,89:C,90:w},{30:63,33:62,75:E,89:C,90:w},{30:64,33:62,75:E,89:C,90:w},t(D,[2,29]),t(D,[2,30]),t(D,[2,31]),t(D,[2,32]),t(D,[2,33]),t(D,[2,34]),t(O,[2,81]),t(O,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(k,[2,79]),t(k,[2,80]),{27:[1,67],29:[1,68]},t(k,[2,85]),t(k,[2,86]),{62:69,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{62:77,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{30:78,33:62,75:E,89:C,90:w},{73:79,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,60]),t(oe,[2,62]),{73:93,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},{30:94,33:62,75:E,76:M,89:C,90:w},{5:[1,95]},{30:96,33:62,75:E,89:C,90:w},{5:[1,97]},{30:98,33:62,75:E,89:C,90:w},{63:[1,99]},t(H,[2,50]),t(H,[2,51]),t(H,[2,52]),t(H,[2,53]),t(H,[2,54]),t(H,[2,55]),t(H,[2,56]),{64:[1,100]},t(T,[2,59],{76:M}),t(T,[2,64],{76:se}),{33:103,75:[1,102],89:C,90:w},t(ce,[2,65],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),t(U,[2,67]),t(U,[2,69]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(U,[2,74]),t(U,[2,75]),t(U,[2,76]),t(U,[2,77]),t(U,[2,78]),t(T,[2,57],{76:se}),t(T,[2,58],{76:M}),{5:W,28:105,31:G,34:K,36:q,38:J,40:Y},{27:[1,112],76:M},{5:X,40:Z,56:113,57:Q,59:$},{27:[1,118],76:M},{33:119,89:C,90:w},{33:120,89:C,90:w},{75:j,78:121,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,61]),t(oe,[2,63]),t(U,[2,68]),t(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:W,28:126,31:G,34:K,36:q,38:J,40:Y},t(T,[2,28]),{5:[1,127]},t(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:X,40:Z,56:130,57:Q,59:$},t(T,[2,47]),{5:[1,131]},t(T,[2,48]),t(T,[2,49]),t(ce,[2,66],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),{33:132,89:C,90:w},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(T,[2,27]),{5:W,28:145,31:G,34:K,36:q,38:J,40:Y},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(T,[2,46]),{5:X,40:Z,56:152,57:Q,59:$},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(T,[2,43]),{5:W,28:159,31:G,34:K,36:q,38:J,40:Y},{5:W,28:160,31:G,34:K,36:q,38:J,40:Y},{5:W,28:161,31:G,34:K,36:q,38:J,40:Y},{5:W,28:162,31:G,34:K,36:q,38:J,40:Y},{5:X,40:Z,56:163,57:Q,59:$},{5:X,40:Z,56:164,57:Q,59:$},t(T,[2,23]),t(T,[2,24]),t(T,[2,25]),t(T,[2,26]),t(T,[2,44]),t(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,ee,A;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var te=``;for(O in A=[],s[w])this.terminals_[O]&&O>f&&A.push(`'`+this.terminals_[O]+`'`);te=h.showPosition?`Parse error on line `+(l+1)+`: +import{n as e,t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import{H as r,U as i,a,b as o,q as s,v as c,w as l,x as u,y as d}from"./app-chunk-O7XYJQB3.js";import{g as f}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{a as p,i as m,o as h,r as g}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as _,t as v}from"./app-chunk-GNY47TPC.js";import{t as y}from"./app-chunk-XXDRQBXY.js";import{t as b}from"./app-chunk-WEXAMYUT.js";var x=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],c=[2,7],l=[1,26],u=[1,27],d=[1,28],f=[1,29],p=[1,33],m=[1,34],h=[1,35],g=[1,36],_=[1,37],v=[1,38],y=[1,24],b=[1,31],x=[1,32],S=[1,30],C=[1,39],w=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,61],D=[89,90],O=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],k=[27,29],ee=[1,70],A=[1,71],te=[1,72],ne=[1,73],re=[1,74],ie=[1,75],ae=[1,76],j=[1,83],M=[1,80],N=[1,84],P=[1,85],F=[1,86],I=[1,87],L=[1,88],R=[1,89],z=[1,90],B=[1,91],V=[1,92],oe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],H=[63,64],se=[1,101],ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],U=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],W=[1,110],G=[1,106],K=[1,107],q=[1,108],J=[1,109],Y=[1,111],X=[1,116],Z=[1,117],Q=[1,114],$=[1,115],le={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:`error`,5:`NEWLINE`,6:`RD`,8:`EOF`,9:`acc_title`,10:`acc_title_value`,11:`acc_descr`,12:`acc_descr_value`,13:`acc_descr_multiline_value`,21:`direction_tb`,22:`direction_bt`,23:`direction_rl`,24:`direction_lr`,27:`STRUCT_START`,29:`STYLE_SEPARATOR`,31:`ID`,32:`COLONSEP`,34:`TEXT`,36:`RISK`,38:`VERIFYMTHD`,40:`STRUCT_STOP`,41:`REQUIREMENT`,42:`FUNCTIONAL_REQUIREMENT`,43:`INTERFACE_REQUIREMENT`,44:`PERFORMANCE_REQUIREMENT`,45:`PHYSICAL_REQUIREMENT`,46:`DESIGN_CONSTRAINT`,47:`LOW_RISK`,48:`MED_RISK`,49:`HIGH_RISK`,50:`VERIFY_ANALYSIS`,51:`VERIFY_DEMONSTRATION`,52:`VERIFY_INSPECTION`,53:`VERIFY_TEST`,54:`ELEMENT`,57:`TYPE`,59:`DOCREF`,61:`END_ARROW_L`,63:`LINE`,64:`END_ARROW_R`,65:`CONTAINS`,66:`COPIES`,67:`DERIVES`,68:`SATISFIES`,69:`VERIFIES`,70:`REFINES`,71:`TRACES`,72:`CLASSDEF`,74:`CLASS`,75:`ALPHA`,76:`COMMA`,77:`STYLE`,80:`NUM`,81:`COLON`,82:`UNIT`,83:`SPACE`,84:`BRKT`,85:`PCT`,86:`MINUS`,87:`LABEL`,88:`SEMICOLON`,89:`unqString`,90:`qString`},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection(`TB`);break;case 18:r.setDirection(`BT`);break;case 19:r.setDirection(`RL`);break;case 20:r.setDirection(`LR`);break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 65:this.$=[a[s]];break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s]}},`anonymous`),table:[{3:1,4:2,6:n,9:r,11:i,13:a},{1:[3]},{3:8,4:2,5:[1,7],6:n,9:r,11:i,13:a},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(o,[2,6]),{3:12,4:2,6:n,9:r,11:i,13:a},{1:[2,2]},{4:17,5:s,7:13,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},t(o,[2,4]),t(o,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:43,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:44,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:45,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:46,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:47,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:48,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:49,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:50,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(T,[2,17]),t(T,[2,18]),t(T,[2,19]),t(T,[2,20]),{30:60,33:62,75:E,89:C,90:w},{30:63,33:62,75:E,89:C,90:w},{30:64,33:62,75:E,89:C,90:w},t(D,[2,29]),t(D,[2,30]),t(D,[2,31]),t(D,[2,32]),t(D,[2,33]),t(D,[2,34]),t(O,[2,81]),t(O,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(k,[2,79]),t(k,[2,80]),{27:[1,67],29:[1,68]},t(k,[2,85]),t(k,[2,86]),{62:69,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{62:77,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{30:78,33:62,75:E,89:C,90:w},{73:79,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,60]),t(oe,[2,62]),{73:93,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},{30:94,33:62,75:E,76:M,89:C,90:w},{5:[1,95]},{30:96,33:62,75:E,89:C,90:w},{5:[1,97]},{30:98,33:62,75:E,89:C,90:w},{63:[1,99]},t(H,[2,50]),t(H,[2,51]),t(H,[2,52]),t(H,[2,53]),t(H,[2,54]),t(H,[2,55]),t(H,[2,56]),{64:[1,100]},t(T,[2,59],{76:M}),t(T,[2,64],{76:se}),{33:103,75:[1,102],89:C,90:w},t(ce,[2,65],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),t(U,[2,67]),t(U,[2,69]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(U,[2,74]),t(U,[2,75]),t(U,[2,76]),t(U,[2,77]),t(U,[2,78]),t(T,[2,57],{76:se}),t(T,[2,58],{76:M}),{5:W,28:105,31:G,34:K,36:q,38:J,40:Y},{27:[1,112],76:M},{5:X,40:Z,56:113,57:Q,59:$},{27:[1,118],76:M},{33:119,89:C,90:w},{33:120,89:C,90:w},{75:j,78:121,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,61]),t(oe,[2,63]),t(U,[2,68]),t(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:W,28:126,31:G,34:K,36:q,38:J,40:Y},t(T,[2,28]),{5:[1,127]},t(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:X,40:Z,56:130,57:Q,59:$},t(T,[2,47]),{5:[1,131]},t(T,[2,48]),t(T,[2,49]),t(ce,[2,66],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),{33:132,89:C,90:w},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(T,[2,27]),{5:W,28:145,31:G,34:K,36:q,38:J,40:Y},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(T,[2,46]),{5:X,40:Z,56:152,57:Q,59:$},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(T,[2,43]),{5:W,28:159,31:G,34:K,36:q,38:J,40:Y},{5:W,28:160,31:G,34:K,36:q,38:J,40:Y},{5:W,28:161,31:G,34:K,36:q,38:J,40:Y},{5:W,28:162,31:G,34:K,36:q,38:J,40:Y},{5:X,40:Z,56:163,57:Q,59:$},{5:X,40:Z,56:164,57:Q,59:$},t(T,[2,23]),t(T,[2,24]),t(T,[2,25]),t(T,[2,26]),t(T,[2,44]),t(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,ee,A;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var te=``;for(O in A=[],s[w])this.terminals_[O]&&O>f&&A.push(`'`+this.terminals_[O]+`'`);te=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+A.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(te,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:A})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),ee=s[r[r.length-2]][r[r.length-1]],r.push(ee);break;case 3:return!0}}return!0},`parse`)};le.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` @@ -81,4 +81,4 @@ Expecting `+A.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on l background-color: ${r??e.edgeLabelBackground}; } -`},`getStyles`),E={};t(E,{draw:()=>D});var D=e(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing requirement diagram (unified)`,t);let{securityLevel:a,state:o,layout:s,look:c}=u(),l=i.db.getData(),d=_(t,a);l.type=i.type,l.layoutAlgorithm=b(s),l.nodeSpacing=o?.nodeSpacing??50,l.rankSpacing=o?.rankSpacing??50,l.markers=c===`neo`?[`requirement_contains_neo`,`requirement_arrow_neo`]:[`requirement_contains`,`requirement_arrow`],l.diagramId=t,await y(l,d),f.insertTitle(d,`requirementDiagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),v(d,8,`requirementDiagram`,o?.useMaxWidth??!0)},`draw`),O={parser:S,get db(){return new C},renderer:E,styles:T};export{O as diagram}; \ No newline at end of file +`},`getStyles`),E={};t(E,{draw:()=>D});var D=e(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing requirement diagram (unified)`,t);let{securityLevel:a,state:o,layout:s,look:c}=u(),l=i.db.getData(),d=y(t,a);l.type=i.type,l.layoutAlgorithm=v(s),l.nodeSpacing=o?.nodeSpacing??50,l.rankSpacing=o?.rankSpacing??50,l.markers=c===`neo`?[`requirement_contains_neo`,`requirement_arrow_neo`]:[`requirement_contains`,`requirement_arrow`],l.diagramId=t,await _(l,d),f.insertTitle(d,`requirementDiagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),b(d,8,`requirementDiagram`,o?.useMaxWidth??!0)},`draw`),O={parser:S,get db(){return new C},renderer:E,styles:T};export{O as diagram}; \ No newline at end of file diff --git a/web/dist/app-sequenceDiagram-PO4LG4MO.js b/web/dist/app-sequenceDiagram-PO4LG4MO.js index e606b65ef..5602e44c0 100644 --- a/web/dist/app-sequenceDiagram-PO4LG4MO.js +++ b/web/dist/app-sequenceDiagram-PO4LG4MO.js @@ -1,4 +1,4 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{A as r,F as i,G as a,H as o,O as s,U as c,a as l,b as u,c as d,i as f,q as p,r as m,s as h,v as g,w as _,x as v,y,z as b}from"./app-chunk-O7XYJQB3.js";import{t as x}from"./app-dist.js";import{g as S,p as C}from"./app-chunk-ZIGJFQKS.js";import{a as w,c as T,i as E,n as D,r as O,s as k}from"./app-chunk-GWA4HPMP.js";import{n as A,t as j}from"./app-chunk-LNGE3PJU.js";import{t as M}from"./app-chunk-2Q5K7J3B.js";var N=x(),P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ee=[1,74],te=[1,80],L=[1,81],ne=[1,82],re=[1,83],ie=[1,84],ae=[1,85],oe=[1,86],se=[1,87],ce=[1,88],le=[1,89],ue=[1,90],R=[1,91],de=[1,92],fe=[1,93],pe=[1,94],me=[1,95],z=[1,96],B=[1,97],he=[1,98],V=[1,99],H=[1,100],U=[1,101],ge=[1,102],_e=[1,103],ve=[1,104],ye=[1,105],W=[2,78],be=[4,5,17,51,53,54],G=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],we=[5,52],K=[70,71,72,73],q=[1,151],Te={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1))}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},t(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(I,[2,30]),t(I,[2,31]),{33:[1,62]},{35:[1,63]},t(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ee},{23:75,55:76,73:ee},{23:77,73:F},{69:78,72:[1,79],78:te,79:L,80:ne,81:re,82:ie,83:ae,84:oe,85:se,86:ce,87:le,88:ue,89:R,90:de,91:fe,92:pe,93:me,94:z,95:B,96:he,97:V,98:H,99:U,100:ge,101:_e,102:ve,103:ye},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],W),t(I,[2,6]),t(I,[2,16]),t(be,[2,10],{11:114}),t(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(I,[2,22]),{5:[1,118]},{5:[1,119]},t(I,[2,25]),t(I,[2,26]),t(I,[2,27]),t(I,[2,28]),t(I,[2,29]),t(I,[2,32]),t(I,[2,33]),t(G,a,{7:120}),t(G,a,{7:121}),t(G,a,{7:122}),t(xe,a,{41:123,7:124}),t(Se,a,{43:125,7:126}),t(Se,a,{7:126,43:127}),t(Ce,a,{46:128,7:129}),t(G,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(we,W,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:te,79:L,80:ne,81:re,82:ie,83:ae,84:oe,85:se,86:ce,87:le,88:ue,89:R,90:de,91:fe,92:pe,93:me,94:z,95:B,96:he,97:V,98:H,99:U,100:ge,101:_e,102:ve,103:ye},t(K,[2,79]),t(K,[2,80]),t(K,[2,81]),t(K,[2,82]),t(K,[2,83]),t(K,[2,84]),t(K,[2,85]),t(K,[2,86]),t(K,[2,87]),t(K,[2,88]),t(K,[2,89]),t(K,[2,90]),t(K,[2,91]),t(K,[2,92]),t(K,[2,93]),t(K,[2,94]),t(K,[2,95]),t(K,[2,96]),t(K,[2,97]),t(K,[2,98]),t(K,[2,99]),t(K,[2,100]),t(K,[2,101]),t(K,[2,102]),t(K,[2,103]),t(K,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:q},{58:152,104:q},{58:153,104:q},{58:154,104:q},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},t(I,[2,20]),t(I,[2,21]),t(I,[2,23]),t(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},t(I,[2,50]),{16:[1,173]},t(I,[2,55]),t(we,[2,76]),{76:[1,174]},{16:[1,175]},t(I,[2,52]),{16:[1,176]},t(I,[2,57]),t(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:q},{23:181,72:[1,182],73:F},{58:183,104:q},{58:184,104:q},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(I,[2,17]),t(be,[2,11]),{13:186,51:D,53:O,54:k},t(be,[2,13]),t(be,[2,14]),t(I,[2,19]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t(I,[2,38]),{16:[1,187]},t(I,[2,39]),{16:[1,188]},t(I,[2,40]),t(I,[2,41]),{16:[1,189]},t(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:q},{58:196,104:q},{58:197,104:q},{5:[2,75]},{58:198,104:q},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},t(be,[2,12]),t(xe,a,{7:124,41:201}),t(Se,a,{7:126,43:202}),t(Ce,a,{7:129,46:203}),t(I,[2,49]),t(I,[2,54]),t(we,[2,77]),t(I,[2,51]),t(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:q},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{A as r,F as i,G as a,H as o,O as s,U as c,a as l,b as u,c as d,i as f,q as p,r as m,s as h,v as g,w as _,x as v,y,z as b}from"./app-chunk-O7XYJQB3.js";import{t as x}from"./app-dist.js";import{g as S,p as C}from"./app-chunk-ZIGJFQKS.js";import{n as w,t as T}from"./app-chunk-LNGE3PJU.js";import{a as E,c as D,i as O,n as k,r as A,s as j}from"./app-chunk-GWA4HPMP.js";import{t as M}from"./app-chunk-2Q5K7J3B.js";var N=x(),P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ee=[1,74],te=[1,80],L=[1,81],ne=[1,82],re=[1,83],ie=[1,84],ae=[1,85],oe=[1,86],se=[1,87],ce=[1,88],le=[1,89],ue=[1,90],R=[1,91],de=[1,92],fe=[1,93],pe=[1,94],me=[1,95],z=[1,96],B=[1,97],he=[1,98],V=[1,99],H=[1,100],U=[1,101],ge=[1,102],_e=[1,103],ve=[1,104],ye=[1,105],W=[2,78],be=[4,5,17,51,53,54],G=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],we=[5,52],K=[70,71,72,73],q=[1,151],Te={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1))}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},t(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(I,[2,30]),t(I,[2,31]),{33:[1,62]},{35:[1,63]},t(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ee},{23:75,55:76,73:ee},{23:77,73:F},{69:78,72:[1,79],78:te,79:L,80:ne,81:re,82:ie,83:ae,84:oe,85:se,86:ce,87:le,88:ue,89:R,90:de,91:fe,92:pe,93:me,94:z,95:B,96:he,97:V,98:H,99:U,100:ge,101:_e,102:ve,103:ye},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],W),t(I,[2,6]),t(I,[2,16]),t(be,[2,10],{11:114}),t(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(I,[2,22]),{5:[1,118]},{5:[1,119]},t(I,[2,25]),t(I,[2,26]),t(I,[2,27]),t(I,[2,28]),t(I,[2,29]),t(I,[2,32]),t(I,[2,33]),t(G,a,{7:120}),t(G,a,{7:121}),t(G,a,{7:122}),t(xe,a,{41:123,7:124}),t(Se,a,{43:125,7:126}),t(Se,a,{7:126,43:127}),t(Ce,a,{46:128,7:129}),t(G,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(we,W,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:te,79:L,80:ne,81:re,82:ie,83:ae,84:oe,85:se,86:ce,87:le,88:ue,89:R,90:de,91:fe,92:pe,93:me,94:z,95:B,96:he,97:V,98:H,99:U,100:ge,101:_e,102:ve,103:ye},t(K,[2,79]),t(K,[2,80]),t(K,[2,81]),t(K,[2,82]),t(K,[2,83]),t(K,[2,84]),t(K,[2,85]),t(K,[2,86]),t(K,[2,87]),t(K,[2,88]),t(K,[2,89]),t(K,[2,90]),t(K,[2,91]),t(K,[2,92]),t(K,[2,93]),t(K,[2,94]),t(K,[2,95]),t(K,[2,96]),t(K,[2,97]),t(K,[2,98]),t(K,[2,99]),t(K,[2,100]),t(K,[2,101]),t(K,[2,102]),t(K,[2,103]),t(K,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:q},{58:152,104:q},{58:153,104:q},{58:154,104:q},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},t(I,[2,20]),t(I,[2,21]),t(I,[2,23]),t(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},t(I,[2,50]),{16:[1,173]},t(I,[2,55]),t(we,[2,76]),{76:[1,174]},{16:[1,175]},t(I,[2,52]),{16:[1,176]},t(I,[2,57]),t(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:q},{23:181,72:[1,182],73:F},{58:183,104:q},{58:184,104:q},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(I,[2,17]),t(be,[2,11]),{13:186,51:D,53:O,54:k},t(be,[2,13]),t(be,[2,14]),t(I,[2,19]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t(I,[2,38]),{16:[1,187]},t(I,[2,39]),{16:[1,188]},t(I,[2,40]),t(I,[2,41]),{16:[1,189]},t(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:q},{58:196,104:q},{58:197,104:q},{5:[2,75]},{58:198,104:q},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},t(be,[2,12]),t(xe,a,{7:124,41:201}),t(Se,a,{7:126,43:202}),t(Ce,a,{7:129,46:203}),t(I,[2,49]),t(I,[2,54]),t(we,[2,77]),t(I,[2,51]),t(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:q},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};Te.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` @@ -7,7 +7,7 @@ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on l `)?i+` `:`{ `+i+` -}`,o=A(e,{schema:j})}r=o?.type??r,o?.alias&&(!n||n.text===t)&&(n={text:o.alias,wrap:n?.wrap,type:r});let s=this.state.records.actors.get(e);if(s){if(this.state.records.currentBox&&s.box&&this.state.records.currentBox!==s.box)throw Error(`A same participant should only be defined in one Box: ${s.name} can't be in '${s.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(a=s.box?s.box:this.state.records.currentBox,s.box=a,s&&t===s.name&&n==null)return}if(n?.text??(n={text:t,type:r}),(r==null||n.text==null)&&(n={text:t,type:r}),this.state.records.actors.set(e,{box:a,name:t,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??`participant`}),this.state.records.prevActor){let t=this.state.records.actors.get(this.state.records.prevActor);t&&(t.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,n=0;if(!e)return 0;for(t=0;t>-`,token:`->>-`,line:`1`,loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:[`'ACTIVE_PARTICIPANT'`]},t}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n?.text??``,wrap:n?.wrap??this.autoWrap(),type:r,activate:i,centralConnection:a??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();let t=/^:?wrap:/.exec(e)!==null||/^:?nowrap:/.exec(e)===null&&void 0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,``)).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled===void 0?v().sequence?.wrap??!1:this.state.records.wrapEnabled}clear(){this.state.reset(),l()}parseMessage(e){let n=e.trim(),{wrap:r,cleanedText:i}=this.extractWrap(n),a={text:i,wrap:r};return t.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){let t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e),n=t?.[1]?t[1].trim():`transparent`,r=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports(`color`,n)||(n=`transparent`,r=e.trim());else{let t=new Option().style;t.color=n,t.color!==n&&(n=`transparent`,r=e.trim())}let{wrap:i,cleanedText:a}=this.extractWrap(r);return{text:a?b(a,v()):void 0,color:n,wrap:i}}addNote(e,t,n){let r={actor:e,placement:t,message:n.text,wrap:n.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,n){let r=this.getActor(e);try{let e=b(n.text,v());e=e.replace(/=/g,`=`),e=e.replace(/&/g,`&`);let t=JSON.parse(e);this.insertLinks(r,t)}catch(e){t.error(`error while parsing actor link text`,e)}}addALink(e,n){let r=this.getActor(e);try{let e={},t=b(n.text,v()),i=t.indexOf(`@`);t=t.replace(/=/g,`=`),t=t.replace(/&/g,`&`);let a=t.slice(0,i-1).trim();e[a]=t.slice(i+1).trim(),this.insertLinks(r,e)}catch(e){t.error(`error while parsing actor link text`,e)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(let n in t)e.links[n]=t[n]}addProperties(e,n){let r=this.getActor(e);try{let e=b(n.text,v()),t=JSON.parse(e);this.insertProperties(r,t)}catch(e){t.error(`error while parsing actor properties text`,e)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(let n in t)e.properties[n]=t[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,n){let r=this.getActor(e),i=document.getElementById(n.text);try{let e=i.innerHTML,t=JSON.parse(e);t.properties&&this.insertProperties(r,t.properties),t.links&&this.insertLinks(r,t.links)}catch(e){t.error(`error while parsing actor details text`,e)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(e=>{this.apply(e)});else switch(e.type){case`sequenceIndex`:this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case`addParticipant`:this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case`createParticipant`:if(this.state.records.actors.has(e.actor))throw Error(`It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior`);this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case`destroyParticipant`:this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case`activeStart`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnection`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnectionReverse`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`activeEnd`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`addNote`:this.addNote(e.actor,e.placement,e.text);break;case`addLinks`:this.addLinks(e.actor,e.text);break;case`addALink`:this.addALink(e.actor,e.text);break;case`addProperties`:this.addProperties(e.actor,e.text);break;case`addDetails`:this.addDetails(e.actor,e.text);break;case`addMessage`:if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw Error(`The created participant `+this.state.records.lastCreated.name+` does not have an associated creating message after its declaration. Please check the sequence diagram.`);this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw Error(`The destroyed participant `+this.state.records.lastDestroyed.name+` does not have an associated destroying message after its declaration. Please check the sequence diagram.`);this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case`boxStart`:this.addBox(e.boxData);break;case`boxEnd`:this.boxEnd();break;case`loopStart`:this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case`loopEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`rectStart`:this.addSignal(void 0,void 0,e.color,e.signalType);break;case`rectEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`optStart`:this.addSignal(void 0,void 0,e.optText,e.signalType);break;case`optEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`altStart`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`else`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`altEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`setAccTitle`:c(e.text);break;case`parStart`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`and`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`parEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`criticalStart`:this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case`option`:this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case`criticalEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`breakStart`:this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case`breakEnd`:this.addSignal(void 0,void 0,void 0,e.signalType)}}getConfig(){return v().sequence}},re=e(e=>{let t=e.dropShadow??`none`,{look:n}=v();return`.actor { +}`,o=w(e,{schema:T})}r=o?.type??r,o?.alias&&(!n||n.text===t)&&(n={text:o.alias,wrap:n?.wrap,type:r});let s=this.state.records.actors.get(e);if(s){if(this.state.records.currentBox&&s.box&&this.state.records.currentBox!==s.box)throw Error(`A same participant should only be defined in one Box: ${s.name} can't be in '${s.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(a=s.box?s.box:this.state.records.currentBox,s.box=a,s&&t===s.name&&n==null)return}if(n?.text??(n={text:t,type:r}),(r==null||n.text==null)&&(n={text:t,type:r}),this.state.records.actors.set(e,{box:a,name:t,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??`participant`}),this.state.records.prevActor){let t=this.state.records.actors.get(this.state.records.prevActor);t&&(t.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,n=0;if(!e)return 0;for(t=0;t>-`,token:`->>-`,line:`1`,loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:[`'ACTIVE_PARTICIPANT'`]},t}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n?.text??``,wrap:n?.wrap??this.autoWrap(),type:r,activate:i,centralConnection:a??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();let t=/^:?wrap:/.exec(e)!==null||/^:?nowrap:/.exec(e)===null&&void 0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,``)).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled===void 0?v().sequence?.wrap??!1:this.state.records.wrapEnabled}clear(){this.state.reset(),l()}parseMessage(e){let n=e.trim(),{wrap:r,cleanedText:i}=this.extractWrap(n),a={text:i,wrap:r};return t.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){let t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e),n=t?.[1]?t[1].trim():`transparent`,r=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports(`color`,n)||(n=`transparent`,r=e.trim());else{let t=new Option().style;t.color=n,t.color!==n&&(n=`transparent`,r=e.trim())}let{wrap:i,cleanedText:a}=this.extractWrap(r);return{text:a?b(a,v()):void 0,color:n,wrap:i}}addNote(e,t,n){let r={actor:e,placement:t,message:n.text,wrap:n.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,n){let r=this.getActor(e);try{let e=b(n.text,v());e=e.replace(/=/g,`=`),e=e.replace(/&/g,`&`);let t=JSON.parse(e);this.insertLinks(r,t)}catch(e){t.error(`error while parsing actor link text`,e)}}addALink(e,n){let r=this.getActor(e);try{let e={},t=b(n.text,v()),i=t.indexOf(`@`);t=t.replace(/=/g,`=`),t=t.replace(/&/g,`&`);let a=t.slice(0,i-1).trim();e[a]=t.slice(i+1).trim(),this.insertLinks(r,e)}catch(e){t.error(`error while parsing actor link text`,e)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(let n in t)e.links[n]=t[n]}addProperties(e,n){let r=this.getActor(e);try{let e=b(n.text,v()),t=JSON.parse(e);this.insertProperties(r,t)}catch(e){t.error(`error while parsing actor properties text`,e)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(let n in t)e.properties[n]=t[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,n){let r=this.getActor(e),i=document.getElementById(n.text);try{let e=i.innerHTML,t=JSON.parse(e);t.properties&&this.insertProperties(r,t.properties),t.links&&this.insertLinks(r,t.links)}catch(e){t.error(`error while parsing actor details text`,e)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(e=>{this.apply(e)});else switch(e.type){case`sequenceIndex`:this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case`addParticipant`:this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case`createParticipant`:if(this.state.records.actors.has(e.actor))throw Error(`It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior`);this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case`destroyParticipant`:this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case`activeStart`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnection`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnectionReverse`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`activeEnd`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`addNote`:this.addNote(e.actor,e.placement,e.text);break;case`addLinks`:this.addLinks(e.actor,e.text);break;case`addALink`:this.addALink(e.actor,e.text);break;case`addProperties`:this.addProperties(e.actor,e.text);break;case`addDetails`:this.addDetails(e.actor,e.text);break;case`addMessage`:if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw Error(`The created participant `+this.state.records.lastCreated.name+` does not have an associated creating message after its declaration. Please check the sequence diagram.`);this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw Error(`The destroyed participant `+this.state.records.lastDestroyed.name+` does not have an associated destroying message after its declaration. Please check the sequence diagram.`);this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case`boxStart`:this.addBox(e.boxData);break;case`boxEnd`:this.boxEnd();break;case`loopStart`:this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case`loopEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`rectStart`:this.addSignal(void 0,void 0,e.color,e.signalType);break;case`rectEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`optStart`:this.addSignal(void 0,void 0,e.optText,e.signalType);break;case`optEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`altStart`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`else`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`altEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`setAccTitle`:c(e.text);break;case`parStart`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`and`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`parEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`criticalStart`:this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case`option`:this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case`criticalEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`breakStart`:this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case`breakEnd`:this.addSignal(void 0,void 0,void 0,e.signalType)}}getConfig(){return v().sequence}},re=e(e=>{let t=e.dropShadow??`none`,{look:n}=v();return`.actor { stroke: ${e.actorBorder}; fill: ${e.actorBkg}; stroke-width: ${e.strokeWidth??1}; @@ -153,17 +153,17 @@ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on l filter: ${t}; stroke: ${e.nodeBorder}; } -`},`getStyles`),ie=44,ae=6,oe=6,se=e((e,t)=>e.actorTextHeight??S.calculateTextDimensions(e.description??``,{fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}).height,`actorLabelHeight`),ce=e(e=>ie+ae+e+oe,`actorStackHeight`),le=e((e,t,n)=>{let r=e+t,i=r-oe-n/2;return{lifelineStartY:r,glyphBottomY:r-oe-n-ae,labelCenterY:i}},`headerBands`),ue=e((e,t)=>{let n=e+oe,r=n+ie;return{glyphTopY:n,glyphBottomY:r,labelCenterY:r+ae+t/2,stackHeight:ce(t)}},`footerBands`),R=36,de=-5,fe=60,pe=fe-de,me=e((e,t,n,r)=>{if(t.look!==`neo`)return null;let i=se(e,t);return n?ue(r,i):le(r,e.height,i)},`neoBands`),z=`actor-top`,B=`actor-bottom`,he=`actor-box`,V=`actor-man`,H=new Set([`redux-color`,`redux-dark-color`]),U=e((e,t)=>e?.length?e[t%e.length]:void 0,`paletteColor`),ge=e(function(e,t){let n=w(e,t);return u().look===`neo`&&n.attr(`data-look`,`neo`),n},`drawRect`),_e=e(function(e,t,n,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let a=t.links,o=t.actorCnt,s=t.rectData;var c=`none`;i&&(c=`block !important`);let l=e.append(`g`);l.attr(`id`,`actor`+o+`_popup`),l.attr(`class`,`actorPopupMenu`),l.attr(`display`,c);var u=``;s.class!==void 0&&(u=` `+s.class);let d=s.width>n?s.width:n,f=l.append(`rect`);if(f.attr(`class`,`actorPopupMenuPanel`+u),f.attr(`x`,s.x),f.attr(`y`,s.height),f.attr(`fill`,s.fill),f.attr(`stroke`,s.stroke),f.attr(`width`,d),f.attr(`height`,s.height),f.attr(`rx`,s.rx),f.attr(`ry`,s.ry),a!=null){var p=20;for(let e in a){var m=l.append(`a`),h=(0,N.sanitizeUrl)(a[e]);m.attr(`xlink:href`,h),m.attr(`target`,`_blank`),We(r)(e,m,s.x+10,s.height+p,d,20,{class:`actor`},r),p+=30}}return f.attr(`height`,p),{height:s.height+p,width:d}},`drawPopup`),ve=e(function(e){return`var pu = document.getElementById('`+e+`'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }`},`popupMenuToggle`),ye=e(async function(e,t,n=null){let r=e.append(`foreignObject`),a=await i(t.text,u()),o=r.append(`xhtml:div`).attr(`style`,`width: fit-content;`).attr(`xmlns`,`http://www.w3.org/1999/xhtml`).html(a).node().getBoundingClientRect();if(r.attr(`height`,Math.round(o.height)).attr(`width`,Math.round(o.width)),t.class===`noteText`){let n=e.node().firstChild;n.setAttribute(`height`,o.height+2*t.textMargin);let i=n.getBBox();r.attr(`x`,Math.round(i.x+i.width/2-o.width/2)).attr(`y`,Math.round(i.y+i.height/2-o.height/2))}else if(n){let{startx:e,stopx:i,starty:a}=n;if(e>i){let t=e;e=i,i=t}r.attr(`x`,Math.round(e+Math.abs(e-i)/2-o.width/2)),t.class===`loopText`?r.attr(`y`,Math.round(a)):r.attr(`y`,Math.round(a-o.height))}return[r]},`drawKatex`),W=e(function(t,n){let r=0,i=0,a=n.text.split(h.lineBreakRegex),[o,s]=C(n.fontSize),c=[],l=0,u=e(()=>n.y,`yfunc`);if(n.valign!==void 0&&n.textMargin!==void 0&&n.textMargin>0)switch(n.valign){case`top`:case`start`:u=e(()=>Math.round(n.y+n.textMargin),`yfunc`);break;case`middle`:case`center`:u=e(()=>Math.round(n.y+(r+i+n.textMargin)/2),`yfunc`);break;case`bottom`:case`end`:u=e(()=>Math.round(n.y+(r+i+2*n.textMargin)-n.textMargin),`yfunc`)}if(n.anchor!==void 0&&n.textMargin!==void 0&&n.width!==void 0)switch(n.anchor){case`left`:case`start`:n.x=Math.round(n.x+n.textMargin),n.anchor=`start`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`;break;case`middle`:case`center`:n.x=Math.round(n.x+n.width/2),n.anchor=`middle`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`;break;case`right`:case`end`:n.x=Math.round(n.x+n.width-n.textMargin),n.anchor=`end`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`}for(let[e,d]of a.entries()){n.textMargin!==void 0&&n.textMargin===0&&o!==void 0&&(l=e*o);let a=t.append(`text`);a.attr(`x`,n.x),a.attr(`y`,u()),n.anchor!==void 0&&a.attr(`text-anchor`,n.anchor).attr(`dominant-baseline`,n.dominantBaseline).attr(`alignment-baseline`,n.alignmentBaseline),n.fontFamily!==void 0&&a.style(`font-family`,n.fontFamily),s!==void 0&&a.style(`font-size`,s),n.fontWeight!==void 0&&a.style(`font-weight`,n.fontWeight),n.fill!==void 0&&a.attr(`fill`,n.fill),n.class!==void 0&&a.attr(`class`,n.class),n.dy===void 0?l!==0&&a.attr(`dy`,l):a.attr(`dy`,n.dy);let f=d||`​`;if(n.tspan){let e=a.append(`tspan`);e.attr(`x`,n.x),n.fill!==void 0&&e.attr(`fill`,n.fill),e.text(f)}else a.text(f);n.valign!==void 0&&n.textMargin!==void 0&&n.textMargin>0&&(i+=(a._groups||a)[0][0].getBBox().height,r=i),c.push(a)}return c},`drawText`),be=e(function(t,n){function r(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}e(r,`genPoints`);let i=t.append(`polygon`);return i.attr(`points`,r(n.x,n.y,n.width,n.height,7)),i.attr(`class`,`labelBox`),n.y+=n.height/2,W(t,n),i},`drawLabel`),G=-1,xe=e((e,t,n,r)=>{e.select&&n.forEach(n=>{let i=t.get(n),a=e.select(`#actor`+i.actorCnt);!r.mirrorActors&&i.stopy?a.attr(`y2`,i.stopy+i.height/2):r.mirrorActors&&a.attr(`y2`,i.stopy)})},`fixLifeLineHeights`),Se=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=s+t.height,{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m}=f,h=e.append(`g`).lower();var g=h;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,l).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=G,t.links!=null&&g.attr(`id`,`root-`+G),u===`neo`&&g.attr(`data-look`,`neo`));let _=k();var v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,v+=i?` ${B}`:` ${z}`,_.x=t.x,_.y=s,_.width=t.width,_.height=t.height,_.class=v,_.rx=3,_.ry=3,_.name=t.name,u===`neo`&&(_.rx=6,_.ry=6);let y=ge(g,_),b=o.get(t.name)??0;if(H.has(d)&&(y.style(`stroke`,U(m,b)),y.style(`fill`,U(p,b))),u===`neo`&&y.attr(`filter`,`url(#${J(a)})`),t.rectData=_,t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?O(g,_.x+_.width-20,_.y+10,e.substr(1)):E(g,_.x+_.width-20,_.y+10,e)}i||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`participant`),g.attr(`data-id`,t.name)),Y(n,r(t.description))(t.description,g,_.x,_.y,_.width,_.height,{class:`actor ${he}`},n);let x=t.height;if(y.node){let e=y.node().getBBox();n.look!==`neo`&&(t.height=e.height,x=e.height)}return x},`drawActorTypeParticipant`),Ce=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=s+t.height,{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m}=f,h=e.append(`g`).lower();var g=h;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,l).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=G,t.links!=null&&g.attr(`id`,`root-`+G),u===`neo`&&g.attr(`data-look`,`neo`));let _=k();var v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,v+=i?` ${B}`:` ${z}`,_.x=t.x,_.y=s,_.width=t.width,_.height=t.height,_.class=v,_.name=t.name,n.look===`neo`&&(_.height=t.height-6);let y={..._,x:_.x+-6,y:_.y+6,class:`actor`},b=ge(g,_),x=ge(g,y);t.rectData=_,u===`neo`&&g.attr(`filter`,`url(#${J(a)})`);let S=o.get(t.name)??0;if(H.has(d)&&(b.style(`stroke`,U(m,S)),b.style(`fill`,U(p,S)),x.style(`stroke`,U(m,S)),x.style(`fill`,U(p,S))),t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?O(g,_.x+_.width-20,_.y+10,e.substr(1)):E(g,_.x+_.width-20,_.y+10,e)}Y(n,r(t.description))(t.description,g,_.x-6,_.y+6,_.width,_.height,{class:`actor ${he}`},n);let C=t.height;if(b.node){let e=b.node().getBBox();n.look!==`neo`&&(t.height=e.height,C=e.height)}return i||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`collections`),g.attr(`data-id`,t.name)),C},`drawActorTypeCollections`),we=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=s+t.height,{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m}=f,h=e.append(`g`).lower(),g=h;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,l).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=G,t.links!=null&&g.attr(`id`,`root-`+G),u===`neo`&&g.attr(`data-look`,`neo`));let _=k(),v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,v+=i?` ${B}`:` ${z}`,g.attr(`class`,v),_.x=t.x,_.y=s,_.width=t.width,_.height=t.height,_.name=t.name;let y=_.height/2,b=y/(2.5+_.height/50),x=g.append(`g`),S=g.append(`g`),C=`M ${_.x},${_.y+y} +`},`getStyles`),ie=44,ae=6,oe=6,se=e((e,t)=>e.actorTextHeight??S.calculateTextDimensions(e.description??``,{fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}).height,`actorLabelHeight`),ce=e(e=>ie+ae+e+oe,`actorStackHeight`),le=e((e,t,n)=>{let r=e+t,i=r-oe-n/2;return{lifelineStartY:r,glyphBottomY:r-oe-n-ae,labelCenterY:i}},`headerBands`),ue=e((e,t)=>{let n=e+oe,r=n+ie;return{glyphTopY:n,glyphBottomY:r,labelCenterY:r+ae+t/2,stackHeight:ce(t)}},`footerBands`),R=36,de=-5,fe=60,pe=fe-de,me=e((e,t,n,r)=>{if(t.look!==`neo`)return null;let i=se(e,t);return n?ue(r,i):le(r,e.height,i)},`neoBands`),z=`actor-top`,B=`actor-bottom`,he=`actor-box`,V=`actor-man`,H=new Set([`redux-color`,`redux-dark-color`]),U=e((e,t)=>e?.length?e[t%e.length]:void 0,`paletteColor`),ge=e(function(e,t){let n=E(e,t);return u().look===`neo`&&n.attr(`data-look`,`neo`),n},`drawRect`),_e=e(function(e,t,n,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let a=t.links,o=t.actorCnt,s=t.rectData;var c=`none`;i&&(c=`block !important`);let l=e.append(`g`);l.attr(`id`,`actor`+o+`_popup`),l.attr(`class`,`actorPopupMenu`),l.attr(`display`,c);var u=``;s.class!==void 0&&(u=` `+s.class);let d=s.width>n?s.width:n,f=l.append(`rect`);if(f.attr(`class`,`actorPopupMenuPanel`+u),f.attr(`x`,s.x),f.attr(`y`,s.height),f.attr(`fill`,s.fill),f.attr(`stroke`,s.stroke),f.attr(`width`,d),f.attr(`height`,s.height),f.attr(`rx`,s.rx),f.attr(`ry`,s.ry),a!=null){var p=20;for(let e in a){var m=l.append(`a`),h=(0,N.sanitizeUrl)(a[e]);m.attr(`xlink:href`,h),m.attr(`target`,`_blank`),We(r)(e,m,s.x+10,s.height+p,d,20,{class:`actor`},r),p+=30}}return f.attr(`height`,p),{height:s.height+p,width:d}},`drawPopup`),ve=e(function(e){return`var pu = document.getElementById('`+e+`'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }`},`popupMenuToggle`),ye=e(async function(e,t,n=null){let r=e.append(`foreignObject`),a=await i(t.text,u()),o=r.append(`xhtml:div`).attr(`style`,`width: fit-content;`).attr(`xmlns`,`http://www.w3.org/1999/xhtml`).html(a).node().getBoundingClientRect();if(r.attr(`height`,Math.round(o.height)).attr(`width`,Math.round(o.width)),t.class===`noteText`){let n=e.node().firstChild;n.setAttribute(`height`,o.height+2*t.textMargin);let i=n.getBBox();r.attr(`x`,Math.round(i.x+i.width/2-o.width/2)).attr(`y`,Math.round(i.y+i.height/2-o.height/2))}else if(n){let{startx:e,stopx:i,starty:a}=n;if(e>i){let t=e;e=i,i=t}r.attr(`x`,Math.round(e+Math.abs(e-i)/2-o.width/2)),t.class===`loopText`?r.attr(`y`,Math.round(a)):r.attr(`y`,Math.round(a-o.height))}return[r]},`drawKatex`),W=e(function(t,n){let r=0,i=0,a=n.text.split(h.lineBreakRegex),[o,s]=C(n.fontSize),c=[],l=0,u=e(()=>n.y,`yfunc`);if(n.valign!==void 0&&n.textMargin!==void 0&&n.textMargin>0)switch(n.valign){case`top`:case`start`:u=e(()=>Math.round(n.y+n.textMargin),`yfunc`);break;case`middle`:case`center`:u=e(()=>Math.round(n.y+(r+i+n.textMargin)/2),`yfunc`);break;case`bottom`:case`end`:u=e(()=>Math.round(n.y+(r+i+2*n.textMargin)-n.textMargin),`yfunc`)}if(n.anchor!==void 0&&n.textMargin!==void 0&&n.width!==void 0)switch(n.anchor){case`left`:case`start`:n.x=Math.round(n.x+n.textMargin),n.anchor=`start`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`;break;case`middle`:case`center`:n.x=Math.round(n.x+n.width/2),n.anchor=`middle`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`;break;case`right`:case`end`:n.x=Math.round(n.x+n.width-n.textMargin),n.anchor=`end`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`}for(let[e,d]of a.entries()){n.textMargin!==void 0&&n.textMargin===0&&o!==void 0&&(l=e*o);let a=t.append(`text`);a.attr(`x`,n.x),a.attr(`y`,u()),n.anchor!==void 0&&a.attr(`text-anchor`,n.anchor).attr(`dominant-baseline`,n.dominantBaseline).attr(`alignment-baseline`,n.alignmentBaseline),n.fontFamily!==void 0&&a.style(`font-family`,n.fontFamily),s!==void 0&&a.style(`font-size`,s),n.fontWeight!==void 0&&a.style(`font-weight`,n.fontWeight),n.fill!==void 0&&a.attr(`fill`,n.fill),n.class!==void 0&&a.attr(`class`,n.class),n.dy===void 0?l!==0&&a.attr(`dy`,l):a.attr(`dy`,n.dy);let f=d||`​`;if(n.tspan){let e=a.append(`tspan`);e.attr(`x`,n.x),n.fill!==void 0&&e.attr(`fill`,n.fill),e.text(f)}else a.text(f);n.valign!==void 0&&n.textMargin!==void 0&&n.textMargin>0&&(i+=(a._groups||a)[0][0].getBBox().height,r=i),c.push(a)}return c},`drawText`),be=e(function(t,n){function r(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}e(r,`genPoints`);let i=t.append(`polygon`);return i.attr(`points`,r(n.x,n.y,n.width,n.height,7)),i.attr(`class`,`labelBox`),n.y+=n.height/2,W(t,n),i},`drawLabel`),G=-1,xe=e((e,t,n,r)=>{e.select&&n.forEach(n=>{let i=t.get(n),a=e.select(`#actor`+i.actorCnt);!r.mirrorActors&&i.stopy?a.attr(`y2`,i.stopy+i.height/2):r.mirrorActors&&a.attr(`y2`,i.stopy)})},`fixLifeLineHeights`),Se=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=s+t.height,{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m}=f,h=e.append(`g`).lower();var g=h;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,l).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=G,t.links!=null&&g.attr(`id`,`root-`+G),u===`neo`&&g.attr(`data-look`,`neo`));let _=j();var v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,v+=i?` ${B}`:` ${z}`,_.x=t.x,_.y=s,_.width=t.width,_.height=t.height,_.class=v,_.rx=3,_.ry=3,_.name=t.name,u===`neo`&&(_.rx=6,_.ry=6);let y=ge(g,_),b=o.get(t.name)??0;if(H.has(d)&&(y.style(`stroke`,U(m,b)),y.style(`fill`,U(p,b))),u===`neo`&&y.attr(`filter`,`url(#${J(a)})`),t.rectData=_,t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?A(g,_.x+_.width-20,_.y+10,e.substr(1)):O(g,_.x+_.width-20,_.y+10,e)}i||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`participant`),g.attr(`data-id`,t.name)),Y(n,r(t.description))(t.description,g,_.x,_.y,_.width,_.height,{class:`actor ${he}`},n);let x=t.height;if(y.node){let e=y.node().getBBox();n.look!==`neo`&&(t.height=e.height,x=e.height)}return x},`drawActorTypeParticipant`),Ce=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=s+t.height,{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m}=f,h=e.append(`g`).lower();var g=h;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,l).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=G,t.links!=null&&g.attr(`id`,`root-`+G),u===`neo`&&g.attr(`data-look`,`neo`));let _=j();var v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,v+=i?` ${B}`:` ${z}`,_.x=t.x,_.y=s,_.width=t.width,_.height=t.height,_.class=v,_.name=t.name,n.look===`neo`&&(_.height=t.height-6);let y={..._,x:_.x+-6,y:_.y+6,class:`actor`},b=ge(g,_),x=ge(g,y);t.rectData=_,u===`neo`&&g.attr(`filter`,`url(#${J(a)})`);let S=o.get(t.name)??0;if(H.has(d)&&(b.style(`stroke`,U(m,S)),b.style(`fill`,U(p,S)),x.style(`stroke`,U(m,S)),x.style(`fill`,U(p,S))),t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?A(g,_.x+_.width-20,_.y+10,e.substr(1)):O(g,_.x+_.width-20,_.y+10,e)}Y(n,r(t.description))(t.description,g,_.x-6,_.y+6,_.width,_.height,{class:`actor ${he}`},n);let C=t.height;if(b.node){let e=b.node().getBBox();n.look!==`neo`&&(t.height=e.height,C=e.height)}return i||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`collections`),g.attr(`data-id`,t.name)),C},`drawActorTypeCollections`),we=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=s+t.height,{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m}=f,h=e.append(`g`).lower(),g=h;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,l).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=G,t.links!=null&&g.attr(`id`,`root-`+G),u===`neo`&&g.attr(`data-look`,`neo`));let _=j(),v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,v+=i?` ${B}`:` ${z}`,g.attr(`class`,v),_.x=t.x,_.y=s,_.width=t.width,_.height=t.height,_.name=t.name;let y=_.height/2,b=y/(2.5+_.height/50),x=g.append(`g`),S=g.append(`g`),C=`M ${_.x},${_.y+y} a ${b},${y} 0 0 0 0,${_.height} h ${_.width-2*b} a ${b},${y} 0 0 0 0,-${_.height} Z `;x.append(`path`).attr(`d`,C),S.append(`path`).attr(`d`,`M ${_.x},${_.y+y} - a ${b},${y} 0 0 0 0,${_.height}`),x.attr(`transform`,`translate(${b}, ${-(_.height/2)})`),S.attr(`transform`,`translate(${_.width-b}, ${-_.height/2})`),t.rectData=_,u===`neo`&&x.attr(`filter`,`url(#${J(a)})`);let w=o.get(t.name)??0;if(H.has(d)&&(x.style(`stroke`,U(m,w)),x.style(`fill`,U(p,w)),S.style(`stroke`,U(m,w)),S.style(`fill`,U(p,w))),t.properties?.icon){let e=t.properties.icon.trim(),n=_.x+_.width-20,r=_.y+10;e.charAt(0)===`@`?O(g,n,r,e.substr(1)):E(g,n,r,e)}Y(n,r(t.description))(t.description,g,_.x,_.y,_.width,_.height,{class:`actor ${he}`},n);let T=t.height,D=x.select(`path:last-child`);if(D.node()){let e=D.node().getBBox();n.look!==`neo`&&(t.height=e.height,T=e.height)}return i||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`queue`),g.attr(`data-id`,t.name)),T},`drawActorTypeQueue`),K=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+75,{look:d,theme:f,themeVariables:p}=n,{bkgColorArray:m,borderColorArray:h,actorBorder:g,actorBkg:_}=p,v=e.append(`g`).lower();i||(G++,v.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=G);let y=e.append(`g`),b=V;b+=i?` ${B}`:` ${z}`,y.attr(`class`,b),y.attr(`name`,t.name);let x=k();x.x=t.x,x.y=s,x.fill=`#eaeaea`,x.width=t.width,x.height=t.height,x.class=`actor`;let S=t.x+t.width/2,C=l?l.glyphBottomY-22:s+32;y.append(`defs`).append(`marker`).attr(`id`,a+`-filled-head-control`).attr(`refX`,11).attr(`refY`,5.8).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`172.5`).attr(`stroke-width`,1.2).append(`path`).attr(`d`,`M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z`),y.append(`circle`).attr(`cx`,S).attr(`cy`,C).attr(`r`,22).attr(`filter`,`${d===`neo`?`url(#${J(a)})`:``}`),y.append(`line`).attr(`marker-end`,`url(#`+a+`-filled-head-control)`).attr(`transform`,`translate(${S}, ${C-22})`);let w=o.get(t.name)??0;return H.has(f)?(y.style(`stroke`,U(h,w)),y.style(`fill`,U(m,w))):(y.style(`stroke`,g),y.style(`fill`,_)),l||(t.height=y.node().getBBox().height+2*(n?.sequence?.labelBoxHeight??0)),Y(n,r(t.description))(t.description,y,x.x,l?l.labelCenterY-x.height/2:x.y+22+(i?5:12),x.width,x.height,{class:`actor ${V}`},n),i||(y.attr(`data-et`,`participant`),y.attr(`data-type`,`control`),y.attr(`data-id`,t.name)),t.height},`drawActorTypeControl`),q=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+75,{look:d,theme:f,themeVariables:p}=n,{bkgColorArray:m,borderColorArray:h}=p,g=e.append(`g`).lower(),_=e.append(`g`),v=`actor`;v+=i?` ${B}`:` ${z}`,_.attr(`class`,v),_.attr(`name`,t.name);let y=k();y.x=t.x,y.y=s,y.fill=`#eaeaea`,y.width=t.width,y.height=t.height,y.class=`actor`;let b=t.x+t.width/2,x=l?l.glyphBottomY-22:s+(i?10:25);_.append(`circle`).attr(`cx`,b).attr(`cy`,x).attr(`r`,22).attr(`width`,t.width).attr(`height`,t.height),_.append(`line`).attr(`x1`,b-22).attr(`x2`,b+22).attr(`y1`,x+22).attr(`y2`,x+22).attr(`stroke-width`,2),d===`neo`&&_.attr(`filter`,`url(#${J(a)})`);let S=o.get(t.name)??0;return H.has(f)&&(_.style(`stroke`,U(h,S)),_.style(`fill`,U(m,S))),l||(t.height=_.node().getBBox().height+(n?.sequence?.labelBoxHeight??0)),i||(G++,g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=G),Y(n,r(t.description))(t.description,_,y.x,l?l.labelCenterY-y.height/2:y.y+(i?15:30),y.width,y.height,{class:`actor ${V}`},n),l||_.attr(`transform`,`translate(0, ${i?22:22/2-5})`),i||(_.attr(`data-et`,`participant`),_.attr(`data-type`,`entity`),_.attr(`data-id`,t.name)),t.height},`drawActorTypeEntity`),Te=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+t.height+2*n.boxTextMargin,{theme:d,themeVariables:f,look:p}=n,{bkgColorArray:m,borderColorArray:h,actorBorder:g}=f,_=e.append(`g`).lower(),v=_;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&v.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),v.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),v=_.append(`g`),t.actorCnt=G,t.links!=null&&v.attr(`id`,`root-`+G),p===`neo`&&v.attr(`data-look`,`neo`));let y=k(),b=`actor`;t.properties?.class?b=t.properties.class:y.fill=`#eaeaea`,b+=i?` ${B}`:` ${z}`,y.x=t.x,y.y=s,y.width=t.width,y.height=t.height,y.class=b,y.name=t.name,y.x=t.x,y.y=s;let x=y.width/3,S=x/2,C=S/(2.5+x/50),w=l?ie:y.width/3,T=l?l.glyphBottomY-w-C:y.y,E=v.append(`g`);E.attr(`class`,b);let D=` + a ${b},${y} 0 0 0 0,${_.height}`),x.attr(`transform`,`translate(${b}, ${-(_.height/2)})`),S.attr(`transform`,`translate(${_.width-b}, ${-_.height/2})`),t.rectData=_,u===`neo`&&x.attr(`filter`,`url(#${J(a)})`);let w=o.get(t.name)??0;if(H.has(d)&&(x.style(`stroke`,U(m,w)),x.style(`fill`,U(p,w)),S.style(`stroke`,U(m,w)),S.style(`fill`,U(p,w))),t.properties?.icon){let e=t.properties.icon.trim(),n=_.x+_.width-20,r=_.y+10;e.charAt(0)===`@`?A(g,n,r,e.substr(1)):O(g,n,r,e)}Y(n,r(t.description))(t.description,g,_.x,_.y,_.width,_.height,{class:`actor ${he}`},n);let T=t.height,E=x.select(`path:last-child`);if(E.node()){let e=E.node().getBBox();n.look!==`neo`&&(t.height=e.height,T=e.height)}return i||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`queue`),g.attr(`data-id`,t.name)),T},`drawActorTypeQueue`),K=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+75,{look:d,theme:f,themeVariables:p}=n,{bkgColorArray:m,borderColorArray:h,actorBorder:g,actorBkg:_}=p,v=e.append(`g`).lower();i||(G++,v.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=G);let y=e.append(`g`),b=V;b+=i?` ${B}`:` ${z}`,y.attr(`class`,b),y.attr(`name`,t.name);let x=j();x.x=t.x,x.y=s,x.fill=`#eaeaea`,x.width=t.width,x.height=t.height,x.class=`actor`;let S=t.x+t.width/2,C=l?l.glyphBottomY-22:s+32;y.append(`defs`).append(`marker`).attr(`id`,a+`-filled-head-control`).attr(`refX`,11).attr(`refY`,5.8).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`172.5`).attr(`stroke-width`,1.2).append(`path`).attr(`d`,`M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z`),y.append(`circle`).attr(`cx`,S).attr(`cy`,C).attr(`r`,22).attr(`filter`,`${d===`neo`?`url(#${J(a)})`:``}`),y.append(`line`).attr(`marker-end`,`url(#`+a+`-filled-head-control)`).attr(`transform`,`translate(${S}, ${C-22})`);let w=o.get(t.name)??0;return H.has(f)?(y.style(`stroke`,U(h,w)),y.style(`fill`,U(m,w))):(y.style(`stroke`,g),y.style(`fill`,_)),l||(t.height=y.node().getBBox().height+2*(n?.sequence?.labelBoxHeight??0)),Y(n,r(t.description))(t.description,y,x.x,l?l.labelCenterY-x.height/2:x.y+22+(i?5:12),x.width,x.height,{class:`actor ${V}`},n),i||(y.attr(`data-et`,`participant`),y.attr(`data-type`,`control`),y.attr(`data-id`,t.name)),t.height},`drawActorTypeControl`),q=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+75,{look:d,theme:f,themeVariables:p}=n,{bkgColorArray:m,borderColorArray:h}=p,g=e.append(`g`).lower(),_=e.append(`g`),v=`actor`;v+=i?` ${B}`:` ${z}`,_.attr(`class`,v),_.attr(`name`,t.name);let y=j();y.x=t.x,y.y=s,y.fill=`#eaeaea`,y.width=t.width,y.height=t.height,y.class=`actor`;let b=t.x+t.width/2,x=l?l.glyphBottomY-22:s+(i?10:25);_.append(`circle`).attr(`cx`,b).attr(`cy`,x).attr(`r`,22).attr(`width`,t.width).attr(`height`,t.height),_.append(`line`).attr(`x1`,b-22).attr(`x2`,b+22).attr(`y1`,x+22).attr(`y2`,x+22).attr(`stroke-width`,2),d===`neo`&&_.attr(`filter`,`url(#${J(a)})`);let S=o.get(t.name)??0;return H.has(f)&&(_.style(`stroke`,U(h,S)),_.style(`fill`,U(m,S))),l||(t.height=_.node().getBBox().height+(n?.sequence?.labelBoxHeight??0)),i||(G++,g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=G),Y(n,r(t.description))(t.description,_,y.x,l?l.labelCenterY-y.height/2:y.y+(i?15:30),y.width,y.height,{class:`actor ${V}`},n),l||_.attr(`transform`,`translate(0, ${i?22:22/2-5})`),i||(_.attr(`data-et`,`participant`),_.attr(`data-type`,`entity`),_.attr(`data-id`,t.name)),t.height},`drawActorTypeEntity`),Te=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+t.height+2*n.boxTextMargin,{theme:d,themeVariables:f,look:p}=n,{bkgColorArray:m,borderColorArray:h,actorBorder:g}=f,_=e.append(`g`).lower(),v=_;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&v.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),v.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),v=_.append(`g`),t.actorCnt=G,t.links!=null&&v.attr(`id`,`root-`+G),p===`neo`&&v.attr(`data-look`,`neo`));let y=j(),b=`actor`;t.properties?.class?b=t.properties.class:y.fill=`#eaeaea`,b+=i?` ${B}`:` ${z}`,y.x=t.x,y.y=s,y.width=t.width,y.height=t.height,y.class=b,y.name=t.name,y.x=t.x,y.y=s;let x=y.width/3,S=x/2,C=S/(2.5+x/50),w=l?ie:y.width/3,T=l?l.glyphBottomY-w-C:y.y,E=v.append(`g`);E.attr(`class`,b);let D=` M ${y.x},${T+C} a ${S},${C} 0 0 0 ${x},0 a ${S},${C} 0 0 0 -${x},0 l 0,${w-2*C} a ${S},${C} 0 0 0 ${x},0 l 0,-${w-2*C} -`;E.append(`path`).attr(`d`,D),p===`neo`&&E.attr(`filter`,`url(#${J(a)})`);let O=o.get(t.name)??0;if(H.has(d)?(E.style(`stroke`,U(h,O)),E.style(`fill`,U(m,O))):E.style(`stroke`,g),E.attr(`transform`,`translate(${x}, ${C})`),t.rectData=y,Y(n,r(t.description))(t.description,v,y.x,l?l.labelCenterY-y.height/2:y.y+35,y.width,y.height,{class:`actor ${he}`},n),!l){let e=E.select(`path:last-child`);e.node()&&(t.height=e.node().getBBox().height+(n.sequence.labelBoxHeight??0))}return i||(v.attr(`data-et`,`participant`),v.attr(`data-type`,`database`),v.attr(`data-id`,t.name)),t.height},`drawActorTypeDatabase`),Ee=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+80,d=l?l.glyphBottomY-22:s+12,f=e.append(`g`).lower(),{look:p,theme:m,themeVariables:h}=n,{bkgColorArray:g,borderColorArray:_,actorBorder:v}=h;i||(G++,f.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=G);let y=e.append(`g`),b=V;b+=i?` ${B}`:` ${z}`,y.attr(`class`,b),y.attr(`name`,t.name);let x=k();x.x=t.x,x.y=s,x.fill=`#eaeaea`,x.width=t.width,x.height=t.height,x.class=`actor`,y.append(`line`).attr(`id`,`actor-man-torso`+G).attr(`x1`,t.x+t.width/2-55).attr(`y1`,d).attr(`x2`,t.x+t.width/2-15).attr(`y2`,d),y.append(`line`).attr(`id`,`actor-man-arms`+G).attr(`x1`,t.x+t.width/2-55).attr(`y1`,d-10).attr(`x2`,t.x+t.width/2-55).attr(`y2`,d+10),y.append(`circle`).attr(`cx`,t.x+t.width/2).attr(`cy`,d).attr(`r`,22),p===`neo`&&y.attr(`filter`,`url(#${J(a)})`);let S=o.get(t.name)??0;return H.has(m)?(y.style(`stroke`,U(_,S)),y.style(`fill`,U(g,S))):y.style(`stroke`,v),l||(t.height=y.node().getBBox().height+(n.sequence.labelBoxHeight??0)),Y(n,r(t.description))(t.description,y,x.x,l?l.labelCenterY-x.height/2:x.y+15,x.width,x.height,{class:`actor ${V}`},n),l||y.attr(`transform`,`translate(0,21)`),i||(y.attr(`data-et`,`participant`),y.attr(`data-type`,`boundary`),y.attr(`data-id`,t.name)),t.height},`drawActorTypeBoundary`),De=e(function(t,n,i,a,o){let s=a?n.stopy:n.starty,c=n.x+n.width/2,l=me(n,i,a,s),u=l?l.lifelineStartY:s+80,{theme:d,themeVariables:f}=i,{bkgColorArray:p,borderColorArray:m,actorBorder:h}=f,g=t.append(`g`).lower();a||(G++,g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,n.name).attr(`data-et`,`life-line`).attr(`data-id`,n.name),n.actorCnt=G);let _=t.append(`g`),v=V;v+=a?` ${B}`:` ${z}`,_.attr(`class`,v),_.attr(`name`,n.name),a||_.attr(`data-et`,`participant`).attr(`data-type`,`actor`).attr(`data-id`,n.name);let y=l?ie/pe:1,b=e(e=>l?l.glyphBottomY-(fe-e)*y:s+e,`gy`),x=e(e=>c+e*y,`gx`);_.append(`line`).attr(`id`,`actor-man-torso`+G).attr(`x1`,c).attr(`y1`,b(25)).attr(`x2`,c).attr(`y2`,b(45)),_.append(`line`).attr(`id`,`actor-man-arms`+G).attr(`x1`,x(-R/2)).attr(`y1`,b(33)).attr(`x2`,x(R/2)).attr(`y2`,b(33)),_.append(`line`).attr(`x1`,x(-R/2)).attr(`y1`,b(60)).attr(`x2`,c).attr(`y2`,b(45)),_.append(`line`).attr(`x1`,c).attr(`y1`,b(45)).attr(`x2`,x(R/2-2)).attr(`y2`,b(60));let S=_.append(`circle`);S.attr(`cx`,n.x+n.width/2),S.attr(`cy`,b(10)),S.attr(`r`,15*y),S.attr(`width`,n.width),S.attr(`height`,n.height),l||(n.height=pe);let C=k();C.x=n.x,C.y=s,C.fill=`#eaeaea`,C.width=n.width,C.height=n.height,C.class=`actor`,C.rx=3,C.ry=3;let w=o.get(n.name)??0;return H.has(d)?(_.style(`stroke`,U(m,w)),_.style(`fill`,U(p,w))):_.style(`stroke`,h),Y(i,r(n.description))(n.description,_,C.x,l?l.labelCenterY-C.height/2:s+35,C.width,C.height,{class:`actor ${V}`},i),n.height},`drawActorTypeActor`),Oe=e(async function(e,t,n,r,i,a,o){let s=o??new Map([...a.db.getActors().values()].map((e,t)=>[e.name,t]));switch(t.type){case`actor`:return await De(e,t,n,r,s);case`participant`:return await Se(e,t,n,r,i,s);case`boundary`:return await Ee(e,t,n,r,i,s);case`control`:return await K(e,t,n,r,i,s);case`entity`:return await q(e,t,n,r,i,s);case`database`:return await Te(e,t,n,r,i,s);case`collections`:return await Ce(e,t,n,r,i,s);case`queue`:return await we(e,t,n,r,i,s)}},`drawActor`),ke=e(function(e,t,n){let r=e.append(`g`);Ne(r,t),t.name&&Y(n)(t.name,r,t.x,t.y+n.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:`text`},n),r.lower()},`drawBox`),Ae=e(function(e){return e.append(`g`)},`anchorElement`),je=e(function(e,t,n,r,i,a,o){let{theme:s,themeVariables:c}=r,{bkgColorArray:l,borderColorArray:u,mainBkg:d}=c,f=k(),p=t.anchored,m=t.actor;f.x=t.startx,f.y=t.starty,f.class=`activation`+i%3,f.width=t.stopx-t.startx,f.height=n-t.starty;let h=ge(p,f),g=(o??new Map([...a.db.getActors().values()].map((e,t)=>[e.name,t]))).get(m)??0;H.has(s)&&(h.style(`stroke`,U(u,g)),h.style(`fill`,U(l,g)??d))},`drawActivation`),Me=e(async function(t,n,i,a,o){let{boxMargin:s,boxTextMargin:c,labelBoxHeight:l,labelBoxWidth:u,messageFontFamily:d,messageFontSize:f,messageFontWeight:p}=a,m=t.append(`g`).attr(`data-et`,`control-structure`).attr(`data-id`,`i`+o.id),h=e(function(e,t,n,r){return m.append(`line`).attr(`x1`,e).attr(`y1`,t).attr(`x2`,n).attr(`y2`,r).attr(`class`,`loopLine`)},`drawLoopLine`);h(n.startx,n.starty,n.stopx,n.starty),h(n.stopx,n.starty,n.stopx,n.stopy),h(n.startx,n.stopy,n.stopx,n.stopy),h(n.startx,n.starty,n.startx,n.stopy),n.sections!==void 0&&n.sections.forEach(function(e){h(n.startx,e.y,n.stopx,e.y).style(`stroke-dasharray`,`3, 3`)});let g=T();g.text=i,g.x=n.startx,g.y=n.starty,g.fontFamily=d,g.fontSize=f,g.fontWeight=p,g.anchor=`middle`,g.valign=`middle`,g.tspan=!1,g.width=Math.max(u??0,50),g.height=l+(a.look===`neo`?15:0)||20,g.textMargin=c,g.class=`labelText`,be(m,g),g=He(),g.text=n.title,g.x=n.startx+u/2+(n.stopx-n.startx)/2,g.y=n.starty+s+c,g.anchor=`middle`,g.valign=`middle`,g.textMargin=c,g.class=`loopText`,g.fontFamily=d,g.fontSize=f,g.fontWeight=p,g.wrap=!0;let _=r(g.text)?await ye(m,g,n):W(m,g);if(n.sectionTitles!==void 0){for(let[e,t]of Object.entries(n.sectionTitles))if(t.message){g.text=t.message,g.x=n.startx+(n.stopx-n.startx)/2,g.y=n.sections[e].y+s+c,g.class=`sectionTitle`,g.anchor=`middle`,g.valign=`middle`,g.tspan=!1,g.fontFamily=d,g.fontSize=f,g.fontWeight=p,g.wrap=n.wrap,r(g.text)?(n.starty=n.sections[e].y,await ye(m,g,n)):W(m,g);let i=Math.round(_.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));n.sections[e].height+=i-(s+c)}}return n.height=Math.round(n.stopy-n.starty),m},`drawLoop`),Ne=e(function(e,t){D(e,t)},`drawBackgroundRect`),Pe=e(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-database`).attr(`fill-rule`,`evenodd`).attr(`clip-rule`,`evenodd`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z`)},`insertDatabaseIcon`),Fe=e(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-computer`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z`)},`insertComputerIcon`),Ie=e(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-clock`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z`)},`insertClockIcon`),Le=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,7.9).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M -1 0 L 10 5 L 0 10 z`)},`insertArrowHead`),Re=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-filled-head`).attr(`refX`,15.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`insertArrowFilledHead`),ze=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-sequencenumber`).attr(`refX`,15).attr(`refY`,15).attr(`markerWidth`,60).attr(`markerHeight`,40).attr(`orient`,`auto`).append(`circle`).attr(`cx`,15).attr(`cy`,15).attr(`r`,6)},`insertSequenceNumber`),Be=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-crosshead`).attr(`markerWidth`,15).attr(`markerHeight`,8).attr(`orient`,`auto`).attr(`refX`,4).attr(`refY`,4.5).append(`path`).attr(`fill`,`none`).attr(`stroke`,`#000000`).style(`stroke-dasharray`,`0, 0`).attr(`stroke-width`,`1pt`).attr(`d`,`M 1,2 L 6,7 M 6,2 L 1,7`)},`insertArrowCrossHead`),J=e(e=>e?`${e}-drop-shadow`:`drop-shadow`,`dropShadowId`),Ve=e(function(e,t,n){let{theme:r}=t;e.append(`defs`).append(`filter`).attr(`id`,J(n)).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${r===`redux`||r===`redux-color`?`#000000`:`#FFFFFF`}`)},`insertDropShadow`),He=e(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:`#666`,width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},`getTextObj`),Ue=e(function(){return{x:0,y:0,fill:`#EDF2AE`,stroke:`#666`,width:100,anchor:`start`,height:100,rx:0,ry:0}},`getNoteRect`),Y=(function(){function t(e,t,n,r,i,a,s){o(t.append(`text`).attr(`x`,n+i/2).attr(`y`,r+a/2+5).style(`text-anchor`,`middle`).text(e),s)}e(t,`byText`);function n(e,t,n,r,i,a,s,c){let{actorFontSize:l,actorFontFamily:u,actorFontWeight:d}=c,[f,p]=C(l),m=e.split(h.lineBreakRegex);for(let e=0;ee.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},`getHeight`),clear:e(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},`clear`),addBox:e(function(e){this.boxes.push(e)},`addBox`),addActor:e(function(e){this.actors.push(e)},`addActor`),addLoop:e(function(e){this.loops.push(e)},`addLoop`),addMessage:e(function(e){this.messages.push(e)},`addMessage`),addNote:e(function(e){this.notes.push(e)},`addNote`),lastActor:e(function(){return this.actors[this.actors.length-1]},`lastActor`),lastLoop:e(function(){return this.loops[this.loops.length-1]},`lastLoop`),lastMessage:e(function(){return this.messages[this.messages.length-1]},`lastMessage`),lastNote:e(function(){return this.notes[this.notes.length-1]},`lastNote`),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:e(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,tt(v())},`init`),updateVal:e(function(e,t,n,r){e[t]=e[t]===void 0?n:r(n,e[t])},`updateVal`),updateBounds:e(function(t,n,r,i){let a=this,o=0;function s(s){return e(function(e){o++;let c=a.sequenceItems.length-o+1;a.updateVal(e,`starty`,n-c*Z.boxMargin,Math.min),a.updateVal(e,`stopy`,i+c*Z.boxMargin,Math.max),a.updateVal(Q.data,`startx`,t-c*Z.boxMargin,Math.min),a.updateVal(Q.data,`stopx`,r+c*Z.boxMargin,Math.max),s!==`activation`&&(a.updateVal(e,`startx`,t-c*Z.boxMargin,Math.min),a.updateVal(e,`stopx`,r+c*Z.boxMargin,Math.max),a.updateVal(Q.data,`starty`,n-c*Z.boxMargin,Math.min),a.updateVal(Q.data,`stopy`,i+c*Z.boxMargin,Math.max))},`updateItemBounds`)}e(s,`updateFn`),this.sequenceItems.forEach(s()),this.activations.forEach(s(`activation`))},`updateBounds`),insert:e(function(e,t,n,r){let i=h.getMin(e,n),a=h.getMax(e,n),o=h.getMin(t,r),s=h.getMax(t,r);this.updateVal(Q.data,`startx`,i,Math.min),this.updateVal(Q.data,`starty`,o,Math.min),this.updateVal(Q.data,`stopx`,a,Math.max),this.updateVal(Q.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),newActivation:e(function(e,t,n){let r=n.get(e.from),i=nt(e.from).length||0,a=r.x+r.width/2+(i-1)*Z.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Z.activationWidth,stopy:void 0,actor:e.from,anchored:X.anchorElement(t)})},`newActivation`),endActivation:e(function(e){let t=this.activations.map(function(e){return e.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},`endActivation`),createLoop:e(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},`createLoop`),newLoop:e(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},`newLoop`),endLoop:e(function(){return this.sequenceItems.pop()},`endLoop`),isLoopOverlap:e(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},`isLoopOverlap`),addSectionToLoop:e(function(e){let t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:Q.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},`addSectionToLoop`),saveVerticalPos:e(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},`saveVerticalPos`),resetVerticalPos:e(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},`resetVerticalPos`),bumpVerticalPos:e(function(e){this.verticalPos+=e,this.data.stopy=h.getMax(this.data.stopy,this.verticalPos)},`bumpVerticalPos`),getVerticalPos:e(function(){return this.verticalPos},`getVerticalPos`),getBounds:e(function(){return{bounds:this.data,models:this.models}},`getBounds`)},Ge=e(async function(e,t,n){Q.bumpVerticalPos(Z.boxMargin),t.height=Z.boxMargin,t.starty=Q.getVerticalPos();let i=k();i.x=t.startx,i.y=t.starty,i.width=t.width||Z.width,i.class=`note`;let a=e.append(`g`);a.attr(`data-et`,`note`),a.attr(`data-id`,`i`+n);let o=X.drawRect(a,i),s=T();s.x=t.startx,s.y=t.starty,s.width=i.width,s.dy=`1em`,s.text=t.message,s.class=`noteText`,s.fontFamily=Z.noteFontFamily,s.fontSize=Z.noteFontSize,s.fontWeight=Z.noteFontWeight,s.anchor=Z.noteAlign,s.textMargin=Z.noteMargin,s.valign=`center`;let c=r(s.text)?await ye(a,s):W(a,s),l=Math.round(c.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));o.attr(`height`,l+2*Z.noteMargin),t.height+=l+2*Z.noteMargin,Q.bumpVerticalPos(l+2*Z.noteMargin),t.stopy=t.starty+l+2*Z.noteMargin,t.stopx=t.startx+i.width,Q.insert(t.startx,t.starty,t.stopx,t.stopy),Q.models.addNote(t)},`drawNote`),Ke=e(function(t,n,r,i,a,o,s){let c=i.db.getActors(),l=c.get(n.from),u=c.get(n.to),d=r.sequenceVisible,f=l.x+l.width/2,p=u.x+u.width/2,m=f<=p,h=mt(n,i),g=t.append(`g`),_=e((e,t)=>{let n=e?16.5:-16.5;return t?-n:n},`getCircleOffset`),v=e(e=>{g.append(`circle`).attr(`cx`,e).attr(`cy`,s).attr(`r`,5).attr(`width`,10).attr(`height`,10)},`drawCircle`),{CENTRAL_CONNECTION:y,CENTRAL_CONNECTION_REVERSE:b,CENTRAL_CONNECTION_DUAL:x}=i.db.LINETYPE;if(d)switch(n.centralConnection){case y:h&&(p+=_(m,!0));break;case b:h||(f+=_(m,!1));break;case x:h?p+=_(m,!0):f+=_(m,!1)}switch(n.centralConnection){case y:v(p);break;case b:v(f);break;case x:v(f),v(p)}},`drawCentralConnection`),qe=e(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),`messageFont`),Je=e(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),`noteFont`),Ye=e(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),`actorFont`);async function Xe(e,t){Q.bumpVerticalPos(10);let{startx:n,stopx:i,message:a}=t,o=h.splitBreaks(a).length,s=r(a),c=s?await f(a,v()):S.calculateTextDimensions(a,qe(Z));if(!s){let e=c.height/o;t.height+=e,Q.bumpVerticalPos(e)}let l,u=c.height-10,d=c.width;if(n===i){l=Q.getVerticalPos()+u,Z.rightAngles||(u+=Z.boxMargin,l=Q.getVerticalPos()+u),u+=30;let e=h.getMax(d/2,Z.width/2);Q.insert(n-e,Q.getVerticalPos()-10+u,i+e,Q.getVerticalPos()+30+u)}else u+=Z.boxMargin,l=Q.getVerticalPos()+u,Q.insert(n,l-10,i,l);return Q.bumpVerticalPos(u),t.height+=u,t.stopy=t.starty+t.height,Q.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),l}e(Xe,`boundMessage`);var Ze=e(async function(e,t,n,i,a,o){let{startx:c,stopx:l,starty:u,message:d,type:f,sequenceIndex:p,sequenceVisible:m}=t,g=S.calculateTextDimensions(d,qe(Z)),_=T();_.x=Math.min(c,l),_.y=u+10,_.width=Math.abs(l-c),_.class=`messageText`,_.dy=`1em`,_.text=d,_.fontFamily=Z.messageFontFamily,_.fontSize=Z.messageFontSize,_.fontWeight=Z.messageFontWeight,_.anchor=Z.messageAlign,_.valign=`center`,_.textMargin=Z.wrapPadding,_.tspan=!1,r(_.text)?await ye(e,_,{startx:c,stopx:l,starty:n}):W(e,_);let v=g.width,y;if(c===l){let r=m||Z.showSequenceNumbers,o=mt(a,i),s=ht(a,i),u=c+(r&&(o||s)?10:0);y=Z.rightAngles?e.append(`path`).attr(`d`,`M ${u},${n} H ${c+h.getMax(Z.width/2,v/2)} V ${n+25} H ${c}`):e.append(`path`).attr(`d`,`M `+u+`,`+n+` C `+(u+60)+`,`+(n-10)+` `+(c+60)+`,`+(n+30)+` `+c+`,`+(n+20)),ft(a,i)&&Ke(e,a,t,i,c,l,n)}else y=e.append(`line`),y.attr(`x1`,c),y.attr(`y1`,n),y.attr(`x2`,l),y.attr(`y2`,n),ft(a,i)&&Ke(e,a,t,i,c,l,n);f===i.db.LINETYPE.DOTTED||f===i.db.LINETYPE.DOTTED_CROSS||f===i.db.LINETYPE.DOTTED_POINT||f===i.db.LINETYPE.DOTTED_OPEN||f===i.db.LINETYPE.BIDIRECTIONAL_DOTTED||f===i.db.LINETYPE.SOLID_TOP_DOTTED||f===i.db.LINETYPE.SOLID_BOTTOM_DOTTED||f===i.db.LINETYPE.STICK_TOP_DOTTED||f===i.db.LINETYPE.STICK_BOTTOM_DOTTED||f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style(`stroke-dasharray`,`3, 3`),y.attr(`class`,`messageLine1`)):y.attr(`class`,`messageLine0`),y.attr(`data-et`,`message`),y.attr(`data-id`,`i`+t.id),y.attr(`data-from`,t.from),y.attr(`data-to`,t.to);let b=``;if(Z.arrowMarkerAbsolute&&(b=s(!0)),y.attr(`stroke-width`,2),y.attr(`stroke`,`none`),y.style(`fill`,`none`),(f===i.db.LINETYPE.SOLID_TOP||f===i.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-solidTopArrowHead)`),(f===i.db.LINETYPE.SOLID_BOTTOM||f===i.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-solidBottomArrowHead)`),(f===i.db.LINETYPE.STICK_TOP||f===i.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-stickTopArrowHead)`),(f===i.db.LINETYPE.STICK_BOTTOM||f===i.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-stickBottomArrowHead)`),(f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-solidBottomArrowHead)`),(f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-solidTopArrowHead)`),(f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-stickBottomArrowHead)`),(f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-stickTopArrowHead)`),(f===i.db.LINETYPE.SOLID||f===i.db.LINETYPE.DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-arrowhead)`),(f===i.db.LINETYPE.BIDIRECTIONAL_SOLID||f===i.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr(`marker-start`,`url(`+b+`#`+o+`-arrowhead)`),y.attr(`marker-end`,`url(`+b+`#`+o+`-arrowhead)`)),(f===i.db.LINETYPE.SOLID_POINT||f===i.db.LINETYPE.DOTTED_POINT)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-filled-head)`),(f===i.db.LINETYPE.SOLID_CROSS||f===i.db.LINETYPE.DOTTED_CROSS)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-crosshead)`),m||Z.showSequenceNumbers){let r=f===i.db.LINETYPE.BIDIRECTIONAL_SOLID||f===i.db.LINETYPE.BIDIRECTIONAL_DOTTED,s=f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,u=ft(a,i),d=c,m=l;r?(cc?m=l-12:(m=l-6,d+=a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_DUAL||a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),m+=u?15:0,y.attr(`x2`,m),y.attr(`x1`,d)):y.attr(`x1`,c+6);let h=0,g=c===l,_=c<=l;h=g?t.fromBounds+1:s?_?t.toBounds-1:t.fromBounds+1:_?t.fromBounds+1:t.toBounds-1;let v=`12px`,x=p.toString().length;x>5?v=`7px`:x>3&&(v=`9px`),e.append(`line`).attr(`x1`,h).attr(`y1`,n).attr(`x2`,h).attr(`y2`,n).attr(`stroke-width`,0).attr(`marker-start`,`url(`+b+`#`+o+`-sequencenumber)`),e.append(`text`).attr(`x`,h).attr(`y`,n+4).attr(`font-family`,`sans-serif`).attr(`font-size`,v).attr(`text-anchor`,`middle`).attr(`class`,`sequenceNumber`).text(p)}},`drawMessage`),Qe=e(function(e,t,n,r,i,a,o){let s=0,c=0,l,u=0;for(let e of r){let r=t.get(e),a=r.box;l&&l!=a&&(o||Q.models.addBox(l),c+=Z.boxMargin+l.margin),a&&a!=l&&(o||(a.x=s+c,a.y=i),c+=a.margin),r.width=h.getMax(r.width||Z.width,Z.width),r.height=h.getMax(r.height||Z.height,Z.height),r.margin=r.margin||Z.actorMargin,u=h.getMax(u,r.height),n.get(r.name)&&(c+=r.width/2),r.x=s+c,r.starty=Q.getVerticalPos(),Q.insert(r.x,i,r.x+r.width,r.height),s+=r.width+c,r.box&&(r.box.width=s+a.margin-r.box.x),c=r.margin,l=r.box,Q.models.addActor(r)}l&&!o&&Q.models.addBox(l),Q.bumpVerticalPos(u)},`addActorRenderingData`),$e=e(async function(e,t,n,r,i,a,o){if(r){let r=0;Q.bumpVerticalPos(Z.boxMargin*2);for(let s of n){let n=t.get(s);n.stopy||=Q.getVerticalPos();let c=await X.drawActor(e,n,Z,!0,i,a,o);r=h.getMax(r,c)}Q.bumpVerticalPos(r+Z.boxMargin)}else for(let r of n){let n=t.get(r);await X.drawActor(e,n,Z,!1,i,a,o)}},`drawActors`),et=e(function(e,t,n,r){let i=0,a=0;for(let o of n){let n=t.get(o),s=st(n),c=X.drawPopup(e,n,s,Z,Z.forceMenus,r);c.height>i&&(i=c.height),c.width+n.x>a&&(a=c.width+n.x)}return{maxHeight:i,maxWidth:a}},`drawActorsPopup`),tt=e(function(e){m(Z,e),e.fontFamily&&(Z.actorFontFamily=Z.noteFontFamily=Z.messageFontFamily=e.fontFamily),e.fontSize&&(Z.actorFontSize=Z.noteFontSize=Z.messageFontSize=e.fontSize),e.fontWeight&&(Z.actorFontWeight=Z.noteFontWeight=Z.messageFontWeight=e.fontWeight)},`setConf`),nt=e(function(e){return Q.activations.filter(function(t){return t.actor===e})},`actorActivations`),rt=e(function(e,t){let n=t.get(e),r=nt(e);return[r.reduce(function(e,t){return h.getMin(e,t.startx)},n.x+n.width/2-1),r.reduce(function(e,t){return h.getMax(e,t.stopx)},n.x+n.width/2+1)]},`activationBounds`);function $(e,n,r,i,a){Q.bumpVerticalPos(r);let o=i;if(n.id&&n.message&&e[n.id]){let r=e[n.id].width,a=qe(Z);n.message=S.wrapLabel(`[${n.message}]`,r-2*Z.wrapPadding,a),n.width=r,n.wrap=!0;let s=S.calculateTextDimensions(n.message,a),c=h.getMax(s.height,Z.labelBoxHeight);o=i+c,t.debug(`${c} - ${n.message}`)}a(n),Q.bumpVerticalPos(o)}e($,`adjustLoopHeightForWrap`);function it(t,n,r,i,a,o,s){function c(e,r){e.x{e.add(t.from),e.add(t.to)}),x=x.filter(t=>e.has(t))}let D=new Map(x.map((e,t)=>[g.get(e)?.name??e,t]));Qe(h,g,_,x,0,S,!1);let O=await _t(S,g,E,o);X.insertArrowHead(h,i),X.insertArrowCrossHead(h,i),X.insertArrowFilledHead(h,i),X.insertSequenceNumber(h,i),X.insertSolidTopArrowHead(h,i),X.insertSolidBottomArrowHead(h,i),X.insertStickTopArrowHead(h,i),X.insertStickBottomArrowHead(h,i),l===`neo`&&X.insertDropShadow(h,Z,i);function k(e,t){let n=Q.endActivation(e);n.starty+18>t&&(n.starty=t-6,t+=12),X.drawActivation(h,n,t,Z,nt(e.from).length,o,D),Q.insert(n.startx,t-10,n.stopx,t)}e(k,`activeEnd`);let A=1,j=1,M=[],N=[],P=0;for(let e of S){let n,r,i;switch(e.type){case o.db.LINETYPE.NOTE:Q.resetVerticalPos(),r=e.noteModel,await Ge(h,r,e.id);break;case o.db.LINETYPE.ACTIVE_START:Q.newActivation(e,h,g);break;case o.db.LINETYPE.CENTRAL_CONNECTION:Q.newActivation(e,h,g);break;case o.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Q.newActivation(e,h,g);break;case o.db.LINETYPE.ACTIVE_END:k(e,Q.getVerticalPos());break;case o.db.LINETYPE.LOOP_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.LOOP_END:n=Q.endLoop(),await X.drawLoop(h,n,`loop`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.RECT_START:$(O,e,Z.boxMargin,Z.boxMargin,e=>{let t=e.message;t||=u?.rectBkgColor||u?.actorBkg||`rgba(128, 128, 128, 0.5)`,Q.newLoop(void 0,t)});break;case o.db.LINETYPE.RECT_END:n=Q.endLoop(),N.push(n),Q.models.addLoop(n),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos());break;case o.db.LINETYPE.OPT_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.OPT_END:n=Q.endLoop(),await X.drawLoop(h,n,`opt`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.ALT_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.ALT_ELSE:$(O,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case o.db.LINETYPE.ALT_END:n=Q.endLoop(),await X.drawLoop(h,n,`alt`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.PAR_START:case o.db.LINETYPE.PAR_OVER_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e)),Q.saveVerticalPos();break;case o.db.LINETYPE.PAR_AND:$(O,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case o.db.LINETYPE.PAR_END:n=Q.endLoop(),await X.drawLoop(h,n,`par`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.AUTONUMBER:A=e.message.start||A,j=e.message.step||j,e.message.visible?o.db.enableSequenceNumbers():o.db.disableSequenceNumbers();break;case o.db.LINETYPE.CRITICAL_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.CRITICAL_OPTION:$(O,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case o.db.LINETYPE.CRITICAL_END:n=Q.endLoop(),await X.drawLoop(h,n,`critical`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.BREAK_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.BREAK_END:n=Q.endLoop(),await X.drawLoop(h,n,`break`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;default:try{i=e.msgModel,i.starty=Q.getVerticalPos(),i.sequenceIndex=A,i.sequenceVisible=o.db.showSequenceNumbers(),i.id=e.id,i.from=e.from,i.to=e.to;let t=await Xe(h,i);it(e,i,t,P,g,_,y),M.push({messageModel:i,lineStartY:t,msg:e}),Q.models.addMessage(i)}catch(e){t.error(`error while drawing message`,e)}}[o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN,o.db.LINETYPE.SOLID,o.db.LINETYPE.SOLID_TOP,o.db.LINETYPE.SOLID_BOTTOM,o.db.LINETYPE.STICK_TOP,o.db.LINETYPE.STICK_BOTTOM,o.db.LINETYPE.SOLID_TOP_DOTTED,o.db.LINETYPE.SOLID_BOTTOM_DOTTED,o.db.LINETYPE.STICK_TOP_DOTTED,o.db.LINETYPE.STICK_BOTTOM_DOTTED,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.DOTTED,o.db.LINETYPE.SOLID_CROSS,o.db.LINETYPE.DOTTED_CROSS,o.db.LINETYPE.SOLID_POINT,o.db.LINETYPE.DOTTED_POINT,o.db.LINETYPE.BIDIRECTIONAL_SOLID,o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(A=Math.round((A+j)*100)/100),P++}t.debug(`createdActors`,_),t.debug(`destroyedActors`,y),await $e(h,g,x,!1,i,o,D);for(let e of M)await Ze(h,e.messageModel,e.lineStartY,o,e.msg,i);Z.mirrorActors&&await $e(h,g,x,!0,i,o,D),N.forEach(e=>X.drawBackgroundRect(h,e)),xe(h,g,x,Z);for(let e of Q.models.boxes){e.height=Q.getVerticalPos()-e.y,Q.insert(e.x,e.y,e.x+e.width,e.height);let t=Z.boxMargin*2;e.startx=e.x-t,e.starty=e.y-t*.25,e.stopx=e.startx+e.width+2*t,e.stopy=e.starty+e.height+t*.75,e.stroke=`rgb(0,0,0, 0.5)`,X.drawBox(h,e,Z)}w&&Q.bumpVerticalPos(Z.boxMargin);let F=et(h,g,x,m),{bounds:I}=Q.getBounds();I.startx===void 0&&(I.startx=0),I.starty===void 0&&(I.starty=0),I.stopx===void 0&&(I.stopx=0),I.stopy===void 0&&(I.stopy=0);let ee=I.stopy-I.starty;ee{let n=qe(Z),r=t.actorKeys.reduce((t,n)=>t+=e.get(n).width+(e.get(n).margin||0),0),i=Z.boxMargin*8;r+=i,r-=2*Z.boxTextMargin,t.wrap&&(t.name=S.wrapLabel(t.name,r-2*Z.wrapPadding,n));let o=S.calculateTextDimensions(t.name,n);a=h.getMax(o.height,a);let s=h.getMax(r,o.width+2*Z.wrapPadding);if(t.margin=Z.boxTextMargin,re.textMaxHeight=a),h.getMax(i,Z.height)}e(ct,`calculateActorMargins`);var lt=e(async function(e,n,i){let a=n.get(e.from),o=n.get(e.to),s=a.x,c=o.x,l=e.wrap&&e.message,u=r(e.message)?await f(e.message,v()):S.calculateTextDimensions(l?S.wrapLabel(e.message,Z.width,Je(Z)):e.message,Je(Z)),d={width:l?Z.width:h.getMax(Z.width,u.width+2*Z.noteMargin),height:0,startx:a.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===i.db.PLACEMENT.RIGHTOF?(d.width=l?h.getMax(Z.width,u.width):h.getMax(a.width/2+o.width/2,u.width+2*Z.noteMargin),d.startx=s+(a.width+Z.actorMargin)/2):e.placement===i.db.PLACEMENT.LEFTOF?(d.width=l?h.getMax(Z.width,u.width+2*Z.noteMargin):h.getMax(a.width/2+o.width/2,u.width+2*Z.noteMargin),d.startx=s-d.width+(a.width-Z.actorMargin)/2):e.to===e.from?(u=S.calculateTextDimensions(l?S.wrapLabel(e.message,h.getMax(Z.width,a.width),Je(Z)):e.message,Je(Z)),d.width=l?h.getMax(Z.width,a.width):h.getMax(a.width,Z.width,u.width+2*Z.noteMargin),d.startx=s+(a.width-d.width)/2):(d.width=Math.abs(s+a.width/2-(c+o.width/2))+Z.actorMargin,d.startx=s2,p=e(e=>l?-e:e,`adjustValue`);t.from===t.to?d=u:(t.activate&&!f&&(d+=p(Z.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(d+=p(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=p(3)));let m=[a,o,s,c],g=Math.abs(u-d);t.wrap&&t.message&&(t.message=S.wrapLabel(t.message,h.getMax(g+2*Z.wrapPadding,Z.width),qe(Z)));let _=S.calculateTextDimensions(t.message,qe(Z));return{width:h.getMax(t.wrap?0:_.width+2*Z.wrapPadding,g+2*Z.wrapPadding,Z.width),height:0,startx:u,stopx:d,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,m),toBounds:Math.max.apply(null,m)}},`buildMessageModel`),_t=e(async function(e,n,r,i){let a={},o=[],s,c,l;for(let t of e){switch(t.type){case i.db.LINETYPE.LOOP_START:case i.db.LINETYPE.ALT_START:case i.db.LINETYPE.OPT_START:case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:case i.db.LINETYPE.CRITICAL_START:case i.db.LINETYPE.BREAK_START:o.push({id:t.id,msg:t.message,from:2**53-1,to:-(2**53-1),width:0});break;case i.db.LINETYPE.ALT_ELSE:case i.db.LINETYPE.PAR_AND:case i.db.LINETYPE.CRITICAL_OPTION:t.message&&(s=o.pop(),a[s.id]=s,a[t.id]=s,o.push(s));break;case i.db.LINETYPE.LOOP_END:case i.db.LINETYPE.ALT_END:case i.db.LINETYPE.OPT_END:case i.db.LINETYPE.PAR_END:case i.db.LINETYPE.CRITICAL_END:case i.db.LINETYPE.BREAK_END:s=o.pop(),a[s.id]=s;break;case i.db.LINETYPE.ACTIVE_START:{let e=n.get(t.from?t.from:t.to.actor),r=nt(t.from?t.from:t.to.actor).length,i=e.x+e.width/2+(r-1)*Z.activationWidth/2,a={startx:i,stopx:i+Z.activationWidth,actor:t.from,enabled:!0};Q.activations.push(a)}break;case i.db.LINETYPE.ACTIVE_END:{let e=Q.activations.map(e=>e.actor).lastIndexOf(t.from);Q.activations.splice(e,1).splice(0,1)}}t.placement===void 0?(l=gt(t,n,i),t.msgModel=l,l.startx&&l.stopx&&o.length>0&&o.forEach(e=>{if(s=e,l.startx===l.stopx){let e=n.get(t.from),r=n.get(t.to);s.from=h.getMin(e.x-l.width/2,e.x-e.width/2,s.from),s.to=h.getMax(r.x+l.width/2,r.x+e.width/2,s.to),s.width=h.getMax(s.width,Math.abs(s.to-s.from))-Z.labelBoxWidth}else s.from=h.getMin(l.startx,s.from),s.to=h.getMax(l.stopx,s.to),s.width=h.getMax(s.width,l.width)-Z.labelBoxWidth})):(c=await lt(t,n,i),t.noteModel=c,o.forEach(e=>{s=e,s.from=h.getMin(s.from,c.startx),s.to=h.getMax(s.to,c.startx+c.width),s.width=h.getMax(s.width,Math.abs(s.from-s.to))-Z.labelBoxWidth}))}return Q.activations=[],t.debug(`Loop type widths:`,a),a},`calculateLoopBounds`),vt={parser:F,get db(){return new ne},renderer:{bounds:Q,drawActors:$e,drawActorsPopup:et,setConf:tt,draw:at},styles:re,init:e(e=>{e.sequence||={},e.wrap&&(e.sequence.wrap=e.wrap,a({sequence:{wrap:e.wrap}}))},`init`)};export{vt as diagram}; \ No newline at end of file +`;E.append(`path`).attr(`d`,D),p===`neo`&&E.attr(`filter`,`url(#${J(a)})`);let O=o.get(t.name)??0;if(H.has(d)?(E.style(`stroke`,U(h,O)),E.style(`fill`,U(m,O))):E.style(`stroke`,g),E.attr(`transform`,`translate(${x}, ${C})`),t.rectData=y,Y(n,r(t.description))(t.description,v,y.x,l?l.labelCenterY-y.height/2:y.y+35,y.width,y.height,{class:`actor ${he}`},n),!l){let e=E.select(`path:last-child`);e.node()&&(t.height=e.node().getBBox().height+(n.sequence.labelBoxHeight??0))}return i||(v.attr(`data-et`,`participant`),v.attr(`data-type`,`database`),v.attr(`data-id`,t.name)),t.height},`drawActorTypeDatabase`),Ee=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+80,d=l?l.glyphBottomY-22:s+12,f=e.append(`g`).lower(),{look:p,theme:m,themeVariables:h}=n,{bkgColorArray:g,borderColorArray:_,actorBorder:v}=h;i||(G++,f.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=G);let y=e.append(`g`),b=V;b+=i?` ${B}`:` ${z}`,y.attr(`class`,b),y.attr(`name`,t.name);let x=j();x.x=t.x,x.y=s,x.fill=`#eaeaea`,x.width=t.width,x.height=t.height,x.class=`actor`,y.append(`line`).attr(`id`,`actor-man-torso`+G).attr(`x1`,t.x+t.width/2-55).attr(`y1`,d).attr(`x2`,t.x+t.width/2-15).attr(`y2`,d),y.append(`line`).attr(`id`,`actor-man-arms`+G).attr(`x1`,t.x+t.width/2-55).attr(`y1`,d-10).attr(`x2`,t.x+t.width/2-55).attr(`y2`,d+10),y.append(`circle`).attr(`cx`,t.x+t.width/2).attr(`cy`,d).attr(`r`,22),p===`neo`&&y.attr(`filter`,`url(#${J(a)})`);let S=o.get(t.name)??0;return H.has(m)?(y.style(`stroke`,U(_,S)),y.style(`fill`,U(g,S))):y.style(`stroke`,v),l||(t.height=y.node().getBBox().height+(n.sequence.labelBoxHeight??0)),Y(n,r(t.description))(t.description,y,x.x,l?l.labelCenterY-x.height/2:x.y+15,x.width,x.height,{class:`actor ${V}`},n),l||y.attr(`transform`,`translate(0,21)`),i||(y.attr(`data-et`,`participant`),y.attr(`data-type`,`boundary`),y.attr(`data-id`,t.name)),t.height},`drawActorTypeBoundary`),De=e(function(t,n,i,a,o){let s=a?n.stopy:n.starty,c=n.x+n.width/2,l=me(n,i,a,s),u=l?l.lifelineStartY:s+80,{theme:d,themeVariables:f}=i,{bkgColorArray:p,borderColorArray:m,actorBorder:h}=f,g=t.append(`g`).lower();a||(G++,g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,n.name).attr(`data-et`,`life-line`).attr(`data-id`,n.name),n.actorCnt=G);let _=t.append(`g`),v=V;v+=a?` ${B}`:` ${z}`,_.attr(`class`,v),_.attr(`name`,n.name),a||_.attr(`data-et`,`participant`).attr(`data-type`,`actor`).attr(`data-id`,n.name);let y=l?ie/pe:1,b=e(e=>l?l.glyphBottomY-(fe-e)*y:s+e,`gy`),x=e(e=>c+e*y,`gx`);_.append(`line`).attr(`id`,`actor-man-torso`+G).attr(`x1`,c).attr(`y1`,b(25)).attr(`x2`,c).attr(`y2`,b(45)),_.append(`line`).attr(`id`,`actor-man-arms`+G).attr(`x1`,x(-R/2)).attr(`y1`,b(33)).attr(`x2`,x(R/2)).attr(`y2`,b(33)),_.append(`line`).attr(`x1`,x(-R/2)).attr(`y1`,b(60)).attr(`x2`,c).attr(`y2`,b(45)),_.append(`line`).attr(`x1`,c).attr(`y1`,b(45)).attr(`x2`,x(R/2-2)).attr(`y2`,b(60));let S=_.append(`circle`);S.attr(`cx`,n.x+n.width/2),S.attr(`cy`,b(10)),S.attr(`r`,15*y),S.attr(`width`,n.width),S.attr(`height`,n.height),l||(n.height=pe);let C=j();C.x=n.x,C.y=s,C.fill=`#eaeaea`,C.width=n.width,C.height=n.height,C.class=`actor`,C.rx=3,C.ry=3;let w=o.get(n.name)??0;return H.has(d)?(_.style(`stroke`,U(m,w)),_.style(`fill`,U(p,w))):_.style(`stroke`,h),Y(i,r(n.description))(n.description,_,C.x,l?l.labelCenterY-C.height/2:s+35,C.width,C.height,{class:`actor ${V}`},i),n.height},`drawActorTypeActor`),Oe=e(async function(e,t,n,r,i,a,o){let s=o??new Map([...a.db.getActors().values()].map((e,t)=>[e.name,t]));switch(t.type){case`actor`:return await De(e,t,n,r,s);case`participant`:return await Se(e,t,n,r,i,s);case`boundary`:return await Ee(e,t,n,r,i,s);case`control`:return await K(e,t,n,r,i,s);case`entity`:return await q(e,t,n,r,i,s);case`database`:return await Te(e,t,n,r,i,s);case`collections`:return await Ce(e,t,n,r,i,s);case`queue`:return await we(e,t,n,r,i,s)}},`drawActor`),ke=e(function(e,t,n){let r=e.append(`g`);Ne(r,t),t.name&&Y(n)(t.name,r,t.x,t.y+n.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:`text`},n),r.lower()},`drawBox`),Ae=e(function(e){return e.append(`g`)},`anchorElement`),je=e(function(e,t,n,r,i,a,o){let{theme:s,themeVariables:c}=r,{bkgColorArray:l,borderColorArray:u,mainBkg:d}=c,f=j(),p=t.anchored,m=t.actor;f.x=t.startx,f.y=t.starty,f.class=`activation`+i%3,f.width=t.stopx-t.startx,f.height=n-t.starty;let h=ge(p,f),g=(o??new Map([...a.db.getActors().values()].map((e,t)=>[e.name,t]))).get(m)??0;H.has(s)&&(h.style(`stroke`,U(u,g)),h.style(`fill`,U(l,g)??d))},`drawActivation`),Me=e(async function(t,n,i,a,o){let{boxMargin:s,boxTextMargin:c,labelBoxHeight:l,labelBoxWidth:u,messageFontFamily:d,messageFontSize:f,messageFontWeight:p}=a,m=t.append(`g`).attr(`data-et`,`control-structure`).attr(`data-id`,`i`+o.id),h=e(function(e,t,n,r){return m.append(`line`).attr(`x1`,e).attr(`y1`,t).attr(`x2`,n).attr(`y2`,r).attr(`class`,`loopLine`)},`drawLoopLine`);h(n.startx,n.starty,n.stopx,n.starty),h(n.stopx,n.starty,n.stopx,n.stopy),h(n.startx,n.stopy,n.stopx,n.stopy),h(n.startx,n.starty,n.startx,n.stopy),n.sections!==void 0&&n.sections.forEach(function(e){h(n.startx,e.y,n.stopx,e.y).style(`stroke-dasharray`,`3, 3`)});let g=D();g.text=i,g.x=n.startx,g.y=n.starty,g.fontFamily=d,g.fontSize=f,g.fontWeight=p,g.anchor=`middle`,g.valign=`middle`,g.tspan=!1,g.width=Math.max(u??0,50),g.height=l+(a.look===`neo`?15:0)||20,g.textMargin=c,g.class=`labelText`,be(m,g),g=He(),g.text=n.title,g.x=n.startx+u/2+(n.stopx-n.startx)/2,g.y=n.starty+s+c,g.anchor=`middle`,g.valign=`middle`,g.textMargin=c,g.class=`loopText`,g.fontFamily=d,g.fontSize=f,g.fontWeight=p,g.wrap=!0;let _=r(g.text)?await ye(m,g,n):W(m,g);if(n.sectionTitles!==void 0){for(let[e,t]of Object.entries(n.sectionTitles))if(t.message){g.text=t.message,g.x=n.startx+(n.stopx-n.startx)/2,g.y=n.sections[e].y+s+c,g.class=`sectionTitle`,g.anchor=`middle`,g.valign=`middle`,g.tspan=!1,g.fontFamily=d,g.fontSize=f,g.fontWeight=p,g.wrap=n.wrap,r(g.text)?(n.starty=n.sections[e].y,await ye(m,g,n)):W(m,g);let i=Math.round(_.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));n.sections[e].height+=i-(s+c)}}return n.height=Math.round(n.stopy-n.starty),m},`drawLoop`),Ne=e(function(e,t){k(e,t)},`drawBackgroundRect`),Pe=e(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-database`).attr(`fill-rule`,`evenodd`).attr(`clip-rule`,`evenodd`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z`)},`insertDatabaseIcon`),Fe=e(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-computer`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z`)},`insertComputerIcon`),Ie=e(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-clock`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z`)},`insertClockIcon`),Le=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,7.9).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M -1 0 L 10 5 L 0 10 z`)},`insertArrowHead`),Re=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-filled-head`).attr(`refX`,15.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`insertArrowFilledHead`),ze=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-sequencenumber`).attr(`refX`,15).attr(`refY`,15).attr(`markerWidth`,60).attr(`markerHeight`,40).attr(`orient`,`auto`).append(`circle`).attr(`cx`,15).attr(`cy`,15).attr(`r`,6)},`insertSequenceNumber`),Be=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-crosshead`).attr(`markerWidth`,15).attr(`markerHeight`,8).attr(`orient`,`auto`).attr(`refX`,4).attr(`refY`,4.5).append(`path`).attr(`fill`,`none`).attr(`stroke`,`#000000`).style(`stroke-dasharray`,`0, 0`).attr(`stroke-width`,`1pt`).attr(`d`,`M 1,2 L 6,7 M 6,2 L 1,7`)},`insertArrowCrossHead`),J=e(e=>e?`${e}-drop-shadow`:`drop-shadow`,`dropShadowId`),Ve=e(function(e,t,n){let{theme:r}=t;e.append(`defs`).append(`filter`).attr(`id`,J(n)).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${r===`redux`||r===`redux-color`?`#000000`:`#FFFFFF`}`)},`insertDropShadow`),He=e(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:`#666`,width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},`getTextObj`),Ue=e(function(){return{x:0,y:0,fill:`#EDF2AE`,stroke:`#666`,width:100,anchor:`start`,height:100,rx:0,ry:0}},`getNoteRect`),Y=(function(){function t(e,t,n,r,i,a,s){o(t.append(`text`).attr(`x`,n+i/2).attr(`y`,r+a/2+5).style(`text-anchor`,`middle`).text(e),s)}e(t,`byText`);function n(e,t,n,r,i,a,s,c){let{actorFontSize:l,actorFontFamily:u,actorFontWeight:d}=c,[f,p]=C(l),m=e.split(h.lineBreakRegex);for(let e=0;ee.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},`getHeight`),clear:e(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},`clear`),addBox:e(function(e){this.boxes.push(e)},`addBox`),addActor:e(function(e){this.actors.push(e)},`addActor`),addLoop:e(function(e){this.loops.push(e)},`addLoop`),addMessage:e(function(e){this.messages.push(e)},`addMessage`),addNote:e(function(e){this.notes.push(e)},`addNote`),lastActor:e(function(){return this.actors[this.actors.length-1]},`lastActor`),lastLoop:e(function(){return this.loops[this.loops.length-1]},`lastLoop`),lastMessage:e(function(){return this.messages[this.messages.length-1]},`lastMessage`),lastNote:e(function(){return this.notes[this.notes.length-1]},`lastNote`),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:e(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,tt(v())},`init`),updateVal:e(function(e,t,n,r){e[t]=e[t]===void 0?n:r(n,e[t])},`updateVal`),updateBounds:e(function(t,n,r,i){let a=this,o=0;function s(s){return e(function(e){o++;let c=a.sequenceItems.length-o+1;a.updateVal(e,`starty`,n-c*Z.boxMargin,Math.min),a.updateVal(e,`stopy`,i+c*Z.boxMargin,Math.max),a.updateVal(Q.data,`startx`,t-c*Z.boxMargin,Math.min),a.updateVal(Q.data,`stopx`,r+c*Z.boxMargin,Math.max),s!==`activation`&&(a.updateVal(e,`startx`,t-c*Z.boxMargin,Math.min),a.updateVal(e,`stopx`,r+c*Z.boxMargin,Math.max),a.updateVal(Q.data,`starty`,n-c*Z.boxMargin,Math.min),a.updateVal(Q.data,`stopy`,i+c*Z.boxMargin,Math.max))},`updateItemBounds`)}e(s,`updateFn`),this.sequenceItems.forEach(s()),this.activations.forEach(s(`activation`))},`updateBounds`),insert:e(function(e,t,n,r){let i=h.getMin(e,n),a=h.getMax(e,n),o=h.getMin(t,r),s=h.getMax(t,r);this.updateVal(Q.data,`startx`,i,Math.min),this.updateVal(Q.data,`starty`,o,Math.min),this.updateVal(Q.data,`stopx`,a,Math.max),this.updateVal(Q.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),newActivation:e(function(e,t,n){let r=n.get(e.from),i=nt(e.from).length||0,a=r.x+r.width/2+(i-1)*Z.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Z.activationWidth,stopy:void 0,actor:e.from,anchored:X.anchorElement(t)})},`newActivation`),endActivation:e(function(e){let t=this.activations.map(function(e){return e.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},`endActivation`),createLoop:e(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},`createLoop`),newLoop:e(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},`newLoop`),endLoop:e(function(){return this.sequenceItems.pop()},`endLoop`),isLoopOverlap:e(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},`isLoopOverlap`),addSectionToLoop:e(function(e){let t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:Q.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},`addSectionToLoop`),saveVerticalPos:e(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},`saveVerticalPos`),resetVerticalPos:e(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},`resetVerticalPos`),bumpVerticalPos:e(function(e){this.verticalPos+=e,this.data.stopy=h.getMax(this.data.stopy,this.verticalPos)},`bumpVerticalPos`),getVerticalPos:e(function(){return this.verticalPos},`getVerticalPos`),getBounds:e(function(){return{bounds:this.data,models:this.models}},`getBounds`)},Ge=e(async function(e,t,n){Q.bumpVerticalPos(Z.boxMargin),t.height=Z.boxMargin,t.starty=Q.getVerticalPos();let i=j();i.x=t.startx,i.y=t.starty,i.width=t.width||Z.width,i.class=`note`;let a=e.append(`g`);a.attr(`data-et`,`note`),a.attr(`data-id`,`i`+n);let o=X.drawRect(a,i),s=D();s.x=t.startx,s.y=t.starty,s.width=i.width,s.dy=`1em`,s.text=t.message,s.class=`noteText`,s.fontFamily=Z.noteFontFamily,s.fontSize=Z.noteFontSize,s.fontWeight=Z.noteFontWeight,s.anchor=Z.noteAlign,s.textMargin=Z.noteMargin,s.valign=`center`;let c=r(s.text)?await ye(a,s):W(a,s),l=Math.round(c.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));o.attr(`height`,l+2*Z.noteMargin),t.height+=l+2*Z.noteMargin,Q.bumpVerticalPos(l+2*Z.noteMargin),t.stopy=t.starty+l+2*Z.noteMargin,t.stopx=t.startx+i.width,Q.insert(t.startx,t.starty,t.stopx,t.stopy),Q.models.addNote(t)},`drawNote`),Ke=e(function(t,n,r,i,a,o,s){let c=i.db.getActors(),l=c.get(n.from),u=c.get(n.to),d=r.sequenceVisible,f=l.x+l.width/2,p=u.x+u.width/2,m=f<=p,h=mt(n,i),g=t.append(`g`),_=e((e,t)=>{let n=e?16.5:-16.5;return t?-n:n},`getCircleOffset`),v=e(e=>{g.append(`circle`).attr(`cx`,e).attr(`cy`,s).attr(`r`,5).attr(`width`,10).attr(`height`,10)},`drawCircle`),{CENTRAL_CONNECTION:y,CENTRAL_CONNECTION_REVERSE:b,CENTRAL_CONNECTION_DUAL:x}=i.db.LINETYPE;if(d)switch(n.centralConnection){case y:h&&(p+=_(m,!0));break;case b:h||(f+=_(m,!1));break;case x:h?p+=_(m,!0):f+=_(m,!1)}switch(n.centralConnection){case y:v(p);break;case b:v(f);break;case x:v(f),v(p)}},`drawCentralConnection`),qe=e(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),`messageFont`),Je=e(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),`noteFont`),Ye=e(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),`actorFont`);async function Xe(e,t){Q.bumpVerticalPos(10);let{startx:n,stopx:i,message:a}=t,o=h.splitBreaks(a).length,s=r(a),c=s?await f(a,v()):S.calculateTextDimensions(a,qe(Z));if(!s){let e=c.height/o;t.height+=e,Q.bumpVerticalPos(e)}let l,u=c.height-10,d=c.width;if(n===i){l=Q.getVerticalPos()+u,Z.rightAngles||(u+=Z.boxMargin,l=Q.getVerticalPos()+u),u+=30;let e=h.getMax(d/2,Z.width/2);Q.insert(n-e,Q.getVerticalPos()-10+u,i+e,Q.getVerticalPos()+30+u)}else u+=Z.boxMargin,l=Q.getVerticalPos()+u,Q.insert(n,l-10,i,l);return Q.bumpVerticalPos(u),t.height+=u,t.stopy=t.starty+t.height,Q.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),l}e(Xe,`boundMessage`);var Ze=e(async function(e,t,n,i,a,o){let{startx:c,stopx:l,starty:u,message:d,type:f,sequenceIndex:p,sequenceVisible:m}=t,g=S.calculateTextDimensions(d,qe(Z)),_=D();_.x=Math.min(c,l),_.y=u+10,_.width=Math.abs(l-c),_.class=`messageText`,_.dy=`1em`,_.text=d,_.fontFamily=Z.messageFontFamily,_.fontSize=Z.messageFontSize,_.fontWeight=Z.messageFontWeight,_.anchor=Z.messageAlign,_.valign=`center`,_.textMargin=Z.wrapPadding,_.tspan=!1,r(_.text)?await ye(e,_,{startx:c,stopx:l,starty:n}):W(e,_);let v=g.width,y;if(c===l){let r=m||Z.showSequenceNumbers,o=mt(a,i),s=ht(a,i),u=c+(r&&(o||s)?10:0);y=Z.rightAngles?e.append(`path`).attr(`d`,`M ${u},${n} H ${c+h.getMax(Z.width/2,v/2)} V ${n+25} H ${c}`):e.append(`path`).attr(`d`,`M `+u+`,`+n+` C `+(u+60)+`,`+(n-10)+` `+(c+60)+`,`+(n+30)+` `+c+`,`+(n+20)),ft(a,i)&&Ke(e,a,t,i,c,l,n)}else y=e.append(`line`),y.attr(`x1`,c),y.attr(`y1`,n),y.attr(`x2`,l),y.attr(`y2`,n),ft(a,i)&&Ke(e,a,t,i,c,l,n);f===i.db.LINETYPE.DOTTED||f===i.db.LINETYPE.DOTTED_CROSS||f===i.db.LINETYPE.DOTTED_POINT||f===i.db.LINETYPE.DOTTED_OPEN||f===i.db.LINETYPE.BIDIRECTIONAL_DOTTED||f===i.db.LINETYPE.SOLID_TOP_DOTTED||f===i.db.LINETYPE.SOLID_BOTTOM_DOTTED||f===i.db.LINETYPE.STICK_TOP_DOTTED||f===i.db.LINETYPE.STICK_BOTTOM_DOTTED||f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style(`stroke-dasharray`,`3, 3`),y.attr(`class`,`messageLine1`)):y.attr(`class`,`messageLine0`),y.attr(`data-et`,`message`),y.attr(`data-id`,`i`+t.id),y.attr(`data-from`,t.from),y.attr(`data-to`,t.to);let b=``;if(Z.arrowMarkerAbsolute&&(b=s(!0)),y.attr(`stroke-width`,2),y.attr(`stroke`,`none`),y.style(`fill`,`none`),(f===i.db.LINETYPE.SOLID_TOP||f===i.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-solidTopArrowHead)`),(f===i.db.LINETYPE.SOLID_BOTTOM||f===i.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-solidBottomArrowHead)`),(f===i.db.LINETYPE.STICK_TOP||f===i.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-stickTopArrowHead)`),(f===i.db.LINETYPE.STICK_BOTTOM||f===i.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-stickBottomArrowHead)`),(f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-solidBottomArrowHead)`),(f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-solidTopArrowHead)`),(f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-stickBottomArrowHead)`),(f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-stickTopArrowHead)`),(f===i.db.LINETYPE.SOLID||f===i.db.LINETYPE.DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-arrowhead)`),(f===i.db.LINETYPE.BIDIRECTIONAL_SOLID||f===i.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr(`marker-start`,`url(`+b+`#`+o+`-arrowhead)`),y.attr(`marker-end`,`url(`+b+`#`+o+`-arrowhead)`)),(f===i.db.LINETYPE.SOLID_POINT||f===i.db.LINETYPE.DOTTED_POINT)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-filled-head)`),(f===i.db.LINETYPE.SOLID_CROSS||f===i.db.LINETYPE.DOTTED_CROSS)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-crosshead)`),m||Z.showSequenceNumbers){let r=f===i.db.LINETYPE.BIDIRECTIONAL_SOLID||f===i.db.LINETYPE.BIDIRECTIONAL_DOTTED,s=f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,u=ft(a,i),d=c,m=l;r?(cc?m=l-12:(m=l-6,d+=a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_DUAL||a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),m+=u?15:0,y.attr(`x2`,m),y.attr(`x1`,d)):y.attr(`x1`,c+6);let h=0,g=c===l,_=c<=l;h=g?t.fromBounds+1:s?_?t.toBounds-1:t.fromBounds+1:_?t.fromBounds+1:t.toBounds-1;let v=`12px`,x=p.toString().length;x>5?v=`7px`:x>3&&(v=`9px`),e.append(`line`).attr(`x1`,h).attr(`y1`,n).attr(`x2`,h).attr(`y2`,n).attr(`stroke-width`,0).attr(`marker-start`,`url(`+b+`#`+o+`-sequencenumber)`),e.append(`text`).attr(`x`,h).attr(`y`,n+4).attr(`font-family`,`sans-serif`).attr(`font-size`,v).attr(`text-anchor`,`middle`).attr(`class`,`sequenceNumber`).text(p)}},`drawMessage`),Qe=e(function(e,t,n,r,i,a,o){let s=0,c=0,l,u=0;for(let e of r){let r=t.get(e),a=r.box;l&&l!=a&&(o||Q.models.addBox(l),c+=Z.boxMargin+l.margin),a&&a!=l&&(o||(a.x=s+c,a.y=i),c+=a.margin),r.width=h.getMax(r.width||Z.width,Z.width),r.height=h.getMax(r.height||Z.height,Z.height),r.margin=r.margin||Z.actorMargin,u=h.getMax(u,r.height),n.get(r.name)&&(c+=r.width/2),r.x=s+c,r.starty=Q.getVerticalPos(),Q.insert(r.x,i,r.x+r.width,r.height),s+=r.width+c,r.box&&(r.box.width=s+a.margin-r.box.x),c=r.margin,l=r.box,Q.models.addActor(r)}l&&!o&&Q.models.addBox(l),Q.bumpVerticalPos(u)},`addActorRenderingData`),$e=e(async function(e,t,n,r,i,a,o){if(r){let r=0;Q.bumpVerticalPos(Z.boxMargin*2);for(let s of n){let n=t.get(s);n.stopy||=Q.getVerticalPos();let c=await X.drawActor(e,n,Z,!0,i,a,o);r=h.getMax(r,c)}Q.bumpVerticalPos(r+Z.boxMargin)}else for(let r of n){let n=t.get(r);await X.drawActor(e,n,Z,!1,i,a,o)}},`drawActors`),et=e(function(e,t,n,r){let i=0,a=0;for(let o of n){let n=t.get(o),s=st(n),c=X.drawPopup(e,n,s,Z,Z.forceMenus,r);c.height>i&&(i=c.height),c.width+n.x>a&&(a=c.width+n.x)}return{maxHeight:i,maxWidth:a}},`drawActorsPopup`),tt=e(function(e){m(Z,e),e.fontFamily&&(Z.actorFontFamily=Z.noteFontFamily=Z.messageFontFamily=e.fontFamily),e.fontSize&&(Z.actorFontSize=Z.noteFontSize=Z.messageFontSize=e.fontSize),e.fontWeight&&(Z.actorFontWeight=Z.noteFontWeight=Z.messageFontWeight=e.fontWeight)},`setConf`),nt=e(function(e){return Q.activations.filter(function(t){return t.actor===e})},`actorActivations`),rt=e(function(e,t){let n=t.get(e),r=nt(e);return[r.reduce(function(e,t){return h.getMin(e,t.startx)},n.x+n.width/2-1),r.reduce(function(e,t){return h.getMax(e,t.stopx)},n.x+n.width/2+1)]},`activationBounds`);function $(e,n,r,i,a){Q.bumpVerticalPos(r);let o=i;if(n.id&&n.message&&e[n.id]){let r=e[n.id].width,a=qe(Z);n.message=S.wrapLabel(`[${n.message}]`,r-2*Z.wrapPadding,a),n.width=r,n.wrap=!0;let s=S.calculateTextDimensions(n.message,a),c=h.getMax(s.height,Z.labelBoxHeight);o=i+c,t.debug(`${c} - ${n.message}`)}a(n),Q.bumpVerticalPos(o)}e($,`adjustLoopHeightForWrap`);function it(t,n,r,i,a,o,s){function c(e,r){e.x{e.add(t.from),e.add(t.to)}),x=x.filter(t=>e.has(t))}let D=new Map(x.map((e,t)=>[g.get(e)?.name??e,t]));Qe(h,g,_,x,0,S,!1);let O=await _t(S,g,E,o);X.insertArrowHead(h,i),X.insertArrowCrossHead(h,i),X.insertArrowFilledHead(h,i),X.insertSequenceNumber(h,i),X.insertSolidTopArrowHead(h,i),X.insertSolidBottomArrowHead(h,i),X.insertStickTopArrowHead(h,i),X.insertStickBottomArrowHead(h,i),l===`neo`&&X.insertDropShadow(h,Z,i);function k(e,t){let n=Q.endActivation(e);n.starty+18>t&&(n.starty=t-6,t+=12),X.drawActivation(h,n,t,Z,nt(e.from).length,o,D),Q.insert(n.startx,t-10,n.stopx,t)}e(k,`activeEnd`);let A=1,j=1,M=[],N=[],P=0;for(let e of S){let n,r,i;switch(e.type){case o.db.LINETYPE.NOTE:Q.resetVerticalPos(),r=e.noteModel,await Ge(h,r,e.id);break;case o.db.LINETYPE.ACTIVE_START:Q.newActivation(e,h,g);break;case o.db.LINETYPE.CENTRAL_CONNECTION:Q.newActivation(e,h,g);break;case o.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Q.newActivation(e,h,g);break;case o.db.LINETYPE.ACTIVE_END:k(e,Q.getVerticalPos());break;case o.db.LINETYPE.LOOP_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.LOOP_END:n=Q.endLoop(),await X.drawLoop(h,n,`loop`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.RECT_START:$(O,e,Z.boxMargin,Z.boxMargin,e=>{let t=e.message;t||=u?.rectBkgColor||u?.actorBkg||`rgba(128, 128, 128, 0.5)`,Q.newLoop(void 0,t)});break;case o.db.LINETYPE.RECT_END:n=Q.endLoop(),N.push(n),Q.models.addLoop(n),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos());break;case o.db.LINETYPE.OPT_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.OPT_END:n=Q.endLoop(),await X.drawLoop(h,n,`opt`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.ALT_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.ALT_ELSE:$(O,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case o.db.LINETYPE.ALT_END:n=Q.endLoop(),await X.drawLoop(h,n,`alt`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.PAR_START:case o.db.LINETYPE.PAR_OVER_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e)),Q.saveVerticalPos();break;case o.db.LINETYPE.PAR_AND:$(O,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case o.db.LINETYPE.PAR_END:n=Q.endLoop(),await X.drawLoop(h,n,`par`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.AUTONUMBER:A=e.message.start||A,j=e.message.step||j,e.message.visible?o.db.enableSequenceNumbers():o.db.disableSequenceNumbers();break;case o.db.LINETYPE.CRITICAL_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.CRITICAL_OPTION:$(O,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case o.db.LINETYPE.CRITICAL_END:n=Q.endLoop(),await X.drawLoop(h,n,`critical`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.BREAK_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.BREAK_END:n=Q.endLoop(),await X.drawLoop(h,n,`break`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;default:try{i=e.msgModel,i.starty=Q.getVerticalPos(),i.sequenceIndex=A,i.sequenceVisible=o.db.showSequenceNumbers(),i.id=e.id,i.from=e.from,i.to=e.to;let t=await Xe(h,i);it(e,i,t,P,g,_,y),M.push({messageModel:i,lineStartY:t,msg:e}),Q.models.addMessage(i)}catch(e){t.error(`error while drawing message`,e)}}[o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN,o.db.LINETYPE.SOLID,o.db.LINETYPE.SOLID_TOP,o.db.LINETYPE.SOLID_BOTTOM,o.db.LINETYPE.STICK_TOP,o.db.LINETYPE.STICK_BOTTOM,o.db.LINETYPE.SOLID_TOP_DOTTED,o.db.LINETYPE.SOLID_BOTTOM_DOTTED,o.db.LINETYPE.STICK_TOP_DOTTED,o.db.LINETYPE.STICK_BOTTOM_DOTTED,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.DOTTED,o.db.LINETYPE.SOLID_CROSS,o.db.LINETYPE.DOTTED_CROSS,o.db.LINETYPE.SOLID_POINT,o.db.LINETYPE.DOTTED_POINT,o.db.LINETYPE.BIDIRECTIONAL_SOLID,o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(A=Math.round((A+j)*100)/100),P++}t.debug(`createdActors`,_),t.debug(`destroyedActors`,y),await $e(h,g,x,!1,i,o,D);for(let e of M)await Ze(h,e.messageModel,e.lineStartY,o,e.msg,i);Z.mirrorActors&&await $e(h,g,x,!0,i,o,D),N.forEach(e=>X.drawBackgroundRect(h,e)),xe(h,g,x,Z);for(let e of Q.models.boxes){e.height=Q.getVerticalPos()-e.y,Q.insert(e.x,e.y,e.x+e.width,e.height);let t=Z.boxMargin*2;e.startx=e.x-t,e.starty=e.y-t*.25,e.stopx=e.startx+e.width+2*t,e.stopy=e.starty+e.height+t*.75,e.stroke=`rgb(0,0,0, 0.5)`,X.drawBox(h,e,Z)}w&&Q.bumpVerticalPos(Z.boxMargin);let F=et(h,g,x,m),{bounds:I}=Q.getBounds();I.startx===void 0&&(I.startx=0),I.starty===void 0&&(I.starty=0),I.stopx===void 0&&(I.stopx=0),I.stopy===void 0&&(I.stopy=0);let ee=I.stopy-I.starty;ee{let n=qe(Z),r=t.actorKeys.reduce((t,n)=>t+=e.get(n).width+(e.get(n).margin||0),0),i=Z.boxMargin*8;r+=i,r-=2*Z.boxTextMargin,t.wrap&&(t.name=S.wrapLabel(t.name,r-2*Z.wrapPadding,n));let o=S.calculateTextDimensions(t.name,n);a=h.getMax(o.height,a);let s=h.getMax(r,o.width+2*Z.wrapPadding);if(t.margin=Z.boxTextMargin,re.textMaxHeight=a),h.getMax(i,Z.height)}e(ct,`calculateActorMargins`);var lt=e(async function(e,n,i){let a=n.get(e.from),o=n.get(e.to),s=a.x,c=o.x,l=e.wrap&&e.message,u=r(e.message)?await f(e.message,v()):S.calculateTextDimensions(l?S.wrapLabel(e.message,Z.width,Je(Z)):e.message,Je(Z)),d={width:l?Z.width:h.getMax(Z.width,u.width+2*Z.noteMargin),height:0,startx:a.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===i.db.PLACEMENT.RIGHTOF?(d.width=l?h.getMax(Z.width,u.width):h.getMax(a.width/2+o.width/2,u.width+2*Z.noteMargin),d.startx=s+(a.width+Z.actorMargin)/2):e.placement===i.db.PLACEMENT.LEFTOF?(d.width=l?h.getMax(Z.width,u.width+2*Z.noteMargin):h.getMax(a.width/2+o.width/2,u.width+2*Z.noteMargin),d.startx=s-d.width+(a.width-Z.actorMargin)/2):e.to===e.from?(u=S.calculateTextDimensions(l?S.wrapLabel(e.message,h.getMax(Z.width,a.width),Je(Z)):e.message,Je(Z)),d.width=l?h.getMax(Z.width,a.width):h.getMax(a.width,Z.width,u.width+2*Z.noteMargin),d.startx=s+(a.width-d.width)/2):(d.width=Math.abs(s+a.width/2-(c+o.width/2))+Z.actorMargin,d.startx=s2,p=e(e=>l?-e:e,`adjustValue`);t.from===t.to?d=u:(t.activate&&!f&&(d+=p(Z.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(d+=p(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=p(3)));let m=[a,o,s,c],g=Math.abs(u-d);t.wrap&&t.message&&(t.message=S.wrapLabel(t.message,h.getMax(g+2*Z.wrapPadding,Z.width),qe(Z)));let _=S.calculateTextDimensions(t.message,qe(Z));return{width:h.getMax(t.wrap?0:_.width+2*Z.wrapPadding,g+2*Z.wrapPadding,Z.width),height:0,startx:u,stopx:d,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,m),toBounds:Math.max.apply(null,m)}},`buildMessageModel`),_t=e(async function(e,n,r,i){let a={},o=[],s,c,l;for(let t of e){switch(t.type){case i.db.LINETYPE.LOOP_START:case i.db.LINETYPE.ALT_START:case i.db.LINETYPE.OPT_START:case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:case i.db.LINETYPE.CRITICAL_START:case i.db.LINETYPE.BREAK_START:o.push({id:t.id,msg:t.message,from:2**53-1,to:-(2**53-1),width:0});break;case i.db.LINETYPE.ALT_ELSE:case i.db.LINETYPE.PAR_AND:case i.db.LINETYPE.CRITICAL_OPTION:t.message&&(s=o.pop(),a[s.id]=s,a[t.id]=s,o.push(s));break;case i.db.LINETYPE.LOOP_END:case i.db.LINETYPE.ALT_END:case i.db.LINETYPE.OPT_END:case i.db.LINETYPE.PAR_END:case i.db.LINETYPE.CRITICAL_END:case i.db.LINETYPE.BREAK_END:s=o.pop(),a[s.id]=s;break;case i.db.LINETYPE.ACTIVE_START:{let e=n.get(t.from?t.from:t.to.actor),r=nt(t.from?t.from:t.to.actor).length,i=e.x+e.width/2+(r-1)*Z.activationWidth/2,a={startx:i,stopx:i+Z.activationWidth,actor:t.from,enabled:!0};Q.activations.push(a)}break;case i.db.LINETYPE.ACTIVE_END:{let e=Q.activations.map(e=>e.actor).lastIndexOf(t.from);Q.activations.splice(e,1).splice(0,1)}}t.placement===void 0?(l=gt(t,n,i),t.msgModel=l,l.startx&&l.stopx&&o.length>0&&o.forEach(e=>{if(s=e,l.startx===l.stopx){let e=n.get(t.from),r=n.get(t.to);s.from=h.getMin(e.x-l.width/2,e.x-e.width/2,s.from),s.to=h.getMax(r.x+l.width/2,r.x+e.width/2,s.to),s.width=h.getMax(s.width,Math.abs(s.to-s.from))-Z.labelBoxWidth}else s.from=h.getMin(l.startx,s.from),s.to=h.getMax(l.stopx,s.to),s.width=h.getMax(s.width,l.width)-Z.labelBoxWidth})):(c=await lt(t,n,i),t.noteModel=c,o.forEach(e=>{s=e,s.from=h.getMin(s.from,c.startx),s.to=h.getMax(s.to,c.startx+c.width),s.width=h.getMax(s.width,Math.abs(s.from-s.to))-Z.labelBoxWidth}))}return Q.activations=[],t.debug(`Loop type widths:`,a),a},`calculateLoopBounds`),vt={parser:F,get db(){return new ne},renderer:{bounds:Q,drawActors:$e,drawActorsPopup:et,setConf:tt,draw:at},styles:re,init:e(e=>{e.sequence||={},e.wrap&&(e.sequence.wrap=e.wrap,a({sequence:{wrap:e.wrap}}))},`init`)};export{vt as diagram}; \ No newline at end of file diff --git a/web/dist/app-stateDiagram-v2-GCMORJYK.js b/web/dist/app-stateDiagram-v2-GCMORJYK.js index 3ea3ee37c..002315249 100644 --- a/web/dist/app-stateDiagram-v2-GCMORJYK.js +++ b/web/dist/app-stateDiagram-v2-GCMORJYK.js @@ -1,9 +1,9 @@ -import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,U as a,a as o,q as s,s as c,v as l,w as u,x as d,y as f}from"./app-chunk-O7XYJQB3.js";import{g as p,s as m}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import{a as h,i as g,o as _,r as v}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import{t as y}from"./app-chunk-GWA4HPMP.js";import{t as b}from"./app-chunk-XXDRQBXY.js";import{t as x}from"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import{r as S,t as C}from"./app-chunk-GNY47TPC.js";var w=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,16],l=[1,17],u=[1,18],d=[1,19],f=[1,33],p=[1,20],m=[1,21],h=[1,22],g=[1,23],_=[1,24],v=[1,26],y=[1,27],b=[1,28],x=[1,29],S=[1,30],C=[1,31],w=[1,32],T=[1,35],E=[1,36],D=[1,37],O=[1,38],k=[1,34],A=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],j=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],M=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NL`,6:`SD`,14:`DESCR`,15:`-->`,16:`HIDE_EMPTY`,17:`scale`,18:`WIDTH`,19:`COMPOSIT_STATE`,20:`STRUCT_START`,21:`STRUCT_STOP`,22:`STATE_DESCR`,23:`AS`,24:`ID`,25:`FORK`,26:`JOIN`,27:`CHOICE`,28:`CONCURRENT`,29:`note`,31:`NOTE_TEXT`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,38:`CLICK`,39:`STRING`,40:`HREF`,41:`classDef`,42:`CLASSDEF_ID`,43:`CLASSDEF_STYLEOPTS`,44:`DEFAULT`,45:`style`,46:`STYLE_IDS`,47:`STYLEDEF_STYLEOPTS`,48:`class`,49:`CLASSENTITY_IDS`,50:`STYLECLASS`,51:`direction_tb`,52:`direction_bt`,53:`direction_rl`,54:`direction_lr`,56:`;`,57:`EDGE_STATE`,58:`STYLE_SEPARATOR`,59:`left_of`,60:`right_of`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.setRootDoc(a[s]),a[s];case 4:this.$=[];break;case 5:a[s]!=`nl`&&(a[s-1].push(a[s]),this.$=a[s-1]);break;case 6:case 7:this.$=a[s];break;case 8:this.$=`nl`;break;case 12:this.$=a[s];break;case 13:let e=a[s-1];e.description=r.trimColon(a[s]),this.$=e;break;case 14:this.$={stmt:`relation`,state1:a[s-2],state2:a[s]};break;case 15:let t=r.trimColon(a[s]);this.$={stmt:`relation`,state1:a[s-3],state2:a[s-1],description:t};break;case 19:this.$={stmt:`state`,id:a[s-3],type:`default`,description:``,doc:a[s-1]};break;case 20:var c=a[s],l=a[s-2].trim();if(a[s].match(`:`)){var u=a[s].split(`:`);c=u[0],l=[l,u[1]]}this.$={stmt:`state`,id:c,type:`default`,description:l};break;case 21:this.$={stmt:`state`,id:a[s-3],type:`default`,description:a[s-5],doc:a[s-1]};break;case 22:this.$={stmt:`state`,id:a[s],type:`fork`};break;case 23:this.$={stmt:`state`,id:a[s],type:`join`};break;case 24:this.$={stmt:`state`,id:a[s],type:`choice`};break;case 25:this.$={stmt:`state`,id:r.getDividerId(),type:`divider`};break;case 26:this.$={stmt:`state`,id:a[s-1].trim(),note:{position:a[s-2].trim(),text:a[s].trim()}};break;case 29:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:this.$={stmt:`click`,id:a[s-3],url:a[s-2],tooltip:a[s-1]};break;case 33:this.$={stmt:`click`,id:a[s-3],url:a[s-1],tooltip:``};break;case 34:case 35:this.$={stmt:`classDef`,id:a[s-1].trim(),classes:a[s].trim()};break;case 36:this.$={stmt:`style`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 37:this.$={stmt:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:r.setDirection(`TB`),this.$={stmt:`dir`,value:`TB`};break;case 39:r.setDirection(`BT`),this.$={stmt:`dir`,value:`BT`};break;case 40:r.setDirection(`RL`),this.$={stmt:`dir`,value:`RL`};break;case 41:r.setDirection(`LR`),this.$={stmt:`dir`,value:`LR`};break;case 44:case 45:this.$={stmt:`state`,id:a[s].trim(),type:`default`,description:``};break;case 46:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``};break;case 47:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``}}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},e([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,7]),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(A,[2,11]),e(A,[2,12],{14:[1,40],15:[1,41]}),e(A,[2,16]),{18:[1,42]},e(A,[2,18],{20:[1,43]}),{23:[1,44]},e(A,[2,22]),e(A,[2,23]),e(A,[2,24]),e(A,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},e(A,[2,28]),{34:[1,49]},{36:[1,50]},e(A,[2,31]),{13:51,24:f,57:k},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},e(j,[2,44],{58:[1,56]}),e(j,[2,45],{58:[1,57]}),e(A,[2,38]),e(A,[2,39]),e(A,[2,40]),e(A,[2,41]),e(A,[2,6]),e(A,[2,13]),{13:58,24:f,57:k},e(A,[2,17]),e(M,a,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},e(A,[2,29]),e(A,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},e(A,[2,14],{14:[1,71]}),{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,72],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},e(A,[2,34]),e(A,[2,35]),e(A,[2,36]),e(A,[2,37]),e(j,[2,46]),e(j,[2,47]),e(A,[2,15]),e(A,[2,19]),e(M,a,{7:78}),e(A,[2,26]),e(A,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,81],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,32]),e(A,[2,33]),e(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,U as a,a as o,q as s,s as c,v as l,w as u,x as d,y as f}from"./app-chunk-O7XYJQB3.js";import{g as p,s as m}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{a as h,i as g,o as _,r as v}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as y,t as b}from"./app-chunk-GNY47TPC.js";import{t as x}from"./app-chunk-GWA4HPMP.js";import{t as S}from"./app-chunk-XXDRQBXY.js";import{t as C}from"./app-chunk-WEXAMYUT.js";var w=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,16],l=[1,17],u=[1,18],d=[1,19],f=[1,33],p=[1,20],m=[1,21],h=[1,22],g=[1,23],_=[1,24],v=[1,26],y=[1,27],b=[1,28],x=[1,29],S=[1,30],C=[1,31],w=[1,32],T=[1,35],E=[1,36],D=[1,37],O=[1,38],k=[1,34],A=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],j=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],M=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NL`,6:`SD`,14:`DESCR`,15:`-->`,16:`HIDE_EMPTY`,17:`scale`,18:`WIDTH`,19:`COMPOSIT_STATE`,20:`STRUCT_START`,21:`STRUCT_STOP`,22:`STATE_DESCR`,23:`AS`,24:`ID`,25:`FORK`,26:`JOIN`,27:`CHOICE`,28:`CONCURRENT`,29:`note`,31:`NOTE_TEXT`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,38:`CLICK`,39:`STRING`,40:`HREF`,41:`classDef`,42:`CLASSDEF_ID`,43:`CLASSDEF_STYLEOPTS`,44:`DEFAULT`,45:`style`,46:`STYLE_IDS`,47:`STYLEDEF_STYLEOPTS`,48:`class`,49:`CLASSENTITY_IDS`,50:`STYLECLASS`,51:`direction_tb`,52:`direction_bt`,53:`direction_rl`,54:`direction_lr`,56:`;`,57:`EDGE_STATE`,58:`STYLE_SEPARATOR`,59:`left_of`,60:`right_of`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.setRootDoc(a[s]),a[s];case 4:this.$=[];break;case 5:a[s]!=`nl`&&(a[s-1].push(a[s]),this.$=a[s-1]);break;case 6:case 7:this.$=a[s];break;case 8:this.$=`nl`;break;case 12:this.$=a[s];break;case 13:let e=a[s-1];e.description=r.trimColon(a[s]),this.$=e;break;case 14:this.$={stmt:`relation`,state1:a[s-2],state2:a[s]};break;case 15:let t=r.trimColon(a[s]);this.$={stmt:`relation`,state1:a[s-3],state2:a[s-1],description:t};break;case 19:this.$={stmt:`state`,id:a[s-3],type:`default`,description:``,doc:a[s-1]};break;case 20:var c=a[s],l=a[s-2].trim();if(a[s].match(`:`)){var u=a[s].split(`:`);c=u[0],l=[l,u[1]]}this.$={stmt:`state`,id:c,type:`default`,description:l};break;case 21:this.$={stmt:`state`,id:a[s-3],type:`default`,description:a[s-5],doc:a[s-1]};break;case 22:this.$={stmt:`state`,id:a[s],type:`fork`};break;case 23:this.$={stmt:`state`,id:a[s],type:`join`};break;case 24:this.$={stmt:`state`,id:a[s],type:`choice`};break;case 25:this.$={stmt:`state`,id:r.getDividerId(),type:`divider`};break;case 26:this.$={stmt:`state`,id:a[s-1].trim(),note:{position:a[s-2].trim(),text:a[s].trim()}};break;case 29:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:this.$={stmt:`click`,id:a[s-3],url:a[s-2],tooltip:a[s-1]};break;case 33:this.$={stmt:`click`,id:a[s-3],url:a[s-1],tooltip:``};break;case 34:case 35:this.$={stmt:`classDef`,id:a[s-1].trim(),classes:a[s].trim()};break;case 36:this.$={stmt:`style`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 37:this.$={stmt:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:r.setDirection(`TB`),this.$={stmt:`dir`,value:`TB`};break;case 39:r.setDirection(`BT`),this.$={stmt:`dir`,value:`BT`};break;case 40:r.setDirection(`RL`),this.$={stmt:`dir`,value:`RL`};break;case 41:r.setDirection(`LR`),this.$={stmt:`dir`,value:`LR`};break;case 44:case 45:this.$={stmt:`state`,id:a[s].trim(),type:`default`,description:``};break;case 46:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``};break;case 47:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``}}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},e([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,7]),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(A,[2,11]),e(A,[2,12],{14:[1,40],15:[1,41]}),e(A,[2,16]),{18:[1,42]},e(A,[2,18],{20:[1,43]}),{23:[1,44]},e(A,[2,22]),e(A,[2,23]),e(A,[2,24]),e(A,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},e(A,[2,28]),{34:[1,49]},{36:[1,50]},e(A,[2,31]),{13:51,24:f,57:k},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},e(j,[2,44],{58:[1,56]}),e(j,[2,45],{58:[1,57]}),e(A,[2,38]),e(A,[2,39]),e(A,[2,40]),e(A,[2,41]),e(A,[2,6]),e(A,[2,13]),{13:58,24:f,57:k},e(A,[2,17]),e(M,a,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},e(A,[2,29]),e(A,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},e(A,[2,14],{14:[1,71]}),{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,72],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},e(A,[2,34]),e(A,[2,35]),e(A,[2,36]),e(A,[2,37]),e(j,[2,46]),e(j,[2,47]),e(A,[2,15]),e(A,[2,19]),e(M,a,{7:78}),e(A,[2,26]),e(A,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,81],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,32]),e(A,[2,33]),e(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};N.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:t(function(e,n,r,i){function a(){let t=n.yytext.indexOf(`%%`);if(t===0)return!1;if(t>0){let r=n.yytext.slice(0,t),i=n.yytext.slice(t);i&&e.lexer.unput(i),n.yytext=r}return!0}switch(t(a,`processId`),r){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState(`SCALE`),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin(`acc_title`),33;case 17:return this.popState(),`acc_title_value`;case 18:return this.begin(`acc_descr`),35;case 19:return this.popState(),`acc_descr_value`;case 20:this.begin(`acc_descr_multiline`);break;case 21:this.popState();break;case 22:return`acc_descr_multiline_value`;case 23:return this.pushState(`CLASSDEF`),41;case 24:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 25:return this.popState(),this.pushState(`CLASSDEFID`),42;case 26:return this.popState(),43;case 27:return this.pushState(`CLASS`),48;case 28:return this.popState(),this.pushState(`CLASS_STYLE`),49;case 29:return this.popState(),50;case 30:return this.pushState(`STYLE`),45;case 31:return this.popState(),this.pushState(`STYLEDEF_STYLES`),46;case 32:return this.popState(),47;case 33:return this.pushState(`SCALE`),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState(`STATE`);break;case 37:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState(`STATE_STRING`);break;case 48:return this.pushState(`STATE_ID`),`AS`;case 49:return a()?(this.popState(),`ID`):void 0;case 50:this.popState();break;case 51:return`STATE_DESCR`;case 52:throw Error(`Error: State name must be a single word. Found: "`+n.yytext.trim()+`"`);case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState(`struct`),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin(`NOTE`),29;case 59:return this.popState(),this.pushState(`NOTE_ID`),59;case 60:return this.popState(),this.pushState(`NOTE_ID`),60;case 61:this.popState(),this.pushState(`FLOATING_NOTE`);break;case 62:return this.popState(),this.pushState(`FLOATING_NOTE_ID`),`AS`;case 63:break;case 64:return`NOTE_TEXT`;case 65:return a()?(this.popState(),`ID`):void 0;case 66:return a()?(this.popState(),this.pushState(`NOTE_TEXT`),24):void 0;case 67:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;case 68:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return a()?24:void 0;case 74:return n.yytext=n.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return`INVALID`}},`anonymous`),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}})();function P(){this.yy={}}return t(P,`Parser`),P.prototype=N,N.Parser=P,new P})();w.parser=w;var T=w,E=`TB`,D=`TB`,O=`dir`,k=`state`,A=`root`,j=`relation`,M=`classDef`,N=`style`,P=`applyClass`,F=`default`,ee=`divider`,te=`fill:none`,ne=`fill: #333`,re=`c`,ie=`markdown`,ae=`normal`,I=`rect`,L=`rectWithTitle`,oe=`stateStart`,se=`stateEnd`,R=`divider`,ce=`roundedWithTitle`,le=`note`,ue=`noteGroup`,z=`statediagram`,de=`${z}-state`,B=`transition`,fe=`note`,pe=`${B} note-edge`,me=`${z}-${fe}`,he=`${z}-cluster`,ge=`${z}-cluster-alt`,V=`parent`,H=`note`,_e=`state`,U=`----`,ve=`${U}${H}`,ye=`${U}${V}`,W=new Map,G=0,be=0,K=new Map,xe=t((e,t,n,r)=>{if(e===R&&n?.id!==void 0&&K.has(n.id)){let e=K.get(n.id);return K.set(t,e),e}let i=be++,a=r?void 0:i;return K.set(t,a),a},`colorSlotFor`);function q(e=``,t=0,n=``,r=U){return`${_e}-${e}${n!==null&&n.length>0?`${r}${n}`:``}-${t}`}t(q,`stateDomId`);var Se=t((e,t,r,i,a,o,s,l)=>{n.trace(`items`,t),t.forEach(t=>{switch(t.stmt){case k:X(e,t,r,i,a,o,s,l);break;case F:X(e,t,r,i,a,o,s,l);break;case j:{X(e,t.state1,r,i,a,o,s,l),X(e,t.state2,r,i,a,o,s,l);let n=s===`neo`,u={id:`edge`+G,start:t.state1.id,end:t.state2.id,arrowhead:`normal`,arrowTypeEnd:n?`arrow_barb_neo`:`arrow_barb`,style:te,labelStyle:``,label:c.sanitizeText(t.description??``,d()),arrowheadStyle:ne,labelpos:re,labelType:ie,thickness:ae,classes:B,look:s};a.push(u),G++}}})},`setupDoc`),Ce=t((e,t=D)=>{let n=t;if(e.doc)for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`);function J(e,t,n){if(!t.id||t.id===``||t.id===``)return;t.cssClasses&&(Array.isArray(t.cssCompiledStyles)||(t.cssCompiledStyles=[]),t.cssClasses.split(` `).forEach(e=>{let r=n.get(e);r&&(t.cssCompiledStyles=[...t.cssCompiledStyles??[],...r.styles])}));let r=e.find(e=>e.id===t.id);r?Object.assign(r,t):e.push(t)}t(J,`insertOrUpdateNode`);function we(e){return e?.classes?.join(` `)??``}t(we,`getClassesFromDbInfo`);function Y(e){return e?.styles??[]}t(Y,`getStylesFromDbInfo`);var X=t((e,t,r,i,a,o,s,l)=>{let u=t.id,f=r.get(u),p=we(f),m=Y(f),h=d(),g=p.trim()!==``||m.length>0;if(n.info(`dataFetcher parsedItem`,t,f,m),u!==`root`){let r=I;t.start===!0?r=oe:t.start===!1&&(r=se),t.type!==F&&(r=t.type),W.get(u)||W.set(u,{id:u,shape:r,description:c.sanitizeText(u,h),cssClasses:`${p} ${de}`,cssStyles:m});let d=W.get(u);t.description&&(Array.isArray(d.description)?(d.shape=L,d.description.push(t.description)):d.description?.length&&d.description.length>0?(d.shape=L,d.description=d.description===u?[t.description]:[d.description,t.description]):(d.shape=I,d.description=t.description),d.description=c.sanitizeTextOrArray(d.description,h)),d.description?.length===1&&d.shape===L&&(d.shape=d.type===`group`?ce:I),!d.type&&t.doc&&(n.info(`Setting cluster for XCX`,u,Ce(t)),d.type=`group`,d.isGroup=!0,d.dir=Ce(t),d.shape=t.type===ee?R:ce,d.colorIndex=xe(d.shape,u,e,g),d.cssClasses=`${d.cssClasses} ${he} ${o?ge:``}`);let f={labelStyle:``,shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:u,dir:d.dir,domId:q(u,G),type:d.type,isGroup:d.type===`group`,colorIndex:d.colorIndex,padding:8,rx:10,ry:10,look:s,labelType:`markdown`};if(f.shape===R&&(f.label=``),e&&e.id!==`root`&&(n.trace(`Setting node `,u,` to be child of its parent `,e.id),f.parentId=e.id),f.centerLabel=!0,t.note){let e={labelStyle:``,shape:le,label:t.note.text,labelType:`markdown`,cssClasses:me,cssStyles:[],cssCompiledStyles:[],id:u+ve+`-`+G,domId:q(u,G,H),type:`node`,isGroup:!1,padding:h.flowchart?.padding,look:s,position:t.note.position},n=u+ye,r={labelStyle:``,shape:ue,label:t.note.text,cssClasses:d.cssClasses,cssStyles:[],id:u+ye,domId:q(u,G,V),type:`group`,isGroup:!0,padding:16,look:s,position:t.note.position};G++,r.id=n,e.parentId=n,J(i,r,l),J(i,e,l),J(i,f,l);let o=u,c=e.id;t.note.position===`left of`&&(o=e.id,c=u),a.push({id:o+`-`+c,start:o,end:c,arrowhead:`none`,arrowTypeEnd:``,style:te,labelStyle:``,classes:pe,pattern:`dashed`,arrowheadStyle:ne,labelpos:re,labelType:ie,thickness:ae,look:s})}else J(i,f,l)}t.doc&&(n.trace(`Adding nodes children `),Se(t,t.doc,r,i,a,!o,s,l))},`dataFetcher`),Te=t(()=>{W.clear(),G=0,be=0,K.clear()},`reset`),Ee=t((e,t=D)=>{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`),De={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing state diagram (v2)`,t);let{securityLevel:a,state:o,layout:s}=d();i.db.extract(i.db.getRootDocV2());let c=i.db.getData(),l=b(t,a);c.type=i.type,c.layoutAlgorithm=C(s),c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=d().look===`neo`?[`barbNeo`]:[`barb`],c.diagramId=t,await S(c,l);try{(typeof i.db.getLinks==`function`?i.db.getLinks():new Map).forEach((e,t)=>{let r=typeof t==`string`?t:typeof t?.id==`string`?t.id:``,i=c.nodes.find(e=>e.id===r);if(!r){n.warn(`⚠️ Invalid or missing stateId from key:`,JSON.stringify(t));return}let a=l.node()?.querySelectorAll(`g.node, g.rough-node`),o;if(a?.forEach(e=>{let t=e.textContent?.trim();(e.id===i?.domId||t===r)&&(o=e)}),!o){n.warn(`⚠️ Could not find node matching text:`,r);return}let s=o.parentNode;if(!s){n.warn(`⚠️ Node has no parent, cannot wrap:`,r);return}let u=document.createElementNS(`http://www.w3.org/2000/svg`,`a`),d=e.url.replace(/^"+|"+$/g,``);if(u.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,d),u.setAttribute(`target`,`_blank`),e.tooltip){let t=e.tooltip.replace(/^"+|"+$/g,``);u.setAttribute(`title`,t),o.setAttribute(`title`,t)}s.replaceChild(u,o),u.appendChild(o),n.info(`🔗 Wrapped node in tag for:`,r,e.url)})}catch(e){n.error(`❌ Error injecting clickable links:`,e)}p.insertTitle(l,`statediagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),x(l,8,z,o?.useMaxWidth??!0)},`draw`),getDir:Ee},Z={START_NODE:`[*]`,START_TYPE:`start`,END_NODE:`[*]`,END_TYPE:`end`,COLOR_KEYWORD:`color`,FILL_KEYWORD:`fill`,BG_FILL:`bgFill`,STYLECLASS_SEP:`,`},Oe=t(()=>new Map,`newClassesList`),Q=t(()=>({relations:[],states:new Map,documents:{}}),`newDoc`),$=t(e=>JSON.parse(JSON.stringify(e)),`clone`),ke=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Oe(),this.documents={root:Q()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=f,this.setAccTitle=a,this.getAccDescription=l,this.setAccDescription=i,this.setDiagramTitle=s,this.getDiagramTitle=u,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{t(this,`StateDB`)}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(e){this.clear(!0);for(let t of Array.isArray(e)?e:e.doc)switch(t.stmt){case k:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note);break;case j:this.addRelation(t.state1,t.state2,t.description);break;case M:this.addStyleClass(t.id.trim(),t.classes);break;case N:this.handleStyleDef(t);break;case P:this.setCssClass(t.id.trim(),t.styleClass);break;case`click`:this.addLink(t.id,t.url,t.tooltip)}let t=this.getStates(),n=d();Te(),X(void 0,this.getRootDocV2(),t,this.nodes,this.edges,!0,n.look,this.classes);for(let e of this.nodes)if(Array.isArray(e.label)){if(e.description=e.label.slice(1),e.isGroup&&e.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${e.id}]`);e.label=e.label[0]}}handleStyleDef(e){let t=e.id.trim().split(`,`),n=e.styleClass.split(`,`);for(let e of t){let t=this.getState(e);if(!t){let n=e.trim();this.addState(n),t=this.getState(n)}t&&(t.styles=n.map(e=>e.replace(/;/g,``)?.trim()))}}setRootDoc(e){n.info(`Setting root doc`,e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,t,n){if(t.stmt===j){this.docTranslator(e,t.state1,!0),this.docTranslator(e,t.state2,!1);return}if(t.stmt===k&&(t.id===Z.START_NODE?(t.id=e.id+(n?`_start`:`_end`),t.start=n):t.id=t.id.trim()),t.stmt!==A&&t.stmt!==k||!t.doc)return;let r=[],i=[];for(let e of t.doc)if(e.type===ee){let t=$(e);t.doc=$(i),r.push(t),i=[]}else i.push(e);if(r.length>0&&i.length>0){let e={stmt:k,id:m(),type:`divider`,doc:$(i)};r.push($(e)),t.doc=r}t.doc.forEach(e=>this.docTranslator(t,e,!0))}getRootDocV2(){return this.docTranslator({id:A,stmt:A},{id:A,stmt:A,doc:this.rootDoc},!0),{id:A,doc:this.rootDoc}}addState(e,t=F,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0){let u=e?.trim();if(!this.currentDocument.states.has(u))n.info(`Adding state `,u,i),this.currentDocument.states.set(u,{stmt:k,id:u,descriptions:[],type:t,doc:r,note:a,classes:[],styles:[],textStyles:[]});else{let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.doc||=r,e.type||=t}if(i&&(n.info(`Setting state description`,u,i),(Array.isArray(i)?i:[i]).forEach(e=>this.addDescription(u,e.trim()))),a){let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.note=a,e.note.text=c.sanitizeText(e.note.text,d())}o&&(n.info(`Setting state classes`,u,o),(Array.isArray(o)?o:[o]).forEach(e=>this.setCssClass(u,e.trim()))),s&&(n.info(`Setting state styles`,u,s),(Array.isArray(s)?s:[s]).forEach(e=>this.setStyle(u,e.trim()))),l&&(n.info(`Setting state styles`,u,s),(Array.isArray(l)?l:[l]).forEach(e=>this.setTextStyle(u,e.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Q()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Oe(),e||(this.links=new Map,o())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){n.info(`Documents = `,this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,t,r){this.links.set(e,{url:t,tooltip:r}),n.warn(`Adding link`,e,t,r)}getLinks(){return this.links}startIdIfNeeded(e=``){return e===Z.START_NODE?(this.startEndCount++,`${Z.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e=``,t=F){return e===Z.START_NODE?Z.START_TYPE:t}endIdIfNeeded(e=``){return e===Z.END_NODE?(this.startEndCount++,`${Z.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e=``,t=F){return e===Z.END_NODE?Z.END_TYPE:t}addRelationObjs(e,t,n=``){let r=this.startIdIfNeeded(e.id.trim()),i=this.startTypeIfNeeded(e.id.trim(),e.type),a=this.startIdIfNeeded(t.id.trim()),o=this.startTypeIfNeeded(t.id.trim(),t.type);this.addState(r,i,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(a,o,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:c.sanitizeText(n,d())})}addRelation(e,t,n){if(typeof e==`object`&&typeof t==`object`)this.addRelationObjs(e,t,n);else if(typeof e==`string`&&typeof t==`string`){let r=this.startIdIfNeeded(e.trim()),i=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(t.trim()),o=this.endTypeIfNeeded(t);this.addState(r,i),this.addState(a,o),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:n?c.sanitizeText(n,d()):void 0})}}addDescription(e,t){let n=this.currentDocument.states.get(e),r=t.startsWith(`:`)?t.replace(`:`,``).trim():t;n?.descriptions?.push(c.sanitizeText(r,d()))}cleanupLabel(e){return e.startsWith(`:`)?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,t=``){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});let n=this.classes.get(e);t&&n&&t.split(Z.STYLECLASS_SEP).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(Z.COLOR_KEYWORD).exec(e)){let e=t.replace(Z.FILL_KEYWORD,Z.BG_FILL).replace(Z.COLOR_KEYWORD,Z.FILL_KEYWORD);n.textStyles.push(e)}n.styles.push(t)})}getClasses(){return this.classes}setupToolTips(t){let n=y();r(t).select(`svg`).selectAll(`g.node, g.rough-node`).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(a===null)return;let o=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),n.html(e.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=this.getState(e);if(!n){let t=e.trim();this.addState(t),n=this.getState(t)}n?.classes?.push(t)})}setStyle(e,t){this.getState(e)?.styles?.push(t)}setTextStyle(e,t){this.getState(e)?.textStyles?.push(t)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===O)}getDirection(){return this.getDirectionStatement()?.value??E}setDirection(e){let t=this.getDirectionStatement();t?t.value=e:this.rootDoc.unshift({stmt:O,value:e})}trimColon(e){return e.startsWith(`:`)?e.slice(1).trim():e.trim()}getData(){let e=d();for(let t of this.nodes)t.wrappingWidth??=e.state?.wrappingWidth,t.isGroup||(t.minWidth??=e.state?.minNodeWidth);return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Ee(this.getRootDocV2())}}getConfig(){return d().state}},Ae=t(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!g(t,r))return``;let i=_(e.look),a=v(n),o=``;for(let e=0;e0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:t(function(e,n,r,i){function a(){let t=n.yytext.indexOf(`%%`);if(t===0)return!1;if(t>0){let r=n.yytext.slice(0,t),i=n.yytext.slice(t);i&&e.lexer.unput(i),n.yytext=r}return!0}switch(t(a,`processId`),r){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState(`SCALE`),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin(`acc_title`),33;case 17:return this.popState(),`acc_title_value`;case 18:return this.begin(`acc_descr`),35;case 19:return this.popState(),`acc_descr_value`;case 20:this.begin(`acc_descr_multiline`);break;case 21:this.popState();break;case 22:return`acc_descr_multiline_value`;case 23:return this.pushState(`CLASSDEF`),41;case 24:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 25:return this.popState(),this.pushState(`CLASSDEFID`),42;case 26:return this.popState(),43;case 27:return this.pushState(`CLASS`),48;case 28:return this.popState(),this.pushState(`CLASS_STYLE`),49;case 29:return this.popState(),50;case 30:return this.pushState(`STYLE`),45;case 31:return this.popState(),this.pushState(`STYLEDEF_STYLES`),46;case 32:return this.popState(),47;case 33:return this.pushState(`SCALE`),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState(`STATE`);break;case 37:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState(`STATE_STRING`);break;case 48:return this.pushState(`STATE_ID`),`AS`;case 49:return a()?(this.popState(),`ID`):void 0;case 50:this.popState();break;case 51:return`STATE_DESCR`;case 52:throw Error(`Error: State name must be a single word. Found: "`+n.yytext.trim()+`"`);case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState(`struct`),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin(`NOTE`),29;case 59:return this.popState(),this.pushState(`NOTE_ID`),59;case 60:return this.popState(),this.pushState(`NOTE_ID`),60;case 61:this.popState(),this.pushState(`FLOATING_NOTE`);break;case 62:return this.popState(),this.pushState(`FLOATING_NOTE_ID`),`AS`;case 63:break;case 64:return`NOTE_TEXT`;case 65:return a()?(this.popState(),`ID`):void 0;case 66:return a()?(this.popState(),this.pushState(`NOTE_TEXT`),24):void 0;case 67:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;case 68:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return a()?24:void 0;case 74:return n.yytext=n.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return`INVALID`}},`anonymous`),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}})();function P(){this.yy={}}return t(P,`Parser`),P.prototype=N,N.Parser=P,new P})();w.parser=w;var T=w,E=`TB`,D=`TB`,O=`dir`,k=`state`,A=`root`,j=`relation`,M=`classDef`,N=`style`,P=`applyClass`,F=`default`,ee=`divider`,te=`fill:none`,ne=`fill: #333`,re=`c`,ie=`markdown`,ae=`normal`,I=`rect`,L=`rectWithTitle`,oe=`stateStart`,se=`stateEnd`,R=`divider`,ce=`roundedWithTitle`,le=`note`,ue=`noteGroup`,z=`statediagram`,de=`${z}-state`,B=`transition`,fe=`note`,pe=`${B} note-edge`,me=`${z}-${fe}`,he=`${z}-cluster`,ge=`${z}-cluster-alt`,V=`parent`,H=`note`,_e=`state`,U=`----`,ve=`${U}${H}`,ye=`${U}${V}`,W=new Map,G=0,be=0,K=new Map,xe=t((e,t,n,r)=>{if(e===R&&n?.id!==void 0&&K.has(n.id)){let e=K.get(n.id);return K.set(t,e),e}let i=be++,a=r?void 0:i;return K.set(t,a),a},`colorSlotFor`);function q(e=``,t=0,n=``,r=U){return`${_e}-${e}${n!==null&&n.length>0?`${r}${n}`:``}-${t}`}t(q,`stateDomId`);var Se=t((e,t,r,i,a,o,s,l)=>{n.trace(`items`,t),t.forEach(t=>{switch(t.stmt){case k:X(e,t,r,i,a,o,s,l);break;case F:X(e,t,r,i,a,o,s,l);break;case j:{X(e,t.state1,r,i,a,o,s,l),X(e,t.state2,r,i,a,o,s,l);let n=s===`neo`,u={id:`edge`+G,start:t.state1.id,end:t.state2.id,arrowhead:`normal`,arrowTypeEnd:n?`arrow_barb_neo`:`arrow_barb`,style:te,labelStyle:``,label:c.sanitizeText(t.description??``,d()),arrowheadStyle:ne,labelpos:re,labelType:ie,thickness:ae,classes:B,look:s};a.push(u),G++}}})},`setupDoc`),Ce=t((e,t=D)=>{let n=t;if(e.doc)for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`);function J(e,t,n){if(!t.id||t.id===``||t.id===``)return;t.cssClasses&&(Array.isArray(t.cssCompiledStyles)||(t.cssCompiledStyles=[]),t.cssClasses.split(` `).forEach(e=>{let r=n.get(e);r&&(t.cssCompiledStyles=[...t.cssCompiledStyles??[],...r.styles])}));let r=e.find(e=>e.id===t.id);r?Object.assign(r,t):e.push(t)}t(J,`insertOrUpdateNode`);function we(e){return e?.classes?.join(` `)??``}t(we,`getClassesFromDbInfo`);function Y(e){return e?.styles??[]}t(Y,`getStylesFromDbInfo`);var X=t((e,t,r,i,a,o,s,l)=>{let u=t.id,f=r.get(u),p=we(f),m=Y(f),h=d(),g=p.trim()!==``||m.length>0;if(n.info(`dataFetcher parsedItem`,t,f,m),u!==`root`){let r=I;t.start===!0?r=oe:t.start===!1&&(r=se),t.type!==F&&(r=t.type),W.get(u)||W.set(u,{id:u,shape:r,description:c.sanitizeText(u,h),cssClasses:`${p} ${de}`,cssStyles:m});let d=W.get(u);t.description&&(Array.isArray(d.description)?(d.shape=L,d.description.push(t.description)):d.description?.length&&d.description.length>0?(d.shape=L,d.description=d.description===u?[t.description]:[d.description,t.description]):(d.shape=I,d.description=t.description),d.description=c.sanitizeTextOrArray(d.description,h)),d.description?.length===1&&d.shape===L&&(d.shape=d.type===`group`?ce:I),!d.type&&t.doc&&(n.info(`Setting cluster for XCX`,u,Ce(t)),d.type=`group`,d.isGroup=!0,d.dir=Ce(t),d.shape=t.type===ee?R:ce,d.colorIndex=xe(d.shape,u,e,g),d.cssClasses=`${d.cssClasses} ${he} ${o?ge:``}`);let f={labelStyle:``,shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:u,dir:d.dir,domId:q(u,G),type:d.type,isGroup:d.type===`group`,colorIndex:d.colorIndex,padding:8,rx:10,ry:10,look:s,labelType:`markdown`};if(f.shape===R&&(f.label=``),e&&e.id!==`root`&&(n.trace(`Setting node `,u,` to be child of its parent `,e.id),f.parentId=e.id),f.centerLabel=!0,t.note){let e={labelStyle:``,shape:le,label:t.note.text,labelType:`markdown`,cssClasses:me,cssStyles:[],cssCompiledStyles:[],id:u+ve+`-`+G,domId:q(u,G,H),type:`node`,isGroup:!1,padding:h.flowchart?.padding,look:s,position:t.note.position},n=u+ye,r={labelStyle:``,shape:ue,label:t.note.text,cssClasses:d.cssClasses,cssStyles:[],id:u+ye,domId:q(u,G,V),type:`group`,isGroup:!0,padding:16,look:s,position:t.note.position};G++,r.id=n,e.parentId=n,J(i,r,l),J(i,e,l),J(i,f,l);let o=u,c=e.id;t.note.position===`left of`&&(o=e.id,c=u),a.push({id:o+`-`+c,start:o,end:c,arrowhead:`none`,arrowTypeEnd:``,style:te,labelStyle:``,classes:pe,pattern:`dashed`,arrowheadStyle:ne,labelpos:re,labelType:ie,thickness:ae,look:s})}else J(i,f,l)}t.doc&&(n.trace(`Adding nodes children `),Se(t,t.doc,r,i,a,!o,s,l))},`dataFetcher`),Te=t(()=>{W.clear(),G=0,be=0,K.clear()},`reset`),Ee=t((e,t=D)=>{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`),De={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing state diagram (v2)`,t);let{securityLevel:a,state:o,layout:s}=d();i.db.extract(i.db.getRootDocV2());let c=i.db.getData(),l=S(t,a);c.type=i.type,c.layoutAlgorithm=b(s),c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=d().look===`neo`?[`barbNeo`]:[`barb`],c.diagramId=t,await y(c,l);try{(typeof i.db.getLinks==`function`?i.db.getLinks():new Map).forEach((e,t)=>{let r=typeof t==`string`?t:typeof t?.id==`string`?t.id:``,i=c.nodes.find(e=>e.id===r);if(!r){n.warn(`⚠️ Invalid or missing stateId from key:`,JSON.stringify(t));return}let a=l.node()?.querySelectorAll(`g.node, g.rough-node`),o;if(a?.forEach(e=>{let t=e.textContent?.trim();(e.id===i?.domId||t===r)&&(o=e)}),!o){n.warn(`⚠️ Could not find node matching text:`,r);return}let s=o.parentNode;if(!s){n.warn(`⚠️ Node has no parent, cannot wrap:`,r);return}let u=document.createElementNS(`http://www.w3.org/2000/svg`,`a`),d=e.url.replace(/^"+|"+$/g,``);if(u.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,d),u.setAttribute(`target`,`_blank`),e.tooltip){let t=e.tooltip.replace(/^"+|"+$/g,``);u.setAttribute(`title`,t),o.setAttribute(`title`,t)}s.replaceChild(u,o),u.appendChild(o),n.info(`🔗 Wrapped node in tag for:`,r,e.url)})}catch(e){n.error(`❌ Error injecting clickable links:`,e)}p.insertTitle(l,`statediagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),C(l,8,z,o?.useMaxWidth??!0)},`draw`),getDir:Ee},Z={START_NODE:`[*]`,START_TYPE:`start`,END_NODE:`[*]`,END_TYPE:`end`,COLOR_KEYWORD:`color`,FILL_KEYWORD:`fill`,BG_FILL:`bgFill`,STYLECLASS_SEP:`,`},Oe=t(()=>new Map,`newClassesList`),Q=t(()=>({relations:[],states:new Map,documents:{}}),`newDoc`),$=t(e=>JSON.parse(JSON.stringify(e)),`clone`),ke=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Oe(),this.documents={root:Q()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=f,this.setAccTitle=a,this.getAccDescription=l,this.setAccDescription=i,this.setDiagramTitle=s,this.getDiagramTitle=u,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{t(this,`StateDB`)}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(e){this.clear(!0);for(let t of Array.isArray(e)?e:e.doc)switch(t.stmt){case k:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note);break;case j:this.addRelation(t.state1,t.state2,t.description);break;case M:this.addStyleClass(t.id.trim(),t.classes);break;case N:this.handleStyleDef(t);break;case P:this.setCssClass(t.id.trim(),t.styleClass);break;case`click`:this.addLink(t.id,t.url,t.tooltip)}let t=this.getStates(),n=d();Te(),X(void 0,this.getRootDocV2(),t,this.nodes,this.edges,!0,n.look,this.classes);for(let e of this.nodes)if(Array.isArray(e.label)){if(e.description=e.label.slice(1),e.isGroup&&e.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${e.id}]`);e.label=e.label[0]}}handleStyleDef(e){let t=e.id.trim().split(`,`),n=e.styleClass.split(`,`);for(let e of t){let t=this.getState(e);if(!t){let n=e.trim();this.addState(n),t=this.getState(n)}t&&(t.styles=n.map(e=>e.replace(/;/g,``)?.trim()))}}setRootDoc(e){n.info(`Setting root doc`,e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,t,n){if(t.stmt===j){this.docTranslator(e,t.state1,!0),this.docTranslator(e,t.state2,!1);return}if(t.stmt===k&&(t.id===Z.START_NODE?(t.id=e.id+(n?`_start`:`_end`),t.start=n):t.id=t.id.trim()),t.stmt!==A&&t.stmt!==k||!t.doc)return;let r=[],i=[];for(let e of t.doc)if(e.type===ee){let t=$(e);t.doc=$(i),r.push(t),i=[]}else i.push(e);if(r.length>0&&i.length>0){let e={stmt:k,id:m(),type:`divider`,doc:$(i)};r.push($(e)),t.doc=r}t.doc.forEach(e=>this.docTranslator(t,e,!0))}getRootDocV2(){return this.docTranslator({id:A,stmt:A},{id:A,stmt:A,doc:this.rootDoc},!0),{id:A,doc:this.rootDoc}}addState(e,t=F,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0){let u=e?.trim();if(!this.currentDocument.states.has(u))n.info(`Adding state `,u,i),this.currentDocument.states.set(u,{stmt:k,id:u,descriptions:[],type:t,doc:r,note:a,classes:[],styles:[],textStyles:[]});else{let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.doc||=r,e.type||=t}if(i&&(n.info(`Setting state description`,u,i),(Array.isArray(i)?i:[i]).forEach(e=>this.addDescription(u,e.trim()))),a){let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.note=a,e.note.text=c.sanitizeText(e.note.text,d())}o&&(n.info(`Setting state classes`,u,o),(Array.isArray(o)?o:[o]).forEach(e=>this.setCssClass(u,e.trim()))),s&&(n.info(`Setting state styles`,u,s),(Array.isArray(s)?s:[s]).forEach(e=>this.setStyle(u,e.trim()))),l&&(n.info(`Setting state styles`,u,s),(Array.isArray(l)?l:[l]).forEach(e=>this.setTextStyle(u,e.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Q()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Oe(),e||(this.links=new Map,o())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){n.info(`Documents = `,this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,t,r){this.links.set(e,{url:t,tooltip:r}),n.warn(`Adding link`,e,t,r)}getLinks(){return this.links}startIdIfNeeded(e=``){return e===Z.START_NODE?(this.startEndCount++,`${Z.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e=``,t=F){return e===Z.START_NODE?Z.START_TYPE:t}endIdIfNeeded(e=``){return e===Z.END_NODE?(this.startEndCount++,`${Z.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e=``,t=F){return e===Z.END_NODE?Z.END_TYPE:t}addRelationObjs(e,t,n=``){let r=this.startIdIfNeeded(e.id.trim()),i=this.startTypeIfNeeded(e.id.trim(),e.type),a=this.startIdIfNeeded(t.id.trim()),o=this.startTypeIfNeeded(t.id.trim(),t.type);this.addState(r,i,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(a,o,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:c.sanitizeText(n,d())})}addRelation(e,t,n){if(typeof e==`object`&&typeof t==`object`)this.addRelationObjs(e,t,n);else if(typeof e==`string`&&typeof t==`string`){let r=this.startIdIfNeeded(e.trim()),i=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(t.trim()),o=this.endTypeIfNeeded(t);this.addState(r,i),this.addState(a,o),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:n?c.sanitizeText(n,d()):void 0})}}addDescription(e,t){let n=this.currentDocument.states.get(e),r=t.startsWith(`:`)?t.replace(`:`,``).trim():t;n?.descriptions?.push(c.sanitizeText(r,d()))}cleanupLabel(e){return e.startsWith(`:`)?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,t=``){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});let n=this.classes.get(e);t&&n&&t.split(Z.STYLECLASS_SEP).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(Z.COLOR_KEYWORD).exec(e)){let e=t.replace(Z.FILL_KEYWORD,Z.BG_FILL).replace(Z.COLOR_KEYWORD,Z.FILL_KEYWORD);n.textStyles.push(e)}n.styles.push(t)})}getClasses(){return this.classes}setupToolTips(t){let n=x();r(t).select(`svg`).selectAll(`g.node, g.rough-node`).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(a===null)return;let o=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),n.html(e.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=this.getState(e);if(!n){let t=e.trim();this.addState(t),n=this.getState(t)}n?.classes?.push(t)})}setStyle(e,t){this.getState(e)?.styles?.push(t)}setTextStyle(e,t){this.getState(e)?.textStyles?.push(t)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===O)}getDirection(){return this.getDirectionStatement()?.value??E}setDirection(e){let t=this.getDirectionStatement();t?t.value=e:this.rootDoc.unshift({stmt:O,value:e})}trimColon(e){return e.startsWith(`:`)?e.slice(1).trim():e.trim()}getData(){let e=d();for(let t of this.nodes)t.wrappingWidth??=e.state?.wrappingWidth,t.isGroup||(t.minWidth??=e.state?.minNodeWidth);return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Ee(this.getRootDocV2())}}getConfig(){return d().state}},Ae=t(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!g(t,r))return``;let i=_(e.look),a=v(n),o=``;for(let e=0;eArray.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));r(t.groups.edgePaths,a,{enabled:!0,jumpRadius:6,jumpStyle:i})}e(i,`applySwimlaneLineJumps`);var a=`__swimlane_default__`,o=21,s=20;function c(e){return Math.max(e.padding??s,s)}e(c,`topLaneHorizontalPadding`);function l(e){let{x:t,y:n,width:r,height:i}=e,a=e.swimlaneContentTop;if(typeof t!=`number`||typeof n!=`number`||typeof r!=`number`||typeof i!=`number`||typeof a!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a)||r<=0||i<=0){delete e.groupTitleRect;return}let s=n-i/2,c=Math.min(a,n+i/2),l=s+Math.min(o,Math.max(0,c-s));if(l<=s){delete e.groupTitleRect;return}e.groupTitleRect={left:t-r/2,right:t+r/2,top:s,bottom:l}}e(l,`assignTopLaneTitleRect`);function u(e){let t=e.direction,n=e.nodes??=[];for(let n of e.nodes??[])n.isGroup&&!n.parentId&&(n.shape=`swimlane`,t&&(n.direction=t));let r=n.filter(e=>!e.isGroup&&!e.parentId);if(r.length===0)return;let i=n.find(e=>e.id===a);i?i.isGroup&&(i.shape=`swimlane`,t&&(i.direction=t)):(i={id:a,label:``,isGroup:!0,shape:`swimlane`,padding:20,look:e.config?.look,colorIndex:n.reduce((e,t)=>Math.max(e,t.colorIndex??-1),-1)+1,...t?{direction:t}:{}},n.push(i));for(let e of r)e.parentId=a}e(u,`prepareLayoutForSwimlanes`);function d(e){let t=new Map;for(let n of e.nodes??[])t.set(n.id,n);let n=[];for(let t of e.edges??[]){let e=typeof t.start==`string`?t.start:void 0,r=typeof t.end==`string`?t.end:void 0;!e||!r||t.labelNodeId||n.push({id:t.id,src:e,dst:r,ref:t})}let r=e.nodes??[],i=r.filter(e=>e.isGroup),a=r.filter(e=>!e.isGroup);return{nodes:[...[...i].reverse(),...a].map(e=>e.id),edges:n,layout:e,nodeById:t}}e(d,`toGraphView`);function f(e,t,n,r){let{layout:i}=e,a=e.nodeById,o=r?.layerGap??100,s=r?.nodeGap??40,u=0;for(let e of t.layers){let t=0;for(let r of e){let e=a.get(r);if(!e){t++;continue}e.layer=u,e.order=t;let i=n.x[r]??t*s,c=n.y[r]??u*o;e.x=i,e.y=c,t++}u++}let d=i.nodes??[],f=new Map,p=[];for(let e of d){if(!e?.isGroup)continue;e.parentId||p.push(e);let t=d.filter(t=>t.parentId===e.id),r=1/0,i=-1/0,a=1/0,o=-1/0;for(let e of t){let t=e.x??n.x[e.id],s=e.y??n.y[e.id],c=e.width??0,l=e.height??0;t!=null&&s!=null&&(r=Math.min(r,t-c/2),i=Math.max(i,t+c/2),a=Math.min(a,s-l/2),o=Math.max(o,s+l/2))}if(r===1/0||a===1/0)e.x=e.x??0,e.y=e.y??0,e.width=e.width??0,e.height=e.height??0;else{let t=e.padding??20,n=e.parentId?t:2*c(e),s=t,l=Math.max(0,i-r)+n,u=Math.max(0,o-a)+s,d=(r+i)/2,p=(a+o)/2;e.x=d,e.y=p,e.width=l,e.height=u,f.set(e.id,{minX:r,maxX:i,minY:a,maxY:o})}}if(p.length>0&&f.size>0){let e=1/0,t=-1/0,n=0;for(let r of p){let i=r.padding??20;i>n&&(n=i);let a=f.get(r.id);a&&(e=Math.min(e,a.minY),t=Math.max(t,a.maxY))}if(e!==1/0&&t!==-1/0){let r=Math.max(0,t-e)+2*Math.max(n,36),i=(e+t)/2;for(let t of p)t.y=i,t.height=r,t.swimlaneContentTop=e;let a=[...p].sort((e,t)=>(e.x??0)-(t.x??0)),o=[],s=[],u=[];for(let e of a){let t=f.get(e.id);if(!t)continue;let n=Math.max(0,t.maxX-t.minX)+2*c(e),r=(t.minX+t.maxX)/2;o.push(e.id),s.push(r),u.push(n)}let d=o.length;if(d>0){let e=new Map;if(d===1)e.set(o[0],u[0]);else{let t=[];for(let e=0;e0&&i>0?{cx:t,cy:n,rect:P(t,n,r,i)}:void 0}e(g,`measuredNodeRect`);function _(e){if(e.isGroup)return;let t=g(e);if(t)return{id:String(e.id??``),cx:t.cx,cy:t.cy,rect:t.rect}}e(_,`nodeBoundsInfoFor`);function v(e,t,n=h){return Math.abs(e.x-t.x)n}e(x,`isHorizontalSegment`);function S(e,t,n=h){return y(e,t,n)&&Math.abs(e.y-t.y)>n}e(S,`isVerticalSegment`);function C(e,t,n,r){return Math.max(0,Math.min(Math.max(e,t),Math.max(n,r))-Math.max(Math.min(e,t),Math.min(n,r)))}e(C,`overlapLength`);function w(e,t,n=h){return e.horizontal&&t.horizontal&&b(e.a,t.a,n)?C(e.a.x,e.b.x,t.a.x,t.b.x):e.vertical&&t.vertical&&y(e.a,t.a,n)?C(e.a.y,e.b.y,t.a.y,t.b.y):0}e(w,`sameAxisSegmentOverlapLength`);function T(e,t=h){let n=[];for(let r=0;r0?n[n.length-1]:void 0;(!e||!v(e,r,t))&&n.push({x:r.x,y:r.y})}return n}e(D,`dedupeConsecutivePoints`);function O(e,t=h){if(!e||e.length!==4)return;let[n,r,i,a]=e;return x(n,r,t)&&S(r,i,t)&&x(i,a,t)?{kind:`HVH`,p0:n,p1:r,p2:i,p3:a}:S(n,r,t)&&x(r,i,t)&&S(i,a,t)?{kind:`VHV`,p0:n,p1:r,p2:i,p3:a}:void 0}e(O,`classifyThreeSegmentRoute`);function k(e,t,n,r=0){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return a>n.left-r&&in.top-r&&ot.left+n&&e.xt.top+n&&e.y=t.right&&e.top<=t.top&&e.bottom>=t.bottom}e(j,`rectContainsRect`);function M(e,t){return e.leftt.left&&e.topt.top}e(M,`rectsOverlap`);function N(e,t){return{left:e.left-t,right:e.right+t,top:e.top-t,bottom:e.bottom+t}}e(N,`inflateRect`);function P(e,t,n,r){return{left:e-n/2,right:e+n/2,top:t-r/2,bottom:t+r/2}}e(P,`rectFromCenterSize`);function F(e){return g(e)?.rect}e(F,`rectOfNodeBounds`);function I(e,t){switch(t){case`top`:return{x:e.cx,y:e.rect.top};case`bottom`:return{x:e.cx,y:e.rect.bottom};case`left`:return{x:e.rect.left,y:e.cy};case`right`:return{x:e.rect.right,y:e.cy}}}e(I,`portForRectSide`);function ee(e,t,n,r,i,a=h){let o=t===`left`||t===`right`,s=r===`left`||r===`right`;if(o&&s){if(t===`right`&&r===`left`&&e.xn.x){if(b(e,n,a))return[e,n];let t=(e.x+n.x)/2;return[e,{x:t,y:e.y},{x:t,y:n.y},n]}if(t===r){if(b(e,n,a))return;let r=t===`left`?Math.min(e.x,n.x)-i:Math.max(e.x,n.x)+i;return[e,{x:r,y:e.y},{x:r,y:n.y},n]}return}if(!o&&!s){if(t===r){if(y(e,n,a))return;let r=t===`top`?Math.min(e.y,n.y)-i:Math.max(e.y,n.y)+i;return[e,{x:e.x,y:r},{x:n.x,y:r},n]}if(!(t===`bottom`&&r===`top`&&e.yn.y))return;if(y(e,n,a))return[e,n];let o=(e.y+n.y)/2;return[e,{x:e.x,y:o},{x:n.x,y:o},n]}if(o&&!s){let i=t===`right`&&n.x>e.x||t===`left`&&n.xn.y;return i&&a?[e,{x:n.x,y:e.y},n]:void 0}let c=t===`bottom`&&n.y>e.y||t===`top`&&n.yn.x;return c&&l?[e,{x:e.x,y:n.y},n]:void 0}e(ee,`buildOrthogonalPortPath`);function L(e,t,n,r){return t===`left`||t===`right`?[e,{x:r,y:e.y},{x:r,y:n.y},n]:[e,{x:e.x,y:r},{x:n.x,y:r},n]}e(L,`buildSameSideTrackPath`);function R(e){let t=new Map,n=[];for(let r of e){if(r.isEdgeLabel)continue;let e=_(r);e&&(t.set(e.id,e),n.push({id:e.id,rect:e.rect}))}return{nodeInfoById:t,realNodeRects:n}}e(R,`collectRealNodeBounds`);function z(e){let t=[],n=[];for(let r of e){let e=_(r);if(!e)continue;let i={id:e.id,rect:e.rect};r.isEdgeLabel?n.push(i):t.push(i)}return{realNodeRects:t,labelNodeRects:n}}e(z,`collectNodeRectEntries`);function te(e,{includeEdgeLabels:t=!0}={}){let n=[];for(let r of e){if(r.isGroup||!t&&r.isEdgeLabel)continue;let e=r.x??0,i=r.y??0,a=r.width??0,o=r.height??0;n.push({nodeId:r.id,...P(e,i,a,o)})}return n}e(te,`collectLayoutNodeRects`);function ne(e,t,n=h){let r=e.start,i=e.end;if(!r||!i)return;let a=t.get(r),o=t.get(i);if(!(!a||!o))return{srcId:r,dstId:i,srcInfo:a,dstInfo:o,collinearX:Math.abs(a.cx-o.cx)m||f<_||f>v)return!1;let x=Math.abs(g-u.a.x)i:a&&s&&b(e,n,i)?C(e.x,t.x,n.x,r.x)>i:!1}e(ie,`sameAxisSegmentsOverlap`);function ae(e,t,n,r,{epsilon:i=h,skipDegenerateOther:a=!1}={}){for(let o of n){if(o===r||o.isLayoutOnly)continue;let n=o.points;if(!(!n||n.length<2))for(let r=0;rf+i&&mg+i&&d<_-i}e(V,`orthogonalSegmentsStrictlyCross`);function oe(e,t,n){let r=Math.min(t,n),i=Math.max(t,n);return e>r+h&&e=2?t[t.length-2]:void 0,n=e&&y(e,r)?{x:r.x,y:i.y}:{x:i.x,y:r.y};t.push(n)}t.push(i)}let n=[];for(let e of t){let t=n[n.length-1];(!t||!v(t,e))&&n.push(e)}return n}e(W,`orthogonalizePolyline`);function G(e){if(e.length<3)return e;let t=[...e];for(let e=0;e<32;e++){let e=U(t);if(t=e.points,!e.changed)break}return t}e(G,`simplifyPolyline`);var K=.001,se=.5,ce=4;function le(e,t,n){let r=e;if(r.isLayoutOnly||!r.points||r.points.length=0&&i=e.length)return e;let a=i-r;if(a<0||a>=e.length)return e;let o=ue(e[i],e[a],t);return n?[o,...e.slice(i)]:[...e.slice(0,i+1),o]}e(de,`clipEndpoint`);function q(e,t){for(let n of e){let e=le(n,t,2);if(!e)continue;let r=[...e.points];e.srcRect&&(r=de(r,e.srcRect,!0)),e.dstRect&&(r=de(r,e.dstRect,!1)),r=G(W(r)),r=xe(r,e.srcRect,e.dstRect),e.edge.points=G(W(r))}}e(q,`clipEdgeEndpointsToNodeBoundaries`);function J(e,t,n,r=!1){if(b(e,t,K)){if(t.yn.bottom+K)return t;if(r){if(e.xn.right+K)return{x:n.right,y:e.y}}return{x:Math.abs(t.x-n.left)<=Math.abs(t.x-n.right)?n.left:n.right,y:e.y}}if(y(e,t,K)){if(t.xn.right+K)return t;if(r){if(e.yn.bottom+K)return{x:e.x,y:n.bottom}}let i=Math.abs(t.y-n.top)<=Math.abs(t.y-n.bottom);return{x:e.x,y:i?n.top:n.bottom}}return t}e(J,`snapEndpointToBoundary`);function fe(e,t,n){let r=e[t];for(let i=t+n;i>=0&&ie.lo)),n=Math.min(...e.map(e=>e.hi));if(!(t>n))return{lo:t,hi:n}}e(he,`intersectRanges`);function ge(e,t){return t===`left`||t===`right`?pe(e.top,e.bottom):pe(e.left,e.right)}e(ge,`clearanceRangeForSide`);function _e(e,t,n){let r=e.y>=n.top-K&&e.y<=n.bottom+K,i=e.x>=n.left-K&&e.x<=n.right+K;if(b(e,t,K)&&r){if(Math.abs(e.x-n.left)0?he(a):void 0}e(ye,`straightClearanceRange`);function be(e,t,n,r,i){let a=ye(e,t,n,r,i);if(!a)return;let o=i?e.y:e.x,s=Math.min(a.hi,Math.max(a.lo,o));if(!(Math.abs(s-o)({...e}));for(let s=t;s>=0&&s=n.left-K&&Math.max(e.x,t.x)<=n.right+K,i=Math.min(e.y,t.y)>=n.top-K&&Math.max(e.y,t.y)<=n.bottom+K;if(Math.abs(e.y-n.top)r.bottom+K;case`left`:return b(t,n,K)&&n.xr.right+K}}e(Ee,`leavesOutward`);function De(e,t,n){if(e.length<3)return e;if(n){let n=Te(e[0],e[1],t);return n&&Ee(n,e[1],e[2],t)?e.slice(1):e}let r=e.length-1,i=Te(e[r-1],e[r],t);return i&&Ee(i,e[r-1],e[r-2],t)?e.slice(0,r):e}e(De,`collapseOwnBorderStub`);function Oe(e,t,n){let r=e;if(t){let e=fe(r,0,1);if(e){let n=J(e,r[0],t);n!==r[0]&&(r=[n,...r.slice(1)])}r=De(r,t,!0)}if(n){let e=r.length-1,t=fe(r,e,-1);if(t){let i=J(t,r[e],n,!0);i!==r[e]&&(r=[...r.slice(0,e),i])}r=De(r,n,!1)}let i=xe(r,t,n);return i!==r||r.length===2?i:(t&&(r=we(r,t,!0)),n&&(r=we(r,n,!1)),r)}e(Oe,`snapAndCollapseEndpoints`);function ke(e,t){for(let n of e){let e=le(n,t,2);if(!e)continue;let r=Oe(D(e.points,K),e.srcRect,e.dstRect);if(r.length<3){e.edge.points=r;continue}let i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];e.edge.points=i}}e(ke,`prepareEdgeEndpointsForRenderer`);function Ae(e){return new Map(e.map(e=>[e.id,e]))}e(Ae,`buildNodeMap`);function je(e,t){let n=e.parentId,r=null;for(;n;){let e=t.get(n);if(!e?.isGroup)break;r=e.id,n=e.parentId}return r}e(je,`resolveTopLevelGroupId`);function Me(e,t){let n=0,r=e.parentId;for(;r;){let e=t.get(r);if(!e?.isGroup)break;n++,r=e.parentId}return n}e(Me,`groupDepth`);function Ne(e){let t=1/0,n=-1/0,r=1/0,i=-1/0;for(let a of e){let e=a.x,o=a.y;if(typeof e!=`number`||typeof o!=`number`)continue;let s=a.width??0,c=a.height??0;t=Math.min(t,e-s/2),n=Math.max(n,e+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}return t===1/0||r===1/0?null:{minX:t,maxX:n,minY:r,maxY:i}}e(Ne,`boundsForChildren`);function Pe(e,t){let n=e.padding??20;e.x=(t.minX+t.maxX)/2,e.y=(t.minY+t.maxY)/2,e.width=Math.max(0,t.maxX-t.minX)+n,e.height=Math.max(0,t.maxY-t.minY)+n}e(Pe,`applyGroupBounds`);function Fe(e){let t=Ae(e),n=e.filter(e=>e.isGroup&&e.parentId).sort((e,n)=>Me(n,t)-Me(e,t));for(let t of n){let n=Ne(e.filter(e=>e.parentId===t.id));n&&Pe(t,n)}}e(Fe,`recomputeNestedGroupBounds`);function Ie(t,n){let r=t.nodes??[],i=t.edges??[],a=r.filter(e=>!e.isGroup),o=1/0,s=-1/0;for(let e of a){let t=e[n];typeof t==`number`&&(o=Math.min(o,t),s=Math.max(s,t))}if(!Number.isFinite(o)||!Number.isFinite(s))return!1;let c=e(e=>o+s-e,`mirror`);for(let e of r){let t=e[n];typeof t==`number`&&(e[n]=c(t));let r=e.groupTitleRect;r&&(e.groupTitleRect=n===`x`?{...r,left:c(r.right),right:c(r.left)}:{...r,top:c(r.bottom),bottom:c(r.top)})}for(let e of i)for(let t of e.points??[])t[n]=c(t[n]);return!0}e(Ie,`mirrorAxis`);function Le(e){return!(e.nodes??[]).some(e=>!e.isGroup)||Ie(e,`y`)}e(Le,`applyBtDirectionTransform`);function Re(e,t=`LR`){let n=e.nodes??[],r=e.edges??[],i=n.filter(e=>!e.isGroup),a=1/0,o=1/0;for(let e of i){let t=e.x??0,n=e.y??0;t0?Math.max(1,l/u):1;for(let e of i){let t=e.x??0,n=((e.y??0)-o)*d+36,r=t-a;e.x=n,e.y=r}for(let e of r)if(e.points)for(let t of e.points){let e=t.x,n=(t.y-o)*d+36,r=e-a;t.x=n,t.y=r}Fe(n);let f=n.filter(e=>e.isGroup&&!e.parentId);if(f.length===0)return t===`RL`&&Ie(e,`x`),!0;let p=Ae(n),m=new Map;for(let e of n){if(e.isGroup)continue;let t=je(e,p);if(!t)continue;let n=m.get(t)??[];n.push(e),m.set(t,n)}let h=0;for(let e of f){let t=e.padding??0;t>h&&(h=t)}let g=[],_=1/0,v=-1/0;for(let e of f){let t=Ne(m.get(e.id)??[]);t&&(_=Math.min(_,t.minX),v=Math.max(v,t.maxX),g.push({lane:e,contentTop:t.minY,contentBottom:t.maxY,centerY:(t.minY+t.maxY)/2}))}if(_===1/0||v===-1/0)return!0;let y=Math.max(0,v-_)+2*Math.max(h,10),b=36+y,x=(_+v)/2-y/2-36,S=x+b/2,C=Math.max(h,36);g.sort((e,t)=>e.centerY-t.centerY);for(let e=0;ed.cy?g.bottom:g.top,t=d.cx+n;if(t<=g.left+ze||t>=g.right-ze)continue;i={x:t,y:e},a={x:t,y:o.y},c={x:o.x,y:o.y}}else{let e=f.cx>d.cx?g.right:g.left,t=d.cy+n;if(t<=g.top+ze||t>=g.bottom-ze)continue;i={x:e,y:t},a={x:o.x,y:t},c={x:o.x,y:o.y}}let p=v(i,a,ze),m=v(a,c,ze);if(p&&m||!p&&B(i,a,r,[l],1)||!m&&B(a,c,r,[u],1))continue;let _=!p&&ae(i,a,e,t,{epsilon:ze,skipDegenerateOther:!0}),y=!m&&ae(a,c,e,t,{epsilon:ze,skipDegenerateOther:!0});if(!(_||y)){h=p?[a,c]:m?[i,a]:[i,a,c];break}}h&&(t.points=h)}}e(He,`portSwapToLShape`);function Ue(t,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=z(n.values());for(let o of t){if(o.isLayoutOnly)continue;let s=o.points;if(!s||s.length<4)continue;let c=D(s,r);if(c.length<4)continue;let l=c.length-1,u=c[l],d=c[l-1],f=c[l-2],p=u.x-d.x,m=u.y-d.y,h=Math.hypot(p,m);if(h>=10||h0;P={x:f.x,y:M},I={x:e?N.right:N.left,y:M}}if(B(P,I,i,E?[E]:[],-2)||B(P,I,a,[],-2))continue;if(O){let e=n.get(O),t=e?F(e):void 0;if(t&&A(P,t,2))continue}let ee=e((e,t)=>`${e.x.toFixed(3)},${e.y.toFixed(3)}|${t.x.toFixed(3)},${t.y.toFixed(3)}`,`ownSegmentKey`),L=new Set;for(let e=0;e{for(let i of t){if(i===o||i.isLayoutOnly)continue;let t=i.points;if(!(!t||t.length<2))for(let i=0;i=0){let e=c[l-3],t=[O,E].filter(e=>!!e);if(B(e,P,i,t,-2)||R(e,P))continue}let z=[...c.slice(0,l-2),P,I];o.points=z;let te=o.labelNodeId;if(te){let e=n.get(te);if(e){let t=e.width??0,n=e.height??0;if(t>0&&n>0){let i,a,o=-1;for(let e=0;e=t+2||d&&l>=n+2)&&l>o&&(o=l,i=(s.x+c.x)/2,a=(s.y+c.y)/2)}i!==void 0&&a!==void 0&&(e.x=i,e.y=a)}}}}}e(Ue,`collapseShortTerminalStub`);var Y=.001,X=8,Z=T,We=e((e,t)=>y(e,t,Y)||b(e,t,Y),`orthogonallyAligned`);function Ge(t,n){let r=e((e,t)=>{let n=e.x??0,r=e.y??0,i=t.x-n,a=t.y-r,o=(e.width??0)/2,s=(e.height??0)/2;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),{x:n+(a===0?0:s*i/a),y:r+s}):(i<0&&(o=-o),{x:n+o,y:r+(i===0?0:o*a/i)})},`rectIntersect`),i=e((e,t)=>{let i=D(e.points??[]);if(i.length<2)return;let a=t?e.start:e.end,o=a?n.get(a):void 0,s=o?F(o):void 0;if(!o||!a||!s)return;let c=t?i[0]:i[i.length-1],l=t?i[1]:i[i.length-2],u=r(o,c),d=c;if(We(l,u)&&(d=l),y(u,d,Y))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`V`,coord:u.x,min:Math.min(u.y,d.y),max:Math.max(u.y,d.y),boundary:u,railEnd:d,rect:s};if(b(u,d,Y))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`H`,coord:u.y,min:Math.min(u.x,d.x),max:Math.max(u.x,d.x),boundary:u,railEnd:d,rect:s}},`terminalLaneFor`),a=e((e,t)=>Math.max(0,Math.min(e.max,t.max)-Math.max(e.min,t.min)),`projectedOverlapLength`),o=e((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:e.orientation===`H`?(Math.abs(e.boundary.x-e.rect.left)<1||Math.abs(e.boundary.x-e.rect.right)<1)&&y(e.boundary,t.boundary,1):(Math.abs(e.boundary.y-e.rect.top)<1||Math.abs(e.boundary.y-e.rect.bottom)<1)&&b(e.boundary,t.boundary,1),`sameTerminalFace`),s=e((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:a(e,t)>=X&&Math.abs(e.coord-t.coord)<.5,`exactTerminalLaneConflict`),c=e((e,t)=>{if(e.nodeId!==t.nodeId||e.orientation!==t.orientation||e.orientation!==`H`||e.atStart===t.atStart)return!1;let n=a(e,t);if(n2*r?!1:o(e,t)&&Math.abs(e.coord-t.coord)<16},`nearTerminalLaneConflict`),l=e((t,n)=>{let r=D(t.edge.points??[]);if(r.length<2)return;let i=t.orientation===`V`?{x:t.boundary.x+n,y:t.boundary.y}:{x:t.boundary.x,y:t.boundary.y+n},a=t.orientation===`V`?{x:t.railEnd.x+n,y:t.railEnd.y}:{x:t.railEnd.x,y:t.railEnd.y+n};if(!e(()=>Math.abs(t.boundary.y-t.rect.top)<1||Math.abs(t.boundary.y-t.rect.bottom)<1?b(i,t.boundary,Y)&&i.x>=t.rect.left+1&&i.x<=t.rect.right-1:Math.abs(t.boundary.x-t.rect.left)<1||Math.abs(t.boundary.x-t.rect.right)<1?y(i,t.boundary,Y)&&i.y>=t.rect.top+1&&i.y<=t.rect.bottom-1:!1,`boundaryStaysOnSameFace`)())return;if(t.atStart){let e=r.length>1&&v(r[1],t.railEnd,Y),n=r.slice(e?2:1),o=n[0];return o&&!We(o,a)?void 0:[i,a,...n]}let o=r.length>1&&v(r[r.length-2],t.railEnd,Y),s=r.slice(0,o?-2:-1),c=s[s.length-1];if(!(c&&!We(c,a)))return[...s,a,i]},`shiftedCandidate`),u=e(e=>{let t=e.edge,r=D(t.points??[]);if(r.length!==2)return!1;let i=t.start,a=t.end,o=i?n.get(i):void 0,s=a?n.get(a):void 0;if(!o||!s)return!1;let c=o.x??0,l=o.y??0,u=s.x??0,d=s.y??0,[f,p]=r;return b(f,p,Y)&&Math.abs(l-d)<1&&Math.abs(c-u)>1||y(f,p,Y)&&Math.abs(c-u)<1&&Math.abs(l-d)>1},`laneIsStraightCollinearConnector`),d=[-7,7,-14,14,-21,21];for(let e=0;e<8;e++){let e=t.filter(e=>!e.isLayoutOnly).flatMap(e=>[i(e,!0),i(e,!1)]).filter(e=>!!e),n=!1;for(let t=0;t{let n=u(e),r=u(t);return n===r?Number(!t.atStart)-Number(!e.atStart):Number(n)-Number(r)});for(let t of p){for(let r of d){let a=l(t,r);if(!a)continue;let o=i({...t.edge,points:a},t.atStart);if(!(!o||e.some(e=>e.edge!==t.edge&&(s(o,e)||f&&c(o,e))))){t.edge.points=a,n=!0;break}}if(n)break}}if(!n)return}}e(Ge,`separateSharedRenderedTerminalLanes`);function Ke(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=e((e,n)=>{let a=e.start,o=e.end,s=Z(n);if(s.length!==n.length-1)return!1;let c=[a,o].filter(e=>!!e);for(let e of s)if(B(e.a,e.b,r,c,-2)||B(e.a,e.b,i,[],-2))return!1;for(let n of t){if(n===e||n.isLayoutOnly)continue;let t=n.points;if(!(!t||t.length<2)){for(let e of s)for(let n of Z(D(t)))if(w(e,n,.5)>=X||V(e.a,e.b,n.a,n.b,Y))return!1}}return!0},`candidateIsSafe`),o=e((e,t)=>{if(t+4>=e.length)return;let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=e[t+4],s=x(n,r)&&S(r,i)&&x(i,a)&&S(a,o)&&y(n,a,Y)&&y(n,o,Y)&&y(r,i,Y)&&(r.x-n.x)*(a.x-i.x)<0,c=S(n,r)&&x(r,i)&&S(i,a)&&x(a,o)&&b(n,a,Y)&&b(n,o,Y)&&b(r,i,Y)&&(r.y-n.y)*(a.y-i.y)<0;if(s||c)return D([...e.slice(0,t+1),o,...e.slice(t+5)]);if(t+5>=e.length)return;let l=e[t+5],u=S(n,r)&&x(r,i)&&S(i,a)&&x(a,o)&&S(o,l)&&y(n,o,Y)&&y(n,l,Y)&&y(i,a,Y)&&(i.x-r.x)*(o.x-a.x)<0,d=x(n,r)&&S(r,i)&&x(i,a)&&S(a,o)&&x(o,l)&&b(n,o,Y)&&b(n,l,Y)&&b(i,a,Y)&&(i.y-r.y)*(o.y-a.y)<0;if(!(!u&&!d))return D([...e.slice(0,t+1),l,...e.slice(t+6)])},`withoutDogleg`);for(let e=0;e<8;e++){let e=!1;for(let n of t){if(n.isLayoutOnly)continue;let t=D(n.points??[]);for(let r=0;r<=t.length-5;r++){let i=o(t,r);if(!(!i||!a(n,i))){n.points=i,e=!0;break}}if(e)break}if(!e)return}}e(Ke,`collapseRedundantRectangularDoglegs`);function qe(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t,n)=>D(e===t?n??[]:e.points??[]),`pointsFor`),s=e((e,t)=>{let n=0;for(let r=0;r{let t=Z(e);if(t.length!==3)return;let n=t[1];if(t[0].horizontal!==n.horizontal&&t[2].horizontal!==n.horizontal)return{index:n.index,horizontal:n.horizontal,vertical:n.vertical,segment:n}},`middleRail`),l=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);return r.filter(e=>{if(n.includes(e.id))return!1;let r=e.rect;return t.horizontal?C(t.a.x,t.b.x,r.left,r.right)>=X&&t.a.y>=r.top-2&&t.a.y<=r.bottom+2:C(t.a.y,t.b.y,r.top,r.bottom)>=X&&t.a.x>=r.left-2&&t.a.x<=r.right+2})},`blockingRectsFor`),u=e((e,t,n)=>{let r=e.map(e=>({...e}));if(t.horizontal)r[t.index].y=n,r[t.index+1].y=n;else if(t.vertical)r[t.index].x=n,r[t.index+1].x=n;else return;let i=G(D(r));return Z(i).length===i.length-1?i:void 0},`candidateByMovingRail`),d=e((e,t,n)=>{let c=[e.start,e.end].filter(e=>!!e),l=Z(t);if(l.length!==t.length-1)return!1;for(let e of l)if(B(e.a,e.b,r,c,-2)||B(e.a,e.b,i,[],-2))return!1;for(let t of a)if(t!==e){for(let e of l)for(let n of Z(o(t)))if(w(e,n,.5)>=X)return!1}return s(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=s(),t=!1;for(let n of a){let r=o(n),i=c(r);if(!i)continue;let a=l(n,i.segment);if(a.length===0)continue;let s=i.horizontal?[Math.min(...a.map(e=>e.rect.top))-20,Math.max(...a.map(e=>e.rect.bottom))+20]:[Math.min(...a.map(e=>e.rect.left))-20,Math.max(...a.map(e=>e.rect.right))+20];for(let a of s){let o=u(r,i.segment,a);if(!(!o||!d(n,o,e))){n.points=o,t=!0;break}}if(t)break}if(!t)return}}e(qe,`liftObstacleHuggingSameSideRails`);function Je(t,n){let r=e(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),i=e(e=>{if(!e.isGroup||e.parentId)return;let t=e.direction,n=typeof t==`string`?t.toUpperCase():``;if(n===`LR`||n===`RL`||n===`BT`)return;let i=r(e),a=e.y,o=e.height;if(!i||typeof a!=`number`||typeof o!=`number`||!Number.isFinite(a)||!Number.isFinite(o)||o<=0)return;let s=i.right-i.left,c=i.bottom-i.top;if(!(c<=0||s{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+Y||n>=t.bottom-Y?!1:C(e.a.x,e.b.x,t.left,t.right)>=X},`horizontalSegmentIntersectsTitle`),o=[...n.values()].map(i).filter(e=>!!e);if(o.length===0)return;let s=0;for(let e of t){if(e.isLayoutOnly)continue;let t=D(e.points??[]);for(let e of Z(t))for(let t of o)a(e,t.rect)&&(s=Math.max(s,t.rect.bottom-e.a.y+4))}if(!(s<=Y))for(let e of o){let t=e.node.y,n=e.node.height;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.y=t-s/2,e.node.height=n+s,e.node.groupTitleRect={...e.rect,top:e.rect.top-s,bottom:e.rect.bottom-s})}}e(Je,`liftTopLaneTitleBandsAboveRails`);function Ye(t,n){let r=e(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),i=e(e=>{if(!e.isGroup||e.parentId||e.direction!==`LR`)return;let t=r(e),n=e.x,i=e.width;if(!t||typeof n!=`number`||typeof i!=`number`||!Number.isFinite(n)||!Number.isFinite(i)||i<=0)return;let a=t.right-t.left,o=t.bottom-t.top;if(!(a<=0||o{if(!e.vertical)return!1;let n=e.a.x;return n<=t.left+Y||n>=t.right-Y?!1:C(e.a.y,e.b.y,t.top,t.bottom)>=X},`verticalSegmentIntersectsTitle`),o=e((e,t)=>{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+Y||n>=t.bottom-Y?!1:C(e.a.x,e.b.x,t.left,t.right)>=X},`horizontalSegmentIntersectsTitle`),s=[...n.values()].map(i).filter(e=>!!e);if(s.length===0)return;let c=0;for(let e of t){if(e.isLayoutOnly)continue;let t=D(e.points??[]);for(let e of Z(t))for(let t of s)if(a(e,t.rect))c=Math.max(c,t.rect.right-e.a.x+4);else if(o(e,t.rect)){let n=Math.min(e.a.x,e.b.x);c=Math.max(c,t.rect.right-n+4)}}if(!(c<=Y))for(let e of s){let t=e.node.x,n=e.node.width;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.x=t-c/2,e.node.width=n+c,e.node.groupTitleRect={...e.rect,left:e.rect.left-c,right:e.rect.right-c})}}e(Ye,`shiftLeftLaneTitleBandsLeftOfRails`);function Xe(t,n){let{realNodeRects:r}=z(n.values()),i=t.filter(e=>!e.isLayoutOnly),a=e((e,t=new Map)=>D(t.get(e)??e.points??[]),`replacementPointsFor`),o=e((e=new Map)=>{let t=0;for(let n=0;ni.reduce((t,n)=>t+E(a(n,e)),0),`totalBends`),c=e(e=>{let t=a(e);if(t.length<4)return;let n=t[t.length-2],r=t[t.length-1];if(!(!x(n,r,Y)&&!S(n,r,Y)))return{tailStart:n,terminal:r}},`terminalTailFor`),l=e((e,t)=>{let n=a(e);if(n.length<3)return;let r=n[0],i=n[1],o;if(x(r,i,Y))o={x:i.x,y:t.tailStart.y};else if(S(r,i,Y))o={x:t.tailStart.x,y:i.y};else return;let s=G(D([r,i,o,t.tailStart,t.terminal]));return Z(s).length===s.length-1?s:void 0},`candidateWithDestinationTail`),u=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Z(t))if(B(e.a,e.b,r,n,-2))return!0;return!1},`pathHasNodeHit`),d=e((e,t,n)=>{for(let r of i)if(r!==e){for(let e of Z(t))for(let t of Z(a(r,n)))if(w(e,t,.5)>=X)return!0}return!1},`pathHasSharedTrack`),f=e((e,t,n)=>!u(e,t)&&!d(e,t,n),`candidateIsSafe`),p=e(()=>{let e=new Map;for(let t of i){let r=t.end;if(!r||!n.has(r)||a(t).length<4)continue;let i=e.get(r)??[];i.push(t),e.set(r,i)}return e},`edgesByDestination`);for(let e=0;e<4;e++){let e=o();if(e===0)return;let t=s(),n,r=e,i=t;for(let t of p().values())for(let a=0;a=e||y>r||y===r&&b>=i||(n=v,r=y,i=b)}if(!n)return;for(let[e,t]of n)e.points=t}}e(Xe,`swapDestinationTerminalTailsToReduceCrossings`);function Ze(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t=new Map)=>D(t.get(e)??e.points??[]),`replacementPointsFor`),s=e((e=new Map)=>{let t=0;for(let n=0;na.reduce((t,n)=>t+E(o(n,e)),0),`totalBends`),l=e(e=>{let t=e.start,r=e.end,i=t?n.get(t):void 0,a=r?n.get(r):void 0,o=i?F(i):void 0,s=a?F(a):void 0;return o&&s?{src:o,dst:s}:void 0},`endpointRectsFor`),u=e((e,t,n)=>{if(n.index<=0||n.index+1>=t.length-1)return;let r=l(e);if(r){if(n.vertical){let i=n.a.x,a=Math.min(r.src.left,r.dst.left),o=Math.max(r.src.right,r.dst.right),s=io+Y?`right`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`vertical`,side:s,coord:i,min:Math.min(n.a.y,n.b.y),max:Math.max(n.a.y,n.b.y)}:void 0}if(n.horizontal){let i=n.a.y,a=Math.min(r.src.top,r.dst.top),o=Math.max(r.src.bottom,r.dst.bottom),s=io+Y?`bottom`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`horizontal`,side:s,coord:i,min:Math.min(n.a.x,n.b.x),max:Math.max(n.a.x,n.b.x)}:void 0}}},`externalRailForSegment`),d=e(()=>{let e=[];for(let t of a){let n=o(t);for(let r of Z(n)){let i=u(t,n,r);i&&e.push(i)}}return e},`collectExternalRails`),f=e((e,t)=>e.edge!==t.edge&&e.axis===t.axis&&e.side===t.side&&C(e.min,e.max,t.min,t.max)>=X,`railsInteract`),p=e(e=>{let t=[],n=new Set;for(let r of e){if(n.has(r))continue;let i=[r],a=[];for(n.add(r);i.length>0;){let t=i.pop();a.push(t);for(let r of e)!n.has(r)&&f(t,r)&&(n.add(r),i.push(r))}a.length>1&&t.push(a)}return t},`connectedComponents`),m=e(e=>{let t=[];for(let n of e)t.some(e=>Math.abs(e-n.coord){let n=t.map(e=>e.coord),r=m(t),i=[];if(t.length<=6){let a=Array(r.length).fill(!1),o=[],s=e(()=>{if(o.length===t.length){o.some((e,t)=>Math.abs(e-n[t])>=Y)&&i.push([...o]);return}for(let[e,t]of r.entries())a[e]||(a[e]=!0,o.push(t),s(),o.pop(),a[e]=!1)},`visit`);return s(),i}for(let e=0;e{let n=new Map;for(let[r,i]of e.entries()){let e=t[r],a=n.get(i.edge)??i.points.map(e=>({x:e.x,y:e.y}));i.axis===`vertical`?(a[i.segmentIndex].x=e,a[i.segmentIndex+1].x=e):(a[i.segmentIndex].y=e,a[i.segmentIndex+1].y=e),n.set(i.edge,a)}let r=new Map;for(let[e,t]of n){let n=G(D(t));if(Z(n).length!==n.length-1)return;r.set(e,n)}return r},`replacementsForAssignment`),_=e(e=>{for(let[t,n]of e){let e=[t.start,t.end].filter(e=>!!e);for(let t of Z(n))if(B(t.a,t.b,r,e,-2)||B(t.a,t.b,i,[],-2))return!1}for(let t=0;t=X)return!1}}return!0},`candidateIsSafe`);for(let e=0;e<4;e++){let e=s();if(e===0)return;let t,n=e,r=c(),i=1/0;for(let a of p(d()))for(let o of h(a)){let l=g(a,o);if(!l||!_(l))continue;let u=s(l);if(u>=e)continue;let d=c(l),f=a.reduce((e,t,n)=>e+Math.abs(o[n]-t.coord),0);u>n||u===n&&(d>r||d===r&&f>=i)||(t=l,n=u,r=d,i=f)}if(!t)return;for(let[e,n]of t)e.points=n}}e(Ze,`reassignCrossingExternalRailChannels`);function Qe(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t,n)=>D(e===t?n??[]:e.points??[]),`pointsFor`),s=e(e=>Z(e).reduce((e,t)=>{let n=t.a.x-t.b.x,r=t.a.y-t.b.y;return e+Math.hypot(n,r)},0),`pathLength`),c=e((e,t)=>{let n=0;for(let r=0;r{if(e.horizontal){let n=e.a.y;return(Math.abs(n-t.top)<1||Math.abs(n-t.bottom)<1)&&C(e.a.x,e.b.x,t.left,t.right)>=X}if(e.vertical){let n=e.a.x;return(Math.abs(n-t.left)<1||Math.abs(n-t.right)<1)&&C(e.a.y,e.b.y,t.top,t.bottom)>=X}return!1},`segmentRunsAlongRectBorder`),u=e(e=>{let t=[e.start,e.end].filter(e=>!!e),r=[];for(let e of t){let t=n.get(e),i=t?F(t):void 0;i&&r.push(i)}return r},`endpointRectsFor`),d=e((e,t)=>{if(t+3>=e.length)return[];let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=x(n,r,Y)&&S(r,i,Y)&&x(i,a,Y),s=S(n,r,Y)&&x(r,i,Y)&&S(i,a,Y);if(!o&&!s||!(o?Math.sign(r.x-n.x)!==Math.sign(a.x-i.x):Math.sign(r.y-n.y)!==Math.sign(a.y-i.y)))return[];let c=y(n,a,Y)||b(n,a,Y)?[]:[{x:n.x,y:a.y},{x:a.x,y:n.y}],l=c.length===0?[[...e.slice(0,t+1),...e.slice(t+3)]]:c.map(n=>[...e.slice(0,t+1),n,...e.slice(t+3)]),u=new Set;return l.map(e=>G(D(e))).filter(e=>{if(Z(e).length!==e.length-1||!e.some(e=>v(e,a,Y)))return!1;let t=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return!u.has(t)&&(u.add(t),!0)})},`shortcutCandidatesAt`),f=e((e,t,n)=>{let s=[e.start,e.end].filter(e=>!!e),d=u(e);for(let e of Z(t))if(B(e.a,e.b,r,s,-2)||B(e.a,e.b,i,[],-2)||d.some(t=>l(e,t)))return!1;for(let n of a)if(n!==e){for(let e of Z(t))for(let t of Z(o(n)))if(w(e,t,.5)>=X)return!1}return c(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=c(),t,n,r=e,i=1/0,l=1/0;for(let u of a){let a=o(u),p=E(a,Y),m=s(a);for(let o=0;o<=a.length-4;o++)for(let h of d(a,o)){let a=E(h,Y),o=s(h);if(!(ar||d===r&&(a>i||a===i&&o>=l)||(t=u,n=h,r=d,i=a,l=o)}}if(!t||!n)return;t.points=n}}e(Qe,`shortcutRedundantOrthogonalJogs`);function $e(t,n){let r=[];for(let e of n.values()){if(e.isGroup||e.isEdgeLabel)continue;let t=e.x??0,n=e.y??0,i=F(e);i&&r.push({id:String(e.id??``),cx:t,cy:n,rect:i})}if(r.length===0)return;let i=new Map(r.map(e=>[e.id,e])),a=r.map(e=>({id:e.id,rect:e.rect})),o=[`top`,`bottom`,`left`,`right`],s={top:Math.min(...r.map(e=>e.rect.top))-20,bottom:Math.max(...r.map(e=>e.rect.bottom))+20,left:Math.min(...r.map(e=>e.rect.left))-20,right:Math.max(...r.map(e=>e.rect.right))+20},c=t.filter(e=>!e.isLayoutOnly),l=new Map(c.map((e,t)=>[e,t])),u=e(e=>{let t=e===`left`||e===`top`?-1:1,n=[];for(let r=0;r<=2;r++)n.push(s[e]+t*20*r);return n},`outwardTracksForSide`),d=e((e,t=new Map)=>D(t.get(e)??e.points??[]),`replacementPointsFor`),f=e((e,t)=>{let n=0;for(let r of e)for(let e of t)V(r.a,r.b,e.a,e.b,Y)&&n++;return n},`crossingCountBetweenSegments`),p=e((e,t)=>f(Z(e),Z(t)),`crossingCountBetweenPaths`),m=e((t=new Map)=>{let n=0,r=[],i=new Set,a=[],o=e(e=>{i.has(e)||(i.add(e),a.push(e))},`addEdge`);for(let e=0;e0&&(n+=l,r.push({first:i,second:e,count:l}),o(i),o(e))}}return a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),{count:n,pairs:r,edgeSet:i,edges:a}},`crossingSnapshot`),h=e((e,t)=>{let n=new Set(t.keys());if(n.size===0)return e.count;let r=0;for(let t of e.pairs)(n.has(t.first)||n.has(t.second))&&(r+=t.count);let i=0;for(let e=0;e{let t=new Map;for(let n of e.pairs){let e=t.get(n.first)??new Set;e.add(n.second),t.set(n.first,e);let r=t.get(n.second)??new Set;r.add(n.first),t.set(n.second,r)}let n=[],r=new Set;for(let i of e.edges){if(r.has(i))continue;let e=[i],a=[];for(r.add(i);e.length>0;){let n=e.pop();a.push(n);for(let i of t.get(n)??[])r.has(i)||(r.add(i),e.push(i))}a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),a.length>1&&n.push(a)}return n},`crossingComponents`),_=e(e=>[e.start,e.end].filter(e=>!!e),`endpointIdsFor`),v=e(e=>{let t=[];for(let n of g(e)){let e=new Set(n),r=new Set(n.flatMap(e=>_(e))),i=[...n];for(let t of c)e.has(t)||_(t).some(e=>r.has(e))&&i.push(t);i.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),t.push(i)}return t},`pairSearchGroups`),y=e((e,t,n)=>h(e,new Map([[t,n]])),`crossingCountWithSingleReplacement`),b=e(e=>{let t=new Map;for(let n of e.pairs)t.set(n.first,(t.get(n.first)??0)+n.count),t.set(n.second,(t.get(n.second)??0)+n.count);return t},`currentCrossingsByEdge`),C=e(e=>e.slice(1).reduce((t,n,r)=>{let i=e[r];return t+Math.abs(n.x-i.x)+Math.abs(n.y-i.y)},0),`pathLength`),T=e((e=new Map)=>c.reduce((t,n)=>t+E(d(n,e)),0),`totalBends`),O=e((e=new Map)=>c.reduce((t,n)=>t+C(d(n,e)),0),`totalLength`),k=e((e,t,n=new Map)=>{let r=Z(t);for(let t of c)if(t!==e){for(let e of r)for(let r of Z(d(t,n)))if(w(e,r,.5)>=X)return!0}return!1},`pathHasSegmentConflict`),A=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Z(t))if(B(e.a,e.b,a,n,-2))return!0;return!1},`pathHitsNode`),j=e((e,t)=>{let n=G(D(t));Z(n).length===n.length-1&&e.push(n)},`pushOrthogonalCandidate`),M=e(e=>e===`left`||e===`right`,`sideIsHorizontal`),N=e((e,t,n)=>{switch(t){case`left`:return Math.min(e.x,n.x)-20;case`right`:return Math.max(e.x,n.x)+20;case`top`:return Math.min(e.y,n.y)-20;case`bottom`:return Math.max(e.y,n.y)+20}},`localTrackForSameSide`),P=e((e,t,n,r)=>{let i=n===`left`||n===`top`?-1:1,a=[N(t,n,r),s[n]];for(let o of a)for(let a=0;a<=2;a++)j(e,L(t,n,r,o+i*20*a))},`addSameSideCandidates`),R=e((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))j(e,[t,{x:a,y:t.y},{x:a,y:n},{x:r.x,y:n},r])},`addHorizontalToVerticalCandidates`),z=e((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))j(e,[t,{x:t.x,y:a},{x:n,y:a},{x:n,y:r.y},r])},`addVerticalToHorizontalCandidates`),te=e((e,t,n,r,i)=>{let a=[...u(`top`),...u(`bottom`)];for(let o of u(n))for(let n of u(i))for(let i of a)j(e,[t,{x:o,y:t.y},{x:o,y:i},{x:n,y:i},{x:n,y:r.y},r])},`addHorizontalPairCandidates`),ne=e((e,t,n,r,i)=>{let a=[...u(`left`),...u(`right`)];for(let o of u(n))for(let n of u(i))for(let i of a)j(e,[t,{x:t.x,y:o},{x:i,y:o},{x:i,y:n},{x:r.x,y:n},r])},`addVerticalPairCandidates`),re=e(e=>{let t=new Set;return e.map(e=>D(e)).filter(e=>{let n=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return t.has(n)||e.length<2?!1:(t.add(n),!0)})},`dedupeCandidatePaths`),ie=e((e,t,n,r)=>{let i=[],a=ee(e,t,n,r,20,Y);a&&j(i,a),t===r&&P(i,e,t,n);let o=M(t),s=M(r);return o&&!s?R(i,e,t,n,r):!o&&s?z(i,e,t,n,r):o?te(i,e,t,n,r):ne(i,e,t,n,r),re(i)},`buildCandidatesForSides`),ae=e((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=I(r,s),c=s===`top`||s===`bottom`?u(s):a;for(let r of i){j(e,[t,n,{x:r,y:n.y},{x:r,y:o.y},o]);for(let i of c)j(e,[t,n,{x:r,y:n.y},{x:r,y:i},{x:o.x,y:i},o])}}},`addVerticalDepartureOuterTrackCandidates`),oe=e((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=I(r,s),c=s===`left`||s===`right`?u(s):i;for(let r of a){j(e,[t,n,{x:n.x,y:r},{x:o.x,y:r},o]);for(let i of c)j(e,[t,n,{x:n.x,y:r},{x:i,y:r},{x:i,y:o.y},o])}}},`addHorizontalDepartureOuterTrackCandidates`),H=e(e=>{let t=e.start,n=e.end,r=n?i.get(n):void 0;if(!t||!r)return[];let a=D(e.points??[]);if(a.length<4)return[];let o=a[0],s=a[1],c=[];return S(o,s,Y)?ae(c,o,s,r):x(o,s,Y)&&oe(c,o,s,r),c},`terminalPreservingOuterTrackCandidates`),U=e(e=>{let t=e.start,n=e.end,r=t?i.get(t):void 0,a=n?i.get(n):void 0;if(!r||!a)return[];let s=[];for(let e of o){let t=I(r,e);for(let n of o)s.push(...ie(t,e,I(a,n),n))}return s.push(...H(e)),s},`candidatePathsFor`),W=e(()=>new Map(c.map(e=>[e,Z(d(e))])),`currentSegmentsByEdge`),K=e((e,t,n)=>{let r=new Set;for(let i of c){if(i===e)continue;let a=n.get(i)??Z(d(i));t.some(e=>a.some(t=>w(e,t,.5)>=X))&&r.add(i)}return r},`sharedTrackConflictsFor`),se=e((e,t,n,r)=>{let i=new Set;return U(e).map(e=>G(D(e))).filter(t=>{if(A(e,t))return!1;let n=t.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return i.has(n)||t.length<2?!1:(i.add(n),!0)}).map(i=>{let a=Z(i),o=0;for(let t of c)t!==e&&(o+=f(a,n.get(t)??Z(d(t))));return{candidate:i,candidateSegments:a,crossings:t.count-(r.get(e)??0)+o,bends:E(i,Y),totalBends:E(i),length:C(i)}}).filter(({crossings:e})=>e<=t.count).sort((e,t)=>e.crossings-t.crossings||e.bends-t.bends||e.length-t.length).slice(0,48).map(t=>({path:t.candidate,segments:t.candidateSegments,sharedTrackConflicts:K(e,t.candidateSegments,n),totalBends:t.totalBends,length:t.length}))},`pairCandidatesFor`),ce=e((e,t,n,r,i,a)=>{let o=0;for(let n of e.pairs)(n.first===t||n.second===t||n.first===r||n.second===r)&&(o+=n.count);let s=f(n.segments,i.segments);for(let e of c){if(e===t||e===r)continue;let o=a.get(e)??Z(d(e));s+=f(n.segments,o)+f(i.segments,o)}return e.count-o+s},`pairCrossingCount`),le=e((e,t)=>{for(let n of e.sharedTrackConflicts)if(n!==t)return!1;return!0},`conflictsOnlyWith`),ue=e((e,t)=>e.segments.some(e=>t.segments.some(t=>w(e,t,.5)>=X)),`candidatesShareTrack`),de=e((e,t,n,r)=>le(t,n.edge)&&le(r,e.edge)&&!ue(t,r),`pairCandidatesAreCompatible`),q=e((e,t,n,r,i)=>{let a=ce(e.current,t.edge,n,r.edge,i,e.baseSegments);if(!(a>=e.current.count))return{replacements:new Map([[t.edge,n.path],[r.edge,i.path]]),crossings:a,bends:e.currentBends-(e.baseBendsByEdge.get(t.edge)??0)-(e.baseBendsByEdge.get(r.edge)??0)+n.totalBends+i.totalBends,length:e.currentLength-(e.baseLengthByEdge.get(t.edge)??0)-(e.baseLengthByEdge.get(r.edge)??0)+n.length+i.length}},`scorePairReplacement`),J=e((e,t)=>e.crossings{let i=r;for(let r of t.candidates)for(let a of n.candidates){if(!de(t,r,n,a))continue;let o=q(e,t,r,n,a);o&&J(o,i)&&(i=o)}return i},`bestScoreForOptionPair`),pe=e(e=>{let t=T(),n=O(),r=W(),i=b(e),a=new Map(c.map(e=>[e,E(d(e))])),o=new Map(c.map(e=>[e,C(d(e))])),s=new Map,l=v(e);for(let t of l)for(let n of t){if(s.has(n))continue;let t=se(n,e,r,i);t.length>0&&s.set(n,{edge:n,candidates:t})}let u={replacements:new Map,crossings:e.count,bends:t,length:n},f={current:e,currentBends:t,currentLength:n,baseBendsByEdge:a,baseLengthByEdge:o,baseSegments:r};for(let t of l){let n=new Set(t.filter(t=>e.edgeSet.has(t))),r=t.map(e=>s.get(e)).filter(e=>!!e);for(let e=0;e0?u.replacements:void 0},`bestPairedReplacement`);for(let e=0;e<4;e++){let e=m(),t=e.count;if(t===0)return;let n,r,i=t,a=1/0;for(let o of e.edges){let s=E(d(o),Y);for(let c of U(o)){let l=A(o,c),u=!l&&k(o,c),d=y(e,o,c),f=E(c,Y);l||u||(di||d===i&&f>=a||(n=o,r=c,i=d,a=f))}}if(n&&r){n.points=r;continue}let o=pe(e);if(!o)return;for(let[e,t]of o)e.points=t}}e($e,`resolveRenderedOrthogonalCrossings`);var et=.001,tt=8;function nt(t,n){let{nodeInfoById:r,realNodeRects:i}=R(n),a=[`top`,`bottom`,`left`,`right`],o={top:Math.min(...i.map(e=>e.rect.top))-20,bottom:Math.max(...i.map(e=>e.rect.bottom))+20,left:Math.min(...i.map(e=>e.rect.left))-20,right:Math.max(...i.map(e=>e.rect.right))+20},s=e((e,t,n,r)=>{let i=[],a=ee(e,t,n,r,20,et);return a&&i.push(a),t===r&&i.push(L(e,t,n,o[t])),i},`buildOrthogonalPathCandidates`),c=e((e,t)=>{for(let n=0;n{let i=0,a=T(e,et),o=n.start,s=n.end;for(let e of t){if(e===n||e.isLayoutOnly)continue;let t=e.start,c=e.end;if(!r&&o&&s&&(t===o||t===s||c===o||c===s))continue;let l=e.points;if(!(!l||l.length<2))for(let e of a)for(let t of T(l,et)){if(re(e.a,e.b,t.a,t.b,et,et)){i++;continue}w(e,t,et)>=tt&&i++}}return i},`pathConflictCount`),u=e((e,t)=>{let n=Math.abs(e.y-t.rect.top),r=Math.abs(e.y-t.rect.bottom),i=Math.abs(e.x-t.rect.left),a=Math.abs(e.x-t.rect.right),o=`top`,s=n;return r{let r=d.get(e)??[];r.push({side:t,edgeId:n}),d.set(e,r)},`addFaceClaim`);for(let e of t){if(e.isLayoutOnly)continue;let t=e.points??[];if(t.length<1)continue;let n=e.id??``,i=e.start,a=e.end;if(i){let e=r.get(i);e&&f(i,u(t[0],e),n)}if(a){let e=r.get(a);e&&f(a,u(t[t.length-1],e),n)}}let p=e((e,t,n)=>d.get(e)?.some(e=>e.edgeId!==n&&e.side===t)??!1,`faceIsClaimed`);for(let e of t){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=E(t,et);if(n<4)continue;let i=e.start,o=e.end;if(!i||!o)continue;let m=r.get(i),h=r.get(o);if(!m||!h)continue;let g=e.id??``,_=l(t,e,!0),v=l(t,e),y,b=_,x=n;for(let t of a){if(p(i,t,g))continue;let n=I(m,t);for(let r of a){if(p(o,r,g))continue;let a=I(h,r);for(let u of s(n,t,a,r)){if(c(u,[i,o]))continue;let t=E(u,et);if(_>0){let n=l(u,e,!0);if(n>b||n===b&&t>=x)continue;b=n,x=t,y=u;continue}l(u,e)>v||te.edgeId!==g));let n=d.get(o);n&&d.set(o,n.filter(e=>e.edgeId!==g)),f(i,u(y[0],m),g),f(o,u(y[y.length-1],h),g)}}}e(nt,`simplifyDetouredEdges`);var Q=.001,rt=10,it=7;function at(e,t){let n=t?0:e.length-1,r=t?1:-1,i=e[n],a=e[n+r];if(!i||!a)return;let o=a.x-i.x,s=a.y-i.y;if(!(Math.abs(o)+Math.abs(s)t&&M(e,ot(t)))}e(st,`labelOverlapsOwnMarker`);function ct(t,n){let r=[];for(let e of t){if(e.isLayoutOnly)continue;let t=e.points;if(!(!t||t.length<2))for(let n=0;n{let n=N(t,3);for(let{nodeId:t,rect:r}of i)if(t!==e&&M(n,r))return!0;return!1},`labelOverlapsForeignNode`),s=e((e,t)=>{let n=N(t,3);for(let t of r)if(t.edgeId!==e&&k(t.p1,t.p2,n))return!0;return!1},`labelOverlapsForeignEdge`),c=e((e,t,n)=>o(e,n)||s(t,n),`labelOverlapsAnything`),l=[],u=e(e=>{for(let{id:t,rect:n}of a)if(j(n,e))return t},`findContainingLane`),d=e((e,t)=>l.some(n=>n.labelId!==e&&M(t,n.rect)),`overlapsPlacedLabel`);for(let r of t){if(r.isLayoutOnly)continue;let t=r.labelNodeId;if(!t)continue;let i=n.get(t);if(!i)continue;let f=r.points;if(!f||f.length<2)continue;let p=i.width??0,m=i.height??0;if(p<=0||m<=0)continue;let h=[];for(let e=0;e=Q&&i>=Q||h.push({idx:e,length:r+i,orientation:r>=Q?`horizontal`:`vertical`,midX:(t.x+n.x)/2,midY:(t.y+n.y)/2})}if(h.length===0)continue;let g=h.length>=3?h.filter(e=>e.idx>0&&e.idx0?g:h,v=p>=m?`horizontal`:`vertical`,y=e(e=>[...e].sort((e,t)=>{let n=e.orientation===v;if(n!==(t.orientation===v))return n?-1:1;let r=e.length>=(e.orientation===`horizontal`?p:m)+2;return r===t.length>=(t.orientation===`horizontal`?p:m)+2?t.length-e.length:r?-1:1}),`rankSegments`),b=h[0],x=h[h.length-1],S=[.5,.25,.75,.05,.95,.15,.85,.1,.9],C=e((e,t)=>{let n=f[e.idx],r=f[e.idx+1];return{midX:n.x+(r.x-n.x)*t,midY:n.y+(r.y-n.y)*t}},`anchorAtT`),w=e((e,t,n)=>Math.min(n,Math.max(t,e)),`clamp`),T=e((e,t)=>e.midX>=t.left-Q&&e.midX<=t.right+Q&&e.midY>=t.top-Q&&e.midY<=t.bottom+Q,`pointInsideRectInclusive`),E=e(e=>{let t=P(e.midX,e.midY,p,m),n=u(t);if(n)return{laneId:n,anchor:e,rect:t};let r=a.find(({rect:t})=>T(e,t));if(!r)return;let i=r.rect.left+p/2+1,o=r.rect.right-p/2-1,s=r.rect.top+m/2+1,c=r.rect.bottom-m/2-1;if(i>o||s>c)return;let l={midX:w(e.midX,i,o),midY:w(e.midY,s,c)},d=P(l.midX,l.midY,p,m);return T(e,d)?{laneId:r.id,anchor:l,rect:d}:void 0},`placementForAnchor`),D=e((e,t,n)=>e.orientation===`horizontal`?Math.abs(t.midX-n.x):Math.abs(t.midY-n.y),`distanceAlongSegment`),O=e((e,t)=>{let n=(e.orientation===`horizontal`?p/2:m/2)+12;if(e===b){let r=f[e.idx];if(D(e,t,r)+Q{let n=y(e);for(let e of n)for(let n of S){let i=C(e,n);if(!O(e,i))continue;let a=E(i);if(a&&!st(a.rect,f)&&!d(t,a.rect)&&!c(t,r.id,a.rect))return{laneId:a.laneId,anchor:a.anchor}}},`tryPool`),A=e((e,n,i=!1)=>{let a=y(e);for(let e of a){let a={midX:e.midX,midY:e.midY};if(n&&!O(e,a))continue;let c=E(a);if(c&&!st(c.rect,f)&&!d(t,c.rect)&&!o(t,c.rect)&&(i||!s(r.id,c.rect)))return{laneId:c.laneId,anchor:c.anchor}}},`findLaneContainingFallback`),j=k(_)??(_.lengthe.labelId===t);n>=0?l[n]={labelId:t,rect:e}:l.push({labelId:t,rect:e})}}}e(ct,`anchorLabelsToPolyline`);var lt=1e-6,ut=8/2,dt=3;function ft(e,t){return e{let s=ft(r,i),c=0,l=e(e=>{if(!e)return;let t=a.get(e);if(!t)return;let n=o===`x`?t.w/2:t.h/2;n>c&&(c=n)},`consider`);l(n.labelNodeId);for(let e of t){if(e===n||e.isLayoutOnly)continue;let t=e.start,r=e.end;!t||!r||ft(t,r)===s&&l(e.labelNodeId)}return c>0?c+dt:0},`labelClearanceFor`);for(let e of t){if(e.isLayoutOnly)continue;let n=e.points;if(!O(n,lt))continue;let a=ne(e,r,lt);if(!a)continue;let{srcId:s,dstId:c,srcInfo:l,dstInfo:u,collinearX:d,collinearY:f}=a;if(d===f)continue;let p,m;if(d){let e=u.cy>l.cy;p={x:l.cx,y:e?l.rect.bottom:l.rect.top},m={x:u.cx,y:e?u.rect.top:u.rect.bottom}}else{let e=u.cx>l.cx;p={x:e?l.rect.right:l.rect.left,y:l.cy},m={x:e?u.rect.left:u.rect.right,y:u.cy}}if(B(p,m,i,[s,c],1))continue;let h=o(e,s,c,d?`x`:`y`),g=h>ut?h:ut,_=[0,g,-g];for(let n of _){let r={...p},a={...m};if(d){if(r.x+=n,a.x+=n,r.x<=l.rect.left||r.x>=l.rect.right||a.x<=u.rect.left||a.x>=u.rect.right)continue}else if(r.y+=n,a.y+=n,r.y<=l.rect.top||r.y>=l.rect.bottom||a.y<=u.rect.top||a.y>=u.rect.bottom)continue;if(!B(r,a,i,[s,c],1)&&!ae(r,a,t,e,{epsilon:lt})){e.points=[r,a];break}}}}e(pt,`straightenCollinearSiblingDetours`);function mt(t,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=z(n.values()),o=e((e,t)=>T(t,r).map(n=>({...n,edge:e,interior:n.index>=1&&n.index<=t.length-3})),`segmentsFor`),s=e(()=>{let e=[];for(let n of t){if(n.isLayoutOnly)continue;let t=n.points;!t||t.length<2||e.push(...o(n,D(t)))}return e},`allSegments`),c=e((e,t)=>e.horizontal&&t.horizontal?C(e.a.x,e.b.x,t.a.x,t.b.x)>=8&&Math.abs(e.a.y-t.a.y)<7:e.vertical&&t.vertical?C(e.a.y,e.b.y,t.a.y,t.b.y)>=8&&Math.abs(e.a.x-t.a.x)<7:!1,`hasCrowdedParallelTrack`),l=e((e,n)=>{let s=e.start,l=e.end,u=o(e,n);if(u.length!==n.length-1)return!1;let d=[s,l].filter(e=>!!e),f=e.labelNodeId?[e.labelNodeId]:[];for(let e of u)if(B(e.a,e.b,i,d,-2)||B(e.a,e.b,a,f,-2))return!1;for(let n of t){if(n===e||n.isLayoutOnly)continue;let t=n.points;if(!(!t||t.length<2)){for(let e of u)for(let i of o(n,D(t)))if(c(e,i)||V(e.a,e.b,i.a,i.b,r))return!1}}return!0},`candidateIsSafe`),u=e((e,t)=>{let n=D(e.edge.points??[]);if(n.length<4||e.index>=n.length-1)return;let r=n.map(e=>({...e}));if(e.horizontal)r[e.index].y+=t,r[e.index+1].y+=t;else if(e.vertical)r[e.index].x+=t,r[e.index+1].x+=t;else return;return o(e.edge,r).length===r.length-1?r:void 0},`shiftedCandidate`),d=e((e,t)=>({x:e.x??(t.left+t.right)/2,y:e.y??(t.top+t.bottom)/2}),`nodeCenter`),f=e(e=>{let t=e.edge,r=D(t.points??[]);if(r.length!==4||e.index!==1)return;let i=t.start?n.get(t.start):void 0,a=t.end?n.get(t.end):void 0,o=i?F(i):void 0,s=a?F(a):void 0,c=r.slice(e.index+2);if(!(!i||!a||!o||!s||c.length===0))return{sourceCenter:d(i,o),targetCenter:d(a,s),sourceRect:o,tail:c}},`sourceDetourContextFor`),p=e((e,t,n,i,a,o)=>{let s=i.y>=n.y,c=s?a.bottom:a.top,l=c+(s?20:-20);if(s&&e.b.y<=l+r||!s&&e.b.y>=l-r)return;let u=e.a.x+t;return D([{x:n.x,y:c},{x:n.x,y:l},{x:u,y:l},{x:u,y:e.b.y},...o],r)},`verticalSourceDetour`),m=e((e,t,n,i,a,o)=>{let s=i.x>=n.x,c=s?a.right:a.left,l=c+(s?20:-20);if(s&&e.b.x<=l+r||!s&&e.b.x>=l-r)return;let u=e.a.y+t;return D([{x:c,y:n.y},{x:l,y:n.y},{x:l,y:u},{x:e.b.x,y:u},...o],r)},`horizontalSourceDetour`),h=e((e,t)=>{let n=f(e);if(n){if(e.vertical)return p(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail);if(e.horizontal)return m(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail)}},`sourceDetourCandidate`),g=[-7,7,-14,14,-21,21];for(let e=0;e<12;e++){let e=s(),t=!1;for(let n=0;ne.interior);for(let e of o){for(let n of g){let r=u(e,n);if(r&&l(e.edge,r)){e.edge.points=r,t=!0;break}let i=h(e,n);if(i&&l(e.edge,i)){e.edge.points=i,t=!0;break}}if(t)break}}if(!t)return}}e(mt,`nudgeSharedInteriorSubpaths`);function ht(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=r.x-n.x,s=r.y-n.y,c=i*s-a*o;if(Math.abs(c)<1e-10)return!1;let l=n.x-e.x,u=n.y-e.y,d=(l*s-u*o)/c,f=(l*a-u*i)/c,p=.01;return d>p&&d<.99&&f>p&&f<.99}e(ht,`segmentsIntersect`);function gt(e){let n=e.nodes??[],r=e.edges??[],i=[];if(!r.length||!n.length)return i;let a=te(n),o=[];for(let e of r){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=e.start,r=e.end,s=e.labelNodeId,c=e.id??`${n}->${r}`;for(let e of a)if(e.nodeId!==n&&e.nodeId!==r&&!(s&&e.nodeId===s)){for(let n=0;n0){let e=i.filter(e=>e.type===`edge-node-overlap`).length,n=i.filter(e=>e.type===`edge-edge-crossing`).length;t.warn(`[SWIMLANE_VALIDATE] ${i.length} issue(s) detected: ${e} edge-node overlap(s), ${n} edge crossing(s)`);for(let e of i)t.warn(`[SWIMLANE_VALIDATE] ${e.type}: ${e.detail}`)}return i}e(gt,`validateSwimlanesLayout`);function _t(t,n){let r=t.nodes??[],i=t.edges??[],a=r.filter(e=>!e.isGroup);if((n===`LR`||n===`RL`)&&a.length>0&&!Re(t,n)||n===`BT`&&a.length>0&&!Le(t))return;for(let e of i){if(e.isLayoutOnly)continue;let t=e.points;!t||t.length<2||(e.points=G(W(t)))}nt(i,r),pt(i,r),He(i,r);let o=new Map;for(let e of r)o.set(String(e.id),e);ct(i,o),q(i,o),Ue(i,o),mt(i,o),Ge(i,o),Ke(i,o),qe(i,o),Xe(i,o);let s=e(()=>{$e(i,o),Ze(i,o),Qe(i,o),ct(i,o),ke(i,o),qe(i,o),ct(i,o),ke(i,o)},`finalizeRenderedEdges`);s(),mt(i,o),s(),Je(i,o),Ye(i,o),Je(i,o),Ye(i,o)}e(_t,`postProcessSwimlaneLayout`);function vt(e){let t=new Map(e.nodeById),n=new Set,r=[];for(let i of e.edges){if(!t.has(i.src)||!t.has(i.dst))continue;let e=`${i.id}:${i.src}->${i.dst}`;n.has(e)||(n.add(e),r.push(i))}return{nodes:[...t.keys()],edges:r,layout:e.layout,nodeById:t}}e(vt,`normalizeGraph`);function yt(e,t){return e.edges.filter(e=>e.dst===t)}e(yt,`incoming`);function bt(e){let t=new Map;for(let n of e.nodes)t.set(n,[]);for(let n of e.edges)t.get(n.src).push(n.dst);return t}e(bt,`buildSuccessorMap`);function xt(e){let t=bt(e);for(let e of t.values())e.sort((e,t)=>e.localeCompare(t));return t}e(xt,`buildSortedSuccessorMap`);function St(e){let t=new Map;for(let n of e.nodes)t.set(n,0);for(let n of e.edges)t.set(n.dst,(t.get(n.dst)??0)+1);return t}e(St,`buildInDegreeMap`);function Ct(e){return[...e.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}e(Ct,`sortedZeroInDegreeNodes`);function wt(e,t=()=>!0){let n=new Map,r=new Map;for(let t of e.nodes)n.set(t,[]),r.set(t,[]);for(let i of e.edges)t(i)&&(r.get(i.src).push(i.dst),n.get(i.dst).push(i.src));return{preds:n,succs:r}}e(wt,`buildPredecessorSuccessorMaps`);function Tt(e,t,n,r){let i=0;for(let t of e.nodes)r?.skipGroups&&e.nodeById.get(t)?.isGroup||(i=Math.max(i,n[t]??0));let a=Array.from({length:i+1},()=>[]);for(let i of t)r?.skipGroups&&e.nodeById.get(i)?.isGroup||a[Math.max(0,n[i]??0)].push(i);return a}e(Tt,`buildLayersFromRanks`);function Et(e){let t=St(e),n=Ct(t),r=[],i=xt(e);for(;n.length;){let e=n.shift();r.push(e);for(let r of i.get(e)??[])if(t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0){let e=0;for(;e{if(i-e<=1)return 0;let a=e+i>>1,o=r(e,a)+r(a,i),s=e,c=a,l=e;for(;s=i||se.dst===t.dst?e.id.localeCompare(t.id):e.dst.localeCompare(t.dst));let i=Object.create(null);for(let e of n.nodes)i[e]=0;let a=[],o=e(e=>{i[e]=1;for(let t of r.get(e)??[]){let e=t.dst;i[e]===0?o(e):i[e]===1&&a.push(t)}i[e]=2},`dfs`),s=St(n),c=[...n.nodes.filter(e=>(s.get(e)??0)===0),...n.nodes.filter(e=>(s.get(e)??0)!==0)];for(let e of c)i[e]===0&&o(e);let l=new Set(a.map(e=>`${e.id}:${e.src}->${e.dst}`)),u=n.edges.map(e=>l.has(`${e.id}:${e.src}->${e.dst}`)?{id:e.id,src:e.dst,dst:e.src,weight:e.weight,ref:e.ref}:e);return{acyclic:{nodes:[...n.nodes],edges:u,layout:n.layout,nodeById:new Map(n.nodeById)},reversed:a}}e(kt,`removeCycles_DFS`);function At(t){let n=new Map,r=e(e=>{if(n.has(e))return n.get(e);let i=t.nodeById.get(e);if(!i)return n.set(e,null),null;let a=i.parentId;if(!a)return n.set(e,null),null;let o=r(a)??a;return n.set(e,o),o},`resolve`);for(let e of t.nodes)r(e);return n}e(At,`buildTopLaneMap`);function jt(e){let t=At(e);return e=>t.get(e)??null}e(jt,`createTopLaneResolver`);function Mt(e){let t=[];for(let n of e.layout.nodes??[])n.isGroup&&!n.parentId&&t.push(n.id);return[...new Set(t)].reverse()}e(Mt,`buildTopLaneOrder`);function Nt(e,t){let n=Mt(e);if(!t||t.length===0)return n;let r=new Set(n),i=new Set,a=[];for(let e of t)!r.has(e)||i.has(e)||(i.add(e),a.push(e));for(let e of n)i.has(e)||a.push(e);return a}e(Nt,`resolveTopLaneOrder`);var Pt={EPSILON:1e-6},Ft={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},It={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Lt(t,n){let r=vt(t),i=n?.laneOf??(()=>null),a=n?.rankHint,{preds:o}=wt(r);for(let e of o.values())e.sort((e,t)=>e.localeCompare(t));let s=Et(r)??[...r.nodes].sort((e,t)=>e.localeCompare(t)),c=new Map;for(let[e,t]of s.entries())c.set(t,e);let l=new Map,u=new Map;for(let e of r.nodes)u.set(e,[]);for(let e of s){let t=(o.get(e)??[]).filter(e=>l.has(e));if(t.length>0){let n=Rt(e,t,{laneOf:i,rankHint:a,topoIndex:c});l.set(e,n),u.get(n).push(e)}else l.has(e)||l.set(e,null)}for(let e of r.nodes)l.has(e)||l.set(e,null);let d=new Set;for(let e of r.nodes)(l.get(e)??null)===null&&d.add(e);let f=[...d].sort((e,t)=>{let n=c.get(e)??0,r=c.get(t)??0;return n===r?e.localeCompare(t):n-r}),p=zt(r),m=new Map;for(let[e,t]of p.entries())m.set(e,[...t].sort((e,t)=>e.localeCompare(t)));let h=Bt(m),g=Vt(m),_=new Map;for(let e of r.nodes)_.set(e,[]);for(let e of g)for(let t of e.nodes){let n=_.get(t);n?n.push(e.id):_.set(t,[e.id])}let v=[],y=[],b=new Set,x=e(e=>{if(!b.has(e)){b.add(e),v.push(e);for(let t of u.get(e)??[])x(t);y.push(e)}},`walk`);for(let e of f)x(e);for(let e of s)x(e);return{parent:l,children:u,roots:f,componentOf:h,blocks:g,nodeBlocks:_,adjacency:m,preorder:v,postorder:y,topologicalOrder:s}}e(Lt,`buildDrivingTree`);function Rt(e,t,n){let r=n.laneOf(e);return[...t].sort((e,t)=>{let i=n.laneOf(e),a=n.laneOf(t),o=i!=null&&i===r;if(o!==(a!=null&&a===r))return o?-1:1;let s=n.rankHint?.[e],c=n.rankHint?.[t];if(s!=null&&c!=null&&s!==c)return c-s;let l=n.topoIndex.get(e)??0,u=n.topoIndex.get(t)??0;return l===u?e.localeCompare(t):l-u})[0]}e(Rt,`chooseParent`);function zt(e){let t=new Map;for(let n of e.nodes)t.set(n,new Set);for(let n of e.edges)t.get(n.src).add(n.dst),t.get(n.dst).add(n.src);return t}e(zt,`buildAdjacency`);function Bt(e){let t=new Map,n=0;for(let r of e.keys()){if(t.has(r))continue;let i=[r];for(;i.length>0;){let r=i.pop();if(!t.has(r)){t.set(r,n);for(let n of e.get(r)??[])t.has(n)||i.push(n)}}n++}return t}e(Bt,`assignComponents`);function Vt(t){let n=new Map,r=new Map,i=[],a=[],o=0,s=e((e,c)=>{n.set(e,++o),r.set(e,o);for(let l of t.get(e)??[])l!==c&&(n.has(l)?(n.get(l)??0)<(n.get(e)??0)&&(i.push([e,l]),r.set(e,Math.min(r.get(e)??o,n.get(l)??o))):(i.push([e,l]),s(l,e),r.set(e,Math.min(r.get(e)??o,r.get(l)??o)),(r.get(l)??0)>=(n.get(e)??0)&&a.push(Ht(e,l,i,a.length))))},`visit`);for(let e of t.keys())n.has(e)||s(e,null);return a}e(Vt,`computeBlocks`);function Ht(e,t,n,r){let i=[],a=new Set;for(;n.length>0;){let r=n.pop();if(i.push(r),a.add(r[0]),a.add(r[1]),r[0]===e&&r[1]===t||r[0]===t&&r[1]===e)break}return{id:r,edges:i,nodes:[...a]}}e(Ht,`popBlock`);function Ut(t,n,r){let i=[...t.nodes],a=new Map;for(let[e,t]of i.entries())a.set(t,e);let o=i.length,s=Array(o).fill(-1),c=Array(o).fill(0),l=[],u=new Set;for(let e of i){let t=r.parent.get(e)??null,n=a.get(e);n!=null&&(t??(s[n]=-1,c[n]=0,u.has(e)||(u.add(e),l.push(e))))}for(;l.length>0;){let e=l.shift(),t=a.get(e);if(t==null)continue;let n=r.children.get(e)??[];for(let e of n){if(u.has(e))continue;let n=a.get(e);n!=null&&(s[n]=t,c[n]=c[t]+1,u.add(e),l.push(e))}}for(let e of i){if(u.has(e))continue;let t=a.get(e);t!=null&&(s[t]=-1,c[t]=0,u.add(e))}let d=Math.max(1,Math.ceil(Math.log2(Math.max(1,o)))+1),f=Array.from({length:d},()=>Array(o).fill(-1));for(let e=0;e{if(e===-1||t===-1)return-1;c[e]>t&1&&(e=f[t][e],e===-1))return-1;if(e===t)return e;for(let n=d-1;n>=0;n--){let r=f[n][e],i=f[n][t];r!==-1&&i!==-1&&r!==i&&(e=r,t=i)}return f[0][e]},`lcaIndex`),m=Array.from({length:o},()=>new Map);for(let e of t.edges){let t=e.src,r=e.dst,i=n[t],o=n[r];if(i==null||o==null||(i>o&&([t,r]=[r,t],[i,o]=[o,i]),i==null||o==null||i===o))continue;let s=a.get(t),c=a.get(r);if(s==null||c==null)continue;let l=p(s,c);if(l===-1)continue;let u=m[l];for(let e=i;e{if(t.size!==0)for(let[n,r]of t)e.set(n,(e.get(n)??0)+r)},`mergeInto`),_=new Set,v=e(e=>{let t=a.get(e);_.add(e);let i=t==null?void 0:m[t],o=i?new Map(i):new Map,s=r.children.get(e)??[];for(let t of s){let r=v(t),i=n[e];if(i!=null){let a=h.get(e);a||(a=new Map,h.set(e,a));let o=r.get(i)??0,s=n[t];s!=null&&s>i&&(o+=1),a.set(t,o)}g(o,r)}return o},`dfs`);for(let e of r.roots)_.has(e)||v(e);for(let e of i)_.has(e)||v(e);return h}e(Ut,`computeSubtreeCrossCounts`);function Wt(t,n,r){let i=new Map,a=e(e=>{let t=r[e]??0,o=[...n.get(e)??[]];o.sort(Gt(r));for(let e of o){a(e);let n=i.get(e);n!=null&&(t=Math.min(t,n))}i.set(e,t)},`annotate`);for(let e of t)a(e);return i}e(Wt,`annotateMinimumLayers`);function Gt(e){return(t,n)=>{let r=e[t]??0,i=e[n]??0;return r===i?t.localeCompare(n):r-i}}e(Gt,`compareByRankThenId`);function Kt(t,n,r,i){let a=0;for(let e of n){let t=r[e]??0;t>a&&(a=t)}let o=Array.from({length:a+1},()=>[]),s=new Set,c=e(e=>{if(s.has(e))return;s.add(e);let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e);for(let t of i(e))c(t)},`emit`);for(let e of t)c(e);for(let e of n)if(!s.has(e)){let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e),s.add(e)}return o}e(Kt,`emitNodesInTreeOrder`);function qt(e){let t=[];for(let n of e){let e=new Set,r=[];for(let t of n)e.has(t)||(e.add(t),r.push(t));t.push(r)}return t}e(qt,`deduplicateLayers`);function Jt(e,t,n,r){return i=>{let a=e.get(i)??[];if(a.length===0)return[];let o=t[i]??0,s=[],c=[],l=n.get(i);for(let e of a){let t=r.get(e)??o;t>o?s.push({child:e,min:t}):c.push(e)}return s.sort((e,t)=>e.min===t.min?e.child.localeCompare(t.child):e.min-t.min),c.sort((e,t)=>{let n=l?.get(e)??0,i=l?.get(t)??0;if(n!==i)return n-i;let a=r.get(e)??o,s=r.get(t)??o;return a===s?e.localeCompare(t):a-s}),[...s.map(e=>e.child),...c]}}e(Jt,`createChildOrderer`);function Yt(e,t,n){let r=Lt(e,{rankHint:t,laneOf:n}),{children:i,roots:a}=r;for(let t of e.nodes)i.has(t)||i.set(t,[]);let o=Ut(e,t,r),s=[...a].sort(Gt(t)),c=Jt(i,t,o,Wt(s,i,t)),l=Kt(s,e.nodes,t,c);return l=qt(l),l}e(Yt,`buildMultitreeLayerOrder`);function Xt(e,t,n){let r=new Set(e),i=new Set(t),a=Dt(t),o=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&o.push(a.get(e.dst));return Ot(o)}e(Xt,`countCrossingsBetweenAdjacent`);function Zt(e,t,n){let r=[];for(let e of t){let t=n[e.src],i=n[e.dst];if(t==null||i==null||t===i)continue;let a=e.src,o=e.dst,s=t,c=i;t>i&&(a=e.dst,o=e.src,s=i,c=t);for(let t=s;t(n[t]??0)-(n[e]??0));for(let s of o){let o=n[s]??0;if(o===0)continue;let c=0;for(let e of r.get(s)??[])c=Math.max(c,(n[e]??0)+1);if(c>=o)continue;let l=o;n[s]=c;let u=Zt(Yt(e,n,i),e.edges,n);u(t[e]??0)-(t[n]??0)||e.localeCompare(n));for(let i of r){let r=n(i);if(!r)continue;let a=e.edges.filter(e=>e.src===i);if(a.length===0)continue;let o=!1,s=0;for(let e of a){let t=n(e.dst);t==null||t===r?o=!0:s++}if(s===0||o)continue;let c=0,l=!1;for(let t of e.edges){if(t.dst!==i)continue;let e=n(t.src);e&&(e===r?l=!0:c++)}if(c>0||!l)continue;let u=t[i]??0,d=u+s,f=0;for(let n of e.edges)n.dst===i&&(f=Math.max(f,(t[n.src]??0)+1));let p=Math.max(u,f,d);p!==u&&(t[i]=p)}}e($t,`adjustCrossLaneSources`);function en(e,t){let n=vt(e),r=Et(n)??[...n.nodes].sort(),i=t?.compactSingleInput??!1,a=jt(n),o=Object.create(null);for(let e of r){let r=yt(n,e),s=t?.ignoreCrossLaneEdges?r.filter(t=>{let n=a(t.src),r=a(e);return!n||!r||n===r}):r;if(s.length===0)o[e]=0;else if(i&&s.length===1){let t=s[0].src;a(t)===a(e)?o[e]=(o[t]??0)+1:o[e]=o[t]??0}else{let t=-1/0;for(let e of s)t=Math.max(t,(o[e.src]??0)+1);o[e]=t===-1/0?0:t}}return(t?.optimizeRanksByCrossings??!1)&&(o=Qt(n,o)),t?.ignoreCrossLaneEdges&&$t(n,o),{layers:Yt(n,o,a),rankOf:o,dummy:new Set}}e(en,`assignLayers_LongestPath`);function tn(t,n){let r=vt(t),i={...en(r,{compactSingleInput:n?.compactSingleInput,ignoreCrossLaneEdges:n?.ignoreCrossLaneEdges,optimizeRanksByCrossings:n?.optimizeRanksByCrossings}).rankOf},a=jt(r),{preds:o,succs:s}=wt(r,e=>{if(n?.ignoreCrossLaneEdges){let t=a(e.src),n=a(e.dst);if(t&&n&&t!==n)return!1}return!0}),c=Et(r)??[...r.nodes],l=[...c].reverse(),u=e((e,t)=>{let n=0;for(let t of o.get(e)??[])n=Math.max(n,(i[t]??0)+1);let r=1/0,a=s.get(e)??[];return a.length>0&&(r=Math.min(...a.map(e=>(i[e]??0)-1))),Number.isFinite(r)||(r=Math.max(n,t)),Math.min(Math.max(t,n),r)},`clampFeasible`),d=Ft.GRAVITY_ITERATIONS,f=e(e=>{let t=!1;for(let n of e){let e=o.get(n)??[],r=s.get(n)??[];if(e.length===0&&r.length===0)continue;let a=e.length>0?e.reduce((e,t)=>e+(i[t]??0)+1,0)/e.length:i[n]??0,c=r.length>0?r.reduce((e,t)=>e+(i[t]??0)-1,0)/r.length:i[n]??0,l=Math.round((a+c)/2),d=u(n,l);d!==i[n]&&(i[n]=d,t=!0)}return t},`relaxOrder`);for(let e=0;e0){let n=Math.min(...t.map(e=>(i[e]??0)-1));(i[e]??0)>n&&(i[e]=n)}}return{layers:Tt(r,c,i),rankOf:i,dummy:new Set}}e(tn,`assignLayers_Gravity`);function nn(e){let t=St(e),n=xt(e),r=Ct(t),i=[];for(;r.length>0;){let e=[];for(let a of r){i.push(a);for(let r of n.get(a)??[])t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0&&e.push(r)}r=e.sort((e,t)=>e.localeCompare(t))}return i.length===e.nodes.length?i:null}e(nn,`topoSortByGenerationIfAcyclic`);function rn(t,n){let r=vt(t),i=n?.direction===`LR`?nn(r)??[...r.nodes].sort():Et(r)??[...r.nodes].sort(),a=jt(r),o=e(e=>a(e)??e,`laneOf`),s=Object.create(null),c=new Map,l=e((e,t)=>n?.ignoreCrossLaneEdges??!0?+(o(e)===o(t)):1,`edgeWeight`);for(let e of i){if(r.nodeById.get(e)?.isGroup)continue;let t=yt(r,e),n=0;if(t.length>0)for(let r of t){let t=r.src,i=s[t]??0;n=Math.max(n,i+l(t,e))}let i=o(e),a=c.get(i)??0,u=Math.max(n,a);s[e]=u,c.set(i,u+1)}return{layers:Tt(r,i,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}e(rn,`assignLayers_LaneAwareCompact`);function an(t,n){let r=vt(n),{rankOf:i}=t,a=t.layers.map(e=>[...e]),o=new Set(t.dummy?[...t.dummy]:[]),s=0,c=new Map(r.nodeById),l=e(e=>{let t=`placeholder-${s++}`,n={id:t,isGroup:!1,isDummy:!0,width:0,height:0};for(c.set(t,n),o.add(t);a.length<=e;)a.push([]);return a[e].push(t),i[t]=e,t},`addDummyAt`),u=[...r.edges].sort((e,t)=>e.id===t.id?e.src===t.src?e.dst.localeCompare(t.dst):e.src.localeCompare(t.src):e.id.localeCompare(t.id)),d=[];for(let e of u){let t=i[e.src]??0,n=i[e.dst]??0;if(n-t<=1){d.push(e);continue}let r=e.src;for(let i=t+1,a=0;i!r.nodes.includes(e))],edges:d,layout:r.layout,nodeById:c};return{layering:{layers:a,rankOf:i,dummy:o},graphWithDummies:f}}e(an,`makeProperLayering`);function on(e){let t=e.length;if(t===0)return 1/0;let n=[...e].sort((e,t)=>e-t);return t%2==1?n[(t-1)/2]:.5*(n[t/2-1]+n[t/2])}e(on,`median`);function sn(e){return e.length===0?1/0:e.reduce((e,t)=>e+t,0)/e.length}e(sn,`barycenter`);function cn(e,t,n,r){let i=new Map;for(let t of e)i.set(t,[]);for(let e of n)r===`down`?t.has(e.src)&&i.has(e.dst)&&i.get(e.dst).push(t.get(e.src)):t.has(e.dst)&&i.has(e.src)&&i.get(e.src).push(t.get(e.dst));return i}e(cn,`neighborPositionsFor`);function ln(e,t,n){let r=n.get(e)??0,i=n.get(t)??0;return r===i?e.localeCompare(t):r-i}e(ln,`currentOrderTieBreak`);function un(e,t,n){let r=new Set(e),i=new Set(t),a=Dt(e),o=Dt(t),s=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&s.push({u:a.get(e.src),v:o.get(e.dst)});return s.sort((e,t)=>e.u===t.u?e.v-t.v:e.u-t.u),Ot(s.map(e=>e.v))}e(un,`countCrossingsBetweenAdjacent`);function dn(e,t,n){return[...e].sort((e,r)=>{let i=on(t.get(e)??[]),a=on(t.get(r)??[]);return i===a?ln(e,r,n):isFinite(i)?isFinite(a)?i-a:-1:1})}e(dn,`sortByHeuristic`);function fn(e,t,n,r,i,a){let o=Dt(e),s=Dt(t),c=cn(t,o,n,r);if(!i||!a||a.length===0)return dn(t,c,s);let l=new Map;for(let e of t){let t=i(e),n=l.get(t)??[];n.push(e),l.set(t,n)}let u=[];for(let e of a){let t=l.get(e);if(!t||t.length===0)continue;let n=dn(t,c,s);u.push(...n)}let d=l.get(null);if(d&&d.length>0){let e=dn(d,c,s);for(let t of e){let e=sn(c.get(t)??[]),n=u.length;if(isFinite(e)){for(let[t,r]of u.entries())if(es.has(e.src)&&c.has(e.dst)),d=l?r.filter(e=>c.has(e.src)&&l.has(e.dst)):void 0,f=e(e=>{let n=un(t,e,u);return d&&i&&(n+=un(e,i,d)),n},`crossingScore`),p=a?new Map:null;if(a&&p)for(let e of n)p.set(e,a(e));let m=!0,h=f(o);for(;m;){m=!1;for(let e=0;e+1[...e]),i=t.edges,a=jt(t),o=Nt(t,n?.laneOrder);for(let e=0;e<3;e++){for(let e=1;e=0;e--)r[e]=fn(r[e+1],r[e],i,`up`,a,o),r[e]=pn(r[e+1],r[e],i,r[e-1],a)}return{layers:r}}e(mn,`orderLayers`);function hn(t,n,r){let i=r?.layerGap??It.DEFAULT_LAYER_GAP,a=r?.nodeGap??It.DEFAULT_NODE_GAP,o=r?.laneGap??a*2,s=r?.direction??`TB`,c=s===`LR`||s===`RL`,l=t.layers,u=Object.create(null),d=Object.create(null),f=e(e=>n.nodeById.get(e),`getNode`),p=e(e=>f(e)?.width??0,`getWidth`),m=e(e=>f(e)?.height??0,`getHeight`),h=jt(n),g=Nt(n,r?.laneOrder),_=l.map(e=>e.reduce((e,t)=>Math.max(e,m(t)),0)),v=[];if(c)for(let e=0;e+1Math.max(e,p(t)),0),n=l[e+1].reduce((e,t)=>Math.max(e,p(t)),0),r=_[e],a=_[e+1],o=r/2+a/2,s=(t+n)/2,c=Math.max(0,s-o-i);v.push(c)}let y=new Set;for(let e of l)for(let t of e)y.add(h(t));let b=y.has(null),x=g.filter(e=>y.has(e)),S=[...b?[null]:[],...x],C=Object.create(null);for(let e of x)C[e]=0;b&&(C.null=0);for(let e of l){let t=Object.create(null),n=[];for(let r of e){let e=h(r);e===null?n.push(r):(t[e]||=[]).push(r)}for(let[e,n]of Object.entries(t)){let t=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);C[e]=Math.max(C[e]??0,t)}if(b&&n.length){let e=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);C.null=Math.max(C.null??0,e)}}let w=new Map;{let e=S.map(e=>(e===null?C.null:C[e])??0),t=-(e.reduce((e,t)=>e+t,0)+o*Math.max(0,S.length-1))/2;for(let n=0;np(e)),r=i-(e.reduce((e,t)=>e+t,0)+a*(t.length-1))/2;for(let[i,o]of t.entries()){let t=e[i];u[o]=r+t/2,d[o]=T+n/2,r+=t+a}}}let o=v[e]??0;T+=n+i+o}let E=new Map;for(let e of n.edges){let t=e.ref.id;E.has(t)||E.set(t,[]),E.get(t).push(e)}for(let[,e]of E){if(e.length===0)continue;let t=e[0].ref,r=t.start,i=t.end;if(r==null||i==null)continue;let a=Math.round(((u[r]??0)+(u[i]??0))/2),o=new Set;for(let t of e)o.add(t.src),o.add(t.dst);for(let e of o)e!==r&&e!==i&&n.nodeById.get(e)?.isDummy&&(u[e]=a)}return{x:u,y:d}}e(hn,`assignCoordinates`);var gn=8;function _n(e){let t=2166136261;for(let n=0;n>>0}e(_n,`hashString`);function vn(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}e(vn,`mulberry32`);function yn(e,t){let n=[...e],r=vn(t);for(let e=n.length-1;e>0;e--){let t=Math.floor(r()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n}e(yn,`deterministicShuffle`);function bn(e,t){let n=0;for(let[r,i]of e.entries())n+=Math.abs(r-(t.get(i)??r));return n}e(bn,`sourceDistance`);function xn(e,t){let n=new Map;for(let[t,r]of e.entries())n.set(r,t);let r=0;for(let{a:e,b:i,weight:a}of t){let t=n.get(e),o=n.get(i);t!=null&&o!=null&&(r+=a*Math.abs(t-o))}return r}e(xn,`laneArrangementCost`);function Sn(e){let t=Mt(e);if(t.length<2)return[];let n=new Map(t.map((e,t)=>[e,t])),r=jt(e),i=new Map;for(let t of e.layout.edges??[]){if(t.isLayoutOnly)continue;let a=typeof t.start==`string`?t.start:void 0,o=typeof t.end==`string`?t.end:void 0;if(!a||!o||!e.nodeById.has(a)||!e.nodeById.has(o))continue;let s=r(a),c=r(o);if(!s||!c||s===c)continue;let l=n.get(s),u=n.get(c);if(l==null||u==null)continue;let[d,f]=l<=u?[s,c]:[c,s],p=`${d}\0${f}`,m=i.get(p);m?m.weight++:i.set(p,{a:d,b:f,weight:1})}return[...i.values()]}e(Sn,`buildWeightedLaneEdges`);function Cn(e,t,n){let r=[...e],i=xn(r,t),a=!0,o=0,s=Math.max(1,r.length);for(;a&&oe.a===t.a?e.b.localeCompare(t.b):e.a.localeCompare(t.a)).map(({a:e,b:t,weight:n})=>`${e}:${t}:${n}`).join(`|`);return _n(`${e.join(`|`)}#${r}#${n}`)}e(Tn,`seedForRestart`);function En(e,t={}){let n=Mt(e);if(n.length<2)return n;let r=Sn(e);if(r.length===0)return n;let i=new Map(n.map((e,t)=>[e,t])),a=Cn(n,r,i),o=Math.max(0,t.restarts??gn);for(let e=0;e$&&c*3>=s?o>0?`bottom`:`top`:s>$?a>0?`right`:`left`:n}e(Pn,`chooseOrthogonalSide`);function Fn(e,t){return Math.abs(e.to-t.from)<$||Math.abs(e.to-t.to)<$?e.to:e.from}e(Fn,`sharedLineEndpointCoord`);function In(e,t){return e.orient===`vertical`?{x:e.coord,y:t}:{x:t,y:e.coord}}e(In,`pointOnLine`);function Ln(t,n){let r=t.nodes??[],i=t.edges??[],a=[];for(let e of i)e.isLayoutOnly||a.push({...e,__originalEdge:e});let o=new Map,s=new Map,c=[],l=n===`LR`;for(let e of r)o.set(e.id,e);let u=r.filter(e=>e.isGroup&&!e.parentId);for(let t of u){let n={id:t.id},i=e(e=>{s.set(e.id,n),r.filter(t=>t.parentId===e.id).forEach(i)},`assignLane`);i(t)}let d=r.filter(e=>!e.isGroup&&!e.isEdgeLabel).map(e=>{let t=e.width??10,n=e.height??10,r=e.x??0,i=e.y??0,a=On;return{nodeId:e.id,minX:r-t/2-a,maxX:r+t/2+a,minY:i-n/2-a,maxY:i+n/2+a,visualXHalfExtent:l?n/2+a:t/2+a}}),f=e((e,t,n,r)=>{let i=c.find(n=>n.orientation===e&&Math.abs(n.coord-t)<1);return i||(i={id:`pipe-${e}-${t.toFixed(0)}`,orientation:e,coord:t,spanMin:n,spanMax:r,tracks:[]},c.push(i)),i.spanMin=Math.min(i.spanMin,n),i.spanMax=Math.max(i.spanMax,r),i},`getOrAddPipe`),p=e((e,t)=>{let n=e.width??10,r=e.height??10,i=e.x??0,a=e.y??0;switch(t){case`top`:return{x:i,y:a-r/2};case`bottom`:return{x:i,y:a+r/2};case`left`:return{x:i-n/2,y:a};case`right`:return{x:i+n/2,y:a}}},`portForSide`),m=e((e,t,n)=>p(e,Pn(e,t,n?`bottom`:`top`)),`getOrthogonalPort`),h=[],g=[],_=new Set,v=1e3,y=e((e,t,n)=>{if(h.length===0)return 0;let r=Math.abs(t.y-n.y)<$,i=Math.abs(t.x-n.x)<$;if(!r&&!i)return 0;let a=0;if(r){let r=t.y,i=Math.min(t.x,n.x)-$,o=Math.max(t.x,n.x)+$;if(o<=i)return 0;for(let t of h)t.edgeIndex!==e&&t.orientation===`vertical`&&(t.pipe.coordo||t.from-$<=r&&t.to+$>=r&&(a+=v))}else if(i){let r=t.x,i=Math.min(t.y,n.y)-$,o=Math.max(t.y,n.y)+$;if(o<=i)return 0;for(let t of h)t.edgeIndex!==e&&t.orientation===`horizontal`&&(t.pipe.coordo||t.from-$<=r&&t.to+$>=r&&(a+=v))}return a},`crossingPenalty`),b=a.map((e,t)=>{if(!e.start||!e.end)return{idx:t,crossLane:0,dx:0,dy:0};let n=o.get(e.start),r=o.get(e.end),i=s.get(e.start),a=s.get(e.end);return{idx:t,crossLane:i&&a&&i.id!==a.id?1:0,dx:n&&r?Math.abs((r.x??0)-(n.x??0)):0,dy:n&&r?Math.abs((r.y??0)-(n.y??0)):0}}).sort((e,t)=>{if(e.crossLane!==t.crossLane)return t.crossLane-e.crossLane;let n=e.dx+e.dy,r=t.dx+t.dy;return Math.abs(n-r)>1?n-r:e.idx-t.idx}).map(e=>e.idx),x=e((e,t,n,r)=>{let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return!!d.find(c=>n&&c.nodeId===n||r&&c.nodeId===r?!1:Math.abs(e.x-t.x)>$?c.minYe.y&&c.maxX>i&&c.minXe.x&&c.maxY>o&&c.minYPn(e,t,`bottom`),`determineSide`),T=new Map;for(let[e,t]of a.entries()){if(!t.start||!t.end||t.start===t.end||t.points&&t.points.length>0)continue;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)continue;let i=(r.x??0)-(n.x??0),a=(r.y??0)-(n.y??0);T.set(e,{edgeIdx:e,srcId:t.start,dstId:t.end,srcSide:w(n,{x:r.x??0,y:r.y??0}),dstSide:w(r,{x:n.x??0,y:n.y??0}),absDx:Math.abs(i),absDy:Math.abs(a),dxSign:Math.sign(i),dySign:Math.sign(a)})}let E=e(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.absDx===0?1/0:e.absDy/e.absDx:e.absDy===0?1/0:e.absDx/e.absDy,`preferenceStrength`),D=e(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.dxSign>=0?`right`:`left`:e.dySign>=0?`bottom`:`top`,`secondarySide`),O=new Map;for(let e of T.values()){let t=`${e.srcId}:${e.srcSide}`;O.has(t)||O.set(t,[]),O.get(t).push(e)}let k=new Map,A=e((e,t)=>`${e}:${t}`,`loadKey`);for(let e of T.values())k.set(A(e.srcId,e.srcSide),(k.get(A(e.srcId,e.srcSide))??0)+1),k.set(A(e.dstId,e.dstSide),(k.get(A(e.dstId,e.dstSide))??0)+1);for(let e of O.values())if(!(e.length<2)){e.sort((e,t)=>{let n=E(e),r=E(t);return Math.abs(n-r)>1e-9?r-n:e.edgeIdx-t.edgeIdx});for(let t=1;t=i||(k.set(A(n.srcId,n.srcSide),i-1),k.set(A(n.srcId,r),a+1),n.srcSide=r)}}let j=e(e=>{let t=e?.shape;return t===`question`||t===`diamond`},`isDiamondNode`),M=new Map;for(let e of T.values())M.has(e.dstId)||M.set(e.dstId,new Set),M.get(e.dstId).add(e.dstSide);for(let e of T.values()){if(!j(o.get(e.srcId)))continue;let t=M.get(e.srcId);if(!t?.has(e.srcSide))continue;let n=D(e);if(t.has(n)||(k.get(A(e.srcId,n))??0)>0)continue;let r=k.get(A(e.srcId,e.srcSide))??0;k.set(A(e.srcId,e.srcSide),Math.max(0,r-1)),k.set(A(e.srcId,n),1),e.srcSide=n}for(let e of T.values()){let{edgeIdx:t,srcId:n,dstId:r,srcSide:i,dstSide:a}=e,s=o.get(n),c=o.get(r),l=`${n}:${i}:src`,u=i===`top`||i===`bottom`?c.x??0:c.y??0;S.has(l)||S.set(l,[]),S.get(l).push({edgeIdx:t,oppositeCoord:u});let d=`${r}:${a}:dst`,f=a===`top`||a===`bottom`?s.x??0:s.y??0;S.has(d)||S.set(d,[]),S.get(d).push({edgeIdx:t,oppositeCoord:f})}let N=new Map;for(let[e,t]of S){if(t.length<2)continue;t.sort((e,t)=>e.oppositeCoord-t.oppositeCoord);let n=e.split(`:`),r=n.slice(0,-2).join(`:`),i=n[n.length-2],a=n[n.length-1],s=o.get(r);if(!s)continue;let c=i===`left`||i===`right`?s.height??10:s.width??10,l=s.shape,u=l===`question`||l===`diamond`?c*.3:c,d=Math.min(20,Math.max(8,u/(t.length+1))),f=-(d*(t.length-1))/2;for(let[e,n]of t.entries()){let t=f+e*d,r=`${n.edgeIdx}:${a}`;N.set(r,t)}}let P=e(e=>!!a[e]?.labelNodeId,`edgeHasLabelNode`),F=e((e,t)=>e?(S.get(`${e}:${t}:src`)??[]).some(({edgeIdx:e})=>P(e))||(S.get(`${e}:${t}:dst`)??[]).some(({edgeIdx:e})=>P(e)):!1,`faceHasLabelNode`),I=e((e,t,n)=>t===`top`||t===`bottom`?{x:e.x+n,y:e.y}:{x:e.x,y:e.y+n},`applyPortOffset`),ee=e((e,t,n)=>{let r=T.get(e),i={x:n.x??0,y:n.y??0},a={x:t.x??0,y:t.y??0},o=r?.srcSide??w(t,i),s=r?.dstSide??w(n,a),c=r?p(t,r.srcSide):m(t,i,!0),l=r?p(n,r.dstSide):m(n,a,!1),u=N.get(`${e}:src`),d=N.get(`${e}:dst`);return u!==void 0&&(c=I(c,o,u)),d!==void 0&&(l=I(l,s,d)),{pSrcPort:c,pDstPort:l,srcSide:o,dstSide:s}},`portsForEdge`);for(let t of b){let n=a[t];if(g[t]=[],!n.start||!n.end||n.points&&n.points.length>0||n.start===n.end)continue;let r=o.get(n.start),i=o.get(n.end);if(!r||!i)continue;let{pSrcPort:s,pDstPort:u,srcSide:p,dstSide:m}=ee(t,r,i),v={...s},b={...u},w=p===`top`||p===`bottom`,T=m===`top`||m===`bottom`;w?v.y=s.y>(r.y??0)?s.y+Mn:s.y-Mn:v.x=s.x>(r.x??0)?s.x+Mn:s.x-Mn,T?b.y=u.y>(i.y??0)?u.y+Mn:u.y-Mn:b.x=u.x>(i.x??0)?u.x+Mn:u.x-Mn;let E=e((e,t)=>{for(let n of d)if(!t.includes(n.nodeId)&&e.x>n.minX&&e.xn.minY&&e.y{if(i){let i=e.y>(t.y??0);return{x:(n.x??0)>=e.x?r.maxX+kn:r.minX-kn,y:i?r.maxY+An:r.minY-An,leavesPositiveSide:i}}let a=e.x>(t.x??0),o=(n.y??0)>=e.y;return{x:a?r.maxX+kn:r.minX-kn,y:o?r.maxY+An:r.minY-An,leavesPositiveSide:a}},`obstacleDetour`),O=[],k=[n.start,n.end],A=E(v,k);if(A.inside&&A.obstacle){let e=A.obstacle;if(w){let t=D(s,r,i,e,!0);v.x=t.x,v.y=t.y;let n=t.leavesPositiveSide?Math.min(e.minY-2,s.y+Mn):Math.max(e.maxY+2,s.y-Mn);O=[{x:s.x,y:n},{x:t.x,y:n},{x:t.x,y:t.y}]}else{let t=D(s,r,i,e,!1),n=t.leavesPositiveSide?Math.min(e.minX-2,s.x+Mn):Math.max(e.maxX+2,s.x-Mn);v.x=t.x,v.y=t.y,O=[{x:n,y:s.y},{x:n,y:t.y},{x:t.x,y:t.y}]}}let j=[],M=E(b,k);if(M.inside&&M.obstacle){let e=M.obstacle;if(T){let t=D(u,i,r,e,!0);b.x=t.x,b.y=t.y,j=[{x:t.x,y:t.y},{x:u.x,y:t.y}]}else{let t=D(u,i,r,e,!1);b.x=t.x,b.y=t.y,j=[{x:t.x,y:t.y},{x:t.x,y:u.y}]}}if(O.length===0&&j.length===0){let e=kn,r=Math.abs(v.x-b.x)1||c>1,d=C.get(n.start??``)??0,f=C.get(n.end??``)??0,g=o>1&&F(n.start,p)||c>1&&F(n.end,m);if((r||i)&&!a&&(!l||l&&!g&&(o<=1||d<=2)&&(c<=1||f<=2))&&!x(s,u,n.start,n.end)){n.points=[{...s},{...v},{...b},{...u}],_.add(t);let e=i?`horizontal`:`vertical`,r=i?s.y:s.x,a=i?Math.min(s.x,u.x):Math.min(s.y,u.y),o=i?Math.max(s.x,u.x):Math.max(s.y,u.y),c={id:`fast-path-${e}-${r.toFixed(0)}-${t}`,orientation:e,coord:r,spanMin:a,spanMax:o,tracks:[]};h.push({edgeIndex:t,segmentIndex:0,orientation:e,pipe:c,trackIndex:0,from:a,to:o});continue}}v.x=f(`vertical`,v.x,v.y,v.y).coord,b.x=f(`vertical`,b.x,b.y,b.y).coord;let P=Math.min(v.x,b.x)-50,I=Math.max(v.x,b.x)+50,L=Math.min(v.y,b.y)-50,R=Math.max(v.y,b.y)+50;for(let e of d){let t=Math.min(v.x,b.x),n=Math.max(v.x,b.x),r=Math.min(v.y,b.y),i=Math.max(v.y,b.y);e.minXt&&e.minYr&&(P=Math.min(P,e.minX-jn),I=Math.max(I,e.maxX+jn),L=Math.min(L,e.minY-jn),R=Math.max(R,e.maxY+jn))}for(let e of d){if(e.maxXI||e.maxYR)continue;let t=kn;f(`horizontal`,e.minY-t,P,I),f(`horizontal`,e.maxY+t,P,I);let n=An;f(`vertical`,e.minX-n,L,R),f(`vertical`,e.maxX+n,L,R)}f(`horizontal`,v.y,P,I),f(`horizontal`,b.y,P,I);let z=c.filter(e=>e.orientation===`horizontal`&&e.coord>=L&&e.coord<=R),te=c.filter(e=>e.orientation===`vertical`&&e.coord>=P&&e.coord<=I),ne=e((e,t)=>`${e.toFixed(1)},${t.toFixed(1)}`,`getKey`),B=ne(v.x,v.y),re=ne(b.x,b.y),ie=new Map,ae=new Map,V=new Map,oe=new Set,H=[];ie.set(B,0),V.set(B,`n`),H.push({key:B,f:Math.hypot(b.x-v.x,b.y-v.y),pt:v}),oe.add(B);let U=[],W=e((e,t)=>x(e,t,n.start,n.end),`checkSegmentBlocked`),G={x:b.x,y:v.y},K=W(v,G),se=W(G,b),ce=K||se,le={x:v.x,y:b.y},ue=W(v,le),de=W(le,b);if(ce?ue||de||(U=Math.abs(v.x-b.x)<$?[v,b]:[v,le,b]):U=Math.abs(v.y-b.y)<$||Math.abs(v.x-b.x)<$?[v,b]:[v,G,b],U.length===0)for(;H.length>0;){H.sort((e,t)=>e.f-t.f);let e=H.shift();if(oe.delete(e.key),e.key===re){let e=re,t=b;for(U=[t];ae.has(e);){let n=ae.get(e);U.unshift(n),t=n,e=ne(n.x,n.y)}break}let r=e.pt.x,i=e.pt.y,a=te.sort((e,t)=>e.coord-t.coord),o=a.findIndex(e=>Math.abs(e.coord-r)<1),s=z.sort((e,t)=>e.coord-t.coord),c=s.findIndex(e=>Math.abs(e.coord-i)<1),l=[];o>0&&l.push({x:a[o-1].coord,y:i}),o>=0&&o0&&l.push({x:r,y:s[c-1].coord}),c>=0&&ce.nodeId===n.start||e.nodeId===n.end?!1:o===s?e.minXr&&e.maxY>c&&e.minYi&&e.maxX>o&&e.minX10&&x<-5||g<-10&&x>5)&&(m=Math.abs(x)*100),(h>10&&_<-5||h<-10&&_>5)&&(m+=Math.abs(_)*50);let S=0,C=V.get(e.key)??`n`,w=Math.abs(_)>$?`h`:`v`;C!==`n`&&C!==w&&(S=50);let T=f+p+m+S,E=(ie.get(e.key)??1/0)+T,D=Math.abs(b.x-a.x)+Math.abs(b.y-a.y);if(E<(ie.get(u)??1/0))if(ae.set(u,e.pt),ie.set(u,E),V.set(u,w),!oe.has(u))H.push({key:u,f:E+D,pt:a}),oe.add(u);else{let e=H.findIndex(e=>e.key===u);e!==-1&&(H[e].f=E+D)}}}if(U.length===0&&(U=[v,{x:v.x,y:b.y},b]),U.length>4){let t=U[0],n=U[U.length-1],r=Math.min(t.x,n.x),i=Math.max(t.x,n.x),a=Math.min(t.y,n.y),o=Math.max(t.y,n.y);for(let e of U)r=Math.min(r,e.x),i=Math.max(i,e.x),a=Math.min(a,e.y),o=Math.max(o,e.y);let s=i>Math.max(t.x,n.x),c=re.minXr&&e.minYa);if(s.length>0){let r=Math.max(t.x,n.x);for(let t of s){let n=(t.minX+t.maxX)/2;if(t.visualXHalfExtent===void 0||isNaN(t.visualXHalfExtent))continue;let i=n+t.visualXHalfExtent+e;r=Math.max(r,i)}isNaN(r)||(i=r)}}if(c){let i=d.filter(r=>r.minXMath.min(t.y,n.y));if(i.length>0){let a=Math.min(t.x,n.x);for(let t of i){let n=(t.minX+t.maxX)/2-t.visualXHalfExtent-e;a=Math.min(a,n)}r=a}}}let u=e(e=>{let r=n.y>t.y,i=d.filter(e=>{let r=Math.min(t.x,n.x)e.minX,i=Math.min(t.y,n.y)e.minY;return r&&i}),a=i;if(l&&i.length>0){let t=i.filter(t=>t.minXe);t.length>0&&(a=t)}if(a.length===0)return n.y;let o=kn;if(r){let e=Math.max(...a.map(e=>e.maxY))+o;if(ee.minY))-o;if(e>n.y+$)return e}return n.y},`findBestReturnY`),f=e(e=>{let r=u(e),i={x:e,y:t.y},a={x:e,y:r},o={x:n.x,y:r},s=W(t,i),c=W(i,a),l=W(a,o),d=r!==n.y&&W(o,n);return!s&&!c&&!l&&!d?Math.abs(r-n.y)<$?[t,i,a,n]:[t,i,a,o,n]:null},`trySimplifyWithDetourX`),p=s&&!c?f(i):c&&!s?f(r):null;p&&(U=p)}let q=[s,...O,...U,...j.reverse(),u];if(q.length>=3){let e=q[q.length-1],t=q[q.length-2],n=q[q.length-3],r=Math.abs(n.y-t.y)<$&&Math.abs(t.y-e.y)<$,i=Math.abs(n.x-t.x)<$&&Math.abs(t.x-e.x)<$;if(r){let r=Math.sign(t.x-n.x),i=Math.sign(e.x-n.x);r!==0&&r===i&&Math.abs(t.x-n.x)>Math.abs(e.x-n.x)&&q.splice(-2,1)}else if(i){let r=Math.sign(t.y-n.y),i=Math.sign(e.y-n.y);r!==0&&r===i&&Math.abs(t.y-n.y)>Math.abs(e.y-n.y)&&q.splice(-2,1)}}let J=[q[0]];for(let e=1;et.x!=r.x>n.x){J.push(n);continue}continue}if(Math.abs(t.x-n.x)<$&&Math.abs(n.x-r.x)<$){if(n.y>t.y!=r.y>n.y){J.push(n);continue}continue}J.push(n)}J.push(q[q.length-1]);for(let e=0;ee.from{let i=!r.segments.some(n=>(n.edgeIndex!==t.edgeIndex||n.segmentIndex!==t.segmentIndex)&&L(n,e)),a=!n.segments.some(n=>(n.edgeIndex!==e.edgeIndex||n.segmentIndex!==e.segmentIndex)&&L(n,t));return i&&a?(e.trackIndex=r.index,t.trackIndex=n.index,n.segments=[...n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),{edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,from:t.from,to:t.to}],r.segments=[...r.segments.filter(e=>e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex),{edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to}],!0):!1},`trySwapSegmentsAcrossTracks`),z=e(e=>{let t=e.tracks.length;return e.tracks[t]={index:t,coord:e.coord,segments:[]},t},`createNewTrack`),te=e((e,t)=>{let n=e.pipe.tracks[e.trackIndex];n.segments=n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),e.trackIndex=t,e.pipe.tracks[t].segments.push({edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to})},`moveSegmentToTrack`),ne=e((e,t)=>{let n=g[e.edgeIndex];for(let r of n){let n=h[r];n.pipe===e.pipe&&te(n,t)}},`moveSegmentChainToTrack`),B=e(e=>{let t=g[e.edgeIndex],n=t.indexOf(h.indexOf(e)),r=[];return n>0&&r.push(h[t[n-1]]),n{if(e.orientation===t.orientation)return!1;let n=e.orientation===`horizontal`?e:t,r=e.orientation===`horizontal`?t:e;return r.pipe.coord>n.from&&r.pipe.coordr.from&&n.pipe.coord{for(let n of e.tracks)if(!n.segments.some(e=>(e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex)&&L(e,t)))return n.index;return-1},`findAvailableTrack`),ae=e((e,t)=>{if(e.trackIndex===t.trackIndex)return L(e,t);let n=B(e),r=B(t);return n.some(e=>r.some(t=>re(e,t)))},`segmentsConflict`),V=e((e,t,n)=>{if(R(e,t,e.pipe.tracks[e.trackIndex],t.pipe.tracks[t.trackIndex]))return;let r=ie(e.pipe,t);n(t,r===-1?z(e.pipe):r)},`resolveTrackConflict`),oe=e(e=>{let t=0;for(let n=0;n{if(H.has(e))return H.get(e);let t=g[e];if(t.length===0){let t={dest:0,deviation:0,base:0,delta:0};return H.set(e,t),t}let n=h[t[0]].pipe.coord,r=n;for(let e=1;eMath.abs(t-n)?e:t;break}}let i=Math.abs(r-n),a={dest:r,deviation:i,base:n,delta:r-n};return H.set(e,a),a},`getDestInfo`),W=e(()=>{let t=0,n=new Map;for(let[e,t]of a.entries())g[e].length!==0&&t.start&&(n.has(t.start)||n.set(t.start,[]),n.get(t.start).push(e));let r=e(e=>{let t=a[e];if(!t.start||!t.end)return 0;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)return 0;let i=(r.x??0)-(n.x??0),s=(r.y??0)-(n.y??0);return Math.abs(i)+Math.abs(s)},`getEdgeDistance`);for(let e of n.values()){e.sort((e,t)=>{let n=U(e),i=U(t);if(Math.abs(n.deviation-i.deviation)>1)return n.deviation-i.deviation;if(Math.abs(n.dest-i.dest)>1)return n.dest-i.dest;let a=r(e),o=r(t);if(Math.abs(a-o)>1)return o-a;let s=g[e].length,c=g[t].length;if(s!==c)return s-c;if(s===1){let n=g[e][0],r=g[t][0];if(h[n]&&h[r]){let e=h[n],t=h[r],i=Math.abs(e.to-e.from),a=Math.abs(t.to-t.from);if(Math.abs(i-a)>1)return i-a}}return 0});let n=e.map(e=>h[g[e][0]]);t+=oe(n)}return t},`fixSourceHandleCrossings`),G=e(()=>{let t=0,n=new Map;for(let[e,t]of a.entries())g[e].length!==0&&t.end&&(n.has(t.end)||n.set(t.end,[]),n.get(t.end).push(e));for(let r of n.values()){r.sort((t,n)=>{let r=e(e=>{let t=g[e];if(t.length<2)return 0;let n=h[t[t.length-2]];return Math.abs(n.to-n.from)},`getDist`),i=r(t),a=r(n);return Math.abs(i-a)>.1?i-a:t-n});let n=r.map(e=>h[g[e][g[e].length-1]]);t+=oe(n)}return t},`fixTargetHandleCrossings`),K=e(()=>{let e=0;for(let t of c){let n=[];for(let e of t.tracks)for(let t of e.segments){let e=g[t.edgeIndex].find(e=>h[e].segmentIndex===t.segmentIndex);e!==void 0&&n.push(h[e])}n.sort((e,t)=>e.edgeIndex-t.edgeIndex||e.segmentIndex-t.segmentIndex);for(let t=0;t{e.segments.forEach(t=>{n.push({edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,trackIndex:e.index,from:t.from,to:t.to})})}),n.sort((e,t)=>e.from-t.from);let r=[];if(n.length>0){let e=[n[0]],t=n[0].to;for(let i=1;ir.add(e.trackIndex));let i=new Map;n.forEach(e=>{let t=U(e.edgeIndex);i.set(e.trackIndex,(i.get(e.trackIndex)??0)+t.delta)});let a=[...r].filter(e=>(i.get(e)??0)<-1),o=[...r].filter(e=>(i.get(e)??0)>1),s=[...r].filter(e=>Math.abs(i.get(e)??0)<=1);a.sort((e,t)=>(i.get(t)??0)-(i.get(e)??0)),o.sort((e,t)=>(i.get(e)??0)-(i.get(t)??0));let c=e((e,r)=>{n.filter(t=>t.trackIndex===e).forEach(e=>{let n=_.has(e.edgeIndex)?t.coord:r;ce.set(`${e.edgeIndex}-${e.segmentIndex}`,n)})},`assignCoord`),l=0;for(let e of a)l++,c(e,t.coord-l*Nn);if(s.length===0&&r.size>0){let e=[...r].sort((e,t)=>Math.abs(i.get(e)??0)-Math.abs(i.get(t)??0))[0],t=a.indexOf(e);t!==-1&&a.splice(t,1);let n=o.indexOf(e);n!==-1&&o.splice(n,1),s.push(e)}let u=0;for(let e of s){if(u===0)c(e,t.coord);else{let n=u%2==1?1:-1,r=Math.ceil(u/2);c(e,t.coord+n*r*Nn*.5)}u++}let d=0;for(let e of o)d++,c(e,t.coord+d*Nn)}}for(let[e,t]of a.entries()){let n=g[e]??[];if(n.length===0)continue;let r=[],{pSrcPort:i,pDstPort:a}=ee(e,o.get(t.start),o.get(t.end)),s=n.map(e=>{let t=h[e],n=ce.get(`${t.edgeIndex}-${t.segmentIndex}`)??t.pipe.coord;return{orient:t.orientation,coord:n,from:t.from,to:t.to}});r.push(i);for(let e=0;e$&&r.push(In(t,i)),c&&o.orient===t.orient)if(Math.abs(t.coord-o.coord)>$){let e=t.orient===`vertical`?(i+o.from)/2:Fn(t,o);r.push(In(t,e),In(o,e))}else(e===0||e===s.length-2)&&r.push(In(t,Fn(t,o)));else if(c)r.push(In(t,o.coord));else{let e=Math.abs(t.from-i)$||Math.abs(c.y-a.y)>$)&&r.push(a);let l=[];r.length>0&&l.push(r[0]);for(let e=1;e$||Math.abs(t.y-n.y)>$)&&l.push(t)}t.points=l}for(let e of a){let t=e.__originalEdge;t&&e.points&&(t.points=e.points)}t.edges=(t.edges??[]).filter(e=>!e.isLayoutOnly);let le=e((e,t)=>{let n=t.x??0,r=t.y??0,i=t.width??0,a=t.height??0;if(i<=0||a<=0)return e;let o=n-i/2,s=n+i/2,c=r-a/2,l=r+a/2;if(e.xs||e.yl)return e;let u=e.x-o,d=s-e.x,f=e.y-c,p=l-e.y,m=Math.min(u,d,f,p);return m===u?{x:o,y:e.y}:m===d?{x:s,y:e.y}:m===f?{x:e.x,y:c}:{x:e.x,y:l}},`nodeBoundaryClamp`);for(let e of t.edges){let t=e.points;if(!t||t.length<2)continue;let n=e.start,r=e.end,i=n?o.get(n):void 0,a=r?o.get(r):void 0;i&&(t[0]=le(t[0],i)),a&&(t[t.length-1]=le(t[t.length-1],a))}return t}e(Ln,`routeEdgesOrthogonal`);function Rn(e){return e.direction??`TB`}e(Rn,`getSwimlaneDirection`);function zn(e){let t=d(e),n=e.config.flowchart?.nodeSpacing??40,r=e.config.flowchart?.rankSpacing??100,i=e.config.swimlane?.ignoreCrossLaneEdges??!0,a=e.config.swimlane?.optimizeRanksByCrossings??!0,o=e.config.swimlane?.automaticLaneOrdering??!1,s=Rn(e),{ordered:c,coordinates:l}=Dn(t,{nodeGap:n,layerGap:r,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:s});f(t,c,l,{nodeGap:n,layerGap:r});for(let t of e.edges??[])delete t.points;Ln(e,s);for(let t of e.edges??[])(!t.curve||t.curve===`basis`)&&(t.curve=`rounded`);return _t(e,s),gt(e),s}e(zn,`runSwimlaneLayoutCore`);function Bn(e){u(e);let t=m(e);e.nodes=t.nodes,e.edges=t.edges}e(Bn,`prepareSwimlaneLayout`);var Vn=n({prepareLayout:Bn,runLayoutCore:zn,afterPaint:i});export{Vn as render}; \ No newline at end of file +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as n}from"./app-chunk-3FUC2YCW.js";import{t as r}from"./app-chunk-NETBCI7D.js";function i(e,{measure:t}){let n=e.config?.swimlane?.lineHops;if(n===!1)return;let i=n===`gap`?`gap`:`arc`,a=e.edges.filter(e=>Array.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));r(t.groups.edgePaths,a,{enabled:!0,jumpRadius:6,jumpStyle:i})}e(i,`applySwimlaneLineJumps`);var a=`__swimlane_default__`,o=21,s=20;function c(e){return Math.max(e.padding??s,s)}e(c,`topLaneHorizontalPadding`);function l(e){let{x:t,y:n,width:r,height:i}=e,a=e.swimlaneContentTop;if(typeof t!=`number`||typeof n!=`number`||typeof r!=`number`||typeof i!=`number`||typeof a!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a)||r<=0||i<=0){delete e.groupTitleRect;return}let s=n-i/2,c=Math.min(a,n+i/2),l=s+Math.min(o,Math.max(0,c-s));if(l<=s){delete e.groupTitleRect;return}e.groupTitleRect={left:t-r/2,right:t+r/2,top:s,bottom:l}}e(l,`assignTopLaneTitleRect`);function u(e){let t=e.direction,n=e.nodes??=[];for(let n of e.nodes??[])n.isGroup&&!n.parentId&&(n.shape=`swimlane`,t&&(n.direction=t));let r=n.filter(e=>!e.isGroup&&!e.parentId);if(r.length===0)return;let i=n.find(e=>e.id===a);i?i.isGroup&&(i.shape=`swimlane`,t&&(i.direction=t)):(i={id:a,label:``,isGroup:!0,shape:`swimlane`,padding:20,look:e.config?.look,colorIndex:n.reduce((e,t)=>Math.max(e,t.colorIndex??-1),-1)+1,...t?{direction:t}:{}},n.push(i));for(let e of r)e.parentId=a}e(u,`prepareLayoutForSwimlanes`);function d(e){let t=new Map;for(let n of e.nodes??[])t.set(n.id,n);let n=[];for(let t of e.edges??[]){let e=typeof t.start==`string`?t.start:void 0,r=typeof t.end==`string`?t.end:void 0;!e||!r||t.labelNodeId||n.push({id:t.id,src:e,dst:r,ref:t})}let r=e.nodes??[],i=r.filter(e=>e.isGroup),a=r.filter(e=>!e.isGroup);return{nodes:[...[...i].reverse(),...a].map(e=>e.id),edges:n,layout:e,nodeById:t}}e(d,`toGraphView`);function f(e,t,n,r){let{layout:i}=e,a=e.nodeById,o=r?.layerGap??100,s=r?.nodeGap??40,u=0;for(let e of t.layers){let t=0;for(let r of e){let e=a.get(r);if(!e){t++;continue}e.layer=u,e.order=t;let i=n.x[r]??t*s,c=n.y[r]??u*o;e.x=i,e.y=c,t++}u++}let d=i.nodes??[],f=new Map,p=[];for(let e of d){if(!e?.isGroup)continue;e.parentId||p.push(e);let t=d.filter(t=>t.parentId===e.id),r=1/0,i=-1/0,a=1/0,o=-1/0;for(let e of t){let t=e.x??n.x[e.id],s=e.y??n.y[e.id],c=e.width??0,l=e.height??0;t!=null&&s!=null&&(r=Math.min(r,t-c/2),i=Math.max(i,t+c/2),a=Math.min(a,s-l/2),o=Math.max(o,s+l/2))}if(r===1/0||a===1/0)e.x=e.x??0,e.y=e.y??0,e.width=e.width??0,e.height=e.height??0;else{let t=e.padding??20,n=e.parentId?t:2*c(e),s=t,l=Math.max(0,i-r)+n,u=Math.max(0,o-a)+s,d=(r+i)/2,p=(a+o)/2;e.x=d,e.y=p,e.width=l,e.height=u,f.set(e.id,{minX:r,maxX:i,minY:a,maxY:o})}}if(p.length>0&&f.size>0){let e=1/0,t=-1/0,n=0;for(let r of p){let i=r.padding??20;i>n&&(n=i);let a=f.get(r.id);a&&(e=Math.min(e,a.minY),t=Math.max(t,a.maxY))}if(e!==1/0&&t!==-1/0){let r=Math.max(0,t-e)+2*Math.max(n,36),i=(e+t)/2;for(let t of p)t.y=i,t.height=r,t.swimlaneContentTop=e;let a=[...p].sort((e,t)=>(e.x??0)-(t.x??0)),o=[],s=[],u=[];for(let e of a){let t=f.get(e.id);if(!t)continue;let n=Math.max(0,t.maxX-t.minX)+2*c(e),r=(t.minX+t.maxX)/2;o.push(e.id),s.push(r),u.push(n)}let d=o.length;if(d>0){let e=new Map;if(d===1)e.set(o[0],u[0]);else{let t=[];for(let e=0;e0&&i>0?{cx:t,cy:n,rect:P(t,n,r,i)}:void 0}e(g,`measuredNodeRect`);function _(e){if(e.isGroup)return;let t=g(e);if(t)return{id:String(e.id??``),cx:t.cx,cy:t.cy,rect:t.rect}}e(_,`nodeBoundsInfoFor`);function v(e,t,n=h){return Math.abs(e.x-t.x)n}e(x,`isHorizontalSegment`);function S(e,t,n=h){return y(e,t,n)&&Math.abs(e.y-t.y)>n}e(S,`isVerticalSegment`);function C(e,t,n,r){return Math.max(0,Math.min(Math.max(e,t),Math.max(n,r))-Math.max(Math.min(e,t),Math.min(n,r)))}e(C,`overlapLength`);function w(e,t,n=h){return e.horizontal&&t.horizontal&&b(e.a,t.a,n)?C(e.a.x,e.b.x,t.a.x,t.b.x):e.vertical&&t.vertical&&y(e.a,t.a,n)?C(e.a.y,e.b.y,t.a.y,t.b.y):0}e(w,`sameAxisSegmentOverlapLength`);function T(e,t=h){let n=[];for(let r=0;r0?n[n.length-1]:void 0;(!e||!v(e,r,t))&&n.push({x:r.x,y:r.y})}return n}e(D,`dedupeConsecutivePoints`);function O(e,t=h){if(!e||e.length!==4)return;let[n,r,i,a]=e;return x(n,r,t)&&S(r,i,t)&&x(i,a,t)?{kind:`HVH`,p0:n,p1:r,p2:i,p3:a}:S(n,r,t)&&x(r,i,t)&&S(i,a,t)?{kind:`VHV`,p0:n,p1:r,p2:i,p3:a}:void 0}e(O,`classifyThreeSegmentRoute`);function k(e,t,n,r=0){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return a>n.left-r&&in.top-r&&ot.left+n&&e.xt.top+n&&e.y=t.right&&e.top<=t.top&&e.bottom>=t.bottom}e(j,`rectContainsRect`);function M(e,t){return e.leftt.left&&e.topt.top}e(M,`rectsOverlap`);function N(e,t){return{left:e.left-t,right:e.right+t,top:e.top-t,bottom:e.bottom+t}}e(N,`inflateRect`);function P(e,t,n,r){return{left:e-n/2,right:e+n/2,top:t-r/2,bottom:t+r/2}}e(P,`rectFromCenterSize`);function F(e){return g(e)?.rect}e(F,`rectOfNodeBounds`);function I(e,t){switch(t){case`top`:return{x:e.cx,y:e.rect.top};case`bottom`:return{x:e.cx,y:e.rect.bottom};case`left`:return{x:e.rect.left,y:e.cy};case`right`:return{x:e.rect.right,y:e.cy}}}e(I,`portForRectSide`);function ee(e,t,n,r,i,a=h){let o=t===`left`||t===`right`,s=r===`left`||r===`right`;if(o&&s){if(t===`right`&&r===`left`&&e.xn.x){if(b(e,n,a))return[e,n];let t=(e.x+n.x)/2;return[e,{x:t,y:e.y},{x:t,y:n.y},n]}if(t===r){if(b(e,n,a))return;let r=t===`left`?Math.min(e.x,n.x)-i:Math.max(e.x,n.x)+i;return[e,{x:r,y:e.y},{x:r,y:n.y},n]}return}if(!o&&!s){if(t===r){if(y(e,n,a))return;let r=t===`top`?Math.min(e.y,n.y)-i:Math.max(e.y,n.y)+i;return[e,{x:e.x,y:r},{x:n.x,y:r},n]}if(!(t===`bottom`&&r===`top`&&e.yn.y))return;if(y(e,n,a))return[e,n];let o=(e.y+n.y)/2;return[e,{x:e.x,y:o},{x:n.x,y:o},n]}if(o&&!s){let i=t===`right`&&n.x>e.x||t===`left`&&n.xn.y;return i&&a?[e,{x:n.x,y:e.y},n]:void 0}let c=t===`bottom`&&n.y>e.y||t===`top`&&n.yn.x;return c&&l?[e,{x:e.x,y:n.y},n]:void 0}e(ee,`buildOrthogonalPortPath`);function L(e,t,n,r){return t===`left`||t===`right`?[e,{x:r,y:e.y},{x:r,y:n.y},n]:[e,{x:e.x,y:r},{x:n.x,y:r},n]}e(L,`buildSameSideTrackPath`);function R(e){let t=new Map,n=[];for(let r of e){if(r.isEdgeLabel)continue;let e=_(r);e&&(t.set(e.id,e),n.push({id:e.id,rect:e.rect}))}return{nodeInfoById:t,realNodeRects:n}}e(R,`collectRealNodeBounds`);function z(e){let t=[],n=[];for(let r of e){let e=_(r);if(!e)continue;let i={id:e.id,rect:e.rect};r.isEdgeLabel?n.push(i):t.push(i)}return{realNodeRects:t,labelNodeRects:n}}e(z,`collectNodeRectEntries`);function te(e,{includeEdgeLabels:t=!0}={}){let n=[];for(let r of e){if(r.isGroup||!t&&r.isEdgeLabel)continue;let e=r.x??0,i=r.y??0,a=r.width??0,o=r.height??0;n.push({nodeId:r.id,...P(e,i,a,o)})}return n}e(te,`collectLayoutNodeRects`);function ne(e,t,n=h){let r=e.start,i=e.end;if(!r||!i)return;let a=t.get(r),o=t.get(i);if(!(!a||!o))return{srcId:r,dstId:i,srcInfo:a,dstInfo:o,collinearX:Math.abs(a.cx-o.cx)m||f<_||f>v)return!1;let x=Math.abs(g-u.a.x)i:a&&s&&b(e,n,i)?C(e.x,t.x,n.x,r.x)>i:!1}e(ie,`sameAxisSegmentsOverlap`);function ae(e,t,n,r,{epsilon:i=h,skipDegenerateOther:a=!1}={}){for(let o of n){if(o===r||o.isLayoutOnly)continue;let n=o.points;if(!(!n||n.length<2))for(let r=0;rf+i&&mg+i&&d<_-i}e(V,`orthogonalSegmentsStrictlyCross`);function oe(e,t,n){let r=Math.min(t,n),i=Math.max(t,n);return e>r+h&&e=2?t[t.length-2]:void 0,n=e&&y(e,r)?{x:r.x,y:i.y}:{x:i.x,y:r.y};t.push(n)}t.push(i)}let n=[];for(let e of t){let t=n[n.length-1];(!t||!v(t,e))&&n.push(e)}return n}e(W,`orthogonalizePolyline`);function G(e){if(e.length<3)return e;let t=[...e];for(let e=0;e<32;e++){let e=U(t);if(t=e.points,!e.changed)break}return t}e(G,`simplifyPolyline`);var K=.001,se=.5,ce=4;function le(e,t,n){let r=e;if(r.isLayoutOnly||!r.points||r.points.length=0&&i=e.length)return e;let a=i-r;if(a<0||a>=e.length)return e;let o=ue(e[i],e[a],t);return n?[o,...e.slice(i)]:[...e.slice(0,i+1),o]}e(de,`clipEndpoint`);function q(e,t){for(let n of e){let e=le(n,t,2);if(!e)continue;let r=[...e.points];e.srcRect&&(r=de(r,e.srcRect,!0)),e.dstRect&&(r=de(r,e.dstRect,!1)),r=G(W(r)),r=xe(r,e.srcRect,e.dstRect),e.edge.points=G(W(r))}}e(q,`clipEdgeEndpointsToNodeBoundaries`);function J(e,t,n,r=!1){if(b(e,t,K)){if(t.yn.bottom+K)return t;if(r){if(e.xn.right+K)return{x:n.right,y:e.y}}return{x:Math.abs(t.x-n.left)<=Math.abs(t.x-n.right)?n.left:n.right,y:e.y}}if(y(e,t,K)){if(t.xn.right+K)return t;if(r){if(e.yn.bottom+K)return{x:e.x,y:n.bottom}}let i=Math.abs(t.y-n.top)<=Math.abs(t.y-n.bottom);return{x:e.x,y:i?n.top:n.bottom}}return t}e(J,`snapEndpointToBoundary`);function fe(e,t,n){let r=e[t];for(let i=t+n;i>=0&&ie.lo)),n=Math.min(...e.map(e=>e.hi));if(!(t>n))return{lo:t,hi:n}}e(he,`intersectRanges`);function ge(e,t){return t===`left`||t===`right`?pe(e.top,e.bottom):pe(e.left,e.right)}e(ge,`clearanceRangeForSide`);function _e(e,t,n){let r=e.y>=n.top-K&&e.y<=n.bottom+K,i=e.x>=n.left-K&&e.x<=n.right+K;if(b(e,t,K)&&r){if(Math.abs(e.x-n.left)0?he(a):void 0}e(ye,`straightClearanceRange`);function be(e,t,n,r,i){let a=ye(e,t,n,r,i);if(!a)return;let o=i?e.y:e.x,s=Math.min(a.hi,Math.max(a.lo,o));if(!(Math.abs(s-o)({...e}));for(let s=t;s>=0&&s=n.left-K&&Math.max(e.x,t.x)<=n.right+K,i=Math.min(e.y,t.y)>=n.top-K&&Math.max(e.y,t.y)<=n.bottom+K;if(Math.abs(e.y-n.top)r.bottom+K;case`left`:return b(t,n,K)&&n.xr.right+K}}e(Ee,`leavesOutward`);function De(e,t,n){if(e.length<3)return e;if(n){let n=Te(e[0],e[1],t);return n&&Ee(n,e[1],e[2],t)?e.slice(1):e}let r=e.length-1,i=Te(e[r-1],e[r],t);return i&&Ee(i,e[r-1],e[r-2],t)?e.slice(0,r):e}e(De,`collapseOwnBorderStub`);function Oe(e,t,n){let r=e;if(t){let e=fe(r,0,1);if(e){let n=J(e,r[0],t);n!==r[0]&&(r=[n,...r.slice(1)])}r=De(r,t,!0)}if(n){let e=r.length-1,t=fe(r,e,-1);if(t){let i=J(t,r[e],n,!0);i!==r[e]&&(r=[...r.slice(0,e),i])}r=De(r,n,!1)}let i=xe(r,t,n);return i!==r||r.length===2?i:(t&&(r=we(r,t,!0)),n&&(r=we(r,n,!1)),r)}e(Oe,`snapAndCollapseEndpoints`);function ke(e,t){for(let n of e){let e=le(n,t,2);if(!e)continue;let r=Oe(D(e.points,K),e.srcRect,e.dstRect);if(r.length<3){e.edge.points=r;continue}let i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];e.edge.points=i}}e(ke,`prepareEdgeEndpointsForRenderer`);function Ae(e){return new Map(e.map(e=>[e.id,e]))}e(Ae,`buildNodeMap`);function je(e,t){let n=e.parentId,r=null;for(;n;){let e=t.get(n);if(!e?.isGroup)break;r=e.id,n=e.parentId}return r}e(je,`resolveTopLevelGroupId`);function Me(e,t){let n=0,r=e.parentId;for(;r;){let e=t.get(r);if(!e?.isGroup)break;n++,r=e.parentId}return n}e(Me,`groupDepth`);function Ne(e){let t=1/0,n=-1/0,r=1/0,i=-1/0;for(let a of e){let e=a.x,o=a.y;if(typeof e!=`number`||typeof o!=`number`)continue;let s=a.width??0,c=a.height??0;t=Math.min(t,e-s/2),n=Math.max(n,e+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}return t===1/0||r===1/0?null:{minX:t,maxX:n,minY:r,maxY:i}}e(Ne,`boundsForChildren`);function Pe(e,t){let n=e.padding??20;e.x=(t.minX+t.maxX)/2,e.y=(t.minY+t.maxY)/2,e.width=Math.max(0,t.maxX-t.minX)+n,e.height=Math.max(0,t.maxY-t.minY)+n}e(Pe,`applyGroupBounds`);function Fe(e){let t=Ae(e),n=e.filter(e=>e.isGroup&&e.parentId).sort((e,n)=>Me(n,t)-Me(e,t));for(let t of n){let n=Ne(e.filter(e=>e.parentId===t.id));n&&Pe(t,n)}}e(Fe,`recomputeNestedGroupBounds`);function Ie(t,n){let r=t.nodes??[],i=t.edges??[],a=r.filter(e=>!e.isGroup),o=1/0,s=-1/0;for(let e of a){let t=e[n];typeof t==`number`&&(o=Math.min(o,t),s=Math.max(s,t))}if(!Number.isFinite(o)||!Number.isFinite(s))return!1;let c=e(e=>o+s-e,`mirror`);for(let e of r){let t=e[n];typeof t==`number`&&(e[n]=c(t));let r=e.groupTitleRect;r&&(e.groupTitleRect=n===`x`?{...r,left:c(r.right),right:c(r.left)}:{...r,top:c(r.bottom),bottom:c(r.top)})}for(let e of i)for(let t of e.points??[])t[n]=c(t[n]);return!0}e(Ie,`mirrorAxis`);function Le(e){return!(e.nodes??[]).some(e=>!e.isGroup)||Ie(e,`y`)}e(Le,`applyBtDirectionTransform`);function Re(e,t=`LR`){let n=e.nodes??[],r=e.edges??[],i=n.filter(e=>!e.isGroup),a=1/0,o=1/0;for(let e of i){let t=e.x??0,n=e.y??0;t0?Math.max(1,l/u):1;for(let e of i){let t=e.x??0,n=((e.y??0)-o)*d+36,r=t-a;e.x=n,e.y=r}for(let e of r)if(e.points)for(let t of e.points){let e=t.x,n=(t.y-o)*d+36,r=e-a;t.x=n,t.y=r}Fe(n);let f=n.filter(e=>e.isGroup&&!e.parentId);if(f.length===0)return t===`RL`&&Ie(e,`x`),!0;let p=Ae(n),m=new Map;for(let e of n){if(e.isGroup)continue;let t=je(e,p);if(!t)continue;let n=m.get(t)??[];n.push(e),m.set(t,n)}let h=0;for(let e of f){let t=e.padding??0;t>h&&(h=t)}let g=[],_=1/0,v=-1/0;for(let e of f){let t=Ne(m.get(e.id)??[]);t&&(_=Math.min(_,t.minX),v=Math.max(v,t.maxX),g.push({lane:e,contentTop:t.minY,contentBottom:t.maxY,centerY:(t.minY+t.maxY)/2}))}if(_===1/0||v===-1/0)return!0;let y=Math.max(0,v-_)+2*Math.max(h,10),b=36+y,x=(_+v)/2-y/2-36,S=x+b/2,C=Math.max(h,36);g.sort((e,t)=>e.centerY-t.centerY);for(let e=0;ed.cy?g.bottom:g.top,t=d.cx+n;if(t<=g.left+ze||t>=g.right-ze)continue;i={x:t,y:e},a={x:t,y:o.y},c={x:o.x,y:o.y}}else{let e=f.cx>d.cx?g.right:g.left,t=d.cy+n;if(t<=g.top+ze||t>=g.bottom-ze)continue;i={x:e,y:t},a={x:o.x,y:t},c={x:o.x,y:o.y}}let p=v(i,a,ze),m=v(a,c,ze);if(p&&m||!p&&B(i,a,r,[l],1)||!m&&B(a,c,r,[u],1))continue;let _=!p&&ae(i,a,e,t,{epsilon:ze,skipDegenerateOther:!0}),y=!m&&ae(a,c,e,t,{epsilon:ze,skipDegenerateOther:!0});if(!(_||y)){h=p?[a,c]:m?[i,a]:[i,a,c];break}}h&&(t.points=h)}}e(He,`portSwapToLShape`);function Ue(t,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=z(n.values());for(let o of t){if(o.isLayoutOnly)continue;let s=o.points;if(!s||s.length<4)continue;let c=D(s,r);if(c.length<4)continue;let l=c.length-1,u=c[l],d=c[l-1],f=c[l-2],p=u.x-d.x,m=u.y-d.y,h=Math.hypot(p,m);if(h>=10||h0;P={x:f.x,y:M},I={x:e?N.right:N.left,y:M}}if(B(P,I,i,E?[E]:[],-2)||B(P,I,a,[],-2))continue;if(O){let e=n.get(O),t=e?F(e):void 0;if(t&&A(P,t,2))continue}let ee=e((e,t)=>`${e.x.toFixed(3)},${e.y.toFixed(3)}|${t.x.toFixed(3)},${t.y.toFixed(3)}`,`ownSegmentKey`),L=new Set;for(let e=0;e{for(let i of t){if(i===o||i.isLayoutOnly)continue;let t=i.points;if(!(!t||t.length<2))for(let i=0;i=0){let e=c[l-3],t=[O,E].filter(e=>!!e);if(B(e,P,i,t,-2)||R(e,P))continue}let z=[...c.slice(0,l-2),P,I];o.points=z;let te=o.labelNodeId;if(te){let e=n.get(te);if(e){let t=e.width??0,n=e.height??0;if(t>0&&n>0){let i,a,o=-1;for(let e=0;e=t+2||d&&l>=n+2)&&l>o&&(o=l,i=(s.x+c.x)/2,a=(s.y+c.y)/2)}i!==void 0&&a!==void 0&&(e.x=i,e.y=a)}}}}}e(Ue,`collapseShortTerminalStub`);var Y=.001,X=8,Z=T,We=e((e,t)=>y(e,t,Y)||b(e,t,Y),`orthogonallyAligned`);function Ge(t,n){let r=e((e,t)=>{let n=e.x??0,r=e.y??0,i=t.x-n,a=t.y-r,o=(e.width??0)/2,s=(e.height??0)/2;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),{x:n+(a===0?0:s*i/a),y:r+s}):(i<0&&(o=-o),{x:n+o,y:r+(i===0?0:o*a/i)})},`rectIntersect`),i=e((e,t)=>{let i=D(e.points??[]);if(i.length<2)return;let a=t?e.start:e.end,o=a?n.get(a):void 0,s=o?F(o):void 0;if(!o||!a||!s)return;let c=t?i[0]:i[i.length-1],l=t?i[1]:i[i.length-2],u=r(o,c),d=c;if(We(l,u)&&(d=l),y(u,d,Y))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`V`,coord:u.x,min:Math.min(u.y,d.y),max:Math.max(u.y,d.y),boundary:u,railEnd:d,rect:s};if(b(u,d,Y))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`H`,coord:u.y,min:Math.min(u.x,d.x),max:Math.max(u.x,d.x),boundary:u,railEnd:d,rect:s}},`terminalLaneFor`),a=e((e,t)=>Math.max(0,Math.min(e.max,t.max)-Math.max(e.min,t.min)),`projectedOverlapLength`),o=e((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:e.orientation===`H`?(Math.abs(e.boundary.x-e.rect.left)<1||Math.abs(e.boundary.x-e.rect.right)<1)&&y(e.boundary,t.boundary,1):(Math.abs(e.boundary.y-e.rect.top)<1||Math.abs(e.boundary.y-e.rect.bottom)<1)&&b(e.boundary,t.boundary,1),`sameTerminalFace`),s=e((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:a(e,t)>=X&&Math.abs(e.coord-t.coord)<.5,`exactTerminalLaneConflict`),c=e((e,t)=>{if(e.nodeId!==t.nodeId||e.orientation!==t.orientation||e.orientation!==`H`||e.atStart===t.atStart)return!1;let n=a(e,t);if(n2*r?!1:o(e,t)&&Math.abs(e.coord-t.coord)<16},`nearTerminalLaneConflict`),l=e((t,n)=>{let r=D(t.edge.points??[]);if(r.length<2)return;let i=t.orientation===`V`?{x:t.boundary.x+n,y:t.boundary.y}:{x:t.boundary.x,y:t.boundary.y+n},a=t.orientation===`V`?{x:t.railEnd.x+n,y:t.railEnd.y}:{x:t.railEnd.x,y:t.railEnd.y+n};if(!e(()=>Math.abs(t.boundary.y-t.rect.top)<1||Math.abs(t.boundary.y-t.rect.bottom)<1?b(i,t.boundary,Y)&&i.x>=t.rect.left+1&&i.x<=t.rect.right-1:Math.abs(t.boundary.x-t.rect.left)<1||Math.abs(t.boundary.x-t.rect.right)<1?y(i,t.boundary,Y)&&i.y>=t.rect.top+1&&i.y<=t.rect.bottom-1:!1,`boundaryStaysOnSameFace`)())return;if(t.atStart){let e=r.length>1&&v(r[1],t.railEnd,Y),n=r.slice(e?2:1),o=n[0];return o&&!We(o,a)?void 0:[i,a,...n]}let o=r.length>1&&v(r[r.length-2],t.railEnd,Y),s=r.slice(0,o?-2:-1),c=s[s.length-1];if(!(c&&!We(c,a)))return[...s,a,i]},`shiftedCandidate`),u=e(e=>{let t=e.edge,r=D(t.points??[]);if(r.length!==2)return!1;let i=t.start,a=t.end,o=i?n.get(i):void 0,s=a?n.get(a):void 0;if(!o||!s)return!1;let c=o.x??0,l=o.y??0,u=s.x??0,d=s.y??0,[f,p]=r;return b(f,p,Y)&&Math.abs(l-d)<1&&Math.abs(c-u)>1||y(f,p,Y)&&Math.abs(c-u)<1&&Math.abs(l-d)>1},`laneIsStraightCollinearConnector`),d=[-7,7,-14,14,-21,21];for(let e=0;e<8;e++){let e=t.filter(e=>!e.isLayoutOnly).flatMap(e=>[i(e,!0),i(e,!1)]).filter(e=>!!e),n=!1;for(let t=0;t{let n=u(e),r=u(t);return n===r?Number(!t.atStart)-Number(!e.atStart):Number(n)-Number(r)});for(let t of p){for(let r of d){let a=l(t,r);if(!a)continue;let o=i({...t.edge,points:a},t.atStart);if(!(!o||e.some(e=>e.edge!==t.edge&&(s(o,e)||f&&c(o,e))))){t.edge.points=a,n=!0;break}}if(n)break}}if(!n)return}}e(Ge,`separateSharedRenderedTerminalLanes`);function Ke(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=e((e,n)=>{let a=e.start,o=e.end,s=Z(n);if(s.length!==n.length-1)return!1;let c=[a,o].filter(e=>!!e);for(let e of s)if(B(e.a,e.b,r,c,-2)||B(e.a,e.b,i,[],-2))return!1;for(let n of t){if(n===e||n.isLayoutOnly)continue;let t=n.points;if(!(!t||t.length<2)){for(let e of s)for(let n of Z(D(t)))if(w(e,n,.5)>=X||V(e.a,e.b,n.a,n.b,Y))return!1}}return!0},`candidateIsSafe`),o=e((e,t)=>{if(t+4>=e.length)return;let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=e[t+4],s=x(n,r)&&S(r,i)&&x(i,a)&&S(a,o)&&y(n,a,Y)&&y(n,o,Y)&&y(r,i,Y)&&(r.x-n.x)*(a.x-i.x)<0,c=S(n,r)&&x(r,i)&&S(i,a)&&x(a,o)&&b(n,a,Y)&&b(n,o,Y)&&b(r,i,Y)&&(r.y-n.y)*(a.y-i.y)<0;if(s||c)return D([...e.slice(0,t+1),o,...e.slice(t+5)]);if(t+5>=e.length)return;let l=e[t+5],u=S(n,r)&&x(r,i)&&S(i,a)&&x(a,o)&&S(o,l)&&y(n,o,Y)&&y(n,l,Y)&&y(i,a,Y)&&(i.x-r.x)*(o.x-a.x)<0,d=x(n,r)&&S(r,i)&&x(i,a)&&S(a,o)&&x(o,l)&&b(n,o,Y)&&b(n,l,Y)&&b(i,a,Y)&&(i.y-r.y)*(o.y-a.y)<0;if(!(!u&&!d))return D([...e.slice(0,t+1),l,...e.slice(t+6)])},`withoutDogleg`);for(let e=0;e<8;e++){let e=!1;for(let n of t){if(n.isLayoutOnly)continue;let t=D(n.points??[]);for(let r=0;r<=t.length-5;r++){let i=o(t,r);if(!(!i||!a(n,i))){n.points=i,e=!0;break}}if(e)break}if(!e)return}}e(Ke,`collapseRedundantRectangularDoglegs`);function qe(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t,n)=>D(e===t?n??[]:e.points??[]),`pointsFor`),s=e((e,t)=>{let n=0;for(let r=0;r{let t=Z(e);if(t.length!==3)return;let n=t[1];if(t[0].horizontal!==n.horizontal&&t[2].horizontal!==n.horizontal)return{index:n.index,horizontal:n.horizontal,vertical:n.vertical,segment:n}},`middleRail`),l=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);return r.filter(e=>{if(n.includes(e.id))return!1;let r=e.rect;return t.horizontal?C(t.a.x,t.b.x,r.left,r.right)>=X&&t.a.y>=r.top-2&&t.a.y<=r.bottom+2:C(t.a.y,t.b.y,r.top,r.bottom)>=X&&t.a.x>=r.left-2&&t.a.x<=r.right+2})},`blockingRectsFor`),u=e((e,t,n)=>{let r=e.map(e=>({...e}));if(t.horizontal)r[t.index].y=n,r[t.index+1].y=n;else if(t.vertical)r[t.index].x=n,r[t.index+1].x=n;else return;let i=G(D(r));return Z(i).length===i.length-1?i:void 0},`candidateByMovingRail`),d=e((e,t,n)=>{let c=[e.start,e.end].filter(e=>!!e),l=Z(t);if(l.length!==t.length-1)return!1;for(let e of l)if(B(e.a,e.b,r,c,-2)||B(e.a,e.b,i,[],-2))return!1;for(let t of a)if(t!==e){for(let e of l)for(let n of Z(o(t)))if(w(e,n,.5)>=X)return!1}return s(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=s(),t=!1;for(let n of a){let r=o(n),i=c(r);if(!i)continue;let a=l(n,i.segment);if(a.length===0)continue;let s=i.horizontal?[Math.min(...a.map(e=>e.rect.top))-20,Math.max(...a.map(e=>e.rect.bottom))+20]:[Math.min(...a.map(e=>e.rect.left))-20,Math.max(...a.map(e=>e.rect.right))+20];for(let a of s){let o=u(r,i.segment,a);if(!(!o||!d(n,o,e))){n.points=o,t=!0;break}}if(t)break}if(!t)return}}e(qe,`liftObstacleHuggingSameSideRails`);function Je(t,n){let r=e(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),i=e(e=>{if(!e.isGroup||e.parentId)return;let t=e.direction,n=typeof t==`string`?t.toUpperCase():``;if(n===`LR`||n===`RL`||n===`BT`)return;let i=r(e),a=e.y,o=e.height;if(!i||typeof a!=`number`||typeof o!=`number`||!Number.isFinite(a)||!Number.isFinite(o)||o<=0)return;let s=i.right-i.left,c=i.bottom-i.top;if(!(c<=0||s{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+Y||n>=t.bottom-Y?!1:C(e.a.x,e.b.x,t.left,t.right)>=X},`horizontalSegmentIntersectsTitle`),o=[...n.values()].map(i).filter(e=>!!e);if(o.length===0)return;let s=0;for(let e of t){if(e.isLayoutOnly)continue;let t=D(e.points??[]);for(let e of Z(t))for(let t of o)a(e,t.rect)&&(s=Math.max(s,t.rect.bottom-e.a.y+4))}if(!(s<=Y))for(let e of o){let t=e.node.y,n=e.node.height;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.y=t-s/2,e.node.height=n+s,e.node.groupTitleRect={...e.rect,top:e.rect.top-s,bottom:e.rect.bottom-s})}}e(Je,`liftTopLaneTitleBandsAboveRails`);function Ye(t,n){let r=e(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),i=e(e=>{if(!e.isGroup||e.parentId||e.direction!==`LR`)return;let t=r(e),n=e.x,i=e.width;if(!t||typeof n!=`number`||typeof i!=`number`||!Number.isFinite(n)||!Number.isFinite(i)||i<=0)return;let a=t.right-t.left,o=t.bottom-t.top;if(!(a<=0||o{if(!e.vertical)return!1;let n=e.a.x;return n<=t.left+Y||n>=t.right-Y?!1:C(e.a.y,e.b.y,t.top,t.bottom)>=X},`verticalSegmentIntersectsTitle`),o=e((e,t)=>{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+Y||n>=t.bottom-Y?!1:C(e.a.x,e.b.x,t.left,t.right)>=X},`horizontalSegmentIntersectsTitle`),s=[...n.values()].map(i).filter(e=>!!e);if(s.length===0)return;let c=0;for(let e of t){if(e.isLayoutOnly)continue;let t=D(e.points??[]);for(let e of Z(t))for(let t of s)if(a(e,t.rect))c=Math.max(c,t.rect.right-e.a.x+4);else if(o(e,t.rect)){let n=Math.min(e.a.x,e.b.x);c=Math.max(c,t.rect.right-n+4)}}if(!(c<=Y))for(let e of s){let t=e.node.x,n=e.node.width;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.x=t-c/2,e.node.width=n+c,e.node.groupTitleRect={...e.rect,left:e.rect.left-c,right:e.rect.right-c})}}e(Ye,`shiftLeftLaneTitleBandsLeftOfRails`);function Xe(t,n){let{realNodeRects:r}=z(n.values()),i=t.filter(e=>!e.isLayoutOnly),a=e((e,t=new Map)=>D(t.get(e)??e.points??[]),`replacementPointsFor`),o=e((e=new Map)=>{let t=0;for(let n=0;ni.reduce((t,n)=>t+E(a(n,e)),0),`totalBends`),c=e(e=>{let t=a(e);if(t.length<4)return;let n=t[t.length-2],r=t[t.length-1];if(!(!x(n,r,Y)&&!S(n,r,Y)))return{tailStart:n,terminal:r}},`terminalTailFor`),l=e((e,t)=>{let n=a(e);if(n.length<3)return;let r=n[0],i=n[1],o;if(x(r,i,Y))o={x:i.x,y:t.tailStart.y};else if(S(r,i,Y))o={x:t.tailStart.x,y:i.y};else return;let s=G(D([r,i,o,t.tailStart,t.terminal]));return Z(s).length===s.length-1?s:void 0},`candidateWithDestinationTail`),u=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Z(t))if(B(e.a,e.b,r,n,-2))return!0;return!1},`pathHasNodeHit`),d=e((e,t,n)=>{for(let r of i)if(r!==e){for(let e of Z(t))for(let t of Z(a(r,n)))if(w(e,t,.5)>=X)return!0}return!1},`pathHasSharedTrack`),f=e((e,t,n)=>!u(e,t)&&!d(e,t,n),`candidateIsSafe`),p=e(()=>{let e=new Map;for(let t of i){let r=t.end;if(!r||!n.has(r)||a(t).length<4)continue;let i=e.get(r)??[];i.push(t),e.set(r,i)}return e},`edgesByDestination`);for(let e=0;e<4;e++){let e=o();if(e===0)return;let t=s(),n,r=e,i=t;for(let t of p().values())for(let a=0;a=e||y>r||y===r&&b>=i||(n=v,r=y,i=b)}if(!n)return;for(let[e,t]of n)e.points=t}}e(Xe,`swapDestinationTerminalTailsToReduceCrossings`);function Ze(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t=new Map)=>D(t.get(e)??e.points??[]),`replacementPointsFor`),s=e((e=new Map)=>{let t=0;for(let n=0;na.reduce((t,n)=>t+E(o(n,e)),0),`totalBends`),l=e(e=>{let t=e.start,r=e.end,i=t?n.get(t):void 0,a=r?n.get(r):void 0,o=i?F(i):void 0,s=a?F(a):void 0;return o&&s?{src:o,dst:s}:void 0},`endpointRectsFor`),u=e((e,t,n)=>{if(n.index<=0||n.index+1>=t.length-1)return;let r=l(e);if(r){if(n.vertical){let i=n.a.x,a=Math.min(r.src.left,r.dst.left),o=Math.max(r.src.right,r.dst.right),s=io+Y?`right`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`vertical`,side:s,coord:i,min:Math.min(n.a.y,n.b.y),max:Math.max(n.a.y,n.b.y)}:void 0}if(n.horizontal){let i=n.a.y,a=Math.min(r.src.top,r.dst.top),o=Math.max(r.src.bottom,r.dst.bottom),s=io+Y?`bottom`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`horizontal`,side:s,coord:i,min:Math.min(n.a.x,n.b.x),max:Math.max(n.a.x,n.b.x)}:void 0}}},`externalRailForSegment`),d=e(()=>{let e=[];for(let t of a){let n=o(t);for(let r of Z(n)){let i=u(t,n,r);i&&e.push(i)}}return e},`collectExternalRails`),f=e((e,t)=>e.edge!==t.edge&&e.axis===t.axis&&e.side===t.side&&C(e.min,e.max,t.min,t.max)>=X,`railsInteract`),p=e(e=>{let t=[],n=new Set;for(let r of e){if(n.has(r))continue;let i=[r],a=[];for(n.add(r);i.length>0;){let t=i.pop();a.push(t);for(let r of e)!n.has(r)&&f(t,r)&&(n.add(r),i.push(r))}a.length>1&&t.push(a)}return t},`connectedComponents`),m=e(e=>{let t=[];for(let n of e)t.some(e=>Math.abs(e-n.coord){let n=t.map(e=>e.coord),r=m(t),i=[];if(t.length<=6){let a=Array(r.length).fill(!1),o=[],s=e(()=>{if(o.length===t.length){o.some((e,t)=>Math.abs(e-n[t])>=Y)&&i.push([...o]);return}for(let[e,t]of r.entries())a[e]||(a[e]=!0,o.push(t),s(),o.pop(),a[e]=!1)},`visit`);return s(),i}for(let e=0;e{let n=new Map;for(let[r,i]of e.entries()){let e=t[r],a=n.get(i.edge)??i.points.map(e=>({x:e.x,y:e.y}));i.axis===`vertical`?(a[i.segmentIndex].x=e,a[i.segmentIndex+1].x=e):(a[i.segmentIndex].y=e,a[i.segmentIndex+1].y=e),n.set(i.edge,a)}let r=new Map;for(let[e,t]of n){let n=G(D(t));if(Z(n).length!==n.length-1)return;r.set(e,n)}return r},`replacementsForAssignment`),_=e(e=>{for(let[t,n]of e){let e=[t.start,t.end].filter(e=>!!e);for(let t of Z(n))if(B(t.a,t.b,r,e,-2)||B(t.a,t.b,i,[],-2))return!1}for(let t=0;t=X)return!1}}return!0},`candidateIsSafe`);for(let e=0;e<4;e++){let e=s();if(e===0)return;let t,n=e,r=c(),i=1/0;for(let a of p(d()))for(let o of h(a)){let l=g(a,o);if(!l||!_(l))continue;let u=s(l);if(u>=e)continue;let d=c(l),f=a.reduce((e,t,n)=>e+Math.abs(o[n]-t.coord),0);u>n||u===n&&(d>r||d===r&&f>=i)||(t=l,n=u,r=d,i=f)}if(!t)return;for(let[e,n]of t)e.points=n}}e(Ze,`reassignCrossingExternalRailChannels`);function Qe(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t,n)=>D(e===t?n??[]:e.points??[]),`pointsFor`),s=e(e=>Z(e).reduce((e,t)=>{let n=t.a.x-t.b.x,r=t.a.y-t.b.y;return e+Math.hypot(n,r)},0),`pathLength`),c=e((e,t)=>{let n=0;for(let r=0;r{if(e.horizontal){let n=e.a.y;return(Math.abs(n-t.top)<1||Math.abs(n-t.bottom)<1)&&C(e.a.x,e.b.x,t.left,t.right)>=X}if(e.vertical){let n=e.a.x;return(Math.abs(n-t.left)<1||Math.abs(n-t.right)<1)&&C(e.a.y,e.b.y,t.top,t.bottom)>=X}return!1},`segmentRunsAlongRectBorder`),u=e(e=>{let t=[e.start,e.end].filter(e=>!!e),r=[];for(let e of t){let t=n.get(e),i=t?F(t):void 0;i&&r.push(i)}return r},`endpointRectsFor`),d=e((e,t)=>{if(t+3>=e.length)return[];let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=x(n,r,Y)&&S(r,i,Y)&&x(i,a,Y),s=S(n,r,Y)&&x(r,i,Y)&&S(i,a,Y);if(!o&&!s||!(o?Math.sign(r.x-n.x)!==Math.sign(a.x-i.x):Math.sign(r.y-n.y)!==Math.sign(a.y-i.y)))return[];let c=y(n,a,Y)||b(n,a,Y)?[]:[{x:n.x,y:a.y},{x:a.x,y:n.y}],l=c.length===0?[[...e.slice(0,t+1),...e.slice(t+3)]]:c.map(n=>[...e.slice(0,t+1),n,...e.slice(t+3)]),u=new Set;return l.map(e=>G(D(e))).filter(e=>{if(Z(e).length!==e.length-1||!e.some(e=>v(e,a,Y)))return!1;let t=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return!u.has(t)&&(u.add(t),!0)})},`shortcutCandidatesAt`),f=e((e,t,n)=>{let s=[e.start,e.end].filter(e=>!!e),d=u(e);for(let e of Z(t))if(B(e.a,e.b,r,s,-2)||B(e.a,e.b,i,[],-2)||d.some(t=>l(e,t)))return!1;for(let n of a)if(n!==e){for(let e of Z(t))for(let t of Z(o(n)))if(w(e,t,.5)>=X)return!1}return c(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=c(),t,n,r=e,i=1/0,l=1/0;for(let u of a){let a=o(u),p=E(a,Y),m=s(a);for(let o=0;o<=a.length-4;o++)for(let h of d(a,o)){let a=E(h,Y),o=s(h);if(!(ar||d===r&&(a>i||a===i&&o>=l)||(t=u,n=h,r=d,i=a,l=o)}}if(!t||!n)return;t.points=n}}e(Qe,`shortcutRedundantOrthogonalJogs`);function $e(t,n){let r=[];for(let e of n.values()){if(e.isGroup||e.isEdgeLabel)continue;let t=e.x??0,n=e.y??0,i=F(e);i&&r.push({id:String(e.id??``),cx:t,cy:n,rect:i})}if(r.length===0)return;let i=new Map(r.map(e=>[e.id,e])),a=r.map(e=>({id:e.id,rect:e.rect})),o=[`top`,`bottom`,`left`,`right`],s={top:Math.min(...r.map(e=>e.rect.top))-20,bottom:Math.max(...r.map(e=>e.rect.bottom))+20,left:Math.min(...r.map(e=>e.rect.left))-20,right:Math.max(...r.map(e=>e.rect.right))+20},c=t.filter(e=>!e.isLayoutOnly),l=new Map(c.map((e,t)=>[e,t])),u=e(e=>{let t=e===`left`||e===`top`?-1:1,n=[];for(let r=0;r<=2;r++)n.push(s[e]+t*20*r);return n},`outwardTracksForSide`),d=e((e,t=new Map)=>D(t.get(e)??e.points??[]),`replacementPointsFor`),f=e((e,t)=>{let n=0;for(let r of e)for(let e of t)V(r.a,r.b,e.a,e.b,Y)&&n++;return n},`crossingCountBetweenSegments`),p=e((e,t)=>f(Z(e),Z(t)),`crossingCountBetweenPaths`),m=e((t=new Map)=>{let n=0,r=[],i=new Set,a=[],o=e(e=>{i.has(e)||(i.add(e),a.push(e))},`addEdge`);for(let e=0;e0&&(n+=l,r.push({first:i,second:e,count:l}),o(i),o(e))}}return a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),{count:n,pairs:r,edgeSet:i,edges:a}},`crossingSnapshot`),h=e((e,t)=>{let n=new Set(t.keys());if(n.size===0)return e.count;let r=0;for(let t of e.pairs)(n.has(t.first)||n.has(t.second))&&(r+=t.count);let i=0;for(let e=0;e{let t=new Map;for(let n of e.pairs){let e=t.get(n.first)??new Set;e.add(n.second),t.set(n.first,e);let r=t.get(n.second)??new Set;r.add(n.first),t.set(n.second,r)}let n=[],r=new Set;for(let i of e.edges){if(r.has(i))continue;let e=[i],a=[];for(r.add(i);e.length>0;){let n=e.pop();a.push(n);for(let i of t.get(n)??[])r.has(i)||(r.add(i),e.push(i))}a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),a.length>1&&n.push(a)}return n},`crossingComponents`),_=e(e=>[e.start,e.end].filter(e=>!!e),`endpointIdsFor`),v=e(e=>{let t=[];for(let n of g(e)){let e=new Set(n),r=new Set(n.flatMap(e=>_(e))),i=[...n];for(let t of c)e.has(t)||_(t).some(e=>r.has(e))&&i.push(t);i.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),t.push(i)}return t},`pairSearchGroups`),y=e((e,t,n)=>h(e,new Map([[t,n]])),`crossingCountWithSingleReplacement`),b=e(e=>{let t=new Map;for(let n of e.pairs)t.set(n.first,(t.get(n.first)??0)+n.count),t.set(n.second,(t.get(n.second)??0)+n.count);return t},`currentCrossingsByEdge`),C=e(e=>e.slice(1).reduce((t,n,r)=>{let i=e[r];return t+Math.abs(n.x-i.x)+Math.abs(n.y-i.y)},0),`pathLength`),T=e((e=new Map)=>c.reduce((t,n)=>t+E(d(n,e)),0),`totalBends`),O=e((e=new Map)=>c.reduce((t,n)=>t+C(d(n,e)),0),`totalLength`),k=e((e,t,n=new Map)=>{let r=Z(t);for(let t of c)if(t!==e){for(let e of r)for(let r of Z(d(t,n)))if(w(e,r,.5)>=X)return!0}return!1},`pathHasSegmentConflict`),A=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Z(t))if(B(e.a,e.b,a,n,-2))return!0;return!1},`pathHitsNode`),j=e((e,t)=>{let n=G(D(t));Z(n).length===n.length-1&&e.push(n)},`pushOrthogonalCandidate`),M=e(e=>e===`left`||e===`right`,`sideIsHorizontal`),N=e((e,t,n)=>{switch(t){case`left`:return Math.min(e.x,n.x)-20;case`right`:return Math.max(e.x,n.x)+20;case`top`:return Math.min(e.y,n.y)-20;case`bottom`:return Math.max(e.y,n.y)+20}},`localTrackForSameSide`),P=e((e,t,n,r)=>{let i=n===`left`||n===`top`?-1:1,a=[N(t,n,r),s[n]];for(let o of a)for(let a=0;a<=2;a++)j(e,L(t,n,r,o+i*20*a))},`addSameSideCandidates`),R=e((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))j(e,[t,{x:a,y:t.y},{x:a,y:n},{x:r.x,y:n},r])},`addHorizontalToVerticalCandidates`),z=e((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))j(e,[t,{x:t.x,y:a},{x:n,y:a},{x:n,y:r.y},r])},`addVerticalToHorizontalCandidates`),te=e((e,t,n,r,i)=>{let a=[...u(`top`),...u(`bottom`)];for(let o of u(n))for(let n of u(i))for(let i of a)j(e,[t,{x:o,y:t.y},{x:o,y:i},{x:n,y:i},{x:n,y:r.y},r])},`addHorizontalPairCandidates`),ne=e((e,t,n,r,i)=>{let a=[...u(`left`),...u(`right`)];for(let o of u(n))for(let n of u(i))for(let i of a)j(e,[t,{x:t.x,y:o},{x:i,y:o},{x:i,y:n},{x:r.x,y:n},r])},`addVerticalPairCandidates`),re=e(e=>{let t=new Set;return e.map(e=>D(e)).filter(e=>{let n=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return t.has(n)||e.length<2?!1:(t.add(n),!0)})},`dedupeCandidatePaths`),ie=e((e,t,n,r)=>{let i=[],a=ee(e,t,n,r,20,Y);a&&j(i,a),t===r&&P(i,e,t,n);let o=M(t),s=M(r);return o&&!s?R(i,e,t,n,r):!o&&s?z(i,e,t,n,r):o?te(i,e,t,n,r):ne(i,e,t,n,r),re(i)},`buildCandidatesForSides`),ae=e((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=I(r,s),c=s===`top`||s===`bottom`?u(s):a;for(let r of i){j(e,[t,n,{x:r,y:n.y},{x:r,y:o.y},o]);for(let i of c)j(e,[t,n,{x:r,y:n.y},{x:r,y:i},{x:o.x,y:i},o])}}},`addVerticalDepartureOuterTrackCandidates`),oe=e((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=I(r,s),c=s===`left`||s===`right`?u(s):i;for(let r of a){j(e,[t,n,{x:n.x,y:r},{x:o.x,y:r},o]);for(let i of c)j(e,[t,n,{x:n.x,y:r},{x:i,y:r},{x:i,y:o.y},o])}}},`addHorizontalDepartureOuterTrackCandidates`),H=e(e=>{let t=e.start,n=e.end,r=n?i.get(n):void 0;if(!t||!r)return[];let a=D(e.points??[]);if(a.length<4)return[];let o=a[0],s=a[1],c=[];return S(o,s,Y)?ae(c,o,s,r):x(o,s,Y)&&oe(c,o,s,r),c},`terminalPreservingOuterTrackCandidates`),U=e(e=>{let t=e.start,n=e.end,r=t?i.get(t):void 0,a=n?i.get(n):void 0;if(!r||!a)return[];let s=[];for(let e of o){let t=I(r,e);for(let n of o)s.push(...ie(t,e,I(a,n),n))}return s.push(...H(e)),s},`candidatePathsFor`),W=e(()=>new Map(c.map(e=>[e,Z(d(e))])),`currentSegmentsByEdge`),K=e((e,t,n)=>{let r=new Set;for(let i of c){if(i===e)continue;let a=n.get(i)??Z(d(i));t.some(e=>a.some(t=>w(e,t,.5)>=X))&&r.add(i)}return r},`sharedTrackConflictsFor`),se=e((e,t,n,r)=>{let i=new Set;return U(e).map(e=>G(D(e))).filter(t=>{if(A(e,t))return!1;let n=t.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return i.has(n)||t.length<2?!1:(i.add(n),!0)}).map(i=>{let a=Z(i),o=0;for(let t of c)t!==e&&(o+=f(a,n.get(t)??Z(d(t))));return{candidate:i,candidateSegments:a,crossings:t.count-(r.get(e)??0)+o,bends:E(i,Y),totalBends:E(i),length:C(i)}}).filter(({crossings:e})=>e<=t.count).sort((e,t)=>e.crossings-t.crossings||e.bends-t.bends||e.length-t.length).slice(0,48).map(t=>({path:t.candidate,segments:t.candidateSegments,sharedTrackConflicts:K(e,t.candidateSegments,n),totalBends:t.totalBends,length:t.length}))},`pairCandidatesFor`),ce=e((e,t,n,r,i,a)=>{let o=0;for(let n of e.pairs)(n.first===t||n.second===t||n.first===r||n.second===r)&&(o+=n.count);let s=f(n.segments,i.segments);for(let e of c){if(e===t||e===r)continue;let o=a.get(e)??Z(d(e));s+=f(n.segments,o)+f(i.segments,o)}return e.count-o+s},`pairCrossingCount`),le=e((e,t)=>{for(let n of e.sharedTrackConflicts)if(n!==t)return!1;return!0},`conflictsOnlyWith`),ue=e((e,t)=>e.segments.some(e=>t.segments.some(t=>w(e,t,.5)>=X)),`candidatesShareTrack`),de=e((e,t,n,r)=>le(t,n.edge)&&le(r,e.edge)&&!ue(t,r),`pairCandidatesAreCompatible`),q=e((e,t,n,r,i)=>{let a=ce(e.current,t.edge,n,r.edge,i,e.baseSegments);if(!(a>=e.current.count))return{replacements:new Map([[t.edge,n.path],[r.edge,i.path]]),crossings:a,bends:e.currentBends-(e.baseBendsByEdge.get(t.edge)??0)-(e.baseBendsByEdge.get(r.edge)??0)+n.totalBends+i.totalBends,length:e.currentLength-(e.baseLengthByEdge.get(t.edge)??0)-(e.baseLengthByEdge.get(r.edge)??0)+n.length+i.length}},`scorePairReplacement`),J=e((e,t)=>e.crossings{let i=r;for(let r of t.candidates)for(let a of n.candidates){if(!de(t,r,n,a))continue;let o=q(e,t,r,n,a);o&&J(o,i)&&(i=o)}return i},`bestScoreForOptionPair`),pe=e(e=>{let t=T(),n=O(),r=W(),i=b(e),a=new Map(c.map(e=>[e,E(d(e))])),o=new Map(c.map(e=>[e,C(d(e))])),s=new Map,l=v(e);for(let t of l)for(let n of t){if(s.has(n))continue;let t=se(n,e,r,i);t.length>0&&s.set(n,{edge:n,candidates:t})}let u={replacements:new Map,crossings:e.count,bends:t,length:n},f={current:e,currentBends:t,currentLength:n,baseBendsByEdge:a,baseLengthByEdge:o,baseSegments:r};for(let t of l){let n=new Set(t.filter(t=>e.edgeSet.has(t))),r=t.map(e=>s.get(e)).filter(e=>!!e);for(let e=0;e0?u.replacements:void 0},`bestPairedReplacement`);for(let e=0;e<4;e++){let e=m(),t=e.count;if(t===0)return;let n,r,i=t,a=1/0;for(let o of e.edges){let s=E(d(o),Y);for(let c of U(o)){let l=A(o,c),u=!l&&k(o,c),d=y(e,o,c),f=E(c,Y);l||u||(di||d===i&&f>=a||(n=o,r=c,i=d,a=f))}}if(n&&r){n.points=r;continue}let o=pe(e);if(!o)return;for(let[e,t]of o)e.points=t}}e($e,`resolveRenderedOrthogonalCrossings`);var et=.001,tt=8;function nt(t,n){let{nodeInfoById:r,realNodeRects:i}=R(n),a=[`top`,`bottom`,`left`,`right`],o={top:Math.min(...i.map(e=>e.rect.top))-20,bottom:Math.max(...i.map(e=>e.rect.bottom))+20,left:Math.min(...i.map(e=>e.rect.left))-20,right:Math.max(...i.map(e=>e.rect.right))+20},s=e((e,t,n,r)=>{let i=[],a=ee(e,t,n,r,20,et);return a&&i.push(a),t===r&&i.push(L(e,t,n,o[t])),i},`buildOrthogonalPathCandidates`),c=e((e,t)=>{for(let n=0;n{let i=0,a=T(e,et),o=n.start,s=n.end;for(let e of t){if(e===n||e.isLayoutOnly)continue;let t=e.start,c=e.end;if(!r&&o&&s&&(t===o||t===s||c===o||c===s))continue;let l=e.points;if(!(!l||l.length<2))for(let e of a)for(let t of T(l,et)){if(re(e.a,e.b,t.a,t.b,et,et)){i++;continue}w(e,t,et)>=tt&&i++}}return i},`pathConflictCount`),u=e((e,t)=>{let n=Math.abs(e.y-t.rect.top),r=Math.abs(e.y-t.rect.bottom),i=Math.abs(e.x-t.rect.left),a=Math.abs(e.x-t.rect.right),o=`top`,s=n;return r{let r=d.get(e)??[];r.push({side:t,edgeId:n}),d.set(e,r)},`addFaceClaim`);for(let e of t){if(e.isLayoutOnly)continue;let t=e.points??[];if(t.length<1)continue;let n=e.id??``,i=e.start,a=e.end;if(i){let e=r.get(i);e&&f(i,u(t[0],e),n)}if(a){let e=r.get(a);e&&f(a,u(t[t.length-1],e),n)}}let p=e((e,t,n)=>d.get(e)?.some(e=>e.edgeId!==n&&e.side===t)??!1,`faceIsClaimed`);for(let e of t){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=E(t,et);if(n<4)continue;let i=e.start,o=e.end;if(!i||!o)continue;let m=r.get(i),h=r.get(o);if(!m||!h)continue;let g=e.id??``,_=l(t,e,!0),v=l(t,e),y,b=_,x=n;for(let t of a){if(p(i,t,g))continue;let n=I(m,t);for(let r of a){if(p(o,r,g))continue;let a=I(h,r);for(let u of s(n,t,a,r)){if(c(u,[i,o]))continue;let t=E(u,et);if(_>0){let n=l(u,e,!0);if(n>b||n===b&&t>=x)continue;b=n,x=t,y=u;continue}l(u,e)>v||te.edgeId!==g));let n=d.get(o);n&&d.set(o,n.filter(e=>e.edgeId!==g)),f(i,u(y[0],m),g),f(o,u(y[y.length-1],h),g)}}}e(nt,`simplifyDetouredEdges`);var Q=.001,rt=10,it=7;function at(e,t){let n=t?0:e.length-1,r=t?1:-1,i=e[n],a=e[n+r];if(!i||!a)return;let o=a.x-i.x,s=a.y-i.y;if(!(Math.abs(o)+Math.abs(s)t&&M(e,ot(t)))}e(st,`labelOverlapsOwnMarker`);function ct(t,n){let r=[];for(let e of t){if(e.isLayoutOnly)continue;let t=e.points;if(!(!t||t.length<2))for(let n=0;n{let n=N(t,3);for(let{nodeId:t,rect:r}of i)if(t!==e&&M(n,r))return!0;return!1},`labelOverlapsForeignNode`),s=e((e,t)=>{let n=N(t,3);for(let t of r)if(t.edgeId!==e&&k(t.p1,t.p2,n))return!0;return!1},`labelOverlapsForeignEdge`),c=e((e,t,n)=>o(e,n)||s(t,n),`labelOverlapsAnything`),l=[],u=e(e=>{for(let{id:t,rect:n}of a)if(j(n,e))return t},`findContainingLane`),d=e((e,t)=>l.some(n=>n.labelId!==e&&M(t,n.rect)),`overlapsPlacedLabel`);for(let r of t){if(r.isLayoutOnly)continue;let t=r.labelNodeId;if(!t)continue;let i=n.get(t);if(!i)continue;let f=r.points;if(!f||f.length<2)continue;let p=i.width??0,m=i.height??0;if(p<=0||m<=0)continue;let h=[];for(let e=0;e=Q&&i>=Q||h.push({idx:e,length:r+i,orientation:r>=Q?`horizontal`:`vertical`,midX:(t.x+n.x)/2,midY:(t.y+n.y)/2})}if(h.length===0)continue;let g=h.length>=3?h.filter(e=>e.idx>0&&e.idx0?g:h,v=p>=m?`horizontal`:`vertical`,y=e(e=>[...e].sort((e,t)=>{let n=e.orientation===v;if(n!==(t.orientation===v))return n?-1:1;let r=e.length>=(e.orientation===`horizontal`?p:m)+2;return r===t.length>=(t.orientation===`horizontal`?p:m)+2?t.length-e.length:r?-1:1}),`rankSegments`),b=h[0],x=h[h.length-1],S=[.5,.25,.75,.05,.95,.15,.85,.1,.9],C=e((e,t)=>{let n=f[e.idx],r=f[e.idx+1];return{midX:n.x+(r.x-n.x)*t,midY:n.y+(r.y-n.y)*t}},`anchorAtT`),w=e((e,t,n)=>Math.min(n,Math.max(t,e)),`clamp`),T=e((e,t)=>e.midX>=t.left-Q&&e.midX<=t.right+Q&&e.midY>=t.top-Q&&e.midY<=t.bottom+Q,`pointInsideRectInclusive`),E=e(e=>{let t=P(e.midX,e.midY,p,m),n=u(t);if(n)return{laneId:n,anchor:e,rect:t};let r=a.find(({rect:t})=>T(e,t));if(!r)return;let i=r.rect.left+p/2+1,o=r.rect.right-p/2-1,s=r.rect.top+m/2+1,c=r.rect.bottom-m/2-1;if(i>o||s>c)return;let l={midX:w(e.midX,i,o),midY:w(e.midY,s,c)},d=P(l.midX,l.midY,p,m);return T(e,d)?{laneId:r.id,anchor:l,rect:d}:void 0},`placementForAnchor`),D=e((e,t,n)=>e.orientation===`horizontal`?Math.abs(t.midX-n.x):Math.abs(t.midY-n.y),`distanceAlongSegment`),O=e((e,t)=>{let n=(e.orientation===`horizontal`?p/2:m/2)+12;if(e===b){let r=f[e.idx];if(D(e,t,r)+Q{let n=y(e);for(let e of n)for(let n of S){let i=C(e,n);if(!O(e,i))continue;let a=E(i);if(a&&!st(a.rect,f)&&!d(t,a.rect)&&!c(t,r.id,a.rect))return{laneId:a.laneId,anchor:a.anchor}}},`tryPool`),A=e((e,n,i=!1)=>{let a=y(e);for(let e of a){let a={midX:e.midX,midY:e.midY};if(n&&!O(e,a))continue;let c=E(a);if(c&&!st(c.rect,f)&&!d(t,c.rect)&&!o(t,c.rect)&&(i||!s(r.id,c.rect)))return{laneId:c.laneId,anchor:c.anchor}}},`findLaneContainingFallback`),j=k(_)??(_.lengthe.labelId===t);n>=0?l[n]={labelId:t,rect:e}:l.push({labelId:t,rect:e})}}}e(ct,`anchorLabelsToPolyline`);var lt=1e-6,ut=8/2,dt=3;function ft(e,t){return e{let s=ft(r,i),c=0,l=e(e=>{if(!e)return;let t=a.get(e);if(!t)return;let n=o===`x`?t.w/2:t.h/2;n>c&&(c=n)},`consider`);l(n.labelNodeId);for(let e of t){if(e===n||e.isLayoutOnly)continue;let t=e.start,r=e.end;!t||!r||ft(t,r)===s&&l(e.labelNodeId)}return c>0?c+dt:0},`labelClearanceFor`);for(let e of t){if(e.isLayoutOnly)continue;let n=e.points;if(!O(n,lt))continue;let a=ne(e,r,lt);if(!a)continue;let{srcId:s,dstId:c,srcInfo:l,dstInfo:u,collinearX:d,collinearY:f}=a;if(d===f)continue;let p,m;if(d){let e=u.cy>l.cy;p={x:l.cx,y:e?l.rect.bottom:l.rect.top},m={x:u.cx,y:e?u.rect.top:u.rect.bottom}}else{let e=u.cx>l.cx;p={x:e?l.rect.right:l.rect.left,y:l.cy},m={x:e?u.rect.left:u.rect.right,y:u.cy}}if(B(p,m,i,[s,c],1))continue;let h=o(e,s,c,d?`x`:`y`),g=h>ut?h:ut,_=[0,g,-g];for(let n of _){let r={...p},a={...m};if(d){if(r.x+=n,a.x+=n,r.x<=l.rect.left||r.x>=l.rect.right||a.x<=u.rect.left||a.x>=u.rect.right)continue}else if(r.y+=n,a.y+=n,r.y<=l.rect.top||r.y>=l.rect.bottom||a.y<=u.rect.top||a.y>=u.rect.bottom)continue;if(!B(r,a,i,[s,c],1)&&!ae(r,a,t,e,{epsilon:lt})){e.points=[r,a];break}}}}e(pt,`straightenCollinearSiblingDetours`);function mt(t,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=z(n.values()),o=e((e,t)=>T(t,r).map(n=>({...n,edge:e,interior:n.index>=1&&n.index<=t.length-3})),`segmentsFor`),s=e(()=>{let e=[];for(let n of t){if(n.isLayoutOnly)continue;let t=n.points;!t||t.length<2||e.push(...o(n,D(t)))}return e},`allSegments`),c=e((e,t)=>e.horizontal&&t.horizontal?C(e.a.x,e.b.x,t.a.x,t.b.x)>=8&&Math.abs(e.a.y-t.a.y)<7:e.vertical&&t.vertical?C(e.a.y,e.b.y,t.a.y,t.b.y)>=8&&Math.abs(e.a.x-t.a.x)<7:!1,`hasCrowdedParallelTrack`),l=e((e,n)=>{let s=e.start,l=e.end,u=o(e,n);if(u.length!==n.length-1)return!1;let d=[s,l].filter(e=>!!e),f=e.labelNodeId?[e.labelNodeId]:[];for(let e of u)if(B(e.a,e.b,i,d,-2)||B(e.a,e.b,a,f,-2))return!1;for(let n of t){if(n===e||n.isLayoutOnly)continue;let t=n.points;if(!(!t||t.length<2)){for(let e of u)for(let i of o(n,D(t)))if(c(e,i)||V(e.a,e.b,i.a,i.b,r))return!1}}return!0},`candidateIsSafe`),u=e((e,t)=>{let n=D(e.edge.points??[]);if(n.length<4||e.index>=n.length-1)return;let r=n.map(e=>({...e}));if(e.horizontal)r[e.index].y+=t,r[e.index+1].y+=t;else if(e.vertical)r[e.index].x+=t,r[e.index+1].x+=t;else return;return o(e.edge,r).length===r.length-1?r:void 0},`shiftedCandidate`),d=e((e,t)=>({x:e.x??(t.left+t.right)/2,y:e.y??(t.top+t.bottom)/2}),`nodeCenter`),f=e(e=>{let t=e.edge,r=D(t.points??[]);if(r.length!==4||e.index!==1)return;let i=t.start?n.get(t.start):void 0,a=t.end?n.get(t.end):void 0,o=i?F(i):void 0,s=a?F(a):void 0,c=r.slice(e.index+2);if(!(!i||!a||!o||!s||c.length===0))return{sourceCenter:d(i,o),targetCenter:d(a,s),sourceRect:o,tail:c}},`sourceDetourContextFor`),p=e((e,t,n,i,a,o)=>{let s=i.y>=n.y,c=s?a.bottom:a.top,l=c+(s?20:-20);if(s&&e.b.y<=l+r||!s&&e.b.y>=l-r)return;let u=e.a.x+t;return D([{x:n.x,y:c},{x:n.x,y:l},{x:u,y:l},{x:u,y:e.b.y},...o],r)},`verticalSourceDetour`),m=e((e,t,n,i,a,o)=>{let s=i.x>=n.x,c=s?a.right:a.left,l=c+(s?20:-20);if(s&&e.b.x<=l+r||!s&&e.b.x>=l-r)return;let u=e.a.y+t;return D([{x:c,y:n.y},{x:l,y:n.y},{x:l,y:u},{x:e.b.x,y:u},...o],r)},`horizontalSourceDetour`),h=e((e,t)=>{let n=f(e);if(n){if(e.vertical)return p(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail);if(e.horizontal)return m(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail)}},`sourceDetourCandidate`),g=[-7,7,-14,14,-21,21];for(let e=0;e<12;e++){let e=s(),t=!1;for(let n=0;ne.interior);for(let e of o){for(let n of g){let r=u(e,n);if(r&&l(e.edge,r)){e.edge.points=r,t=!0;break}let i=h(e,n);if(i&&l(e.edge,i)){e.edge.points=i,t=!0;break}}if(t)break}}if(!t)return}}e(mt,`nudgeSharedInteriorSubpaths`);function ht(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=r.x-n.x,s=r.y-n.y,c=i*s-a*o;if(Math.abs(c)<1e-10)return!1;let l=n.x-e.x,u=n.y-e.y,d=(l*s-u*o)/c,f=(l*a-u*i)/c,p=.01;return d>p&&d<.99&&f>p&&f<.99}e(ht,`segmentsIntersect`);function gt(e){let n=e.nodes??[],r=e.edges??[],i=[];if(!r.length||!n.length)return i;let a=te(n),o=[];for(let e of r){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=e.start,r=e.end,s=e.labelNodeId,c=e.id??`${n}->${r}`;for(let e of a)if(e.nodeId!==n&&e.nodeId!==r&&!(s&&e.nodeId===s)){for(let n=0;n0){let e=i.filter(e=>e.type===`edge-node-overlap`).length,n=i.filter(e=>e.type===`edge-edge-crossing`).length;t.warn(`[SWIMLANE_VALIDATE] ${i.length} issue(s) detected: ${e} edge-node overlap(s), ${n} edge crossing(s)`);for(let e of i)t.warn(`[SWIMLANE_VALIDATE] ${e.type}: ${e.detail}`)}return i}e(gt,`validateSwimlanesLayout`);function _t(t,n){let r=t.nodes??[],i=t.edges??[],a=r.filter(e=>!e.isGroup);if((n===`LR`||n===`RL`)&&a.length>0&&!Re(t,n)||n===`BT`&&a.length>0&&!Le(t))return;for(let e of i){if(e.isLayoutOnly)continue;let t=e.points;!t||t.length<2||(e.points=G(W(t)))}nt(i,r),pt(i,r),He(i,r);let o=new Map;for(let e of r)o.set(String(e.id),e);ct(i,o),q(i,o),Ue(i,o),mt(i,o),Ge(i,o),Ke(i,o),qe(i,o),Xe(i,o);let s=e(()=>{$e(i,o),Ze(i,o),Qe(i,o),ct(i,o),ke(i,o),qe(i,o),ct(i,o),ke(i,o)},`finalizeRenderedEdges`);s(),mt(i,o),s(),Je(i,o),Ye(i,o),Je(i,o),Ye(i,o)}e(_t,`postProcessSwimlaneLayout`);function vt(e){let t=new Map(e.nodeById),n=new Set,r=[];for(let i of e.edges){if(!t.has(i.src)||!t.has(i.dst))continue;let e=`${i.id}:${i.src}->${i.dst}`;n.has(e)||(n.add(e),r.push(i))}return{nodes:[...t.keys()],edges:r,layout:e.layout,nodeById:t}}e(vt,`normalizeGraph`);function yt(e,t){return e.edges.filter(e=>e.dst===t)}e(yt,`incoming`);function bt(e){let t=new Map;for(let n of e.nodes)t.set(n,[]);for(let n of e.edges)t.get(n.src).push(n.dst);return t}e(bt,`buildSuccessorMap`);function xt(e){let t=bt(e);for(let e of t.values())e.sort((e,t)=>e.localeCompare(t));return t}e(xt,`buildSortedSuccessorMap`);function St(e){let t=new Map;for(let n of e.nodes)t.set(n,0);for(let n of e.edges)t.set(n.dst,(t.get(n.dst)??0)+1);return t}e(St,`buildInDegreeMap`);function Ct(e){return[...e.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}e(Ct,`sortedZeroInDegreeNodes`);function wt(e,t=()=>!0){let n=new Map,r=new Map;for(let t of e.nodes)n.set(t,[]),r.set(t,[]);for(let i of e.edges)t(i)&&(r.get(i.src).push(i.dst),n.get(i.dst).push(i.src));return{preds:n,succs:r}}e(wt,`buildPredecessorSuccessorMaps`);function Tt(e,t,n,r){let i=0;for(let t of e.nodes)r?.skipGroups&&e.nodeById.get(t)?.isGroup||(i=Math.max(i,n[t]??0));let a=Array.from({length:i+1},()=>[]);for(let i of t)r?.skipGroups&&e.nodeById.get(i)?.isGroup||a[Math.max(0,n[i]??0)].push(i);return a}e(Tt,`buildLayersFromRanks`);function Et(e){let t=St(e),n=Ct(t),r=[],i=xt(e);for(;n.length;){let e=n.shift();r.push(e);for(let r of i.get(e)??[])if(t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0){let e=0;for(;e{if(i-e<=1)return 0;let a=e+i>>1,o=r(e,a)+r(a,i),s=e,c=a,l=e;for(;s=i||se.dst===t.dst?e.id.localeCompare(t.id):e.dst.localeCompare(t.dst));let i=Object.create(null);for(let e of n.nodes)i[e]=0;let a=[],o=e(e=>{i[e]=1;for(let t of r.get(e)??[]){let e=t.dst;i[e]===0?o(e):i[e]===1&&a.push(t)}i[e]=2},`dfs`),s=St(n),c=[...n.nodes.filter(e=>(s.get(e)??0)===0),...n.nodes.filter(e=>(s.get(e)??0)!==0)];for(let e of c)i[e]===0&&o(e);let l=new Set(a.map(e=>`${e.id}:${e.src}->${e.dst}`)),u=n.edges.map(e=>l.has(`${e.id}:${e.src}->${e.dst}`)?{id:e.id,src:e.dst,dst:e.src,weight:e.weight,ref:e.ref}:e);return{acyclic:{nodes:[...n.nodes],edges:u,layout:n.layout,nodeById:new Map(n.nodeById)},reversed:a}}e(kt,`removeCycles_DFS`);function At(t){let n=new Map,r=e(e=>{if(n.has(e))return n.get(e);let i=t.nodeById.get(e);if(!i)return n.set(e,null),null;let a=i.parentId;if(!a)return n.set(e,null),null;let o=r(a)??a;return n.set(e,o),o},`resolve`);for(let e of t.nodes)r(e);return n}e(At,`buildTopLaneMap`);function jt(e){let t=At(e);return e=>t.get(e)??null}e(jt,`createTopLaneResolver`);function Mt(e){let t=[];for(let n of e.layout.nodes??[])n.isGroup&&!n.parentId&&t.push(n.id);return[...new Set(t)].reverse()}e(Mt,`buildTopLaneOrder`);function Nt(e,t){let n=Mt(e);if(!t||t.length===0)return n;let r=new Set(n),i=new Set,a=[];for(let e of t)!r.has(e)||i.has(e)||(i.add(e),a.push(e));for(let e of n)i.has(e)||a.push(e);return a}e(Nt,`resolveTopLaneOrder`);var Pt={EPSILON:1e-6},Ft={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},It={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Lt(t,n){let r=vt(t),i=n?.laneOf??(()=>null),a=n?.rankHint,{preds:o}=wt(r);for(let e of o.values())e.sort((e,t)=>e.localeCompare(t));let s=Et(r)??[...r.nodes].sort((e,t)=>e.localeCompare(t)),c=new Map;for(let[e,t]of s.entries())c.set(t,e);let l=new Map,u=new Map;for(let e of r.nodes)u.set(e,[]);for(let e of s){let t=(o.get(e)??[]).filter(e=>l.has(e));if(t.length>0){let n=Rt(e,t,{laneOf:i,rankHint:a,topoIndex:c});l.set(e,n),u.get(n).push(e)}else l.has(e)||l.set(e,null)}for(let e of r.nodes)l.has(e)||l.set(e,null);let d=new Set;for(let e of r.nodes)(l.get(e)??null)===null&&d.add(e);let f=[...d].sort((e,t)=>{let n=c.get(e)??0,r=c.get(t)??0;return n===r?e.localeCompare(t):n-r}),p=zt(r),m=new Map;for(let[e,t]of p.entries())m.set(e,[...t].sort((e,t)=>e.localeCompare(t)));let h=Bt(m),g=Vt(m),_=new Map;for(let e of r.nodes)_.set(e,[]);for(let e of g)for(let t of e.nodes){let n=_.get(t);n?n.push(e.id):_.set(t,[e.id])}let v=[],y=[],b=new Set,x=e(e=>{if(!b.has(e)){b.add(e),v.push(e);for(let t of u.get(e)??[])x(t);y.push(e)}},`walk`);for(let e of f)x(e);for(let e of s)x(e);return{parent:l,children:u,roots:f,componentOf:h,blocks:g,nodeBlocks:_,adjacency:m,preorder:v,postorder:y,topologicalOrder:s}}e(Lt,`buildDrivingTree`);function Rt(e,t,n){let r=n.laneOf(e);return[...t].sort((e,t)=>{let i=n.laneOf(e),a=n.laneOf(t),o=i!=null&&i===r;if(o!==(a!=null&&a===r))return o?-1:1;let s=n.rankHint?.[e],c=n.rankHint?.[t];if(s!=null&&c!=null&&s!==c)return c-s;let l=n.topoIndex.get(e)??0,u=n.topoIndex.get(t)??0;return l===u?e.localeCompare(t):l-u})[0]}e(Rt,`chooseParent`);function zt(e){let t=new Map;for(let n of e.nodes)t.set(n,new Set);for(let n of e.edges)t.get(n.src).add(n.dst),t.get(n.dst).add(n.src);return t}e(zt,`buildAdjacency`);function Bt(e){let t=new Map,n=0;for(let r of e.keys()){if(t.has(r))continue;let i=[r];for(;i.length>0;){let r=i.pop();if(!t.has(r)){t.set(r,n);for(let n of e.get(r)??[])t.has(n)||i.push(n)}}n++}return t}e(Bt,`assignComponents`);function Vt(t){let n=new Map,r=new Map,i=[],a=[],o=0,s=e((e,c)=>{n.set(e,++o),r.set(e,o);for(let l of t.get(e)??[])l!==c&&(n.has(l)?(n.get(l)??0)<(n.get(e)??0)&&(i.push([e,l]),r.set(e,Math.min(r.get(e)??o,n.get(l)??o))):(i.push([e,l]),s(l,e),r.set(e,Math.min(r.get(e)??o,r.get(l)??o)),(r.get(l)??0)>=(n.get(e)??0)&&a.push(Ht(e,l,i,a.length))))},`visit`);for(let e of t.keys())n.has(e)||s(e,null);return a}e(Vt,`computeBlocks`);function Ht(e,t,n,r){let i=[],a=new Set;for(;n.length>0;){let r=n.pop();if(i.push(r),a.add(r[0]),a.add(r[1]),r[0]===e&&r[1]===t||r[0]===t&&r[1]===e)break}return{id:r,edges:i,nodes:[...a]}}e(Ht,`popBlock`);function Ut(t,n,r){let i=[...t.nodes],a=new Map;for(let[e,t]of i.entries())a.set(t,e);let o=i.length,s=Array(o).fill(-1),c=Array(o).fill(0),l=[],u=new Set;for(let e of i){let t=r.parent.get(e)??null,n=a.get(e);n!=null&&(t??(s[n]=-1,c[n]=0,u.has(e)||(u.add(e),l.push(e))))}for(;l.length>0;){let e=l.shift(),t=a.get(e);if(t==null)continue;let n=r.children.get(e)??[];for(let e of n){if(u.has(e))continue;let n=a.get(e);n!=null&&(s[n]=t,c[n]=c[t]+1,u.add(e),l.push(e))}}for(let e of i){if(u.has(e))continue;let t=a.get(e);t!=null&&(s[t]=-1,c[t]=0,u.add(e))}let d=Math.max(1,Math.ceil(Math.log2(Math.max(1,o)))+1),f=Array.from({length:d},()=>Array(o).fill(-1));for(let e=0;e{if(e===-1||t===-1)return-1;c[e]>t&1&&(e=f[t][e],e===-1))return-1;if(e===t)return e;for(let n=d-1;n>=0;n--){let r=f[n][e],i=f[n][t];r!==-1&&i!==-1&&r!==i&&(e=r,t=i)}return f[0][e]},`lcaIndex`),m=Array.from({length:o},()=>new Map);for(let e of t.edges){let t=e.src,r=e.dst,i=n[t],o=n[r];if(i==null||o==null||(i>o&&([t,r]=[r,t],[i,o]=[o,i]),i==null||o==null||i===o))continue;let s=a.get(t),c=a.get(r);if(s==null||c==null)continue;let l=p(s,c);if(l===-1)continue;let u=m[l];for(let e=i;e{if(t.size!==0)for(let[n,r]of t)e.set(n,(e.get(n)??0)+r)},`mergeInto`),_=new Set,v=e(e=>{let t=a.get(e);_.add(e);let i=t==null?void 0:m[t],o=i?new Map(i):new Map,s=r.children.get(e)??[];for(let t of s){let r=v(t),i=n[e];if(i!=null){let a=h.get(e);a||(a=new Map,h.set(e,a));let o=r.get(i)??0,s=n[t];s!=null&&s>i&&(o+=1),a.set(t,o)}g(o,r)}return o},`dfs`);for(let e of r.roots)_.has(e)||v(e);for(let e of i)_.has(e)||v(e);return h}e(Ut,`computeSubtreeCrossCounts`);function Wt(t,n,r){let i=new Map,a=e(e=>{let t=r[e]??0,o=[...n.get(e)??[]];o.sort(Gt(r));for(let e of o){a(e);let n=i.get(e);n!=null&&(t=Math.min(t,n))}i.set(e,t)},`annotate`);for(let e of t)a(e);return i}e(Wt,`annotateMinimumLayers`);function Gt(e){return(t,n)=>{let r=e[t]??0,i=e[n]??0;return r===i?t.localeCompare(n):r-i}}e(Gt,`compareByRankThenId`);function Kt(t,n,r,i){let a=0;for(let e of n){let t=r[e]??0;t>a&&(a=t)}let o=Array.from({length:a+1},()=>[]),s=new Set,c=e(e=>{if(s.has(e))return;s.add(e);let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e);for(let t of i(e))c(t)},`emit`);for(let e of t)c(e);for(let e of n)if(!s.has(e)){let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e),s.add(e)}return o}e(Kt,`emitNodesInTreeOrder`);function qt(e){let t=[];for(let n of e){let e=new Set,r=[];for(let t of n)e.has(t)||(e.add(t),r.push(t));t.push(r)}return t}e(qt,`deduplicateLayers`);function Jt(e,t,n,r){return i=>{let a=e.get(i)??[];if(a.length===0)return[];let o=t[i]??0,s=[],c=[],l=n.get(i);for(let e of a){let t=r.get(e)??o;t>o?s.push({child:e,min:t}):c.push(e)}return s.sort((e,t)=>e.min===t.min?e.child.localeCompare(t.child):e.min-t.min),c.sort((e,t)=>{let n=l?.get(e)??0,i=l?.get(t)??0;if(n!==i)return n-i;let a=r.get(e)??o,s=r.get(t)??o;return a===s?e.localeCompare(t):a-s}),[...s.map(e=>e.child),...c]}}e(Jt,`createChildOrderer`);function Yt(e,t,n){let r=Lt(e,{rankHint:t,laneOf:n}),{children:i,roots:a}=r;for(let t of e.nodes)i.has(t)||i.set(t,[]);let o=Ut(e,t,r),s=[...a].sort(Gt(t)),c=Jt(i,t,o,Wt(s,i,t)),l=Kt(s,e.nodes,t,c);return l=qt(l),l}e(Yt,`buildMultitreeLayerOrder`);function Xt(e,t,n){let r=new Set(e),i=new Set(t),a=Dt(t),o=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&o.push(a.get(e.dst));return Ot(o)}e(Xt,`countCrossingsBetweenAdjacent`);function Zt(e,t,n){let r=[];for(let e of t){let t=n[e.src],i=n[e.dst];if(t==null||i==null||t===i)continue;let a=e.src,o=e.dst,s=t,c=i;t>i&&(a=e.dst,o=e.src,s=i,c=t);for(let t=s;t(n[t]??0)-(n[e]??0));for(let s of o){let o=n[s]??0;if(o===0)continue;let c=0;for(let e of r.get(s)??[])c=Math.max(c,(n[e]??0)+1);if(c>=o)continue;let l=o;n[s]=c;let u=Zt(Yt(e,n,i),e.edges,n);u(t[e]??0)-(t[n]??0)||e.localeCompare(n));for(let i of r){let r=n(i);if(!r)continue;let a=e.edges.filter(e=>e.src===i);if(a.length===0)continue;let o=!1,s=0;for(let e of a){let t=n(e.dst);t==null||t===r?o=!0:s++}if(s===0||o)continue;let c=0,l=!1;for(let t of e.edges){if(t.dst!==i)continue;let e=n(t.src);e&&(e===r?l=!0:c++)}if(c>0||!l)continue;let u=t[i]??0,d=u+s,f=0;for(let n of e.edges)n.dst===i&&(f=Math.max(f,(t[n.src]??0)+1));let p=Math.max(u,f,d);p!==u&&(t[i]=p)}}e($t,`adjustCrossLaneSources`);function en(e,t){let n=vt(e),r=Et(n)??[...n.nodes].sort(),i=t?.compactSingleInput??!1,a=jt(n),o=Object.create(null);for(let e of r){let r=yt(n,e),s=t?.ignoreCrossLaneEdges?r.filter(t=>{let n=a(t.src),r=a(e);return!n||!r||n===r}):r;if(s.length===0)o[e]=0;else if(i&&s.length===1){let t=s[0].src;a(t)===a(e)?o[e]=(o[t]??0)+1:o[e]=o[t]??0}else{let t=-1/0;for(let e of s)t=Math.max(t,(o[e.src]??0)+1);o[e]=t===-1/0?0:t}}return(t?.optimizeRanksByCrossings??!1)&&(o=Qt(n,o)),t?.ignoreCrossLaneEdges&&$t(n,o),{layers:Yt(n,o,a),rankOf:o,dummy:new Set}}e(en,`assignLayers_LongestPath`);function tn(t,n){let r=vt(t),i={...en(r,{compactSingleInput:n?.compactSingleInput,ignoreCrossLaneEdges:n?.ignoreCrossLaneEdges,optimizeRanksByCrossings:n?.optimizeRanksByCrossings}).rankOf},a=jt(r),{preds:o,succs:s}=wt(r,e=>{if(n?.ignoreCrossLaneEdges){let t=a(e.src),n=a(e.dst);if(t&&n&&t!==n)return!1}return!0}),c=Et(r)??[...r.nodes],l=[...c].reverse(),u=e((e,t)=>{let n=0;for(let t of o.get(e)??[])n=Math.max(n,(i[t]??0)+1);let r=1/0,a=s.get(e)??[];return a.length>0&&(r=Math.min(...a.map(e=>(i[e]??0)-1))),Number.isFinite(r)||(r=Math.max(n,t)),Math.min(Math.max(t,n),r)},`clampFeasible`),d=Ft.GRAVITY_ITERATIONS,f=e(e=>{let t=!1;for(let n of e){let e=o.get(n)??[],r=s.get(n)??[];if(e.length===0&&r.length===0)continue;let a=e.length>0?e.reduce((e,t)=>e+(i[t]??0)+1,0)/e.length:i[n]??0,c=r.length>0?r.reduce((e,t)=>e+(i[t]??0)-1,0)/r.length:i[n]??0,l=Math.round((a+c)/2),d=u(n,l);d!==i[n]&&(i[n]=d,t=!0)}return t},`relaxOrder`);for(let e=0;e0){let n=Math.min(...t.map(e=>(i[e]??0)-1));(i[e]??0)>n&&(i[e]=n)}}return{layers:Tt(r,c,i),rankOf:i,dummy:new Set}}e(tn,`assignLayers_Gravity`);function nn(e){let t=St(e),n=xt(e),r=Ct(t),i=[];for(;r.length>0;){let e=[];for(let a of r){i.push(a);for(let r of n.get(a)??[])t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0&&e.push(r)}r=e.sort((e,t)=>e.localeCompare(t))}return i.length===e.nodes.length?i:null}e(nn,`topoSortByGenerationIfAcyclic`);function rn(t,n){let r=vt(t),i=n?.direction===`LR`?nn(r)??[...r.nodes].sort():Et(r)??[...r.nodes].sort(),a=jt(r),o=e(e=>a(e)??e,`laneOf`),s=Object.create(null),c=new Map,l=e((e,t)=>n?.ignoreCrossLaneEdges??!0?+(o(e)===o(t)):1,`edgeWeight`);for(let e of i){if(r.nodeById.get(e)?.isGroup)continue;let t=yt(r,e),n=0;if(t.length>0)for(let r of t){let t=r.src,i=s[t]??0;n=Math.max(n,i+l(t,e))}let i=o(e),a=c.get(i)??0,u=Math.max(n,a);s[e]=u,c.set(i,u+1)}return{layers:Tt(r,i,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}e(rn,`assignLayers_LaneAwareCompact`);function an(t,n){let r=vt(n),{rankOf:i}=t,a=t.layers.map(e=>[...e]),o=new Set(t.dummy?[...t.dummy]:[]),s=0,c=new Map(r.nodeById),l=e(e=>{let t=`placeholder-${s++}`,n={id:t,isGroup:!1,isDummy:!0,width:0,height:0};for(c.set(t,n),o.add(t);a.length<=e;)a.push([]);return a[e].push(t),i[t]=e,t},`addDummyAt`),u=[...r.edges].sort((e,t)=>e.id===t.id?e.src===t.src?e.dst.localeCompare(t.dst):e.src.localeCompare(t.src):e.id.localeCompare(t.id)),d=[];for(let e of u){let t=i[e.src]??0,n=i[e.dst]??0;if(n-t<=1){d.push(e);continue}let r=e.src;for(let i=t+1,a=0;i!r.nodes.includes(e))],edges:d,layout:r.layout,nodeById:c};return{layering:{layers:a,rankOf:i,dummy:o},graphWithDummies:f}}e(an,`makeProperLayering`);function on(e){let t=e.length;if(t===0)return 1/0;let n=[...e].sort((e,t)=>e-t);return t%2==1?n[(t-1)/2]:.5*(n[t/2-1]+n[t/2])}e(on,`median`);function sn(e){return e.length===0?1/0:e.reduce((e,t)=>e+t,0)/e.length}e(sn,`barycenter`);function cn(e,t,n,r){let i=new Map;for(let t of e)i.set(t,[]);for(let e of n)r===`down`?t.has(e.src)&&i.has(e.dst)&&i.get(e.dst).push(t.get(e.src)):t.has(e.dst)&&i.has(e.src)&&i.get(e.src).push(t.get(e.dst));return i}e(cn,`neighborPositionsFor`);function ln(e,t,n){let r=n.get(e)??0,i=n.get(t)??0;return r===i?e.localeCompare(t):r-i}e(ln,`currentOrderTieBreak`);function un(e,t,n){let r=new Set(e),i=new Set(t),a=Dt(e),o=Dt(t),s=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&s.push({u:a.get(e.src),v:o.get(e.dst)});return s.sort((e,t)=>e.u===t.u?e.v-t.v:e.u-t.u),Ot(s.map(e=>e.v))}e(un,`countCrossingsBetweenAdjacent`);function dn(e,t,n){return[...e].sort((e,r)=>{let i=on(t.get(e)??[]),a=on(t.get(r)??[]);return i===a?ln(e,r,n):isFinite(i)?isFinite(a)?i-a:-1:1})}e(dn,`sortByHeuristic`);function fn(e,t,n,r,i,a){let o=Dt(e),s=Dt(t),c=cn(t,o,n,r);if(!i||!a||a.length===0)return dn(t,c,s);let l=new Map;for(let e of t){let t=i(e),n=l.get(t)??[];n.push(e),l.set(t,n)}let u=[];for(let e of a){let t=l.get(e);if(!t||t.length===0)continue;let n=dn(t,c,s);u.push(...n)}let d=l.get(null);if(d&&d.length>0){let e=dn(d,c,s);for(let t of e){let e=sn(c.get(t)??[]),n=u.length;if(isFinite(e)){for(let[t,r]of u.entries())if(es.has(e.src)&&c.has(e.dst)),d=l?r.filter(e=>c.has(e.src)&&l.has(e.dst)):void 0,f=e(e=>{let n=un(t,e,u);return d&&i&&(n+=un(e,i,d)),n},`crossingScore`),p=a?new Map:null;if(a&&p)for(let e of n)p.set(e,a(e));let m=!0,h=f(o);for(;m;){m=!1;for(let e=0;e+1[...e]),i=t.edges,a=jt(t),o=Nt(t,n?.laneOrder);for(let e=0;e<3;e++){for(let e=1;e=0;e--)r[e]=fn(r[e+1],r[e],i,`up`,a,o),r[e]=pn(r[e+1],r[e],i,r[e-1],a)}return{layers:r}}e(mn,`orderLayers`);function hn(t,n,r){let i=r?.layerGap??It.DEFAULT_LAYER_GAP,a=r?.nodeGap??It.DEFAULT_NODE_GAP,o=r?.laneGap??a*2,s=r?.direction??`TB`,c=s===`LR`||s===`RL`,l=t.layers,u=Object.create(null),d=Object.create(null),f=e(e=>n.nodeById.get(e),`getNode`),p=e(e=>f(e)?.width??0,`getWidth`),m=e(e=>f(e)?.height??0,`getHeight`),h=jt(n),g=Nt(n,r?.laneOrder),_=l.map(e=>e.reduce((e,t)=>Math.max(e,m(t)),0)),v=[];if(c)for(let e=0;e+1Math.max(e,p(t)),0),n=l[e+1].reduce((e,t)=>Math.max(e,p(t)),0),r=_[e],a=_[e+1],o=r/2+a/2,s=(t+n)/2,c=Math.max(0,s-o-i);v.push(c)}let y=new Set;for(let e of l)for(let t of e)y.add(h(t));let b=y.has(null),x=g.filter(e=>y.has(e)),S=[...b?[null]:[],...x],C=Object.create(null);for(let e of x)C[e]=0;b&&(C.null=0);for(let e of l){let t=Object.create(null),n=[];for(let r of e){let e=h(r);e===null?n.push(r):(t[e]||=[]).push(r)}for(let[e,n]of Object.entries(t)){let t=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);C[e]=Math.max(C[e]??0,t)}if(b&&n.length){let e=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);C.null=Math.max(C.null??0,e)}}let w=new Map;{let e=S.map(e=>(e===null?C.null:C[e])??0),t=-(e.reduce((e,t)=>e+t,0)+o*Math.max(0,S.length-1))/2;for(let n=0;np(e)),r=i-(e.reduce((e,t)=>e+t,0)+a*(t.length-1))/2;for(let[i,o]of t.entries()){let t=e[i];u[o]=r+t/2,d[o]=T+n/2,r+=t+a}}}let o=v[e]??0;T+=n+i+o}let E=new Map;for(let e of n.edges){let t=e.ref.id;E.has(t)||E.set(t,[]),E.get(t).push(e)}for(let[,e]of E){if(e.length===0)continue;let t=e[0].ref,r=t.start,i=t.end;if(r==null||i==null)continue;let a=Math.round(((u[r]??0)+(u[i]??0))/2),o=new Set;for(let t of e)o.add(t.src),o.add(t.dst);for(let e of o)e!==r&&e!==i&&n.nodeById.get(e)?.isDummy&&(u[e]=a)}return{x:u,y:d}}e(hn,`assignCoordinates`);var gn=8;function _n(e){let t=2166136261;for(let n=0;n>>0}e(_n,`hashString`);function vn(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}e(vn,`mulberry32`);function yn(e,t){let n=[...e],r=vn(t);for(let e=n.length-1;e>0;e--){let t=Math.floor(r()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n}e(yn,`deterministicShuffle`);function bn(e,t){let n=0;for(let[r,i]of e.entries())n+=Math.abs(r-(t.get(i)??r));return n}e(bn,`sourceDistance`);function xn(e,t){let n=new Map;for(let[t,r]of e.entries())n.set(r,t);let r=0;for(let{a:e,b:i,weight:a}of t){let t=n.get(e),o=n.get(i);t!=null&&o!=null&&(r+=a*Math.abs(t-o))}return r}e(xn,`laneArrangementCost`);function Sn(e){let t=Mt(e);if(t.length<2)return[];let n=new Map(t.map((e,t)=>[e,t])),r=jt(e),i=new Map;for(let t of e.layout.edges??[]){if(t.isLayoutOnly)continue;let a=typeof t.start==`string`?t.start:void 0,o=typeof t.end==`string`?t.end:void 0;if(!a||!o||!e.nodeById.has(a)||!e.nodeById.has(o))continue;let s=r(a),c=r(o);if(!s||!c||s===c)continue;let l=n.get(s),u=n.get(c);if(l==null||u==null)continue;let[d,f]=l<=u?[s,c]:[c,s],p=`${d}\0${f}`,m=i.get(p);m?m.weight++:i.set(p,{a:d,b:f,weight:1})}return[...i.values()]}e(Sn,`buildWeightedLaneEdges`);function Cn(e,t,n){let r=[...e],i=xn(r,t),a=!0,o=0,s=Math.max(1,r.length);for(;a&&oe.a===t.a?e.b.localeCompare(t.b):e.a.localeCompare(t.a)).map(({a:e,b:t,weight:n})=>`${e}:${t}:${n}`).join(`|`);return _n(`${e.join(`|`)}#${r}#${n}`)}e(Tn,`seedForRestart`);function En(e,t={}){let n=Mt(e);if(n.length<2)return n;let r=Sn(e);if(r.length===0)return n;let i=new Map(n.map((e,t)=>[e,t])),a=Cn(n,r,i),o=Math.max(0,t.restarts??gn);for(let e=0;e$&&c*3>=s?o>0?`bottom`:`top`:s>$?a>0?`right`:`left`:n}e(Pn,`chooseOrthogonalSide`);function Fn(e,t){return Math.abs(e.to-t.from)<$||Math.abs(e.to-t.to)<$?e.to:e.from}e(Fn,`sharedLineEndpointCoord`);function In(e,t){return e.orient===`vertical`?{x:e.coord,y:t}:{x:t,y:e.coord}}e(In,`pointOnLine`);function Ln(t,n){let r=t.nodes??[],i=t.edges??[],a=[];for(let e of i)e.isLayoutOnly||a.push({...e,__originalEdge:e});let o=new Map,s=new Map,c=[],l=n===`LR`;for(let e of r)o.set(e.id,e);let u=r.filter(e=>e.isGroup&&!e.parentId);for(let t of u){let n={id:t.id},i=e(e=>{s.set(e.id,n),r.filter(t=>t.parentId===e.id).forEach(i)},`assignLane`);i(t)}let d=r.filter(e=>!e.isGroup&&!e.isEdgeLabel).map(e=>{let t=e.width??10,n=e.height??10,r=e.x??0,i=e.y??0,a=On;return{nodeId:e.id,minX:r-t/2-a,maxX:r+t/2+a,minY:i-n/2-a,maxY:i+n/2+a,visualXHalfExtent:l?n/2+a:t/2+a}}),f=e((e,t,n,r)=>{let i=c.find(n=>n.orientation===e&&Math.abs(n.coord-t)<1);return i||(i={id:`pipe-${e}-${t.toFixed(0)}`,orientation:e,coord:t,spanMin:n,spanMax:r,tracks:[]},c.push(i)),i.spanMin=Math.min(i.spanMin,n),i.spanMax=Math.max(i.spanMax,r),i},`getOrAddPipe`),p=e((e,t)=>{let n=e.width??10,r=e.height??10,i=e.x??0,a=e.y??0;switch(t){case`top`:return{x:i,y:a-r/2};case`bottom`:return{x:i,y:a+r/2};case`left`:return{x:i-n/2,y:a};case`right`:return{x:i+n/2,y:a}}},`portForSide`),m=e((e,t,n)=>p(e,Pn(e,t,n?`bottom`:`top`)),`getOrthogonalPort`),h=[],g=[],_=new Set,v=1e3,y=e((e,t,n)=>{if(h.length===0)return 0;let r=Math.abs(t.y-n.y)<$,i=Math.abs(t.x-n.x)<$;if(!r&&!i)return 0;let a=0;if(r){let r=t.y,i=Math.min(t.x,n.x)-$,o=Math.max(t.x,n.x)+$;if(o<=i)return 0;for(let t of h)t.edgeIndex!==e&&t.orientation===`vertical`&&(t.pipe.coordo||t.from-$<=r&&t.to+$>=r&&(a+=v))}else if(i){let r=t.x,i=Math.min(t.y,n.y)-$,o=Math.max(t.y,n.y)+$;if(o<=i)return 0;for(let t of h)t.edgeIndex!==e&&t.orientation===`horizontal`&&(t.pipe.coordo||t.from-$<=r&&t.to+$>=r&&(a+=v))}return a},`crossingPenalty`),b=a.map((e,t)=>{if(!e.start||!e.end)return{idx:t,crossLane:0,dx:0,dy:0};let n=o.get(e.start),r=o.get(e.end),i=s.get(e.start),a=s.get(e.end);return{idx:t,crossLane:i&&a&&i.id!==a.id?1:0,dx:n&&r?Math.abs((r.x??0)-(n.x??0)):0,dy:n&&r?Math.abs((r.y??0)-(n.y??0)):0}}).sort((e,t)=>{if(e.crossLane!==t.crossLane)return t.crossLane-e.crossLane;let n=e.dx+e.dy,r=t.dx+t.dy;return Math.abs(n-r)>1?n-r:e.idx-t.idx}).map(e=>e.idx),x=e((e,t,n,r)=>{let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return!!d.find(c=>n&&c.nodeId===n||r&&c.nodeId===r?!1:Math.abs(e.x-t.x)>$?c.minYe.y&&c.maxX>i&&c.minXe.x&&c.maxY>o&&c.minYPn(e,t,`bottom`),`determineSide`),T=new Map;for(let[e,t]of a.entries()){if(!t.start||!t.end||t.start===t.end||t.points&&t.points.length>0)continue;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)continue;let i=(r.x??0)-(n.x??0),a=(r.y??0)-(n.y??0);T.set(e,{edgeIdx:e,srcId:t.start,dstId:t.end,srcSide:w(n,{x:r.x??0,y:r.y??0}),dstSide:w(r,{x:n.x??0,y:n.y??0}),absDx:Math.abs(i),absDy:Math.abs(a),dxSign:Math.sign(i),dySign:Math.sign(a)})}let E=e(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.absDx===0?1/0:e.absDy/e.absDx:e.absDy===0?1/0:e.absDx/e.absDy,`preferenceStrength`),D=e(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.dxSign>=0?`right`:`left`:e.dySign>=0?`bottom`:`top`,`secondarySide`),O=new Map;for(let e of T.values()){let t=`${e.srcId}:${e.srcSide}`;O.has(t)||O.set(t,[]),O.get(t).push(e)}let k=new Map,A=e((e,t)=>`${e}:${t}`,`loadKey`);for(let e of T.values())k.set(A(e.srcId,e.srcSide),(k.get(A(e.srcId,e.srcSide))??0)+1),k.set(A(e.dstId,e.dstSide),(k.get(A(e.dstId,e.dstSide))??0)+1);for(let e of O.values())if(!(e.length<2)){e.sort((e,t)=>{let n=E(e),r=E(t);return Math.abs(n-r)>1e-9?r-n:e.edgeIdx-t.edgeIdx});for(let t=1;t=i||(k.set(A(n.srcId,n.srcSide),i-1),k.set(A(n.srcId,r),a+1),n.srcSide=r)}}let j=e(e=>{let t=e?.shape;return t===`question`||t===`diamond`},`isDiamondNode`),M=new Map;for(let e of T.values())M.has(e.dstId)||M.set(e.dstId,new Set),M.get(e.dstId).add(e.dstSide);for(let e of T.values()){if(!j(o.get(e.srcId)))continue;let t=M.get(e.srcId);if(!t?.has(e.srcSide))continue;let n=D(e);if(t.has(n)||(k.get(A(e.srcId,n))??0)>0)continue;let r=k.get(A(e.srcId,e.srcSide))??0;k.set(A(e.srcId,e.srcSide),Math.max(0,r-1)),k.set(A(e.srcId,n),1),e.srcSide=n}for(let e of T.values()){let{edgeIdx:t,srcId:n,dstId:r,srcSide:i,dstSide:a}=e,s=o.get(n),c=o.get(r),l=`${n}:${i}:src`,u=i===`top`||i===`bottom`?c.x??0:c.y??0;S.has(l)||S.set(l,[]),S.get(l).push({edgeIdx:t,oppositeCoord:u});let d=`${r}:${a}:dst`,f=a===`top`||a===`bottom`?s.x??0:s.y??0;S.has(d)||S.set(d,[]),S.get(d).push({edgeIdx:t,oppositeCoord:f})}let N=new Map;for(let[e,t]of S){if(t.length<2)continue;t.sort((e,t)=>e.oppositeCoord-t.oppositeCoord);let n=e.split(`:`),r=n.slice(0,-2).join(`:`),i=n[n.length-2],a=n[n.length-1],s=o.get(r);if(!s)continue;let c=i===`left`||i===`right`?s.height??10:s.width??10,l=s.shape,u=l===`question`||l===`diamond`?c*.3:c,d=Math.min(20,Math.max(8,u/(t.length+1))),f=-(d*(t.length-1))/2;for(let[e,n]of t.entries()){let t=f+e*d,r=`${n.edgeIdx}:${a}`;N.set(r,t)}}let P=e(e=>!!a[e]?.labelNodeId,`edgeHasLabelNode`),F=e((e,t)=>e?(S.get(`${e}:${t}:src`)??[]).some(({edgeIdx:e})=>P(e))||(S.get(`${e}:${t}:dst`)??[]).some(({edgeIdx:e})=>P(e)):!1,`faceHasLabelNode`),I=e((e,t,n)=>t===`top`||t===`bottom`?{x:e.x+n,y:e.y}:{x:e.x,y:e.y+n},`applyPortOffset`),ee=e((e,t,n)=>{let r=T.get(e),i={x:n.x??0,y:n.y??0},a={x:t.x??0,y:t.y??0},o=r?.srcSide??w(t,i),s=r?.dstSide??w(n,a),c=r?p(t,r.srcSide):m(t,i,!0),l=r?p(n,r.dstSide):m(n,a,!1),u=N.get(`${e}:src`),d=N.get(`${e}:dst`);return u!==void 0&&(c=I(c,o,u)),d!==void 0&&(l=I(l,s,d)),{pSrcPort:c,pDstPort:l,srcSide:o,dstSide:s}},`portsForEdge`);for(let t of b){let n=a[t];if(g[t]=[],!n.start||!n.end||n.points&&n.points.length>0||n.start===n.end)continue;let r=o.get(n.start),i=o.get(n.end);if(!r||!i)continue;let{pSrcPort:s,pDstPort:u,srcSide:p,dstSide:m}=ee(t,r,i),v={...s},b={...u},w=p===`top`||p===`bottom`,T=m===`top`||m===`bottom`;w?v.y=s.y>(r.y??0)?s.y+Mn:s.y-Mn:v.x=s.x>(r.x??0)?s.x+Mn:s.x-Mn,T?b.y=u.y>(i.y??0)?u.y+Mn:u.y-Mn:b.x=u.x>(i.x??0)?u.x+Mn:u.x-Mn;let E=e((e,t)=>{for(let n of d)if(!t.includes(n.nodeId)&&e.x>n.minX&&e.xn.minY&&e.y{if(i){let i=e.y>(t.y??0);return{x:(n.x??0)>=e.x?r.maxX+kn:r.minX-kn,y:i?r.maxY+An:r.minY-An,leavesPositiveSide:i}}let a=e.x>(t.x??0),o=(n.y??0)>=e.y;return{x:a?r.maxX+kn:r.minX-kn,y:o?r.maxY+An:r.minY-An,leavesPositiveSide:a}},`obstacleDetour`),O=[],k=[n.start,n.end],A=E(v,k);if(A.inside&&A.obstacle){let e=A.obstacle;if(w){let t=D(s,r,i,e,!0);v.x=t.x,v.y=t.y;let n=t.leavesPositiveSide?Math.min(e.minY-2,s.y+Mn):Math.max(e.maxY+2,s.y-Mn);O=[{x:s.x,y:n},{x:t.x,y:n},{x:t.x,y:t.y}]}else{let t=D(s,r,i,e,!1),n=t.leavesPositiveSide?Math.min(e.minX-2,s.x+Mn):Math.max(e.maxX+2,s.x-Mn);v.x=t.x,v.y=t.y,O=[{x:n,y:s.y},{x:n,y:t.y},{x:t.x,y:t.y}]}}let j=[],M=E(b,k);if(M.inside&&M.obstacle){let e=M.obstacle;if(T){let t=D(u,i,r,e,!0);b.x=t.x,b.y=t.y,j=[{x:t.x,y:t.y},{x:u.x,y:t.y}]}else{let t=D(u,i,r,e,!1);b.x=t.x,b.y=t.y,j=[{x:t.x,y:t.y},{x:t.x,y:u.y}]}}if(O.length===0&&j.length===0){let e=kn,r=Math.abs(v.x-b.x)1||c>1,d=C.get(n.start??``)??0,f=C.get(n.end??``)??0,g=o>1&&F(n.start,p)||c>1&&F(n.end,m);if((r||i)&&!a&&(!l||l&&!g&&(o<=1||d<=2)&&(c<=1||f<=2))&&!x(s,u,n.start,n.end)){n.points=[{...s},{...v},{...b},{...u}],_.add(t);let e=i?`horizontal`:`vertical`,r=i?s.y:s.x,a=i?Math.min(s.x,u.x):Math.min(s.y,u.y),o=i?Math.max(s.x,u.x):Math.max(s.y,u.y),c={id:`fast-path-${e}-${r.toFixed(0)}-${t}`,orientation:e,coord:r,spanMin:a,spanMax:o,tracks:[]};h.push({edgeIndex:t,segmentIndex:0,orientation:e,pipe:c,trackIndex:0,from:a,to:o});continue}}v.x=f(`vertical`,v.x,v.y,v.y).coord,b.x=f(`vertical`,b.x,b.y,b.y).coord;let P=Math.min(v.x,b.x)-50,I=Math.max(v.x,b.x)+50,L=Math.min(v.y,b.y)-50,R=Math.max(v.y,b.y)+50;for(let e of d){let t=Math.min(v.x,b.x),n=Math.max(v.x,b.x),r=Math.min(v.y,b.y),i=Math.max(v.y,b.y);e.minXt&&e.minYr&&(P=Math.min(P,e.minX-jn),I=Math.max(I,e.maxX+jn),L=Math.min(L,e.minY-jn),R=Math.max(R,e.maxY+jn))}for(let e of d){if(e.maxXI||e.maxYR)continue;let t=kn;f(`horizontal`,e.minY-t,P,I),f(`horizontal`,e.maxY+t,P,I);let n=An;f(`vertical`,e.minX-n,L,R),f(`vertical`,e.maxX+n,L,R)}f(`horizontal`,v.y,P,I),f(`horizontal`,b.y,P,I);let z=c.filter(e=>e.orientation===`horizontal`&&e.coord>=L&&e.coord<=R),te=c.filter(e=>e.orientation===`vertical`&&e.coord>=P&&e.coord<=I),ne=e((e,t)=>`${e.toFixed(1)},${t.toFixed(1)}`,`getKey`),B=ne(v.x,v.y),re=ne(b.x,b.y),ie=new Map,ae=new Map,V=new Map,oe=new Set,H=[];ie.set(B,0),V.set(B,`n`),H.push({key:B,f:Math.hypot(b.x-v.x,b.y-v.y),pt:v}),oe.add(B);let U=[],W=e((e,t)=>x(e,t,n.start,n.end),`checkSegmentBlocked`),G={x:b.x,y:v.y},K=W(v,G),se=W(G,b),ce=K||se,le={x:v.x,y:b.y},ue=W(v,le),de=W(le,b);if(ce?ue||de||(U=Math.abs(v.x-b.x)<$?[v,b]:[v,le,b]):U=Math.abs(v.y-b.y)<$||Math.abs(v.x-b.x)<$?[v,b]:[v,G,b],U.length===0)for(;H.length>0;){H.sort((e,t)=>e.f-t.f);let e=H.shift();if(oe.delete(e.key),e.key===re){let e=re,t=b;for(U=[t];ae.has(e);){let n=ae.get(e);U.unshift(n),t=n,e=ne(n.x,n.y)}break}let r=e.pt.x,i=e.pt.y,a=te.sort((e,t)=>e.coord-t.coord),o=a.findIndex(e=>Math.abs(e.coord-r)<1),s=z.sort((e,t)=>e.coord-t.coord),c=s.findIndex(e=>Math.abs(e.coord-i)<1),l=[];o>0&&l.push({x:a[o-1].coord,y:i}),o>=0&&o0&&l.push({x:r,y:s[c-1].coord}),c>=0&&ce.nodeId===n.start||e.nodeId===n.end?!1:o===s?e.minXr&&e.maxY>c&&e.minYi&&e.maxX>o&&e.minX10&&x<-5||g<-10&&x>5)&&(m=Math.abs(x)*100),(h>10&&_<-5||h<-10&&_>5)&&(m+=Math.abs(_)*50);let S=0,C=V.get(e.key)??`n`,w=Math.abs(_)>$?`h`:`v`;C!==`n`&&C!==w&&(S=50);let T=f+p+m+S,E=(ie.get(e.key)??1/0)+T,D=Math.abs(b.x-a.x)+Math.abs(b.y-a.y);if(E<(ie.get(u)??1/0))if(ae.set(u,e.pt),ie.set(u,E),V.set(u,w),!oe.has(u))H.push({key:u,f:E+D,pt:a}),oe.add(u);else{let e=H.findIndex(e=>e.key===u);e!==-1&&(H[e].f=E+D)}}}if(U.length===0&&(U=[v,{x:v.x,y:b.y},b]),U.length>4){let t=U[0],n=U[U.length-1],r=Math.min(t.x,n.x),i=Math.max(t.x,n.x),a=Math.min(t.y,n.y),o=Math.max(t.y,n.y);for(let e of U)r=Math.min(r,e.x),i=Math.max(i,e.x),a=Math.min(a,e.y),o=Math.max(o,e.y);let s=i>Math.max(t.x,n.x),c=re.minXr&&e.minYa);if(s.length>0){let r=Math.max(t.x,n.x);for(let t of s){let n=(t.minX+t.maxX)/2;if(t.visualXHalfExtent===void 0||isNaN(t.visualXHalfExtent))continue;let i=n+t.visualXHalfExtent+e;r=Math.max(r,i)}isNaN(r)||(i=r)}}if(c){let i=d.filter(r=>r.minXMath.min(t.y,n.y));if(i.length>0){let a=Math.min(t.x,n.x);for(let t of i){let n=(t.minX+t.maxX)/2-t.visualXHalfExtent-e;a=Math.min(a,n)}r=a}}}let u=e(e=>{let r=n.y>t.y,i=d.filter(e=>{let r=Math.min(t.x,n.x)e.minX,i=Math.min(t.y,n.y)e.minY;return r&&i}),a=i;if(l&&i.length>0){let t=i.filter(t=>t.minXe);t.length>0&&(a=t)}if(a.length===0)return n.y;let o=kn;if(r){let e=Math.max(...a.map(e=>e.maxY))+o;if(ee.minY))-o;if(e>n.y+$)return e}return n.y},`findBestReturnY`),f=e(e=>{let r=u(e),i={x:e,y:t.y},a={x:e,y:r},o={x:n.x,y:r},s=W(t,i),c=W(i,a),l=W(a,o),d=r!==n.y&&W(o,n);return!s&&!c&&!l&&!d?Math.abs(r-n.y)<$?[t,i,a,n]:[t,i,a,o,n]:null},`trySimplifyWithDetourX`),p=s&&!c?f(i):c&&!s?f(r):null;p&&(U=p)}let q=[s,...O,...U,...j.reverse(),u];if(q.length>=3){let e=q[q.length-1],t=q[q.length-2],n=q[q.length-3],r=Math.abs(n.y-t.y)<$&&Math.abs(t.y-e.y)<$,i=Math.abs(n.x-t.x)<$&&Math.abs(t.x-e.x)<$;if(r){let r=Math.sign(t.x-n.x),i=Math.sign(e.x-n.x);r!==0&&r===i&&Math.abs(t.x-n.x)>Math.abs(e.x-n.x)&&q.splice(-2,1)}else if(i){let r=Math.sign(t.y-n.y),i=Math.sign(e.y-n.y);r!==0&&r===i&&Math.abs(t.y-n.y)>Math.abs(e.y-n.y)&&q.splice(-2,1)}}let J=[q[0]];for(let e=1;et.x!=r.x>n.x){J.push(n);continue}continue}if(Math.abs(t.x-n.x)<$&&Math.abs(n.x-r.x)<$){if(n.y>t.y!=r.y>n.y){J.push(n);continue}continue}J.push(n)}J.push(q[q.length-1]);for(let e=0;ee.from{let i=!r.segments.some(n=>(n.edgeIndex!==t.edgeIndex||n.segmentIndex!==t.segmentIndex)&&L(n,e)),a=!n.segments.some(n=>(n.edgeIndex!==e.edgeIndex||n.segmentIndex!==e.segmentIndex)&&L(n,t));return i&&a?(e.trackIndex=r.index,t.trackIndex=n.index,n.segments=[...n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),{edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,from:t.from,to:t.to}],r.segments=[...r.segments.filter(e=>e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex),{edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to}],!0):!1},`trySwapSegmentsAcrossTracks`),z=e(e=>{let t=e.tracks.length;return e.tracks[t]={index:t,coord:e.coord,segments:[]},t},`createNewTrack`),te=e((e,t)=>{let n=e.pipe.tracks[e.trackIndex];n.segments=n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),e.trackIndex=t,e.pipe.tracks[t].segments.push({edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to})},`moveSegmentToTrack`),ne=e((e,t)=>{let n=g[e.edgeIndex];for(let r of n){let n=h[r];n.pipe===e.pipe&&te(n,t)}},`moveSegmentChainToTrack`),B=e(e=>{let t=g[e.edgeIndex],n=t.indexOf(h.indexOf(e)),r=[];return n>0&&r.push(h[t[n-1]]),n{if(e.orientation===t.orientation)return!1;let n=e.orientation===`horizontal`?e:t,r=e.orientation===`horizontal`?t:e;return r.pipe.coord>n.from&&r.pipe.coordr.from&&n.pipe.coord{for(let n of e.tracks)if(!n.segments.some(e=>(e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex)&&L(e,t)))return n.index;return-1},`findAvailableTrack`),ae=e((e,t)=>{if(e.trackIndex===t.trackIndex)return L(e,t);let n=B(e),r=B(t);return n.some(e=>r.some(t=>re(e,t)))},`segmentsConflict`),V=e((e,t,n)=>{if(R(e,t,e.pipe.tracks[e.trackIndex],t.pipe.tracks[t.trackIndex]))return;let r=ie(e.pipe,t);n(t,r===-1?z(e.pipe):r)},`resolveTrackConflict`),oe=e(e=>{let t=0;for(let n=0;n{if(H.has(e))return H.get(e);let t=g[e];if(t.length===0){let t={dest:0,deviation:0,base:0,delta:0};return H.set(e,t),t}let n=h[t[0]].pipe.coord,r=n;for(let e=1;eMath.abs(t-n)?e:t;break}}let i=Math.abs(r-n),a={dest:r,deviation:i,base:n,delta:r-n};return H.set(e,a),a},`getDestInfo`),W=e(()=>{let t=0,n=new Map;for(let[e,t]of a.entries())g[e].length!==0&&t.start&&(n.has(t.start)||n.set(t.start,[]),n.get(t.start).push(e));let r=e(e=>{let t=a[e];if(!t.start||!t.end)return 0;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)return 0;let i=(r.x??0)-(n.x??0),s=(r.y??0)-(n.y??0);return Math.abs(i)+Math.abs(s)},`getEdgeDistance`);for(let e of n.values()){e.sort((e,t)=>{let n=U(e),i=U(t);if(Math.abs(n.deviation-i.deviation)>1)return n.deviation-i.deviation;if(Math.abs(n.dest-i.dest)>1)return n.dest-i.dest;let a=r(e),o=r(t);if(Math.abs(a-o)>1)return o-a;let s=g[e].length,c=g[t].length;if(s!==c)return s-c;if(s===1){let n=g[e][0],r=g[t][0];if(h[n]&&h[r]){let e=h[n],t=h[r],i=Math.abs(e.to-e.from),a=Math.abs(t.to-t.from);if(Math.abs(i-a)>1)return i-a}}return 0});let n=e.map(e=>h[g[e][0]]);t+=oe(n)}return t},`fixSourceHandleCrossings`),G=e(()=>{let t=0,n=new Map;for(let[e,t]of a.entries())g[e].length!==0&&t.end&&(n.has(t.end)||n.set(t.end,[]),n.get(t.end).push(e));for(let r of n.values()){r.sort((t,n)=>{let r=e(e=>{let t=g[e];if(t.length<2)return 0;let n=h[t[t.length-2]];return Math.abs(n.to-n.from)},`getDist`),i=r(t),a=r(n);return Math.abs(i-a)>.1?i-a:t-n});let n=r.map(e=>h[g[e][g[e].length-1]]);t+=oe(n)}return t},`fixTargetHandleCrossings`),K=e(()=>{let e=0;for(let t of c){let n=[];for(let e of t.tracks)for(let t of e.segments){let e=g[t.edgeIndex].find(e=>h[e].segmentIndex===t.segmentIndex);e!==void 0&&n.push(h[e])}n.sort((e,t)=>e.edgeIndex-t.edgeIndex||e.segmentIndex-t.segmentIndex);for(let t=0;t{e.segments.forEach(t=>{n.push({edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,trackIndex:e.index,from:t.from,to:t.to})})}),n.sort((e,t)=>e.from-t.from);let r=[];if(n.length>0){let e=[n[0]],t=n[0].to;for(let i=1;ir.add(e.trackIndex));let i=new Map;n.forEach(e=>{let t=U(e.edgeIndex);i.set(e.trackIndex,(i.get(e.trackIndex)??0)+t.delta)});let a=[...r].filter(e=>(i.get(e)??0)<-1),o=[...r].filter(e=>(i.get(e)??0)>1),s=[...r].filter(e=>Math.abs(i.get(e)??0)<=1);a.sort((e,t)=>(i.get(t)??0)-(i.get(e)??0)),o.sort((e,t)=>(i.get(e)??0)-(i.get(t)??0));let c=e((e,r)=>{n.filter(t=>t.trackIndex===e).forEach(e=>{let n=_.has(e.edgeIndex)?t.coord:r;ce.set(`${e.edgeIndex}-${e.segmentIndex}`,n)})},`assignCoord`),l=0;for(let e of a)l++,c(e,t.coord-l*Nn);if(s.length===0&&r.size>0){let e=[...r].sort((e,t)=>Math.abs(i.get(e)??0)-Math.abs(i.get(t)??0))[0],t=a.indexOf(e);t!==-1&&a.splice(t,1);let n=o.indexOf(e);n!==-1&&o.splice(n,1),s.push(e)}let u=0;for(let e of s){if(u===0)c(e,t.coord);else{let n=u%2==1?1:-1,r=Math.ceil(u/2);c(e,t.coord+n*r*Nn*.5)}u++}let d=0;for(let e of o)d++,c(e,t.coord+d*Nn)}}for(let[e,t]of a.entries()){let n=g[e]??[];if(n.length===0)continue;let r=[],{pSrcPort:i,pDstPort:a}=ee(e,o.get(t.start),o.get(t.end)),s=n.map(e=>{let t=h[e],n=ce.get(`${t.edgeIndex}-${t.segmentIndex}`)??t.pipe.coord;return{orient:t.orientation,coord:n,from:t.from,to:t.to}});r.push(i);for(let e=0;e$&&r.push(In(t,i)),c&&o.orient===t.orient)if(Math.abs(t.coord-o.coord)>$){let e=t.orient===`vertical`?(i+o.from)/2:Fn(t,o);r.push(In(t,e),In(o,e))}else(e===0||e===s.length-2)&&r.push(In(t,Fn(t,o)));else if(c)r.push(In(t,o.coord));else{let e=Math.abs(t.from-i)$||Math.abs(c.y-a.y)>$)&&r.push(a);let l=[];r.length>0&&l.push(r[0]);for(let e=1;e$||Math.abs(t.y-n.y)>$)&&l.push(t)}t.points=l}for(let e of a){let t=e.__originalEdge;t&&e.points&&(t.points=e.points)}t.edges=(t.edges??[]).filter(e=>!e.isLayoutOnly);let le=e((e,t)=>{let n=t.x??0,r=t.y??0,i=t.width??0,a=t.height??0;if(i<=0||a<=0)return e;let o=n-i/2,s=n+i/2,c=r-a/2,l=r+a/2;if(e.xs||e.yl)return e;let u=e.x-o,d=s-e.x,f=e.y-c,p=l-e.y,m=Math.min(u,d,f,p);return m===u?{x:o,y:e.y}:m===d?{x:s,y:e.y}:m===f?{x:e.x,y:c}:{x:e.x,y:l}},`nodeBoundaryClamp`);for(let e of t.edges){let t=e.points;if(!t||t.length<2)continue;let n=e.start,r=e.end,i=n?o.get(n):void 0,a=r?o.get(r):void 0;i&&(t[0]=le(t[0],i)),a&&(t[t.length-1]=le(t[t.length-1],a))}return t}e(Ln,`routeEdgesOrthogonal`);function Rn(e){return e.direction??`TB`}e(Rn,`getSwimlaneDirection`);function zn(e){let t=d(e),n=e.config.flowchart?.nodeSpacing??40,r=e.config.flowchart?.rankSpacing??100,i=e.config.swimlane?.ignoreCrossLaneEdges??!0,a=e.config.swimlane?.optimizeRanksByCrossings??!0,o=e.config.swimlane?.automaticLaneOrdering??!1,s=Rn(e),{ordered:c,coordinates:l}=Dn(t,{nodeGap:n,layerGap:r,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:s});f(t,c,l,{nodeGap:n,layerGap:r});for(let t of e.edges??[])delete t.points;Ln(e,s);for(let t of e.edges??[])(!t.curve||t.curve===`basis`)&&(t.curve=`rounded`);return _t(e,s),gt(e),s}e(zn,`runSwimlaneLayoutCore`);function Bn(e){u(e);let t=m(e);e.nodes=t.nodes,e.edges=t.edges}e(Bn,`prepareSwimlaneLayout`);var Vn=n({prepareLayout:Bn,runLayoutCore:zn,afterPaint:i});export{Vn as render}; \ No newline at end of file diff --git a/web/dist/app-swimlanesDiagram-TC7HE7FX.js b/web/dist/app-swimlanesDiagram-TC7HE7FX.js index d6bc0af9c..8c32c5dbc 100644 --- a/web/dist/app-swimlanesDiagram-TC7HE7FX.js +++ b/web/dist/app-swimlanesDiagram-TC7HE7FX.js @@ -1,4 +1,4 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import"./app-chunk-GWA4HPMP.js";import"./app-chunk-XXDRQBXY.js";import"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-GNY47TPC.js";import"./app-chunk-LNGE3PJU.js";import{r as t,t as n}from"./app-chunk-7M6MHVWA.js";var r=n({styles:e(e=>`${t(e)} +import{n as e}from"./app-chunk-Y2CYZVJY.js";import"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-LNGE3PJU.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import"./app-chunk-GNY47TPC.js";import"./app-chunk-GWA4HPMP.js";import"./app-chunk-XXDRQBXY.js";import"./app-chunk-WEXAMYUT.js";import{r as t,t as n}from"./app-chunk-7M6MHVWA.js";var r=n({styles:e(e=>`${t(e)} .swimlane.cluster:not([data-color-id]) rect { stroke: ${e.clusterBorder} !important; } diff --git a/web/dist/app-usecaseDiagram-POWQR4AR.js b/web/dist/app-usecaseDiagram-POWQR4AR.js index 1c5e4e6d4..1c6798fe0 100644 --- a/web/dist/app-usecaseDiagram-POWQR4AR.js +++ b/web/dist/app-usecaseDiagram-POWQR4AR.js @@ -1,4 +1,4 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{H as r,U as i,a,b as o,f as s,q as c,v as l,w as u,x as d,y as f,z as p}from"./app-chunk-O7XYJQB3.js";import{g as m}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import{i as h}from"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import{a as g,i as ee,o as te,r as _}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import{t as ne}from"./app-chunk-XXDRQBXY.js";import{t as re}from"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import{r as ie,t as ae}from"./app-chunk-GNY47TPC.js";var oe=typeof global==`object`&&global&&global.Object===Object&&global,se=typeof self==`object`&&self&&self.Object===Object&&self,v=oe||se||Function(`return this`)(),y=v.Symbol,ce=Object.prototype,le=ce.hasOwnProperty,ue=ce.toString,de=y?y.toStringTag:void 0;function fe(e){var t=le.call(e,de),n=e[de];try{e[de]=void 0;var r=!0}catch{}var i=ue.call(e);return r&&(t?e[de]=n:delete e[de]),i}var pe=Object.prototype.toString;function me(e){return pe.call(e)}var he=`[object Null]`,ge=`[object Undefined]`,_e=y?y.toStringTag:void 0;function ve(e){return e==null?e===void 0?ge:he:_e&&_e in Object(e)?fe(e):me(e)}function ye(e){return typeof e==`object`&&!!e}var be=`[object Symbol]`;function xe(e){return typeof e==`symbol`||ye(e)&&ve(e)==be}function Se(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n0){if(++t>=mt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function vt(e){return function(){return e}}var yt=function(){try{var e=ct(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),bt=_t(yt?function(e,t){return yt(e,`toString`,{configurable:!0,enumerable:!1,value:vt(t),writable:!0})}:He);function xt(e,t){for(var n=-1,r=e==null?0:e.length;++n-1}var Dt=9007199254740991,Ot=/^(?:0|[1-9]\d*)$/;function kt(e,t){var n=typeof e;return t??=Dt,!!t&&(n==`number`||n!=`symbol`&&Ot.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=Rt}function Bt(e){return e!=null&&zt(e.length)&&!qe(e)}function Vt(e,t,n){if(!je(n))return!1;var r=typeof t;return(r==`number`?Bt(n)&&kt(t,n.length):r==`string`&&t in n)?jt(n[t],e):!1}function Ht(e){return Lt(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&Vt(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r-1}function pr(e,t){var n=this.__data__,r=cr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function mr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t0&&n(s)?t>1?Br(s,t-1,n,r,i):Lr(i,s):r||(i[i.length]=s)}return i}function Vr(e){return e!=null&&e.length?Br(e,1):[]}var Hr=Rn(Object.getPrototypeOf,Object);function Ur(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++rs))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&ro?new $a:void 0;for(a.set(e,t),a.set(t,e);++d2?t[2]:void 0;for(i&&Vt(t[0],t[1],i)&&(r=1);++n=us&&(a=to,o=!1,t=new $a(t));outer:for(;++i-1?i[a?t[o]:o]:void 0}}var Ss=Math.max;function Cs(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Ve(n);return i<0&&(i=Ss(r+i,0)),St(e,Xo(t,3),i)}var ws=xs(Cs);function Ts(e){return e&&e.length?e[0]:void 0}function Es(e,t){var n=-1,r=Bt(e)?Array(e.length):[];return ns(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function k(e,t){return(b(e)?Se:Es)(e,Xo(t,3))}function Ds(e,t){return Br(k(e,t),1)}var Os=Object.prototype.hasOwnProperty,ks=is(function(e,t,n){Os.call(e,n)?e[n].push(t):At(e,n,[t])}),As=Object.prototype.hasOwnProperty;function js(e,t){return e!=null&&As.call(e,t)}function A(e,t){return e!=null&&Ho(e,t,js)}var Ms=`[object String]`;function j(e){return typeof e==`string`||!b(e)&&ye(e)&&ve(e)==Ms}function Ns(e,t){return Se(t,function(t){return e[t]})}function M(e){return e==null?[]:Ns(e,C(e))}var Ps=Math.max;function N(e,t,n,r){e=Bt(e)?e:M(e),n=n&&!r?Ve(n):0;var i=e.length;return n<0&&(n=Ps(i+n,0)),j(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Tt(e,t,n)>-1}var Fs=Math.max;function Is(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Ve(n);return i<0&&(i=Fs(r+i,0)),Tt(e,t,i)}var Ls=`[object Map]`,Rs=`[object Set]`,zs=Object.prototype.hasOwnProperty;function P(e){if(e==null)return!0;if(Bt(e)&&(b(e)||typeof e==`string`||typeof e.splice==`function`||nn(e)||Fn(e)||Zt(e)))return!e.length;var t=ji(e);if(t==Ls||t==Rs)return!e.size;if(Wt(e))return!Vn(e).length;for(var n in e)if(zs.call(e,n))return!1;return!0}var Bs=`[object RegExp]`;function Vs(e){return ye(e)&&ve(e)==Bs}var Hs=Nn&&Nn.isRegExp,Us=Hs?kn(Hs):Vs;function Ws(e){return e===void 0}var Gs=`Expected a function`;function Ks(e){if(typeof e!=`function`)throw TypeError(Gs);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function qs(e,t,n,r){if(!je(e))return e;t=Mr(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i=tc){var l=t?null:ec(e);if(l)return oo(l);o=!1,i=to,c=new $a}else c=t?[]:s;outer:for(;++r{t.accept(e)})}},I=class extends uc{constructor(e){super([]),this.idx=1,w(this,Ys(e,e=>e!==void 0))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},dc=class extends uc{constructor(e){super(e.definition),this.orgText=``,w(this,Ys(e,e=>e!==void 0))}},L=class extends uc{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,w(this,Ys(e,e=>e!==void 0))}},R=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},fc=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},pc=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},z=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},mc=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},hc=class extends uc{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,w(this,Ys(e,e=>e!==void 0))}},B=class{constructor(e){this.idx=1,w(this,Ys(e,e=>e!==void 0))}accept(e){e.visit(this)}};function gc(e){return k(e,_c)}function _c(e){function t(e){return k(e,_c)}if(e instanceof I){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return j(e.label)&&(t.label=e.label),t}if(e instanceof L)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof R)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof fc)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof pc)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:_c(new B({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof mc)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:_c(new B({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof z)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof hc)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof B){let t={type:`Terminal`,name:e.terminalType.name,label:cc(e.terminalType),idx:e.idx};j(e.label)&&(t.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=Us(n)?n.source:n),t}if(e instanceof dc)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`)}var vc=class{visit(e){let t=e;switch(t.constructor){case I:return this.visitNonTerminal(t);case L:return this.visitAlternative(t);case R:return this.visitOption(t);case fc:return this.visitRepetitionMandatory(t);case pc:return this.visitRepetitionMandatoryWithSeparator(t);case mc:return this.visitRepetitionWithSeparator(t);case z:return this.visitRepetition(t);case hc:return this.visitAlternation(t);case B:return this.visitTerminal(t);case dc:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function yc(e){return e instanceof L||e instanceof R||e instanceof z||e instanceof fc||e instanceof pc||e instanceof mc||e instanceof B||e instanceof dc}function bc(e,t=[]){return e instanceof R||e instanceof z||e instanceof mc?!0:e instanceof hc?$s(e.definition,e=>bc(e,t)):e instanceof I&&N(t,e)?!1:e instanceof uc&&(e instanceof I&&t.push(e),vs(e.definition,e=>bc(e,t)))}function xc(e){return e instanceof hc}function Sc(e){if(e instanceof I)return`SUBRULE`;if(e instanceof R)return`OPTION`;if(e instanceof hc)return`OR`;if(e instanceof fc)return`AT_LEAST_ONE`;if(e instanceof pc)return`AT_LEAST_ONE_SEP`;if(e instanceof mc)return`MANY_SEP`;if(e instanceof z)return`MANY`;if(e instanceof B)return`CONSUME`;throw Error(`non exhaustive match`)}var Cc=class{walk(e,t=[]){O(e.definition,(n,r)=>{let i=D(e.definition,r+1);if(n instanceof I)this.walkProdRef(n,i,t);else if(n instanceof B)this.walkTerminal(n,i,t);else if(n instanceof L)this.walkFlat(n,i,t);else if(n instanceof R)this.walkOption(n,i,t);else if(n instanceof fc)this.walkAtLeastOne(n,i,t);else if(n instanceof pc)this.walkAtLeastOneSep(n,i,t);else if(n instanceof mc)this.walkManySep(n,i,t);else if(n instanceof z)this.walkMany(n,i,t);else if(n instanceof hc)this.walkOr(n,i,t);else throw Error(`non exhaustive match`)})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){let r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){let r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){let r=[new R({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=wc(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new R({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=wc(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);O(e.definition,e=>{let t=new L({definition:[e]});this.walk(t,r)})}};function wc(e,t,n){return[new R({definition:[new B({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Tc(e){if(e instanceof I)return Tc(e.referencedRule);if(e instanceof B)return Oc(e);if(yc(e))return Ec(e);if(xc(e))return Dc(e);throw Error(`non exhaustive match`)}function Ec(e){let t=[],n=e.definition,r=0,i=n.length>r,a,o=!0;for(;i&&o;)a=n[r],o=bc(a),t=t.concat(Tc(a)),r+=1,i=n.length>r;return rc(t)}function Dc(e){return rc(Vr(k(e.definition,e=>Tc(e))))}function Oc(e){return[e.terminalType]}var kc=`_~IN~_`,Ac=class extends Cc{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){let r=Mc(e.referencedRule,e.idx)+this.topProd.name,i=Tc(new L({definition:t.concat(n)}));this.follows[r]=i}};function jc(e){let t={};return O(e,e=>{let n=new Ac(e).startWalking();w(t,n)}),t}function Mc(e,t){return e.name+t+kc}function V(e){return e.charCodeAt(0)}function Nc(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Pc(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t],e[t]=!0}function Fc(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`);return!0}function Ic(){throw Error(`Internal Error - Should never get here!`)}function Lc(e){return e.type===`Character`}var Rc=[];for(let e=V(`0`);e<=V(`9`);e++)Rc.push(e);var zc=[V(`_`)].concat(Rc);for(let e=V(`a`);e<=V(`z`);e++)zc.push(e);for(let e=V(`A`);e<=V(`Z`);e++)zc.push(e);var Bc=[V(` `),V(`\f`),V(` +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{H as r,U as i,a,b as o,f as s,q as c,v as l,w as u,x as d,y as f,z as p}from"./app-chunk-O7XYJQB3.js";import{g as m}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import{i as h}from"./app-chunk-MBY4JIJT.js";import{a as g,i as ee,o as te,r as _}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as ne,t as re}from"./app-chunk-GNY47TPC.js";import{t as ie}from"./app-chunk-XXDRQBXY.js";import{t as ae}from"./app-chunk-WEXAMYUT.js";var oe=typeof global==`object`&&global&&global.Object===Object&&global,se=typeof self==`object`&&self&&self.Object===Object&&self,v=oe||se||Function(`return this`)(),y=v.Symbol,ce=Object.prototype,le=ce.hasOwnProperty,ue=ce.toString,de=y?y.toStringTag:void 0;function fe(e){var t=le.call(e,de),n=e[de];try{e[de]=void 0;var r=!0}catch{}var i=ue.call(e);return r&&(t?e[de]=n:delete e[de]),i}var pe=Object.prototype.toString;function me(e){return pe.call(e)}var he=`[object Null]`,ge=`[object Undefined]`,_e=y?y.toStringTag:void 0;function ve(e){return e==null?e===void 0?ge:he:_e&&_e in Object(e)?fe(e):me(e)}function ye(e){return typeof e==`object`&&!!e}var be=`[object Symbol]`;function xe(e){return typeof e==`symbol`||ye(e)&&ve(e)==be}function Se(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n0){if(++t>=mt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function vt(e){return function(){return e}}var yt=function(){try{var e=ct(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),bt=_t(yt?function(e,t){return yt(e,`toString`,{configurable:!0,enumerable:!1,value:vt(t),writable:!0})}:He);function xt(e,t){for(var n=-1,r=e==null?0:e.length;++n-1}var Dt=9007199254740991,Ot=/^(?:0|[1-9]\d*)$/;function kt(e,t){var n=typeof e;return t??=Dt,!!t&&(n==`number`||n!=`symbol`&&Ot.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=Rt}function Bt(e){return e!=null&&zt(e.length)&&!qe(e)}function Vt(e,t,n){if(!je(n))return!1;var r=typeof t;return(r==`number`?Bt(n)&&kt(t,n.length):r==`string`&&t in n)?jt(n[t],e):!1}function Ht(e){return Lt(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&Vt(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r-1}function pr(e,t){var n=this.__data__,r=cr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function mr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t0&&n(s)?t>1?Br(s,t-1,n,r,i):Lr(i,s):r||(i[i.length]=s)}return i}function Vr(e){return e!=null&&e.length?Br(e,1):[]}var Hr=Rn(Object.getPrototypeOf,Object);function Ur(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++rs))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&ro?new $a:void 0;for(a.set(e,t),a.set(t,e);++d2?t[2]:void 0;for(i&&Vt(t[0],t[1],i)&&(r=1);++n=us&&(a=to,o=!1,t=new $a(t));outer:for(;++i-1?i[a?t[o]:o]:void 0}}var Ss=Math.max;function Cs(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Ve(n);return i<0&&(i=Ss(r+i,0)),St(e,Xo(t,3),i)}var ws=xs(Cs);function Ts(e){return e&&e.length?e[0]:void 0}function Es(e,t){var n=-1,r=Bt(e)?Array(e.length):[];return ns(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function k(e,t){return(b(e)?Se:Es)(e,Xo(t,3))}function Ds(e,t){return Br(k(e,t),1)}var Os=Object.prototype.hasOwnProperty,ks=is(function(e,t,n){Os.call(e,n)?e[n].push(t):At(e,n,[t])}),As=Object.prototype.hasOwnProperty;function js(e,t){return e!=null&&As.call(e,t)}function A(e,t){return e!=null&&Ho(e,t,js)}var Ms=`[object String]`;function j(e){return typeof e==`string`||!b(e)&&ye(e)&&ve(e)==Ms}function Ns(e,t){return Se(t,function(t){return e[t]})}function M(e){return e==null?[]:Ns(e,C(e))}var Ps=Math.max;function N(e,t,n,r){e=Bt(e)?e:M(e),n=n&&!r?Ve(n):0;var i=e.length;return n<0&&(n=Ps(i+n,0)),j(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Tt(e,t,n)>-1}var Fs=Math.max;function Is(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Ve(n);return i<0&&(i=Fs(r+i,0)),Tt(e,t,i)}var Ls=`[object Map]`,Rs=`[object Set]`,zs=Object.prototype.hasOwnProperty;function P(e){if(e==null)return!0;if(Bt(e)&&(b(e)||typeof e==`string`||typeof e.splice==`function`||nn(e)||Fn(e)||Zt(e)))return!e.length;var t=ji(e);if(t==Ls||t==Rs)return!e.size;if(Wt(e))return!Vn(e).length;for(var n in e)if(zs.call(e,n))return!1;return!0}var Bs=`[object RegExp]`;function Vs(e){return ye(e)&&ve(e)==Bs}var Hs=Nn&&Nn.isRegExp,Us=Hs?kn(Hs):Vs;function Ws(e){return e===void 0}var Gs=`Expected a function`;function Ks(e){if(typeof e!=`function`)throw TypeError(Gs);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function qs(e,t,n,r){if(!je(e))return e;t=Mr(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i=tc){var l=t?null:ec(e);if(l)return oo(l);o=!1,i=to,c=new $a}else c=t?[]:s;outer:for(;++r{t.accept(e)})}},I=class extends uc{constructor(e){super([]),this.idx=1,w(this,Ys(e,e=>e!==void 0))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},dc=class extends uc{constructor(e){super(e.definition),this.orgText=``,w(this,Ys(e,e=>e!==void 0))}},L=class extends uc{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,w(this,Ys(e,e=>e!==void 0))}},R=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},fc=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},pc=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},z=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},mc=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},hc=class extends uc{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,w(this,Ys(e,e=>e!==void 0))}},B=class{constructor(e){this.idx=1,w(this,Ys(e,e=>e!==void 0))}accept(e){e.visit(this)}};function gc(e){return k(e,_c)}function _c(e){function t(e){return k(e,_c)}if(e instanceof I){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return j(e.label)&&(t.label=e.label),t}if(e instanceof L)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof R)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof fc)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof pc)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:_c(new B({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof mc)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:_c(new B({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof z)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof hc)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof B){let t={type:`Terminal`,name:e.terminalType.name,label:cc(e.terminalType),idx:e.idx};j(e.label)&&(t.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=Us(n)?n.source:n),t}if(e instanceof dc)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`)}var vc=class{visit(e){let t=e;switch(t.constructor){case I:return this.visitNonTerminal(t);case L:return this.visitAlternative(t);case R:return this.visitOption(t);case fc:return this.visitRepetitionMandatory(t);case pc:return this.visitRepetitionMandatoryWithSeparator(t);case mc:return this.visitRepetitionWithSeparator(t);case z:return this.visitRepetition(t);case hc:return this.visitAlternation(t);case B:return this.visitTerminal(t);case dc:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function yc(e){return e instanceof L||e instanceof R||e instanceof z||e instanceof fc||e instanceof pc||e instanceof mc||e instanceof B||e instanceof dc}function bc(e,t=[]){return e instanceof R||e instanceof z||e instanceof mc?!0:e instanceof hc?$s(e.definition,e=>bc(e,t)):e instanceof I&&N(t,e)?!1:e instanceof uc&&(e instanceof I&&t.push(e),vs(e.definition,e=>bc(e,t)))}function xc(e){return e instanceof hc}function Sc(e){if(e instanceof I)return`SUBRULE`;if(e instanceof R)return`OPTION`;if(e instanceof hc)return`OR`;if(e instanceof fc)return`AT_LEAST_ONE`;if(e instanceof pc)return`AT_LEAST_ONE_SEP`;if(e instanceof mc)return`MANY_SEP`;if(e instanceof z)return`MANY`;if(e instanceof B)return`CONSUME`;throw Error(`non exhaustive match`)}var Cc=class{walk(e,t=[]){O(e.definition,(n,r)=>{let i=D(e.definition,r+1);if(n instanceof I)this.walkProdRef(n,i,t);else if(n instanceof B)this.walkTerminal(n,i,t);else if(n instanceof L)this.walkFlat(n,i,t);else if(n instanceof R)this.walkOption(n,i,t);else if(n instanceof fc)this.walkAtLeastOne(n,i,t);else if(n instanceof pc)this.walkAtLeastOneSep(n,i,t);else if(n instanceof mc)this.walkManySep(n,i,t);else if(n instanceof z)this.walkMany(n,i,t);else if(n instanceof hc)this.walkOr(n,i,t);else throw Error(`non exhaustive match`)})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){let r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){let r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){let r=[new R({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=wc(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new R({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=wc(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);O(e.definition,e=>{let t=new L({definition:[e]});this.walk(t,r)})}};function wc(e,t,n){return[new R({definition:[new B({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Tc(e){if(e instanceof I)return Tc(e.referencedRule);if(e instanceof B)return Oc(e);if(yc(e))return Ec(e);if(xc(e))return Dc(e);throw Error(`non exhaustive match`)}function Ec(e){let t=[],n=e.definition,r=0,i=n.length>r,a,o=!0;for(;i&&o;)a=n[r],o=bc(a),t=t.concat(Tc(a)),r+=1,i=n.length>r;return rc(t)}function Dc(e){return rc(Vr(k(e.definition,e=>Tc(e))))}function Oc(e){return[e.terminalType]}var kc=`_~IN~_`,Ac=class extends Cc{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){let r=Mc(e.referencedRule,e.idx)+this.topProd.name,i=Tc(new L({definition:t.concat(n)}));this.follows[r]=i}};function jc(e){let t={};return O(e,e=>{let n=new Ac(e).startWalking();w(t,n)}),t}function Mc(e,t){return e.name+t+kc}function V(e){return e.charCodeAt(0)}function Nc(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Pc(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t],e[t]=!0}function Fc(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`);return!0}function Ic(){throw Error(`Internal Error - Should never get here!`)}function Lc(e){return e.type===`Character`}var Rc=[];for(let e=V(`0`);e<=V(`9`);e++)Rc.push(e);var zc=[V(`_`)].concat(Rc);for(let e=V(`a`);e<=V(`z`);e++)zc.push(e);for(let e=V(`A`);e<=V(`Z`);e++)zc.push(e);var Bc=[V(` `),V(`\f`),V(` `),V(`\r`),V(` `),V(`\v`),V(` `),V(`\xA0`),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(`\u2028`),V(`\u2029`),V(` `),V(` `),V(` `),V(``)],Vc=/[0-9a-fA-F]/,Hc=/[0-9]/,Uc=/[1-9]/,Wc=class{constructor(){this.idx=0,this.input=``,this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar(`/`);let t=this.disjunction();this.consumeChar(`/`);let n={type:`Flags`,loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case`g`:Pc(n,`global`);break;case`i`:Pc(n,`ignoreCase`);break;case`m`:Pc(n,`multiLine`);break;case`u`:Pc(n,`unicode`);break;case`y`:Pc(n,`sticky`)}if(this.idx!==this.input.length)throw Error(`Redundant input: `+this.input.substring(this.idx));return{type:`Pattern`,flags:n,value:t,loc:this.loc(0)}}disjunction(){let e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()===`|`;)this.consumeChar(`|`),e.push(this.alternative());return{type:`Disjunction`,value:e,loc:this.loc(t)}}alternative(){let e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:`Alternative`,value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case`^`:return{type:`StartAnchor`,loc:this.loc(e)};case`$`:return{type:`EndAnchor`,loc:this.loc(e)};case`\\`:switch(this.popChar()){case`b`:return{type:`WordBoundary`,loc:this.loc(e)};case`B`:return{type:`NonWordBoundary`,loc:this.loc(e)}}throw Error(`Invalid Assertion Escape`);case`(`:this.consumeChar(`?`);let t;switch(this.popChar()){case`=`:t=`Lookahead`;break;case`!`:t=`NegativeLookahead`;break;case`<`:switch(this.popChar()){case`=`:t=`Lookbehind`;break;case`!`:t=`NegativeLookbehind`}}Fc(t);let n=this.disjunction();return this.consumeChar(`)`),{type:t,value:n,loc:this.loc(e)}}return Ic()}quantifier(e=!1){let t,n=this.idx;switch(this.popChar()){case`*`:t={atLeast:0,atMost:1/0};break;case`+`:t={atLeast:1,atMost:1/0};break;case`?`:t={atLeast:0,atMost:1};break;case`{`:let n=this.integerIncludingZero();switch(this.popChar()){case`}`:t={atLeast:n,atMost:n};break;case`,`:let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar(`}`)}if(e===!0&&t===void 0)return;Fc(t)}if((e!==!0||t!==void 0)&&Fc(t))return this.peekChar(0)===`?`?(this.consumeChar(`?`),t.greedy=!1):t.greedy=!0,t.type=`Quantifier`,t.loc=this.loc(n),t}atom(){let e,t=this.idx;switch(this.peekChar()){case`.`:e=this.dotAll();break;case`\\`:e=this.atomEscape();break;case`[`:e=this.characterClass();break;case`(`:e=this.group()}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Fc(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Ic()}dotAll(){return this.consumeChar(`.`),{type:`Set`,complement:!0,value:[V(` `),V(`\r`),V(`\u2028`),V(`\u2029`)]}}atomEscape(){switch(this.consumeChar(`\\`),this.peekChar()){case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:return this.decimalEscapeAtom();case`d`:case`D`:case`s`:case`S`:case`w`:case`W`:return this.characterClassEscape();case`f`:case`n`:case`r`:case`t`:case`v`:return this.controlEscapeAtom();case`c`:return this.controlLetterEscapeAtom();case`0`:return this.nulCharacterAtom();case`x`:return this.hexEscapeSequenceAtom();case`u`:return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:`GroupBackReference`,value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case`d`:e=Rc;break;case`D`:e=Rc,t=!0;break;case`s`:e=Bc;break;case`S`:e=Bc,t=!0;break;case`w`:e=zc;break;case`W`:e=zc,t=!0}return Fc(e)?{type:`Set`,value:e,complement:t}:Ic()}controlEscapeAtom(){let e;switch(this.popChar()){case`f`:e=V(`\f`);break;case`n`:e=V(` `);break;case`r`:e=V(`\r`);break;case`t`:e=V(` `);break;case`v`:e=V(`\v`)}return Fc(e)?{type:`Character`,value:e}:Ic()}controlLetterEscapeAtom(){this.consumeChar(`c`);let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error(`Invalid `);return{type:`Character`,value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar(`0`),{type:`Character`,value:V(`\0`)}}hexEscapeSequenceAtom(){return this.consumeChar(`x`),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar(`u`),this.parseHexDigits(4)}identityEscapeAtom(){return{type:`Character`,value:V(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case` @@ -73,7 +73,7 @@ For Further details.`,r},buildEmptyRepetitionError(e){let t=Sc(e.repetition);ret `);break;case`r`:e&&(t+=`\r`);break;case`t`:e&&(t+=` `);break;case`u`:{let n=this.text.slice(this.offset,this.offset+4);if(!/^[\dA-Fa-f]{4}$/u.test(n))throw new Q(this.offset);e&&(t+=String.fromCharCode(Number.parseInt(n,16))),this.offset+=4;break}default:throw new Q(i)}}throw new Q(this.offset)}consumeLiteral(e){let t=0;for(let n of e){if(this.text[this.offset+t]!==n)throw new Q(this.offset+t);t++}this.offset+=e.length}consumeNumber(){if(this.text[this.offset]===`-`&&this.offset++,this.text[this.offset]===`0`)this.offset++;else if(this.text[this.offset]>=`1`&&this.text[this.offset]<=`9`)for(;this.text[this.offset]>=`0`&&this.text[this.offset]<=`9`;)this.offset++;else throw new Q(this.offset);if(this.text[this.offset]===`.`){if(this.offset++,this.text[this.offset]<`0`||this.text[this.offset]>`9`)throw new Q(this.offset);for(;this.text[this.offset]>=`0`&&this.text[this.offset]<=`9`;)this.offset++}if(this.text[this.offset]===`e`||this.text[this.offset]===`E`){if(this.offset++,(this.text[this.offset]===`+`||this.text[this.offset]===`-`)&&this.offset++,this.text[this.offset]<`0`||this.text[this.offset]>`9`)throw new Q(this.offset);for(;this.text[this.offset]>=`0`&&this.text[this.offset]<=`9`;)this.offset++}}skipWhitespace(){for(;this.offset({shape:e.type===`normal`?`actor`:e.type===`hollow`?`actor-hollow`:e.type===`awesome`?`actor-awesome`:`actor-icon`,...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`actor`,actorType:e.type,business:e.business,labelType:e.labelType,...e.icon?{icon:e.icon}:{},...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),`actorNode`),Lm=e(e=>({shape:e.shape,...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`usecase`,useCaseShape:e.shape,business:e.business,labelType:e.labelType,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),`useCaseNode`),Rm=e(e=>({label:e.label,shape:`note`,attrs:{kind:`note`,target:e.target,labelType:e.labelType}}),`noteNode`),zm=e(e=>({label:e.id,shape:`json-table`,...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`json`,value:e.value,propertyOrder:e.propertyOrder,labelType:`text`}}),`jsonNode`),Bm=e(e=>({id:e.id,source:e.source,target:e.target,...e.label?{label:e.label}:{},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{relationshipType:e.type,arrowType:e.arrowType,minlen:e.minlen,explicitId:e.explicitId,animate:e.animate,...e.animation?{animation:e.animation}:{},...e.labelType?{labelType:e.labelType}:{}}}),`relationshipEdge`),Vm=e(e=>({id:`${e.id}-edge`,source:e.id,target:e.target,attrs:{relationshipType:`note`,arrowType:q.LINE_SOLID,pattern:`dotted`,minlen:1,explicitId:!1,animate:!1,internal:!0}}),`noteEdge`),Hm=e((e,t,n,r)=>{let i={};for(let t of e.getActors().values())i[t.id]=Im(t);for(let t of e.getUseCases().values())i[t.id]=Lm(t);for(let t of e.getNotes().values())i[t.id]=Rm(t);for(let t of e.getJsonNodes().values())i[t.id]=zm(t);let a={};for(let t of e.getSystemBoundaries().values())a[t.id]={...t.label===t.id?{}:{title:t.label},nodes:[...t.members],...t.classes.length?{classes:[...t.classes]}:{},...t.styles.length?{styles:[...t.styles]}:{},attrs:{kind:`systemBoundary`,boundaryType:t.type,labelType:t.labelType}};let o={};for(let t of e.getClassDefs().values())o[t.id]={styles:[...t.styles]};let s=e.getDirection();return{version:1,diagramType:`usecase`,source:t,header:{keyword:`usecase`,direction:s===`TD`?`TB`:s,span:n},...e.getAccTitle()?{accTitle:e.getAccTitle()}:{},...e.getAccDescription()?{accDescr:e.getAccDescription()}:{},nodes:i,edges:[...e.getRelationships().map(Bm),...[...e.getNotes().values()].map(Vm)],groups:a,classDefs:o,statements:r}},`buildUsecaseGraphAST`),$=e(e=>`line ${e.line}, column ${e.column} [${e.span[0]},${e.span[1]})`,`locationText`),Um=e(e=>e===void 0?``:` (label "${e}")`,`labelSuffix`),Wm=e(e=>e.generated?e.label:void 0,`generatedFrom`),Gm=e((e,t)=>{for(let n of t)e.includes(n)||e.push(n)},`pushUnique`),Km=class{constructor(e){this.db=e,this.source=``,this.statements=[],this.elements=[],this.boundaries=[],this.jsonDrafts=[],this.relationshipDrafts=[],this.noteDrafts=[],this.metadataAssignments=[],this.classAssignments=[],this.styleAssignments=[],this.classDefinitions=[],this.directions=[],this.model=e.createModel()}static{e(this,`UsecaseModelBuilder`)}reset(e){this.model=this.db.createModel(),this.source=e,this.statements=[],this.elements.length=0,this.boundaries.length=0,this.jsonDrafts.length=0,this.relationshipDrafts.length=0,this.noteDrafts.length=0,this.metadataAssignments.length=0,this.classAssignments.length=0,this.styleAssignments.length=0,this.classDefinitions.length=0,this.directions.length=0}addElement(e){this.elements.push(e)}addBoundary(e){this.boundaries.push(e)}addJson(e){this.jsonDrafts.push(e)}addRelationship(e){this.relationshipDrafts.push(e)}addNote(e){this.noteDrafts.push(e)}addMetadataAssignment(e,t,n,r){this.metadataAssignments.push({target:e,targetLocation:t,metadata:n,statement:r})}addClassDef(e,t){this.classDefinitions.push({ids:e,styles:t})}addClassAssignment(e,t){this.classAssignments.push({targets:e,classes:t})}addStyleAssignment(e,t,n){this.styleAssignments.push({target:e,location:t,styles:n})}setDirection(e){this.directions.push(e===`TD`?`TB`:e)}setAccTitle(e){this.model.accTitle=e}setAccDescription(e){this.model.accDescription=e}setStatements(e){this.statements=e}getActors(){return this.model.actors}getUseCases(){return this.model.useCases}getSystemBoundaries(){return this.model.systemBoundaries}getRelationships(){return this.model.relationships}getNotes(){return this.model.notes}getJsonNodes(){return this.model.jsonNodes}getClassDefs(){return this.model.classDefs}getDirection(){return this.model.direction}getAccTitle(){return this.model.accTitle}getAccDescription(){return this.model.accDescription}finalize(e){let t=new Map,n=new Map,r=new Map,i=new Map;for(let e of this.relationshipDrafts)this.recordFirst(i,e.source.id,e.source.location.span[0]),this.recordFirst(i,e.target.id,e.target.location.span[0]);for(let e of this.elements)this.recordFirst(i,e.id,e.location.span[0]);for(let e of this.boundaries)this.recordFirst(i,e.id,e.location.span[0]);for(let e of this.jsonDrafts)this.recordFirst(i,e.id,e.location.span[0]);let a=[...this.elements.map(e=>({offset:e.location.span[0],type:`element`,value:e})),...this.boundaries.map(e=>({offset:e.location.span[0],type:`boundary`,value:e})),...this.jsonDrafts.map(e=>({offset:e.location.span[0],type:`json`,value:e})),...this.relationshipDrafts.filter(e=>e.explicitId).map(e=>({offset:e.explicitIdLocation.span[0],type:`edge`,value:e}))].sort((e,t)=>e.offset-t.offset);for(let e of a)e.type===`element`?this.collectElement(e.value,t,n):e.type===`boundary`?this.collectBoundary(e.value,t,r):e.type===`json`?this.registerUnique(t,e.value.id,`json`,e.value.location,!1):this.registerUnique(t,e.value.explicitId,`edge`,e.value.explicitIdLocation,!1);this.materializeElements(n,i),this.materializeBoundaries(r,i),this.materializeJson(i);let o=this.materializeRelationships(t,n,i);this.reorderElements(n,i),this.applyMetadataAssignments(t,n,r,o),this.validateAndRefreshElements(n),this.refreshBoundaries(r,n),this.materializeNotes(t),this.applyClassDefinitions(),this.applyClassesAndStyles(t,o),this.model.direction=this.directions.at(-1)??this.model.direction,this.model.symbols=new Map([...t].map(([e,t])=>[e,t.kind]));let s=Hm(this,this.source,e,this.statements);return this.model.ast=s,this.db.commit(this.model),s}collectElement(e,t,n){let r=t.get(e.id),i=Wm({generated:e.generated,label:e.label.text});r&&r.kind!==e.kind&&this.conflict(`ID '${e.id}' is declared as both ${r.kind} and ${e.kind}`,e.location,r.location,i,Wm(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,Wm(r));let a=n.get(e.id);if(!a){let r={kind:e.kind,id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],...e.parentId?{parentId:e.parentId,parentLocation:e.parentLocation}:{},...e.shape?{shape:e.shape}:{},...e.stereotype?{stereotype:e.stereotype,stereotypeLocation:e.location}:{}};this.applyDeclarationMetadata(r,e.metadata),n.set(e.id,r),t.set(e.id,{kind:e.kind,location:e.location,generated:e.generated,label:e.label.text});return}(a.label.text!==e.label.text||a.label.type!==e.label.type)&&this.conflict(`ID '${e.id}' has conflicting labels`,e.location,a.location),e.shape&&a.shape&&e.shape!==a.shape&&this.conflict(`Use case '${e.id}' has conflicting shapes`,e.location,a.location),e.parentId&&a.parentId&&e.parentId!==a.parentId&&this.conflict(`Element '${e.id}' belongs to more than one system boundary`,e.parentLocation??e.location,a.parentLocation??a.location),e.stereotype&&a.stereotype&&e.stereotype!==a.stereotype&&this.conflict(`Element '${e.id}' has conflicting stereotypes`,e.location,a.stereotypeLocation??a.location),a.shape??=e.shape,a.parentId??=e.parentId,a.parentLocation??=e.parentLocation,a.stereotype??=e.stereotype,a.stereotypeLocation??=e.stereotype?e.location:void 0,Gm(a.classes,e.classes),this.applyDeclarationMetadata(a,e.metadata)}collectBoundary(e,t,n){let r=t.get(e.id),i=Wm({generated:e.generated,label:e.label.text});r&&r.kind!==`boundary`&&this.conflict(`ID '${e.id}' is declared as both ${r.kind} and boundary`,e.location,r.location,i,Wm(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,Wm(r));let a=n.get(e.id);if(a){(a.label.text!==e.label.text||a.label.type!==e.label.type)&&this.conflict(`Boundary '${e.id}' has conflicting titles`,e.location,a.location),Gm(a.classes,e.classes);return}n.set(e.id,{id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],styles:[],members:[]}),t.set(e.id,{kind:`boundary`,location:e.location,generated:e.generated,label:e.label.text})}materializeElements(e,t){for(let n of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)))this.setElementModel(n)}materializeBoundaries(e,t){for(let n of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)))this.model.systemBoundaries.set(n.id,{id:n.id,label:n.label.text,labelType:n.label.type,type:n.type??`rect`,members:[],classes:[...n.classes],styles:[...n.styles]})}materializeJson(e){for(let t of[...this.jsonDrafts].sort((t,n)=>(e.get(t.id)??0)-(e.get(n.id)??0)))this.model.jsonNodes.set(t.id,{id:t.id,value:t.value,propertyOrder:t.propertyOrder,classes:[...t.classes],styles:[]})}materializeRelationships(e,t,n){let r=new Map,i=0;for(let a of this.relationshipDrafts){let o=this.resolveEndpoint(a.source,e,t,n),s=this.resolveEndpoint(a.target,e,t,n);this.validateRelationship(a,o,s,e);let c=a.explicitId??`edge-${i++}`,l={id:c,explicitId:!!a.explicitId,source:a.source.id,target:a.target.id,type:a.type,arrowType:a.arrowType,...a.label?{label:a.label.text,labelType:a.label.type}:{},minlen:a.minlen,classes:[],styles:[],animate:!1};this.model.relationships.push(l),r.set(c,{draft:a,relationship:l})}return this.model.relationshipCounter=i,r}resolveEndpoint(e,t,n,r){if(e.classesOnReference&&!e.declaration)throw Error(`Relationship endpoint '${e.id}' uses ::: without declaring the node at ${$(e.location)}`);let i=t.get(e.id);return i?i.kind:(n.set(e.id,{kind:`usecase`,id:e.id,label:e.label,location:e.location,generated:e.generated,shape:`ellipse`,classes:[]}),t.set(e.id,{kind:`usecase`,location:e.location,generated:e.generated,label:e.label.text}),this.recordFirst(r,e.id,e.location.span[0]),`usecase`)}reorderElements(e,t){let n=new Map(this.model.actors),r=new Map(this.model.useCases);this.model.actors.clear(),this.model.useCases.clear();for(let i of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0))){!n.has(i.id)&&!r.has(i.id)&&this.setElementModel(i);let e=n.get(i.id)??this.model.actors.get(i.id),t=r.get(i.id)??this.model.useCases.get(i.id);e?this.model.actors.set(i.id,e):t&&this.model.useCases.set(i.id,t)}}applyMetadataAssignments(e,t,n,r){for(let i of this.metadataAssignments){let a=e.get(i.target);if(!a){let e=this.inferMetadataKind(i.metadata);throw Error(`Metadata target '${i.target}' is unresolved${e?` (metadata implies ${e})`:``} at ${$(i.targetLocation)}`)}if(a.kind===`actor`||a.kind===`usecase`)this.applyStandaloneElementMetadata(t.get(i.target),i.metadata);else if(a.kind===`boundary`){let e=n.get(i.target);for(let t of i.metadata.properties)(t.key!==`type`||t.value!==`rect`&&t.value!==`package`)&&this.invalidMetadata(i.target,a.kind,t),e.type=t.value}else if(a.kind===`edge`){let e=r.get(i.target);if(!e)throw Error(`Metadata target '${i.target}' is not an explicit edge at ${$(i.targetLocation)}`);i.statement.kind=`edgeMetadata`,i.statement.edges=[{id:i.target,span:i.statement.span,idSpan:i.targetLocation.span,...i.statement.metadata?{metadata:i.statement.metadata}:{}}],delete i.statement.nodes;for(let t of i.metadata.properties)t.key===`animate`&&typeof t.value==`boolean`?e.relationship.animate=t.value:t.key===`animation`&&(t.value===`fast`||t.value===`slow`)?(e.relationship.animation=t.value,e.relationship.animate=!0):this.invalidMetadata(i.target,a.kind,t)}else for(let e of i.metadata.properties)this.invalidMetadata(i.target,a.kind,e)}for(let{relationship:e}of r.values())e.animation&&(e.animate=!0)}applyStandaloneElementMetadata(e,t){for(let n of t.properties)e.kind===`actor`?this.applyActorProperty(e,n,!0):n.key===`business`&&typeof n.value==`boolean`?e.business=n.value:this.invalidMetadata(e.id,e.kind,n)}applyDeclarationMetadata(e,t){if(t)for(let n of t.properties)e.kind===`actor`?this.applyActorProperty(e,n,!1):n.key===`business`&&typeof n.value==`boolean`?(e.business!==void 0&&e.business!==n.value&&this.conflict(`Use case '${e.id}' has conflicting business metadata`,n.location,e.location),e.business=n.value):this.invalidMetadata(e.id,e.kind,n)}applyActorProperty(e,t,n){t.key===`type`&&(t.value===`normal`||t.value===`hollow`||t.value===`awesome`)?(!n&&e.actorType!==void 0&&e.actorType!==t.value&&this.conflict(`Actor '${e.id}' has conflicting type metadata`,t.location,e.location),e.actorType=t.value):t.key===`icon`&&typeof t.value==`string`?(!n&&e.icon!==void 0&&e.icon!==t.value&&this.conflict(`Actor '${e.id}' has conflicting icon metadata`,t.location,e.location),e.icon=t.value):t.key===`business`&&typeof t.value==`boolean`?(!n&&e.business!==void 0&&e.business!==t.value&&this.conflict(`Actor '${e.id}' has conflicting business metadata`,t.location,e.location),e.business=t.value):this.invalidMetadata(e.id,e.kind,t)}validateAndRefreshElements(e){for(let t of e.values()){let e=t.icon?`icon`:t.actorType??`normal`;if(t.kind===`actor`){if(t.icon&&t.actorType&&t.actorType!==`normal`)throw Error(`Actor '${t.id}' cannot combine icon with type '${t.actorType}' at ${$(t.location)}`);if(t.business&&(e===`icon`||e===`awesome`))throw Error(`Business actor '${t.id}' must use normal or hollow geometry at ${$(t.location)}`)}else if((t.shape??`ellipse`)===`rect`&&t.business)throw Error(`Rectangular use case '${t.id}' cannot be a business use case at ${$(t.location)}`);this.setElementModel(t)}}refreshBoundaries(e,t){for(let t of e.values())t.members.length=0;for(let t of[...this.elements].sort((e,t)=>e.location.span[0]-t.location.span[0])){if(!t.parentId)continue;let n=e.get(t.parentId);if(!n)throw Error(`Parent boundary '${t.parentId}' for '${t.id}' is unresolved at ${$(t.parentLocation??t.location)}`);n.members.includes(t.id)||n.members.push(t.id)}for(let n of t.values())if(n.parentId&&!e.has(n.parentId))throw Error(`Parent boundary '${n.parentId}' for '${n.id}' is unresolved at ${$(n.parentLocation??n.location)}`);for(let t of e.values()){let e=this.model.systemBoundaries.get(t.id);e.type=t.type??`rect`,e.members=[...t.members],e.classes=[...t.classes],e.styles=[...t.styles]}}materializeNotes(e){let t=0;for(let n of this.noteDrafts){let r=e.get(n.target);if(!r)throw Error(`Note target '${n.target}' is unresolved at ${$(n.targetLocation)}`);r.kind!==`actor`&&r.kind!==`usecase`&&this.conflict(`Note target '${n.target}' must be an actor or use case, not ${r.kind}`,n.targetLocation,r.location);let i=`note-${t++}`;this.model.notes.set(i,{id:i,target:n.target,label:n.label.text,labelType:n.label.type})}this.model.noteCounter=t}applyClassDefinitions(){for(let e of this.classDefinitions)for(let t of e.ids)this.model.classDefs.set(t,{id:t,styles:[...e.styles]})}applyClassesAndStyles(e,t){for(let n of this.classAssignments)for(let r of n.targets)Gm(this.getStylable(r.id,e,t,r.location).classes,n.classes);for(let n of this.styleAssignments)this.getStylable(n.target,e,t,n.location).styles.push(...n.styles)}getStylable(e,t,n,r){let i=t.get(e)?.kind,a=i===`actor`?this.model.actors.get(e):i===`usecase`?this.model.useCases.get(e):i===`boundary`?this.model.systemBoundaries.get(e):i===`json`?this.model.jsonNodes.get(e):i===`edge`?n.get(e)?.relationship:void 0;if(!a)throw Error(`Class/style target '${e}' is unresolved or anonymous at ${$(r)}`);return a}validateRelationship(t,n,r,i){let a=e(e=>e===`actor`||e===`usecase`||e===`json`,`allowed`);if(a(n)||this.conflict(`Relationship source '${t.source.id}' cannot be ${n}`,t.source.location,i.get(t.source.id).location),a(r)||this.conflict(`Relationship target '${t.target.id}' cannot be ${r}`,t.target.location,i.get(t.target.id).location),(t.type===`include`||t.type===`extend`)&&(n!==`usecase`||r!==`usecase`))throw Error(`${t.type} relationship requires use-case endpoints at ${$(t.location)}`);if(t.type===`generalization`&&(n!==`actor`&&n!==`usecase`||n!==r))throw Error(`Generalization requires actor-to-actor or use-case-to-use-case endpoints at ${$(t.location)}`);if(t.type===`association`&&(n===`json`||r===`json`)&&![0,1,2].includes(t.arrowType))throw Error(`JSON relationship '${t.source.id}' to '${t.target.id}' permits only point, reversed-point, or markerless solid association at ${$(t.location)}`)}setElementModel(e){if(e.kind===`actor`){let t=e.icon?`icon`:e.actorType??`normal`;this.model.useCases.delete(e.id),this.model.actors.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,type:t,...e.icon?{icon:e.icon}:{},business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.actors.get(e.id)?.styles??[]})}else this.model.actors.delete(e.id),this.model.useCases.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,shape:e.shape??`ellipse`,business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.useCases.get(e.id)?.styles??[]})}inferMetadataKind(e){let t=new Set([`actor`,`usecase`,`boundary`,`edge`]);for(let n of e.properties)if(n.key===`icon`)t.clear(),t.add(`actor`);else if(n.key===`animate`||n.key===`animation`)t.clear(),t.add(`edge`);else if(n.key===`type`)t.clear(),n.value===`rect`||n.value===`package`?t.add(`boundary`):(n.value===`normal`||n.value===`hollow`||n.value===`awesome`)&&t.add(`actor`);else if(n.key===`business`)t.delete(`boundary`),t.delete(`edge`);else return;return t.size===1?[...t][0]:void 0}invalidMetadata(e,t,n){throw Error(`Metadata property '${n.key}' is invalid for ${t} '${e}' at ${$(n.location)}`)}registerUnique(e,t,n,r,i){let a=e.get(t);a&&this.conflict(`ID '${t}' is declared more than once (${a.kind} and ${n})`,r,a.location,void 0,Wm(a)),e.set(t,{kind:n,location:r,generated:i})}recordFirst(e,t,n){let r=e.get(t);(r===void 0||nthis.visit(e)),r=this.nodes(e,`relationTail`)[0],i=n.map((e,n)=>this.actorOccurrence(t[n],e,!0));for(let e of n)this.builder.addElement(this.actorDraft(e));if(!r)return{kind:`node`,span:[0,0],nodes:i};let a=this.visit(r);a.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(a.target));let o=this.relationshipDraft(n[0],a,this.nodeLocation(r));this.builder.addRelationship(o);let s=o.explicitId??`edge-${this.anonymousEdge++}`;return i.push(this.entityOccurrence(this.nodes(r.children,`entityName`)[0],a.target,a.target.explicitDeclaration)),{kind:`edge`,span:[0,0],nodes:i,edges:[{id:s,span:[0,0],...o.explicitIdLocation?{idSpan:o.explicitIdLocation.span}:{},...o.label?{labelSpan:o.label.span}:{}}]}}actorItem(e){let t=this.visit(this.nodes(e,`actorName`)[0]),n=this.nodes(e,`metadata`)[0],r=this.nodes(e,`stereotype`)[0],i=this.nodes(e,`classSuffix`)[0],a=i?this.visit(i):{classes:[],spans:[]};return{...t,...n?{metadata:this.visit(n)}:{},...r?{stereotype:this.visit(r)}:{},classes:a.classes,classSpans:a.spans}}actorName(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0];if(t){let n=this.nodes(e,`nodeLabel`)[0],r=n?this.visit(n):this.tokenLabel(t);return{id:t.image,label:r,location:this.tokenLocation(t),generated:!1,classes:[],classSpans:[]}}let r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[],classSpans:[]}}actorDeclarationOnly(e){let t=this.nodes(e,`actorItem`),n=t.map(e=>this.visit(e));for(let e of n)this.builder.addElement(this.actorDraft(e));return{kind:`node`,span:[0,0],nodes:n.map((e,n)=>this.actorOccurrence(t[n],e,!0))}}entityStatement(e){let t=this.nodes(e,`entityName`),n=this.visit(t[0]),r=this.nodes(e,`relationTail`)[0];if(!r)return n.explicitDeclaration=!0,n.shape??=`ellipse`,this.builder.addElement(this.entityDraft(n)),{kind:`node`,span:[0,0],nodes:[this.entityOccurrence(t[0],n,!0)]};n.explicitDeclaration&&this.builder.addElement(this.entityDraft(n));let i=this.visit(r);i.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(i.target));let a={source:this.endpoint(n),target:this.endpoint(i.target),location:this.nodeLocation(r),...i.explicitId?{explicitId:i.explicitId,explicitIdLocation:i.explicitIdLocation}:{},...i.arrow};this.builder.addRelationship(a);let o=a.explicitId??`edge-${this.anonymousEdge++}`;return{kind:`edge`,span:[0,0],nodes:[this.entityOccurrence(t[0],n,n.explicitDeclaration),this.entityOccurrence(this.nodes(r.children,`entityName`)[0],i.target,i.target.explicitDeclaration)],edges:[{id:o,span:[0,0],...a.explicitIdLocation?{idSpan:a.explicitIdLocation.span}:{},...a.label?{labelSpan:a.label.span}:{}}]}}entityName(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0],r=this.nodes(e,`nodeLabel`)[0],i=this.nodes(e,`useCaseMetadata`)[0],a=this.nodes(e,`stereotype`)[0],o=this.nodes(e,`classSuffix`)[0],s=o?this.visit(o):{classes:[],spans:[]};if(t){let n=r?this.visit(r):this.tokenLabel(t),o=r?this.tokens(e,`LBRACKET`).length?`rect`:`ellipse`:void 0;return{id:t.image,label:n,location:this.tokenLocation(t),generated:!1,...o?{shape:o}:{},...i?{metadata:this.visit(i)}:{},...a?{stereotype:this.visit(a)}:{},classes:s.classes,classSpans:s.spans,explicitDeclaration:!!(o||i||a)}}let c=this.tokenLabel(n);return{id:this.generateId(c.text),label:c,location:this.tokenLocation(n),generated:!0,...i?{metadata:this.visit(i)}:{},...a?{stereotype:this.visit(a)}:{},classes:s.classes,classSpans:s.spans,explicitDeclaration:!!(i||a)}}nodeLabel(e){let t=this.allTokens(e);if(t.length===1&&(t[0].tokenType.name===`PLAIN_STRING`||t[0].tokenType.name===`MARKDOWN_STRING`))return this.tokenLabel(t[0]);let n=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return{text:this.source.slice(n[0],n[1]),type:`text`,span:n}}useCaseMetadata(e){return this.visit(this.nodes(e,`metadata`)[0])}relationTail(e){let t=this.tokens(e,`IDENTIFIER`)[0];return{...t?{explicitId:t.image,explicitIdLocation:this.tokenLocation(t)}:{},arrow:this.visit(this.nodes(e,`arrow`)[0]),target:this.visit(this.nodes(e,`entityName`)[0])}}arrow(e){return this.visit(this.firstNode(e,`semanticRelation`,`forwardSolidOperator`,`backwardSolidOperator`,`markerlessSolidOperator`,`forwardCircleOperator`,`backwardCircleOperator`,`forwardCrossOperator`,`backwardCrossOperator`))}edgeLabel(e){return this.nodeLabel(e)}semanticRelation(e){if(this.tokens(e,`GENERALIZATION`).length)return{type:`generalization`,arrowType:q.SOLID_ARROW,minlen:1};let t=this.tokens(e,`INCLUDE`).length?`include`:`extend`,n=this.tokens(e,t===`include`?`INCLUDE`:`EXTEND`)[0];return{type:t,arrowType:q.SOLID_ARROW,label:{text:t,type:`text`,span:this.tokenSpan(n)},minlen:1}}metadata(e){return{properties:this.nodes(e,`metadataProperty`).map(e=>this.visit(e)),location:this.ctxLocation(e)}}metadataProperty(e){let t=this.allTokens(e).filter(e=>e.tokenType.name!==`COLON`),n=t[0],r=t[1],i=r.tokenType.name===`TRUE`||r.tokenType.name!==`FALSE`&&this.decodePlain(r),a=[n.startOffset,(r.endOffset??r.startOffset)+1];return{key:this.decodePlain(n),value:i,span:a,keySpan:this.contentSpan(n),valueSpan:this.contentSpan(r),location:this.tokenLocation(n)}}metadataSeparator(e){}systemBoundaryStatement(e){let t=this.visit(this.nodes(e,`systemBoundaryName`)[0]),n=this.nodes(e,`classSuffix`)[0],r=n?this.visit(n):{classes:[],spans:[]};t.classes=r.classes,this.builder.addBoundary(t);let i=this.parentBoundary;this.parentBoundary={id:t.id,location:t.location};let a=this.nodes(e,`systemBoundaryContent`)[0],o=a?this.visit(a):[];this.parentBoundary=i;let s=this.tokens(e,`END`)[0],c=this.nodes(e,`metadata`)[0],l=c?this.visit(c):void 0,u={kind:`group`,span:[0,0],group:t.id,idSpan:t.location.span,titleSpan:t.label.span,endSpan:this.tokenSpan(s),classSpans:r.spans,...l?{metadata:l.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))}:{},...o.length?{children:o}:{}};return l&&this.builder.addMetadataAssignment(t.id,t.location,l,u),u}systemBoundaryName(e){let t=this.tokens(e,`IDENTIFIER`)[0];if(t){let n=this.nodes(e,`nodeLabel`)[0];return{id:t.image,label:n?this.visit(n):this.tokenLabel(t),location:this.tokenLocation(t),generated:!1,classes:[]}}let n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0],r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[]}}systemBoundaryContent(e){return[...this.nodes(e,`blankLine`),...this.nodes(e,`commentLine`),...this.nodes(e,`boundaryElement`)].sort((e,t)=>(e.location?.startOffset??0)-(t.location?.startOffset??0)).map(e=>this.wrap(e,this.visit(e)))}boundaryElement(e){let t=this.nodes(e,`actorDeclarationOnly`)[0];if(t)return this.visit(t);let n=this.nodes(e,`entityName`)[0],r=this.visit(n);return r.explicitDeclaration=!0,r.shape??=`ellipse`,this.builder.addElement(this.entityDraft(r)),{kind:`node`,span:[0,0],nodes:[this.entityOccurrence(n,r,!0)]}}metadataAssignmentStatement(e){let t=this.visit(this.nodes(e,`metadataAssignmentTarget`)[0]),n=this.visit(this.nodes(e,`metadata`)[0]),r={kind:`metadata`,span:[0,0],nodes:[{id:t.id,span:t.location.span,idSpan:t.location.span}],metadata:n.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))};return this.builder.addMetadataAssignment(t.id,t.location,n,r),r}metadataAssignmentTarget(e){let t=this.allTokens(e)[0],n=this.tokenLabel(t);return{id:t.tokenType.name===`IDENTIFIER`?t.image:this.generateId(n.text),location:this.tokenLocation(t)}}noteStatement(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.visit(this.nodes(e,`nodeLabel`)[0]);return this.builder.addNote({target:t.image,targetLocation:this.tokenLocation(t),label:n,location:this.ctxLocation(e)}),{kind:`note`,span:[0,0],ref:`note-${this.anonymousNote++}`,refSpan:n.span,nodes:[{id:t.image,span:this.tokenSpan(t),idSpan:this.tokenSpan(t)}]}}stereotype(e){let t=this.tokens(e,`STEREOTYPE_TEXT`)[0];return{value:t.image.trim(),span:this.tokenSpan(t)}}classSuffix(e){let t=this.tokens(e,`IDENTIFIER`);return{classes:t.map(e=>e.image),spans:t.map(e=>this.tokenSpan(e))}}jsonStatement(e){let t=this.tokens(e,`JSON_DECLARATION_START`)[0],n=this.tokens(e,`JSON_OBJECT_LITERAL`)[0],r=/^json[\t ]+(\w+)/.exec(t.image),i=r[1],a=r[0].length-i.length,o={span:[t.startOffset+a,t.startOffset+a+i.length],line:t.startLine??1,column:(t.startColumn??1)+a},s=Fm(n.image,n.startLine??1,n.startColumn??1),c=this.nodes(e,`classSuffix`)[0],l=c?this.visit(c):{classes:[],spans:[]},u={id:i,value:s.value,propertyOrder:s.propertyOrder,location:o,classes:l.classes};return this.builder.addJson(u),{kind:`json`,span:[0,0],nodes:[{id:i,span:o.span,idSpan:o.span,defines:!0,classSpans:l.spans}],classSpans:l.spans}}directionStatement(e){let t=this.allTokens(e).find(e=>[`TD`,`TB`,`BT`,`RL`,`LR`].includes(e.tokenType.name));return this.builder.setDirection(t.image),{kind:`direction`,span:[0,0]}}classDefStatement(e){let t=this.tokens(e,`IDENTIFIER`),n=this.visit(this.nodes(e,`styles`)[0]);return this.builder.addClassDef(t.map(e=>e.image),n),{kind:`classDef`,span:[0,0],ref:t[0].image,refSpan:this.tokenSpan(t[0])}}classStatement(e){let t=this.tokens(e,`IDENTIFIER`),n=1;for(;n({id:e.image,location:this.tokenLocation(e)})),i=t.slice(n).map(e=>e.image);return this.builder.addClassAssignment(r,i),{kind:`classAssign`,span:[0,0],ref:i[0],refSpan:this.tokenSpan(t[n]),nodes:r.map(({id:e,location:t})=>({id:e,span:t.span,idSpan:t.span}))}}styleStatement(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.visit(this.nodes(e,`styles`)[0]);return this.builder.addStyleAssignment(t.image,this.tokenLocation(t),n),{kind:`style`,span:[0,0],nodes:[{id:t.image,span:this.tokenSpan(t),idSpan:this.tokenSpan(t)}]}}styles(e){return this.nodes(e,`styleValue`).map(e=>this.visit(e))}styleValue(e){let t=this.allTokens(e),n=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return this.source.slice(n[0],n[1]).replaceAll(`\\,`,`,`)}styleComponent(e){return this.allTokens(e).map(e=>e.image).join(``)}forwardSolidOperator(e){let t=this.tokens(e,`FORWARD_SOLID`)[0];return{type:`association`,arrowType:q.SOLID_ARROW,minlen:this.solidMinlen(t)}}backwardSolidOperator(e){let t=this.tokens(e,`BACKWARD_SOLID`)[0],n=this.nodes(e,`edgeLabel`)[0],r=n?this.tokens(e,`MARKERLESS_SOLID`).at(-1):t;return{type:`association`,arrowType:q.BACK_ARROW,minlen:this.solidMinlen(r),...n?{label:this.visit(n)}:{}}}markerlessSolidOperator(e){let t=this.nodes(e,`edgeLabel`)[0],n=this.allTokens(e);if(!t)return{type:`association`,arrowType:q.LINE_SOLID,minlen:this.solidMinlen(this.tokens(e,`MARKERLESS_SOLID`)[0])};let r=n.at(-1),i=r.tokenType.name===`FORWARD_SOLID`?q.SOLID_ARROW:r.tokenType.name===`FORWARD_CIRCLE`?q.CIRCLE_ARROW:r.tokenType.name===`FORWARD_CROSS`?q.CROSS_ARROW:q.LINE_SOLID;return{type:`association`,arrowType:i,label:this.visit(t),minlen:i===q.SOLID_ARROW||i===q.LINE_SOLID?this.solidMinlen(r):1}}forwardCircleOperator(e){return{type:`association`,arrowType:q.CIRCLE_ARROW,minlen:1}}backwardCircleOperator(e){let t=this.nodes(e,`edgeLabel`)[0];return{type:`association`,arrowType:q.CIRCLE_ARROW_REVERSED,minlen:1,...t?{label:this.visit(t)}:{}}}forwardCrossOperator(e){return{type:`association`,arrowType:q.CROSS_ARROW,minlen:1}}backwardCrossOperator(e){let t=this.nodes(e,`edgeLabel`)[0];return{type:`association`,arrowType:q.CROSS_ARROW_REVERSED,minlen:1,...t?{label:this.visit(t)}:{}}}actorDraft(e){return{id:e.id,kind:`actor`,label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}entityDraft(e){return{id:e.id,kind:`usecase`,label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.shape?{shape:e.shape}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}endpoint(e,t=e.explicitDeclaration??!0){return{id:e.id,label:e.label,location:e.location,generated:e.generated,declaration:t,classesOnReference:e.classes.length>0}}relationshipDraft(e,t,n){return{source:this.endpoint(e,!0),target:this.endpoint(t.target),location:n,...t.explicitId?{explicitId:t.explicitId,explicitIdLocation:t.explicitIdLocation}:{},...t.arrow}}actorOccurrence(e,t,n){return{id:t.id,span:this.nodeSpan(e),idSpan:t.location.span,labelSpan:t.label.span,...n?{defines:!0}:{},...t.stereotype?{stereotypeSpan:t.stereotype.span}:{},...t.metadata?{metadata:t.metadata.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))}:{},...t.classSpans.length?{classSpans:t.classSpans}:{}}}entityOccurrence(e,t,n){return this.actorOccurrence(e,t,n)}wrap(e,t){if(t.kind===`blank`||t.kind===`comment`)return t;t.span=this.nodeSpan(e);for(let e of t.edges??[])e.span=t.span;return t}tokenLabel(e){let t=e.tokenType.name===`MARKDOWN_STRING`?`markdown`:`text`,n=t===`markdown`?2:+(e.tokenType.name===`PLAIN_STRING`),r=this.tokenSpan(e,n);return{text:this.source.slice(r[0],r[1]),type:t,span:r}}decodePlain(e){return e.tokenType.name===`PLAIN_STRING`?e.image.slice(1,-1):e.image}contentSpan(e){return this.tokenSpan(e,e.tokenType.name===`PLAIN_STRING`?1:e.tokenType.name===`MARKDOWN_STRING`?2:0)}generateId(e){return e.replace(/\W/g,`_`)}solidMinlen(e){return Math.max(1,(e.image.match(/-/g)?.length??2)-1)}nodeLocation(e){let t=this.allTokens(e.children)[0];return{span:this.nodeSpan(e),line:t.startLine??1,column:t.startColumn??1}}ctxLocation(e){let t=this.allTokens(e).filter(e=>e.tokenType.name!==`NEWLINE`&&e.tokenType.name!==`EOF`),n=t[0],r=t.at(-1);return{span:[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)],line:n.startLine??1,column:n.startColumn??1}}tokenLocation(e){let t=e.tokenType.name===`PLAIN_STRING`?1:e.tokenType.name===`MARKDOWN_STRING`?2:0;return{span:this.tokenSpan(e,t),line:e.startLine??1,column:(e.startColumn??1)+t}}nodeSpan(e){let t=this.allTokens(e.children).filter(e=>e.tokenType.name!==`NEWLINE`&&e.tokenType.name!==`EOF`),n=t[0],r=t.at(-1);if(!n||!r)throw Error(`Usecase CST node has no source token`);return[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)]}tokenSpan(e,t=0){return[e.startOffset+t,Math.min(this.source.length,(e.endOffset??e.startOffset+e.image.length-1)+1-t)]}nodes(e,t){return(e[t]??[]).filter(e=>`children`in e)}tokens(e,t){return(e[t]??[]).filter(e=>`tokenTypeIdx`in e)}firstNode(e,...t){for(let n of t){let t=this.nodes(e,n)[0];if(t)return t}throw Error(`Usecase CST is missing one of: ${t.join(`, `)}`)}allTokens(e){let t=[];for(let n of Object.values(e))for(let e of n)`tokenTypeIdx`in e?t.push(e):t.push(...this.allTokens(e.children));return t.sort((e,t)=>e.startOffset-t.startOffset)}},Ym={parse:e(async t=>{np.clear(),Am.input=[];try{Cf({diagramType:`usecase`,lexer:Dm,parser:Am,entry:e(()=>Am.start(),`entry`),visit:e(e=>Jm.build(e,t),`visit`)},t)}catch(e){np.clear();let n=Am.errors[0];if(n){let{token:r}=n,i=Number.isFinite(r.startOffset)?r.startOffset:t.length,a=typeof r.endOffset==`number`&&Number.isFinite(r.endOffset)?r.endOffset+1:i,o=r.startLine??t.slice(0,i).split(/\r\n|\r|\n/).length,s=Math.max(t.lastIndexOf(` `,i-1),t.lastIndexOf(`\r`,i-1)),c=r.startColumn??i-s,l=e instanceof Error?e.message:String(e);throw Error(`${l} at line ${o}, column ${c} [${i},${a})`)}throw e}},`parse`)},Xm=[`point`,`circle`,`cross`,`extension`],Zm={usecaseActor:!0,usecaseActorHollow:!0,usecaseActorAwesome:!0,usecaseActorIcon:!0},Qm=e((e,t)=>{let[n,r]=[e,t].map(e=>e.replace(/[^\w-]+/g,`_`).replace(/^_+|_+$/g,``)||`element`);return`usecase-${n}-${r}`},`usecaseDomId`),$m=e(e=>`usecase-${e.replace(/[^\w-]+/g,`_`).replace(/^_+|_+$/g,``)||`element`}`,`usecaseNodeDomId`),eh=e((e,t)=>t===`markdown`?h(e).map(e=>e.map(e=>e.content).join(` `)).join(` -`):e,`getAccessibleLabel`),th=e(e=>{let t=eh(e.label??e.id,e.labelType);if(Zm[e.shape]){let n=e.actorType&&e.actorType!==`normal`?`${e.actorType} `:``;return`${e.business?`business `:``}${n}actor ${t}${e.stereotype?`, stereotype ${e.stereotype}`:``}`}if(e.shape===`note`)return`Note for ${e.noteTargetLabel??e.noteTarget??``}: ${t}`;if(e.shape===`usecaseJsonTable`){let n=(e.jsonRows??[]).map(e=>`${e.accessibleKey}: ${e.value}`).join(`; `);return n?`${t}: ${n}`:t}let n=e.stereotype?`, stereotype ${e.stereotype}`:``;return`${e.business?`business `:``}use case ${t}${n}`},`getUsecaseNodeAccessibleName`),nh=e(e=>`${e.boundaryType} system boundary ${eh(e.label??e.id,e.labelType)}`,`getUsecaseBoundaryAccessibleName`),rh=e(e=>e.relationshipType===`note`?``:`${e.relationshipType===`association`&&e.label?`association ${eh(e.label,e.labelType)}`:e.relationshipType} from ${e.sourceLabel} to ${e.targetLabel}`,`getUsecaseEdgeAccessibleName`),ih=e(e=>e.replace(/&/g,`&`).replace(//g,`>`),`escapePlainLabel`),ah=e(e=>e.replace(/([*[\\\]_`])/g,`\\$1`),`escapeMarkdownMarkers`),oh=e((e,t)=>{e.diagramId=t,e.markers=[...Xm];for(let t of e.nodes){let e=t;if(e.domId=$m(t.id),t.label!==void 0&&t.labelType===`text`&&(t.label=ih(t.label)),t.stereotype&&=ih(t.stereotype),!t.isGroup&&t.shape===`usecaseJsonTable`&&(t.jsonRows=t.jsonRows?.map(e=>({...e,key:ih(e.key),value:ih(e.value)}))),!t.isGroup&&(t.shape===`usecaseEllipse`||t.shape===`rect`)&&t.stereotype){let n=t.label??ih(t.id);t.label=`\xAB${ah(t.stereotype)}\xBB
${t.labelType===`text`?ah(n):n}`,t.labelType=`markdown`,e.hasFoldedStereotype=!0,delete t.stereotype}}for(let t of e.edges)t.label!==void 0&&t.labelType===`text`&&(t.label=ih(t.label));return e},`prepareUsecaseLayoutData`),sh=e((e,t,r)=>{for(let n of t.nodes){let i=typeof n.domId==`string`?n.domId:Qm(t.diagramId,n.id),a=e.select(`#${i}`),o=n.isGroup?`boundary`:Zm[n.shape]?`actor`:n.shape===`note`?`note`:n.shape===`usecaseJsonTable`?`json`:`usecase`,s=r.nodes.get(n.id)??n.id;if(a.attr(`data-usecase-id`,n.id).attr(`data-usecase-kind`,o).attr(`role`,`img`).attr(`aria-label`,s),!n.isGroup&&(n.shape===`usecaseEllipse`||n.shape===`rect`)&&`hasFoldedStereotype`in n&&n.hasFoldedStereotype===!0){let e=a.node(),t=e?.querySelector(`.nodeLabel`),n=t?.querySelector(`p`)??t,r=n?.firstChild;if(n&&r?.nodeType===3){let e=n.ownerDocument.createElement(`span`);e.className=`usecase-stereotype`,n.insertBefore(e,r),e.appendChild(r)}else e?.querySelector(`.label tspan tspan, .label tspan`)?.classList.add(`usecase-stereotype`)}}let i=new Map(t.edges.map(e=>[e.id,e]));e.selectAll(`path[data-et="edge"]`).each(function(){let e=i.get(this.getAttribute(`data-id`)??``);if(!e)return;let a=n(this);a.attr(`id`,Qm(t.diagramId,e.id)).attr(`data-usecase-id`,e.id).attr(`data-usecase-kind`,e.internal?`note-connector`:`relationship`),e.internal?a.attr(`aria-hidden`,`true`):a.attr(`role`,`img`).attr(`aria-label`,r.edges.get(e.id)??e.id)})},`annotateUsecaseElements`),ch=e((e,t)=>{e.style(`--mermaid-usecase-actor-font-size`,`${t.actorFontSize}px`).style(`--mermaid-usecase-actor-font-family`,t.actorFontFamily).style(`--mermaid-usecase-actor-font-weight`,t.actorFontWeight).style(`--mermaid-usecase-font-size`,`${t.usecaseFontSize}px`).style(`--mermaid-usecase-font-family`,t.usecaseFontFamily).style(`--mermaid-usecase-font-weight`,t.usecaseFontWeight)},`applyUsecaseFonts`),lh={draw:e(async(e,n,r,i)=>{t.info(`Drawing usecase diagram (unified)`,n);let{layout:a}=d(),o=i.db,s=o.getData(),c=new Map(s.nodes.map(e=>[e.id,eh(e.label??e.id,e.labelType)])),l={nodes:new Map(s.nodes.map(e=>[e.id,e.isGroup?nh(e):th(e.shape===`note`?{...e,noteTargetLabel:c.get(e.noteTarget??``)}:e)])),edges:new Map(s.edges.map(e=>[e.id,rh({...e,sourceLabel:c.get(e.source)??e.sourceLabel,targetLabel:c.get(e.target)??e.targetLabel})]))},u=ne(n,s.config.securityLevel);s.layoutAlgorithm=ae(a),oh(s,n),ch(u,s),await ie(s,u),sh(u,s,l);let f=s.diagramPadding;m.insertTitle(u,`usecaseDiagramTitleText`,0,o.getDiagramTitle?.()??``),re(u,f,`usecaseDiagram`,s.useMaxWidth),ch(u,s)},`draw`)},uh=e(e=>({actorBkg:e.usecaseActorBkg??e.actorBkg??e.mainBkg,actorBorder:e.usecaseActorBorder??e.actorBorder??e.primaryColor,bkg:e.usecaseBkg??e.mainBkg,border:e.usecaseBorder??e.nodeBorder??e.primaryColor,boundaryBkg:e.usecaseBoundaryBkg??e.clusterBkg,boundaryBorder:e.usecaseBoundaryBorder??e.clusterBorder,includeLine:e.usecaseIncludeLine??e.lineColor,extendLine:e.usecaseExtendLine??e.lineColor}),`roleColors`),dh=e(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!ee(t,r))return``;let i=o().usecase?.colorScheme===`rotate`,a=te(e.look),s=a===`handDrawn`,c=_(n),l=``;for(let e=0;e{let t=eh(e.label??e.id,e.labelType);if(Zm[e.shape]){let n=e.actorType&&e.actorType!==`normal`?`${e.actorType} `:``;return`${e.business?`business `:``}${n}actor ${t}${e.stereotype?`, stereotype ${e.stereotype}`:``}`}if(e.shape===`note`)return`Note for ${e.noteTargetLabel??e.noteTarget??``}: ${t}`;if(e.shape===`usecaseJsonTable`){let n=(e.jsonRows??[]).map(e=>`${e.accessibleKey}: ${e.value}`).join(`; `);return n?`${t}: ${n}`:t}let n=e.stereotype?`, stereotype ${e.stereotype}`:``;return`${e.business?`business `:``}use case ${t}${n}`},`getUsecaseNodeAccessibleName`),nh=e(e=>`${e.boundaryType} system boundary ${eh(e.label??e.id,e.labelType)}`,`getUsecaseBoundaryAccessibleName`),rh=e(e=>e.relationshipType===`note`?``:`${e.relationshipType===`association`&&e.label?`association ${eh(e.label,e.labelType)}`:e.relationshipType} from ${e.sourceLabel} to ${e.targetLabel}`,`getUsecaseEdgeAccessibleName`),ih=e(e=>e.replace(/&/g,`&`).replace(//g,`>`),`escapePlainLabel`),ah=e(e=>e.replace(/([*[\\\]_`])/g,`\\$1`),`escapeMarkdownMarkers`),oh=e((e,t)=>{e.diagramId=t,e.markers=[...Xm];for(let t of e.nodes){let e=t;if(e.domId=$m(t.id),t.label!==void 0&&t.labelType===`text`&&(t.label=ih(t.label)),t.stereotype&&=ih(t.stereotype),!t.isGroup&&t.shape===`usecaseJsonTable`&&(t.jsonRows=t.jsonRows?.map(e=>({...e,key:ih(e.key),value:ih(e.value)}))),!t.isGroup&&(t.shape===`usecaseEllipse`||t.shape===`rect`)&&t.stereotype){let n=t.label??ih(t.id);t.label=`\xAB${ah(t.stereotype)}\xBB
${t.labelType===`text`?ah(n):n}`,t.labelType=`markdown`,e.hasFoldedStereotype=!0,delete t.stereotype}}for(let t of e.edges)t.label!==void 0&&t.labelType===`text`&&(t.label=ih(t.label));return e},`prepareUsecaseLayoutData`),sh=e((e,t,r)=>{for(let n of t.nodes){let i=typeof n.domId==`string`?n.domId:Qm(t.diagramId,n.id),a=e.select(`#${i}`),o=n.isGroup?`boundary`:Zm[n.shape]?`actor`:n.shape===`note`?`note`:n.shape===`usecaseJsonTable`?`json`:`usecase`,s=r.nodes.get(n.id)??n.id;if(a.attr(`data-usecase-id`,n.id).attr(`data-usecase-kind`,o).attr(`role`,`img`).attr(`aria-label`,s),!n.isGroup&&(n.shape===`usecaseEllipse`||n.shape===`rect`)&&`hasFoldedStereotype`in n&&n.hasFoldedStereotype===!0){let e=a.node(),t=e?.querySelector(`.nodeLabel`),n=t?.querySelector(`p`)??t,r=n?.firstChild;if(n&&r?.nodeType===3){let e=n.ownerDocument.createElement(`span`);e.className=`usecase-stereotype`,n.insertBefore(e,r),e.appendChild(r)}else e?.querySelector(`.label tspan tspan, .label tspan`)?.classList.add(`usecase-stereotype`)}}let i=new Map(t.edges.map(e=>[e.id,e]));e.selectAll(`path[data-et="edge"]`).each(function(){let e=i.get(this.getAttribute(`data-id`)??``);if(!e)return;let a=n(this);a.attr(`id`,Qm(t.diagramId,e.id)).attr(`data-usecase-id`,e.id).attr(`data-usecase-kind`,e.internal?`note-connector`:`relationship`),e.internal?a.attr(`aria-hidden`,`true`):a.attr(`role`,`img`).attr(`aria-label`,r.edges.get(e.id)??e.id)})},`annotateUsecaseElements`),ch=e((e,t)=>{e.style(`--mermaid-usecase-actor-font-size`,`${t.actorFontSize}px`).style(`--mermaid-usecase-actor-font-family`,t.actorFontFamily).style(`--mermaid-usecase-actor-font-weight`,t.actorFontWeight).style(`--mermaid-usecase-font-size`,`${t.usecaseFontSize}px`).style(`--mermaid-usecase-font-family`,t.usecaseFontFamily).style(`--mermaid-usecase-font-weight`,t.usecaseFontWeight)},`applyUsecaseFonts`),lh={draw:e(async(e,n,r,i)=>{t.info(`Drawing usecase diagram (unified)`,n);let{layout:a}=d(),o=i.db,s=o.getData(),c=new Map(s.nodes.map(e=>[e.id,eh(e.label??e.id,e.labelType)])),l={nodes:new Map(s.nodes.map(e=>[e.id,e.isGroup?nh(e):th(e.shape===`note`?{...e,noteTargetLabel:c.get(e.noteTarget??``)}:e)])),edges:new Map(s.edges.map(e=>[e.id,rh({...e,sourceLabel:c.get(e.source)??e.sourceLabel,targetLabel:c.get(e.target)??e.targetLabel})]))},u=ie(n,s.config.securityLevel);s.layoutAlgorithm=re(a),oh(s,n),ch(u,s),await ne(s,u),sh(u,s,l);let f=s.diagramPadding;m.insertTitle(u,`usecaseDiagramTitleText`,0,o.getDiagramTitle?.()??``),ae(u,f,`usecaseDiagram`,s.useMaxWidth),ch(u,s)},`draw`)},uh=e(e=>({actorBkg:e.usecaseActorBkg??e.actorBkg??e.mainBkg,actorBorder:e.usecaseActorBorder??e.actorBorder??e.primaryColor,bkg:e.usecaseBkg??e.mainBkg,border:e.usecaseBorder??e.nodeBorder??e.primaryColor,boundaryBkg:e.usecaseBoundaryBkg??e.clusterBkg,boundaryBorder:e.usecaseBoundaryBorder??e.clusterBorder,includeLine:e.usecaseIncludeLine??e.lineColor,extendLine:e.usecaseExtendLine??e.lineColor}),`roleColors`),dh=e(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!ee(t,r))return``;let i=o().usecase?.colorScheme===`rotate`,a=te(e.look),s=a===`handDrawn`,c=_(n),l=``;for(let e=0;ei.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["app-Tooltip.js","app-rolldown-runtime.js","app-jsx-runtime.js","app-common.js","app-MermaidPreview.js","app-preload-helper.js","app-useTranslation.js","app-x.js","app-purify.es.js","app-chunk-Y2CYZVJY.js","app-src.js","app-chunk-O7XYJQB3.js","app-chunk-ZIGJFQKS.js","app-dist.js","app-chunk-6AEJRKK7.js","app-chunk-LNGE3PJU.js","app-chunk-7PRAP22T.js","app-chunk-742MDFTN.js","app-chunk-MBY4JIJT.js","app-chunk-7INBJB4K.js","app-chunk-J5ZVWO5B.js","app-rough.esm.js","app-chunk-5DYCD2WN.js","app-chunk-UA2S7LBM.js","app-chunk-Z7XXMR3K.js","app-line.js","app-path.js","app-array.js","app-chunk-GNY47TPC.js","app-chunk-DUW6YSOI.js","app-pdf.js","app-InteractiveTerminal.js","app-Dialog.js"])))=>i.map(i=>d[i]); import{i as e,n as t,t as n}from"./app-rolldown-runtime.js";import{n as r,t as i}from"./app-jsx-runtime.js";import{A as a,C as o,D as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,N as h,O as g,P as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as D,a as O,b as k,c as A,d as j,f as M,g as N,h as P,i as F,j as I,k as ee,l as L,m as R,o as te,p as z,q as B,r as ne,s as re,t as V,u as ie,v as ae,w as oe,x as se,y as ce,z as le}from"./app-Tooltip.js";import{C as H,_ as ue,a as de,b as fe,d as pe,g as me,h as he,i as ge,m as _e,n as ve,o as ye,r as be,s as xe,t as Se,u as Ce,v as we,y as Te}from"./app-Dialog.js";import{t as Ee}from"./app-preload-helper.js";import{a as U,i as De,n as Oe,r as ke,t as W}from"./app-useTranslation.js";import{n as Ae,r as G,t as je}from"./app-x.js";import{t as Me}from"./app-purify.es.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Ne=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Pe=n(((e,t)=>{t.exports=Ne()})),Fe=n((e=>{var t=Pe(),n=r(),i=E();function a(e){var t=`https://react.dev/errors/`+e;if(1R||(e.current=L[R],L[R]=null,R--)}function B(e,t){R++,L[R]=e.current,e.current=t}var ne=te(null),re=te(null),V=te(null),ie=te(null);function ae(e,t){switch(B(V,t),B(re,e),B(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}z(ne),B(ne,e)}function oe(){z(ne),z(re),z(V)}function se(e){e.memoizedState!==null&&B(ie,e);var t=ne.current,n=Jd(t,e.type);t!==n&&(B(re,e),B(ne,n))}function ce(e){re.current===e&&(z(ne),z(re)),ie.current===e&&(z(ie),ip._currentValue=ee)}var le,H;function ue(e){if(le===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);le=t&&t[1]||``,H=-1)`:-112e3){re(t(`fileAttachmentPromptTooLong`));return}l.content=m}if(u=h?await n(m,s.images,i,a,h):a?await n(m,s.images,i,a):i?await n(m,s.images.length>0||r?s.images:void 0,i):r||s.images.length>0?await n(m,s.images):await n(m),u){we(null),i===Oe.current&&(Oe.current=null);let e=o.clear(l.owner.key,l.revision);e&&c.current.key===l.owner.key&&(f.current=e,d(e),re(null))}}catch(e){c.current.key===l.owner.key&&re(e instanceof Error?e.message:t(`fileAttachmentReadFailed`))}finally{p&&c.current.key===l.owner.key&&!G.current&&B(!1),l.pending=!1;let e=o.read(l.owner.key);(u||!e.prompt&&e.images.length===0&&!e.files?.length)&&b.current.get(l.owner.key)===l&&b.current.delete(l.owner.key)}},at=async(n,r=!1)=>{if(n?.preventDefault(),!ze||e.sessionSwitching||e.modelSelectionPending||e.planSelectionPending||e.thinkingPendingLevel!==null||e.promptAdmissionPending||e.promptAdmissionRecovery||e.promptAdmissionResolution||v||!p.trim()&&m.length===0&&h.length===0||G.current)return;let i=We&&(r?!Ke:Ke);if(i&&Oe.current){ae(t(`steerStaleTurn`));return}let a=/^\/([^\s/]+)/u.exec(p.trim())?.[1],o=Je.commands.find(e=>e.name===a);if(o?.availability===`unsupported`){ae(`/${o.name}: ${t(`commandUnavailable_${o.unavailableReason??`not_integrated`}`)}`);return}if(o?.action){if(p.trim()!==`/${o.name}`||m.length>0||h.length>0){ae(t(`commandPanelArguments`));return}if(e.onCommandAction?.(o.action)!==!0){ae(t(`commandPanelUnavailable`));return}Fe({prompt:``,caret:0}),ae(null);return}ae(null),await it(e.actions.sendPrompt,!1,Oe.current??void 0,i&&Ue?{streamingBehavior:`steer`,expectedTurnCommandId:Ue.commandId}:void 0)},ot=()=>{if(!(!Ie||e.sessionSwitching||e.modelSelectionPending||e.thinkingPendingLevel!==null||v))return it(e.actions.sendPromptAsNew,!0)},st=e=>{if(e.availability!==`available`)return;let t=`/${e.name} `;Fe({prompt:t,caret:t.length})&&(ae(null),D(!0),queueMicrotask(()=>{c.current.key===y&&(Te.current?.focus(),Te.current?.setSelectionRange(t.length,t.length))}))},ct=e=>{if(!$e.length)return;let t=O;for(let n=0;n<$e.length;n++)if(t=(t+e+$e.length)%$e.length,$e[t]?.availability===`available`){k(t);return}},lt=e=>{let n=Me.current,r=f.current;if(!n||n.ownerKey!==y||n.ownerKey!==c.current.key||n.revision!==r.revision)return t(`fileReferenceDraftChanged`);let i=r.prompt.slice(0,n.start),a=r.prompt.slice(n.end),o=nk(e),s=i&&!/\s$/u.test(i)?` `:``,l=`${i}${s}${o}${a&&!/^\s/u.test(a)?` `:``}${a}`,u=i.length+s.length+o.length;if(!Fe({prompt:l,caret:u}))return t(`draftLimit`);je.current=!0},ut=()=>{let e=f.current,t=Te.current,n=Math.min(Math.max(t?.selectionStart??e.caret,0),e.prompt.length);Me.current={ownerKey:y,revision:e.revision,start:n,end:Math.min(Math.max(t?.selectionEnd??n,n),e.prompt.length)},j(!0)},dt=[...(e.snapshot?.workspaces??[]).map(t=>({id:t.path,label:t.name,icon:(0,q.jsx)(Vs,{}),endContent:t.path===e.selectedWorkspace?(0,q.jsx)(rs,{}):void 0,onClick:()=>e.actions.setWorkspace(t.path)})),{type:`divider`},{id:`add`,label:t(`addWorkspaceMenu`),icon:(0,q.jsx)(Ae,{}),onClick:()=>void e.actions.chooseWorkspace()}],ft=e.draftModel??e.snapshot?.models.find(e=>e.current),pt=e.snapshot?.workspaces.find(t=>t.path===e.selectedWorkspace)?.name??(e.selectedWorkspace?LD(e.selectedWorkspace):t(`selectWorkspace`)),mt=e.snapshot?.sessions.find(e=>e.path===i),ht=Ie?ID(mt??{},n?.id??t(`untitledSession`)):Le?t(`newSession`):n?ID(mt??{},n.id):t(`newSession`),gt=e.sessionSwitching?e.workspaceDraft?t(`promptTask`):t(`switchingSession`):e.selectedWorkspace?Ie&&e.snapshot?.runtime.planHasPrompt&&[`planning`,`ready`].includes(e.snapshot.runtime.plan??``)?t(`promptPlanMessage`):e.landing?t(`promptTask`):t(Re?`promptMessage`:`promptReadonly`):t(`promptStart`),_t=e.snapshot?.thinking,vt=_t?.level??null,yt=e.thinkingPendingLevel??null,bt=_t?.supported??!1,xt=!!e.selectedWorkspace&&!Ie&&(Le||!n),St=_t?!_t.available.includes(vt??``):!1,Ct=_t?!bt&&!xt?`thinkingUnsupportedHint`:!Ie&&!xt?`thinkingInactiveHint`:Ve?`thinkingLockedRunning`:e.modelSelectionPending?`thinkingModelPendingHint`:null:null,wt=e.snapshot?.selectedExecution,Tt=n&&wt&&wt.sessionId===n.id&&wt.sessionPath===n.path?wt.pendingFollowUps:void 0,Et=Tt??(Ie?e.pendingFollowUpsReceipt:null),Dt=n&&wt?.sessionId===n.id&&wt.sessionPath===n.path?wt.pendingSteering:void 0,Ot=Dt??(Ie?e.pendingSteeringReceipt:null),kt=Dt===void 0?[]:wt?.steeringMessages??[],At=!e.workspaceDraft&&!e.sessionSwitching&&kt.length>0,jt=Tt===void 0?[]:wt?.queuedMessages??[],Mt=new Map,Nt=jt.map(e=>{let t=Mt.get(e)??0;return Mt.set(e,t+1),{message:e,key:`${e}:${t}`}}),Pt=!e.workspaceDraft&&!e.sessionSwitching&&Tt!==void 0&&jt.length>0,Ft=Be?t(`compactionDraftHelp`):e.promptAdmissionPending&&!He?t(`promptPending`):e.modelSelectionPending?t(`thinkingModelPendingHint`):e.thinkingPendingLevel===null?e.workspaceDraft?t(`enterHint`):e.turnCancellationPending?t(`stoppingTurn`):e.turnTerminalStatus===`cancelled`?t(`stoppedTurn`):!At&&(Ot??0)>0?t(`pendingSteeringHint`,{count:Ot}):!Pt&&(Ie&&e.pendingFollowUpsReceipt!==null||(Et??0)>0)?(Et??0)>0?t(`pendingFollowUpsHint`,{count:Et??0}):t(`acceptedHint`):t(ze?Ve?Ke?`steeringHint`:`queuedHint`:`enterHint`:`activeOnlyHint`):t(`thinkingPendingHint`),It=ze&&(Be||e.promptAdmissionPending&&!He||e.modelSelectionPending||e.thinkingPendingLevel!==null||e.turnCancellationPending||e.turnTerminalStatus===`cancelled`||!Pt&&Ie&&e.pendingFollowUpsReceipt!==null||!Pt&&(Et??0)>0||!At&&(Ot??0)>0||Ve&&!!(p.trim()||m.length||h.length)),Lt=P===y,Rt=(e=!1)=>{N(null),e&&R.current?.focus()},zt=e=>()=>{N(null),e()},Bt=async r=>{if(!(!Ie||!n||Lt||e.sessionSwitching)){F(y),ae(null);try{if(r===`compact`)await L.compactSession(n.id,n.path);else if((await L.updatePromptQueue(n.id,n.path,r)).sessionId!==n.id)throw Error(t(`queueUpdateFailed`));!await e.actions.refreshSnapshot()&&r!==`compact`&&c.current.key===y&&ae(t(`queueStatusUnconfirmed`))}catch(e){c.current.key===y&&ae(r===`compact`?e instanceof Error?e.message:t(`commandPanelUnavailable`):t(`queueUpdateFailed`))}finally{F(e=>e===y?null:e)}}},Vt=M===`files`?[{id:`back`,section:t(`composerAdd`),label:t(`composerBack`),icon:(0,q.jsx)(Cs,{}),onClick:()=>N(`main`)},{id:`file-upload`,section:t(`composerAdd`),label:t(`addFiles`),description:t(`fileAttachmentDescription`),icon:(0,q.jsx)(Fs,{}),disabled:z||m.length+h.length>=8,onClick:zt(()=>{ke.current&&(ke.current.accept=``,ke.current.click())})},{id:`image`,section:t(`composerAdd`),label:t(`addImages`),description:t(`imageAttachmentDescription`),icon:(0,q.jsx)(Ks,{}),disabled:z||m.length>=8,onClick:zt(()=>{ke.current&&(ke.current.accept=`image/png,image/jpeg,image/gif,image/webp`,ke.current.click())})},{id:`workspace-file`,section:t(`composerAdd`),label:t(`fileReference`),icon:(0,q.jsx)(Fs,{}),onClick:zt(ut)}]:[{id:`file`,section:t(`composerAdd`),label:t(`composerFile`),alias:`file`,icon:(0,q.jsx)(Fs,{}),onClick:()=>N(`files`)},{id:`plan`,section:t(`composerAdd`),label:t(`composerPlan`),alias:`plan`,description:t(`composerPlanDescription`),icon:(0,q.jsx)($s,{}),disabled:!Ie||Ve||e.planSelectionPending||e.promptAdmissionPending,onClick:zt(()=>void e.actions.selectPlanMode(e.snapshot?.runtime.plan===`inactive`))},{id:`compact`,section:t(`composerCommands`),label:t(`composerCompact`),alias:`compact`,description:t(`composerCompactDescription`),icon:(0,q.jsx)(fc,{}),disabled:!Ie||Ve||Lt||e.promptAdmissionPending||(Et??0)>0,onClick:zt(()=>void Bt(`compact`))},{id:`model`,section:t(`composerCommands`),label:t(`composerModel`),alias:`model`,description:t(`composerModelDescription`),icon:(0,q.jsx)(ws,{}),disabled:!Ie&&!Le||Ve||e.modelSelectionPending,onClick:zt(()=>ee(e=>e+1))}];return(0,q.jsxs)(`div`,{className:`composer-dock`,children:[Ie&&e.snapshot?.runtime.plan===`ready`&&!e.sessionSwitching&&(0,q.jsx)(`div`,{className:`plan-mode-bar`,children:(0,q.jsx)(`button`,{type:`button`,disabled:Ve||z||!!G.current||e.planSelectionPending||e.promptAdmissionPending||!!e.promptAdmissionRecovery,onClick:()=>{if((p.trim()||m.length>0||h.length>0)&&!window.confirm(t(`planImplementationReplaceDraft`)))return;let n=f.current.revision,r=c.current.key;e.actions.preparePlanImplementation().then(e=>{!e||f.current.revision!==n||c.current.key!==r||Fe({prompt:e.prompt,images:[],caret:e.prompt.length},r)&&(Oe.current={sessionId:e.sessionId,sessionPath:e.sessionPath,planRevision:e.planRevision},re(null),Te.current?.focus())})},children:t(`planModeImplement`)})}),!Ie&&!e.workspaceDraft&&!e.sessionSwitching&&n&&r===n.path&&(0,q.jsxs)(`div`,{className:`composer-session-notice`,children:[(0,q.jsx)(`span`,{children:t(`activateViewedSessionHint`)}),(0,q.jsx)(`button`,{type:`button`,className:`secondary`,onClick:()=>void e.actions.selectSession(n.path),children:t(`activateViewedSession`)})]}),e.accessory,e.promptAdmissionRecovery&&(0,q.jsxs)(`section`,{className:`prompt-recovery`,role:`alert`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:t(`promptAdmissionUnknown`)}),(0,q.jsx)(`span`,{children:e.promptAdmissionRecovery.phase===`checking`?t(`promptAdmissionCheckingDetail`):e.promptAdmissionRecovery.phase===`verification-failed`?t(`promptAdmissionVerificationFailedDetail`):t(`promptAdmissionUnknownDetail`)})]}),(0,q.jsxs)(`div`,{className:`prompt-recovery-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:e.promptAdmissionRecovery.phase===`submitting`,onClick:e.actions.abandonPromptAdmission,children:t(`abandonAdmission`)}),e.promptAdmissionRecovery.phase===`verification-failed`&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>void e.actions.checkPromptAdmissionRecovery(),children:t(`retryAdmissionCheck`)}),e.promptAdmissionRecovery.retryable&&(0,q.jsx)(`button`,{type:`button`,disabled:!Ie||e.sessionSwitching||e.modelSelectionPending||e.thinkingPendingLevel!==null||e.promptAdmissionRecovery.phase!==`ready`,onClick:()=>void e.actions.retryPromptAdmission(),children:t(`retryOriginalAdmission`)}),(0,q.jsx)(`button`,{type:`button`,className:`primary`,disabled:z||!Ie||e.sessionSwitching||e.modelSelectionPending||e.thinkingPendingLevel!==null||v||e.promptAdmissionRecovery.phase!==`ready`||!p.trim()&&m.length===0&&h.length===0,onClick:()=>void ot(),children:e.promptAdmissionRecovery.phase===`submitting`?t(`sendingAsNew`):t(`sendAsNew`)})]})]}),(0,q.jsxs)(`div`,{className:`composer-status-strip`,children:[Ie&&(0,q.jsx)(YD,{snapshot:e.snapshot,observed:e.activityObserved,onInspectSubagent:e.onInspectSubagent,expanded:fe===`activity`,onExpandedChange:e=>ue(t=>e?{owner:y,panel:`activity`}:t?.panel===`activity`?null:t)}),(Pt||At)&&(0,q.jsxs)(`section`,{className:`composer-queue`,"data-state":wt?.promptQueueBlocked?`blocked`:`waiting`,"aria-label":Pt?t(`pendingFollowUpsHint`,{count:Tt}):t(`steeringMessagesTitle`),"aria-busy":Lt,children:[(0,q.jsxs)(`div`,{className:`composer-queue-status`,role:`status`,children:[(0,q.jsx)(vs,{"aria-hidden":`true`}),(0,q.jsxs)(`button`,{type:`button`,className:`composer-queue-toggle`,"aria-expanded":pe,"aria-controls":ye,"aria-label":Pt?t(`pendingFollowUpsHint`,{count:Tt}):t(`pendingSteeringHint`,{count:Ot}),onClick:()=>me(`queue`),children:[[Pt?t(`composerQueuedCount`,{count:Tt}):``,At?t(`composerSteeringCount`,{count:Ot}):``].filter(Boolean).join(` · `),(0,q.jsx)(is,{"aria-hidden":`true`})]}),Ie&&(0,q.jsxs)(`span`,{children:[wt?.promptQueueBlocked&&(0,q.jsx)(`button`,{type:`button`,disabled:Lt||Be,onClick:()=>void Bt(`retry`),children:t(`retryPrompt`)}),(0,q.jsx)(`button`,{type:`button`,disabled:Lt,onClick:()=>void Bt(`clear`),children:t(`clearPromptQueue`)})]})]}),(0,q.jsxs)(`div`,{id:ye,className:`composer-queue-details composer-status-details`,hidden:!pe,children:[(wt?.promptQueueBlocked||Be)&&(0,q.jsx)(`p`,{className:`composer-queue-help`,children:t(wt?.promptQueueBlocked?`compactionQueueBlocked`:`compactionQueueWaiting`)}),Pt&&(0,q.jsx)(`ul`,{children:Nt.map(({message:e,key:r})=>{let i=`${n?.id}\0${n?.path}\0${r}`,a=ce===i,o=e||t(`queuedImage`),s=t(a?`queuedMessageCollapse`:`queuedMessageExpand`);return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,className:`composer-queue-row ${a?`expanded`:``}`,"aria-expanded":a,"aria-label":`${s}: ${a?o:zD(o,80)}`,title:s,onClick:()=>le(a?null:i),children:[(0,q.jsx)(Cs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o})]})},r)})}),Tt!==void 0&&Tt>jt.length&&(0,q.jsx)(`small`,{children:t(`queuedMore`,{count:Tt-jt.length})}),At&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`composer-queue-help`,children:t(`pendingSteeringHint`,{count:Ot})}),(0,q.jsx)(`ul`,{children:kt.map((e,r)=>{let i=`${n?.id}\0${n?.path}\0steer:${r}:${e}`,a=ce===i,o=e||t(`queuedImage`),s=t(a?`queuedMessageCollapse`:`queuedMessageExpand`);return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,className:`composer-queue-row ${a?`expanded`:``}`,"aria-expanded":a,"aria-label":`${s}: ${a?o:zD(o,80)}`,title:s,onClick:()=>le(a?null:i),children:[(0,q.jsx)(Cs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o})]})},i)})}),(Ot??0)>kt.length&&(0,q.jsx)(`small`,{children:t(`queuedMore`,{count:(Ot??0)-kt.length})})]})]}),wt?.promptQueueBlocked&&!pe&&(0,q.jsx)(`p`,{className:`composer-queue-blocked`,role:`status`,children:t(`compactionQueueBlocked`)})]})]}),(0,q.jsxs)(`form`,{"data-editor-expanded":_e||void 0,className:`composer composer-m02 ${e.selectedWorkspace?``:`dormant`} ${oe?`is-dragging`:``}`,onSubmit:e=>void at(e),onDragEnter:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),tt&&se(!0))},onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),tt&&(e.dataTransfer.dropEffect=`copy`,se(!0)))},onDragLeave:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||se(!1)},onDrop:e=>{se(!1),e.dataTransfer.files.length!==0&&(e.preventDefault(),tt&&rt(e.dataTransfer.files))},children:[(0,q.jsx)(ik,{open:!!M,viewKey:M??void 0,items:Vt,onClose:Rt},`actions:${y}`),!e.selectedWorkspace&&(0,q.jsxs)(`div`,{className:`composer-dormant-cta`,"aria-hidden":`true`,children:[(0,q.jsx)(Vs,{}),(0,q.jsx)(`span`,{children:gt})]}),!e.selectedWorkspace&&!e.landing&&(0,q.jsx)(`button`,{className:`dormant-overlay`,type:`button`,"aria-label":t(`selectWorkspace`),onClick:()=>void e.actions.chooseWorkspace()}),(0,q.jsx)(`input`,{ref:ke,className:`sr-only`,type:`file`,multiple:!0,tabIndex:-1,"aria-hidden":`true`,onChange:e=>{e.currentTarget.files&&rt(e.currentTarget.files)}}),(0,q.jsxs)(`div`,{className:`composer-attachments`,ref:Ee,children:[(0,q.jsx)(dO,{ownerKey:y,images:m,onRemove:e=>{Fe({images:f.current.images.filter(t=>t.id!==e)})&&re(null)}}),(0,q.jsx)(fO,{ownerKey:y,files:h,onRemove:e=>{Fe({files:(f.current.files??[]).filter(t=>t.id!==e)})&&re(null)}})]}),ne&&(0,q.jsx)(`p`,{className:`composer-attachment-error`,role:`alert`,children:ne}),s.status===`failed`&&(0,q.jsxs)(`p`,{className:`composer-attachment-error`,role:`status`,children:[t(`draftStorageUnavailable`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:()=>{o.retryStorage().then(()=>{let e=o.read(c.current.key);f.current=e,S.current=!0,d(e)})},children:t(`draftStorageRetry`)})]}),s.invalid&&(0,q.jsx)(`p`,{className:`composer-attachment-error`,role:`status`,children:t(`draftStorageInvalid`)}),z&&(0,q.jsx)(`p`,{role:`status`,children:t(`imageAttachmentsLoading`)}),ie&&(0,q.jsx)(`p`,{className:`composer-attachment-error`,role:`alert`,children:ie}),v&&(0,q.jsx)(`p`,{id:`composer-prompt-length-error`,className:`composer-attachment-error`,role:`alert`,children:t(`promptTooLong`,{count:_,limit:12e3})}),oe&&(0,q.jsxs)(`div`,{className:`composer-drop-overlay`,"aria-hidden":`true`,children:[(0,q.jsx)(Ks,{}),(0,q.jsx)(`span`,{children:t(`dropImagesHere`)})]}),(0,q.jsxs)(`div`,{className:`composer-editor`,children:[(0,q.jsx)(`textarea`,{id:ve,ref:Te,value:p,rows:1,disabled:qe,readOnly:!e.selectedWorkspace,"aria-label":t(`describeTask`),"aria-invalid":v||void 0,"aria-describedby":v?`composer-prompt-length-error`:void 0,"aria-autocomplete":`list`,"aria-controls":et?$k:void 0,"aria-activedescendant":et&&$e[O]?eA(O):void 0,placeholder:gt,onChange:e=>{Fe({prompt:e.target.value,caret:e.target.selectionStart})&&(ae(null),D(!1))},onClick:e=>Fe({caret:e.currentTarget.selectionStart}),onSelect:e=>Fe({caret:e.currentTarget.selectionStart}),onFocus:()=>{T(!0),D(!1)},onBlur:()=>T(!1),onPaste:e=>{if(!tt)return;let t=Array.from(e.clipboardData.files);if(t.length===0)for(let n of Array.from(e.clipboardData.items??[])){let e=n.kind===`file`?n.getAsFile():null;e&&t.push(e)}t.length!==0&&(e.clipboardData.getData(`text/plain`)||e.preventDefault(),rt(t))},onKeyDown:e=>{if(!(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)){if(Xe){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),ct(e.key===`ArrowDown`?1:-1);return}if(e.key===`Escape`){e.preventDefault(),D(!0);return}if(e.key===`Tab`){let t=$e[O];!e.shiftKey&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&t?.availability===`available`&&(e.preventDefault(),st(t));return}if(e.key===`Enter`&&!e.shiftKey){let t=$e[O];if(t){e.preventDefault(),st(t);return}if($e.length>0){e.preventDefault();return}}}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),at(void 0,e.metaKey||e.ctrlKey))}}}),e.selectedWorkspace&&(0,q.jsx)(V,{content:t(_e?`collapseInput`:`expandInput`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,className:`composer-expand-button icon-button`,"aria-label":t(_e?`collapseInput`:`expandInput`),"aria-expanded":_e,"aria-controls":ve,disabled:qe,onPointerDown:e=>e.preventDefault(),onClick:()=>{let e=Te.current;if(e){be.current?.owner!==y&&(be.current={owner:y});let t=be.current;t[_e?`expanded`:`compact`]=e.scrollTop,xe.current={start:e.selectionStart,end:e.selectionEnd,direction:e.selectionDirection,scrollTop:t[_e?`compact`:`expanded`]??e.scrollTop}}ge(_e?null:y)},children:_e?(0,q.jsx)(fc,{"aria-hidden":`true`}):(0,q.jsx)(ac,{"aria-hidden":`true`})})})]}),(0,q.jsx)(rA,{open:Xe,activeIndex:O,commandDiscovery:Je,commands:$e,draft:!!e.workspaceDraft,preferBelow:e.landing,onComplete:st,onSelect:k},`commands:${y}`),(0,q.jsxs)(`div`,{className:`composer-toolbar`,children:[(0,q.jsxs)(`div`,{className:`composer-toolbar-context`,children:[tt&&(0,q.jsx)(V,{content:t(`addContext`),placement:`above`,children:(0,q.jsx)(`button`,{ref:R,type:`button`,className:`composer-context-trigger icon-button`,"aria-label":t(`addContext`),"aria-haspopup":`menu`,"aria-expanded":M!==null,"aria-controls":M?`composer-action-menu`:void 0,onClick:()=>{D(!0),N(M?null:`main`)},children:(0,q.jsx)(Ae,{})})}),e.landing?(0,q.jsx)(yo,{className:`workspace-picker-menu`,button:{label:e.selectedWorkspace?LD(e.selectedWorkspace):t(`selectWorkspace`),icon:(0,q.jsx)(Vs,{}),size:`sm`,variant:`ghost`,className:`workspace-picker`},items:dt,menuWidth:240,placement:`above`,alignment:`start`,hasChevron:!0}):(0,q.jsxs)(`span`,{className:`composer-workspace-label`,title:`${pt} / ${ht}`,children:[(0,q.jsx)(Vs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:pt})]}),Ie&&e.snapshot?.runtime.plan&&e.snapshot.runtime.plan!==`inactive`&&(0,q.jsx)(`span`,{className:`composer-plan-chip`,children:t(`planMode_${e.snapshot.runtime.plan}`)})]}),(0,q.jsxs)(`div`,{className:`composer-toolbar-controls`,children:[We&&(0,q.jsx)(yo,{button:{className:`composer-delivery-trigger`,label:t(Ke?`steerCurrentTurn`:`sendNextTurn`),children:(0,q.jsx)(`span`,{className:`composer-delivery-label`,children:t(Ke?`steerCurrentTurn`:`sendNextTurn`)}),"aria-label":t(Ke?`steerCurrentTurn`:`sendNextTurn`),tooltip:t(Ke?`steerCurrentTurn`:`sendNextTurn`),icon:Ke?(0,q.jsx)(Bc,{"aria-hidden":`true`}):(0,q.jsx)(Cs,{"aria-hidden":`true`}),variant:`ghost`,size:`sm`,isDisabled:e.promptAdmissionPending||!!e.promptAdmissionRecovery},items:[{id:`followUp`,label:t(`sendNextTurn`),onClick:()=>{Ue&&(we({ownerKey:y,expectedTurnCommandId:Ue.commandId,mode:`followUp`}),ae(null))}},{id:`steer`,label:t(`steerCurrentTurn`),isDisabled:!We,onClick:()=>{!We||!Ue||(we({ownerKey:y,expectedTurnCommandId:Ue.commandId,mode:`steer`}),ae(null))}}],placement:`above`,alignment:`end`,hasChevron:!0}),(0,q.jsx)(`div`,{className:`model-picker-wrap`,hidden:!!(n&&!Ie&&!e.workspaceDraft),title:Ct?t(Ct):void 0,"data-level":vt??`none`,"data-pending":yt!==null,"data-warning":St,children:(0,q.jsx)(Qk,{snapshot:e.snapshot,openRequest:I,currentModel:ft,draftModel:e.draftModel,modelSearch:C,modelSelectionPending:!!e.modelSelectionPending,promptAdmissionPending:e.promptAdmissionPending,sessionSwitching:e.sessionSwitching,liveRunning:Ve,workspaceDraft:!!e.workspaceDraft,thinkingPendingLevel:yt,thinkingNeedsSession:xt,thinkingDisabledReason:Ct,onOpenProviders:e.onOpenProviders,actions:e.actions})}),He&&(0,q.jsx)(V,{content:t(`stopTurn`),placement:`above`,children:(0,q.jsx)(`button`,{className:`send-button stop-button`,type:`button`,"aria-label":t(`stopTurn`),disabled:e.turnCancellationPending||e.sessionSwitching,onClick:()=>void e.actions.cancelActiveTurn(),children:(0,q.jsx)(Rc,{"aria-hidden":`true`})})}),(!He||!!(p.trim()||m.length||h.length))&&(0,q.jsx)(V,{content:t(Be?`compactionDraftHelp`:`send`),placement:`above`,children:(0,q.jsx)(`button`,{className:`send-button`,type:`submit`,"aria-label":t(`send`),disabled:z||e.sessionSwitching||e.modelSelectionPending||e.thinkingPendingLevel!==null||!ze||!e.selectedWorkspace||e.promptAdmissionPending||v||e.planSelectionPending||!!e.promptAdmissionRecovery||!!e.promptAdmissionResolution||!p.trim()&&m.length===0&&h.length===0,children:e.sessionSwitching&&e.workspaceDraft?(0,q.jsx)(rc,{className:`send-spinner`}):(0,q.jsx)(Xo,{})})})]})]}),(0,q.jsx)(`div`,{className:`composer-hint`,"data-visible":It,"aria-live":`polite`,children:ze?Ft:null})]}),(0,q.jsx)(tk,{open:A,sessionId:Ie?n?.id:void 0,onClose:()=>j(!1),onInsert:lt})]})}function sA({target:e,onClose:t,onOpenProviders:n}){let{t:r}=W(),i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(0),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)(null),p=e=>{f(null),td(e).then(e=>f(e?`copied`:`failed`))};(0,K.useEffect)(()=>{let t=new AbortController;return c(null),u(null),f(null),(async()=>{let n={errors:[]},[a,o]=await Promise.allSettled([i.thinking(e.sessionId,t.signal),i.trust(e.sessionId,t.signal)]);a.status===`fulfilled`&&a.value.sessionId===e.sessionId?n.thinking=a.value:n.errors.push(r(`thinkingUnavailable`)),o.status===`fulfilled`&&(o.value.workspace===void 0||o.value.workspace===e.cwd)?n.trust=o.value:n.errors.push(r(`trustUnavailable`)),!t.signal.aborted&&(c(n),u(new Date().toLocaleTimeString()))})(),()=>t.abort()},[i,e,a,r]);let m=r(`runtimeStatus`);return(0,q.jsx)(Se,{isOpen:!0,onOpenChange:e=>!e&&t(),width:640,"aria-label":m,children:(0,q.jsxs)(`section`,{className:`inspection-panel`,children:[(0,q.jsxs)(`header`,{className:`inspection-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:m}),(0,q.jsx)(`p`,{className:`inspection-subtitle`,children:e.cwd})]}),(0,q.jsxs)(`div`,{className:`inspection-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":r(`refreshStatus`),disabled:!s,onClick:()=>o(e=>e+1),children:(0,q.jsx)(me,{})}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":r(`close`),onClick:t,children:(0,q.jsx)(je,{})})]})]}),d&&(0,q.jsx)(`p`,{role:`status`,children:r(d===`copied`?`copiedMessage`:`copyFailed`)}),s?(0,q.jsxs)(q.Fragment,{children:[s.errors.map(e=>(0,q.jsx)(`p`,{className:`inspection-warning`,role:`alert`,children:e},e)),(0,q.jsxs)(`section`,{className:`inspection-section`,children:[(0,q.jsx)(`h3`,{children:r(`modelAndThinking`)}),(0,q.jsxs)(`dl`,{children:[(0,q.jsx)(`dt`,{children:r(`selectedModel`)}),(0,q.jsx)(`dd`,{children:e.model||r(`noModels`)}),(0,q.jsx)(`dt`,{children:r(`thinkingLevel`)}),(0,q.jsx)(`dd`,{children:s.thinking?.supported===!1?r(`thinkingUnsupported`):s.thinking?.level??r(`unknownState`)}),!!s.thinking?.available.length&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`dt`,{children:r(`availableThinking`)}),(0,q.jsx)(`dd`,{children:s.thinking?.available.join(` · `)})]})]}),s.thinking?.supported===!1&&(0,q.jsx)(`p`,{className:`inspection-note`,children:r(`thinkingUnsupportedHint`)}),s.thinking&&s.thinking.supported!==!1&&!s.thinking.available.includes(s.thinking.level)&&(0,q.jsx)(`p`,{className:`inspection-warning`,role:`status`,children:r(`thinkingLevelMismatch`)})]}),(0,q.jsxs)(`section`,{className:`inspection-section`,children:[(0,q.jsx)(`h3`,{children:r(`projectTrust`)}),(0,q.jsx)(`p`,{children:r(`trust_${s.trust?.state??`unknown`}`)}),(0,q.jsxs)(`dl`,{children:[(0,q.jsx)(`dt`,{children:r(`savedTrustDecision`)}),(0,q.jsx)(`dd`,{children:r(`trustDecision_${s.trust?.decision??`unknown`}`)}),(0,q.jsx)(`dt`,{children:r(`activeSessionTrust`)}),(0,q.jsx)(`dd`,{children:s.trust?.sessionTrusted===!0?r(`trustActiveYes`):s.trust?.sessionTrusted===!1?r(`trustActiveNo`):r(`unknownState`)})]}),s.trust?.refreshRequired===!0&&(0,q.jsx)(`p`,{className:`inspection-warning`,children:r(`trustRefreshNeeded`)})]}),n&&(0,q.jsxs)(`button`,{type:`button`,className:`inspection-provider-link`,"aria-label":r(`openProviderSettings`),onClick:n,children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:r(`providerAvailability`)}),(0,q.jsx)(`small`,{children:r(`authNotVerified`)})]}),r(`openProviderSettings`)]}),(0,q.jsxs)(`div`,{className:`inspection-setup`,children:[(0,q.jsx)(`p`,{className:`inspection-note`,children:r(`configurationViaPi`)}),(0,q.jsx)(`code`,{children:`/openpi-setup`}),(0,q.jsx)(`button`,{type:`button`,className:`inspection-copy`,"aria-label":r(`copySetupCommand`),title:r(`copySetupCommand`),onClick:()=>p(`/openpi-setup`),children:(0,q.jsx)(_s,{"aria-hidden":`true`})})]}),(0,q.jsx)(`p`,{className:`inspection-updated`,children:r(`statusCaptured`,{time:l})})]}):(0,q.jsx)(`p`,{role:`status`,children:r(`inspectionLoading`)})]})})}var cA=32,lA=1048576;function uA(e){return e.drafts.reduce((e,t)=>e+sd(t.custom)+Object.values(t.notes).reduce((e,t)=>e+sd(t),0),0)}function dA(e,t,n){if(!(n.submission||n.drafts.some(e=>e.choice!==null||e.custom||Object.values(e.notes).some(Boolean))))return e.delete(t),!0;let r=e.get(t);if(!r&&e.size>=cA)return!1;let i=r?uA(r):0,a=uA(n),o=Array.from(e.values()).reduce((e,t)=>e+uA(t),0);return a>i&&o-i+a>lA?!1:(e.set(t,n),!0)}function fA(e,t,n,r){for(let[i,a]of e)a.sessionId===t&&a.sessionPath===n&&a.requestId!==r&&e.delete(i)}function pA({request:e,answer:t,onSettled:n,connected:r=!0,sessionPath:i=``,workingCache:a}){let{t:o}=W(),s=(0,K.useId)(),c=(0,K.useMemo)(()=>new Map,[]),l=a??c,u=JSON.stringify([e.sessionId,i,e.requestId]),[d,f]=(0,K.useState)(()=>l.get(u)??{sessionId:e.sessionId,sessionPath:i,requestId:e.requestId,drafts:e.questions.map(()=>({choice:null,custom:``,notes:{}})),index:0,review:!1,submission:null}),p=(0,K.useRef)(d),{drafts:m,index:h,review:g,submission:_}=d,[v,y]=(0,K.useState)(!!d.submission),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(!1),w=(0,K.useRef)(!1),T=!!_,E=(0,K.useRef)(null),D=(0,K.useRef)(null),O=e.questions[h],k=m[h],A=S||T||!r,j=m.some(e=>e.choice===`custom`?!cd(e.custom):typeof e.choice==`number`&&!cd(e.notes[e.choice]??``)),M=m.every(e=>e.choice!==null)&&!j,N=(t,n)=>e.handoff?o(n===0?`handoffDone`:`handoffUnable`):t;(0,K.useEffect)(()=>()=>E.current?.abort(),[]);let P=e=>dA(l,u,e)?(p.current=e,f(e),x(!1),!0):(x(!0),!1),F=(e,t=!1)=>{P({...p.current,index:e,review:t}),requestAnimationFrame(()=>D.current?.focus())},I=e=>{let t=p.current;P({...t,drafts:t.drafts.map((n,r)=>r===t.index?{...n,...e}:n)})},ee=()=>e.questions.map((e,t)=>{let n=m[t];if(n.choice===`custom`)return n.custom.trim()?{id:e.id,custom:n.custom}:{id:e.id,rephrase:!0};let r=typeof n.choice==`number`?e.options[n.choice]?.label:void 0;return{id:e.id,selected:r,...typeof n.choice==`number`&&n.notes[n.choice]?.trim()?{note:n.notes[n.choice]}:{}}}),L=async(i=!1)=>{if(w.current||!r||!i&&!T&&!M)return;let a=p.current.submission??{answers:i?null:ee()};if(!P({...p.current,submission:a}))return;w.current=!0,C(!0),y(!1);let o=new AbortController;E.current=o;try{let r=await t(e,a.answers,o.signal);o.signal.aborted||(l.delete(u),n(r))}catch{o.signal.aborted||y(!0)}finally{o.signal.aborted||(w.current=!1,C(!1))}};return(0,q.jsxs)(`section`,{className:`question-card`,"aria-labelledby":`${s}-title`,"aria-busy":S,children:[(0,q.jsxs)(`header`,{className:`question-card-header`,children:[(0,q.jsxs)(`span`,{className:`question-status`,children:[(0,q.jsx)(lc,{"aria-hidden":`true`}),o(e.handoff?`handoffWaiting`:`questionWaiting`)]}),(0,q.jsx)(`span`,{className:`question-count`,children:g?o(e.handoff?`handoffReview`:`questionReview`):o(`questionProgress`,{current:h+1,total:e.questions.length})}),(0,q.jsx)(`button`,{type:`button`,className:`question-icon`,"aria-label":o(`questionDismiss`),title:o(`questionDismiss`),disabled:A,onClick:()=>void L(!0),children:(0,q.jsx)(je,{})})]}),(0,q.jsxs)(`div`,{className:`question-card-body`,children:[(0,q.jsx)(`h2`,{id:`${s}-title`,ref:D,tabIndex:-1,children:g?o(`questionReviewTitle`):O.question}),e.handoff&&(0,q.jsxs)(`div`,{className:`handoff-instructions`,children:[(0,q.jsx)(`p`,{children:e.handoff.instructions}),(0,q.jsxs)(`p`,{className:`question-help`,children:[o(`handoffSignal`),` `,e.handoff.completionSignal]}),(0,q.jsx)(`p`,{className:`question-help`,children:o(`handoffVerify`)})]}),g?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`question-help`,children:o(`questionReviewHelp`)}),(0,q.jsx)(`ol`,{className:`question-review-list`,children:e.questions.map((e,t)=>{let n=m[t];return(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`question-review-label`,children:e.header}),(0,q.jsx)(`p`,{children:typeof n.choice==`number`?N(e.options[n.choice]?.label,n.choice):n.custom.trim()||o(`questionRephrase`)}),typeof n.choice==`number`&&n.notes[n.choice]?.trim()&&(0,q.jsx)(`p`,{className:`question-help`,children:n.notes[n.choice]})]}),(0,q.jsx)(`button`,{type:`button`,className:`question-icon`,"aria-label":o(`questionEdit`,{question:e.header}),disabled:A,onClick:()=>F(t),children:(0,q.jsx)(yc,{})})]},e.id)})})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`fieldset`,{disabled:A,className:`question-choices`,children:[(0,q.jsx)(`legend`,{className:`sr-only`,children:O.header}),O.options.map((t,n)=>(0,q.jsxs)(`label`,{className:`question-choice ${k.choice===n?`is-selected`:``}`,children:[(0,q.jsx)(`input`,{className:`question-radio`,type:`radio`,name:`${s}-${O.id}`,checked:k.choice===n,onChange:()=>I({choice:n})}),(0,q.jsx)(`span`,{className:`question-choice-number`,"aria-hidden":`true`,children:k.choice===n?(0,q.jsx)(rs,{"aria-hidden":`true`}):n+1}),(0,q.jsxs)(`span`,{className:`question-choice-copy`,children:[(0,q.jsx)(`strong`,{children:N(t.label,n)}),(0,q.jsx)(`span`,{children:e.handoff?o(n===0?`handoffDoneHelp`:`handoffUnableHelp`):t.description})]})]},t.label))]}),typeof k.choice==`number`&&(0,q.jsxs)(`div`,{className:`question-extras`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`question-note-toggle`,disabled:A,"aria-expanded":!!k.notesExpanded,"aria-controls":k.notesExpanded?`${s}-notes`:void 0,onClick:()=>I({notesExpanded:!k.notesExpanded}),children:[(0,q.jsx)(yc,{"aria-hidden":`true`}),o(`questionNotes`)]}),typeof k.choice==`number`&&O.options[k.choice]?.preview&&(0,q.jsxs)(`details`,{className:`question-preview-disclosure`,children:[(0,q.jsx)(`summary`,{children:o(`questionPreview`)}),(0,q.jsx)(`pre`,{className:`question-preview`,children:O.options[k.choice].preview})]},`${O.id}-${k.choice}`)]}),(k.choice===`custom`||typeof k.choice==`number`&&k.notesExpanded)&&(0,q.jsxs)(`label`,{className:`question-notes`,id:`${s}-notes`,children:[(0,q.jsx)(`span`,{className:`sr-only`,id:`${s}-answer-label`,children:k.choice===`custom`?o(`questionYourAnswer`):o(`questionNotes`)}),(0,q.jsx)(`textarea`,{rows:1,disabled:A,value:k.choice===`custom`?k.custom:k.notes[k.choice]??``,onChange:e=>k.choice===`custom`?I({custom:e.target.value}):typeof k.choice==`number`&&I({notes:{...k.notes,[k.choice]:e.target.value}}),"aria-invalid":j,"aria-labelledby":`${s}-answer-label`,"aria-describedby":[j?`${s}-limit`:``,k.choice===`custom`?`${s}-custom-help`:``].filter(Boolean).join(` `)||void 0,placeholder:k.choice===`custom`?o(`questionCustomPlaceholder`):o(`questionNotesPlaceholder`)}),k.choice===`custom`&&(0,q.jsx)(`span`,{className:`question-help`,id:`${s}-custom-help`,children:o(`questionCustomHelp`)})]})]}),j&&(0,q.jsx)(`p`,{className:`question-error`,id:`${s}-limit`,role:`alert`,children:o(`questionLimit`,{count:8e3})}),b&&(0,q.jsx)(`p`,{className:`question-error`,role:`alert`,children:o(`questionDraftLimit`)}),!r&&(0,q.jsx)(`p`,{className:`question-help`,role:`status`,children:o(`questionDisconnected`)}),v&&(0,q.jsx)(`p`,{className:`question-error`,role:`alert`,children:o(`questionUncertain`)})]},`${h}:${g}`),(0,q.jsxs)(`footer`,{className:`question-card-footer`,children:[!g&&!e.handoff&&(0,q.jsxs)(`label`,{className:`question-custom ${k.choice===`custom`?`is-selected`:``} ${A?`is-disabled`:``}`,children:[(0,q.jsx)(`input`,{className:`question-radio`,type:`radio`,name:`${s}-${O.id}`,checked:k.choice===`custom`,disabled:A,onChange:()=>I({choice:`custom`})}),(0,q.jsx)(`span`,{className:`question-choice-number`,"aria-hidden":`true`,children:(0,q.jsx)(yc,{})}),(0,q.jsx)(`span`,{children:o(`questionCustom`)})]}),(0,q.jsxs)(`div`,{className:`question-actions`,children:[(g||h>0)&&(0,q.jsxs)(`button`,{type:`button`,className:`question-secondary`,disabled:A||!g&&h===0,onClick:()=>F(g?e.questions.length-1:h-1),children:[(0,q.jsx)(Ko,{}),o(`questionBack`)]}),!T&&(0,q.jsx)(`button`,{type:`button`,className:`question-secondary question-skip`,disabled:A,title:o(`questionDismiss`),onClick:()=>void L(!0),children:o(`questionSkip`)}),T?(0,q.jsxs)(`button`,{type:`button`,className:`question-primary`,disabled:S||!r,onClick:()=>void L(),children:[(0,q.jsx)(he,{}),o(S?`questionSubmitting`:`questionRetry`)]}):g?(0,q.jsxs)(`button`,{type:`button`,className:`question-primary`,disabled:A||!M,onClick:()=>void L(),children:[(0,q.jsx)(rs,{}),o(e.handoff?`handoffSubmit`:`questionSubmit`)]}):(0,q.jsxs)(`button`,{type:`button`,className:`question-primary`,disabled:A||k.choice===null||j,onClick:()=>F(hnew de,[]),s=(0,K.useMemo)(()=>new Map,[]),c=i??s,[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(0),_=(0,K.useRef)(null),v=(0,K.useRef)(null);return(0,K.useEffect)(()=>{let t=new AbortController;return o.pendingQuestions(e,t.signal).then(({pending:n})=>{if(t.signal.aborted)return;let i=n?.requestId===_.current?null:n;v.current=i?.requestId??null,m(!1),fA(c,e,r,n?.requestId),u(i),n&&n.requestId!==_.current&&f(null)},()=>{t.signal.aborted||m(!0)}),()=>t.abort()},[o,e,r,c,t,h]),!l&&!d&&!p?null:(0,q.jsx)(`div`,{className:`question-panel`,children:l?(0,q.jsx)(pA,{request:l,connected:n,sessionPath:r,workingCache:c,answer:(e,t,n)=>o.answerQuestions(e,t,n),onSettled:e=>{v.current===l.requestId&&(v.current=null,_.current=l.requestId,u(null),f(e.state===`answered`?null:e),g(e=>e+1))}},l.requestId):d?(0,q.jsxs)(`div`,{className:`question-receipt`,role:`status`,children:[(0,q.jsx)(rs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:a(`questionState_${d.state}`)}),(0,q.jsx)(`button`,{type:`button`,className:`question-icon`,"aria-label":a(`questionCloseReceipt`),onClick:()=>f(null),children:(0,q.jsx)(je,{})})]}):(0,q.jsxs)(`div`,{className:`question-receipt`,role:`alert`,children:[(0,q.jsx)(`span`,{children:a(`questionLoadFailed`)}),(0,q.jsx)(`button`,{type:`button`,className:`question-secondary`,onClick:()=>g(e=>e+1),children:a(`questionRetryLoad`)})]})})}function hA(e,t,{active:n=!0,running:r=!1,initialSource:i=`unstaged`,initialBaseRef:a}={}){let{t:o}=W(),s=(0,K.useMemo)(()=>new de,[]),c=(0,K.useRef)(null),l=(0,K.useRef)(null),u=(0,K.useRef)(!1),d=(0,K.useRef)({active:n,running:r});d.current={active:n,running:r};let[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)(null),v=e?.id,y=e?.path,[b,x]=(0,K.useState)({sessionId:v,sessionPath:y,source:i,baseRef:a}),S=b.sessionId===v&&b.sessionPath===y?b.source:i,C=b.sessionId===v&&b.sessionPath===y?b.baseRef:a,w=(0,K.useCallback)(e=>{x({sessionId:v,sessionPath:y,source:e,baseRef:C})},[v,y,C]),T=(0,K.useCallback)(e=>{x({sessionId:v,sessionPath:y,source:`branch`,baseRef:e})},[v,y]);(0,K.useLayoutEffect)(()=>{p(null),_(null),h(!!v)},[v,y,S,C]);let E=(0,K.useCallback)((e,t)=>{if(!(e.signal.aborted||c.current!==e)&&(c.current=null,h(!1),u.current)){u.current=!1;let e=d.current;(e.active||!e.running)&&l.current===null&&(l.current=window.setTimeout(()=>{l.current=null,t()},e.active?200:2e3))}},[]),D=(0,K.useCallback)(async()=>{if(!v||!y||document.visibilityState===`hidden`)return;if(c.current){u.current=!0;return}let e=new AbortController;c.current=e,h(!0),_(null);try{let t=await s.gitReview(v,y,e.signal,{source:S,offset:`0`,...S===`branch`&&C?{baseRef:C}:{}});e.signal.aborted||(t.ok||_(o(t.reason===`not_git_repository`?`gitReviewNotRepository`:t.reason===`baseline_unavailable`?`gitReviewBaselineUnavailable`:t.reason===`base_branch_unavailable`?`gitReviewBaseUnavailable`:t.reason===`invalid_base_branch`?`gitReviewBaseInvalid`:`gitReviewFailed`)),p(e=>!t.ok&&e?.ok?t.branches?{...e,branches:t.branches}:e:t.ok&&e?.ok&&t.snapshot.revision===e.snapshot.revision?JSON.stringify(t.branches)===JSON.stringify(e.branches)?e:{...e,branches:t.branches}:t))}catch(t){e.signal.aborted||_(t instanceof Error?t.message:`Git review unavailable`)}finally{E(e,D)}},[s,v,y,S,C,o,E]),O=(0,K.useCallback)(async()=>{if(!v||!y||!f?.ok||f.snapshot.nextOffset===void 0||c.current)return;let e=f.snapshot,t=new AbortController;c.current=t,h(!0),_(null);try{let n=await s.gitReview(v,y,t.signal,{source:S,offset:String(e.nextOffset),revision:e.revision,...S===`branch`&&C?{baseRef:C}:{}});if(t.signal.aborted)return;if(!n.ok||n.snapshot.revision!==e.revision)throw Error(o(!n.ok&&n.reason===`revision_changed`?`gitReviewChanged`:`gitReviewFailed`));p({...n,snapshot:{...n.snapshot,files:[...e.files,...n.snapshot.files],additions:e.additions+n.snapshot.additions,deletions:e.deletions+n.snapshot.deletions}})}catch(e){t.signal.aborted||_(e instanceof Error?e.message:o(`gitReviewFailed`))}finally{E(t,D)}},[s,v,y,S,C,f,o,E,D]),k=(0,K.useCallback)(async(e,t,n)=>{if(!v||!y)return;let r=await s.gitReview(v,y,t,{source:S,file:e,revision:n,...S===`branch`&&C?{baseRef:C}:{}});if(!r.ok||r.summaryRevision!==n)throw(r.ok||r.reason===`revision_changed`)&&!t.aborted&&D(),Error(o(!r.ok&&r.reason!==`revision_changed`?`gitReviewFailed`:`gitReviewChanged`));return r.snapshot.files.find(t=>t.path===e)},[s,v,y,S,C,D,o]);return(0,K.useEffect)(()=>{if(v)return l.current=window.setTimeout(()=>{l.current=null,D()},200),()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null,u.current=!1,c.current?.abort(),c.current=null}},[D,v]),(0,K.useEffect)(()=>{n&&l.current!==null&&(window.clearTimeout(l.current),l.current=null)},[n]),(0,K.useEffect)(()=>{if(!n&&r){l.current!==null&&window.clearTimeout(l.current),l.current=null,u.current=!1;return}!v||l.current!==null||(l.current=window.setTimeout(()=>{l.current=null,D()},n?200:2e3))},[D,t,n,r,v]),(0,K.useEffect)(()=>{if(!v)return;let e=()=>{let e=d.current;(e.active||!e.running)&&D()};return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,e)}},[D,v]),(0,K.useMemo)(()=>({result:f,loading:m,error:g,refresh:D,source:S,setSource:w,baseRef:C,setBaseRef:T,readFile:k,loadMore:O}),[f,m,g,D,S,w,C,T,k,O])}function gA({notice:e,actions:t}){let{t:n}=W(),r=(0,K.useRef)(!1),[i,a]=(0,K.useState)(null),[o,s]=(0,K.useState)(!1),c=()=>t.dismissArchiveNotice(e.key),l=async n=>{if(!r.current){r.current=!0,a(n),s(!1);try{(n===`undo`?await t.unarchiveSession(e.path):await t.selectSession(e.path,e.sessionId))===!1?s(!0):c()}catch{s(!0)}finally{r.current=!1,a(null)}}};return(0,q.jsx)(`div`,{className:`archive-notification`,"data-session-path":e.path,children:(0,q.jsx)(Gu,{type:`info`,body:n(`archiveNoticeTitle`),isAutoHide:!i&&!o,autoHideDuration:8e3,onDismiss:c,renderContent:()=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Go,{className:`archive-notification-icon`,"aria-hidden":`true`}),(0,q.jsxs)(`div`,{className:`archive-notification-copy`,children:[(0,q.jsx)(`strong`,{children:n(`archiveNoticeTitle`)}),(0,q.jsx)(`span`,{title:e.title,children:e.title}),o&&(0,q.jsx)(`span`,{className:`archive-notification-error`,role:`alert`,children:n(`archiveNoticeFailed`)})]}),(0,q.jsx)(`button`,{type:`button`,disabled:i!==null,onClick:()=>void l(`view`),children:n(`archiveNoticeView`)}),(0,q.jsxs)(`button`,{type:`button`,className:`archive-notification-undo`,disabled:i!==null,onClick:()=>void l(`undo`),children:[i===`undo`&&(0,q.jsx)(rc,{className:`archive-notification-spinner`,"aria-hidden":`true`}),n(`archiveNoticeUndo`)]}),(0,q.jsx)(`button`,{type:`button`,className:`archive-notification-close`,"aria-label":n(`close`),onClick:c,children:(0,q.jsx)(je,{"aria-hidden":`true`})})]})})})}function _A({notices:e,actions:t}){return e.length?(0,q.jsx)(`div`,{className:`archive-notifications`,children:e.map(e=>(0,q.jsx)(gA,{notice:e,actions:t},e.key))}):null}function vA(e){let t=e?.closest(`.session-row, .workspace-group`),n=e?.closest(`.session-sidebar`),r=t?.dataset.sessionKey,i=Array.from(n?.querySelectorAll(`.session, .workspace-label, .workspace-heading-label`)??[]),a=i.findIndex(e=>t?.contains(e)),o=a<0?i:[...i.slice(a+1),...i.slice(0,a).reverse()];return()=>requestAnimationFrame(()=>{!n?.isConnected||document.querySelector(`dialog[open]`)||[e,r==null?null:Array.from(n.querySelectorAll(`.session-row`)).find(e=>e.dataset.sessionKey===r)?.querySelector(`.menu-action-button`),...o,n.querySelector(`.new-session-button`)].find(e=>e?.isConnected&&!e.closest(`[hidden], [inert]`)&&e.checkVisibility?.()!==!1)?.focus({preventScroll:!0})})}function yA({session:e,archived:t,connected:n,pinSaving:r,restoring:i,movementItems:a,client:o,actions:s,onRename:c,onPin:l,onRead:u,onArchive:d,onNotice:f}){let{t:p}=W(),m=(0,K.useRef)(null),h=(0,K.useRef)(!0),g=(0,K.useRef)(0),_=(0,K.useRef)(!1),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(null),[S,C]=(0,K.useState)(!1),[w,T]=(0,K.useState)(!1),[E,D]=(0,K.useState)(null),[O,k]=(0,K.useState)(!1),[A,j]=(0,K.useState)(null),[M,N]=(0,K.useState)(!1),[P,F]=(0,K.useState)(!1),I=e.execution?.status===`running`||e.execution?.waitingForInput,ee=(e.execution?.pendingFollowUps??0)+(e.execution?.pendingSteering??0)>0,L=n?I||ee?p(`sidebarActionRunning`):void 0:p(`sidebarActionDisconnected`),R=t?p(`sidebarForkArchived`):n?E?.local===!1?p(`sidebarForkUnavailable`):void 0:p(`sidebarActionDisconnected`),te=A!==null&&(A.path!==e.path||A.id!==e.id),z=e.pinOrder!==void 0,B=()=>vA(m.current?.querySelector(`button`)??null),ne=()=>{let t=new URL(`/`,window.location.origin);return t.searchParams.set(`sessionPath`,e.path),t.searchParams.set(`sessionId`,e.id),t.href};(0,K.useEffect)(()=>(h.current=!0,()=>{h.current=!1,g.current++}),[]);let re=(0,K.useRef)({id:e.id,path:e.path});(0,K.useEffect)(()=>{(re.current.id!==e.id||re.current.path!==e.path)&&(re.current={id:e.id,path:e.path},y(!1),x(null),D(null))},[e.id,e.path]),(0,K.useEffect)(()=>{if(!v||!e.cwd||!n)return;let t=++g.current;return x(null),C(!1),o.sessionOpenTargets(e.path,e.id).then(e=>{h.current&&g.current===t&&x(e.targets)}).catch(()=>{h.current&&g.current===t&&C(!0)}),()=>{g.current++}},[o,n,v,e.cwd,e.id,e.path]),(0,K.useEffect)(()=>{if(!v||t||!n)return;let r=!1;return D(null),k(!1),Promise.resolve().then(()=>o.sessionForkOptions(e.path,e.id)).then(e=>{r||D(e)}).catch(()=>{r||k(!0)}),()=>{r=!0}},[t,o,n,v,e.id,e.path]);let V=()=>{y(!1),queueMicrotask(c)},ie=()=>{let e=B();l().then(e,e)},ae=()=>{let e=B();d().then(e,e)},oe=async t=>{try{let n=await td(t===`link`?ne():t===`cwd`?e.cwd:(await o.sessionMarkdown(e.path,e.id)).markdown);f(p(n?`sidebarCopied`:`sidebarCopyFailed`),!n)}catch{f(p(`sidebarCopyFailed`),!0)}},se=async(t=`local`)=>{if(!(w||R)&&!(t===`worktree`&&!E?.worktree)){T(!0);try{t===`worktree`?await s.forkConversation(e.path,e.id,t):await s.forkConversation(e.path,e.id)}catch{f(p(`sidebarForkFailed`),!0)}finally{h.current&&T(!1)}}},ce=()=>{if(_.current)return;let e=A?.restoreFocus;j(null),e?.()},le=async()=>{if(!(!A||_.current||L||te)){_.current=!0,N(!0),F(!1);try{await s.deleteSession(A.path,A.id,A.commandId)?(h.current&&j(null),A.restoreFocus()):h.current&&F(!0)}catch{h.current&&F(!0)}finally{_.current=!1,h.current&&N(!1)}}},H=[{id:`rename`,label:p(`sidebarRename`),icon:(0,q.jsx)(yc,{}),isDisabled:!n,onClick:V},...t?[]:[{id:`pin`,label:p(z?`sidebarUnpin`:`sidebarPin`),icon:z?(0,q.jsx)(bc,{}):(0,q.jsx)(xc,{}),isDisabled:r||!n,onClick:ie},{id:`read`,label:p(e.unread?`markConversationRead`:`markConversationUnread`),icon:(0,q.jsx)(As,{}),isDisabled:!e.readRevision||!n,onClick:()=>void u()}],...a.length?[{type:`divider`},...a]:[],...t?[]:[{type:`divider`},{id:`fork`,label:R?(0,q.jsxs)(`span`,{className:`sidebar-menu-unavailable`,children:[(0,q.jsx)(`span`,{children:p(`sidebarFork`)}),(0,q.jsx)(`small`,{children:R})]}):p(`sidebarFork`),icon:(0,q.jsx)(Ws,{}),isDisabled:!!R||w,items:[{id:`fork-local`,label:p(w?`forkSessionPending`:e.worktree?`sidebarForkSameWorktree`:`sidebarForkLocal`),icon:(0,q.jsx)(pc,{}),onClick:()=>void se()},...E?.worktree?[{id:`fork-worktree`,label:p(`sidebarForkWorktree`),icon:(0,q.jsx)(Gc,{className:`sidebar-worktree-icon`}),onClick:()=>void se(`worktree`)}]:E===null?[{id:`fork-worktree-loading`,label:p(O?`sidebarForkOptionsFailed`:`sidebarForkOptionsLoading`),isDisabled:!0}]:[]]}],{type:`divider`},{id:`copy`,label:p(`sidebarCopy`),icon:(0,q.jsx)(Ss,{}),items:[{id:`copy-link`,label:p(`sidebarCopyLink`),onClick:()=>void oe(`link`)},{id:`copy-markdown`,label:p(`sidebarCopyMarkdown`),isDisabled:!n,onClick:()=>void oe(`markdown`)},{id:`copy-cwd`,label:p(`sidebarCopyCwd`),isDisabled:!e.cwd,onClick:()=>void oe(`cwd`)}]},{type:`divider`},{id:`new-window`,label:p(`sidebarNewWindow`),icon:(0,q.jsx)(Fc,{}),onClick:()=>{window.open(ne(),`_blank`,`noopener,noreferrer`)}},...e.cwd&&n&&(b==null||b.length>0)?[{id:`open-in`,label:p(`sidebarOpenIn`),icon:(0,q.jsx)(Yo,{}),items:b?.map(t=>({id:t.id,label:t.label,onClick:()=>{o.openSessionIn(e.path,e.id,t.id).catch(()=>f(p(`sidebarOpenFailed`),!0))}}))??[{id:`open-in-loading`,label:p(S?`sidebarAppsFailed`:`sidebarAppsLoading`),isDisabled:!0}]}]:[],{type:`divider`},{id:t?`restore`:`archive`,label:p(i?`restoringConversation`:t?`sidebarRestore`:`sidebarArchive`),icon:t?(0,q.jsx)(Wo,{}):(0,q.jsx)(Go,{}),isDisabled:i||!!L,description:L,onClick:ae},{id:`delete`,label:p(`sidebarDelete`),icon:(0,q.jsx)(Uc,{}),isDisabled:!!L,description:L,onClick:()=>{let t=B();queueMicrotask(()=>{h.current&&(F(!1),j({commandId:crypto.randomUUID(),path:e.path,id:e.id,name:ID(e,p(`untitledSession`)),restoreFocus:t}))})}}];return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`astryx-menu-trigger`,ref:m,children:(0,q.jsx)(yo,{className:`sidebar-action-menu sidebar-conversation-menu`,button:{label:p(`conversationOptions`),icon:(0,q.jsx)(Ds,{}),isIconOnly:!0,size:`sm`,variant:`ghost`,className:`menu-action-button`},items:v?H:[],menuWidth:248,placement:`below`,alignment:`start`,hasChevron:!1,isMenuOpen:v,onOpenChange:y})}),A&&(0,q.jsx)(Se,{isOpen:A!==null,onOpenChange:e=>{e||ce()},purpose:`form`,width:420,"aria-label":p(`sidebarDeleteTitle`),children:(0,q.jsxs)(`form`,{className:`openpi-dialog sidebar-delete-dialog`,onSubmit:e=>{e.preventDefault(),le()},children:[(0,q.jsx)(`strong`,{children:p(`sidebarDeleteTitle`)}),(0,q.jsx)(`p`,{children:p(`sidebarDeleteDescription`,{name:A?.name})}),(P||te)&&(0,q.jsx)(`p`,{className:`sidebar-dialog-error`,role:`alert`,children:p(te?`sessionLinkUnavailable`:`sidebarDeleteFailed`)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,disabled:M,onClick:ce,children:p(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,className:`danger`,disabled:M||!!L||te,children:p(M?`sidebarDeleting`:`sidebarDeleteConfirm`)})]})]})})]})}var bA=e=>JSON.stringify([`session`,e.id,e.path]),xA=e=>JSON.stringify([`message`,e.sessionId,e.sessionPath,e.messageId,e.source,e.lineOffset]);function SA({open:e,initialQuery:t,initialIncludeArchived:n,sessions:r,workspaces:i,onClose:a,onCreateSession:o,onOpenSession:s,onOpenMessage:c}){let{t:l}=W(),u=(0,K.useMemo)(()=>new de,[]),[d,f]=(0,K.useState)(t),p=n,[m,h]=(0,K.useState)(null),[g,_]=(0,K.useState)(!1),[v,y]=(0,K.useState)(0),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(null),[w,T]=(0,K.useState)(null),[E,D]=(0,K.useState)(null),O=(0,K.useRef)(null),k=(0,K.useId)(),A=(0,K.useRef)(null);(0,K.useEffect)(()=>(e&&(f(t),h(null),x(!1),C(null),T(null)),()=>{A.current?.abort(),A.current=null}),[e,t]);let j=d.trim(),M=(0,K.useMemo)(()=>new Map(i?.map(e=>[e.path,e.name])),[i]),N=(0,K.useMemo)(()=>{if(!e||!s)return[];let t=j.toLocaleLowerCase();return(r??[]).filter(e=>e.archived&&!p?!1:!t||`${ID(e,l(`untitledSession`))} ${e.cwd} ${M.get(e.cwd)??``}`.toLocaleLowerCase().includes(t)).sort((e,t)=>t.modified.localeCompare(e.modified)||e.path.localeCompare(t.path))},[e,r,M,j,p,s,l]),P=j?[{name:`transcriptSearchSessions`,sessions:N.slice(0,9)}]:[{name:`pinnedConversations`,sessions:N.filter(e=>e.pinOrder!==void 0).sort((e,t)=>(e.pinOrder??0)-(t.pinOrder??0))},{name:`transcriptSearchRecent`,sessions:N.filter(e=>e.pinOrder===void 0).slice(0,10)}];(0,K.useLayoutEffect)(()=>{A.current?.abort(),A.current=null,T(null),C(null),D(null)},[e,j,p,v]),(0,K.useEffect)(()=>{if(!e||!j){_(!1),x(!1);return}let t=new AbortController;_(!0),x(!1);let n=window.setTimeout(()=>{u.searchTranscripts(j,{includeArchived:p,signal:t.signal}).then(e=>{t.signal.aborted||h({query:j,revision:v,includeArchived:p,response:e})}).catch(()=>{t.signal.aborted||x(!0)}).finally(()=>{t.signal.aborted||_(!1)})},250);return()=>{window.clearTimeout(n),t.abort()}},[u,e,j,p,v]);let F=m?.query===j&&m.revision===v&&m.includeArchived===p?m.response:null,I=[...P.flatMap(e=>e.sessions.map(bA)),...j?F?.matches.map(xA)??[]:[]],ee=E!==null&&I.includes(E)?E:I[0],L=e=>`${k}-${encodeURIComponent(e)}`,R=ee?L(ee):void 0;(0,K.useLayoutEffect)(()=>{e&&R&&document.getElementById(R)?.scrollIntoView?.({block:`nearest`})},[e,R]);let te=async(e,t,n)=>{if(A.current)return;D(e),O.current?.focus({preventScroll:!0});let r=new AbortController;A.current=r,T(e),C(null);try{let e=await t(r.signal);if(r.signal.aborted)return;e===!1?C(n):a()}catch{r.signal.aborted||C(n)}finally{A.current===r&&(A.current=null,T(null))}};return(0,q.jsx)(Se,{isOpen:e,onOpenChange:e=>!e&&a(),purpose:`info`,width:`min(700px, 92vw)`,maxHeight:`calc(var(--transcript-search-list-height) + 64px)`,padding:0,className:`transcript-search-modal`,"aria-label":l(`transcriptSearch`),children:e&&(0,q.jsxs)(`div`,{className:`transcript-search-dialog`,children:[(0,q.jsx)(`h2`,{className:`transcript-search-sr-only`,children:l(`transcriptSearch`)}),(0,q.jsx)(`input`,{ref:O,className:`transcript-search-input`,"data-autofocus":!0,type:`search`,maxLength:200,value:d,"aria-label":l(`transcriptSearch`),"aria-autocomplete":`list`,"aria-controls":k,"aria-activedescendant":R,placeholder:l(`transcriptSearchPlaceholder`),autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,onChange:e=>f(e.target.value),onKeyDown:e=>{if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||![`ArrowDown`,`ArrowUp`,`Home`,`End`,`Enter`].includes(e.key)||w!==null)return;if(!ee||!R){e.key===`Enter`&&!j&&o&&(e.preventDefault(),a(),o());return}e.preventDefault();let t=I.indexOf(ee);if(e.key===`Enter`){document.getElementById(R)?.click();return}let n=e.key===`Home`?0:e.key===`End`?I.length-1:e.key===`ArrowDown`?Math.min(t+1,I.length-1):Math.max(t-1,0);D(I[n]??null)}}),(0,q.jsx)(`span`,{className:`transcript-search-sr-only`,role:`status`,children:g?l(`transcriptSearching`):null}),(0,q.jsxs)(`div`,{className:`transcript-search-groups`,children:[(0,q.jsx)(`div`,{id:k,role:`listbox`,"aria-label":l(`transcriptSearch`),children:P.filter(e=>e.sessions.length>0||j&&F?.matches.length).map(e=>(0,q.jsxs)(`fieldset`,{"aria-label":l(e.name),children:[(0,q.jsxs)(`h3`,{children:[l(e.name),g&&(0,q.jsx)(rc,{className:`is-spinning`,"aria-hidden":`true`})]}),(0,q.jsxs)(`ul`,{className:`transcript-search-results`,role:`presentation`,children:[s&&e.sessions.map(e=>{let t=ID(e,l(`untitledSession`)),n=bA(e),r=e.ungrouped?l(`ungrouped`):M.get(e.cwd)||LD(e.cwd);return(0,q.jsx)(`li`,{role:`presentation`,children:(0,q.jsxs)(`button`,{id:L(n),role:`option`,"aria-selected":n===ee,tabIndex:-1,type:`button`,disabled:w!==null,"aria-label":l(`transcriptSearchSessionResult`,{session:t}),onPointerMove:()=>D(n),onMouseDown:e=>e.preventDefault(),onClick:()=>void te(n,t=>s(e.path,t),`transcriptSearchSessionOpenFailed`),children:[(0,q.jsx)(`span`,{className:`transcript-search-accessory`,"aria-hidden":`true`,children:w===n?(0,q.jsx)(rc,{className:`is-spinning`}):e.unread?(0,q.jsx)(hs,{className:`transcript-search-unread`}):null}),(0,q.jsx)(`span`,{className:`transcript-search-result-body`,children:(0,q.jsxs)(`span`,{className:`transcript-search-result-line`,children:[(0,q.jsx)(`span`,{className:`transcript-search-title`,title:t,children:t}),(0,q.jsx)(`span`,{className:`transcript-search-project`,title:e.cwd,children:r})]})})]})},n)}),j&&F?.matches.map(e=>{let t=e.sessionName||l(`untitledSession`),n=l(`transcriptSearchSource_${e.source}`),r=xA(e);return(0,q.jsx)(`li`,{role:`presentation`,children:(0,q.jsxs)(`button`,{id:L(r),role:`option`,"aria-selected":r===ee,tabIndex:-1,type:`button`,disabled:w!==null,"aria-label":l(`transcriptSearchResult`,{session:t,source:n}),onPointerMove:()=>D(r),onMouseDown:e=>e.preventDefault(),onClick:()=>void te(r,t=>c({sessionId:e.sessionId,sessionPath:e.sessionPath,entryId:e.messageId},t),`transcriptSearchOpenFailed`),children:[(0,q.jsx)(`span`,{className:`transcript-search-accessory`,"aria-hidden":`true`,children:w===r&&(0,q.jsx)(rc,{className:`is-spinning`})}),(0,q.jsxs)(`span`,{className:`transcript-search-result-body`,children:[(0,q.jsxs)(`span`,{className:`transcript-search-result-line`,children:[(0,q.jsx)(`span`,{className:`transcript-search-title`,title:t,children:t}),(0,q.jsx)(`span`,{className:`transcript-search-project`,title:e.workspace??n,children:e.workspace?M.get(e.workspace)||LD(e.workspace):n})]}),(0,q.jsx)(`span`,{className:`transcript-search-snippet`,children:e.snippet})]})]})},r)})]})]},e.name))}),!j&&!N.length&&(0,q.jsxs)(`div`,{className:`transcript-search-empty-history`,children:[(0,q.jsx)(`p`,{children:l(`noConversations`)}),o&&(0,q.jsx)(`button`,{className:`transcript-search-create`,type:`button`,onClick:()=>{a(),o()},children:l(`newSession`)})]}),j&&!N.length&&!F?.matches.length&&(g?(0,q.jsx)(`div`,{className:`transcript-search-feedback`,"aria-hidden":`true`,children:(0,q.jsx)(rc,{className:`is-spinning`})}):F&&!b?(0,q.jsx)(`div`,{className:`transcript-search-feedback`,role:`status`,children:l(`transcriptSearchEmpty`)}):null),b&&(0,q.jsxs)(`p`,{className:`transcript-search-error`,role:`alert`,children:[l(`transcriptSearchFailed`),(0,q.jsx)(`button`,{type:`button`,onClick:()=>y(e=>e+1),children:l(`transcriptSearchRetry`)})]}),S&&(0,q.jsx)(`p`,{className:`transcript-search-error`,role:`alert`,children:l(S)}),F?.partial&&(0,q.jsx)(`p`,{className:`transcript-search-partial`,children:l(`transcriptSearchPartial`)})]})]})})}function CA({workspace:e,client:t,actions:n,connected:r,onClose:i}){let{t:a}=W(),[o,s]=(0,K.useState)([]),[c,l]=(0,K.useState)(),[u,d]=(0,K.useState)(!1),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(0),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(null),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(!1),w=(0,K.useRef)(0),T=(0,K.useRef)(null),E=(0,K.useRef)(!1),D=(0,K.useRef)(!0),O=(0,K.useCallback)(async n=>{let r=++w.current;d(!0),p(null);try{let i=await t.workspaceWorktrees(e,n);if(!D.current||r!==w.current)return;if(i.truncated&&!i.nextCursor)throw Error(`Missing worktree continuation`);s(e=>{let t=n?[...e]:[];for(let e of i.worktrees)t.some(t=>t.worktreePath===e.worktreePath&&t.sessionId===e.sessionId&&t.sessionPath===e.sessionPath)||t.push(e);return t}),l(i.nextCursor),h(e=>(n?e:0)+i.unavailable)}catch(e){D.current&&r===w.current&&p(e instanceof ge&&e.code===`WORKTREE_LIST_CHANGED`?`changed`:`failed`)}finally{D.current&&r===w.current&&d(!1)}},[t,e]);(0,K.useEffect)(()=>(D.current=!0,O(),()=>{D.current=!1,w.current++}),[O]);let k=async()=>{if(!(!g||E.current||!r)){E.current=!0,C(!0);try{let e=await n.releaseSessionWorktree(g);if(!D.current)return;y(e),x(!1),e.state===`removed`&&s(e=>e.filter(e=>e.worktreePath!==g.worktreePath||e.sessionId!==g.sessionId||e.sessionPath!==g.sessionPath))}catch{D.current&&(x(!0),y(null))}finally{E.current=!1,D.current&&C(!1)}}};(0,K.useEffect)(()=>{g&&!S&&T.current?.focus()},[g,S]);let A=()=>{E.current||i()};return(0,q.jsx)(Se,{isOpen:!0,onOpenChange:e=>{e||A()},purpose:`form`,width:560,"aria-label":a(`managedWorktrees`),children:(0,q.jsxs)(`div`,{className:`openpi-dialog`,children:[(0,q.jsx)(`strong`,{children:a(`managedWorktrees`)}),(0,q.jsx)(`p`,{className:`sidebar-dialog-path`,children:e}),(0,q.jsx)(`p`,{children:a(`managedWorktreesDescription`)}),g?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`sidebar-dialog-path`,children:g.worktreePath}),(0,q.jsx)(`p`,{children:a(`managedWorktreeConfirm`)}),(v||b)&&(0,q.jsxs)(`p`,{role:`status`,className:v?.state===`removed`?void 0:`sidebar-dialog-error`,children:[a(v?.state===`removed`?`managedWorktreeRemoved`:v?.state===`preserved`?`managedWorktreePreserved`:v?.state===`uncertain`?`managedWorktreeUncertainTerminal`:`managedWorktreeUncertain`),v?.reason&&(0,q.jsxs)(q.Fragment,{children:[` `,v.reason]})]}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,ref:T,disabled:S,onClick:()=>{_(null),y(null),x(!1)},children:a(`managedWorktreesBack`)}),v?.state!==`removed`&&v?.state!==`uncertain`&&(0,q.jsx)(`button`,{type:`button`,className:`danger`,disabled:S||!r,onClick:()=>void k(),children:a(S?`managedWorktreeRemoving`:v||b?`managedWorktreesRetry`:`managedWorktreeRemove`)})]})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`managed-worktrees-list`,children:o.map(e=>(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`sidebar-dialog-path`,children:e.worktreePath}),(0,q.jsx)(`button`,{type:`button`,disabled:!r||u||!!f,onClick:()=>{_(e),y(null),x(!1)},children:a(`managedWorktreeReview`)})]},JSON.stringify([e.worktreePath,e.sessionId,e.sessionPath])))}),!u&&!f&&!o.length&&(0,q.jsx)(`p`,{children:a(`managedWorktreesEmpty`)}),m>0&&(0,q.jsx)(`p`,{children:a(`managedWorktreesUnavailable`,{count:m})}),f&&(0,q.jsx)(`p`,{role:`alert`,children:a(f===`changed`?`managedWorktreesChanged`:`managedWorktreesLoadFailed`)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,onClick:A,children:a(`close`)}),f&&(0,q.jsx)(`button`,{type:`button`,disabled:u||!r,onClick:()=>void O(f===`changed`?void 0:c),children:a(f===`changed`?`managedWorktreesRefresh`:`managedWorktreesRetry`)}),c&&!f&&(0,q.jsx)(`button`,{type:`button`,disabled:u||!r,onClick:()=>void O(c),children:a(`managedWorktreesMore`)}),u&&(0,q.jsx)(`span`,{role:`status`,children:a(`loading`)})]})]})]})})}function wA(e){return e.workspacePath??e.cwd}function TA(e,t,n){return e[t+(n?2:-1)]??null}function EA(e,t,n){return e[t+ +!!n]??null}function DA(e,t){return e>t.top+t.height/2}function OA(e){let t=e.execution?.lastTurn;return JSON.stringify(t?[e.path,e.id,t.commandId,t.finishedAt]:[e.path,e.id])}function kA(e){return e.firstUnread?.type===`turn`?e.firstUnread.finishedAt:e.execution?.lastTurn?.finishedAt??Date.parse(e.modified)}function AA(e){return JSON.stringify([e.path,e.id])}function jA(e,t=!0){return t&&e.execution?.waitingForInput?0:e.unread?1:t&&e.execution?.status===`running`?2:3}function MA({items:e,label:t,alignment:n=`start`}){return(0,q.jsx)(`span`,{className:`astryx-menu-trigger`,children:(0,q.jsx)(yo,{className:`sidebar-action-menu`,button:{label:t,icon:(0,q.jsx)(Ds,{}),isIconOnly:!0,size:`sm`,variant:`ghost`,className:`menu-action-button`},items:e,menuWidth:240,placement:`below`,alignment:n,hasChevron:!1})})}function NA(e){let{t,i18n:n}=W(),[r,i]=(0,K.useState)(null),a=(0,K.useRef)(null),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(!1),[f,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(10),[g,_]=(0,K.useState)(!0),[v,y]=(0,K.useState)(new Set),b=(0,K.useRef)(null),[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(new Set),[k,A]=(0,K.useState)(10),[j,M]=(0,K.useState)(!1),[N,P]=(0,K.useState)(null),[F,I]=(0,K.useState)(!1),ee=(0,K.useRef)(new Set),L=(0,K.useRef)(null),R=(0,K.useRef)(null),te=(0,K.useRef)(e.connected),[z,B]=(0,K.useState)(null),[ne,re]=(0,K.useState)(``),[ie,ae]=(0,K.useState)(!1),oe=(0,K.useRef)(null),se=(0,K.useRef)(null),ce=(0,K.useRef)(null),le=(0,K.useRef)(null),H=(0,K.useRef)(null),fe=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!N)return;let e=window.setTimeout(()=>P(null),5e3);return()=>window.clearTimeout(e)},[N]);let pe=e.snapshot,he=pe?.selectedSession?.path===e.selectedPath?e.selectedPath:null,_e=pe?.sessions.find(e=>e.path===pe.selectedSession?.path&&e.id===pe.selectedSession?.id),ve=OA(_e??{id:``,path:``});(0,K.useLayoutEffect)(()=>{e.selectedPath,L.current=null,R.current=null,M(!1)},[ve,e.selectedPath]),(0,K.useEffect)(()=>{let t=te.current===!1&&e.connected!==!1;if(te.current=e.connected,R.current&&_e?.readRevision&&R.current.revision!==_e.readRevision&&(R.current=null,L.current=ve,M(!1)),!e.sessionViewVisible||!_e||e.selectedPath!==_e.path||L.current===ve||e.connected===!1)return;let n=(t=!1)=>{if(document.visibilityState!==`visible`||!document.hasFocus()||document.querySelector(`dialog[open]`)||L.current===ve)return;if(!_e.unread||!_e.readRevision){L.current=ve,R.current=null;return}if(R.current?.state===`pending`||R.current?.state===`failed`&&!t)return;let n={state:`pending`,revision:_e.readRevision};R.current=n,M(!1),e.actions.setSessionRead(_e.path,_e.id,!0,_e.readRevision).then(()=>{!$e.current||R.current!==n||(R.current=null,L.current=ve)}).catch(()=>{!$e.current||R.current!==n||(n.state=`failed`,M(!0))})},r=()=>n(!0);return n(t),document.addEventListener(`visibilitychange`,r),window.addEventListener(`focus`,r),document.addEventListener(`close`,r,!0),()=>{document.removeEventListener(`visibilitychange`,r),window.removeEventListener(`focus`,r),document.removeEventListener(`close`,r,!0)}},[ve,_e,e.sessionViewVisible,e.selectedPath,e.connected,e.actions]);let ye=(0,K.useMemo)(()=>new de,[]),[be,xe]=(0,K.useState)(!1),[Ce,we]=(0,K.useState)(!1),[Te,Ee]=(0,K.useState)(!1),U=(0,K.useRef)(!1),De=(0,K.useRef)(null),Oe=(0,K.useRef)(!1),[ke,G]=(0,K.useState)(!1),Me=(0,K.useRef)(null),[Ne,Pe]=(0,K.useState)(null),[Fe,Ie]=(0,K.useState)(null),[Le,Re]=(0,K.useState)(!1),[ze,Be]=(0,K.useState)(!1),Ve=pe?.preferences.pinnedSort??`manual`,He=pe?.preferences.sidebarGrouping??`project`,Ue=pe?.preferences.chatsSort??`updated`,We=(pe?.sessions??[]).filter(e=>e.pinOrder!==void 0&&!e.archived).sort((e,t)=>(Ve===`updated`?t.modified.localeCompare(e.modified):0)||e.pinOrder-t.pinOrder).filter(n=>{let r=pe?.workspaces.find(e=>e.path===wA(n));return`${ID(n,t(`untitledSession`))} ${n.cwd} ${r?.name??``}`.toLowerCase().includes(e.query.trim().toLowerCase())}),Ge=async e=>{if(!U.current){U.current=!0,Ee(!0),Be(!1);try{await e()}catch{Be(!0)}finally{U.current=!1,Ee(!1)}}},Ke=(t,n,r)=>Ge(()=>e.actions.setSessionPin(t.path,t.id,n,r)),qe=(t,n,r)=>Ge(()=>e.actions.setSidebarPin(t,n,r)),Je=t=>Ge(async()=>{await ye.savePreferences(t),await e.actions.refreshSnapshot()}),Ye=async(t,n)=>{if(!t.readRevision)return;let r=OA(t);if(!ee.current.has(r)){t.path===e.selectedPath&&(R.current=null,L.current=r),ee.current.add(r),M(!1);try{await e.actions.setSessionRead(t.path,t.id,n,t.readRevision)}catch{M(!0)}finally{ee.current.delete(r)}}},Xe=e.query.trim(),Ze=JSON.stringify([be,Xe]),Qe=(0,K.useRef)({key:Ze});Qe.current.key!==Ze&&(Qe.current={key:Ze});let $e=(0,K.useRef)(!1),[et,tt]=(0,K.useState)(null),[nt,rt]=(0,K.useState)(!1),[it,at]=(0,K.useState)(null),ot=(0,K.useRef)(null),st=et?.query===Xe?et:null,ct=it?.query===Xe?it:null,lt=(0,K.useCallback)(async(e,t)=>{if(!be)return;ot.current?.abort();let n=new AbortController;ot.current=n,rt(!0),at(null);try{let r=await ye.listArchivedSessions({query:Xe,...e?{cursor:e}:{},limit:25},n.signal);if(n.signal.aborted||ot.current!==n)return;let i=[...r.sessions];for(;!e&&t!==void 0&&i.length!i.some(t=>t.path===e.path));if(i.push(...e),!e.length)break}tt(t=>({...r,query:Xe,sessions:e&&t?.query===Xe?[...t.sessions,...i.filter(e=>!t.sessions.some(t=>t.path===e.path))]:i}))}catch(r){!n.signal.aborted&&ot.current===n&&at({query:Xe,kind:r instanceof ge&&r.code===`ARCHIVED_SESSION_CURSOR_STALE`?`stale`:`failed`,...e?{cursor:e}:{},...t===void 0?{}:{retainedCount:t}})}finally{ot.current===n&&(ot.current=null,rt(!1))}},[Xe,be,ye]),[ut,dt]=(0,K.useState)(new Set),[ft,pt]=(0,K.useState)(new Set),mt=(0,K.useRef)(new Set),[ht,gt]=(0,K.useState)(!1),[_t,vt]=(0,K.useState)(!1),yt=(0,K.useRef)(!1),[bt,xt]=(0,K.useState)(!1),St=(0,K.useRef)(!1),[Ct,wt]=(0,K.useState)(!1),[Tt,Et]=(0,K.useState)(!1),Dt=(0,K.useRef)(!1),Ot=async t=>{if(mt.current.has(t))return;mt.current.add(t),pt(new Set(mt.current)),gt(!1);let n=Qe.current;try{let r=await e.actions.unarchiveSession(t);if(!$e.current||Qe.current!==n)return;r?(tt(e=>e?{...e,sessions:e.sessions.filter(e=>e.path!==t)}:null),await lt()):gt(!0)}finally{mt.current.delete(t),$e.current&&pt(new Set(mt.current))}};(0,K.useEffect)(()=>($e.current=!0,()=>{$e.current=!1}),[]),(0,K.useEffect)(()=>(gt(!1),at(null),be&&(tt(e=>e?.query===Xe?e:null),lt()),()=>{ot.current?.abort(),ot.current=null}),[Xe,be,lt]),(0,K.useEffect)(()=>{if(e.searchOpen)return oe.current?.focus(),()=>se.current?.focus()},[e.searchOpen]),(0,K.useEffect)(()=>{if(e.mobileOpen)return H.current?.focus(),()=>{let t=e.returnFocusRef?.current;t?.checkVisibility()&&t.focus()}},[e.mobileOpen,e.returnFocusRef]),(0,K.useEffect)(()=>{e.mobileOpen&&document.activeElement===document.body&&!document.querySelector(`dialog:modal`)&&H.current?.focus()}),(0,K.useEffect)(()=>{c&&(ce.current?.focus(),ce.current?.select())},[c]);let kt=(0,K.useMemo)(()=>{let n=e.query.trim().toLowerCase(),r=be?st?.sessions??[]:pe?.sessions??[],i=(e,i)=>r.filter(r=>!!r.archived===be&&(be||r.pinOrder===void 0)&&(e===`__ungrouped__`?r.ungrouped:wA(r)===e&&!r.ungrouped)&&(!n||be||i||`${ID(r,t(`untitledSession`))} ${r.cwd}`.toLowerCase().includes(n))),a=[...pe?.workspaces??[]];for(let e of r)!e.ungrouped&&!a.some(t=>t.path===wA(e))&&a.push({path:wA(e),name:wA(e),current:!1});return[...a.map(e=>{let t=!!n&&`${e.name} ${e.path}`.toLowerCase().includes(n);return{...e,showPath:a.some(t=>t.path!==e.path&&t.name===e.name),sessions:i(e.path,t),ungrouped:!1,matches:t}}),{path:`__ungrouped__`,name:t(`ungrouped`),current:!1,sessions:i(`__ungrouped__`,!1),ungrouped:!0,pinOrder:void 0,showPath:!1,matches:!1}].filter(e=>e.sessions.length>0||!be&&!e.ungrouped&&(!n||e.matches))},[be,e.query,st,pe,t]),At=e=>[...e].sort((e,t)=>(Ue===`manual`?(e.order??2**53-1)-(t.order??2**53-1):0)||t.modified.localeCompare(e.modified)||e.path.localeCompare(t.path)),jt=(e,t)=>{if(e.length<=t+1)return e;let n=e.slice(0,t),r=e.find(e=>e.path===he&&e.id===pe?.selectedSession?.id);return r&&!n.includes(r)&&n.push(r),n},Mt=kt.filter(e=>!e.ungrouped),Nt=Mt.filter(e=>e.pinOrder!==void 0),Pt=[...We.map(e=>({kind:`session`,session:e,pinOrder:e.pinOrder})),...Nt.map(e=>({kind:`workspace`,project:e,pinOrder:e.pinOrder}))].sort((e,t)=>{let n=e=>e.kind===`session`?e.session.modified:e.project.sessions.reduce((e,t)=>t.modified>e?t.modified:e,``);return(Ve===`updated`?n(t).localeCompare(n(e)):0)||e.pinOrder-t.pinOrder}),Ft=e=>e.kind===`session`?{kind:`session`,path:e.session.path,id:e.session.id}:{kind:`workspace`,path:e.project.path},It=Mt.filter(e=>e.pinOrder===void 0),Lt=x||e.query.trim()||be||It.length<=6?It:It.slice(0,5),Rt=It.find(e=>_e?.path===he&&e.path===(_e?wA(_e):void 0));Rt&&!Lt.includes(Rt)&&Lt.push(Rt);let zt=At((pe?.sessions??[]).filter(n=>!n.archived&&n.pinOrder===void 0&&!pe?.workspaces.some(e=>e.pinOrder!==void 0&&e.path===wA(n))&&(He===`list`||pe?.preferences.projectsInRecents!==!1||n.ungrouped||!Mt.some(e=>e.path===wA(n)))&&(!e.query.trim()||`${ID(n,t(`untitledSession`))} ${n.cwd} ${pe?.workspaces.find(e=>e.path===wA(n))?.name??``}`.toLowerCase().includes(e.query.trim().toLowerCase())))),Bt=e.query.trim()?zt:jt(zt,k),Vt=t=>jA(t,e.connected)<3,Ht=new Date;Ht.setHours(0,0,0,0),Ht.setDate(Ht.getDate()-6);let Ut=(pe?.sessions??[]).filter(e=>!e.archived&&(Vt(e)||v.has(AA(e))||[`completed`,`failed`].includes(e.execution?.lastTurn?.outcome??``)&&(e.execution?.lastTurn?.finishedAt??0)>=Ht.getTime())),Wt=new Map([...v].map((e,t)=>[e,t])),Gt=Ut.filter(e=>Vt(e)||v.has(AA(e))).sort((t,n)=>(Wt.get(AA(t))??1/0)-(Wt.get(AA(n))??1/0)||jA(t,e.connected)-jA(n,e.connected)||n.modified.localeCompare(t.modified)),Kt=new Set(Gt.map(e=>e.path)),qt=Ut.filter(e=>!g||!Kt.has(e.path)).sort((e,t)=>kA(t)-kA(e)),Jt=g?Gt.slice(0,m):[],Yt=qt.slice(0,Math.max(0,m-Jt.length)),Xt=Ut.length>Jt.length+Yt.length;(0,K.useEffect)(()=>{let e=fe.current;if(!f||!Xt||!e||typeof IntersectionObserver>`u`)return;let t=new IntersectionObserver(([e])=>{e?.isIntersecting&&(t.disconnect(),h(m+10))},{root:e.closest(`.sidebar-navigation`)});return t.observe(e),()=>t.disconnect()},[f,Xt,m]),(0,K.useEffect)(()=>{if(!f){b.current=null,y(e=>e.size?new Set:e),h(10);return}let t=b.current??{openedAt:Date.now(),sessions:new Set((pe?.sessions??[]).map(AA))},n=(pe?.sessions??[]).filter(t=>!t.archived&&jA(t,e.connected)<3).sort((t,n)=>jA(t,e.connected)-jA(n,e.connected)||n.modified.localeCompare(t.modified)),r=n.filter(e=>!t.sessions.has(AA(e))&&Date.parse(e.created)>=t.openedAt);for(let e of pe?.sessions??[])t.sessions.add(AA(e));b.current=t,y(e=>{let t=new Set([...r.map(AA),...e,...n.map(AA)]);return t.size===e.size?e:t})},[f,pe?.sessions,e.connected]);let Zt=(pe?.sessions??[]).filter(e=>!e.archived&&e.unread),Qt=Zt.filter(e=>e.readRevision),$t=g?Gt.filter(e=>e.unread&&e.readRevision):[],en=async e=>{if(!F){I(!0);try{await Promise.all(e.map(e=>Ye(e,!0)))}finally{I(!1)}}},tn=he?_e?wA(_e):pe?.selectedSession?.cwd:null,nn=!!(pe?.truncation.sessionsOmitted||pe?.truncation.workspacesOmitted),rn=e=>{yt.current||(re(e.name),ae(!1),l(e))},an=async()=>{let t=ne.trim();if(!c||!t||t===c.name||yt.current)return;let n=c,r=Qe.current,i=st?.sessions.length??25;yt.current=!0,vt(!0),ae(!1);try{if(n.kind===`workspace`?await e.actions.renameWorkspace(n.path,t):await e.actions.renameSession(n.path,t),!$e.current)return;l(null),n.kind===`session`&&be&&Qe.current===r&<(void 0,i)}catch{$e.current&&ae(!0)}finally{yt.current=!1,$e.current&&vt(!1)}},on=async()=>{if(!z||St.current)return;let t=z;St.current=!0,xt(!0),wt(!1);try{let n=await e.actions.removeWorkspace(t.path);if(!$e.current)return;n?B(null):wt(!0)}catch{$e.current&&wt(!0)}finally{St.current=!1,$e.current&&xt(!1)}},sn=async t=>{if(Dt.current)return;let n=Qe.current;Dt.current=!0,Et(!0);try{if(!t){await e.actions.chooseWorkspace();return}let r=await e.actions.createSession(t);if(!$e.current||Qe.current!==n||!r?.sessionId||!r.sessionPath||r.workspacePath!==t)return;xe(!1),p(!1),e.actions.setQuery(``)}catch{}finally{Dt.current=!1,$e.current&&Et(!1)}},cn=(0,K.useCallback)(()=>{(De.current||Me.current)&&(Oe.current=!0),De.current=null,Me.current=null,G(!1),Ie(null),Pe(null)},[]);(0,K.useEffect)(()=>{let e=e=>{e.key!==`Escape`||!De.current&&!Me.current||(e.preventDefault(),cn())},t=()=>{(De.current||Me.current)&&cn()};return window.addEventListener(`keydown`,e,!0),window.addEventListener(`blur`,t),()=>{window.removeEventListener(`keydown`,e,!0),window.removeEventListener(`blur`,t)}},[cn]);let ln=(e,t)=>{let n=Pt[e];if(!n)return;let r=TA(Pt,e,t);qe(Ft(n),!0,r?Ft(r):null)},un=e=>Ve===`manual`?[{id:`move-up`,label:t(`movePinUp`),icon:(0,q.jsx)(Xo,{}),isDisabled:Te||e<=0,onClick:()=>ln(e,!1)},{id:`move-down`,label:t(`movePinDown`),icon:(0,q.jsx)(ue,{}),isDisabled:Te||e===Pt.length-1,onClick:()=>ln(e,!0)}]:[],dn=[{id:`updated`,label:t(`pinnedRecentlyUpdated`),endContent:Ue===`updated`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({chatsSort:`updated`})},{id:`manual`,label:t(`pinnedManualOrder`),endContent:Ue===`manual`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({chatsSort:`manual`})}],fn=[{id:`updated`,label:t(`pinnedRecentlyUpdated`),endContent:Ve===`updated`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({pinnedSort:`updated`})},{id:`manual`,label:t(`pinnedManualOrder`),endContent:Ve===`manual`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({pinnedSort:`manual`})}],pn=[{label:t(`sidebarGroupBy`),items:[{label:t(`sidebarByProject`),endContent:He===`project`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({sidebarGrouping:`project`})},{label:t(`sidebarFlatList`),endContent:He===`list`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({sidebarGrouping:`list`})}]},{label:t(`sidebarChatSort`),items:dn}],mn=[...pn,...He===`project`?[{label:t(`sidebarShow`),items:[{label:t(`sidebarProjectsInRecents`),endContent:pe?.preferences.projectsInRecents===!1?void 0:(0,q.jsx)(rs,{size:16}),isDisabled:Te,onClick:()=>void Je({projectsInRecents:pe?.preferences.projectsInRecents===!1})}]}]:[]],hn=(0,q.jsxs)(`div`,{className:`sidebar-section-actions is-always-visible`,children:[(0,q.jsx)(MA,{label:t(`sidebarActivityOptions`),items:[{type:`section`,title:t(`sidebarShow`),items:[{label:t(`sidebarPriority`),endContent:g?(0,q.jsx)(rs,{size:16}):void 0,onClick:()=>_(e=>!e)}]},{type:`divider`},{label:t(`sidebarMarkAllRead`),icon:(0,q.jsx)(ic,{}),isDisabled:F||!$t.length,onClick:()=>void en($t)}]}),g&&Gt.some(e=>!Vt(e))&&(0,q.jsx)(V,{content:t(`sidebarClearRead`),children:(0,q.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":t(`sidebarClearRead`),onClick:()=>y(new Set(Gt.filter(Vt).map(AA))),children:(0,q.jsx)(es,{"aria-hidden":`true`})})})]}),gn=(a,o=!1,s)=>{let c=JSON.stringify([a.path,a.id,o,s?.key]),l=Pt.findIndex(e=>e.kind===`session`&&e.session.path===a.path&&e.session.id===a.id),u={kind:`session`,path:a.path,id:a.id},d=a.pinOrder!==void 0,p=e.connected!==!1&&a.execution?.status===`running`,m=e.connected!==!1&&a.execution?.waitingForInput,h=a.firstUnread?.type===`turn`?a.firstUnread.outcome:a.execution?.lastTurn?.outcome,g=m?`attention`:p?`running`:a.unread?h===`failed`?`attention`:h===`completed`?`completed`:`unread`:void 0,_=g===`running`?rc:g===`attention`?ls:hs,v=e.connected===!1?0:a.execution?.pendingFollowUps??0,y=a.path===he&&a.id===pe?.selectedSession?.id,b=g===`attention`?m?`waiting`:`failed`:g===`running`&&a.execution?.compacting?`compacting`:g,x=[...b?[t(`sidebarState_`+b)]:[],...v>0?[t(`pendingFollowUpsHint`,{count:v})]:[]].join(` · `),S=s?.sessions.findIndex(e=>e.path===a.path&&e.id===a.id)??-1,C=!be&&!o&&Ue===`manual`&&!!s,w=t=>Ge(()=>e.actions.setSessionOrder(a.path,a.id,t?{path:t.path,id:t.id}:null)),T=o?un(l):C&&s?[{id:`move-up`,label:t(`movePinUp`),icon:(0,q.jsx)(Xo,{}),isDisabled:Te||S<=0,onClick:()=>void w(TA(s.sessions,S,!1))},{id:`move-down`,label:t(`movePinDown`),icon:(0,q.jsx)(ue,{}),isDisabled:Te||S===s.sessions.length-1,onClick:()=>void w(TA(s.sessions,S,!0))}]:[];return(0,q.jsxs)(`li`,{className:`session-row `+(a.unread?`is-unread `:``)+(Fe===a.path?Le?`is-pin-drop-after`:`is-pin-drop-target`:``),"aria-label":ID(a,t(`untitledSession`)),"data-session-key":JSON.stringify([a.path,a.id]),"data-dragging":ke&&(De.current?.kind===`session`&&De.current.path===a.path&&De.current.id===a.id||Me.current?.path===a.path&&Me.current.id===a.id)||void 0,draggable:!Te&&!e.query.trim()&&(o?Ve===`manual`:C),onDragStart:e=>{if(e.stopPropagation(),o&&Ve===`manual`)De.current=u;else if(C&&s)Me.current={path:a.path,id:a.id,scope:s.key};else{e.preventDefault();return}G(!0),Oe.current=!0,e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,a.id)},onDragOver:e=>{if(!(o&&Ve===`manual`&&De.current)&&!(C&&Me.current?.scope===s?.key))return;e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`move`,Ie(a.path),Pe(null);let t=e.currentTarget.getBoundingClientRect();Re(DA(e.clientY,t))},onDragEnd:cn,onDrop:t=>{let n=t.currentTarget.getBoundingClientRect(),r=DA(t.clientY,n);if(o&&Ve===`manual`&&De.current){t.preventDefault(),t.stopPropagation();let e=Pt[l+1];qe(De.current,!0,r?e?Ft(e):null:u)}else if(C&&s&&Me.current?.scope===s.key){t.preventDefault(),t.stopPropagation();let n=Me.current,i=EA(s.sessions,S,r);Ge(()=>e.actions.setSessionOrder(n.path,n.id,i?{path:i.path,id:i.id}:null))}else return;cn()},children:[(0,q.jsx)(V,{placement:`end`,delay:450,onOpenChange:e=>i(t=>e?c:t===c?null:t),content:r===c?(0,q.jsxs)(`span`,{className:`session-hover-preview`,children:[(0,q.jsx)(`strong`,{children:ID(a,t(`untitledSession`))}),a.name&&a.firstMessage&&a.firstMessage!==`(no messages)`&&a.firstMessage!==a.name&&(0,q.jsx)(`span`,{children:a.firstMessage}),(0,q.jsx)(`time`,{dateTime:a.modified,children:new Date(a.modified).toLocaleString(n.resolvedLanguage,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})})]}):null,children:(0,q.jsxs)(`button`,{className:`session `+(y?`active`:``),type:`button`,"aria-current":y?`page`:void 0,"aria-label":[ID(a,t(`untitledSession`)),a.path,x].filter(Boolean).join(` · `),onClick:()=>{y&&a.unread&&e.sessionViewVisible&&e.connected!==!1&&Ye(a,!0),e.actions.selectSession(a.path)},onDoubleClick:n=>{y&&e.connected!==!1&&n.target instanceof Element&&n.target.closest(`.session-title`)&&rn({kind:`session`,path:a.path,name:ID(a,t(`untitledSession`))})},children:[(0,q.jsxs)(`span`,{className:`session-copy`,children:[(0,q.jsx)(`span`,{className:`session-title`,children:ID(a,t(`untitledSession`))}),f&&(0,q.jsxs)(`span`,{className:`session-project`,children:[(0,q.jsx)(Vs,{"aria-hidden":`true`}),pe?.workspaces.find(e=>e.path===wA(a))?.name??RD(wA(a))]})]}),x&&(0,q.jsx)(V,{content:x,children:(0,q.jsxs)(`span`,{className:`session-status`,"aria-hidden":`true`,children:[g&&(0,q.jsx)(_,{className:`session-state session-state-`+g}),v>0&&(0,q.jsxs)(`span`,{className:`session-queue`,children:[(0,q.jsx)(ec,{}),(0,q.jsx)(`span`,{children:v>99?`99+`:v})]})]})})]})}),!be&&(0,q.jsx)(V,{content:t(d?`unpinConversation`:`pinConversation`),children:(0,q.jsx)(`button`,{type:`button`,className:`session-pin-button`,"aria-label":t(d?`unpinConversation`:`pinConversation`),disabled:Te,onClick:e=>{let t=vA(e.currentTarget);Ke(a,!d).finally(t)},children:(0,q.jsx)(xc,{"aria-hidden":`true`,fill:d?`currentColor`:`none`})})}),(0,q.jsx)(yA,{session:a,archived:be,connected:e.connected!==!1,pinSaving:Te,restoring:ft.has(a.path),movementItems:T,client:ye,actions:e.actions,onRename:()=>rn({kind:`session`,path:a.path,name:ID(a,t(`untitledSession`))}),onPin:()=>Ke(a,!d),onRead:()=>Ye(a,!!a.unread),onArchive:()=>be?Ot(a.path):e.actions.archiveSession(a.path),onNotice:(e,t=!1)=>P({message:e,error:t})})]},a.path)},_n=(n,r=!1)=>{let i=(be?ut:e.collapsed).has(n.path)&&!e.query.trim(),o=!n.ungrouped&&tn===n.path,c=Pt.findIndex(e=>e.kind===`workspace`&&e.project.path===n.path),l=It.findIndex(e=>e.path===n.path),u=!be&&!n.ungrouped&&!Te&&!e.query.trim(),d=t=>Ge(()=>e.actions.setWorkspaceOrder(n.path,TA(It,l,t)?.path??null)),f={kind:`workspace`,path:n.path},p=At(n.sessions),m=Qt.filter(e=>!e.ungrouped&&wA(e)===n.path),h=be||!!e.query.trim()||D.has(n.path)||p.length<=6,g=[...be?[]:[{id:`pin`,label:t(r?`unpinWorkspace`:`pinWorkspace`),icon:(0,q.jsx)(xc,{}),isDisabled:Te,onClick:()=>void qe(f,!r)},{id:`mark-read`,label:t(`sidebarMarkAllRead`),icon:(0,q.jsx)(ic,{}),isDisabled:F||!m.length,onClick:()=>void en(m)}],...r?un(c):be?[]:[{id:`move-up`,label:t(`movePinUp`),icon:(0,q.jsx)(Xo,{}),isDisabled:!u||l<=0,onClick:()=>void d(!1)},{id:`move-down`,label:t(`movePinDown`),icon:(0,q.jsx)(ue,{}),isDisabled:!u||l===It.length-1,onClick:()=>void d(!0)}],...n.ungrouped?[]:[{id:`managed-worktrees`,label:t(`managedWorktrees`),icon:(0,q.jsx)(Vs,{}),isDisabled:e.connected===!1,onClick:()=>{let e=Array.from(le.current?.querySelectorAll(`.workspace-group`)??[]).find(e=>e.dataset.workspaceKey===n.path);a.current=vA(e?.querySelector(`.workspace-row-actions .menu-action-button`)??null),queueMicrotask(()=>s(n.path))}}],{id:`rename`,label:t(`renameWorkspace`),icon:(0,q.jsx)(Ic,{}),onClick:()=>rn({kind:`workspace`,path:n.path,name:n.name})},{id:`remove`,label:t(`removeWorkspace`),icon:(0,q.jsx)(Uc,{}),variant:`destructive`,onClick:()=>{wt(!1),B({path:n.path,name:n.name})}}];return(0,q.jsxs)(`section`,{className:`workspace-group `+(i?`collapsed `:``)+(o?`is-active-workspace `:``)+(Ne===n.path?Le?`is-pin-drop-after`:`is-pin-drop-target`:``),"data-workspace-key":n.path,"aria-label":n.name,onDragOver:e=>{if(!u||!De.current||(r?Ve!==`manual`:De.current.kind!==`workspace`))return;e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`move`,Pe(n.path),Ie(null);let t=e.currentTarget.getBoundingClientRect();Re(DA(e.clientY,t))},onDragEnd:cn,onDragLeave:e=>{(!(e.relatedTarget instanceof Node)||!e.currentTarget.contains(e.relatedTarget))&&Pe(null)},onDrop:t=>{if(!u||!De.current||(r?Ve!==`manual`:De.current.kind!==`workspace`))return;t.preventDefault(),t.stopPropagation();let i=t.currentTarget.getBoundingClientRect(),a=DA(t.clientY,i),o=De.current;if(o.kind!==`workspace`||o.path!==n.path)if(r){let e=Pt[c+1];qe(o,!0,a?e?Ft(e):null:f)}else Ge(()=>e.actions.setWorkspaceOrder(o.path,a?It[l+1]?.path??null:n.path));cn()},children:[(0,q.jsxs)(`div`,{className:`workspace-button`,draggable:u&&(!r||Ve===`manual`),onDragStart:e=>{if(!u||r&&Ve!==`manual`||e.target instanceof Element&&e.target.closest(`.workspace-row-actions`)){e.preventDefault();return}De.current=f,requestAnimationFrame(()=>{$e.current&&De.current===f&&G(!0)}),Oe.current=!0,e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,n.path)},children:[(0,q.jsxs)(`button`,{className:`workspace-label`,type:`button`,"aria-expanded":!i,"aria-current":o?`location`:void 0,disabled:!!e.query.trim(),title:n.ungrouped?void 0:n.path,onClick:()=>{be?dt(e=>{let t=new Set(e);return t.has(n.path)?t.delete(n.path):t.add(n.path),t}):e.actions.toggleWorkspace(n.path)},children:[(0,q.jsx)(`span`,{className:`workspace-toggle`,"aria-hidden":`true`,children:i?(0,q.jsx)(Vs,{className:`workspace-folder`}):(0,q.jsx)(zs,{className:`workspace-folder`})}),(0,q.jsxs)(`span`,{className:`workspace-identity`,children:[(0,q.jsx)(`strong`,{children:n.name}),n.showPath&&(0,q.jsx)(`small`,{children:RD(n.path)})]})]}),!n.ungrouped&&(0,q.jsxs)(`span`,{className:`workspace-row-actions`,children:[(0,q.jsx)(MA,{label:t(`workspaceOptions`),items:g}),(0,q.jsx)(V,{content:t(`newSession`),children:(0,q.jsx)(`button`,{className:`workspace-action`,type:`button`,"aria-label":t(`newSession`)+` `+n.name,disabled:Tt,"aria-busy":Tt||void 0,onClick:()=>void sn(n.path),children:(0,q.jsx)(Ic,{})})})]})]}),!i&&!p.length&&!be&&!e.query.trim()&&!nn&&(0,q.jsx)(`p`,{className:`workspace-empty`,children:t(`noConversations`)}),!i&&p.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`ul`,{className:`workspace-sessions`,children:(h?p:jt(p,5)).map(e=>gn(e,!1,{key:n.path,sessions:p}))}),!be&&!e.query.trim()&&p.length>6&&(0,q.jsx)(`button`,{className:`sidebar-show-more is-indented`,type:`button`,"aria-expanded":D.has(n.path),onClick:()=>O(e=>{let t=new Set(e);return t.has(n.path)?t.delete(n.path):t.add(n.path),t}),children:t(D.has(n.path)?`sidebarShowLess`:`sidebarShowMore`)})]})]},n.path)},vn=new Map,yn=new Date,bn=new Date(yn);bn.setDate(yn.getDate()-1);for(let e of Yt){let n=new Date(kA(e)),r=n.toDateString()===yn.toDateString()?t(`sidebarToday`):n.toDateString()===bn.toDateString()?t(`sidebarYesterday`):Number.isFinite(n.getTime())?n.toLocaleDateString(void 0,{weekday:`long`}):t(`sidebarEarlier`);vn.set(r,[...vn.get(r)??[],e])}return(0,q.jsxs)(`div`,{ref:le,id:`session-sidebar`,className:`session-sidebar`,role:e.mobileOpen?`dialog`:`complementary`,"aria-modal":e.mobileOpen||void 0,"aria-label":`Session navigation`,tabIndex:e.mobileOpen?-1:void 0,onPointerDownCapture:()=>{!De.current&&!Me.current&&(Oe.current=!1)},onClickCapture:e=>{e.detail!==0&&Oe.current&&(e.preventDefault(),e.stopPropagation(),Oe.current=!1)},onKeyDown:t=>{if(!e.mobileOpen||t.defaultPrevented||t.target instanceof Element&&(t.target.closest(`dialog`)||t.key!==`Tab`&&t.target.closest(`[role="menu"]`))||t.key===`Escape`&&le.current?.querySelector(`[aria-haspopup="menu"][aria-expanded="true"]`)||(t.key===`Escape`&&!t.nativeEvent.isComposing&&(t.preventDefault(),e.actions.closeMobileSidebar()),t.key!==`Tab`))return;let n=Array.from(le.current?.querySelectorAll(`button, input, select, textarea, a[href], [tabindex]`)??[]).filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&e.checkVisibility({visibilityProperty:!0})),r=t.shiftKey?n.at(-1):n[0],i=t.shiftKey?n[0]:n.at(-1);(document.activeElement===le.current||document.activeElement===i)&&(t.preventDefault(),r?.focus())},children:[(0,q.jsxs)(`div`,{className:`sidebar-brand`,children:[(0,q.jsx)(`span`,{className:`sidebar-brand-title`,children:`OpenPI`}),(0,q.jsxs)(`div`,{className:`sidebar-header-actions`,children:[(0,q.jsx)(V,{content:t(f?`sidebarViewChats`:`sidebarViewActivity`),children:(0,q.jsxs)(`button`,{className:`icon-button sidebar-activity-toggle`,type:`button`,"aria-label":t(f?`sidebarViewChats`:`sidebarViewActivity`),"aria-pressed":f,onClick:()=>{xe(!1),p(e=>!e)},children:[(0,q.jsx)(Zo,{"aria-hidden":`true`}),Zt.length>0&&(0,q.jsx)(`span`,{className:`sidebar-unread-dot`})]})}),(0,q.jsx)(V,{content:t(`searchConversations`),children:(0,q.jsx)(`button`,{ref:se,className:`icon-button`,type:`button`,"aria-label":t(`searchConversations`),onClick:()=>d(!0),children:(0,q.jsx)(Dc,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:t(`collapseSidebar`),placement:`end`,children:(0,q.jsx)(`button`,{ref:H,className:`collapse-button sidebar-mobile-close`,type:`button`,"aria-label":t(`collapseSidebar`),onClick:()=>e.mobileOpen?e.actions.closeMobileSidebar():e.actions.toggleSidebar(!1),children:(0,q.jsx)(hc,{})})})]})]}),(0,q.jsx)(V,{content:t(`newSession`),placement:`end`,children:(0,q.jsxs)(`button`,{className:`new-session-button`,type:`button`,"aria-label":t(`newSession`),disabled:Tt,"aria-busy":Tt||void 0,onClick:()=>void sn(e.selectedWorkspace),children:[Tt?(0,q.jsx)(rc,{className:`new-session-spinner`}):(0,q.jsx)(Ae,{}),(0,q.jsx)(`span`,{children:t(`newSession`)})]})}),(0,q.jsx)(SA,{open:u,initialQuery:e.query,initialIncludeArchived:be,sessions:pe?.sessions??[],workspaces:pe?.workspaces??[],onClose:()=>d(!1),onOpenMessage:e.actions.navigateToMessage,onOpenSession:t=>e.actions.selectSession(t),onCreateSession:()=>void sn(e.selectedWorkspace)}),(0,q.jsxs)(`div`,{className:`sidebar-navigation`,children:[N&&(0,q.jsx)(`p`,{className:`sidebar-scope-note sidebar-action-feedback`,role:N.error?`alert`:`status`,children:N.message}),ze&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,role:`alert`,children:t(`sidebarSaveFailed`)}),j&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,role:`alert`,children:t(`sidebarReadFailed`)}),f?(0,q.jsxs)(`section`,{className:`sidebar-activity`,"aria-label":t(`sidebarActivity`),children:[g&&(0,q.jsxs)(`section`,{"aria-label":t(`sidebarPriority`),children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsx)(`h2`,{className:`sidebar-section-label`,children:t(`sidebarPriority`)}),hn]}),(0,q.jsx)(`ul`,{className:`sidebar-activity-sessions`,children:Jt.map(e=>gn(e))}),!Jt.length&&(0,q.jsx)(`p`,{className:`sidebar-activity-empty`,children:t(`sidebarActivityEmpty`)})]}),[...vn].map(([e,t],n)=>(0,q.jsxs)(`section`,{"aria-label":e,children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsx)(`h2`,{className:`sidebar-section-label`,children:e}),!g&&n===0&&hn]}),(0,q.jsx)(`ul`,{className:`sidebar-activity-sessions`,children:t.map(e=>gn(e))})]},e)),!g&&!vn.size&&(0,q.jsxs)(`section`,{"aria-label":t(`sidebarToday`),children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsx)(`h2`,{className:`sidebar-section-label`,children:t(`sidebarToday`)}),hn]}),(0,q.jsx)(`p`,{className:`sidebar-activity-empty`,children:t(`sidebarActivityEmpty`)})]}),Xt&&(0,q.jsx)(`div`,{ref:fe,className:`sidebar-activity-tail`,role:`status`,"aria-label":t(`loading`),children:(0,q.jsx)(rc,{"aria-hidden":`true`})})]}):(0,q.jsxs)(q.Fragment,{children:[!be&&(Pt.length>0||ke&&De.current&&Ve===`manual`)&&(0,q.jsxs)(`section`,{className:`pinned-section `+(Ne===`pinned-tail`?`is-pin-drop-after`:``),"aria-label":t(`pinnedConversations`),onDragOver:t=>{Te||Ve!==`manual`||!De.current||e.query.trim()||(t.preventDefault(),t.dataTransfer.dropEffect=`move`,Pe(`pinned-tail`),Ie(null))},onDragLeave:e=>{(!(e.relatedTarget instanceof Node)||!e.currentTarget.contains(e.relatedTarget))&&Pe(null)},onDrop:t=>{Te||Ve!==`manual`||!De.current||e.query.trim()||(t.preventDefault(),t.stopPropagation(),qe(De.current,!0,null),cn())},children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`workspace-heading-label`,"aria-expanded":!Ce||!!e.query.trim(),onClick:()=>we(e=>!e),children:[t(`pinnedConversations`),(0,q.jsx)(is,{className:Ce&&!e.query.trim()?`is-collapsed`:``,"aria-hidden":`true`})]}),(0,q.jsx)(`div`,{className:`sidebar-section-actions`,children:(0,q.jsx)(MA,{label:t(`pinnedOptions`),items:fn,alignment:`end`})})]}),ke&&Ve===`manual`&&(Pt.length===0||Ce)&&(0,q.jsx)(`p`,{className:`sidebar-drop-hint`,children:t(`sidebarDropPin`)}),(!Ce||!!e.query.trim())&&(0,q.jsx)(`ul`,{className:`pinned-sessions`,children:Pt.map(e=>e.kind===`session`?gn(e.session,!0):(0,q.jsx)(`li`,{className:`pinned-workspace`,children:_n(e.project,!0)},e.project.path))})]}),(be||He===`project`||e.searchOpen)&&(0,q.jsxs)(`div`,{className:`workspace-heading sidebar-section-heading `+(e.searchOpen?`is-searching`:``),children:[(0,q.jsxs)(`button`,{type:`button`,className:`workspace-heading-label`,"aria-label":t(be?`currentConversations`:`sidebarProjects`),"aria-expanded":be?void 0:!C||!!e.query.trim(),onClick:()=>be?xe(!1):w(e=>!e),children:[be&&(0,q.jsx)(Ko,{"aria-hidden":`true`}),t(be?`archivedConversations`:`sidebarProjects`),!be&&(0,q.jsx)(is,{className:C&&!e.query.trim()?`is-collapsed`:``,"aria-hidden":`true`})]}),(0,q.jsxs)(`div`,{className:`session-search`,children:[(0,q.jsx)(Dc,{}),(0,q.jsx)(`input`,{ref:oe,type:`search`,value:e.query,placeholder:t(`searchPlaceholder`),maxLength:be?160:void 0,"aria-label":t(`searchConversations`),onChange:t=>e.actions.setQuery(t.target.value)}),(0,q.jsx)(`button`,{type:`button`,"aria-label":t(`closeSearch`),onClick:()=>e.actions.setSearchOpen(!1),children:(0,q.jsx)(je,{})})]}),(0,q.jsxs)(`div`,{className:`workspace-actions sidebar-section-actions`,children:[!be&&(0,q.jsx)(MA,{label:t(`sidebarProjectOptions`),items:pn}),be&&(0,q.jsx)(V,{content:t(`sidebarFilterList`),children:(0,q.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":t(`sidebarFilterList`),onClick:()=>e.actions.setSearchOpen(!0),children:(0,q.jsx)(Dc,{})})}),!be&&(0,q.jsx)(V,{content:t(`addWorkspace`),children:(0,q.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":t(`addWorkspace`),onClick:()=>void e.actions.chooseWorkspace(),children:(0,q.jsx)(Ae,{})})})]})]}),e.searchOpen&&(0,q.jsxs)(`button`,{type:`button`,className:`sidebar-content-search`,onClick:()=>d(!0),children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),t(`transcriptSearch`)]}),be&&(0,q.jsxs)(`div`,{className:`sidebar-archive-actions`,children:[(0,q.jsx)(V,{content:t(`refreshArchives`),placement:`end`,children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":t(`refreshArchives`),disabled:nt,onClick:()=>void lt(),children:(0,q.jsx)(me,{"aria-hidden":`true`})})}),nt&&(0,q.jsx)(`span`,{role:`status`,children:t(`loadingArchives`)})]}),be&&ct&&(0,q.jsxs)(`div`,{className:`sidebar-scope-note`,role:`alert`,children:[(0,q.jsx)(`p`,{children:t(ct.kind===`stale`?`archiveCursorStale`:`archiveLoadFailed`)}),(0,q.jsx)(`button`,{type:`button`,disabled:nt,onClick:()=>void lt(ct.kind===`stale`?void 0:ct.cursor,ct.retainedCount),children:t(ct.kind===`stale`?`refreshArchives`:`retryArchives`)})]}),be&&!!st?.truncation.recordsUnscanned&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,children:t(`archiveScanBounded`,{count:st?.truncation.recordsUnscanned})}),!be&&nn&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,children:t(`loadedHistoryBounded`,{sessions:pe?.truncation.sessionsOmitted,workspaces:pe?.truncation.workspacesOmitted})}),be&&ht&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,role:`alert`,children:t(`restoreFailed`)}),(0,q.jsxs)(`div`,{className:`workspace-tree`,children:[(be?kt:He===`project`&&(!C||e.query.trim())?Lt:[]).map(e=>_n(e)),!be&&He===`project`&&ke&&De.current?.kind===`workspace`&&!e.query.trim()&&(0,q.jsx)(`section`,{className:`sidebar-project-tail `+(Ne===`project-tail`?`is-pin-drop-target`:``),"aria-label":t(`sidebarDropProjectLast`),onDragOver:e=>{Te||De.current?.kind!==`workspace`||(e.preventDefault(),e.dataTransfer.dropEffect=`move`,Pe(`project-tail`),Ie(null))},onDragLeave:e=>{(!(e.relatedTarget instanceof Node)||!e.currentTarget.contains(e.relatedTarget))&&Pe(null)},onDrop:t=>{if(Te||De.current?.kind!==`workspace`)return;t.preventDefault();let n=De.current;Ge(()=>e.actions.setWorkspaceOrder(n.path,null)),cn()},children:t(`sidebarDropProjectLast`)}),!be&&He===`project`&&!C&&!e.query.trim()&&It.length>6&&(0,q.jsx)(`button`,{className:`sidebar-show-more`,type:`button`,"aria-expanded":x,onClick:()=>S(e=>!e),children:t(x?`sidebarShowLess`:`sidebarShowMore`)}),!be&&(0,q.jsxs)(`section`,{className:`sidebar-recents`,"aria-label":t(`sidebarRecent`),children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`workspace-heading-label`,"aria-expanded":!T||!!e.query.trim(),onClick:()=>E(e=>!e),children:[t(`sidebarRecent`),(0,q.jsx)(is,{className:T&&!e.query.trim()?`is-collapsed`:``,"aria-hidden":`true`})]}),(0,q.jsx)(`div`,{className:`sidebar-section-actions`,children:(0,q.jsx)(MA,{label:t(`sidebarRecentOptions`),items:mn})})]}),(!T||!!e.query.trim())&&(0,q.jsx)(`ul`,{className:`recent-sessions`,children:Bt.map(e=>gn(e,!1,{key:`recent`,sessions:zt}))}),!T&&Bt.lengthA(e=>e+10),children:t(`sidebarShowMore`)})]}),(be?!kt.length:!Pt.length&&!zt.length&&(He===`list`||!It.length))&&(0,q.jsx)(`div`,{className:`empty`,hidden:be&&(nt||!!ct),children:e.query.trim()?t(be&&st?.truncation.recordsUnscanned?`noMatchingScannedArchives`:!be&&nn?`noMatchingLoaded`:`noMatching`):t(be?st?.truncation.recordsUnscanned?`noScannedArchives`:`noArchivedSessions`:`noSessions`)}),be&&st?.nextCursor&&ct?.kind!==`stale`&&(0,q.jsx)(`button`,{type:`button`,className:`sidebar-archive-more`,disabled:nt,onClick:()=>void lt(st.nextCursor),children:t(`moreArchives`)})]})]})]}),(0,q.jsx)(`div`,{className:`sidebar-footer`,children:(0,q.jsx)(V,{content:t(`settings`),placement:`above`,children:(0,q.jsxs)(`button`,{className:`sidebar-settings-button`,type:`button`,"aria-label":t(`settings`),"data-provider-settings-trigger":!0,disabled:e.settingsDisabled,onClick:e.onOpenSettings,children:[(0,q.jsx)(Ac,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:t(`settings`)})]})})}),(0,q.jsx)(Se,{isOpen:!!c,onOpenChange:e=>!e&&!yt.current&&l(null),purpose:`form`,width:400,"aria-label":c?.kind===`workspace`?t(`renameWorkspace`):t(`renameConversation`),children:(0,q.jsxs)(`form`,{className:`openpi-dialog`,onSubmit:e=>{e.preventDefault(),an()},children:[(0,q.jsx)(`strong`,{children:c?.kind===`workspace`?t(`renameWorkspace`):t(`renameConversation`)}),(0,q.jsx)(`input`,{ref:ce,value:ne,maxLength:80,disabled:_t,"aria-label":c?.kind===`workspace`?t(`workspaceName`):t(`conversationName`),onChange:e=>re(e.target.value)}),ie&&(0,q.jsx)(`p`,{className:`sidebar-dialog-error`,role:`alert`,children:t(`renameFailed`)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:_t,onClick:()=>{yt.current||l(null)},children:t(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,className:`primary`,disabled:_t||!ne.trim()||ne.trim()===c?.name,children:t(_t?`savingName`:`save`)})]})]})}),o&&(0,q.jsx)(CA,{workspace:o,client:ye,actions:e.actions,connected:e.connected!==!1,onClose:()=>{s(null),a.current?.()}},o),(0,q.jsx)(Se,{isOpen:!!z,onOpenChange:e=>!e&&!St.current&&B(null),purpose:`form`,width:440,"aria-label":t(`removeWorkspace`),children:(0,q.jsxs)(`div`,{className:`openpi-dialog`,children:[(0,q.jsx)(`strong`,{children:t(`removeWorkspace`)}),(0,q.jsx)(`p`,{className:`sidebar-dialog-path`,children:z?.path}),(0,q.jsxs)(`p`,{children:[z?.name,`:`,t(`workspaceDeleteConfirm`)]}),Ct&&(0,q.jsx)(`p`,{className:`sidebar-dialog-error`,role:`alert`,children:t(`workspaceRemoveFailed`)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:bt,onClick:()=>{St.current||B(null)},children:t(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`danger`,disabled:bt,onClick:()=>void on(),children:t(bt?`removingWorkspace`:`removeWorkspace`)})]})]})})]})}var PA=(0,K.createContext)(null);PA.displayName=`LayoutAreaContext`;var FA=(0,K.createContext)({hasHeader:!1,hasFooter:!1,hasStart:!1,hasEnd:!1});FA.displayName=`LayoutSlotsContext`;var IA={center:{kGNEyG:`x6s0dn4`,$$css:!0},end:{kGNEyG:`xuk3077`,$$css:!0},start:{kGNEyG:`x1cy8zhl`,$$css:!0},stretch:{kGNEyG:`x1qjc9v5`,$$css:!0}},LA={start:{kjj79g:`x1nhvcw1`,$$css:!0},center:{kjj79g:`xl56j7k`,$$css:!0},end:{kjj79g:`x13a6bvl`,$$css:!0},between:{kjj79g:`x1qughib`,$$css:!0},around:{kjj79g:`x1l1ennw`,$$css:!0},evenly:{kjj79g:`xaw8158`,$$css:!0}},RA={horizontal:{kXwgrk:`x1q0g3np`,$$css:!0},vertical:{kXwgrk:`xdt5ytf`,$$css:!0}},zA={nowrap:{kwnvtZ:`xozqiw3`,$$css:!0},wrap:{kwnvtZ:`x1a02dak`,$$css:!0},"wrap-reverse":{kwnvtZ:`x8hhl5t`,$$css:!0}},BA={stack:{k1xSpc:`x78zum5`,$$css:!0}},VA={0:{k1C7PZ:`x1o57wo1`,khm7nJ:`x6yxi7o`,$$css:!0},1:{k1C7PZ:`x1lfs0n9`,khm7nJ:`x1ngg2t4`,$$css:!0},2:{k1C7PZ:`xak3so`,khm7nJ:`x1x7z4sm`,$$css:!0},3:{k1C7PZ:`xewh9hi`,khm7nJ:`x4olc9o`,$$css:!0},4:{k1C7PZ:`xty4p9g`,khm7nJ:`xtx9w7w`,$$css:!0},5:{k1C7PZ:`x1eqhezk`,khm7nJ:`x1iu6piu`,$$css:!0},6:{k1C7PZ:`x3qlgwd`,khm7nJ:`xczp1bk`,$$css:!0},8:{k1C7PZ:`xicv188`,khm7nJ:`xgx0vcf`,$$css:!0},10:{k1C7PZ:`x1p37tyl`,khm7nJ:`x1xpicb7`,$$css:!0},"0.5":{k1C7PZ:`x1kihgfc`,khm7nJ:`x1tw44j4`,$$css:!0},"1.5":{k1C7PZ:`x1thn6ci`,khm7nJ:`xhq53yo`,$$css:!0}};function HA({crossAlign:e,direction:t,gap:n,mainAlign:r,wrap:i}){return[BA.stack,RA[t],n!=null&&VA[n],e!=null&&IA[e],r!=null&&LA[r],i!=null&&zA[i]]}var UA={reset:{kAzted:`x2lwn1j`,k7Eaqz:`xeuugli`,$$css:!0}},WA={center:{kSGwAc:`xamitd3`,$$css:!0},end:{kSGwAc:`xpvyfi4`,$$css:!0},start:{kSGwAc:`xqcrz7y`,$$css:!0},stretch:{kSGwAc:`xkh2ocl`,$$css:!0}},GA={fill:{kzQI83:`x1iyjqo2`,$$css:!0},static:{kzQI83:`x1c4vz4f`,kmuXW:`x2lah0s`,$$css:!0}};function KA({crossAlignSelf:e,size:t}={}){return[UA.reset,GA[t??`static`],e!=null&&WA[e]]}var qA={layoutOuter:{keTefX:`xojxgvx`,k71WvV:`x1fcf3bl`,keoZOQ:`x1sa9bsh`,k1K539:`x6h7pi7`,$$css:!0},layoutInner:{"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0},fill:{kZKoxP:`x12qplqi`,kskxy:`xenllk4`,$$css:!0},auto:{kAzted:`x1us19tq`,$$css:!0},middle:{kUk6DE:`x98rzlu`,kAzted:`x2lwn1j`,$$css:!0},fullBleed:{"--layout-padding-outer-x":`x1wbjvqu`,"--layout-padding-outer-y":`xzxxx64`,$$css:!0}},JA={kzqmXN:`xh8yej3`,kUOVxO:`xvueqy4`,$$css:!0},YA={contentWidthVar:e=>[{"--layout-content-width":(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`x4906uf`,$$css:!0},{"--x---layout-content-width":(typeof e==`number`?`${e}px`:e)==null?void 0:typeof e==`number`?`${e}px`:e}],contentWidth:e=>[JA,{ks0D6T:(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`xf68679`,$$css:!0},{"--x-maxWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(typeof e==`number`?`${e}px`:e)}]};function XA({area:e,children:t}){return t==null?null:(0,q.jsx)(PA,{value:e,children:t})}var ZA={"x-default-marker":`x-default-marker`,$$css:!0};function QA({children:e,content:t,contentWidth:n,defaultHasDividers:r,end:i,footer:a,header:o,height:s=`fill`,padding:c,ref:l,start:u,xstyle:d,className:f,style:p}){let m=s===`fill`,h=t??e,g=(0,K.useMemo)(()=>r==null?null:{defaultHasDividers:r},[r]),_=o!=null,v=a!=null,y=u!=null,x=i!=null,S=(0,K.useMemo)(()=>({hasHeader:_,hasFooter:v,hasStart:y,hasEnd:x}),[_,v,y,x]),C=(0,q.jsx)(FA,{value:S,children:(0,q.jsx)(`div`,{ref:l,...H(O(`layout`,{height:s}),w(qA.layoutOuter,m?qA.fill:qA.auto,d),f,p),children:(0,q.jsxs)(`div`,{...w(ZA,qA.layoutInner,...HA({direction:`vertical`}),m?qA.fill:qA.auto,c===0&&qA.fullBleed,c!=null&&oe[c],c!=null&&b[c],n!=null&&YA.contentWidthVar(n)),children:[(0,q.jsx)(XA,{area:`header`,children:o}),(0,q.jsxs)(`div`,{...w(...HA({direction:`horizontal`}),qA.middle,n!=null&&YA.contentWidth(n)),children:[(0,q.jsx)(XA,{area:`start`,children:u}),(0,q.jsx)(`div`,{...w(...KA({size:`fill`})),children:(0,q.jsx)(XA,{area:`content`,children:h})}),(0,q.jsx)(XA,{area:`end`,children:i})]}),(0,q.jsx)(XA,{area:`footer`,children:a})]})})});return g==null?C:(0,q.jsx)(iO,{value:g,children:C})}QA.displayName=`Layout`;var $A={content:{kB7OPa:`x9f619`,kZKoxP:`x5yr21d`,kUk6DE:`x98rzlu`,kAzted:`x2lwn1j`,kVQacm:`x7giv3`,kZCmMZ:`xwjyata`,kwRFfy:`x1peupej`,kLKAdn:`xqty4a x1ioh5az`,kGO01o:`xg476vw xsg11nj`,"--container-padding-inline-start":`x408pgh`,"--container-padding-inline-end":`xikqloz`,"--container-padding-block-start":`xjmgx01`,"--container-padding-block-end":`xi9ns85`,$$css:!0},noStart:{kZCmMZ:`x139j0dd`,"--container-padding-inline-start":`xdvaxxn`,"--container-padding-inline-end":`xqpvj4r`,$$css:!0},noEnd:{kwRFfy:`xpc6k2p`,$$css:!0},noHeader:{kLKAdn:`x81pis9`,"--container-padding-block-start":`xzz8v79`,$$css:!0},noFooter:{kGO01o:`xon7vh3`,"--container-padding-block-end":`x1xjq73n`,$$css:!0},scrollable:{kVQacm:`xysyzu8`,$$css:!0},fullBleed:{kZCmMZ:`x1c1uobl`,kwRFfy:`xyri2b`,kLKAdn:`xexx8yu`,kGO01o:`x18d9i69`,"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0}};function ej({children:e,isScrollable:t=!0,padding:n,label:r,role:i,xstyle:a,className:s,style:c,ref:l,...u}){let{hasHeader:d,hasFooter:f,hasStart:p,hasEnd:m}=(0,K.use)(FA),h=n===0;return(0,q.jsx)(`div`,{ref:l,role:i,"aria-label":r,...H(O(`layout-content`),w($A.content,!p&&!h&&n==null&&$A.noStart,!m&&!h&&n==null&&$A.noEnd,!d&&!h&&n==null&&$A.noHeader,!f&&!h&&n==null&&$A.noFooter,t&&$A.scrollable,h&&$A.fullBleed,n!=null&&I[n],n!=null&&o[n],n!=null&&y[n],n!=null&&se[n],a),s,c),...u,children:e})}ej.displayName=`LayoutContent`;var tj={footer:{kmuXW:`x2lah0s`,$$css:!0},inner:{kB7OPa:`x9f619`,ks0D6T:`xjl2t3p`,kUOVxO:`xvueqy4`,kZCmMZ:`x139j0dd`,kwRFfy:`xpc6k2p`,kLKAdn:`xqty4a`,kGO01o:`xon7vh3`,"--container-padding-inline-start":`xdvaxxn`,"--container-padding-inline-end":`xqpvj4r`,"--container-padding-block-start":`xjmgx01`,"--container-padding-block-end":`x1xjq73n`,$$css:!0},fullBleed:{kZCmMZ:`x1c1uobl`,kwRFfy:`xyri2b`,kLKAdn:`xexx8yu`,kGO01o:`x18d9i69`,"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0},divider:{kEafiO:`x178xt8z`,kPef9Z:`x13fuv20`,kLZC3w:`x1pc3f07`,$$css:!0}},nj={sizing:e=>[{kZKoxP:e==null?e:`x16ye13r`,$$css:!0},{"--x-height":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]};function rj({children:e,hasDivider:t,height:n,label:r,padding:i,role:a,xstyle:s,className:c,style:l,ref:u,...d}){let f=(0,K.use)(iO),p=t??f?.defaultHasDividers??!1,m=i===0;return(0,q.jsx)(`div`,{ref:u,role:a,"aria-label":r,"data-divider":p||void 0,...H(O(`layout-footer`),w(tj.footer,nj.sizing(n??null),p&&tj.divider,s),c,l),...d,children:(0,q.jsx)(`div`,{...w(tj.inner,m&&tj.fullBleed,i!=null&&I[i],i!=null&&o[i],i!=null&&y[i],i!=null&&se[i]),children:e})})}rj.displayName=`LayoutFooter`;var ij={scrollable:{kVQacm:`xysyzu8`,$$css:!0}};function aj({direction:e=`vertical`,hAlign:t,vAlign:n,justify:r,align:i,gap:o,padding:c,paddingInline:l,paddingInlineStart:u,paddingInlineEnd:d,paddingBlock:f,paddingBlockStart:p,paddingBlockEnd:m,isScrollable:h,width:_,height:v,maxWidth:y,minHeight:b,wrap:x,as:S=`div`,xstyle:C,className:T,style:E,children:D,ref:k,...A}){let j=t??(e===`horizontal`?r:i),M=n??(e===`horizontal`?i:r),N=e===`horizontal`?j:M,P=e===`horizontal`?M:j,F=u??l??c,I=d??l??c,L=p??f??c,R=m??f??c,te=w(...HA({direction:e,crossAlign:P,mainAlign:N,gap:o,wrap:x}),F!=null&&a[F],I!=null&&ee[I],L!=null&&g[L],R!=null&&s[R],h&&ij.scrollable,C),z={..._!=null&&{width:typeof _==`number`?`${_}px`:_},...v!=null&&{height:typeof v==`number`?`${v}px`:v},...y!=null&&{maxWidth:typeof y==`number`?`${y}px`:y},...b!=null&&{minHeight:typeof b==`number`?`${b}px`:b}};return(0,K.createElement)(S,{ref:k,...H(O(`stack`,{direction:e,gap:o,wrap:x}),te,T,{...E,...z}),...A},D)}aj.displayName=`Stack`;function oj({ref:e,justify:t,align:n,hAlign:r,vAlign:i,...a}){return(0,q.jsx)(aj,{...a,direction:`horizontal`,hAlign:r??t,vAlign:i??n,ref:e})}oj.displayName=`HStack`;function sj({ref:e,justify:t,align:n,hAlign:r,vAlign:i,...a}){return(0,q.jsx)(aj,{...a,direction:`vertical`,hAlign:r??n,vAlign:i??t,ref:e})}sj.displayName=`VStack`;var cj=`(max-width: 640px)`,lj={action:{ks0D6T:`x193iq5w`,k7Eaqz:`xeuugli`,$$css:!0},stackedAction:{kzqmXN:`xh8yej3`,$$css:!0}};function uj({ref:e,isOpen:t,isInline:n,onOpenChange:r,title:i,description:a,cancelLabel:o,actionLabel:s,actionVariant:c=`destructive`,isActionLoading:l,onAction:u,width:d=400,xstyle:f,className:p,style:m,"data-testid":h,...g}){let _=jr(),v=o??_(`@astryx.alertDialog.cancel`),y=(0,K.useId)(),b=(0,K.useId)(),x=Hi(cj),S=(0,K.useCallback)(()=>{r(!1)},[r]),C=[lj.action,x&&lj.stackedAction],w=(0,q.jsx)(Br,{variant:`ghost`,label:v,onClick:S,xstyle:C,"data-autofocus":!0},`cancel`),T=(0,q.jsx)(Br,{variant:c,label:s,onClick:u,isLoading:l,xstyle:C},`action`);return(0,q.jsx)(Se,{...g,ref:e,isOpen:t,isInline:n,onOpenChange:r,width:d,purpose:`form`,role:n?`group`:`alertdialog`,"aria-labelledby":y,"aria-describedby":b,...H(O(`alert-dialog`),{className:p,style:m}),xstyle:f,"data-testid":h,children:(0,q.jsx)(QA,{content:(0,q.jsxs)(ej,{children:[(0,q.jsx)(sO,{level:2,id:y,children:i}),(0,q.jsx)(jt,{type:`body`,color:`secondary`,id:b,children:a})]}),footer:(0,q.jsx)(rj,{children:(0,q.jsx)(aj,{direction:x?`vertical`:`horizontal`,gap:2,hAlign:x?`stretch`:`end`,wrap:x?`nowrap`:`wrap`,children:x?[T,w]:[w,T]})})})})}uj.displayName=`AlertDialog`;var dj={x1iwu4tg:`x1iwu4tg`,$$css:!0},fj={sm:{kzqmXN:`x1td3qas`,kZKoxP:`x1qx5ct2`,$$css:!0},md:{kzqmXN:`x100vrsf`,kZKoxP:`xxk0z11`,$$css:!0}},pj={sm:{kzqmXN:`x1td3qas`,kZKoxP:`x1qx5ct2`,$$css:!0},md:{kzqmXN:`x100vrsf`,kZKoxP:`xxk0z11`,$$css:!0}},mj={sm:{kzqmXN:`x1td3qas`,kZKoxP:`x1qx5ct2`,kmVPX3:`x1i3ajwb`,$$css:!0},md:{kzqmXN:`x100vrsf`,kZKoxP:`xxk0z11`,kmVPX3:`xfawy5m`,$$css:!0}},hj={sm:{kzqmXN:`x6jxa94`,kZKoxP:`x1v9usgg`,k3aq6I:`xbryuvx`,$$css:!0},md:{kzqmXN:`x1kky2od`,kZKoxP:`xlup9mm`,k3aq6I:`xbryuvx`,$$css:!0}},gj={sm:{kzqmXN:`x1kky2od`,kZKoxP:`xlup9mm`,k3aq6I:`xv5t66b xi9aj42`,$$css:!0},md:{kzqmXN:`xw4jnvo`,kZKoxP:`x1qx5ct2`,k3aq6I:`x15481yp x12xz5k6`,$$css:!0}},_j={sm:{kAzted:`xisnujt`,$$css:!0},md:{kAzted:`xjwf9q1`,$$css:!0}},vj={container:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`x1txdalj`,$$css:!0},containerLabelHidden:{kOIVth:`xxhr3t`,$$css:!0},containerSpread:{kjj79g:`x1qughib`,kzqmXN:`xh8yej3`,$$css:!0},statusGap:{keoZOQ:`xtbrsbv`,$$css:!0},switchWrapper:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kmuXW:`x2lah0s`,kHBbk8:`xc8icb0`,$$css:!0},input:{kVAEAm:`x10l6tqk`,kogj98:`x1ghz6dp`,kmVPX3:`x1717udv`,kSiTet:`xg01cxk`,kkrTdU:`x1ypdohk x16khyan`,kY2c9j:`x1vjfegm`,k7Eaqz:`xkagaj0`,kAzted:`x80b3aj`,k87sOh:`xijlfn0`,kLqNvP:`x1hsn8va`,k3aq6I:`x8i4i9p`,$$css:!0},inputDisabled:{kkrTdU:`xt0e3qv`,$$css:!0},inputBusy:{kfzvcC:`x47corl`,$$css:!0},track:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kaIpWk:`xjspbzw`,k1ekBW:`x15406qy`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,kB7OPa:`x9f619`,kMzoRj:`xc342km x13rsnn2`,ksu8eU:`xng3xce xx61lck`,kVAM5u:`x1w1tqly`,$$css:!0},trackFocus:{kI3sdo:`x1a2a7pz xafswnp`,kInvED:`xwz5zln`,$$css:!0},trackOff:{kWkggS:`xspzpui x1a8ae7b x9yvj25`,$$css:!0},trackOn:{kWkggS:`x1ewilqj xcgwt1n x1jzqe4`,$$css:!0},trackDisabled:{kSiTet:`xbyyjgo`,kVAM5u:`xmnqt3w`,$$css:!0},trackDisabledOff:{kWkggS:`xspzpui`,$$css:!0},thumb:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kaIpWk:`xjspbzw`,k1ekBW:`xh3q6i0`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,$$css:!0},thumbOff:{kWkggS:`x10xzikg xwvh9j7`,$$css:!0},thumbOn:{kWkggS:`x10xzikg x1sir5s4`,$$css:!0},labelWrapper:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,kjj79g:`xl56j7k`,$$css:!0}},yj={width:e=>[{kzqmXN:e==null?e:`x5lhr3w`,$$css:!0},{"--x-width":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]};function bj({label:e,isLabelHidden:t=!1,description:n,onChange:r,changeAction:i,isLoading:a=!1,value:o,isDisabled:s=!1,htmlName:c,disabledMessage:l,isOptional:u=!1,isRequired:d=!1,onFocus:f,onBlur:p,labelIcon:m,labelTooltip:h,labelPosition:g=`end`,labelSpacing:_=`hug`,status:v,size:y=`md`,width:b,xstyle:x,className:S,style:C,ref:T,...E}){let D=(0,K.useId)(),k=(0,K.useId)(),A=(0,K.useId)(),j=YO({isRequired:d,isOptional:u}),[,M]=(0,K.useTransition)(),[N,P]=(0,K.useOptimistic)(o),I=a||N!==o,ee=N===!0,L=s&&!!l,R=F({placement:`above`,focusTrigger:`always`,isEnabled:L}),te=[];n&&te.push(k),v?.message&&te.push(A),L&&te.push(R.describedBy);let z=te.length>0?te.join(` `):void 0,B=(0,q.jsxs)(`div`,{...w(vj.switchWrapper,fj[y]),children:[(0,q.jsx)(`input`,{ref:we(T,R.positionRef),id:D,type:`checkbox`,role:`switch`,name:s?void 0:c,checked:ee,disabled:s&&!L,"aria-disabled":L?`true`:void 0,form:L?``:void 0,required:d,"aria-required":j?`true`:void 0,onChange:e=>{if(s||I)return;let t=e.target.checked;r?.(t,e),i&&!e.defaultPrevented&&M(async()=>{P(t),await i(t,e)})},onFocus:f,onBlur:p,"aria-describedby":z,"aria-invalid":v?.type===`error`||void 0,"aria-busy":I||void 0,...w(vj.input,pj[y],s&&vj.inputDisabled,I&&vj.inputBusy)}),(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(O(`switch`,{checked:ee?`checked`:null,disabled:s?`disabled`:null,size:y}),w(vj.track,mj[y],ee?vj.trackOn:vj.trackOff,!s&&vj.trackFocus,s&&vj.trackDisabled,s&&!ee&&vj.trackDisabledOff)),children:(0,q.jsx)(`div`,{...H(O(`switch-thumb`,{checked:ee?`checked`:null,size:y}),w(vj.thumb,ee?gj[y]:hj[y],ee?vj.thumbOn:vj.thumbOff)),children:I&&(0,q.jsx)(Gt,{size:`sm`})})}),I&&(0,q.jsx)(Kt,{role:`status`,children:`Loading`})]}),ne=(0,q.jsx)(`div`,{...w(vj.labelWrapper,_j[y]),children:(0,q.jsx)(MO,{...O(`switch-label`),label:e,inputID:D,isLabelHidden:t,isDisabled:s,isOptional:u,isRequired:d,labelIcon:m,labelTooltip:h,description:n,descriptionID:k})});return(0,q.jsxs)(`div`,{...H(O(`switch-field`,{labelPosition:g===`end`?void 0:g,labelSpacing:_===`hug`?void 0:_}),w(b!=null&&yj.width(b),x),S,C),...E,children:[(0,q.jsxs)(`div`,{ref:e=>{R.interactionRef(e)},...w(vj.container,t&&vj.containerLabelHidden,_===`spread`&&vj.containerSpread,!s&&dj),children:[` `,g===`start`?(0,q.jsxs)(q.Fragment,{children:[ne,B]}):(0,q.jsxs)(q.Fragment,{children:[B,ne]})]}),v?.message&&(0,q.jsx)(IO,{type:v.type,message:v.message,id:A,variant:`detached`,xstyle:vj.statusGap}),L&&R.renderTooltip(l)]})}bj.displayName=`Switch`;var xj=[`chrome`,`edge`,`brave`,`chromium`,`safari`,`firefox`],Sj=[`embedded`,...xj],Cj=e=>xj.some(t=>t===e);function wj(){let[e,t]=(0,K.useState)(),n=(0,K.useRef)(void 0),r=(0,K.useRef)(!1),i=(0,K.useRef)(!0),a=(0,K.useRef)(void 0),o=(0,K.useCallback)(()=>{a.current?.(),a.current=void 0,n.current?.close(),n.current=void 0,i.current&&t(void 0)},[]);return(0,K.useEffect)(()=>(i.current=!0,window.addEventListener(`pagehide`,o),()=>{i.current=!1,window.removeEventListener(`pagehide`,o),o()}),[o]),{container:e,open:async()=>{if(n.current&&!n.current.closed)return n.current.focus(),!0;if(r.current)return!1;r.current=!0;try{let e=window.documentPictureInPicture,r=e?await e.requestWindow({width:460,height:740}):window.open(`about:blank`,`_blank`,`popup,width=460,height=740`);if(!r)return!1;if(!i.current)return r.close(),!1;n.current=r,r.document.title=`OpenPI Browser Bridge`;let o=()=>{r.document.documentElement.lang=document.documentElement.lang,r.document.documentElement.dataset.theme=document.documentElement.dataset.theme,r.document.documentElement.style.cssText=document.documentElement.style.cssText};o(),r.document.documentElement.classList.add(`browser-guide-window`);for(let e of document.styleSheets)try{let t=r.document.createElement(`style`);t.textContent=[...e.cssRules].map(e=>e.cssText).join(` `),r.document.head.append(t)}catch{if(!e.href)continue;let t=r.document.createElement(`link`);t.rel=`stylesheet`,t.href=e.href,r.document.head.append(t)}let s=r.document.createElement(`main`);s.className=`browser-settings browser-settings-detached`,r.document.body.append(s);let c=new MutationObserver(o);c.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`,`style`,`lang`]});let l=()=>{c.disconnect(),n.current===r&&(n.current=void 0,a.current=void 0,i.current&&t(void 0))};return r.addEventListener(`pagehide`,l,{once:!0}),a.current=()=>{c.disconnect(),r.removeEventListener(`pagehide`,l)},t(s),!0}catch{return o(),!1}finally{r.current=!1}},close:o,isOpen:()=>!!(n.current&&!n.current.closed)}}function Tj({id:e,name:t,label:n,value:r,options:i,disabled:a=!1,onChange:o,className:s,menuWidth:c=`min(300px, calc(100vw - 32px))`}){let l=i.find(e=>e.value===r);return(0,q.jsx)(yo,{button:{id:e,name:t,label:l?.label??r,"aria-label":n,variant:`secondary`,size:`sm`,className:`settings-select-menu-trigger${s?` ${s}`:``}`,isDisabled:a},className:`settings-select-menu`,menuWidth:c,alignment:`end`,children:(0,q.jsx)(Bo,{value:r,label:n,onChange:e=>{e!==r&&o(e)},children:i.map(e=>(0,q.jsx)(Ho,{value:e.value,label:e.label,isDisabled:a||e.disabled,description:e.description?(0,q.jsx)(`span`,{className:`settings-select-option-description`,children:e.description}):void 0},e.value))})})}var Ej={chrome:`Chrome`,edge:`Microsoft Edge`,brave:`Brave`,chromium:`Chromium`,safari:`Safari`,firefox:`Firefox`};function Dj({browser:e}){return(0,q.jsx)(`span`,{className:`browser-settings-mark ${e}`,"aria-hidden":`true`,children:e===`chrome`||e===`chromium`?(0,q.jsx)(`i`,{}):(0,q.jsx)(Es,{})})}function Oj({onConfigure:e,setupPending:t=!1}){let{t:n}=W(),r=wj(),i=(0,K.useRef)(r.isOpen);i.current=r.isOpen;let[a,o]=(0,K.useState)(),[s,c]=(0,K.useState)(),[l,u]=(0,K.useState)(!1),d=l||t,[f,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(),[g,_]=(0,K.useState)(`chrome`),[v,y]=(0,K.useState)(1),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(),w=(0,K.useRef)(0),T=(0,K.useRef)(null),E=(0,K.useRef)(null),D=(0,K.useRef)(!0);(0,K.useEffect)(()=>{m&&(T.current?.scrollIntoView?.({block:`start`}),E.current?.focus({preventScroll:!0}))},[m,v,r.container]);let O=(0,K.useCallback)(async()=>{let e=++w.current;try{let t=await new de().request(`/api/settings/browser`);return D.current&&e===w.current&&(o(t),c(void 0)),t}catch(t){D.current&&e===w.current&&c(t instanceof Error?t.message:String(t));return}},[]);(0,K.useEffect)(()=>{D.current=!0,O();let e=setInterval(()=>{(document.visibilityState===`visible`||i.current())&&O()},3e3),t=()=>void O();return window.addEventListener(`focus`,t),()=>{D.current=!1,clearInterval(e),window.removeEventListener(`focus`,t)}},[O]);let k=async t=>{u(!0),c(void 0),C(void 0),++w.current;try{let r=await e(`Configure browser access: ${[t.control===void 0?void 0:`browser_control=${t.control}`,t.embedded===void 0?void 0:`browser_embedded=${t.embedded}`,t.defaultBrowser===void 0?void 0:`browser_default=${JSON.stringify(t.defaultBrowser)}`,t.externalBrowsers===void 0?void 0:`browser_external=${JSON.stringify(t.externalBrowsers)}`].filter(e=>e!==void 0).join(`, `)}. Preserve all other settings.`);if(!D.current)return;if(!r)throw Error(n(`setupRequestFailed`));C(n(`setupRequestAccepted`))}catch(e){await O(),D.current&&c(e instanceof Error?e.message:String(e))}finally{D.current&&u(!1)}},A=async(e,t)=>{u(!0),c(void 0),C(void 0);try{if(await new de().request(`/api/settings/browser/action`,{method:`POST`,body:JSON.stringify({browser:e,action:t})}),D.current)return!0}catch(e){D.current&&c(e instanceof Error?e.message:String(e))}finally{D.current&&u(!1)}return!1},j=e=>e===`embedded`?n(`browserEmbedded`):Ej[e];if(!a)return(0,q.jsxs)(`div`,{className:`browser-settings-load`,role:s?`alert`:`status`,children:[(0,q.jsx)(Es,{}),(0,q.jsx)(`p`,{children:s||n(`browserLoading`)}),s&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>void O(),children:n(`browserCheck`)})]});let{config:M}=a,N=a.profiles.find(e=>e.current&&e.connected&&e.version===a.extensionVersion),P=e=>a.profiles.filter(t=>t.connected&&t.version===a.extensionVersion&&(e===`embedded`?t.current&&![`safari`,`firefox`].includes(t.browser):t.browser===e)),F=e=>e===`embedded`?M.embedded:M.externalBrowsers.includes(e),I=(e,t)=>e===`embedded`?{embedded:t}:{externalBrowsers:t?[...new Set([...M.externalBrowsers,e])]:M.externalBrowsers.filter(t=>t!==e)},ee=e=>{h(e),y(1),C(void 0),x(!1),_(e===`embedded`?N&&![`safari`,`firefox`].includes(N.browser)?N.browser:`chrome`:e)},L=e=>{let t=P(e).length>0,r=e===`embedded`||a.browsers.some(t=>t.id===e&&t.installed),i=a.profiles.some(t=>t.connected&&t.version!==a.extensionVersion&&(e===`embedded`?t.current&&![`safari`,`firefox`].includes(t.browser):t.browser===e));return(0,q.jsxs)(`div`,{className:`browser-settings-row`,children:[(0,q.jsx)(Dj,{browser:e}),(0,q.jsxs)(`div`,{className:`browser-settings-description`,children:[(0,q.jsx)(`strong`,{children:j(e)}),(0,q.jsx)(`span`,{className:t?`connected`:``,children:t?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`i`,{}),n(`browserConnected`)]}):n(i?`browserUpdateNeeded`:r?`browserNeedsSetup`:`browserNotFound`)})]}),(0,q.jsx)(`button`,{className:`browser-settings-button`,type:`button`,disabled:l,"aria-label":n(t?`browserManageNamed`:`browserSetupNamed`,{browser:j(e)}),onClick:()=>ee(e),children:n(t?`browserManage`:`browserSetUp`)}),(0,q.jsx)(bj,{label:n(`browserAllowNamed`,{browser:j(e)}),isLabelHidden:!0,size:`sm`,value:F(e),isDisabled:d,onChange:t=>void k(I(e,t))})]},e)},R=m!==void 0&&P(m).length>0,te=a.browsers.some(e=>e.id===g&&e.installed),z=g===`safari`||g===`firefox`,B=z?a.portableExtensionPath??a.extensionPath:a.extensionPath,ne=g===`firefox`?`${B.replace(/[\\/]+$/,``)}/manifest.json`:B,re=z?`browser-extension-portable`:`browser-extension`,V=g===`safari`?n(`browserSafariSettings`):g===`firefox`?`about:debugging#/runtime/this-firefox`:`${g===`edge`?`edge`:g===`brave`?`brave`:`chrome`}://extensions/`,ie=n(g===`safari`?`browserSafariDeveloper`:g===`firefox`?`browserFirefoxThis`:`browserDeveloperMode`),ae=n(g===`safari`?`browserSafariTemporary`:g===`firefox`?`browserFirefoxTemporary`:`browserLoadUnpacked`),oe=[n(`browserStepOpen`),ie,n(`browserStepAdd`),n(`browserStepConnect`)];return(0,q.jsxs)(`div`,{className:`settings-content-page browser-settings`,children:[(0,q.jsxs)(`header`,{className:`browser-settings-heading`,children:[(0,q.jsx)(`h1`,{children:n(`browserSettings`)}),(0,q.jsx)(`p`,{children:n(`browserSettingsIntro`)})]}),(0,q.jsxs)(`div`,{className:`browser-settings-card browser-settings-main-card`,children:[(0,q.jsxs)(`div`,{className:`browser-settings-control`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:n(`browserControl`)}),(0,q.jsx)(`p`,{children:n(`browserControlHint`)})]}),(0,q.jsx)(bj,{label:n(`browserControl`),isLabelHidden:!0,size:`sm`,value:M.control,isDisabled:d,onChange:e=>void k({control:e})})]}),(0,q.jsxs)(`div`,{className:`browser-settings-default`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{htmlFor:`browser-default`,children:n(`browserDefault`)}),(0,q.jsx)(`p`,{children:n(`browserDefaultHint`)})]}),(0,q.jsx)(Tj,{id:`browser-default`,label:n(`browserDefault`),value:M.defaultBrowser,disabled:d,onChange:e=>{let t=Sj.find(t=>t===e);t&&k({defaultBrowser:t})},options:Sj.map(e=>({value:e,label:`${j(e)}${F(e)?``:` · ${n(`browserBlocked`)}`}`,disabled:!F(e)}))})]})]}),!F(M.defaultBrowser)&&(0,q.jsx)(`p`,{className:`browser-settings-warning`,role:`status`,children:n(`browserDefaultBlocked`)}),(0,q.jsxs)(`div`,{className:`browser-settings-section-heading`,children:[(0,q.jsx)(`h2`,{children:n(`browserAllowedTitle`)}),(0,q.jsx)(`span`,{children:!M.control&&n(`browserOffHint`)})]}),(0,q.jsxs)(`div`,{className:`browser-settings-card`,children:[L(`embedded`),L(`chrome`),(0,q.jsxs)(`details`,{className:`browser-settings-more`,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(os,{}),n(`browserMore`)]}),xj.filter(e=>e!==`chrome`).map(L)]})]}),(0,q.jsx)(`p`,{className:`browser-settings-example`,children:n(`browserSpeakHint`)}),r.container&&(0,q.jsxs)(`div`,{className:`browser-settings-guide-placeholder`,role:`status`,children:[(0,q.jsx)(`p`,{children:n(`browserGuideDetached`)}),(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-button`,onClick:()=>void r.open(),children:n(`browserShowGuide`)}),(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-text-button`,onClick:r.close,children:n(`browserGuideInline`)})]}),m!==void 0&&(e=>r.container?(0,$c.createPortal)(e,r.container):e)((0,q.jsxs)(`section`,{ref:T,className:`browser-settings-guide`,"aria-label":n(`browserGuideTitle`,{browser:j(m)}),children:[(0,q.jsxs)(`div`,{className:`browser-settings-guide-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{children:n(R?`browserConnectionTitle`:`browserGuideEyebrow`)}),(0,q.jsx)(`h3`,{children:n(`browserGuideTitle`,{browser:j(m)})})]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:l,"aria-label":n(`browserCloseGuide`),onClick:()=>{r.close(),h(void 0)},children:(0,q.jsx)(je,{})})]}),!r.container&&!R&&(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-text-button`,onClick:async()=>{await r.open()||C(n(`browserGuideBlocked`))},children:[(0,q.jsx)(Os,{}),n(`browserGuidePopout`)]}),R?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`browser-settings-ready`,children:[(0,q.jsx)(ds,{}),n(`browserConnectionReady`)]}),(0,q.jsx)(`p`,{children:m===`embedded`?n(`browserEmbeddedDetail`):n(`browserExternalDetail`,{browser:j(m)})}),(0,q.jsxs)(`div`,{className:`browser-settings-guide-actions`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-button`,disabled:l,onClick:()=>void A(m===`embedded`?N.browser:m,`manage`),children:[n(`browserManageExtension`),(0,q.jsx)(Os,{})]}),(!F(m)||!M.control)&&(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-primary`,disabled:d,onClick:()=>void k({control:!0,...I(m,!0)}),children:n(`browserAllowUse`)}),F(m)&&M.defaultBrowser!==m&&(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-button`,disabled:d,onClick:()=>void k({defaultBrowser:m}),children:n(`browserMakeDefault`)})]})]}):(0,q.jsxs)(q.Fragment,{children:[m===`embedded`&&(0,q.jsxs)(`label`,{className:`browser-settings-install-browser`,htmlFor:`browser-install-target`,children:[n(`browserInstallIn`),(0,q.jsx)(Tj,{id:`browser-install-target`,label:n(`browserInstallIn`),value:g,disabled:l,onChange:e=>{let t=xj.find(t=>t===e);t&&(_(t),y(1),x(!1),C(void 0))},options:xj.filter(e=>![`safari`,`firefox`].includes(e)).map(e=>({value:e,label:Ej[e]}))})]}),(0,q.jsx)(`ol`,{className:`browser-settings-progress`,"aria-label":n(`browserSetupSteps`),children:oe.map((e,t)=>(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,"aria-current":v===t+1?`step`:void 0,"aria-label":n(`browserStepLabel`,{step:t+1,label:e}),disabled:l,onClick:()=>{y(t+1),C(void 0)},children:[(0,q.jsx)(`span`,{children:t+1}),e]})},e))}),(0,q.jsxs)(`div`,{className:`browser-settings-wizard`,"aria-live":`polite`,children:[(0,q.jsx)(`span`,{className:`browser-settings-step-count`,children:n(`browserStepCount`,{step:v,total:oe.length})}),(0,q.jsx)(`h4`,{ref:E,tabIndex:-1,children:n(v===1?`browserOpenManagerTitle`:v===2?g===`safari`?`browserSafariDeveloperTitle`:g===`firefox`?`browserFirefoxDeveloperTitle`:`browserDeveloperTitle`:v===3?`browserInstallTitle`:`browserConnectTitle`,{browser:Ej[g]})}),(0,q.jsx)(`p`,{children:n(v===1?g===`safari`?`browserSafariOpenHint`:`browserOpenManagerHint`:v===2?g===`safari`?`browserSafariDeveloperHint`:g===`firefox`?`browserFirefoxDeveloperHint`:`browserDeveloperHint`:v===3?g===`safari`?`browserSafariLoadHint`:g===`firefox`?`browserFirefoxLoadHint`:`browserLoadHint`:`browserConnectHint`,{browser:Ej[g],loadLabel:ae})}),v===1&&(0,q.jsxs)(`div`,{className:`browser-settings-address`,children:[(0,q.jsx)(Dj,{browser:g}),(0,q.jsx)(`code`,{children:V})]}),v===2&&(0,q.jsxs)(`figure`,{className:`browser-settings-illustration ${g}`,children:[(0,q.jsx)(`figcaption`,{children:n(`browserIllustration`,{browser:Ej[g]})}),(0,q.jsxs)(`div`,{className:`browser-settings-demo`,"aria-hidden":`true`,children:[(0,q.jsxs)(`div`,{className:`browser-settings-demo-bar`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`code`,{children:V})]}),(0,q.jsxs)(`div`,{className:`browser-settings-demo-heading`,children:[(0,q.jsx)(`span`,{children:n(`browserExtensions`)}),(0,q.jsxs)(`span`,{className:`browser-settings-demo-toggle highlight`,children:[ie,g!==`firefox`&&(0,q.jsx)(`i`,{})]})]}),(0,q.jsxs)(`div`,{className:`browser-settings-demo-toolbar`,children:[(0,q.jsx)(`span`,{children:ae}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]})]})]}),v===3&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`ol`,{className:`browser-settings-install-steps`,children:[(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{className:`browser-settings-install-label`,children:[(0,q.jsx)(`strong`,{children:n(g===`firefox`?`browserLocateManifest`:`browserLocateTarget`)}),(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-button`,disabled:l,onClick:()=>void A(g,`folder`),children:n(g===`firefox`?`browserRevealManifest`:`browserRevealTarget`)})]}),(0,q.jsxs)(`div`,{className:`browser-settings-selection`,children:[(0,q.jsx)(zs,{"aria-hidden":`true`}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:g===`firefox`?`manifest.json`:re}),(0,q.jsx)(`p`,{children:n(g===`firefox`?`browserSelectManifestHint`:`browserSelectFolderHint`)})]})]})]}),(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`strong`,{children:n(z?`browserLoadInBrowser`:`browserDragToBrowser`,{browser:Ej[g],loadLabel:ae})}),(0,q.jsx)(`p`,{children:n(z?`browserSelectLocatedTarget`:`browserDragFolderHint`,{browser:Ej[g],folder:re})}),(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-text-button`,disabled:l||!te,onClick:()=>void A(g,`manage`),children:[n(`browserOpenManager`,{browser:Ej[g]}),(0,q.jsx)(Os,{})]})]})]}),(0,q.jsxs)(`details`,{className:`browser-settings-picker-help`,children:[(0,q.jsx)(`summary`,{children:n(z?`browserManualSelection`:`browserManualInstall`)}),(0,q.jsxs)(`div`,{className:`browser-settings-install-label`,children:[(0,q.jsx)(`strong`,{children:n(`browserCopyLocation`)}),(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-button`,onClick:async e=>{let t=await td(ne,e.currentTarget.ownerDocument);x(t),C(t?void 0:n(`browserCopyFailed`))},children:[b?(0,q.jsx)(rs,{}):(0,q.jsx)(Ss,{}),n(b?`browserPathCopied`:`browserCopyPath`)]})]}),(0,q.jsx)(`code`,{className:`browser-settings-install-path`,children:ne}),(0,q.jsx)(`p`,{children:n(`browserLoadInBrowser`,{browser:Ej[g],loadLabel:ae})}),!z&&(0,q.jsx)(`p`,{children:n(`browserLoadAlternate`)}),(0,q.jsx)(`p`,{children:n(navigator.userAgent.includes(`Mac`)?`browserChooseFolderMac`:`browserChooseFolderOther`,{confirm:n(g===`firefox`?`browserConfirmFile`:`browserConfirmFolder`)})})]}),(0,q.jsx)(`p`,{className:`browser-settings-install-checkpoint`,children:n(`browserInstallCheckpoint`)})]}),v===4&&(0,q.jsxs)(`div`,{className:`browser-settings-waiting`,role:`status`,children:[(0,q.jsx)(me,{}),(0,q.jsx)(`span`,{children:n(`browserWaiting`)})]}),!te&&(0,q.jsx)(`p`,{className:`browser-settings-warning`,children:n(`browserInstallBrowserFirst`,{browser:Ej[g]})}),(0,q.jsxs)(`div`,{className:`browser-settings-wizard-actions`,children:[v>1&&(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-button`,disabled:l,onClick:()=>{y(v-1),C(void 0)},children:[(0,q.jsx)(Ko,{}),n(`browserPreviousStep`)]}),v===1&&(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-text-button`,disabled:l,onClick:()=>y(4),children:n(`browserAlreadyInstalled`)}),v<4?(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-primary`,disabled:l||!te,onClick:async()=>{(v===2||await A(g,v===1?`manage`:`connect`))&&y(v+1)},children:[n(l?`browserOpening`:v===1?`browserOpenManager`:v===2?g===`firefox`?`browserFirefoxDone`:`browserDeveloperDone`:`browserInstalledConnect`,{browser:Ej[g]}),v===2?(0,q.jsx)(qo,{}):(0,q.jsx)(Os,{})]}):(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-primary`,disabled:l||f,onClick:async()=>{p(!0);let e=await O();if(D.current){p(!1);let t=e?.profiles.some(t=>t.connected&&t.version===e.extensionVersion&&(m===`embedded`?t.current&&![`safari`,`firefox`].includes(t.browser):t.browser===m));C(n(t?`browserConnectionReady`:`browserNotConnectedYet`))}},children:[(0,q.jsx)(me,{className:f?`settings-spin`:``}),n(`browserCheck`)]})]}),v===4?(0,q.jsxs)(`div`,{className:`browser-settings-connect-help`,children:[(0,q.jsx)(`p`,{children:n(`browserAllowHint`)}),(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-text-button`,disabled:l||!te,onClick:()=>void A(g,`connect`),children:[n(`browserOpenIn`,{browser:Ej[g]}),(0,q.jsx)(Os,{})]})]}):v===2&&(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-text-button`,disabled:l||!te,onClick:()=>void A(g,`manage`),children:[n(`browserReopenManager`),(0,q.jsx)(Os,{})]})]})]}),(0,q.jsxs)(`details`,{className:`browser-settings-help`,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(is,{}),n(`browserHelp`)]}),(0,q.jsx)(`p`,{children:n(`browserReloadHint`)}),(0,q.jsx)(`p`,{children:n(`browserSupportedHint`)})]}),s&&(0,q.jsx)(`div`,{className:`browser-settings-error`,role:`alert`,children:s}),(0,q.jsx)(`div`,{className:`browser-settings-feedback`,role:`status`,"aria-live":`polite`,children:l?n(`browserSaving`):S})]})),!m&&s&&(0,q.jsxs)(`div`,{className:`browser-settings-error`,role:`alert`,children:[s,(0,q.jsx)(`button`,{type:`button`,onClick:()=>void O(),children:n(`browserCheck`)})]}),(0,q.jsx)(`div`,{className:`browser-settings-feedback`,role:`status`,"aria-live":`polite`,children:!m&&(l?n(`browserSaving`):S)})]})}function kj({label:e,value:t,options:n,disabled:r,onChange:i}){return(0,q.jsx)(yo,{button:{label:n.find(e=>e.value===t)?.label??t,"aria-label":e,variant:`secondary`,size:`sm`,className:`configuration-menu-trigger`,isDisabled:r},className:`configuration-menu`,menuWidth:`min(360px, calc(100vw - 32px))`,alignment:`end`,items:n.map(e=>({id:e.value,label:e.label,isDisabled:r,description:e.description?(0,q.jsx)(`span`,{className:`configuration-option-description`,children:e.description}):void 0,endContent:t===e.value?(0,q.jsx)(`span`,{className:`settings-select-check`,"aria-hidden":`true`,children:(0,q.jsx)(rs,{})}):void 0,onClick:()=>{e.value!==t&&i(e.value)}}))})}function Aj({catalog:e,error:t,pending:n,preferencePending:r,onConfigure:i,onUpdatePreferences:a,onRefresh:o,onOpenRuntimeStatus:s}){let{t:c}=W(),l=e?.setupWritable===!1||!!e?.resources.diagnostics.settingsErrors,u=n||r||!!t||!!e?.resources.diagnostics.settingsErrors,d=e?.setup.ui.webHiddenThinkingLevels??[],f=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],p=e?.setup.response?.verbosity??`default`,m=e?.setup.response?.reasoningSummary??`default`;return(0,q.jsxs)(`section`,{className:`settings-content-page settings-configuration-panel`,children:[(0,q.jsxs)(`header`,{className:`settings-page-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:c(`configurationSettings`)}),(0,q.jsx)(`p`,{children:c(`configurationIntro`)})]}),(0,q.jsx)(`button`,{type:`button`,"aria-label":c(`refreshStatus`),onClick:o,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]}),t&&(0,q.jsx)(`p`,{className:`inspection-warning`,role:`alert`,children:t}),!e&&!t&&(0,q.jsx)(`p`,{role:`status`,children:c(`settingsCatalogLoading`)}),l&&(0,q.jsxs)(`p`,{className:`inspection-warning`,role:`alert`,children:[c(`configurationReadFailure`),e?.setupDiagnostics?.map(e=>(0,q.jsxs)(`span`,{children:[e.path,`: `,e.message]},`${e.path}:${e.message}`))]}),e&&!l&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`configuration-scope`,children:[(0,q.jsxs)(`span`,{className:`configuration-scope-label`,children:[(0,q.jsx)(qc,{"aria-hidden":`true`}),c(`configurationUserScope`)]}),(0,q.jsx)(`span`,{children:c(`configurationSetupHint`)})]}),(0,q.jsxs)(`div`,{className:`configuration-group`,children:[(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationApproval`)}),(0,q.jsx)(`p`,{children:c(`configurationApprovalDetail`)})]}),(0,q.jsx)(`span`,{className:`configuration-readonly`,children:c(`configurationPiPermissions`)})]}),(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationSandbox`)}),(0,q.jsx)(`p`,{children:c(`configurationSandboxDetail`)})]}),(0,q.jsx)(`span`,{className:`configuration-readonly`,children:c(`configurationSandboxUnavailable`)})]}),(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`webSearchSettings`)}),(0,q.jsx)(`p`,{children:c(`configurationSearchDetail`)}),e.webSearch?.available!==!0&&(0,q.jsx)(`p`,{children:c(`webSearchUnsupported`)})]}),(0,q.jsx)(`div`,{className:`configuration-control`,children:(0,q.jsx)(kj,{label:c(`webSearchSettings`),value:e.setup.webSearch?.enabled===!0?`on`:`off`,options:[{value:`off`,label:c(`disabled`),description:c(`configurationSearchOff`)},{value:`on`,label:c(`enabled`),description:c(`configurationSearchOn`)}],disabled:u,onChange:e=>{i(c(e===`on`?`webSearchNativeRequest`:`webSearchDisableRequest`))}})})]}),(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationVerbosity`)}),(0,q.jsx)(`p`,{children:c(`configurationVerbosityDetail`)}),e.responseSupport?.verbosity!==!0&&(0,q.jsx)(`p`,{children:c(`configurationResponsesUnavailable`)})]}),(0,q.jsx)(`div`,{className:`configuration-control`,children:(0,q.jsx)(kj,{label:c(`configurationVerbosity`),value:p,options:[`default`,`low`,`medium`,`high`].map(e=>({value:e,label:c(`configurationVerbosity_${e}`),description:e==="default"?void 0:c(`configurationVerbosityHelp_${e}`)})),disabled:u||e.responseSupport?.verbosity!==!0,onChange:e=>{i(c(`configurationVerbosityRequest`,{value:e}))}})})]}),(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationSummary`)}),(0,q.jsx)(`p`,{children:c(`configurationSummaryDetail`)}),e.responseSupport?.reasoningSummary!==!0&&(0,q.jsx)(`p`,{children:c(`configurationSummaryUnavailable`)})]}),(0,q.jsx)(`div`,{className:`configuration-control`,children:(0,q.jsx)(kj,{label:c(`configurationSummary`),value:m,options:[`default`,`auto`,`concise`,`detailed`,`none`].map(e=>({value:e,label:c(`configurationSummary_${e}`),description:e==="default"?void 0:c(`configurationSummaryHelp_${e}`)})),disabled:u||e.responseSupport?.reasoningSummary!==!0,onChange:e=>{i(c(`configurationSummaryRequest`,{value:e}))}})})]})]}),(0,q.jsxs)(`section`,{className:`configuration-section`,children:[(0,q.jsx)(`h2`,{children:c(`configurationModelFeatures`)}),(0,q.jsx)(`div`,{className:`configuration-group`,children:(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationReasoningLevels`)}),(0,q.jsx)(`p`,{children:c(`configurationReasoningDetail`)})]}),(0,q.jsx)(`div`,{className:`configuration-control`,children:(0,q.jsx)(yo,{button:{label:c(`configurationReasoningCount`,{count:f.filter(e=>!d.includes(e)).length}),"aria-label":c(`configurationReasoningLevels`),variant:`secondary`,size:`sm`,className:`configuration-menu-trigger`,isDisabled:u},className:`configuration-level-menu`,menuWidth:`min(240px, calc(100vw - 32px))`,alignment:`end`,children:f.map(e=>(0,q.jsx)(Ro,{label:e,value:!d.includes(e),isDisabled:u,endContent:(0,q.jsx)(`span`,{className:`configuration-check`,children:!d.includes(e)&&(0,q.jsx)(rs,{"aria-hidden":`true`})}),onChange:t=>{a({thinkingLevelVisibility:{level:e,visible:t}})}},e))})})]})})]}),(0,q.jsxs)(`section`,{className:`configuration-section`,children:[(0,q.jsx)(`h2`,{children:c(`configurationDependencies`)}),(0,q.jsx)(`div`,{className:`configuration-group`,children:(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationEnvironment`)}),(0,q.jsx)(`p`,{children:c(`configurationEnvironmentDetail`)})]}),(0,q.jsxs)(`button`,{type:`button`,className:`configuration-runtime-button`,onClick:s,children:[c(`configurationRuntimeStatus`),(0,q.jsx)(Yo,{"aria-hidden":`true`})]})]})})]})]})]})}function jj({catalog:e,error:t,pending:n,onConfigure:r,onRefresh:i}){let{t:a}=W(),o=e?.setup.webSearch?.enabled===!0,s=e?.webSearch?.available===!0,c=n||!e||!!t||!!e?.resources.diagnostics.settingsErrors;return(0,q.jsxs)(`section`,{className:`settings-content-page settings-web-search-panel`,children:[(0,q.jsxs)(`header`,{className:`settings-page-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:a(`webSearchSettings`)}),(0,q.jsx)(`p`,{children:a(`webSearchIntro`)})]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button settings-heading-refresh`,"aria-label":a(`refreshStatus`),onClick:i,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]}),t&&(0,q.jsx)(`p`,{className:`inspection-warning`,role:`alert`,children:t}),!e&&!t&&(0,q.jsx)(`p`,{role:`status`,children:a(`settingsCatalogLoading`)}),(0,q.jsxs)(`section`,{className:`settings-control-group`,children:[(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsxs)(`div`,{className:`settings-control-copy`,children:[(0,q.jsx)(`h2`,{children:a(`webSearchCurrentModel`)}),(0,q.jsx)(`p`,{children:a(`webSearchNativeDetail`)})]}),(0,q.jsx)(Br,{label:a(o?`webSearchDisable`:`webSearchEnable`),variant:`secondary`,size:`sm`,isDisabled:c,isLoading:n,onClick:()=>void r(a(o?`webSearchDisableRequest`:`webSearchNativeRequest`))})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`div`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:a(`model`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:e?.webSearch?.model?`${e.webSearch.provider} / ${e.webSearch.model}`:a(`unavailable`)})]})]}),(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:a(`webSearchDefaultOff`)}),(0,q.jsx)(`p`,{role:`status`,className:`settings-resource-caption`,children:a(s?`webSearchSupported`:`webSearchUnsupported`)})]})}var Mj={wrapper:{k8WAf4:`xu0wf1k`,kg3NbH:`x7a5moj`,$$css:!0},icon:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kmuXW:`x2lah0s`,$$css:!0}};function Nj({ref:e,label:t,clearLabel:n,placeholder:r,value:i,onValueChange:a,onKeyDown:o,onFocus:s,onBlur:c,onContainerKeyDown:l,xstyle:u,className:d,style:f,...p}){let[m,h]=(0,K.useState)(!1);(0,K.useEffect)(()=>{D()},[]);let g=(0,K.useCallback)(e=>{h(N()===`keyboard`),s?.(e)},[s]),_=(0,K.useCallback)(e=>{h(!1),c?.(e)},[c]),v=(0,K.useCallback)(()=>{a(``),typeof e==`object`&&e?.current&&e.current.focus()},[a,e]);return(0,q.jsx)(`div`,{onKeyDown:l,...H(w(Mj.wrapper,u),d,f),children:(0,q.jsxs)(`div`,{"data-keyboard-focus":m?`true`:void 0,...{0:{className:`x9f619 x78zum5 x6s0dn4 x1txdalj xh8yej3 x1vofgu7 xf314gf xh6dtrn xkdsq27 xuedmi6 x12w9bfk xlr8y92`},1:{className:`x9f619 x78zum5 x6s0dn4 x1txdalj xh8yej3 x1vofgu7 xf314gf xh6dtrn xkdsq27 xuedmi6 x12w9bfk xlr8y92 x1gnnqk1 x1btxeh5`}}[!!m<<0],children:[(0,q.jsx)(ya,{icon:`search`,size:`sm`,color:`secondary`,xstyle:Mj.icon}),(0,q.jsx)(`input`,{ref:e,type:`text`,"aria-label":t,placeholder:r,value:i,onChange:e=>a(e.target.value),onKeyDown:o,onFocus:g,onBlur:_,className:`x1iyjqo2 xs83m0k xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1tgivj0 x9ynric xcr08ib xdk3u5w x1kq96og x1a2a7pz xeyghm5`,...p}),i!==``&&(0,q.jsx)(KO,{label:n,onClick:v})]})})}Nj.displayName=`PanelSearchInput`;function Pj(e){return typeof e==`string`||!(`type`in e)}function Fj(e){return typeof e==`object`&&`type`in e&&e.type===`divider`}function Ij(e){return typeof e==`object`&&`type`in e&&e.type===`section`}function Lj(e){return typeof e==`string`?{value:e,label:e}:{...e,label:e.label??e.value}}function Rj(e){let t=[];for(let n of e)if(Pj(n))t.push(Lj(n));else if(Ij(n))for(let e of n.options)t.push(Lj(e));return t}var zj=1;function Bj(e){let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t}function Vj({isOpen:e,selectedItemIndex:t,listboxId:n,listboxRef:r,anchorRef:i}){let[a,o]=(0,K.useState)(0),[s,c]=(0,K.useState)(!1),l=(0,K.useCallback)((e,t)=>{o(e),c(t)},[]);return ne(()=>{if(!e){l(0,!1);return}if(!r.current||!i.current){l(0,!0);return}let a=`${n}-item-${t>=0?t:0}`,o=document.getElementById(a);if(!o){l(0,!0);return}let s=r.current,c=i.current.getBoundingClientRect(),u=s.offsetHeight;if(u<=0){l(0,!0);return}let d=Bj(o)-Bj(s)-s.scrollTop+o.offsetHeight/2,f=c.top+c.height/2-d-zj,p=window.innerHeight,m=Math.max(0,p-u),h=Math.min(Math.max(f,0),m),g=Math.max(0,c.bottom-h);l(g,!0)},[e,t,n,r,i,l]),{offset:a,isPositioned:s}}function Hj({selectableItems:e,value:t,isDisabled:n=!1,isOpen:r,hasSearch:i=!1,onOpen:a,onClose:o,onSelect:s,onClear:c,onSearchSeed:l,wasJustDismissed:u,listboxId:d}){let[f,p]=(0,K.useState)(-1),m=(0,K.useCallback)(e=>`${d}-item-${e}`,[d]),h=(0,K.useCallback)(()=>e.map((e,t)=>e.disabled?-1:t).filter(e=>e>=0),[e]),g=(0,K.useCallback)(()=>e.findIndex(e=>e.value===t),[e,t]),_=(0,K.useCallback)(()=>{p(-1),o()},[o]),v=(0,K.useCallback)(e=>{e.disabled||(s?.(e.value),_())},[s,_]),y=(0,K.useCallback)(()=>{if(!(n||u?.())){if(r)_();else if(a(),!i){let e=g();p(e>=0?e:0)}}},[n,u,r,a,_,g,i]),b=(0,K.useCallback)((e,t)=>{e.disabled||p(t)},[]);return{highlightedIndex:f,setHighlightedIndex:p,getItemId:m,onTriggerClick:y,onKeyDown:(0,K.useCallback)(o=>{if(n)return;let s=h();switch(o.key){case`ArrowDown`:if(o.preventDefault(),!r)a(),p(0);else{let e=s.indexOf(f),t=Math.min(e+1,s.length-1);p(s[t]??f)}break;case`ArrowUp`:if(o.preventDefault(),!r)a(),p(e.length-1);else{let e=s.indexOf(f),t=Math.max(e-1,0);p(s[t]??f)}break;case` `:if(i)break;case`Enter`:if(o.preventDefault(),r&&f>=0){let t=e[f];t&&!t.disabled&&v(t)}else if(!r&&(a(),!i)){let e=g();p(e>=0?e:0)}break;case`Escape`:r&&(o.preventDefault(),_());break;case`Tab`:r&&_();break;case`Home`:o.preventDefault(),r&&s.length>0&&p(s[0]);break;case`End`:o.preventDefault(),r&&s.length>0&&p(s[s.length-1]);break;case`PageUp`:o.preventDefault(),r&&s.length>0&&p(s[0]);break;case`PageDown`:o.preventDefault(),r&&s.length>0&&p(s[s.length-1]);break;case`Delete`:case`Backspace`:!i&&!r&&c!=null&&t!=null&&(o.preventDefault(),c());break;default:i&&l&&o.key.length===1&&!o.ctrlKey&&!o.metaKey&&(r||a(),l(o.key))}},[n,r,a,_,e,f,v,g,h,i,c,l,t]),onItemSelect:v,onItemMouseEnter:b}}var Uj=(0,K.createContext)(`stacked`);Uj.displayName=`SelectorRowLayoutContext`;function Wj(){return(0,K.use)(Uj)}var Gj={root:{k8WAf4:`xt970qd`,kg3NbH:`xnjsko4`,kaIpWk:`x2u8bby`,$$css:!0}};function Kj({icon:e,label:t,description:n,layout:r,endContent:i,xstyle:a,className:o,style:s}){let c=Wj();return(0,q.jsx)(Na,{startContent:e?xa(e,{size:`sm`,color:`secondary`}):void 0,label:t,description:n,layout:c===`inline`?`inline`:r,endContent:i,xstyle:[Gj.root,a],...H(O(`selector-option`),{className:o,style:s})})}Kj.displayName=`SelectorOption`;var qj={triggerContainer:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`x1qughib`,kOIVth:`x1txdalj`,kzqmXN:`xh8yej3`,k8WAf4:`xce4md1`,kg3NbH:`xrrkdod`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib xdk3u5w`,kLWn49:`x7acx1w`,kMwMTN:`x1tgivj0`,kkrTdU:`x1ypdohk x16khyan`,$$css:!0},triggerPlaceholder:{kMwMTN:`xv1l7n4`,$$css:!0},triggerInGroup:{kAzted:`x2lwn1j`,k8WAf4:`xt970qd`,$$css:!0},triggerIcon:{kmuXW:`x2lah0s`,$$css:!0},triggerIconRotation:{k1ekBW:`x11xpdln`,kIyJzY:`xuedmi6`,kAMwcw:`xlr8y92`,k3nNDw:`x1g0ag68`,$$css:!0},triggerIconOpen:{k3aq6I:`x19jd1h0`,$$css:!0},triggerGhost:{kzqmXN:`x14atkfc`,kMzoRj:`xc342km`,kWkggS:`xjbqb8w`,kGVxlE:`x1gnnqk1 x1s17dad x15ysqaf`,k63SB2:`x1e4wzip`,k1ekBW:`xrafxwg`,k3aq6I:`x3oybdh xk4oym4`,$$css:!0},triggerGhostDisabled:{kKwaWg:`x18o3ruo`,k3aq6I:`x1c071of x1pdlv7q`,$$css:!0},statusButton:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmVPX3:`x1717udv`,kogj98:`x1ghz6dp`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`xjbqb8w`,kMwMTN:`x1heor9g`,kkrTdU:`x1ypdohk x16khyan`,kaIpWk:`xh6dtrn`,$$css:!0},searchRowInput:{kg3NbH:`x2hg6jq`,$$css:!0},popover:{k7Eaqz:`xrzjruh`,$$css:!0},divider:{kqGvvJ:`xsq74q5`,$$css:!0},item:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`x1qughib`,kOIVth:`x1txdalj`,kzqmXN:`xh8yej3`,kmVPX3:`xlsj2fj`,kaIpWk:`xh6dtrn`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib`,kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w`,kkrTdU:`x1ypdohk x16khyan`,k9WMMc:`x1yc453h`,kI3sdo:`x1a2a7pz`,$$css:!0},itemHighlighted:{kWkggS:`x1lmrjuc`,$$css:!0},itemSelected:{k63SB2:`x1e4wzip`,$$css:!0},itemDisabled:{kSiTet:`xbyyjgo`,kkrTdU:`xt0e3qv`,$$css:!0}},Jj={sm:{kAzted:`x1gdqauq`,k8WAf4:`x1ecmfrv`,$$css:!0},md:{kAzted:`x1uogy3y`,k8WAf4:`x1ioay2v`,$$css:!0},lg:{kAzted:`x1xf4nls`,k8WAf4:`x1vn5h1t`,$$css:!0}},Yj={sm:{k8WAf4:`xu0wf1k`,kg3NbH:`xf314gf`,$$css:!0},md:{k8WAf4:`x1vofgu7`,$$css:!0},lg:{$$css:!0}},Xj={warning:`warning`,error:`error`,success:`success`},Zj={warning:`warning`,error:`error`,success:`success`},Qj={warning:`@astryx.input.statusButton.warning`,error:`@astryx.input.statusButton.error`,success:`@astryx.input.statusButton.success`};function $j({option:e}){return(0,q.jsx)(Kj,{icon:e.icon,label:e.label??e.value,description:e.description})}function eM(e,t){return!t||(e.label??e.value).toLowerCase().includes(t.toLowerCase())}function tM(e,t){return t?e.filter(e=>eM(e,t)):e}function nM(e){let t=jr(),{label:n,isLabelHidden:r=!1,description:i,isOptional:a=!1,isRequired:o=!1,isDisabled:s=!1,disabledMessage:c,options:l,value:u,onChange:d,changeAction:f,isLoading:m=!1,placeholder:h,size:g,variant:_=`input`,status:v,statusVariant:y=`attached`,labelTooltip:b,startIcon:x,htmlName:S,renderOption:C,renderValue:T,indicatorPosition:E=`end`,hasSearch:D=!1,searchPlaceholder:k,emptyText:A,emptySearchText:j,placement:N,isDefaultOpen:P=!1,"data-testid":I,width:ee,xstyle:L,className:te,style:z,hasClear:B,id:ne,...re}=e,V=YO({isRequired:o,isOptional:a}),oe=h??t(`@astryx.selector.placeholder`),se=k??t(`@astryx.selector.searchPlaceholder`),ce=A??t(`@astryx.selector.empty`),le=j??t(`@astryx.selector.emptySearchResults`),ue=B===!0,de=Zt(g,`md`),pe=_===`ghost`&&y===`attached`?`detached`:y,me=u===null?void 0:u,he=(0,K.useId)(),ge=ne??he,_e=(0,K.useId)(),ve=(0,K.useId)(),ye=(0,K.useId)(),be=(0,K.useId)(),xe=(0,K.useId)(),Se=(0,K.useRef)(null),Ce=(0,K.useRef)(null),we=(0,K.useRef)(null),Te=ZO(),[Ee,U]=(0,K.useState)(``),De=(0,K.useRef)(``),Oe=Ee.length>0,[,ke]=(0,K.useTransition)(),[W,Ae]=(0,K.useOptimistic)(me),G=m||W!==me,je=vu(),Me=typeof ce==`string`?ce:t(`@astryx.selector.empty`),Ne=typeof le==`string`?le:t(`@astryx.selector.emptySearchResults`),Pe=s&&!!c,Fe=F({placement:`above`,focusTrigger:`always`,isEnabled:Pe}),Ie=F({placement:`above`,isEnabled:pe===`tooltip`&&!!v?.message}),{ariaLabelledBy:Le,ariaDescribedBy:Re}=gt(be,[i?ve:null,!Te&&pe!==`tooltip`&&v?.message?ye:null,pe===`tooltip`&&v?.message?Ie.describedBy:null,Pe?Fe.describedBy:null],Te),ze=(0,K.useMemo)(()=>Rj(l),[l]),Be=(0,K.useMemo)(()=>tM(ze,Ee),[ze,Ee]),Ve=(0,K.useMemo)(()=>ze.findIndex(e=>e.value===W),[ze,W]),He=(0,K.useMemo)(()=>Ve>=0?ze[Ve]:void 0,[ze,Ve]),Ue=(0,K.useRef)(null),We=(0,K.useRef)(()=>{}),Ge=Gr({onHide:(0,K.useCallback)(()=>{U(``),De.current=``,We.current(),je(``),Ce.current?.focus()},[je]),hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:`none`,surfaceTarget:`selector-popup`}),Ke=ae(Ge.id,Ge.isOpen);(0,K.useEffect)(()=>{P&&Ge.show()},[]);let qe=(0,K.useCallback)(e=>{if(e.length===0){je(``);return}if(m){je(``);return}let n=tM(ze,e).length;je(n===0?Ne:t(`@astryx.selector.resultCount`,{count:n}))},[je,m,ze,Ne,t]),Je=(0,K.useCallback)(e=>{U(e),De.current=e,qe(e)},[qe]),Ye=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!(Ge.isOpen&&!m&&Ee===``&&ze.length===0)){Ye.current=null;return}Ye.current!==Me&&(Ye.current=Me,je(Me))},[Ge.isOpen,m,Ee,ze.length,Me,je]);let Xe=N==null&&!D,{offset:Ze,isPositioned:Qe}=Vj({isOpen:Ge.isOpen&&Xe,selectedItemIndex:Ve,listboxId:_e,listboxRef:Ue,anchorRef:Se}),$e=Xe?Ze:0,et=!Xe||Qe,tt=N??`below`,nt=$e>0?{marginBlockStart:`-${$e}px`}:void 0,rt=(0,K.useCallback)(()=>{We.current(),d?.(null),f&&ke(async()=>{Ae(void 0),await f(null)})},[d,f,ke,Ae]),it=(0,K.useCallback)(e=>{let t=De.current+e;De.current=t,U(t),qe(t)},[qe]),at=(0,K.useCallback)(e=>{d?.(e),f&&ke(async()=>{Ae(e),await f(e)})},[d,f,ke,Ae]),{highlightedIndex:ot,setHighlightedIndex:st,getItemId:ct,onTriggerClick:lt,onKeyDown:ut,onItemSelect:dt,onItemMouseEnter:ft}=Hj({selectableItems:Be,wasJustDismissed:Ge.wasJustDismissed,value:W,isDisabled:s,isOpen:Ge.isOpen,hasSearch:D,onOpen:(0,K.useCallback)(()=>{Ge.show(),D&&requestAnimationFrame(()=>{let e=we.current;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))})},[Ge,D]),onClose:Ge.hide,onSelect:at,onClear:ue?rt:void 0,onSearchSeed:it,listboxId:_e}),pt=io({getItemLabels:()=>ze.map(e=>e.label??e.value),isDisabled:e=>ze[e]?.disabled===!0,getCurrentIndex:()=>Ge.isOpen?ot:Ve,onMatch:e=>{let t=ze[e];Ge.isOpen?st(e):t.value!==W&&(at(t.value),je(t.label??t.value))}});We.current=pt.reset;let mt=(0,K.useCallback)(e=>{if(!s&&!D&&pt.onKeyDown(e)){e.preventDefault();return}ut(e)},[s,D,pt,ut]);(0,K.useEffect)(()=>{!Ge.isOpen||ot<0||document.getElementById(ct(ot))?.scrollIntoView?.({block:`nearest`})},[Ge.isOpen,ot,ct]);let ht=(0,K.useCallback)(e=>{e.stopPropagation(),rt()},[rt]),_t=(0,K.useCallback)(()=>D?(0,q.jsx)(Nj,{ref:we,id:xe,label:t(`@astryx.selector.searchOptions`),clearLabel:t(`@astryx.textInput.clearLabel`,{label:t(`@astryx.selector.searchOptions`)}),...O(`selector-search`),xstyle:_!==`ghost`&&qj.searchRowInput,role:`combobox`,"aria-expanded":Ge.isOpen,"aria-controls":_e,"aria-autocomplete":`list`,"aria-activedescendant":Ge.isOpen&&ot>=0?ct(ot):void 0,value:Ee,onValueChange:Je,onContainerKeyDown:e=>{e.target!==we.current&&e.key===`Tab`&&!e.shiftKey&&ut(e)},onKeyDown:e=>{if(!M(e.nativeEvent)){if(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`PageUp`||e.key===`PageDown`||e.key===`Enter`||e.key===`Escape`){ut(e);return}e.key===`Tab`&&(e.shiftKey||!Oe)&&ut(e)}},placeholder:se}):null,[D,xe,_e,Ee,Oe,se,Je,ut,Ge.isOpen,ot,ct,_,t]),vt=Io(`check`),yt=(0,K.useCallback)((e,t)=>{let n=t===ot,r=e.value===me,i=(0,q.jsx)(`span`,{className:`x3nfvp2 x6s0dn4 xl56j7k x2lah0s xgomdpo`,children:(0,q.jsx)(vt,{state:r?`checked`:`unchecked`,size:`sm`,isDisabled:e.disabled??!1,...O(`selector-check`)})}),a=(0,q.jsx)(`span`,{className:`x78zum5 x6s0dn4 x1txdalj x98rzlu xeuugli`,children:C?C(e):(0,q.jsx)($j,{option:e})}),o=E===`start`?(0,q.jsxs)(q.Fragment,{children:[i,a]}):(0,q.jsxs)(q.Fragment,{children:[a,i]});return(0,q.jsx)(`div`,{id:ct(t),role:`option`,"aria-selected":r,"aria-disabled":e.disabled,onClick:()=>dt(e),onMouseEnter:()=>ft(e,t),...H(O(`selector-option-row`,{size:de,selected:r?`selected`:null,disabled:e.disabled?`disabled`:null}),w(qj.item,Yj[de],n&&qj.itemHighlighted,r&&qj.itemSelected,e.disabled&&qj.itemDisabled)),children:o},e.value)},[C,E,ot,de,me,ct,dt,ft,vt]),bt=(0,K.useCallback)(()=>{let e=D&&!!Ee;if(Be.length===0&&!m)return[(0,q.jsx)(`div`,{role:`presentation`,...H(O(`selector-empty-state`),{className:`x1b2ylru x2b8uid xv1l7n4 x9ynric xcr08ib`}),children:e?le:ce},`empty`)];let t=0,n=[];for(let r=0;r{Se.current=e,Ge.triggerRef(e),Fe.ref(e)},onClick:lt,"data-testid":I,...H(O(`selector`,{variant:_,size:de,status:v?.type??null,disabled:s?`disabled`:null}),w(BO.base,qj.triggerContainer,Jj[de],_===`ghost`&&qj.triggerGhost,_===`ghost`&&rn.backgroundImage,_===`ghost`&&fe.focusWithin,s&&BO.disabled,_===`ghost`&&s&&qj.triggerGhostDisabled,!He&&qj.triggerPlaceholder,_!==`ghost`&&v&&VO[v.type],_!==`ghost`&&v&&!s&&HO[v.type],_!==`ghost`&&Te&&JO.inGroup,Te&&qj.triggerInGroup,L),te,z),children:[x&&xa(x,{size:`sm`,color:`secondary`}),Te&&(0,q.jsx)(Kt,{id:be,children:n}),(0,q.jsx)(`button`,{ref:Ce,id:ge,type:`button`,role:D?void 0:`combobox`,...re,"aria-haspopup":`listbox`,"aria-expanded":Ge.isOpen,"aria-controls":_e,"aria-activedescendant":!D&&Ge.isOpen&&ot>=0?ct(ot):void 0,"aria-describedby":Re,"aria-labelledby":Le,"aria-required":V?`true`:void 0,"aria-invalid":v?.type===`error`?`true`:void 0,"aria-busy":G||void 0,disabled:s&&!Pe,"aria-disabled":Pe?`true`:void 0,onKeyDown:mt,tabIndex:s&&!Pe?-1:0,...{0:{className:`x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x16khyan x1a2a7pz`},1:{className:`x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x16khyan x1a2a7pz xkh2ocl`}}[!!Te<<0],children:Ct}),S!=null&&(0,q.jsx)(`input`,{type:`hidden`,name:S,value:u??``,disabled:s}),G&&(0,q.jsx)(Gt,{size:`sm`}),ue&&u!=null&&!s&&(0,q.jsx)(qO,{...Ke,label:t(`@astryx.selector.clearLabel`,{label:n}),onClick:ht,iconClassName:ie(`selector-clear-icon`)}),xt?St?(0,q.jsx)(`button`,{ref:Ie.ref,type:`button`,"aria-label":t(Qj[v.type]),"aria-describedby":Ie.describedBy,...Ke,onClick:e=>e.stopPropagation(),...w(fe.focusVisible,qj.statusButton),children:(0,q.jsx)(ya,{icon:Xj[v.type],size:`sm`,color:Zj[v.type],xstyle:qj.triggerIcon})}):(0,q.jsx)(ya,{icon:Xj[v.type],size:`sm`,color:Zj[v.type],xstyle:qj.triggerIcon}):(0,q.jsx)(ya,{icon:`chevronDown`,size:`sm`,color:`secondary`,xstyle:[qj.triggerIcon,qj.triggerIconRotation,Ge.isOpen&&qj.triggerIconOpen],...O(`selector-indicator-icon`,{state:Ge.isOpen?`expanded`:`collapsed`})})]}),Ge.render(D?(0,q.jsxs)(`div`,{children:[_t(),(0,q.jsx)(Ga,{}),(0,q.jsx)(`div`,{ref:Ue,id:_e,role:`listbox`,"aria-labelledby":ge,...{0:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj x1hc1fzr x1ey1afo`},1:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x1hc1fzr x1ey1afo x2hg6jq`}}[(_!==`ghost`)<<0],children:bt()})]}):(0,q.jsx)(`div`,{ref:Ue,id:_e,role:`listbox`,"aria-labelledby":ge,...{0:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj x1hc1fzr x1ey1afo`},2:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x1hc1fzr x1ey1afo x2hg6jq`},1:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj xg01cxk xq2gx43`},3:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x2hg6jq xg01cxk xq2gx43`}}[(_!==`ghost`)<<1|!et<<0],children:bt()}),{placement:tt,alignment:`start`,offset:Xe?void 0:p[`--spacing-1`],xstyle:[qj.popover,R[tt]],style:nt}),St&&Ie.renderTooltip(v?.message??``),Pe&&Fe.renderTooltip(c)]});return Te?wt:(0,q.jsx)(zO,{label:n,isLabelHidden:r,description:i,inputID:ge,descriptionID:i?ve:void 0,isOptional:a,isRequired:o,isDisabled:s,status:v?{type:v.type,message:v.message,messageID:v.message?ye:void 0}:void 0,statusVariant:pe,labelTooltip:b,width:ee,children:wt})}nM.displayName=`Selector`;function rM(e){return e?.status===`running`||e?.status===`cancelling`}function iM({sessionId:e,auth:t,busy:n,onSaving:r,onAuthenticated:i,onReload:a}){let{t:o}=W(),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(!1),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(0),[_,v]=(0,K.useState)(``),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(!1),T=(0,K.useRef)(!1),E=(0,K.useRef)(null),D=(0,K.useRef)(!1),O=(0,K.useRef)(0),k=(0,K.useRef)(null),A=(0,K.useRef)({onSaving:r,onAuthenticated:i});A.current={onSaving:r,onAuthenticated:i};let j=rM(s),M=t.id,N=`${e}:${M}`,P=(0,K.useRef)({key:N});P.current.key!==N&&(P.current={key:N});let F=P.current,I=(0,K.useCallback)((t,n)=>{if(t&&(t.sessionId!==e||t.provider!==M||n&&t.id!==n))throw Error(`Login ownership changed`);if(n&&!t)throw Error(`Login status unavailable`);if(!T.current||P.current!==F){t&&rM(t)&&new de().cancelProviderLogin(e,t.id).catch(()=>void 0);return}E.current=t,c(t),m(!1),t?.status===`succeeded`&&!t.refreshRequired&&k.current!==t.id&&(k.current=t.id,A.current.onAuthenticated())},[e,M,F]);(0,K.useEffect)(()=>{T.current=!0,E.current=null,D.current=!1,k.current=null,c(null),u(!1),f(!1),m(!1),b(!1),w(!1);let t=new AbortController,n=O.current;return new de().providerLogin(e,void 0,t.signal).then(e=>{!t.signal.aborted&&n===O.current&&!D.current&&e?.provider===M&&rM(e)&&I(e)}).catch(()=>void 0),()=>{T.current=!1,t.abort();let n=E.current;n&&rM(n)&&new de().cancelProviderLogin(e,n.id).catch(()=>void 0),A.current.onSaving(!1)}},[e,M,I]),(0,K.useEffect)(()=>{A.current.onSaving(j||l)},[j,l]);let ee=s?.prompt?.id;(0,K.useEffect)(()=>{v(``)},[ee]);let L=s?.id;(0,K.useEffect)(()=>{b(!1)},[L]),(0,K.useEffect)(()=>{if(l||D.current||!j||!L)return;let t=new AbortController,n=O.current,r=0,i=async()=>{try{let a=await new de().providerLogin(e,L,t.signal);if(t.signal.aborted||n!==O.current||D.current)return;I(a,L),rM(a)&&(r=window.setTimeout(()=>void i(),900))}catch{!t.signal.aborted&&n===O.current&&!D.current&&m(!0)}};return i(),()=>{t.abort(),clearTimeout(r)}},[e,I,L,j,l,h]);let R=async(e,t)=>{if(!D.current){D.current=!0,O.current++,u(!0),f(!1);try{I(await e(),t)}catch{T.current&&P.current===F&&f(!0)}finally{P.current===F&&(D.current=!1,O.current++,T.current&&(u(!1),g(e=>e+1)))}}},te=()=>{n||j||R(()=>new de().startProviderLogin(e,M))},z=t=>{let n=s?.prompt;if(!s||!n)return;let r=s.id;R(()=>new de().respondProviderLogin(e,r,n.id,t))},B=()=>{let t=s?.id;return R(()=>new de().providerLogin(e,t),t)},ne=s?.prompt,re=s?.auth||s?.device,V=ne&&ne.type!==`select`&&(0,q.jsxs)(`div`,{className:`models-login-input`,children:[(0,q.jsxs)(`label`,{className:`models-field`,children:[ne.type===`manual_code`?o(`accountLoginPaste`):ne.message,(0,q.jsx)(`input`,{type:ne.type===`secret`||ne.type===`manual_code`?`password`:`text`,autoComplete:`off`,spellCheck:!1,value:_,maxLength:8192,placeholder:ne.placeholder,disabled:l||s.status!==`running`,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key!==`Enter`||e.nativeEvent.isComposing||(e.preventDefault(),(ne.type===`text`||_.trim())&&z(_))}})]}),(0,q.jsx)(`button`,{type:`button`,className:`models-button primary`,disabled:l||ne.type!==`text`&&!_.trim()||s.status!==`running`,onClick:()=>z(_),children:o(`accountLoginContinue`)})]});return(0,q.jsxs)(`div`,{className:`models-account-login`,children:[!j&&!C&&(!s||[`failed`,`expired`,`cancelled`].includes(s.status))&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`models-login-intro`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:M===`openai`?o(`accountLoginChatGPT`):M===`anthropic`?o(`accountLoginClaude`):t.loginLabel||t.name}),(0,q.jsx)(`p`,{className:`models-hint`,children:o(t.subscription?`accountLoginExisting`:`accountLoginIntro`)})]})}),(0,q.jsxs)(`div`,{className:`models-login-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button primary`,disabled:n||l||d,onClick:te,children:o(t.subscription?`accountLoginAgain`:`accountLoginStart`)}),t.subscription&&(0,q.jsx)(`button`,{type:`button`,className:`models-link`,disabled:n||l,onClick:()=>S(!0),children:o(`accountLogout`)})]})]}),j&&(0,q.jsxs)(`div`,{className:`models-login-flow`,children:[(0,q.jsxs)(`div`,{className:`models-login-status`,role:`status`,children:[(0,q.jsx)(rc,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o(s?.status===`cancelling`?`accountLoginCancelling`:re?`accountLoginWaiting`:ne?`accountLoginChoose`:`accountLoginStarting`)})]}),re&&(0,q.jsx)(`p`,{className:`models-hint`,children:o(s?.device?`accountLoginDeviceHelp`:`accountLoginBrowserHelp`)}),s?.device&&(0,q.jsxs)(`div`,{className:`models-device-code`,children:[(0,q.jsx)(`code`,{children:s.device.code}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":o(`accountLoginCopyCode`),onClick:()=>{s.device&&navigator.clipboard.writeText(s.device.code).then(()=>{T.current&&P.current===F&&b(!0)}).catch(()=>{T.current&&P.current===F&&b(!1)})},children:y?(0,q.jsx)(rs,{}):(0,q.jsx)(Ss,{})})]}),re&&(0,q.jsxs)(`a`,{className:`models-button primary models-login-open`,href:s?.device?.url||s?.auth?.url,target:`_blank`,rel:`noopener noreferrer`,children:[o(`accountLoginOpen`),(0,q.jsx)(Yo,{"aria-hidden":`true`})]}),ne?.type===`select`&&(0,q.jsx)(`fieldset`,{className:`models-login-options`,"aria-label":ne.message,children:ne.options?.map(e=>{let t=[`openai`,`openai-codex`].includes(M)&&[`browser`,`device_code`].includes(e.id);return(0,q.jsxs)(`button`,{type:`button`,className:`models-login-option`,disabled:l||s?.status!==`running`,onClick:()=>z(e.id),children:[(0,q.jsx)(`strong`,{children:t?o(e.id===`browser`?`accountLoginBrowser`:`accountLoginDevice`):e.label}),(t||e.description)&&(0,q.jsx)(`span`,{children:t?o(e.id===`browser`?`accountLoginBrowserOption`:`accountLoginDeviceOption`):e.description})]},e.id)})}),ne?.type===`manual_code`&&re?(0,q.jsxs)(`details`,{className:`models-login-fallback`,children:[(0,q.jsx)(`summary`,{children:o(`accountLoginFallback`)}),(0,q.jsx)(`p`,{className:`models-hint`,children:o(`accountLoginRemoteHelp`)}),V]}):V,s?.messages.map(e=>(0,q.jsxs)(`div`,{className:`models-hint`,children:[(0,q.jsx)(`p`,{children:e.message}),e.links?.map(e=>(0,q.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.label,(0,q.jsx)(Yo,{"aria-hidden":`true`})]},e.url))]},e.id)),(0,q.jsx)(`button`,{type:`button`,className:`models-link models-login-cancel`,disabled:l||s?.status===`cancelling`,onClick:()=>{s&&R(()=>new de().cancelProviderLogin(e,s.id))},children:o(`accountLoginCancel`)})]}),s?.status===`succeeded`&&s.refreshRequired&&(0,q.jsxs)(`p`,{className:`models-hint`,role:`status`,children:[o(`accountLoginRefreshRequired`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:a,children:o(`refreshStatus`)})]}),C&&(0,q.jsxs)(`p`,{className:`models-hint`,role:`status`,children:[o(`accountLogoutRefreshRequired`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:a,children:o(`refreshStatus`)})]}),s&&[`failed`,`expired`,`cancelled`].includes(s.status)&&(0,q.jsx)(`p`,{className:s.status===`failed`?`models-error`:`models-hint`,role:`status`,children:o(`accountLogin_${s.status}`)}),d&&(0,q.jsxs)(`p`,{className:`models-error`,role:`alert`,children:[o(`accountLoginRequestFailed`),(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:()=>void B(),children:o(`refreshStatus`)})]}),p&&(0,q.jsxs)(`p`,{className:`models-error`,role:`alert`,children:[o(`accountLoginStatusUnknown`),(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:()=>g(e=>e+1),children:o(`refreshStatus`)})]}),x&&(0,q.jsx)(uj,{isOpen:!0,title:o(`accountLogoutTitle`,{provider:t.name}),description:o(`accountLogoutDetail`),cancelLabel:o(`cancel`),actionLabel:o(`accountLogout`),isActionLoading:l,onOpenChange:e=>{!e&&!l&&S(!1)},onAction:()=>{D.current||n||(D.current=!0,O.current++,u(!0),f(!1),new de().logoutProvider(e,M).then(e=>{!T.current||P.current!==F||(S(!1),e.refreshRequired?w(!0):a())}).catch(()=>{T.current&&P.current===F&&(S(!1),f(!0))}).finally(()=>{P.current===F&&(D.current=!1,O.current++,T.current&&(u(!1),g(e=>e+1)))}))}})]})}var aM={assign:0,create:0,clone:0,discard:0,update:0};function oM(e){return Array.isArray(e)}function sM(e){return mM(typeof e,`bigint`)}function cM(e){return mM(typeof e,`boolean`)}function lM(e){return mM(e,null)}function uM(e){return Number.isFinite(e)}function dM(e){return fM(e)&&!oM(e)}function fM(e){return mM(typeof e,`object`)&&!lM(e)}function pM(e){return mM(typeof e,`string`)}function mM(e,t){return e===t}function hM(e,t){return e>t}function gM(e,t){return eHM(e))}function RM(e){return e.slice()}function zM(e){return new RegExp(e.source,e.flags)}function BM(e){return new Map(HM([...e.entries()]))}function VM(e){return new Set(HM([...e.values()]))}function HM(e){return wM(e)?RM(e):TM(e)?zM(e):DM(e)?BM(e):EM(e)?VM(e):oM(e)?LM(e):fM(e)?IM(e):e}function UM(e){return aM.clone+=1,HM(e)}function WM(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function GM(e,t){return{...e,...t}}function KM(e,t,n={}){aM.create+=1;let r=GM(t,n);return AM(kM().enumerableKind?GM(r,e):WM(r,e))}function qM(e,t){aM.discard+=1;let n={};for(let r of xM(e)){if(t.includes(r))continue;let i=Object.getOwnPropertyDescriptor(e,r);i.value=UM(i.value),Object.defineProperty(n,r,i)}return AM(n)}function JM(e,t,n){aM.update+=1;let r=kM(),i=UM(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return AM(i)}function YM(e,t){return fM(e)&&bM(e,`~kind`)&&mM(e[`~kind`],t)}function XM(e){return fM(e)}function ZM(e,t,n){return KM({"~kind":`Deferred`},{type:`deferred`,action:e,parameters:t,options:n},{})}function QM(e){return YM(e,`Deferred`)}function $M(e){return JM(e,{"~readonly":!0},{})}function eN(e,t){return JM($M(e),{},t)}function tN(e,t,n,r){return eN(BU(e,t,n),r)}function nN(e){return JM(e,{"~optional":!0},{})}function rN(e,t){return JM(nN(e),{},t)}function iN(e,t,n,r){return rN(BU(e,t,n),r)}function aN(e,t){return KM({"~kind":`Array`},{type:`array`,items:e},t)}function oN(e){return YM(e,`Array`)}function sN(e){return qM(e,[`~kind`,`type`,`items`])}function cN(e,t,n={}){return KM({"~kind":`Constructor`},{type:`constructor`,parameters:e,instanceType:t},n)}function lN(e){return YM(e,`Constructor`)}function uN(e){return qM(e,[`~kind`,`type`,`parameters`,`instanceType`])}function dN(e,t,n={}){return KM({"~kind":`Function`},{type:`function`,parameters:e,returnType:t},n)}function fN(e){return YM(e,`Function`)}function pN(e){return qM(e,[`~kind`,`type`,`parameters`,`returnType`])}function mN(e,t){return KM({"~kind":`Ref`},{$ref:e},t)}function hN(e){return YM(e,`Ref`)}function gN(e,t){return KM({"~kind":`Generic`},{type:`generic`,parameters:e,expression:t})}function _N(e){return YM(e,`Generic`)}function vN(e){return KM({"~kind":`Any`},{},e)}function yN(e){return YM(e,`Any`)}var bN=`(?!)`;function xN(e){return KM({"~kind":`Never`},{not:{}},e)}function SN(e){return YM(e,`Never`)}function CN(e,t={}){return rN(e,t)}function wN(e){return CN(e)}function TN(e){return XM(e)&&bM(e,`~optional`)}function EN(e){return xM(e).filter(t=>!TN(e[t]))}function DN(e){return xM(e)}function ON(e){return CM(e)}function kN(e,t={}){let n=EN(e);return KM({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}function AN(e){return YM(e,`Object`)}function jN(e){return qM(e,[`~kind`,`type`,`properties`,`required`])}function MN(e){return KM({"~kind":`Unknown`},{},e)}function NN(e){return YM(e,`Unknown`)}function PN(e,t,n){return KM({"~kind":`Cyclic`},{$defs:xM(e).reduce((t,n)=>({...t,[n]:JM(e[n],{},{$id:n})}),{}),$ref:t},n)}function FN(e){return YM(e,`Cyclic`)}function IN(e){return dM(e)&&bM(e,`~unsafe`)&&lM(e[`~unsafe`])}function LN(e){return YM(e,`Infer`)}function RN(e,t,n,r={}){return KM({"~kind":`Dependent`},{if:e,then:t,else:n},r)}function zN(e){return YM(e,`Dependent`)}function BN(e){return qM(e,[`~kind`,`if`,`then`,`else`])}function VN(e){return dM(e)}function HN(e){return xM(e).filter(e=>isNaN(e)).reduce((t,n)=>[...t,e[n]],[])}function UN(e,t){return KM({"~kind":`Enum`},{enum:VN(e)?HN(e):e},t)}function WN(e){return YM(e,`Enum`)}function GN(e,t={}){return KM({"~kind":`Intersect`},{allOf:e},t)}function KN(e){return YM(e,`Intersect`)}function qN(e){return qM(e,[`~kind`,`allOf`])}function JN(){throw Error(`Unreachable`)}var YN;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(YN||={}),Array.from({length:256}).map((e,t)=>BigInt(t));var XN=new Float64Array(1);new DataView(XN.buffer),new Uint8Array(XN.buffer),new TextEncoder;function ZN(e){return XM(e)&&bM(e,`~immutable`)}function QN(e,t={}){return eN(e,t)}function $N(e){return XM(e)&&bM(e,`~readonly`)}var eP=`-?(?:0|[1-9][0-9]*)n`;function tP(e){return KM({"~kind":`BigInt`},{type:`bigint`},e)}function nP(e){return YM(e,`BigInt`)}function rP(e){return YM(e,`Boolean`)}var iP=`-?(?:0|[1-9][0-9]*)`;function aP(e){return KM({"~kind":`Integer`},{type:`integer`},e)}function oP(e){return YM(e,`Integer`)}var sP=class extends Error{constructor(e){super(`Invalid Literal value`),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function cP(e){return sM(e)?`bigint`:cM(e)?`boolean`:uM(e)?`number`:pM(e)?`string`:(()=>{throw new sP(e)})()}function lP(e,t){return KM({"~kind":`Literal`},{type:cP(e),const:e},t)}function uP(e){return sM(e)||cM(e)||uM(e)||pM(e)}function dP(e){return pP(e)&&uM(e.const)}function fP(e){return pP(e)&&pM(e.const)}function pP(e){return YM(e,`Literal`)}function mP(e){return KM({"~kind":`Null`},{type:`null`},e)}function hP(e){return YM(e,`Null`)}var gP=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function _P(e){return KM({"~kind":`Number`},{type:`number`},e)}function vP(e){return YM(e,`Number`)}function yP(e){return KM({"~kind":`Symbol`},{type:`symbol`},e)}function bP(e){return YM(e,`Symbol`)}function xP(e){return KM({"~kind":`String`},{type:`string`},e)}function SP(e){return YM(e,`String`)}function CP(e,t={}){return KM({"~kind":`Union`},{anyOf:e},t)}function wP(e){return YM(e,`Union`)}function TP(e){return qM(e,[`~kind`,`anyOf`])}function EP(e){let t=nL(e);return mM(t.length,2)?t[0]:[]}function DP(e){return!0}function OP(e){return vM(e,(e,t)=>AP(e)?OP(t):!1,()=>!0)}function kP(e){return!mM(e.length,0)&&OP(e)}function AP(e){return wP(e)?kP(e.anyOf):pP(e)?DP(e.const):!1}function jP(e){return kP(e)}function MP(e){return KM({"~kind":`TemplateLiteral`},{type:`string`,pattern:e},{})}function NP(e,t,n=[]){return vM(e,(e,r)=>NP(r,t,[...n,`${e}${t}`]),()=>n)}function PP(e,t){return mM(e.length,0)?[`${t}`]:NP(e,t)}function FP(e,t,n=[]){return vM(t,(t,r)=>FP(e,r,[...n,...IP(e,t)]),()=>n)}function IP(e,t){return wP(t)?FP(e,t.anyOf):pP(t)?PP(e,t.const):JN()}function LP(e,t){return vM(t,(t,n)=>LP(IP(e,t),n),()=>e)}function RP(e){return e.map(e=>lP(e))}function zP(e){return CP(RP(LP([],e)))}function BP(e){return mM(e.length,0)?JN():mM(e.length,1)&&pP(e[0])?e[0]:zP(e)}function VP(e){let t=EP(e);return mM(t.length,0)?xP():jP(t)?BP(t):MP(e)}function HP(e){let t=VP(e);return CL(t)?xP():t}function UP(e,t){return KM({"~kind":`Record`},{type:`object`,patternProperties:{[e]:t}})}function WP(e){return UP(XF,e)}function GP(e){return kN({true:e,false:e})}function KP(e,t={}){let[n,r,i]=[e,e.length,!1];return KM({"~kind":`Tuple`},{type:`array`,additionalItems:i,items:n,minItems:r},t)}function qP(e){return YM(e,`Tuple`)}function JP(e){return qM(e,[`~kind`,`type`,`items`,`minItems`,`additionalItems`])}function YP(e){return qM(e,[`~readonly`])}function XP(e,t){return JM(YP(e),{},t)}function ZP(e,t,n,r){return XP(BU(e,t,n),r)}function QP(e,t={}){return XP(e,t)}function $P(e){return qM(e,[`~optional`])}function eF(e,t){return JM($P(e),{},t)}function tF(e,t,n,r){return eF(BU(e,t,n),r)}function nF(e,t={}){return eF(e,t)}function rF(e){return e.reduceRight((e,t,n)=>({[n]:t,...e}),{})}function iF(e){return kN(rF(e.items))}function aF(e){return AN(e)||qP(e)}function oF(e,t){return $N(e)?!!$N(t):!1}function sF(e,t){return TN(e)?!!TN(t):!1}function cF(e,t){let n=oF(e,t),r=sF(e,t),i=QP(nF(EF([e,t])));return n&&r?QN(CN(i)):n&&!r?QN(i):!n&&r?CN(i):i}function lF(e,t,n){return n in e?n in t?cF(e[n],t[n]):e[n]:n in t?t[n]:xN()}function uF(e,t){return[...new Set([...xM(e),...xM(t)])].reduce((n,r)=>({...n,[r]:lF(e,t,r)}),{})}function dF(e){return AN(e)?e.properties:qP(e)?rF(e.items):{}}function fF(e,t){return kN(uF(dF(e),dF(t)))}function pF(e,t){let n=Dz(e,t);return mM(n,2)?e:mM(n,3)||mM(n,0)?t:xN()}function mF(e,t){let n=aF(e),r=aF(t);return n&&r?fF(e,t):n&&!r?e:!n&&r?t:pF(e,t)}function hF(e,t){return SN(e)||yN(e)?e:NN(e)||SN(t)||yN(t)?t:NN(t)?e:mF(e,t)}function gF(e,t){return wP(e)||wP(t)}function _F(e,t){let n=kF(e),r=kF(t);return gF(n,r)?EF([n,r]):hF(n,r)}function vF(e,t,n=[]){return vM(t,(t,r)=>vF(e,r,[...n,_F(t,e)]),()=>mM(n.length,0)?[e]:n)}function yF(e,t,n=[]){return vM(e,(e,r)=>yF(r,t,[...n,...bF([e],t)]),()=>n)}function bF(e,t=[]){return vM(e,(e,n)=>wP(e)?bF(n,yF(e.anyOf,t)):bF(n,vF(e,t)),()=>t)}function xF(e,t){return AL(Ez({},e,t))?[]:[e]}function SF(e,t,n=[]){return vM(e,(e,r)=>SF(r,t,[...n,...xF(e,t)]),()=>n)}function CF(e,t){let n=kF(e);return OF(SF(wP(n)?n.anyOf:[n],t))}function wF(e,t,n){return OF([EF([e,t]),CF(n,e)])}function TF(e,t=[]){return vM(e,(e,n)=>TF(n,[...t,lP(e)]),()=>OF(t))}function EF(e){return OF(jz(bF(e)))}function DF(e){return kF(HP(e))}function OF(e){return AF(jz(e))}function kF(e){return zN(e)?wF(e.if,e.then,e.else):WN(e)?TF(e.enum):KN(e)?EF(e.allOf):CL(e)?DF(e.pattern):wP(e)?OF(e.anyOf):e}function AF(e){return mM(e.length,1)?e[0]:mM(e.length,0)?xN():CP(e)}function jF(e,t){return GF(TF(e),t)}function MF(e,t){return UP(JF,t)}function NF(e,t){return GF(EF(e),t)}function PF(e,t){return pM(e)||uM(e)?kN({[e]:t}):mM(e,!1)?kN({false:t}):mM(e,!0)?kN({true:t}):kN({})}function FF(e,t){return UP(YF,t)}function IF(e,t){return bM(e,`pattern`)&&(pM(e.pattern)||e.pattern instanceof RegExp)?UP(e.pattern.toString(),t):UP(XF,t)}function LF(e,t){return jP(EP(e))?GF(DF(e),t):UP(e,t)}function RF(e){return wP(e)?zF(e.anyOf):[e]}function zF(e,t=[]){return vM(e,(e,n)=>zF(n,[...t,...RF(e)]),()=>t)}function BF(e){return e.some(e=>SP(e)||vP(e)||oP(e))}function VF(e,t){return mM(BF(e),!0)?UP(XF,t):void 0}function HF(e,t){return e.reduce((e,n)=>pP(n)&&(pM(n.const)||uM(n.const))?{...e,[n.const]:t}:e,{})}function UF(e,t){return kN(HF(e,t))}function WF(e,t){let n=zF(e),r=VF(n,t);return XM(r)?r:UF(n,t)}function GF(e,t){return yN(e)?WP(t):rP(e)?GP(t):WN(e)?jF(e.enum,t):oP(e)?MF(e,t):KN(e)?NF(e.allOf,t):pP(e)?PF(e.const,t):vP(e)?FF(e,t):wP(e)?WF(e.anyOf,t):SP(e)?IF(e,t):CL(e)?LF(e.pattern,t):kN({})}function KF(e,t,n){return NU([e])?JM(GF(e,t),{},n):ZF(e,t,n)}function qF(e,t,n,r,i){return KF(BU(e,t,n),BU(e,t,r),i)}var JF=`^${iP}$`,YF=`^${gP}$`,XF=`^.*$`;function ZF(e,t,n={}){return ZM(`Record`,[e,t],n)}function QF(e,t,n={}){return KF(e,t,n)}function $F(e,t){return UP(e,t)}function eI(e){return mM(e,XF)?xP():mM(e,JF)?aP():mM(e,YF)?_P():VP(e)}function tI(e){return xM(e.patternProperties)[0]}function nI(e){return eI(tI(e))}function rI(e){return e.patternProperties[tI(e)]}function iI(e){return YM(e,`Record`)}function aI(e){return KM({"~kind":`Rest`},{type:`rest`,items:e},{})}function oI(e){return YM(e,`Rest`)}function sI(e){return YM(e,`This`)}function cI(e){return KM({"~kind":`Undefined`},{type:`undefined`},e)}function lI(e){return YM(e,`Undefined`)}function uI(e){return YM(e,`Void`)}function dI(e){return tP()}function fI(e){return xP()}function pI(e){return _P()}function mI(e){return aP()}function hI(e){return xN()}function gI(e){return lP(e)}function _I(e){return e}function vI(e){return CP(e[1])}function yI(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function bI(e){return[e[0],...e[1]]}function xI(e){return e}function SI(e){return e[1]}function CI(e){return mM(e.length,2)}function wI(e,t,n){return CI(e)?t(e[0],e[1]):n()}function TI(e,t){return mM(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function EI(e,t){for(let n=0;nString.fromCharCode(e+n))}var OI=[...DI(97,122),...DI(65,90)],kI=[`0`,...DI(49,57)],AI=`//`,jI=`/*`,MI=`*/`;function NI(e){let t=e.indexOf(MI);return mM(t,-1)?``:e.slice(t+2)}function PI(e){let t=e.indexOf(` `);return mM(t,-1)?``:e.slice(t)}function FI(e){return e.replace(/^[ \t\r\f\v]+/,``)}function II(e){let t=FI(e);return t.startsWith(jI)?II(NI(t.slice(2))):t.startsWith(AI)?II(PI(t.slice(2))):t}function LI(e){let t=e.trimStart();return t.startsWith(jI)?LI(NI(t.slice(2))):t.startsWith(AI)?LI(PI(t.slice(2))):t}[...kI];function RI(e,t){return EI([e],t)}function zI(e,t){return mM(e,``)?[``,t]:e.startsWith(` -`)?RI(e,II(t)):e.startsWith(` `)?RI(e,t):RI(e,LI(t))}[...OI,...kI],[...kI];function BI(e){return mM(e,``)?[]:[e.slice(0,1),e.slice(1)]}function VI(e,t){return vM(e,(e,n)=>t.startsWith(e)?!0:VI(n,t),()=>!1)}function HI(e,t,n=``){return wI(BI(t),(r,i)=>VI(e,t)?[n,t]:HI(e,i,`${n}${r}`),()=>[])}function UI(e,t){return wI(HI(e,t),(e,t)=>mM(e,``)?[]:[e,t],()=>[])}var WI=(e,t,n=()=>[])=>e.length===2?t(e):n(),GI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[dI(e),t]),KI=e=>WI(zI(`.*`,e),([e,t])=>[fI(e),t]),qI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,e),([e,t])=>[pI(e),t]),JI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[mI(e),t]),YI=e=>WI(zI(`(?!)`,e),([e,t])=>[hI(e),t]),XI=e=>WI(UI([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[gI(e),t]),ZI=e=>WI(WI(GI(e),([e,t])=>[e,t],()=>WI(KI(e),([e,t])=>[e,t],()=>WI(qI(e),([e,t])=>[e,t],()=>WI(JI(e),([e,t])=>[e,t],()=>WI(YI(e),([e,t])=>[e,t],()=>WI(QI(e),([e,t])=>[e,t],()=>WI(XI(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[_I(e),t]),QI=e=>WI(WI(zI(`(`,e),([e,t])=>WI(tL(t),([t,n])=>WI(zI(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[vI(e),t]),$I=e=>WI(WI(WI(eL(e),([e,t])=>WI(zI(`|`,t),([t,n])=>WI($I(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>WI(WI(eL(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>WI([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[yI(e),t]),eL=e=>WI(WI(ZI(e),([e,t])=>WI(tL(t),([t,n])=>[[e,t],n])),([e,t])=>[bI(e),t]),tL=e=>WI(WI($I(e),([e,t])=>[e,t],()=>WI(eL(e),([e,t])=>[e,t],()=>[])),([e,t])=>[xI(e),t]),nL=e=>WI(WI(zI(`^`,e),([e,t])=>WI(tL(t),([t,n])=>WI(zI(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[SI(e),t]);function rL(e){return e.join(`|`)}function iL(e){return e.slice(1,e.length-1)}function aL(e,t,n){return gL(t,`${n}${e}`)}function oL(e,t){return gL(e,`${t}${eP}`)}function sL(e,t){return gL(e,`${t}${iP}`)}function cL(e,t){return gL(e,`${t}${gP}`)}function lL(e,t){return hL(CP([lP(`false`),lP(`true`)]),e,t)}function uL(e,t){return gL(e,`${t}.*`)}function dL(e,t,n){return gL(t,`${n}${iL(e)}`)}function fL(e,t,n){return hL(yL(e,{}),t,n)}function pL(e,t,n){return hL(TF(e),t,n)}function mL(e,t,n,r=[]){return vM(e,(e,i)=>mL(i,t,n,[...r,hL(e,[],``)]),()=>gL(t,`${n}(${rL(r)})`))}function hL(e,t,n){return WN(e)?pL(e.enum,t,n):oP(e)?sL(t,n):pP(e)?aL(e.const,t,n):nP(e)?oL(t,n):rP(e)?lL(t,n):vP(e)?cL(t,n):SP(e)?uL(t,n):CL(e)?dL(e.pattern,t,n):SL(e)?fL(e.parameters[0],t,n):wP(e)?mL(e.anyOf,t,n):bN}function gL(e,t){return vM(e,(e,n)=>hL(e,n,t),()=>t)}function _L(e){return`^${gL(e,``)}$`}function vL(e){return MP(_L(e))}function yL(e,t){return NU(e)?JM(vL(e),{},t):xL(e,t)}function bL(e,t,n,r){return yL(IU(e,t,n),r)}function xL(e,t={}){return ZM(`TemplateLiteral`,[e],t)}function SL(e){return XM(e)&&bM(e,`action`)&&mM(e.action,`TemplateLiteral`)}function CL(e){return YM(e,`TemplateLiteral`)}function wL(e){return KM({"~kind":`ExtendsUnion`},{inferred:e})}function TL(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`inferred`)&&mM(e[`~kind`],`ExtendsUnion`)&&fM(e.inferred)}function EL(e){return KM({"~kind":`ExtendsTrue`},{inferred:e})}function DL(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`inferred`)&&mM(e[`~kind`],`ExtendsTrue`)&&fM(e.inferred)}function OL(){return KM({"~kind":`ExtendsFalse`},{})}function kL(e){return fM(e)&&bM(e,`~kind`)&&mM(e[`~kind`],`ExtendsFalse`)}function AL(e){return TL(e)||DL(e)}function jL(e,t,n){return AL(e)?t(e.inferred):n()}function ML(e,t,n,r){return jL(XR(e,n,r),r=>EL(jM(jM(e,r),{[t]:n})),()=>OL())}function NL(e,t){return EL(e)}function PL(e,t,n,r,i){return jL(XR(e,t,n),e=>jL(XR(e,t,r),e=>EL(e),()=>OL()),()=>jL(XR(e,t,i),e=>EL(e),()=>OL()))}function FL(e,t,n){return XR(e,t,TF(n))}function IL(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>IL(e,t,r),()=>OL()),()=>EL(e))}function LL(e,t,n){return XR(e,t,DF(n))}function RL(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>EL(e),()=>RL(e,t,r)),()=>OL())}function zL(e,t,n){return yN(n)?NL(e,t):zN(n)?PL(e,t,n.if,n.then,n.else):WN(n)?FL(e,t,n.enum):LN(n)?ML(e,n.name,t,n.extends):KN(n)?IL(e,t,n.allOf):CL(n)?LL(e,t,n.pattern):wP(n)?RL(e,t,n.anyOf):NN(n)?EL(e):OL()}function BL(e,t,n){return LN(n)?zL(e,t,n):yN(n)||NN(n)?EL(e):wL(e)}function VL(e,t){let n=ZN(e),r=ZN(t);return n&&r||!n&&r?!0:!(n&&!r)}function HL(e,t,n,r){return oN(r)?VL(t,r)?XR(e,n,r.items):OL():zL(e,t,r)}function UL(e,t,n){return nP(n)?EL(e):zL(e,t,n)}function WL(e,t,n){return rP(n)?EL(e):zL(e,t,n)}function GL(e,t,n,r,i){let a=LN(r)?t:r,o=LN(r)?r:t,s=TN(t),c=TN(r);return!s&&c?OL():jL(XR(e,a,o),e=>JL(e,n,i),()=>OL())}function KL(e,t,n,r){return vM(r,(r,i)=>GL(e,t,n,r,i),()=>TN(t)?EL(e):OL())}function qL(e,t,n){return vM(t,(t,r)=>KL(e,t,r,n),()=>EL(e))}function JL(e,t,n){return qL(e,t,n)}function YL(e,t,n){return uI(n)?EL(e):XR(e,t,n)}function XL(e,t,n,r){return yN(r)||NN(r)?EL(e):lN(r)?jL(JL(e,t,r.parameters),e=>YL(e,n,r.instanceType),()=>OL()):OL()}function ZL(e,t,n,r,i){return jL(XR(e,t,i),()=>XR(e,n,i),()=>XR(e,r,i))}function QL(e,t,n){return XR(e,TF(t),n)}function $L(e,t,n,r){return yN(r)||NN(r)?EL(e):fN(r)?jL(JL(e,t,r.parameters),e=>YL(e,n,r.returnType),()=>OL()):OL()}function eR(e,t,n){return oP(n)||vP(n)?EL(e):zL(e,t,n)}function tR(e,t,n){return XR(e,EF(t),n)}function nR(e,t,n){return t===n?EL(e):OL()}function rR(e,t,n){return pP(n)?nR(e,t,n.const):nP(n)?EL(e):zL(e,lP(t),n)}function iR(e,t,n){return pP(n)?nR(e,t,n.const):rP(n)?EL(e):zL(e,lP(t),n)}function aR(e,t,n){return pP(n)?nR(e,t,n.const):vP(n)?EL(e):zL(e,lP(t),n)}function oR(e,t,n){return pP(n)?nR(e,t,n.const):SP(n)?EL(e):zL(e,lP(t),n)}function sR(e,t,n){return sM(t.const)?rR(e,t.const,n):cM(t.const)?iR(e,t.const,n):uM(t.const)?aR(e,t.const,n):pM(t.const)?oR(e,t.const,n):JN()}function cR(e,t,n){return LN(n)?zL(e,t,n):EL(e)}function lR(e,t,n){return hP(n)?EL(e):zL(e,t,n)}function uR(e,t,n){return vP(n)?EL(e):zL(e,t,n)}function dR(e,t,n){return TN(t)?TN(n)?EL(e):OL():EL(e)}function fR(e,t,n){return LN(n)&&SN(n.extends)?OL():jL(XR(e,t,n),e=>dR(e,t,n),()=>OL())}function pR(e,t){return e.reduce((e,n)=>n in t&&AL(t[n])?{...e,...t[n].inferred}:JN(),{})}function mR(e,t,n){let r={};for(let i of xM(n))r[i]=i in t?fR({},t[i],n[i]):TN(n[i])?LN(n[i])?EL(jM(e,{[n[i].name]:n[i].extends})):EL(e):OL();let i=CM(r).every(e=>AL(e)),a=i?pR(xM(r),r):{};return i?EL(a):OL()}function hR(e,t,n){let r=mR(e,t,n);return AL(r)?EL(jM(e,r.inferred)):OL()}function gR(e,t,n){return hR(e,t,n)}function _R(e,t){return xM(t).reduce((n,r)=>({...n,[r]:bM(e,r)?wP(n[r])?CP([...n[r].anyOf,t[r]]):CP([e[r],t[r]]):t[r]}),e)}function vR(e,t,n,r){return vM(t,(t,i)=>jL(XR({},e[t],n),t=>vR(e,i,n,_R(r,t)),()=>OL()),()=>EL(r))}function yR(e,t,n,r){return vR(t,xM(t),r,e)}function bR(e,t,n){return iI(n)?yR(e,t,tI(n),rI(n)):AN(n)?gR(e,t,n.properties):zL(e,kN(t),n)}function xR(e,t){return mM(xM(t).length,0)?EL(e):OL()}function SR(e,t,n,r,i){return XR(e,n,i)}function CR(e,t,n,r){return iI(r)?SR(e,eI(t),n,eI(tI(r)),rI(r)):AN(r)?xR(e,r.properties):yN(r)||NN(r)?EL(e):OL()}function wR(e,t,n){return SP(n)?EL(e):zL(e,t,n)}function TR(e,t,n){return bP(n)?EL(e):zL(e,t,n)}function ER(e,t,n){return XR(e,DF(t),n)}function DR(e,t){return KM({"~kind":`Inferrable`},{name:e,type:t},{})}function OR(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`name`)&&bM(e,`type`)&&mM(e[`~kind`],`Inferrable`)&&pM(e.name)&&fM(e.type)}function kR(e){return oI(e)?LN(e.items)?oN(e.items.extends)?DR(e.items.name,e.items.extends.items):NN(e.items.extends)?DR(e.items.name,e.items.extends):void 0:JN():void 0}function AR(e){return LN(e)?DR(e.name,e.extends):void 0}function jR(e,t,n=[]){return vM(e,(e,r)=>jL(XR({},e,t),()=>jR(r,t,[...n,e]),()=>void 0),()=>n)}function MR(e,t,n,r){let i=jR(n,r);return oM(i)?EL(jM(e,{[t]:KP(i)})):OL()}function NR(e,t,n,r){let i=jR(n,r);return oM(i)?EL(jM(e,{[t]:CP(i)})):OL()}function PR(e){return[...e].reverse()}function FR(e,t){return t?PR(e):e}function IR(e){let t=e.length>0?e[0]:void 0;return XM(XM(t)?kR(t):void 0)}function LR(e,t,n,r,i,a){return jL(XR(e,n,i),e=>BR(e,t,r,a),()=>OL())}function RR(e,t,n,r,i){let a=kR(r);return OR(a)?MR(e,a.name,FR(n,t),a.type):vM(n,(n,a)=>LR(e,t,n,a,r,i),()=>OL())}function zR(e,t,n,r){return vM(r,(r,i)=>RR(e,t,n,r,i),()=>mM(n.length,0)?EL(e):OL())}function BR(e,t,n,r){return zR(e,t,n,r)}function VR(e,t,n){let r=FU(e,MU([],[]),n),i=IR(r);return BR(e,i,FR(t,i),FR(r,i))}function HR(e,t,n){let r=AR(n);return OR(r)?NR(e,r.name,t,r.type):vM(t,(t,r)=>jL(XR(e,t,n),e=>HR(e,r,n),()=>OL()),()=>EL(e))}function UR(e,t,n){let r=FU(e,MU([],[]),t);return qP(n)?VR(e,r,n.items):oN(n)?HR(e,r,n.items):zL(e,KP(r),n)}function WR(e,t,n){return uI(n)||lI(n)?EL(e):zL(e,t,n)}function GR(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>EL(e),()=>GR(e,t,r)),()=>OL())}function KR(e,t,n){return vM(t,(t,r)=>jL(GR(e,t,n),e=>KR(e,r,n),()=>OL()),()=>EL(e))}function qR(e,t,n){let r=AR(n);return OR(r)?NR(e,r.name,t,r.type):wP(n)?KR(e,t,n.anyOf):KR(e,t,[n])}function JR(e,t,n){return LN(n)?zL(e,t,n):yN(n)||NN(n)?EL(e):OL()}function YR(e,t,n){return uI(n)?EL(e):zL(e,t,n)}function XR(e,t,n){return yN(t)?BL(e,t,n):oN(t)?HL(e,t,t.items,n):nP(t)?UL(e,t,n):rP(t)?WL(e,t,n):lN(t)?XL(e,t.parameters,t.instanceType,n):zN(t)?ZL(e,t.if,t.then,t.else,n):WN(t)?QL(e,t.enum,n):fN(t)?$L(e,t.parameters,t.returnType,n):oP(t)?eR(e,t,n):KN(t)?tR(e,t.allOf,n):pP(t)?sR(e,t,n):SN(t)?cR(e,t,n):hP(t)?lR(e,t,n):vP(t)?uR(e,t,n):AN(t)?bR(e,t.properties,n):iI(t)?CR(e,tI(t),rI(t),n):SP(t)?wR(e,t,n):bP(t)?TR(e,t,n):CL(t)?ER(e,t.pattern,n):qP(t)?UR(e,t.items,n):lI(t)?WR(e,t,n):wP(t)?qR(e,t.anyOf,n):NN(t)?JR(e,t,n):uI(t)?YR(e,t,n):OL()}function ZR(e,t){return EF([...e,kN(t)])}function QR(e,t,n){return NU(e)?JM(ZR(e,t),{},n):ez(e,t,n)}function $R(e,t,n,r,i){return QR(IU(e,t,n),PU(e,t,r),i)}function ez(e,t,n={}){return ZM(`Interface`,[e,t],n)}function tz(e){return XM(e)&&bM(e,`action`)&&mM(e.action,`Interface`)}function nz(e,t,n){return e.includes(n)?!0:az([...e,n],t,t[n])}function rz(e,t,n){return iz(e,t,ON(n))}function iz(e,t,n){return vM(n,(n,r)=>az(e,t,n)?!0:iz(e,t,r),()=>!1)}function az(e,t,n){return hN(n)?nz(e,t,n.$ref):oN(n)?az(e,t,n.items):lN(n)?iz(e,t,[...n.parameters,n.instanceType]):fN(n)?iz(e,t,[...n.parameters,n.returnType]):tz(n)?rz(e,t,n.parameters[1]):KN(n)?iz(e,t,n.allOf):AN(n)?rz(e,t,n.properties):wP(n)?iz(e,t,n.anyOf):qP(n)?iz(e,t,n.items):iI(n)?az(e,t,rI(n)):!1}function oz(e,t,n){return az(e,t,n)}function sz(e,t){return t.reduce((t,n)=>oz([n],e,e[n])?[...t,n]:t,[])}function cz(e){return sz(e,DN(e))}function lz(e,t,n){return n.includes(t)?n:t in e?fz(e,e[t],[...n,t]):JN()}function uz(e,t,n){return dz(e,ON(t),n)}function dz(e,t,n){return t.reduce((t,n)=>fz(e,n,t),n)}function fz(e,t,n){return hN(t)?lz(e,t.$ref,n):oN(t)?fz(e,t.items,n):lN(t)?dz(e,[...t.parameters,t.instanceType],n):fN(t)?dz(e,[...t.parameters,t.returnType],n):tz(t)?uz(e,t.parameters[1],n):KN(t)?dz(e,t.allOf,n):AN(t)?uz(e,t.properties,n):wP(t)?dz(e,t.anyOf,n):qP(t)?dz(e,t.items,n):iI(t)?fz(e,rI(t),n):n}function pz(e,t,n){return fz(e,n,[t])}function mz(e){return vN()}function hz(e){return xM(e).reduce((t,n)=>({...t,[n]:_z(e[n])}),{})}function gz(e){return e.reduce((e,t)=>[...e,_z(t)],[])}function _z(e){return hN(e)?mz(e.$ref):oN(e)?aN(_z(e.items),sN(e)):lN(e)?cN(gz(e.parameters),_z(e.instanceType)):fN(e)?dN(gz(e.parameters),_z(e.returnType)):KN(e)?GN(gz(e.allOf)):AN(e)?kN(hz(e.properties)):iI(e)?QF(nI(e),_z(rI(e))):wP(e)?CP(gz(e.anyOf)):qP(e)?KP(gz(e.items)):e}function vz(e,t){return t in e?_z(e[t]):MN()}function yz(e){return vz(e.$defs,e.$ref)}function bz(e,t,n){let r=IU(e,MU([],[]),t),i=PU({},MU([],[]),n);return EF([...r,kN(i)])}function xz(e,t){return xM(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=tz(r)?bz(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function Sz(e,t,n){return PN(xz(e,pz(e,t,n)),t)}function Cz(e,t){return t in e?hN(e[t])?Cz(e,e[t].$ref):e[t]:xN()}function wz(e,t){return Cz(e,t)}function Tz(e){return FN(e)?yz(e):IN(e)?MN():e}function Ez(e,t,n){return XR(e,Tz(t),Tz(n))}function Dz(e,t){let n=[Ez({},e,t),Ez({},t,e)];return AL(n[0])&&AL(n[1])?0:AL(n[0])&&kL(n[1])?2:kL(n[0])&&AL(n[1])?3:1}function Oz(e,t,n=[],r=t){return vM(t,(t,i)=>{let a=Dz(e,t);return mM(a,2)||mM(a,0)?r:mM(a,1)?Oz(e,i,[...n,t],r):Oz(e,i,n,r)},()=>[...n,e])}function kz(e,t,n){let r=kF(e);return yN(r)||NN(r)?[r]:SN(r)?Az(t,n):AN(r)?Az(t,[...n,r]):Az(t,Oz(r,n))}function Az(e,t=[]){return vM(e,(e,n)=>kz(e,n,t),()=>t)}function jz(e){return zF(Az(e))}function Mz(e,t){return JM(kF(e),{},t)}function Nz(e,t,n,r){return Mz(BU(e,t,n),r)}function Pz(e,t=[]){return QM(e)&&mM(e.action,`Conditional`)?hN(e.parameters[0])?Pz(e.parameters[2],Pz(e.parameters[3],[...t,e.parameters[0].$ref])):Pz(e.parameters[2],Pz(e.parameters[3],t)):QM(e)&&mM(e.action,`Mapped`)&&QM(e.parameters[1])&&mM(e.parameters[1].action,`KeyOf`)&&hN(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function Fz(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function Iz(e,t,n=[]){return vM(e,(e,r)=>vM(t,(t,i)=>Iz(r,i,[...n,[t,e]]),()=>n),()=>n)}function Lz(e){return CL(e)?DF(e.pattern):WN(e)?TF(e.enum):e}function Rz(e){let t=Lz(e);return wP(t)?[...t.anyOf]:[t]}function zz(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function Bz(e,t){return t.reduce((t,n)=>[...t,...zz(e,n)],[])}function Vz(e){return e.reduce((e,t)=>mM(t[0],!0)?Bz(e,Rz(t[1])):Bz(e,[t[1]]),[[]])}function Hz(e,t,n){let r=Iz(t,Fz(e,Pz(n)));return QM(n)&&mM(n.action,`Conditional`)||QM(n)&&mM(n.action,`Mapped`)?Vz(r):[t]}function Uz(){return[`(not-resolvable)`,xN()]}function Wz(){return[`(not-generic)`,xN()]}function Gz(e,t,n){return[e,gN(t,n)]}function Kz(e,t,n){return t in e?qz(e,t,e[t],n):Uz()}function qz(e,t,n,r){return _N(n)?Gz(t,n.parameters,n.expression):hN(n)?Kz(e,n.$ref,r):Wz()}function Jz(e,t,n){return qz(e,`(anonymous)`,t,n)}function Yz(e,t,n){if(LN(t)||fB(t)||AL(Ez({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function Xz(e,t,n,r,i){let a=BU(e,t,i);return Yz(n,a,r),jM(e,{[n]:a})}function Zz(e,t,n,r,i){let a=BU(e,t,n.extends),o=BU(e,t,n.equals);return vM(i,(i,o)=>Qz(Xz(e,t,n.name,a,i),t,r,o),()=>Qz(Xz(e,t,n.name,a,o),t,r,[]))}function Qz(e,t,n,r){return vM(n,(n,i)=>Zz(e,t,n,i,r),()=>e)}function $z(e,t,n,r){return Qz(e,t,n,r)}var eB=0,tB=0;function nB(){if(!gM(tB,kM().maxInstantiationCount))throw Error(`Type instantiation is excessively deep and possibly infinite`)}function rB(){nB(),tB++,eB++}function iB(){eB--,mM(eB,0)&&(tB=0)}function aB(e){return hM(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function oB(e,t){return mM(aB(e),t)}function sB(e,t,n,r,i,a){rB();try{let o=$z(e,t,r,a),s=BU(o,MU([...t.callstack,n.$ref],t.visited),i);return BU(o,MU([],[]),s)}finally{iB()}}function cB(e,t,n,r,i,a){return a.reduce((a,o)=>{let s=sB(e,t,n,r,i,o);return[...a,s]},[])}function lB(e,t,n,r,i,a){let o=cB(e,t,n,r,i,Hz(r,a,i));return mM(o.length,1)?o[0]:OF(o)}function uB(e,t,n,r){let i=IU(e,t,r),a=Jz(e,n,r),o=a[0],s=a[1];return _N(s)?oB(t,o)?dB(mN(o),i):lB(e,t,mN(o),s.parameters,s.expression,i):dB(n,i)}function dB(e,t){return KM({"~kind":`Call`},{type:`call`,target:e,arguments:t},{})}function fB(e){return YM(e,`Call`)}function pB(e){return qM(e,[`~immutable`])}function mB(e,t){return JM(pB(e),{},t)}function hB(e,t,n,r){return mB(BU(e,t,n),r)}function gB(e,t){return e(t)}function _B(e,t){return pM(t)?lP(gB(e,t)):lP(t)}function vB(e,t){return bB(e,DF(t))}function yB(e,t){return CP(t.map(t=>bB(e,t)))}function bB(e,t){return pP(t)?_B(e,t.const):CL(t)?vB(e,t.pattern):wP(t)?yB(e,t.anyOf):t}function xB(e,t={}){return ZM(`Capitalize`,[e],t)}function SB(e,t={}){return ZM(`Lowercase`,[e],t)}function CB(e,t={}){return ZM(`Uncapitalize`,[e],t)}function wB(e,t={}){return ZM(`Uppercase`,[e],t)}var TB=e=>e[0].toUpperCase()+e.slice(1),EB=e=>e.toLowerCase(),DB=e=>e[0].toLowerCase()+e.slice(1),OB=e=>e.toUpperCase();function kB(e,t){return NU([e])?JM(bB(TB,e),{},t):xB(e,t)}function AB(e,t){return NU([e])?JM(bB(EB,e),{},t):SB(e,t)}function jB(e,t){return NU([e])?JM(bB(DB,e),{},t):CB(e,t)}function MB(e,t){return NU([e])?JM(bB(OB,e),{},t):wB(e,t)}function NB(e,t,n,r){return kB(BU(e,t,n),r)}function PB(e,t,n,r){return AB(BU(e,t,n),r)}function FB(e,t,n,r){return jB(BU(e,t,n),r)}function IB(e,t,n,r){return MB(BU(e,t,n),r)}function LB(e,t,n,r,i={}){return ZM(`Conditional`,[e,t,n,r],i)}function RB(e,t,n,r,i,a){let o=Ez(e,n,r);return TL(o)?CP([BU(o.inferred,t,i),BU(e,t,a)]):DL(o)?BU(o.inferred,t,i):BU(e,t,a)}function zB(e,t,n,r,i,a,o){return NU([n,r])?JM(RB(e,t,n,r,i,a),{},o):LB(n,r,i,a,o)}function BB(e,t,n,r,i,a,o){return zB(e,t,BU(e,t,n),BU(e,t,r),i,a,o)}function VB(e,t={}){return ZM(`ConstructorParameters`,[e],t)}function HB(e){let t=lN(e)?e.parameters:[];return KP(FU({},MU([],[]),t))}function UB(e,t){return NU([e])?JM(HB(e),{},t):VB(e,t)}function WB(e,t,n,r){return UB(BU(e,t,n),r)}function GB(e,t,n={}){return ZM(`Exclude`,[e,t],n)}function KB(e,t,n){return NU([e,t])?JM(CF(e,t),{},n):GB(e,t,n)}function qB(e,t,n,r,i){return KB(BU(e,t,n),BU(e,t,r),i)}function JB(e,t,n={}){return ZM(`Extract`,[e,t],n)}function YB(e,t){return AL(Ez({},e,t))?[e]:[]}function XB(e,t,n=[]){return vM(e,(e,r)=>XB(r,t,[...n,...YB(e,t)]),()=>n)}function ZB(e,t){let n=kF(e);return OF(XB(wP(n)?n.anyOf:[n],t))}function QB(e,t,n){return NU([e,t])?JM(ZB(e,t),{},n):JB(e,t,n)}function $B(e,t,n,r,i){return QB(BU(e,t,n),BU(e,t,r),i)}function eV(e,t,n={}){return ZM(`Index`,[e,t],n)}function tV(e,t){return uV(wz(e,t))}function nV(e,t,n){return uV(wF(e,t,n))}function rV(e,t){let n=xM(e).filter(e=>!bM(t,e)),r=xM(t).filter(t=>!bM(e,t)),i=xM(e).filter(e=>bM(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:EF([e[r],t[r]])}),{});return jM(jM(a,o),s)}function iV(e){return e.reduce((e,t)=>rV(e,uV(t)),{})}function aV(e){return e}function oV(e){return uV(iF(KP(e)))}function sV(e,t){return xM(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:OF([e[r],t[r]])}),{})}function cV(e,t){return vM(e,(e,n)=>cV(n,sV(t,uV(e))),()=>t)}function lV(e){return vM(e,(e,t)=>cV(t,uV(e)),()=>JN())}function uV(e){return FN(e)?tV(e.$defs,e.$ref):zN(e)?nV(e.if,e.then,e.else):KN(e)?iV(e.allOf):wP(e)?lV(e.anyOf):qP(e)?oV(e.items):AN(e)?aV(e.properties):{}}function dV(e){return kN(uV(e))}var fV=RegExp(`^(?:0|[1-9][0-9]*)$`);function pV(e){let t=`${e}`;return fV.test(t)?parseInt(t):e}function mV(e){return lP(pV(e))}function hV(e){return e.map(e=>gV(e))}function gV(e){return KN(e)?GN(hV(e.allOf)):wP(e)?CP(hV(e.anyOf)):pP(e)?mV(e.const):e}function _V(e,t){return AL(Ez({},gV(t),_P()))?e:pP(t)&&mM(t.const,`length`)?_P():xN()}function vV(e,t){return TV(wz(e,t))}function yV(e,t,n){return TV(wF(e,t,n))}function bV(e){return TV(TF(e))}function xV(e){return TV(EF(e))}function SV(e){return[`${e}`]}function CV(e){return TV(DF(e))}function wV(e){return e.reduce((e,t)=>[...e,...TV(t)],[])}function TV(e){return FN(e)?vV(e.$defs,e.$ref):zN(e)?yV(e.if,e.then,e.else):WN(e)?bV(e.enum):KN(e)?xV(e.allOf):pP(e)?SV(e.const):CL(e)?CV(e.pattern):wP(e)?wV(e.anyOf):[]}function EV(e){return TV(e)}function DV(e,t){return t.map(t=>OV(e,t))}function OV(e,t){return oN(t)?aN(OV(e,t.items)):lN(t)?cN(DV(e,t.parameters),OV(e,t.instanceType)):fN(t)?dN(DV(e,t.parameters),OV(e,t.returnType)):qP(t)?KP(DV(e,t.items)):wP(t)?CP(DV(e,t.anyOf)):KN(t)?GN(DV(e,t.allOf)):sI(t)?kN(e):t}function kV(e,t){return OV(e,t)}function AV(e,t){return kV(e,t in e?e[t]:xN())}function jV(e,t){return t.reduce((t,n)=>[...t,AV(e,n)],[])}function MV(e,t){return OF(jV(e,EV(t)))}var NV=new RegExp(JF);function PV(e){return e.filter(e=>NV.test(e))}function FV(e){return OF(jV(e,PV(DN(e))))}function IV(e,t){return vP(t)?FV(e):MV(e,t)}function LV(e){return lP(pV(e))}function RV(e){return e.map(e=>zV(e))}function zV(e){return KN(e)?GN(RV(e.allOf)):wP(e)?CP(RV(e.anyOf)):pP(e)?LV(e.const):e}function BV(e,t){return e.reduceRight((e,n,r)=>AL(Ez({},lP(r),t))?[n,...e]:e,[])}function VV(e,t){return AF(BV(e,zV(t)))}function HV(e){return AF(e)}function UV(e,t){return pP(t)&&mM(t.const,`length`)?lP(e.length):vP(t)||oP(t)?HV(e):VV(e,t)}function WV(e,t){return oN(e)?_V(e.items,t):AN(e)?IV(e.properties,t):qP(e)?UV(e.items,t):xN()}function GV(e){return FN(e)||zN(e)||KN(e)||wP(e)?dV(e):e}function KV(e,t,n){return NU([e,t])?JM(WV(GV(e),t),{},n):eV(e,t,n)}function qV(e,t,n,r,i){return KV(BU(e,t,n),BU(e,t,r),i)}function JV(e,t={}){return ZM(`InstanceType`,[e],t)}function YV(e){return lN(e)?e.instanceType:xN()}function XV(e,t){return NU([e])?JM(YV(e),{},t):JV(e,t)}function ZV(e,t,n,r={}){return XV(BU(e,t,n),r)}function QV(e,t={}){return ZM(`KeyOf`,[e],t)}function $V(){return CP([_P(),xP(),yP()])}function eH(e){return _P()}function tH(e){return e.reduce((e,t)=>uP(t)?[...e,lP(pV(t))]:JN(),[])}function nH(e){return AF(tH(xM(e)))}function rH(e){return nI(e)}function iH(e){return AF(e.map((e,t)=>lP(t)))}function aH(e){return yN(e)?$V():oN(e)?eH(e.items):AN(e)?nH(e.properties):iI(e)?rH(e):qP(e)?iH(e.items):xN()}function oH(e){return FN(e)||zN(e)||KN(e)||wP(e)?dV(e):e}function sH(e,t){return NU([e])?JM(aH(oH(e)),{},t):QV(e,t)}function cH(e,t,n,r){return sH(BU(e,t,n),r)}function lH(e,t,n,r,i={}){return ZM(`Mapped`,[e,t,n,r],i)}function uH(e){return mH(DF(e))}function dH(e){return e.reduce((e,t)=>[...e,...mH(t)],[])}function fH(e){return mH(TF(e))}function pH(e){return uM(e)?[lP(`${e}`)]:[lP(e)]}function mH(e){return WN(e)?fH(e.enum):pP(e)?pH(e.const):CL(e)?uH(e.pattern):wP(e)?dH(e.anyOf):[e]}function hH(e){return mH(e)}function gH(e){return CL(e)?DF(e.pattern):e}function _H(e,t,n,r,i,a){let o=jM(e,{[n.name]:r}),s=gH(BU(o,t,i)),c=BU(o,t,a);return dP(s)||fP(s)?{[s.const]:c}:{}}function vH(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,_H(e,t,n,o,i,a)],[])}function yH(e){return e.reduce((e,t)=>[...e,kN(t)],[])}function bH(e,t,n,r,i,a){return EF(yH(vH(e,t,n,hH(r),i,a)))}function xH(e,t,n,r,i,a,o){return NU([r])?JM(bH(e,t,n,r,i,a),{},o):lH(n,r,i,a,o)}function SH(e,t,n,r,i,a,o){return xH(e,t,n,BU(e,t,r),i,a,o)}function CH(e,t,n){let r=jM(e,t);return xM(t).filter(e=>n.includes(e)).reduce((e,n)=>({...e,[n]:Sz(r,n,t[n])}),{})}function wH(e,t,n){let r=jM(e,t);return xM(t).filter(e=>!n.includes(e)).reduce((e,n)=>({...e,[n]:BU(r,MU([],[]),t[n])}),{})}function TH(e,t,n){let r=cz(t),i=CH(e,t,r),a=wH(e,t,r);return JM({...i,...a},{},n)}function EH(e,t,n,r){return TH(e,n,r)}function DH(e,t={}){return ZM(`NonNullable`,[e],t)}function OH(e){return KB(e,CP([mP(),cI()]),{})}function kH(e,t){return NU([e])?JM(OH(e),{},t):DH(e,t)}function AH(e,t,n,r){return kH(BU(e,t,n),r)}function jH(e,t,n={}){return ZM(`Omit`,[e,t],n)}function MH(e){let t=dV(e);return AN(t)?t.properties:JN()}function NH(e,t){return xM(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function PH(e,t){return kN(NH(MH(e),EV(t)))}function FH(e,t,n){return NU([e,t])?JM(PH(e,t),{},n):jH(e,t,n)}function IH(e,t,n,r,i){return FH(BU(e,t,n),BU(e,t,r),i)}function LH(e,t={}){return ZM(`Parameters`,[e],t)}function RH(e){let t=fN(e)?e.parameters:[];return KP(FU({},MU([],[]),t))}function zH(e,t){return NU([e])?JM(RH(e),{},t):LH(e,t)}function BH(e,t,n,r){return zH(BU(e,t,n),r)}function VH(e,t={}){return ZM(`Partial`,[e],t)}function HH(e,t={}){return YH(e,t)}function UH(e,t){let n=JH(wz(e,t));return PN(jM(e,{[t]:n}),t)}function WH(e,t,n){return JH(wF(e,t,n))}function GH(e){return JH(EF(e))}function KH(e){return CP(e.map(e=>JH(e)))}function qH(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:CN(e[n])}),{}))}function JH(e){return FN(e)?UH(e.$defs,e.$ref):zN(e)?WH(e.if,e.then,e.else):KN(e)?GH(e.allOf):wP(e)?KH(e.anyOf):AN(e)?qH(e.properties):kN({})}function YH(e,t){return NU([e])?JM(JH(e),{},t):VH(e,t)}function XH(e,t,n,r){return YH(BU(e,t,n),r)}function ZH(e,t,n={}){return ZM(`Pick`,[e,t],n)}function QH(e,t){return xM(e).reduce((n,r)=>t.includes(r)?jM(n,{[r]:e[r]}):n,{})}function $H(e,t){return kN(QH(MH(e),EV(t)))}function eU(e,t,n){return NU([e,t])?JM($H(e,t),{},n):ZH(e,t,n)}function tU(e,t,n,r,i){return eU(BU(e,t,n),BU(e,t,r),i)}function nU(e,t={}){return ZM(`ReadonlyObject`,[e],t)}function rU(e){return WU(aN(e))}function iU(e,t){let n=uU(wz(e,t));return PN(jM(e,{[t]:n}),t)}function aU(e,t,n){return uU(wF(e,t,n))}function oU(e){return uU(EF(e))}function sU(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:QN(e[n])}),{}))}function cU(e){return WU(KP(e))}function lU(e){return CP(e.map(e=>uU(e)))}function uU(e){return oN(e)?rU(e.items):FN(e)?iU(e.$defs,e.$ref):zN(e)?aU(e.if,e.then,e.else):KN(e)?oU(e.allOf):AN(e)?sU(e.properties):qP(e)?cU(e.items):wP(e)?lU(e.anyOf):e}function dU(e,t){return NU([e])?JM(uU(e),{},t):nU(e)}function fU(e,t,n,r){return dU(BU(e,t,n),r)}function pU(e,t,n,r){return t.visited.includes(r)?n:r in e?BU(e,MU(t.callstack,[...t.visited,r]),e[r]):n}function mU(e,t){let n=yU(wz(e,t));return PN(jM(e,{[t]:n}),t)}function hU(e,t,n){return yU(wF(e,t,n))}function gU(e){return yU(EF(e))}function _U(e){return CP(e.map(e=>yU(e)))}function vU(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:nF(e[n])}),{}))}function yU(e){return FN(e)?mU(e.$defs,e.$ref):zN(e)?hU(e.if,e.then,e.else):KN(e)?gU(e.allOf):wP(e)?_U(e.anyOf):AN(e)?vU(e.properties):kN({})}function bU(e,t={}){return ZM(`Required`,[e],t)}function xU(e,t){return NU([e])?JM(yU(e),{},t):bU(e,t)}function SU(e,t,n,r){return xU(BU(e,t,n),r)}function CU(e,t={}){return ZM(`ReturnType`,[e],t)}function wU(e){return fN(e)?e.returnType:xN()}function TU(e,t){return NU([e])?JM(wU(e),{},t):CU(e,t)}function EU(e,t,n,r={}){return TU(BU(e,t,n),r)}function DU(e,t){return ZM(`With`,[e,t],{})}function OU(e,t){return NU([e])?JM(e,{},t):DU(e,t)}function kU(e,t,n,r){return OU(BU(e,t,n),r)}function AU(e){return oI(e)?qP(e.items)?jU(e.items.items):LN(e.items)||hN(e.items)?[e]:[xN()]:[e]}function jU(e){return e.reduce((e,t)=>[...e,...AU(t)],[])}function MU(e,t){return{callstack:e,visited:t}}function NU(e){return vM(e,(e,t)=>!hN(e)&&NU(t),()=>!0)}function PU(e,t,n){return xM(n).reduce((r,i)=>({...r,[i]:BU(e,t,n[i])}),{})}function FU(e,t,n){return jU(IU(e,t,n))}function IU(e,t,n){return n.map(n=>BU(e,t,n))}function LU(e,t){let n=TN(e)?rN(t,{}):t,r=$N(e)?eN(n,{}):n;return ZN(e)?HU(r,{}):r}function RU(e,t,n,r,i){return mM(n,`AddImmutable`)?UU(e,t,r[0],i):mM(n,`RemoveImmutable`)?hB(e,t,r[0],i):mM(n,`AddReadonly`)?tN(e,t,r[0],i):mM(n,`RemoveReadonly`)?ZP(e,t,r[0],i):mM(n,`AddOptional`)?iN(e,t,r[0],i):mM(n,`RemoveOptional`)?tF(e,t,r[0],i):mM(n,`Capitalize`)?NB(e,t,r[0],i):mM(n,`Conditional`)?BB(e,t,r[0],r[1],r[2],r[3],i):mM(n,`ConstructorParameters`)?WB(e,t,r[0],i):mM(n,`Evaluate`)?Nz(e,t,r[0],i):mM(n,`Exclude`)?qB(e,t,r[0],r[1],i):mM(n,`Extract`)?$B(e,t,r[0],r[1],i):mM(n,`Index`)?qV(e,t,r[0],r[1],i):mM(n,`InstanceType`)?ZV(e,t,r[0],i):mM(n,`Interface`)?$R(e,t,r[0],r[1],i):mM(n,`KeyOf`)?cH(e,t,r[0],i):mM(n,`Lowercase`)?PB(e,t,r[0],i):mM(n,`Mapped`)?SH(e,t,r[0],r[1],r[2],r[3],i):mM(n,`Module`)?EH(e,t,r[0],i):mM(n,`NonNullable`)?AH(e,t,r[0],i):mM(n,`Pick`)?tU(e,t,r[0],r[1],i):mM(n,`Parameters`)?BH(e,t,r[0],i):mM(n,`Partial`)?XH(e,t,r[0],i):mM(n,`Omit`)?IH(e,t,r[0],r[1],i):mM(n,`ReadonlyObject`)?fU(e,t,r[0],i):mM(n,`Record`)?qF(e,t,r[0],r[1],i):mM(n,`Required`)?SU(e,t,r[0],i):mM(n,`ReturnType`)?EU(e,t,r[0],i):mM(n,`TemplateLiteral`)?bL(e,t,r[0],i):mM(n,`Uncapitalize`)?FB(e,t,r[0],i):mM(n,`Uppercase`)?IB(e,t,r[0],i):mM(n,`With`)?kU(e,t,r[0],r[1]):ZM(n,r,i)}function zU(e,t,n){return LU(n,hN(n)?pU(e,t,n,n.$ref):oN(n)?aN(BU(e,t,n.items),sN(n)):fB(n)?uB(e,t,n.target,n.arguments):lN(n)?cN(IU(e,t,n.parameters),BU(e,t,n.instanceType),uN(n)):fN(n)?dN(IU(e,t,n.parameters),BU(e,t,n.returnType),pN(n)):zN(n)?RN(BU(e,t,n.if),BU(e,t,n.then),BU(e,t,n.else),BN(n)):KN(n)?GN(IU(e,t,n.allOf),qN(n)):AN(n)?kN(PU(e,t,n.properties),jN(n)):iI(n)?$F(tI(n),BU(e,t,rI(n))):oI(n)?aI(BU(e,t,n.items)):qP(n)?KP(FU(e,t,n.items),JP(n)):wP(n)?CP(IU(e,t,n.anyOf),TP(n)):n)}function BU(e,t,n){return QM(n)?RU(e,t,n.action,n.parameters,n.options):zU(e,t,n)}function VU(e){return JM(e,{"~immutable":!0},{})}function HU(e,t){return JM(VU(e),{},t)}function UU(e,t,n,r){return HU(BU(e,t,n),r)}function WU(e,t={}){return HU(e,t)}var GU=[`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],KU=[`off`,...GU],qU=[`text`,`image`],JU=[`none`,`short`,`long`],YU=[`short`,`long`];UN(GU);var XU=UN(KU);UN(qU),UN(JU),HH(QF(XU,CP([xP(),mP()]))),HH(QF(UN(YU),_P({exclusiveMinimum:0})),{description:`Best-effort prompt cache lifetime in seconds for each retention tier. A missing tier means the lifetime is unknown, so Pi does not warm it.`});var ZU={input:_P({description:`Input cost in USD per million tokens.`}),output:_P({description:`Output cost in USD per million tokens.`}),cacheRead:_P({description:`Cache-read cost in USD per million tokens.`}),cacheWrite:_P({description:`Cache-write cost in USD per million tokens.`})};kN(ZU);var QU=kN({inputTokensAbove:_P({description:`Use this tier when total request input exceeds this token count.`}),...ZU});kN({...ZU,tiers:wN(aN(QU,{description:`Request-wide pricing tiers. The highest matching input threshold applies to the full request.`}))});function $U(e){return kN({maxWidth:wN(aP({minimum:1})),maxHeight:wN(aP({minimum:1})),maxBytes:wN(aP({minimum:1,description:`Maximum base64-encoded payload size in bytes.`})),jpegQuality:wN(aP({minimum:1,maximum:100}))},e)}$U();var eW=kN({resize:wN($U({description:`Cache-safe resize profile applied before a new image enters conversation history.`})),maxPerMessage:wN(aP({minimum:1,description:`Maximum images accepted in one provider message.`})),maxPerRequest:wN(aP({minimum:1,description:`Maximum images accepted across one provider request.`}))});kN({maxRequestBytes:wN(aP({minimum:1,description:`Maximum serialized provider request size in bytes.`})),images:wN(eW)});function tW({sessionId:e,template:t,existingIds:n,apiKey:r,onClose:i,onAdd:a}){let{t:o}=W(),[s,c]=(0,K.useState)([]),[l,u]=(0,K.useState)(new Set),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)(!0),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(0),x=(0,K.useRef)({template:t,apiKey:r,existingIds:n}),S=new Set(n),C=Math.max(0,100-S.size),w=s.filter(e=>`${e.id} ${e.name}`.toLowerCase().includes(d.trim().toLowerCase())),T=w.filter(e=>!S.has(e.id)),E=T.length>0&&T.every(e=>l.has(e.id));return(0,K.useEffect)(()=>{let t=new AbortController,{template:n,apiKey:r,existingIds:i}=x.current;return m(!0),v(!1),new de().discoverProviderModels(e,{provider:n.provider,baseUrl:n.baseUrl,api:n.api,...r.trim()?{apiKey:r.trim()}:{}},t.signal).then(e=>{t.signal.aborted||(c(e.models),g(e.truncated),m(!1),u(new Set(e.models.filter(e=>!i.includes(e.id)).slice(0,Math.max(0,100-i.length)).map(e=>e.id))))},()=>{t.signal.aborted||(v(!0),m(!1))}),()=>t.abort()},[e,y]),(0,q.jsx)(Se,{isOpen:!0,width:380,padding:0,className:`models-picker-dialog`,"aria-label":o(`providerPickerTitle`),onOpenChange:e=>!e&&i(),children:(0,q.jsxs)(`div`,{className:`models-picker`,children:[(0,q.jsxs)(`header`,{children:[(0,q.jsx)(`h2`,{children:o(`providerPickerTitle`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":o(`close`),onClick:i,children:(0,q.jsx)(je,{})})]}),(0,q.jsx)(`p`,{children:o(`providerPickerIntro`)}),(0,q.jsxs)(`div`,{className:`models-picker-toolbar`,children:[(0,q.jsx)(`input`,{"data-autofocus":!0,type:`search`,"aria-label":o(`providerPickerSearch`),placeholder:o(`providerPickerSearch`),value:d,onKeyDown:e=>{e.key===`Enter`&&e.preventDefault()},onChange:e=>f(e.target.value)}),(0,q.jsx)(`button`,{type:`button`,className:`models-link`,disabled:p||!T.length,onClick:()=>u(e=>{let t=new Set(e);for(let e of T)E?t.delete(e.id):t.size(0,q.jsxs)(`label`,{className:`models-picker-row`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:S.has(e.id)||l.has(e.id),disabled:S.has(e.id)||!l.has(e.id)&&l.size>=C,onChange:t=>u(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}),(0,q.jsx)(`span`,{title:e.name,children:e.id}),S.has(e.id)&&(0,q.jsx)(`small`,{children:o(`providerPickerAdded`)})]},e.id)),!p&&!_&&!w.length&&(0,q.jsx)(`p`,{className:`models-picker-empty`,children:o(d?`providerPickerNoMatch`:`providerPickerEmpty`)}),_&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[(0,q.jsx)(`p`,{children:o(`providerPickerError_load`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:()=>b(e=>e+1),children:o(`retryAdmissionCheck`)})]})]}),h&&(0,q.jsx)(`p`,{className:`models-hint`,children:o(`providerPickerBounded`)}),(0,q.jsxs)(`footer`,{children:[(0,q.jsx)(`span`,{className:`models-hint`,"aria-live":`polite`,children:l.size>0&&o(`providerPickerSelected`,{count:l.size})}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:i,children:o(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:!l.size||p||_,onClick:()=>a(s.filter(e=>l.has(e.id))),children:o(`providerPickerSave`)})]})]})})}function nW(e){let t=e.trim();if(!t)return;let n=/^(\d+(?:\.\d+)?)([km])?$/i.exec(t);if(!n)return NaN;let r=n[2]?.toLowerCase()===`m`?1e6:n[2]?.toLowerCase()===`k`?1e3:1,i=Number(n[1])*r,a=Math.round(i),o=Math.abs(i-a)<1e-6?a:i;return Number.isSafeInteger(o)&&o>0&&o<=1e8?o:NaN}function rW(e){if(e===void 0)return``;if(Number.isInteger(e)&&e>0){if(e%1e6==0)return`${e/1e6}M`;if(e%1e3==0)return`${e/1e3}K`}return String(e)}function iW({sessionId:e,providerId:t,configuration:n,auth:r,isNew:i,custom:a,taken:o,currentModel:s,availableModels:c,busy:l,onDirty:u,onSaving:d,onClose:f,onReload:p}){let{t:m}=W(),[h]=(0,K.useState)(()=>{let e=n.providers?.find(e=>e.provider===t),i=n.models.filter(e=>e.provider===t).map(e=>({...e,rowKey:crypto.randomUUID()}));return{provider:t,name:e?.name||r?.name||t,baseUrl:e?.baseUrl||i[0]?.baseUrl||r?.baseUrl||``,api:e?.api||i[0]?.api||r?.api||`openai-completions`,models:i}}),[g]=(0,K.useState)(n.revision),[_,v]=(0,K.useState)(h),[y,b]=(0,K.useState)(``),x=!i&&!!r?.authMethods.includes(`oauth`),S=a||!!r?.authMethods.includes(`api_key`),[C,w]=(0,K.useState)(x&&(!r?.configured||r?.subscription||!S)?`oauth`:`api_key`),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1),k=(0,K.useRef)(null),A=(0,K.useRef)(!1),[j,M]=(0,K.useState)(new Set),[N,P]=(0,K.useState)({}),[F,I]=(0,K.useState)(!1),[ee,L]=(0,K.useState)(null),[R,te]=(0,K.useState)(!1),z=(0,K.useRef)(null),B=(0,K.useRef)({onDirty:u,onSaving:d});B.current={onDirty:u,onSaving:d};let ne=JSON.stringify(_)!==JSON.stringify(h),re=ne||y.length>0;(0,K.useEffect)(()=>{B.current.onDirty(re)},[re]),(0,K.useEffect)(()=>{B.current.onSaving(F||T)},[F,T]),(0,K.useEffect)(()=>{D?A.current=!0:A.current&&(A.current=!1,k.current?.focus({preventScroll:!0}))},[D]),(0,K.useEffect)(()=>()=>{z.current?.abort(),B.current.onSaving(!1),B.current.onDirty(!1)},[]);let V=n.providers?.find(e=>e.provider===t)?.editable!==!1,ie=l||F||T,ae=ie||R||!V,oe=!/^[a-zA-Z0-9._-]+$/.test(_.provider)||[`__proto__`,`constructor`,`prototype`].includes(_.provider)||i&&a&&o.includes(_.provider),se=_.models.findIndex(e=>!e.id.trim()||[e.contextWindow,e.maxTokens].some(e=>e!==void 0&&!Number.isFinite(e))||_.models.some(t=>t.rowKey!==e.rowKey&&t.id.trim()===e.id.trim())),ce=se!==-1,le=i&&a||ne,H=!oe&&!/[\r\n\u0000]/u.test(y)&&(R||!le||(!a||_.models.length>0)&&!ce&&!!_.baseUrl)&&(le||y.trim().length>0),ue=e=>{v(t=>({...t,...e})),ee!==`conflict`&&L(null)},fe=(e,t)=>ue({models:_.models.map((n,r)=>r===e?{...n,...t}:n)}),pe=_.models.map(e=>n.thinkingDefaults?.[`${e.provider}/${e.id}`]),me=_.models.map((e,t)=>{let n=e.thinkingLevelMap??pe[t];return KU.filter(e=>n?.[e]!==null&&(e!==`xhigh`&&e!==`max`||n?.[e]!==void 0))}),he={id:``,name:``,reasoning:!1,provider:_.provider,baseUrl:_.baseUrl,api:_.api},_e=async()=>{if(ie||D||!H||ee===`conflict`)return;let t=new AbortController;z.current=t,I(!0),L(null);let n=R,r=new de;try{if(le&&!n){if(await r.changeProviderConfiguration(e,g,{action:`save`,configuration:{..._,name:_.name.trim()||_.provider,models:_.models.map(({rowKey:e,...t})=>({...t,id:t.id.trim(),name:t.name.trim()||t.id.trim(),provider:_.provider,baseUrl:_.baseUrl===h.baseUrl&&t.baseUrl||_.baseUrl,api:_.api===h.api?t.api:_.api}))}},t.signal),t.signal.aborted)return;n=!0,te(!0)}if(y.trim()&&await r.saveProviderKey(e,_.provider,y.trim(),t.signal),t.signal.aborted)return;b(``),B.current.onDirty(!1),f(_.name||_.provider,_.provider)}catch(e){t.signal.aborted||L(e instanceof ge&&e.code===`MODEL_CONFIGURATION_CONFLICT`?`conflict`:e instanceof ge&&e.code===`MODEL_NOT_AVAILABLE`?`current`:n?`key`:`failed`)}finally{t.signal.aborted||I(!1)}},ve=e=>(0,q.jsxs)(`label`,{className:`models-field`,children:[m(e===`name`?`providerDisplayName`:`modelConfig_${e}`),(0,q.jsx)(`input`,{type:e===`baseUrl`?`url`:`text`,value:_[e],maxLength:e===`baseUrl`?2048:160,autoComplete:`off`,disabled:ae,required:e===`provider`||e===`baseUrl`&&le,"aria-invalid":e===`provider`&&_.provider.length>0&&oe,placeholder:e===`provider`?`my-provider`:e===`name`?_.provider:`https://api.example.com/v1`,onChange:t=>ue({[e]:t.target.value})})]}),ye=(0,q.jsxs)(`label`,{className:`models-field`,htmlFor:`provider-api-${t||`custom`}`,children:[m(`modelConfig_api`),(0,q.jsx)(Tj,{id:`provider-api-${t||`custom`}`,label:m(`modelConfig_api`),value:_.api,disabled:ae,onChange:e=>{(e===`openai-responses`||e===`openai-completions`||e===`anthropic-messages`)&&ue({api:e})},options:[{value:`openai-completions`,label:`OpenAI Chat Completions`},{value:`openai-responses`,label:`OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`}]})]}),be=(0,q.jsxs)(`div`,{className:`models-catalog`,children:[(0,q.jsxs)(`div`,{className:`models-list-head`,children:[(0,q.jsx)(`span`,{children:m(`modelSettings`)}),(0,q.jsx)(`button`,{type:`button`,ref:k,className:`models-link`,disabled:ae||oe||!_.baseUrl,onClick:()=>O(!0),children:m(`providerFetchModels`)})]}),!V&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerModelsReadOnly`)}),_.models.length===0&&(0,q.jsx)(`p`,{className:`models-empty`,children:m(a?`providerModelsEmpty`:`providerModelsInherited`,{count:c.length})}),(0,q.jsxs)(`div`,{className:`models-entry-list`,children:[s&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerCurrentSessionModel`,{model:`${s.provider} / ${s.id}`})}),_.models.map((e,t)=>(0,q.jsxs)(`div`,{className:`models-entry`,children:[s?.provider===_.provider&&s.id===e.id&&(0,q.jsx)(`p`,{className:`models-current-label`,children:m(`currentModel`)}),(0,q.jsxs)(`div`,{className:`models-entry-row`,children:[(0,q.jsx)(`input`,{"aria-label":m(`providerModelId`,{number:t+1}),placeholder:m(`modelConfig_id`),value:e.id,maxLength:256,required:!0,disabled:ae||s?.provider===_.provider&&s.id===e.id,onChange:e=>fe(t,{id:e.target.value})}),(0,q.jsx)(`input`,{"aria-label":m(`providerModelName`,{number:t+1}),placeholder:m(`modelConfig_name`),value:e.name,maxLength:256,disabled:ae,onChange:e=>fe(t,{name:e.target.value})}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":m(`providerModelDetails`,{model:e.name||e.id||t+1}),"aria-expanded":j.has(e.rowKey),title:m(`providerModelOptions`),onClick:()=>M(t=>{let n=new Set(t);return n.delete(e.rowKey)||n.add(e.rowKey),n}),children:(0,q.jsx)(os,{})}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon danger`,"aria-label":m(`providerRemoveModel`,{model:e.name||e.id||t+1}),disabled:ae||s?.provider===_.provider&&s.id===e.id,title:s?.provider===_.provider&&s.id===e.id?m(`providerCurrentRemoval`):m(`providerRemoveModel`,{model:e.name||e.id||t+1}),onClick:()=>{ue({models:_.models.filter((e,n)=>n!==t)}),M(t=>new Set([...t].filter(t=>t!==e.rowKey))),P(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.rowKey)))},children:(0,q.jsx)(Uc,{})})]}),j.has(e.rowKey)&&(0,q.jsxs)(`div`,{className:`models-entry-details`,children:[[`contextWindow`,`maxTokens`].map(n=>(0,q.jsxs)(`label`,{className:`models-field models-capacity`,children:[m(`modelConfig_${n}`),(0,q.jsx)(`input`,{type:`text`,inputMode:`numeric`,autoComplete:`off`,spellCheck:!1,"aria-label":m(`providerCapacityLabel`,{field:m(`modelConfig_${n}`),number:t+1}),"aria-invalid":e[n]!==void 0&&!Number.isFinite(e[n]),placeholder:n===`contextWindow`?`256K`:`32K`,value:N[e.rowKey]?.[n]??rW(e[n]),disabled:ae,onChange:r=>{let i=r.target.value;P(t=>({...t,[e.rowKey]:{...t[e.rowKey],[n]:i}})),fe(t,{[n]:nW(i)})}})]},n)),(0,q.jsxs)(`fieldset`,{className:`models-input-types`,"aria-label":m(`providerCapacityLabel`,{field:m(`providerInputTypes`),number:t+1}),children:[(0,q.jsx)(`legend`,{children:m(`providerInputTypes`)}),(0,q.jsx)(`div`,{children:[`text`,`image`].map(n=>{let r=e.input??[`text`];return(0,q.jsxs)(`label`,{className:`models-checkbox`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:r.includes(n),disabled:ae||r.length===1&&r.includes(n),onChange:e=>fe(t,{input:[`text`,`image`].filter(t=>t===n?e.target.checked:r.includes(t))})}),m(n===`text`?`providerInputText`:`providerInputImage`)]},n)})})]}),(0,q.jsx)(`p`,{className:`models-hint models-capability-hint`,children:m(`providerImageHint`)}),(0,q.jsxs)(`label`,{className:`models-checkbox models-reasoning`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:e.reasoning,disabled:ae,onChange:e=>fe(t,{reasoning:e.target.checked})}),m(`modelConfig_reasoning`)]}),(0,q.jsx)(`p`,{className:`models-hint models-capability-hint`,children:m(`providerReasoningHint`)}),e.reasoning&&(0,q.jsxs)(`div`,{className:`models-thinking-levels`,children:[(0,q.jsxs)(`div`,{className:`models-thinking-copy`,children:[(0,q.jsx)(`strong`,{children:m(`providerThinkingLevels`)}),(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerThinkingLevelsHint`)})]}),(0,q.jsx)(yo,{button:{label:e.thinkingLevelMap==null?m(`providerThinkingAutomatic`):m(`providerThinkingSelected`,{count:me[t].length}),"aria-label":m(`providerCapacityLabel`,{field:m(`providerThinkingLevels`),number:t+1}),variant:`secondary`,size:`sm`,className:`models-thinking-trigger`,isDisabled:ae},className:`configuration-level-menu`,menuWidth:`min(240px, calc(100vw - 32px))`,alignment:`end`,children:KU.map(n=>{let r=me[t],i=r.includes(n);return(0,q.jsx)(Ro,{label:n,value:i,isDisabled:ae||i&&r.length===1,endContent:(0,q.jsx)(`span`,{className:`configuration-check`,children:i&&(0,q.jsx)(rs,{"aria-hidden":`true`})}),onChange:i=>{fe(t,{thinkingLevelMap:Object.fromEntries(KU.map(a=>{let o=a===n?i:r.includes(a),s=h.models.find(t=>t.rowKey===e.rowKey)?.thinkingLevelMap?.[a];return[a,o?e.thinkingLevelMap?.[a]??s??pe[t]?.[a]??(a===`off`?`none`:a):null]}))})}},n)})}),e.thinkingLevelMap!=null&&(0,q.jsx)(`button`,{type:`button`,className:`models-link models-thinking-reset`,disabled:ae,onClick:()=>fe(t,{thinkingLevelMap:null}),children:m(`providerThinkingReset`)})]})]})]},e.rowKey))]}),(0,q.jsxs)(`button`,{type:`button`,className:`models-button models-add-model`,disabled:ae||_.models.length>=100,onClick:()=>{ue({models:[..._.models,{...he,rowKey:crypto.randomUUID()}]})},children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),m(`addModel`)]}),ce&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:m(`providerModelInvalid`,{number:se+1})})]});return(0,q.jsxs)(`form`,{className:`models-editor`,onSubmit:e=>{e.preventDefault(),_e()},children:[!i&&a&&(0,q.jsxs)(`div`,{className:`models-editor-heading`,children:[(0,q.jsx)(`span`,{children:_.name||_.provider}),_.name!==_.provider&&(0,q.jsx)(`small`,{children:_.provider})]}),i&&a&&(0,q.jsxs)(q.Fragment,{children:[ve(`provider`),_.provider&&oe&&(0,q.jsx)(`p`,{className:`models-error`,children:m(`providerIdInvalid`)}),ve(`name`),ve(`baseUrl`),ye]}),x&&S&&(0,q.jsxs)(`fieldset`,{className:`models-add-modes`,"aria-label":m(`accountLoginMethod`),children:[(0,q.jsx)(`button`,{type:`button`,"aria-pressed":C===`oauth`,disabled:ie,onClick:()=>w(`oauth`),children:m(`accountLoginTab`)}),(0,q.jsx)(`button`,{type:`button`,"aria-pressed":C===`api_key`,disabled:ie,onClick:()=>w(`api_key`),children:m(`accountLoginKeyTab`)})]}),x&&C===`oauth`&&r&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(iM,{sessionId:e,auth:r,busy:l||F||re,onSaving:E,onAuthenticated:()=>f(_.name||_.provider,_.provider),onReload:p}),re&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`accountLoginUnsaved`)})]}),S&&C===`api_key`?(0,q.jsxs)(`label`,{className:`models-field`,children:[m(`providerApiKey`),(0,q.jsx)(`input`,{type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:8192,value:y,placeholder:m(r?.configured?`providerKeyKeep`:`providerKeyOptional`),disabled:ie,onChange:e=>{b(e.target.value),ee!==`conflict`&&L(null)}})]}):x?null:(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerNativeAuth`)}),i&&a?be:(0,q.jsxs)(`details`,{className:`models-customized`,children:[(0,q.jsx)(`summary`,{children:m(`providerCustomSettings`)}),(0,q.jsxs)(`div`,{children:[a&&ve(`name`),ve(`baseUrl`),a&&ye,be]})]}),ee&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:m(ee===`conflict`?`modelConfigurationConflict`:ee===`key`?`providerProfileSavedKeyFailed`:ee===`current`?`providerCurrentRemoval`:`providerConfigurationFailed`)}),ee===`conflict`&&(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:p,children:m(`providerReload`)}),!T&&(0,q.jsxs)(`div`,{className:`models-editor-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:F,onClick:()=>R?p():f(),children:m(`cancel`)}),(C===`api_key`||ne)&&(0,q.jsx)(`button`,{type:`submit`,className:`models-button primary`,disabled:ie||!H||ee===`conflict`,"aria-busy":F,children:m(F?`savingSettings`:`providerSave`)})]}),D&&(0,q.jsx)(tW,{sessionId:e,template:he,existingIds:_.models.map(e=>e.id),apiKey:y,onClose:()=>O(!1),onAdd:e=>{ue({models:[..._.models,...e.map(e=>({...he,...e,rowKey:crypto.randomUUID()}))]}),O(!1)}})]})}function aW({sessionId:e,sessionPath:t,provider:n,purpose:r,initialModel:i,busy:a,onSelectModel:o,onDefaultSaved:s,onSaving:c,onClose:l}){let{t:u}=W(),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)([]),[h,g]=(0,K.useState)(i?`${i.provider}/${i.id}`:``),[_,v]=(0,K.useState)(!0),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(0),[C,w]=(0,K.useState)(0),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1),[k,A]=(0,K.useState)(null);(0,K.useEffect)(()=>{let t=new AbortController;v(!0),b(!1);let r=window.setTimeout(()=>{new de().searchModels(d.trim(),e,t.signal,n).then(e=>{t.signal.aborted||(m(e.models),S(e.truncation.matchesOmitted),v(!1))},()=>{t.signal.aborted||(b(!0),v(!1))})},d?200:0);return()=>{t.abort(),window.clearTimeout(r)}},[e,n,d,C]);let j=p.find(e=>`${e.provider}/${e.id}`===h)??p[0],M=new Map;for(let e of p){let t=M.get(e.provider);t?t.push(e):M.set(e.provider,[e])}let N=async()=>{if(!j||_||D||a||!t)return;O(!0),c(!0),A(null);let n=!1;try{if(r===`use`){if(!await o(`${j.provider}/${j.id}`))throw Error(`selection failed`);n=!0}(r==="default"||T)&&s(await new de().saveModelDefault(j.provider,j.id,e,t)),l()}catch{A(n?`modelDefaultPartial`:r==="default"?`modelDefaultSaveFailed`:`modelConnectionUseFailed`)}finally{O(!1),c(!1)}};return(0,q.jsxs)(`div`,{className:`models-connection-choice`,children:[(0,q.jsx)(`p`,{className:`models-hint`,children:u(r==="default"?`modelDefaultHint`:`modelConnectionNextHint`)}),(p.length>8||x>0||d)&&(0,q.jsx)(`input`,{type:`search`,"aria-label":u(`modelConnectionSearch`),placeholder:u(`modelConnectionSearch`),maxLength:200,value:d,disabled:D,onChange:e=>f(e.target.value)}),y?(0,q.jsxs)(`p`,{className:`models-error`,role:`alert`,children:[u(`modelConnectionLoadFailed`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:()=>w(e=>e+1),children:u(`retryAdmissionCheck`)})]}):_?(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`loadingModels`)}):p.length?(0,q.jsx)(nM,{label:u(`selectModel`),className:`models-provider-picker`,placement:`below`,value:j?`${j.provider}/${j.id}`:``,isDisabled:D,options:[...M].map(([e,t])=>({type:`section`,title:e,options:t.map(e=>({value:`${e.provider}/${e.id}`,label:e.name||e.id,description:`${e.provider} · ${e.id}`,icon:(0,q.jsx)(Yk,{id:e.provider})}))})),onChange:e=>g(e)}):(0,q.jsx)(`p`,{className:`models-hint`,children:u(d?`modelConnectionNoMatch`:`modelConnectionNoModels`)}),x>0&&!_&&(0,q.jsx)(`p`,{className:`models-hint`,children:u(`modelConnectionMore`,{count:x})}),r===`use`&&(0,q.jsxs)(`label`,{className:`models-checkbox`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:T,disabled:D,onChange:e=>E(e.target.checked)}),u(`modelMakeDefault`)]}),k&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:u(k)}),(0,q.jsxs)(`div`,{className:`models-editor-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:D,onClick:l,children:u(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button primary`,disabled:D||a||_||y||!j||!t,onClick:()=>void N(),children:u(D?`providerSaving`:r==="default"?`modelDefaultSave`:`modelConnectionUse`)})]})]})}function oW({sessionId:e,sessionPath:t,models:n,currentModel:r,busy:i,focusCredentials:a,onSaved:o,onSelectModel:s,onDraftChange:c,onSavingChange:l}){let{t:u}=W(),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(0),[h,g]=(0,K.useState)(!0),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(null),[x,S]=(0,K.useState)([]),[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(`account`),[D,O]=(0,K.useState)(``),[k,A]=(0,K.useState)(``),[j,M]=(0,K.useState)({}),[N,P]=(0,K.useState)(!1),[F,I]=(0,K.useState)({}),[ee,L]=(0,K.useState)(!1),R=N||ee||Object.values(F).some(Boolean),[te,z]=(0,K.useState)(null),[B,ne]=(0,K.useState)(!1),[re,V]=(0,K.useState)(null),[ie,ae]=(0,K.useState)(null),[oe,se]=(0,K.useState)(null),[ce,le]=(0,K.useState)(null),H=(0,K.useRef)(null),ue=(0,K.useRef)(a),fe=(0,K.useRef)(null),pe=(0,K.useRef)(new Map),me=(0,K.useRef)(null),he=(0,K.useRef)(null),_e=(0,K.useRef)({onDraftChange:c,onSavingChange:l});_e.current={onDraftChange:c,onSavingChange:l},(0,K.useEffect)(()=>{c(Object.values(j).some(Boolean))},[j,c]),(0,K.useEffect)(()=>{l(R)},[R,l]),(0,K.useEffect)(()=>{!re&&!R&&he.current&&(he.current.focus({preventScroll:!0}),he.current=null)},[re,R]),(0,K.useEffect)(()=>{if(!fe.current)return;let e=fe.current;fe.current=null,(pe.current.get(e)??me.current)?.focus({preventScroll:!0})}),(0,K.useEffect)(()=>()=>{H.current?.abort(),_e.current.onDraftChange(!1),_e.current.onSavingChange(!1)},[]),(0,K.useEffect)(()=>{let t=new AbortController;g(!0),v(!1);let n=new de;return Promise.all([n.modelConfigurations(e,t.signal),n.providerAuth(e,t.signal)]).then(([e,n])=>{if(!t.signal.aborted&&(f({configuration:e,auth:n}),g(!1),ue.current)){ue.current=!1;let e=r?.provider||n.providers.find(e=>e.configured)?.id;e&&(b(e),S([e]))}},()=>{t.signal.aborted||(v(!0),g(!1))}),()=>t.abort()},[e,p,r?.provider]),(0,K.useEffect)(()=>{let t=new AbortController;return ne(!1),new de().modelDefaults(e,t.signal).then(e=>{t.signal.aborted||z(e)},()=>{t.signal.aborted||ne(!0)}),()=>t.abort()},[e,p]);let ve=d?.configuration,ye=new Set([...ve?.providers?.map(e=>e.provider)??[],...ve?.models.map(e=>e.provider)??[]]),be=new Set([...ye,...d?.auth.providers.filter(e=>e.configured).map(e=>e.id)??[],...n.map(e=>e.provider),...x.filter(e=>!e.startsWith(`add:`))]),xe=[...be].map(e=>{let t=d?.auth.providers.find(t=>t.id===e);return{id:e,name:ve?.providers?.find(t=>t.provider===e)?.name||t?.name||e,auth:t}}),Se=d?.auth.providers.filter(e=>e.authMethods.includes(`api_key`)&&!be.has(e.id))??[],Ce=d?.auth.providers.filter(e=>e.authMethods.includes(`oauth`)&&!e.subscription)??[],we=Ce.find(e=>e.id===D)??Ce[0],Te=Se.find(e=>e.id===k)??Se[0],Ee=[{id:`account`,label:`accountLoginTab`,hint:`providerAccountHint`,available:Ce.length>0},{id:`catalog`,label:`providerAddCatalog`,hint:`providerCatalogHint`,available:Se.length>0},{id:`custom`,label:`providerAddCustom`,hint:`providerCustomHint`,available:!0}],U=e=>{E(e);let t=e===`custom`?`add:custom`:e===`account`?we&&`add:account:${we.id}`:Te&&`add:${Te.id}`;t&&S(e=>e.includes(t)?e:[...e,t])},De=e=>{he.current=null,V(null),ae(null),w(!1),b(y===e?null:e),S(t=>t.includes(e)?t:[...t,e])},Oe=(e,t,n)=>{he.current=null,fe.current=e;let r=t=>e.startsWith(`add:`)?t.startsWith(`add:`):t===e;S(e=>e.filter(e=>!r(e))),M(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!r(e)))),e.startsWith(`add:`)?w(!1):b(null),t&&(ae(t),V({purpose:`use`,provider:n??e}),m(e=>e+1),o().catch(()=>!1))},ke=(t,a,s,c)=>{if(!ve)return null;let l=d?.auth.providers.find(e=>e.id===a),f=e=>I(n=>n[t]===e?n:{...n,[t]:e}),p=()=>{Oe(t),m(e=>e+1),o().catch(()=>!1)};return t.startsWith(`add:account:`)?l&&(0,q.jsxs)(`div`,{className:`models-editor`,children:[(0,q.jsx)(iM,{sessionId:e,auth:l,busy:i,onSaving:f,onAuthenticated:()=>Oe(t,l.name||l.id,l.id),onReload:p}),!F[t]&&(0,q.jsx)(`div`,{className:`models-editor-actions`,children:(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:()=>Oe(t),children:u(`cancel`)})})]}):(0,q.jsx)(iW,{sessionId:e,providerId:a,configuration:ve,auth:l,isNew:s,custom:c,taken:[...d?.auth.providers.map(e=>e.id)??[],...ye],currentModel:r,availableModels:n.filter(e=>e.provider===a),busy:i,onDirty:e=>M(n=>n[t]===e?n:{...n,[t]:e}),onSaving:f,onClose:(e,n)=>Oe(t,e,n),onReload:p},t)},G=e=>xe.find(t=>t.id===e)?.name??e,je=e=>n.find(t=>t.provider===e.provider&&t.id===e.id)?.name||e.id,Me=(e,t,n)=>{he.current=t,V({purpose:e,provider:n}),b(null),w(!1)},Ne=(n,a)=>(0,q.jsx)(aW,{sessionId:e,sessionPath:t,provider:a,purpose:n,initialModel:n==="default"?te?.model:r,busy:i,onSelectModel:s,onDefaultSaved:e=>{z(e),ne(!1),o().catch(()=>!1)},onSaving:L,onClose:()=>{V(null)}},`${n}:${a??`all`}`);return(0,q.jsxs)(`div`,{className:`settings-content-page models-page`,children:[(0,q.jsxs)(`div`,{className:`models-section`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:u(`modelSettings`)}),(0,q.jsx)(`p`,{children:u(`modelsIntro`)})]})}),ie&&(0,q.jsxs)(`p`,{className:`models-saved`,role:`status`,children:[u(`providerSaved`,{provider:ie}),r&&(0,q.jsxs)(`span`,{children:[` `,u(`providerCurrentSessionModel`,{model:`${r.provider} / ${r.id}`})]})]}),_&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[u(`providerLoadFailed`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:h,onClick:()=>m(e=>e+1),children:u(`retryAdmissionCheck`)})]}),ce&&!oe&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[ce,` `,(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:h,onClick:()=>{le(null),m(e=>e+1)},children:u(`refreshStatus`)})]}),!d&&h&&(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`providerLoading`)}),(0,q.jsxs)(`div`,{className:`models-default-card`,children:[(0,q.jsxs)(`div`,{className:`models-default-row`,children:[(0,q.jsxs)(`div`,{className:`models-default-copy`,children:[(0,q.jsx)(`span`,{className:`models-default-title`,children:u(`modelDefaultTitle`)}),B?(0,q.jsx)(`span`,{className:`models-hint`,children:u(`modelDefaultReadFailed`)}):te?.model?(0,q.jsxs)(`span`,{className:`models-default-value`,children:[(0,q.jsx)(`span`,{className:`models-default-avatar`,"aria-hidden":`true`,children:(0,q.jsx)(Yk,{id:te.model.provider,modelId:te.model.id})}),(0,q.jsxs)(`span`,{children:[je(te.model),(0,q.jsx)(`small`,{children:G(te.model.provider)})]})]}):(0,q.jsx)(`span`,{className:`models-hint`,children:u(te?`modelDefaultNotSet`:`loadingModels`)})]}),(0,q.jsxs)(`button`,{type:`button`,className:`models-button primary models-default-choose`,disabled:R||i||Object.values(j).some(Boolean)||!t,"aria-expanded":re?.purpose==="default",onClick:e=>B?m(e=>e+1):re?.purpose==="default"?V(null):Me(`default`,e.currentTarget),children:[(0,q.jsx)(`span`,{children:u(B?`refreshStatus`:`modelDefaultChoose`)}),!B&&(0,q.jsx)(os,{"aria-hidden":`true`})]})]}),te?.projectOverride&&(0,q.jsx)(`p`,{className:`models-hint`,children:u(`modelDefaultProjectOverride`,{model:`${G(te.projectOverride.provider)} / ${je(te.projectOverride)}`})}),re?.purpose==="default"&&Ne(`default`)]}),(0,q.jsxs)(`div`,{className:`models-connections-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:u(`modelConnectionsTitle`)}),(0,q.jsx)(`p`,{children:u(`modelConnectionsIntro`)})]}),(0,q.jsx)(`span`,{"aria-hidden":`true`,children:xe.length})]}),(0,q.jsx)(`ul`,{className:`models-provider-list`,children:xe.map(e=>{let n=!C&&y===e.id,a=e.auth?.custom??ye.has(e.id);return(0,q.jsxs)(`li`,{className:`models-provider-card`,children:[(0,q.jsxs)(`div`,{className:`models-provider-head`,children:[(0,q.jsxs)(`div`,{className:`models-provider-identity`,children:[(0,q.jsx)(`span`,{className:`models-provider-avatar`,"aria-hidden":`true`,children:(0,q.jsx)(Yk,{id:e.id})}),(0,q.jsxs)(`div`,{className:`models-provider-label`,children:[(0,q.jsx)(`span`,{className:`models-provider-name`,children:e.name}),a&&(0,q.jsx)(`span`,{className:`models-provider-tag`,children:u(`providerCustomTag`)}),te?.model?.provider===e.id&&(0,q.jsx)(`span`,{className:`models-provider-tag is-default`,children:u(`modelDefaultBadge`)}),r?.provider===e.id&&(0,q.jsx)(`span`,{className:`models-provider-tag is-current`,children:u(`modelCurrentBadge`)}),e.auth&&(0,q.jsxs)(`span`,{className:`models-provider-status`,children:[(0,q.jsx)(`span`,{className:`models-credential-dot ${e.auth.configured?`configured`:`missing`}`,role:`img`,"aria-label":u(e.auth.configured?`credentialConfigured`:`credentialMissing`),title:u(e.auth.configured?`credentialConfigured`:`credentialMissing`)}),u(e.auth.subscription?`accountLoginConfigured`:e.auth.configured?`credentialConfigured`:`credentialMissing`)]})]})]}),(0,q.jsxs)(`div`,{className:`models-provider-actions`,children:[e.auth?.configured&&(0,q.jsx)(`button`,{type:`button`,className:`models-button models-select-connection`,disabled:R||i||Object.values(j).some(Boolean)||!t,"aria-label":u(`modelConnectionChooseProvider`,{provider:e.name}),"aria-expanded":re?.purpose===`use`&&re.provider===e.id,onClick:t=>re?.purpose===`use`&&re.provider===e.id?V(null):Me(`use`,t.currentTarget,e.id),children:u(`selectModel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,"aria-label":u(`editProvider`,{provider:e.name}),ref:t=>{t?pe.current.set(e.id,t):pe.current.delete(e.id)},"aria-expanded":n,disabled:R,onClick:()=>De(e.id),children:u(e.auth?.authMethods.includes(`oauth`)&&!e.auth.configured?`accountLoginStart`:`providerEdit`)}),ye.has(e.id)&&(0,q.jsx)(`button`,{type:`button`,className:`models-button danger`,"aria-label":u(`removeProvider`,{provider:e.name}),disabled:R||i||r?.provider===e.id,title:r?.provider===e.id?u(`providerCurrentRemoval`):void 0,onClick:()=>{se(e.id),le(null)},children:u(`providerRemove`)})]})]}),re?.purpose===`use`&&re.provider===e.id&&Ne(`use`,e.id),x.includes(e.id)&&(0,q.jsx)(`div`,{hidden:!n,children:ke(e.id,e.id,!1,a)})]},e.id)})}),ve&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{hidden:!C,className:`models-add-card`,children:[(0,q.jsx)(`fieldset`,{className:`models-add-modes`,"aria-label":u(`providerAddMode`),onKeyDown:e=>{if(R||![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=Ee.filter(e=>e.available),n=t.findIndex(e=>e.id===T),r=t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length].id;U(r),e.currentTarget.querySelectorAll(`button`)[Ee.findIndex(e=>e.id===r)]?.focus()},children:Ee.map(e=>(0,q.jsx)(`button`,{type:`button`,"aria-pressed":T===e.id,disabled:R||!e.available,onClick:()=>U(e.id),children:u(e.label)},e.id))}),(0,q.jsx)(`p`,{className:`models-hint`,children:u(Ee.find(e=>e.id===T)?.hint??`providerCustomHint`)}),(0,q.jsxs)(`div`,{hidden:T!==`account`,children:[we&&(0,q.jsx)(`div`,{className:`models-provider-select`,children:(0,q.jsx)(nM,{label:u(`provider`),className:`models-provider-picker`,options:Ce.map(e=>({value:e.id,label:e.name||e.id,icon:(0,q.jsx)(Yk,{id:e.id})})),value:we.id,isDisabled:R,placement:`below`,onChange:e=>{O(e);let t=`add:account:${e}`;S(e=>e.includes(t)?e:[...e,t])}})}),x.filter(e=>e.startsWith(`add:account:`)).map(e=>(0,q.jsx)(`div`,{hidden:e!==`add:account:${we?.id}`,children:ke(e,e.slice(12),!0,!1)},e))]}),(0,q.jsxs)(`div`,{hidden:T!==`catalog`,children:[Te&&(0,q.jsx)(`div`,{className:`models-provider-select`,children:(0,q.jsx)(nM,{label:u(`provider`),className:`models-provider-picker`,options:Se.map(e=>({value:e.id,label:e.name||e.id,icon:(0,q.jsx)(Yk,{id:e.id})})),value:Te.id,isDisabled:R,placement:`below`,onChange:e=>{A(e);let t=`add:${e}`;S(e=>e.includes(t)?e:[...e,t])}})}),x.filter(e=>e.startsWith(`add:`)&&e!==`add:custom`&&!e.startsWith(`add:account:`)).map(e=>(0,q.jsx)(`div`,{hidden:e!==`add:${Te?.id}`,children:ke(e,e.slice(4),!0,!1)},e))]}),x.includes(`add:custom`)&&(0,q.jsx)(`div`,{hidden:T!==`custom`,children:ke(`add:custom`,``,!0,!0)})]}),!C&&(0,q.jsxs)(`button`,{type:`button`,className:`models-add-button`,ref:me,disabled:R,onClick:()=>{he.current=null,V(null),w(!0),b(null),ae(null),U(Ee.find(e=>e.id===T)?.available?T:Ee.find(e=>e.available).id)},children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),u(`providerAdd`)]})]}),i&&(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`modelSelectionBusy`)})]}),oe&&(0,q.jsx)(uj,{isOpen:!0,title:u(`removeProvider`,{provider:xe.find(e=>e.id===oe)?.name||oe}),description:ce||u(`providerRemoveDetail`),isActionLoading:R,cancelLabel:u(`cancel`),actionLabel:u(R?`savingSettings`:`providerRemove`),onOpenChange:e=>{!e&&!R&&se(null)},onAction:()=>{if(R||i||!ve)return;let t=new AbortController;H.current=t,P(!0),le(null),new de().changeProviderConfiguration(e,ve.revision,{action:`remove`,provider:oe},t.signal).then(()=>{t.signal.aborted||(Oe(oe),se(null),m(e=>e+1),o().catch(()=>!1))},e=>{t.signal.aborted||le(u(e instanceof ge&&e.code===`MODEL_CONFIGURATION_CONFLICT`?`modelConfigurationConflict`:`providerConfigurationFailed`))}).finally(()=>{t.signal.aborted||P(!1)})}})]})}function sW(){let e={version:`1.1.0`,id:`f3ee7c6867d04f8c4196c6eac9e8b2bb2ab35767fca8d07d66124511dbd50d7d`,mode:`production`},{t}=W(),[n,r]=(0,K.useState)(null),[i,a]=(0,K.useState)(`loading`),[o,s]=(0,K.useState)(0);(0,K.useEffect)(()=>{let e=new AbortController,t=new de;return a(`loading`),r(null),t.request(`/api/diagnostics`,{signal:e.signal}).then(t=>{e.signal.aborted||(r(t.openpi??null),a(`ready`))},()=>{e.signal.aborted||a(`error`)}),()=>e.abort()},[o]);let c=t(`notReported`),l=e?.id&&n?.frontendAtStartup?.id&&e.id!==n.frontendAtStartup.id;return(0,q.jsxs)(`section`,{className:`settings-section-block`,"aria-label":t(`runtimeIdentity`),children:[(0,q.jsx)(`h2`,{children:t(`runtimeIdentity`)}),(0,q.jsx)(`p`,{children:t(`runtimeIdentityHint`)}),i===`loading`&&(0,q.jsx)(`p`,{role:`status`,children:t(`settingsCatalogLoading`)}),i===`error`&&(0,q.jsx)(`p`,{role:`alert`,children:t(`runtimeIdentityFailed`)}),(0,q.jsxs)(`dl`,{className:`settings-summary-list runtime-identity-list`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeBackendVersion`)}),(0,q.jsx)(`dd`,{children:n?.version??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimePackageRoot`)}),(0,q.jsx)(`dd`,{children:n?.packageRoot??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeStartedAt`)}),(0,q.jsx)(`dd`,{children:n?new Date(n.startedAt).toLocaleString():c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeGitRevision`)}),(0,q.jsx)(`dd`,{children:n?.git?.revision??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeGitState`)}),(0,q.jsx)(`dd`,{children:n?.git?.dirty==null?c:t(n.git.dirty?`runtimeGitDirty`:`runtimeGitClean`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeFrontendVersion`)}),(0,q.jsx)(`dd`,{children:e?.version??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeFrontendBuild`)}),(0,q.jsx)(`dd`,{children:e?.mode===`development`?t(`runtimeDevelopmentBuild`):e?.id??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeStartupBuild`)}),(0,q.jsx)(`dd`,{children:n?.frontendAtStartup?.id??c})]})]}),l&&(0,q.jsx)(`p`,{role:`status`,children:t(`runtimeBuildMismatch`)}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>s(e=>e+1),disabled:i===`loading`,children:t(`refreshStatus`)})]})}var cW=20,lW={track:{kVAEAm:`x10l6tqk`,kWkggS:`xdsb6cv`,kaIpWk:`xjspbzw`,$$css:!0},trackHorizontal:{kLqNvP:`x1o0tod`,kt4wiu:`xtijo5x`,kZKoxP:`xqu0tyb`,k87sOh:`xwa60dl`,k3aq6I:`x1cb1t30`,$$css:!0},trackVertical:{k87sOh:`x13vifvy`,krVfgx:`x1ey2m1c`,kzqmXN:`x51ohtg`,$$css:!0},filledTrack:{kVAEAm:`x10l6tqk`,kWkggS:`x1ewilqj`,kaIpWk:`xjspbzw`,$$css:!0},filledTrackHorizontal:{kZKoxP:`xqu0tyb`,k87sOh:`xwa60dl`,k3aq6I:`x1cb1t30`,$$css:!0},filledTrackVertical:{kzqmXN:`x51ohtg`,$$css:!0},thumb:{kVAEAm:`x10l6tqk`,kzqmXN:`xw4jnvo`,kZKoxP:`x1qx5ct2`,kaIpWk:`xjspbzw`,kWkggS:`x1ewilqj`,k3aq6I:`x11lhmoz`,k1ekBW:`x106061f`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,kI3sdo:`x1a2a7pz`,kkrTdU:`x1jm3nie x16khyan`,kY2c9j:`x1vjfegm`,$$css:!0},thumbHorizontal:{k87sOh:`xwa60dl`,k3aq6I:`x11lhmoz xoffwj3`,$$css:!0},thumbHover:{kWkggS:`x1ewilqj xvxo0qp`,$$css:!0},thumbDisabled:{kWkggS:`xwmxj5m`,kkrTdU:`xt0e3qv`,$$css:!0}};function uW(e,t,n){return Math.min(Math.max(e,t),n)}function dW(e){if(Math.abs(e)<1){let t=e.toExponential().split(`e-`);if(t.length===2)return(t[0].split(`.`)[1]?.length??0)+parseInt(t[1],10)}let t=String(e).split(`.`)[1];return t?t.length:0}function fW(e,t,n){if(n<=0)return e;let r=t+Math.round((e-t)/n)*n,i=Math.min(Math.max(dW(t),dW(n)),20);return Number(r.toFixed(i))}function pW(e,t,n){return n===t?0:(e-t)/(n-t)*100}var mW=cW/2;function hW(e){return vW(e,mW-e/100*cW)}function gW(e,t){let n=t-e;return vW(n,-(n/100)*cW)}function _W(e,t){let n=t-cW;return n>0?(e-mW)/n:t>0?e/t:0}function vW(e,t){let n=e=>Number(e.toFixed(3));return`calc(${n(e)}% ${t<0?`-`:`+`} ${Math.abs(n(t))}px)`}function yW({ref:e,...t}){let{label:n,isLabelHidden:r=!1,description:i,isDisabled:a=!1,disabledMessage:o,isOptional:s=!1,isRequired:c=!1,status:l,labelTooltip:u,min:d=0,max:f=100,step:p=1,orientation:m=`horizontal`,formatValue:h,htmlName:g,valueDisplay:_=`tooltip`,marks:v,width:y,xstyle:b,className:x,style:S,"data-testid":C,value:T,onChange:E,onChangeEnd:k}=t,A=Array.isArray(T),j=A&&`minStepsBetweenThumbs`in t?t.minStepsBetweenThumbs??0:0,M=m===`horizontal`,P=(0,K.useId)(),I=(0,K.useId)(),ee=(0,K.useId)(),L=(0,K.useId)(),R=(0,K.useId)(),te=(0,K.useRef)(null),z=(0,K.useRef)(null),[B,ne]=(0,K.useState)(null),[re,ie]=(0,K.useState)(null);(0,K.useEffect)(()=>{D()},[]);let ae=(0,K.useCallback)((e,t)=>{ie(!a&&N()===`keyboard`?e:null)},[a]),oe=(0,K.useCallback)(e=>{ie(null)},[]),se=a&&!!o,ce=F({placement:`above`,focusTrigger:`always`,isEnabled:se}),le=c&&!s,ue=[];i&&ue.push(ee),l?.message&&ue.push(L),le&&ue.push(R),se&&ue.push(ce.describedBy);let de=ue.length>0?ue.join(` `):void 0,pe=(0,K.useMemo)(()=>(Array.isArray(T)?T:[T??d]).map(e=>uW(e,d,f)),[T,d,f]),me=(0,K.useRef)(pe);me.current=pe;let he=(0,K.useCallback)((e,t)=>{let n=te.current;if(!n)return d;let r=n.getBoundingClientRect(),i;return i=M?_W(Ya(n)?r.right-e:e-r.left,r.width):1-_W(t-r.top,r.height),i=uW(i,0,1),uW(fW(d+i*(f-d),d,p),d,f)},[d,f,p,M]),ge=(0,K.useCallback)(e=>{if(!A)return 0;let[t,n]=pe;return Math.abs(e-t)<=Math.abs(e-n)?0:1},[A,pe]),_e=(0,K.useCallback)((e,t)=>{if(a)return;let n=uW(fW(t,d,p),d,f);if(A){let t=[...pe];t[e]=n;let r=j*p;e===0?t[0]=Math.min(t[0],t[1]-r):t[1]=Math.max(t[1],t[0]+r),t[0]=uW(t[0],d,f),t[1]=uW(t[1],d,f),E?.(t)}else E?.(n)},[a,A,pe,d,f,p,j,E]),ve=(0,K.useRef)(k);ve.current=k;let ye=(0,K.useCallback)(e=>{let t=e??me.current,n=ve.current;A?n?.(t):n?.(t[0])},[A]),be=(0,K.useCallback)(e=>{if(a)return;e.preventDefault();let t=e.target.closest(`[data-mark-value]`),n=t?Number(t.dataset.markValue):he(e.clientX,e.clientY),r=ge(n);z.current=r,ne(r),_e(r,n);let i=te.current;i&&i.querySelectorAll(`[role="slider"]`)[r]?.focus(),ie(null),typeof e.currentTarget.setPointerCapture==`function`&&e.currentTarget.setPointerCapture(e.pointerId)},[a,he,ge,_e]),xe=(0,K.useCallback)(e=>{if(z.current===null||a)return;let t=he(e.clientX,e.clientY);_e(z.current,t)},[a,he,_e]),Se=(0,K.useCallback)(e=>{z.current!==null&&(z.current=null,ne(null),ye())},[ye]),Ce=(0,K.useCallback)((e,t)=>{if(a)return;N()===`keyboard`&&ie(e);let n=pe[e],r;switch(t.key){case`ArrowRight`:case`ArrowUp`:r=n+p;break;case`ArrowLeft`:case`ArrowDown`:r=n-p;break;case`PageUp`:r=n+p*10;break;case`PageDown`:r=n-p*10;break;case`Home`:r=d;break;case`End`:r=f;break;default:return}t.preventDefault();let i=uW(fW(r,d,p),d,f);if(_e(e,r),A){let t=[...pe];t[e]=i;let n=j*p;e===0?t[0]=Math.min(t[0],t[1]-n):t[1]=Math.max(t[1],t[0]+n),t[0]=uW(t[0],d,f),t[1]=uW(t[1],d,f),ye(t)}else ye([i])},[a,A,pe,p,d,f,j,_e,ye]),Te=e=>h?h(e):String(e),Ee=e=>{let t=pe[e],n=pW(t,d,f),r=M?{insetInlineStart:hW(n)}:{bottom:hW(n),left:`50%`},i=A?e===0?`Minimum value`:`Maximum value`:void 0,o=j*p,s=A&&e===1?uW(pe[0]+o,d,f):d,c=A&&e===0?uW(pe[1]-o,d,f):f,u=_===`tooltip`&&!se,g=M?`above`:`start`,v=(0,q.jsx)(`div`,{id:A?void 0:P,role:`slider`,tabIndex:a&&!se?-1:0,"aria-valuemin":s,"aria-valuemax":c,"aria-valuenow":t,"aria-valuetext":h?h(t):void 0,"aria-orientation":m,"aria-disabled":a||void 0,"aria-invalid":l?.type===`error`||void 0,"aria-label":i,"aria-labelledby":A?void 0:I,"aria-describedby":de,onKeyDown:t=>Ce(e,t),onFocus:t=>ae(e,t),onBlur:oe,...H(O(`slider-thumb`,{orientation:m,disabled:a?`disabled`:null}),w(lW.thumb,M?lW.thumbHorizontal:Et.centerInline(`50%`),!a&&lW.thumbHover,!a&&re===e&&fe.focusVisible,a&&lW.thumbDisabled),void 0,r)},e);return u?(0,q.jsx)(V,{content:Te(t),placement:g,delay:0,focusTrigger:`always`,isOpen:B===e||void 0,children:v},e):v},U=(()=>{if(A){let[e,t]=pe,n=pW(e,d,f),r=pW(t,d,f);return M?{insetInlineStart:hW(n),width:gW(n,r)}:{bottom:hW(n),height:gW(n,r)}}let e=pW(pe[0],d,f);return M?{insetInlineStart:`0%`,width:hW(e)}:{bottom:`0%`,height:hW(e)}})(),De=_===`text`?(0,q.jsx)(`span`,{className:`x9ynric xcr08ib x1tgivj0 xuxw1ft x2lah0s`,children:A?`${Te(pe[0])} – ${Te(pe[1])}`:Te(pe[0])}):null;return(0,q.jsxs)(zO,{"data-testid":C,label:n,isLabelHidden:r,description:i,inputID:P,labelID:I,isGroupLabel:!0,descriptionID:i?ee:void 0,isOptional:s,isRequired:c,isDisabled:a,status:l?{type:l.type,message:l.message,messageID:l.message?L:void 0}:void 0,labelTooltip:u,statusVariant:`detached`,width:y,xstyle:b,className:x,style:S,children:[(0,q.jsxs)(`div`,{...H(O(`slider`,{orientation:m,disabled:a?`disabled`:null}),{className:`x78zum5 x6s0dn4 x1txdalj`}),children:[g!=null&&pe.map((e,t)=>(0,q.jsx)(`input`,{type:`hidden`,name:g,value:String(e),disabled:a},t===0?`start`:`end`)),(0,q.jsxs)(`div`,{ref:we(e,te,ce.ref),...A?{role:`group`,"aria-labelledby":I}:void 0,onPointerDown:be,onPointerMove:xe,onPointerUp:Se,onPointerCancel:Se,...{0:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k x1ypdohk x16khyan`},2:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 x1ypdohk x16khyan`},1:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k xbyyjgo xt0e3qv`},3:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 xbyyjgo xt0e3qv`}}[!!M<<1|!!a<<0],children:[(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(O(`slider-track`,{orientation:m}),w(lW.track,M?lW.trackHorizontal:[lW.trackVertical,Et.centerInline(`0px`)]))}),(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(w(lW.filledTrack,M?lW.filledTrackHorizontal:[lW.filledTrackVertical,Et.centerInline(`0px`)]),{style:U})}),v&&(0,q.jsx)(`div`,{"aria-hidden":`true`,...{0:{className:`x10l6tqk x13vifvy x1ey2m1c xbudbmw`},1:{className:`x10l6tqk x1o0tod xtijo5x xwa60dl`}}[!!M<<0],children:v.map(e=>{let t=pW(e.value,d,f),n=M?{insetInlineStart:hW(t)}:{bottom:hW(t)};return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{"data-testid":`slider-mark`,"data-mark-value":e.value,...H({0:{className:`x10l6tqk x7njt3n xjspbzw x36qwtl x1xc55vz x1m9mm8y`},1:{className:`x10l6tqk x7njt3n xjspbzw xfo62xy xdk7pt x11lhmoz xoffwj3`}}[!!M<<0],{style:n})}),e.label&&(0,q.jsx)(`span`,{"data-testid":`slider-mark-label`,"data-mark-value":e.value,...H({0:{className:`x10l6tqk x9ynric x141an7d xv1l7n4 xuxw1ft x131p8rn x9p6ekw`},1:{className:`x10l6tqk x9ynric x141an7d xv1l7n4 xuxw1ft xuuh30 x1nyx83j xuivejd`}}[!!M<<0],{style:n}),children:e.label})]},e.value)})}),pe.map((e,t)=>Ee(t))]}),De]}),le&&(0,q.jsx)(Kt,{id:R,children:`Required`}),se&&ce.renderTooltip(o)]})}yW.displayName=`Slider`;var bW=[`explorer`,`implementer`,`reviewer`,`advisor`];function xW({catalog:e,error:t,onRefresh:n}){let{t:r}=W();return!t&&!e?(0,q.jsxs)(`div`,{className:`settings-load-state`,role:`status`,children:[(0,q.jsx)(me,{className:`settings-spin`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:r(`settingsCatalogLoading`)})]}):t?(0,q.jsxs)(`div`,{className:`settings-load-state error`,role:`alert`,children:[(0,q.jsx)(`strong`,{children:r(`settingsCatalogFailed`)}),(0,q.jsx)(`span`,{children:t}),(0,q.jsx)(`button`,{type:`button`,onClick:n,children:r(`retryAdmissionCheck`)})]}):null}function SW({icon:e,title:t,description:n,value:r,disabled:i,loading:a,onChange:o}){return(0,q.jsxs)(`div`,{className:`settings-inline-control settings-toggle-row`,children:[(0,q.jsx)(e,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-inline-copy`,children:[(0,q.jsx)(`strong`,{children:t}),n&&(0,q.jsx)(`small`,{children:n})]}),(0,q.jsx)(bj,{label:t,isLabelHidden:!0,value:r,size:`sm`,isDisabled:i,isLoading:a,onChange:o})]})}function CW({isPending:e,isBlocked:t=!1,onConfigure:n,request:r,label:i}){return(0,q.jsx)(Br,{label:i,variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Xc,{"aria-hidden":`true`}),isDisabled:e||t,isLoading:e,onClick:()=>void n(r)})}function wW({pending:e,onConfigure:t,placeholder:n}){let{t:r}=W(),[i,a]=(0,K.useState)(``);return(0,q.jsxs)(`form`,{className:`settings-edit-form`,onSubmit:n=>{n.preventDefault(),!e&&i.trim()&&t(i.trim())},children:[(0,q.jsxs)(`label`,{className:`settings-form-field`,children:[r(`setupConfigurationRequest`),(0,q.jsx)(`textarea`,{required:!0,maxLength:2e3,value:i,disabled:e,placeholder:n,onChange:e=>a(e.target.value)})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:e||!i.trim(),children:r(`configureViaSetup`)}),(0,q.jsx)(`small`,{children:r(`setupFormDetail`)})]})}function TW({catalog:e,error:t,currentModel:n,thinkingLevel:r,cwd:i,setupPending:a,setupBlocked:o=!1,preferencePending:s,setupBusy:c,setupBlockedReason:l,onConfigure:u,onUpdatePreferences:d,onOpenRuntimeStatus:f,onRefresh:p}){let{t:m}=W(),h=e?.setup,g=h?.workflows.concurrency??0,_=h?.workflows.maxAgentCalls??0,[v,y]=(0,K.useState)(g),[b,x]=(0,K.useState)(_);return(0,K.useEffect)(()=>y(g),[g]),(0,K.useEffect)(()=>x(_),[_]),(0,q.jsxs)(`section`,{className:`settings-content-page settings-general-panel`,children:[(0,q.jsxs)(`div`,{className:`settings-page-heading`,children:[(0,q.jsx)(`div`,{children:(0,q.jsx)(`h1`,{children:m(`generalSettings`)})}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:u,request:m(`setupRequestReviewAll`),label:m(`configureOpenPi`)})]}),c&&(0,q.jsx)(`p`,{className:`settings-pending-hint`,role:`status`,children:l||m(`settingsSetupBusyHint`)}),(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:p}),h&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`section`,{className:`settings-section-block`,children:(0,q.jsxs)(`div`,{className:`settings-follow-up-control`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:m(`followUpBehavior`)}),(0,q.jsx)(`p`,{children:m(`followUpBehaviorDetail`)})]}),(0,q.jsxs)(`fieldset`,{className:`settings-follow-up-choices`,disabled:s,children:[(0,q.jsx)(`legend`,{className:`sr-only`,children:m(`followUpBehavior`)}),[`followUp`,`steer`].map(e=>(0,q.jsxs)(`label`,{children:[(0,q.jsx)(`input`,{type:`radio`,name:`follow-up-behavior`,value:e,"aria-label":m(e===`steer`?`followUpSteer`:`followUpQueue`),checked:(h.ui.webFollowUpBehavior??`followUp`)===e,onChange:()=>void d({followUpBehavior:e})}),(0,q.jsxs)(`span`,{className:`settings-follow-up-option`,children:[e===`steer`?(0,q.jsx)(Cs,{"aria-hidden":`true`}):(0,q.jsx)(tc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-follow-up-option-copy`,children:[(0,q.jsx)(`strong`,{children:m(e===`steer`?`followUpSteer`:`followUpQueue`)}),(0,q.jsx)(`small`,{children:m(e===`steer`?`followUpSteerDetail`:`followUpQueueDetail`)})]})]})]},e))]})]})}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`agentBehavior`)}),(0,q.jsxs)(`div`,{className:`settings-chat-controls`,children:[(0,q.jsxs)(`form`,{className:`settings-limits-control`,onSubmit:e=>{e.preventDefault(),!a&&!o&&u(m(`setupRequestLimits`,{concurrency:v,calls:b}))},children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(Us,{"aria-hidden":`true`}),m(`workflowLimits`)]}),(0,q.jsx)(`small`,{children:m(`workflowLimitsValue`,{concurrency:h.workflows.concurrency,calls:h.workflows.maxAgentCalls})}),(0,q.jsxs)(`label`,{children:[m(`workflowConcurrency`),(0,q.jsx)(`input`,{type:`number`,min:1,value:v,disabled:a||o,onChange:e=>y(Number(e.target.value)),required:!0})]}),(0,q.jsxs)(`label`,{children:[m(`workflowCalls`),(0,q.jsx)(`input`,{type:`number`,min:1,value:b,disabled:a||o,onChange:e=>x(Number(e.target.value)),required:!0})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:a||o||v===h.workflows.concurrency&&b===h.workflows.maxAgentCalls,children:m(`configureViaSetup`)})]}),(0,q.jsx)(SW,{icon:Pc,title:m(`nextActionSuggestions`),description:m(`nextActionSuggestionsDetail`),value:h.suggestions.enabled,disabled:a||o,loading:a,onChange:e=>void u(m(e?`setupRequestEnableSuggestions`:`setupRequestDisableSuggestions`))}),h.suggestions.model&&(0,q.jsx)(`small`,{children:`${h.suggestions.model.provider}/${h.suggestions.model.model} · ${h.suggestions.model.reasoning}`}),(0,q.jsxs)(`div`,{className:`settings-inline-control`,children:[(0,q.jsx)(bs,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-inline-copy`,children:[(0,q.jsxs)(`strong`,{children:[m(`postEditCommand`),(0,q.jsx)(`span`,{className:`settings-inline-status`,children:m(h.postEditConfigured?`configured`:`disabled`)})]}),(0,q.jsx)(`small`,{children:m(`postEditCommandDetail`)})]}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:u,request:m(`setupRequestPostEdit`),label:m(`configurePostEdit`)})]}),(0,q.jsx)(`small`,{children:m(`agentSettingsSetupHint`)})]})]}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`resultDisplay`)}),(0,q.jsxs)(`div`,{className:`settings-chat-controls`,children:[[[`subagentResultDisplay`,`subagentResults`,ws],[`bashToolDisplay`,`bashOperations`,Vc],[`fileMutationDisplay`,`fileMutations`,Fs]].map(([e,t,n])=>(0,q.jsxs)(`label`,{className:`settings-inline-control`,htmlFor:`settings-${e}`,children:[(0,q.jsx)(n,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`settings-inline-copy`,children:(0,q.jsx)(`strong`,{children:m(t)})}),(0,q.jsx)(Tj,{id:`settings-${e}`,className:`settings-select-control`,label:m(t),value:h.ui[e],disabled:s,onChange:t=>{(t===`full`||t===`compact`)&&d({[e]:t})},options:[{value:`compact`,label:m(`detailDisplay_compact`)},{value:`full`,label:m(`detailDisplay_full`)}]})]},e)),(0,q.jsx)(SW,{icon:mc,title:m(`terminalFooter`),value:h.ui.customFooter,disabled:s,loading:s,onChange:e=>void d({customFooter:e})}),(0,q.jsxs)(`label`,{className:`settings-inline-control`,htmlFor:`settings-footer-style`,children:[(0,q.jsx)(`span`,{children:m(`terminalFooterStyle`)}),(0,q.jsx)(Tj,{id:`settings-footer-style`,className:`settings-select-control`,label:m(`terminalFooterStyle`),value:h.ui.footerStyle,disabled:s||!h.ui.customFooter,onChange:e=>{(e===`plain`||e===`powerline`||e===`powerline-mono`)&&d({footerStyle:e})},options:[{value:`plain`,label:`Plain`},{value:`powerline`,label:`Powerline`},{value:`powerline-mono`,label:`Powerline Mono`}]})]}),(0,q.jsx)(`small`,{children:m(`terminalFooterHint`)})]})]})]}),(0,q.jsx)(sW,{}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`sessionSettings`)}),(0,q.jsxs)(`dl`,{className:`settings-summary-list`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`selectedModel`)}),(0,q.jsx)(`dd`,{children:n?.label??m(`noModels`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`thinkingLevel`)}),(0,q.jsx)(`dd`,{children:r})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`currentWorkspace`)}),(0,q.jsx)(`dd`,{title:i,children:i})]})]}),(0,q.jsx)(Br,{label:m(`openRuntimeDetails`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ls,{"aria-hidden":`true`}),className:`settings-runtime-action`,onClick:f})]})]})}function EW(e){return e.split(/[\\/]/u).filter(Boolean).at(-1)||e}function DW({kind:e,query:t,scope:n,onQuery:r,onScope:i,onAdd:a}){let{t:o}=W();return(0,q.jsxs)(`div`,{className:`settings-resource-toolbar`,children:[(0,q.jsxs)(`div`,{className:`settings-resource-toolbar-heading`,children:[(0,q.jsx)(`strong`,{children:o(`resources`)}),(0,q.jsx)(Br,{label:o(e===`skills`?`addSkill`:`addPlugin`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:a})]}),(0,q.jsxs)(`label`,{className:`settings-resource-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":o(`searchResources`),placeholder:o(`searchResources`),value:t,onChange:e=>r(e.target.value)})]}),(0,q.jsx)(Tj,{label:o(`filterResourceScope`),value:n,onChange:i,options:[{value:`all`,label:o(`allResourceScopes`)},...[`project`,`user`,`temporary`].map(e=>({value:e,label:o(`resourceScope_${e}`)}))]})]})}function OW({kind:e,pending:t,onConfigure:n,onCancel:r}){let{t:i}=W(),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(`user`);return(0,q.jsxs)(`section`,{className:`settings-resource-install`,children:[(0,q.jsx)(`header`,{className:`settings-detail-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:i(e===`skills`?`addSkill`:`addPlugin`)}),(0,q.jsx)(`p`,{children:i(`resourceInstallIntro`)})]})}),(0,q.jsxs)(`form`,{className:`settings-edit-form`,onSubmit:r=>{r.preventDefault(),!t&&a.trim()&&n(i(`setupResourceInstallRequest`,{kind:i(e===`skills`?`skillsSettings`:`pluginsSettings`),source:JSON.stringify(a.trim()),scope:s}))},children:[(0,q.jsxs)(`label`,{className:`settings-form-field`,children:[i(`resourcePackageSource`),(0,q.jsx)(`input`,{required:!0,maxLength:1e3,value:a,placeholder:i(`resourcePackageSourcePlaceholder`),disabled:t,onChange:e=>{o(e.target.value)}})]}),(0,q.jsxs)(`label`,{className:`settings-form-field`,htmlFor:`resource-install-scope`,children:[i(`scope`),(0,q.jsx)(Tj,{id:`resource-install-scope`,label:i(`scope`),value:s,disabled:t,onChange:c,options:[{value:`user`,label:i(`resourceScope_user`)},{value:`project`,label:i(`resourceScope_project`)}]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-actions`,children:[(0,q.jsx)(Br,{type:`submit`,label:i(`configureViaSetup`),variant:`secondary`,size:`sm`,isDisabled:t||!a.trim()}),(0,q.jsx)(Br,{label:i(`cancel`),variant:`ghost`,size:`sm`,onClick:r})]}),(0,q.jsx)(`small`,{children:i(`resourceInstallReview`)})]}),e===`skills`&&(0,q.jsxs)(`a`,{className:`settings-resource-link`,href:`https://skills.sh`,target:`_blank`,rel:`noreferrer`,children:[i(`browseSkills`),(0,q.jsx)(Os,{"aria-hidden":`true`})]})]})}function kW({catalog:e,pending:t,onReload:n,kind:r,onConfigure:i,children:a}){let{t:o}=W(),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(null);return(0,q.jsxs)(`section`,{className:`settings-resource-management`,children:[a&&(0,q.jsx)(`div`,{className:`settings-resource-actions`,children:a}),(0,q.jsxs)(`div`,{className:`settings-resource-reload`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:o(`resourceSessionState`)}),(0,q.jsx)(`p`,{children:o(`resourcesReloadNote`)})]}),(0,q.jsx)(Br,{label:o(`reloadResources`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(me,{"aria-hidden":`true`}),isDisabled:t||l||!e?.sessionPath||!n,isLoading:l,onClick:()=>c(!0)})]}),d&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,role:`status`,children:d}),(0,q.jsxs)(`details`,{className:`settings-resource-advanced`,children:[(0,q.jsx)(`summary`,{children:o(`advancedResourceConfiguration`)}),(0,q.jsx)(wW,{pending:t,onConfigure:i,placeholder:o(r===`skills`?`setupSkillsPlaceholder`:`setupPluginsPlaceholder`)})]}),s&&(0,q.jsx)(uj,{isOpen:!0,onOpenChange:c,title:o(`reloadResources`),description:o(`resourceReloadReview`),cancelLabel:o(`cancel`),actionLabel:o(`reloadResources`),onAction:()=>{c(!1),u(!0),f(null),n?.().then(()=>f(o(`resourceReloaded`)),e=>f(e instanceof Error?e.message:o(`resourceReloadFailed`))).finally(()=>u(!1))}})]})}function AW({catalog:e}){let{t}=W();if(!e)return null;let{diagnostics:n,truncation:r}=e.resources;return!n.settingsErrors&&!n.extensionErrors&&!n.skillErrors&&!r.truncated?null:(0,q.jsxs)(`p`,{className:`settings-resource-notice`,role:`status`,children:[t(`resourceDiagnostics`,n),n.settingsErrors?` ${t(`resourceConfigurationDiagnostics`,{count:n.settingsErrors})}`:``,r.truncated&&` ${t(`resourceCatalogTruncated`)}`]})}function jW({catalog:e,error:t,onRefresh:n,setupPending:r,onConfigure:i,onReload:a}){let{t:o}=W(),s=e?.resources.skills??[],[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(`all`),[f,p]=(0,K.useState)(!1),m=(0,K.useMemo)(()=>s.filter(e=>(u===`all`||e.scope===u)&&`${e.name} ${e.description} ${e.source}`.toLocaleLowerCase().includes(c.trim().toLocaleLowerCase())),[s,c,u]),h=(0,K.useMemo)(()=>[`project`,`user`,`temporary`].map(e=>({scope:e,skills:m.filter(t=>t.scope===e)})).filter(e=>e.skills.length>0),[m]),[g,_]=(0,K.useState)(``),[v,y]=(0,K.useState)(null),b=m.find(e=>e.id===g)??m[0],x=m.filter(e=>e.canManage!==!1),S=JSON.stringify(x.map(e=>e.filePath)),C=new TextEncoder().encode(S).length>12e3;(0,K.useEffect)(()=>{s.length&&!s.some(e=>e.id===g)&&_(s[0].id)},[g,s]);let w=e=>{y(null),td(`/skill:${e.name} `).then(e=>y(e?`copied`:`failed`))};return(0,q.jsxs)(`section`,{className:`settings-content-page settings-managed-panel`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:o(`skillsSettings`)}),(0,q.jsx)(`p`,{children:o(`skillsEmptyIntro`)})]})}),(0,q.jsxs)(`aside`,{className:`settings-resource-sidebar`,children:[(0,q.jsx)(DW,{kind:`skills`,query:c,scope:u,onQuery:l,onScope:d,onAdd:()=>p(!0)}),(0,q.jsxs)(`div`,{className:`settings-resource-list`,children:[h.map(e=>(0,q.jsxs)(`section`,{className:`settings-resource-group`,children:[(0,q.jsx)(`span`,{className:`settings-sidebar-label`,children:o(`resourceScope_${e.scope}`)}),e.skills.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:`settings-resource-item`,"aria-current":e.id===b?.id?`page`:void 0,onClick:()=>{_(e.id),y(null),p(!1)},children:[(0,q.jsx)(Pc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:e.name}),(0,q.jsx)(`small`,{children:o(e.disableModelInvocation?`explicitOnly`:`availableToModel`)})]})]},e.id))]},e.scope)),!e&&!t&&(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}),e&&!m.length&&(0,q.jsx)(`p`,{className:`settings-resource-empty`,children:o(s.length?`noMatchingResources`:`noSkillsFound`)})]}),(0,q.jsxs)(`div`,{className:`settings-sidebar-footer`,children:[(0,q.jsx)(`span`,{children:o(`skillCount`,{count:s.length})}),(0,q.jsx)(`button`,{type:`button`,"aria-label":o(`refreshStatus`),onClick:n,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-detail`,children:[(0,q.jsx)(AW,{catalog:e}),f?(0,q.jsx)(OW,{kind:`skills`,pending:r,onConfigure:i,onCancel:()=>p(!1)}):t?(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}):b?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`settings-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:b.name}),(0,q.jsx)(`p`,{children:b.description})]}),(0,q.jsx)(Br,{label:o(v===`copied`?`copiedMessage`:`copySkillInvocation`),variant:`secondary`,size:`sm`,icon:v===`copied`?(0,q.jsx)(rs,{}):(0,q.jsx)(_s,{}),onClick:()=>w(b)})]}),(0,q.jsxs)(`dl`,{className:`settings-detail-metadata`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`source`)}),(0,q.jsx)(`dd`,{children:b.source===`auto`?o(`resourceSourceAuto`):b.source===`local`?o(`resourceSourceLocal`):b.source===`builtin`?o(`builtIn`):b.source})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`scope`)}),(0,q.jsx)(`dd`,{children:o(`resourceScope_${b.scope}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`invocation`)}),(0,q.jsx)(`dd`,{children:(0,q.jsx)(`code`,{children:`/skill:${b.name}`})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`modelInvocation`)}),(0,q.jsx)(`dd`,{children:o(b.disableModelInvocation?`explicitOnly`:`availableToModel`)})]})]}),(0,q.jsxs)(`section`,{className:`settings-path-block`,children:[(0,q.jsx)(Fs,{"aria-hidden":`true`}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:o(`skillFile`)}),(0,q.jsx)(`code`,{children:b.filePath})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-actions`,children:[(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(b.disableModelInvocation?`enableSkillInvocation`:`disableSkillInvocation`),request:o(`setupSkillInvocationRequest`,{path:b.filePath,disabled:!b.disableModelInvocation})}),(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(`updateResource`),request:o(`setupSkillManageRequest`,{action:`update`,path:JSON.stringify(b.filePath),source:JSON.stringify(b.source),scope:b.scope})}),(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(`removeResource`),request:o(`setupSkillManageRequest`,{action:`remove`,path:JSON.stringify(b.filePath),source:JSON.stringify(b.source),scope:b.scope})})]}),b.canManage===!1&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,children:o(`resourceTargetTruncated`)}),v===`failed`&&(0,q.jsx)(`p`,{className:`inspection-warning`,children:o(`copyFailed`)})]}):(0,q.jsxs)(`div`,{className:`settings-empty-detail`,children:[(0,q.jsx)(Pc,{"aria-hidden":`true`}),(0,q.jsx)(`h2`,{children:o(s.length?`noMatchingResources`:`skillsEmptyTitle`)}),(0,q.jsx)(Br,{label:o(`addSkill`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:()=>p(!0)})]}),!f&&(0,q.jsxs)(kW,{catalog:e,pending:r,onReload:a,kind:`skills`,onConfigure:i,children:[x.length>1&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(CW,{isPending:r,isBlocked:C,onConfigure:i,label:o(`enableVisibleSkills`,{count:x.length}),request:o(`setupSkillsBulkRequest`,{paths:S,disabled:!1})}),(0,q.jsx)(CW,{isPending:r,isBlocked:C,onConfigure:i,label:o(`disableVisibleSkills`,{count:x.length}),request:o(`setupSkillsBulkRequest`,{paths:S,disabled:!0})})]}),C&&(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`resourceBulkTooLarge`)})]})]})]})}function MW({catalog:e,error:t,currentModel:n,models:r,activity:i,setupPending:a,setupBlocked:o=!1,onConfigure:s,onRefresh:c}){let{t:l}=W(),[u,d]=(0,K.useState)(`explorer`),f=e?.setup.subagents.roleModels[u],[p,m]=(0,K.useState)(``),[h,g]=(0,K.useState)(1);(0,K.useEffect)(()=>{let t=e?.setup.subagents.roleModels[u];m(t?`${t.provider}/${t.model}`:``),g(e?.setup.workflows.concurrency??1)},[u,e]);let _=i?.items.filter(e=>e.status===`running`).length??0,v=i?.items.filter(e=>e.status!==`running`).length??0;return(0,q.jsxs)(`section`,{className:`settings-content-page settings-subagents-panel`,children:[(0,q.jsxs)(`header`,{className:`settings-page-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:l(`subagentsSettings`)}),(0,q.jsx)(`p`,{children:l(`subagentConfigurationIntro`)})]}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:s,request:l(`setupRequestSubagents`),label:l(`configureRoles`)})]}),(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:c}),(0,q.jsx)(`div`,{className:`settings-control-group`,children:(0,q.jsxs)(`label`,{className:`settings-control-row`,htmlFor:`subagent-role`,children:[(0,q.jsxs)(`span`,{className:`settings-control-copy`,children:[(0,q.jsx)(`strong`,{children:l(`builtInRoles`)}),(0,q.jsx)(`span`,{children:l(`subagentRoleShort_${u}`)})]}),(0,q.jsx)(Tj,{id:`subagent-role`,name:`subagentRole`,label:l(`builtInRoles`),value:u,onChange:e=>{let t=bW.find(t=>t===e);t&&d(t)},options:bW.map(e=>({value:e,label:l(`subagentRole_${e}`)}))})]})}),(0,q.jsx)(`div`,{className:`settings-role-detail`,children:e&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`header`,{className:`settings-detail-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:l(`subagentRole_${u}`)}),(0,q.jsx)(`p`,{children:l(`subagentRoleDescription_${u}`)})]})}),(0,q.jsxs)(`form`,{className:`settings-edit-form settings-role-form`,onSubmit:e=>{e.preventDefault(),!(a||o)&&s(l(`setupRoleFormRequest`,{role:u,model:p||l(`inheritParentModel`),concurrency:h}))},children:[(0,q.jsxs)(`div`,{className:`settings-control-group`,children:[(0,q.jsxs)(`label`,{className:`settings-control-row`,htmlFor:`role-model`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`modelAssignment`)})}),(0,q.jsx)(Tj,{id:`role-model`,name:`roleModel`,label:l(`modelAssignment`),value:p,disabled:a||o,onChange:m,menuWidth:`min(380px, calc(100vw - 32px))`,options:[{value:``,label:l(`inheritParentModel`)},...p&&!r.some(e=>`${e.provider}/${e.id}`===p)?[{value:p,label:p}]:[],...r.map(e=>({value:`${e.provider}/${e.id}`,label:e.label}))]})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`effectiveModel`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:f?`${f.provider}/${f.model}`:n?.label??l(`unknownState`)})]}),(0,q.jsxs)(`label`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`workflowConcurrencyLabel`)})}),(0,q.jsx)(`input`,{name:`concurrency`,type:`number`,autoComplete:`off`,min:1,max:64,required:!0,value:h,disabled:a||o,onChange:e=>g(Number(e.target.value))})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`workflowCallLimit`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:e.setup.workflows.maxAgentCalls})]})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:a||o,children:l(`configureViaSetup`)}),(0,q.jsx)(`small`,{className:`settings-resource-caption`,children:l(`setupFormDetail`)})]}),(0,q.jsxs)(`section`,{className:`settings-role-principles`,children:[(0,q.jsx)(`h2`,{children:l(`runtimeBoundaries`)}),(0,q.jsxs)(`div`,{className:`settings-control-group`,children:[(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(Ys,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:l(`subagentAuthorityNote`)})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(ws,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:l(`subagentModelNote`)})]})]}),(0,q.jsxs)(`p`,{className:`settings-resource-caption`,children:[l(`subagentActiveCount`,{count:_}),` ·`,` `,l(`subagentCompletedCount`,{count:v})]})]})]})})]})}function NW(e){return e.extensions.length+e.skills.length+e.prompts.length+e.themes.length}function PW(e){return e.enabled===!1?`disabled`:e.configured&&!e.installed?`missing`:e.diagnostics?.length?`error`:NW(e)?`loaded`:e.installed?`installed`:`notLoaded`}function FW({catalog:e,error:t,onRefresh:n,setupPending:r,onConfigure:i,onReload:a}){let{t:o}=W(),s=e?.resources.plugins??[],[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(`all`),[f,p]=(0,K.useState)(!1),m=(0,K.useMemo)(()=>s.filter(e=>(u===`all`||e.scope===u)&&`${e.name??``} ${e.source}`.toLocaleLowerCase().includes(c.trim().toLocaleLowerCase())),[s,c,u]),[h,g]=(0,K.useState)(``),_=m.find(e=>e.id===h)??m[0],v=m.filter(e=>e.configured&&e.canManage!==!1),y=e=>e.name??(e.source===`auto`?o(`resourceSourceAuto`):e.source===`builtin`?o(`builtIn`):EW(e.source)),b=JSON.stringify(v.map(({source:e,scope:t,baseDir:n})=>({source:e,scope:t,path:n}))),x=new TextEncoder().encode(b).length>12e3;return(0,K.useEffect)(()=>{s.length&&!s.some(e=>e.id===h)&&g(s[0].id)},[s,h]),(0,q.jsxs)(`section`,{className:`settings-content-page settings-managed-panel`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:o(`pluginsSettings`)}),(0,q.jsx)(`p`,{children:o(`pluginsEmptyIntro`)})]})}),(0,q.jsxs)(`aside`,{className:`settings-resource-sidebar`,children:[(0,q.jsx)(DW,{kind:`plugins`,query:c,scope:u,onQuery:l,onScope:d,onAdd:()=>p(!0)}),(0,q.jsxs)(`div`,{className:`settings-resource-list`,children:[m.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:`settings-resource-item`,"aria-current":e.id===_?.id?`page`:void 0,onClick:()=>{g(e.id),p(!1)},children:[(0,q.jsx)(Sc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:y(e)}),(0,q.jsxs)(`small`,{children:[o(`resourceScope_${e.scope}`),` ·`,` `,o(`pluginState_${PW(e)}`)]})]})]},e.id)),!e&&!t&&(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}),e&&!m.length&&(0,q.jsx)(`p`,{className:`settings-resource-empty`,children:o(s.length?`noMatchingResources`:`noPluginsFound`)})]}),(0,q.jsxs)(`div`,{className:`settings-sidebar-footer`,children:[(0,q.jsx)(`span`,{children:e?o(`pluginCount`,{count:s.length}):o(`settingsCatalogLoading`)}),(0,q.jsx)(`button`,{type:`button`,"aria-label":o(`refreshStatus`),onClick:n,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-detail`,children:[(0,q.jsx)(AW,{catalog:e}),f?(0,q.jsx)(OW,{kind:`plugins`,pending:r,onConfigure:i,onCancel:()=>p(!1)}):t?(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}):_?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`settings-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:y(_)}),(0,q.jsx)(`code`,{children:_.source})]}),(0,q.jsx)(`span`,{className:`settings-status-badge ${PW(_)===`loaded`?`healthy`:``}`,children:o(`pluginState_${PW(_)}`)})]}),(0,q.jsxs)(`dl`,{className:`settings-detail-metadata settings-detail-metadata-wide`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`scope`)}),(0,q.jsx)(`dd`,{children:o(`resourceScope_${_.scope}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`resourceOrigin`)}),(0,q.jsx)(`dd`,{children:o(`resourceOrigin_${_.origin}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`installedVersion`)}),(0,q.jsx)(`dd`,{children:_.installedVersion??o(`notReported`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`configuredVersion`)}),(0,q.jsx)(`dd`,{children:_.configuredVersion??o(`resourceVersionUnpinned`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`resources`)}),(0,q.jsx)(`dd`,{children:o(`pluginResourceSummary`,{extensions:_.extensions.length,skills:_.skills.length,prompts:_.prompts.length,themes:_.themes.length})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`baseDirectory`)}),(0,q.jsx)(`dd`,{title:_.baseDir,children:_.baseDir??o(`notReported`)})]})]}),[...new Set(_.diagnostics)].map(e=>(0,q.jsx)(`p`,{className:`settings-resource-notice`,role:`status`,children:e},e)),_.canManage===!1&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,children:o(`resourceTargetTruncated`)}),_.configured&&_.canManage!==!1&&(0,q.jsx)(`div`,{className:`settings-resource-actions settings-resource-primary-actions`,children:[_.enabled===!1?`enable`:`disable`,`update`,`remove`].map(e=>(0,q.jsx)(CW,{isPending:r,onConfigure:i,label:o(`pluginAction_${e}`),request:o(`setupPluginOperationRequest`,{action:e,source:JSON.stringify(_.source),path:JSON.stringify(_.baseDir??null),scope:_.scope})},e))}),(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`pluginLoadedResources`,{count:NW(_)})}),(0,q.jsxs)(`section`,{className:`settings-resource-groups`,children:[_.extensions.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`extensions`)}),(0,q.jsx)(`ul`,{children:_.extensions.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:e.name}),(0,q.jsx)(`code`,{children:e.path})]}),(0,q.jsx)(`span`,{children:o(`extensionSurfaceCount`,{tools:e.toolCount,commands:e.commandCount})})]},e.path))})]}),_.skills.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`skillsSettings`)}),(0,q.jsx)(`p`,{children:_.skills.join(` · `)})]}),_.prompts.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`prompts`)}),(0,q.jsx)(`p`,{children:_.prompts.join(` · `)})]}),_.themes.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`themes`)}),(0,q.jsx)(`p`,{children:_.themes.join(` · `)})]})]})]}):(0,q.jsxs)(`div`,{className:`settings-empty-detail`,children:[(0,q.jsx)(Sc,{"aria-hidden":`true`}),(0,q.jsx)(`h2`,{children:o(s.length?`noMatchingResources`:`pluginsEmptyTitle`)}),(0,q.jsx)(Br,{label:o(`addPlugin`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:()=>p(!0)})]}),!f&&(0,q.jsxs)(kW,{catalog:e,pending:r,onReload:a,kind:`plugins`,onConfigure:i,children:[v.length>1&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(CW,{isPending:r,isBlocked:x,onConfigure:i,label:o(`enableVisiblePlugins`,{count:v.length}),request:o(`setupPluginsBulkRequest`,{packages:b,disabled:!1})}),(0,q.jsx)(CW,{isPending:r,isBlocked:x,onConfigure:i,label:o(`disableVisiblePlugins`,{count:v.length}),request:o(`setupPluginsBulkRequest`,{packages:b,disabled:!0})})]}),x&&(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`resourceBulkTooLarge`)})]})]})]})}function IW(e,t=``,n){let r=(0,K.useMemo)(()=>new de,[]),[i,a]=(0,K.useState)(0),o=JSON.stringify([e,t]),s=(0,K.useRef)(o);s.current=o;let c=(0,K.useRef)(0),[l,u]=(0,K.useState)(null),d=(0,K.useCallback)(()=>a(e=>e+1),[]);return(0,K.useEffect)(()=>{let t=new AbortController,n=++c.current;return u(e=>({owner:o,catalog:e?.owner===o?e.catalog:null,error:null})),r.settingsCatalog(e,t.signal).then(e=>{!t.signal.aborted&&c.current===n&&u({owner:o,catalog:e,error:null})},e=>{!t.signal.aborted&&c.current===n&&u(t=>({owner:o,catalog:t?.owner===o?t.catalog:null,error:e instanceof Error?e.message:String(e)}))}),()=>t.abort()},[r,i,e,o,n]),{catalog:l?.owner===o?l.catalog:null,error:l?.owner===o?l.error:null,refresh:d,updateSetup:e=>{s.current===o&&(c.current++,u(t=>t?.owner===o&&t.catalog?{...t,catalog:{...t.catalog,setup:e}}:t))}}}var LW=[`default`,`mist`,`rose`,`pine`],RW=[`codex`,`sans`,`serif`,`mono`],zW=[`system`,`light`,`dark`],BW={palette:`default`,accent:``,background:``,foreground:``,font:`codex`};function VW(e){return e===`pine`?`dark`:e===`mist`||e===`rose`?`light`:e}function HW(e,t){return e===`mist`||e===`rose`||e===`pine`?e:t.palette}function UW(e,t){switch(e){case`mist`:return t?{background:`#182126`,foreground:`#EDF3F5`,sidebar:`#1D292F`,accent:`#7BB5CA`}:{background:`#F8FBFC`,foreground:`#253239`,sidebar:`#EEF3F5`,accent:`#347991`};case`rose`:return t?{background:`#211A1C`,foreground:`#F4ECEC`,sidebar:`#2A2123`,accent:`#E09AA5`}:{background:`#FFF9F7`,foreground:`#342729`,sidebar:`#F6EDEA`,accent:`#B45562`};case`pine`:return t?{background:`#101A17`,foreground:`#EAF2EC`,sidebar:`#16241F`,accent:`#86C89E`}:{background:`#F4F8F5`,foreground:`#20352A`,sidebar:`#E9F1EB`,accent:`#32704A`};default:return t?{background:`#17191C`,foreground:`#EDF0F2`,sidebar:`#1D2024`,accent:`#74A9E6`}:{background:`#FFFFFF`,foreground:`#1A1C1F`,sidebar:`#F6F7F9`,accent:`#2563EB`}}}function WW(e){if(e.length>2e3)return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;if(Object.keys(n).sort().join(`,`)!==`appearance,theme,version`||n.version!==1)return null;let r=zW.find(e=>e===n.theme);if(!r||!n.appearance||typeof n.appearance!=`object`||Array.isArray(n.appearance))return null;let i=n.appearance;if(Object.keys(i).sort().join(`,`)!==`accent,background,font,foreground,palette`)return null;let a=LW.find(e=>e===i.palette),o=i.font===`system`?`codex`:RW.find(e=>e===i.font),{accent:s,background:c,foreground:l}=i;return!a||!o||typeof s!=`string`||typeof c!=`string`||typeof l!=`string`||![s,c,l].every(e=>e===``||/^#[0-9a-f]{6}$/iu.test(e))?null:{theme:r,appearance:{palette:a,font:o,accent:s,background:c,foreground:l}}}catch{return null}}var GW=[``,`#2563EB`,`#7C3AED`,`#DB2777`,`#D97706`,`#16A34A`];function KW({label:e,value:t,options:n,disabled:r,onSelect:i}){let a=n.find(e=>e.id===t);return(0,q.jsx)(yo,{className:`settings-select-menu`,button:{label:a?.label??t,"aria-label":e,variant:`secondary`,size:`sm`,className:`appearance-menu-trigger`,isDisabled:r,...a?.color?{icon:(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:a.color}})}:{}},menuWidth:200,alignment:`end`,items:n.map(e=>({id:e.id||`default`,label:e.label,isDisabled:r,...e.color?{icon:(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:e.color}})}:{},endContent:t===e.id?(0,q.jsx)(`span`,{className:`settings-select-check`,"aria-hidden":`true`,children:(0,q.jsx)(rs,{})}):void 0,onClick:()=>i(e.id)}))})}function qW({label:e,value:t,fallback:n,disabled:r,onSave:i}){let a=(t||n).toUpperCase(),o=(0,K.useRef)(a);o.current=a;let[s,c]=(0,K.useState)(a);(0,K.useEffect)(()=>c(a),[a]);let l=e=>{c(e),e!==a&&/^#[0-9a-f]{6}$/iu.test(e)&&i(e).then(e=>{e||c(o.current)})};return(0,q.jsxs)(`div`,{className:`appearance-color-input`,children:[(0,q.jsxs)(`label`,{className:`appearance-color-picker`,children:[(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:a}}),(0,q.jsx)(`input`,{"aria-label":`${e} — ${a}`,type:`color`,value:a,disabled:r,onChange:e=>l(e.target.value.toUpperCase())})]}),(0,q.jsx)(`input`,{className:`appearance-color-hex`,type:`text`,"aria-label":e,value:s,maxLength:7,spellCheck:!1,disabled:r,onChange:e=>l(e.target.value.toUpperCase()),onBlur:()=>c(a)})]})}function JW({catalog:e,theme:t,pending:n,error:r,onRefresh:i,onUpdatePreferences:a}){let{t:o}=W(),{mode:s}=sa(),c=e?.setup,l=c?.ui.webTheme??t,u=c?.ui.webAppearance??BW,d=HW(l,u),f=VW(l),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(``),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(null),[C,w]=(0,K.useState)(c?.ui.webChatWidth??820),[T,E]=(0,K.useState)(c?.ui.webChatFontSize??14),D=(0,K.useRef)({chatWidth:C,fontSize:T});c&&(D.current={chatWidth:c.ui.webChatWidth,fontSize:c.ui.webChatFontSize}),(0,K.useEffect)(()=>{c&&(w(c.ui.webChatWidth),E(c.ui.webChatFontSize))},[c]);let O=e?.setupWritable===!1||!!e?.resources.diagnostics.settingsErrors,k=n||!c||!!r||O,A=WW(_),j=e=>a({appearance:e}),M=()=>{n||(g(!1),v(``),b(!1))},N=f===`dark`||f===`system`&&s===`dark`,P=UW(d,N);return(0,q.jsxs)(`section`,{className:`settings-content-page settings-appearance-panel`,children:[(0,q.jsx)(`h1`,{children:o(`appearance`)}),(!c||r||O)&&(0,q.jsxs)(`div`,{className:`settings-load-state`,role:r||O?`alert`:`status`,children:[(0,q.jsx)(me,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o(O?`configurationReadFailure`:r?`settingsCatalogFailed`:`settingsCatalogLoading`)}),(r||O)&&(0,q.jsx)(`button`,{type:`button`,onClick:i,children:o(`retryAdmissionCheck`)})]}),(0,q.jsxs)(`section`,{className:`appearance-section`,"aria-labelledby":`appearance-visual-title`,children:[(0,q.jsx)(`h2`,{id:`appearance-visual-title`,children:o(`appearanceVisualStyle`)}),(0,q.jsxs)(`div`,{className:`appearance-card appearance-mode-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceMode`)}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":o(`appearanceMode`),className:`appearance-mode-options`,children:zW.map(e=>(0,q.jsx)(V,{content:o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`),children:(0,q.jsxs)(`label`,{className:`appearance-mode-option`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`openpi-appearance-mode`,"aria-label":o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`),checked:f===e,disabled:k,onChange:()=>void a({theme:e})}),(0,q.jsxs)(`span`,{"aria-hidden":`true`,className:`appearance-mode-preview`,"data-mode":e,"data-selected":f===e,children:[(0,q.jsxs)(`span`,{className:`appearance-mini-window`,children:[(0,q.jsx)(`span`,{className:`appearance-mini-sidebar`}),(0,q.jsxs)(`span`,{className:`appearance-mini-chat`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`em`,{})]})]}),e===`system`&&(0,q.jsxs)(`span`,{className:`appearance-mini-window appearance-mini-dark`,children:[(0,q.jsx)(`span`,{className:`appearance-mini-sidebar`}),(0,q.jsxs)(`span`,{className:`appearance-mini-chat`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`em`,{})]})]})]}),(0,q.jsx)(`span`,{className:`appearance-mode-label`,children:o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`)})]})},e))})]}),(0,q.jsxs)(`div`,{className:`appearance-card`,children:[(0,q.jsxs)(`div`,{className:`appearance-row appearance-theme-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceTheme`)}),(0,q.jsxs)(`div`,{className:`appearance-theme-actions`,children:[(0,q.jsx)(V,{content:o(`appearanceImport`),children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":o(`appearanceImport`),disabled:k,onClick:()=>{b(!1),g(!0)},children:(0,q.jsx)(Ts,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:o(`appearanceCopy`),children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":o(`appearanceCopy`),disabled:k,onClick:()=>{td(JSON.stringify({version:1,theme:f,appearance:{...u,palette:d}})).then(e=>S(e?`saved`:`failed`))},children:(0,q.jsx)(Ss,{"aria-hidden":`true`})})})]})]}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":o(`appearanceTheme`),"aria-busy":n,className:`appearance-palette-options`,children:LW.map(e=>{let t=UW(e,N),n=e==="default"?`OpenPI`:o(`theme${e[0].toUpperCase()}${e.slice(1)}`);return(0,q.jsxs)(`label`,{className:`appearance-palette-option`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`openpi-appearance-palette`,"aria-label":n,checked:d===e,disabled:k,onChange:()=>void j({palette:e})}),(0,q.jsxs)(`span`,{className:`appearance-palette-preview`,"aria-hidden":`true`,style:{background:t.background,color:t.foreground},children:[(0,q.jsxs)(`span`,{className:`appearance-palette-shell`,style:{background:t.sidebar},children:[(0,q.jsxs)(`span`,{className:`appearance-palette-sidebar`,children:[(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]}),(0,q.jsxs)(`span`,{className:`appearance-palette-canvas`,style:{background:t.background},children:[(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`em`,{style:{borderColor:t.accent},children:(0,q.jsx)(`span`,{className:`appearance-palette-send`,style:{background:t.accent}})})]})]}),(0,q.jsx)(`span`,{className:`appearance-palette-check`,children:(0,q.jsx)(rs,{})})]}),(0,q.jsx)(`span`,{className:`appearance-palette-label`,children:n})]},e)})}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceAccent`)}),(0,q.jsxs)(`div`,{className:`appearance-accent-controls`,children:[(0,q.jsx)(KW,{label:o(`appearanceAccent`),value:u.accent,options:GW.map((e,t)=>({id:e,label:o(`appearanceAccent${t}`),color:e||`var(--text)`})),disabled:k,onSelect:e=>void j({accent:e})}),(0,q.jsx)(qW,{label:o(`appearanceCustomAccent`),value:u.accent,fallback:`#2563EB`,disabled:k,onSave:e=>j({accent:e})})]})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceBackground`)}),(0,q.jsx)(qW,{label:o(`appearanceBackground`),value:u.background,fallback:P.background,disabled:k,onSave:e=>j({background:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceForeground`)}),(0,q.jsx)(qW,{label:o(`appearanceForeground`),value:u.foreground,fallback:P.foreground,disabled:k,onSave:e=>j({foreground:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceFont`)}),(0,q.jsx)(KW,{label:o(`appearanceFont`),value:u.font===`system`?`codex`:u.font,options:RW.map(e=>({id:e,label:o(`appearanceFont_${e}`)})),disabled:k,onSelect:e=>{let t=RW.find(t=>t===e);t&&j({font:t})}})]})]}),x&&(0,q.jsx)(`p`,{role:x===`failed`?`alert`:`status`,className:`appearance-share-status`,children:o(x===`saved`?`appearanceCopied`:`appearanceCopyFailed`)})]}),(0,q.jsxs)(`section`,{className:`appearance-section`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`appearance-advanced-toggle`,"aria-expanded":p,"aria-controls":`appearance-advanced`,onClick:()=>m(!p),children:[o(`appearanceAdvanced`),p?(0,q.jsx)(is,{"aria-hidden":`true`}):(0,q.jsx)(os,{"aria-hidden":`true`})]}),p&&c&&(0,q.jsxs)(`div`,{id:`appearance-advanced`,className:`appearance-card appearance-advanced-content`,children:[(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`expandThinkingByDefault`)}),(0,q.jsx)(bj,{label:o(`expandThinkingByDefault`),isLabelHidden:!0,value:c.ui.webExpandThinking,size:`sm`,isDisabled:k,onChange:e=>void a({expandThinking:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-slider-row`,children:[(0,q.jsxs)(`div`,{className:`settings-slider-heading`,children:[(0,q.jsx)(`span`,{children:o(`chatContentWidth`)}),(0,q.jsxs)(`output`,{children:[C,`px`]}),(0,q.jsx)(`button`,{type:`button`,className:`settings-reset-button`,"aria-label":o(`resetChatContentWidth`),disabled:k||C===820,onClick:()=>{w(820),a({chatWidth:820}).then(e=>{e||w(D.current.chatWidth)})},children:(0,q.jsx)(he,{"aria-hidden":`true`})})]}),(0,q.jsx)(yW,{label:o(`chatContentWidth`),isLabelHidden:!0,value:C,min:820,max:2e3,step:10,width:`100%`,valueDisplay:`none`,isDisabled:k,onChange:e=>w(e),onChangeEnd:e=>{e!==c.ui.webChatWidth&&a({chatWidth:e}).then(e=>{e||w(D.current.chatWidth)})}})]}),(0,q.jsxs)(`div`,{className:`appearance-slider-row`,children:[(0,q.jsxs)(`div`,{className:`settings-slider-heading`,children:[(0,q.jsx)(`span`,{children:o(`chatFontSize`)}),(0,q.jsxs)(`output`,{children:[T,`px`]}),(0,q.jsx)(`button`,{type:`button`,className:`settings-reset-button`,"aria-label":o(`resetChatFontSize`),disabled:k||T===14,onClick:()=>{E(14),a({chatFontSize:14}).then(e=>{e||E(D.current.fontSize)})},children:(0,q.jsx)(he,{"aria-hidden":`true`})})]}),(0,q.jsx)(yW,{label:o(`chatFontSize`),isLabelHidden:!0,value:T,min:12,max:24,step:1,width:`100%`,valueDisplay:`none`,isDisabled:k,onChange:e=>E(e),onChangeEnd:e=>{e!==c.ui.webChatFontSize&&a({chatFontSize:e}).then(e=>{e||E(D.current.fontSize)})}})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceReset`)}),(0,q.jsxs)(`button`,{type:`button`,className:`appearance-reset`,disabled:k,onClick:()=>void a({theme:`system`,appearance:BW,chatWidth:820,chatFontSize:14,expandThinking:!1}),children:[(0,q.jsx)(he,{"aria-hidden":`true`}),o(`appearanceResetAction`)]})]})]})]}),(0,q.jsxs)(Se,{isOpen:h,onOpenChange:e=>{e||M()},"aria-label":o(`appearanceImport`),width:480,className:`appearance-import-dialog`,children:[(0,q.jsx)(`h2`,{className:`appearance-import-title`,children:o(`appearanceImport`)}),(0,q.jsxs)(`form`,{className:`appearance-import-form`,onSubmit:e=>{e.preventDefault(),!(!A||k)&&(b(!1),a(A).then(e=>{e?(g(!1),v(``)):b(!0)}))},children:[(0,q.jsxs)(`label`,{children:[o(`appearanceThemeValue`),(0,q.jsx)(`textarea`,{maxLength:2e3,value:_,disabled:n,placeholder:o(`appearanceImportPlaceholder`),onChange:e=>{b(!1),v(e.target.value)}})]}),_&&!A&&(0,q.jsx)(`p`,{role:`alert`,children:o(`appearanceImportInvalid`)}),y&&(0,q.jsx)(`p`,{role:`alert`,children:o(`settingsPreferencesSaveFailed`)}),(0,q.jsxs)(`div`,{className:`appearance-import-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:n,onClick:M,children:o(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,disabled:k||!A,children:o(n?`savingSettings`:`appearanceImportAction`)})]})]})]})]})}function YW({workspaces:e,onRestore:t}){let{t:n,i18n:r}=W(),i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(``),[l,u]=(0,K.useState)(`updated`),[d,f]=(0,K.useState)(new Set),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(null),[y,b]=(0,K.useState)(null),[x,S]=(0,K.useState)(new Set),C=(0,K.useRef)(new Set),w=(0,K.useRef)(null),T=(0,K.useRef)(!1),E=JSON.stringify([a.trim(),s,l]),D=(0,K.useRef)({key:E});D.current.key!==E&&(D.current={key:E});let O=p?.scope===E?p:null,k=_?.scope===E?_:null,A=(0,K.useCallback)(async(e,t=0)=>{w.current?.abort();let n=new AbortController;w.current=n,g(!0),v(null);let r={query:a.trim(),sort:l,...s?{cwd:s}:{},limit:25};try{let a=await i.listArchivedSessions({...r,...e?{cursor:e}:{}},n.signal);if(n.signal.aborted||w.current!==n)return;let o=[...a.sessions];for(;!e&&o.length!o.some(t=>t.path===e.path));if(o.push(...e),!e.length)break}m(t=>({...a,scope:E,sessions:e&&t?.scope===E?[...t.sessions,...o.filter(e=>!t.sessions.some(t=>t.path===e.path))]:o}))}catch(t){!n.signal.aborted&&w.current===n&&v({scope:E,stale:t instanceof ge&&t.code===`ARCHIVED_SESSION_CURSOR_STALE`,...e?{cursor:e}:{}})}finally{w.current===n&&(w.current=null,g(!1))}},[i,s,a,E,l]);(0,K.useEffect)(()=>(T.current=!0,()=>{T.current=!1}),[]),(0,K.useEffect)(()=>(b(null),A(),()=>{w.current?.abort(),w.current=null}),[A]);let j=async e=>{if(C.current.has(e))return;C.current.add(e),S(new Set(C.current)),b(null);let n=D.current;try{let r=await t(e);if(!T.current||D.current!==n)return;if(!r){b(e);return}let i=O?.sessions.length??0;m(t=>t?{...t,sessions:t.sessions.filter(t=>t.path!==e)}:null),await A(void 0,i)}catch{T.current&&D.current===n&&b(e)}finally{C.current.delete(e),T.current&&S(new Set(C.current))}},M=new Map;for(let e of O?.sessions??[]){let t=e.workspacePath??e.cwd,n=M.get(t)??[];n.push(e),M.set(t,n)}let N=t=>e.find(e=>e.path===t)?.name??t.split(/[\\/]/u).filter(Boolean).at(-1)??t,P=[...new Set([...e.map(e=>e.path),...M.keys(),...s?[s]:[]])];return(0,q.jsxs)(`section`,{className:`settings-content-page settings-archive-panel`,children:[(0,q.jsx)(`h1`,{children:n(`settingsArchivedChats`)}),(0,q.jsxs)(`div`,{className:`settings-archive-toolbar`,children:[(0,q.jsxs)(`label`,{className:`settings-archive-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":n(`searchArchivedChats`),placeholder:n(`searchArchivedChats`),maxLength:160,value:a,onChange:e=>o(e.target.value)}),a&&(0,q.jsx)(`button`,{type:`button`,"aria-label":n(`settingsClearSearch`),onClick:()=>o(``),children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),(0,q.jsx)(Tj,{label:n(`archiveProjectFilter`),value:s,onChange:c,options:[{value:``,label:n(`archiveAllProjects`)},...P.map(e=>({value:e,label:N(e)}))]}),(0,q.jsx)(Tj,{label:n(`archiveSort`),value:l,onChange:e=>u(e===`created`?`created`:`updated`),options:[{value:`updated`,label:n(`archiveSortUpdated`)},{value:`created`,label:n(`archiveSortCreated`)}]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":n(`refreshArchives`),disabled:h,onClick:()=>void A(void 0,O?.sessions.length),children:(0,q.jsx)(me,{"aria-hidden":`true`})})]}),k&&(0,q.jsxs)(`div`,{className:`settings-archive-error`,role:`alert`,children:[(0,q.jsx)(`span`,{children:n(k.stale?`archiveCursorStale`:`archiveLoadFailed`)}),(0,q.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>void A(k.stale?void 0:k.cursor),children:n(`retryAdmissionCheck`)})]}),y&&(0,q.jsx)(`div`,{className:`settings-archive-error`,role:`alert`,children:n(`restoreFailed`)}),h&&(0,q.jsx)(`p`,{role:`status`,className:`settings-archive-status`,children:n(`loadingArchives`)}),!h&&!k&&O?.sessions.length===0&&(0,q.jsxs)(`div`,{className:`settings-archive-empty`,children:[(0,q.jsx)(Go,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:n(a.trim()||s?`noMatchingScannedArchives`:O.truncation.truncated?`noScannedArchives`:`noArchivedSessions`)})]}),(0,q.jsx)(`div`,{className:`settings-archive-groups`,children:[...M].map(([e,t])=>(0,q.jsxs)(`section`,{className:`settings-archive-group`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`settings-archive-group-heading`,"aria-label":n(`archiveProjectGroup`,{project:N(e),count:t.length}),"aria-expanded":!d.has(e),"aria-controls":`archive-group-${encodeURIComponent(e)}`,onClick:()=>f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),children:[d.has(e)?(0,q.jsx)(os,{"aria-hidden":`true`}):(0,q.jsx)(is,{"aria-hidden":`true`}),(0,q.jsx)(Vs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{title:e,children:N(e)}),(0,q.jsx)(`small`,{children:t.length})]}),!d.has(e)&&(0,q.jsx)(`ul`,{id:`archive-group-${encodeURIComponent(e)}`,className:`settings-archive-list`,children:t.map(e=>{let t=e.name||e.firstMessage||n(`untitledSession`),i=new Date(l===`created`?e.created:e.modified);return(0,q.jsxs)(`li`,{className:`settings-archive-row`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`settings-archive-chat-title`,title:t,children:t}),(0,q.jsx)(`time`,{dateTime:Number.isNaN(i.getTime())?void 0:i.toISOString(),children:Number.isNaN(i.getTime())?n(`unknownState`):new Intl.DateTimeFormat(r.language,{dateStyle:`medium`}).format(i)})]}),(0,q.jsxs)(`button`,{type:`button`,"aria-label":n(`restoreArchivedChat`,{title:t}),disabled:x.has(e.path),onClick:()=>void j(e.path),children:[(0,q.jsx)(Wo,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:n(x.has(e.path)?`restoringConversation`:`restoreConversation`)})]})]},e.path)})})]},e))}),!!O?.truncation.recordsUnscanned&&(0,q.jsx)(`p`,{className:`settings-archive-status`,children:n(`archiveScanBounded`,{count:O.truncation.recordsUnscanned})}),O?.nextCursor&&(0,q.jsx)(`button`,{type:`button`,className:`settings-archive-more`,disabled:h,onClick:()=>void A(O.nextCursor),children:n(`moreArchives`)})]})}var XW=[{id:`general`,group:`settingsPersonal`,label:`generalSettings`,Icon:Nc,terms:[`agentBehavior`,`resultDisplay`,`workflowLimits`,`runtimeIdentity`,`runtimeBackendVersion`,`runtimePackageRoot`,`runtimeStartedAt`,`runtimeGitRevision`,`runtimeGitState`,`runtimeFrontendVersion`,`runtimeFrontendBuild`,`runtimeStartupBuild`]},{id:`appearance`,group:`settingsPersonal`,label:`appearance`,Icon:zc,terms:[`appearanceTheme`,`appearanceAccent`,`appearanceFont`,`chatContentWidth`,`chatFontSize`]},{id:`archived-chats`,group:`settingsPersonal`,label:`settingsArchivedChats`,Icon:Go,terms:[`restoreConversation`]},{id:`configuration`,group:`settingsPersonal`,label:`configurationSettings`,Icon:Mc,terms:[`configurationApproval`,`configurationSandbox`,`configurationVerbosity`,`configurationSummary`,`configurationReasoningLevels`,`configurationDependencies`]},{id:`models`,group:`settingsAgent`,label:`modelSettings`,Icon:ws,terms:[`modelDefaultTitle`]},{id:`subagents`,group:`settingsAgent`,label:`subagentsSettings`,Icon:$o,terms:[]},{id:`web-search`,group:`settingsAgent`,label:`webSearchSettings`,Icon:Dc,terms:[]},{id:`skills`,group:`settingsIntegrations`,label:`skillsSettings`,Icon:Xs,terms:[]},{id:`plugins`,group:`settingsIntegrations`,label:`pluginsSettings`,Icon:Sc,terms:[]},{id:`browser`,group:`settingsIntegrations`,label:`browserSettings`,Icon:Es,terms:[]}];function ZW(e){return XW.find(({id:t})=>t===e)?.id}function QW({sessionId:e,sessionPath:t,cwd:n,entry:r=`general`,models:i,currentModel:a,thinkingLevel:o,theme:s,preferences:c,workspaces:l=[],onRestoreSession:u,capabilities:d,setupBusy:f,setupBlockedReason:p,plan:m,planSelectionPending:h=!1,onExitPlan:g,setupOutcome:_,onConfigureOpenPi:v,interaction:y,onPreferencesChanged:b,onSelectModel:x,onOpenRuntimeStatus:S,onClose:C}){let{t:w}=W(),T=f||!!p,E=(0,K.useRef)(null),D=(0,K.useRef)(null),[O,k]=(0,K.useState)(``),[A,j]=(0,K.useState)(r===`credentials`?`models`:r),[M,N]=(0,K.useState)(r===`credentials`||r===`models`),[P,F]=(0,K.useState)(!1),[I,ee]=(0,K.useState)(!1),[L,R]=(0,K.useState)(`general`),te=(0,K.useRef)(!1),z=(0,K.useRef)(!1),B=(0,K.useRef)(0),[ne,re]=(0,K.useState)(!1),V=(0,K.useRef)(!1),[ie,ae]=(0,K.useState)(!1),[oe,se]=(0,K.useState)(null),[ce,le]=(0,K.useState)(!1),[H,ue]=(0,K.useState)(!1),[fe,pe]=(0,K.useState)(null),me=H,he=(0,K.useRef)(void 0),ge=m!==void 0&&m!==`inactive`,_e=P||T||ge||h,ve=I&&L!==A||!I&&(A===`skills`||A===`plugins`||A===`web-search`)?void 0:!I||_?.requestId!==he.current?_:void 0,{catalog:ye,error:be,refresh:xe,updateSetup:Ce}=IW(e,a?`${a.provider}/${a.id}`:``,JSON.stringify(c)),we=ve!==void 0&&[`failed`,`cancelled`,`unconfirmed`].includes(ve.status);(0,K.useEffect)(()=>{E.current?.focus()},[]),(0,K.useEffect)(()=>{if(I){if(ve&&ve.status!==`pending`&&te.current){te.current=!1,z.current=!1,window.clearTimeout(B.current),xe(),b();return}if(T){z.current=!0;return}!z.current||!te.current||(te.current=!1,z.current=!1,window.clearTimeout(B.current),xe(),b())}},[b,xe,T,I,ve]),(0,K.useEffect)(()=>()=>window.clearTimeout(B.current),[]);let Te=async e=>{if(ae(!1),_e)return!1;he.current=_?.requestId,R(A),F(!0),ee(!1),te.current=!1,z.current=!1,window.clearTimeout(B.current),se(null);try{let t=await v(e);return t?(ee(!0),te.current=!0,B.current=window.setTimeout(()=>{!te.current||z.current||(te.current=!1,z.current=!1,xe(),b())},2e3)):se(w(`setupRequestFailed`)),t}catch(e){return F(!1),se(e instanceof Error?e.message:w(`setupRequestFailed`)),!1}finally{F(!1)}},Ee=async()=>{if(_e||!ye?.sessionPath)throw Error(w(`resourceReloadFailed`));F(!0);try{await new de().reloadSettingsResources(e,ye.sessionPath),xe(),b()}finally{F(!1)}},U=async e=>{if(V.current||!ye)return!1;V.current=!0,re(!0),ae(!1),se(null);try{let t=await new de().savePreferences(e);return Ce(t.setup),ae(!0),b(),!0}catch{return se(w(`settingsPreferencesSaveFailed`)),!1}finally{V.current=!1,re(!1)}},De=e=>{me||(j(e),k(``),e===`models`&&N(!0),se(null))};(0,K.useEffect)(()=>{let e=new URL(window.location.href);e.searchParams.set(`settings`,A),window.history.replaceState(window.history.state,``,e)},[A]);let Oe=XW.filter(({label:e,terms:t})=>[e,...t].some(e=>w(e).normalize(`NFKC`).toLocaleLowerCase().includes(O.trim().normalize(`NFKC`).toLocaleLowerCase()))),ke=(e,t=!1)=>{if(!me){if(ce&&!t){pe(e);return}pe(null),e.kind===`runtime`?S():C()}};return(0,q.jsxs)(Se,{isOpen:!0,purpose:`info`,padding:0,width:`calc(100vw - 32px)`,maxHeight:`calc(100dvh - 16px)`,className:`provider-settings-dialog`,"aria-label":w(`settings`),onOpenChange:e=>{!e&&!fe&&ke({kind:`close`})},children:[(0,q.jsxs)(`section`,{className:`provider-settings-surface`,children:[(0,q.jsxs)(`aside`,{className:`provider-settings-sidebar`,children:[(0,q.jsxs)(`header`,{className:`provider-settings-header`,children:[(0,q.jsx)(`strong`,{className:`provider-settings-title`,children:w(`settings`)}),(0,q.jsx)(`select`,{className:`provider-settings-mobile-picker`,"aria-label":w(`settingsNavigation`),disabled:me,value:A,onChange:e=>{let t=XW.find(({id:t})=>t===e.target.value);t&&De(t.id)},children:XW.map(({id:e,label:t})=>(0,q.jsx)(`option`,{value:e,children:w(t)},e))})]}),(0,q.jsxs)(`label`,{className:`provider-settings-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":w(`settingsSearch`),placeholder:w(`settingsSearch`),value:O,onChange:e=>k(e.target.value),disabled:me}),O&&(0,q.jsx)(`button`,{type:`button`,"aria-label":w(`settingsClearSearch`),onClick:()=>k(``),children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),(0,q.jsxs)(`div`,{className:`provider-settings-navigation`,ref:D,"aria-label":w(`settingsNavigation`),role:`tablist`,"aria-orientation":`vertical`,children:[[`settingsPersonal`,`settingsAgent`,`settingsIntegrations`].map(e=>(0,q.jsxs)(`div`,{className:`provider-settings-nav-group`,children:[Oe.some(t=>t.group===e)&&(0,q.jsx)(`p`,{children:w(e)}),Oe.filter(t=>t.group===e).map(({id:e,label:t,Icon:n})=>(0,q.jsxs)(`button`,{type:`button`,role:`tab`,disabled:me,id:`settings-tab-${e}`,tabIndex:A===e||!Oe.some(e=>e.id===A)&&Oe[0]?.id===e?0:-1,"aria-selected":A===e,"aria-controls":`settings-panel-${e}`,className:`provider-settings-tab`,title:w(t),onClick:()=>De(e),onKeyDown:t=>{if(t.altKey||t.ctrlKey||t.metaKey||t.nativeEvent.isComposing)return;let n=Oe.findIndex(t=>t.id===e),r=t.key===`Home`?0:t.key===`End`?Oe.length-1:t.key===`ArrowDown`||t.key===`ArrowRight`?(n+1)%Oe.length:t.key===`ArrowUp`||t.key===`ArrowLeft`?(n+Oe.length-1)%Oe.length:void 0;if(r===void 0)return;t.preventDefault();let i=Oe[r].id;De(i),D.current?.querySelector(`#settings-tab-${i}`)?.focus()},children:[(0,q.jsx)(n,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:w(t)})]},e))]},e)),Oe.length===0&&(0,q.jsx)(`p`,{className:`provider-settings-no-results`,role:`status`,children:w(`settingsNoResults`)})]}),(0,q.jsx)(`button`,{ref:E,type:`button`,className:`icon-button provider-settings-close`,"aria-label":w(`close`),disabled:me,title:w(me?`savingSettings`:`close`),onClick:()=>ke({kind:`close`}),children:(0,q.jsx)(je,{})})]}),(0,q.jsxs)(`div`,{className:`provider-settings-body`,children:[ge&&A!==`browser`&&(0,q.jsxs)(`div`,{className:`settings-plan-notice`,role:`status`,children:[(0,q.jsx)(`span`,{children:w(T?`setupPlanBusy`:`setupPlanBlocked`)}),(0,q.jsx)(Br,{label:w(`planModeExit`),variant:`secondary`,size:`sm`,isDisabled:T||h||!g,onClick:()=>void g?.()})]}),(0,q.jsxs)(`div`,{className:`provider-settings-main`,children:[(0,q.jsx)(`div`,{id:`settings-panel-configuration`,"aria-labelledby":`settings-tab-configuration`,"aria-label":w(`configurationSettings`),role:`tabpanel`,hidden:A!==`configuration`,children:A===`configuration`&&(0,q.jsx)(Aj,{catalog:ye,error:be,pending:_e||I&&L===`configuration`&&(!ve||ve.status===`pending`),preferencePending:ne,onConfigure:Te,onUpdatePreferences:U,onRefresh:xe,onOpenRuntimeStatus:()=>ke({kind:`runtime`})})}),(0,q.jsx)(`div`,{id:`settings-panel-appearance`,"aria-labelledby":`settings-tab-appearance`,"aria-label":w(`appearance`),role:`tabpanel`,hidden:A!==`appearance`,children:(0,q.jsx)(JW,{catalog:ye,theme:s,pending:ne,error:be,onRefresh:xe,onUpdatePreferences:U})}),(0,q.jsx)(`div`,{id:`settings-panel-archived-chats`,"aria-labelledby":`settings-tab-archived-chats`,"aria-label":w(`settingsArchivedChats`),role:`tabpanel`,hidden:A!==`archived-chats`,children:A===`archived-chats`&&(0,q.jsx)(YW,{workspaces:l,onRestore:u??(async()=>!1)})}),(0,q.jsx)(`div`,{id:`settings-panel-web-search`,"aria-labelledby":`settings-tab-web-search`,"aria-label":w(`webSearchSettings`),role:`tabpanel`,hidden:A!==`web-search`,children:A===`web-search`&&(0,q.jsx)(jj,{catalog:ye,error:be,pending:_e,onConfigure:Te,onRefresh:xe})}),(0,q.jsx)(`div`,{id:`settings-panel-browser`,"aria-labelledby":`settings-tab-browser`,"aria-label":w(`browserSettings`),role:`tabpanel`,hidden:A!==`browser`,children:A===`browser`&&(0,q.jsx)(Oj,{onConfigure:Te,setupPending:_e})}),(0,q.jsx)(`div`,{id:`settings-panel-general`,"aria-labelledby":`settings-tab-general`,"aria-label":w(`generalSettings`),role:`tabpanel`,hidden:A!==`general`,children:(0,q.jsx)(TW,{catalog:ye,error:be,currentModel:a,thinkingLevel:o,cwd:n,setupPending:P||T,preferencePending:ne||!ye,setupBusy:T,setupBlockedReason:p,setupBlocked:ge||h,onConfigure:Te,onUpdatePreferences:U,onOpenRuntimeStatus:()=>ke({kind:`runtime`}),onRefresh:xe})}),(0,q.jsx)(`section`,{id:`settings-panel-models`,"aria-labelledby":`settings-tab-models`,"aria-label":w(`modelSettings`),className:`settings-models`,role:`tabpanel`,hidden:A!==`models`,children:M&&(0,q.jsx)(oW,{sessionId:e,sessionPath:t,models:i,currentModel:a,busy:T,focusCredentials:r===`credentials`,onSaved:async()=>(xe(),b()),onSelectModel:x,onDraftChange:le,onSavingChange:ue},e)}),(0,q.jsx)(`div`,{id:`settings-panel-skills`,"aria-labelledby":`settings-tab-skills`,"aria-label":w(`skillsSettings`),role:`tabpanel`,hidden:A!==`skills`,children:(0,q.jsx)(jW,{catalog:ye,error:be,onRefresh:xe,setupPending:_e,onConfigure:Te,onReload:Ee},e)}),(0,q.jsx)(`div`,{id:`settings-panel-subagents`,"aria-labelledby":`settings-tab-subagents`,"aria-label":w(`subagentsSettings`),role:`tabpanel`,hidden:A!==`subagents`,children:(0,q.jsx)(MW,{catalog:ye,error:be,currentModel:a,models:i,activity:d?.subagents,setupPending:P||T,setupBlocked:ge||h,onConfigure:Te,onRefresh:xe})}),(0,q.jsx)(`div`,{id:`settings-panel-plugins`,"aria-labelledby":`settings-tab-plugins`,"aria-label":w(`pluginsSettings`),role:`tabpanel`,hidden:A!==`plugins`,children:(0,q.jsx)(FW,{catalog:ye,error:be,onRefresh:xe,setupPending:_e,onConfigure:Te,onReload:Ee},e)})]}),y,oe&&(0,q.jsx)(`div`,{className:`settings-global-error`,role:`alert`,children:oe}),(ne||ie)&&!oe&&!we&&(0,q.jsx)(`div`,{className:`settings-global-status`,role:`status`,children:w(ne?`savingSettings`:`settingsPreferencesSaved`)}),!ne&&(!ie||we)&&(I&&L===A||ve)&&!oe&&(0,q.jsxs)(`div`,{className:ve?.status===`failed`?`settings-global-error`:`settings-global-status`,role:ve?.status===`failed`?`alert`:`status`,children:[w(ve?(A===`skills`||A===`plugins`||A===`web-search`)&&[`unconfirmed`,`saved`,`unchanged`].includes(ve.status)?`resourceRequestFinished`:`setupOutcome_${ve.status}`:T?`setupRequestRunning`:A===`skills`||A===`plugins`||A===`web-search`?`resourceRequestSubmitted`:`setupRequestAccepted`),ve?.error&&(0,q.jsx)(`p`,{children:ve.error})]})]})]}),fe&&(0,q.jsx)(uj,{isOpen:!0,onOpenChange:e=>{e||pe(null)},title:w(`unsavedSettingsTitle`),description:w(`unsavedSettingsDetail`),cancelLabel:w(`keepEditing`),actionLabel:w(`discardAndContinue`),onAction:()=>ke(fe,!0)})]})}function $W({identity:e}){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;let n=t%6;return(0,q.jsx)(`span`,{className:`subagent-avatar tone-${n}`,"aria-hidden":`true`,children:(0,q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,children:[(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,q.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`}),(0,q.jsx)(`path`,{d:`M3 12h18M5 6.5c4 3 10 3 14 0M5 17.5c4-3 10-3 14 0`})]},`sphere`),(0,q.jsx)(`g`,{children:(0,q.jsx)(`path`,{d:`M4 20V4a16 16 0 0 1 16 16H4ZM4 4l16 16M4 9l11 11M4 14l6 6M10 5l-6 15M16 10L4 20`})},`fan`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`path`,{d:`m12 2 3 6 7-1-4 5 4 5-7-1-3 6-3-6-7 1 4-5-4-5 7 1Z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`})]},`rosette`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,q.jsx)(`path`,{d:`M3 12h18M12 3a9 9 0 0 0 0 18M12 6a6 6 0 0 0 0 12M12 9a3 3 0 0 0 0 6M12 3v18`})]},`arcs`),(0,q.jsx)(`g`,{children:(0,q.jsx)(`path`,{d:`m12 2 9 5v10l-9 5-9-5V7Zm0 0v20M3 7l18 10M21 7 3 17M3 7l9 5 9-5M3 17l9-5 9 5`})},`prism`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`path`,{d:`M12 12V2c6 0 10 4 10 10H12Zm0 0v10C6 22 2 18 2 12h10ZM12 12H2C2 6 6 2 12 2v10Zm0 0h10c0 6-4 10-10 10V12Z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2`,fill:`currentColor`})]},`windmill`)][n]})})}function eG(e,t,n,r){let i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(0),p=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(!n)return;let r=new AbortController;return p.current=r,c(!0),u(!1),i.sessionSources(e,t,r.signal).then(n=>{!r.signal.aborted&&n.sessionId===e&&n.path===t&&o(n)}).catch(()=>{r.signal.aborted||u(!0)}).finally(()=>{r.signal.aborted||(c(!1),p.current=null)}),()=>{r.abort(),p.current?.abort(),p.current=null}},[i,e,t,n,r,d]),{page:a?.sessionId===e&&a.path===t?a:null,loading:s,error:l,loadMore:async()=>{if(p.current||!a||a.nextOffset===void 0)return;let n=new AbortController;p.current=n,c(!0),u(!1);try{let r=await i.sessionSources(e,t,n.signal,a.nextOffset,a.revision);!n.signal.aborted&&r.sessionId===e&&r.path===t&&r.revision===a.revision&&o({...r,sources:[...a.sources,...r.sources]})}catch{n.signal.aborted||u(!0)}finally{n.signal.aborted||(c(!1),p.current=null)}},refresh:()=>f(e=>e+1)}}function tG({sessionId:e,path:t,source:n,thumbnail:r=!1,active:i=!0}){let{t:a}=W(),o=(0,K.useRef)(null),[s,c]=(0,K.useState)(!1),l=JSON.stringify([e,t,n.entryId,n.partIndex]),[u,d]=(0,K.useState)(null);(0,K.useEffect)(()=>{if(!r||!o.current||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(([e])=>c(!!e?.isIntersecting));return e.observe(o.current),()=>e.disconnect()},[r]),(0,K.useEffect)(()=>{if(!i||r&&!s){d(null);return}let a=new AbortController,o;return d({identity:l}),new de().sourceImage(e,t,n.entryId,n.partIndex,a.signal).then(e=>{if(a.signal.aborted)return;if(![`image/png`,`image/jpeg`,`image/gif`,`image/webp`].includes(e.mimeType)||e.data.length>xe)throw Error(`Invalid image`);let t=atob(e.data);if(t.length>10485760||btoa(t)!==e.data)throw Error(`Invalid image`);let n=Uint8Array.from(t,e=>e.charCodeAt(0));o=URL.createObjectURL(new Blob([n],{type:e.mimeType})),d({identity:l,url:o})}).catch(()=>{a.signal.aborted||d({identity:l,failed:!0})}),()=>{a.abort(),o&&URL.revokeObjectURL(o)}},[e,t,n.entryId,n.partIndex,l,i,r,s]);let f=i&&(!r||s)&&u?.identity===l?u:null;return(0,q.jsx)(`span`,{ref:o,className:`session-source-image`,"data-thumbnail":r||void 0,children:f?.url&&!f.failed?(0,q.jsx)(`img`,{src:f.url,draggable:!1,alt:r?``:n.name||a(`attachedImage`),onError:()=>d({identity:l,failed:!0})}):r?(0,q.jsx)(qs,{"aria-hidden":`true`}):(0,q.jsx)(`p`,{role:f?.failed?`alert`:`status`,children:a(f?.failed?`imagePreviewFailed`:`readingFile`)})})}function nG({source:e,sessionId:t,path:n,onOpen:r,thumbnail:i=!0,detailed:a=!1}){let{t:o}=W();return(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row session-source-row${a?` source-detail-row`:``}`,title:e.reference||e.name||o(`attachedImage`),onClick:r,children:[(0,q.jsx)(`span`,{className:`session-source-icon`,children:e.kind===`image`?i?(0,q.jsx)(tG,{sessionId:t,path:n,source:e,thumbnail:!0}):(0,q.jsx)(qs,{"aria-hidden":`true`}):(0,q.jsx)(Fs,{"aria-hidden":`true`})}),a?(0,q.jsxs)(`span`,{className:`session-source-copy`,children:[(0,q.jsx)(`strong`,{children:e.name||o(`attachedImage`)}),e.reference&&(0,q.jsx)(`span`,{className:`source-detail-reference`,children:e.reference}),(0,q.jsx)(`span`,{className:`source-detail-status`,children:o(`sourceAttached`)})]}):(0,q.jsx)(`span`,{children:e.name||o(`attachedImage`)})]})}function rG({sessionId:e,path:t,data:n,onSelect:r}){let{t:i}=W(),a=be(),o=(0,K.useRef)(null),s=(0,K.useRef)(a?.sources?.scroll??0);return(0,K.useLayoutEffect)(()=>{n.page?.sources.length&&o.current&&(o.current.scrollTop=s.current)},[n.page?.sources.length]),(0,q.jsxs)(`div`,{className:`session-sources-list`,ref:o,onScroll:e=>{s.current=e.currentTarget.scrollTop,a&&(a.sources={scroll:s.current})},children:[!n.loading&&!n.error&&!n.page?.sources.length&&(0,q.jsx)(`p`,{children:i(`sourcesEmpty`)}),n.page?.sources.map(n=>(0,q.jsx)(nG,{source:n,sessionId:e,path:t,onOpen:()=>r(n),detailed:!0},n.id)),n.error&&(0,q.jsxs)(`p`,{role:`alert`,children:[i(`sourcesFailed`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:n.refresh,children:i(`gitReviewRetry`)})]}),n.loading&&(0,q.jsx)(`p`,{role:`status`,children:i(`readingFile`)}),n.page?.nextOffset!==void 0&&(0,q.jsx)(`button`,{className:`sources-load-more`,type:`button`,disabled:n.loading,onClick:()=>void n.loadMore(),children:i(`sourcesLoadMore`)}),n.page?.truncated&&(0,q.jsx)(`p`,{children:i(`sourcesPartial`)})]})}function iG({sessionId:e,path:t,revision:n}){let{t:r}=W(),i=eG(e,t,!0,n),a=(0,K.useRef)(null);(0,K.useEffect)(()=>{let e=requestAnimationFrame(()=>a.current?.focus({preventScroll:!0}));return()=>cancelAnimationFrame(e)},[]);let o=(0,K.useContext)($E),[s,c]=(0,K.useState)(null),l=e=>{e?.kind===`file`&&e.reference?o?.open(e.reference,void 0,document.activeElement instanceof HTMLElement?document.activeElement:void 0):c(e)};return(0,q.jsxs)(`section`,{className:`session-sources-panel`,ref:a,tabIndex:-1,"aria-label":r(`sessionSources`),children:[(0,q.jsx)(rG,{sessionId:e,path:t,data:i,onSelect:l}),(0,q.jsx)(aG,{sessionId:e,path:t,open:!!s,source:s,data:i,onSelect:l,onClose:()=>c(null)})]})}function aG({sessionId:e,path:t,open:n,source:r,data:i,onSelect:a,onClose:o}){let{t:s}=W(),[c,l]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{r?.id,l(!1)},[e,t,r?.id]),(0,q.jsx)(Se,{isOpen:n,onOpenChange:e=>!e&&o(),purpose:`info`,width:800,maxHeight:`calc(100dvh - 32px)`,padding:0,"aria-label":s(`sessionSources`),children:n&&(0,q.jsxs)(`div`,{className:`session-sources-dialog draft-image-preview`,children:[(0,q.jsxs)(`header`,{children:[r&&i&&(0,q.jsx)(`button`,{type:`button`,"aria-label":s(`sourcesBack`),onClick:()=>a(null),children:(0,q.jsx)(Ko,{})}),(0,q.jsx)(`strong`,{title:r?.name,children:r?r.name||s(`attachedImage`):s(`sessionSources`)}),r&&(0,q.jsx)(`button`,{type:`button`,"aria-pressed":c,onClick:()=>l(e=>!e),children:s(c?`fitImage`:`originalImageSize`)}),(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,"aria-label":s(`close`),onClick:o,children:(0,q.jsx)(je,{})})]}),r?(0,q.jsx)(lO,{original:c,children:(0,q.jsx)(tG,{sessionId:e,path:t,source:r,active:n},JSON.stringify([e,t,r.id]))},JSON.stringify([e,t,r.id])):i?(0,q.jsx)(rG,{sessionId:e,path:t,data:i,onSelect:a}):null]})})}function oG({sessionId:e,workspace:t,agents:n,omitted:r,omittedWorkflows:i=0,review:a,onSubagents:o,onReview:s,onSources:c,sessionPath:l,revision:u,onAddSources:d,reviewLoading:f=!1,reviewError:p}){let{t:m}=W(),[h,g]=(0,K.useState)(!1),_=(0,K.useRef)(null),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!0),S=(0,K.useId)(),[C,w]=(0,K.useState)(null),T=eG(e,l??``,!!(l&&(h||v)),u),E=(0,K.useContext)($E),D=a?.ok?a.snapshot.totals:void 0,O=e=>{!e&&c?(y(!1),w(null),P(c)):e?.kind===`file`&&e.reference?(y(!1),P(()=>E?.open(e.reference,void 0,_.current??void 0))):P(()=>{w(e),y(!0)})},k=n.filter(e=>e.state===`running`),A=n.filter(e=>e.state===`done`),j=n.length-k.length-A.length,M=[...k,...n.filter(e=>e.state!==`running`)].slice(0,4),N=[k.length?m(`subagentSummaryRunning`,{count:k.length}):``,A.length?m(`subagentSummaryDone`,{count:A.length}):``,j?m(`subagentSummaryOther`,{count:j}):``].filter(Boolean).join(` · `)||m(`subagentNoneYet`),P=e=>{g(!1),_.current?.focus(),e()};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Zu,{isOpen:h,onOpenChange:g,placement:`below`,alignment:`end`,width:`min(340px, calc(100vw - 24px))`,label:m(`sessionOverview`),closeButtonLabel:m(`close`),isModal:!1,content:(0,q.jsxs)(`div`,{className:`session-overview`,children:[(0,q.jsx)(`p`,{className:`session-overview-title`,children:t}),(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row`,title:m(`sessionOverviewChanges`),onClick:()=>P(s),children:[(0,q.jsx)(Ms,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:m(`overviewChanges`)}),D&&!p?(0,q.jsxs)(`span`,{className:`session-overview-diff`,title:m(D.complete?`overviewLineTotals`:`overviewPartialTotals`),children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,D.additions.toLocaleString()]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,D.deletions.toLocaleString()]}),!D.complete&&(0,q.jsx)(`span`,{className:`session-overview-note`,children:m(`gitReviewPartialLabel`)})]}):(0,q.jsx)(`span`,{className:`session-overview-note`,children:m(f?`overviewCounting`:a?.ok?`overviewCountsUnknown`:`overviewReviewUnavailable`)})]}),(0,q.jsxs)(`div`,{className:`session-overview-section`,children:[(0,q.jsx)(`p`,{children:m(`subagentDetails`)}),(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row session-overview-agents`,onClick:()=>P(o),"aria-label":`${m(`subagentDetails`)}: ${N}`,children:[M.length>0&&(0,q.jsx)(`span`,{className:`subagent-avatar-stack`,children:M.map(t=>(0,q.jsx)($W,{identity:`${e}:${t.id}`},t.id))}),(0,q.jsx)(`span`,{className:`session-overview-agent-counts`,children:N.split(` · `).map(e=>(0,q.jsx)(`span`,{children:e},e))}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),r>0&&(0,q.jsx)(`small`,{children:m(`subagentListTruncated`,{count:r})}),i>0&&(0,q.jsx)(`small`,{children:m(`subagentWorkflowsTruncated`,{count:i})})]}),l&&(0,q.jsxs)(`div`,{className:`session-overview-section`,children:[(0,q.jsxs)(`div`,{className:`session-overview-section-heading`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`session-sources-toggle`,"aria-expanded":b,"aria-controls":S,onClick:()=>x(e=>!e),children:[(0,q.jsx)(`span`,{children:m(`sessionSources`)}),T.page&&(T.page.total!==void 0||T.page.nextOffset===void 0)&&(0,q.jsxs)(`span`,{children:[`· `,T.page.total??T.page.sources.length,T.page.truncated?`+`:``]}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),d&&(0,q.jsx)(V,{content:m(`sourcesAdd`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":m(`sourcesAdd`),onClick:()=>P(d),children:(0,q.jsx)(Ae,{})})})]}),(0,q.jsxs)(`div`,{id:S,hidden:!b,children:[T.page?.sources.slice(0,3).map(t=>(0,q.jsx)(nG,{source:t,sessionId:e,path:l,onOpen:()=>O(t)},t.id)),T.error?(0,q.jsxs)(`p`,{role:`alert`,children:[m(`sourcesFailed`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:T.refresh,children:m(`gitReviewRetry`)})]}):!T.page?.sources.length&&(0,q.jsx)(`p`,{children:m(T.loading?`readingFile`:`sourcesEmpty`)}),!!(T.page&&(T.page.sources.length>3||T.page.nextOffset!==void 0))&&(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row sources-view-all`,onClick:()=>O(null),children:[(0,q.jsx)(Qs,{}),(0,q.jsx)(`span`,{children:m(`sourcesViewAll`)}),(0,q.jsx)(os,{})]})]})]})]}),children:e=>(0,q.jsx)(V,{content:m(`sessionOverview`),placement:`below`,children:(0,q.jsx)(`button`,{...e,ref:t=>{e.ref(t),_.current=t},type:`button`,className:`task-tools-trigger`,"aria-label":m(`sessionOverview`),children:(0,q.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,q.jsx)(`circle`,{cx:`5.5`,cy:`7`,r:`2.8`}),(0,q.jsx)(`circle`,{cx:`5.5`,cy:`17`,r:`2.8`}),(0,q.jsx)(`path`,{d:`M12 7h8M12 17h8`})]})})})}),l&&(0,q.jsx)(aG,{sessionId:e,path:l,open:v,source:C,data:T,onSelect:O,onClose:()=>{y(!1),w(null)}})]})}function sG(e){return e<1e3?Math.round(e).toString():e<1e4?`${(e/1e3).toFixed(1)}k`:e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1)}M`}function cG(e){if(!e)return;let{input:t,output:n,cacheRead:r,cacheWrite:i}=e;if(t===0&&n===0&&r===0&&i===0)return;let a=t+r+i,o=r>0?` (${sG(r)} cached)`:``;return`${sG(a)} in${o} · ${sG(n)} out`}function lG(e,t,n){if([`session_start`,`session_switched`,`session_created`].includes(t))return e.length===0?e:[];if([`agent_settled`,`turn_settled`].includes(t))return e.some(e=>e.state===`running`)?e.map(e=>e.state===`running`?{...e,state:`unknown`}:e):e;if(!t.startsWith(`tool_execution_`))return e;let r=n.toolCallId;if(typeof r!=`string`||r.length>500)return e;let i=e.find(e=>e.call.id===r);if(i&&i.state!==`running`&&(i.state!==`unknown`||t!==`tool_execution_end`))return e;let a=dd(n.call),o=a.type===`toolCall`&&typeof a.name==`string`&&typeof a.arguments==`string`?a:i?.call;if(!o||o.evidenceTruncated&&o.id?.includes(`[truncated]`))return e;let s=dd(n.result),c=typeof s.content==`string`?s:i?.result,l=typeof n.parentToolCallId==`string`&&n.parentToolCallId.length<=500?n.parentToolCallId:i?.parentToolCallId,u={call:o,result:c,...l?{parentToolCallId:l}:{},state:t===`tool_execution_end`?n.isError===!0?`failed`:`returned`:`running`},d=(i?e.map(e=>e.call.id===r?u:e):[...e,u]).slice(-32);for(;d.length>0&&new TextEncoder().encode(JSON.stringify(d)).byteLength>524288;)d.shift();return d}var uG={en:{translation:{quitOpenPI:`Quit OpenPI`,quittingOpenPI:`Quitting…`,quitConfirmHelp:`Quit this OpenPI Web application? All running tasks in this Web application will stop. Conversations are saved and will be available when you restart.`,quitTabHelp:`Closing this browser tab alone leaves OpenPI and its tasks running in the background.`,quitAccepted:`OpenPI is shutting down`,quitAcceptedHelp:`The quit request was accepted. Wait for the terminal to confirm that OpenPI has stopped, then you can close this tab.`,quitRestartHelp:`To restart, run openpi web in a terminal, or /web in Pi, then open the address it displays. Refreshing this page does not restart OpenPI.`,quitFailed:`Could not confirm shutdown. Check the terminal before trying again. You can also stop OpenPI with Ctrl+C in its terminal.`,promptPending:`Processing your request…`,commandFeedbackTruncated:`This is a limited command preview. Narrow the query or run it in the TUI for the full output.`,planMode_inactive:`Normal mode`,planMode_planning:`Planning · writes blocked`,planMode_ready:`Plan ready · awaiting review`,planMode_invalid:`Plan state invalid · writes blocked`,planModeEnter:`Plan`,promptPlanMessage:`This conversation uses Plan mode · discuss the plan; no implementation yet`,planModeUnconfirmed:`Could not confirm Plan mode. Refresh before continuing.`,planModeExit:`Exit planning`,planModeImplement:`Prepare implementation prompt`,planImplementationReplaceDraft:`Preparing this plan will replace the current draft and turn off Plan mode. The prompt will not be sent. Continue?`,commandSupport_plan:`Planning and same-session implementation prompts are available. Starting a fresh implementation session still requires the TUI.`,commandSupport_setup:`Configuration uses the active model; questions are answered in Web.`,handoffWaiting:`Manual action`,handoffDone:`Done`,handoffUnable:`Unable to complete`,handoffDoneHelp:`I performed the action. The agent still needs to verify it.`,handoffUnableHelp:`I could not finish. I can add a note about the blocker.`,handoffReview:`Review status`,handoffSubmit:`Submit status`,handoffSignal:`Expected result:`,handoffVerify:`Reporting Done lets the agent continue and verify; it is not proof of success.`,planCardLabel:`Development plan`,planCardReady:`Plan ready`,planCardResult:`Plan result`,planCardNotApproval:`This step produced a plan. It did not approve or start implementation.`,planCardCollapse:`Collapse`,planCardExpand:`Expand`,planCardCopy:`Copy plan`,planCardCopyPreview:`Copy visible preview`,planCardTruncated:`Only a bounded preview is displayed.`,planCardLoadFull:`Load full plan`,planCardLoadingFull:`Loading plan...`,planCardLoadFailed:`Could not load the full plan. Retry`,planCardEvidence:`Tool result · plan_ready`,questionWaiting:`Question`,questionPreview:`View preview`,questionSkip:`Skip`,questionProgress:`{{current}} of {{total}}`,questionReview:`Review answers`,questionReviewTitle:`Ready to send?`,questionReviewHelp:`Review your choices. Nothing is sent until you submit.`,questionEdit:`Edit answer: {{question}}`,questionDismiss:`Dismiss questions without answering`,questionCustom:`Or write your own reply`,questionCustomHelp:`Or leave it blank to ask for a clearer question.`,questionYourAnswer:`Your answer`,questionCustomPlaceholder:`Describe what you have in mind…`,questionNotes:`Additional context (optional)`,questionNotesPlaceholder:`Add a constraint or clarify your choice…`,questionRephrase:`Ask for a clearer or smaller question`,questionBack:`Back`,questionNext:`Next question`,questionSubmit:`Submit answers`,questionSubmitting:`Sending…`,questionRetry:`Check submission`,questionUncertain:`We could not confirm delivery. Your submitted answers are kept here. Check submission to recover the result without sending them twice.`,questionDisconnected:`Reconnecting… Your choices stay here; submitting is paused.`,questionLimit:`Keep each answer or note within {{count}} UTF-8 bytes.`,questionLoadFailed:`Could not check for questions awaiting your answer.`,questionDraftLimit:`Question drafts are full. Shorten or clear an existing answer before adding more text.`,questionRetryLoad:`Try again`,questionCloseReceipt:`Close question status`,questionState_dismissed:`Questions dismissed. No answers were submitted.`,questionState_cancelled:`Questions cancelled. No answers were submitted.`,questionState_expired:`Questions expired. No answers were submitted.`,questionState_stale:`This request is no longer active. Check the conversation for its result.`,conversationView:`Conversation view`,jumpToLatest:`Jump to latest`,historyLoading:`Loading history…`,historyOmitted:`{{count}} earlier entries · Scroll up to load automatically`,historyChanged:`The Session branch changed. History has been reset to the current branch.`,historyUnavailable:`Could not load history. Please retry.`,historyValidationUnavailable:`Could not verify the conversation history. Please retry.`,historyVerifying:`Checking conversation history…`,messageLoadFull:`Load full message`,messageLoadMore:`Load more`,messageLoadingFull:`Loading message…`,messageLoadFailed:`Could not load this message. Retry`,filePreview:`File preview`,changeEvidence:`Changes`,changeEvidenceScope:`Read-only Git snapshot of changes since this session started.`,turnLabel:`Turn {{number}}`,turnState_running:`Running`,turnState_complete:`Completed`,turnState_failed:`Failed`,turnState_interrupted:`Interrupted`,turnState_waiting:`Waiting for response`,turnState_forked:`Forked · Ready to continue`,turnChanges_one:`{{count}} file changed during this turn`,turnChanges_other:`{{count}} files changed during this turn`,turnChangesPartial:`At least {{count}} files changed during this turn`,turnChangesIncomplete:`This turn's change record is incomplete.`,turnChangesMore:`Show {{count}} more files`,turnChangesLess:`Show fewer files`,turnChangesReview:`Review turn changes`,turnChangesReviewButton:`Review`,turnChangesBack:`Back to turn changes`,turnChangesLoading:`Loading this turn's changes…`,turnChangesUnavailable:`This turn's saved diff is unavailable.`,messageCopyRequiresFull:`Load the full message before copying.`,filesChanged_one:`{{count}} file changed`,filesChanged_other:`{{count}} files changed`,reviewChanges:`Review changes`,workspaceChanges:`Workspace changes`,overviewChanges:`Changes`,overviewLineTotals:`Text lines added and removed across the current Git comparison`,overviewPartialTotals:`Known line counts only; some files could not be counted. Open Changes for details.`,overviewCounting:`Counting…`,overviewCountsUnknown:`Counts unavailable`,overviewReviewUnavailable:`Unavailable`,sessionSources:`Sources`,sourcesAdd:`Add source`,sourcesDescription:`Browse this conversation's attached images and files`,sourceAttached:`Attached to this conversation`,sourcesEmpty:`No sources yet`,sourcesFailed:`Could not load sources.`,sourcesViewAll:`View all`,sourcesLoadMore:`Load more sources`,sourcesBack:`Back to sources`,sourcesPartial:`This list has reached its display limit. Earlier sources remain in the conversation.`,turnChangesScope:`Saved workspace changes during this turn`,turnEdits_one:`Edited {{count}} file`,turnEdits_other:`Edited {{count}} files`,turnEditsPartial:`Recorded edits to {{count}} files`,turnEditsScope:`This turn's recorded file-tool writes · saved; shell and external edits are not included`,turnEditStatsUnknown:`Line counts unavailable`,turnEditReason_before_unavailable:`The write completed, but previous contents were not authorized for reading. A before/after diff is unavailable.`,turnEditReason_content_limit:`The write completed. Content exceeds the saved comparison limit, so exact line counts are unavailable.`,turnEditReason_concurrent_change:`The file changed between recorded operations. A reliable net diff for this turn is unavailable.`,gitReviewLoadedCount:`{{count}} files loaded`,gitReviewPartialLabel:`Partial`,gitReviewSearch:`Search file paths`,gitReviewExpand:`Expand review`,gitReviewSearchLoaded:`Search loaded files`,gitReviewMarkViewed:`Mark {{path}} as viewed`,gitReviewMarkCurrentViewed:`Mark current file {{path}} as viewed`,gitReviewViewedLabel:`Viewed`,gitReviewViewedProgress:`Viewed {{viewed}} / {{loaded}} loaded files`,gitReviewViewedLimit:`Up to {{count}} viewed marks are remembered for this comparison.`,gitReviewNoMatch:`No matching files.`,gitReviewNoLoadedMatch:`No matches in the loaded files.`,gitReviewLoadNext:`Load the next files`,gitReviewChanged:`The workspace changed. Refresh the list before loading more.`,gitReviewNewVersion:`New changes are available. You are reading the previous version.`,gitReviewShowLatest:`Show latest diff`,gitReviewBinary:`No text diff is available for this binary file.`,gitReviewBinaryShort:`Binary`,gitReviewPendingStats:`Not loaded`,gitReviewComparison:`{{current}} compared with {{base}}`,gitReviewWorkingTree:`Working tree compared with HEAD`,gitReviewSessionSnapshot:`Changes since this session started`,gitReviewDetached:`Detached HEAD`,gitReviewLoading:`Reading Git changes…`,gitReviewRetry:`Retry`,gitReviewRefresh:`Refresh changes`,gitReviewOlderResult:`Showing the previous result.`,gitReviewNotRepository:`This workspace is not a Git repository.`,gitReviewUnborn:`This repository has no readable HEAD yet.`,gitReviewFailed:`Git changes could not be read.`,gitReviewTruncated:`The change snapshot reached its file or diff size limit.`,gitReviewEmpty:`No changes in this comparison.`,gitReviewHiddenLines:`{{count}} more diff lines hidden.`,gitReviewDiffTruncated:`This file's diff was not loaded because the snapshot reached its size limit.`,gitReviewShowMore:`Show {{count}} more files`,gitReviewBackToFiles:`Back to changed files`,gitReviewFilePreview:`Diff for {{file}}`,gitReviewNoDiff:`No text diff is available for this file.`,changeDiff:`Change diff`,diffViewMode:`Diff view`,diffUnified:`Unified`,diffSplit:`Side by side`,diffBefore:`Before`,diffAfter:`After`,diffView:`Diff`,gitFileStatus_added:`Added`,gitFileStatus_modified:`Modified`,gitFileStatus_deleted:`Deleted`,gitFileStatus_renamed:`Renamed`,gitFileStatus_copied:`Copied`,gitFileStatus_untracked:`Untracked`,gitFileStatus_unknown:`Changed`,closePreview:`Close preview`,imageZoom:`Image zoom`,imageZoomHelp:`Zoom is relative to Fit. Use Ctrl + wheel to zoom, then drag to pan.`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,previousImage:`Previous image`,nextImage:`Next image`,imagePosition:`Image {{current}} of {{total}}`,artifactReadOnly:`Read-only`,artifactReferenceUnavailable:`File preview is unavailable in this view: {{path}}`,artifactSession:`Session {{sessionId}}`,copyFilePath:`Copy file path`,filePathCopied:`File path copied`,refreshFile:`Refresh file`,downloadFile:`Download file`,downloadingFile:`Downloading…`,artifactOlderPreview:`Showing an older preview. `,readingFile:`Reading file…`,artifactVersion:`Version`,artifactBytes:`{{count}} bytes`,artifactPreviewTruncated:`Preview truncated. Download the file for the complete content.`,artifactUnsupported:`This file type cannot be previewed. Use Download.`,filesLargeMarkdownSource:`This Markdown preview is large, so it is shown as source to keep scrolling responsive. All loaded text is included.`,chatView:`Chat`,trajectory:`Trajectory`,trajectoryScope:`Recorded Session messages in order, not execution durations or the complete model request.`,trajectoryRunning:`Work is active. This view updates as saved records arrive; in-flight text is available in Chat.`,trajectoryTruncated:`Loaded history is partial: {{entries}} entries omitted, {{parts}} parts omitted, {{messages}} messages truncated.`,trajectoryEmpty:`No saved records yet.`,trajectoryOrder:`Record order`,trajectoryOverview:`Overview`,trajectorySequenceHint:`Record order · widths are not elapsed time`,trajectoryClearRange:`Clear selection`,trajectoryContextLane:`Context`,trajectoryModelLane:`Model`,trajectoryToolLane:`Tools`,trajectorySelectRecord:`Select record {{number}}: {{name}}`,trajectoryTimingTab:`Timing`,trajectoryUsageTab:`Usage`,trajectoryDurationLabel:`Duration`,trajectoryTimingSource:`Source`,trajectoryTimingUnknown:`No execution duration was recorded. Record timestamps are not operation start times.`,trajectoryTimingNative:`Pi nested tool execution`,trajectoryTTFT:`Time to first output`,trajectoryGenerationTime:`Generation time`,trajectoryThroughput:`Output tokens / second`,trajectoryNotRecorded:`Not recorded`,trajectoryUsageUnknown:`This response has no reported token usage in the loaded records.`,trajectoryUsage_input:`Uncached input`,trajectoryUsage_cacheRead:`Cache read`,trajectoryUsage_cacheWrite:`Cache write`,trajectoryUsage_output:`Output`,trajectoryProvider:`Provider`,trajectoryModel:`Model`,trajectoryCode:`Code`,trajectoryWrap:`Wrap lines`,trajectoryCopy:`Copy source`,trajectoryCopied:`Copied`,trajectoryRawArguments:`Original JSON`,trajectoryFoldTurns:`Turns`,trajectoryFoldCalls:`Calls`,trajectoryMetrics:`Loaded execution summary`,trajectoryRequestCount:`{{count}} model responses`,trajectoryToolCount:`{{count}} tool calls`,trajectoryModelResponses:`Model responses`,trajectoryToolCalls:`Tool calls`,trajectoryLastTurn:`Latest recorded turn`,trajectoryEventColumn:`Event`,trajectoryContentColumn:`Content`,trajectoryTurn:`Turn {{number}}`,trajectoryLoadHistory:`Load earlier history`,trajectoryLatestRecords:`Jump to latest records`,trajectoryHistoryLoading:`Loading history…`,trajectoryNestedOutputMissing:`Pi recorded this nested call's status, but did not persist its result body. The outer script's output is separate.`,trajectoryRecordCount:`{{count}} records`,trajectoryMatches:`{{count}} matches`,trajectorySearch:`Search loaded records`,trajectoryNoMatches:`No matching records.`,trajectoryEarlierGroup:`Earlier context`,trajectoryEventCount:`{{count}} Session changes`,trajectorySummary:`Overview`,trajectoryInputTab:`Input`,trajectoryResultTab:`Result`,trajectoryConversationGroup:`Conversation`,trajectoryReasoningTitle:`Thinking`,trajectoryRecordNumber:`Record {{number}}`,trajectoryRecordInfo:`Record information`,trajectoryRecordId:`Record ID`,trajectoryCallId:`Tool call ID`,trajectoryEventType:`Event type`,trajectoryEvent_model_change:`Model changed`,trajectoryEvent_thinking_level_change:`Thinking level changed`,trajectoryEvent_compaction:`Context compacted`,trajectoryEvent_session_info:`Session information updated`,trajectoryEvent_custom:`Session record`,trajectoryEarlier:`Show earlier records ({{count}} remaining in loaded history)`,trajectoryDetails:`Record details`,trajectoryRecordedAt:`Record timestamp`,trajectoryEvidenceTruncated:`This evidence was truncated in the Session projection.`,trajectoryArguments:`Tool arguments`,trajectoryRecordedContent:`Recorded content`,trajectoryThinking:`Recorded model reasoning`,trajectoryOutput:`Tool result`,trajectoryMissingResult:`No unambiguous result is included in the loaded records. This does not imply the tool is still running.`,trajectoryStructured:`Structured result`,trajectoryEventOnly:`Only this event’s type and timestamp are available.`,trajectory_user:`User message`,trajectory_assistant:`Assistant`,trajectory_call:`Tool call`,trajectory_result:`Unpaired result`,trajectory_event:`Session event`,trajectoryRole_user:`User`,trajectoryRole_assistant:`Assistant`,trajectoryRole_call:`Tool`,trajectoryRole_result:`Result`,trajectoryRole_event:`Event`,trajectory_returned:`Tool returned a result.`,trajectory_error:`Tool returned an error`,trajectory_unknown:`Outcome not established`,runtimeStatus:`Runtime status`,runtimeIdentity:`OpenPI runtime information`,runtimeIdentityHint:`Backend information was captured at startup. It does not track later disk changes or Session reloads, and is not proof of every loaded module. Frontend identity describes this page build.`,runtimeIdentityFailed:`Could not read backend runtime information. Try again.`,runtimeBackendVersion:`Backend package version`,runtimePackageRoot:`Backend package directory`,runtimeStartedAt:`Process started`,runtimeGitRevision:`Git revision at startup`,runtimeGitState:`Working tree at startup`,runtimeGitDirty:`Local changes present`,runtimeGitClean:`Clean`,runtimeFrontendVersion:`Page package version`,runtimeFrontendBuild:`Page build ID`,runtimeStartupBuild:`Page build ID recorded at startup`,runtimeDevelopmentBuild:`Development server (no production build ID)`,runtimeBuildMismatch:`This page build differs from the build recorded when the backend started. Refresh the page or restart the service, then check again.`,refreshStatus:`Refresh status`,openTools:`Open tools`,openToolsUnavailable:`Select a chat to open tools`,sideConversation:`Side conversation`,sideConversationDescription:`Ask a focused question in a separate Pi session without interrupting the main task.`,workbarChangesDescription:`Inspect the current Git branch and working tree.`,terminal:`Terminal`,renameTerminal:`Rename terminal`,terminalName:`Terminal name`,workbarTerminalDescription:`Open an interactive shell for the current workspace.`,restartTerminal:`Restart terminal`,reconnectTerminal:`Reconnect terminal`,restartTerminalTitle:`Restart this terminal?`,restartTerminalDetail:`The current terminal will be closed. Running processes may be interrupted.`,terminalReconnecting:`Reconnecting terminal...`,terminalScrollToBottom:`Scroll to bottom`,terminalOutputResynced:`Terminal output resynchronized.`,terminalRestarting:`Restarting terminal...`,terminalConnecting:`Starting terminal…`,terminalExited:`Terminal exited.`,terminalExitCode:`Terminal exited with code {{code}}.`,terminalDisconnected:`Terminal connection ended unexpectedly.`,terminalError:`Terminal unavailable.`,terminalLoadError:`The terminal interface could not load. Refresh the page to try again.`,reloadPage:`Refresh page`,browser:`Browser`,sessionFileRecords:`Session file records`,gitReviewSource:`Changes`,gitReviewBaseBranch:`Compare against branch`,gitReviewChooseBase:`Choose comparison branch`,gitReviewSearchBranches:`Search branches`,gitReviewLocalBranch:`Local branch`,gitReviewRemoteBranch:`Remote branch`,gitReviewBranchesTruncated:`Showing a bounded list of branches. Some branches are omitted.`,gitReviewNoMatchingBranches:`No matching branches.`,gitReviewBaseUnavailable:`No default comparison branch is available. Choose a branch to review committed changes.`,gitReviewBaseInvalid:`The selected comparison branch is unavailable. Choose another branch.`,gitReviewUnstaged:`Unstaged changes`,gitReviewStaged:`Staged changes`,gitReviewBranch:`Branch changes`,gitReviewFileMissing:`This file no longer has changes in this view. Refresh the file list.`,artifactExternalAccess:`This file is in another working directory. You can authorize read-only access to this file for this session; other files remain inaccessible.`,artifactAuthorizeFile:`Open this file read-only`,sideConversationPending:`Preparing side conversation…`,resizeSidebar:`Resize sidebar`,resizePanes:`Resize panes`,resizeWorkbar:`Resize workbar`,browserPasteTooLarge:`Paste at most {{count}} characters at a time.`,browserInputTooLarge:`Enter at most {{count}} characters at a time.`,browserInputTargetChanged:`The input target changed or could not be confirmed. An input operation was not executed.`,workbarBrowserDescription:`Open and interact with a page inside the OpenPI workbar.`,browserReady:`Enter an address to start browsing`,browserStarting:`Starting the embedded browser…`,browserOpened:`Opened in the embedded browser`,browserOpenAgain:`Open again`,browserOpenFailed:`The embedded browser is unavailable.`,browserBack:`Back`,browserForward:`Forward`,browserReload:`Reload`,browserTabs:`Browser tabs`,browserNewTab:`New tab`,browserAddTab:`New browser tab`,browserCloseTab:`Close {{title}}`,browserTabLimit:`Up to {{count}} browser tabs`,browserPageTitle:`Web page: {{address}}`,browserEnteredAddress:`Last address opened from this toolbar`,browserAddressNotAllowed:`Enter an HTTP(S) address without embedded credentials, outside this application's origin.`,browserLocationUnknown:`This page navigated. Its new address is unavailable. Reload returns to the address you entered.`,browserDirectDescription:`Browse pages directly. Sites that refuse embedding can be opened in your external browser.`,browserDirectHint:`The address records toolbar navigation only. Page popups open in your external browser. Blank page? Use Open in external browser.`,browserEnhancedHint:`Browser enhancement is on: addresses sync and ordinary popup links open in these tabs. Some site policies, login popups and cross-site history still require an external browser.`,files:`Files`,filesExplorer:`Workspace files`,filesSearch:`Filter files…`,refreshFiles:`Refresh files`,filesWorkspaceActions:`Workspace file actions`,filesCreateMenu:`New`,filesImportMenu:`Import`,filesMoreMenu:`More`,filesNewFile:`New file`,filesNewDirectory:`New folder`,filesImport:`Import files`,filesImportFolder:`Import folder`,filesImportFolderChoose:`Choose a folder to import`,filesImportFolderLimit:`Import up to 2,000 files and folders at a time, with at most 64 nested levels.`,filesSelectMultiple:`Select multiple files`,filesSelectItem:`Select {{name}}`,filesSelectedCount:`{{count}} selected`,filesRename:`Rename`,filesNewName:`New name`,filesMove:`Move`,filesMoveDestination:`Destination folder (workspace relative path)`,filesTrashAction:`Move to trash`,filesTrash:`Workspace trash`,filesTrashDetail:`Removed files stay in this workspace and can be restored. Existing names are preserved.`,filesTrashEmpty:`No removed files`,filesTrashUnavailable:`{{count}} entries could not be verified. Their contents remain in .openpi-trash; automatic restore is unavailable.`,filesRestore:`Restore`,filesRestoreItem:`Restore {{name}}`,filesUndoTrash:`Undo removal`,filesOrganizationResults:`File operation results`,filesOperationDone:`Done`,filesRefreshBeforeOrganizing:`Refresh the file tree before organizing this item.`,filesImportChoose:`Choose files to import`,filesTargetDirectory:`Destination`,filesWorkspaceRoot:`Workspace root`,filesFileName:`File name`,filesDirectoryName:`Folder name`,filesCreate:`Create`,filesCreating:`Creating…`,filesCreated:`Created: {{path}}`,filesNameInvalid:`Enter one file or folder name without path separators.`,filesNameExists:`This name already exists. Choose a different name; the existing file was preserved.`,filesMutationFailed:`Could not write this file. Your input is preserved.`,filesWriteUnavailable:`Switch to this session to write workspace files.`,filesImportLimit:`Each file can be up to 50 MiB. Existing names are never overwritten.`,filesImportTooLarge:`This file exceeds the 50 MiB import limit.`,filesImportDirectoryUnsupported:`Folders cannot be imported. Choose the files inside the folder.`,filesImportResults:`File import results`,filesImportPending:`Waiting to import`,filesImporting:`Importing…`,filesImported:`Saved to the workspace`,filesImportedNoPreview:`Saved. Preview supports up to 20 MiB; copy the path to use this file in chat.`,filesClearImported:`Clear completed imports`,filesRetryImport:`Retry import`,filesPathActions:`Path actions for {{name}}`,filesCopyRelativePath:`Copy relative path`,filesCopyAbsolutePath:`Copy absolute path`,filesPathCopied:`Copied path: {{path}}`,filesReadFailed:`Unable to read files.`,filesRetryRead:`Try again`,filesErrorDetails:`Error details`,filesReadFailedDetail:`The file list could not be loaded. Check your connection and try again.`,filesReadDenied:`This session's workspace is currently unavailable or cannot be verified. Check the session and workspace, then try again.`,filesSymlink:`Symbolic link — not followed by the file browser`,filesTruncated:`The result is incomplete. Refine your search.`,filesNoMatches:`No matching files`,filesEmpty:`This folder is empty`,filesChoose:`Choose a file to preview`,filesChooseDetail:`Browse your workspace on the right. Files open here, keeping the explorer in place.`,filesHideTree:`Hide file tree`,filesShowTree:`Show file tree`,filesPreview:`Preview`,filesSource:`View source`,filesEdit:`Edit`,filesMode:`File view`,filesEditor:`File editor`,filesSave:`Save file`,filesSaving:`Saving…`,filesSaved:`Saved`,filesUnsaved:`Unsaved changes · draft kept in this window`,filesDiscard:`Discard draft`,filesDiscardConfirm:`Discard your unsaved changes to this file?`,filesSaveConflict:`The file changed on disk. Your draft is preserved. Refresh to inspect the current version, then reconcile your changes before saving.`,filesSaveFailed:`Could not save. Your draft is preserved; check the file and retry.`,filesEditLoadFirst:`Continue reading the complete file before editing.`,filesEditUnavailable:`Editing supports workspace UTF-8 text files up to 1 MiB. At most 16 unsaved drafts can be kept.`,filesOutline:`Document outline`,filesDiskVersion:`Inspect current disk version`,filesReconcile:`Reviewed · continue editing my draft against this version`,filesTable:`Table preview`,filesRow:`Row`,filesSheets:`Worksheets`,filesTableTruncated:`Showing a partial table preview. Download the original file for complete content.`,filesOfficeLayout:`Document content preview; pagination and typography may differ from Office.`,filesSlidesLayout:`Slide text and images; themes, charts and animations may differ from PowerPoint.`,filesPreviousPage:`Previous page`,filesNextPage:`Next page`,filesZoomOut:`Zoom out`,filesZoomIn:`Zoom in`,filesZoomReset:`Reset zoom`,filesPdfPage:`Page {{page}}`,filesDocumentLimit:`This document exceeds the preview limit. Download it to open locally.`,filesPreviewFailed:`Unable to preview this file. You can still download it.`,filesDiagram:`Mermaid diagram`,filesDiagramLoadError:`Unable to load diagram preview. The source is shown below. Refresh the page to try again.`,filesExpandDiagram:`Expand diagram`,filesFitImage:`Fit`,filesOriginalImage:`Original size`,filesLoadMore:`Load more`,filesLoaded:`{{count}} items loaded`,filesReadMore:`Continue reading`,filesContentChanged:`The file changed. Refresh when ready; your current reading position is preserved.`,workbarFilesDescription:`Browse workspace files with an inline preview and file tree.`,backToSideConversations:`Back to side conversations`,continueSideConversation:`Send a follow-up…`,startSideConversation:`Ask a side question…`,sideConversationModelInherited:`New side conversations use the main conversation’s model and thinking level.`,sideConversationModelFixed:`This is the model used by this side conversation.`,stop:`Stop`,start:`Start`,browserAddress:`Browser address`,browserGo:`Open address`,openExternalBrowser:`Open in external browser`,invalidBrowserAddress:`Enter a valid HTTP or HTTPS address.`,addImages:`Add images`,addFiles:`Add files`,fileAttachments:`File attachments`,previewFileAttachment:`Preview file`,fileAttachmentDescription:`Documents, spreadsheets, PDFs, text, code, and other files`,fileAttachmentCount:`Attach up to {{count}} items.`,fileAttachmentTooLarge:`Files must total 50 MB or less.`,fileAttachmentReadFailed:`Could not read this file. Check the format or whether it is password protected.`,fileAttachmentTextReady:`Text ready`,fileAttachmentTextTruncated:`Partial text · original retained`,fileAttachmentOriginalReady:`Original file ready`,fileAttachmentExtractionFailed:`Text unavailable · original retained`,fileAttachmentEncodingUnavailable:`The text encoding could not be read. The original bytes are preserved.`,fileAttachmentDocumentUnavailable:`Text could not be extracted. The document may be password protected or have an unsupported format. The original bytes are preserved.`,fileAttachmentNoText:`The original file will be attached for the agent to read with its tools. No text was extracted.`,fileAttachmentPreviewTruncated:`Preview shows the first 20,000 characters. The complete extracted text will be attached.`,fileAttachmentExtractedContent:`Extracted text`,fileAttachmentPromptLabel:`User-provided files:`,fileAttachmentPromptTooLong:`The message and file references exceed the input limit. Shorten the message or attach fewer files.`,imageAttachmentDescription:`PNG, JPEG, GIF, or WebP`,imageAttachments:`Image attachments`,imageAttachmentsLoading:`Preparing attachments…`,commandOpensPanel:`Open panel`,commandPanelArguments:`This command opens a panel and cannot include arguments or images. Remove them, or use the panel directly.`,commandPanelUnavailable:`The panel could not be opened. Your command is preserved.`,commandUnavailable_terminal_only:`Requires Pi's terminal interface.`,commandUnavailable_not_integrated:`This extension command is not connected to Web yet. Use it in Pi's terminal.`,artifactImagePreviewFailed:`Unable to preview this image. Refresh the file to retry, or download it.`,artifactFileDetails:`File details`,turnElapsedRunning:`Working for {{duration}}`,compactionElapsed:`Waiting {{duration}}`,compactionRunning:`Compacting context`,compactionCompleted:`Context automatically compacted`,compactionFailed:`Context compaction failed`,compactionInterrupted:`Compaction interrupted`,compactionUnchanged:`Compaction finished without a new summary`,compactionUnavailable:`Context compaction status unavailable`,compactionReconnectHelp:`Connection interrupted. The current status will be checked after reconnecting.`,compactionDraftHelp:`Compacting history. Messages you send will be queued.`,turnElapsedFinished:`Worked for {{duration}}`,composerAdd:`Add`,composerCommands:`Commands`,composerFile:`File`,composerPlan:`Plan`,composerCompact:`Compact`,composerModel:`Model`,composerBack:`Back`,composerPlanDescription:`Enter or leave Plan mode`,composerCompactDescription:`Summarize earlier conversation history`,composerModelDescription:`Select this Session's model`,compactionQueueWaiting:`Waiting for compaction to finish`,compactionQueueBlocked:`Messages retained. Retry when ready or clear the queue.`,clearPromptQueue:`Clear queue`,queueUpdateFailed:`Could not update the queue. Check the current session and try again.`,queueStatusUnconfirmed:`The request was received, but the latest queue state could not be verified. Refresh before trying again.`,turnElapsedOutcome_cancelled:`Stopped`,turnElapsedOutcome_failed:`Failed`,turnElapsedOutcome_uncertain:`Outcome unconfirmed`,settingsSetupBusyHint:`Agent configuration is available after this turn. Display settings can be changed now.`,resetChatContentWidth:`Reset chat content width`,resetChatFontSize:`Reset chat font size`,setupResolveAdmission:`Return to the conversation to resolve the pending message before applying settings.`,removeAttachment:`Remove attachment`,dropImagesHere:`Drop files or images here`,imageAttachmentCount:`Attach up to {{count}} images.`,imageAttachmentTooLarge:`Each image must be 10 MB or smaller.`,imageAttachmentTotalTooLarge:`The attached images must total 32 MB or less.`,imageAttachmentUnsupported:`Only valid PNG, JPEG, GIF, and WebP images are supported.`,imageAttachmentReadFailed:`Could not read this image. Add it again to retry; your message is preserved.`,attachedImage:`Attached image`,previewAttachment:`Preview image`,closeImagePreview:`Close image preview`,imagePreviewFailed:`Unable to display this image.`,fitImage:`Fit image`,originalImageSize:`Original size`,imageViewMode:`Image view`,sessionUsage:`Session token usage`,sessionInputTokens:`Input tokens`,sessionOutputTokens:`Output tokens`,sessionCacheTokens:`Cached tokens`,sessionContextUsage:`Context usage and context window`,usageContextLabel:`Context`,usageUnknown:`Unknown`,usageOpenDetails:`Input {{input}} · Output {{output}} · Context {{percent}} / {{capacity}} · View token usage`,usageContextHelp:`Estimated tokens in the current branch / model context limit.`,usageSessionTotals:`Session totals`,usageInputLabel:`Input`,usageOutputLabel:`Output`,usageCacheReadLabel:`Cache read`,usageCacheWriteLabel:`Cache write`,usageTotalLabel:`Total`,usageWorkspaceLabel:`Workspace`,usageSessionId:`Session ID`,usageTotalsHelp:`Session token totals include cache usage.`,subagentDetails:`Subagents`,sessionOverview:`Session overview`,sessionOverviewChanges:`Changes in the current review scope`,subagentSummaryRunning:`{{count}} running`,subagentSummaryDone:`{{count}} completed`,subagentSummaryOther:`{{count}} other`,subagentNoneYet:`No subagents yet`,subagentOtherGroup:`Failed / interrupted`,subagentShowMore:`Show {{count}} more`,backToSubagents:`Back to subagents`,subagentActiveGroup:`Active`,subagentFinishedGroup:`Completed`,subagentNoneRunning:`No subagents running.`,subagentNoneFinished:`Completed tasks will appear here.`,subagentProgress:`Subagents: {{running}} running · {{completed}} completed`,subagentSummaryUnknown:`{{count}} without confirmed status`,subagentTasks:`Subagent tasks`,inspectSubagent:`Open subagent: {{name}}`,subagentState_running:`Running`,subagentProcessing:`Working…`,subagentState_done:`Completed`,subagentState_error:`Failed`,subagentState_interrupted:`Interrupted`,subagentStarting:`Starting…`,subagentSpawnFailed:`Failed to start`,subagentStateUnavailable:`Started · state unavailable`,subagentSpawnReceipt:`Start receipt`,subagentSpawnReceiptHint:`This confirms the start request, not the subagent's final result.`,subagentTask:`Assigned task`,subagentTranscript:`Subagent conversation`,subagentResult:`Result`,subagentSpend:`Cumulative token spend`,subagentSaved:`Saved record`,subagentRecordedState:`Last recorded state`,subagentSavedHint:`From this parent session's saved receipts. A result may include other tasks from the same batch; this is not the child's full live conversation.`,subagentReadOnly:`Read-only view · closing this panel does not stop the task`,subagentUnavailable:`Live details are no longer available for this subagent in the current session. The start receipt is not evidence of completion.`,subagentStale:`Could not refresh. The details below are the last received snapshot.`,subagentNoMessages:`No messages received yet.`,subagentTranscriptUnavailable:`This view retains a task summary and cannot show the full child conversation.`,subagentWorkflowsTruncated:`{{count}} workflows are outside the loaded list; their task counts are unknown.`,subagentState_unknown:`Unconfirmed`,subagentUnconfirmedGroup:`Unconfirmed`,subagentTruncated:`Showing recent messages. {{count}} earlier messages are not included in this view.`,subagentTextTruncated:`Some long content is shown as an excerpt.`,subagentListTruncated:`{{count}} additional tasks are outside the loaded list.`,subagentThinkingRedacted:`Reasoning was redacted by the provider.`,inspectionChanged:`The active session changed. Reopen this panel.`,inspectionUnavailable:`Details are unavailable.`,inspectionLoading:`Loading status…`,thinkingUnavailable:`Thinking state is unavailable.`,trustUnavailable:`Project trust status is unavailable.`,copySetupCommand:`Copy setup command`,savedTrustDecision:`Saved decision`,activeSessionTrust:`Active Session trust`,trustDecision_trusted:`Trusted`,trustDecision_denied:`Denied`,trustDecision_undecided:`Undecided`,trustDecision_unknown:`Unknown`,trustActiveYes:`Trusted in this Session`,trustActiveNo:`Not trusted in this Session`,modelAndThinking:`Model and reasoning`,selectedModel:`Current model`,thinkingLevel:`Thinking level`,availableThinking:`Available levels`,unknownState:`Unknown`,projectTrust:`Project trust`,trust_trusted:`This session trusts the workspace.`,trust_untrusted:`Trust for this workspace has been denied.`,trust_restricted:`Project resources are restricted pending a trust decision.`,trust_unknown:`Trust state is not available.`,trustRefreshNeeded:`The saved decision and active session differ. Refresh the session through Pi to apply it.`,providerAvailability:`Provider credentials`,settings:`Settings`,settingsNavigation:`Settings navigation`,generalSettings:`General`,configurationSettings:`Configuration`,configurationIntro:`Permissions, web access and model responses.`,configurationReadFailure:`Configuration could not be read safely. Fix the settings file, then refresh.`,configurationUserScope:`User configuration`,configurationSetupHint:`Response and search changes use OpenPI setup`,configurationApproval:`Approval policy`,configurationApprovalDetail:`Tool approvals follow the installed Pi extensions.`,configurationPiPermissions:`Pi extensions`,configurationSandbox:`Sandbox`,configurationSandboxDetail:`Tools run with the host process permissions.`,configurationSandboxUnavailable:`No OS sandbox`,configurationSearchDetail:`Let the current Session model search the web when supported.`,configurationSearchOff:`Do not offer native search to the current model.`,configurationSearchOn:`Offer native search when the current connection supports it.`,configurationVerbosity:`Output verbosity`,configurationVerbosityDetail:`Choose how much detail the model includes in its response.`,configurationResponsesUnavailable:`The current connection does not use a supported Responses API.`,configurationVerbosity_default:`Model default`,configurationVerbosity_low:`Low`,configurationVerbosity_medium:`Medium`,configurationVerbosity_high:`High`,configurationVerbosityHelp_low:`Prefer short answers with fewer details.`,configurationVerbosityHelp_medium:`Include useful explanation and a moderate amount of detail.`,configurationVerbosityHelp_high:`Include more complete explanation and detail.`,configurationVerbosityRequest:`Set only response_verbosity to {{value}}; preserve the other OpenPI settings.`,configurationSummary:`Reasoning summary`,configurationSummaryDetail:`Choose the summary requested from a supported reasoning model.`,configurationSummaryUnavailable:`The current connection does not support reasoning summaries.`,configurationSummary_default:`Model default`,configurationSummary_auto:`Auto`,configurationSummary_concise:`Concise`,configurationSummary_detailed:`Detailed`,configurationSummary_none:`Off`,configurationSummaryHelp_auto:`Let the model choose the summary length.`,configurationSummaryHelp_concise:`Request a brief reasoning summary.`,configurationSummaryHelp_detailed:`Request a more detailed reasoning summary.`,configurationSummaryHelp_none:`Do not request a summary. Keep the current reasoning effort.`,configurationSummaryRequest:`Set only response_reasoning_summary to {{value}}; preserve the other OpenPI settings.`,configurationModelFeatures:`Model features`,configurationReasoningLevels:`Available reasoning efforts`,configurationReasoningDetail:`Choose which levels appear in model controls. Only levels supported by the current model are shown; the current level stays visible.`,configurationReasoningCount:`{{count}} selected`,configurationDependencies:`Workspace dependencies`,configurationEnvironment:`Local environment`,configurationEnvironmentDetail:`Node.js, Python and other tools come from your environment. OpenPI does not install a bundled workspace runtime.`,configurationRuntimeStatus:`Runtime status`,browserSettings:`Browser`,webSearchSettings:`Web search`,webSearchCurrentModel:`Current Session model`,webSearchNativeDetail:`Use your current model provider's native search with the existing connection and credentials.`,webSearchSupported:`This connection supports native search. When enabled, the model decides when to search.`,webSearchUnsupported:`Native search is unsupported or unconfirmed for this connection. No search tool is provided and no other provider is used.`,webSearchNativeRequest:`Enable native web search using the current Session model and existing Pi credentials. Do not switch model, connection protocol, or search provider. Unsupported or unknown connections must receive no search tool.`,webSearchIntro:`Let your model search current sources and read the original pages.`,webSearchPackageDetail:`Optional search, page reading, and PDF extraction through a Pi package.`,webSearchDefaultOff:`Off by default. This optional extension follows the current Session model; it needs no separate search key or plugin installation.`,webSearchLoaded:`Package loaded in this Session`,webSearchNotLoaded:`Package not loaded in this Session`,webSearchSource:`Review plugin source`,webSearchProfile:`Search setup`,webSearchExa:`Exa — no API key required`,webSearchExisting:`Keep my existing search preferences`,webSearchProfileHint:`Exa uses search queries with direct page reading. Existing preferences stay untouched. Other search services can be configured after installation.`,webSearchEnable:`Enable web search…`,webSearchDisable:`Disable web search…`,webSearchConfigure:`Change search service…`,webSearchExaRequest:`Enable optional web search with Pi Web Access and Exa, which needs no API key. Let me review the installation confirmation, preserve other preferences, and do not reload automatically.`,webSearchExistingRequest:`Enable optional web search with Pi Web Access and keep my existing search preferences unchanged. Let me review the installation confirmation, preserve other preferences, and do not reload automatically.`,webSearchDisableRequest:`Disable native web search. Preserve other settings and Session history.`,webSearchProviderRequest:`Help me change the search service for my installed Pi Web Access plugin. Explain available services and permissions, preserve unrelated preferences, keep credentials with the search plugin, and do not reload automatically.`,browserSettingsIntro:`Let OpenPI read pages, click, type and take screenshots.`,browserControl:`Browser control`,browserControlHint:`Requests a setup change. Access changes after the configuration is saved.`,browserDefault:`Default browser`,browserDefaultHint:`Requests a setup change for the browser used when none is named.`,browserEmbedded:`OpenPI browser`,browserAllowedTitle:`Allowed browsers`,browserOffHint:`Your choices take effect when browser control is on.`,browserConnected:`Connected`,browserNeedsSetup:`Extension setup needed`,browserNotFound:`Browser not detected`,browserUpdateNeeded:`Extension update needed`,browserBlocked:`Not allowed`,browserDefaultBlocked:`Your default browser is not allowed. Allow it or choose another default.`,browserSetUp:`Set up`,browserManage:`Manage`,browserSetupNamed:`Set up {{browser}}`,browserManageNamed:`Manage {{browser}}`,browserAllowNamed:`Allow {{browser}}`,browserMore:`More browsers`,browserSpeakHint:`Say “Use Chrome to…” to choose a different browser for a request.`,browserGuideTitle:`Connect {{browser}}`,browserGuideEyebrow:`One step at a time`,browserConnectionTitle:`Connection`,browserCloseGuide:`Close browser setup`,browserConnectionReady:`Connected. Choose whether OpenPI may use this browser.`,browserEmbeddedDetail:`Pages open inside OpenPI. Some websites require a regular browser to sign in or display correctly.`,browserExternalDetail:`OpenPI can use existing tabs and signed-in pages in your connected {{browser}} profile. Keep an OpenPI tab open in that profile.`,browserManageExtension:`Manage extension`,browserAllowUse:`Allow OpenPI to use it`,browserMakeDefault:`Use as default`,browserInstallIn:`Install in`,browserInstallTitle:`Install OpenPI Browser Bridge`,browserSetupSteps:`Setup steps`,browserGuidePopout:`Keep this guide in a separate window`,browserGuideDetached:`Your guide is open in a separate window. Follow it alongside the browser settings.`,browserShowGuide:`Show guide`,browserGuideInline:`Return guide here`,browserGuideBlocked:`The guide window could not open. Allow pop-ups and try again, or follow the steps here.`,browserSafariSettings:`Safari → Settings`,browserSafariDeveloper:`Developer settings`,browserSafariTemporary:`Add Temporary Extension…`,browserSafariOpenHint:`Open Safari, then choose Safari → Settings. Keep this guide alongside it. Requires Safari 26 or later on macOS.`,browserSafariDeveloperTitle:`Show Safari’s developer settings`,browserSafariDeveloperHint:`In Settings → Advanced, turn on Show features for web developers. Then select the Developer tab.`,browserSafariLoadHint:`In Developer, click Add Temporary Extension and select the folder below. Enable OpenPI Browser Bridge and allow the websites you want to control, including the local OpenPI page. Temporary extensions need reloading after Safari quits.`,browserFirefoxThis:`This Firefox`,browserFirefoxTemporary:`Load Temporary Add-on…`,browserFirefoxDeveloperTitle:`Select This Firefox`,browserFirefoxDeveloperHint:`On about:debugging, choose This Firefox in the left sidebar. Firefox does not need a Developer mode switch.`,browserFirefoxLoadHint:`Click Load Temporary Add-on and select manifest.json in the folder below. This development installation lasts until Firefox restarts; a permanent installation requires a Mozilla-signed package.`,browserFirefoxDone:`Selected. Next`,browserStepCount:`Step {{step}} of {{total}}`,browserStepLabel:`Step {{step}}: {{label}}`,browserStepOpen:`Open page`,browserStepAdd:`Add extension`,browserStepConnect:`Connect`,browserOpenManagerTitle:`Open {{browser}} extensions`,browserOpenManagerHint:`This opens {{browser}}. Complete the action on its extensions page, then return here to continue.`,browserOpenManager:`Open {{browser}} extensions`,browserReopenManager:`Open extensions page again`,browserAlreadyInstalled:`Already installed? Connect`,browserDeveloperMode:`Developer mode`,browserDeveloperTitle:`Turn on Developer mode`,browserDeveloperHint:`Turn on Developer mode on the extensions page. The {{loadLabel}} button will appear.`,browserDeveloperDone:`It’s on. Next`,browserIllustration:`Illustration · In {{browser}}`,browserExtensions:`Extensions`,browserLoadUnpacked:`Load unpacked`,browserLoadHint:`The extension is ready on this computer. Follow these steps in {{browser}} to load it.`,browserCopyLocation:`Copy the location below`,browserLocateTarget:`Find the extension on this computer`,browserRevealTarget:`Locate extension`,browserLocateManifest:`Find the extension’s manifest.json`,browserRevealManifest:`Locate manifest.json`,browserDragToBrowser:`Drag the folder onto {{browser}} extensions`,browserDragFolderHint:`Drag the entire {{folder}} folder from your file manager onto the extensions page, with Developer mode on.`,browserSelectLocatedTarget:`In the browser’s file picker, select the item located in the previous step.`,browserManualInstall:`Need another way? Select by path`,browserManualSelection:`Can’t find it? Select by path`,browserLoadInBrowser:`In {{browser}}, click “{{loadLabel}}”`,browserLoadAlternate:`The button appears when Developer mode is on.`,browserConfirmFolder:`Select`,browserConfirmFile:`Open`,browserSelectFolderHint:`Select this entire folder, not a .js file inside it.`,browserSelectManifestHint:`Select manifest.json, not one of the .js files.`,browserInstallCheckpoint:`Continue when OpenPI Browser Bridge appears in the extensions list.`,browserPathCopied:`Path copied`,browserCopyFailed:`Couldn’t copy. Select the path above and copy it manually.`,browserChooseFolderMac:`Press ⌘ ⇧ G, paste the copied path and press Return. Then click “{{confirm}}”.`,browserChooseFolderOther:`Paste the copied path into the location bar and press Enter. Then click “{{confirm}}”.`,browserInstalledConnect:`Added. Connect to OpenPI`,browserPreviousStep:`Back`,browserWaiting:`Waiting for OpenPI Browser Bridge… We’ll detect it automatically.`,browserInstallBrowserFirst:`Install {{browser}} first, or open this OpenPI address in your installed browser.`,browserConnectTitle:`Connect to OpenPI`,browserConnectHint:`Open OpenPI in {{browser}}. Use the profile where you installed the extension.`,browserOpenIn:`Open in {{browser}}`,browserAllowHint:`Once connected, you can allow OpenPI to use this browser. Installing the extension does not change your browser permissions.`,browserCheck:`Check connection`,browserNotConnectedYet:`No connection yet. Finish installation, refresh OpenPI in that browser and check again.`,browserHelp:`Setup help`,browserReloadHint:`Already installed? Reload OpenPI Browser Bridge in the extension manager and refresh OpenPI. Accept the browser’s permission prompt if shown.`,browserSupportedHint:`Chrome, Edge, Brave and Chromium 145+ support embedded and native pages. Safari 26+ on macOS and Firefox 128+ use the portable extension for native tabs; nested frames must be opened separately. Temporary Safari/Firefox installations need reloading after browser restart.`,browserCopyPath:`Copy path`,browserOpening:`Opening browser…`,browserLoading:`Checking browser connections…`,browserSaved:`Saved. Browser permissions take effect immediately.`,browserSaving:`Working…`,modelSettings:`Models`,skillsSettings:`Skills`,subagentsSettings:`Sub-agents`,pluginsSettings:`Plugins`,configureOpenPi:`Configure OpenPI`,setupRequestReviewAll:`review every OpenPI configuration area with me`,setupRequestSetTheme:`set only the OpenPI Web theme to {{value}} and preserve every other setting`,setupRequestSetChatWidth:`set only the OpenPI Web chat content width to {{value}}px and preserve every other setting`,setupRequestSetChatFontSize:`set only the OpenPI Web chat font size to {{value}}px and preserve every other setting`,setupRequestEnableExpandedThinking:`expand thinking blocks by default in OpenPI Web and preserve every other setting`,setupRequestDisableExpandedThinking:`collapse thinking blocks by default in OpenPI Web and preserve every other setting`,setupRequestSubagents:`review and configure Agent role models and workflow limits`,setupRequestFailed:`The OpenPI setup request was not accepted.`,setupRequestRunning:`Applying OpenPI settings…`,setupRequestAccepted:`Configuration request accepted.`,setupPlanBlocked:`Exit Plan mode before changing agent configuration. Display settings can be changed directly; exiting does not start implementation.`,setupPlanBusy:`Agent configuration requires an idle turn and leaving Plan mode. Display settings can be changed now.`,setupOutcome_pending:`Configuration request is awaiting a save receipt.`,toolCallArguments:`Tool arguments`,toolCallOutput:`Tool result`,setupOutcome_saved:`OpenPI configuration was saved and applied.`,setupOutcome_unchanged:`Configuration was saved; effective settings are unchanged.`,setupOutcome_failed:`The setup request failed. Review the error and current settings before retrying.`,setupOutcome_cancelled:`Setup was cancelled without a confirmed save.`,setupOutcome_unconfirmed:`No successful save was confirmed. Review current settings before retrying /openpi-setup.`,settingsUpdateFailed:`The Web preference could not be saved.`,settingsPreferencesSaved:`Preferences saved.`,settingsPreferencesSaveFailed:`Could not save display settings. Check configuration diagnostics and retry.`,settingsCatalogLoading:`Loading Pi resources…`,settingsCatalogFailed:`Could not load Pi settings resources.`,appearance:`Appearance`,settingsPersonal:`Personal`,settingsAgent:`Agent`,settingsIntegrations:`Integrations`,settingsArchivedChats:`Archived chats`,settingsSearch:`Search settings`,settingsClearSearch:`Clear search`,settingsNoResults:`No matching settings`,appearanceVisualStyle:`Visual style`,appearanceMode:`Mode`,appearanceTheme:`Theme`,appearanceAccent:`Accent color`,appearanceBackground:`Background`,appearanceForeground:`Foreground`,appearanceFont:`Font`,appearanceFont_codex:`Codex default`,appearanceFont_sans:`Sans serif`,appearanceFont_serif:`Serif`,appearanceFont_mono:`Monospace`,appearanceAccent0:`Default`,appearanceAccent1:`Blue`,appearanceAccent2:`Purple`,appearanceAccent3:`Pink`,appearanceAccent4:`Orange`,appearanceAccent5:`Green`,appearanceCustomAccent:`Custom accent color`,appearanceAdvanced:`Advanced`,appearanceReset:`Restore defaults`,appearanceResetAction:`Reset appearance`,appearanceImport:`Import theme`,appearanceCopy:`Copy theme`,appearanceCopied:`Theme copied`,appearanceCopyFailed:`Could not copy theme. Try again.`,appearanceThemeValue:`Theme data`,appearanceImportPlaceholder:`Paste an OpenPI theme…`,appearanceImportInvalid:`Enter valid OpenPI theme data.`,appearanceImportAction:`Import`,searchArchivedChats:`Search archived chats`,archiveProjectFilter:`Filter by project`,archiveAllProjects:`All projects`,archiveProjectGroup:`{{project}} · {{count}} archived chats`,archiveSort:`Sort archived chats`,archiveSortUpdated:`Last updated`,archiveSortCreated:`Date created`,restoreArchivedChat:`Restore {{title}}`,themeLight:`Light`,themeDark:`Dark`,themeMist:`Mist`,themeRose:`Rose`,themePine:`Pine`,themeSystem:`System`,conversationSettings:`Conversation`,expandThinkingByDefault:`Expand thinking by default`,chatContentWidth:`Chat content width`,chatFontSize:`Chat font size`,agentBehavior:`Agent behavior`,workflowLimits:`Workflow limits`,workflowConcurrency:`Workflow concurrency`,workflowCalls:`Total calls`,agentSettingsSetupHint:`Agent changes are applied through /openpi-setup in the current session.`,setupRequestLimits:`Set workflow concurrency to {{concurrency}} and total agent calls to {{calls}}. Preserve other settings.`,setupRequestEnableSuggestions:`Enable next-action suggestions. Help me choose a model if required; preserve other settings.`,setupRequestDisableSuggestions:`Disable next-action suggestions. Preserve other settings.`,setupRequestPostEdit:`Help me configure or disable the post-edit command. Show the current configuration and ask which command to use.`,configurePostEdit:`Configure post-edit command`,workflowLimitsValue:`{{concurrency}} concurrent · {{calls}} total calls`,nextActionSuggestions:`Next-action suggestions`,nextActionSuggestionsDetail:`Offer a few useful next actions when the current task finishes.`,enabled:`Enabled`,disabled:`Disabled`,configured:`Configured`,postEditCommand:`Post-edit command`,postEditCommandDetail:`Run a command after edits. Nothing runs while this is off.`,resultDisplay:`Default result display`,subagentResults:`Subagent results`,bashOperations:`Bash operations`,fileMutations:`Write / Edit operations`,footer:`Footer`,terminalFooter:`Pi terminal footer`,terminalFooterStyle:`Terminal footer style`,terminalFooterHint:`Applies to Pi's command-line interface. An already open Pi interface updates when restarted or when setup is applied.`,detailDisplay_full:`Full`,detailDisplay_compact:`Compact`,sessionSettings:`Session`,currentModel:`Current`,providerCurrentSessionModel:`This conversation uses {{model}}.`,useThisModel:`Use model`,model:`Model`,modelConnection:`Model connection`,provider:`Provider`,modelId:`Model ID`,providerStatusUnavailable:`This provider is not present in the bounded authentication snapshot.`,providerSettings:`Provider credentials`,providerSettingsIntro:`Inspect which Pi providers can authenticate the current Web session.`,openRuntimeDetails:`Open runtime details`,currentWorkspace:`Current workspace`,providerAuth_api_key:`API key`,providerAuth_oauth:`OAuth`,providerAuthUnknown:`Authentication method not reported`,authentication:`Authentication`,accessType:`Access`,providerAccessSubscription:`Subscription account`,providerAccessStandard:`Provider credentials`,configurationOwner:`Configuration owner`,providerLoading:`Loading provider status…`,providerLoadFailed:`Could not load provider status.`,providerReadOnly:`Managed by Pi`,selectProvider:`Select a provider`,gitReviewBaselineUnavailable:`No usable session baseline was retained (it may exceed the capture limit). Choose Unstaged, Staged or Branch to inspect Git changes, or open the session file records.`,modelsIntro:`Sign in with an account or add an API key. Your existing Pi connections are available here.`,modelConnectionsTitle:`Model connections`,modelConnectionsIntro:`Manage credentials and choose models for new and current chats.`,accountLoginMethod:`Connection method`,accountLoginTab:`Account`,accountLoginChatGPT:`ChatGPT account`,accountLoginClaude:`Claude account`,accountLoginKeyTab:`API key`,accountLoginConfigured:`Account signed in`,accountLoginIntro:`Continue in your browser. No API key needed.`,accountLoginExisting:`Your account credential is saved in Pi.`,accountLoginStart:`Sign in`,accountLoginAgain:`Sign in again`,accountLoginUnsaved:`Save or discard your other changes before signing in.`,accountLoginStarting:`Preparing sign-in…`,accountLoginWaiting:`Waiting for authorization`,accountLoginChoose:`Choose how to sign in`,accountLoginCancelling:`Cancelling sign-in…`,accountLoginBrowser:`Continue in browser`,accountLoginDevice:`Use a device code`,accountLoginBrowserOption:`Sign in on this computer. Returns here automatically.`,accountLoginDeviceOption:`For remote servers or when browser sign-in is unavailable.`,accountLoginBrowserHelp:`Open the sign-in page and approve access. This page updates automatically.`,accountLoginDeviceHelp:`Open the authorization page and enter this code. Keep this page open.`,accountLoginOpen:`Open sign-in page`,accountLoginCopyCode:`Copy device code`,accountLoginPaste:`Authorization code or callback URL`,accountLoginContinue:`Continue`,accountLoginFallback:`Signed in but still waiting?`,accountLoginRemoteHelp:`If automatic return does not work, copy the final callback URL from your browser and paste it here.`,accountLoginCancel:`Cancel sign-in`,accountLogin_failed:`Sign-in failed. Try again or choose another method.`,accountLogin_expired:`Sign-in expired. Start again to get a new authorization link.`,accountLogin_cancelled:`Sign-in cancelled.`,accountLoginRequestFailed:`The request did not complete. Refresh status before retrying.`,accountLoginStatusUnknown:`Cannot check sign-in status. Your authorization may still be in progress.`,accountLoginRefreshRequired:`The credential was saved, but Pi could not update its model list. Reload Pi before using this connection.`,accountLogout:`Sign out`,accountLogoutRefreshRequired:`The saved credential was removed, but Pi could not update its model list. Reload Pi to refresh the status.`,accountLogoutTitle:`Sign out of {{provider}}?`,accountLogoutDetail:`Removes this provider’s saved credential from Pi on this machine. Other Pi sessions using it will also need to sign in again. Environment credentials are unchanged.`,providerInputTypes:`Input types`,providerInputText:`Text`,providerInputImage:`Images`,providerCustomTag:`Custom`,providerEdit:`Edit`,providerRemove:`Delete`,providerSave:`Save`,editProvider:`Edit {{provider}}`,removeProvider:`Delete {{provider}}`,providerAdd:`Add model provider`,providerAddMode:`How to add`,providerAddCatalog:`Third-party providers`,providerAddCustom:`Custom model API`,providerAccountHint:`Use an existing account to connect. Choose a provider and continue in your browser.`,providerCatalogHint:`Choose a provider from the built-in catalog and enter its API key.`,providerCustomHint:`Connect a gateway or self-hosted service using an OpenAI or Anthropic compatible API.`,providerKeyKeep:`Leave blank to keep the existing key`,providerKeyOptional:`Enter an API key, or leave blank to use environment authentication`,providerDisplayName:`Provider name`,providerCustomSettings:`Custom settings`,providerSaved:`Saved {{provider}}.`,modelDefaultTitle:`Default for new chats`,modelDefaultChoose:`Choose model`,modelDefaultBadge:`Default`,modelCurrentBadge:`In use`,modelDefaultNotSet:`Not set · Pi chooses when a new chat starts`,modelDefaultHint:`Choose the model for future chats. Existing chats keep their own model. This also updates Pi's default.`,modelDefaultReadFailed:`Could not read the default model.`,modelDefaultProjectOverride:`This workspace has a Pi override: {{model}}.`,modelDefaultSave:`Save default`,modelMakeDefault:`Also make this the default for new chats`,modelDefaultSaveFailed:`The default was not confirmed. Refresh status and try again.`,modelDefaultPartial:`The chat model changed, but saving the default was not confirmed. Refresh status before retrying.`,modelConnectionNextHint:`Choose a model from this connection to use in the current chat.`,modelConnectionSearch:`Search models…`,modelConnectionChooseProvider:`Choose a model from {{provider}}`,modelConnectionUse:`Use in this chat`,modelConnectionUseFailed:`The model change was not confirmed. Refresh the model list and try again.`,modelConnectionLoadFailed:`Could not load models.`,modelConnectionNoModels:`No selectable models yet. Check the connection or add a model definition.`,modelConnectionNoMatch:`No matching models.`,modelConnectionMore:`{{count}} more models. Search to narrow the list.`,providerModelsEmpty:`No models yet. Fetch available models or add one manually.`,providerModelsInherited:`Uses the provider’s built-in model catalog.`,providerModelsReadOnly:`This provider contains model settings that must be edited in Pi’s configuration file.`,providerModelId:`Model {{number}} ID`,providerModelName:`Model {{number}} name`,providerModelDetails:`Model details: {{model}}`,providerRemoveModel:`Remove model: {{model}}`,providerIdInvalid:`Use a unique provider ID with letters, numbers, hyphens, dots or underscores.`,providerNativeAuth:`This provider uses Pi’s native sign-in.`,providerConfigurationFailed:`Could not save. Check the fields and retry when the session is idle.`,providerProfileSavedKeyFailed:`The provider was saved, but its API key was not. Retry saving the key.`,providerReload:`Discard draft and reload`,providerCurrentRemoval:`Select another model before removing the model currently in use.`,providerRemoveDetail:`Remove this provider’s configuration and custom models? Credentials managed by Pi are kept.`,providerPickerIntro:`Select the models you want to add from this provider.`,providerPickerSelected:`{{count}} selected`,providerApiKey:`API key`,providerKeyPlaceholder:`Paste a key to add or replace it`,saveProviderKey:`Save API key`,savingSettings:`Saving…`,keepEditing:`Keep editing`,discardAndContinue:`Discard and continue`,unsavedSettingsTitle:`Discard unsaved changes?`,unsavedSettingsDetail:`Unsaved model and credential changes will be lost.`,unsavedCredentialTitle:`Discard the unsaved credential?`,unsavedCredentialDetail:`The new key has not been saved and will be cleared.`,modelSelectionBusy:`This session is busy. Model changes are unavailable.`,providerKeySaved:`Saved to Pi credentials. Existing keys are never displayed.`,providerSaveFailed:`Credential save did not complete. Wait until the session is idle, refresh status and retry. Some providers need additional authentication settings.`,providerWriteDetail:`Save API keys here directly to Pi. Keys never enter a model conversation. For OAuth or additional provider fields, use Pi's native login.`,editModelConfiguration:`Add or edit a custom model`,modelConfigurationDetail:`Set up a provider connection, then choose available models or add one manually. Saving does not send a model request.`,configuredModels:`Custom model configuration`,addModel:`Add a model`,modelConfig_provider:`Provider ID`,modelConfig_id:`Model ID`,modelConfig_name:`Display name`,modelConfig_baseUrl:`API base URL`,modelConfig_api:`API format`,modelConfig_contextWindow:`Context window`,modelConfig_maxTokens:`Max output tokens`,providerCapacityLabel:`{{field}} {{number}}`,providerModelOptions:`Model options`,providerModelInvalid:`Model {{number}}: use a unique model ID and positive token counts, such as 128K or 1M. Leave capacities blank to use defaults.`,modelConfig_reasoning:`Supports reasoning`,saveModelConfiguration:`Save model`,reloadModelConfiguration:`Discard draft and load latest`,retryModelConfiguration:`Retry loading`,discardModelDraftTitle:`Discard this model draft?`,discardModelDraftDetail:`The latest configuration will replace this unsaved draft.`,discardAndReload:`Discard and reload`,modelConfigurationUnsaved:`Unsaved changes`,modelConfigurationConflict:`Model configuration changed elsewhere. Your draft is unchanged.`,modelConfigurationLoadFailed:`Could not load model configuration. Your draft is unchanged.`,modelConfigurationSaved:`Saved to Pi models.json. Configure the provider API key to make this model available.`,modelConfigurationFailed:`Model save did not complete. Your draft is unchanged.`,setupConfigurationRequest:`Configuration request`,configureViaSetup:`Apply via OpenPI setup`,setupFormDetail:`Uses /openpi-setup. Follow progress and any required confirmation in the conversation; submission does not mean the configuration is saved.`,setupSkillsPlaceholder:`Describe the skill to add or configure, including its source or local path`,setupPluginsPlaceholder:`Describe the Pi package to configure, including its exact package name or local path`,enableSkillInvocation:`Allow model invocation`,disableSkillInvocation:`Require explicit invocation`,setupSkillInvocationRequest:`Configure this Pi skill: {{path}}. Set its native disable-model-invocation field to {{disabled}}. Preserve other content and explain when the change takes effect.`,setupRoleFormRequest:`Configure the OpenPI {{role}} role to use {{model}} and set workflow concurrency to {{concurrency}}. Inherit parent thinking, validate the selection and preserve unrelated configuration.`,providerReadOnlyDetail:`This page is read-only and never receives credential values. Configure provider authentication through Pi, then refresh this status.`,openProviderSettings:`Open provider settings`,credentialConfigured:`Configured`,credentialMissing:`Not configured`,authNotVerified:`Configured credentials do not guarantee a successful model request.`,configurationViaPi:`Read-only status. Manage model credentials and trust through Pi; manage OpenPI options with /openpi-setup.`,noSkillsFound:`No skills are loaded for this Session.`,addSkill:`Add skill`,addPlugin:`Add plugin`,searchResources:`Search by name or source`,filterResourceScope:`Resource scope`,allResourceScopes:`All scopes`,noMatchingResources:`No matching resources`,resourceBulkTooLarge:`Filter the list further before submitting a bulk request.`,resourceManagement:`Pi resources`,resourceSourceAuto:`Pi automatic discovery`,resourceSourceLocal:`Local resource`,resourcePackageSource:`Package, repository or local path`,resourcePackageSourcePlaceholder:`npm:package@version · git:owner/repo · /path/to/skill`,resourceInstallIntro:`Choose a source and scope. OpenPI setup will review and apply the request in the conversation.`,resourceInstallReview:`Review the exact source and permissions in the conversation. Submitting this request does not mean it is installed or loaded.`,resourceRequestSubmitted:`Request submitted. Follow progress and confirmations in the conversation, then refresh this catalog.`,browseSkills:`Browse skills.sh`,resourceSessionState:`Apply to this Session`,resourcesReloadNote:`Refresh reads the catalog. Reload applies saved resources to this idle Session; changes are never reloaded automatically.`,reloadResources:`Reload resources`,resourceReloadReview:`Apply saved Pi skill and plugin configuration and restart extensions in the current Session? Wait for running work to finish first.`,resourceReloaded:`Resources reloaded. Review the refreshed catalog and diagnostics.`,resourceReloadFailed:`Could not reload resources. Wait for this Session to become idle and refresh before retrying.`,advancedResourceConfiguration:`Advanced configuration`,resourceDiagnostics:`Pi reports {{extensionErrors}} extension diagnostics and {{skillErrors}} skill diagnostics.`,resourceConfigurationDiagnostics:`{{count}} settings files could not be read. Review Pi configuration diagnostics.`,resourceCatalogTruncated:`This catalog is bounded; some resources are omitted.`,resourceTargetTruncated:`This source or path is truncated. Confirm the full target through Advanced configuration before making changes.`,updateResource:`Review update`,removeResource:`Review removal`,skillsEmptyTitle:`Add your first skill`,skillsEmptyIntro:`Skills give Pi reusable instructions. Add a package, repository or local skill; project skills follow Pi project trust.`,pluginsEmptyTitle:`Extend Pi with a plugin`,pluginsEmptyIntro:`Packages can include extensions, skills, prompts and themes. Add a source to review its installation through OpenPI setup.`,pluginCount:`{{count}} plugin sources`,installedVersion:`Installed version`,configuredVersion:`Configured version`,resourceVersionUnpinned:`Not pinned / local source`,pluginState_loaded:`Session resources loaded`,pluginState_installed:`Installed · not loaded`,pluginState_disabled:`Disabled in configuration`,pluginState_missing:`Package missing`,pluginState_error:`Load diagnostics`,pluginState_notLoaded:`Not loaded`,pluginLoadedResources:`{{count}} resources in this Session's catalog. Configuration changes require an explicit reload.`,pluginAction_enable:`Review enable`,pluginAction_disable:`Review disable`,pluginAction_update:`Review update`,pluginAction_remove:`Review removal`,enableVisibleSkills:`Allow model use ({{count}} shown)`,disableVisibleSkills:`Explicit use only ({{count}} shown)`,enableVisiblePlugins:`Enable {{count}} shown packages`,disableVisiblePlugins:`Disable {{count}} shown packages`,setupResourceInstallRequest:`Add these Pi {{kind}} from source {{source}} in scope {{scope}}. Inspect the source and resolve a fixed package identity, review required installation permissions with me using ask_user, then use Pi's native package/skill configuration. For a skill request, preserve unrelated extensions and other resources. Preserve existing preferences and project trust; do not reload this Session automatically. Report saved configuration and any remaining action separately. Do not change unrelated OpenPI settings.`,setupPluginOperationRequest:`Review Pi package action {{action}} for exactly configured source {{source}}, native root {{path}}, scope {{scope}}. Resolve relative sources against the native scope's settings directory. Use Pi's native package management. For updates, inspect available versions and review a fixed target identity and required permissions with me using ask_user before installing. Preserve resource filters and all unrelated preferences; if a toggle would destroy filters, stop and explain. Removal must not delete a local source directory. Do not reload automatically. Report persisted and active states separately; do not change unrelated OpenPI settings.`,setupSkillManageRequest:`Review Pi skill action {{action}} for exactly file {{path}}, source {{source}}, scope {{scope}}. Inspect native ownership first. Review the update/removal and required permissions with me using ask_user. Preserve unrelated skills and package resources; do not remove an entire shared package to remove one skill. Preserve project trust and do not reload automatically. Do not change unrelated OpenPI settings.`,setupSkillsBulkRequest:`For exactly these currently displayed Pi skill files {{paths}}, set native disable-model-invocation to {{disabled}}. Inspect ownership, preserve all other content and preferences, review necessary changes with me, and report any files that cannot be changed safely. Explicit /skill invocation remains available. Do not reload automatically or change unrelated OpenPI settings.`,setupPluginsBulkRequest:`For exactly these currently displayed Pi packages {{packages}}, set disabled to {{disabled}} through native Pi configuration. Preserve all other preferences and resource filters; skip and report entries whose filters cannot be preserved. Respect scope and project trust, review necessary changes with me, and do not reload automatically or change unrelated OpenPI settings.`,resourceRequestFinished:`The setup turn has ended. Refresh and inspect Pi's configuration and Session resources to confirm what changed.`,skillCount_one:`{{count}} skill`,skillCount_other:`{{count}} skills`,skill:`Skill`,copySkillInvocation:`Copy invocation`,source:`Source`,scope:`Scope`,invocation:`Invocation`,modelInvocation:`Model invocation`,resourceScope_user:`Global`,resourceScope_project:`Project`,resourceScope_temporary:`Temporary`,explicitOnly:`Explicit invocation only`,availableToModel:`Available to the model`,skillFile:`Skill file`,selectSkill:`Select a skill`,subagentConfiguration:`Pi-native subagent roles`,subagentConfigurationIntro:`Role models inherit from the parent unless OpenPI setup assigns an available model.`,subagentActiveCount_one:`{{count}} active`,subagentActiveCount_other:`{{count}} active`,subagentCompletedCount_one:`{{count}} recorded`,subagentCompletedCount_other:`{{count}} recorded`,subagentConcurrency:`Limit {{count}}`,builtInRoles:`Built-in roles`,subagentRole_explorer:`Explorer`,subagentRole_implementer:`Implementer`,subagentRole_reviewer:`Reviewer`,subagentRole_advisor:`Advisor`,subagentRoleShort_explorer:`Read-only investigation`,subagentRoleShort_implementer:`Focused implementation`,subagentRoleShort_reviewer:`Correctness review`,subagentRoleShort_advisor:`Technical analysis`,subagentRoleDescription_explorer:`Explores the codebase and reports evidence without modifying files.`,subagentRoleDescription_implementer:`Implements a bounded change and runs the relevant repository checks.`,subagentRoleDescription_reviewer:`Reviews correctness, safety, regressions, and missing validation.`,subagentRoleDescription_advisor:`Analyzes difficult technical questions and recommends a concrete next step.`,configureRoles:`Configure roles`,builtInRole:`Built-in role`,builtIn:`Built-in`,modelAssignment:`Model assignment`,inheritParentModel:`Inherit parent model`,effectiveModel:`Effective model`,workflowConcurrencyLabel:`Concurrent agents`,workflowCallLimit:`Total agent calls`,runtimeBoundaries:`Runtime boundaries`,subagentAuthorityNote:`Child authority is the fail-closed intersection of the parent Session and role capabilities.`,subagentModelNote:`No hardcoded provider is introduced; an unassigned role follows the parent model and thinking level.`,resourceCount_one:`{{count}} resource`,resourceCount_other:`{{count}} resources`,noPluginsFound:`No loaded plugin sources were reported.`,pluginCatalogTotals:`{{extensions}} ext · {{skills}} skills · {{prompts}} prompts · {{themes}} themes`,loaded:`Loaded`,resourceOrigin:`Origin`,resourceOrigin_package:`Package`,resourceOrigin_topLevel:`Top-level resource`,resources:`Resources`,baseDirectory:`Base directory`,notReported:`Not reported`,extensions:`Extensions`,extensionSurfaceCount:`{{tools}} tools · {{commands}} commands`,prompts:`Prompts`,themes:`Themes`,pluginResourceSummary:`{{extensions}} ext · {{skills}} skills · {{prompts}} prompts · {{themes}} themes`,pluginsManagedByPi:`These resources are loaded by Pi. Submit changes using the setup form above. Package changes follow native confirmation and take effect through Pi's reload lifecycle.`,selectPlugin:`Select a plugin source`,statusCaptured:`Snapshot at {{time}} · refresh for the latest state`,conversationViews:`Conversation views`,currentConversations:`Current`,archivedConversations:`Archived`,refreshArchives:`Refresh archived conversations`,loadingArchives:`Loading archived conversations...`,moreArchives:`Load more archived conversations`,retryArchives:`Retry archived conversations`,archiveLoadFailed:`Could not load archived conversations.`,archiveCursorStale:`Archived conversations changed. Refresh to continue.`,archiveScanBounded:`{{count}} older records have not been scanned.`,noArchivedSessions:`No archived conversations.`,noScannedArchives:`No archived conversations in the scanned history.`,noMatchingScannedArchives:`No matching archived conversations in the scanned history.`,draftLimit:`Draft storage is full. Send or clear an existing draft before adding more content.`,restoreConversation:`Restore conversation`,restoringConversation:`Restoring…`,loadedArchives:`Archived conversations in the loaded history`,loadedHistoryBounded:`{{sessions}} more sessions and {{workspaces}} workspace summaries are not loaded. Search covers the loaded list only.`,noLoadedArchives:`No archived conversations in this loaded list.`,restoreFailed:`Could not confirm restoration. Refresh and try again.`,execution_running:`Running`,execution_done:`Completed`,execution_killed:`Stopped`,execution_timed_out:`Timed out`,execution_failed:`Failed`,execution_uncertain:`Uncertain`,activeOnlyHint:`Only the active Web session accepts messages.`,acceptedHint:`Message accepted by OpenPI Web.`,promptAdmissionUnknown:`It is unclear whether the last message was received.`,promptAdmissionUnknownDetail:`Review the refreshed Session history and runtime status before deciding. Sending as a new message may create a duplicate message.`,promptAdmissionCheckingDetail:`Checking the latest Session history and runtime status before resend options are enabled.`,promptAdmissionVerificationFailedDetail:`Could not refresh the latest Session history and runtime status. Check again before sending as a new message.`,abandonAdmission:`Don't resend for now`,retryAdmissionCheck:`Check again`,retryOriginalAdmission:`Retry original message`,promptTooLong:`Message exceeds the send limit ({{count}} / {{limit}}).`,sendAsNew:`Send as new message`,sendingAsNew:`Sending…`,stopTurn:`Stop current turn`,stoppingTurn:`Stopping current turn…`,stoppedTurn:`Current turn stopped.`,pendingFollowUpsHint:`{{count}} messages queued`,sendNextTurn:`Send next turn`,followUpBehavior:`Follow-up behavior`,followUpBehaviorDetail:`While OpenPI is running, queue new messages for the next turn or guide the current turn. Press ⌘/Ctrl+Enter to use the other option once.`,followUpQueue:`Queue`,followUpQueueDetail:`Next turn`,followUpSteer:`Steer`,followUpSteerDetail:`Current turn`,steerCurrentTurn:`Steer current turn`,steeringHint:`Use this instruction after the current tool step finishes.`,pendingSteeringHint:`{{count}} instructions received; waiting for the current tool step`,steeringMessagesTitle:`Pending instructions for this turn`,steerStaleTurn:`That turn has ended or changed. Your draft is kept. Check the updated status and send again.`,sourceFeedbackNew:`{{path}} · new line {{line}}`,sourceFeedbackOld:`{{path}} · old line {{line}}`,forkMessage:`Fork from here`,forkMessageHint:`Create a new conversation from this message. Keep the original conversation; no message is sent.`,forkSessionPending:`Creating a fork…`,forkSessionCreated:`Fork created. The original conversation remains in the sidebar.`,forkSessionCancelled:`Fork cancelled. The original conversation is kept.`,forkSessionUncertain:`The fork could not be confirmed. Refresh and inspect your conversations before trying again.`,forkSessionUnavailable:`Switch to this conversation and let its current work and queued messages finish before forking.`,reviewQuoteLine:`Reference this line`,reviewSelectOldLine:`Select old line {{line}}`,reviewSelectNewLine:`Select new line {{line}}`,queuedMore:`{{count}} more queued`,queuedImage:`Image attachment`,queuedMessageExpand:`Expand queued message`,queuedMessageCollapse:`Collapse queued message`,backgroundSessionRunning:`This session is running in the background…`,observedSessionTools:`{{count}} active tools`,toolsRequireCurrentSession:`Switch to this session to use interactive tools.`,activateViewedSession:`Switch to this session`,activateViewedSessionHint:`Send a message to continue this conversation.`,addWorkspace:`Add workspace`,addWorkspaceMenu:`Add workspace...`,archiveConversation:`Archive conversation`,pinnedConversations:`Pinned`,sidebarOptions:`Sidebar options`,sidebarProjectOptions:`Project sidebar options`,sidebarRecentOptions:`Chat sidebar options`,sidebarActivityOptions:`Activity view options`,sidebarShow:`Show`,sidebarGroupBy:`Group conversations`,sidebarByProject:`By project`,sidebarFlatList:`All conversations`,sidebarChatSort:`Conversation order`,sidebarRecent:`Recent`,sidebarProjectsInRecents:`Show projects in Recent`,sidebarShowMore:`Show more`,sidebarShowLess:`Show less`,sidebarFilterList:`Filter this list`,sidebarSaveFailed:`Could not save the change. Please try again.`,pinWorkspace:`Pin project`,unpinWorkspace:`Unpin project`,markConversationRead:`Mark as read`,markConversationUnread:`Mark as unread`,sidebarState_unread:`Unread conversation`,sidebarActivity:`Activity`,sidebarViewActivity:`View activity`,sidebarViewChats:`View conversations`,sidebarPriority:`Priority`,sidebarActivityEmpty:`Nothing needs attention`,sidebarActivityEmptyHint:`Completed work and conversations needing your attention appear here.`,sidebarMarkAllRead:`Mark all as read`,sidebarClearRead:`Clear read chats from Priority`,sidebarReadFailed:`Could not update read status. Please try again.`,sidebarToday:`Today`,sidebarYesterday:`Yesterday`,sidebarEarlier:`Earlier`,sidebarActivityCompleted:`Completed`,sidebarActivityFailed:`Failed`,sidebarActivityRead:`Read`,modelAdvanced:`Advanced parameters`,providerConnectionHeading:`Provider connection`,providerFetchModels:`Get available models`,providerFetchHint:`Enter the provider and endpoint, then choose models in one step.`,providerPickerTitle:`Choose models to add`,providerPickerAccess:`Connection credentials`,providerPickerKey:`Access key (optional)`,providerPickerKeyHint:`Leave blank to use saved credentials for this endpoint. A key entered here is used for discovery only and is not saved.`,providerPickerSearch:`Search models`,providerPickerSelectAll:`Select all`,providerPickerClear:`Clear selection`,providerPickerLoading:`Reading available models…`,providerPickerAdded:`Added`,providerPickerNoMatch:`No matching models`,providerPickerEmpty:`No models returned. You can still add one manually.`,providerPickerBounded:`Showing the first 500 models. Add other IDs manually.`,providerPickerError_load:`Could not read the model list. Check the endpoint and credentials, then retry or add a model manually.`,providerPickerError_save:`Could not confirm the save. Your selection is kept; check the connection before retrying.`,providerPickerError_conflict:`Configuration changed elsewhere. Close this dialog and reload configuration before saving again.`,providerPickerDefaults:`New models use {{context}} context / {{output}} output tokens. You can adjust these per model after adding.`,providerPickerRetry:`Refresh list`,providerPickerCount:`{{count}} selected · up to 100`,providerPickerSave:`Add selected`,sidebarState_running:`Running`,sidebarState_compacting:`Organizing context`,sidebarState_waiting:`Waiting for your response`,sidebarState_completed:`Completed · unread result`,sidebarState_failed:`Failed · open conversation for details`,pinnedOptions:`Pinned options`,pinConversation:`Pin conversation`,unpinConversation:`Unpin conversation`,pinnedRecentlyUpdated:`Recently updated`,pinnedManualOrder:`Manual order`,movePinUp:`Move up`,movePinDown:`Move down`,pinSaveFailed:`Could not save pinned conversations. Please try again.`,cancel:`Cancel`,chooseWorkspaceHint:`Choose a workspace and describe the work`,close:`Close`,closeSearch:`Close search`,collapseSidebar:`Collapse sidebar`,confirmEdit:`Save and rerun`,editMessageHint:`Rerun from here in a new branch. Keep the original conversation, images and file references. Existing workspace changes are kept.`,regenerateMessage:`Regenerate response`,regenerateMessageHint:`Rerun this question in a new branch, keeping its original attachments and conversation.`,messageRerunStarted:`Rerun admitted in a new branch. The original conversation is kept.`,openOriginalConversation:`View original conversation`,messageRerunWorkspaceHint:`Existing workspace changes are kept.`,modelRequestRecovered:`Request recovered`,modelReconnecting:`Reconnecting`,modelReconnectUnknown:`Reconnection status unconfirmed`,modelEarlierAttempts:`Earlier request errors`,modelFailedAttempts:`Failed attempts ({{count}})`,draftStorageUnavailable:`Draft could not be saved on this device. Keep this page open or copy your message.`,draftStorageInvalid:`Some saved draft content could not be restored. Check your message and attachments.`,draftStorageRetry:`Retry saving draft`,workbarBackToChat:`Back to chat`,workbarCollapseTools:`Collapse tools`,workbarEndTerminal:`Close {{name}} and end its process`,workbarNewTerminal:`New terminal`,workbarContinueInChat:`Continue in chat`,transcriptSearch:`Search message contents`,transcriptSearchPlaceholder:`Search titles, projects, or messages…`,transcriptSearchRecent:`Recent conversations`,transcriptSearchSessions:`Conversations`,transcriptSearchMessages:`Message contents`,transcriptSearchSessionResult:`Open conversation {{session}}`,transcriptSearchSessionOpenFailed:`Could not open this conversation. Try again.`,transcriptSearchIncludeArchived:`Include archived conversations`,transcriptSearching:`Searching messages…`,transcriptSearchEmpty:`No matching messages found.`,transcriptSearchFailed:`Could not search messages. Try again.`,transcriptSearchRetry:`Retry search`,transcriptSearchPartial:`Some history could not be searched. Results may be incomplete.`,transcriptSearchOpenFailed:`This message could not be opened. It may have moved or belong to another branch.`,transcriptSearchResult:`Open message from {{source}} in {{session}}`,transcriptSearchSource_user:`you`,transcriptSearchSource_assistant:`assistant`,transcriptSearchSource_tool_call:`tool call`,transcriptSearchSource_tool_result:`tool output`,connected:`Connected`,connecting:`Connecting`,conversationName:`Conversation name`,conversationOptions:`Conversation options`,sidebarRename:`Rename`,sidebarPin:`Pin`,sidebarUnpin:`Unpin`,sidebarFork:`Fork`,sidebarForkLocal:`Fork chat`,sidebarForkSameWorktree:`Fork in same worktree`,archiveNoticeTitle:`Chat archived`,archiveNoticeView:`View`,archiveNoticeUndo:`Undo`,archiveNoticeFailed:`Could not complete this action. Try again.`,sidebarForkWorktree:`Fork chat in new worktree`,sidebarForkCancelling:`Requesting cancellation…`,sidebarForkFinishing:`Cancellation is no longer available. Confirming the result…`,sidebarForkCancelUnconfirmed:`Cancellation could not be confirmed. Waiting for the fork result.`,sidebarForkWorktreePreserved:`The worktree was kept at {{path}}. Inspect it before retrying.`,sidebarForkWorktreePending:`Creating a worktree and conversation…`,sidebarForkOptionsLoading:`Checking worktree availability…`,sidebarForkOptionsFailed:`Unable to check worktrees. Reopen menu to retry.`,sidebarForkUnavailable:`Send a message before forking this conversation.`,sidebarForkArchived:`Restore this conversation before forking.`,sidebarForkFailed:`Could not create the fork. The original conversation is unchanged.`,sidebarCopy:`Copy`,sidebarCopyLink:`Copy conversation link`,sidebarCopyMarkdown:`Copy as Markdown`,sidebarCopyCwd:`Copy working directory`,sidebarCopied:`Copied`,sidebarCopyFailed:`Could not copy. Try again.`,sidebarNewWindow:`Open in new window`,sidebarOpenIn:`Open in`,sidebarAppsLoading:`Loading available apps…`,sidebarAppsFailed:`Unable to load apps. Reopen menu to retry.`,sidebarOpenFailed:`Unable to open this project in the selected app.`,sidebarArchive:`Archive`,sidebarRestore:`Restore`,sidebarDelete:`Permanently delete`,managedWorktreeRecoveryFull:`Check earlier unfinished removal requests before starting another.`,managedWorktreesChanged:`The worktree list changed. Refresh it before reviewing a target.`,managedWorktreesRefresh:`Refresh worktrees`,managedWorktreesBack:`Back to worktrees`,managedWorktreesRetry:`Retry request`,managedWorktrees:`Retained worktrees`,managedWorktreesDescription:`Worktrees created by OpenPI are kept when a conversation is deleted. Review an exact path before requesting removal. Active, shared, changed or unverified worktrees stay in place.`,managedWorktreeConfirm:`Remove this managed worktree? The server rechecks ownership, active conversations and local changes before removal.`,managedWorktreeRemoved:`Worktree removed.`,managedWorktreePreserved:`Worktree kept:`,managedWorktreeUncertainTerminal:`Removal outcome is uncertain. Automatic removal cannot be repeated. Inspect the retained path before taking further action.`,managedWorktreeUncertain:`Removal outcome is unknown. Retry to check the original request.`,managedWorktreeRemoving:`Checking and removing…`,managedWorktreeRemove:`Remove worktree`,managedWorktreeReview:`Review removal`,managedWorktreesEmpty:`No managed worktrees were found on this page.`,managedWorktreesUnavailable:`{{count}} ownership records could not be verified.`,managedWorktreesLoadFailed:`Could not load retained worktrees. Retry without changing the target.`,managedWorktreesMore:`Load more worktrees`,managedWorktreeRetainedAfterDelete:`Conversation deleted. Worktree kept at {{path}}. Review retained worktrees in the project menu.`,sidebarDeleteTitle:`Delete conversation?`,sidebarDeleteDescription:`Permanently delete “{{name}}”? This cannot be undone.`,sidebarDeleteConfirm:`Delete`,sidebarDeleting:`Deleting…`,sidebarDeleteFailed:`Could not delete this conversation. Retry or cancel.`,sidebarActionRunning:`Let current work and queued messages finish first.`,sidebarActionDisconnected:`Reconnect before changing this conversation.`,sessionDeleteCancelled:`Deletion cancelled`,sessionDeleteUncertain:`Could not confirm whether the conversation was deleted. Refresh and try again.`,sessionDeleted:`Conversation permanently deleted`,sessionDeleteMetadataPending:`The conversation was deleted, but its sidebar records could not be fully cleared.`,sessionLinkUnavailable:`The linked conversation no longer exists or its identity has changed.`,sidebarDropPin:`Drop here to pin`,sidebarDropProjectLast:`Move project to the end`,conversationTurns:`Conversation turns`,conversationTurnPosition:`Go to turn {{position}}`,turnPreviewLoading:`Loading preview…`,turnPreviewUnavailable:`Preview unavailable. Try again.`,commands:`Slash commands`,addContext:`Add context`,fileReference:`Reference workspace file`,fileReferenceTitle:`Reference workspace file`,fileReferenceDetail:`Add a path reference to the prompt without uploading file contents.`,fileReferenceLabel:`Workspace file path`,fileReferencePlaceholder:`src/app.tsx`,fileReferenceValidatedHint:`The current Session verifies that this is a readable workspace file.`,fileReferenceDraftHint:`This path will be resolved by Pi after the new Session starts.`,fileReferenceChecking:`Checking…`,fileReferenceFailed:`Could not verify this file.`,fileReferenceDenied:`Choose a file inside the current Session workspace.`,fileReferenceMissing:`This workspace file no longer exists.`,fileReferenceUnsupported:`Only regular workspace files can be referenced.`,fileReferenceExpired:`The active Session changed. Reopen the file reference and try again.`,fileReferenceBusy:`File validation is busy. Try again shortly.`,insertReference:`Insert reference`,commandsSessionRequired:`Slash commands are available after the Session starts.`,commandsEmptyDraftOnly:`Slash commands can be inserted only into an empty draft.`,commandsLoading:`Loading commands...`,commandsUnavailable:`Commands are temporarily unavailable.`,commandsNoMatch:`No matching commands.`,commandsNoAvailable:`No discovered commands can run in Web. Type a command name to inspect its availability.`,commandsBounded:`{{count}} more commands are not shown.`,commandSessionRequired:`Commands require an active Web session.`,commandUnsupported:`Not adapted · manual commands still reach Pi`,commandAcceptsArguments:`Accepts arguments`,commandSource_extension:`Extension`,commandSource_prompt:`Prompt template`,commandSource_skill:`Skill`,copiedMessage:`Copied`,copyMessage:`Copy message`,copyFailed:`Copy failed. Please select and copy the message manually.`,copiedCode:`Code copied`,copyCode:`Copy code`,copyCodeFailed:`Could not copy this code. Select and copy it manually.`,codeBlock:`Code block`,wrapCode:`Wrap lines`,expandCode:`Show all {{count}} lines`,collapseCode:`Collapse code`,expandInput:`Expand input`,collapseInput:`Collapse input`,deleteWorkspace:`Delete workspace`,describeTask:`Describe a task`,editMessage:`Edit and rerun from here`,enterHint:`Enter to send, Shift+Enter for a new line.`,expandSidebar:`Expand sidebar`,importWorkspace:`Import workspace`,loadingModels:`Loading models...`,modelsTruncated:`Showing {{shown}} models. {{omitted}} more are available; search to find them.`,searchModels:`Search available models`,searchModelsPlaceholder:`Search provider, model name, or ID...`,searchingModels:`Searching models...`,noMatchingModels:`No matching models`,modelSearchFailed:`Could not search models. Try again.`,retryModelSearch:`Retry model search`,fileReferenceDraftChanged:`The draft changed. Reopen the file reference.`,modelSearchTruncated:`{{omitted}} matching models are not shown.`,modelPreparing:`Preparing task...`,modelRetrying:`Retrying model request...`,modelRunning:`Working…`,modelRequestFailed:`Model request failed`,modelRequestStopped:`Model request stopped`,modelFailureUnknown:`The provider did not return an error reason.`,retryPrompt:`Retry prompt`,retryingPrompt:`Retrying...`,newSession:`New session`,noConversations:`No conversations yet`,noMatching:`No matching conversations`,noMatchingLoaded:`No matching conversations in the loaded history`,noModels:`No models available`,noOutput:`no output`,noSessions:`No sessions`,openSidebar:`Open sidebar`,promptMessage:`Send a message or start a task, / for commands`,promptReadonly:`A non-active session cannot receive prompts`,promptStart:`Choose a workspace to begin.`,promptTask:`Describe what you want to build.`,queuedHint:`The message will be queued after the current turn.`,reconnecting:`Reconnecting`,removeWorkspace:`Remove from sidebar`,workspaceOptions:`Workspace options`,renameFailed:`Could not save the name. Your changes were kept.`,savingName:`Saving...`,workspaceRemoveFailed:`Could not remove the workspace. Try again.`,removingWorkspace:`Removing...`,renameConversation:`Rename conversation`,renameWorkspace:`Rename workspace`,save:`Save`,searchConversations:`Search conversations`,searchPlaceholder:`Filter titles and workspaces…`,selectModel:`Select model`,configureModels:`Configure models`,openModelSettings:`Model settings`,selectThinking:`Select thinking level`,thinkingAvailableLevels:`Available: {{levels}}`,resetThinking:`Restore the opening level ({{level}})`,modelThinkingNotEnabled:`Thinking is not enabled for this model. Enable reasoning support in model settings if your provider supports it.`,providerReasoningHint:`Enable only if the provider supports reasoning. Adjust the active level in the composer.`,providerThinkingLevels:`Supported thinking levels`,providerThinkingLevelsHint:`Choose the levels this model supports. Saving updates the conversation picker.`,providerThinkingAutomatic:`Automatic (Pi defaults)`,providerThinkingSelected_one:`{{count}} level selected`,providerThinkingSelected_other:`{{count}} levels selected`,providerThinkingReset:`Use Pi defaults`,providerImageHint:`When Image is unchecked, the model will not receive image attachments.`,selectWorkspace:`Select workspace`,send:`Send`,processDetails:`Execution details`,processRunning:`Working`,processThinkingCount_one:`{{count}} reasoning note`,processThinkingCount_other:`{{count}} reasoning notes`,processToolCount_one:`{{count}} tool call`,processToolCount_other:`{{count}} tool calls`,processFailureCount_one:`{{count}} failed`,processFailureCount_other:`{{count}} failed`,runtimeActivities:`Activity`,activityAgentProgress:`{{completed}}/{{total}} agents finished`,activityCapacity:`Concurrent tasks: {{running}}/{{limit}} · {{queued}} waiting`,composerQueuedCount:`Queued {{count}}`,composerSteeringCount:`Steering {{count}}`,runtimeActivityRunning_one:`{{count}} running`,runtimeActivityRunning_other:`{{count}} running`,runtimeActivityCount_one:`{{count}} activity`,runtimeActivityCount_other:`{{count}} activities`,processActivityCount_one:`{{count}} agent activity`,processActivityCount_other:`{{count}} agent activities`,switchingSession:`Switching session...`,thinkingActive:`Thinking...`,thinkingActiveLevel:`Thinking ({{level}})...`,thinkingDone:`Thinking`,thinkingLoadFull:`Load full thinking`,thinkingLoadingFull:`Loading thinking…`,thinkingLoadFailed:`Unable to load thinking. Retry`,thinkingPartialText:`Showing part of the saved thinking. More text can be loaded below.`,thinkingPreviewOnly:`Thinking preview reached its limit. The full saved text will be available when this message finishes.`,toolState_running:`Running`,toolState_returned:`Returned`,toolState_failed:`Failed`,toolState_cancelled:`Stopped`,toolState_timed_out:`Timed out`,toolState_unknown:`Unconfirmed`,toolSnapshotMissingResult:`No result at fork`,toolActivity_running:`{{action}}…`,toolActivity_failed:`{{action}} failed`,toolActivity_cancelled:`{{action}} stopped`,toolActivity_timed_out:`{{action}} timed out`,toolActivity_unknown:`{{action}}`,toolAction_read:`Read`,toolAction_write:`Write file`,toolAction_edit:`Edit file`,toolAction_command:`Run command`,toolAction_search:`Search`,toolAction_list:`List files`,toolAction_web:`Browse web`,toolAction_agent:`Agent activity`,subagentAction_spawn:`Start subagent`,subagentAction_send:`Send follow-up`,subagentAction_check:`Check subagent`,subagentAction_wait:`Wait for subagent`,subagentAction_cancel:`Stop subagent`,subagentActionDone_spawn:`Started subagent`,subagentActionDone_send:`Sent follow-up`,subagentActionDone_check:`Checked subagent`,subagentActionDone_wait:`Finished waiting`,subagentActionDone_cancel:`Stop request returned`,toolAction_workflow:`Workflow`,toolAction_plan:`Prepare plan`,toolAction_git:`Review changes`,toolAction_call:`Use tool`,toolActionDone_read:`Read`,toolActionDone_write:`Wrote file`,toolActionDone_edit:`Edited`,toolActionDone_command:`Ran command`,toolActionDone_search:`Searched`,toolActionDone_list:`Listed files`,toolActionDone_web:`Browsed web`,toolActionDone_agent:`Agent activity returned`,toolActionDone_workflow:`Workflow tool returned`,toolActionDone_plan:`Plan tool returned`,toolActionDone_git:`Reviewed changes`,toolActionDone_call:`Used tool`,toolActionGroup_read:`read files`,toolActionGroup_write:`write files`,toolActionGroup_edit:`edit files`,toolActionGroup_command:`run commands`,toolActionGroup_search:`search`,toolActionGroup_list:`list files`,toolActionGroup_web:`browse web`,toolActionGroup_agent:`agent activity`,toolActionGroup_workflow:`workflow activity`,toolActionGroup_plan:`planning`,toolActionGroup_git:`review changes`,toolActionGroup_call:`use tools`,toolGroup_done:`Activity · {{actions}}`,toolGroup_running:`Working · {{actions}}`,toolGroup_unknown:`Activity · {{actions}}`,toolGroupSeparator:`, `,toolSearchTarget:`“{{pattern}}” · {{path}}`,toolDiffStatsHelp:`Added and removed lines in the displayed diff`,toolRequestedFile:`File:`,toolWorkspace:`Workspace`,toolRawEvidence:`Arguments and original result`,toolCodemodeDetails:`Script and original result`,toolNestedOutputMissing:`This session records the call and its status, but not the nested tool output.`,toolNestedArgumentsMissing:`This session omits the full arguments and nested tool output.`,toolNestedIncomplete:`The nested-call record is incomplete; some calls, arguments or final states are unavailable.`,toolPartialEvidence:`Partial output: a byte, line or item limit was reached. The original result may also be truncated.`,toolFileChange_created:`File created`,toolFileChange_unchanged:`No content changes`,toolFileChange_overwritten:`File overwritten`,toolChangeUnavailable:`This result does not include a change comparison.`,toolTestResults:`Reported test results · {{format}}`,toolTestCounts:`{{tests}} tests · {{passed}} passed · {{failed}} failed · {{cancelled}} cancelled`,toolTestCountsHelp:`Counts come from command output. The execution status is shown separately.`,toolReadMore:`Read another range using the path and offset. The original result contains continuation details.`,toolFullOutputReference:`Full output:`,subagentBackgroundResult_one:`Background subagent result · {{count}}`,subagentBackgroundResult_other:`Background subagent results · {{count}}`,thinkingDraftHint:`Choose a workspace and create a session first.`,thinkingInactiveHint:`Only the active session can change its thinking level.`,thinkingLevelMismatch:`The confirmed thinking level is not offered by the current model. Choosing another level will correct it.`,thinkingLockedRunning:`Stop the current turn before changing the thinking level.`,thinkingModelPendingHint:`Wait for the model change to finish.`,thinkingNotConfirmed:`Thinking level was not confirmed. Please try again.`,thinkingPendingHint:`Applying the thinking level...`,thinkingUnsupported:`Thinking is unavailable`,thinkingUnsupportedHint:`No model is selected, or the current model does not support thinking.`,unavailable:`Unavailable`,ungrouped:`Ungrouped`,untitledSession:`New session`,workspaceDeleteConfirm:`The folder and conversation records will be kept. Its conversations will move to Ungrouped.`,workspaceName:`Workspace name`,workspaces:`Workspaces`,sidebarProjects:`Projects`}},zh:{translation:{quitOpenPI:`退出 OpenPI`,quittingOpenPI:`正在退出…`,quitConfirmHelp:`确定退出此 OpenPI Web 应用吗?此 Web 应用中所有正在运行的任务都会停止,对话会保存,重启后可继续查看。`,quitTabHelp:`仅关闭浏览器标签页会让 OpenPI 和任务继续在后台运行。`,quitAccepted:`OpenPI 正在关闭`,quitAcceptedHelp:`退出请求已接受。请等待终端确认 OpenPI 已停止,然后可以关闭此标签页。`,quitRestartHelp:`重新启动:在终端运行 openpi web,或在 Pi 中运行 /web,然后打开显示的地址。刷新此页面不会重启 OpenPI。`,quitFailed:`无法确认是否已关闭。请先检查终端,再重试。也可以在 OpenPI 所在终端按 Ctrl+C 停止应用。`,promptPending:`正在处理请求…`,commandFeedbackTruncated:`这里只显示部分命令结果。请缩小查询范围,或在 TUI 查看完整输出。`,planMode_inactive:`普通模式`,planMode_planning:`规划中 · 禁止写入`,planMode_ready:`计划就绪 · 等待审阅`,planMode_invalid:`计划状态异常 · 禁止写入`,planModeEnter:`进入规划`,promptPlanMessage:`本次对话使用 Plan 模式 · 继续讨论计划,暂不实施`,planModeUnconfirmed:`暂时无法确认 Plan 状态,请刷新后再继续。`,planModeExit:`退出规划`,planModeImplement:`准备实施提示`,planImplementationReplaceDraft:`准备实施会替换当前草稿并关闭规划模式,但不会发送提示词。是否继续?`,commandSupport_plan:`支持规划和准备当前会话的实施提示;新建实施会话仍需使用 TUI。`,commandSupport_setup:`通过当前模型配置,在 Web 回答问题。`,handoffWaiting:`需要你操作`,handoffDone:`已完成`,handoffUnable:`无法完成`,handoffDoneHelp:`已执行操作,接下来由模型验证结果。`,handoffUnableHelp:`未能完成,可以补充遇到的障碍。`,handoffReview:`复核状态`,handoffSubmit:`提交状态`,handoffSignal:`预期结果:`,handoffVerify:`提交完成后,模型仍需验证结果;你的反馈本身不代表验证成功。`,planCardLabel:`开发计划`,planCardReady:`计划已就绪`,planCardResult:`计划结果`,planCardNotApproval:`此步骤仅生成计划,不代表已批准或开始实施。`,planCardCollapse:`收起`,planCardExpand:`展开`,planCardCopy:`复制计划`,planCardCopyPreview:`复制可见预览`,planCardTruncated:`当前仅显示截断预览。`,planCardLoadFull:`加载完整计划`,planCardLoadingFull:`正在加载计划...`,planCardLoadFailed:`无法加载完整计划,重试`,planCardEvidence:`工具结果 · plan_ready`,questionWaiting:`问题`,questionPreview:`查看预览`,questionSkip:`跳过`,questionProgress:`{{current}} / {{total}}`,questionReview:`复核答案`,questionReviewTitle:`确认这些选择?`,questionReviewHelp:`可以返回修改,点击提交后才会发送给助手。`,questionEdit:`修改答案:{{question}}`,questionDismiss:`关闭提问,不提交答案`,questionCustom:`或自行撰写回复`,questionCustomHelp:`留空提交,表示希望助手把问题说清楚或拆小。`,questionYourAnswer:`你的答案`,questionCustomPlaceholder:`说说你的想法…`,questionNotes:`补充说明(选填)`,questionNotesPlaceholder:`补充限制条件,或解释你的选择…`,questionRephrase:`请助手把问题说清楚或拆小`,questionBack:`上一步`,questionNext:`下一题`,questionSubmit:`提交答案`,questionSubmitting:`正在提交…`,questionRetry:`核对提交结果`,questionUncertain:`暂时无法确认是否送达,已保留本次提交的答案。点击核对可恢复结果,不会重复提交。`,questionDisconnected:`正在重新连接… 已保留你的选择,暂时无法提交。`,questionLimit:`每项答案或补充说明不能超过 {{count}} 个 UTF-8 字节。`,questionLoadFailed:`暂时无法读取等待回答的问题。`,questionDraftLimit:`提问草稿已达上限,请缩短或清空已有答案后再添加内容。`,questionRetryLoad:`重试`,questionCloseReceipt:`关闭问答状态提示`,questionState_dismissed:`已关闭提问,没有提交答案。`,questionState_cancelled:`提问已取消,没有提交答案。`,questionState_expired:`提问已过期,没有提交答案。`,questionState_stale:`该提问已失效,请查看对话中的处理结果。`,conversationView:`会话视图`,jumpToLatest:`跳至最新`,historyLoading:`正在加载历史…`,historyOmitted:`还有 {{count}} 条较早记录 · 向上滚动自动加载`,historyChanged:`会话分支已更改,已切换到当前分支的历史。`,historyUnavailable:`历史记录加载失败,请重试。`,historyValidationUnavailable:`无法校验会话历史,请重试。`,historyVerifying:`正在校验会话历史…`,messageLoadFull:`加载完整消息`,messageLoadMore:`加载更多`,messageLoadingFull:`正在加载消息…`,messageLoadFailed:`无法加载这条消息,重试`,filePreview:`文件预览`,changeEvidence:`变更`,changeEvidenceScope:`按所选范围查看当前工作目录的只读 Git 变更。`,turnLabel:`第 {{number}} 轮`,turnState_running:`运行中`,turnState_complete:`已完成`,turnState_failed:`失败`,turnState_interrupted:`已中断`,turnState_waiting:`等待回复`,turnState_forked:`已分叉,可继续对话`,turnChanges:`本轮更改 {{count}} 个文件`,turnChangesPartial:`本轮已记录 {{count}} 个文件`,turnChangesIncomplete:`这一轮的变更记录不完整。`,turnChangesMore:`再显示 {{count}} 个文件`,turnChangesLess:`收起文件`,turnChangesReview:`审阅本轮变更`,turnChangesReviewButton:`审阅`,turnChangesBack:`返回本轮变更`,turnChangesLoading:`正在加载本轮变更…`,turnChangesUnavailable:`无法读取本轮保存的差异。`,messageCopyRequiresFull:`加载完整消息后才能复制。`,filesChanged:`{{count}} 个文件已更改`,reviewChanges:`查看变更`,workspaceChanges:`工作区更改`,overviewChanges:`变更`,overviewLineTotals:`当前 Git 比较范围内的文本新增与删除行数`,overviewPartialTotals:`仅展示已核实的行数,部分文件尚无法统计。点击变更查看详情。`,overviewCounting:`统计中…`,overviewCountsUnknown:`行数未知`,overviewReviewUnavailable:`暂不可用`,sessionSources:`来源`,sourcesAdd:`添加来源`,sourcesDescription:`查看此对话附加的图片与文件`,sourceAttached:`已附加到对话`,sourcesEmpty:`暂无来源`,sourcesFailed:`来源加载失败。`,sourcesViewAll:`查看全部`,sourcesLoadMore:`加载更多来源`,sourcesBack:`返回来源列表`,sourcesPartial:`已达到列表展示上限,更早的来源仍可在对话中查看。`,turnChangesScope:`该轮开始至结束的工作区差异 · 已保存`,turnEdits:`已编辑 {{count}} 个文件`,turnEditsPartial:`已记录 {{count}} 个文件的编辑`,turnEditsScope:`本轮文件工具写入记录 · 已保存;不含命令行与外部修改`,turnEditStatsUnknown:`行数未知`,turnEditReason_before_unavailable:`文件已写入,但该操作未授权读取旧内容,无法提供可靠的前后差异。`,turnEditReason_content_limit:`文件已写入,内容超过已保存对比的大小限制,无法提供准确行数。`,turnEditReason_concurrent_change:`文件在已记录的操作之间发生了变化,无法确认本轮净增删行数。`,gitReviewLoadedCount:`已载入 {{count}} 个文件`,gitReviewPartialLabel:`部分`,gitReviewSearch:`搜索文件路径`,gitReviewExpand:`展开审阅`,gitReviewSearchLoaded:`搜索已载入文件`,gitReviewMarkViewed:`标记 {{path}} 为已查看`,gitReviewMarkCurrentViewed:`标记当前文件 {{path}} 为已查看`,gitReviewViewedLabel:`已查看`,gitReviewViewedProgress:`已查看 {{viewed}} / 已加载 {{loaded}} 个文件`,gitReviewViewedLimit:`本次对比最多保留 {{count}} 个已查看标记。`,gitReviewNoMatch:`没有匹配的文件。`,gitReviewNoLoadedMatch:`已载入文件中没有匹配项。`,gitReviewLoadNext:`载入下一批文件`,gitReviewChanged:`工作区已有变化,请刷新清单后继续载入。`,gitReviewNewVersion:`有新的更改,当前仍显示你正在阅读的版本。`,gitReviewShowLatest:`查看最新差异`,gitReviewBinary:`此二进制文件无法显示文本差异。`,gitReviewBinaryShort:`二进制`,gitReviewPendingStats:`待读取`,gitReviewComparison:`{{current}} 对比 {{base}}`,gitReviewWorkingTree:`工作区对比 HEAD`,gitReviewSessionSnapshot:`自本会话开始后的变更`,gitReviewDetached:`游离 HEAD`,gitReviewLoading:`正在读取 Git 变更…`,gitReviewRetry:`重试`,gitReviewRefresh:`刷新变更`,gitReviewOlderResult:`当前显示上一次读取结果。`,gitReviewNotRepository:`此工作区不是 Git 仓库。`,gitReviewUnborn:`此仓库还没有可读取的 HEAD。`,gitReviewFailed:`无法读取 Git 变更。`,gitReviewTruncated:`结果不完整,部分文件或差异未载入。`,gitReviewEmpty:`当前范围内没有文件变更。`,gitReviewHiddenLines:`另有 {{count}} 行 diff 未显示。`,gitReviewDiffTruncated:`快照已达到大小上限,未加载此文件的 diff。`,gitReviewShowMore:`再显示 {{count}} 个文件`,gitReviewBackToFiles:`返回变更文件`,gitReviewFilePreview:`{{file}} 的差异`,gitReviewNoDiff:`此文件没有可显示的文本差异。`,changeDiff:`变更差异`,diffViewMode:`差异视图`,diffUnified:`统一`,diffSplit:`并排`,diffBefore:`修改前`,diffAfter:`修改后`,diffView:`差异`,gitFileStatus_added:`已新增`,gitFileStatus_modified:`已修改`,gitFileStatus_deleted:`已删除`,gitFileStatus_renamed:`已重命名`,gitFileStatus_copied:`已复制`,gitFileStatus_untracked:`未跟踪`,gitFileStatus_unknown:`已变更`,closePreview:`关闭预览`,imageZoom:`图片缩放`,imageZoomHelp:`缩放相对于适应窗口。Ctrl + 滚轮缩放,放大后可拖动查看。`,zoomIn:`放大图片`,zoomOut:`缩小图片`,previousImage:`上一张图片`,nextImage:`下一张图片`,imagePosition:`第 {{current}} 张,共 {{total}} 张图片`,artifactReadOnly:`只读`,artifactReferenceUnavailable:`此视图无法打开文件预览:{{path}}`,artifactSession:`所属会话 {{sessionId}}`,copyFilePath:`复制文件路径`,filePathCopied:`已复制文件路径`,refreshFile:`刷新文件`,downloadFile:`下载文件`,downloadingFile:`正在下载…`,artifactOlderPreview:`当前显示旧版预览。`,readingFile:`正在读取文件…`,artifactVersion:`版本`,artifactBytes:`{{count}} 字节`,artifactPreviewTruncated:`预览已截断;下载文件可获取完整内容。`,artifactUnsupported:`此类型无法预览,请下载文件。`,filesLargeMarkdownSource:`Markdown 预览较大,已显示为源码以保持滚动流畅。已加载的文字全部保留。`,chatView:`对话`,trajectory:`执行轨迹`,trajectoryScope:`按记录顺序展示会话消息,不表示执行耗时,也不是完整模型请求。`,trajectoryRunning:`任务仍在进行。已保存记录到达后自动更新;实时生成内容可在“对话”中查看。`,trajectoryTruncated:`当前历史不完整:省略 {{entries}} 条记录、{{parts}} 个内容片段,{{messages}} 条消息被截断。`,trajectoryEmpty:`尚无已保存记录。`,trajectoryOrder:`记录顺序`,trajectoryOverview:`总览`,trajectorySequenceHint:`按记录顺序排列 · 宽度不表示执行耗时`,trajectoryClearRange:`清除选区`,trajectoryContextLane:`上下文`,trajectoryModelLane:`模型`,trajectoryToolLane:`工具`,trajectorySelectRecord:`选择记录 {{number}}:{{name}}`,trajectoryTimingTab:`时间`,trajectoryUsageTab:`用量`,trajectoryDurationLabel:`耗时`,trajectoryTimingSource:`数据来源`,trajectoryTimingUnknown:`尚未记录执行耗时。保存时间不等于操作开始时间。`,trajectoryTimingNative:`Pi 嵌套工具执行记录`,trajectoryTTFT:`首段输出等待`,trajectoryGenerationTime:`生成时间`,trajectoryThroughput:`每秒输出 tokens`,trajectoryNotRecorded:`未记录`,trajectoryUsageUnknown:`已加载记录中没有此响应的 token 用量。`,trajectoryUsage_input:`未缓存输入`,trajectoryUsage_cacheRead:`缓存读取`,trajectoryUsage_cacheWrite:`缓存写入`,trajectoryUsage_output:`输出`,trajectoryProvider:`提供商`,trajectoryModel:`模型`,trajectoryCode:`代码`,trajectoryWrap:`自动换行`,trajectoryCopy:`复制原文`,trajectoryCopied:`已复制`,trajectoryRawArguments:`原始 JSON`,trajectoryFoldTurns:`回合`,trajectoryFoldCalls:`工具调用`,trajectoryMetrics:`已加载执行摘要`,trajectoryRequestCount:`{{count}} 次模型响应`,trajectoryToolCount:`{{count}} 次工具调用`,trajectoryModelResponses:`模型响应`,trajectoryToolCalls:`工具调用`,trajectoryLastTurn:`最近已记录回合`,trajectoryEventColumn:`事件`,trajectoryContentColumn:`内容`,trajectoryTurn:`回合 {{number}}`,trajectoryLoadHistory:`加载更早历史`,trajectoryLatestRecords:`回到最新记录`,trajectoryHistoryLoading:`正在加载历史…`,trajectoryNestedOutputMissing:`Pi 已记录此嵌套调用的状态,但未保存其结果正文。外层脚本输出单独保留。`,trajectoryRecordCount:`{{count}} 条记录`,trajectoryMatches:`{{count}} 条匹配`,trajectorySearch:`搜索已加载记录`,trajectoryNoMatches:`没有匹配的记录。`,trajectoryEarlierGroup:`较早上下文`,trajectoryEventCount:`{{count}} 条会话变更`,trajectorySummary:`概览`,trajectoryInputTab:`输入`,trajectoryResultTab:`结果`,trajectoryConversationGroup:`本轮对话`,trajectoryReasoningTitle:`思考`,trajectoryRecordNumber:`记录 {{number}}`,trajectoryRecordInfo:`记录信息`,trajectoryRecordId:`记录 ID`,trajectoryCallId:`工具调用 ID`,trajectoryEventType:`事件类型`,trajectoryEvent_model_change:`切换模型`,trajectoryEvent_thinking_level_change:`调整思考级别`,trajectoryEvent_compaction:`压缩上下文`,trajectoryEvent_session_info:`更新会话信息`,trajectoryEvent_custom:`会话记录`,trajectoryEarlier:`显示更早记录(已加载历史中还有 {{count}} 条)`,trajectoryDetails:`记录详情`,trajectoryRecordedAt:`记录时间`,trajectoryEvidenceTruncated:`此证据在会话投影中已被截断。`,trajectoryArguments:`工具参数`,trajectoryRecordedContent:`已记录内容`,trajectoryThinking:`模型返回的推理内容`,trajectoryOutput:`工具结果`,trajectoryMissingResult:`当前记录中没有可明确配对的结果。这不表示工具仍在运行。`,trajectoryStructured:`结构化结果`,trajectoryEventOnly:`当前仅提供此事件的类型和记录时间。`,trajectory_user:`用户消息`,trajectory_assistant:`助手回复`,trajectory_call:`工具调用`,trajectory_result:`未配对结果`,trajectory_event:`会话事件`,trajectoryRole_user:`用户`,trajectoryRole_assistant:`助手`,trajectoryRole_call:`工具`,trajectoryRole_result:`结果`,trajectoryRole_event:`事件`,trajectory_returned:`工具已返回结果。`,trajectory_error:`工具返回错误`,trajectory_unknown:`尚无法确定结果`,runtimeStatus:`运行状态`,runtimeIdentity:`OpenPI 运行信息`,runtimeIdentityHint:`后端信息在启动时采样,不随之后的磁盘改动或会话重新加载更新,也不证明所有模块的加载版本。前端标识对应当前页面构建。`,runtimeIdentityFailed:`无法读取后端运行信息,请重试。`,runtimeBackendVersion:`后端包版本`,runtimePackageRoot:`后端包目录`,runtimeStartedAt:`进程启动时间`,runtimeGitRevision:`启动时 Git 提交`,runtimeGitState:`启动时工作区状态`,runtimeGitDirty:`存在本地改动`,runtimeGitClean:`干净`,runtimeFrontendVersion:`页面包版本`,runtimeFrontendBuild:`页面构建标识`,runtimeStartupBuild:`后端启动时记录的页面构建标识`,runtimeDevelopmentBuild:`开发服务器(无生产构建标识)`,runtimeBuildMismatch:`当前页面构建与后端启动时记录的构建不同。请刷新页面或重启服务后重新检查。`,refreshStatus:`刷新状态`,openTools:`打开工具`,openToolsUnavailable:`选择会话后可打开工具`,sideConversation:`侧边对话`,sideConversationDescription:`在独立 Pi 会话中追问具体问题,不打断当前主任务。`,workbarChangesDescription:`查看当前目录的未暂存、已暂存、分支或会话变更。`,terminal:`终端`,renameTerminal:`重命名终端`,terminalName:`终端名称`,workbarTerminalDescription:`打开当前工作区的交互式终端。`,restartTerminal:`重新启动终端`,reconnectTerminal:`重新连接终端`,restartTerminalTitle:`重新启动此终端?`,restartTerminalDetail:`当前终端会被关闭,其中运行的进程可能被中断。`,terminalReconnecting:`正在重新连接终端...`,terminalScrollToBottom:`回到底部`,terminalOutputResynced:`终端输出已重新同步`,terminalRestarting:`正在重新启动终端...`,terminalConnecting:`正在启动终端…`,terminalExited:`终端已退出。`,terminalExitCode:`终端已退出,状态码 {{code}}。`,terminalDisconnected:`终端连接意外中断。`,terminalError:`终端不可用。`,terminalLoadError:`终端界面加载失败,请刷新页面后重试。`,reloadPage:`刷新页面`,browser:`浏览器`,sessionFileRecords:`本会话文件记录`,gitReviewSource:`变更范围`,gitReviewBaseBranch:`对比分支`,gitReviewChooseBase:`选择对比分支`,gitReviewSearchBranches:`搜索分支`,gitReviewLocalBranch:`本地分支`,gitReviewRemoteBranch:`远程分支`,gitReviewBranchesTruncated:`显示有数量限制的分支列表,部分分支已省略。`,gitReviewNoMatchingBranches:`没有匹配的分支。`,gitReviewBaseUnavailable:`没有可用的默认对比分支。请选择分支以审阅已提交的变更。`,gitReviewBaseInvalid:`所选对比分支已不可用,请选择其他分支。`,gitReviewUnstaged:`未暂存(含未跟踪)`,gitReviewStaged:`已暂存变更`,gitReviewBranch:`分支变更`,gitReviewFileMissing:`此文件在当前范围内已无变更,请刷新文件列表。`,artifactExternalAccess:`此文件位于其他工作目录。可为当前会话授权只读打开这一个文件,不会开放其他文件的访问。`,artifactAuthorizeFile:`只读打开此文件`,sideConversationPending:`正在准备侧边会话…`,resizeSidebar:`调整侧边栏宽度`,resizePanes:`调整面板宽度`,resizeWorkbar:`调整工具栏宽度`,browserPasteTooLarge:`每次最多粘贴 {{count}} 个字符。`,browserInputTooLarge:`每次最多输入 {{count}} 个字符。`,browserInputTargetChanged:`输入目标已变化或无法确认,有输入操作未执行。`,workbarBrowserDescription:`在 OpenPI 工作栏内打开并操作网页。`,browserReady:`输入地址开始浏览`,browserStarting:`正在启动内嵌浏览器…`,browserOpened:`已在内嵌浏览器中打开`,browserOpenAgain:`再次打开`,browserOpenFailed:`内嵌浏览器暂不可用。`,browserBack:`后退`,browserForward:`前进`,browserReload:`重新加载`,browserTabs:`网页标签页`,browserNewTab:`新标签页`,browserAddTab:`新建网页标签页`,browserCloseTab:`关闭 {{title}}`,browserTabLimit:`最多打开 {{count}} 个网页标签页`,browserPageTitle:`网页:{{address}}`,browserEnteredAddress:`最近从此地址栏打开的地址`,browserAddressNotAllowed:`请输入不含用户名或密码、且不属于 OpenPI 自身地址的 HTTP(S) 网址。`,browserLocationUnknown:`网页已跳转,新地址无法读取。重新加载会返回你输入的地址。`,browserDirectDescription:`直接浏览网页。不允许嵌入的网站可在外部浏览器打开。`,browserDirectHint:`地址栏仅记录手动打开的地址。网页弹窗在外部浏览器打开;遇到空白页,可点击外部打开。`,browserEnhancedHint:`浏览增强已开启:地址自动同步,普通弹窗链接在内部标签页打开。部分站点限制、登录弹窗和跨站历史仍需外部浏览器。`,files:`文件`,filesExplorer:`工作区文件`,filesSearch:`筛选文件…`,refreshFiles:`刷新文件`,filesWorkspaceActions:`工作区文件操作`,filesCreateMenu:`新建`,filesImportMenu:`导入`,filesMoreMenu:`更多`,filesNewFile:`新建文件`,filesNewDirectory:`新建文件夹`,filesImport:`导入文件`,filesImportFolder:`导入文件夹`,filesImportFolderChoose:`选择要导入的文件夹`,filesImportFolderLimit:`每次最多导入 2,000 个文件和文件夹,目录层级最多 64 层。`,filesSelectMultiple:`多选文件`,filesSelectItem:`选择 {{name}}`,filesSelectedCount:`已选 {{count}} 项`,filesRename:`重命名`,filesNewName:`新名称`,filesMove:`移动`,filesMoveDestination:`目标文件夹(工作区内相对路径)`,filesTrashAction:`移入回收站`,filesTrash:`工作区回收站`,filesTrashDetail:`移除的文件保留在当前工作区,可恢复;不会覆盖同名文件。`,filesTrashEmpty:`暂无已移除文件`,filesTrashUnavailable:`{{count}} 项记录无法核验,内容仍保留在 .openpi-trash 中,暂不能自动恢复。`,filesRestore:`恢复`,filesRestoreItem:`恢复 {{name}}`,filesUndoTrash:`撤销移除`,filesOrganizationResults:`文件操作结果`,filesOperationDone:`完成`,filesRefreshBeforeOrganizing:`请先刷新文件树,再整理这项文件。`,filesImportChoose:`选择要导入的文件`,filesTargetDirectory:`目标目录`,filesWorkspaceRoot:`工作区根目录`,filesFileName:`文件名称`,filesDirectoryName:`文件夹名称`,filesCreate:`创建`,filesCreating:`创建中…`,filesCreated:`已创建:{{path}}`,filesNameInvalid:`请输入单个文件或文件夹名称,不要包含路径分隔符。`,filesNameExists:`此名称已存在,请更换名称;原有文件已保留。`,filesMutationFailed:`写入失败,输入已保留。`,filesWriteUnavailable:`请先切换到此会话,再修改工作区文件。`,filesImportLimit:`每个文件最多 50 MiB,同名文件不会覆盖。`,filesImportTooLarge:`此文件超过 50 MiB 导入上限。`,filesImportDirectoryUnsupported:`不支持导入整个文件夹,请选择其中的文件。`,filesImportResults:`文件导入结果`,filesImportPending:`等待导入`,filesImporting:`导入中…`,filesImported:`已保存到工作区`,filesImportedNoPreview:`已保存。预览上限为 20 MiB;可复制路径,在对话中引用此文件。`,filesClearImported:`清除已完成的导入`,filesRetryImport:`重试导入`,filesPathActions:`{{name}} 的路径操作`,filesCopyRelativePath:`复制相对路径`,filesCopyAbsolutePath:`复制绝对路径`,filesPathCopied:`已复制路径:{{path}}`,filesReadFailed:`无法读取文件。`,filesRetryRead:`重试读取`,filesErrorDetails:`错误详情`,filesReadFailedDetail:`文件列表未能加载,请检查连接后重试。`,filesReadDenied:`当前会话的工作区暂不可访问,或无法确认目录身份。请确认会话与工作区后重试。`,filesSymlink:`符号链接,文件浏览器不会自动跟随`,filesTruncated:`结果不完整,请缩小搜索范围。`,filesNoMatches:`没有匹配的文件`,filesEmpty:`此文件夹为空`,filesChoose:`选择文件进行预览`,filesChooseDetail:`从右侧浏览工作区文件,在这里直接预览。`,filesHideTree:`收起文件树`,filesShowTree:`显示文件树`,filesPreview:`预览`,filesSource:`查看源代码`,filesEdit:`编辑`,filesMode:`文件视图`,filesEditor:`文件编辑器`,filesSave:`保存文件`,filesSaving:`保存中…`,filesSaved:`已保存`,filesUnsaved:`未保存的修改 · 草稿保留在当前窗口`,filesDiscard:`放弃草稿`,filesDiscardConfirm:`放弃此文件尚未保存的修改?`,filesSaveConflict:`磁盘上的文件已改变,编辑草稿已保留。请刷新查看最新内容,核对修改后再保存。`,filesSaveFailed:`保存失败,编辑草稿已保留。请检查文件后重试。`,filesEditLoadFirst:`请先继续读取完整文件,再编辑。`,filesEditUnavailable:`支持编辑工作区内不超过 1 MiB 的 UTF-8 文本,最多保留 16 份未保存草稿。`,filesOutline:`章节目录`,filesDiskVersion:`查看当前磁盘版本`,filesReconcile:`已核对,保留草稿并基于此版本继续编辑`,filesTable:`表格预览`,filesRow:`行`,filesSheets:`工作表`,filesTableTruncated:`当前仅显示部分表格内容;下载原文件可查看完整内容。`,filesOfficeLayout:`文档内容预览;分页和排版可能与 Office 不同。`,filesSlidesLayout:`幻灯片文字与图片预览;主题、图表和动画可能与 PowerPoint 不同。`,filesPreviousPage:`上一页`,filesNextPage:`下一页`,filesZoomOut:`缩小`,filesZoomIn:`放大`,filesZoomReset:`重置缩放`,filesPdfPage:`第 {{page}} 页`,filesDocumentLimit:`此文档超出预览处理范围,请下载后在本地打开。`,filesPreviewFailed:`无法预览此文件,仍可下载后打开。`,filesDiagram:`Mermaid 图表`,filesDiagramLoadError:`图表预览加载失败,已显示源码。刷新页面后可重试。`,filesExpandDiagram:`放大图表`,filesFitImage:`适应宽度`,filesOriginalImage:`原始尺寸`,filesLoadMore:`加载更多`,filesLoaded:`已加载 {{count}} 项`,filesReadMore:`继续读取`,filesContentChanged:`文件已更新。当前阅读内容已保留,可在准备好后刷新。`,workbarFilesDescription:`浏览工作区文件,在文件树旁直接预览。`,backToSideConversations:`返回侧边对话`,continueSideConversation:`继续追问…`,startSideConversation:`提出一个侧边问题…`,sideConversationModelInherited:`新侧边对话使用主会话的模型与思考等级。`,sideConversationModelFixed:`这是当前侧边对话使用的模型。`,stop:`停止`,start:`开始`,browserAddress:`浏览器地址`,browserGo:`打开地址`,openExternalBrowser:`在外部浏览器打开`,invalidBrowserAddress:`请输入有效的 HTTP 或 HTTPS 地址。`,addImages:`添加图片`,addFiles:`添加文件`,fileAttachments:`文件附件`,previewFileAttachment:`预览文件`,fileAttachmentDescription:`文档、表格、PDF、文本、代码及其他文件`,fileAttachmentCount:`最多可添加 {{count}} 个附件。`,fileAttachmentTooLarge:`文件总大小不能超过 50 MB。`,fileAttachmentReadFailed:`无法读取此文件,请检查格式或是否有密码保护。`,fileAttachmentTextReady:`文本已就绪`,fileAttachmentTextTruncated:`部分文本 · 保留原文件`,fileAttachmentOriginalReady:`原文件已就绪`,fileAttachmentExtractionFailed:`未提取文本 · 原文件保留`,fileAttachmentEncodingUnavailable:`无法读取文本编码,原文件字节已保留。`,fileAttachmentDocumentUnavailable:`无法提取文本。文件可能受密码保护或格式暂不支持,原文件字节已保留。`,fileAttachmentNoText:`发送后,代理可通过工具读取原文件;此文件未提取出文本。`,fileAttachmentPreviewTruncated:`预览显示前 20,000 个字符,发送时会附上全部已提取文本。`,fileAttachmentExtractedContent:`已提取文本`,fileAttachmentPromptLabel:`用户提供的文件:`,fileAttachmentPromptTooLong:`消息和文件引用超过输入限制,请缩短消息或减少附件。`,imageAttachmentDescription:`支持 PNG、JPEG、GIF 或 WebP`,imageAttachments:`图片附件`,imageAttachmentsLoading:`正在准备附件…`,commandOpensPanel:`打开面板`,commandPanelArguments:`此命令用于打开面板,不能携带参数或图片。请移除后重试,或直接使用对应面板。`,commandPanelUnavailable:`未能打开面板,已保留命令。`,commandUnavailable_terminal_only:`需要在 Pi 终端界面中使用。`,commandUnavailable_not_integrated:`此扩展命令尚未接入 Web,请在 Pi 终端中使用。`,artifactImagePreviewFailed:`图片预览失败。请刷新文件重试,或下载后查看。`,artifactFileDetails:`文件信息`,turnElapsedRunning:`正在处理 · {{duration}}`,compactionElapsed:`已等待 {{duration}}`,compactionRunning:`正在压缩上下文`,compactionCompleted:`上下文已自动压缩`,compactionFailed:`上下文压缩失败`,compactionInterrupted:`压缩已中断`,compactionUnchanged:`压缩已结束,未生成新的摘要`,compactionUnavailable:`上下文压缩状态暂不可用`,compactionReconnectHelp:`连接已中断,恢复连接后将核实当前状态。`,compactionDraftHelp:`正在压缩上下文,发送的消息会排队等待。`,turnElapsedFinished:`用时 {{duration}}`,composerAdd:`添加`,composerCommands:`指令`,composerFile:`文件`,composerPlan:`计划`,composerCompact:`压缩`,composerModel:`模型`,composerBack:`返回`,composerPlanDescription:`进入或退出计划模式`,composerCompactDescription:`整理之前的对话,释放上下文空间`,composerModelDescription:`选择本会话使用的模型`,compactionQueueWaiting:`等待压缩完成`,compactionQueueBlocked:`消息已保留,可重试或清空队列。`,clearPromptQueue:`取消排队`,queueUpdateFailed:`未能更新队列,请确认当前会话后重试。`,queueStatusUnconfirmed:`请求已接收,但暂时无法确认最新队列状态。请刷新后再操作。`,turnElapsedOutcome_cancelled:`已停止`,turnElapsedOutcome_failed:`失败`,turnElapsedOutcome_uncertain:`结果待确认`,settingsSetupBusyHint:`Agent 配置需等待当前轮次结束;显示设置可直接调整。`,resetChatContentWidth:`恢复默认聊天宽度`,resetChatFontSize:`恢复默认字体大小`,setupResolveAdmission:`请先返回对话,处理尚未确认的消息,再应用设置。`,removeAttachment:`移除附件`,dropImagesHere:`将文件或图片拖到这里`,imageAttachmentCount:`最多可添加 {{count}} 张图片。`,imageAttachmentTooLarge:`单张图片不能超过 10 MB。`,imageAttachmentTotalTooLarge:`图片总大小不能超过 32 MB。`,imageAttachmentUnsupported:`仅支持有效的 PNG、JPEG、GIF 和 WebP 图片。`,imageAttachmentReadFailed:`无法读取此图片,请重新添加重试;消息内容已保留。`,attachedImage:`已附加图片`,previewAttachment:`预览图片`,closeImagePreview:`关闭图片预览`,imagePreviewFailed:`无法显示这张图片。`,fitImage:`适应窗口`,originalImageSize:`原始尺寸`,imageViewMode:`图片查看`,sessionUsage:`会话 Token 用量`,sessionInputTokens:`输入 Token`,sessionOutputTokens:`输出 Token`,sessionCacheTokens:`缓存 Token`,sessionContextUsage:`上下文占用与窗口大小`,usageContextLabel:`上下文`,usageUnknown:`未知`,usageOpenDetails:`输入 {{input}} · 输出 {{output}} · 上下文 {{percent}} / {{capacity}} · 查看会话用量`,usageContextHelp:`当前分支的估算占用 / 模型上下文容量上限。`,usageSessionTotals:`累计用量`,usageInputLabel:`输入`,usageOutputLabel:`输出`,usageCacheReadLabel:`缓存读取`,usageCacheWriteLabel:`缓存写入`,usageTotalLabel:`总计`,usageWorkspaceLabel:`工作区`,usageSessionId:`会话 ID`,usageTotalsHelp:`本会话累计 Token 用量,包含缓存。`,subagentDetails:`子代理`,sessionOverview:`会话概览`,sessionOverviewChanges:`当前审阅范围的更改`,subagentSummaryRunning:`{{count}} 运行中`,subagentSummaryDone:`{{count}} 完成`,subagentSummaryOther:`{{count}} 其他记录`,subagentNoneYet:`暂无子代理`,subagentOtherGroup:`失败 / 已中断`,subagentShowMore:`再显示 {{count}} 个`,backToSubagents:`返回子代理列表`,subagentActiveGroup:`已开启`,subagentFinishedGroup:`完成`,subagentNoneRunning:`暂无正在运行的子代理。`,subagentNoneFinished:`任务结束后会显示在这里。`,subagentProgress:`子代理:{{running}} 运行中 · {{completed}} 已完成`,subagentSummaryUnknown:`{{count}} 个状态未确认`,subagentTasks:`子代理任务列表`,inspectSubagent:`打开子代理:{{name}}`,subagentState_running:`运行中`,subagentProcessing:`处理中`,subagentState_done:`已完成`,subagentState_error:`失败`,subagentState_interrupted:`已中断`,subagentStarting:`正在启动…`,subagentSpawnFailed:`启动失败`,subagentStateUnavailable:`已启动 · 状态未保留`,subagentSpawnReceipt:`启动回执`,subagentSpawnReceiptHint:`此回执仅确认启动请求,不表示子代理任务已完成。`,subagentTask:`分配的任务`,subagentTranscript:`子代理对话`,subagentResult:`执行结果`,subagentSpend:`累计 token 消耗`,subagentSaved:`已保存记录`,subagentRecordedState:`最后记录的状态`,subagentSavedHint:`来自当前父会话已保存的回执;结果可能包含同批其他任务,并非子代理的完整实时对话。`,subagentReadOnly:`只读查看 · 关闭此面板不会停止任务`,subagentUnavailable:`当前会话已无法提供此子代理的实时详情。启动回执不代表任务已完成。`,subagentStale:`刷新失败,下方保留的是上次收到的状态。`,subagentNoMessages:`暂未收到消息。`,subagentTranscriptUnavailable:`此视图仅保留任务摘要,无法显示完整子代理对话。`,subagentWorkflowsTruncated:`另有 {{count}} 个 workflow 未包含在当前列表中,其任务数量未知。`,subagentState_unknown:`未确认`,subagentUnconfirmedGroup:`未确认`,subagentTruncated:`当前显示最近的消息,另有 {{count}} 条较早消息未包含在此视图中。`,subagentTextTruncated:`部分较长内容仅显示节选。`,subagentListTruncated:`另有 {{count}} 个任务未包含在当前列表中。`,subagentThinkingRedacted:`服务商已隐藏此段思考内容。`,inspectionChanged:`当前会话已切换,请重新打开详情。`,inspectionUnavailable:`暂时无法读取详情。`,inspectionLoading:`正在读取状态…`,thinkingUnavailable:`暂时无法读取思考等级。`,trustUnavailable:`暂时无法读取项目信任状态。`,copySetupCommand:`复制配置命令`,savedTrustDecision:`已保存决定`,activeSessionTrust:`当前会话信任`,trustDecision_trusted:`已信任`,trustDecision_denied:`已拒绝`,trustDecision_undecided:`未决定`,trustDecision_unknown:`未知`,trustActiveYes:`当前会话已信任`,trustActiveNo:`当前会话未信任`,modelAndThinking:`模型与思考`,selectedModel:`当前模型`,thinkingLevel:`思考等级`,availableThinking:`支持的等级`,unknownState:`未知`,projectTrust:`项目信任`,trust_trusted:`当前会话信任此工作区。`,trust_untrusted:`此工作区的信任已被拒绝。`,trust_restricted:`项目资源受到限制,等待信任决定。`,trust_unknown:`尚无法确定信任状态。`,trustRefreshNeeded:`保存的信任决定与当前会话不同,请通过 Pi 刷新会话后生效。`,providerAvailability:`服务商凭据`,settings:`设置`,settingsNavigation:`设置导航`,generalSettings:`常规`,configurationSettings:`配置`,configurationIntro:`配置工具权限、网络访问与模型响应。`,configurationReadFailure:`无法安全读取配置。请修复设置文件后刷新。`,configurationUserScope:`用户配置`,configurationSetupHint:`响应与搜索选项通过 OpenPI setup 应用`,configurationApproval:`批准策略`,configurationApprovalDetail:`工具审批沿用已安装 Pi 扩展的权限机制。`,configurationPiPermissions:`由 Pi 扩展管理`,configurationSandbox:`沙箱设置`,configurationSandboxDetail:`工具使用宿主进程的权限运行。`,configurationSandboxUnavailable:`未提供 OS 沙箱`,configurationSearchDetail:`允许当前会话模型在支持时访问网络。`,configurationSearchOff:`不向当前模型提供原生搜索。`,configurationSearchOn:`在当前连接支持时允许原生搜索。`,configurationVerbosity:`输出详细程度`,configurationVerbosityDetail:`选择模型回复包含细节的详细程度。`,configurationResponsesUnavailable:`当前连接未使用支持的 Responses 接口。`,configurationVerbosity_default:`模型默认`,configurationVerbosity_low:`简短`,configurationVerbosity_medium:`适中`,configurationVerbosity_high:`详细`,configurationVerbosityHelp_low:`简短直接地回答,减少额外细节。`,configurationVerbosityHelp_medium:`给出必要解释与适量细节。`,configurationVerbosityHelp_high:`提供更完整的解释与细节。`,configurationVerbosityRequest:`只把 response_verbosity 设为 {{value}},保留其他 OpenPI 配置。`,configurationSummary:`推理摘要`,configurationSummaryDetail:`选择向支持的推理模型请求哪种摘要。`,configurationSummaryUnavailable:`当前连接不支持推理摘要。`,configurationSummary_default:`模型默认`,configurationSummary_auto:`自动`,configurationSummary_concise:`简洁`,configurationSummary_detailed:`详细`,configurationSummary_none:`关闭`,configurationSummaryHelp_auto:`由模型自动选择摘要长度。`,configurationSummaryHelp_concise:`请求简洁的推理摘要。`,configurationSummaryHelp_detailed:`请求较详细的推理摘要。`,configurationSummaryHelp_none:`不请求推理摘要;保留当前推理强度。`,configurationSummaryRequest:`只把 response_reasoning_summary 设为 {{value}},保留其他 OpenPI 配置。`,configurationModelFeatures:`模型功能`,configurationReasoningLevels:`可用推理强度`,configurationReasoningDetail:`选择在模型控件中显示哪些级别。控件只显示当前模型支持的档位,当前档位始终保留。`,configurationReasoningCount:`已选择 {{count}} 个`,configurationDependencies:`工作空间依赖项`,configurationEnvironment:`本地运行环境`,configurationEnvironmentDetail:`Node.js、Python 等工具由当前环境提供。OpenPI 不安装捆绑的工作空间运行时。`,configurationRuntimeStatus:`运行状态`,browserSettings:`浏览器`,webSearchSettings:`联网搜索`,webSearchCurrentModel:`当前会话模型`,webSearchNativeDetail:`调用当前模型供应商的原生搜索,复用现有连接和凭据。`,webSearchSupported:`当前连接支持原生搜索。开启后,由模型决定何时联网。`,webSearchUnsupported:`当前连接不支持或尚未确认支持原生搜索,不提供搜索工具,也不会切换到其他供应商。`,webSearchNativeRequest:`开启联网搜索,使用当前会话模型的原生搜索和已有 Pi 凭据。不要切换模型、连接协议或搜索供应商;当前连接不支持或支持情况未知时,不提供搜索工具。`,webSearchIntro:`让模型搜索最新资料,并打开原始网页核实。`,webSearchPackageDetail:`通过可选 Pi 插件提供搜索、网页读取和 PDF 提取。`,webSearchDefaultOff:`默认关闭。可选扩展跟随当前会话模型,无需另填搜索密钥或安装插件。`,webSearchLoaded:`本会话已加载插件`,webSearchNotLoaded:`本会话尚未加载插件`,webSearchSource:`查看插件源码`,webSearchProfile:`搜索设置`,webSearchExa:`Exa — 无需 API 密钥`,webSearchExisting:`保留我已有的搜索偏好`,webSearchProfileHint:`Exa 提供搜索,网页由本机直接读取。已有偏好会原样保留;安装后也可更换搜索服务。`,webSearchEnable:`启用联网搜索…`,webSearchDisable:`关闭联网搜索…`,webSearchConfigure:`更换搜索服务…`,webSearchExaRequest:`启用可选联网搜索,使用 Pi Web Access 和无需 API 密钥的 Exa。让我审阅插件安装确认,保留其他偏好,不要自动重新加载。`,webSearchExistingRequest:`启用可选联网搜索,使用 Pi Web Access,原样保留我已有的搜索偏好。让我审阅插件安装确认,保留其他偏好,不要自动重新加载。`,webSearchDisableRequest:`关闭原生联网搜索。保留其他设置和会话记录。`,webSearchProviderRequest:`帮我更换已安装 Pi Web Access 插件的搜索服务。介绍可用服务与权限,保留无关偏好,密钥留在搜索插件中,不要自动重新加载。`,browserSettingsIntro:`让 OpenPI 阅读网页、点击、输入和截图。`,browserControl:`浏览器控制`,browserControlHint:`提交设置变更请求,保存配置后生效。`,browserDefault:`默认浏览器`,browserDefaultHint:`提交设置变更请求,选择未指定浏览器时使用的默认项。`,browserEmbedded:`OpenPI 内置浏览器`,browserAllowedTitle:`允许使用的浏览器`,browserOffHint:`下方选择将在开启浏览器控制后生效。`,browserConnected:`已连接`,browserNeedsSetup:`需要连接浏览器扩展`,browserNotFound:`未检测到此浏览器`,browserUpdateNeeded:`需要更新扩展`,browserBlocked:`未授权`,browserDefaultBlocked:`当前默认浏览器未获授权,请允许使用或更换默认值。`,browserSetUp:`设置`,browserManage:`管理`,browserSetupNamed:`设置 {{browser}}`,browserManageNamed:`管理 {{browser}}`,browserAllowNamed:`允许使用 {{browser}}`,browserMore:`更多浏览器`,browserSpeakHint:`对话中说“使用 Chrome …”,即可指定这次使用的浏览器。`,browserGuideTitle:`连接 {{browser}}`,browserGuideEyebrow:`跟着做,一次一步`,browserConnectionTitle:`连接状态`,browserCloseGuide:`收起浏览器设置引导`,browserConnectionReady:`连接正常,可选择是否允许 OpenPI 使用。`,browserEmbeddedDetail:`网页在 OpenPI 内打开。部分网站需要使用普通浏览器才能登录或正常显示。`,browserExternalDetail:`OpenPI 可以使用已连接的 {{browser}} 配置中的现有标签和登录状态。请在该配置中保留一个 OpenPI 标签页。`,browserManageExtension:`管理扩展`,browserAllowUse:`允许 OpenPI 使用`,browserMakeDefault:`设为默认`,browserInstallIn:`安装到`,browserInstallTitle:`安装 OpenPI Browser Bridge`,browserSetupSteps:`设置步骤`,browserGuidePopout:`在独立窗口中跟随操作`,browserGuideDetached:`引导已在独立窗口打开,可以对照浏览器设置逐步完成。`,browserShowGuide:`显示引导窗口`,browserGuideInline:`把引导放回这里`,browserGuideBlocked:`未能打开引导窗口。可允许弹出式窗口后重试,也可继续查看这里的步骤。`,browserSafariSettings:`Safari → 设置`,browserSafariDeveloper:`开发者设置`,browserSafariTemporary:`添加临时扩展…`,browserSafariOpenHint:`打开 Safari 后,在菜单栏选择「Safari → 设置」,对照此引导操作。需要 macOS 上的 Safari 26 或更新版本。`,browserSafariDeveloperTitle:`显示 Safari 开发者设置`,browserSafariDeveloperHint:`在「设置 → 高级」中开启「显示网页开发者功能」,再进入「开发者」标签。`,browserSafariLoadHint:`在「开发者」中点击「添加临时扩展」,选择下方文件夹。启用 OpenPI Browser Bridge,允许访问要控制的网站及本地 OpenPI 页面。退出 Safari 后需重新加载临时扩展。`,browserFirefoxThis:`此 Firefox`,browserFirefoxTemporary:`临时载入附加组件…`,browserFirefoxDeveloperTitle:`选择「此 Firefox」`,browserFirefoxDeveloperHint:`在 about:debugging 左侧选择「此 Firefox」。Firefox 不需要开启「开发者模式」开关。`,browserFirefoxLoadHint:`点击「临时载入附加组件」,选择下方文件夹中的 manifest.json。此安装在 Firefox 重启后失效;永久安装需要经过 Mozilla 签名的扩展包。`,browserFirefoxDone:`已选中,下一步`,browserStepCount:`第 {{step}} 步,共 {{total}} 步`,browserStepLabel:`第 {{step}} 步:{{label}}`,browserStepOpen:`打开扩展页`,browserStepAdd:`添加扩展`,browserStepConnect:`连接`,browserOpenManagerTitle:`打开 {{browser}} 扩展页`,browserOpenManagerHint:`接下来会打开 {{browser}}。在扩展页完成操作后,回到这里继续。`,browserOpenManager:`打开 {{browser}} 扩展页`,browserReopenManager:`重新打开扩展页`,browserAlreadyInstalled:`已经安装?直接连接`,browserDeveloperMode:`开发者模式`,browserDeveloperTitle:`开启「开发者模式」`,browserDeveloperHint:`在扩展页开启「开发者模式」,页面会出现「{{loadLabel}}」按钮。`,browserDeveloperDone:`已开启,下一步`,browserIllustration:`操作示意 · 在 {{browser}} 中完成`,browserExtensions:`扩展程序`,browserLoadUnpacked:`加载未打包的扩展程序`,browserLoadHint:`扩展已准备在本机,按下面的顺序在 {{browser}} 中载入。`,browserCopyLocation:`复制下面的路径`,browserLocateTarget:`找到本机的扩展文件夹`,browserRevealTarget:`定位扩展文件夹`,browserLocateManifest:`找到扩展中的 manifest.json`,browserRevealManifest:`定位 manifest.json`,browserDragToBrowser:`把文件夹拖到 {{browser}} 扩展页`,browserDragFolderHint:`将文件管理器中的 {{folder}} 整个文件夹拖到扩展页,保持「开发者模式」开启。`,browserSelectLocatedTarget:`在浏览器弹出的选择窗口中,选择上一步定位的项目。`,browserManualInstall:`无法拖入?使用路径选择`,browserManualSelection:`找不到?使用路径选择`,browserLoadInBrowser:`在 {{browser}} 点击「{{loadLabel}}」`,browserLoadAlternate:`部分版本显示为「加载已解压的扩展程序」或 Load unpacked。`,browserConfirmFolder:`选择`,browserConfirmFile:`打开`,browserSelectFolderHint:`选择整个文件夹,不要选择里面的 .js 文件。`,browserSelectManifestHint:`只选择 manifest.json,不要选择 .js 文件。`,browserInstallCheckpoint:`在扩展列表看到 OpenPI Browser Bridge 卡片后,再继续连接。`,browserPathCopied:`已复制路径`,browserCopyFailed:`未能复制,请选中上方路径手动复制。`,browserChooseFolderMac:`按 ⌘ ⇧ G,粘贴刚复制的路径并按回车定位,再点击「{{confirm}}」。`,browserChooseFolderOther:`在选择窗口的地址栏粘贴刚复制的路径并回车,再点击「{{confirm}}」。`,browserInstalledConnect:`已添加,连接 OpenPI`,browserPreviousStep:`上一步`,browserWaiting:`等待 OpenPI Browser Bridge 连接,连接后会自动进入下一步。`,browserInstallBrowserFirst:`请先安装 {{browser}},或在已安装的浏览器中打开当前 OpenPI 地址。`,browserConnectTitle:`连接 OpenPI`,browserConnectHint:`在 {{browser}} 中打开 OpenPI,使用刚安装扩展的浏览器配置。`,browserOpenIn:`在 {{browser}} 中打开`,browserAllowHint:`连接成功后,可以允许 OpenPI 使用此浏览器。安装扩展不会自动开启浏览器控制。`,browserCheck:`检查连接`,browserNotConnectedYet:`还未连接。请完成安装,在该浏览器中刷新 OpenPI 后再次检查。`,browserHelp:`设置帮助`,browserReloadHint:`已安装旧版?在扩展页重新加载 OpenPI Browser Bridge,再刷新 OpenPI。如浏览器提示权限,请完成其原生确认。`,browserSupportedHint:`Chrome、Edge、Brave、Chromium 145+ 可控制内置页面及普通标签。macOS Safari 26+、Firefox 128+ 通过兼容扩展控制普通标签,嵌套框架需单独打开。Safari、Firefox 的临时安装需在浏览器重启后重新加载。`,browserCopyPath:`复制路径`,browserOpening:`正在打开浏览器…`,browserLoading:`正在检查浏览器连接…`,browserSaved:`已保存,浏览器权限立即生效。`,browserSaving:`正在处理…`,modelSettings:`模型`,skillsSettings:`技能`,subagentsSettings:`子代理`,pluginsSettings:`插件`,configureOpenPi:`配置 OpenPI`,setupRequestReviewAll:`和我一起检查全部 OpenPI 配置项`,setupRequestSetTheme:`仅将 OpenPI Web 主题设置为 {{value}},其他配置保持不变`,setupRequestSetChatWidth:`仅将 OpenPI Web 聊天内容宽度设置为 {{value}}px,其他配置保持不变`,setupRequestSetChatFontSize:`仅将 OpenPI Web 聊天字体大小设置为 {{value}}px,其他配置保持不变`,setupRequestEnableExpandedThinking:`仅将 OpenPI Web 的思考块改为默认展开,其他配置保持不变`,setupRequestDisableExpandedThinking:`仅将 OpenPI Web 的思考块改为默认折叠,其他配置保持不变`,setupRequestSubagents:`检查并配置 Agent 角色模型和工作流上限`,setupRequestFailed:`OpenPI 配置请求未被接收。`,setupRequestRunning:`正在应用 OpenPI 设置…`,setupRequestAccepted:`配置请求已接收。`,setupPlanBlocked:`Agent 配置需先退出 Plan 模式;显示设置可直接调整。退出不会开始实施计划。`,setupPlanBusy:`Agent 配置需等待当前回合结束并退出 Plan 模式;显示设置可直接调整。`,setupOutcome_pending:`配置请求正在处理,尚未收到保存回执。`,toolCallArguments:`工具参数`,toolCallOutput:`工具结果`,setupOutcome_saved:`OpenPI 配置已保存并应用。`,setupOutcome_unchanged:`配置已保存,实际设置没有变化。`,setupOutcome_failed:`配置请求失败,请查看错误和当前设置后再重试。`,setupOutcome_cancelled:`配置过程已取消,未确认成功保存。`,setupOutcome_unconfirmed:`本次未确认成功保存,请核对当前设置后再运行 /openpi-setup。`,settingsUpdateFailed:`无法保存 Web 显示设置。`,settingsPreferencesSaved:`偏好设置已保存。`,settingsPreferencesSaveFailed:`无法保存显示设置,请检查配置诊断后重试。`,settingsCatalogLoading:`正在加载 Pi 资源…`,settingsCatalogFailed:`无法加载 Pi 设置资源。`,appearance:`外观`,settingsPersonal:`个人`,settingsAgent:`Agent`,settingsIntegrations:`集成`,settingsArchivedChats:`已归档聊天`,settingsSearch:`搜索设置`,settingsClearSearch:`清除搜索`,settingsNoResults:`没有匹配的设置`,appearanceVisualStyle:`视觉风格`,appearanceMode:`模式`,appearanceTheme:`主题`,appearanceAccent:`强调色`,appearanceBackground:`背景`,appearanceForeground:`前景`,appearanceFont:`字体`,appearanceFont_codex:`Codex 默认`,appearanceFont_sans:`无衬线`,appearanceFont_serif:`衬线`,appearanceFont_mono:`等宽`,appearanceAccent0:`默认`,appearanceAccent1:`蓝色`,appearanceAccent2:`紫色`,appearanceAccent3:`粉色`,appearanceAccent4:`橙色`,appearanceAccent5:`绿色`,appearanceCustomAccent:`自定义强调色`,appearanceAdvanced:`高级`,appearanceReset:`恢复默认设置`,appearanceResetAction:`重置外观`,appearanceImport:`导入主题`,appearanceCopy:`复制主题`,appearanceCopied:`主题已复制`,appearanceCopyFailed:`无法复制主题,请重试。`,appearanceThemeValue:`主题数据`,appearanceImportPlaceholder:`粘贴 OpenPI 主题…`,appearanceImportInvalid:`请输入有效的 OpenPI 主题数据。`,appearanceImportAction:`导入`,searchArchivedChats:`搜索已归档聊天`,archiveProjectFilter:`按项目筛选`,archiveAllProjects:`所有项目`,archiveProjectGroup:`{{project}} · {{count}} 条归档聊天`,archiveSort:`归档聊天排序`,archiveSortUpdated:`最近更新`,archiveSortCreated:`创建时间`,restoreArchivedChat:`恢复 {{title}}`,themeLight:`浅色`,themeDark:`深色`,themeMist:`雾青`,themeRose:`蔷薇`,themePine:`松夜`,themeSystem:`跟随系统`,conversationSettings:`对话`,expandThinkingByDefault:`默认展开思考块`,chatContentWidth:`聊天内容宽度`,chatFontSize:`聊天字体大小`,agentBehavior:`Agent 行为`,workflowLimits:`工作流上限`,workflowConcurrency:`工作流并行上限`,workflowCalls:`总调用次数`,agentSettingsSetupHint:`Agent 设置通过当前会话中的 /openpi-setup 生效。`,setupRequestLimits:`将工作流并行上限设置为 {{concurrency}},总子代理调用上限设置为 {{calls}},保留其他配置。`,setupRequestEnableSuggestions:`启用下一步建议。如需模型配置,请帮助我选择模型,保留其他配置。`,setupRequestDisableSuggestions:`关闭下一步建议,保留其他配置。`,setupRequestPostEdit:`帮我配置或关闭编辑后命令。先展示当前配置,再询问要使用的命令。`,configurePostEdit:`配置编辑后命令`,workflowLimitsValue:`并行 {{concurrency}} · 总调用 {{calls}}`,nextActionSuggestions:`下一步建议`,nextActionSuggestionsDetail:`当前任务结束后,提供几个可选择的下一步操作。`,enabled:`已启用`,disabled:`已关闭`,configured:`已配置`,postEditCommand:`编辑后命令`,postEditCommandDetail:`编辑完成后运行一个命令;关闭时不会执行任何命令。`,resultDisplay:`默认结果显示`,subagentResults:`子代理结果`,bashOperations:`Bash 操作`,fileMutations:`Write / Edit 操作`,footer:`页脚`,terminalFooter:`Pi 终端页脚`,terminalFooterStyle:`终端页脚样式`,terminalFooterHint:`影响 Pi 命令行界面的页脚;已打开的 Pi 界面在下次启动或配置应用后更新。`,detailDisplay_full:`完整`,detailDisplay_compact:`紧凑`,sessionSettings:`会话`,currentModel:`当前`,providerCurrentSessionModel:`当前会话使用 {{model}}。`,useThisModel:`使用此模型`,model:`模型`,modelConnection:`模型连接`,provider:`服务商`,modelId:`模型 ID`,providerStatusUnavailable:`此服务商不在当前有界认证快照中。`,providerSettings:`服务商凭据`,providerSettingsIntro:`查看当前 Web 会话可通过哪些 Pi 服务商完成认证。`,openRuntimeDetails:`打开运行详情`,currentWorkspace:`当前工作区`,providerAuth_api_key:`API 密钥`,providerAuth_oauth:`OAuth`,providerAuthUnknown:`未报告认证方式`,authentication:`认证方式`,accessType:`访问方式`,providerAccessSubscription:`订阅账户`,providerAccessStandard:`服务商凭据`,configurationOwner:`配置归属`,providerLoading:`正在加载服务商状态…`,providerLoadFailed:`无法加载服务商状态。`,providerReadOnly:`由 Pi 管理`,selectProvider:`选择服务商`,gitReviewBaselineUnavailable:`未保留可用的会话基线,可能超出了捕获限额。请切换到未暂存、已暂存或分支查看 Git 变更,也可打开本会话文件记录。`,modelsIntro:`登录账户或添加 API 密钥。已有的 Pi 连接也会显示在这里。`,modelConnectionsTitle:`模型连接`,modelConnectionsIntro:`管理连接凭据,选择新会话和当前会话使用的模型。`,accountLoginMethod:`连接方式`,accountLoginTab:`账户登录`,accountLoginChatGPT:`ChatGPT 账户`,accountLoginClaude:`Claude 账户`,accountLoginKeyTab:`API 密钥`,accountLoginConfigured:`账户已登录`,accountLoginIntro:`在浏览器中完成授权,无需填写 API 密钥。`,accountLoginExisting:`账户凭据已保存在 Pi 中。`,accountLoginStart:`登录`,accountLoginAgain:`重新登录`,accountLoginUnsaved:`请先保存或放弃其他修改,再登录账户。`,accountLoginStarting:`正在准备登录…`,accountLoginWaiting:`等待账户授权`,accountLoginChoose:`选择登录方式`,accountLoginCancelling:`正在取消登录…`,accountLoginBrowser:`在浏览器中继续`,accountLoginDevice:`使用设备码登录`,accountLoginBrowserOption:`在当前电脑上登录,完成后自动返回。`,accountLoginDeviceOption:`适合远程服务器,或无法自动返回的情况。`,accountLoginBrowserHelp:`打开登录页并完成授权,这里会自动更新。`,accountLoginDeviceHelp:`打开授权页并输入下方代码,请保持此页面打开。`,accountLoginOpen:`打开登录页`,accountLoginCopyCode:`复制设备码`,accountLoginPaste:`授权码或回调地址`,accountLoginContinue:`继续`,accountLoginFallback:`已登录,但这里没有更新?`,accountLoginRemoteHelp:`如果无法自动返回,请复制浏览器最后的回调地址,并粘贴到下方。`,accountLoginCancel:`取消登录`,accountLogin_failed:`登录未完成,请重试或选择其他登录方式。`,accountLogin_expired:`登录已过期,请重新开始获取新的授权链接。`,accountLogin_cancelled:`已取消登录。`,accountLoginRequestFailed:`请求未完成,请先刷新状态再重试。`,accountLoginStatusUnknown:`暂时无法查询登录状态,账户授权可能仍在进行。`,accountLoginRefreshRequired:`凭据已保存,但 Pi 未能更新模型列表。请重载 Pi 后使用此连接。`,accountLogout:`退出登录`,accountLogoutRefreshRequired:`已移除保存的凭据,但 Pi 未能更新模型列表。请重载 Pi 刷新状态。`,accountLogoutTitle:`退出 {{provider}}?`,accountLogoutDetail:`将移除此电脑上 Pi 保存的该服务凭据,其他使用它的 Pi 会话也需要重新登录。环境凭据不受影响。`,providerInputTypes:`输入类型`,providerInputText:`文本`,providerInputImage:`图片`,providerCustomTag:`自定义`,providerEdit:`编辑`,providerRemove:`删除`,providerSave:`保存`,editProvider:`编辑 {{provider}}`,removeProvider:`删除 {{provider}}`,providerAdd:`添加模型提供商`,providerAddMode:`添加方式`,providerAddCatalog:`第三方模型提供商`,providerAddCustom:`自定义模型 API`,providerAccountHint:`使用已有账户连接模型,选择服务商后前往浏览器授权。`,providerCatalogHint:`从内置目录中选择提供商,填入其 API 密钥即可使用。`,providerCustomHint:`连接中转站、自部署服务或其他兼容 OpenAI / Anthropic 协议的接口,需填写 API 地址、协议和模型。`,providerKeyKeep:`已配置密钥,留空保持不变`,providerKeyOptional:`输入 API 密钥,或留空使用环境认证`,providerDisplayName:`提供商名称`,providerCustomSettings:`自定义设置`,providerSaved:`已保存 {{provider}}。`,modelDefaultTitle:`新会话默认模型`,modelDefaultChoose:`选择模型`,modelDefaultBadge:`默认`,modelCurrentBadge:`当前使用`,modelDefaultNotSet:`未设置 · 新会话启动时由 Pi 选择`,modelDefaultHint:`选择以后新会话使用的模型,已有会话保留自己的选择。此设置也会更新 Pi 的默认模型。`,modelDefaultReadFailed:`暂时无法读取默认模型。`,modelDefaultProjectOverride:`此工作区有 Pi 独立设置:{{model}}。`,modelDefaultSave:`保存默认模型`,modelMakeDefault:`同时设为新会话默认模型`,modelDefaultSaveFailed:`默认模型保存尚未确认,请刷新状态后重试。`,modelDefaultPartial:`当前模型已切换,但默认模型保存尚未确认,请刷新状态后再试。`,modelConnectionNextHint:`从此连接选择一个模型,用于当前会话。`,modelConnectionSearch:`搜索模型…`,modelConnectionChooseProvider:`选择 {{provider}} 的模型`,modelConnectionUse:`用于当前会话`,modelConnectionUseFailed:`模型切换尚未确认,请刷新模型列表后重试。`,modelConnectionLoadFailed:`暂时无法读取模型列表。`,modelConnectionNoModels:`暂无可选模型,请检查连接或添加模型定义。`,modelConnectionNoMatch:`没有匹配的模型。`,modelConnectionMore:`还有 {{count}} 个模型,可搜索缩小范围。`,providerModelsEmpty:`还没有模型,获取可用模型或手动添加。`,providerModelsInherited:`使用提供商的内置模型目录。`,providerModelsReadOnly:`此提供商包含当前页面未支持的模型设置,请在 Pi 配置文件中编辑。`,providerModelId:`模型 {{number}} ID`,providerModelName:`模型 {{number}} 名称`,providerModelDetails:`模型参数:{{model}}`,providerRemoveModel:`删除模型:{{model}}`,providerIdInvalid:`请使用未被占用的提供商 ID,仅包含字母、数字、连字符、点或下划线。`,providerNativeAuth:`此提供商使用 Pi 原生登录。`,providerConfigurationFailed:`保存失败,请检查填写内容,并在会话空闲时重试。`,providerProfileSavedKeyFailed:`提供商配置已保存,但密钥保存失败。重试将只保存密钥。`,providerReload:`放弃草稿并重新加载`,providerCurrentRemoval:`请先切换当前使用的模型,再删除。`,providerRemoveDetail:`删除此提供商的配置和自定义模型?由 Pi 管理的凭据将保留。`,providerPickerIntro:`以下是模型提供商的可用模型,勾选要添加的模型。`,providerPickerSelected:`已选 {{count}} 个`,providerApiKey:`API 密钥`,providerKeyPlaceholder:`粘贴密钥以添加或替换`,saveProviderKey:`保存密钥`,savingSettings:`正在保存…`,keepEditing:`继续编辑`,discardAndContinue:`放弃更改并继续`,unsavedSettingsTitle:`放弃未保存的更改?`,unsavedSettingsDetail:`未保存的模型和凭据修改将被丢弃。`,unsavedCredentialTitle:`放弃未保存的凭据?`,unsavedCredentialDetail:`新密钥尚未保存,继续后将清空。`,modelSelectionBusy:`当前会话忙碌,暂不能切换模型。`,providerKeySaved:`已保存到 Pi 凭据存储。已有密钥不会回显。`,providerSaveFailed:`密钥保存未完成。请等待会话空闲,刷新状态后重试;部分服务商需要额外认证信息。`,providerWriteDetail:`在这里直接保存到 Pi 凭据存储,密钥不会进入模型对话。OAuth 或需要额外字段的认证请使用 Pi 原生登录。`,editModelConfiguration:`添加或编辑自定义模型`,modelConfigurationDetail:`先设置提供商连接,再获取模型列表或手动添加。保存配置不会调用模型。`,configuredModels:`自定义模型配置`,addModel:`添加模型`,modelConfig_provider:`服务商 ID`,modelConfig_id:`模型 ID`,modelConfig_name:`显示名称`,modelConfig_baseUrl:`API 地址`,modelConfig_api:`API 格式`,modelConfig_contextWindow:`上下文窗口`,modelConfig_maxTokens:`最大输出 token 数`,providerCapacityLabel:`{{field}} {{number}}`,providerModelOptions:`模型选项`,providerModelInvalid:`模型 {{number}}:模型 ID 不能为空或重复;容量需为正数,例如 128K 或 1M,留空使用默认值。`,modelConfig_reasoning:`支持推理`,saveModelConfiguration:`保存模型`,reloadModelConfiguration:`放弃草稿并载入最新配置`,retryModelConfiguration:`重试读取`,discardModelDraftTitle:`放弃这份模型草稿?`,discardModelDraftDetail:`最新配置将替换这份未保存的草稿。`,discardAndReload:`放弃并重新载入`,modelConfigurationUnsaved:`未保存的更改`,modelConfigurationConflict:`模型配置已在别处更改,当前草稿已保留。`,modelConfigurationLoadFailed:`无法读取模型配置,草稿已保留。`,modelConfigurationSaved:`已保存到 Pi models.json。配置服务商密钥后即可选择此模型。`,modelConfigurationFailed:`模型保存未完成,草稿已保留。`,setupConfigurationRequest:`配置需求`,configureViaSetup:`通过 OpenPI setup 应用`,setupFormDetail:`统一走 /openpi-setup。请在对话中查看进度及必要的确认;提交成功不等于配置已保存。`,setupSkillsPlaceholder:`填写要添加或调整的技能,以及来源或本地路径`,setupPluginsPlaceholder:`填写要配置的 Pi 插件,以及准确的包名或本地路径`,enableSkillInvocation:`允许模型调用`,disableSkillInvocation:`改为仅显式调用`,setupSkillInvocationRequest:`配置这个 Pi 技能:{{path}}。将原生 disable-model-invocation 字段设为 {{disabled}},保留其余内容,并说明何时生效。`,setupRoleFormRequest:`将 OpenPI 的 {{role}} 角色配置为使用 {{model}},工作流并发设为 {{concurrency}}。推理级别继承父会话,校验选择有效性,并保留其他配置。`,providerReadOnlyDetail:`此页面只读且不会接收凭据内容。请通过 Pi 配置服务商认证,然后刷新此状态。`,openProviderSettings:`打开服务商设置`,credentialConfigured:`已配置`,credentialMissing:`未配置`,authNotVerified:`凭据已配置不代表模型请求一定成功。`,configurationViaPi:`此处为只读状态。模型凭据与信任由 Pi 管理,OpenPI 选项通过 /openpi-setup 配置。`,noSkillsFound:`当前会话没有加载技能。`,addSkill:`添加技能`,addPlugin:`添加插件`,searchResources:`搜索名称或来源`,filterResourceScope:`资源范围`,allResourceScopes:`全部范围`,noMatchingResources:`没有匹配的资源`,resourceBulkTooLarge:`请进一步筛选列表后,再提交批量配置请求。`,resourceManagement:`Pi 资源`,resourceSourceAuto:`Pi 自动发现`,resourceSourceLocal:`本地资源`,resourcePackageSource:`软件包、仓库或本地路径`,resourcePackageSourcePlaceholder:`npm:包名@版本 · git:owner/repo · /path/to/skill`,resourceInstallIntro:`选择来源和范围,在对话中通过 OpenPI setup 审查并应用。`,resourceInstallReview:`请在对话中确认准确来源和权限。提交请求不代表已安装或已加载。`,resourceRequestSubmitted:`请求已提交。请在对话中查看进度和确认,完成后刷新此目录。`,browseSkills:`浏览 skills.sh 技能`,resourceSessionState:`应用到当前会话`,resourcesReloadNote:`刷新只读取目录;重新加载才会将已保存的资源应用到空闲会话。配置变更不会自动重新加载。`,reloadResources:`重新加载资源`,resourceReloadReview:`将已保存的 Pi 技能与插件配置应用到当前会话,并重新启动扩展?请先等待运行中的工作结束。`,resourceReloaded:`资源已重新加载,请查看更新后的目录和诊断。`,resourceReloadFailed:`无法重新加载资源。请等待当前会话空闲,刷新后重试。`,advancedResourceConfiguration:`高级配置`,resourceDiagnostics:`Pi 报告了 {{extensionErrors}} 项扩展诊断与 {{skillErrors}} 项技能诊断。`,resourceConfigurationDiagnostics:`{{count}} 项设置读取失败,请检查 Pi 配置诊断。`,resourceCatalogTruncated:`此目录有数量上限,部分资源未展示。`,resourceTargetTruncated:`此来源或路径已截断,请通过高级配置确认完整目标后再进行管理。`,updateResource:`检查更新`,removeResource:`审查移除`,skillsEmptyTitle:`添加你的第一个技能`,skillsEmptyIntro:`技能为 Pi 提供可复用的指引。可以添加软件包、仓库或本地技能;项目技能遵循 Pi 的项目信任。`,pluginsEmptyTitle:`用插件扩展 Pi`,pluginsEmptyIntro:`软件包可以包含扩展、技能、提示词和主题。添加来源后,通过 OpenPI setup 审查安装。`,pluginCount:`{{count}} 个插件来源`,installedVersion:`已安装版本`,configuredVersion:`配置版本`,resourceVersionUnpinned:`未固定版本 / 本地来源`,pluginState_loaded:`本会话资源已加载`,pluginState_installed:`已安装 · 未加载`,pluginState_disabled:`配置已禁用`,pluginState_missing:`软件包缺失`,pluginState_error:`加载诊断`,pluginState_notLoaded:`未加载`,pluginLoadedResources:`当前会话目录包含 {{count}} 项资源。配置变更需要明确重新加载后才会应用。`,pluginAction_enable:`审查启用`,pluginAction_disable:`审查禁用`,pluginAction_update:`检查更新`,pluginAction_remove:`审查移除`,enableVisibleSkills:`允许模型使用(当前 {{count}} 项)`,disableVisibleSkills:`仅显式调用(当前 {{count}} 项)`,enableVisiblePlugins:`启用当前 {{count}} 个软件包`,disableVisiblePlugins:`禁用当前 {{count}} 个软件包`,setupResourceInstallRequest:`添加 Pi {{kind}},来源为 {{source}},范围为 {{scope}}。先检查来源并确定固定的软件包身份,通过 ask_user 与我确认安装权限,再使用 Pi 原生的软件包或技能配置。添加技能时保留其他扩展和资源。保留现有偏好与项目信任,不要自动重新加载当前会话。分别报告已保存的配置与仍需执行的操作,不要改动无关的 OpenPI 设置。`,setupPluginOperationRequest:`审查 Pi 软件包操作 {{action}},只针对配置来源 {{source}}、原生安装目录 {{path}}、范围 {{scope}}。相对来源应以该范围的原生设置目录解析。使用 Pi 原生包管理;更新时检查可用版本,通过 ask_user 与我确认固定的目标身份和安装权限。保留资源过滤器及所有无关偏好;如果切换会破坏过滤器,停止并说明。移除时不得删除本地来源目录。不要自动重新加载,分别报告已持久化与当前会话状态,不要改动无关的 OpenPI 设置。`,setupSkillManageRequest:`审查 Pi 技能操作 {{action}},只针对文件 {{path}}、来源 {{source}}、范围 {{scope}}。先检查原生资源归属,通过 ask_user 与我确认更新或移除及所需权限。保留无关技能与软件包资源,不要为了移除一个技能删除整个共享软件包。保留项目信任,不要自动重新加载,也不要改动无关的 OpenPI 设置。`,setupSkillsBulkRequest:`只针对当前展示的 Pi 技能文件 {{paths}},将原生 disable-model-invocation 设为 {{disabled}}。检查资源归属,保留其余内容和偏好,与我审查必要变更,报告无法安全修改的文件。显式 /skill 调用仍应可用。不要自动重新加载,也不要改动无关的 OpenPI 设置。`,setupPluginsBulkRequest:`只针对当前展示的 Pi 软件包 {{packages}},通过 Pi 原生配置将 disabled 设为 {{disabled}}。保留其他偏好与资源过滤器;无法保留过滤器的条目应跳过并报告。遵循范围与项目信任,与我审查必要变更,不要自动重新加载,也不要改动无关的 OpenPI 设置。`,resourceRequestFinished:`配置回合已结束。请刷新并查看 Pi 原生配置与会话资源,确认实际变更。`,skillCount_one:`{{count}} 个技能`,skillCount_other:`{{count}} 个技能`,skill:`技能`,copySkillInvocation:`复制调用命令`,source:`来源`,scope:`范围`,invocation:`调用方式`,modelInvocation:`模型调用`,resourceScope_user:`全局`,resourceScope_project:`项目`,resourceScope_temporary:`临时`,explicitOnly:`仅允许明确调用`,availableToModel:`模型可按需使用`,skillFile:`技能文件`,selectSkill:`选择一个技能`,subagentConfiguration:`Pi 原生子代理角色`,subagentConfigurationIntro:`未在 OpenPI 配置中指定模型时,角色继承父会话模型。`,subagentActiveCount_one:`{{count}} 个运行中`,subagentActiveCount_other:`{{count}} 个运行中`,subagentCompletedCount_one:`{{count}} 条记录`,subagentCompletedCount_other:`{{count}} 条记录`,subagentConcurrency:`上限 {{count}}`,builtInRoles:`内置角色`,subagentRole_explorer:`探索者`,subagentRole_implementer:`实现者`,subagentRole_reviewer:`审查者`,subagentRole_advisor:`顾问`,subagentRoleShort_explorer:`只读调查`,subagentRoleShort_implementer:`聚焦实现`,subagentRoleShort_reviewer:`正确性审查`,subagentRoleShort_advisor:`技术分析`,subagentRoleDescription_explorer:`调查代码库并报告证据,不修改文件。`,subagentRoleDescription_implementer:`实现边界明确的改动并运行相关仓库检查。`,subagentRoleDescription_reviewer:`审查正确性、安全性、回归风险和缺失验证。`,subagentRoleDescription_advisor:`分析困难技术问题并提出具体下一步建议。`,configureRoles:`配置角色`,builtInRole:`内置角色`,builtIn:`内置`,modelAssignment:`模型分配`,inheritParentModel:`继承父会话模型`,effectiveModel:`实际模型`,workflowConcurrencyLabel:`并行 Agent`,workflowCallLimit:`Agent 总调用数`,runtimeBoundaries:`运行时边界`,subagentAuthorityNote:`子会话权限是父会话与角色能力的故障关闭交集,不会静默扩大权限。`,subagentModelNote:`不会硬编码服务商;未分配的角色继承父会话模型和思考等级。`,resourceCount_one:`{{count}} 项资源`,resourceCount_other:`{{count}} 项资源`,noPluginsFound:`Pi 未报告已加载的插件来源。`,pluginCatalogTotals:`{{extensions}} 扩展 · {{skills}} 技能 · {{prompts}} 提示词 · {{themes}} 主题`,loaded:`已加载`,resourceOrigin:`来源类型`,resourceOrigin_package:`软件包`,resourceOrigin_topLevel:`顶层资源`,resources:`资源`,baseDirectory:`基础目录`,notReported:`未报告`,extensions:`扩展`,extensionSurfaceCount:`{{tools}} 个工具 · {{commands}} 个命令`,prompts:`提示词`,themes:`主题`,pluginResourceSummary:`{{extensions}} 扩展 · {{skills}} 技能 · {{prompts}} 提示词 · {{themes}} 主题`,pluginsManagedByPi:`这些资源由 Pi 加载。可通过上方 setup 表单提交变更;软件包操作沿用原生确认,并通过 Pi 的重新加载流程生效。`,selectPlugin:`选择一个插件来源`,statusCaptured:`采集于 {{time}} · 刷新查看最新状态`,conversationViews:`会话视图`,currentConversations:`当前`,archivedConversations:`已归档`,refreshArchives:`刷新归档会话`,loadingArchives:`正在加载归档会话...`,moreArchives:`加载更多归档会话`,retryArchives:`重试读取归档会话`,archiveLoadFailed:`无法加载归档会话。`,archiveCursorStale:`归档会话已变化,请刷新后继续。`,archiveScanBounded:`还有 {{count}} 条更早记录未扫描。`,noArchivedSessions:`没有归档会话。`,noScannedArchives:`已扫描历史中没有归档会话。`,noMatchingScannedArchives:`已扫描历史中没有匹配的归档会话。`,draftLimit:`草稿暂存已满,请先发送或清空已有草稿。`,restoreConversation:`恢复会话`,restoringConversation:`正在恢复…`,loadedArchives:`已加载历史中的归档会话`,loadedHistoryBounded:`另有 {{sessions}} 个会话和 {{workspaces}} 个工作区摘要未加载。搜索仅覆盖已加载列表。`,noLoadedArchives:`已加载列表中没有归档会话。`,restoreFailed:`暂时无法确认恢复结果,请刷新后重试。`,execution_running:`运行中`,execution_done:`已完成`,execution_killed:`已停止`,execution_timed_out:`已超时`,execution_failed:`失败`,execution_uncertain:`状态不确定`,activeOnlyHint:`只有当前 Web 会话可以接收消息。`,stopTurn:`停止当前轮次`,stoppingTurn:`正在停止当前轮次…`,stoppedTurn:`当前轮次已停止。`,pendingFollowUpsHint:`{{count}} 条消息正在排队`,sendNextTurn:`下一轮发送`,followUpBehavior:`跟进处理方式`,followUpBehaviorDetail:`OpenPI 运行时,将后续消息排队到下一轮,或引导当前轮次。按 ⌘/Ctrl+Enter 可仅对这条消息使用另一种方式。`,followUpQueue:`排队`,followUpQueueDetail:`下一轮发送`,followUpSteer:`引导`,followUpSteerDetail:`加入当前轮次`,steerCurrentTurn:`当前执行纠偏`,steeringHint:`在当前工具步骤结束后加入这条指示。`,pendingSteeringHint:`已接收 {{count}} 条纠偏指示,等待当前工具步骤结束`,steeringMessagesTitle:`当前轮次待处理的纠偏指示`,steerStaleTurn:`目标轮次已结束或变化。草稿已保留,请确认更新后的状态并重新发送。`,sourceFeedbackNew:`{{path}} · 新版本第 {{line}} 行`,sourceFeedbackOld:`{{path}} · 旧版本第 {{line}} 行`,forkMessage:`从此处分叉`,forkMessageHint:`从此消息创建新聊天,保留原聊天;不会自动发送消息。`,forkSessionPending:`正在创建分叉会话…`,forkSessionCreated:`已创建分叉会话,原会话保留在侧栏。`,forkSessionCancelled:`分叉已取消,原会话已保留。`,forkSessionUncertain:`无法确认分叉结果。请先刷新并检查会话列表,再决定是否重试。`,forkSessionUnavailable:`切换到此会话并等待当前执行和排队消息结束后,可以从这里创建新会话。`,reviewQuoteLine:`引用此行`,reviewSelectOldLine:`选择旧版本第 {{line}} 行`,reviewSelectNewLine:`选择新版本第 {{line}} 行`,queuedMore:`还有 {{count}} 条排队消息`,queuedImage:`图片附件`,queuedMessageExpand:`展开排队消息`,queuedMessageCollapse:`收起排队消息`,backgroundSessionRunning:`此会话正在后台运行…`,observedSessionTools:`{{count}} 个正在执行的工具`,toolsRequireCurrentSession:`切换到此会话后可使用交互工具。`,activateViewedSession:`切换到此会话`,activateViewedSessionHint:`发送消息即可继续此会话。`,acceptedHint:`OpenPI Web 已接收消息。`,promptAdmissionUnknown:`无法确认上次发送的消息是否已被接收。`,promptAdmissionUnknownDetail:`请先核对已刷新的会话历史和运行状态,再决定下一步。作为新消息发送可能产生重复消息。`,promptAdmissionCheckingDetail:`正在核对最新的会话历史和运行状态,核对完成前不能作为新消息发送。`,promptAdmissionVerificationFailedDetail:`暂时无法刷新最新的会话历史和运行状态。请重新核对后再决定是否作为新消息发送。`,abandonAdmission:`暂不重新发送`,retryAdmissionCheck:`重新核对`,retryOriginalAdmission:`重试原消息`,promptTooLong:`文本超出发送上限({{count}} / {{limit}})。`,sendAsNew:`作为新消息发送`,sendingAsNew:`正在发送…`,addWorkspace:`添加工作区`,addWorkspaceMenu:`添加工作区...`,archiveConversation:`归档会话`,pinnedConversations:`置顶`,sidebarOptions:`侧栏选项`,sidebarProjectOptions:`项目侧栏选项`,sidebarRecentOptions:`会话侧栏选项`,sidebarActivityOptions:`动态视图选项`,sidebarShow:`显示`,sidebarGroupBy:`会话分组`,sidebarByProject:`按项目分组`,sidebarFlatList:`所有会话`,sidebarChatSort:`会话排序`,sidebarRecent:`最近`,sidebarProjectsInRecents:`在最近列表显示项目会话`,sidebarShowMore:`展开显示`,sidebarShowLess:`收起显示`,sidebarFilterList:`筛选当前列表`,sidebarSaveFailed:`更改未能保存,请重试。`,pinWorkspace:`置顶项目`,unpinWorkspace:`取消置顶项目`,markConversationRead:`标记为已读`,markConversationUnread:`标记为未读`,sidebarState_unread:`未读会话`,sidebarActivity:`动态`,sidebarViewActivity:`查看动态`,sidebarViewChats:`查看会话`,sidebarPriority:`优先关注`,sidebarActivityEmpty:`没有需要关注的会话`,sidebarActivityEmptyHint:`已完成的工作和需要你处理的会话会显示在这里。`,sidebarMarkAllRead:`全部标记为已读`,sidebarClearRead:`清除优先关注中的已读会话`,sidebarReadFailed:`未能更新已读状态,请重试。`,sidebarToday:`今天`,sidebarYesterday:`昨天`,sidebarEarlier:`更早`,sidebarActivityCompleted:`已完成`,sidebarActivityFailed:`执行失败`,sidebarActivityRead:`已读`,modelAdvanced:`高级参数`,providerConnectionHeading:`提供商连接`,providerFetchModels:`获取可用模型`,providerFetchHint:`填写提供商和端点后,可一次选择多个模型。`,providerPickerTitle:`选择要添加的模型`,providerPickerAccess:`连接凭据`,providerPickerKey:`访问密钥(可选)`,providerPickerKeyHint:`留空使用此端点已保存的凭据。此处输入的密钥仅用于获取列表,不会保存。`,providerPickerSearch:`搜索模型`,providerPickerSelectAll:`全选`,providerPickerClear:`清空选择`,providerPickerLoading:`正在获取可用模型…`,providerPickerAdded:`已添加`,providerPickerNoMatch:`没有匹配的模型`,providerPickerEmpty:`提供商没有返回模型,仍可手动添加。`,providerPickerBounded:`当前显示前 500 个模型,其他模型可手动填写 ID。`,providerPickerError_load:`未能获取模型列表,请检查端点和凭据后重试,也可以手动添加。`,providerPickerError_save:`尚未确认保存成功。已保留你的选择,请检查连接后重试。`,providerPickerError_conflict:`配置已在其他地方更新,请关闭弹窗、重新读取配置后再保存。`,providerPickerDefaults:`新模型使用 {{context}} 上下文 / {{output}} 输出 token,添加后可逐个调整。`,providerPickerRetry:`刷新列表`,providerPickerCount:`已选 {{count}} 个 · 最多 100 个`,providerPickerSave:`添加所选`,sidebarState_running:`执行中`,sidebarState_compacting:`正在整理上下文`,sidebarState_waiting:`等待你的回复`,sidebarState_completed:`已完成 · 结果未读`,sidebarState_failed:`执行失败 · 打开会话查看详情`,pinnedOptions:`置顶选项`,pinConversation:`置顶会话`,unpinConversation:`取消置顶`,pinnedRecentlyUpdated:`最近更新`,pinnedManualOrder:`手动排序`,movePinUp:`上移`,movePinDown:`下移`,pinSaveFailed:`置顶设置未能保存,请重试。`,cancel:`取消`,chooseWorkspaceHint:`选择工作区并描述任务`,close:`关闭`,closeSearch:`关闭搜索`,collapseSidebar:`收起侧边栏`,confirmEdit:`保存并重新运行`,editMessageHint:`从这里创建新分支并重新运行;保留原对话、图片和文件引用。已有工作区改动会保留。`,regenerateMessage:`重新生成回答`,regenerateMessageHint:`在新分支重新运行这条问题,保留原附件和原对话。`,messageRerunStarted:`已在新分支接收重跑消息,原对话已保留。`,openOriginalConversation:`查看原对话`,messageRerunWorkspaceHint:`已有工作区改动会保留。`,modelRequestRecovered:`请求已恢复`,modelReconnecting:`正在重新连接`,modelReconnectUnknown:`重连状态待确认`,modelEarlierAttempts:`先前请求错误`,modelFailedAttempts:`失败尝试({{count}} 次)`,draftStorageUnavailable:`草稿未能保存到此设备,请保持页面打开或复制消息。`,draftStorageInvalid:`部分保存的草稿内容无法恢复,请检查消息和附件。`,draftStorageRetry:`重试保存草稿`,workbarBackToChat:`返回聊天`,workbarCollapseTools:`收起工具栏`,workbarEndTerminal:`关闭 {{name}} 并结束进程`,workbarNewTerminal:`新建终端`,workbarContinueInChat:`继续追问`,transcriptSearch:`搜索消息内容`,transcriptSearchPlaceholder:`搜索标题、项目或消息…`,transcriptSearchRecent:`最近会话`,transcriptSearchSessions:`会话`,transcriptSearchMessages:`消息内容`,transcriptSearchSessionResult:`打开会话 {{session}}`,transcriptSearchSessionOpenFailed:`暂时无法打开此会话,请重试。`,transcriptSearchIncludeArchived:`包含归档会话`,transcriptSearching:`正在搜索消息…`,transcriptSearchEmpty:`没有匹配的消息。`,transcriptSearchFailed:`暂时无法搜索消息,请重试。`,transcriptSearchRetry:`重试搜索`,transcriptSearchPartial:`部分历史未能搜索,结果可能不完整。`,transcriptSearchOpenFailed:`无法打开这条消息,它可能已移动或位于其他分支。`,transcriptSearchResult:`打开 {{session}} 中来自{{source}}的消息`,transcriptSearchSource_user:`你`,transcriptSearchSource_assistant:`助手`,transcriptSearchSource_tool_call:`工具调用`,transcriptSearchSource_tool_result:`工具结果`,connected:`已连接`,connecting:`正在连接`,conversationName:`会话名称`,conversationOptions:`会话选项`,sidebarRename:`重命名`,sidebarPin:`置顶`,sidebarUnpin:`取消置顶`,sidebarFork:`分叉`,sidebarForkLocal:`创建聊天分支`,sidebarForkSameWorktree:`在同一工作树中分叉`,archiveNoticeTitle:`聊天已归档`,archiveNoticeView:`查看`,archiveNoticeUndo:`撤销`,archiveNoticeFailed:`操作未完成,请重试。`,sidebarForkWorktree:`在新工作树中创建聊天分支`,sidebarForkCancelling:`正在请求取消…`,sidebarForkFinishing:`无法再取消,正在确认创建结果…`,sidebarForkCancelUnconfirmed:`无法确认取消,正在等待分叉结果。`,sidebarForkWorktreePreserved:`工作树已保留在 {{path}},请检查后再重试。`,sidebarForkWorktreePending:`正在创建工作树和聊天分支…`,sidebarForkOptionsLoading:`正在检查工作树是否可用…`,sidebarForkOptionsFailed:`无法检查工作树,请重新打开菜单重试。`,sidebarForkUnavailable:`发送消息后才能创建此聊天的分支。`,sidebarForkArchived:`请先恢复此会话,再创建分叉。`,sidebarForkFailed:`未能创建分叉,原会话已保留。`,sidebarCopy:`复制`,sidebarCopyLink:`复制会话链接`,sidebarCopyMarkdown:`复制为 Markdown`,sidebarCopyCwd:`复制工作目录`,sidebarCopied:`已复制`,sidebarCopyFailed:`复制失败,请重试。`,sidebarNewWindow:`在新窗口中打开`,sidebarOpenIn:`打开方式`,sidebarAppsLoading:`正在加载可用应用…`,sidebarAppsFailed:`无法加载应用,请重新打开菜单重试。`,sidebarOpenFailed:`无法在所选应用中打开此项目。`,sidebarArchive:`归档`,sidebarRestore:`恢复`,sidebarDelete:`永久删除`,managedWorktreeRecoveryFull:`请先核对先前未确认的移除请求,再开始新的请求。`,managedWorktreesChanged:`工作树列表已变化,请刷新后重新核对目标。`,managedWorktreesRefresh:`刷新工作树列表`,managedWorktreesBack:`返回工作树列表`,managedWorktreesRetry:`重试请求`,managedWorktrees:`保留的工作树`,managedWorktreesDescription:`删除会话会保留 OpenPI 创建的工作树。请核对准确路径后再请求移除。使用中、共享、有改动或无法确认归属的工作树会保留。`,managedWorktreeConfirm:`移除此工作树?服务端会重新核对归属、使用中的会话及本地改动后再操作。`,managedWorktreeRemoved:`工作树已移除。`,managedWorktreePreserved:`工作树已保留:`,managedWorktreeUncertainTerminal:`移除结果无法确认,不能自动重复移除。请先检查保留路径,再决定后续操作。`,managedWorktreeUncertain:`尚不能确认移除结果。重试会核对原请求。`,managedWorktreeRemoving:`正在核对并移除…`,managedWorktreeRemove:`移除工作树`,managedWorktreeReview:`核对移除`,managedWorktreesEmpty:`这一页没有找到托管工作树。`,managedWorktreesUnavailable:`有 {{count}} 条归属记录无法确认。`,managedWorktreesLoadFailed:`无法加载保留的工作树。请重试,目标不会改变。`,managedWorktreesMore:`加载更多工作树`,managedWorktreeRetainedAfterDelete:`会话已删除,工作树保留在 {{path}}。可从项目菜单核对保留的工作树。`,sidebarDeleteTitle:`删除会话?`,sidebarDeleteDescription:`确定永久删除“{{name}}”?此操作无法撤销。`,sidebarDeleteConfirm:`删除`,sidebarDeleting:`正在删除…`,sidebarDeleteFailed:`未能删除此会话,请重试或取消。`,sidebarActionRunning:`请等待当前工作和排队消息结束。`,sidebarActionDisconnected:`请先恢复连接,再修改此会话。`,sessionDeleteCancelled:`删除已取消`,sessionDeleteUncertain:`无法确认会话是否删除,请刷新后重试`,sessionDeleted:`会话已永久删除`,sessionDeleteMetadataPending:`会话已删除,但侧栏记录未清理完成`,sessionLinkUnavailable:`链接中的会话已不存在或身份已变化`,sidebarDropPin:`拖到此处置顶`,sidebarDropProjectLast:`将项目移到最后`,conversationTurns:`会话轮次`,conversationTurnPosition:`前往第 {{position}} 轮`,turnPreviewLoading:`正在加载预览…`,turnPreviewUnavailable:`暂时无法读取,请重试。`,commands:`斜杠命令`,addContext:`添加上下文`,fileReference:`引用工作区文件`,fileReferenceTitle:`引用工作区文件`,fileReferenceDetail:`将路径引用加入提示词,不上传文件内容。`,fileReferenceLabel:`工作区文件路径`,fileReferencePlaceholder:`src/app.tsx`,fileReferenceValidatedHint:`当前会话会验证该路径是可读取的工作区文件。`,fileReferenceDraftHint:`新会话启动后,Pi 会按其工具权限解析该路径。`,fileReferenceChecking:`正在检查…`,fileReferenceFailed:`无法验证该文件。`,fileReferenceDenied:`请选择当前会话工作区内的文件。`,fileReferenceMissing:`该工作区文件已不存在。`,fileReferenceUnsupported:`只能引用工作区中的普通文件。`,fileReferenceExpired:`活动会话已变化,请重新打开文件引用后再试。`,fileReferenceBusy:`文件校验正忙,请稍后重试。`,insertReference:`插入引用`,commandsSessionRequired:`会话启动后才能插入斜杠命令。`,commandsEmptyDraftOnly:`只能在空白草稿中插入斜杠命令。`,commandsLoading:`正在加载命令…`,commandsUnavailable:`暂时无法读取命令。`,commandsNoMatch:`没有匹配的命令。`,commandsNoAvailable:`已发现的命令均不能在 Web 中运行。输入具体命令名可查看其可用性。`,commandsBounded:`另有 {{count}} 个命令未显示。`,commandSessionRequired:`命令仅在已创建的 Web 会话中可用。`,commandUnsupported:`尚未适配 · 手动命令仍交给 Pi`,commandAcceptsArguments:`可输入参数`,commandSource_extension:`扩展命令`,commandSource_prompt:`提示词模板`,commandSource_skill:`技能`,copiedMessage:`已复制`,copyMessage:`复制消息`,copyFailed:`复制失败,请选中消息后手动复制。`,copiedCode:`代码已复制`,copyCode:`复制代码`,copyCodeFailed:`无法复制代码,请选中后手动复制。`,codeBlock:`代码块`,wrapCode:`自动换行`,expandCode:`展开全部 {{count}} 行`,collapseCode:`收起代码`,expandInput:`展开输入框`,collapseInput:`收起输入框`,deleteWorkspace:`删除工作区`,describeTask:`描述任务`,editMessage:`修改并从这里重跑`,enterHint:`按 Enter 发送,Shift+Enter 换行。`,expandSidebar:`展开侧边栏`,importWorkspace:`导入工作区`,loadingModels:`正在加载模型...`,modelsTruncated:`当前显示 {{shown}} 个模型,还有 {{omitted}} 个可用;搜索即可查找。`,searchModels:`搜索可用模型`,searchModelsPlaceholder:`搜索服务商、模型名称或 ID...`,searchingModels:`正在搜索模型...`,noMatchingModels:`没有匹配的模型`,modelSearchFailed:`模型搜索失败,请重试。`,retryModelSearch:`重试模型搜索`,fileReferenceDraftChanged:`草稿已变化,请重新打开文件引用。`,modelSearchTruncated:`还有 {{omitted}} 个匹配模型未显示。`,modelPreparing:`正在准备任务...`,modelRetrying:`模型请求重试中...`,modelRunning:`正在运行…`,modelRequestFailed:`模型请求失败`,modelRequestStopped:`模型请求已停止`,modelFailureUnknown:`服务商没有返回具体失败原因。`,retryPrompt:`重试消息`,retryingPrompt:`正在重试…`,newSession:`新建会话`,noConversations:`暂无对话`,noMatching:`没有匹配的会话`,noMatchingLoaded:`已加载历史中没有匹配的会话`,noModels:`没有可用模型`,noOutput:`无输出`,noSessions:`暂无会话`,openSidebar:`打开侧边栏`,promptMessage:`发消息或创建任务,/ 调用指令`,promptReadonly:`非当前会话不能接收消息`,promptStart:`选择一个工作区开始`,promptTask:`描述你想要构建的任务`,queuedHint:`当前回合结束后将发送消息。`,reconnecting:`正在重连`,removeWorkspace:`从侧边栏移除`,workspaceOptions:`工作区选项`,renameFailed:`无法保存名称,已保留你的修改。`,savingName:`正在保存...`,workspaceRemoveFailed:`无法移出工作区,请重试。`,removingWorkspace:`正在移出...`,renameConversation:`重命名会话`,renameWorkspace:`重命名工作区`,save:`保存`,searchConversations:`搜索会话`,searchPlaceholder:`筛选标题与工作目录…`,selectModel:`选择模型`,configureModels:`配置模型`,openModelSettings:`模型设置`,selectThinking:`选择思考等级`,thinkingAvailableLevels:`可选等级:{{levels}}`,resetThinking:`恢复打开时的等级({{level}})`,modelThinkingNotEnabled:`此模型未启用思考。如提供商支持,可在模型设置中开启「支持推理」。`,providerReasoningHint:`按提供商能力开启,在聊天输入框调节当前思考等级。`,providerThinkingLevels:`支持的思考等级`,providerThinkingLevelsHint:`选择此模型支持的等级,保存后同步到会话选择器。`,providerThinkingAutomatic:`自动(Pi 默认)`,providerThinkingSelected:`已选 {{count}} 项`,providerThinkingReset:`使用 Pi 默认等级`,providerImageHint:`未勾选图片时,模型不会收到图片附件。`,selectWorkspace:`选择工作区`,send:`发送`,processDetails:`执行过程`,processRunning:`正在执行`,processThinkingCount:`{{count}} 段思考`,processToolCount:`{{count}} 次工具调用`,processFailureCount:`{{count}} 次失败`,runtimeActivities:`执行活动`,activityAgentProgress:`{{completed}}/{{total}} 个子代理已结束`,activityCapacity:`并行任务:{{running}}/{{limit}} · {{queued}} 个等待中`,composerQueuedCount:`排队 {{count}}`,composerSteeringCount:`引导 {{count}}`,runtimeActivityRunning:`{{count}} 项进行中`,runtimeActivityCount:`{{count}} 项活动`,processActivityCount:`{{count}} 项 Agent 活动`,switchingSession:`正在切换会话...`,thinkingActive:`思考中...`,thinkingActiveLevel:`思考中({{level}})...`,thinkingDone:`思考过程`,thinkingLoadFull:`查看完整思考`,thinkingLoadingFull:`正在加载思考…`,thinkingLoadFailed:`思考加载失败,点击重试`,thinkingPartialText:`当前显示部分已保存的思考,可继续加载下方内容。`,thinkingPreviewOnly:`思考预览已达到显示上限,此消息保存后可查看完整内容。`,toolState_running:`执行中`,toolState_returned:`已返回`,toolState_failed:`失败`,toolState_cancelled:`已停止`,toolState_timed_out:`超时`,toolState_unknown:`未确认`,toolSnapshotMissingResult:`分叉时尚无结果`,toolActivity_running:`正在{{action}}`,toolActivity_failed:`{{action}}失败`,toolActivity_cancelled:`{{action}}已停止`,toolActivity_timed_out:`{{action}}超时`,toolActivity_unknown:`{{action}}`,toolAction_read:`读取`,toolAction_write:`写入文件`,toolAction_edit:`编辑文件`,toolAction_command:`运行`,toolAction_search:`搜索`,toolAction_list:`列出文件`,toolAction_web:`浏览网页`,toolAction_agent:`使用子代理`,subagentAction_spawn:`启动子代理`,subagentAction_send:`发送补充消息`,subagentAction_check:`查询子代理`,subagentAction_wait:`等待子代理`,subagentAction_cancel:`停止子代理`,subagentActionDone_spawn:`已启动子代理`,subagentActionDone_send:`已发送补充消息`,subagentActionDone_check:`已查询子代理`,subagentActionDone_wait:`已结束等待`,subagentActionDone_cancel:`停止请求已返回`,toolAction_workflow:`调用工作流`,toolAction_plan:`准备计划`,toolAction_git:`查看变更`,toolAction_call:`调用工具`,toolActionDone_read:`已读取`,toolActionDone_write:`已写入`,toolActionDone_edit:`已编辑`,toolActionDone_command:`已运行`,toolActionDone_search:`已搜索`,toolActionDone_list:`已列出的文件`,toolActionDone_web:`已浏览网页`,toolActionDone_agent:`子代理工具已返回`,toolActionDone_workflow:`工作流工具已返回`,toolActionDone_plan:`计划工具已返回`,toolActionDone_git:`已查看变更`,toolActionDone_call:`已调用工具`,toolActionGroup_read:`读取文件`,toolActionGroup_write:`写入文件`,toolActionGroup_edit:`编辑文件`,toolActionGroup_command:`运行命令`,toolActionGroup_search:`搜索`,toolActionGroup_list:`列出文件`,toolActionGroup_web:`浏览网页`,toolActionGroup_agent:`子代理活动`,toolActionGroup_workflow:`工作流活动`,toolActionGroup_plan:`准备计划`,toolActionGroup_git:`查看变更`,toolActionGroup_call:`调用工具`,toolGroup_done:`{{actions}}`,toolGroup_running:`正在{{actions}}`,toolGroup_unknown:`{{actions}}`,toolGroupSeparator:`、`,toolSearchTarget:`“{{pattern}}” · {{path}}`,toolDiffStatsHelp:`当前显示差异中的新增和删除行数`,toolRequestedFile:`文件:`,toolWorkspace:`工作区`,toolRawEvidence:`参数与原始结果`,toolCodemodeDetails:`脚本与原始结果`,toolNestedOutputMissing:`会话记录保留了调用和状态,未保存此子工具的输出。`,toolNestedArgumentsMissing:`会话记录未保留完整参数和此子工具的输出。`,toolNestedIncomplete:`子调用记录不完整,部分调用、参数或最终状态不可用。`,toolPartialEvidence:`输出未完整显示:已达到字节、行数或条目上限。原始结果也可能被截断。`,toolFileChange_created:`已创建文件`,toolFileChange_unchanged:`文件内容未改变`,toolFileChange_overwritten:`已覆盖文件`,toolChangeUnavailable:`此工具结果未提供修改对比。`,toolTestResults:`测试结果摘要 · {{format}}`,toolTestCounts:`{{tests}} 项测试 · {{passed}} 通过 · {{failed}} 失败 · {{cancelled}} 取消`,toolTestCountsHelp:`数量来自命令输出,执行状态单独显示。`,toolReadMore:`可使用文件路径和 offset 继续读取,具体方式见原始结果。`,toolFullOutputReference:`完整输出:`,subagentBackgroundResult:`后台子代理结果 · {{count}}`,thinkingDraftHint:`请先选择工作区并创建会话。`,thinkingInactiveHint:`只有当前会话可以更改思考等级。`,thinkingLevelMismatch:`当前确认的思考等级不在此模型支持范围内;选择其它等级即可修正。`,thinkingLockedRunning:`请先停止当前轮次,再更改思考等级。`,thinkingModelPendingHint:`请等待模型切换完成。`,thinkingNotConfirmed:`思考等级未获确认,请重试。`,thinkingPendingHint:`正在应用思考等级...`,thinkingUnsupported:`暂不支持思考`,thinkingUnsupportedHint:`尚未选择模型,或当前模型不支持思考。`,unavailable:`不可用`,ungrouped:`未分组`,untitledSession:`新会话`,workspaceDeleteConfirm:`文件夹与会话记录会保留,其中的会话会被放到“未分组”;再次打开此目录时将是一个干净的工作区。`,workspaceName:`工作区名称`,workspaces:`工作区`,sidebarProjects:`项目`}}},dG=navigator.language?.toLowerCase().startsWith(`zh`)?`zh`:`en`;Xl.use(Zl).init({fallbackLng:`en`,initAsync:!1,interpolation:{escapeValue:!1},lng:dG,resources:uG}),document.documentElement.lang=dG===`zh`?`zh-CN`:`en`;var fG=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},pG=10,mG=13,hG=32,gG=6;function _G(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{maxBufferSize:t,onComment:n,onError:r,onEvent:i,onId:a,onRetry:o}=e,s=[],c=0,l=!0,u,d=``,f=0,p,m=!1,h=!1,g=!1;function _(e){if(m)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l&&(l=!1,e.charCodeAt(0)===65279?e=e.slice(1):e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),(h||g)&&(e=v(e),!e))return;if(!s.length){let t=S(e);t!==``&&y(t),x();return}if(e.indexOf(` +`)?RI(e,II(t)):e.startsWith(` `)?RI(e,t):RI(e,LI(t))}[...OI,...kI],[...kI];function BI(e){return mM(e,``)?[]:[e.slice(0,1),e.slice(1)]}function VI(e,t){return vM(e,(e,n)=>t.startsWith(e)?!0:VI(n,t),()=>!1)}function HI(e,t,n=``){return wI(BI(t),(r,i)=>VI(e,t)?[n,t]:HI(e,i,`${n}${r}`),()=>[])}function UI(e,t){return wI(HI(e,t),(e,t)=>mM(e,``)?[]:[e,t],()=>[])}var WI=(e,t,n=()=>[])=>e.length===2?t(e):n(),GI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[dI(e),t]),KI=e=>WI(zI(`.*`,e),([e,t])=>[fI(e),t]),qI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,e),([e,t])=>[pI(e),t]),JI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[mI(e),t]),YI=e=>WI(zI(`(?!)`,e),([e,t])=>[hI(e),t]),XI=e=>WI(UI([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[gI(e),t]),ZI=e=>WI(WI(GI(e),([e,t])=>[e,t],()=>WI(KI(e),([e,t])=>[e,t],()=>WI(qI(e),([e,t])=>[e,t],()=>WI(JI(e),([e,t])=>[e,t],()=>WI(YI(e),([e,t])=>[e,t],()=>WI(QI(e),([e,t])=>[e,t],()=>WI(XI(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[_I(e),t]),QI=e=>WI(WI(zI(`(`,e),([e,t])=>WI(tL(t),([t,n])=>WI(zI(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[vI(e),t]),$I=e=>WI(WI(WI(eL(e),([e,t])=>WI(zI(`|`,t),([t,n])=>WI($I(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>WI(WI(eL(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>WI([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[yI(e),t]),eL=e=>WI(WI(ZI(e),([e,t])=>WI(tL(t),([t,n])=>[[e,t],n])),([e,t])=>[bI(e),t]),tL=e=>WI(WI($I(e),([e,t])=>[e,t],()=>WI(eL(e),([e,t])=>[e,t],()=>[])),([e,t])=>[xI(e),t]),nL=e=>WI(WI(zI(`^`,e),([e,t])=>WI(tL(t),([t,n])=>WI(zI(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[SI(e),t]);function rL(e){return e.join(`|`)}function iL(e){return e.slice(1,e.length-1)}function aL(e,t,n){return gL(t,`${n}${e}`)}function oL(e,t){return gL(e,`${t}${eP}`)}function sL(e,t){return gL(e,`${t}${iP}`)}function cL(e,t){return gL(e,`${t}${gP}`)}function lL(e,t){return hL(CP([lP(`false`),lP(`true`)]),e,t)}function uL(e,t){return gL(e,`${t}.*`)}function dL(e,t,n){return gL(t,`${n}${iL(e)}`)}function fL(e,t,n){return hL(yL(e,{}),t,n)}function pL(e,t,n){return hL(TF(e),t,n)}function mL(e,t,n,r=[]){return vM(e,(e,i)=>mL(i,t,n,[...r,hL(e,[],``)]),()=>gL(t,`${n}(${rL(r)})`))}function hL(e,t,n){return WN(e)?pL(e.enum,t,n):oP(e)?sL(t,n):pP(e)?aL(e.const,t,n):nP(e)?oL(t,n):rP(e)?lL(t,n):vP(e)?cL(t,n):SP(e)?uL(t,n):CL(e)?dL(e.pattern,t,n):SL(e)?fL(e.parameters[0],t,n):wP(e)?mL(e.anyOf,t,n):bN}function gL(e,t){return vM(e,(e,n)=>hL(e,n,t),()=>t)}function _L(e){return`^${gL(e,``)}$`}function vL(e){return MP(_L(e))}function yL(e,t){return NU(e)?JM(vL(e),{},t):xL(e,t)}function bL(e,t,n,r){return yL(IU(e,t,n),r)}function xL(e,t={}){return ZM(`TemplateLiteral`,[e],t)}function SL(e){return XM(e)&&bM(e,`action`)&&mM(e.action,`TemplateLiteral`)}function CL(e){return YM(e,`TemplateLiteral`)}function wL(e){return KM({"~kind":`ExtendsUnion`},{inferred:e})}function TL(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`inferred`)&&mM(e[`~kind`],`ExtendsUnion`)&&fM(e.inferred)}function EL(e){return KM({"~kind":`ExtendsTrue`},{inferred:e})}function DL(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`inferred`)&&mM(e[`~kind`],`ExtendsTrue`)&&fM(e.inferred)}function OL(){return KM({"~kind":`ExtendsFalse`},{})}function kL(e){return fM(e)&&bM(e,`~kind`)&&mM(e[`~kind`],`ExtendsFalse`)}function AL(e){return TL(e)||DL(e)}function jL(e,t,n){return AL(e)?t(e.inferred):n()}function ML(e,t,n,r){return jL(XR(e,n,r),r=>EL(jM(jM(e,r),{[t]:n})),()=>OL())}function NL(e,t){return EL(e)}function PL(e,t,n,r,i){return jL(XR(e,t,n),e=>jL(XR(e,t,r),e=>EL(e),()=>OL()),()=>jL(XR(e,t,i),e=>EL(e),()=>OL()))}function FL(e,t,n){return XR(e,t,TF(n))}function IL(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>IL(e,t,r),()=>OL()),()=>EL(e))}function LL(e,t,n){return XR(e,t,DF(n))}function RL(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>EL(e),()=>RL(e,t,r)),()=>OL())}function zL(e,t,n){return yN(n)?NL(e,t):zN(n)?PL(e,t,n.if,n.then,n.else):WN(n)?FL(e,t,n.enum):LN(n)?ML(e,n.name,t,n.extends):KN(n)?IL(e,t,n.allOf):CL(n)?LL(e,t,n.pattern):wP(n)?RL(e,t,n.anyOf):NN(n)?EL(e):OL()}function BL(e,t,n){return LN(n)?zL(e,t,n):yN(n)||NN(n)?EL(e):wL(e)}function VL(e,t){let n=ZN(e),r=ZN(t);return n&&r||!n&&r?!0:!(n&&!r)}function HL(e,t,n,r){return oN(r)?VL(t,r)?XR(e,n,r.items):OL():zL(e,t,r)}function UL(e,t,n){return nP(n)?EL(e):zL(e,t,n)}function WL(e,t,n){return rP(n)?EL(e):zL(e,t,n)}function GL(e,t,n,r,i){let a=LN(r)?t:r,o=LN(r)?r:t,s=TN(t),c=TN(r);return!s&&c?OL():jL(XR(e,a,o),e=>JL(e,n,i),()=>OL())}function KL(e,t,n,r){return vM(r,(r,i)=>GL(e,t,n,r,i),()=>TN(t)?EL(e):OL())}function qL(e,t,n){return vM(t,(t,r)=>KL(e,t,r,n),()=>EL(e))}function JL(e,t,n){return qL(e,t,n)}function YL(e,t,n){return uI(n)?EL(e):XR(e,t,n)}function XL(e,t,n,r){return yN(r)||NN(r)?EL(e):lN(r)?jL(JL(e,t,r.parameters),e=>YL(e,n,r.instanceType),()=>OL()):OL()}function ZL(e,t,n,r,i){return jL(XR(e,t,i),()=>XR(e,n,i),()=>XR(e,r,i))}function QL(e,t,n){return XR(e,TF(t),n)}function $L(e,t,n,r){return yN(r)||NN(r)?EL(e):fN(r)?jL(JL(e,t,r.parameters),e=>YL(e,n,r.returnType),()=>OL()):OL()}function eR(e,t,n){return oP(n)||vP(n)?EL(e):zL(e,t,n)}function tR(e,t,n){return XR(e,EF(t),n)}function nR(e,t,n){return t===n?EL(e):OL()}function rR(e,t,n){return pP(n)?nR(e,t,n.const):nP(n)?EL(e):zL(e,lP(t),n)}function iR(e,t,n){return pP(n)?nR(e,t,n.const):rP(n)?EL(e):zL(e,lP(t),n)}function aR(e,t,n){return pP(n)?nR(e,t,n.const):vP(n)?EL(e):zL(e,lP(t),n)}function oR(e,t,n){return pP(n)?nR(e,t,n.const):SP(n)?EL(e):zL(e,lP(t),n)}function sR(e,t,n){return sM(t.const)?rR(e,t.const,n):cM(t.const)?iR(e,t.const,n):uM(t.const)?aR(e,t.const,n):pM(t.const)?oR(e,t.const,n):JN()}function cR(e,t,n){return LN(n)?zL(e,t,n):EL(e)}function lR(e,t,n){return hP(n)?EL(e):zL(e,t,n)}function uR(e,t,n){return vP(n)?EL(e):zL(e,t,n)}function dR(e,t,n){return TN(t)?TN(n)?EL(e):OL():EL(e)}function fR(e,t,n){return LN(n)&&SN(n.extends)?OL():jL(XR(e,t,n),e=>dR(e,t,n),()=>OL())}function pR(e,t){return e.reduce((e,n)=>n in t&&AL(t[n])?{...e,...t[n].inferred}:JN(),{})}function mR(e,t,n){let r={};for(let i of xM(n))r[i]=i in t?fR({},t[i],n[i]):TN(n[i])?LN(n[i])?EL(jM(e,{[n[i].name]:n[i].extends})):EL(e):OL();let i=CM(r).every(e=>AL(e)),a=i?pR(xM(r),r):{};return i?EL(a):OL()}function hR(e,t,n){let r=mR(e,t,n);return AL(r)?EL(jM(e,r.inferred)):OL()}function gR(e,t,n){return hR(e,t,n)}function _R(e,t){return xM(t).reduce((n,r)=>({...n,[r]:bM(e,r)?wP(n[r])?CP([...n[r].anyOf,t[r]]):CP([e[r],t[r]]):t[r]}),e)}function vR(e,t,n,r){return vM(t,(t,i)=>jL(XR({},e[t],n),t=>vR(e,i,n,_R(r,t)),()=>OL()),()=>EL(r))}function yR(e,t,n,r){return vR(t,xM(t),r,e)}function bR(e,t,n){return iI(n)?yR(e,t,tI(n),rI(n)):AN(n)?gR(e,t,n.properties):zL(e,kN(t),n)}function xR(e,t){return mM(xM(t).length,0)?EL(e):OL()}function SR(e,t,n,r,i){return XR(e,n,i)}function CR(e,t,n,r){return iI(r)?SR(e,eI(t),n,eI(tI(r)),rI(r)):AN(r)?xR(e,r.properties):yN(r)||NN(r)?EL(e):OL()}function wR(e,t,n){return SP(n)?EL(e):zL(e,t,n)}function TR(e,t,n){return bP(n)?EL(e):zL(e,t,n)}function ER(e,t,n){return XR(e,DF(t),n)}function DR(e,t){return KM({"~kind":`Inferrable`},{name:e,type:t},{})}function OR(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`name`)&&bM(e,`type`)&&mM(e[`~kind`],`Inferrable`)&&pM(e.name)&&fM(e.type)}function kR(e){return oI(e)?LN(e.items)?oN(e.items.extends)?DR(e.items.name,e.items.extends.items):NN(e.items.extends)?DR(e.items.name,e.items.extends):void 0:JN():void 0}function AR(e){return LN(e)?DR(e.name,e.extends):void 0}function jR(e,t,n=[]){return vM(e,(e,r)=>jL(XR({},e,t),()=>jR(r,t,[...n,e]),()=>void 0),()=>n)}function MR(e,t,n,r){let i=jR(n,r);return oM(i)?EL(jM(e,{[t]:KP(i)})):OL()}function NR(e,t,n,r){let i=jR(n,r);return oM(i)?EL(jM(e,{[t]:CP(i)})):OL()}function PR(e){return[...e].reverse()}function FR(e,t){return t?PR(e):e}function IR(e){let t=e.length>0?e[0]:void 0;return XM(XM(t)?kR(t):void 0)}function LR(e,t,n,r,i,a){return jL(XR(e,n,i),e=>BR(e,t,r,a),()=>OL())}function RR(e,t,n,r,i){let a=kR(r);return OR(a)?MR(e,a.name,FR(n,t),a.type):vM(n,(n,a)=>LR(e,t,n,a,r,i),()=>OL())}function zR(e,t,n,r){return vM(r,(r,i)=>RR(e,t,n,r,i),()=>mM(n.length,0)?EL(e):OL())}function BR(e,t,n,r){return zR(e,t,n,r)}function VR(e,t,n){let r=FU(e,MU([],[]),n),i=IR(r);return BR(e,i,FR(t,i),FR(r,i))}function HR(e,t,n){let r=AR(n);return OR(r)?NR(e,r.name,t,r.type):vM(t,(t,r)=>jL(XR(e,t,n),e=>HR(e,r,n),()=>OL()),()=>EL(e))}function UR(e,t,n){let r=FU(e,MU([],[]),t);return qP(n)?VR(e,r,n.items):oN(n)?HR(e,r,n.items):zL(e,KP(r),n)}function WR(e,t,n){return uI(n)||lI(n)?EL(e):zL(e,t,n)}function GR(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>EL(e),()=>GR(e,t,r)),()=>OL())}function KR(e,t,n){return vM(t,(t,r)=>jL(GR(e,t,n),e=>KR(e,r,n),()=>OL()),()=>EL(e))}function qR(e,t,n){let r=AR(n);return OR(r)?NR(e,r.name,t,r.type):wP(n)?KR(e,t,n.anyOf):KR(e,t,[n])}function JR(e,t,n){return LN(n)?zL(e,t,n):yN(n)||NN(n)?EL(e):OL()}function YR(e,t,n){return uI(n)?EL(e):zL(e,t,n)}function XR(e,t,n){return yN(t)?BL(e,t,n):oN(t)?HL(e,t,t.items,n):nP(t)?UL(e,t,n):rP(t)?WL(e,t,n):lN(t)?XL(e,t.parameters,t.instanceType,n):zN(t)?ZL(e,t.if,t.then,t.else,n):WN(t)?QL(e,t.enum,n):fN(t)?$L(e,t.parameters,t.returnType,n):oP(t)?eR(e,t,n):KN(t)?tR(e,t.allOf,n):pP(t)?sR(e,t,n):SN(t)?cR(e,t,n):hP(t)?lR(e,t,n):vP(t)?uR(e,t,n):AN(t)?bR(e,t.properties,n):iI(t)?CR(e,tI(t),rI(t),n):SP(t)?wR(e,t,n):bP(t)?TR(e,t,n):CL(t)?ER(e,t.pattern,n):qP(t)?UR(e,t.items,n):lI(t)?WR(e,t,n):wP(t)?qR(e,t.anyOf,n):NN(t)?JR(e,t,n):uI(t)?YR(e,t,n):OL()}function ZR(e,t){return EF([...e,kN(t)])}function QR(e,t,n){return NU(e)?JM(ZR(e,t),{},n):ez(e,t,n)}function $R(e,t,n,r,i){return QR(IU(e,t,n),PU(e,t,r),i)}function ez(e,t,n={}){return ZM(`Interface`,[e,t],n)}function tz(e){return XM(e)&&bM(e,`action`)&&mM(e.action,`Interface`)}function nz(e,t,n){return e.includes(n)?!0:az([...e,n],t,t[n])}function rz(e,t,n){return iz(e,t,ON(n))}function iz(e,t,n){return vM(n,(n,r)=>az(e,t,n)?!0:iz(e,t,r),()=>!1)}function az(e,t,n){return hN(n)?nz(e,t,n.$ref):oN(n)?az(e,t,n.items):lN(n)?iz(e,t,[...n.parameters,n.instanceType]):fN(n)?iz(e,t,[...n.parameters,n.returnType]):tz(n)?rz(e,t,n.parameters[1]):KN(n)?iz(e,t,n.allOf):AN(n)?rz(e,t,n.properties):wP(n)?iz(e,t,n.anyOf):qP(n)?iz(e,t,n.items):iI(n)?az(e,t,rI(n)):!1}function oz(e,t,n){return az(e,t,n)}function sz(e,t){return t.reduce((t,n)=>oz([n],e,e[n])?[...t,n]:t,[])}function cz(e){return sz(e,DN(e))}function lz(e,t,n){return n.includes(t)?n:t in e?fz(e,e[t],[...n,t]):JN()}function uz(e,t,n){return dz(e,ON(t),n)}function dz(e,t,n){return t.reduce((t,n)=>fz(e,n,t),n)}function fz(e,t,n){return hN(t)?lz(e,t.$ref,n):oN(t)?fz(e,t.items,n):lN(t)?dz(e,[...t.parameters,t.instanceType],n):fN(t)?dz(e,[...t.parameters,t.returnType],n):tz(t)?uz(e,t.parameters[1],n):KN(t)?dz(e,t.allOf,n):AN(t)?uz(e,t.properties,n):wP(t)?dz(e,t.anyOf,n):qP(t)?dz(e,t.items,n):iI(t)?fz(e,rI(t),n):n}function pz(e,t,n){return fz(e,n,[t])}function mz(e){return vN()}function hz(e){return xM(e).reduce((t,n)=>({...t,[n]:_z(e[n])}),{})}function gz(e){return e.reduce((e,t)=>[...e,_z(t)],[])}function _z(e){return hN(e)?mz(e.$ref):oN(e)?aN(_z(e.items),sN(e)):lN(e)?cN(gz(e.parameters),_z(e.instanceType)):fN(e)?dN(gz(e.parameters),_z(e.returnType)):KN(e)?GN(gz(e.allOf)):AN(e)?kN(hz(e.properties)):iI(e)?QF(nI(e),_z(rI(e))):wP(e)?CP(gz(e.anyOf)):qP(e)?KP(gz(e.items)):e}function vz(e,t){return t in e?_z(e[t]):MN()}function yz(e){return vz(e.$defs,e.$ref)}function bz(e,t,n){let r=IU(e,MU([],[]),t),i=PU({},MU([],[]),n);return EF([...r,kN(i)])}function xz(e,t){return xM(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=tz(r)?bz(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function Sz(e,t,n){return PN(xz(e,pz(e,t,n)),t)}function Cz(e,t){return t in e?hN(e[t])?Cz(e,e[t].$ref):e[t]:xN()}function wz(e,t){return Cz(e,t)}function Tz(e){return FN(e)?yz(e):IN(e)?MN():e}function Ez(e,t,n){return XR(e,Tz(t),Tz(n))}function Dz(e,t){let n=[Ez({},e,t),Ez({},t,e)];return AL(n[0])&&AL(n[1])?0:AL(n[0])&&kL(n[1])?2:kL(n[0])&&AL(n[1])?3:1}function Oz(e,t,n=[],r=t){return vM(t,(t,i)=>{let a=Dz(e,t);return mM(a,2)||mM(a,0)?r:mM(a,1)?Oz(e,i,[...n,t],r):Oz(e,i,n,r)},()=>[...n,e])}function kz(e,t,n){let r=kF(e);return yN(r)||NN(r)?[r]:SN(r)?Az(t,n):AN(r)?Az(t,[...n,r]):Az(t,Oz(r,n))}function Az(e,t=[]){return vM(e,(e,n)=>kz(e,n,t),()=>t)}function jz(e){return zF(Az(e))}function Mz(e,t){return JM(kF(e),{},t)}function Nz(e,t,n,r){return Mz(BU(e,t,n),r)}function Pz(e,t=[]){return QM(e)&&mM(e.action,`Conditional`)?hN(e.parameters[0])?Pz(e.parameters[2],Pz(e.parameters[3],[...t,e.parameters[0].$ref])):Pz(e.parameters[2],Pz(e.parameters[3],t)):QM(e)&&mM(e.action,`Mapped`)&&QM(e.parameters[1])&&mM(e.parameters[1].action,`KeyOf`)&&hN(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function Fz(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function Iz(e,t,n=[]){return vM(e,(e,r)=>vM(t,(t,i)=>Iz(r,i,[...n,[t,e]]),()=>n),()=>n)}function Lz(e){return CL(e)?DF(e.pattern):WN(e)?TF(e.enum):e}function Rz(e){let t=Lz(e);return wP(t)?[...t.anyOf]:[t]}function zz(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function Bz(e,t){return t.reduce((t,n)=>[...t,...zz(e,n)],[])}function Vz(e){return e.reduce((e,t)=>mM(t[0],!0)?Bz(e,Rz(t[1])):Bz(e,[t[1]]),[[]])}function Hz(e,t,n){let r=Iz(t,Fz(e,Pz(n)));return QM(n)&&mM(n.action,`Conditional`)||QM(n)&&mM(n.action,`Mapped`)?Vz(r):[t]}function Uz(){return[`(not-resolvable)`,xN()]}function Wz(){return[`(not-generic)`,xN()]}function Gz(e,t,n){return[e,gN(t,n)]}function Kz(e,t,n){return t in e?qz(e,t,e[t],n):Uz()}function qz(e,t,n,r){return _N(n)?Gz(t,n.parameters,n.expression):hN(n)?Kz(e,n.$ref,r):Wz()}function Jz(e,t,n){return qz(e,`(anonymous)`,t,n)}function Yz(e,t,n){if(LN(t)||fB(t)||AL(Ez({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function Xz(e,t,n,r,i){let a=BU(e,t,i);return Yz(n,a,r),jM(e,{[n]:a})}function Zz(e,t,n,r,i){let a=BU(e,t,n.extends),o=BU(e,t,n.equals);return vM(i,(i,o)=>Qz(Xz(e,t,n.name,a,i),t,r,o),()=>Qz(Xz(e,t,n.name,a,o),t,r,[]))}function Qz(e,t,n,r){return vM(n,(n,i)=>Zz(e,t,n,i,r),()=>e)}function $z(e,t,n,r){return Qz(e,t,n,r)}var eB=0,tB=0;function nB(){if(!gM(tB,kM().maxInstantiationCount))throw Error(`Type instantiation is excessively deep and possibly infinite`)}function rB(){nB(),tB++,eB++}function iB(){eB--,mM(eB,0)&&(tB=0)}function aB(e){return hM(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function oB(e,t){return mM(aB(e),t)}function sB(e,t,n,r,i,a){rB();try{let o=$z(e,t,r,a),s=BU(o,MU([...t.callstack,n.$ref],t.visited),i);return BU(o,MU([],[]),s)}finally{iB()}}function cB(e,t,n,r,i,a){return a.reduce((a,o)=>{let s=sB(e,t,n,r,i,o);return[...a,s]},[])}function lB(e,t,n,r,i,a){let o=cB(e,t,n,r,i,Hz(r,a,i));return mM(o.length,1)?o[0]:OF(o)}function uB(e,t,n,r){let i=IU(e,t,r),a=Jz(e,n,r),o=a[0],s=a[1];return _N(s)?oB(t,o)?dB(mN(o),i):lB(e,t,mN(o),s.parameters,s.expression,i):dB(n,i)}function dB(e,t){return KM({"~kind":`Call`},{type:`call`,target:e,arguments:t},{})}function fB(e){return YM(e,`Call`)}function pB(e){return qM(e,[`~immutable`])}function mB(e,t){return JM(pB(e),{},t)}function hB(e,t,n,r){return mB(BU(e,t,n),r)}function gB(e,t){return e(t)}function _B(e,t){return pM(t)?lP(gB(e,t)):lP(t)}function vB(e,t){return bB(e,DF(t))}function yB(e,t){return CP(t.map(t=>bB(e,t)))}function bB(e,t){return pP(t)?_B(e,t.const):CL(t)?vB(e,t.pattern):wP(t)?yB(e,t.anyOf):t}function xB(e,t={}){return ZM(`Capitalize`,[e],t)}function SB(e,t={}){return ZM(`Lowercase`,[e],t)}function CB(e,t={}){return ZM(`Uncapitalize`,[e],t)}function wB(e,t={}){return ZM(`Uppercase`,[e],t)}var TB=e=>e[0].toUpperCase()+e.slice(1),EB=e=>e.toLowerCase(),DB=e=>e[0].toLowerCase()+e.slice(1),OB=e=>e.toUpperCase();function kB(e,t){return NU([e])?JM(bB(TB,e),{},t):xB(e,t)}function AB(e,t){return NU([e])?JM(bB(EB,e),{},t):SB(e,t)}function jB(e,t){return NU([e])?JM(bB(DB,e),{},t):CB(e,t)}function MB(e,t){return NU([e])?JM(bB(OB,e),{},t):wB(e,t)}function NB(e,t,n,r){return kB(BU(e,t,n),r)}function PB(e,t,n,r){return AB(BU(e,t,n),r)}function FB(e,t,n,r){return jB(BU(e,t,n),r)}function IB(e,t,n,r){return MB(BU(e,t,n),r)}function LB(e,t,n,r,i={}){return ZM(`Conditional`,[e,t,n,r],i)}function RB(e,t,n,r,i,a){let o=Ez(e,n,r);return TL(o)?CP([BU(o.inferred,t,i),BU(e,t,a)]):DL(o)?BU(o.inferred,t,i):BU(e,t,a)}function zB(e,t,n,r,i,a,o){return NU([n,r])?JM(RB(e,t,n,r,i,a),{},o):LB(n,r,i,a,o)}function BB(e,t,n,r,i,a,o){return zB(e,t,BU(e,t,n),BU(e,t,r),i,a,o)}function VB(e,t={}){return ZM(`ConstructorParameters`,[e],t)}function HB(e){let t=lN(e)?e.parameters:[];return KP(FU({},MU([],[]),t))}function UB(e,t){return NU([e])?JM(HB(e),{},t):VB(e,t)}function WB(e,t,n,r){return UB(BU(e,t,n),r)}function GB(e,t,n={}){return ZM(`Exclude`,[e,t],n)}function KB(e,t,n){return NU([e,t])?JM(CF(e,t),{},n):GB(e,t,n)}function qB(e,t,n,r,i){return KB(BU(e,t,n),BU(e,t,r),i)}function JB(e,t,n={}){return ZM(`Extract`,[e,t],n)}function YB(e,t){return AL(Ez({},e,t))?[e]:[]}function XB(e,t,n=[]){return vM(e,(e,r)=>XB(r,t,[...n,...YB(e,t)]),()=>n)}function ZB(e,t){let n=kF(e);return OF(XB(wP(n)?n.anyOf:[n],t))}function QB(e,t,n){return NU([e,t])?JM(ZB(e,t),{},n):JB(e,t,n)}function $B(e,t,n,r,i){return QB(BU(e,t,n),BU(e,t,r),i)}function eV(e,t,n={}){return ZM(`Index`,[e,t],n)}function tV(e,t){return uV(wz(e,t))}function nV(e,t,n){return uV(wF(e,t,n))}function rV(e,t){let n=xM(e).filter(e=>!bM(t,e)),r=xM(t).filter(t=>!bM(e,t)),i=xM(e).filter(e=>bM(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:EF([e[r],t[r]])}),{});return jM(jM(a,o),s)}function iV(e){return e.reduce((e,t)=>rV(e,uV(t)),{})}function aV(e){return e}function oV(e){return uV(iF(KP(e)))}function sV(e,t){return xM(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:OF([e[r],t[r]])}),{})}function cV(e,t){return vM(e,(e,n)=>cV(n,sV(t,uV(e))),()=>t)}function lV(e){return vM(e,(e,t)=>cV(t,uV(e)),()=>JN())}function uV(e){return FN(e)?tV(e.$defs,e.$ref):zN(e)?nV(e.if,e.then,e.else):KN(e)?iV(e.allOf):wP(e)?lV(e.anyOf):qP(e)?oV(e.items):AN(e)?aV(e.properties):{}}function dV(e){return kN(uV(e))}var fV=RegExp(`^(?:0|[1-9][0-9]*)$`);function pV(e){let t=`${e}`;return fV.test(t)?parseInt(t):e}function mV(e){return lP(pV(e))}function hV(e){return e.map(e=>gV(e))}function gV(e){return KN(e)?GN(hV(e.allOf)):wP(e)?CP(hV(e.anyOf)):pP(e)?mV(e.const):e}function _V(e,t){return AL(Ez({},gV(t),_P()))?e:pP(t)&&mM(t.const,`length`)?_P():xN()}function vV(e,t){return TV(wz(e,t))}function yV(e,t,n){return TV(wF(e,t,n))}function bV(e){return TV(TF(e))}function xV(e){return TV(EF(e))}function SV(e){return[`${e}`]}function CV(e){return TV(DF(e))}function wV(e){return e.reduce((e,t)=>[...e,...TV(t)],[])}function TV(e){return FN(e)?vV(e.$defs,e.$ref):zN(e)?yV(e.if,e.then,e.else):WN(e)?bV(e.enum):KN(e)?xV(e.allOf):pP(e)?SV(e.const):CL(e)?CV(e.pattern):wP(e)?wV(e.anyOf):[]}function EV(e){return TV(e)}function DV(e,t){return t.map(t=>OV(e,t))}function OV(e,t){return oN(t)?aN(OV(e,t.items)):lN(t)?cN(DV(e,t.parameters),OV(e,t.instanceType)):fN(t)?dN(DV(e,t.parameters),OV(e,t.returnType)):qP(t)?KP(DV(e,t.items)):wP(t)?CP(DV(e,t.anyOf)):KN(t)?GN(DV(e,t.allOf)):sI(t)?kN(e):t}function kV(e,t){return OV(e,t)}function AV(e,t){return kV(e,t in e?e[t]:xN())}function jV(e,t){return t.reduce((t,n)=>[...t,AV(e,n)],[])}function MV(e,t){return OF(jV(e,EV(t)))}var NV=new RegExp(JF);function PV(e){return e.filter(e=>NV.test(e))}function FV(e){return OF(jV(e,PV(DN(e))))}function IV(e,t){return vP(t)?FV(e):MV(e,t)}function LV(e){return lP(pV(e))}function RV(e){return e.map(e=>zV(e))}function zV(e){return KN(e)?GN(RV(e.allOf)):wP(e)?CP(RV(e.anyOf)):pP(e)?LV(e.const):e}function BV(e,t){return e.reduceRight((e,n,r)=>AL(Ez({},lP(r),t))?[n,...e]:e,[])}function VV(e,t){return AF(BV(e,zV(t)))}function HV(e){return AF(e)}function UV(e,t){return pP(t)&&mM(t.const,`length`)?lP(e.length):vP(t)||oP(t)?HV(e):VV(e,t)}function WV(e,t){return oN(e)?_V(e.items,t):AN(e)?IV(e.properties,t):qP(e)?UV(e.items,t):xN()}function GV(e){return FN(e)||zN(e)||KN(e)||wP(e)?dV(e):e}function KV(e,t,n){return NU([e,t])?JM(WV(GV(e),t),{},n):eV(e,t,n)}function qV(e,t,n,r,i){return KV(BU(e,t,n),BU(e,t,r),i)}function JV(e,t={}){return ZM(`InstanceType`,[e],t)}function YV(e){return lN(e)?e.instanceType:xN()}function XV(e,t){return NU([e])?JM(YV(e),{},t):JV(e,t)}function ZV(e,t,n,r={}){return XV(BU(e,t,n),r)}function QV(e,t={}){return ZM(`KeyOf`,[e],t)}function $V(){return CP([_P(),xP(),yP()])}function eH(e){return _P()}function tH(e){return e.reduce((e,t)=>uP(t)?[...e,lP(pV(t))]:JN(),[])}function nH(e){return AF(tH(xM(e)))}function rH(e){return nI(e)}function iH(e){return AF(e.map((e,t)=>lP(t)))}function aH(e){return yN(e)?$V():oN(e)?eH(e.items):AN(e)?nH(e.properties):iI(e)?rH(e):qP(e)?iH(e.items):xN()}function oH(e){return FN(e)||zN(e)||KN(e)||wP(e)?dV(e):e}function sH(e,t){return NU([e])?JM(aH(oH(e)),{},t):QV(e,t)}function cH(e,t,n,r){return sH(BU(e,t,n),r)}function lH(e,t,n,r,i={}){return ZM(`Mapped`,[e,t,n,r],i)}function uH(e){return mH(DF(e))}function dH(e){return e.reduce((e,t)=>[...e,...mH(t)],[])}function fH(e){return mH(TF(e))}function pH(e){return uM(e)?[lP(`${e}`)]:[lP(e)]}function mH(e){return WN(e)?fH(e.enum):pP(e)?pH(e.const):CL(e)?uH(e.pattern):wP(e)?dH(e.anyOf):[e]}function hH(e){return mH(e)}function gH(e){return CL(e)?DF(e.pattern):e}function _H(e,t,n,r,i,a){let o=jM(e,{[n.name]:r}),s=gH(BU(o,t,i)),c=BU(o,t,a);return dP(s)||fP(s)?{[s.const]:c}:{}}function vH(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,_H(e,t,n,o,i,a)],[])}function yH(e){return e.reduce((e,t)=>[...e,kN(t)],[])}function bH(e,t,n,r,i,a){return EF(yH(vH(e,t,n,hH(r),i,a)))}function xH(e,t,n,r,i,a,o){return NU([r])?JM(bH(e,t,n,r,i,a),{},o):lH(n,r,i,a,o)}function SH(e,t,n,r,i,a,o){return xH(e,t,n,BU(e,t,r),i,a,o)}function CH(e,t,n){let r=jM(e,t);return xM(t).filter(e=>n.includes(e)).reduce((e,n)=>({...e,[n]:Sz(r,n,t[n])}),{})}function wH(e,t,n){let r=jM(e,t);return xM(t).filter(e=>!n.includes(e)).reduce((e,n)=>({...e,[n]:BU(r,MU([],[]),t[n])}),{})}function TH(e,t,n){let r=cz(t),i=CH(e,t,r),a=wH(e,t,r);return JM({...i,...a},{},n)}function EH(e,t,n,r){return TH(e,n,r)}function DH(e,t={}){return ZM(`NonNullable`,[e],t)}function OH(e){return KB(e,CP([mP(),cI()]),{})}function kH(e,t){return NU([e])?JM(OH(e),{},t):DH(e,t)}function AH(e,t,n,r){return kH(BU(e,t,n),r)}function jH(e,t,n={}){return ZM(`Omit`,[e,t],n)}function MH(e){let t=dV(e);return AN(t)?t.properties:JN()}function NH(e,t){return xM(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function PH(e,t){return kN(NH(MH(e),EV(t)))}function FH(e,t,n){return NU([e,t])?JM(PH(e,t),{},n):jH(e,t,n)}function IH(e,t,n,r,i){return FH(BU(e,t,n),BU(e,t,r),i)}function LH(e,t={}){return ZM(`Parameters`,[e],t)}function RH(e){let t=fN(e)?e.parameters:[];return KP(FU({},MU([],[]),t))}function zH(e,t){return NU([e])?JM(RH(e),{},t):LH(e,t)}function BH(e,t,n,r){return zH(BU(e,t,n),r)}function VH(e,t={}){return ZM(`Partial`,[e],t)}function HH(e,t={}){return YH(e,t)}function UH(e,t){let n=JH(wz(e,t));return PN(jM(e,{[t]:n}),t)}function WH(e,t,n){return JH(wF(e,t,n))}function GH(e){return JH(EF(e))}function KH(e){return CP(e.map(e=>JH(e)))}function qH(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:CN(e[n])}),{}))}function JH(e){return FN(e)?UH(e.$defs,e.$ref):zN(e)?WH(e.if,e.then,e.else):KN(e)?GH(e.allOf):wP(e)?KH(e.anyOf):AN(e)?qH(e.properties):kN({})}function YH(e,t){return NU([e])?JM(JH(e),{},t):VH(e,t)}function XH(e,t,n,r){return YH(BU(e,t,n),r)}function ZH(e,t,n={}){return ZM(`Pick`,[e,t],n)}function QH(e,t){return xM(e).reduce((n,r)=>t.includes(r)?jM(n,{[r]:e[r]}):n,{})}function $H(e,t){return kN(QH(MH(e),EV(t)))}function eU(e,t,n){return NU([e,t])?JM($H(e,t),{},n):ZH(e,t,n)}function tU(e,t,n,r,i){return eU(BU(e,t,n),BU(e,t,r),i)}function nU(e,t={}){return ZM(`ReadonlyObject`,[e],t)}function rU(e){return WU(aN(e))}function iU(e,t){let n=uU(wz(e,t));return PN(jM(e,{[t]:n}),t)}function aU(e,t,n){return uU(wF(e,t,n))}function oU(e){return uU(EF(e))}function sU(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:QN(e[n])}),{}))}function cU(e){return WU(KP(e))}function lU(e){return CP(e.map(e=>uU(e)))}function uU(e){return oN(e)?rU(e.items):FN(e)?iU(e.$defs,e.$ref):zN(e)?aU(e.if,e.then,e.else):KN(e)?oU(e.allOf):AN(e)?sU(e.properties):qP(e)?cU(e.items):wP(e)?lU(e.anyOf):e}function dU(e,t){return NU([e])?JM(uU(e),{},t):nU(e)}function fU(e,t,n,r){return dU(BU(e,t,n),r)}function pU(e,t,n,r){return t.visited.includes(r)?n:r in e?BU(e,MU(t.callstack,[...t.visited,r]),e[r]):n}function mU(e,t){let n=yU(wz(e,t));return PN(jM(e,{[t]:n}),t)}function hU(e,t,n){return yU(wF(e,t,n))}function gU(e){return yU(EF(e))}function _U(e){return CP(e.map(e=>yU(e)))}function vU(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:nF(e[n])}),{}))}function yU(e){return FN(e)?mU(e.$defs,e.$ref):zN(e)?hU(e.if,e.then,e.else):KN(e)?gU(e.allOf):wP(e)?_U(e.anyOf):AN(e)?vU(e.properties):kN({})}function bU(e,t={}){return ZM(`Required`,[e],t)}function xU(e,t){return NU([e])?JM(yU(e),{},t):bU(e,t)}function SU(e,t,n,r){return xU(BU(e,t,n),r)}function CU(e,t={}){return ZM(`ReturnType`,[e],t)}function wU(e){return fN(e)?e.returnType:xN()}function TU(e,t){return NU([e])?JM(wU(e),{},t):CU(e,t)}function EU(e,t,n,r={}){return TU(BU(e,t,n),r)}function DU(e,t){return ZM(`With`,[e,t],{})}function OU(e,t){return NU([e])?JM(e,{},t):DU(e,t)}function kU(e,t,n,r){return OU(BU(e,t,n),r)}function AU(e){return oI(e)?qP(e.items)?jU(e.items.items):LN(e.items)||hN(e.items)?[e]:[xN()]:[e]}function jU(e){return e.reduce((e,t)=>[...e,...AU(t)],[])}function MU(e,t){return{callstack:e,visited:t}}function NU(e){return vM(e,(e,t)=>!hN(e)&&NU(t),()=>!0)}function PU(e,t,n){return xM(n).reduce((r,i)=>({...r,[i]:BU(e,t,n[i])}),{})}function FU(e,t,n){return jU(IU(e,t,n))}function IU(e,t,n){return n.map(n=>BU(e,t,n))}function LU(e,t){let n=TN(e)?rN(t,{}):t,r=$N(e)?eN(n,{}):n;return ZN(e)?HU(r,{}):r}function RU(e,t,n,r,i){return mM(n,`AddImmutable`)?UU(e,t,r[0],i):mM(n,`RemoveImmutable`)?hB(e,t,r[0],i):mM(n,`AddReadonly`)?tN(e,t,r[0],i):mM(n,`RemoveReadonly`)?ZP(e,t,r[0],i):mM(n,`AddOptional`)?iN(e,t,r[0],i):mM(n,`RemoveOptional`)?tF(e,t,r[0],i):mM(n,`Capitalize`)?NB(e,t,r[0],i):mM(n,`Conditional`)?BB(e,t,r[0],r[1],r[2],r[3],i):mM(n,`ConstructorParameters`)?WB(e,t,r[0],i):mM(n,`Evaluate`)?Nz(e,t,r[0],i):mM(n,`Exclude`)?qB(e,t,r[0],r[1],i):mM(n,`Extract`)?$B(e,t,r[0],r[1],i):mM(n,`Index`)?qV(e,t,r[0],r[1],i):mM(n,`InstanceType`)?ZV(e,t,r[0],i):mM(n,`Interface`)?$R(e,t,r[0],r[1],i):mM(n,`KeyOf`)?cH(e,t,r[0],i):mM(n,`Lowercase`)?PB(e,t,r[0],i):mM(n,`Mapped`)?SH(e,t,r[0],r[1],r[2],r[3],i):mM(n,`Module`)?EH(e,t,r[0],i):mM(n,`NonNullable`)?AH(e,t,r[0],i):mM(n,`Pick`)?tU(e,t,r[0],r[1],i):mM(n,`Parameters`)?BH(e,t,r[0],i):mM(n,`Partial`)?XH(e,t,r[0],i):mM(n,`Omit`)?IH(e,t,r[0],r[1],i):mM(n,`ReadonlyObject`)?fU(e,t,r[0],i):mM(n,`Record`)?qF(e,t,r[0],r[1],i):mM(n,`Required`)?SU(e,t,r[0],i):mM(n,`ReturnType`)?EU(e,t,r[0],i):mM(n,`TemplateLiteral`)?bL(e,t,r[0],i):mM(n,`Uncapitalize`)?FB(e,t,r[0],i):mM(n,`Uppercase`)?IB(e,t,r[0],i):mM(n,`With`)?kU(e,t,r[0],r[1]):ZM(n,r,i)}function zU(e,t,n){return LU(n,hN(n)?pU(e,t,n,n.$ref):oN(n)?aN(BU(e,t,n.items),sN(n)):fB(n)?uB(e,t,n.target,n.arguments):lN(n)?cN(IU(e,t,n.parameters),BU(e,t,n.instanceType),uN(n)):fN(n)?dN(IU(e,t,n.parameters),BU(e,t,n.returnType),pN(n)):zN(n)?RN(BU(e,t,n.if),BU(e,t,n.then),BU(e,t,n.else),BN(n)):KN(n)?GN(IU(e,t,n.allOf),qN(n)):AN(n)?kN(PU(e,t,n.properties),jN(n)):iI(n)?$F(tI(n),BU(e,t,rI(n))):oI(n)?aI(BU(e,t,n.items)):qP(n)?KP(FU(e,t,n.items),JP(n)):wP(n)?CP(IU(e,t,n.anyOf),TP(n)):n)}function BU(e,t,n){return QM(n)?RU(e,t,n.action,n.parameters,n.options):zU(e,t,n)}function VU(e){return JM(e,{"~immutable":!0},{})}function HU(e,t){return JM(VU(e),{},t)}function UU(e,t,n,r){return HU(BU(e,t,n),r)}function WU(e,t={}){return HU(e,t)}var GU=[`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],KU=[`off`,...GU],qU=[`text`,`image`],JU=[`none`,`short`,`long`],YU=[`short`,`long`];UN(GU);var XU=UN(KU);UN(qU),UN(JU),HH(QF(XU,CP([xP(),mP()]))),HH(QF(UN(YU),_P({exclusiveMinimum:0})),{description:`Best-effort prompt cache lifetime in seconds for each retention tier. A missing tier means the lifetime is unknown, so Pi does not warm it.`});var ZU={input:_P({description:`Input cost in USD per million tokens.`}),output:_P({description:`Output cost in USD per million tokens.`}),cacheRead:_P({description:`Cache-read cost in USD per million tokens.`}),cacheWrite:_P({description:`Cache-write cost in USD per million tokens.`})};kN(ZU);var QU=kN({inputTokensAbove:_P({description:`Use this tier when total request input exceeds this token count.`}),...ZU});kN({...ZU,tiers:wN(aN(QU,{description:`Request-wide pricing tiers. The highest matching input threshold applies to the full request.`}))});function $U(e){return kN({maxWidth:wN(aP({minimum:1})),maxHeight:wN(aP({minimum:1})),maxBytes:wN(aP({minimum:1,description:`Maximum base64-encoded payload size in bytes.`})),jpegQuality:wN(aP({minimum:1,maximum:100}))},e)}$U();var eW=kN({resize:wN($U({description:`Cache-safe resize profile applied before a new image enters conversation history.`})),maxPerMessage:wN(aP({minimum:1,description:`Maximum images accepted in one provider message.`})),maxPerRequest:wN(aP({minimum:1,description:`Maximum images accepted across one provider request.`}))});kN({maxRequestBytes:wN(aP({minimum:1,description:`Maximum serialized provider request size in bytes.`})),images:wN(eW)});function tW({sessionId:e,template:t,existingIds:n,apiKey:r,onClose:i,onAdd:a}){let{t:o}=W(),[s,c]=(0,K.useState)([]),[l,u]=(0,K.useState)(new Set),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)(!0),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(0),x=(0,K.useRef)({template:t,apiKey:r,existingIds:n}),S=new Set(n),C=Math.max(0,100-S.size),w=s.filter(e=>`${e.id} ${e.name}`.toLowerCase().includes(d.trim().toLowerCase())),T=w.filter(e=>!S.has(e.id)),E=T.length>0&&T.every(e=>l.has(e.id));return(0,K.useEffect)(()=>{let t=new AbortController,{template:n,apiKey:r,existingIds:i}=x.current;return m(!0),v(!1),new de().discoverProviderModels(e,{provider:n.provider,baseUrl:n.baseUrl,api:n.api,...r.trim()?{apiKey:r.trim()}:{}},t.signal).then(e=>{t.signal.aborted||(c(e.models),g(e.truncated),m(!1),u(new Set(e.models.filter(e=>!i.includes(e.id)).slice(0,Math.max(0,100-i.length)).map(e=>e.id))))},()=>{t.signal.aborted||(v(!0),m(!1))}),()=>t.abort()},[e,y]),(0,q.jsx)(Se,{isOpen:!0,width:380,padding:0,className:`models-picker-dialog`,"aria-label":o(`providerPickerTitle`),onOpenChange:e=>!e&&i(),children:(0,q.jsxs)(`div`,{className:`models-picker`,children:[(0,q.jsxs)(`header`,{children:[(0,q.jsx)(`h2`,{children:o(`providerPickerTitle`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":o(`close`),onClick:i,children:(0,q.jsx)(je,{})})]}),(0,q.jsx)(`p`,{children:o(`providerPickerIntro`)}),(0,q.jsxs)(`div`,{className:`models-picker-toolbar`,children:[(0,q.jsx)(`input`,{"data-autofocus":!0,type:`search`,"aria-label":o(`providerPickerSearch`),placeholder:o(`providerPickerSearch`),value:d,onKeyDown:e=>{e.key===`Enter`&&e.preventDefault()},onChange:e=>f(e.target.value)}),(0,q.jsx)(`button`,{type:`button`,className:`models-link`,disabled:p||!T.length,onClick:()=>u(e=>{let t=new Set(e);for(let e of T)E?t.delete(e.id):t.size(0,q.jsxs)(`label`,{className:`models-picker-row`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:S.has(e.id)||l.has(e.id),disabled:S.has(e.id)||!l.has(e.id)&&l.size>=C,onChange:t=>u(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}),(0,q.jsx)(`span`,{title:e.name,children:e.id}),S.has(e.id)&&(0,q.jsx)(`small`,{children:o(`providerPickerAdded`)})]},e.id)),!p&&!_&&!w.length&&(0,q.jsx)(`p`,{className:`models-picker-empty`,children:o(d?`providerPickerNoMatch`:`providerPickerEmpty`)}),_&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[(0,q.jsx)(`p`,{children:o(`providerPickerError_load`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:()=>b(e=>e+1),children:o(`retryAdmissionCheck`)})]})]}),h&&(0,q.jsx)(`p`,{className:`models-hint`,children:o(`providerPickerBounded`)}),(0,q.jsxs)(`footer`,{children:[(0,q.jsx)(`span`,{className:`models-hint`,"aria-live":`polite`,children:l.size>0&&o(`providerPickerSelected`,{count:l.size})}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:i,children:o(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:!l.size||p||_,onClick:()=>a(s.filter(e=>l.has(e.id))),children:o(`providerPickerSave`)})]})]})})}function nW(e){let t=e.trim();if(!t)return;let n=/^(\d+(?:\.\d+)?)([km])?$/i.exec(t);if(!n)return NaN;let r=n[2]?.toLowerCase()===`m`?1e6:n[2]?.toLowerCase()===`k`?1e3:1,i=Number(n[1])*r,a=Math.round(i),o=Math.abs(i-a)<1e-6?a:i;return Number.isSafeInteger(o)&&o>0&&o<=1e8?o:NaN}function rW(e){if(e===void 0)return``;if(Number.isInteger(e)&&e>0){if(e%1e6==0)return`${e/1e6}M`;if(e%1e3==0)return`${e/1e3}K`}return String(e)}function iW({sessionId:e,providerId:t,configuration:n,auth:r,isNew:i,custom:a,taken:o,currentModel:s,availableModels:c,busy:l,onDirty:u,onSaving:d,onClose:f,onReload:p}){let{t:m}=W(),[h]=(0,K.useState)(()=>{let e=n.providers?.find(e=>e.provider===t),i=n.models.filter(e=>e.provider===t).map(e=>({...e,rowKey:crypto.randomUUID()}));return{provider:t,name:e?.name||r?.name||t,baseUrl:e?.baseUrl||i[0]?.baseUrl||r?.baseUrl||``,api:e?.api||i[0]?.api||r?.api||`openai-completions`,models:i}}),[g]=(0,K.useState)(n.revision),[_,v]=(0,K.useState)(h),[y,b]=(0,K.useState)(``),x=!i&&!!r?.authMethods.includes(`oauth`),S=a||!!r?.authMethods.includes(`api_key`),[C,w]=(0,K.useState)(x&&(!r?.configured||r?.subscription||!S)?`oauth`:`api_key`),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1),k=(0,K.useRef)(null),A=(0,K.useRef)(!1),[j,M]=(0,K.useState)(new Set),[N,P]=(0,K.useState)({}),[F,I]=(0,K.useState)(!1),[ee,L]=(0,K.useState)(null),[R,te]=(0,K.useState)(!1),z=(0,K.useRef)(null),B=(0,K.useRef)({onDirty:u,onSaving:d});B.current={onDirty:u,onSaving:d};let ne=JSON.stringify(_)!==JSON.stringify(h),re=ne||y.length>0;(0,K.useEffect)(()=>{B.current.onDirty(re)},[re]),(0,K.useEffect)(()=>{B.current.onSaving(F||T)},[F,T]),(0,K.useEffect)(()=>{D?A.current=!0:A.current&&(A.current=!1,k.current?.focus({preventScroll:!0}))},[D]),(0,K.useEffect)(()=>()=>{z.current?.abort(),B.current.onSaving(!1),B.current.onDirty(!1)},[]);let V=n.providers?.find(e=>e.provider===t)?.editable!==!1,ie=l||F||T,ae=ie||R||!V,oe=!/^[a-zA-Z0-9._-]+$/.test(_.provider)||[`__proto__`,`constructor`,`prototype`].includes(_.provider)||i&&a&&o.includes(_.provider),se=_.models.findIndex(e=>!e.id.trim()||[e.contextWindow,e.maxTokens].some(e=>e!==void 0&&!Number.isFinite(e))||_.models.some(t=>t.rowKey!==e.rowKey&&t.id.trim()===e.id.trim())),ce=se!==-1,le=i&&a||ne,H=!oe&&!/[\r\n\u0000]/u.test(y)&&(R||!le||(!a||_.models.length>0)&&!ce&&!!_.baseUrl)&&(le||y.trim().length>0),ue=e=>{v(t=>({...t,...e})),ee!==`conflict`&&L(null)},fe=(e,t)=>ue({models:_.models.map((n,r)=>r===e?{...n,...t}:n)}),pe=_.models.map(e=>n.thinkingDefaults?.[`${e.provider}/${e.id}`]),me=_.models.map((e,t)=>{let n=e.thinkingLevelMap??pe[t];return KU.filter(e=>n?.[e]!==null&&(e!==`xhigh`&&e!==`max`||n?.[e]!==void 0))}),he={id:``,name:``,reasoning:!1,provider:_.provider,baseUrl:_.baseUrl,api:_.api},_e=async()=>{if(ie||D||!H||ee===`conflict`)return;let t=new AbortController;z.current=t,I(!0),L(null);let n=R,r=new de;try{if(le&&!n){if(await r.changeProviderConfiguration(e,g,{action:`save`,configuration:{..._,name:_.name.trim()||_.provider,models:_.models.map(({rowKey:e,...t})=>({...t,id:t.id.trim(),name:t.name.trim()||t.id.trim(),provider:_.provider,baseUrl:_.baseUrl===h.baseUrl&&t.baseUrl||_.baseUrl,api:_.api===h.api?t.api:_.api}))}},t.signal),t.signal.aborted)return;n=!0,te(!0)}if(y.trim()&&await r.saveProviderKey(e,_.provider,y.trim(),t.signal),t.signal.aborted)return;b(``),B.current.onDirty(!1),f(_.name||_.provider,_.provider)}catch(e){t.signal.aborted||L(e instanceof ge&&e.code===`MODEL_CONFIGURATION_CONFLICT`?`conflict`:e instanceof ge&&e.code===`MODEL_NOT_AVAILABLE`?`current`:n?`key`:`failed`)}finally{t.signal.aborted||I(!1)}},ve=e=>(0,q.jsxs)(`label`,{className:`models-field`,children:[m(e===`name`?`providerDisplayName`:`modelConfig_${e}`),(0,q.jsx)(`input`,{type:e===`baseUrl`?`url`:`text`,value:_[e],maxLength:e===`baseUrl`?2048:160,autoComplete:`off`,disabled:ae,required:e===`provider`||e===`baseUrl`&&le,"aria-invalid":e===`provider`&&_.provider.length>0&&oe,placeholder:e===`provider`?`my-provider`:e===`name`?_.provider:`https://api.example.com/v1`,onChange:t=>ue({[e]:t.target.value})})]}),ye=(0,q.jsxs)(`label`,{className:`models-field`,htmlFor:`provider-api-${t||`custom`}`,children:[m(`modelConfig_api`),(0,q.jsx)(Tj,{id:`provider-api-${t||`custom`}`,label:m(`modelConfig_api`),value:_.api,disabled:ae,onChange:e=>{(e===`openai-responses`||e===`openai-completions`||e===`anthropic-messages`)&&ue({api:e})},options:[{value:`openai-completions`,label:`OpenAI Chat Completions`},{value:`openai-responses`,label:`OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`}]})]}),be=(0,q.jsxs)(`div`,{className:`models-catalog`,children:[(0,q.jsxs)(`div`,{className:`models-list-head`,children:[(0,q.jsx)(`span`,{children:m(`modelSettings`)}),(0,q.jsx)(`button`,{type:`button`,ref:k,className:`models-link`,disabled:ae||oe||!_.baseUrl,onClick:()=>O(!0),children:m(`providerFetchModels`)})]}),!V&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerModelsReadOnly`)}),_.models.length===0&&(0,q.jsx)(`p`,{className:`models-empty`,children:m(a?`providerModelsEmpty`:`providerModelsInherited`,{count:c.length})}),(0,q.jsxs)(`div`,{className:`models-entry-list`,children:[s&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerCurrentSessionModel`,{model:`${s.provider} / ${s.id}`})}),_.models.map((e,t)=>(0,q.jsxs)(`div`,{className:`models-entry`,children:[s?.provider===_.provider&&s.id===e.id&&(0,q.jsx)(`p`,{className:`models-current-label`,children:m(`currentModel`)}),(0,q.jsxs)(`div`,{className:`models-entry-row`,children:[(0,q.jsx)(`input`,{"aria-label":m(`providerModelId`,{number:t+1}),placeholder:m(`modelConfig_id`),value:e.id,maxLength:256,required:!0,disabled:ae||s?.provider===_.provider&&s.id===e.id,onChange:e=>fe(t,{id:e.target.value})}),(0,q.jsx)(`input`,{"aria-label":m(`providerModelName`,{number:t+1}),placeholder:m(`modelConfig_name`),value:e.name,maxLength:256,disabled:ae,onChange:e=>fe(t,{name:e.target.value})}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":m(`providerModelDetails`,{model:e.name||e.id||t+1}),"aria-expanded":j.has(e.rowKey),title:m(`providerModelOptions`),onClick:()=>M(t=>{let n=new Set(t);return n.delete(e.rowKey)||n.add(e.rowKey),n}),children:(0,q.jsx)(os,{})}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon danger`,"aria-label":m(`providerRemoveModel`,{model:e.name||e.id||t+1}),disabled:ae||s?.provider===_.provider&&s.id===e.id,title:s?.provider===_.provider&&s.id===e.id?m(`providerCurrentRemoval`):m(`providerRemoveModel`,{model:e.name||e.id||t+1}),onClick:()=>{ue({models:_.models.filter((e,n)=>n!==t)}),M(t=>new Set([...t].filter(t=>t!==e.rowKey))),P(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.rowKey)))},children:(0,q.jsx)(Uc,{})})]}),j.has(e.rowKey)&&(0,q.jsxs)(`div`,{className:`models-entry-details`,children:[[`contextWindow`,`maxTokens`].map(n=>(0,q.jsxs)(`label`,{className:`models-field models-capacity`,children:[m(`modelConfig_${n}`),(0,q.jsx)(`input`,{type:`text`,inputMode:`numeric`,autoComplete:`off`,spellCheck:!1,"aria-label":m(`providerCapacityLabel`,{field:m(`modelConfig_${n}`),number:t+1}),"aria-invalid":e[n]!==void 0&&!Number.isFinite(e[n]),placeholder:n===`contextWindow`?`256K`:`32K`,value:N[e.rowKey]?.[n]??rW(e[n]),disabled:ae,onChange:r=>{let i=r.target.value;P(t=>({...t,[e.rowKey]:{...t[e.rowKey],[n]:i}})),fe(t,{[n]:nW(i)})}})]},n)),(0,q.jsxs)(`fieldset`,{className:`models-input-types`,"aria-label":m(`providerCapacityLabel`,{field:m(`providerInputTypes`),number:t+1}),children:[(0,q.jsx)(`legend`,{children:m(`providerInputTypes`)}),(0,q.jsx)(`div`,{children:[`text`,`image`].map(n=>{let r=e.input??[`text`];return(0,q.jsxs)(`label`,{className:`models-checkbox`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:r.includes(n),disabled:ae||r.length===1&&r.includes(n),onChange:e=>fe(t,{input:[`text`,`image`].filter(t=>t===n?e.target.checked:r.includes(t))})}),m(n===`text`?`providerInputText`:`providerInputImage`)]},n)})})]}),(0,q.jsx)(`p`,{className:`models-hint models-capability-hint`,children:m(`providerImageHint`)}),(0,q.jsxs)(`label`,{className:`models-checkbox models-reasoning`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:e.reasoning,disabled:ae,onChange:e=>fe(t,{reasoning:e.target.checked})}),m(`modelConfig_reasoning`)]}),(0,q.jsx)(`p`,{className:`models-hint models-capability-hint`,children:m(`providerReasoningHint`)}),e.reasoning&&(0,q.jsxs)(`div`,{className:`models-thinking-levels`,children:[(0,q.jsxs)(`div`,{className:`models-thinking-copy`,children:[(0,q.jsx)(`strong`,{children:m(`providerThinkingLevels`)}),(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerThinkingLevelsHint`)})]}),(0,q.jsx)(yo,{button:{label:e.thinkingLevelMap==null?m(`providerThinkingAutomatic`):m(`providerThinkingSelected`,{count:me[t].length}),"aria-label":m(`providerCapacityLabel`,{field:m(`providerThinkingLevels`),number:t+1}),variant:`secondary`,size:`sm`,className:`models-thinking-trigger`,isDisabled:ae},className:`configuration-level-menu`,menuWidth:`min(240px, calc(100vw - 32px))`,alignment:`end`,children:KU.map(n=>{let r=me[t],i=r.includes(n);return(0,q.jsx)(Ro,{label:n,value:i,isDisabled:ae||i&&r.length===1,endContent:(0,q.jsx)(`span`,{className:`configuration-check`,children:i&&(0,q.jsx)(rs,{"aria-hidden":`true`})}),onChange:i=>{fe(t,{thinkingLevelMap:Object.fromEntries(KU.map(a=>{let o=a===n?i:r.includes(a),s=h.models.find(t=>t.rowKey===e.rowKey)?.thinkingLevelMap?.[a];return[a,o?e.thinkingLevelMap?.[a]??s??pe[t]?.[a]??(a===`off`?`none`:a):null]}))})}},n)})}),e.thinkingLevelMap!=null&&(0,q.jsx)(`button`,{type:`button`,className:`models-link models-thinking-reset`,disabled:ae,onClick:()=>fe(t,{thinkingLevelMap:null}),children:m(`providerThinkingReset`)})]})]})]},e.rowKey))]}),(0,q.jsxs)(`button`,{type:`button`,className:`models-button models-add-model`,disabled:ae||_.models.length>=100,onClick:()=>{ue({models:[..._.models,{...he,rowKey:crypto.randomUUID()}]})},children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),m(`addModel`)]}),ce&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:m(`providerModelInvalid`,{number:se+1})})]});return(0,q.jsxs)(`form`,{className:`models-editor`,onSubmit:e=>{e.preventDefault(),_e()},children:[!i&&a&&(0,q.jsxs)(`div`,{className:`models-editor-heading`,children:[(0,q.jsx)(`span`,{children:_.name||_.provider}),_.name!==_.provider&&(0,q.jsx)(`small`,{children:_.provider})]}),i&&a&&(0,q.jsxs)(q.Fragment,{children:[ve(`provider`),_.provider&&oe&&(0,q.jsx)(`p`,{className:`models-error`,children:m(`providerIdInvalid`)}),ve(`name`),ve(`baseUrl`),ye]}),x&&S&&(0,q.jsxs)(`fieldset`,{className:`models-add-modes`,"aria-label":m(`accountLoginMethod`),children:[(0,q.jsx)(`button`,{type:`button`,"aria-pressed":C===`oauth`,disabled:ie,onClick:()=>w(`oauth`),children:m(`accountLoginTab`)}),(0,q.jsx)(`button`,{type:`button`,"aria-pressed":C===`api_key`,disabled:ie,onClick:()=>w(`api_key`),children:m(`accountLoginKeyTab`)})]}),x&&C===`oauth`&&r&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(iM,{sessionId:e,auth:r,busy:l||F||re,onSaving:E,onAuthenticated:()=>f(_.name||_.provider,_.provider),onReload:p}),re&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`accountLoginUnsaved`)})]}),S&&C===`api_key`?(0,q.jsxs)(`label`,{className:`models-field`,children:[m(`providerApiKey`),(0,q.jsx)(`input`,{type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:8192,value:y,placeholder:m(r?.configured?`providerKeyKeep`:`providerKeyOptional`),disabled:ie,onChange:e=>{b(e.target.value),ee!==`conflict`&&L(null)}})]}):x?null:(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerNativeAuth`)}),i&&a?be:(0,q.jsxs)(`details`,{className:`models-customized`,children:[(0,q.jsx)(`summary`,{children:m(`providerCustomSettings`)}),(0,q.jsxs)(`div`,{children:[a&&ve(`name`),ve(`baseUrl`),a&&ye,be]})]}),ee&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:m(ee===`conflict`?`modelConfigurationConflict`:ee===`key`?`providerProfileSavedKeyFailed`:ee===`current`?`providerCurrentRemoval`:`providerConfigurationFailed`)}),ee===`conflict`&&(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:p,children:m(`providerReload`)}),!T&&(0,q.jsxs)(`div`,{className:`models-editor-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:F,onClick:()=>R?p():f(),children:m(`cancel`)}),(C===`api_key`||ne)&&(0,q.jsx)(`button`,{type:`submit`,className:`models-button primary`,disabled:ie||!H||ee===`conflict`,"aria-busy":F,children:m(F?`savingSettings`:`providerSave`)})]}),D&&(0,q.jsx)(tW,{sessionId:e,template:he,existingIds:_.models.map(e=>e.id),apiKey:y,onClose:()=>O(!1),onAdd:e=>{ue({models:[..._.models,...e.map(e=>({...he,...e,rowKey:crypto.randomUUID()}))]}),O(!1)}})]})}function aW({sessionId:e,sessionPath:t,provider:n,purpose:r,initialModel:i,busy:a,onSelectModel:o,onDefaultSaved:s,onSaving:c,onClose:l}){let{t:u}=W(),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)([]),[h,g]=(0,K.useState)(i?`${i.provider}/${i.id}`:``),[_,v]=(0,K.useState)(!0),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(0),[C,w]=(0,K.useState)(0),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1),[k,A]=(0,K.useState)(null);(0,K.useEffect)(()=>{let t=new AbortController;v(!0),b(!1);let r=window.setTimeout(()=>{new de().searchModels(d.trim(),e,t.signal,n).then(e=>{t.signal.aborted||(m(e.models),S(e.truncation.matchesOmitted),v(!1))},()=>{t.signal.aborted||(b(!0),v(!1))})},d?200:0);return()=>{t.abort(),window.clearTimeout(r)}},[e,n,d,C]);let j=p.find(e=>`${e.provider}/${e.id}`===h)??p[0],M=new Map;for(let e of p){let t=M.get(e.provider);t?t.push(e):M.set(e.provider,[e])}let N=async()=>{if(!j||_||D||a||!t)return;O(!0),c(!0),A(null);let n=!1;try{if(r===`use`){if(!await o(`${j.provider}/${j.id}`))throw Error(`selection failed`);n=!0}(r==="default"||T)&&s(await new de().saveModelDefault(j.provider,j.id,e,t)),l()}catch{A(n?`modelDefaultPartial`:r==="default"?`modelDefaultSaveFailed`:`modelConnectionUseFailed`)}finally{O(!1),c(!1)}};return(0,q.jsxs)(`div`,{className:`models-connection-choice`,children:[(0,q.jsx)(`p`,{className:`models-hint`,children:u(r==="default"?`modelDefaultHint`:`modelConnectionNextHint`)}),(p.length>8||x>0||d)&&(0,q.jsx)(`input`,{type:`search`,"aria-label":u(`modelConnectionSearch`),placeholder:u(`modelConnectionSearch`),maxLength:200,value:d,disabled:D,onChange:e=>f(e.target.value)}),y?(0,q.jsxs)(`p`,{className:`models-error`,role:`alert`,children:[u(`modelConnectionLoadFailed`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:()=>w(e=>e+1),children:u(`retryAdmissionCheck`)})]}):_?(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`loadingModels`)}):p.length?(0,q.jsx)(nM,{label:u(`selectModel`),className:`models-provider-picker`,placement:`below`,value:j?`${j.provider}/${j.id}`:``,isDisabled:D,options:[...M].map(([e,t])=>({type:`section`,title:e,options:t.map(e=>({value:`${e.provider}/${e.id}`,label:e.name||e.id,description:`${e.provider} · ${e.id}`,icon:(0,q.jsx)(Yk,{id:e.provider})}))})),onChange:e=>g(e)}):(0,q.jsx)(`p`,{className:`models-hint`,children:u(d?`modelConnectionNoMatch`:`modelConnectionNoModels`)}),x>0&&!_&&(0,q.jsx)(`p`,{className:`models-hint`,children:u(`modelConnectionMore`,{count:x})}),r===`use`&&(0,q.jsxs)(`label`,{className:`models-checkbox`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:T,disabled:D,onChange:e=>E(e.target.checked)}),u(`modelMakeDefault`)]}),k&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:u(k)}),(0,q.jsxs)(`div`,{className:`models-editor-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:D,onClick:l,children:u(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button primary`,disabled:D||a||_||y||!j||!t,onClick:()=>void N(),children:u(D?`providerSaving`:r==="default"?`modelDefaultSave`:`modelConnectionUse`)})]})]})}function oW({sessionId:e,sessionPath:t,models:n,currentModel:r,busy:i,focusCredentials:a,onSaved:o,onSelectModel:s,onDraftChange:c,onSavingChange:l}){let{t:u}=W(),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(0),[h,g]=(0,K.useState)(!0),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(null),[x,S]=(0,K.useState)([]),[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(`account`),[D,O]=(0,K.useState)(``),[k,A]=(0,K.useState)(``),[j,M]=(0,K.useState)({}),[N,P]=(0,K.useState)(!1),[F,I]=(0,K.useState)({}),[ee,L]=(0,K.useState)(!1),R=N||ee||Object.values(F).some(Boolean),[te,z]=(0,K.useState)(null),[B,ne]=(0,K.useState)(!1),[re,V]=(0,K.useState)(null),[ie,ae]=(0,K.useState)(null),[oe,se]=(0,K.useState)(null),[ce,le]=(0,K.useState)(null),H=(0,K.useRef)(null),ue=(0,K.useRef)(a),fe=(0,K.useRef)(null),pe=(0,K.useRef)(new Map),me=(0,K.useRef)(null),he=(0,K.useRef)(null),_e=(0,K.useRef)({onDraftChange:c,onSavingChange:l});_e.current={onDraftChange:c,onSavingChange:l},(0,K.useEffect)(()=>{c(Object.values(j).some(Boolean))},[j,c]),(0,K.useEffect)(()=>{l(R)},[R,l]),(0,K.useEffect)(()=>{!re&&!R&&he.current&&(he.current.focus({preventScroll:!0}),he.current=null)},[re,R]),(0,K.useEffect)(()=>{if(!fe.current)return;let e=fe.current;fe.current=null,(pe.current.get(e)??me.current)?.focus({preventScroll:!0})}),(0,K.useEffect)(()=>()=>{H.current?.abort(),_e.current.onDraftChange(!1),_e.current.onSavingChange(!1)},[]),(0,K.useEffect)(()=>{let t=new AbortController;g(!0),v(!1);let n=new de;return Promise.all([n.modelConfigurations(e,t.signal),n.providerAuth(e,t.signal)]).then(([e,n])=>{if(!t.signal.aborted&&(f({configuration:e,auth:n}),g(!1),ue.current)){ue.current=!1;let e=r?.provider||n.providers.find(e=>e.configured)?.id;e&&(b(e),S([e]))}},()=>{t.signal.aborted||(v(!0),g(!1))}),()=>t.abort()},[e,p,r?.provider]),(0,K.useEffect)(()=>{let t=new AbortController;return ne(!1),new de().modelDefaults(e,t.signal).then(e=>{t.signal.aborted||z(e)},()=>{t.signal.aborted||ne(!0)}),()=>t.abort()},[e,p]);let ve=d?.configuration,ye=new Set([...ve?.providers?.map(e=>e.provider)??[],...ve?.models.map(e=>e.provider)??[]]),be=new Set([...ye,...d?.auth.providers.filter(e=>e.configured).map(e=>e.id)??[],...n.map(e=>e.provider),...x.filter(e=>!e.startsWith(`add:`))]),xe=[...be].map(e=>{let t=d?.auth.providers.find(t=>t.id===e);return{id:e,name:ve?.providers?.find(t=>t.provider===e)?.name||t?.name||e,auth:t}}),Se=d?.auth.providers.filter(e=>e.authMethods.includes(`api_key`)&&!be.has(e.id))??[],Ce=d?.auth.providers.filter(e=>e.authMethods.includes(`oauth`)&&!e.subscription)??[],we=Ce.find(e=>e.id===D)??Ce[0],Te=Se.find(e=>e.id===k)??Se[0],Ee=[{id:`account`,label:`accountLoginTab`,hint:`providerAccountHint`,available:Ce.length>0},{id:`catalog`,label:`providerAddCatalog`,hint:`providerCatalogHint`,available:Se.length>0},{id:`custom`,label:`providerAddCustom`,hint:`providerCustomHint`,available:!0}],U=e=>{E(e);let t=e===`custom`?`add:custom`:e===`account`?we&&`add:account:${we.id}`:Te&&`add:${Te.id}`;t&&S(e=>e.includes(t)?e:[...e,t])},De=e=>{he.current=null,V(null),ae(null),w(!1),b(y===e?null:e),S(t=>t.includes(e)?t:[...t,e])},Oe=(e,t,n)=>{he.current=null,fe.current=e;let r=t=>e.startsWith(`add:`)?t.startsWith(`add:`):t===e;S(e=>e.filter(e=>!r(e))),M(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!r(e)))),e.startsWith(`add:`)?w(!1):b(null),t&&(ae(t),V({purpose:`use`,provider:n??e}),m(e=>e+1),o().catch(()=>!1))},ke=(t,a,s,c)=>{if(!ve)return null;let l=d?.auth.providers.find(e=>e.id===a),f=e=>I(n=>n[t]===e?n:{...n,[t]:e}),p=()=>{Oe(t),m(e=>e+1),o().catch(()=>!1)};return t.startsWith(`add:account:`)?l&&(0,q.jsxs)(`div`,{className:`models-editor`,children:[(0,q.jsx)(iM,{sessionId:e,auth:l,busy:i,onSaving:f,onAuthenticated:()=>Oe(t,l.name||l.id,l.id),onReload:p}),!F[t]&&(0,q.jsx)(`div`,{className:`models-editor-actions`,children:(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:()=>Oe(t),children:u(`cancel`)})})]}):(0,q.jsx)(iW,{sessionId:e,providerId:a,configuration:ve,auth:l,isNew:s,custom:c,taken:[...d?.auth.providers.map(e=>e.id)??[],...ye],currentModel:r,availableModels:n.filter(e=>e.provider===a),busy:i,onDirty:e=>M(n=>n[t]===e?n:{...n,[t]:e}),onSaving:f,onClose:(e,n)=>Oe(t,e,n),onReload:p},t)},G=e=>xe.find(t=>t.id===e)?.name??e,je=e=>n.find(t=>t.provider===e.provider&&t.id===e.id)?.name||e.id,Me=(e,t,n)=>{he.current=t,V({purpose:e,provider:n}),b(null),w(!1)},Ne=(n,a)=>(0,q.jsx)(aW,{sessionId:e,sessionPath:t,provider:a,purpose:n,initialModel:n==="default"?te?.model:r,busy:i,onSelectModel:s,onDefaultSaved:e=>{z(e),ne(!1),o().catch(()=>!1)},onSaving:L,onClose:()=>{V(null)}},`${n}:${a??`all`}`);return(0,q.jsxs)(`div`,{className:`settings-content-page models-page`,children:[(0,q.jsxs)(`div`,{className:`models-section`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:u(`modelSettings`)}),(0,q.jsx)(`p`,{children:u(`modelsIntro`)})]})}),ie&&(0,q.jsxs)(`p`,{className:`models-saved`,role:`status`,children:[u(`providerSaved`,{provider:ie}),r&&(0,q.jsxs)(`span`,{children:[` `,u(`providerCurrentSessionModel`,{model:`${r.provider} / ${r.id}`})]})]}),_&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[u(`providerLoadFailed`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:h,onClick:()=>m(e=>e+1),children:u(`retryAdmissionCheck`)})]}),ce&&!oe&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[ce,` `,(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:h,onClick:()=>{le(null),m(e=>e+1)},children:u(`refreshStatus`)})]}),!d&&h&&(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`providerLoading`)}),(0,q.jsxs)(`div`,{className:`models-default-card`,children:[(0,q.jsxs)(`div`,{className:`models-default-row`,children:[(0,q.jsxs)(`div`,{className:`models-default-copy`,children:[(0,q.jsx)(`span`,{className:`models-default-title`,children:u(`modelDefaultTitle`)}),B?(0,q.jsx)(`span`,{className:`models-hint`,children:u(`modelDefaultReadFailed`)}):te?.model?(0,q.jsxs)(`span`,{className:`models-default-value`,children:[(0,q.jsx)(`span`,{className:`models-default-avatar`,"aria-hidden":`true`,children:(0,q.jsx)(Yk,{id:te.model.provider,modelId:te.model.id})}),(0,q.jsxs)(`span`,{children:[je(te.model),(0,q.jsx)(`small`,{children:G(te.model.provider)})]})]}):(0,q.jsx)(`span`,{className:`models-hint`,children:u(te?`modelDefaultNotSet`:`loadingModels`)})]}),(0,q.jsxs)(`button`,{type:`button`,className:`models-button primary models-default-choose`,disabled:R||i||Object.values(j).some(Boolean)||!t,"aria-expanded":re?.purpose==="default",onClick:e=>B?m(e=>e+1):re?.purpose==="default"?V(null):Me(`default`,e.currentTarget),children:[(0,q.jsx)(`span`,{children:u(B?`refreshStatus`:`modelDefaultChoose`)}),!B&&(0,q.jsx)(os,{"aria-hidden":`true`})]})]}),te?.projectOverride&&(0,q.jsx)(`p`,{className:`models-hint`,children:u(`modelDefaultProjectOverride`,{model:`${G(te.projectOverride.provider)} / ${je(te.projectOverride)}`})}),re?.purpose==="default"&&Ne(`default`)]}),(0,q.jsxs)(`div`,{className:`models-connections-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:u(`modelConnectionsTitle`)}),(0,q.jsx)(`p`,{children:u(`modelConnectionsIntro`)})]}),(0,q.jsx)(`span`,{"aria-hidden":`true`,children:xe.length})]}),(0,q.jsx)(`ul`,{className:`models-provider-list`,children:xe.map(e=>{let n=!C&&y===e.id,a=e.auth?.custom??ye.has(e.id);return(0,q.jsxs)(`li`,{className:`models-provider-card`,children:[(0,q.jsxs)(`div`,{className:`models-provider-head`,children:[(0,q.jsxs)(`div`,{className:`models-provider-identity`,children:[(0,q.jsx)(`span`,{className:`models-provider-avatar`,"aria-hidden":`true`,children:(0,q.jsx)(Yk,{id:e.id})}),(0,q.jsxs)(`div`,{className:`models-provider-label`,children:[(0,q.jsx)(`span`,{className:`models-provider-name`,children:e.name}),a&&(0,q.jsx)(`span`,{className:`models-provider-tag`,children:u(`providerCustomTag`)}),te?.model?.provider===e.id&&(0,q.jsx)(`span`,{className:`models-provider-tag is-default`,children:u(`modelDefaultBadge`)}),r?.provider===e.id&&(0,q.jsx)(`span`,{className:`models-provider-tag is-current`,children:u(`modelCurrentBadge`)}),e.auth&&(0,q.jsxs)(`span`,{className:`models-provider-status`,children:[(0,q.jsx)(`span`,{className:`models-credential-dot ${e.auth.configured?`configured`:`missing`}`,role:`img`,"aria-label":u(e.auth.configured?`credentialConfigured`:`credentialMissing`),title:u(e.auth.configured?`credentialConfigured`:`credentialMissing`)}),u(e.auth.subscription?`accountLoginConfigured`:e.auth.configured?`credentialConfigured`:`credentialMissing`)]})]})]}),(0,q.jsxs)(`div`,{className:`models-provider-actions`,children:[e.auth?.configured&&(0,q.jsx)(`button`,{type:`button`,className:`models-button models-select-connection`,disabled:R||i||Object.values(j).some(Boolean)||!t,"aria-label":u(`modelConnectionChooseProvider`,{provider:e.name}),"aria-expanded":re?.purpose===`use`&&re.provider===e.id,onClick:t=>re?.purpose===`use`&&re.provider===e.id?V(null):Me(`use`,t.currentTarget,e.id),children:u(`selectModel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,"aria-label":u(`editProvider`,{provider:e.name}),ref:t=>{t?pe.current.set(e.id,t):pe.current.delete(e.id)},"aria-expanded":n,disabled:R,onClick:()=>De(e.id),children:u(e.auth?.authMethods.includes(`oauth`)&&!e.auth.configured?`accountLoginStart`:`providerEdit`)}),ye.has(e.id)&&(0,q.jsx)(`button`,{type:`button`,className:`models-button danger`,"aria-label":u(`removeProvider`,{provider:e.name}),disabled:R||i||r?.provider===e.id,title:r?.provider===e.id?u(`providerCurrentRemoval`):void 0,onClick:()=>{se(e.id),le(null)},children:u(`providerRemove`)})]})]}),re?.purpose===`use`&&re.provider===e.id&&Ne(`use`,e.id),x.includes(e.id)&&(0,q.jsx)(`div`,{hidden:!n,children:ke(e.id,e.id,!1,a)})]},e.id)})}),ve&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{hidden:!C,className:`models-add-card`,children:[(0,q.jsx)(`fieldset`,{className:`models-add-modes`,"aria-label":u(`providerAddMode`),onKeyDown:e=>{if(R||![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=Ee.filter(e=>e.available),n=t.findIndex(e=>e.id===T),r=t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length].id;U(r),e.currentTarget.querySelectorAll(`button`)[Ee.findIndex(e=>e.id===r)]?.focus()},children:Ee.map(e=>(0,q.jsx)(`button`,{type:`button`,"aria-pressed":T===e.id,disabled:R||!e.available,onClick:()=>U(e.id),children:u(e.label)},e.id))}),(0,q.jsx)(`p`,{className:`models-hint`,children:u(Ee.find(e=>e.id===T)?.hint??`providerCustomHint`)}),(0,q.jsxs)(`div`,{hidden:T!==`account`,children:[we&&(0,q.jsx)(`div`,{className:`models-provider-select`,children:(0,q.jsx)(nM,{label:u(`provider`),className:`models-provider-picker`,options:Ce.map(e=>({value:e.id,label:e.name||e.id,icon:(0,q.jsx)(Yk,{id:e.id})})),value:we.id,isDisabled:R,placement:`below`,onChange:e=>{O(e);let t=`add:account:${e}`;S(e=>e.includes(t)?e:[...e,t])}})}),x.filter(e=>e.startsWith(`add:account:`)).map(e=>(0,q.jsx)(`div`,{hidden:e!==`add:account:${we?.id}`,children:ke(e,e.slice(12),!0,!1)},e))]}),(0,q.jsxs)(`div`,{hidden:T!==`catalog`,children:[Te&&(0,q.jsx)(`div`,{className:`models-provider-select`,children:(0,q.jsx)(nM,{label:u(`provider`),className:`models-provider-picker`,options:Se.map(e=>({value:e.id,label:e.name||e.id,icon:(0,q.jsx)(Yk,{id:e.id})})),value:Te.id,isDisabled:R,placement:`below`,onChange:e=>{A(e);let t=`add:${e}`;S(e=>e.includes(t)?e:[...e,t])}})}),x.filter(e=>e.startsWith(`add:`)&&e!==`add:custom`&&!e.startsWith(`add:account:`)).map(e=>(0,q.jsx)(`div`,{hidden:e!==`add:${Te?.id}`,children:ke(e,e.slice(4),!0,!1)},e))]}),x.includes(`add:custom`)&&(0,q.jsx)(`div`,{hidden:T!==`custom`,children:ke(`add:custom`,``,!0,!0)})]}),!C&&(0,q.jsxs)(`button`,{type:`button`,className:`models-add-button`,ref:me,disabled:R,onClick:()=>{he.current=null,V(null),w(!0),b(null),ae(null),U(Ee.find(e=>e.id===T)?.available?T:Ee.find(e=>e.available).id)},children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),u(`providerAdd`)]})]}),i&&(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`modelSelectionBusy`)})]}),oe&&(0,q.jsx)(uj,{isOpen:!0,title:u(`removeProvider`,{provider:xe.find(e=>e.id===oe)?.name||oe}),description:ce||u(`providerRemoveDetail`),isActionLoading:R,cancelLabel:u(`cancel`),actionLabel:u(R?`savingSettings`:`providerRemove`),onOpenChange:e=>{!e&&!R&&se(null)},onAction:()=>{if(R||i||!ve)return;let t=new AbortController;H.current=t,P(!0),le(null),new de().changeProviderConfiguration(e,ve.revision,{action:`remove`,provider:oe},t.signal).then(()=>{t.signal.aborted||(Oe(oe),se(null),m(e=>e+1),o().catch(()=>!1))},e=>{t.signal.aborted||le(u(e instanceof ge&&e.code===`MODEL_CONFIGURATION_CONFLICT`?`modelConfigurationConflict`:`providerConfigurationFailed`))}).finally(()=>{t.signal.aborted||P(!1)})}})]})}function sW(){let e={version:`1.1.0`,id:`0746de8f104151b57ab00e1b97ff31bc252ab81b2e22c6739aa61c0100ae4658`,mode:`production`},{t}=W(),[n,r]=(0,K.useState)(null),[i,a]=(0,K.useState)(`loading`),[o,s]=(0,K.useState)(0);(0,K.useEffect)(()=>{let e=new AbortController,t=new de;return a(`loading`),r(null),t.request(`/api/diagnostics`,{signal:e.signal}).then(t=>{e.signal.aborted||(r(t.openpi??null),a(`ready`))},()=>{e.signal.aborted||a(`error`)}),()=>e.abort()},[o]);let c=t(`notReported`),l=e?.id&&n?.frontendAtStartup?.id&&e.id!==n.frontendAtStartup.id;return(0,q.jsxs)(`section`,{className:`settings-section-block`,"aria-label":t(`runtimeIdentity`),children:[(0,q.jsx)(`h2`,{children:t(`runtimeIdentity`)}),(0,q.jsx)(`p`,{children:t(`runtimeIdentityHint`)}),i===`loading`&&(0,q.jsx)(`p`,{role:`status`,children:t(`settingsCatalogLoading`)}),i===`error`&&(0,q.jsx)(`p`,{role:`alert`,children:t(`runtimeIdentityFailed`)}),(0,q.jsxs)(`dl`,{className:`settings-summary-list runtime-identity-list`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeBackendVersion`)}),(0,q.jsx)(`dd`,{children:n?.version??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimePackageRoot`)}),(0,q.jsx)(`dd`,{children:n?.packageRoot??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeStartedAt`)}),(0,q.jsx)(`dd`,{children:n?new Date(n.startedAt).toLocaleString():c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeGitRevision`)}),(0,q.jsx)(`dd`,{children:n?.git?.revision??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeGitState`)}),(0,q.jsx)(`dd`,{children:n?.git?.dirty==null?c:t(n.git.dirty?`runtimeGitDirty`:`runtimeGitClean`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeFrontendVersion`)}),(0,q.jsx)(`dd`,{children:e?.version??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeFrontendBuild`)}),(0,q.jsx)(`dd`,{children:e?.mode===`development`?t(`runtimeDevelopmentBuild`):e?.id??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeStartupBuild`)}),(0,q.jsx)(`dd`,{children:n?.frontendAtStartup?.id??c})]})]}),l&&(0,q.jsx)(`p`,{role:`status`,children:t(`runtimeBuildMismatch`)}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>s(e=>e+1),disabled:i===`loading`,children:t(`refreshStatus`)})]})}var cW=20,lW={track:{kVAEAm:`x10l6tqk`,kWkggS:`xdsb6cv`,kaIpWk:`xjspbzw`,$$css:!0},trackHorizontal:{kLqNvP:`x1o0tod`,kt4wiu:`xtijo5x`,kZKoxP:`xqu0tyb`,k87sOh:`xwa60dl`,k3aq6I:`x1cb1t30`,$$css:!0},trackVertical:{k87sOh:`x13vifvy`,krVfgx:`x1ey2m1c`,kzqmXN:`x51ohtg`,$$css:!0},filledTrack:{kVAEAm:`x10l6tqk`,kWkggS:`x1ewilqj`,kaIpWk:`xjspbzw`,$$css:!0},filledTrackHorizontal:{kZKoxP:`xqu0tyb`,k87sOh:`xwa60dl`,k3aq6I:`x1cb1t30`,$$css:!0},filledTrackVertical:{kzqmXN:`x51ohtg`,$$css:!0},thumb:{kVAEAm:`x10l6tqk`,kzqmXN:`xw4jnvo`,kZKoxP:`x1qx5ct2`,kaIpWk:`xjspbzw`,kWkggS:`x1ewilqj`,k3aq6I:`x11lhmoz`,k1ekBW:`x106061f`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,kI3sdo:`x1a2a7pz`,kkrTdU:`x1jm3nie x16khyan`,kY2c9j:`x1vjfegm`,$$css:!0},thumbHorizontal:{k87sOh:`xwa60dl`,k3aq6I:`x11lhmoz xoffwj3`,$$css:!0},thumbHover:{kWkggS:`x1ewilqj xvxo0qp`,$$css:!0},thumbDisabled:{kWkggS:`xwmxj5m`,kkrTdU:`xt0e3qv`,$$css:!0}};function uW(e,t,n){return Math.min(Math.max(e,t),n)}function dW(e){if(Math.abs(e)<1){let t=e.toExponential().split(`e-`);if(t.length===2)return(t[0].split(`.`)[1]?.length??0)+parseInt(t[1],10)}let t=String(e).split(`.`)[1];return t?t.length:0}function fW(e,t,n){if(n<=0)return e;let r=t+Math.round((e-t)/n)*n,i=Math.min(Math.max(dW(t),dW(n)),20);return Number(r.toFixed(i))}function pW(e,t,n){return n===t?0:(e-t)/(n-t)*100}var mW=cW/2;function hW(e){return vW(e,mW-e/100*cW)}function gW(e,t){let n=t-e;return vW(n,-(n/100)*cW)}function _W(e,t){let n=t-cW;return n>0?(e-mW)/n:t>0?e/t:0}function vW(e,t){let n=e=>Number(e.toFixed(3));return`calc(${n(e)}% ${t<0?`-`:`+`} ${Math.abs(n(t))}px)`}function yW({ref:e,...t}){let{label:n,isLabelHidden:r=!1,description:i,isDisabled:a=!1,disabledMessage:o,isOptional:s=!1,isRequired:c=!1,status:l,labelTooltip:u,min:d=0,max:f=100,step:p=1,orientation:m=`horizontal`,formatValue:h,htmlName:g,valueDisplay:_=`tooltip`,marks:v,width:y,xstyle:b,className:x,style:S,"data-testid":C,value:T,onChange:E,onChangeEnd:k}=t,A=Array.isArray(T),j=A&&`minStepsBetweenThumbs`in t?t.minStepsBetweenThumbs??0:0,M=m===`horizontal`,P=(0,K.useId)(),I=(0,K.useId)(),ee=(0,K.useId)(),L=(0,K.useId)(),R=(0,K.useId)(),te=(0,K.useRef)(null),z=(0,K.useRef)(null),[B,ne]=(0,K.useState)(null),[re,ie]=(0,K.useState)(null);(0,K.useEffect)(()=>{D()},[]);let ae=(0,K.useCallback)((e,t)=>{ie(!a&&N()===`keyboard`?e:null)},[a]),oe=(0,K.useCallback)(e=>{ie(null)},[]),se=a&&!!o,ce=F({placement:`above`,focusTrigger:`always`,isEnabled:se}),le=c&&!s,ue=[];i&&ue.push(ee),l?.message&&ue.push(L),le&&ue.push(R),se&&ue.push(ce.describedBy);let de=ue.length>0?ue.join(` `):void 0,pe=(0,K.useMemo)(()=>(Array.isArray(T)?T:[T??d]).map(e=>uW(e,d,f)),[T,d,f]),me=(0,K.useRef)(pe);me.current=pe;let he=(0,K.useCallback)((e,t)=>{let n=te.current;if(!n)return d;let r=n.getBoundingClientRect(),i;return i=M?_W(Ya(n)?r.right-e:e-r.left,r.width):1-_W(t-r.top,r.height),i=uW(i,0,1),uW(fW(d+i*(f-d),d,p),d,f)},[d,f,p,M]),ge=(0,K.useCallback)(e=>{if(!A)return 0;let[t,n]=pe;return Math.abs(e-t)<=Math.abs(e-n)?0:1},[A,pe]),_e=(0,K.useCallback)((e,t)=>{if(a)return;let n=uW(fW(t,d,p),d,f);if(A){let t=[...pe];t[e]=n;let r=j*p;e===0?t[0]=Math.min(t[0],t[1]-r):t[1]=Math.max(t[1],t[0]+r),t[0]=uW(t[0],d,f),t[1]=uW(t[1],d,f),E?.(t)}else E?.(n)},[a,A,pe,d,f,p,j,E]),ve=(0,K.useRef)(k);ve.current=k;let ye=(0,K.useCallback)(e=>{let t=e??me.current,n=ve.current;A?n?.(t):n?.(t[0])},[A]),be=(0,K.useCallback)(e=>{if(a)return;e.preventDefault();let t=e.target.closest(`[data-mark-value]`),n=t?Number(t.dataset.markValue):he(e.clientX,e.clientY),r=ge(n);z.current=r,ne(r),_e(r,n);let i=te.current;i&&i.querySelectorAll(`[role="slider"]`)[r]?.focus(),ie(null),typeof e.currentTarget.setPointerCapture==`function`&&e.currentTarget.setPointerCapture(e.pointerId)},[a,he,ge,_e]),xe=(0,K.useCallback)(e=>{if(z.current===null||a)return;let t=he(e.clientX,e.clientY);_e(z.current,t)},[a,he,_e]),Se=(0,K.useCallback)(e=>{z.current!==null&&(z.current=null,ne(null),ye())},[ye]),Ce=(0,K.useCallback)((e,t)=>{if(a)return;N()===`keyboard`&&ie(e);let n=pe[e],r;switch(t.key){case`ArrowRight`:case`ArrowUp`:r=n+p;break;case`ArrowLeft`:case`ArrowDown`:r=n-p;break;case`PageUp`:r=n+p*10;break;case`PageDown`:r=n-p*10;break;case`Home`:r=d;break;case`End`:r=f;break;default:return}t.preventDefault();let i=uW(fW(r,d,p),d,f);if(_e(e,r),A){let t=[...pe];t[e]=i;let n=j*p;e===0?t[0]=Math.min(t[0],t[1]-n):t[1]=Math.max(t[1],t[0]+n),t[0]=uW(t[0],d,f),t[1]=uW(t[1],d,f),ye(t)}else ye([i])},[a,A,pe,p,d,f,j,_e,ye]),Te=e=>h?h(e):String(e),Ee=e=>{let t=pe[e],n=pW(t,d,f),r=M?{insetInlineStart:hW(n)}:{bottom:hW(n),left:`50%`},i=A?e===0?`Minimum value`:`Maximum value`:void 0,o=j*p,s=A&&e===1?uW(pe[0]+o,d,f):d,c=A&&e===0?uW(pe[1]-o,d,f):f,u=_===`tooltip`&&!se,g=M?`above`:`start`,v=(0,q.jsx)(`div`,{id:A?void 0:P,role:`slider`,tabIndex:a&&!se?-1:0,"aria-valuemin":s,"aria-valuemax":c,"aria-valuenow":t,"aria-valuetext":h?h(t):void 0,"aria-orientation":m,"aria-disabled":a||void 0,"aria-invalid":l?.type===`error`||void 0,"aria-label":i,"aria-labelledby":A?void 0:I,"aria-describedby":de,onKeyDown:t=>Ce(e,t),onFocus:t=>ae(e,t),onBlur:oe,...H(O(`slider-thumb`,{orientation:m,disabled:a?`disabled`:null}),w(lW.thumb,M?lW.thumbHorizontal:Et.centerInline(`50%`),!a&&lW.thumbHover,!a&&re===e&&fe.focusVisible,a&&lW.thumbDisabled),void 0,r)},e);return u?(0,q.jsx)(V,{content:Te(t),placement:g,delay:0,focusTrigger:`always`,isOpen:B===e||void 0,children:v},e):v},U=(()=>{if(A){let[e,t]=pe,n=pW(e,d,f),r=pW(t,d,f);return M?{insetInlineStart:hW(n),width:gW(n,r)}:{bottom:hW(n),height:gW(n,r)}}let e=pW(pe[0],d,f);return M?{insetInlineStart:`0%`,width:hW(e)}:{bottom:`0%`,height:hW(e)}})(),De=_===`text`?(0,q.jsx)(`span`,{className:`x9ynric xcr08ib x1tgivj0 xuxw1ft x2lah0s`,children:A?`${Te(pe[0])} – ${Te(pe[1])}`:Te(pe[0])}):null;return(0,q.jsxs)(zO,{"data-testid":C,label:n,isLabelHidden:r,description:i,inputID:P,labelID:I,isGroupLabel:!0,descriptionID:i?ee:void 0,isOptional:s,isRequired:c,isDisabled:a,status:l?{type:l.type,message:l.message,messageID:l.message?L:void 0}:void 0,labelTooltip:u,statusVariant:`detached`,width:y,xstyle:b,className:x,style:S,children:[(0,q.jsxs)(`div`,{...H(O(`slider`,{orientation:m,disabled:a?`disabled`:null}),{className:`x78zum5 x6s0dn4 x1txdalj`}),children:[g!=null&&pe.map((e,t)=>(0,q.jsx)(`input`,{type:`hidden`,name:g,value:String(e),disabled:a},t===0?`start`:`end`)),(0,q.jsxs)(`div`,{ref:we(e,te,ce.ref),...A?{role:`group`,"aria-labelledby":I}:void 0,onPointerDown:be,onPointerMove:xe,onPointerUp:Se,onPointerCancel:Se,...{0:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k x1ypdohk x16khyan`},2:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 x1ypdohk x16khyan`},1:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k xbyyjgo xt0e3qv`},3:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 xbyyjgo xt0e3qv`}}[!!M<<1|!!a<<0],children:[(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(O(`slider-track`,{orientation:m}),w(lW.track,M?lW.trackHorizontal:[lW.trackVertical,Et.centerInline(`0px`)]))}),(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(w(lW.filledTrack,M?lW.filledTrackHorizontal:[lW.filledTrackVertical,Et.centerInline(`0px`)]),{style:U})}),v&&(0,q.jsx)(`div`,{"aria-hidden":`true`,...{0:{className:`x10l6tqk x13vifvy x1ey2m1c xbudbmw`},1:{className:`x10l6tqk x1o0tod xtijo5x xwa60dl`}}[!!M<<0],children:v.map(e=>{let t=pW(e.value,d,f),n=M?{insetInlineStart:hW(t)}:{bottom:hW(t)};return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{"data-testid":`slider-mark`,"data-mark-value":e.value,...H({0:{className:`x10l6tqk x7njt3n xjspbzw x36qwtl x1xc55vz x1m9mm8y`},1:{className:`x10l6tqk x7njt3n xjspbzw xfo62xy xdk7pt x11lhmoz xoffwj3`}}[!!M<<0],{style:n})}),e.label&&(0,q.jsx)(`span`,{"data-testid":`slider-mark-label`,"data-mark-value":e.value,...H({0:{className:`x10l6tqk x9ynric x141an7d xv1l7n4 xuxw1ft x131p8rn x9p6ekw`},1:{className:`x10l6tqk x9ynric x141an7d xv1l7n4 xuxw1ft xuuh30 x1nyx83j xuivejd`}}[!!M<<0],{style:n}),children:e.label})]},e.value)})}),pe.map((e,t)=>Ee(t))]}),De]}),le&&(0,q.jsx)(Kt,{id:R,children:`Required`}),se&&ce.renderTooltip(o)]})}yW.displayName=`Slider`;var bW=[`explorer`,`implementer`,`reviewer`,`advisor`];function xW({catalog:e,error:t,onRefresh:n}){let{t:r}=W();return!t&&!e?(0,q.jsxs)(`div`,{className:`settings-load-state`,role:`status`,children:[(0,q.jsx)(me,{className:`settings-spin`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:r(`settingsCatalogLoading`)})]}):t?(0,q.jsxs)(`div`,{className:`settings-load-state error`,role:`alert`,children:[(0,q.jsx)(`strong`,{children:r(`settingsCatalogFailed`)}),(0,q.jsx)(`span`,{children:t}),(0,q.jsx)(`button`,{type:`button`,onClick:n,children:r(`retryAdmissionCheck`)})]}):null}function SW({icon:e,title:t,description:n,value:r,disabled:i,loading:a,onChange:o}){return(0,q.jsxs)(`div`,{className:`settings-inline-control settings-toggle-row`,children:[(0,q.jsx)(e,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-inline-copy`,children:[(0,q.jsx)(`strong`,{children:t}),n&&(0,q.jsx)(`small`,{children:n})]}),(0,q.jsx)(bj,{label:t,isLabelHidden:!0,value:r,size:`sm`,isDisabled:i,isLoading:a,onChange:o})]})}function CW({isPending:e,isBlocked:t=!1,onConfigure:n,request:r,label:i}){return(0,q.jsx)(Br,{label:i,variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Xc,{"aria-hidden":`true`}),isDisabled:e||t,isLoading:e,onClick:()=>void n(r)})}function wW({pending:e,onConfigure:t,placeholder:n}){let{t:r}=W(),[i,a]=(0,K.useState)(``);return(0,q.jsxs)(`form`,{className:`settings-edit-form`,onSubmit:n=>{n.preventDefault(),!e&&i.trim()&&t(i.trim())},children:[(0,q.jsxs)(`label`,{className:`settings-form-field`,children:[r(`setupConfigurationRequest`),(0,q.jsx)(`textarea`,{required:!0,maxLength:2e3,value:i,disabled:e,placeholder:n,onChange:e=>a(e.target.value)})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:e||!i.trim(),children:r(`configureViaSetup`)}),(0,q.jsx)(`small`,{children:r(`setupFormDetail`)})]})}function TW({catalog:e,error:t,currentModel:n,thinkingLevel:r,cwd:i,setupPending:a,setupBlocked:o=!1,preferencePending:s,setupBusy:c,setupBlockedReason:l,onConfigure:u,onUpdatePreferences:d,onOpenRuntimeStatus:f,onRefresh:p}){let{t:m}=W(),h=e?.setup,g=h?.workflows.concurrency??0,_=h?.workflows.maxAgentCalls??0,[v,y]=(0,K.useState)(g),[b,x]=(0,K.useState)(_);return(0,K.useEffect)(()=>y(g),[g]),(0,K.useEffect)(()=>x(_),[_]),(0,q.jsxs)(`section`,{className:`settings-content-page settings-general-panel`,children:[(0,q.jsxs)(`div`,{className:`settings-page-heading`,children:[(0,q.jsx)(`div`,{children:(0,q.jsx)(`h1`,{children:m(`generalSettings`)})}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:u,request:m(`setupRequestReviewAll`),label:m(`configureOpenPi`)})]}),c&&(0,q.jsx)(`p`,{className:`settings-pending-hint`,role:`status`,children:l||m(`settingsSetupBusyHint`)}),(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:p}),h&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`section`,{className:`settings-section-block`,children:(0,q.jsxs)(`div`,{className:`settings-follow-up-control`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:m(`followUpBehavior`)}),(0,q.jsx)(`p`,{children:m(`followUpBehaviorDetail`)})]}),(0,q.jsxs)(`fieldset`,{className:`settings-follow-up-choices`,disabled:s,children:[(0,q.jsx)(`legend`,{className:`sr-only`,children:m(`followUpBehavior`)}),[`followUp`,`steer`].map(e=>(0,q.jsxs)(`label`,{children:[(0,q.jsx)(`input`,{type:`radio`,name:`follow-up-behavior`,value:e,"aria-label":m(e===`steer`?`followUpSteer`:`followUpQueue`),checked:(h.ui.webFollowUpBehavior??`followUp`)===e,onChange:()=>void d({followUpBehavior:e})}),(0,q.jsxs)(`span`,{className:`settings-follow-up-option`,children:[e===`steer`?(0,q.jsx)(Cs,{"aria-hidden":`true`}):(0,q.jsx)(tc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-follow-up-option-copy`,children:[(0,q.jsx)(`strong`,{children:m(e===`steer`?`followUpSteer`:`followUpQueue`)}),(0,q.jsx)(`small`,{children:m(e===`steer`?`followUpSteerDetail`:`followUpQueueDetail`)})]})]})]},e))]})]})}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`agentBehavior`)}),(0,q.jsxs)(`div`,{className:`settings-chat-controls`,children:[(0,q.jsxs)(`form`,{className:`settings-limits-control`,onSubmit:e=>{e.preventDefault(),!a&&!o&&u(m(`setupRequestLimits`,{concurrency:v,calls:b}))},children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(Us,{"aria-hidden":`true`}),m(`workflowLimits`)]}),(0,q.jsx)(`small`,{children:m(`workflowLimitsValue`,{concurrency:h.workflows.concurrency,calls:h.workflows.maxAgentCalls})}),(0,q.jsxs)(`label`,{children:[m(`workflowConcurrency`),(0,q.jsx)(`input`,{type:`number`,min:1,value:v,disabled:a||o,onChange:e=>y(Number(e.target.value)),required:!0})]}),(0,q.jsxs)(`label`,{children:[m(`workflowCalls`),(0,q.jsx)(`input`,{type:`number`,min:1,value:b,disabled:a||o,onChange:e=>x(Number(e.target.value)),required:!0})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:a||o||v===h.workflows.concurrency&&b===h.workflows.maxAgentCalls,children:m(`configureViaSetup`)})]}),(0,q.jsx)(SW,{icon:Pc,title:m(`nextActionSuggestions`),description:m(`nextActionSuggestionsDetail`),value:h.suggestions.enabled,disabled:a||o,loading:a,onChange:e=>void u(m(e?`setupRequestEnableSuggestions`:`setupRequestDisableSuggestions`))}),h.suggestions.model&&(0,q.jsx)(`small`,{children:`${h.suggestions.model.provider}/${h.suggestions.model.model} · ${h.suggestions.model.reasoning}`}),(0,q.jsxs)(`div`,{className:`settings-inline-control`,children:[(0,q.jsx)(bs,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-inline-copy`,children:[(0,q.jsxs)(`strong`,{children:[m(`postEditCommand`),(0,q.jsx)(`span`,{className:`settings-inline-status`,children:m(h.postEditConfigured?`configured`:`disabled`)})]}),(0,q.jsx)(`small`,{children:m(`postEditCommandDetail`)})]}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:u,request:m(`setupRequestPostEdit`),label:m(`configurePostEdit`)})]}),(0,q.jsx)(`small`,{children:m(`agentSettingsSetupHint`)})]})]}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`resultDisplay`)}),(0,q.jsxs)(`div`,{className:`settings-chat-controls`,children:[[[`subagentResultDisplay`,`subagentResults`,ws],[`bashToolDisplay`,`bashOperations`,Vc],[`fileMutationDisplay`,`fileMutations`,Fs]].map(([e,t,n])=>(0,q.jsxs)(`label`,{className:`settings-inline-control`,htmlFor:`settings-${e}`,children:[(0,q.jsx)(n,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`settings-inline-copy`,children:(0,q.jsx)(`strong`,{children:m(t)})}),(0,q.jsx)(Tj,{id:`settings-${e}`,className:`settings-select-control`,label:m(t),value:h.ui[e],disabled:s,onChange:t=>{(t===`full`||t===`compact`)&&d({[e]:t})},options:[{value:`compact`,label:m(`detailDisplay_compact`)},{value:`full`,label:m(`detailDisplay_full`)}]})]},e)),(0,q.jsx)(SW,{icon:mc,title:m(`terminalFooter`),value:h.ui.customFooter,disabled:s,loading:s,onChange:e=>void d({customFooter:e})}),(0,q.jsxs)(`label`,{className:`settings-inline-control`,htmlFor:`settings-footer-style`,children:[(0,q.jsx)(`span`,{children:m(`terminalFooterStyle`)}),(0,q.jsx)(Tj,{id:`settings-footer-style`,className:`settings-select-control`,label:m(`terminalFooterStyle`),value:h.ui.footerStyle,disabled:s||!h.ui.customFooter,onChange:e=>{(e===`plain`||e===`powerline`||e===`powerline-mono`)&&d({footerStyle:e})},options:[{value:`plain`,label:`Plain`},{value:`powerline`,label:`Powerline`},{value:`powerline-mono`,label:`Powerline Mono`}]})]}),(0,q.jsx)(`small`,{children:m(`terminalFooterHint`)})]})]})]}),(0,q.jsx)(sW,{}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`sessionSettings`)}),(0,q.jsxs)(`dl`,{className:`settings-summary-list`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`selectedModel`)}),(0,q.jsx)(`dd`,{children:n?.label??m(`noModels`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`thinkingLevel`)}),(0,q.jsx)(`dd`,{children:r})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`currentWorkspace`)}),(0,q.jsx)(`dd`,{title:i,children:i})]})]}),(0,q.jsx)(Br,{label:m(`openRuntimeDetails`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ls,{"aria-hidden":`true`}),className:`settings-runtime-action`,onClick:f})]})]})}function EW(e){return e.split(/[\\/]/u).filter(Boolean).at(-1)||e}function DW({kind:e,query:t,scope:n,onQuery:r,onScope:i,onAdd:a}){let{t:o}=W();return(0,q.jsxs)(`div`,{className:`settings-resource-toolbar`,children:[(0,q.jsxs)(`div`,{className:`settings-resource-toolbar-heading`,children:[(0,q.jsx)(`strong`,{children:o(`resources`)}),(0,q.jsx)(Br,{label:o(e===`skills`?`addSkill`:`addPlugin`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:a})]}),(0,q.jsxs)(`label`,{className:`settings-resource-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":o(`searchResources`),placeholder:o(`searchResources`),value:t,onChange:e=>r(e.target.value)})]}),(0,q.jsx)(Tj,{label:o(`filterResourceScope`),value:n,onChange:i,options:[{value:`all`,label:o(`allResourceScopes`)},...[`project`,`user`,`temporary`].map(e=>({value:e,label:o(`resourceScope_${e}`)}))]})]})}function OW({kind:e,pending:t,onConfigure:n,onCancel:r}){let{t:i}=W(),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(`user`);return(0,q.jsxs)(`section`,{className:`settings-resource-install`,children:[(0,q.jsx)(`header`,{className:`settings-detail-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:i(e===`skills`?`addSkill`:`addPlugin`)}),(0,q.jsx)(`p`,{children:i(`resourceInstallIntro`)})]})}),(0,q.jsxs)(`form`,{className:`settings-edit-form`,onSubmit:r=>{r.preventDefault(),!t&&a.trim()&&n(i(`setupResourceInstallRequest`,{kind:i(e===`skills`?`skillsSettings`:`pluginsSettings`),source:JSON.stringify(a.trim()),scope:s}))},children:[(0,q.jsxs)(`label`,{className:`settings-form-field`,children:[i(`resourcePackageSource`),(0,q.jsx)(`input`,{required:!0,maxLength:1e3,value:a,placeholder:i(`resourcePackageSourcePlaceholder`),disabled:t,onChange:e=>{o(e.target.value)}})]}),(0,q.jsxs)(`label`,{className:`settings-form-field`,htmlFor:`resource-install-scope`,children:[i(`scope`),(0,q.jsx)(Tj,{id:`resource-install-scope`,label:i(`scope`),value:s,disabled:t,onChange:c,options:[{value:`user`,label:i(`resourceScope_user`)},{value:`project`,label:i(`resourceScope_project`)}]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-actions`,children:[(0,q.jsx)(Br,{type:`submit`,label:i(`configureViaSetup`),variant:`secondary`,size:`sm`,isDisabled:t||!a.trim()}),(0,q.jsx)(Br,{label:i(`cancel`),variant:`ghost`,size:`sm`,onClick:r})]}),(0,q.jsx)(`small`,{children:i(`resourceInstallReview`)})]}),e===`skills`&&(0,q.jsxs)(`a`,{className:`settings-resource-link`,href:`https://skills.sh`,target:`_blank`,rel:`noreferrer`,children:[i(`browseSkills`),(0,q.jsx)(Os,{"aria-hidden":`true`})]})]})}function kW({catalog:e,pending:t,onReload:n,kind:r,onConfigure:i,children:a}){let{t:o}=W(),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(null);return(0,q.jsxs)(`section`,{className:`settings-resource-management`,children:[a&&(0,q.jsx)(`div`,{className:`settings-resource-actions`,children:a}),(0,q.jsxs)(`div`,{className:`settings-resource-reload`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:o(`resourceSessionState`)}),(0,q.jsx)(`p`,{children:o(`resourcesReloadNote`)})]}),(0,q.jsx)(Br,{label:o(`reloadResources`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(me,{"aria-hidden":`true`}),isDisabled:t||l||!e?.sessionPath||!n,isLoading:l,onClick:()=>c(!0)})]}),d&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,role:`status`,children:d}),(0,q.jsxs)(`details`,{className:`settings-resource-advanced`,children:[(0,q.jsx)(`summary`,{children:o(`advancedResourceConfiguration`)}),(0,q.jsx)(wW,{pending:t,onConfigure:i,placeholder:o(r===`skills`?`setupSkillsPlaceholder`:`setupPluginsPlaceholder`)})]}),s&&(0,q.jsx)(uj,{isOpen:!0,onOpenChange:c,title:o(`reloadResources`),description:o(`resourceReloadReview`),cancelLabel:o(`cancel`),actionLabel:o(`reloadResources`),onAction:()=>{c(!1),u(!0),f(null),n?.().then(()=>f(o(`resourceReloaded`)),e=>f(e instanceof Error?e.message:o(`resourceReloadFailed`))).finally(()=>u(!1))}})]})}function AW({catalog:e}){let{t}=W();if(!e)return null;let{diagnostics:n,truncation:r}=e.resources;return!n.settingsErrors&&!n.extensionErrors&&!n.skillErrors&&!r.truncated?null:(0,q.jsxs)(`p`,{className:`settings-resource-notice`,role:`status`,children:[t(`resourceDiagnostics`,n),n.settingsErrors?` ${t(`resourceConfigurationDiagnostics`,{count:n.settingsErrors})}`:``,r.truncated&&` ${t(`resourceCatalogTruncated`)}`]})}function jW({catalog:e,error:t,onRefresh:n,setupPending:r,onConfigure:i,onReload:a}){let{t:o}=W(),s=e?.resources.skills??[],[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(`all`),[f,p]=(0,K.useState)(!1),m=(0,K.useMemo)(()=>s.filter(e=>(u===`all`||e.scope===u)&&`${e.name} ${e.description} ${e.source}`.toLocaleLowerCase().includes(c.trim().toLocaleLowerCase())),[s,c,u]),h=(0,K.useMemo)(()=>[`project`,`user`,`temporary`].map(e=>({scope:e,skills:m.filter(t=>t.scope===e)})).filter(e=>e.skills.length>0),[m]),[g,_]=(0,K.useState)(``),[v,y]=(0,K.useState)(null),b=m.find(e=>e.id===g)??m[0],x=m.filter(e=>e.canManage!==!1),S=JSON.stringify(x.map(e=>e.filePath)),C=new TextEncoder().encode(S).length>12e3;(0,K.useEffect)(()=>{s.length&&!s.some(e=>e.id===g)&&_(s[0].id)},[g,s]);let w=e=>{y(null),td(`/skill:${e.name} `).then(e=>y(e?`copied`:`failed`))};return(0,q.jsxs)(`section`,{className:`settings-content-page settings-managed-panel`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:o(`skillsSettings`)}),(0,q.jsx)(`p`,{children:o(`skillsEmptyIntro`)})]})}),(0,q.jsxs)(`aside`,{className:`settings-resource-sidebar`,children:[(0,q.jsx)(DW,{kind:`skills`,query:c,scope:u,onQuery:l,onScope:d,onAdd:()=>p(!0)}),(0,q.jsxs)(`div`,{className:`settings-resource-list`,children:[h.map(e=>(0,q.jsxs)(`section`,{className:`settings-resource-group`,children:[(0,q.jsx)(`span`,{className:`settings-sidebar-label`,children:o(`resourceScope_${e.scope}`)}),e.skills.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:`settings-resource-item`,"aria-current":e.id===b?.id?`page`:void 0,onClick:()=>{_(e.id),y(null),p(!1)},children:[(0,q.jsx)(Pc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:e.name}),(0,q.jsx)(`small`,{children:o(e.disableModelInvocation?`explicitOnly`:`availableToModel`)})]})]},e.id))]},e.scope)),!e&&!t&&(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}),e&&!m.length&&(0,q.jsx)(`p`,{className:`settings-resource-empty`,children:o(s.length?`noMatchingResources`:`noSkillsFound`)})]}),(0,q.jsxs)(`div`,{className:`settings-sidebar-footer`,children:[(0,q.jsx)(`span`,{children:o(`skillCount`,{count:s.length})}),(0,q.jsx)(`button`,{type:`button`,"aria-label":o(`refreshStatus`),onClick:n,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-detail`,children:[(0,q.jsx)(AW,{catalog:e}),f?(0,q.jsx)(OW,{kind:`skills`,pending:r,onConfigure:i,onCancel:()=>p(!1)}):t?(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}):b?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`settings-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:b.name}),(0,q.jsx)(`p`,{children:b.description})]}),(0,q.jsx)(Br,{label:o(v===`copied`?`copiedMessage`:`copySkillInvocation`),variant:`secondary`,size:`sm`,icon:v===`copied`?(0,q.jsx)(rs,{}):(0,q.jsx)(_s,{}),onClick:()=>w(b)})]}),(0,q.jsxs)(`dl`,{className:`settings-detail-metadata`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`source`)}),(0,q.jsx)(`dd`,{children:b.source===`auto`?o(`resourceSourceAuto`):b.source===`local`?o(`resourceSourceLocal`):b.source===`builtin`?o(`builtIn`):b.source})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`scope`)}),(0,q.jsx)(`dd`,{children:o(`resourceScope_${b.scope}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`invocation`)}),(0,q.jsx)(`dd`,{children:(0,q.jsx)(`code`,{children:`/skill:${b.name}`})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`modelInvocation`)}),(0,q.jsx)(`dd`,{children:o(b.disableModelInvocation?`explicitOnly`:`availableToModel`)})]})]}),(0,q.jsxs)(`section`,{className:`settings-path-block`,children:[(0,q.jsx)(Fs,{"aria-hidden":`true`}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:o(`skillFile`)}),(0,q.jsx)(`code`,{children:b.filePath})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-actions`,children:[(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(b.disableModelInvocation?`enableSkillInvocation`:`disableSkillInvocation`),request:o(`setupSkillInvocationRequest`,{path:b.filePath,disabled:!b.disableModelInvocation})}),(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(`updateResource`),request:o(`setupSkillManageRequest`,{action:`update`,path:JSON.stringify(b.filePath),source:JSON.stringify(b.source),scope:b.scope})}),(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(`removeResource`),request:o(`setupSkillManageRequest`,{action:`remove`,path:JSON.stringify(b.filePath),source:JSON.stringify(b.source),scope:b.scope})})]}),b.canManage===!1&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,children:o(`resourceTargetTruncated`)}),v===`failed`&&(0,q.jsx)(`p`,{className:`inspection-warning`,children:o(`copyFailed`)})]}):(0,q.jsxs)(`div`,{className:`settings-empty-detail`,children:[(0,q.jsx)(Pc,{"aria-hidden":`true`}),(0,q.jsx)(`h2`,{children:o(s.length?`noMatchingResources`:`skillsEmptyTitle`)}),(0,q.jsx)(Br,{label:o(`addSkill`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:()=>p(!0)})]}),!f&&(0,q.jsxs)(kW,{catalog:e,pending:r,onReload:a,kind:`skills`,onConfigure:i,children:[x.length>1&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(CW,{isPending:r,isBlocked:C,onConfigure:i,label:o(`enableVisibleSkills`,{count:x.length}),request:o(`setupSkillsBulkRequest`,{paths:S,disabled:!1})}),(0,q.jsx)(CW,{isPending:r,isBlocked:C,onConfigure:i,label:o(`disableVisibleSkills`,{count:x.length}),request:o(`setupSkillsBulkRequest`,{paths:S,disabled:!0})})]}),C&&(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`resourceBulkTooLarge`)})]})]})]})}function MW({catalog:e,error:t,currentModel:n,models:r,activity:i,setupPending:a,setupBlocked:o=!1,onConfigure:s,onRefresh:c}){let{t:l}=W(),[u,d]=(0,K.useState)(`explorer`),f=e?.setup.subagents.roleModels[u],[p,m]=(0,K.useState)(``),[h,g]=(0,K.useState)(1);(0,K.useEffect)(()=>{let t=e?.setup.subagents.roleModels[u];m(t?`${t.provider}/${t.model}`:``),g(e?.setup.workflows.concurrency??1)},[u,e]);let _=i?.items.filter(e=>e.status===`running`).length??0,v=i?.items.filter(e=>e.status!==`running`).length??0;return(0,q.jsxs)(`section`,{className:`settings-content-page settings-subagents-panel`,children:[(0,q.jsxs)(`header`,{className:`settings-page-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:l(`subagentsSettings`)}),(0,q.jsx)(`p`,{children:l(`subagentConfigurationIntro`)})]}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:s,request:l(`setupRequestSubagents`),label:l(`configureRoles`)})]}),(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:c}),(0,q.jsx)(`div`,{className:`settings-control-group`,children:(0,q.jsxs)(`label`,{className:`settings-control-row`,htmlFor:`subagent-role`,children:[(0,q.jsxs)(`span`,{className:`settings-control-copy`,children:[(0,q.jsx)(`strong`,{children:l(`builtInRoles`)}),(0,q.jsx)(`span`,{children:l(`subagentRoleShort_${u}`)})]}),(0,q.jsx)(Tj,{id:`subagent-role`,name:`subagentRole`,label:l(`builtInRoles`),value:u,onChange:e=>{let t=bW.find(t=>t===e);t&&d(t)},options:bW.map(e=>({value:e,label:l(`subagentRole_${e}`)}))})]})}),(0,q.jsx)(`div`,{className:`settings-role-detail`,children:e&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`header`,{className:`settings-detail-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:l(`subagentRole_${u}`)}),(0,q.jsx)(`p`,{children:l(`subagentRoleDescription_${u}`)})]})}),(0,q.jsxs)(`form`,{className:`settings-edit-form settings-role-form`,onSubmit:e=>{e.preventDefault(),!(a||o)&&s(l(`setupRoleFormRequest`,{role:u,model:p||l(`inheritParentModel`),concurrency:h}))},children:[(0,q.jsxs)(`div`,{className:`settings-control-group`,children:[(0,q.jsxs)(`label`,{className:`settings-control-row`,htmlFor:`role-model`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`modelAssignment`)})}),(0,q.jsx)(Tj,{id:`role-model`,name:`roleModel`,label:l(`modelAssignment`),value:p,disabled:a||o,onChange:m,menuWidth:`min(380px, calc(100vw - 32px))`,options:[{value:``,label:l(`inheritParentModel`)},...p&&!r.some(e=>`${e.provider}/${e.id}`===p)?[{value:p,label:p}]:[],...r.map(e=>({value:`${e.provider}/${e.id}`,label:e.label}))]})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`effectiveModel`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:f?`${f.provider}/${f.model}`:n?.label??l(`unknownState`)})]}),(0,q.jsxs)(`label`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`workflowConcurrencyLabel`)})}),(0,q.jsx)(`input`,{name:`concurrency`,type:`number`,autoComplete:`off`,min:1,max:64,required:!0,value:h,disabled:a||o,onChange:e=>g(Number(e.target.value))})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`workflowCallLimit`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:e.setup.workflows.maxAgentCalls})]})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:a||o,children:l(`configureViaSetup`)}),(0,q.jsx)(`small`,{className:`settings-resource-caption`,children:l(`setupFormDetail`)})]}),(0,q.jsxs)(`section`,{className:`settings-role-principles`,children:[(0,q.jsx)(`h2`,{children:l(`runtimeBoundaries`)}),(0,q.jsxs)(`div`,{className:`settings-control-group`,children:[(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(Ys,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:l(`subagentAuthorityNote`)})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(ws,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:l(`subagentModelNote`)})]})]}),(0,q.jsxs)(`p`,{className:`settings-resource-caption`,children:[l(`subagentActiveCount`,{count:_}),` ·`,` `,l(`subagentCompletedCount`,{count:v})]})]})]})})]})}function NW(e){return e.extensions.length+e.skills.length+e.prompts.length+e.themes.length}function PW(e){return e.enabled===!1?`disabled`:e.configured&&!e.installed?`missing`:e.diagnostics?.length?`error`:NW(e)?`loaded`:e.installed?`installed`:`notLoaded`}function FW({catalog:e,error:t,onRefresh:n,setupPending:r,onConfigure:i,onReload:a}){let{t:o}=W(),s=e?.resources.plugins??[],[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(`all`),[f,p]=(0,K.useState)(!1),m=(0,K.useMemo)(()=>s.filter(e=>(u===`all`||e.scope===u)&&`${e.name??``} ${e.source}`.toLocaleLowerCase().includes(c.trim().toLocaleLowerCase())),[s,c,u]),[h,g]=(0,K.useState)(``),_=m.find(e=>e.id===h)??m[0],v=m.filter(e=>e.configured&&e.canManage!==!1),y=e=>e.name??(e.source===`auto`?o(`resourceSourceAuto`):e.source===`builtin`?o(`builtIn`):EW(e.source)),b=JSON.stringify(v.map(({source:e,scope:t,baseDir:n})=>({source:e,scope:t,path:n}))),x=new TextEncoder().encode(b).length>12e3;return(0,K.useEffect)(()=>{s.length&&!s.some(e=>e.id===h)&&g(s[0].id)},[s,h]),(0,q.jsxs)(`section`,{className:`settings-content-page settings-managed-panel`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:o(`pluginsSettings`)}),(0,q.jsx)(`p`,{children:o(`pluginsEmptyIntro`)})]})}),(0,q.jsxs)(`aside`,{className:`settings-resource-sidebar`,children:[(0,q.jsx)(DW,{kind:`plugins`,query:c,scope:u,onQuery:l,onScope:d,onAdd:()=>p(!0)}),(0,q.jsxs)(`div`,{className:`settings-resource-list`,children:[m.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:`settings-resource-item`,"aria-current":e.id===_?.id?`page`:void 0,onClick:()=>{g(e.id),p(!1)},children:[(0,q.jsx)(Sc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:y(e)}),(0,q.jsxs)(`small`,{children:[o(`resourceScope_${e.scope}`),` ·`,` `,o(`pluginState_${PW(e)}`)]})]})]},e.id)),!e&&!t&&(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}),e&&!m.length&&(0,q.jsx)(`p`,{className:`settings-resource-empty`,children:o(s.length?`noMatchingResources`:`noPluginsFound`)})]}),(0,q.jsxs)(`div`,{className:`settings-sidebar-footer`,children:[(0,q.jsx)(`span`,{children:e?o(`pluginCount`,{count:s.length}):o(`settingsCatalogLoading`)}),(0,q.jsx)(`button`,{type:`button`,"aria-label":o(`refreshStatus`),onClick:n,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-detail`,children:[(0,q.jsx)(AW,{catalog:e}),f?(0,q.jsx)(OW,{kind:`plugins`,pending:r,onConfigure:i,onCancel:()=>p(!1)}):t?(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}):_?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`settings-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:y(_)}),(0,q.jsx)(`code`,{children:_.source})]}),(0,q.jsx)(`span`,{className:`settings-status-badge ${PW(_)===`loaded`?`healthy`:``}`,children:o(`pluginState_${PW(_)}`)})]}),(0,q.jsxs)(`dl`,{className:`settings-detail-metadata settings-detail-metadata-wide`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`scope`)}),(0,q.jsx)(`dd`,{children:o(`resourceScope_${_.scope}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`resourceOrigin`)}),(0,q.jsx)(`dd`,{children:o(`resourceOrigin_${_.origin}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`installedVersion`)}),(0,q.jsx)(`dd`,{children:_.installedVersion??o(`notReported`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`configuredVersion`)}),(0,q.jsx)(`dd`,{children:_.configuredVersion??o(`resourceVersionUnpinned`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`resources`)}),(0,q.jsx)(`dd`,{children:o(`pluginResourceSummary`,{extensions:_.extensions.length,skills:_.skills.length,prompts:_.prompts.length,themes:_.themes.length})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`baseDirectory`)}),(0,q.jsx)(`dd`,{title:_.baseDir,children:_.baseDir??o(`notReported`)})]})]}),[...new Set(_.diagnostics)].map(e=>(0,q.jsx)(`p`,{className:`settings-resource-notice`,role:`status`,children:e},e)),_.canManage===!1&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,children:o(`resourceTargetTruncated`)}),_.configured&&_.canManage!==!1&&(0,q.jsx)(`div`,{className:`settings-resource-actions settings-resource-primary-actions`,children:[_.enabled===!1?`enable`:`disable`,`update`,`remove`].map(e=>(0,q.jsx)(CW,{isPending:r,onConfigure:i,label:o(`pluginAction_${e}`),request:o(`setupPluginOperationRequest`,{action:e,source:JSON.stringify(_.source),path:JSON.stringify(_.baseDir??null),scope:_.scope})},e))}),(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`pluginLoadedResources`,{count:NW(_)})}),(0,q.jsxs)(`section`,{className:`settings-resource-groups`,children:[_.extensions.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`extensions`)}),(0,q.jsx)(`ul`,{children:_.extensions.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:e.name}),(0,q.jsx)(`code`,{children:e.path})]}),(0,q.jsx)(`span`,{children:o(`extensionSurfaceCount`,{tools:e.toolCount,commands:e.commandCount})})]},e.path))})]}),_.skills.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`skillsSettings`)}),(0,q.jsx)(`p`,{children:_.skills.join(` · `)})]}),_.prompts.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`prompts`)}),(0,q.jsx)(`p`,{children:_.prompts.join(` · `)})]}),_.themes.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`themes`)}),(0,q.jsx)(`p`,{children:_.themes.join(` · `)})]})]})]}):(0,q.jsxs)(`div`,{className:`settings-empty-detail`,children:[(0,q.jsx)(Sc,{"aria-hidden":`true`}),(0,q.jsx)(`h2`,{children:o(s.length?`noMatchingResources`:`pluginsEmptyTitle`)}),(0,q.jsx)(Br,{label:o(`addPlugin`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:()=>p(!0)})]}),!f&&(0,q.jsxs)(kW,{catalog:e,pending:r,onReload:a,kind:`plugins`,onConfigure:i,children:[v.length>1&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(CW,{isPending:r,isBlocked:x,onConfigure:i,label:o(`enableVisiblePlugins`,{count:v.length}),request:o(`setupPluginsBulkRequest`,{packages:b,disabled:!1})}),(0,q.jsx)(CW,{isPending:r,isBlocked:x,onConfigure:i,label:o(`disableVisiblePlugins`,{count:v.length}),request:o(`setupPluginsBulkRequest`,{packages:b,disabled:!0})})]}),x&&(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`resourceBulkTooLarge`)})]})]})]})}function IW(e,t=``,n){let r=(0,K.useMemo)(()=>new de,[]),[i,a]=(0,K.useState)(0),o=JSON.stringify([e,t]),s=(0,K.useRef)(o);s.current=o;let c=(0,K.useRef)(0),[l,u]=(0,K.useState)(null),d=(0,K.useCallback)(()=>a(e=>e+1),[]);return(0,K.useEffect)(()=>{let t=new AbortController,n=++c.current;return u(e=>({owner:o,catalog:e?.owner===o?e.catalog:null,error:null})),r.settingsCatalog(e,t.signal).then(e=>{!t.signal.aborted&&c.current===n&&u({owner:o,catalog:e,error:null})},e=>{!t.signal.aborted&&c.current===n&&u(t=>({owner:o,catalog:t?.owner===o?t.catalog:null,error:e instanceof Error?e.message:String(e)}))}),()=>t.abort()},[r,i,e,o,n]),{catalog:l?.owner===o?l.catalog:null,error:l?.owner===o?l.error:null,refresh:d,updateSetup:e=>{s.current===o&&(c.current++,u(t=>t?.owner===o&&t.catalog?{...t,catalog:{...t.catalog,setup:e}}:t))}}}var LW=[`default`,`mist`,`rose`,`pine`],RW=[`codex`,`sans`,`serif`,`mono`],zW=[`system`,`light`,`dark`],BW={palette:`default`,accent:``,background:``,foreground:``,font:`codex`};function VW(e){return e===`pine`?`dark`:e===`mist`||e===`rose`?`light`:e}function HW(e,t){return e===`mist`||e===`rose`||e===`pine`?e:t.palette}function UW(e,t){switch(e){case`mist`:return t?{background:`#182126`,foreground:`#EDF3F5`,sidebar:`#1D292F`,accent:`#7BB5CA`}:{background:`#F8FBFC`,foreground:`#253239`,sidebar:`#EEF3F5`,accent:`#347991`};case`rose`:return t?{background:`#211A1C`,foreground:`#F4ECEC`,sidebar:`#2A2123`,accent:`#E09AA5`}:{background:`#FFF9F7`,foreground:`#342729`,sidebar:`#F6EDEA`,accent:`#B45562`};case`pine`:return t?{background:`#101A17`,foreground:`#EAF2EC`,sidebar:`#16241F`,accent:`#86C89E`}:{background:`#F4F8F5`,foreground:`#20352A`,sidebar:`#E9F1EB`,accent:`#32704A`};default:return t?{background:`#17191C`,foreground:`#EDF0F2`,sidebar:`#1D2024`,accent:`#74A9E6`}:{background:`#FFFFFF`,foreground:`#1A1C1F`,sidebar:`#F6F7F9`,accent:`#2563EB`}}}function WW(e){if(e.length>2e3)return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;if(Object.keys(n).sort().join(`,`)!==`appearance,theme,version`||n.version!==1)return null;let r=zW.find(e=>e===n.theme);if(!r||!n.appearance||typeof n.appearance!=`object`||Array.isArray(n.appearance))return null;let i=n.appearance;if(Object.keys(i).sort().join(`,`)!==`accent,background,font,foreground,palette`)return null;let a=LW.find(e=>e===i.palette),o=i.font===`system`?`codex`:RW.find(e=>e===i.font),{accent:s,background:c,foreground:l}=i;return!a||!o||typeof s!=`string`||typeof c!=`string`||typeof l!=`string`||![s,c,l].every(e=>e===``||/^#[0-9a-f]{6}$/iu.test(e))?null:{theme:r,appearance:{palette:a,font:o,accent:s,background:c,foreground:l}}}catch{return null}}var GW=[``,`#2563EB`,`#7C3AED`,`#DB2777`,`#D97706`,`#16A34A`];function KW({label:e,value:t,options:n,disabled:r,onSelect:i}){let a=n.find(e=>e.id===t);return(0,q.jsx)(yo,{className:`settings-select-menu`,button:{label:a?.label??t,"aria-label":e,variant:`secondary`,size:`sm`,className:`appearance-menu-trigger`,isDisabled:r,...a?.color?{icon:(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:a.color}})}:{}},menuWidth:200,alignment:`end`,items:n.map(e=>({id:e.id||`default`,label:e.label,isDisabled:r,...e.color?{icon:(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:e.color}})}:{},endContent:t===e.id?(0,q.jsx)(`span`,{className:`settings-select-check`,"aria-hidden":`true`,children:(0,q.jsx)(rs,{})}):void 0,onClick:()=>i(e.id)}))})}function qW({label:e,value:t,fallback:n,disabled:r,onSave:i}){let a=(t||n).toUpperCase(),o=(0,K.useRef)(a);o.current=a;let[s,c]=(0,K.useState)(a);(0,K.useEffect)(()=>c(a),[a]);let l=e=>{c(e),e!==a&&/^#[0-9a-f]{6}$/iu.test(e)&&i(e).then(e=>{e||c(o.current)})};return(0,q.jsxs)(`div`,{className:`appearance-color-input`,children:[(0,q.jsxs)(`label`,{className:`appearance-color-picker`,children:[(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:a}}),(0,q.jsx)(`input`,{"aria-label":`${e} — ${a}`,type:`color`,value:a,disabled:r,onChange:e=>l(e.target.value.toUpperCase())})]}),(0,q.jsx)(`input`,{className:`appearance-color-hex`,type:`text`,"aria-label":e,value:s,maxLength:7,spellCheck:!1,disabled:r,onChange:e=>l(e.target.value.toUpperCase()),onBlur:()=>c(a)})]})}function JW({catalog:e,theme:t,pending:n,error:r,onRefresh:i,onUpdatePreferences:a}){let{t:o}=W(),{mode:s}=sa(),c=e?.setup,l=c?.ui.webTheme??t,u=c?.ui.webAppearance??BW,d=HW(l,u),f=VW(l),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(``),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(null),[C,w]=(0,K.useState)(c?.ui.webChatWidth??820),[T,E]=(0,K.useState)(c?.ui.webChatFontSize??14),D=(0,K.useRef)({chatWidth:C,fontSize:T});c&&(D.current={chatWidth:c.ui.webChatWidth,fontSize:c.ui.webChatFontSize}),(0,K.useEffect)(()=>{c&&(w(c.ui.webChatWidth),E(c.ui.webChatFontSize))},[c]);let O=e?.setupWritable===!1||!!e?.resources.diagnostics.settingsErrors,k=n||!c||!!r||O,A=WW(_),j=e=>a({appearance:e}),M=()=>{n||(g(!1),v(``),b(!1))},N=f===`dark`||f===`system`&&s===`dark`,P=UW(d,N);return(0,q.jsxs)(`section`,{className:`settings-content-page settings-appearance-panel`,children:[(0,q.jsx)(`h1`,{children:o(`appearance`)}),(!c||r||O)&&(0,q.jsxs)(`div`,{className:`settings-load-state`,role:r||O?`alert`:`status`,children:[(0,q.jsx)(me,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o(O?`configurationReadFailure`:r?`settingsCatalogFailed`:`settingsCatalogLoading`)}),(r||O)&&(0,q.jsx)(`button`,{type:`button`,onClick:i,children:o(`retryAdmissionCheck`)})]}),(0,q.jsxs)(`section`,{className:`appearance-section`,"aria-labelledby":`appearance-visual-title`,children:[(0,q.jsx)(`h2`,{id:`appearance-visual-title`,children:o(`appearanceVisualStyle`)}),(0,q.jsxs)(`div`,{className:`appearance-card appearance-mode-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceMode`)}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":o(`appearanceMode`),className:`appearance-mode-options`,children:zW.map(e=>(0,q.jsx)(V,{content:o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`),children:(0,q.jsxs)(`label`,{className:`appearance-mode-option`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`openpi-appearance-mode`,"aria-label":o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`),checked:f===e,disabled:k,onChange:()=>void a({theme:e})}),(0,q.jsxs)(`span`,{"aria-hidden":`true`,className:`appearance-mode-preview`,"data-mode":e,"data-selected":f===e,children:[(0,q.jsxs)(`span`,{className:`appearance-mini-window`,children:[(0,q.jsx)(`span`,{className:`appearance-mini-sidebar`}),(0,q.jsxs)(`span`,{className:`appearance-mini-chat`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`em`,{})]})]}),e===`system`&&(0,q.jsxs)(`span`,{className:`appearance-mini-window appearance-mini-dark`,children:[(0,q.jsx)(`span`,{className:`appearance-mini-sidebar`}),(0,q.jsxs)(`span`,{className:`appearance-mini-chat`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`em`,{})]})]})]}),(0,q.jsx)(`span`,{className:`appearance-mode-label`,children:o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`)})]})},e))})]}),(0,q.jsxs)(`div`,{className:`appearance-card`,children:[(0,q.jsxs)(`div`,{className:`appearance-row appearance-theme-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceTheme`)}),(0,q.jsxs)(`div`,{className:`appearance-theme-actions`,children:[(0,q.jsx)(V,{content:o(`appearanceImport`),children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":o(`appearanceImport`),disabled:k,onClick:()=>{b(!1),g(!0)},children:(0,q.jsx)(Ts,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:o(`appearanceCopy`),children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":o(`appearanceCopy`),disabled:k,onClick:()=>{td(JSON.stringify({version:1,theme:f,appearance:{...u,palette:d}})).then(e=>S(e?`saved`:`failed`))},children:(0,q.jsx)(Ss,{"aria-hidden":`true`})})})]})]}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":o(`appearanceTheme`),"aria-busy":n,className:`appearance-palette-options`,children:LW.map(e=>{let t=UW(e,N),n=e==="default"?`OpenPI`:o(`theme${e[0].toUpperCase()}${e.slice(1)}`);return(0,q.jsxs)(`label`,{className:`appearance-palette-option`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`openpi-appearance-palette`,"aria-label":n,checked:d===e,disabled:k,onChange:()=>void j({palette:e})}),(0,q.jsxs)(`span`,{className:`appearance-palette-preview`,"aria-hidden":`true`,style:{background:t.background,color:t.foreground},children:[(0,q.jsxs)(`span`,{className:`appearance-palette-shell`,style:{background:t.sidebar},children:[(0,q.jsxs)(`span`,{className:`appearance-palette-sidebar`,children:[(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]}),(0,q.jsxs)(`span`,{className:`appearance-palette-canvas`,style:{background:t.background},children:[(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`em`,{style:{borderColor:t.accent},children:(0,q.jsx)(`span`,{className:`appearance-palette-send`,style:{background:t.accent}})})]})]}),(0,q.jsx)(`span`,{className:`appearance-palette-check`,children:(0,q.jsx)(rs,{})})]}),(0,q.jsx)(`span`,{className:`appearance-palette-label`,children:n})]},e)})}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceAccent`)}),(0,q.jsxs)(`div`,{className:`appearance-accent-controls`,children:[(0,q.jsx)(KW,{label:o(`appearanceAccent`),value:u.accent,options:GW.map((e,t)=>({id:e,label:o(`appearanceAccent${t}`),color:e||`var(--text)`})),disabled:k,onSelect:e=>void j({accent:e})}),(0,q.jsx)(qW,{label:o(`appearanceCustomAccent`),value:u.accent,fallback:`#2563EB`,disabled:k,onSave:e=>j({accent:e})})]})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceBackground`)}),(0,q.jsx)(qW,{label:o(`appearanceBackground`),value:u.background,fallback:P.background,disabled:k,onSave:e=>j({background:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceForeground`)}),(0,q.jsx)(qW,{label:o(`appearanceForeground`),value:u.foreground,fallback:P.foreground,disabled:k,onSave:e=>j({foreground:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceFont`)}),(0,q.jsx)(KW,{label:o(`appearanceFont`),value:u.font===`system`?`codex`:u.font,options:RW.map(e=>({id:e,label:o(`appearanceFont_${e}`)})),disabled:k,onSelect:e=>{let t=RW.find(t=>t===e);t&&j({font:t})}})]})]}),x&&(0,q.jsx)(`p`,{role:x===`failed`?`alert`:`status`,className:`appearance-share-status`,children:o(x===`saved`?`appearanceCopied`:`appearanceCopyFailed`)})]}),(0,q.jsxs)(`section`,{className:`appearance-section`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`appearance-advanced-toggle`,"aria-expanded":p,"aria-controls":`appearance-advanced`,onClick:()=>m(!p),children:[o(`appearanceAdvanced`),p?(0,q.jsx)(is,{"aria-hidden":`true`}):(0,q.jsx)(os,{"aria-hidden":`true`})]}),p&&c&&(0,q.jsxs)(`div`,{id:`appearance-advanced`,className:`appearance-card appearance-advanced-content`,children:[(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`expandThinkingByDefault`)}),(0,q.jsx)(bj,{label:o(`expandThinkingByDefault`),isLabelHidden:!0,value:c.ui.webExpandThinking,size:`sm`,isDisabled:k,onChange:e=>void a({expandThinking:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-slider-row`,children:[(0,q.jsxs)(`div`,{className:`settings-slider-heading`,children:[(0,q.jsx)(`span`,{children:o(`chatContentWidth`)}),(0,q.jsxs)(`output`,{children:[C,`px`]}),(0,q.jsx)(`button`,{type:`button`,className:`settings-reset-button`,"aria-label":o(`resetChatContentWidth`),disabled:k||C===820,onClick:()=>{w(820),a({chatWidth:820}).then(e=>{e||w(D.current.chatWidth)})},children:(0,q.jsx)(he,{"aria-hidden":`true`})})]}),(0,q.jsx)(yW,{label:o(`chatContentWidth`),isLabelHidden:!0,value:C,min:820,max:2e3,step:10,width:`100%`,valueDisplay:`none`,isDisabled:k,onChange:e=>w(e),onChangeEnd:e=>{e!==c.ui.webChatWidth&&a({chatWidth:e}).then(e=>{e||w(D.current.chatWidth)})}})]}),(0,q.jsxs)(`div`,{className:`appearance-slider-row`,children:[(0,q.jsxs)(`div`,{className:`settings-slider-heading`,children:[(0,q.jsx)(`span`,{children:o(`chatFontSize`)}),(0,q.jsxs)(`output`,{children:[T,`px`]}),(0,q.jsx)(`button`,{type:`button`,className:`settings-reset-button`,"aria-label":o(`resetChatFontSize`),disabled:k||T===14,onClick:()=>{E(14),a({chatFontSize:14}).then(e=>{e||E(D.current.fontSize)})},children:(0,q.jsx)(he,{"aria-hidden":`true`})})]}),(0,q.jsx)(yW,{label:o(`chatFontSize`),isLabelHidden:!0,value:T,min:12,max:24,step:1,width:`100%`,valueDisplay:`none`,isDisabled:k,onChange:e=>E(e),onChangeEnd:e=>{e!==c.ui.webChatFontSize&&a({chatFontSize:e}).then(e=>{e||E(D.current.fontSize)})}})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceReset`)}),(0,q.jsxs)(`button`,{type:`button`,className:`appearance-reset`,disabled:k,onClick:()=>void a({theme:`system`,appearance:BW,chatWidth:820,chatFontSize:14,expandThinking:!1}),children:[(0,q.jsx)(he,{"aria-hidden":`true`}),o(`appearanceResetAction`)]})]})]})]}),(0,q.jsxs)(Se,{isOpen:h,onOpenChange:e=>{e||M()},"aria-label":o(`appearanceImport`),width:480,className:`appearance-import-dialog`,children:[(0,q.jsx)(`h2`,{className:`appearance-import-title`,children:o(`appearanceImport`)}),(0,q.jsxs)(`form`,{className:`appearance-import-form`,onSubmit:e=>{e.preventDefault(),!(!A||k)&&(b(!1),a(A).then(e=>{e?(g(!1),v(``)):b(!0)}))},children:[(0,q.jsxs)(`label`,{children:[o(`appearanceThemeValue`),(0,q.jsx)(`textarea`,{maxLength:2e3,value:_,disabled:n,placeholder:o(`appearanceImportPlaceholder`),onChange:e=>{b(!1),v(e.target.value)}})]}),_&&!A&&(0,q.jsx)(`p`,{role:`alert`,children:o(`appearanceImportInvalid`)}),y&&(0,q.jsx)(`p`,{role:`alert`,children:o(`settingsPreferencesSaveFailed`)}),(0,q.jsxs)(`div`,{className:`appearance-import-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:n,onClick:M,children:o(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,disabled:k||!A,children:o(n?`savingSettings`:`appearanceImportAction`)})]})]})]})]})}function YW({workspaces:e,onRestore:t}){let{t:n,i18n:r}=W(),i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(``),[l,u]=(0,K.useState)(`updated`),[d,f]=(0,K.useState)(new Set),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(null),[y,b]=(0,K.useState)(null),[x,S]=(0,K.useState)(new Set),C=(0,K.useRef)(new Set),w=(0,K.useRef)(null),T=(0,K.useRef)(!1),E=JSON.stringify([a.trim(),s,l]),D=(0,K.useRef)({key:E});D.current.key!==E&&(D.current={key:E});let O=p?.scope===E?p:null,k=_?.scope===E?_:null,A=(0,K.useCallback)(async(e,t=0)=>{w.current?.abort();let n=new AbortController;w.current=n,g(!0),v(null);let r={query:a.trim(),sort:l,...s?{cwd:s}:{},limit:25};try{let a=await i.listArchivedSessions({...r,...e?{cursor:e}:{}},n.signal);if(n.signal.aborted||w.current!==n)return;let o=[...a.sessions];for(;!e&&o.length!o.some(t=>t.path===e.path));if(o.push(...e),!e.length)break}m(t=>({...a,scope:E,sessions:e&&t?.scope===E?[...t.sessions,...o.filter(e=>!t.sessions.some(t=>t.path===e.path))]:o}))}catch(t){!n.signal.aborted&&w.current===n&&v({scope:E,stale:t instanceof ge&&t.code===`ARCHIVED_SESSION_CURSOR_STALE`,...e?{cursor:e}:{}})}finally{w.current===n&&(w.current=null,g(!1))}},[i,s,a,E,l]);(0,K.useEffect)(()=>(T.current=!0,()=>{T.current=!1}),[]),(0,K.useEffect)(()=>(b(null),A(),()=>{w.current?.abort(),w.current=null}),[A]);let j=async e=>{if(C.current.has(e))return;C.current.add(e),S(new Set(C.current)),b(null);let n=D.current;try{let r=await t(e);if(!T.current||D.current!==n)return;if(!r){b(e);return}let i=O?.sessions.length??0;m(t=>t?{...t,sessions:t.sessions.filter(t=>t.path!==e)}:null),await A(void 0,i)}catch{T.current&&D.current===n&&b(e)}finally{C.current.delete(e),T.current&&S(new Set(C.current))}},M=new Map;for(let e of O?.sessions??[]){let t=e.workspacePath??e.cwd,n=M.get(t)??[];n.push(e),M.set(t,n)}let N=t=>e.find(e=>e.path===t)?.name??t.split(/[\\/]/u).filter(Boolean).at(-1)??t,P=[...new Set([...e.map(e=>e.path),...M.keys(),...s?[s]:[]])];return(0,q.jsxs)(`section`,{className:`settings-content-page settings-archive-panel`,children:[(0,q.jsx)(`h1`,{children:n(`settingsArchivedChats`)}),(0,q.jsxs)(`div`,{className:`settings-archive-toolbar`,children:[(0,q.jsxs)(`label`,{className:`settings-archive-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":n(`searchArchivedChats`),placeholder:n(`searchArchivedChats`),maxLength:160,value:a,onChange:e=>o(e.target.value)}),a&&(0,q.jsx)(`button`,{type:`button`,"aria-label":n(`settingsClearSearch`),onClick:()=>o(``),children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),(0,q.jsx)(Tj,{label:n(`archiveProjectFilter`),value:s,onChange:c,options:[{value:``,label:n(`archiveAllProjects`)},...P.map(e=>({value:e,label:N(e)}))]}),(0,q.jsx)(Tj,{label:n(`archiveSort`),value:l,onChange:e=>u(e===`created`?`created`:`updated`),options:[{value:`updated`,label:n(`archiveSortUpdated`)},{value:`created`,label:n(`archiveSortCreated`)}]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":n(`refreshArchives`),disabled:h,onClick:()=>void A(void 0,O?.sessions.length),children:(0,q.jsx)(me,{"aria-hidden":`true`})})]}),k&&(0,q.jsxs)(`div`,{className:`settings-archive-error`,role:`alert`,children:[(0,q.jsx)(`span`,{children:n(k.stale?`archiveCursorStale`:`archiveLoadFailed`)}),(0,q.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>void A(k.stale?void 0:k.cursor),children:n(`retryAdmissionCheck`)})]}),y&&(0,q.jsx)(`div`,{className:`settings-archive-error`,role:`alert`,children:n(`restoreFailed`)}),h&&(0,q.jsx)(`p`,{role:`status`,className:`settings-archive-status`,children:n(`loadingArchives`)}),!h&&!k&&O?.sessions.length===0&&(0,q.jsxs)(`div`,{className:`settings-archive-empty`,children:[(0,q.jsx)(Go,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:n(a.trim()||s?`noMatchingScannedArchives`:O.truncation.truncated?`noScannedArchives`:`noArchivedSessions`)})]}),(0,q.jsx)(`div`,{className:`settings-archive-groups`,children:[...M].map(([e,t])=>(0,q.jsxs)(`section`,{className:`settings-archive-group`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`settings-archive-group-heading`,"aria-label":n(`archiveProjectGroup`,{project:N(e),count:t.length}),"aria-expanded":!d.has(e),"aria-controls":`archive-group-${encodeURIComponent(e)}`,onClick:()=>f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),children:[d.has(e)?(0,q.jsx)(os,{"aria-hidden":`true`}):(0,q.jsx)(is,{"aria-hidden":`true`}),(0,q.jsx)(Vs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{title:e,children:N(e)}),(0,q.jsx)(`small`,{children:t.length})]}),!d.has(e)&&(0,q.jsx)(`ul`,{id:`archive-group-${encodeURIComponent(e)}`,className:`settings-archive-list`,children:t.map(e=>{let t=e.name||e.firstMessage||n(`untitledSession`),i=new Date(l===`created`?e.created:e.modified);return(0,q.jsxs)(`li`,{className:`settings-archive-row`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`settings-archive-chat-title`,title:t,children:t}),(0,q.jsx)(`time`,{dateTime:Number.isNaN(i.getTime())?void 0:i.toISOString(),children:Number.isNaN(i.getTime())?n(`unknownState`):new Intl.DateTimeFormat(r.language,{dateStyle:`medium`}).format(i)})]}),(0,q.jsxs)(`button`,{type:`button`,"aria-label":n(`restoreArchivedChat`,{title:t}),disabled:x.has(e.path),onClick:()=>void j(e.path),children:[(0,q.jsx)(Wo,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:n(x.has(e.path)?`restoringConversation`:`restoreConversation`)})]})]},e.path)})})]},e))}),!!O?.truncation.recordsUnscanned&&(0,q.jsx)(`p`,{className:`settings-archive-status`,children:n(`archiveScanBounded`,{count:O.truncation.recordsUnscanned})}),O?.nextCursor&&(0,q.jsx)(`button`,{type:`button`,className:`settings-archive-more`,disabled:h,onClick:()=>void A(O.nextCursor),children:n(`moreArchives`)})]})}var XW=[{id:`general`,group:`settingsPersonal`,label:`generalSettings`,Icon:Nc,terms:[`agentBehavior`,`resultDisplay`,`workflowLimits`,`runtimeIdentity`,`runtimeBackendVersion`,`runtimePackageRoot`,`runtimeStartedAt`,`runtimeGitRevision`,`runtimeGitState`,`runtimeFrontendVersion`,`runtimeFrontendBuild`,`runtimeStartupBuild`]},{id:`appearance`,group:`settingsPersonal`,label:`appearance`,Icon:zc,terms:[`appearanceTheme`,`appearanceAccent`,`appearanceFont`,`chatContentWidth`,`chatFontSize`]},{id:`archived-chats`,group:`settingsPersonal`,label:`settingsArchivedChats`,Icon:Go,terms:[`restoreConversation`]},{id:`configuration`,group:`settingsPersonal`,label:`configurationSettings`,Icon:Mc,terms:[`configurationApproval`,`configurationSandbox`,`configurationVerbosity`,`configurationSummary`,`configurationReasoningLevels`,`configurationDependencies`]},{id:`models`,group:`settingsAgent`,label:`modelSettings`,Icon:ws,terms:[`modelDefaultTitle`]},{id:`subagents`,group:`settingsAgent`,label:`subagentsSettings`,Icon:$o,terms:[]},{id:`web-search`,group:`settingsAgent`,label:`webSearchSettings`,Icon:Dc,terms:[]},{id:`skills`,group:`settingsIntegrations`,label:`skillsSettings`,Icon:Xs,terms:[]},{id:`plugins`,group:`settingsIntegrations`,label:`pluginsSettings`,Icon:Sc,terms:[]},{id:`browser`,group:`settingsIntegrations`,label:`browserSettings`,Icon:Es,terms:[]}];function ZW(e){return XW.find(({id:t})=>t===e)?.id}function QW({sessionId:e,sessionPath:t,cwd:n,entry:r=`general`,models:i,currentModel:a,thinkingLevel:o,theme:s,preferences:c,workspaces:l=[],onRestoreSession:u,capabilities:d,setupBusy:f,setupBlockedReason:p,plan:m,planSelectionPending:h=!1,onExitPlan:g,setupOutcome:_,onConfigureOpenPi:v,interaction:y,onPreferencesChanged:b,onSelectModel:x,onOpenRuntimeStatus:S,onClose:C}){let{t:w}=W(),T=f||!!p,E=(0,K.useRef)(null),D=(0,K.useRef)(null),[O,k]=(0,K.useState)(``),[A,j]=(0,K.useState)(r===`credentials`?`models`:r),[M,N]=(0,K.useState)(r===`credentials`||r===`models`),[P,F]=(0,K.useState)(!1),[I,ee]=(0,K.useState)(!1),[L,R]=(0,K.useState)(`general`),te=(0,K.useRef)(!1),z=(0,K.useRef)(!1),B=(0,K.useRef)(0),[ne,re]=(0,K.useState)(!1),V=(0,K.useRef)(!1),[ie,ae]=(0,K.useState)(!1),[oe,se]=(0,K.useState)(null),[ce,le]=(0,K.useState)(!1),[H,ue]=(0,K.useState)(!1),[fe,pe]=(0,K.useState)(null),me=H,he=(0,K.useRef)(void 0),ge=m!==void 0&&m!==`inactive`,_e=P||T||ge||h,ve=I&&L!==A||!I&&(A===`skills`||A===`plugins`||A===`web-search`)?void 0:!I||_?.requestId!==he.current?_:void 0,{catalog:ye,error:be,refresh:xe,updateSetup:Ce}=IW(e,a?`${a.provider}/${a.id}`:``,JSON.stringify(c)),we=ve!==void 0&&[`failed`,`cancelled`,`unconfirmed`].includes(ve.status);(0,K.useEffect)(()=>{E.current?.focus()},[]),(0,K.useEffect)(()=>{if(I){if(ve&&ve.status!==`pending`&&te.current){te.current=!1,z.current=!1,window.clearTimeout(B.current),xe(),b();return}if(T){z.current=!0;return}!z.current||!te.current||(te.current=!1,z.current=!1,window.clearTimeout(B.current),xe(),b())}},[b,xe,T,I,ve]),(0,K.useEffect)(()=>()=>window.clearTimeout(B.current),[]);let Te=async e=>{if(ae(!1),_e)return!1;he.current=_?.requestId,R(A),F(!0),ee(!1),te.current=!1,z.current=!1,window.clearTimeout(B.current),se(null);try{let t=await v(e);return t?(ee(!0),te.current=!0,B.current=window.setTimeout(()=>{!te.current||z.current||(te.current=!1,z.current=!1,xe(),b())},2e3)):se(w(`setupRequestFailed`)),t}catch(e){return F(!1),se(e instanceof Error?e.message:w(`setupRequestFailed`)),!1}finally{F(!1)}},Ee=async()=>{if(_e||!ye?.sessionPath)throw Error(w(`resourceReloadFailed`));F(!0);try{await new de().reloadSettingsResources(e,ye.sessionPath),xe(),b()}finally{F(!1)}},U=async e=>{if(V.current||!ye)return!1;V.current=!0,re(!0),ae(!1),se(null);try{let t=await new de().savePreferences(e);return Ce(t.setup),ae(!0),b(),!0}catch{return se(w(`settingsPreferencesSaveFailed`)),!1}finally{V.current=!1,re(!1)}},De=e=>{me||(j(e),k(``),e===`models`&&N(!0),se(null))};(0,K.useEffect)(()=>{let e=new URL(window.location.href);e.searchParams.set(`settings`,A),window.history.replaceState(window.history.state,``,e)},[A]);let Oe=XW.filter(({label:e,terms:t})=>[e,...t].some(e=>w(e).normalize(`NFKC`).toLocaleLowerCase().includes(O.trim().normalize(`NFKC`).toLocaleLowerCase()))),ke=(e,t=!1)=>{if(!me){if(ce&&!t){pe(e);return}pe(null),e.kind===`runtime`?S():C()}};return(0,q.jsxs)(Se,{isOpen:!0,purpose:`info`,padding:0,width:`calc(100vw - 32px)`,maxHeight:`calc(100dvh - 16px)`,className:`provider-settings-dialog`,"aria-label":w(`settings`),onOpenChange:e=>{!e&&!fe&&ke({kind:`close`})},children:[(0,q.jsxs)(`section`,{className:`provider-settings-surface`,children:[(0,q.jsxs)(`aside`,{className:`provider-settings-sidebar`,children:[(0,q.jsxs)(`header`,{className:`provider-settings-header`,children:[(0,q.jsx)(`strong`,{className:`provider-settings-title`,children:w(`settings`)}),(0,q.jsx)(`select`,{className:`provider-settings-mobile-picker`,"aria-label":w(`settingsNavigation`),disabled:me,value:A,onChange:e=>{let t=XW.find(({id:t})=>t===e.target.value);t&&De(t.id)},children:XW.map(({id:e,label:t})=>(0,q.jsx)(`option`,{value:e,children:w(t)},e))})]}),(0,q.jsxs)(`label`,{className:`provider-settings-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":w(`settingsSearch`),placeholder:w(`settingsSearch`),value:O,onChange:e=>k(e.target.value),disabled:me}),O&&(0,q.jsx)(`button`,{type:`button`,"aria-label":w(`settingsClearSearch`),onClick:()=>k(``),children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),(0,q.jsxs)(`div`,{className:`provider-settings-navigation`,ref:D,"aria-label":w(`settingsNavigation`),role:`tablist`,"aria-orientation":`vertical`,children:[[`settingsPersonal`,`settingsAgent`,`settingsIntegrations`].map(e=>(0,q.jsxs)(`div`,{className:`provider-settings-nav-group`,children:[Oe.some(t=>t.group===e)&&(0,q.jsx)(`p`,{children:w(e)}),Oe.filter(t=>t.group===e).map(({id:e,label:t,Icon:n})=>(0,q.jsxs)(`button`,{type:`button`,role:`tab`,disabled:me,id:`settings-tab-${e}`,tabIndex:A===e||!Oe.some(e=>e.id===A)&&Oe[0]?.id===e?0:-1,"aria-selected":A===e,"aria-controls":`settings-panel-${e}`,className:`provider-settings-tab`,title:w(t),onClick:()=>De(e),onKeyDown:t=>{if(t.altKey||t.ctrlKey||t.metaKey||t.nativeEvent.isComposing)return;let n=Oe.findIndex(t=>t.id===e),r=t.key===`Home`?0:t.key===`End`?Oe.length-1:t.key===`ArrowDown`||t.key===`ArrowRight`?(n+1)%Oe.length:t.key===`ArrowUp`||t.key===`ArrowLeft`?(n+Oe.length-1)%Oe.length:void 0;if(r===void 0)return;t.preventDefault();let i=Oe[r].id;De(i),D.current?.querySelector(`#settings-tab-${i}`)?.focus()},children:[(0,q.jsx)(n,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:w(t)})]},e))]},e)),Oe.length===0&&(0,q.jsx)(`p`,{className:`provider-settings-no-results`,role:`status`,children:w(`settingsNoResults`)})]}),(0,q.jsx)(`button`,{ref:E,type:`button`,className:`icon-button provider-settings-close`,"aria-label":w(`close`),disabled:me,title:w(me?`savingSettings`:`close`),onClick:()=>ke({kind:`close`}),children:(0,q.jsx)(je,{})})]}),(0,q.jsxs)(`div`,{className:`provider-settings-body`,children:[ge&&A!==`browser`&&(0,q.jsxs)(`div`,{className:`settings-plan-notice`,role:`status`,children:[(0,q.jsx)(`span`,{children:w(T?`setupPlanBusy`:`setupPlanBlocked`)}),(0,q.jsx)(Br,{label:w(`planModeExit`),variant:`secondary`,size:`sm`,isDisabled:T||h||!g,onClick:()=>void g?.()})]}),(0,q.jsxs)(`div`,{className:`provider-settings-main`,children:[(0,q.jsx)(`div`,{id:`settings-panel-configuration`,"aria-labelledby":`settings-tab-configuration`,"aria-label":w(`configurationSettings`),role:`tabpanel`,hidden:A!==`configuration`,children:A===`configuration`&&(0,q.jsx)(Aj,{catalog:ye,error:be,pending:_e||I&&L===`configuration`&&(!ve||ve.status===`pending`),preferencePending:ne,onConfigure:Te,onUpdatePreferences:U,onRefresh:xe,onOpenRuntimeStatus:()=>ke({kind:`runtime`})})}),(0,q.jsx)(`div`,{id:`settings-panel-appearance`,"aria-labelledby":`settings-tab-appearance`,"aria-label":w(`appearance`),role:`tabpanel`,hidden:A!==`appearance`,children:(0,q.jsx)(JW,{catalog:ye,theme:s,pending:ne,error:be,onRefresh:xe,onUpdatePreferences:U})}),(0,q.jsx)(`div`,{id:`settings-panel-archived-chats`,"aria-labelledby":`settings-tab-archived-chats`,"aria-label":w(`settingsArchivedChats`),role:`tabpanel`,hidden:A!==`archived-chats`,children:A===`archived-chats`&&(0,q.jsx)(YW,{workspaces:l,onRestore:u??(async()=>!1)})}),(0,q.jsx)(`div`,{id:`settings-panel-web-search`,"aria-labelledby":`settings-tab-web-search`,"aria-label":w(`webSearchSettings`),role:`tabpanel`,hidden:A!==`web-search`,children:A===`web-search`&&(0,q.jsx)(jj,{catalog:ye,error:be,pending:_e,onConfigure:Te,onRefresh:xe})}),(0,q.jsx)(`div`,{id:`settings-panel-browser`,"aria-labelledby":`settings-tab-browser`,"aria-label":w(`browserSettings`),role:`tabpanel`,hidden:A!==`browser`,children:A===`browser`&&(0,q.jsx)(Oj,{onConfigure:Te,setupPending:_e})}),(0,q.jsx)(`div`,{id:`settings-panel-general`,"aria-labelledby":`settings-tab-general`,"aria-label":w(`generalSettings`),role:`tabpanel`,hidden:A!==`general`,children:(0,q.jsx)(TW,{catalog:ye,error:be,currentModel:a,thinkingLevel:o,cwd:n,setupPending:P||T,preferencePending:ne||!ye,setupBusy:T,setupBlockedReason:p,setupBlocked:ge||h,onConfigure:Te,onUpdatePreferences:U,onOpenRuntimeStatus:()=>ke({kind:`runtime`}),onRefresh:xe})}),(0,q.jsx)(`section`,{id:`settings-panel-models`,"aria-labelledby":`settings-tab-models`,"aria-label":w(`modelSettings`),className:`settings-models`,role:`tabpanel`,hidden:A!==`models`,children:M&&(0,q.jsx)(oW,{sessionId:e,sessionPath:t,models:i,currentModel:a,busy:T,focusCredentials:r===`credentials`,onSaved:async()=>(xe(),b()),onSelectModel:x,onDraftChange:le,onSavingChange:ue},e)}),(0,q.jsx)(`div`,{id:`settings-panel-skills`,"aria-labelledby":`settings-tab-skills`,"aria-label":w(`skillsSettings`),role:`tabpanel`,hidden:A!==`skills`,children:(0,q.jsx)(jW,{catalog:ye,error:be,onRefresh:xe,setupPending:_e,onConfigure:Te,onReload:Ee},e)}),(0,q.jsx)(`div`,{id:`settings-panel-subagents`,"aria-labelledby":`settings-tab-subagents`,"aria-label":w(`subagentsSettings`),role:`tabpanel`,hidden:A!==`subagents`,children:(0,q.jsx)(MW,{catalog:ye,error:be,currentModel:a,models:i,activity:d?.subagents,setupPending:P||T,setupBlocked:ge||h,onConfigure:Te,onRefresh:xe})}),(0,q.jsx)(`div`,{id:`settings-panel-plugins`,"aria-labelledby":`settings-tab-plugins`,"aria-label":w(`pluginsSettings`),role:`tabpanel`,hidden:A!==`plugins`,children:(0,q.jsx)(FW,{catalog:ye,error:be,onRefresh:xe,setupPending:_e,onConfigure:Te,onReload:Ee},e)})]}),y,oe&&(0,q.jsx)(`div`,{className:`settings-global-error`,role:`alert`,children:oe}),(ne||ie)&&!oe&&!we&&(0,q.jsx)(`div`,{className:`settings-global-status`,role:`status`,children:w(ne?`savingSettings`:`settingsPreferencesSaved`)}),!ne&&(!ie||we)&&(I&&L===A||ve)&&!oe&&(0,q.jsxs)(`div`,{className:ve?.status===`failed`?`settings-global-error`:`settings-global-status`,role:ve?.status===`failed`?`alert`:`status`,children:[w(ve?(A===`skills`||A===`plugins`||A===`web-search`)&&[`unconfirmed`,`saved`,`unchanged`].includes(ve.status)?`resourceRequestFinished`:`setupOutcome_${ve.status}`:T?`setupRequestRunning`:A===`skills`||A===`plugins`||A===`web-search`?`resourceRequestSubmitted`:`setupRequestAccepted`),ve?.error&&(0,q.jsx)(`p`,{children:ve.error})]})]})]}),fe&&(0,q.jsx)(uj,{isOpen:!0,onOpenChange:e=>{e||pe(null)},title:w(`unsavedSettingsTitle`),description:w(`unsavedSettingsDetail`),cancelLabel:w(`keepEditing`),actionLabel:w(`discardAndContinue`),onAction:()=>ke(fe,!0)})]})}function $W({identity:e}){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;let n=t%6;return(0,q.jsx)(`span`,{className:`subagent-avatar tone-${n}`,"aria-hidden":`true`,children:(0,q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,children:[(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,q.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`}),(0,q.jsx)(`path`,{d:`M3 12h18M5 6.5c4 3 10 3 14 0M5 17.5c4-3 10-3 14 0`})]},`sphere`),(0,q.jsx)(`g`,{children:(0,q.jsx)(`path`,{d:`M4 20V4a16 16 0 0 1 16 16H4ZM4 4l16 16M4 9l11 11M4 14l6 6M10 5l-6 15M16 10L4 20`})},`fan`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`path`,{d:`m12 2 3 6 7-1-4 5 4 5-7-1-3 6-3-6-7 1 4-5-4-5 7 1Z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`})]},`rosette`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,q.jsx)(`path`,{d:`M3 12h18M12 3a9 9 0 0 0 0 18M12 6a6 6 0 0 0 0 12M12 9a3 3 0 0 0 0 6M12 3v18`})]},`arcs`),(0,q.jsx)(`g`,{children:(0,q.jsx)(`path`,{d:`m12 2 9 5v10l-9 5-9-5V7Zm0 0v20M3 7l18 10M21 7 3 17M3 7l9 5 9-5M3 17l9-5 9 5`})},`prism`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`path`,{d:`M12 12V2c6 0 10 4 10 10H12Zm0 0v10C6 22 2 18 2 12h10ZM12 12H2C2 6 6 2 12 2v10Zm0 0h10c0 6-4 10-10 10V12Z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2`,fill:`currentColor`})]},`windmill`)][n]})})}function eG(e,t,n,r){let i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(0),p=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(!n)return;let r=new AbortController;return p.current=r,c(!0),u(!1),i.sessionSources(e,t,r.signal).then(n=>{!r.signal.aborted&&n.sessionId===e&&n.path===t&&o(n)}).catch(()=>{r.signal.aborted||u(!0)}).finally(()=>{r.signal.aborted||(c(!1),p.current=null)}),()=>{r.abort(),p.current?.abort(),p.current=null}},[i,e,t,n,r,d]),{page:a?.sessionId===e&&a.path===t?a:null,loading:s,error:l,loadMore:async()=>{if(p.current||!a||a.nextOffset===void 0)return;let n=new AbortController;p.current=n,c(!0),u(!1);try{let r=await i.sessionSources(e,t,n.signal,a.nextOffset,a.revision);!n.signal.aborted&&r.sessionId===e&&r.path===t&&r.revision===a.revision&&o({...r,sources:[...a.sources,...r.sources]})}catch{n.signal.aborted||u(!0)}finally{n.signal.aborted||(c(!1),p.current=null)}},refresh:()=>f(e=>e+1)}}function tG({sessionId:e,path:t,source:n,thumbnail:r=!1,active:i=!0}){let{t:a}=W(),o=(0,K.useRef)(null),[s,c]=(0,K.useState)(!1),l=JSON.stringify([e,t,n.entryId,n.partIndex]),[u,d]=(0,K.useState)(null);(0,K.useEffect)(()=>{if(!r||!o.current||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(([e])=>c(!!e?.isIntersecting));return e.observe(o.current),()=>e.disconnect()},[r]),(0,K.useEffect)(()=>{if(!i||r&&!s){d(null);return}let a=new AbortController,o;return d({identity:l}),new de().sourceImage(e,t,n.entryId,n.partIndex,a.signal).then(e=>{if(a.signal.aborted)return;if(![`image/png`,`image/jpeg`,`image/gif`,`image/webp`].includes(e.mimeType)||e.data.length>xe)throw Error(`Invalid image`);let t=atob(e.data);if(t.length>10485760||btoa(t)!==e.data)throw Error(`Invalid image`);let n=Uint8Array.from(t,e=>e.charCodeAt(0));o=URL.createObjectURL(new Blob([n],{type:e.mimeType})),d({identity:l,url:o})}).catch(()=>{a.signal.aborted||d({identity:l,failed:!0})}),()=>{a.abort(),o&&URL.revokeObjectURL(o)}},[e,t,n.entryId,n.partIndex,l,i,r,s]);let f=i&&(!r||s)&&u?.identity===l?u:null;return(0,q.jsx)(`span`,{ref:o,className:`session-source-image`,"data-thumbnail":r||void 0,children:f?.url&&!f.failed?(0,q.jsx)(`img`,{src:f.url,draggable:!1,alt:r?``:n.name||a(`attachedImage`),onError:()=>d({identity:l,failed:!0})}):r?(0,q.jsx)(qs,{"aria-hidden":`true`}):(0,q.jsx)(`p`,{role:f?.failed?`alert`:`status`,children:a(f?.failed?`imagePreviewFailed`:`readingFile`)})})}function nG({source:e,sessionId:t,path:n,onOpen:r,thumbnail:i=!0,detailed:a=!1}){let{t:o}=W();return(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row session-source-row${a?` source-detail-row`:``}`,title:e.reference||e.name||o(`attachedImage`),onClick:r,children:[(0,q.jsx)(`span`,{className:`session-source-icon`,children:e.kind===`image`?i?(0,q.jsx)(tG,{sessionId:t,path:n,source:e,thumbnail:!0}):(0,q.jsx)(qs,{"aria-hidden":`true`}):(0,q.jsx)(Fs,{"aria-hidden":`true`})}),a?(0,q.jsxs)(`span`,{className:`session-source-copy`,children:[(0,q.jsx)(`strong`,{children:e.name||o(`attachedImage`)}),e.reference&&(0,q.jsx)(`span`,{className:`source-detail-reference`,children:e.reference}),(0,q.jsx)(`span`,{className:`source-detail-status`,children:o(`sourceAttached`)})]}):(0,q.jsx)(`span`,{children:e.name||o(`attachedImage`)})]})}function rG({sessionId:e,path:t,data:n,onSelect:r}){let{t:i}=W(),a=be(),o=(0,K.useRef)(null),s=(0,K.useRef)(a?.sources?.scroll??0);return(0,K.useLayoutEffect)(()=>{n.page?.sources.length&&o.current&&(o.current.scrollTop=s.current)},[n.page?.sources.length]),(0,q.jsxs)(`div`,{className:`session-sources-list`,ref:o,onScroll:e=>{s.current=e.currentTarget.scrollTop,a&&(a.sources={scroll:s.current})},children:[!n.loading&&!n.error&&!n.page?.sources.length&&(0,q.jsx)(`p`,{children:i(`sourcesEmpty`)}),n.page?.sources.map(n=>(0,q.jsx)(nG,{source:n,sessionId:e,path:t,onOpen:()=>r(n),detailed:!0},n.id)),n.error&&(0,q.jsxs)(`p`,{role:`alert`,children:[i(`sourcesFailed`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:n.refresh,children:i(`gitReviewRetry`)})]}),n.loading&&(0,q.jsx)(`p`,{role:`status`,children:i(`readingFile`)}),n.page?.nextOffset!==void 0&&(0,q.jsx)(`button`,{className:`sources-load-more`,type:`button`,disabled:n.loading,onClick:()=>void n.loadMore(),children:i(`sourcesLoadMore`)}),n.page?.truncated&&(0,q.jsx)(`p`,{children:i(`sourcesPartial`)})]})}function iG({sessionId:e,path:t,revision:n}){let{t:r}=W(),i=eG(e,t,!0,n),a=(0,K.useRef)(null);(0,K.useEffect)(()=>{let e=requestAnimationFrame(()=>a.current?.focus({preventScroll:!0}));return()=>cancelAnimationFrame(e)},[]);let o=(0,K.useContext)($E),[s,c]=(0,K.useState)(null),l=e=>{e?.kind===`file`&&e.reference?o?.open(e.reference,void 0,document.activeElement instanceof HTMLElement?document.activeElement:void 0):c(e)};return(0,q.jsxs)(`section`,{className:`session-sources-panel`,ref:a,tabIndex:-1,"aria-label":r(`sessionSources`),children:[(0,q.jsx)(rG,{sessionId:e,path:t,data:i,onSelect:l}),(0,q.jsx)(aG,{sessionId:e,path:t,open:!!s,source:s,data:i,onSelect:l,onClose:()=>c(null)})]})}function aG({sessionId:e,path:t,open:n,source:r,data:i,onSelect:a,onClose:o}){let{t:s}=W(),[c,l]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{r?.id,l(!1)},[e,t,r?.id]),(0,q.jsx)(Se,{isOpen:n,onOpenChange:e=>!e&&o(),purpose:`info`,width:800,maxHeight:`calc(100dvh - 32px)`,padding:0,"aria-label":s(`sessionSources`),children:n&&(0,q.jsxs)(`div`,{className:`session-sources-dialog draft-image-preview`,children:[(0,q.jsxs)(`header`,{children:[r&&i&&(0,q.jsx)(`button`,{type:`button`,"aria-label":s(`sourcesBack`),onClick:()=>a(null),children:(0,q.jsx)(Ko,{})}),(0,q.jsx)(`strong`,{title:r?.name,children:r?r.name||s(`attachedImage`):s(`sessionSources`)}),r&&(0,q.jsx)(`button`,{type:`button`,"aria-pressed":c,onClick:()=>l(e=>!e),children:s(c?`fitImage`:`originalImageSize`)}),(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,"aria-label":s(`close`),onClick:o,children:(0,q.jsx)(je,{})})]}),r?(0,q.jsx)(lO,{original:c,children:(0,q.jsx)(tG,{sessionId:e,path:t,source:r,active:n},JSON.stringify([e,t,r.id]))},JSON.stringify([e,t,r.id])):i?(0,q.jsx)(rG,{sessionId:e,path:t,data:i,onSelect:a}):null]})})}function oG({sessionId:e,workspace:t,agents:n,omitted:r,omittedWorkflows:i=0,review:a,onSubagents:o,onReview:s,onSources:c,sessionPath:l,revision:u,onAddSources:d,reviewLoading:f=!1,reviewError:p}){let{t:m}=W(),[h,g]=(0,K.useState)(!1),_=(0,K.useRef)(null),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!0),S=(0,K.useId)(),[C,w]=(0,K.useState)(null),T=eG(e,l??``,!!(l&&(h||v)),u),E=(0,K.useContext)($E),D=a?.ok?a.snapshot.totals:void 0,O=e=>{!e&&c?(y(!1),w(null),P(c)):e?.kind===`file`&&e.reference?(y(!1),P(()=>E?.open(e.reference,void 0,_.current??void 0))):P(()=>{w(e),y(!0)})},k=n.filter(e=>e.state===`running`),A=n.filter(e=>e.state===`done`),j=n.length-k.length-A.length,M=[...k,...n.filter(e=>e.state!==`running`)].slice(0,4),N=[k.length?m(`subagentSummaryRunning`,{count:k.length}):``,A.length?m(`subagentSummaryDone`,{count:A.length}):``,j?m(`subagentSummaryOther`,{count:j}):``].filter(Boolean).join(` · `)||m(`subagentNoneYet`),P=e=>{g(!1),_.current?.focus(),e()};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Zu,{isOpen:h,onOpenChange:g,placement:`below`,alignment:`end`,width:`min(340px, calc(100vw - 24px))`,label:m(`sessionOverview`),closeButtonLabel:m(`close`),isModal:!1,content:(0,q.jsxs)(`div`,{className:`session-overview`,children:[(0,q.jsx)(`p`,{className:`session-overview-title`,children:t}),(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row`,title:m(`sessionOverviewChanges`),onClick:()=>P(s),children:[(0,q.jsx)(Ms,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:m(`overviewChanges`)}),D&&!p?(0,q.jsxs)(`span`,{className:`session-overview-diff`,title:m(D.complete?`overviewLineTotals`:`overviewPartialTotals`),children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,D.additions.toLocaleString()]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,D.deletions.toLocaleString()]}),!D.complete&&(0,q.jsx)(`span`,{className:`session-overview-note`,children:m(`gitReviewPartialLabel`)})]}):(0,q.jsx)(`span`,{className:`session-overview-note`,children:m(f?`overviewCounting`:a?.ok?`overviewCountsUnknown`:`overviewReviewUnavailable`)})]}),(0,q.jsxs)(`div`,{className:`session-overview-section`,children:[(0,q.jsx)(`p`,{children:m(`subagentDetails`)}),(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row session-overview-agents`,onClick:()=>P(o),"aria-label":`${m(`subagentDetails`)}: ${N}`,children:[M.length>0&&(0,q.jsx)(`span`,{className:`subagent-avatar-stack`,children:M.map(t=>(0,q.jsx)($W,{identity:`${e}:${t.id}`},t.id))}),(0,q.jsx)(`span`,{className:`session-overview-agent-counts`,children:N.split(` · `).map(e=>(0,q.jsx)(`span`,{children:e},e))}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),r>0&&(0,q.jsx)(`small`,{children:m(`subagentListTruncated`,{count:r})}),i>0&&(0,q.jsx)(`small`,{children:m(`subagentWorkflowsTruncated`,{count:i})})]}),l&&(0,q.jsxs)(`div`,{className:`session-overview-section`,children:[(0,q.jsxs)(`div`,{className:`session-overview-section-heading`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`session-sources-toggle`,"aria-expanded":b,"aria-controls":S,onClick:()=>x(e=>!e),children:[(0,q.jsx)(`span`,{children:m(`sessionSources`)}),T.page&&(T.page.total!==void 0||T.page.nextOffset===void 0)&&(0,q.jsxs)(`span`,{children:[`· `,T.page.total??T.page.sources.length,T.page.truncated?`+`:``]}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),d&&(0,q.jsx)(V,{content:m(`sourcesAdd`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":m(`sourcesAdd`),onClick:()=>P(d),children:(0,q.jsx)(Ae,{})})})]}),(0,q.jsxs)(`div`,{id:S,hidden:!b,children:[T.page?.sources.slice(0,3).map(t=>(0,q.jsx)(nG,{source:t,sessionId:e,path:l,onOpen:()=>O(t)},t.id)),T.error?(0,q.jsxs)(`p`,{role:`alert`,children:[m(`sourcesFailed`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:T.refresh,children:m(`gitReviewRetry`)})]}):!T.page?.sources.length&&(0,q.jsx)(`p`,{children:m(T.loading?`readingFile`:`sourcesEmpty`)}),!!(T.page&&(T.page.sources.length>3||T.page.nextOffset!==void 0))&&(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row sources-view-all`,onClick:()=>O(null),children:[(0,q.jsx)(Qs,{}),(0,q.jsx)(`span`,{children:m(`sourcesViewAll`)}),(0,q.jsx)(os,{})]})]})]})]}),children:e=>(0,q.jsx)(V,{content:m(`sessionOverview`),placement:`below`,children:(0,q.jsx)(`button`,{...e,ref:t=>{e.ref(t),_.current=t},type:`button`,className:`task-tools-trigger`,"aria-label":m(`sessionOverview`),children:(0,q.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,q.jsx)(`circle`,{cx:`5.5`,cy:`7`,r:`2.8`}),(0,q.jsx)(`circle`,{cx:`5.5`,cy:`17`,r:`2.8`}),(0,q.jsx)(`path`,{d:`M12 7h8M12 17h8`})]})})})}),l&&(0,q.jsx)(aG,{sessionId:e,path:l,open:v,source:C,data:T,onSelect:O,onClose:()=>{y(!1),w(null)}})]})}function sG(e){return e<1e3?Math.round(e).toString():e<1e4?`${(e/1e3).toFixed(1)}k`:e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1)}M`}function cG(e){if(!e)return;let{input:t,output:n,cacheRead:r,cacheWrite:i}=e;if(t===0&&n===0&&r===0&&i===0)return;let a=t+r+i,o=r>0?` (${sG(r)} cached)`:``;return`${sG(a)} in${o} · ${sG(n)} out`}function lG(e,t,n){if([`session_start`,`session_switched`,`session_created`].includes(t))return e.length===0?e:[];if([`agent_settled`,`turn_settled`].includes(t))return e.some(e=>e.state===`running`)?e.map(e=>e.state===`running`?{...e,state:`unknown`}:e):e;if(!t.startsWith(`tool_execution_`))return e;let r=n.toolCallId;if(typeof r!=`string`||r.length>500)return e;let i=e.find(e=>e.call.id===r);if(i&&i.state!==`running`&&(i.state!==`unknown`||t!==`tool_execution_end`))return e;let a=dd(n.call),o=a.type===`toolCall`&&typeof a.name==`string`&&typeof a.arguments==`string`?a:i?.call;if(!o||o.evidenceTruncated&&o.id?.includes(`[truncated]`))return e;let s=dd(n.result),c=typeof s.content==`string`?s:i?.result,l=typeof n.parentToolCallId==`string`&&n.parentToolCallId.length<=500?n.parentToolCallId:i?.parentToolCallId,u={call:o,result:c,...l?{parentToolCallId:l}:{},state:t===`tool_execution_end`?n.isError===!0?`failed`:`returned`:`running`},d=(i?e.map(e=>e.call.id===r?u:e):[...e,u]).slice(-32);for(;d.length>0&&new TextEncoder().encode(JSON.stringify(d)).byteLength>524288;)d.shift();return d}var uG={en:{translation:{quitOpenPI:`Quit OpenPI`,quittingOpenPI:`Quitting…`,quitConfirmHelp:`Quit this OpenPI Web application? All running tasks in this Web application will stop. Conversations are saved and will be available when you restart.`,quitTabHelp:`Closing this browser tab alone leaves OpenPI and its tasks running in the background.`,quitAccepted:`OpenPI is shutting down`,quitAcceptedHelp:`The quit request was accepted. Wait for the terminal to confirm that OpenPI has stopped, then you can close this tab.`,quitRestartHelp:`To restart, run openpi web in a terminal, or /web in Pi, then open the address it displays. Refreshing this page does not restart OpenPI.`,quitFailed:`Could not confirm shutdown. Check the terminal before trying again. You can also stop OpenPI with Ctrl+C in its terminal.`,promptPending:`Processing your request…`,commandFeedbackTruncated:`This is a limited command preview. Narrow the query or run it in the TUI for the full output.`,planMode_inactive:`Normal mode`,planMode_planning:`Planning · writes blocked`,planMode_ready:`Plan ready · awaiting review`,planMode_invalid:`Plan state invalid · writes blocked`,planModeEnter:`Plan`,promptPlanMessage:`This conversation uses Plan mode · discuss the plan; no implementation yet`,planModeUnconfirmed:`Could not confirm Plan mode. Refresh before continuing.`,planModeExit:`Exit planning`,planModeImplement:`Prepare implementation prompt`,planImplementationReplaceDraft:`Preparing this plan will replace the current draft and turn off Plan mode. The prompt will not be sent. Continue?`,commandSupport_plan:`Planning and same-session implementation prompts are available. Starting a fresh implementation session still requires the TUI.`,commandSupport_setup:`Configuration uses the active model; questions are answered in Web.`,handoffWaiting:`Manual action`,handoffDone:`Done`,handoffUnable:`Unable to complete`,handoffDoneHelp:`I performed the action. The agent still needs to verify it.`,handoffUnableHelp:`I could not finish. I can add a note about the blocker.`,handoffReview:`Review status`,handoffSubmit:`Submit status`,handoffSignal:`Expected result:`,handoffVerify:`Reporting Done lets the agent continue and verify; it is not proof of success.`,planCardLabel:`Development plan`,planCardReady:`Plan ready`,planCardResult:`Plan result`,planCardNotApproval:`This step produced a plan. It did not approve or start implementation.`,planCardCollapse:`Collapse`,planCardExpand:`Expand`,planCardCopy:`Copy plan`,planCardCopyPreview:`Copy visible preview`,planCardTruncated:`Only a bounded preview is displayed.`,planCardLoadFull:`Load full plan`,planCardLoadingFull:`Loading plan...`,planCardLoadFailed:`Could not load the full plan. Retry`,planCardEvidence:`Tool result · plan_ready`,questionWaiting:`Question`,questionPreview:`View preview`,questionSkip:`Skip`,questionProgress:`{{current}} of {{total}}`,questionReview:`Review answers`,questionReviewTitle:`Ready to send?`,questionReviewHelp:`Review your choices. Nothing is sent until you submit.`,questionEdit:`Edit answer: {{question}}`,questionDismiss:`Dismiss questions without answering`,questionCustom:`Or write your own reply`,questionCustomHelp:`Or leave it blank to ask for a clearer question.`,questionYourAnswer:`Your answer`,questionCustomPlaceholder:`Describe what you have in mind…`,questionNotes:`Additional context (optional)`,questionNotesPlaceholder:`Add a constraint or clarify your choice…`,questionRephrase:`Ask for a clearer or smaller question`,questionBack:`Back`,questionNext:`Next question`,questionSubmit:`Submit answers`,questionSubmitting:`Sending…`,questionRetry:`Check submission`,questionUncertain:`We could not confirm delivery. Your submitted answers are kept here. Check submission to recover the result without sending them twice.`,questionDisconnected:`Reconnecting… Your choices stay here; submitting is paused.`,questionLimit:`Keep each answer or note within {{count}} UTF-8 bytes.`,questionLoadFailed:`Could not check for questions awaiting your answer.`,questionDraftLimit:`Question drafts are full. Shorten or clear an existing answer before adding more text.`,questionRetryLoad:`Try again`,questionCloseReceipt:`Close question status`,questionState_dismissed:`Questions dismissed. No answers were submitted.`,questionState_cancelled:`Questions cancelled. No answers were submitted.`,questionState_expired:`Questions expired. No answers were submitted.`,questionState_stale:`This request is no longer active. Check the conversation for its result.`,conversationView:`Conversation view`,jumpToLatest:`Jump to latest`,historyLoading:`Loading history…`,historyOmitted:`{{count}} earlier entries · Scroll up to load automatically`,historyChanged:`The Session branch changed. History has been reset to the current branch.`,historyUnavailable:`Could not load history. Please retry.`,historyValidationUnavailable:`Could not verify the conversation history. Please retry.`,historyVerifying:`Checking conversation history…`,messageLoadFull:`Load full message`,messageLoadMore:`Load more`,messageLoadingFull:`Loading message…`,messageLoadFailed:`Could not load this message. Retry`,filePreview:`File preview`,changeEvidence:`Changes`,changeEvidenceScope:`Read-only Git snapshot of changes since this session started.`,turnLabel:`Turn {{number}}`,turnState_running:`Running`,turnState_complete:`Completed`,turnState_failed:`Failed`,turnState_interrupted:`Interrupted`,turnState_waiting:`Waiting for response`,turnState_forked:`Forked · Ready to continue`,turnChanges_one:`{{count}} file changed during this turn`,turnChanges_other:`{{count}} files changed during this turn`,turnChangesPartial:`At least {{count}} files changed during this turn`,turnChangesIncomplete:`This turn's change record is incomplete.`,turnChangesMore:`Show {{count}} more files`,turnChangesLess:`Show fewer files`,turnChangesReview:`Review turn changes`,turnChangesReviewButton:`Review`,turnChangesBack:`Back to turn changes`,turnChangesLoading:`Loading this turn's changes…`,turnChangesUnavailable:`This turn's saved diff is unavailable.`,messageCopyRequiresFull:`Load the full message before copying.`,filesChanged_one:`{{count}} file changed`,filesChanged_other:`{{count}} files changed`,reviewChanges:`Review changes`,workspaceChanges:`Workspace changes`,overviewChanges:`Changes`,overviewLineTotals:`Text lines added and removed across the current Git comparison`,overviewPartialTotals:`Known line counts only; some files could not be counted. Open Changes for details.`,overviewCounting:`Counting…`,overviewCountsUnknown:`Counts unavailable`,overviewReviewUnavailable:`Unavailable`,sessionSources:`Sources`,sourcesAdd:`Add source`,sourcesDescription:`Browse this conversation's attached images and files`,sourceAttached:`Attached to this conversation`,sourcesEmpty:`No sources yet`,sourcesFailed:`Could not load sources.`,sourcesViewAll:`View all`,sourcesLoadMore:`Load more sources`,sourcesBack:`Back to sources`,sourcesPartial:`This list has reached its display limit. Earlier sources remain in the conversation.`,turnChangesScope:`Saved workspace changes during this turn`,turnEdits_one:`Edited {{count}} file`,turnEdits_other:`Edited {{count}} files`,turnEditsPartial:`Recorded edits to {{count}} files`,turnEditsScope:`This turn's recorded file-tool writes · saved; shell and external edits are not included`,turnEditStatsUnknown:`Line counts unavailable`,turnEditReason_before_unavailable:`The write completed, but previous contents were not authorized for reading. A before/after diff is unavailable.`,turnEditReason_content_limit:`The write completed. Content exceeds the saved comparison limit, so exact line counts are unavailable.`,turnEditReason_concurrent_change:`The file changed between recorded operations. A reliable net diff for this turn is unavailable.`,gitReviewLoadedCount:`{{count}} files loaded`,gitReviewPartialLabel:`Partial`,gitReviewSearch:`Search file paths`,gitReviewExpand:`Expand review`,gitReviewSearchLoaded:`Search loaded files`,gitReviewMarkViewed:`Mark {{path}} as viewed`,gitReviewMarkCurrentViewed:`Mark current file {{path}} as viewed`,gitReviewViewedLabel:`Viewed`,gitReviewViewedProgress:`Viewed {{viewed}} / {{loaded}} loaded files`,gitReviewViewedLimit:`Up to {{count}} viewed marks are remembered for this comparison.`,gitReviewNoMatch:`No matching files.`,gitReviewNoLoadedMatch:`No matches in the loaded files.`,gitReviewLoadNext:`Load the next files`,gitReviewChanged:`The workspace changed. Refresh the list before loading more.`,gitReviewNewVersion:`New changes are available. You are reading the previous version.`,gitReviewShowLatest:`Show latest diff`,gitReviewBinary:`No text diff is available for this binary file.`,gitReviewBinaryShort:`Binary`,gitReviewPendingStats:`Not loaded`,gitReviewComparison:`{{current}} compared with {{base}}`,gitReviewWorkingTree:`Working tree compared with HEAD`,gitReviewSessionSnapshot:`Changes since this session started`,gitReviewDetached:`Detached HEAD`,gitReviewLoading:`Reading Git changes…`,gitReviewRetry:`Retry`,gitReviewRefresh:`Refresh changes`,gitReviewOlderResult:`Showing the previous result.`,gitReviewNotRepository:`This workspace is not a Git repository.`,gitReviewUnborn:`This repository has no readable HEAD yet.`,gitReviewFailed:`Git changes could not be read.`,gitReviewTruncated:`The change snapshot reached its file or diff size limit.`,gitReviewEmpty:`No changes in this comparison.`,gitReviewHiddenLines:`{{count}} more diff lines hidden.`,gitReviewDiffTruncated:`This file's diff was not loaded because the snapshot reached its size limit.`,gitReviewShowMore:`Show {{count}} more files`,gitReviewBackToFiles:`Back to changed files`,gitReviewFilePreview:`Diff for {{file}}`,gitReviewNoDiff:`No text diff is available for this file.`,changeDiff:`Change diff`,diffViewMode:`Diff view`,diffUnified:`Unified`,diffSplit:`Side by side`,diffBefore:`Before`,diffAfter:`After`,diffView:`Diff`,gitFileStatus_added:`Added`,gitFileStatus_modified:`Modified`,gitFileStatus_deleted:`Deleted`,gitFileStatus_renamed:`Renamed`,gitFileStatus_copied:`Copied`,gitFileStatus_untracked:`Untracked`,gitFileStatus_unknown:`Changed`,closePreview:`Close preview`,imageZoom:`Image zoom`,imageZoomHelp:`Zoom is relative to Fit. Use Ctrl + wheel to zoom, then drag to pan.`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,previousImage:`Previous image`,nextImage:`Next image`,imagePosition:`Image {{current}} of {{total}}`,artifactReadOnly:`Read-only`,artifactReferenceUnavailable:`File preview is unavailable in this view: {{path}}`,artifactSession:`Session {{sessionId}}`,copyFilePath:`Copy file path`,filePathCopied:`File path copied`,refreshFile:`Refresh file`,downloadFile:`Download file`,downloadingFile:`Downloading…`,artifactOlderPreview:`Showing an older preview. `,readingFile:`Reading file…`,artifactVersion:`Version`,artifactBytes:`{{count}} bytes`,artifactPreviewTruncated:`Preview truncated. Download the file for the complete content.`,artifactUnsupported:`This file type cannot be previewed. Use Download.`,filesLargeMarkdownSource:`This Markdown preview is large, so it is shown as source to keep scrolling responsive. All loaded text is included.`,chatView:`Chat`,trajectory:`Trajectory`,trajectoryScope:`Recorded Session messages in order, not execution durations or the complete model request.`,trajectoryRunning:`Work is active. This view updates as saved records arrive; in-flight text is available in Chat.`,trajectoryTruncated:`Loaded history is partial: {{entries}} entries omitted, {{parts}} parts omitted, {{messages}} messages truncated.`,trajectoryEmpty:`No saved records yet.`,trajectoryOrder:`Record order`,trajectoryOverview:`Overview`,trajectorySequenceHint:`Record order · widths are not elapsed time`,trajectoryClearRange:`Clear selection`,trajectoryContextLane:`Context`,trajectoryModelLane:`Model`,trajectoryToolLane:`Tools`,trajectorySelectRecord:`Select record {{number}}: {{name}}`,trajectoryTimingTab:`Timing`,trajectoryUsageTab:`Usage`,trajectoryDurationLabel:`Duration`,trajectoryTimingSource:`Source`,trajectoryTimingUnknown:`No execution duration was recorded. Record timestamps are not operation start times.`,trajectoryTimingNative:`Pi nested tool execution`,trajectoryTTFT:`Time to first output`,trajectoryGenerationTime:`Generation time`,trajectoryThroughput:`Output tokens / second`,trajectoryNotRecorded:`Not recorded`,trajectoryUsageUnknown:`This response has no reported token usage in the loaded records.`,trajectoryUsage_input:`Uncached input`,trajectoryUsage_cacheRead:`Cache read`,trajectoryUsage_cacheWrite:`Cache write`,trajectoryUsage_output:`Output`,trajectoryProvider:`Provider`,trajectoryModel:`Model`,trajectoryCode:`Code`,trajectoryWrap:`Wrap lines`,trajectoryCopy:`Copy source`,trajectoryCopied:`Copied`,trajectoryRawArguments:`Original JSON`,trajectoryFoldTurns:`Turns`,trajectoryFoldCalls:`Calls`,trajectoryMetrics:`Loaded execution summary`,trajectoryRequestCount:`{{count}} model responses`,trajectoryToolCount:`{{count}} tool calls`,trajectoryModelResponses:`Model responses`,trajectoryToolCalls:`Tool calls`,trajectoryLastTurn:`Latest recorded turn`,trajectoryEventColumn:`Event`,trajectoryContentColumn:`Content`,trajectoryTurn:`Turn {{number}}`,trajectoryLoadHistory:`Load earlier history`,trajectoryLatestRecords:`Jump to latest records`,trajectoryHistoryLoading:`Loading history…`,trajectoryNestedOutputMissing:`Pi recorded this nested call's status, but did not persist its result body. The outer script's output is separate.`,trajectoryRecordCount:`{{count}} records`,trajectoryMatches:`{{count}} matches`,trajectorySearch:`Search loaded records`,trajectoryNoMatches:`No matching records.`,trajectoryEarlierGroup:`Earlier context`,trajectoryEventCount:`{{count}} Session changes`,trajectorySummary:`Overview`,trajectoryInputTab:`Input`,trajectoryResultTab:`Result`,trajectoryConversationGroup:`Conversation`,trajectoryReasoningTitle:`Thinking`,trajectoryRecordNumber:`Record {{number}}`,trajectoryRecordInfo:`Record information`,trajectoryRecordId:`Record ID`,trajectoryCallId:`Tool call ID`,trajectoryEventType:`Event type`,trajectoryEvent_model_change:`Model changed`,trajectoryEvent_thinking_level_change:`Thinking level changed`,trajectoryEvent_compaction:`Context compacted`,trajectoryEvent_session_info:`Session information updated`,trajectoryEvent_custom:`Session record`,trajectoryEarlier:`Show earlier records ({{count}} remaining in loaded history)`,trajectoryDetails:`Record details`,trajectoryRecordedAt:`Record timestamp`,trajectoryEvidenceTruncated:`This evidence was truncated in the Session projection.`,trajectoryArguments:`Tool arguments`,trajectoryRecordedContent:`Recorded content`,trajectoryThinking:`Recorded model reasoning`,trajectoryOutput:`Tool result`,trajectoryMissingResult:`No unambiguous result is included in the loaded records. This does not imply the tool is still running.`,trajectoryStructured:`Structured result`,trajectoryEventOnly:`Only this event’s type and timestamp are available.`,trajectory_user:`User message`,trajectory_assistant:`Assistant`,trajectory_call:`Tool call`,trajectory_result:`Unpaired result`,trajectory_event:`Session event`,trajectoryRole_user:`User`,trajectoryRole_assistant:`Assistant`,trajectoryRole_call:`Tool`,trajectoryRole_result:`Result`,trajectoryRole_event:`Event`,trajectory_returned:`Tool returned a result.`,trajectory_error:`Tool returned an error`,trajectory_unknown:`Outcome not established`,runtimeStatus:`Runtime status`,runtimeIdentity:`OpenPI runtime information`,runtimeIdentityHint:`Backend information was captured at startup. It does not track later disk changes or Session reloads, and is not proof of every loaded module. Frontend identity describes this page build.`,runtimeIdentityFailed:`Could not read backend runtime information. Try again.`,runtimeBackendVersion:`Backend package version`,runtimePackageRoot:`Backend package directory`,runtimeStartedAt:`Process started`,runtimeGitRevision:`Git revision at startup`,runtimeGitState:`Working tree at startup`,runtimeGitDirty:`Local changes present`,runtimeGitClean:`Clean`,runtimeFrontendVersion:`Page package version`,runtimeFrontendBuild:`Page build ID`,runtimeStartupBuild:`Page build ID recorded at startup`,runtimeDevelopmentBuild:`Development server (no production build ID)`,runtimeBuildMismatch:`This page build differs from the build recorded when the backend started. Refresh the page or restart the service, then check again.`,refreshStatus:`Refresh status`,openTools:`Open tools`,openToolsUnavailable:`Select a chat to open tools`,sideConversation:`Side conversation`,sideConversationDescription:`Ask a focused question in a separate Pi session without interrupting the main task.`,workbarChangesDescription:`Inspect the current Git branch and working tree.`,terminal:`Terminal`,renameTerminal:`Rename terminal`,terminalName:`Terminal name`,workbarTerminalDescription:`Open an interactive shell for the current workspace.`,restartTerminal:`Restart terminal`,reconnectTerminal:`Reconnect terminal`,restartTerminalTitle:`Restart this terminal?`,restartTerminalDetail:`The current terminal will be closed. Running processes may be interrupted.`,terminalReconnecting:`Reconnecting terminal...`,terminalScrollToBottom:`Scroll to bottom`,terminalOutputResynced:`Terminal output resynchronized.`,terminalRestarting:`Restarting terminal...`,terminalConnecting:`Starting terminal…`,terminalExited:`Terminal exited.`,terminalExitCode:`Terminal exited with code {{code}}.`,terminalDisconnected:`Terminal connection ended unexpectedly.`,terminalError:`Terminal unavailable.`,terminalLoadError:`The terminal interface could not load. Refresh the page to try again.`,reloadPage:`Refresh page`,browser:`Browser`,sessionFileRecords:`Session file records`,gitReviewSource:`Changes`,gitReviewBaseBranch:`Compare against branch`,gitReviewChooseBase:`Choose comparison branch`,gitReviewSearchBranches:`Search branches`,gitReviewLocalBranch:`Local branch`,gitReviewRemoteBranch:`Remote branch`,gitReviewBranchesTruncated:`Showing a bounded list of branches. Some branches are omitted.`,gitReviewNoMatchingBranches:`No matching branches.`,gitReviewBaseUnavailable:`No default comparison branch is available. Choose a branch to review committed changes.`,gitReviewBaseInvalid:`The selected comparison branch is unavailable. Choose another branch.`,gitReviewUnstaged:`Unstaged changes`,gitReviewStaged:`Staged changes`,gitReviewBranch:`Branch changes`,gitReviewFileMissing:`This file no longer has changes in this view. Refresh the file list.`,artifactExternalAccess:`This file is in another working directory. You can authorize read-only access to this file for this session; other files remain inaccessible.`,artifactAuthorizeFile:`Open this file read-only`,sideConversationPending:`Preparing side conversation…`,resizeSidebar:`Resize sidebar`,resizePanes:`Resize panes`,resizeWorkbar:`Resize workbar`,browserPasteTooLarge:`Paste at most {{count}} characters at a time.`,browserInputTooLarge:`Enter at most {{count}} characters at a time.`,browserInputTargetChanged:`The input target changed or could not be confirmed. An input operation was not executed.`,workbarBrowserDescription:`Open and interact with a page inside the OpenPI workbar.`,browserReady:`Enter an address to start browsing`,browserStarting:`Starting the embedded browser…`,browserOpened:`Opened in the embedded browser`,browserOpenAgain:`Open again`,browserOpenFailed:`The embedded browser is unavailable.`,browserBack:`Back`,browserForward:`Forward`,browserReload:`Reload`,browserTabs:`Browser tabs`,browserNewTab:`New tab`,browserAddTab:`New browser tab`,browserCloseTab:`Close {{title}}`,browserTabLimit:`Up to {{count}} browser tabs`,browserPageTitle:`Web page: {{address}}`,browserEnteredAddress:`Last address opened from this toolbar`,browserAddressNotAllowed:`Enter an HTTP(S) address without embedded credentials, outside this application's origin.`,browserLocationUnknown:`This page navigated. Its new address is unavailable. Reload returns to the address you entered.`,browserDirectDescription:`Browse pages directly. Sites that refuse embedding can be opened in your external browser.`,browserDirectHint:`The address records toolbar navigation only. Page popups open in your external browser. Blank page? Use Open in external browser.`,browserEnhancedHint:`Browser enhancement is on: addresses sync and ordinary popup links open in these tabs. Some site policies, login popups and cross-site history still require an external browser.`,files:`Files`,filesExplorer:`Workspace files`,filesSearch:`Filter files…`,refreshFiles:`Refresh files`,filesWorkspaceActions:`Workspace file actions`,filesCreateMenu:`New`,filesImportMenu:`Import`,filesMoreMenu:`More`,filesNewFile:`New file`,filesNewDirectory:`New folder`,filesImport:`Import files`,filesImportFolder:`Import folder`,filesImportFolderChoose:`Choose a folder to import`,filesImportFolderLimit:`Import up to 2,000 files and folders at a time, with at most 64 nested levels.`,filesSelectMultiple:`Select multiple files`,filesSelectItem:`Select {{name}}`,filesSelectedCount:`{{count}} selected`,filesRename:`Rename`,filesNewName:`New name`,filesMove:`Move`,filesMoveDestination:`Destination folder (workspace relative path)`,filesTrashAction:`Move to trash`,filesTrash:`Workspace trash`,filesTrashDetail:`Removed files stay in this workspace and can be restored. Existing names are preserved.`,filesTrashEmpty:`No removed files`,filesTrashUnavailable:`{{count}} entries could not be verified. Their contents remain in .openpi-trash; automatic restore is unavailable.`,filesRestore:`Restore`,filesRestoreItem:`Restore {{name}}`,filesUndoTrash:`Undo removal`,filesOrganizationResults:`File operation results`,filesOperationDone:`Done`,filesRefreshBeforeOrganizing:`Refresh the file tree before organizing this item.`,filesImportChoose:`Choose files to import`,filesTargetDirectory:`Destination`,filesWorkspaceRoot:`Workspace root`,filesFileName:`File name`,filesDirectoryName:`Folder name`,filesCreate:`Create`,filesCreating:`Creating…`,filesCreated:`Created: {{path}}`,filesNameInvalid:`Enter one file or folder name without path separators.`,filesNameExists:`This name already exists. Choose a different name; the existing file was preserved.`,filesMutationFailed:`Could not write this file. Your input is preserved.`,filesWriteUnavailable:`Switch to this session to write workspace files.`,filesImportLimit:`Each file can be up to 50 MiB. Existing names are never overwritten.`,filesImportTooLarge:`This file exceeds the 50 MiB import limit.`,filesImportDirectoryUnsupported:`Folders cannot be imported. Choose the files inside the folder.`,filesImportResults:`File import results`,filesImportPending:`Waiting to import`,filesImporting:`Importing…`,filesImported:`Saved to the workspace`,filesImportedNoPreview:`Saved. Preview supports up to 20 MiB; copy the path to use this file in chat.`,filesClearImported:`Clear completed imports`,filesRetryImport:`Retry import`,filesPathActions:`Path actions for {{name}}`,filesCopyRelativePath:`Copy relative path`,filesCopyAbsolutePath:`Copy absolute path`,filesPathCopied:`Copied path: {{path}}`,filesReadFailed:`Unable to read files.`,filesRetryRead:`Try again`,filesErrorDetails:`Error details`,filesReadFailedDetail:`The file list could not be loaded. Check your connection and try again.`,filesReadDenied:`This session's workspace is currently unavailable or cannot be verified. Check the session and workspace, then try again.`,filesSymlink:`Symbolic link — not followed by the file browser`,filesTruncated:`The result is incomplete. Refine your search.`,filesNoMatches:`No matching files`,filesEmpty:`This folder is empty`,filesChoose:`Choose a file to preview`,filesChooseDetail:`Browse your workspace on the right. Files open here, keeping the explorer in place.`,filesHideTree:`Hide file tree`,filesShowTree:`Show file tree`,filesPreview:`Preview`,filesSource:`View source`,filesEdit:`Edit`,filesMode:`File view`,filesEditor:`File editor`,filesSave:`Save file`,filesSaving:`Saving…`,filesSaved:`Saved`,filesUnsaved:`Unsaved changes · draft kept in this window`,filesDiscard:`Discard draft`,filesDiscardConfirm:`Discard your unsaved changes to this file?`,filesSaveConflict:`The file changed on disk. Your draft is preserved. Refresh to inspect the current version, then reconcile your changes before saving.`,filesSaveFailed:`Could not save. Your draft is preserved; check the file and retry.`,filesEditLoadFirst:`Continue reading the complete file before editing.`,filesEditUnavailable:`Editing supports workspace UTF-8 text files up to 1 MiB. At most 16 unsaved drafts can be kept.`,filesOutline:`Document outline`,filesDiskVersion:`Inspect current disk version`,filesReconcile:`Reviewed · continue editing my draft against this version`,filesTable:`Table preview`,filesRow:`Row`,filesSheets:`Worksheets`,filesTableTruncated:`Showing a partial table preview. Download the original file for complete content.`,filesOfficeLayout:`Document content preview; pagination and typography may differ from Office.`,filesSlidesLayout:`Slide text and images; themes, charts and animations may differ from PowerPoint.`,filesPreviousPage:`Previous page`,filesNextPage:`Next page`,filesZoomOut:`Zoom out`,filesZoomIn:`Zoom in`,filesZoomReset:`Reset zoom`,filesPdfPage:`Page {{page}}`,filesDocumentLimit:`This document exceeds the preview limit. Download it to open locally.`,filesPreviewFailed:`Unable to preview this file. You can still download it.`,filesDiagram:`Mermaid diagram`,filesDiagramLoadError:`Unable to load diagram preview. The source is shown below. Refresh the page to try again.`,filesExpandDiagram:`Expand diagram`,filesFitImage:`Fit`,filesOriginalImage:`Original size`,filesLoadMore:`Load more`,filesLoaded:`{{count}} items loaded`,filesReadMore:`Continue reading`,filesContentChanged:`The file changed. Refresh when ready; your current reading position is preserved.`,workbarFilesDescription:`Browse workspace files with an inline preview and file tree.`,backToSideConversations:`Back to side conversations`,continueSideConversation:`Send a follow-up…`,startSideConversation:`Ask a side question…`,sideConversationModelInherited:`New side conversations use the main conversation’s model and thinking level.`,sideConversationModelFixed:`This is the model used by this side conversation.`,stop:`Stop`,start:`Start`,browserAddress:`Browser address`,browserGo:`Open address`,openExternalBrowser:`Open in external browser`,invalidBrowserAddress:`Enter a valid HTTP or HTTPS address.`,addImages:`Add images`,addFiles:`Add files`,fileAttachments:`File attachments`,previewFileAttachment:`Preview file`,fileAttachmentDescription:`Documents, spreadsheets, PDFs, text, code, and other files`,fileAttachmentCount:`Attach up to {{count}} items.`,fileAttachmentTooLarge:`Files must total 50 MB or less.`,fileAttachmentReadFailed:`Could not read this file. Check the format or whether it is password protected.`,fileAttachmentTextReady:`Text ready`,fileAttachmentTextTruncated:`Partial text · original retained`,fileAttachmentOriginalReady:`Original file ready`,fileAttachmentExtractionFailed:`Text unavailable · original retained`,fileAttachmentEncodingUnavailable:`The text encoding could not be read. The original bytes are preserved.`,fileAttachmentDocumentUnavailable:`Text could not be extracted. The document may be password protected or have an unsupported format. The original bytes are preserved.`,fileAttachmentNoText:`The original file will be attached for the agent to read with its tools. No text was extracted.`,fileAttachmentPreviewTruncated:`Preview shows the first 20,000 characters. The complete extracted text will be attached.`,fileAttachmentExtractedContent:`Extracted text`,fileAttachmentPromptLabel:`User-provided files:`,fileAttachmentPromptTooLong:`The message and file references exceed the input limit. Shorten the message or attach fewer files.`,imageAttachmentDescription:`PNG, JPEG, GIF, or WebP`,imageAttachments:`Image attachments`,imageAttachmentsLoading:`Preparing attachments…`,commandOpensPanel:`Open panel`,commandPanelArguments:`This command opens a panel and cannot include arguments or images. Remove them, or use the panel directly.`,commandPanelUnavailable:`The panel could not be opened. Your command is preserved.`,commandUnavailable_terminal_only:`Requires Pi's terminal interface.`,commandUnavailable_not_integrated:`This extension command is not connected to Web yet. Use it in Pi's terminal.`,artifactImagePreviewFailed:`Unable to preview this image. Refresh the file to retry, or download it.`,artifactFileDetails:`File details`,turnElapsedRunning:`Working for {{duration}}`,compactionElapsed:`Waiting {{duration}}`,compactionRunning:`Compacting context`,compactionCompleted:`Context automatically compacted`,compactionFailed:`Context compaction failed`,compactionInterrupted:`Compaction interrupted`,compactionUnchanged:`Compaction finished without a new summary`,compactionUnavailable:`Context compaction status unavailable`,compactionReconnectHelp:`Connection interrupted. The current status will be checked after reconnecting.`,compactionDraftHelp:`Compacting history. Messages you send will be queued.`,turnElapsedFinished:`Worked for {{duration}}`,composerAdd:`Add`,composerCommands:`Commands`,composerFile:`File`,composerPlan:`Plan`,composerCompact:`Compact`,composerModel:`Model`,composerBack:`Back`,composerPlanDescription:`Enter or leave Plan mode`,composerCompactDescription:`Summarize earlier conversation history`,composerModelDescription:`Select this Session's model`,compactionQueueWaiting:`Waiting for compaction to finish`,compactionQueueBlocked:`Messages retained. Retry when ready or clear the queue.`,clearPromptQueue:`Clear queue`,queueUpdateFailed:`Could not update the queue. Check the current session and try again.`,queueStatusUnconfirmed:`The request was received, but the latest queue state could not be verified. Refresh before trying again.`,turnElapsedOutcome_cancelled:`Stopped`,turnElapsedOutcome_failed:`Failed`,turnElapsedOutcome_uncertain:`Outcome unconfirmed`,settingsSetupBusyHint:`Agent configuration is available after this turn. Display settings can be changed now.`,resetChatContentWidth:`Reset chat content width`,resetChatFontSize:`Reset chat font size`,setupResolveAdmission:`Return to the conversation to resolve the pending message before applying settings.`,removeAttachment:`Remove attachment`,dropImagesHere:`Drop files or images here`,imageAttachmentCount:`Attach up to {{count}} images.`,imageAttachmentTooLarge:`Each image must be 10 MB or smaller.`,imageAttachmentTotalTooLarge:`The attached images must total 32 MB or less.`,imageAttachmentUnsupported:`Only valid PNG, JPEG, GIF, and WebP images are supported.`,imageAttachmentReadFailed:`Could not read this image. Add it again to retry; your message is preserved.`,attachedImage:`Attached image`,previewAttachment:`Preview image`,closeImagePreview:`Close image preview`,imagePreviewFailed:`Unable to display this image.`,fitImage:`Fit image`,originalImageSize:`Original size`,imageViewMode:`Image view`,sessionUsage:`Session token usage`,sessionInputTokens:`Input tokens`,sessionOutputTokens:`Output tokens`,sessionCacheTokens:`Cached tokens`,sessionContextUsage:`Context usage and context window`,usageContextLabel:`Context`,usageUnknown:`Unknown`,usageOpenDetails:`Input {{input}} · Output {{output}} · Context {{percent}} / {{capacity}} · View token usage`,usageContextHelp:`Estimated tokens in the current branch / model context limit.`,usageSessionTotals:`Session totals`,usageInputLabel:`Input`,usageOutputLabel:`Output`,usageCacheReadLabel:`Cache read`,usageCacheWriteLabel:`Cache write`,usageTotalLabel:`Total`,usageWorkspaceLabel:`Workspace`,usageSessionId:`Session ID`,usageTotalsHelp:`Session token totals include cache usage.`,subagentDetails:`Subagents`,sessionOverview:`Session overview`,sessionOverviewChanges:`Changes in the current review scope`,subagentSummaryRunning:`{{count}} running`,subagentSummaryDone:`{{count}} completed`,subagentSummaryOther:`{{count}} other`,subagentNoneYet:`No subagents yet`,subagentOtherGroup:`Failed / interrupted`,subagentShowMore:`Show {{count}} more`,backToSubagents:`Back to subagents`,subagentActiveGroup:`Active`,subagentFinishedGroup:`Completed`,subagentNoneRunning:`No subagents running.`,subagentNoneFinished:`Completed tasks will appear here.`,subagentProgress:`Subagents: {{running}} running · {{completed}} completed`,subagentSummaryUnknown:`{{count}} without confirmed status`,subagentTasks:`Subagent tasks`,inspectSubagent:`Open subagent: {{name}}`,subagentState_running:`Running`,subagentProcessing:`Working…`,subagentState_done:`Completed`,subagentState_error:`Failed`,subagentState_interrupted:`Interrupted`,subagentStarting:`Starting…`,subagentSpawnFailed:`Failed to start`,subagentStateUnavailable:`Started · state unavailable`,subagentSpawnReceipt:`Start receipt`,subagentSpawnReceiptHint:`This confirms the start request, not the subagent's final result.`,subagentTask:`Assigned task`,subagentTranscript:`Subagent conversation`,subagentResult:`Result`,subagentSpend:`Cumulative token spend`,subagentSaved:`Saved record`,subagentRecordedState:`Last recorded state`,subagentSavedHint:`From this parent session's saved receipts. A result may include other tasks from the same batch; this is not the child's full live conversation.`,subagentReadOnly:`Read-only view · closing this panel does not stop the task`,subagentUnavailable:`Live details are no longer available for this subagent in the current session. The start receipt is not evidence of completion.`,subagentStale:`Could not refresh. The details below are the last received snapshot.`,subagentNoMessages:`No messages received yet.`,subagentTranscriptUnavailable:`This view retains a task summary and cannot show the full child conversation.`,subagentWorkflowsTruncated:`{{count}} workflows are outside the loaded list; their task counts are unknown.`,subagentState_unknown:`Unconfirmed`,subagentUnconfirmedGroup:`Unconfirmed`,subagentTruncated:`Showing recent messages. {{count}} earlier messages are not included in this view.`,subagentTextTruncated:`Some long content is shown as an excerpt.`,subagentListTruncated:`{{count}} additional tasks are outside the loaded list.`,subagentThinkingRedacted:`Reasoning was redacted by the provider.`,inspectionChanged:`The active session changed. Reopen this panel.`,inspectionUnavailable:`Details are unavailable.`,inspectionLoading:`Loading status…`,thinkingUnavailable:`Thinking state is unavailable.`,trustUnavailable:`Project trust status is unavailable.`,copySetupCommand:`Copy setup command`,savedTrustDecision:`Saved decision`,activeSessionTrust:`Active Session trust`,trustDecision_trusted:`Trusted`,trustDecision_denied:`Denied`,trustDecision_undecided:`Undecided`,trustDecision_unknown:`Unknown`,trustActiveYes:`Trusted in this Session`,trustActiveNo:`Not trusted in this Session`,modelAndThinking:`Model and reasoning`,selectedModel:`Current model`,thinkingLevel:`Thinking level`,availableThinking:`Available levels`,unknownState:`Unknown`,projectTrust:`Project trust`,trust_trusted:`This session trusts the workspace.`,trust_untrusted:`Trust for this workspace has been denied.`,trust_restricted:`Project resources are restricted pending a trust decision.`,trust_unknown:`Trust state is not available.`,trustRefreshNeeded:`The saved decision and active session differ. Refresh the session through Pi to apply it.`,providerAvailability:`Provider credentials`,settings:`Settings`,settingsNavigation:`Settings navigation`,generalSettings:`General`,configurationSettings:`Configuration`,configurationIntro:`Permissions, web access and model responses.`,configurationReadFailure:`Configuration could not be read safely. Fix the settings file, then refresh.`,configurationUserScope:`User configuration`,configurationSetupHint:`Response and search changes use OpenPI setup`,configurationApproval:`Approval policy`,configurationApprovalDetail:`Tool approvals follow the installed Pi extensions.`,configurationPiPermissions:`Pi extensions`,configurationSandbox:`Sandbox`,configurationSandboxDetail:`Tools run with the host process permissions.`,configurationSandboxUnavailable:`No OS sandbox`,configurationSearchDetail:`Let the current Session model search the web when supported.`,configurationSearchOff:`Do not offer native search to the current model.`,configurationSearchOn:`Offer native search when the current connection supports it.`,configurationVerbosity:`Output verbosity`,configurationVerbosityDetail:`Choose how much detail the model includes in its response.`,configurationResponsesUnavailable:`The current connection does not use a supported Responses API.`,configurationVerbosity_default:`Model default`,configurationVerbosity_low:`Low`,configurationVerbosity_medium:`Medium`,configurationVerbosity_high:`High`,configurationVerbosityHelp_low:`Prefer short answers with fewer details.`,configurationVerbosityHelp_medium:`Include useful explanation and a moderate amount of detail.`,configurationVerbosityHelp_high:`Include more complete explanation and detail.`,configurationVerbosityRequest:`Set only response_verbosity to {{value}}; preserve the other OpenPI settings.`,configurationSummary:`Reasoning summary`,configurationSummaryDetail:`Choose the summary requested from a supported reasoning model.`,configurationSummaryUnavailable:`The current connection does not support reasoning summaries.`,configurationSummary_default:`Model default`,configurationSummary_auto:`Auto`,configurationSummary_concise:`Concise`,configurationSummary_detailed:`Detailed`,configurationSummary_none:`Off`,configurationSummaryHelp_auto:`Let the model choose the summary length.`,configurationSummaryHelp_concise:`Request a brief reasoning summary.`,configurationSummaryHelp_detailed:`Request a more detailed reasoning summary.`,configurationSummaryHelp_none:`Do not request a summary. Keep the current reasoning effort.`,configurationSummaryRequest:`Set only response_reasoning_summary to {{value}}; preserve the other OpenPI settings.`,configurationModelFeatures:`Model features`,configurationReasoningLevels:`Available reasoning efforts`,configurationReasoningDetail:`Choose which levels appear in model controls. Only levels supported by the current model are shown; the current level stays visible.`,configurationReasoningCount:`{{count}} selected`,configurationDependencies:`Workspace dependencies`,configurationEnvironment:`Local environment`,configurationEnvironmentDetail:`Node.js, Python and other tools come from your environment. OpenPI does not install a bundled workspace runtime.`,configurationRuntimeStatus:`Runtime status`,browserSettings:`Browser`,webSearchSettings:`Web search`,webSearchCurrentModel:`Current Session model`,webSearchNativeDetail:`Use your current model provider's native search with the existing connection and credentials.`,webSearchSupported:`This connection supports native search. When enabled, the model decides when to search.`,webSearchUnsupported:`Native search is unsupported or unconfirmed for this connection. No search tool is provided and no other provider is used.`,webSearchNativeRequest:`Enable native web search using the current Session model and existing Pi credentials. Do not switch model, connection protocol, or search provider. Unsupported or unknown connections must receive no search tool.`,webSearchIntro:`Let your model search current sources and read the original pages.`,webSearchPackageDetail:`Optional search, page reading, and PDF extraction through a Pi package.`,webSearchDefaultOff:`Off by default. This optional extension follows the current Session model; it needs no separate search key or plugin installation.`,webSearchLoaded:`Package loaded in this Session`,webSearchNotLoaded:`Package not loaded in this Session`,webSearchSource:`Review plugin source`,webSearchProfile:`Search setup`,webSearchExa:`Exa — no API key required`,webSearchExisting:`Keep my existing search preferences`,webSearchProfileHint:`Exa uses search queries with direct page reading. Existing preferences stay untouched. Other search services can be configured after installation.`,webSearchEnable:`Enable web search…`,webSearchDisable:`Disable web search…`,webSearchConfigure:`Change search service…`,webSearchExaRequest:`Enable optional web search with Pi Web Access and Exa, which needs no API key. Let me review the installation confirmation, preserve other preferences, and do not reload automatically.`,webSearchExistingRequest:`Enable optional web search with Pi Web Access and keep my existing search preferences unchanged. Let me review the installation confirmation, preserve other preferences, and do not reload automatically.`,webSearchDisableRequest:`Disable native web search. Preserve other settings and Session history.`,webSearchProviderRequest:`Help me change the search service for my installed Pi Web Access plugin. Explain available services and permissions, preserve unrelated preferences, keep credentials with the search plugin, and do not reload automatically.`,browserSettingsIntro:`Let OpenPI read pages, click, type and take screenshots.`,browserControl:`Browser control`,browserControlHint:`Requests a setup change. Access changes after the configuration is saved.`,browserDefault:`Default browser`,browserDefaultHint:`Requests a setup change for the browser used when none is named.`,browserEmbedded:`OpenPI browser`,browserAllowedTitle:`Allowed browsers`,browserOffHint:`Your choices take effect when browser control is on.`,browserConnected:`Connected`,browserNeedsSetup:`Extension setup needed`,browserNotFound:`Browser not detected`,browserUpdateNeeded:`Extension update needed`,browserBlocked:`Not allowed`,browserDefaultBlocked:`Your default browser is not allowed. Allow it or choose another default.`,browserSetUp:`Set up`,browserManage:`Manage`,browserSetupNamed:`Set up {{browser}}`,browserManageNamed:`Manage {{browser}}`,browserAllowNamed:`Allow {{browser}}`,browserMore:`More browsers`,browserSpeakHint:`Say “Use Chrome to…” to choose a different browser for a request.`,browserGuideTitle:`Connect {{browser}}`,browserGuideEyebrow:`One step at a time`,browserConnectionTitle:`Connection`,browserCloseGuide:`Close browser setup`,browserConnectionReady:`Connected. Choose whether OpenPI may use this browser.`,browserEmbeddedDetail:`Pages open inside OpenPI. Some websites require a regular browser to sign in or display correctly.`,browserExternalDetail:`OpenPI can use existing tabs and signed-in pages in your connected {{browser}} profile. Keep an OpenPI tab open in that profile.`,browserManageExtension:`Manage extension`,browserAllowUse:`Allow OpenPI to use it`,browserMakeDefault:`Use as default`,browserInstallIn:`Install in`,browserInstallTitle:`Install OpenPI Browser Bridge`,browserSetupSteps:`Setup steps`,browserGuidePopout:`Keep this guide in a separate window`,browserGuideDetached:`Your guide is open in a separate window. Follow it alongside the browser settings.`,browserShowGuide:`Show guide`,browserGuideInline:`Return guide here`,browserGuideBlocked:`The guide window could not open. Allow pop-ups and try again, or follow the steps here.`,browserSafariSettings:`Safari → Settings`,browserSafariDeveloper:`Developer settings`,browserSafariTemporary:`Add Temporary Extension…`,browserSafariOpenHint:`Open Safari, then choose Safari → Settings. Keep this guide alongside it. Requires Safari 26 or later on macOS.`,browserSafariDeveloperTitle:`Show Safari’s developer settings`,browserSafariDeveloperHint:`In Settings → Advanced, turn on Show features for web developers. Then select the Developer tab.`,browserSafariLoadHint:`In Developer, click Add Temporary Extension and select the folder below. Enable OpenPI Browser Bridge and allow the websites you want to control, including the local OpenPI page. Temporary extensions need reloading after Safari quits.`,browserFirefoxThis:`This Firefox`,browserFirefoxTemporary:`Load Temporary Add-on…`,browserFirefoxDeveloperTitle:`Select This Firefox`,browserFirefoxDeveloperHint:`On about:debugging, choose This Firefox in the left sidebar. Firefox does not need a Developer mode switch.`,browserFirefoxLoadHint:`Click Load Temporary Add-on and select manifest.json in the folder below. This development installation lasts until Firefox restarts; a permanent installation requires a Mozilla-signed package.`,browserFirefoxDone:`Selected. Next`,browserStepCount:`Step {{step}} of {{total}}`,browserStepLabel:`Step {{step}}: {{label}}`,browserStepOpen:`Open page`,browserStepAdd:`Add extension`,browserStepConnect:`Connect`,browserOpenManagerTitle:`Open {{browser}} extensions`,browserOpenManagerHint:`This opens {{browser}}. Complete the action on its extensions page, then return here to continue.`,browserOpenManager:`Open {{browser}} extensions`,browserReopenManager:`Open extensions page again`,browserAlreadyInstalled:`Already installed? Connect`,browserDeveloperMode:`Developer mode`,browserDeveloperTitle:`Turn on Developer mode`,browserDeveloperHint:`Turn on Developer mode on the extensions page. The {{loadLabel}} button will appear.`,browserDeveloperDone:`It’s on. Next`,browserIllustration:`Illustration · In {{browser}}`,browserExtensions:`Extensions`,browserLoadUnpacked:`Load unpacked`,browserLoadHint:`The extension is ready on this computer. Follow these steps in {{browser}} to load it.`,browserCopyLocation:`Copy the location below`,browserLocateTarget:`Find the extension on this computer`,browserRevealTarget:`Locate extension`,browserLocateManifest:`Find the extension’s manifest.json`,browserRevealManifest:`Locate manifest.json`,browserDragToBrowser:`Drag the folder onto {{browser}} extensions`,browserDragFolderHint:`Drag the entire {{folder}} folder from your file manager onto the extensions page, with Developer mode on.`,browserSelectLocatedTarget:`In the browser’s file picker, select the item located in the previous step.`,browserManualInstall:`Need another way? Select by path`,browserManualSelection:`Can’t find it? Select by path`,browserLoadInBrowser:`In {{browser}}, click “{{loadLabel}}”`,browserLoadAlternate:`The button appears when Developer mode is on.`,browserConfirmFolder:`Select`,browserConfirmFile:`Open`,browserSelectFolderHint:`Select this entire folder, not a .js file inside it.`,browserSelectManifestHint:`Select manifest.json, not one of the .js files.`,browserInstallCheckpoint:`Continue when OpenPI Browser Bridge appears in the extensions list.`,browserPathCopied:`Path copied`,browserCopyFailed:`Couldn’t copy. Select the path above and copy it manually.`,browserChooseFolderMac:`Press ⌘ ⇧ G, paste the copied path and press Return. Then click “{{confirm}}”.`,browserChooseFolderOther:`Paste the copied path into the location bar and press Enter. Then click “{{confirm}}”.`,browserInstalledConnect:`Added. Connect to OpenPI`,browserPreviousStep:`Back`,browserWaiting:`Waiting for OpenPI Browser Bridge… We’ll detect it automatically.`,browserInstallBrowserFirst:`Install {{browser}} first, or open this OpenPI address in your installed browser.`,browserConnectTitle:`Connect to OpenPI`,browserConnectHint:`Open OpenPI in {{browser}}. Use the profile where you installed the extension.`,browserOpenIn:`Open in {{browser}}`,browserAllowHint:`Once connected, you can allow OpenPI to use this browser. Installing the extension does not change your browser permissions.`,browserCheck:`Check connection`,browserNotConnectedYet:`No connection yet. Finish installation, refresh OpenPI in that browser and check again.`,browserHelp:`Setup help`,browserReloadHint:`Already installed? Reload OpenPI Browser Bridge in the extension manager and refresh OpenPI. Accept the browser’s permission prompt if shown.`,browserSupportedHint:`Chrome, Edge, Brave and Chromium 145+ support embedded and native pages. Safari 26+ on macOS and Firefox 128+ use the portable extension for native tabs; nested frames must be opened separately. Temporary Safari/Firefox installations need reloading after browser restart.`,browserCopyPath:`Copy path`,browserOpening:`Opening browser…`,browserLoading:`Checking browser connections…`,browserSaved:`Saved. Browser permissions take effect immediately.`,browserSaving:`Working…`,modelSettings:`Models`,skillsSettings:`Skills`,subagentsSettings:`Sub-agents`,pluginsSettings:`Plugins`,configureOpenPi:`Configure OpenPI`,setupRequestReviewAll:`review every OpenPI configuration area with me`,setupRequestSetTheme:`set only the OpenPI Web theme to {{value}} and preserve every other setting`,setupRequestSetChatWidth:`set only the OpenPI Web chat content width to {{value}}px and preserve every other setting`,setupRequestSetChatFontSize:`set only the OpenPI Web chat font size to {{value}}px and preserve every other setting`,setupRequestEnableExpandedThinking:`expand thinking blocks by default in OpenPI Web and preserve every other setting`,setupRequestDisableExpandedThinking:`collapse thinking blocks by default in OpenPI Web and preserve every other setting`,setupRequestSubagents:`review and configure Agent role models and workflow limits`,setupRequestFailed:`The OpenPI setup request was not accepted.`,setupRequestRunning:`Applying OpenPI settings…`,setupRequestAccepted:`Configuration request accepted.`,setupPlanBlocked:`Exit Plan mode before changing agent configuration. Display settings can be changed directly; exiting does not start implementation.`,setupPlanBusy:`Agent configuration requires an idle turn and leaving Plan mode. Display settings can be changed now.`,setupOutcome_pending:`Configuration request is awaiting a save receipt.`,toolCallArguments:`Tool arguments`,toolCallOutput:`Tool result`,setupOutcome_saved:`OpenPI configuration was saved and applied.`,setupOutcome_unchanged:`Configuration was saved; effective settings are unchanged.`,setupOutcome_failed:`The setup request failed. Review the error and current settings before retrying.`,setupOutcome_cancelled:`Setup was cancelled without a confirmed save.`,setupOutcome_unconfirmed:`No successful save was confirmed. Review current settings before retrying /openpi-setup.`,settingsUpdateFailed:`The Web preference could not be saved.`,settingsPreferencesSaved:`Preferences saved.`,settingsPreferencesSaveFailed:`Could not save display settings. Check configuration diagnostics and retry.`,settingsCatalogLoading:`Loading Pi resources…`,settingsCatalogFailed:`Could not load Pi settings resources.`,appearance:`Appearance`,settingsPersonal:`Personal`,settingsAgent:`Agent`,settingsIntegrations:`Integrations`,settingsArchivedChats:`Archived chats`,settingsSearch:`Search settings`,settingsClearSearch:`Clear search`,settingsNoResults:`No matching settings`,appearanceVisualStyle:`Visual style`,appearanceMode:`Mode`,appearanceTheme:`Theme`,appearanceAccent:`Accent color`,appearanceBackground:`Background`,appearanceForeground:`Foreground`,appearanceFont:`Font`,appearanceFont_codex:`Codex default`,appearanceFont_sans:`Sans serif`,appearanceFont_serif:`Serif`,appearanceFont_mono:`Monospace`,appearanceAccent0:`Default`,appearanceAccent1:`Blue`,appearanceAccent2:`Purple`,appearanceAccent3:`Pink`,appearanceAccent4:`Orange`,appearanceAccent5:`Green`,appearanceCustomAccent:`Custom accent color`,appearanceAdvanced:`Advanced`,appearanceReset:`Restore defaults`,appearanceResetAction:`Reset appearance`,appearanceImport:`Import theme`,appearanceCopy:`Copy theme`,appearanceCopied:`Theme copied`,appearanceCopyFailed:`Could not copy theme. Try again.`,appearanceThemeValue:`Theme data`,appearanceImportPlaceholder:`Paste an OpenPI theme…`,appearanceImportInvalid:`Enter valid OpenPI theme data.`,appearanceImportAction:`Import`,searchArchivedChats:`Search archived chats`,archiveProjectFilter:`Filter by project`,archiveAllProjects:`All projects`,archiveProjectGroup:`{{project}} · {{count}} archived chats`,archiveSort:`Sort archived chats`,archiveSortUpdated:`Last updated`,archiveSortCreated:`Date created`,restoreArchivedChat:`Restore {{title}}`,themeLight:`Light`,themeDark:`Dark`,themeMist:`Mist`,themeRose:`Rose`,themePine:`Pine`,themeSystem:`System`,conversationSettings:`Conversation`,expandThinkingByDefault:`Expand thinking by default`,chatContentWidth:`Chat content width`,chatFontSize:`Chat font size`,agentBehavior:`Agent behavior`,workflowLimits:`Workflow limits`,workflowConcurrency:`Workflow concurrency`,workflowCalls:`Total calls`,agentSettingsSetupHint:`Agent changes are applied through /openpi-setup in the current session.`,setupRequestLimits:`Set workflow concurrency to {{concurrency}} and total agent calls to {{calls}}. Preserve other settings.`,setupRequestEnableSuggestions:`Enable next-action suggestions. Help me choose a model if required; preserve other settings.`,setupRequestDisableSuggestions:`Disable next-action suggestions. Preserve other settings.`,setupRequestPostEdit:`Help me configure or disable the post-edit command. Show the current configuration and ask which command to use.`,configurePostEdit:`Configure post-edit command`,workflowLimitsValue:`{{concurrency}} concurrent · {{calls}} total calls`,nextActionSuggestions:`Next-action suggestions`,nextActionSuggestionsDetail:`Offer a few useful next actions when the current task finishes.`,enabled:`Enabled`,disabled:`Disabled`,configured:`Configured`,postEditCommand:`Post-edit command`,postEditCommandDetail:`Run a command after edits. Nothing runs while this is off.`,resultDisplay:`Default result display`,subagentResults:`Subagent results`,bashOperations:`Bash operations`,fileMutations:`Write / Edit operations`,footer:`Footer`,terminalFooter:`Pi terminal footer`,terminalFooterStyle:`Terminal footer style`,terminalFooterHint:`Applies to Pi's command-line interface. An already open Pi interface updates when restarted or when setup is applied.`,detailDisplay_full:`Full`,detailDisplay_compact:`Compact`,sessionSettings:`Session`,currentModel:`Current`,providerCurrentSessionModel:`This conversation uses {{model}}.`,useThisModel:`Use model`,model:`Model`,modelConnection:`Model connection`,provider:`Provider`,modelId:`Model ID`,providerStatusUnavailable:`This provider is not present in the bounded authentication snapshot.`,providerSettings:`Provider credentials`,providerSettingsIntro:`Inspect which Pi providers can authenticate the current Web session.`,openRuntimeDetails:`Open runtime details`,currentWorkspace:`Current workspace`,providerAuth_api_key:`API key`,providerAuth_oauth:`OAuth`,providerAuthUnknown:`Authentication method not reported`,authentication:`Authentication`,accessType:`Access`,providerAccessSubscription:`Subscription account`,providerAccessStandard:`Provider credentials`,configurationOwner:`Configuration owner`,providerLoading:`Loading provider status…`,providerLoadFailed:`Could not load provider status.`,providerReadOnly:`Managed by Pi`,selectProvider:`Select a provider`,gitReviewBaselineUnavailable:`No usable session baseline was retained (it may exceed the capture limit). Choose Unstaged, Staged or Branch to inspect Git changes, or open the session file records.`,modelsIntro:`Sign in with an account or add an API key. Your existing Pi connections are available here.`,modelConnectionsTitle:`Model connections`,modelConnectionsIntro:`Manage credentials and choose models for new and current chats.`,accountLoginMethod:`Connection method`,accountLoginTab:`Account`,accountLoginChatGPT:`ChatGPT account`,accountLoginClaude:`Claude account`,accountLoginKeyTab:`API key`,accountLoginConfigured:`Account signed in`,accountLoginIntro:`Continue in your browser. No API key needed.`,accountLoginExisting:`Your account credential is saved in Pi.`,accountLoginStart:`Sign in`,accountLoginAgain:`Sign in again`,accountLoginUnsaved:`Save or discard your other changes before signing in.`,accountLoginStarting:`Preparing sign-in…`,accountLoginWaiting:`Waiting for authorization`,accountLoginChoose:`Choose how to sign in`,accountLoginCancelling:`Cancelling sign-in…`,accountLoginBrowser:`Continue in browser`,accountLoginDevice:`Use a device code`,accountLoginBrowserOption:`Sign in on this computer. Returns here automatically.`,accountLoginDeviceOption:`For remote servers or when browser sign-in is unavailable.`,accountLoginBrowserHelp:`Open the sign-in page and approve access. This page updates automatically.`,accountLoginDeviceHelp:`Open the authorization page and enter this code. Keep this page open.`,accountLoginOpen:`Open sign-in page`,accountLoginCopyCode:`Copy device code`,accountLoginPaste:`Authorization code or callback URL`,accountLoginContinue:`Continue`,accountLoginFallback:`Signed in but still waiting?`,accountLoginRemoteHelp:`If automatic return does not work, copy the final callback URL from your browser and paste it here.`,accountLoginCancel:`Cancel sign-in`,accountLogin_failed:`Sign-in failed. Try again or choose another method.`,accountLogin_expired:`Sign-in expired. Start again to get a new authorization link.`,accountLogin_cancelled:`Sign-in cancelled.`,accountLoginRequestFailed:`The request did not complete. Refresh status before retrying.`,accountLoginStatusUnknown:`Cannot check sign-in status. Your authorization may still be in progress.`,accountLoginRefreshRequired:`The credential was saved, but Pi could not update its model list. Reload Pi before using this connection.`,accountLogout:`Sign out`,accountLogoutRefreshRequired:`The saved credential was removed, but Pi could not update its model list. Reload Pi to refresh the status.`,accountLogoutTitle:`Sign out of {{provider}}?`,accountLogoutDetail:`Removes this provider’s saved credential from Pi on this machine. Other Pi sessions using it will also need to sign in again. Environment credentials are unchanged.`,providerInputTypes:`Input types`,providerInputText:`Text`,providerInputImage:`Images`,providerCustomTag:`Custom`,providerEdit:`Edit`,providerRemove:`Delete`,providerSave:`Save`,editProvider:`Edit {{provider}}`,removeProvider:`Delete {{provider}}`,providerAdd:`Add model provider`,providerAddMode:`How to add`,providerAddCatalog:`Third-party providers`,providerAddCustom:`Custom model API`,providerAccountHint:`Use an existing account to connect. Choose a provider and continue in your browser.`,providerCatalogHint:`Choose a provider from the built-in catalog and enter its API key.`,providerCustomHint:`Connect a gateway or self-hosted service using an OpenAI or Anthropic compatible API.`,providerKeyKeep:`Leave blank to keep the existing key`,providerKeyOptional:`Enter an API key, or leave blank to use environment authentication`,providerDisplayName:`Provider name`,providerCustomSettings:`Custom settings`,providerSaved:`Saved {{provider}}.`,modelDefaultTitle:`Default for new chats`,modelDefaultChoose:`Choose model`,modelDefaultBadge:`Default`,modelCurrentBadge:`In use`,modelDefaultNotSet:`Not set · Pi chooses when a new chat starts`,modelDefaultHint:`Choose the model for future chats. Existing chats keep their own model. This also updates Pi's default.`,modelDefaultReadFailed:`Could not read the default model.`,modelDefaultProjectOverride:`This workspace has a Pi override: {{model}}.`,modelDefaultSave:`Save default`,modelMakeDefault:`Also make this the default for new chats`,modelDefaultSaveFailed:`The default was not confirmed. Refresh status and try again.`,modelDefaultPartial:`The chat model changed, but saving the default was not confirmed. Refresh status before retrying.`,modelConnectionNextHint:`Choose a model from this connection to use in the current chat.`,modelConnectionSearch:`Search models…`,modelConnectionChooseProvider:`Choose a model from {{provider}}`,modelConnectionUse:`Use in this chat`,modelConnectionUseFailed:`The model change was not confirmed. Refresh the model list and try again.`,modelConnectionLoadFailed:`Could not load models.`,modelConnectionNoModels:`No selectable models yet. Check the connection or add a model definition.`,modelConnectionNoMatch:`No matching models.`,modelConnectionMore:`{{count}} more models. Search to narrow the list.`,providerModelsEmpty:`No models yet. Fetch available models or add one manually.`,providerModelsInherited:`Uses the provider’s built-in model catalog.`,providerModelsReadOnly:`This provider contains model settings that must be edited in Pi’s configuration file.`,providerModelId:`Model {{number}} ID`,providerModelName:`Model {{number}} name`,providerModelDetails:`Model details: {{model}}`,providerRemoveModel:`Remove model: {{model}}`,providerIdInvalid:`Use a unique provider ID with letters, numbers, hyphens, dots or underscores.`,providerNativeAuth:`This provider uses Pi’s native sign-in.`,providerConfigurationFailed:`Could not save. Check the fields and retry when the session is idle.`,providerProfileSavedKeyFailed:`The provider was saved, but its API key was not. Retry saving the key.`,providerReload:`Discard draft and reload`,providerCurrentRemoval:`Select another model before removing the model currently in use.`,providerRemoveDetail:`Remove this provider’s configuration and custom models? Credentials managed by Pi are kept.`,providerPickerIntro:`Select the models you want to add from this provider.`,providerPickerSelected:`{{count}} selected`,providerApiKey:`API key`,providerKeyPlaceholder:`Paste a key to add or replace it`,saveProviderKey:`Save API key`,savingSettings:`Saving…`,keepEditing:`Keep editing`,discardAndContinue:`Discard and continue`,unsavedSettingsTitle:`Discard unsaved changes?`,unsavedSettingsDetail:`Unsaved model and credential changes will be lost.`,unsavedCredentialTitle:`Discard the unsaved credential?`,unsavedCredentialDetail:`The new key has not been saved and will be cleared.`,modelSelectionBusy:`This session is busy. Model changes are unavailable.`,providerKeySaved:`Saved to Pi credentials. Existing keys are never displayed.`,providerSaveFailed:`Credential save did not complete. Wait until the session is idle, refresh status and retry. Some providers need additional authentication settings.`,providerWriteDetail:`Save API keys here directly to Pi. Keys never enter a model conversation. For OAuth or additional provider fields, use Pi's native login.`,editModelConfiguration:`Add or edit a custom model`,modelConfigurationDetail:`Set up a provider connection, then choose available models or add one manually. Saving does not send a model request.`,configuredModels:`Custom model configuration`,addModel:`Add a model`,modelConfig_provider:`Provider ID`,modelConfig_id:`Model ID`,modelConfig_name:`Display name`,modelConfig_baseUrl:`API base URL`,modelConfig_api:`API format`,modelConfig_contextWindow:`Context window`,modelConfig_maxTokens:`Max output tokens`,providerCapacityLabel:`{{field}} {{number}}`,providerModelOptions:`Model options`,providerModelInvalid:`Model {{number}}: use a unique model ID and positive token counts, such as 128K or 1M. Leave capacities blank to use defaults.`,modelConfig_reasoning:`Supports reasoning`,saveModelConfiguration:`Save model`,reloadModelConfiguration:`Discard draft and load latest`,retryModelConfiguration:`Retry loading`,discardModelDraftTitle:`Discard this model draft?`,discardModelDraftDetail:`The latest configuration will replace this unsaved draft.`,discardAndReload:`Discard and reload`,modelConfigurationUnsaved:`Unsaved changes`,modelConfigurationConflict:`Model configuration changed elsewhere. Your draft is unchanged.`,modelConfigurationLoadFailed:`Could not load model configuration. Your draft is unchanged.`,modelConfigurationSaved:`Saved to Pi models.json. Configure the provider API key to make this model available.`,modelConfigurationFailed:`Model save did not complete. Your draft is unchanged.`,setupConfigurationRequest:`Configuration request`,configureViaSetup:`Apply via OpenPI setup`,setupFormDetail:`Uses /openpi-setup. Follow progress and any required confirmation in the conversation; submission does not mean the configuration is saved.`,setupSkillsPlaceholder:`Describe the skill to add or configure, including its source or local path`,setupPluginsPlaceholder:`Describe the Pi package to configure, including its exact package name or local path`,enableSkillInvocation:`Allow model invocation`,disableSkillInvocation:`Require explicit invocation`,setupSkillInvocationRequest:`Configure this Pi skill: {{path}}. Set its native disable-model-invocation field to {{disabled}}. Preserve other content and explain when the change takes effect.`,setupRoleFormRequest:`Configure the OpenPI {{role}} role to use {{model}} and set workflow concurrency to {{concurrency}}. Inherit parent thinking, validate the selection and preserve unrelated configuration.`,providerReadOnlyDetail:`This page is read-only and never receives credential values. Configure provider authentication through Pi, then refresh this status.`,openProviderSettings:`Open provider settings`,credentialConfigured:`Configured`,credentialMissing:`Not configured`,authNotVerified:`Configured credentials do not guarantee a successful model request.`,configurationViaPi:`Read-only status. Manage model credentials and trust through Pi; manage OpenPI options with /openpi-setup.`,noSkillsFound:`No skills are loaded for this Session.`,addSkill:`Add skill`,addPlugin:`Add plugin`,searchResources:`Search by name or source`,filterResourceScope:`Resource scope`,allResourceScopes:`All scopes`,noMatchingResources:`No matching resources`,resourceBulkTooLarge:`Filter the list further before submitting a bulk request.`,resourceManagement:`Pi resources`,resourceSourceAuto:`Pi automatic discovery`,resourceSourceLocal:`Local resource`,resourcePackageSource:`Package, repository or local path`,resourcePackageSourcePlaceholder:`npm:package@version · git:owner/repo · /path/to/skill`,resourceInstallIntro:`Choose a source and scope. OpenPI setup will review and apply the request in the conversation.`,resourceInstallReview:`Review the exact source and permissions in the conversation. Submitting this request does not mean it is installed or loaded.`,resourceRequestSubmitted:`Request submitted. Follow progress and confirmations in the conversation, then refresh this catalog.`,browseSkills:`Browse skills.sh`,resourceSessionState:`Apply to this Session`,resourcesReloadNote:`Refresh reads the catalog. Reload applies saved resources to this idle Session; changes are never reloaded automatically.`,reloadResources:`Reload resources`,resourceReloadReview:`Apply saved Pi skill and plugin configuration and restart extensions in the current Session? Wait for running work to finish first.`,resourceReloaded:`Resources reloaded. Review the refreshed catalog and diagnostics.`,resourceReloadFailed:`Could not reload resources. Wait for this Session to become idle and refresh before retrying.`,advancedResourceConfiguration:`Advanced configuration`,resourceDiagnostics:`Pi reports {{extensionErrors}} extension diagnostics and {{skillErrors}} skill diagnostics.`,resourceConfigurationDiagnostics:`{{count}} settings files could not be read. Review Pi configuration diagnostics.`,resourceCatalogTruncated:`This catalog is bounded; some resources are omitted.`,resourceTargetTruncated:`This source or path is truncated. Confirm the full target through Advanced configuration before making changes.`,updateResource:`Review update`,removeResource:`Review removal`,skillsEmptyTitle:`Add your first skill`,skillsEmptyIntro:`Skills give Pi reusable instructions. Add a package, repository or local skill; project skills follow Pi project trust.`,pluginsEmptyTitle:`Extend Pi with a plugin`,pluginsEmptyIntro:`Packages can include extensions, skills, prompts and themes. Add a source to review its installation through OpenPI setup.`,pluginCount:`{{count}} plugin sources`,installedVersion:`Installed version`,configuredVersion:`Configured version`,resourceVersionUnpinned:`Not pinned / local source`,pluginState_loaded:`Session resources loaded`,pluginState_installed:`Installed · not loaded`,pluginState_disabled:`Disabled in configuration`,pluginState_missing:`Package missing`,pluginState_error:`Load diagnostics`,pluginState_notLoaded:`Not loaded`,pluginLoadedResources:`{{count}} resources in this Session's catalog. Configuration changes require an explicit reload.`,pluginAction_enable:`Review enable`,pluginAction_disable:`Review disable`,pluginAction_update:`Review update`,pluginAction_remove:`Review removal`,enableVisibleSkills:`Allow model use ({{count}} shown)`,disableVisibleSkills:`Explicit use only ({{count}} shown)`,enableVisiblePlugins:`Enable {{count}} shown packages`,disableVisiblePlugins:`Disable {{count}} shown packages`,setupResourceInstallRequest:`Add these Pi {{kind}} from source {{source}} in scope {{scope}}. Inspect the source and resolve a fixed package identity, review required installation permissions with me using ask_user, then use Pi's native package/skill configuration. For a skill request, preserve unrelated extensions and other resources. Preserve existing preferences and project trust; do not reload this Session automatically. Report saved configuration and any remaining action separately. Do not change unrelated OpenPI settings.`,setupPluginOperationRequest:`Review Pi package action {{action}} for exactly configured source {{source}}, native root {{path}}, scope {{scope}}. Resolve relative sources against the native scope's settings directory. Use Pi's native package management. For updates, inspect available versions and review a fixed target identity and required permissions with me using ask_user before installing. Preserve resource filters and all unrelated preferences; if a toggle would destroy filters, stop and explain. Removal must not delete a local source directory. Do not reload automatically. Report persisted and active states separately; do not change unrelated OpenPI settings.`,setupSkillManageRequest:`Review Pi skill action {{action}} for exactly file {{path}}, source {{source}}, scope {{scope}}. Inspect native ownership first. Review the update/removal and required permissions with me using ask_user. Preserve unrelated skills and package resources; do not remove an entire shared package to remove one skill. Preserve project trust and do not reload automatically. Do not change unrelated OpenPI settings.`,setupSkillsBulkRequest:`For exactly these currently displayed Pi skill files {{paths}}, set native disable-model-invocation to {{disabled}}. Inspect ownership, preserve all other content and preferences, review necessary changes with me, and report any files that cannot be changed safely. Explicit /skill invocation remains available. Do not reload automatically or change unrelated OpenPI settings.`,setupPluginsBulkRequest:`For exactly these currently displayed Pi packages {{packages}}, set disabled to {{disabled}} through native Pi configuration. Preserve all other preferences and resource filters; skip and report entries whose filters cannot be preserved. Respect scope and project trust, review necessary changes with me, and do not reload automatically or change unrelated OpenPI settings.`,resourceRequestFinished:`The setup turn has ended. Refresh and inspect Pi's configuration and Session resources to confirm what changed.`,skillCount_one:`{{count}} skill`,skillCount_other:`{{count}} skills`,skill:`Skill`,copySkillInvocation:`Copy invocation`,source:`Source`,scope:`Scope`,invocation:`Invocation`,modelInvocation:`Model invocation`,resourceScope_user:`Global`,resourceScope_project:`Project`,resourceScope_temporary:`Temporary`,explicitOnly:`Explicit invocation only`,availableToModel:`Available to the model`,skillFile:`Skill file`,selectSkill:`Select a skill`,subagentConfiguration:`Pi-native subagent roles`,subagentConfigurationIntro:`Role models inherit from the parent unless OpenPI setup assigns an available model.`,subagentActiveCount_one:`{{count}} active`,subagentActiveCount_other:`{{count}} active`,subagentCompletedCount_one:`{{count}} recorded`,subagentCompletedCount_other:`{{count}} recorded`,subagentConcurrency:`Limit {{count}}`,builtInRoles:`Built-in roles`,subagentRole_explorer:`Explorer`,subagentRole_implementer:`Implementer`,subagentRole_reviewer:`Reviewer`,subagentRole_advisor:`Advisor`,subagentRoleShort_explorer:`Read-only investigation`,subagentRoleShort_implementer:`Focused implementation`,subagentRoleShort_reviewer:`Correctness review`,subagentRoleShort_advisor:`Technical analysis`,subagentRoleDescription_explorer:`Explores the codebase and reports evidence without modifying files.`,subagentRoleDescription_implementer:`Implements a bounded change and runs the relevant repository checks.`,subagentRoleDescription_reviewer:`Reviews correctness, safety, regressions, and missing validation.`,subagentRoleDescription_advisor:`Analyzes difficult technical questions and recommends a concrete next step.`,configureRoles:`Configure roles`,builtInRole:`Built-in role`,builtIn:`Built-in`,modelAssignment:`Model assignment`,inheritParentModel:`Inherit parent model`,effectiveModel:`Effective model`,workflowConcurrencyLabel:`Concurrent agents`,workflowCallLimit:`Total agent calls`,runtimeBoundaries:`Runtime boundaries`,subagentAuthorityNote:`Child authority is the fail-closed intersection of the parent Session and role capabilities.`,subagentModelNote:`No hardcoded provider is introduced; an unassigned role follows the parent model and thinking level.`,resourceCount_one:`{{count}} resource`,resourceCount_other:`{{count}} resources`,noPluginsFound:`No loaded plugin sources were reported.`,pluginCatalogTotals:`{{extensions}} ext · {{skills}} skills · {{prompts}} prompts · {{themes}} themes`,loaded:`Loaded`,resourceOrigin:`Origin`,resourceOrigin_package:`Package`,resourceOrigin_topLevel:`Top-level resource`,resources:`Resources`,baseDirectory:`Base directory`,notReported:`Not reported`,extensions:`Extensions`,extensionSurfaceCount:`{{tools}} tools · {{commands}} commands`,prompts:`Prompts`,themes:`Themes`,pluginResourceSummary:`{{extensions}} ext · {{skills}} skills · {{prompts}} prompts · {{themes}} themes`,pluginsManagedByPi:`These resources are loaded by Pi. Submit changes using the setup form above. Package changes follow native confirmation and take effect through Pi's reload lifecycle.`,selectPlugin:`Select a plugin source`,statusCaptured:`Snapshot at {{time}} · refresh for the latest state`,conversationViews:`Conversation views`,currentConversations:`Current`,archivedConversations:`Archived`,refreshArchives:`Refresh archived conversations`,loadingArchives:`Loading archived conversations...`,moreArchives:`Load more archived conversations`,retryArchives:`Retry archived conversations`,archiveLoadFailed:`Could not load archived conversations.`,archiveCursorStale:`Archived conversations changed. Refresh to continue.`,archiveScanBounded:`{{count}} older records have not been scanned.`,noArchivedSessions:`No archived conversations.`,noScannedArchives:`No archived conversations in the scanned history.`,noMatchingScannedArchives:`No matching archived conversations in the scanned history.`,draftLimit:`Draft storage is full. Send or clear an existing draft before adding more content.`,restoreConversation:`Restore conversation`,restoringConversation:`Restoring…`,loadedArchives:`Archived conversations in the loaded history`,loadedHistoryBounded:`{{sessions}} more sessions and {{workspaces}} workspace summaries are not loaded. Search covers the loaded list only.`,noLoadedArchives:`No archived conversations in this loaded list.`,restoreFailed:`Could not confirm restoration. Refresh and try again.`,execution_running:`Running`,execution_done:`Completed`,execution_killed:`Stopped`,execution_timed_out:`Timed out`,execution_failed:`Failed`,execution_uncertain:`Uncertain`,activeOnlyHint:`Only the active Web session accepts messages.`,acceptedHint:`Message accepted by OpenPI Web.`,promptAdmissionUnknown:`It is unclear whether the last message was received.`,promptAdmissionUnknownDetail:`Review the refreshed Session history and runtime status before deciding. Sending as a new message may create a duplicate message.`,promptAdmissionCheckingDetail:`Checking the latest Session history and runtime status before resend options are enabled.`,promptAdmissionVerificationFailedDetail:`Could not refresh the latest Session history and runtime status. Check again before sending as a new message.`,abandonAdmission:`Don't resend for now`,retryAdmissionCheck:`Check again`,retryOriginalAdmission:`Retry original message`,promptTooLong:`Message exceeds the send limit ({{count}} / {{limit}}).`,sendAsNew:`Send as new message`,sendingAsNew:`Sending…`,stopTurn:`Stop current turn`,stoppingTurn:`Stopping current turn…`,stoppedTurn:`Current turn stopped.`,pendingFollowUpsHint:`{{count}} messages queued`,sendNextTurn:`Send next turn`,followUpBehavior:`Follow-up behavior`,followUpBehaviorDetail:`While OpenPI is running, queue new messages for the next turn or guide the current turn. Press ⌘/Ctrl+Enter to use the other option once.`,followUpQueue:`Queue`,followUpQueueDetail:`Next turn`,followUpSteer:`Steer`,followUpSteerDetail:`Current turn`,steerCurrentTurn:`Steer current turn`,steeringHint:`Use this instruction after the current tool step finishes.`,pendingSteeringHint:`{{count}} instructions received; waiting for the current tool step`,steeringMessagesTitle:`Pending instructions for this turn`,steerStaleTurn:`That turn has ended or changed. Your draft is kept. Check the updated status and send again.`,sourceFeedbackNew:`{{path}} · new line {{line}}`,sourceFeedbackOld:`{{path}} · old line {{line}}`,forkMessage:`Fork from here`,forkMessageHint:`Create a new conversation from this message. Keep the original conversation; no message is sent.`,forkSessionPending:`Creating a fork…`,forkSessionCreated:`Fork created. The original conversation remains in the sidebar.`,forkSessionCancelled:`Fork cancelled. The original conversation is kept.`,forkSessionUncertain:`The fork could not be confirmed. Refresh and inspect your conversations before trying again.`,forkSessionUnavailable:`Switch to this conversation and let its current work and queued messages finish before forking.`,reviewQuoteLine:`Reference this line`,reviewSelectOldLine:`Select old line {{line}}`,reviewSelectNewLine:`Select new line {{line}}`,queuedMore:`{{count}} more queued`,queuedImage:`Image attachment`,queuedMessageExpand:`Expand queued message`,queuedMessageCollapse:`Collapse queued message`,backgroundSessionRunning:`This session is running in the background…`,observedSessionTools:`{{count}} active tools`,toolsRequireCurrentSession:`Switch to this session to use interactive tools.`,activateViewedSession:`Switch to this session`,activateViewedSessionHint:`Send a message to continue this conversation.`,addWorkspace:`Add workspace`,addWorkspaceMenu:`Add workspace...`,archiveConversation:`Archive conversation`,pinnedConversations:`Pinned`,sidebarOptions:`Sidebar options`,sidebarProjectOptions:`Project sidebar options`,sidebarRecentOptions:`Chat sidebar options`,sidebarActivityOptions:`Activity view options`,sidebarShow:`Show`,sidebarGroupBy:`Group conversations`,sidebarByProject:`By project`,sidebarFlatList:`All conversations`,sidebarChatSort:`Conversation order`,sidebarRecent:`Recent`,sidebarProjectsInRecents:`Show projects in Recent`,sidebarShowMore:`Show more`,sidebarShowLess:`Show less`,sidebarFilterList:`Filter this list`,sidebarSaveFailed:`Could not save the change. Please try again.`,pinWorkspace:`Pin project`,unpinWorkspace:`Unpin project`,markConversationRead:`Mark as read`,markConversationUnread:`Mark as unread`,sidebarState_unread:`Unread conversation`,sidebarActivity:`Activity`,sidebarViewActivity:`View activity`,sidebarViewChats:`View conversations`,sidebarPriority:`Priority`,sidebarActivityEmpty:`Nothing needs attention`,sidebarActivityEmptyHint:`Completed work and conversations needing your attention appear here.`,sidebarMarkAllRead:`Mark all as read`,sidebarClearRead:`Clear read chats from Priority`,sidebarReadFailed:`Could not update read status. Please try again.`,sidebarToday:`Today`,sidebarYesterday:`Yesterday`,sidebarEarlier:`Earlier`,sidebarActivityCompleted:`Completed`,sidebarActivityFailed:`Failed`,sidebarActivityRead:`Read`,modelAdvanced:`Advanced parameters`,providerConnectionHeading:`Provider connection`,providerFetchModels:`Get available models`,providerFetchHint:`Enter the provider and endpoint, then choose models in one step.`,providerPickerTitle:`Choose models to add`,providerPickerAccess:`Connection credentials`,providerPickerKey:`Access key (optional)`,providerPickerKeyHint:`Leave blank to use saved credentials for this endpoint. A key entered here is used for discovery only and is not saved.`,providerPickerSearch:`Search models`,providerPickerSelectAll:`Select all`,providerPickerClear:`Clear selection`,providerPickerLoading:`Reading available models…`,providerPickerAdded:`Added`,providerPickerNoMatch:`No matching models`,providerPickerEmpty:`No models returned. You can still add one manually.`,providerPickerBounded:`Showing the first 500 models. Add other IDs manually.`,providerPickerError_load:`Could not read the model list. Check the endpoint and credentials, then retry or add a model manually.`,providerPickerError_save:`Could not confirm the save. Your selection is kept; check the connection before retrying.`,providerPickerError_conflict:`Configuration changed elsewhere. Close this dialog and reload configuration before saving again.`,providerPickerDefaults:`New models use {{context}} context / {{output}} output tokens. You can adjust these per model after adding.`,providerPickerRetry:`Refresh list`,providerPickerCount:`{{count}} selected · up to 100`,providerPickerSave:`Add selected`,sidebarState_running:`Running`,sidebarState_compacting:`Organizing context`,sidebarState_waiting:`Waiting for your response`,sidebarState_completed:`Completed · unread result`,sidebarState_failed:`Failed · open conversation for details`,pinnedOptions:`Pinned options`,pinConversation:`Pin conversation`,unpinConversation:`Unpin conversation`,pinnedRecentlyUpdated:`Recently updated`,pinnedManualOrder:`Manual order`,movePinUp:`Move up`,movePinDown:`Move down`,pinSaveFailed:`Could not save pinned conversations. Please try again.`,cancel:`Cancel`,chooseWorkspaceHint:`Choose a workspace and describe the work`,close:`Close`,closeSearch:`Close search`,collapseSidebar:`Collapse sidebar`,confirmEdit:`Save and rerun`,editMessageHint:`Rerun from here in a new branch. Keep the original conversation, images and file references. Existing workspace changes are kept.`,regenerateMessage:`Regenerate response`,regenerateMessageHint:`Rerun this question in a new branch, keeping its original attachments and conversation.`,messageRerunStarted:`Rerun admitted in a new branch. The original conversation is kept.`,openOriginalConversation:`View original conversation`,messageRerunWorkspaceHint:`Existing workspace changes are kept.`,modelRequestRecovered:`Request recovered`,modelReconnecting:`Reconnecting`,modelReconnectUnknown:`Reconnection status unconfirmed`,modelEarlierAttempts:`Earlier request errors`,modelFailedAttempts:`Failed attempts ({{count}})`,draftStorageUnavailable:`Draft could not be saved on this device. Keep this page open or copy your message.`,draftStorageInvalid:`Some saved draft content could not be restored. Check your message and attachments.`,draftStorageRetry:`Retry saving draft`,workbarBackToChat:`Back to chat`,workbarCollapseTools:`Collapse tools`,workbarEndTerminal:`Close {{name}} and end its process`,workbarNewTerminal:`New terminal`,workbarContinueInChat:`Continue in chat`,transcriptSearch:`Search message contents`,transcriptSearchPlaceholder:`Search titles, projects, or messages…`,transcriptSearchRecent:`Recent conversations`,transcriptSearchSessions:`Conversations`,transcriptSearchMessages:`Message contents`,transcriptSearchSessionResult:`Open conversation {{session}}`,transcriptSearchSessionOpenFailed:`Could not open this conversation. Try again.`,transcriptSearchIncludeArchived:`Include archived conversations`,transcriptSearching:`Searching messages…`,transcriptSearchEmpty:`No matching messages found.`,transcriptSearchFailed:`Could not search messages. Try again.`,transcriptSearchRetry:`Retry search`,transcriptSearchPartial:`Some history could not be searched. Results may be incomplete.`,transcriptSearchOpenFailed:`This message could not be opened. It may have moved or belong to another branch.`,transcriptSearchResult:`Open message from {{source}} in {{session}}`,transcriptSearchSource_user:`you`,transcriptSearchSource_assistant:`assistant`,transcriptSearchSource_tool_call:`tool call`,transcriptSearchSource_tool_result:`tool output`,connected:`Connected`,connecting:`Connecting`,conversationName:`Conversation name`,conversationOptions:`Conversation options`,sidebarRename:`Rename`,sidebarPin:`Pin`,sidebarUnpin:`Unpin`,sidebarFork:`Fork`,sidebarForkLocal:`Fork chat`,sidebarForkSameWorktree:`Fork in same worktree`,archiveNoticeTitle:`Chat archived`,archiveNoticeView:`View`,archiveNoticeUndo:`Undo`,archiveNoticeFailed:`Could not complete this action. Try again.`,sidebarForkWorktree:`Fork chat in new worktree`,sidebarForkCancelling:`Requesting cancellation…`,sidebarForkFinishing:`Cancellation is no longer available. Confirming the result…`,sidebarForkCancelUnconfirmed:`Cancellation could not be confirmed. Waiting for the fork result.`,sidebarForkWorktreePreserved:`The worktree was kept at {{path}}. Inspect it before retrying.`,sidebarForkWorktreePending:`Creating a worktree and conversation…`,sidebarForkOptionsLoading:`Checking worktree availability…`,sidebarForkOptionsFailed:`Unable to check worktrees. Reopen menu to retry.`,sidebarForkUnavailable:`Send a message before forking this conversation.`,sidebarForkArchived:`Restore this conversation before forking.`,sidebarForkFailed:`Could not create the fork. The original conversation is unchanged.`,sidebarCopy:`Copy`,sidebarCopyLink:`Copy conversation link`,sidebarCopyMarkdown:`Copy as Markdown`,sidebarCopyCwd:`Copy working directory`,sidebarCopied:`Copied`,sidebarCopyFailed:`Could not copy. Try again.`,sidebarNewWindow:`Open in new window`,sidebarOpenIn:`Open in`,sidebarAppsLoading:`Loading available apps…`,sidebarAppsFailed:`Unable to load apps. Reopen menu to retry.`,sidebarOpenFailed:`Unable to open this project in the selected app.`,sidebarArchive:`Archive`,sidebarRestore:`Restore`,sidebarDelete:`Permanently delete`,managedWorktreeRecoveryFull:`Check earlier unfinished removal requests before starting another.`,managedWorktreesChanged:`The worktree list changed. Refresh it before reviewing a target.`,managedWorktreesRefresh:`Refresh worktrees`,managedWorktreesBack:`Back to worktrees`,managedWorktreesRetry:`Retry request`,managedWorktrees:`Retained worktrees`,managedWorktreesDescription:`Worktrees created by OpenPI are kept when a conversation is deleted. Review an exact path before requesting removal. Active, shared, changed or unverified worktrees stay in place.`,managedWorktreeConfirm:`Remove this managed worktree? The server rechecks ownership, active conversations and local changes before removal.`,managedWorktreeRemoved:`Worktree removed.`,managedWorktreePreserved:`Worktree kept:`,managedWorktreeUncertainTerminal:`Removal outcome is uncertain. Automatic removal cannot be repeated. Inspect the retained path before taking further action.`,managedWorktreeUncertain:`Removal outcome is unknown. Retry to check the original request.`,managedWorktreeRemoving:`Checking and removing…`,managedWorktreeRemove:`Remove worktree`,managedWorktreeReview:`Review removal`,managedWorktreesEmpty:`No managed worktrees were found on this page.`,managedWorktreesUnavailable:`{{count}} ownership records could not be verified.`,managedWorktreesLoadFailed:`Could not load retained worktrees. Retry without changing the target.`,managedWorktreesMore:`Load more worktrees`,managedWorktreeRetainedAfterDelete:`Conversation deleted. Worktree kept at {{path}}. Review retained worktrees in the project menu.`,sidebarDeleteTitle:`Delete conversation?`,sidebarDeleteDescription:`Permanently delete “{{name}}”? This cannot be undone.`,sidebarDeleteConfirm:`Delete`,sidebarDeleting:`Deleting…`,sidebarDeleteFailed:`Could not delete this conversation. Retry or cancel.`,sidebarActionRunning:`Let current work and queued messages finish first.`,sidebarActionDisconnected:`Reconnect before changing this conversation.`,sessionDeleteCancelled:`Deletion cancelled`,sessionDeleteUncertain:`Could not confirm whether the conversation was deleted. Refresh and try again.`,sessionDeleted:`Conversation permanently deleted`,sessionDeleteMetadataPending:`The conversation was deleted, but its sidebar records could not be fully cleared.`,sessionLinkUnavailable:`The linked conversation no longer exists or its identity has changed.`,sidebarDropPin:`Drop here to pin`,sidebarDropProjectLast:`Move project to the end`,conversationTurns:`Conversation turns`,conversationTurnPosition:`Go to turn {{position}}`,turnPreviewLoading:`Loading preview…`,turnPreviewUnavailable:`Preview unavailable. Try again.`,commands:`Slash commands`,addContext:`Add context`,fileReference:`Reference workspace file`,fileReferenceTitle:`Reference workspace file`,fileReferenceDetail:`Add a path reference to the prompt without uploading file contents.`,fileReferenceLabel:`Workspace file path`,fileReferencePlaceholder:`src/app.tsx`,fileReferenceValidatedHint:`The current Session verifies that this is a readable workspace file.`,fileReferenceDraftHint:`This path will be resolved by Pi after the new Session starts.`,fileReferenceChecking:`Checking…`,fileReferenceFailed:`Could not verify this file.`,fileReferenceDenied:`Choose a file inside the current Session workspace.`,fileReferenceMissing:`This workspace file no longer exists.`,fileReferenceUnsupported:`Only regular workspace files can be referenced.`,fileReferenceExpired:`The active Session changed. Reopen the file reference and try again.`,fileReferenceBusy:`File validation is busy. Try again shortly.`,insertReference:`Insert reference`,commandsSessionRequired:`Slash commands are available after the Session starts.`,commandsEmptyDraftOnly:`Slash commands can be inserted only into an empty draft.`,commandsLoading:`Loading commands...`,commandsUnavailable:`Commands are temporarily unavailable.`,commandsNoMatch:`No matching commands.`,commandsNoAvailable:`No discovered commands can run in Web. Type a command name to inspect its availability.`,commandsBounded:`{{count}} more commands are not shown.`,commandSessionRequired:`Commands require an active Web session.`,commandUnsupported:`Not adapted · manual commands still reach Pi`,commandAcceptsArguments:`Accepts arguments`,commandSource_extension:`Extension`,commandSource_prompt:`Prompt template`,commandSource_skill:`Skill`,copiedMessage:`Copied`,copyMessage:`Copy message`,copyFailed:`Copy failed. Please select and copy the message manually.`,copiedCode:`Code copied`,copyCode:`Copy code`,copyCodeFailed:`Could not copy this code. Select and copy it manually.`,codeBlock:`Code block`,wrapCode:`Wrap lines`,expandCode:`Show all {{count}} lines`,collapseCode:`Collapse code`,expandInput:`Expand input`,collapseInput:`Collapse input`,deleteWorkspace:`Delete workspace`,describeTask:`Describe a task`,editMessage:`Edit and rerun from here`,enterHint:`Enter to send, Shift+Enter for a new line.`,expandSidebar:`Expand sidebar`,importWorkspace:`Import workspace`,loadingModels:`Loading models...`,modelsTruncated:`Showing {{shown}} models. {{omitted}} more are available; search to find them.`,searchModels:`Search available models`,searchModelsPlaceholder:`Search provider, model name, or ID...`,searchingModels:`Searching models...`,noMatchingModels:`No matching models`,modelSearchFailed:`Could not search models. Try again.`,retryModelSearch:`Retry model search`,fileReferenceDraftChanged:`The draft changed. Reopen the file reference.`,modelSearchTruncated:`{{omitted}} matching models are not shown.`,modelPreparing:`Preparing task...`,modelRetrying:`Retrying model request...`,modelRunning:`Working…`,modelRequestFailed:`Model request failed`,modelRequestStopped:`Model request stopped`,modelFailureUnknown:`The provider did not return an error reason.`,retryPrompt:`Retry prompt`,retryingPrompt:`Retrying...`,newSession:`New session`,noConversations:`No conversations yet`,noMatching:`No matching conversations`,noMatchingLoaded:`No matching conversations in the loaded history`,noModels:`No models available`,noOutput:`no output`,noSessions:`No sessions`,openSidebar:`Open sidebar`,promptMessage:`Send a message or start a task, / for commands`,promptReadonly:`A non-active session cannot receive prompts`,promptStart:`Choose a workspace to begin.`,promptTask:`Describe what you want to build.`,queuedHint:`The message will be queued after the current turn.`,reconnecting:`Reconnecting`,removeWorkspace:`Remove from sidebar`,workspaceOptions:`Workspace options`,renameFailed:`Could not save the name. Your changes were kept.`,savingName:`Saving...`,workspaceRemoveFailed:`Could not remove the workspace. Try again.`,removingWorkspace:`Removing...`,renameConversation:`Rename conversation`,renameWorkspace:`Rename workspace`,save:`Save`,searchConversations:`Search conversations`,searchPlaceholder:`Filter titles and workspaces…`,selectModel:`Select model`,configureModels:`Configure models`,openModelSettings:`Model settings`,selectThinking:`Select thinking level`,thinkingAvailableLevels:`Available: {{levels}}`,resetThinking:`Restore the opening level ({{level}})`,modelThinkingNotEnabled:`Thinking is not enabled for this model. Enable reasoning support in model settings if your provider supports it.`,providerReasoningHint:`Enable only if the provider supports reasoning. Adjust the active level in the composer.`,providerThinkingLevels:`Supported thinking levels`,providerThinkingLevelsHint:`Choose the levels this model supports. Saving updates the conversation picker.`,providerThinkingAutomatic:`Automatic (Pi defaults)`,providerThinkingSelected_one:`{{count}} level selected`,providerThinkingSelected_other:`{{count}} levels selected`,providerThinkingReset:`Use Pi defaults`,providerImageHint:`When Image is unchecked, the model will not receive image attachments.`,selectWorkspace:`Select workspace`,send:`Send`,processDetails:`Execution details`,processRunning:`Working`,processThinkingCount_one:`{{count}} reasoning note`,processThinkingCount_other:`{{count}} reasoning notes`,processToolCount_one:`{{count}} tool call`,processToolCount_other:`{{count}} tool calls`,processFailureCount_one:`{{count}} failed`,processFailureCount_other:`{{count}} failed`,runtimeActivities:`Activity`,activityAgentProgress:`{{completed}}/{{total}} agents finished`,activityCapacity:`Concurrent tasks: {{running}}/{{limit}} · {{queued}} waiting`,composerQueuedCount:`Queued {{count}}`,composerSteeringCount:`Steering {{count}}`,runtimeActivityRunning_one:`{{count}} running`,runtimeActivityRunning_other:`{{count}} running`,runtimeActivityCount_one:`{{count}} activity`,runtimeActivityCount_other:`{{count}} activities`,processActivityCount_one:`{{count}} agent activity`,processActivityCount_other:`{{count}} agent activities`,switchingSession:`Switching session...`,thinkingActive:`Thinking...`,thinkingActiveLevel:`Thinking ({{level}})...`,thinkingDone:`Thinking`,thinkingLoadFull:`Load full thinking`,thinkingLoadingFull:`Loading thinking…`,thinkingLoadFailed:`Unable to load thinking. Retry`,thinkingPartialText:`Showing part of the saved thinking. More text can be loaded below.`,thinkingPreviewOnly:`Thinking preview reached its limit. The full saved text will be available when this message finishes.`,toolState_running:`Running`,toolState_returned:`Returned`,toolState_failed:`Failed`,toolState_cancelled:`Stopped`,toolState_timed_out:`Timed out`,toolState_unknown:`Unconfirmed`,toolSnapshotMissingResult:`No result at fork`,toolActivity_running:`{{action}}…`,toolActivity_failed:`{{action}} failed`,toolActivity_cancelled:`{{action}} stopped`,toolActivity_timed_out:`{{action}} timed out`,toolActivity_unknown:`{{action}}`,toolAction_read:`Read`,toolAction_write:`Write file`,toolAction_edit:`Edit file`,toolAction_command:`Run command`,toolAction_search:`Search`,toolAction_list:`List files`,toolAction_web:`Browse web`,toolAction_agent:`Agent activity`,subagentAction_spawn:`Start subagent`,subagentAction_send:`Send follow-up`,subagentAction_check:`Check subagent`,subagentAction_wait:`Wait for subagent`,subagentAction_cancel:`Stop subagent`,subagentActionDone_spawn:`Started subagent`,subagentActionDone_send:`Sent follow-up`,subagentActionDone_check:`Checked subagent`,subagentActionDone_wait:`Finished waiting`,subagentActionDone_cancel:`Stop request returned`,toolAction_workflow:`Workflow`,toolAction_plan:`Prepare plan`,toolAction_git:`Review changes`,toolAction_call:`Use tool`,toolActionDone_read:`Read`,toolActionDone_write:`Wrote file`,toolActionDone_edit:`Edited`,toolActionDone_command:`Ran command`,toolActionDone_search:`Searched`,toolActionDone_list:`Listed files`,toolActionDone_web:`Browsed web`,toolActionDone_agent:`Agent activity returned`,toolActionDone_workflow:`Workflow tool returned`,toolActionDone_plan:`Plan tool returned`,toolActionDone_git:`Reviewed changes`,toolActionDone_call:`Used tool`,toolActionGroup_read:`read files`,toolActionGroup_write:`write files`,toolActionGroup_edit:`edit files`,toolActionGroup_command:`run commands`,toolActionGroup_search:`search`,toolActionGroup_list:`list files`,toolActionGroup_web:`browse web`,toolActionGroup_agent:`agent activity`,toolActionGroup_workflow:`workflow activity`,toolActionGroup_plan:`planning`,toolActionGroup_git:`review changes`,toolActionGroup_call:`use tools`,toolGroup_done:`Activity · {{actions}}`,toolGroup_running:`Working · {{actions}}`,toolGroup_unknown:`Activity · {{actions}}`,toolGroupSeparator:`, `,toolSearchTarget:`“{{pattern}}” · {{path}}`,toolDiffStatsHelp:`Added and removed lines in the displayed diff`,toolRequestedFile:`File:`,toolWorkspace:`Workspace`,toolRawEvidence:`Arguments and original result`,toolCodemodeDetails:`Script and original result`,toolNestedOutputMissing:`This session records the call and its status, but not the nested tool output.`,toolNestedArgumentsMissing:`This session omits the full arguments and nested tool output.`,toolNestedIncomplete:`The nested-call record is incomplete; some calls, arguments or final states are unavailable.`,toolPartialEvidence:`Partial output: a byte, line or item limit was reached. The original result may also be truncated.`,toolFileChange_created:`File created`,toolFileChange_unchanged:`No content changes`,toolFileChange_overwritten:`File overwritten`,toolChangeUnavailable:`This result does not include a change comparison.`,toolTestResults:`Reported test results · {{format}}`,toolTestCounts:`{{tests}} tests · {{passed}} passed · {{failed}} failed · {{cancelled}} cancelled`,toolTestCountsHelp:`Counts come from command output. The execution status is shown separately.`,toolReadMore:`Read another range using the path and offset. The original result contains continuation details.`,toolFullOutputReference:`Full output:`,subagentBackgroundResult_one:`Background subagent result · {{count}}`,subagentBackgroundResult_other:`Background subagent results · {{count}}`,thinkingDraftHint:`Choose a workspace and create a session first.`,thinkingInactiveHint:`Only the active session can change its thinking level.`,thinkingLevelMismatch:`The confirmed thinking level is not offered by the current model. Choosing another level will correct it.`,thinkingLockedRunning:`Stop the current turn before changing the thinking level.`,thinkingModelPendingHint:`Wait for the model change to finish.`,thinkingNotConfirmed:`Thinking level was not confirmed. Please try again.`,thinkingPendingHint:`Applying the thinking level...`,thinkingUnsupported:`Thinking is unavailable`,thinkingUnsupportedHint:`No model is selected, or the current model does not support thinking.`,unavailable:`Unavailable`,ungrouped:`Ungrouped`,untitledSession:`New session`,workspaceDeleteConfirm:`The folder and conversation records will be kept. Its conversations will move to Ungrouped.`,workspaceName:`Workspace name`,workspaces:`Workspaces`,sidebarProjects:`Projects`}},zh:{translation:{quitOpenPI:`退出 OpenPI`,quittingOpenPI:`正在退出…`,quitConfirmHelp:`确定退出此 OpenPI Web 应用吗?此 Web 应用中所有正在运行的任务都会停止,对话会保存,重启后可继续查看。`,quitTabHelp:`仅关闭浏览器标签页会让 OpenPI 和任务继续在后台运行。`,quitAccepted:`OpenPI 正在关闭`,quitAcceptedHelp:`退出请求已接受。请等待终端确认 OpenPI 已停止,然后可以关闭此标签页。`,quitRestartHelp:`重新启动:在终端运行 openpi web,或在 Pi 中运行 /web,然后打开显示的地址。刷新此页面不会重启 OpenPI。`,quitFailed:`无法确认是否已关闭。请先检查终端,再重试。也可以在 OpenPI 所在终端按 Ctrl+C 停止应用。`,promptPending:`正在处理请求…`,commandFeedbackTruncated:`这里只显示部分命令结果。请缩小查询范围,或在 TUI 查看完整输出。`,planMode_inactive:`普通模式`,planMode_planning:`规划中 · 禁止写入`,planMode_ready:`计划就绪 · 等待审阅`,planMode_invalid:`计划状态异常 · 禁止写入`,planModeEnter:`进入规划`,promptPlanMessage:`本次对话使用 Plan 模式 · 继续讨论计划,暂不实施`,planModeUnconfirmed:`暂时无法确认 Plan 状态,请刷新后再继续。`,planModeExit:`退出规划`,planModeImplement:`准备实施提示`,planImplementationReplaceDraft:`准备实施会替换当前草稿并关闭规划模式,但不会发送提示词。是否继续?`,commandSupport_plan:`支持规划和准备当前会话的实施提示;新建实施会话仍需使用 TUI。`,commandSupport_setup:`通过当前模型配置,在 Web 回答问题。`,handoffWaiting:`需要你操作`,handoffDone:`已完成`,handoffUnable:`无法完成`,handoffDoneHelp:`已执行操作,接下来由模型验证结果。`,handoffUnableHelp:`未能完成,可以补充遇到的障碍。`,handoffReview:`复核状态`,handoffSubmit:`提交状态`,handoffSignal:`预期结果:`,handoffVerify:`提交完成后,模型仍需验证结果;你的反馈本身不代表验证成功。`,planCardLabel:`开发计划`,planCardReady:`计划已就绪`,planCardResult:`计划结果`,planCardNotApproval:`此步骤仅生成计划,不代表已批准或开始实施。`,planCardCollapse:`收起`,planCardExpand:`展开`,planCardCopy:`复制计划`,planCardCopyPreview:`复制可见预览`,planCardTruncated:`当前仅显示截断预览。`,planCardLoadFull:`加载完整计划`,planCardLoadingFull:`正在加载计划...`,planCardLoadFailed:`无法加载完整计划,重试`,planCardEvidence:`工具结果 · plan_ready`,questionWaiting:`问题`,questionPreview:`查看预览`,questionSkip:`跳过`,questionProgress:`{{current}} / {{total}}`,questionReview:`复核答案`,questionReviewTitle:`确认这些选择?`,questionReviewHelp:`可以返回修改,点击提交后才会发送给助手。`,questionEdit:`修改答案:{{question}}`,questionDismiss:`关闭提问,不提交答案`,questionCustom:`或自行撰写回复`,questionCustomHelp:`留空提交,表示希望助手把问题说清楚或拆小。`,questionYourAnswer:`你的答案`,questionCustomPlaceholder:`说说你的想法…`,questionNotes:`补充说明(选填)`,questionNotesPlaceholder:`补充限制条件,或解释你的选择…`,questionRephrase:`请助手把问题说清楚或拆小`,questionBack:`上一步`,questionNext:`下一题`,questionSubmit:`提交答案`,questionSubmitting:`正在提交…`,questionRetry:`核对提交结果`,questionUncertain:`暂时无法确认是否送达,已保留本次提交的答案。点击核对可恢复结果,不会重复提交。`,questionDisconnected:`正在重新连接… 已保留你的选择,暂时无法提交。`,questionLimit:`每项答案或补充说明不能超过 {{count}} 个 UTF-8 字节。`,questionLoadFailed:`暂时无法读取等待回答的问题。`,questionDraftLimit:`提问草稿已达上限,请缩短或清空已有答案后再添加内容。`,questionRetryLoad:`重试`,questionCloseReceipt:`关闭问答状态提示`,questionState_dismissed:`已关闭提问,没有提交答案。`,questionState_cancelled:`提问已取消,没有提交答案。`,questionState_expired:`提问已过期,没有提交答案。`,questionState_stale:`该提问已失效,请查看对话中的处理结果。`,conversationView:`会话视图`,jumpToLatest:`跳至最新`,historyLoading:`正在加载历史…`,historyOmitted:`还有 {{count}} 条较早记录 · 向上滚动自动加载`,historyChanged:`会话分支已更改,已切换到当前分支的历史。`,historyUnavailable:`历史记录加载失败,请重试。`,historyValidationUnavailable:`无法校验会话历史,请重试。`,historyVerifying:`正在校验会话历史…`,messageLoadFull:`加载完整消息`,messageLoadMore:`加载更多`,messageLoadingFull:`正在加载消息…`,messageLoadFailed:`无法加载这条消息,重试`,filePreview:`文件预览`,changeEvidence:`变更`,changeEvidenceScope:`按所选范围查看当前工作目录的只读 Git 变更。`,turnLabel:`第 {{number}} 轮`,turnState_running:`运行中`,turnState_complete:`已完成`,turnState_failed:`失败`,turnState_interrupted:`已中断`,turnState_waiting:`等待回复`,turnState_forked:`已分叉,可继续对话`,turnChanges:`本轮更改 {{count}} 个文件`,turnChangesPartial:`本轮已记录 {{count}} 个文件`,turnChangesIncomplete:`这一轮的变更记录不完整。`,turnChangesMore:`再显示 {{count}} 个文件`,turnChangesLess:`收起文件`,turnChangesReview:`审阅本轮变更`,turnChangesReviewButton:`审阅`,turnChangesBack:`返回本轮变更`,turnChangesLoading:`正在加载本轮变更…`,turnChangesUnavailable:`无法读取本轮保存的差异。`,messageCopyRequiresFull:`加载完整消息后才能复制。`,filesChanged:`{{count}} 个文件已更改`,reviewChanges:`查看变更`,workspaceChanges:`工作区更改`,overviewChanges:`变更`,overviewLineTotals:`当前 Git 比较范围内的文本新增与删除行数`,overviewPartialTotals:`仅展示已核实的行数,部分文件尚无法统计。点击变更查看详情。`,overviewCounting:`统计中…`,overviewCountsUnknown:`行数未知`,overviewReviewUnavailable:`暂不可用`,sessionSources:`来源`,sourcesAdd:`添加来源`,sourcesDescription:`查看此对话附加的图片与文件`,sourceAttached:`已附加到对话`,sourcesEmpty:`暂无来源`,sourcesFailed:`来源加载失败。`,sourcesViewAll:`查看全部`,sourcesLoadMore:`加载更多来源`,sourcesBack:`返回来源列表`,sourcesPartial:`已达到列表展示上限,更早的来源仍可在对话中查看。`,turnChangesScope:`该轮开始至结束的工作区差异 · 已保存`,turnEdits:`已编辑 {{count}} 个文件`,turnEditsPartial:`已记录 {{count}} 个文件的编辑`,turnEditsScope:`本轮文件工具写入记录 · 已保存;不含命令行与外部修改`,turnEditStatsUnknown:`行数未知`,turnEditReason_before_unavailable:`文件已写入,但该操作未授权读取旧内容,无法提供可靠的前后差异。`,turnEditReason_content_limit:`文件已写入,内容超过已保存对比的大小限制,无法提供准确行数。`,turnEditReason_concurrent_change:`文件在已记录的操作之间发生了变化,无法确认本轮净增删行数。`,gitReviewLoadedCount:`已载入 {{count}} 个文件`,gitReviewPartialLabel:`部分`,gitReviewSearch:`搜索文件路径`,gitReviewExpand:`展开审阅`,gitReviewSearchLoaded:`搜索已载入文件`,gitReviewMarkViewed:`标记 {{path}} 为已查看`,gitReviewMarkCurrentViewed:`标记当前文件 {{path}} 为已查看`,gitReviewViewedLabel:`已查看`,gitReviewViewedProgress:`已查看 {{viewed}} / 已加载 {{loaded}} 个文件`,gitReviewViewedLimit:`本次对比最多保留 {{count}} 个已查看标记。`,gitReviewNoMatch:`没有匹配的文件。`,gitReviewNoLoadedMatch:`已载入文件中没有匹配项。`,gitReviewLoadNext:`载入下一批文件`,gitReviewChanged:`工作区已有变化,请刷新清单后继续载入。`,gitReviewNewVersion:`有新的更改,当前仍显示你正在阅读的版本。`,gitReviewShowLatest:`查看最新差异`,gitReviewBinary:`此二进制文件无法显示文本差异。`,gitReviewBinaryShort:`二进制`,gitReviewPendingStats:`待读取`,gitReviewComparison:`{{current}} 对比 {{base}}`,gitReviewWorkingTree:`工作区对比 HEAD`,gitReviewSessionSnapshot:`自本会话开始后的变更`,gitReviewDetached:`游离 HEAD`,gitReviewLoading:`正在读取 Git 变更…`,gitReviewRetry:`重试`,gitReviewRefresh:`刷新变更`,gitReviewOlderResult:`当前显示上一次读取结果。`,gitReviewNotRepository:`此工作区不是 Git 仓库。`,gitReviewUnborn:`此仓库还没有可读取的 HEAD。`,gitReviewFailed:`无法读取 Git 变更。`,gitReviewTruncated:`结果不完整,部分文件或差异未载入。`,gitReviewEmpty:`当前范围内没有文件变更。`,gitReviewHiddenLines:`另有 {{count}} 行 diff 未显示。`,gitReviewDiffTruncated:`快照已达到大小上限,未加载此文件的 diff。`,gitReviewShowMore:`再显示 {{count}} 个文件`,gitReviewBackToFiles:`返回变更文件`,gitReviewFilePreview:`{{file}} 的差异`,gitReviewNoDiff:`此文件没有可显示的文本差异。`,changeDiff:`变更差异`,diffViewMode:`差异视图`,diffUnified:`统一`,diffSplit:`并排`,diffBefore:`修改前`,diffAfter:`修改后`,diffView:`差异`,gitFileStatus_added:`已新增`,gitFileStatus_modified:`已修改`,gitFileStatus_deleted:`已删除`,gitFileStatus_renamed:`已重命名`,gitFileStatus_copied:`已复制`,gitFileStatus_untracked:`未跟踪`,gitFileStatus_unknown:`已变更`,closePreview:`关闭预览`,imageZoom:`图片缩放`,imageZoomHelp:`缩放相对于适应窗口。Ctrl + 滚轮缩放,放大后可拖动查看。`,zoomIn:`放大图片`,zoomOut:`缩小图片`,previousImage:`上一张图片`,nextImage:`下一张图片`,imagePosition:`第 {{current}} 张,共 {{total}} 张图片`,artifactReadOnly:`只读`,artifactReferenceUnavailable:`此视图无法打开文件预览:{{path}}`,artifactSession:`所属会话 {{sessionId}}`,copyFilePath:`复制文件路径`,filePathCopied:`已复制文件路径`,refreshFile:`刷新文件`,downloadFile:`下载文件`,downloadingFile:`正在下载…`,artifactOlderPreview:`当前显示旧版预览。`,readingFile:`正在读取文件…`,artifactVersion:`版本`,artifactBytes:`{{count}} 字节`,artifactPreviewTruncated:`预览已截断;下载文件可获取完整内容。`,artifactUnsupported:`此类型无法预览,请下载文件。`,filesLargeMarkdownSource:`Markdown 预览较大,已显示为源码以保持滚动流畅。已加载的文字全部保留。`,chatView:`对话`,trajectory:`执行轨迹`,trajectoryScope:`按记录顺序展示会话消息,不表示执行耗时,也不是完整模型请求。`,trajectoryRunning:`任务仍在进行。已保存记录到达后自动更新;实时生成内容可在“对话”中查看。`,trajectoryTruncated:`当前历史不完整:省略 {{entries}} 条记录、{{parts}} 个内容片段,{{messages}} 条消息被截断。`,trajectoryEmpty:`尚无已保存记录。`,trajectoryOrder:`记录顺序`,trajectoryOverview:`总览`,trajectorySequenceHint:`按记录顺序排列 · 宽度不表示执行耗时`,trajectoryClearRange:`清除选区`,trajectoryContextLane:`上下文`,trajectoryModelLane:`模型`,trajectoryToolLane:`工具`,trajectorySelectRecord:`选择记录 {{number}}:{{name}}`,trajectoryTimingTab:`时间`,trajectoryUsageTab:`用量`,trajectoryDurationLabel:`耗时`,trajectoryTimingSource:`数据来源`,trajectoryTimingUnknown:`尚未记录执行耗时。保存时间不等于操作开始时间。`,trajectoryTimingNative:`Pi 嵌套工具执行记录`,trajectoryTTFT:`首段输出等待`,trajectoryGenerationTime:`生成时间`,trajectoryThroughput:`每秒输出 tokens`,trajectoryNotRecorded:`未记录`,trajectoryUsageUnknown:`已加载记录中没有此响应的 token 用量。`,trajectoryUsage_input:`未缓存输入`,trajectoryUsage_cacheRead:`缓存读取`,trajectoryUsage_cacheWrite:`缓存写入`,trajectoryUsage_output:`输出`,trajectoryProvider:`提供商`,trajectoryModel:`模型`,trajectoryCode:`代码`,trajectoryWrap:`自动换行`,trajectoryCopy:`复制原文`,trajectoryCopied:`已复制`,trajectoryRawArguments:`原始 JSON`,trajectoryFoldTurns:`回合`,trajectoryFoldCalls:`工具调用`,trajectoryMetrics:`已加载执行摘要`,trajectoryRequestCount:`{{count}} 次模型响应`,trajectoryToolCount:`{{count}} 次工具调用`,trajectoryModelResponses:`模型响应`,trajectoryToolCalls:`工具调用`,trajectoryLastTurn:`最近已记录回合`,trajectoryEventColumn:`事件`,trajectoryContentColumn:`内容`,trajectoryTurn:`回合 {{number}}`,trajectoryLoadHistory:`加载更早历史`,trajectoryLatestRecords:`回到最新记录`,trajectoryHistoryLoading:`正在加载历史…`,trajectoryNestedOutputMissing:`Pi 已记录此嵌套调用的状态,但未保存其结果正文。外层脚本输出单独保留。`,trajectoryRecordCount:`{{count}} 条记录`,trajectoryMatches:`{{count}} 条匹配`,trajectorySearch:`搜索已加载记录`,trajectoryNoMatches:`没有匹配的记录。`,trajectoryEarlierGroup:`较早上下文`,trajectoryEventCount:`{{count}} 条会话变更`,trajectorySummary:`概览`,trajectoryInputTab:`输入`,trajectoryResultTab:`结果`,trajectoryConversationGroup:`本轮对话`,trajectoryReasoningTitle:`思考`,trajectoryRecordNumber:`记录 {{number}}`,trajectoryRecordInfo:`记录信息`,trajectoryRecordId:`记录 ID`,trajectoryCallId:`工具调用 ID`,trajectoryEventType:`事件类型`,trajectoryEvent_model_change:`切换模型`,trajectoryEvent_thinking_level_change:`调整思考级别`,trajectoryEvent_compaction:`压缩上下文`,trajectoryEvent_session_info:`更新会话信息`,trajectoryEvent_custom:`会话记录`,trajectoryEarlier:`显示更早记录(已加载历史中还有 {{count}} 条)`,trajectoryDetails:`记录详情`,trajectoryRecordedAt:`记录时间`,trajectoryEvidenceTruncated:`此证据在会话投影中已被截断。`,trajectoryArguments:`工具参数`,trajectoryRecordedContent:`已记录内容`,trajectoryThinking:`模型返回的推理内容`,trajectoryOutput:`工具结果`,trajectoryMissingResult:`当前记录中没有可明确配对的结果。这不表示工具仍在运行。`,trajectoryStructured:`结构化结果`,trajectoryEventOnly:`当前仅提供此事件的类型和记录时间。`,trajectory_user:`用户消息`,trajectory_assistant:`助手回复`,trajectory_call:`工具调用`,trajectory_result:`未配对结果`,trajectory_event:`会话事件`,trajectoryRole_user:`用户`,trajectoryRole_assistant:`助手`,trajectoryRole_call:`工具`,trajectoryRole_result:`结果`,trajectoryRole_event:`事件`,trajectory_returned:`工具已返回结果。`,trajectory_error:`工具返回错误`,trajectory_unknown:`尚无法确定结果`,runtimeStatus:`运行状态`,runtimeIdentity:`OpenPI 运行信息`,runtimeIdentityHint:`后端信息在启动时采样,不随之后的磁盘改动或会话重新加载更新,也不证明所有模块的加载版本。前端标识对应当前页面构建。`,runtimeIdentityFailed:`无法读取后端运行信息,请重试。`,runtimeBackendVersion:`后端包版本`,runtimePackageRoot:`后端包目录`,runtimeStartedAt:`进程启动时间`,runtimeGitRevision:`启动时 Git 提交`,runtimeGitState:`启动时工作区状态`,runtimeGitDirty:`存在本地改动`,runtimeGitClean:`干净`,runtimeFrontendVersion:`页面包版本`,runtimeFrontendBuild:`页面构建标识`,runtimeStartupBuild:`后端启动时记录的页面构建标识`,runtimeDevelopmentBuild:`开发服务器(无生产构建标识)`,runtimeBuildMismatch:`当前页面构建与后端启动时记录的构建不同。请刷新页面或重启服务后重新检查。`,refreshStatus:`刷新状态`,openTools:`打开工具`,openToolsUnavailable:`选择会话后可打开工具`,sideConversation:`侧边对话`,sideConversationDescription:`在独立 Pi 会话中追问具体问题,不打断当前主任务。`,workbarChangesDescription:`查看当前目录的未暂存、已暂存、分支或会话变更。`,terminal:`终端`,renameTerminal:`重命名终端`,terminalName:`终端名称`,workbarTerminalDescription:`打开当前工作区的交互式终端。`,restartTerminal:`重新启动终端`,reconnectTerminal:`重新连接终端`,restartTerminalTitle:`重新启动此终端?`,restartTerminalDetail:`当前终端会被关闭,其中运行的进程可能被中断。`,terminalReconnecting:`正在重新连接终端...`,terminalScrollToBottom:`回到底部`,terminalOutputResynced:`终端输出已重新同步`,terminalRestarting:`正在重新启动终端...`,terminalConnecting:`正在启动终端…`,terminalExited:`终端已退出。`,terminalExitCode:`终端已退出,状态码 {{code}}。`,terminalDisconnected:`终端连接意外中断。`,terminalError:`终端不可用。`,terminalLoadError:`终端界面加载失败,请刷新页面后重试。`,reloadPage:`刷新页面`,browser:`浏览器`,sessionFileRecords:`本会话文件记录`,gitReviewSource:`变更范围`,gitReviewBaseBranch:`对比分支`,gitReviewChooseBase:`选择对比分支`,gitReviewSearchBranches:`搜索分支`,gitReviewLocalBranch:`本地分支`,gitReviewRemoteBranch:`远程分支`,gitReviewBranchesTruncated:`显示有数量限制的分支列表,部分分支已省略。`,gitReviewNoMatchingBranches:`没有匹配的分支。`,gitReviewBaseUnavailable:`没有可用的默认对比分支。请选择分支以审阅已提交的变更。`,gitReviewBaseInvalid:`所选对比分支已不可用,请选择其他分支。`,gitReviewUnstaged:`未暂存(含未跟踪)`,gitReviewStaged:`已暂存变更`,gitReviewBranch:`分支变更`,gitReviewFileMissing:`此文件在当前范围内已无变更,请刷新文件列表。`,artifactExternalAccess:`此文件位于其他工作目录。可为当前会话授权只读打开这一个文件,不会开放其他文件的访问。`,artifactAuthorizeFile:`只读打开此文件`,sideConversationPending:`正在准备侧边会话…`,resizeSidebar:`调整侧边栏宽度`,resizePanes:`调整面板宽度`,resizeWorkbar:`调整工具栏宽度`,browserPasteTooLarge:`每次最多粘贴 {{count}} 个字符。`,browserInputTooLarge:`每次最多输入 {{count}} 个字符。`,browserInputTargetChanged:`输入目标已变化或无法确认,有输入操作未执行。`,workbarBrowserDescription:`在 OpenPI 工作栏内打开并操作网页。`,browserReady:`输入地址开始浏览`,browserStarting:`正在启动内嵌浏览器…`,browserOpened:`已在内嵌浏览器中打开`,browserOpenAgain:`再次打开`,browserOpenFailed:`内嵌浏览器暂不可用。`,browserBack:`后退`,browserForward:`前进`,browserReload:`重新加载`,browserTabs:`网页标签页`,browserNewTab:`新标签页`,browserAddTab:`新建网页标签页`,browserCloseTab:`关闭 {{title}}`,browserTabLimit:`最多打开 {{count}} 个网页标签页`,browserPageTitle:`网页:{{address}}`,browserEnteredAddress:`最近从此地址栏打开的地址`,browserAddressNotAllowed:`请输入不含用户名或密码、且不属于 OpenPI 自身地址的 HTTP(S) 网址。`,browserLocationUnknown:`网页已跳转,新地址无法读取。重新加载会返回你输入的地址。`,browserDirectDescription:`直接浏览网页。不允许嵌入的网站可在外部浏览器打开。`,browserDirectHint:`地址栏仅记录手动打开的地址。网页弹窗在外部浏览器打开;遇到空白页,可点击外部打开。`,browserEnhancedHint:`浏览增强已开启:地址自动同步,普通弹窗链接在内部标签页打开。部分站点限制、登录弹窗和跨站历史仍需外部浏览器。`,files:`文件`,filesExplorer:`工作区文件`,filesSearch:`筛选文件…`,refreshFiles:`刷新文件`,filesWorkspaceActions:`工作区文件操作`,filesCreateMenu:`新建`,filesImportMenu:`导入`,filesMoreMenu:`更多`,filesNewFile:`新建文件`,filesNewDirectory:`新建文件夹`,filesImport:`导入文件`,filesImportFolder:`导入文件夹`,filesImportFolderChoose:`选择要导入的文件夹`,filesImportFolderLimit:`每次最多导入 2,000 个文件和文件夹,目录层级最多 64 层。`,filesSelectMultiple:`多选文件`,filesSelectItem:`选择 {{name}}`,filesSelectedCount:`已选 {{count}} 项`,filesRename:`重命名`,filesNewName:`新名称`,filesMove:`移动`,filesMoveDestination:`目标文件夹(工作区内相对路径)`,filesTrashAction:`移入回收站`,filesTrash:`工作区回收站`,filesTrashDetail:`移除的文件保留在当前工作区,可恢复;不会覆盖同名文件。`,filesTrashEmpty:`暂无已移除文件`,filesTrashUnavailable:`{{count}} 项记录无法核验,内容仍保留在 .openpi-trash 中,暂不能自动恢复。`,filesRestore:`恢复`,filesRestoreItem:`恢复 {{name}}`,filesUndoTrash:`撤销移除`,filesOrganizationResults:`文件操作结果`,filesOperationDone:`完成`,filesRefreshBeforeOrganizing:`请先刷新文件树,再整理这项文件。`,filesImportChoose:`选择要导入的文件`,filesTargetDirectory:`目标目录`,filesWorkspaceRoot:`工作区根目录`,filesFileName:`文件名称`,filesDirectoryName:`文件夹名称`,filesCreate:`创建`,filesCreating:`创建中…`,filesCreated:`已创建:{{path}}`,filesNameInvalid:`请输入单个文件或文件夹名称,不要包含路径分隔符。`,filesNameExists:`此名称已存在,请更换名称;原有文件已保留。`,filesMutationFailed:`写入失败,输入已保留。`,filesWriteUnavailable:`请先切换到此会话,再修改工作区文件。`,filesImportLimit:`每个文件最多 50 MiB,同名文件不会覆盖。`,filesImportTooLarge:`此文件超过 50 MiB 导入上限。`,filesImportDirectoryUnsupported:`不支持导入整个文件夹,请选择其中的文件。`,filesImportResults:`文件导入结果`,filesImportPending:`等待导入`,filesImporting:`导入中…`,filesImported:`已保存到工作区`,filesImportedNoPreview:`已保存。预览上限为 20 MiB;可复制路径,在对话中引用此文件。`,filesClearImported:`清除已完成的导入`,filesRetryImport:`重试导入`,filesPathActions:`{{name}} 的路径操作`,filesCopyRelativePath:`复制相对路径`,filesCopyAbsolutePath:`复制绝对路径`,filesPathCopied:`已复制路径:{{path}}`,filesReadFailed:`无法读取文件。`,filesRetryRead:`重试读取`,filesErrorDetails:`错误详情`,filesReadFailedDetail:`文件列表未能加载,请检查连接后重试。`,filesReadDenied:`当前会话的工作区暂不可访问,或无法确认目录身份。请确认会话与工作区后重试。`,filesSymlink:`符号链接,文件浏览器不会自动跟随`,filesTruncated:`结果不完整,请缩小搜索范围。`,filesNoMatches:`没有匹配的文件`,filesEmpty:`此文件夹为空`,filesChoose:`选择文件进行预览`,filesChooseDetail:`从右侧浏览工作区文件,在这里直接预览。`,filesHideTree:`收起文件树`,filesShowTree:`显示文件树`,filesPreview:`预览`,filesSource:`查看源代码`,filesEdit:`编辑`,filesMode:`文件视图`,filesEditor:`文件编辑器`,filesSave:`保存文件`,filesSaving:`保存中…`,filesSaved:`已保存`,filesUnsaved:`未保存的修改 · 草稿保留在当前窗口`,filesDiscard:`放弃草稿`,filesDiscardConfirm:`放弃此文件尚未保存的修改?`,filesSaveConflict:`磁盘上的文件已改变,编辑草稿已保留。请刷新查看最新内容,核对修改后再保存。`,filesSaveFailed:`保存失败,编辑草稿已保留。请检查文件后重试。`,filesEditLoadFirst:`请先继续读取完整文件,再编辑。`,filesEditUnavailable:`支持编辑工作区内不超过 1 MiB 的 UTF-8 文本,最多保留 16 份未保存草稿。`,filesOutline:`章节目录`,filesDiskVersion:`查看当前磁盘版本`,filesReconcile:`已核对,保留草稿并基于此版本继续编辑`,filesTable:`表格预览`,filesRow:`行`,filesSheets:`工作表`,filesTableTruncated:`当前仅显示部分表格内容;下载原文件可查看完整内容。`,filesOfficeLayout:`文档内容预览;分页和排版可能与 Office 不同。`,filesSlidesLayout:`幻灯片文字与图片预览;主题、图表和动画可能与 PowerPoint 不同。`,filesPreviousPage:`上一页`,filesNextPage:`下一页`,filesZoomOut:`缩小`,filesZoomIn:`放大`,filesZoomReset:`重置缩放`,filesPdfPage:`第 {{page}} 页`,filesDocumentLimit:`此文档超出预览处理范围,请下载后在本地打开。`,filesPreviewFailed:`无法预览此文件,仍可下载后打开。`,filesDiagram:`Mermaid 图表`,filesDiagramLoadError:`图表预览加载失败,已显示源码。刷新页面后可重试。`,filesExpandDiagram:`放大图表`,filesFitImage:`适应宽度`,filesOriginalImage:`原始尺寸`,filesLoadMore:`加载更多`,filesLoaded:`已加载 {{count}} 项`,filesReadMore:`继续读取`,filesContentChanged:`文件已更新。当前阅读内容已保留,可在准备好后刷新。`,workbarFilesDescription:`浏览工作区文件,在文件树旁直接预览。`,backToSideConversations:`返回侧边对话`,continueSideConversation:`继续追问…`,startSideConversation:`提出一个侧边问题…`,sideConversationModelInherited:`新侧边对话使用主会话的模型与思考等级。`,sideConversationModelFixed:`这是当前侧边对话使用的模型。`,stop:`停止`,start:`开始`,browserAddress:`浏览器地址`,browserGo:`打开地址`,openExternalBrowser:`在外部浏览器打开`,invalidBrowserAddress:`请输入有效的 HTTP 或 HTTPS 地址。`,addImages:`添加图片`,addFiles:`添加文件`,fileAttachments:`文件附件`,previewFileAttachment:`预览文件`,fileAttachmentDescription:`文档、表格、PDF、文本、代码及其他文件`,fileAttachmentCount:`最多可添加 {{count}} 个附件。`,fileAttachmentTooLarge:`文件总大小不能超过 50 MB。`,fileAttachmentReadFailed:`无法读取此文件,请检查格式或是否有密码保护。`,fileAttachmentTextReady:`文本已就绪`,fileAttachmentTextTruncated:`部分文本 · 保留原文件`,fileAttachmentOriginalReady:`原文件已就绪`,fileAttachmentExtractionFailed:`未提取文本 · 原文件保留`,fileAttachmentEncodingUnavailable:`无法读取文本编码,原文件字节已保留。`,fileAttachmentDocumentUnavailable:`无法提取文本。文件可能受密码保护或格式暂不支持,原文件字节已保留。`,fileAttachmentNoText:`发送后,代理可通过工具读取原文件;此文件未提取出文本。`,fileAttachmentPreviewTruncated:`预览显示前 20,000 个字符,发送时会附上全部已提取文本。`,fileAttachmentExtractedContent:`已提取文本`,fileAttachmentPromptLabel:`用户提供的文件:`,fileAttachmentPromptTooLong:`消息和文件引用超过输入限制,请缩短消息或减少附件。`,imageAttachmentDescription:`支持 PNG、JPEG、GIF 或 WebP`,imageAttachments:`图片附件`,imageAttachmentsLoading:`正在准备附件…`,commandOpensPanel:`打开面板`,commandPanelArguments:`此命令用于打开面板,不能携带参数或图片。请移除后重试,或直接使用对应面板。`,commandPanelUnavailable:`未能打开面板,已保留命令。`,commandUnavailable_terminal_only:`需要在 Pi 终端界面中使用。`,commandUnavailable_not_integrated:`此扩展命令尚未接入 Web,请在 Pi 终端中使用。`,artifactImagePreviewFailed:`图片预览失败。请刷新文件重试,或下载后查看。`,artifactFileDetails:`文件信息`,turnElapsedRunning:`正在处理 · {{duration}}`,compactionElapsed:`已等待 {{duration}}`,compactionRunning:`正在压缩上下文`,compactionCompleted:`上下文已自动压缩`,compactionFailed:`上下文压缩失败`,compactionInterrupted:`压缩已中断`,compactionUnchanged:`压缩已结束,未生成新的摘要`,compactionUnavailable:`上下文压缩状态暂不可用`,compactionReconnectHelp:`连接已中断,恢复连接后将核实当前状态。`,compactionDraftHelp:`正在压缩上下文,发送的消息会排队等待。`,turnElapsedFinished:`用时 {{duration}}`,composerAdd:`添加`,composerCommands:`指令`,composerFile:`文件`,composerPlan:`计划`,composerCompact:`压缩`,composerModel:`模型`,composerBack:`返回`,composerPlanDescription:`进入或退出计划模式`,composerCompactDescription:`整理之前的对话,释放上下文空间`,composerModelDescription:`选择本会话使用的模型`,compactionQueueWaiting:`等待压缩完成`,compactionQueueBlocked:`消息已保留,可重试或清空队列。`,clearPromptQueue:`取消排队`,queueUpdateFailed:`未能更新队列,请确认当前会话后重试。`,queueStatusUnconfirmed:`请求已接收,但暂时无法确认最新队列状态。请刷新后再操作。`,turnElapsedOutcome_cancelled:`已停止`,turnElapsedOutcome_failed:`失败`,turnElapsedOutcome_uncertain:`结果待确认`,settingsSetupBusyHint:`Agent 配置需等待当前轮次结束;显示设置可直接调整。`,resetChatContentWidth:`恢复默认聊天宽度`,resetChatFontSize:`恢复默认字体大小`,setupResolveAdmission:`请先返回对话,处理尚未确认的消息,再应用设置。`,removeAttachment:`移除附件`,dropImagesHere:`将文件或图片拖到这里`,imageAttachmentCount:`最多可添加 {{count}} 张图片。`,imageAttachmentTooLarge:`单张图片不能超过 10 MB。`,imageAttachmentTotalTooLarge:`图片总大小不能超过 32 MB。`,imageAttachmentUnsupported:`仅支持有效的 PNG、JPEG、GIF 和 WebP 图片。`,imageAttachmentReadFailed:`无法读取此图片,请重新添加重试;消息内容已保留。`,attachedImage:`已附加图片`,previewAttachment:`预览图片`,closeImagePreview:`关闭图片预览`,imagePreviewFailed:`无法显示这张图片。`,fitImage:`适应窗口`,originalImageSize:`原始尺寸`,imageViewMode:`图片查看`,sessionUsage:`会话 Token 用量`,sessionInputTokens:`输入 Token`,sessionOutputTokens:`输出 Token`,sessionCacheTokens:`缓存 Token`,sessionContextUsage:`上下文占用与窗口大小`,usageContextLabel:`上下文`,usageUnknown:`未知`,usageOpenDetails:`输入 {{input}} · 输出 {{output}} · 上下文 {{percent}} / {{capacity}} · 查看会话用量`,usageContextHelp:`当前分支的估算占用 / 模型上下文容量上限。`,usageSessionTotals:`累计用量`,usageInputLabel:`输入`,usageOutputLabel:`输出`,usageCacheReadLabel:`缓存读取`,usageCacheWriteLabel:`缓存写入`,usageTotalLabel:`总计`,usageWorkspaceLabel:`工作区`,usageSessionId:`会话 ID`,usageTotalsHelp:`本会话累计 Token 用量,包含缓存。`,subagentDetails:`子代理`,sessionOverview:`会话概览`,sessionOverviewChanges:`当前审阅范围的更改`,subagentSummaryRunning:`{{count}} 运行中`,subagentSummaryDone:`{{count}} 完成`,subagentSummaryOther:`{{count}} 其他记录`,subagentNoneYet:`暂无子代理`,subagentOtherGroup:`失败 / 已中断`,subagentShowMore:`再显示 {{count}} 个`,backToSubagents:`返回子代理列表`,subagentActiveGroup:`已开启`,subagentFinishedGroup:`完成`,subagentNoneRunning:`暂无正在运行的子代理。`,subagentNoneFinished:`任务结束后会显示在这里。`,subagentProgress:`子代理:{{running}} 运行中 · {{completed}} 已完成`,subagentSummaryUnknown:`{{count}} 个状态未确认`,subagentTasks:`子代理任务列表`,inspectSubagent:`打开子代理:{{name}}`,subagentState_running:`运行中`,subagentProcessing:`处理中`,subagentState_done:`已完成`,subagentState_error:`失败`,subagentState_interrupted:`已中断`,subagentStarting:`正在启动…`,subagentSpawnFailed:`启动失败`,subagentStateUnavailable:`已启动 · 状态未保留`,subagentSpawnReceipt:`启动回执`,subagentSpawnReceiptHint:`此回执仅确认启动请求,不表示子代理任务已完成。`,subagentTask:`分配的任务`,subagentTranscript:`子代理对话`,subagentResult:`执行结果`,subagentSpend:`累计 token 消耗`,subagentSaved:`已保存记录`,subagentRecordedState:`最后记录的状态`,subagentSavedHint:`来自当前父会话已保存的回执;结果可能包含同批其他任务,并非子代理的完整实时对话。`,subagentReadOnly:`只读查看 · 关闭此面板不会停止任务`,subagentUnavailable:`当前会话已无法提供此子代理的实时详情。启动回执不代表任务已完成。`,subagentStale:`刷新失败,下方保留的是上次收到的状态。`,subagentNoMessages:`暂未收到消息。`,subagentTranscriptUnavailable:`此视图仅保留任务摘要,无法显示完整子代理对话。`,subagentWorkflowsTruncated:`另有 {{count}} 个 workflow 未包含在当前列表中,其任务数量未知。`,subagentState_unknown:`未确认`,subagentUnconfirmedGroup:`未确认`,subagentTruncated:`当前显示最近的消息,另有 {{count}} 条较早消息未包含在此视图中。`,subagentTextTruncated:`部分较长内容仅显示节选。`,subagentListTruncated:`另有 {{count}} 个任务未包含在当前列表中。`,subagentThinkingRedacted:`服务商已隐藏此段思考内容。`,inspectionChanged:`当前会话已切换,请重新打开详情。`,inspectionUnavailable:`暂时无法读取详情。`,inspectionLoading:`正在读取状态…`,thinkingUnavailable:`暂时无法读取思考等级。`,trustUnavailable:`暂时无法读取项目信任状态。`,copySetupCommand:`复制配置命令`,savedTrustDecision:`已保存决定`,activeSessionTrust:`当前会话信任`,trustDecision_trusted:`已信任`,trustDecision_denied:`已拒绝`,trustDecision_undecided:`未决定`,trustDecision_unknown:`未知`,trustActiveYes:`当前会话已信任`,trustActiveNo:`当前会话未信任`,modelAndThinking:`模型与思考`,selectedModel:`当前模型`,thinkingLevel:`思考等级`,availableThinking:`支持的等级`,unknownState:`未知`,projectTrust:`项目信任`,trust_trusted:`当前会话信任此工作区。`,trust_untrusted:`此工作区的信任已被拒绝。`,trust_restricted:`项目资源受到限制,等待信任决定。`,trust_unknown:`尚无法确定信任状态。`,trustRefreshNeeded:`保存的信任决定与当前会话不同,请通过 Pi 刷新会话后生效。`,providerAvailability:`服务商凭据`,settings:`设置`,settingsNavigation:`设置导航`,generalSettings:`常规`,configurationSettings:`配置`,configurationIntro:`配置工具权限、网络访问与模型响应。`,configurationReadFailure:`无法安全读取配置。请修复设置文件后刷新。`,configurationUserScope:`用户配置`,configurationSetupHint:`响应与搜索选项通过 OpenPI setup 应用`,configurationApproval:`批准策略`,configurationApprovalDetail:`工具审批沿用已安装 Pi 扩展的权限机制。`,configurationPiPermissions:`由 Pi 扩展管理`,configurationSandbox:`沙箱设置`,configurationSandboxDetail:`工具使用宿主进程的权限运行。`,configurationSandboxUnavailable:`未提供 OS 沙箱`,configurationSearchDetail:`允许当前会话模型在支持时访问网络。`,configurationSearchOff:`不向当前模型提供原生搜索。`,configurationSearchOn:`在当前连接支持时允许原生搜索。`,configurationVerbosity:`输出详细程度`,configurationVerbosityDetail:`选择模型回复包含细节的详细程度。`,configurationResponsesUnavailable:`当前连接未使用支持的 Responses 接口。`,configurationVerbosity_default:`模型默认`,configurationVerbosity_low:`简短`,configurationVerbosity_medium:`适中`,configurationVerbosity_high:`详细`,configurationVerbosityHelp_low:`简短直接地回答,减少额外细节。`,configurationVerbosityHelp_medium:`给出必要解释与适量细节。`,configurationVerbosityHelp_high:`提供更完整的解释与细节。`,configurationVerbosityRequest:`只把 response_verbosity 设为 {{value}},保留其他 OpenPI 配置。`,configurationSummary:`推理摘要`,configurationSummaryDetail:`选择向支持的推理模型请求哪种摘要。`,configurationSummaryUnavailable:`当前连接不支持推理摘要。`,configurationSummary_default:`模型默认`,configurationSummary_auto:`自动`,configurationSummary_concise:`简洁`,configurationSummary_detailed:`详细`,configurationSummary_none:`关闭`,configurationSummaryHelp_auto:`由模型自动选择摘要长度。`,configurationSummaryHelp_concise:`请求简洁的推理摘要。`,configurationSummaryHelp_detailed:`请求较详细的推理摘要。`,configurationSummaryHelp_none:`不请求推理摘要;保留当前推理强度。`,configurationSummaryRequest:`只把 response_reasoning_summary 设为 {{value}},保留其他 OpenPI 配置。`,configurationModelFeatures:`模型功能`,configurationReasoningLevels:`可用推理强度`,configurationReasoningDetail:`选择在模型控件中显示哪些级别。控件只显示当前模型支持的档位,当前档位始终保留。`,configurationReasoningCount:`已选择 {{count}} 个`,configurationDependencies:`工作空间依赖项`,configurationEnvironment:`本地运行环境`,configurationEnvironmentDetail:`Node.js、Python 等工具由当前环境提供。OpenPI 不安装捆绑的工作空间运行时。`,configurationRuntimeStatus:`运行状态`,browserSettings:`浏览器`,webSearchSettings:`联网搜索`,webSearchCurrentModel:`当前会话模型`,webSearchNativeDetail:`调用当前模型供应商的原生搜索,复用现有连接和凭据。`,webSearchSupported:`当前连接支持原生搜索。开启后,由模型决定何时联网。`,webSearchUnsupported:`当前连接不支持或尚未确认支持原生搜索,不提供搜索工具,也不会切换到其他供应商。`,webSearchNativeRequest:`开启联网搜索,使用当前会话模型的原生搜索和已有 Pi 凭据。不要切换模型、连接协议或搜索供应商;当前连接不支持或支持情况未知时,不提供搜索工具。`,webSearchIntro:`让模型搜索最新资料,并打开原始网页核实。`,webSearchPackageDetail:`通过可选 Pi 插件提供搜索、网页读取和 PDF 提取。`,webSearchDefaultOff:`默认关闭。可选扩展跟随当前会话模型,无需另填搜索密钥或安装插件。`,webSearchLoaded:`本会话已加载插件`,webSearchNotLoaded:`本会话尚未加载插件`,webSearchSource:`查看插件源码`,webSearchProfile:`搜索设置`,webSearchExa:`Exa — 无需 API 密钥`,webSearchExisting:`保留我已有的搜索偏好`,webSearchProfileHint:`Exa 提供搜索,网页由本机直接读取。已有偏好会原样保留;安装后也可更换搜索服务。`,webSearchEnable:`启用联网搜索…`,webSearchDisable:`关闭联网搜索…`,webSearchConfigure:`更换搜索服务…`,webSearchExaRequest:`启用可选联网搜索,使用 Pi Web Access 和无需 API 密钥的 Exa。让我审阅插件安装确认,保留其他偏好,不要自动重新加载。`,webSearchExistingRequest:`启用可选联网搜索,使用 Pi Web Access,原样保留我已有的搜索偏好。让我审阅插件安装确认,保留其他偏好,不要自动重新加载。`,webSearchDisableRequest:`关闭原生联网搜索。保留其他设置和会话记录。`,webSearchProviderRequest:`帮我更换已安装 Pi Web Access 插件的搜索服务。介绍可用服务与权限,保留无关偏好,密钥留在搜索插件中,不要自动重新加载。`,browserSettingsIntro:`让 OpenPI 阅读网页、点击、输入和截图。`,browserControl:`浏览器控制`,browserControlHint:`提交设置变更请求,保存配置后生效。`,browserDefault:`默认浏览器`,browserDefaultHint:`提交设置变更请求,选择未指定浏览器时使用的默认项。`,browserEmbedded:`OpenPI 内置浏览器`,browserAllowedTitle:`允许使用的浏览器`,browserOffHint:`下方选择将在开启浏览器控制后生效。`,browserConnected:`已连接`,browserNeedsSetup:`需要连接浏览器扩展`,browserNotFound:`未检测到此浏览器`,browserUpdateNeeded:`需要更新扩展`,browserBlocked:`未授权`,browserDefaultBlocked:`当前默认浏览器未获授权,请允许使用或更换默认值。`,browserSetUp:`设置`,browserManage:`管理`,browserSetupNamed:`设置 {{browser}}`,browserManageNamed:`管理 {{browser}}`,browserAllowNamed:`允许使用 {{browser}}`,browserMore:`更多浏览器`,browserSpeakHint:`对话中说“使用 Chrome …”,即可指定这次使用的浏览器。`,browserGuideTitle:`连接 {{browser}}`,browserGuideEyebrow:`跟着做,一次一步`,browserConnectionTitle:`连接状态`,browserCloseGuide:`收起浏览器设置引导`,browserConnectionReady:`连接正常,可选择是否允许 OpenPI 使用。`,browserEmbeddedDetail:`网页在 OpenPI 内打开。部分网站需要使用普通浏览器才能登录或正常显示。`,browserExternalDetail:`OpenPI 可以使用已连接的 {{browser}} 配置中的现有标签和登录状态。请在该配置中保留一个 OpenPI 标签页。`,browserManageExtension:`管理扩展`,browserAllowUse:`允许 OpenPI 使用`,browserMakeDefault:`设为默认`,browserInstallIn:`安装到`,browserInstallTitle:`安装 OpenPI Browser Bridge`,browserSetupSteps:`设置步骤`,browserGuidePopout:`在独立窗口中跟随操作`,browserGuideDetached:`引导已在独立窗口打开,可以对照浏览器设置逐步完成。`,browserShowGuide:`显示引导窗口`,browserGuideInline:`把引导放回这里`,browserGuideBlocked:`未能打开引导窗口。可允许弹出式窗口后重试,也可继续查看这里的步骤。`,browserSafariSettings:`Safari → 设置`,browserSafariDeveloper:`开发者设置`,browserSafariTemporary:`添加临时扩展…`,browserSafariOpenHint:`打开 Safari 后,在菜单栏选择「Safari → 设置」,对照此引导操作。需要 macOS 上的 Safari 26 或更新版本。`,browserSafariDeveloperTitle:`显示 Safari 开发者设置`,browserSafariDeveloperHint:`在「设置 → 高级」中开启「显示网页开发者功能」,再进入「开发者」标签。`,browserSafariLoadHint:`在「开发者」中点击「添加临时扩展」,选择下方文件夹。启用 OpenPI Browser Bridge,允许访问要控制的网站及本地 OpenPI 页面。退出 Safari 后需重新加载临时扩展。`,browserFirefoxThis:`此 Firefox`,browserFirefoxTemporary:`临时载入附加组件…`,browserFirefoxDeveloperTitle:`选择「此 Firefox」`,browserFirefoxDeveloperHint:`在 about:debugging 左侧选择「此 Firefox」。Firefox 不需要开启「开发者模式」开关。`,browserFirefoxLoadHint:`点击「临时载入附加组件」,选择下方文件夹中的 manifest.json。此安装在 Firefox 重启后失效;永久安装需要经过 Mozilla 签名的扩展包。`,browserFirefoxDone:`已选中,下一步`,browserStepCount:`第 {{step}} 步,共 {{total}} 步`,browserStepLabel:`第 {{step}} 步:{{label}}`,browserStepOpen:`打开扩展页`,browserStepAdd:`添加扩展`,browserStepConnect:`连接`,browserOpenManagerTitle:`打开 {{browser}} 扩展页`,browserOpenManagerHint:`接下来会打开 {{browser}}。在扩展页完成操作后,回到这里继续。`,browserOpenManager:`打开 {{browser}} 扩展页`,browserReopenManager:`重新打开扩展页`,browserAlreadyInstalled:`已经安装?直接连接`,browserDeveloperMode:`开发者模式`,browserDeveloperTitle:`开启「开发者模式」`,browserDeveloperHint:`在扩展页开启「开发者模式」,页面会出现「{{loadLabel}}」按钮。`,browserDeveloperDone:`已开启,下一步`,browserIllustration:`操作示意 · 在 {{browser}} 中完成`,browserExtensions:`扩展程序`,browserLoadUnpacked:`加载未打包的扩展程序`,browserLoadHint:`扩展已准备在本机,按下面的顺序在 {{browser}} 中载入。`,browserCopyLocation:`复制下面的路径`,browserLocateTarget:`找到本机的扩展文件夹`,browserRevealTarget:`定位扩展文件夹`,browserLocateManifest:`找到扩展中的 manifest.json`,browserRevealManifest:`定位 manifest.json`,browserDragToBrowser:`把文件夹拖到 {{browser}} 扩展页`,browserDragFolderHint:`将文件管理器中的 {{folder}} 整个文件夹拖到扩展页,保持「开发者模式」开启。`,browserSelectLocatedTarget:`在浏览器弹出的选择窗口中,选择上一步定位的项目。`,browserManualInstall:`无法拖入?使用路径选择`,browserManualSelection:`找不到?使用路径选择`,browserLoadInBrowser:`在 {{browser}} 点击「{{loadLabel}}」`,browserLoadAlternate:`部分版本显示为「加载已解压的扩展程序」或 Load unpacked。`,browserConfirmFolder:`选择`,browserConfirmFile:`打开`,browserSelectFolderHint:`选择整个文件夹,不要选择里面的 .js 文件。`,browserSelectManifestHint:`只选择 manifest.json,不要选择 .js 文件。`,browserInstallCheckpoint:`在扩展列表看到 OpenPI Browser Bridge 卡片后,再继续连接。`,browserPathCopied:`已复制路径`,browserCopyFailed:`未能复制,请选中上方路径手动复制。`,browserChooseFolderMac:`按 ⌘ ⇧ G,粘贴刚复制的路径并按回车定位,再点击「{{confirm}}」。`,browserChooseFolderOther:`在选择窗口的地址栏粘贴刚复制的路径并回车,再点击「{{confirm}}」。`,browserInstalledConnect:`已添加,连接 OpenPI`,browserPreviousStep:`上一步`,browserWaiting:`等待 OpenPI Browser Bridge 连接,连接后会自动进入下一步。`,browserInstallBrowserFirst:`请先安装 {{browser}},或在已安装的浏览器中打开当前 OpenPI 地址。`,browserConnectTitle:`连接 OpenPI`,browserConnectHint:`在 {{browser}} 中打开 OpenPI,使用刚安装扩展的浏览器配置。`,browserOpenIn:`在 {{browser}} 中打开`,browserAllowHint:`连接成功后,可以允许 OpenPI 使用此浏览器。安装扩展不会自动开启浏览器控制。`,browserCheck:`检查连接`,browserNotConnectedYet:`还未连接。请完成安装,在该浏览器中刷新 OpenPI 后再次检查。`,browserHelp:`设置帮助`,browserReloadHint:`已安装旧版?在扩展页重新加载 OpenPI Browser Bridge,再刷新 OpenPI。如浏览器提示权限,请完成其原生确认。`,browserSupportedHint:`Chrome、Edge、Brave、Chromium 145+ 可控制内置页面及普通标签。macOS Safari 26+、Firefox 128+ 通过兼容扩展控制普通标签,嵌套框架需单独打开。Safari、Firefox 的临时安装需在浏览器重启后重新加载。`,browserCopyPath:`复制路径`,browserOpening:`正在打开浏览器…`,browserLoading:`正在检查浏览器连接…`,browserSaved:`已保存,浏览器权限立即生效。`,browserSaving:`正在处理…`,modelSettings:`模型`,skillsSettings:`技能`,subagentsSettings:`子代理`,pluginsSettings:`插件`,configureOpenPi:`配置 OpenPI`,setupRequestReviewAll:`和我一起检查全部 OpenPI 配置项`,setupRequestSetTheme:`仅将 OpenPI Web 主题设置为 {{value}},其他配置保持不变`,setupRequestSetChatWidth:`仅将 OpenPI Web 聊天内容宽度设置为 {{value}}px,其他配置保持不变`,setupRequestSetChatFontSize:`仅将 OpenPI Web 聊天字体大小设置为 {{value}}px,其他配置保持不变`,setupRequestEnableExpandedThinking:`仅将 OpenPI Web 的思考块改为默认展开,其他配置保持不变`,setupRequestDisableExpandedThinking:`仅将 OpenPI Web 的思考块改为默认折叠,其他配置保持不变`,setupRequestSubagents:`检查并配置 Agent 角色模型和工作流上限`,setupRequestFailed:`OpenPI 配置请求未被接收。`,setupRequestRunning:`正在应用 OpenPI 设置…`,setupRequestAccepted:`配置请求已接收。`,setupPlanBlocked:`Agent 配置需先退出 Plan 模式;显示设置可直接调整。退出不会开始实施计划。`,setupPlanBusy:`Agent 配置需等待当前回合结束并退出 Plan 模式;显示设置可直接调整。`,setupOutcome_pending:`配置请求正在处理,尚未收到保存回执。`,toolCallArguments:`工具参数`,toolCallOutput:`工具结果`,setupOutcome_saved:`OpenPI 配置已保存并应用。`,setupOutcome_unchanged:`配置已保存,实际设置没有变化。`,setupOutcome_failed:`配置请求失败,请查看错误和当前设置后再重试。`,setupOutcome_cancelled:`配置过程已取消,未确认成功保存。`,setupOutcome_unconfirmed:`本次未确认成功保存,请核对当前设置后再运行 /openpi-setup。`,settingsUpdateFailed:`无法保存 Web 显示设置。`,settingsPreferencesSaved:`偏好设置已保存。`,settingsPreferencesSaveFailed:`无法保存显示设置,请检查配置诊断后重试。`,settingsCatalogLoading:`正在加载 Pi 资源…`,settingsCatalogFailed:`无法加载 Pi 设置资源。`,appearance:`外观`,settingsPersonal:`个人`,settingsAgent:`Agent`,settingsIntegrations:`集成`,settingsArchivedChats:`已归档聊天`,settingsSearch:`搜索设置`,settingsClearSearch:`清除搜索`,settingsNoResults:`没有匹配的设置`,appearanceVisualStyle:`视觉风格`,appearanceMode:`模式`,appearanceTheme:`主题`,appearanceAccent:`强调色`,appearanceBackground:`背景`,appearanceForeground:`前景`,appearanceFont:`字体`,appearanceFont_codex:`Codex 默认`,appearanceFont_sans:`无衬线`,appearanceFont_serif:`衬线`,appearanceFont_mono:`等宽`,appearanceAccent0:`默认`,appearanceAccent1:`蓝色`,appearanceAccent2:`紫色`,appearanceAccent3:`粉色`,appearanceAccent4:`橙色`,appearanceAccent5:`绿色`,appearanceCustomAccent:`自定义强调色`,appearanceAdvanced:`高级`,appearanceReset:`恢复默认设置`,appearanceResetAction:`重置外观`,appearanceImport:`导入主题`,appearanceCopy:`复制主题`,appearanceCopied:`主题已复制`,appearanceCopyFailed:`无法复制主题,请重试。`,appearanceThemeValue:`主题数据`,appearanceImportPlaceholder:`粘贴 OpenPI 主题…`,appearanceImportInvalid:`请输入有效的 OpenPI 主题数据。`,appearanceImportAction:`导入`,searchArchivedChats:`搜索已归档聊天`,archiveProjectFilter:`按项目筛选`,archiveAllProjects:`所有项目`,archiveProjectGroup:`{{project}} · {{count}} 条归档聊天`,archiveSort:`归档聊天排序`,archiveSortUpdated:`最近更新`,archiveSortCreated:`创建时间`,restoreArchivedChat:`恢复 {{title}}`,themeLight:`浅色`,themeDark:`深色`,themeMist:`雾青`,themeRose:`蔷薇`,themePine:`松夜`,themeSystem:`跟随系统`,conversationSettings:`对话`,expandThinkingByDefault:`默认展开思考块`,chatContentWidth:`聊天内容宽度`,chatFontSize:`聊天字体大小`,agentBehavior:`Agent 行为`,workflowLimits:`工作流上限`,workflowConcurrency:`工作流并行上限`,workflowCalls:`总调用次数`,agentSettingsSetupHint:`Agent 设置通过当前会话中的 /openpi-setup 生效。`,setupRequestLimits:`将工作流并行上限设置为 {{concurrency}},总子代理调用上限设置为 {{calls}},保留其他配置。`,setupRequestEnableSuggestions:`启用下一步建议。如需模型配置,请帮助我选择模型,保留其他配置。`,setupRequestDisableSuggestions:`关闭下一步建议,保留其他配置。`,setupRequestPostEdit:`帮我配置或关闭编辑后命令。先展示当前配置,再询问要使用的命令。`,configurePostEdit:`配置编辑后命令`,workflowLimitsValue:`并行 {{concurrency}} · 总调用 {{calls}}`,nextActionSuggestions:`下一步建议`,nextActionSuggestionsDetail:`当前任务结束后,提供几个可选择的下一步操作。`,enabled:`已启用`,disabled:`已关闭`,configured:`已配置`,postEditCommand:`编辑后命令`,postEditCommandDetail:`编辑完成后运行一个命令;关闭时不会执行任何命令。`,resultDisplay:`默认结果显示`,subagentResults:`子代理结果`,bashOperations:`Bash 操作`,fileMutations:`Write / Edit 操作`,footer:`页脚`,terminalFooter:`Pi 终端页脚`,terminalFooterStyle:`终端页脚样式`,terminalFooterHint:`影响 Pi 命令行界面的页脚;已打开的 Pi 界面在下次启动或配置应用后更新。`,detailDisplay_full:`完整`,detailDisplay_compact:`紧凑`,sessionSettings:`会话`,currentModel:`当前`,providerCurrentSessionModel:`当前会话使用 {{model}}。`,useThisModel:`使用此模型`,model:`模型`,modelConnection:`模型连接`,provider:`服务商`,modelId:`模型 ID`,providerStatusUnavailable:`此服务商不在当前有界认证快照中。`,providerSettings:`服务商凭据`,providerSettingsIntro:`查看当前 Web 会话可通过哪些 Pi 服务商完成认证。`,openRuntimeDetails:`打开运行详情`,currentWorkspace:`当前工作区`,providerAuth_api_key:`API 密钥`,providerAuth_oauth:`OAuth`,providerAuthUnknown:`未报告认证方式`,authentication:`认证方式`,accessType:`访问方式`,providerAccessSubscription:`订阅账户`,providerAccessStandard:`服务商凭据`,configurationOwner:`配置归属`,providerLoading:`正在加载服务商状态…`,providerLoadFailed:`无法加载服务商状态。`,providerReadOnly:`由 Pi 管理`,selectProvider:`选择服务商`,gitReviewBaselineUnavailable:`未保留可用的会话基线,可能超出了捕获限额。请切换到未暂存、已暂存或分支查看 Git 变更,也可打开本会话文件记录。`,modelsIntro:`登录账户或添加 API 密钥。已有的 Pi 连接也会显示在这里。`,modelConnectionsTitle:`模型连接`,modelConnectionsIntro:`管理连接凭据,选择新会话和当前会话使用的模型。`,accountLoginMethod:`连接方式`,accountLoginTab:`账户登录`,accountLoginChatGPT:`ChatGPT 账户`,accountLoginClaude:`Claude 账户`,accountLoginKeyTab:`API 密钥`,accountLoginConfigured:`账户已登录`,accountLoginIntro:`在浏览器中完成授权,无需填写 API 密钥。`,accountLoginExisting:`账户凭据已保存在 Pi 中。`,accountLoginStart:`登录`,accountLoginAgain:`重新登录`,accountLoginUnsaved:`请先保存或放弃其他修改,再登录账户。`,accountLoginStarting:`正在准备登录…`,accountLoginWaiting:`等待账户授权`,accountLoginChoose:`选择登录方式`,accountLoginCancelling:`正在取消登录…`,accountLoginBrowser:`在浏览器中继续`,accountLoginDevice:`使用设备码登录`,accountLoginBrowserOption:`在当前电脑上登录,完成后自动返回。`,accountLoginDeviceOption:`适合远程服务器,或无法自动返回的情况。`,accountLoginBrowserHelp:`打开登录页并完成授权,这里会自动更新。`,accountLoginDeviceHelp:`打开授权页并输入下方代码,请保持此页面打开。`,accountLoginOpen:`打开登录页`,accountLoginCopyCode:`复制设备码`,accountLoginPaste:`授权码或回调地址`,accountLoginContinue:`继续`,accountLoginFallback:`已登录,但这里没有更新?`,accountLoginRemoteHelp:`如果无法自动返回,请复制浏览器最后的回调地址,并粘贴到下方。`,accountLoginCancel:`取消登录`,accountLogin_failed:`登录未完成,请重试或选择其他登录方式。`,accountLogin_expired:`登录已过期,请重新开始获取新的授权链接。`,accountLogin_cancelled:`已取消登录。`,accountLoginRequestFailed:`请求未完成,请先刷新状态再重试。`,accountLoginStatusUnknown:`暂时无法查询登录状态,账户授权可能仍在进行。`,accountLoginRefreshRequired:`凭据已保存,但 Pi 未能更新模型列表。请重载 Pi 后使用此连接。`,accountLogout:`退出登录`,accountLogoutRefreshRequired:`已移除保存的凭据,但 Pi 未能更新模型列表。请重载 Pi 刷新状态。`,accountLogoutTitle:`退出 {{provider}}?`,accountLogoutDetail:`将移除此电脑上 Pi 保存的该服务凭据,其他使用它的 Pi 会话也需要重新登录。环境凭据不受影响。`,providerInputTypes:`输入类型`,providerInputText:`文本`,providerInputImage:`图片`,providerCustomTag:`自定义`,providerEdit:`编辑`,providerRemove:`删除`,providerSave:`保存`,editProvider:`编辑 {{provider}}`,removeProvider:`删除 {{provider}}`,providerAdd:`添加模型提供商`,providerAddMode:`添加方式`,providerAddCatalog:`第三方模型提供商`,providerAddCustom:`自定义模型 API`,providerAccountHint:`使用已有账户连接模型,选择服务商后前往浏览器授权。`,providerCatalogHint:`从内置目录中选择提供商,填入其 API 密钥即可使用。`,providerCustomHint:`连接中转站、自部署服务或其他兼容 OpenAI / Anthropic 协议的接口,需填写 API 地址、协议和模型。`,providerKeyKeep:`已配置密钥,留空保持不变`,providerKeyOptional:`输入 API 密钥,或留空使用环境认证`,providerDisplayName:`提供商名称`,providerCustomSettings:`自定义设置`,providerSaved:`已保存 {{provider}}。`,modelDefaultTitle:`新会话默认模型`,modelDefaultChoose:`选择模型`,modelDefaultBadge:`默认`,modelCurrentBadge:`当前使用`,modelDefaultNotSet:`未设置 · 新会话启动时由 Pi 选择`,modelDefaultHint:`选择以后新会话使用的模型,已有会话保留自己的选择。此设置也会更新 Pi 的默认模型。`,modelDefaultReadFailed:`暂时无法读取默认模型。`,modelDefaultProjectOverride:`此工作区有 Pi 独立设置:{{model}}。`,modelDefaultSave:`保存默认模型`,modelMakeDefault:`同时设为新会话默认模型`,modelDefaultSaveFailed:`默认模型保存尚未确认,请刷新状态后重试。`,modelDefaultPartial:`当前模型已切换,但默认模型保存尚未确认,请刷新状态后再试。`,modelConnectionNextHint:`从此连接选择一个模型,用于当前会话。`,modelConnectionSearch:`搜索模型…`,modelConnectionChooseProvider:`选择 {{provider}} 的模型`,modelConnectionUse:`用于当前会话`,modelConnectionUseFailed:`模型切换尚未确认,请刷新模型列表后重试。`,modelConnectionLoadFailed:`暂时无法读取模型列表。`,modelConnectionNoModels:`暂无可选模型,请检查连接或添加模型定义。`,modelConnectionNoMatch:`没有匹配的模型。`,modelConnectionMore:`还有 {{count}} 个模型,可搜索缩小范围。`,providerModelsEmpty:`还没有模型,获取可用模型或手动添加。`,providerModelsInherited:`使用提供商的内置模型目录。`,providerModelsReadOnly:`此提供商包含当前页面未支持的模型设置,请在 Pi 配置文件中编辑。`,providerModelId:`模型 {{number}} ID`,providerModelName:`模型 {{number}} 名称`,providerModelDetails:`模型参数:{{model}}`,providerRemoveModel:`删除模型:{{model}}`,providerIdInvalid:`请使用未被占用的提供商 ID,仅包含字母、数字、连字符、点或下划线。`,providerNativeAuth:`此提供商使用 Pi 原生登录。`,providerConfigurationFailed:`保存失败,请检查填写内容,并在会话空闲时重试。`,providerProfileSavedKeyFailed:`提供商配置已保存,但密钥保存失败。重试将只保存密钥。`,providerReload:`放弃草稿并重新加载`,providerCurrentRemoval:`请先切换当前使用的模型,再删除。`,providerRemoveDetail:`删除此提供商的配置和自定义模型?由 Pi 管理的凭据将保留。`,providerPickerIntro:`以下是模型提供商的可用模型,勾选要添加的模型。`,providerPickerSelected:`已选 {{count}} 个`,providerApiKey:`API 密钥`,providerKeyPlaceholder:`粘贴密钥以添加或替换`,saveProviderKey:`保存密钥`,savingSettings:`正在保存…`,keepEditing:`继续编辑`,discardAndContinue:`放弃更改并继续`,unsavedSettingsTitle:`放弃未保存的更改?`,unsavedSettingsDetail:`未保存的模型和凭据修改将被丢弃。`,unsavedCredentialTitle:`放弃未保存的凭据?`,unsavedCredentialDetail:`新密钥尚未保存,继续后将清空。`,modelSelectionBusy:`当前会话忙碌,暂不能切换模型。`,providerKeySaved:`已保存到 Pi 凭据存储。已有密钥不会回显。`,providerSaveFailed:`密钥保存未完成。请等待会话空闲,刷新状态后重试;部分服务商需要额外认证信息。`,providerWriteDetail:`在这里直接保存到 Pi 凭据存储,密钥不会进入模型对话。OAuth 或需要额外字段的认证请使用 Pi 原生登录。`,editModelConfiguration:`添加或编辑自定义模型`,modelConfigurationDetail:`先设置提供商连接,再获取模型列表或手动添加。保存配置不会调用模型。`,configuredModels:`自定义模型配置`,addModel:`添加模型`,modelConfig_provider:`服务商 ID`,modelConfig_id:`模型 ID`,modelConfig_name:`显示名称`,modelConfig_baseUrl:`API 地址`,modelConfig_api:`API 格式`,modelConfig_contextWindow:`上下文窗口`,modelConfig_maxTokens:`最大输出 token 数`,providerCapacityLabel:`{{field}} {{number}}`,providerModelOptions:`模型选项`,providerModelInvalid:`模型 {{number}}:模型 ID 不能为空或重复;容量需为正数,例如 128K 或 1M,留空使用默认值。`,modelConfig_reasoning:`支持推理`,saveModelConfiguration:`保存模型`,reloadModelConfiguration:`放弃草稿并载入最新配置`,retryModelConfiguration:`重试读取`,discardModelDraftTitle:`放弃这份模型草稿?`,discardModelDraftDetail:`最新配置将替换这份未保存的草稿。`,discardAndReload:`放弃并重新载入`,modelConfigurationUnsaved:`未保存的更改`,modelConfigurationConflict:`模型配置已在别处更改,当前草稿已保留。`,modelConfigurationLoadFailed:`无法读取模型配置,草稿已保留。`,modelConfigurationSaved:`已保存到 Pi models.json。配置服务商密钥后即可选择此模型。`,modelConfigurationFailed:`模型保存未完成,草稿已保留。`,setupConfigurationRequest:`配置需求`,configureViaSetup:`通过 OpenPI setup 应用`,setupFormDetail:`统一走 /openpi-setup。请在对话中查看进度及必要的确认;提交成功不等于配置已保存。`,setupSkillsPlaceholder:`填写要添加或调整的技能,以及来源或本地路径`,setupPluginsPlaceholder:`填写要配置的 Pi 插件,以及准确的包名或本地路径`,enableSkillInvocation:`允许模型调用`,disableSkillInvocation:`改为仅显式调用`,setupSkillInvocationRequest:`配置这个 Pi 技能:{{path}}。将原生 disable-model-invocation 字段设为 {{disabled}},保留其余内容,并说明何时生效。`,setupRoleFormRequest:`将 OpenPI 的 {{role}} 角色配置为使用 {{model}},工作流并发设为 {{concurrency}}。推理级别继承父会话,校验选择有效性,并保留其他配置。`,providerReadOnlyDetail:`此页面只读且不会接收凭据内容。请通过 Pi 配置服务商认证,然后刷新此状态。`,openProviderSettings:`打开服务商设置`,credentialConfigured:`已配置`,credentialMissing:`未配置`,authNotVerified:`凭据已配置不代表模型请求一定成功。`,configurationViaPi:`此处为只读状态。模型凭据与信任由 Pi 管理,OpenPI 选项通过 /openpi-setup 配置。`,noSkillsFound:`当前会话没有加载技能。`,addSkill:`添加技能`,addPlugin:`添加插件`,searchResources:`搜索名称或来源`,filterResourceScope:`资源范围`,allResourceScopes:`全部范围`,noMatchingResources:`没有匹配的资源`,resourceBulkTooLarge:`请进一步筛选列表后,再提交批量配置请求。`,resourceManagement:`Pi 资源`,resourceSourceAuto:`Pi 自动发现`,resourceSourceLocal:`本地资源`,resourcePackageSource:`软件包、仓库或本地路径`,resourcePackageSourcePlaceholder:`npm:包名@版本 · git:owner/repo · /path/to/skill`,resourceInstallIntro:`选择来源和范围,在对话中通过 OpenPI setup 审查并应用。`,resourceInstallReview:`请在对话中确认准确来源和权限。提交请求不代表已安装或已加载。`,resourceRequestSubmitted:`请求已提交。请在对话中查看进度和确认,完成后刷新此目录。`,browseSkills:`浏览 skills.sh 技能`,resourceSessionState:`应用到当前会话`,resourcesReloadNote:`刷新只读取目录;重新加载才会将已保存的资源应用到空闲会话。配置变更不会自动重新加载。`,reloadResources:`重新加载资源`,resourceReloadReview:`将已保存的 Pi 技能与插件配置应用到当前会话,并重新启动扩展?请先等待运行中的工作结束。`,resourceReloaded:`资源已重新加载,请查看更新后的目录和诊断。`,resourceReloadFailed:`无法重新加载资源。请等待当前会话空闲,刷新后重试。`,advancedResourceConfiguration:`高级配置`,resourceDiagnostics:`Pi 报告了 {{extensionErrors}} 项扩展诊断与 {{skillErrors}} 项技能诊断。`,resourceConfigurationDiagnostics:`{{count}} 项设置读取失败,请检查 Pi 配置诊断。`,resourceCatalogTruncated:`此目录有数量上限,部分资源未展示。`,resourceTargetTruncated:`此来源或路径已截断,请通过高级配置确认完整目标后再进行管理。`,updateResource:`检查更新`,removeResource:`审查移除`,skillsEmptyTitle:`添加你的第一个技能`,skillsEmptyIntro:`技能为 Pi 提供可复用的指引。可以添加软件包、仓库或本地技能;项目技能遵循 Pi 的项目信任。`,pluginsEmptyTitle:`用插件扩展 Pi`,pluginsEmptyIntro:`软件包可以包含扩展、技能、提示词和主题。添加来源后,通过 OpenPI setup 审查安装。`,pluginCount:`{{count}} 个插件来源`,installedVersion:`已安装版本`,configuredVersion:`配置版本`,resourceVersionUnpinned:`未固定版本 / 本地来源`,pluginState_loaded:`本会话资源已加载`,pluginState_installed:`已安装 · 未加载`,pluginState_disabled:`配置已禁用`,pluginState_missing:`软件包缺失`,pluginState_error:`加载诊断`,pluginState_notLoaded:`未加载`,pluginLoadedResources:`当前会话目录包含 {{count}} 项资源。配置变更需要明确重新加载后才会应用。`,pluginAction_enable:`审查启用`,pluginAction_disable:`审查禁用`,pluginAction_update:`检查更新`,pluginAction_remove:`审查移除`,enableVisibleSkills:`允许模型使用(当前 {{count}} 项)`,disableVisibleSkills:`仅显式调用(当前 {{count}} 项)`,enableVisiblePlugins:`启用当前 {{count}} 个软件包`,disableVisiblePlugins:`禁用当前 {{count}} 个软件包`,setupResourceInstallRequest:`添加 Pi {{kind}},来源为 {{source}},范围为 {{scope}}。先检查来源并确定固定的软件包身份,通过 ask_user 与我确认安装权限,再使用 Pi 原生的软件包或技能配置。添加技能时保留其他扩展和资源。保留现有偏好与项目信任,不要自动重新加载当前会话。分别报告已保存的配置与仍需执行的操作,不要改动无关的 OpenPI 设置。`,setupPluginOperationRequest:`审查 Pi 软件包操作 {{action}},只针对配置来源 {{source}}、原生安装目录 {{path}}、范围 {{scope}}。相对来源应以该范围的原生设置目录解析。使用 Pi 原生包管理;更新时检查可用版本,通过 ask_user 与我确认固定的目标身份和安装权限。保留资源过滤器及所有无关偏好;如果切换会破坏过滤器,停止并说明。移除时不得删除本地来源目录。不要自动重新加载,分别报告已持久化与当前会话状态,不要改动无关的 OpenPI 设置。`,setupSkillManageRequest:`审查 Pi 技能操作 {{action}},只针对文件 {{path}}、来源 {{source}}、范围 {{scope}}。先检查原生资源归属,通过 ask_user 与我确认更新或移除及所需权限。保留无关技能与软件包资源,不要为了移除一个技能删除整个共享软件包。保留项目信任,不要自动重新加载,也不要改动无关的 OpenPI 设置。`,setupSkillsBulkRequest:`只针对当前展示的 Pi 技能文件 {{paths}},将原生 disable-model-invocation 设为 {{disabled}}。检查资源归属,保留其余内容和偏好,与我审查必要变更,报告无法安全修改的文件。显式 /skill 调用仍应可用。不要自动重新加载,也不要改动无关的 OpenPI 设置。`,setupPluginsBulkRequest:`只针对当前展示的 Pi 软件包 {{packages}},通过 Pi 原生配置将 disabled 设为 {{disabled}}。保留其他偏好与资源过滤器;无法保留过滤器的条目应跳过并报告。遵循范围与项目信任,与我审查必要变更,不要自动重新加载,也不要改动无关的 OpenPI 设置。`,resourceRequestFinished:`配置回合已结束。请刷新并查看 Pi 原生配置与会话资源,确认实际变更。`,skillCount_one:`{{count}} 个技能`,skillCount_other:`{{count}} 个技能`,skill:`技能`,copySkillInvocation:`复制调用命令`,source:`来源`,scope:`范围`,invocation:`调用方式`,modelInvocation:`模型调用`,resourceScope_user:`全局`,resourceScope_project:`项目`,resourceScope_temporary:`临时`,explicitOnly:`仅允许明确调用`,availableToModel:`模型可按需使用`,skillFile:`技能文件`,selectSkill:`选择一个技能`,subagentConfiguration:`Pi 原生子代理角色`,subagentConfigurationIntro:`未在 OpenPI 配置中指定模型时,角色继承父会话模型。`,subagentActiveCount_one:`{{count}} 个运行中`,subagentActiveCount_other:`{{count}} 个运行中`,subagentCompletedCount_one:`{{count}} 条记录`,subagentCompletedCount_other:`{{count}} 条记录`,subagentConcurrency:`上限 {{count}}`,builtInRoles:`内置角色`,subagentRole_explorer:`探索者`,subagentRole_implementer:`实现者`,subagentRole_reviewer:`审查者`,subagentRole_advisor:`顾问`,subagentRoleShort_explorer:`只读调查`,subagentRoleShort_implementer:`聚焦实现`,subagentRoleShort_reviewer:`正确性审查`,subagentRoleShort_advisor:`技术分析`,subagentRoleDescription_explorer:`调查代码库并报告证据,不修改文件。`,subagentRoleDescription_implementer:`实现边界明确的改动并运行相关仓库检查。`,subagentRoleDescription_reviewer:`审查正确性、安全性、回归风险和缺失验证。`,subagentRoleDescription_advisor:`分析困难技术问题并提出具体下一步建议。`,configureRoles:`配置角色`,builtInRole:`内置角色`,builtIn:`内置`,modelAssignment:`模型分配`,inheritParentModel:`继承父会话模型`,effectiveModel:`实际模型`,workflowConcurrencyLabel:`并行 Agent`,workflowCallLimit:`Agent 总调用数`,runtimeBoundaries:`运行时边界`,subagentAuthorityNote:`子会话权限是父会话与角色能力的故障关闭交集,不会静默扩大权限。`,subagentModelNote:`不会硬编码服务商;未分配的角色继承父会话模型和思考等级。`,resourceCount_one:`{{count}} 项资源`,resourceCount_other:`{{count}} 项资源`,noPluginsFound:`Pi 未报告已加载的插件来源。`,pluginCatalogTotals:`{{extensions}} 扩展 · {{skills}} 技能 · {{prompts}} 提示词 · {{themes}} 主题`,loaded:`已加载`,resourceOrigin:`来源类型`,resourceOrigin_package:`软件包`,resourceOrigin_topLevel:`顶层资源`,resources:`资源`,baseDirectory:`基础目录`,notReported:`未报告`,extensions:`扩展`,extensionSurfaceCount:`{{tools}} 个工具 · {{commands}} 个命令`,prompts:`提示词`,themes:`主题`,pluginResourceSummary:`{{extensions}} 扩展 · {{skills}} 技能 · {{prompts}} 提示词 · {{themes}} 主题`,pluginsManagedByPi:`这些资源由 Pi 加载。可通过上方 setup 表单提交变更;软件包操作沿用原生确认,并通过 Pi 的重新加载流程生效。`,selectPlugin:`选择一个插件来源`,statusCaptured:`采集于 {{time}} · 刷新查看最新状态`,conversationViews:`会话视图`,currentConversations:`当前`,archivedConversations:`已归档`,refreshArchives:`刷新归档会话`,loadingArchives:`正在加载归档会话...`,moreArchives:`加载更多归档会话`,retryArchives:`重试读取归档会话`,archiveLoadFailed:`无法加载归档会话。`,archiveCursorStale:`归档会话已变化,请刷新后继续。`,archiveScanBounded:`还有 {{count}} 条更早记录未扫描。`,noArchivedSessions:`没有归档会话。`,noScannedArchives:`已扫描历史中没有归档会话。`,noMatchingScannedArchives:`已扫描历史中没有匹配的归档会话。`,draftLimit:`草稿暂存已满,请先发送或清空已有草稿。`,restoreConversation:`恢复会话`,restoringConversation:`正在恢复…`,loadedArchives:`已加载历史中的归档会话`,loadedHistoryBounded:`另有 {{sessions}} 个会话和 {{workspaces}} 个工作区摘要未加载。搜索仅覆盖已加载列表。`,noLoadedArchives:`已加载列表中没有归档会话。`,restoreFailed:`暂时无法确认恢复结果,请刷新后重试。`,execution_running:`运行中`,execution_done:`已完成`,execution_killed:`已停止`,execution_timed_out:`已超时`,execution_failed:`失败`,execution_uncertain:`状态不确定`,activeOnlyHint:`只有当前 Web 会话可以接收消息。`,stopTurn:`停止当前轮次`,stoppingTurn:`正在停止当前轮次…`,stoppedTurn:`当前轮次已停止。`,pendingFollowUpsHint:`{{count}} 条消息正在排队`,sendNextTurn:`下一轮发送`,followUpBehavior:`跟进处理方式`,followUpBehaviorDetail:`OpenPI 运行时,将后续消息排队到下一轮,或引导当前轮次。按 ⌘/Ctrl+Enter 可仅对这条消息使用另一种方式。`,followUpQueue:`排队`,followUpQueueDetail:`下一轮发送`,followUpSteer:`引导`,followUpSteerDetail:`加入当前轮次`,steerCurrentTurn:`当前执行纠偏`,steeringHint:`在当前工具步骤结束后加入这条指示。`,pendingSteeringHint:`已接收 {{count}} 条纠偏指示,等待当前工具步骤结束`,steeringMessagesTitle:`当前轮次待处理的纠偏指示`,steerStaleTurn:`目标轮次已结束或变化。草稿已保留,请确认更新后的状态并重新发送。`,sourceFeedbackNew:`{{path}} · 新版本第 {{line}} 行`,sourceFeedbackOld:`{{path}} · 旧版本第 {{line}} 行`,forkMessage:`从此处分叉`,forkMessageHint:`从此消息创建新聊天,保留原聊天;不会自动发送消息。`,forkSessionPending:`正在创建分叉会话…`,forkSessionCreated:`已创建分叉会话,原会话保留在侧栏。`,forkSessionCancelled:`分叉已取消,原会话已保留。`,forkSessionUncertain:`无法确认分叉结果。请先刷新并检查会话列表,再决定是否重试。`,forkSessionUnavailable:`切换到此会话并等待当前执行和排队消息结束后,可以从这里创建新会话。`,reviewQuoteLine:`引用此行`,reviewSelectOldLine:`选择旧版本第 {{line}} 行`,reviewSelectNewLine:`选择新版本第 {{line}} 行`,queuedMore:`还有 {{count}} 条排队消息`,queuedImage:`图片附件`,queuedMessageExpand:`展开排队消息`,queuedMessageCollapse:`收起排队消息`,backgroundSessionRunning:`此会话正在后台运行…`,observedSessionTools:`{{count}} 个正在执行的工具`,toolsRequireCurrentSession:`切换到此会话后可使用交互工具。`,activateViewedSession:`切换到此会话`,activateViewedSessionHint:`发送消息即可继续此会话。`,acceptedHint:`OpenPI Web 已接收消息。`,promptAdmissionUnknown:`无法确认上次发送的消息是否已被接收。`,promptAdmissionUnknownDetail:`请先核对已刷新的会话历史和运行状态,再决定下一步。作为新消息发送可能产生重复消息。`,promptAdmissionCheckingDetail:`正在核对最新的会话历史和运行状态,核对完成前不能作为新消息发送。`,promptAdmissionVerificationFailedDetail:`暂时无法刷新最新的会话历史和运行状态。请重新核对后再决定是否作为新消息发送。`,abandonAdmission:`暂不重新发送`,retryAdmissionCheck:`重新核对`,retryOriginalAdmission:`重试原消息`,promptTooLong:`文本超出发送上限({{count}} / {{limit}})。`,sendAsNew:`作为新消息发送`,sendingAsNew:`正在发送…`,addWorkspace:`添加工作区`,addWorkspaceMenu:`添加工作区...`,archiveConversation:`归档会话`,pinnedConversations:`置顶`,sidebarOptions:`侧栏选项`,sidebarProjectOptions:`项目侧栏选项`,sidebarRecentOptions:`会话侧栏选项`,sidebarActivityOptions:`动态视图选项`,sidebarShow:`显示`,sidebarGroupBy:`会话分组`,sidebarByProject:`按项目分组`,sidebarFlatList:`所有会话`,sidebarChatSort:`会话排序`,sidebarRecent:`最近`,sidebarProjectsInRecents:`在最近列表显示项目会话`,sidebarShowMore:`展开显示`,sidebarShowLess:`收起显示`,sidebarFilterList:`筛选当前列表`,sidebarSaveFailed:`更改未能保存,请重试。`,pinWorkspace:`置顶项目`,unpinWorkspace:`取消置顶项目`,markConversationRead:`标记为已读`,markConversationUnread:`标记为未读`,sidebarState_unread:`未读会话`,sidebarActivity:`动态`,sidebarViewActivity:`查看动态`,sidebarViewChats:`查看会话`,sidebarPriority:`优先关注`,sidebarActivityEmpty:`没有需要关注的会话`,sidebarActivityEmptyHint:`已完成的工作和需要你处理的会话会显示在这里。`,sidebarMarkAllRead:`全部标记为已读`,sidebarClearRead:`清除优先关注中的已读会话`,sidebarReadFailed:`未能更新已读状态,请重试。`,sidebarToday:`今天`,sidebarYesterday:`昨天`,sidebarEarlier:`更早`,sidebarActivityCompleted:`已完成`,sidebarActivityFailed:`执行失败`,sidebarActivityRead:`已读`,modelAdvanced:`高级参数`,providerConnectionHeading:`提供商连接`,providerFetchModels:`获取可用模型`,providerFetchHint:`填写提供商和端点后,可一次选择多个模型。`,providerPickerTitle:`选择要添加的模型`,providerPickerAccess:`连接凭据`,providerPickerKey:`访问密钥(可选)`,providerPickerKeyHint:`留空使用此端点已保存的凭据。此处输入的密钥仅用于获取列表,不会保存。`,providerPickerSearch:`搜索模型`,providerPickerSelectAll:`全选`,providerPickerClear:`清空选择`,providerPickerLoading:`正在获取可用模型…`,providerPickerAdded:`已添加`,providerPickerNoMatch:`没有匹配的模型`,providerPickerEmpty:`提供商没有返回模型,仍可手动添加。`,providerPickerBounded:`当前显示前 500 个模型,其他模型可手动填写 ID。`,providerPickerError_load:`未能获取模型列表,请检查端点和凭据后重试,也可以手动添加。`,providerPickerError_save:`尚未确认保存成功。已保留你的选择,请检查连接后重试。`,providerPickerError_conflict:`配置已在其他地方更新,请关闭弹窗、重新读取配置后再保存。`,providerPickerDefaults:`新模型使用 {{context}} 上下文 / {{output}} 输出 token,添加后可逐个调整。`,providerPickerRetry:`刷新列表`,providerPickerCount:`已选 {{count}} 个 · 最多 100 个`,providerPickerSave:`添加所选`,sidebarState_running:`执行中`,sidebarState_compacting:`正在整理上下文`,sidebarState_waiting:`等待你的回复`,sidebarState_completed:`已完成 · 结果未读`,sidebarState_failed:`执行失败 · 打开会话查看详情`,pinnedOptions:`置顶选项`,pinConversation:`置顶会话`,unpinConversation:`取消置顶`,pinnedRecentlyUpdated:`最近更新`,pinnedManualOrder:`手动排序`,movePinUp:`上移`,movePinDown:`下移`,pinSaveFailed:`置顶设置未能保存,请重试。`,cancel:`取消`,chooseWorkspaceHint:`选择工作区并描述任务`,close:`关闭`,closeSearch:`关闭搜索`,collapseSidebar:`收起侧边栏`,confirmEdit:`保存并重新运行`,editMessageHint:`从这里创建新分支并重新运行;保留原对话、图片和文件引用。已有工作区改动会保留。`,regenerateMessage:`重新生成回答`,regenerateMessageHint:`在新分支重新运行这条问题,保留原附件和原对话。`,messageRerunStarted:`已在新分支接收重跑消息,原对话已保留。`,openOriginalConversation:`查看原对话`,messageRerunWorkspaceHint:`已有工作区改动会保留。`,modelRequestRecovered:`请求已恢复`,modelReconnecting:`正在重新连接`,modelReconnectUnknown:`重连状态待确认`,modelEarlierAttempts:`先前请求错误`,modelFailedAttempts:`失败尝试({{count}} 次)`,draftStorageUnavailable:`草稿未能保存到此设备,请保持页面打开或复制消息。`,draftStorageInvalid:`部分保存的草稿内容无法恢复,请检查消息和附件。`,draftStorageRetry:`重试保存草稿`,workbarBackToChat:`返回聊天`,workbarCollapseTools:`收起工具栏`,workbarEndTerminal:`关闭 {{name}} 并结束进程`,workbarNewTerminal:`新建终端`,workbarContinueInChat:`继续追问`,transcriptSearch:`搜索消息内容`,transcriptSearchPlaceholder:`搜索标题、项目或消息…`,transcriptSearchRecent:`最近会话`,transcriptSearchSessions:`会话`,transcriptSearchMessages:`消息内容`,transcriptSearchSessionResult:`打开会话 {{session}}`,transcriptSearchSessionOpenFailed:`暂时无法打开此会话,请重试。`,transcriptSearchIncludeArchived:`包含归档会话`,transcriptSearching:`正在搜索消息…`,transcriptSearchEmpty:`没有匹配的消息。`,transcriptSearchFailed:`暂时无法搜索消息,请重试。`,transcriptSearchRetry:`重试搜索`,transcriptSearchPartial:`部分历史未能搜索,结果可能不完整。`,transcriptSearchOpenFailed:`无法打开这条消息,它可能已移动或位于其他分支。`,transcriptSearchResult:`打开 {{session}} 中来自{{source}}的消息`,transcriptSearchSource_user:`你`,transcriptSearchSource_assistant:`助手`,transcriptSearchSource_tool_call:`工具调用`,transcriptSearchSource_tool_result:`工具结果`,connected:`已连接`,connecting:`正在连接`,conversationName:`会话名称`,conversationOptions:`会话选项`,sidebarRename:`重命名`,sidebarPin:`置顶`,sidebarUnpin:`取消置顶`,sidebarFork:`分叉`,sidebarForkLocal:`创建聊天分支`,sidebarForkSameWorktree:`在同一工作树中分叉`,archiveNoticeTitle:`聊天已归档`,archiveNoticeView:`查看`,archiveNoticeUndo:`撤销`,archiveNoticeFailed:`操作未完成,请重试。`,sidebarForkWorktree:`在新工作树中创建聊天分支`,sidebarForkCancelling:`正在请求取消…`,sidebarForkFinishing:`无法再取消,正在确认创建结果…`,sidebarForkCancelUnconfirmed:`无法确认取消,正在等待分叉结果。`,sidebarForkWorktreePreserved:`工作树已保留在 {{path}},请检查后再重试。`,sidebarForkWorktreePending:`正在创建工作树和聊天分支…`,sidebarForkOptionsLoading:`正在检查工作树是否可用…`,sidebarForkOptionsFailed:`无法检查工作树,请重新打开菜单重试。`,sidebarForkUnavailable:`发送消息后才能创建此聊天的分支。`,sidebarForkArchived:`请先恢复此会话,再创建分叉。`,sidebarForkFailed:`未能创建分叉,原会话已保留。`,sidebarCopy:`复制`,sidebarCopyLink:`复制会话链接`,sidebarCopyMarkdown:`复制为 Markdown`,sidebarCopyCwd:`复制工作目录`,sidebarCopied:`已复制`,sidebarCopyFailed:`复制失败,请重试。`,sidebarNewWindow:`在新窗口中打开`,sidebarOpenIn:`打开方式`,sidebarAppsLoading:`正在加载可用应用…`,sidebarAppsFailed:`无法加载应用,请重新打开菜单重试。`,sidebarOpenFailed:`无法在所选应用中打开此项目。`,sidebarArchive:`归档`,sidebarRestore:`恢复`,sidebarDelete:`永久删除`,managedWorktreeRecoveryFull:`请先核对先前未确认的移除请求,再开始新的请求。`,managedWorktreesChanged:`工作树列表已变化,请刷新后重新核对目标。`,managedWorktreesRefresh:`刷新工作树列表`,managedWorktreesBack:`返回工作树列表`,managedWorktreesRetry:`重试请求`,managedWorktrees:`保留的工作树`,managedWorktreesDescription:`删除会话会保留 OpenPI 创建的工作树。请核对准确路径后再请求移除。使用中、共享、有改动或无法确认归属的工作树会保留。`,managedWorktreeConfirm:`移除此工作树?服务端会重新核对归属、使用中的会话及本地改动后再操作。`,managedWorktreeRemoved:`工作树已移除。`,managedWorktreePreserved:`工作树已保留:`,managedWorktreeUncertainTerminal:`移除结果无法确认,不能自动重复移除。请先检查保留路径,再决定后续操作。`,managedWorktreeUncertain:`尚不能确认移除结果。重试会核对原请求。`,managedWorktreeRemoving:`正在核对并移除…`,managedWorktreeRemove:`移除工作树`,managedWorktreeReview:`核对移除`,managedWorktreesEmpty:`这一页没有找到托管工作树。`,managedWorktreesUnavailable:`有 {{count}} 条归属记录无法确认。`,managedWorktreesLoadFailed:`无法加载保留的工作树。请重试,目标不会改变。`,managedWorktreesMore:`加载更多工作树`,managedWorktreeRetainedAfterDelete:`会话已删除,工作树保留在 {{path}}。可从项目菜单核对保留的工作树。`,sidebarDeleteTitle:`删除会话?`,sidebarDeleteDescription:`确定永久删除“{{name}}”?此操作无法撤销。`,sidebarDeleteConfirm:`删除`,sidebarDeleting:`正在删除…`,sidebarDeleteFailed:`未能删除此会话,请重试或取消。`,sidebarActionRunning:`请等待当前工作和排队消息结束。`,sidebarActionDisconnected:`请先恢复连接,再修改此会话。`,sessionDeleteCancelled:`删除已取消`,sessionDeleteUncertain:`无法确认会话是否删除,请刷新后重试`,sessionDeleted:`会话已永久删除`,sessionDeleteMetadataPending:`会话已删除,但侧栏记录未清理完成`,sessionLinkUnavailable:`链接中的会话已不存在或身份已变化`,sidebarDropPin:`拖到此处置顶`,sidebarDropProjectLast:`将项目移到最后`,conversationTurns:`会话轮次`,conversationTurnPosition:`前往第 {{position}} 轮`,turnPreviewLoading:`正在加载预览…`,turnPreviewUnavailable:`暂时无法读取,请重试。`,commands:`斜杠命令`,addContext:`添加上下文`,fileReference:`引用工作区文件`,fileReferenceTitle:`引用工作区文件`,fileReferenceDetail:`将路径引用加入提示词,不上传文件内容。`,fileReferenceLabel:`工作区文件路径`,fileReferencePlaceholder:`src/app.tsx`,fileReferenceValidatedHint:`当前会话会验证该路径是可读取的工作区文件。`,fileReferenceDraftHint:`新会话启动后,Pi 会按其工具权限解析该路径。`,fileReferenceChecking:`正在检查…`,fileReferenceFailed:`无法验证该文件。`,fileReferenceDenied:`请选择当前会话工作区内的文件。`,fileReferenceMissing:`该工作区文件已不存在。`,fileReferenceUnsupported:`只能引用工作区中的普通文件。`,fileReferenceExpired:`活动会话已变化,请重新打开文件引用后再试。`,fileReferenceBusy:`文件校验正忙,请稍后重试。`,insertReference:`插入引用`,commandsSessionRequired:`会话启动后才能插入斜杠命令。`,commandsEmptyDraftOnly:`只能在空白草稿中插入斜杠命令。`,commandsLoading:`正在加载命令…`,commandsUnavailable:`暂时无法读取命令。`,commandsNoMatch:`没有匹配的命令。`,commandsNoAvailable:`已发现的命令均不能在 Web 中运行。输入具体命令名可查看其可用性。`,commandsBounded:`另有 {{count}} 个命令未显示。`,commandSessionRequired:`命令仅在已创建的 Web 会话中可用。`,commandUnsupported:`尚未适配 · 手动命令仍交给 Pi`,commandAcceptsArguments:`可输入参数`,commandSource_extension:`扩展命令`,commandSource_prompt:`提示词模板`,commandSource_skill:`技能`,copiedMessage:`已复制`,copyMessage:`复制消息`,copyFailed:`复制失败,请选中消息后手动复制。`,copiedCode:`代码已复制`,copyCode:`复制代码`,copyCodeFailed:`无法复制代码,请选中后手动复制。`,codeBlock:`代码块`,wrapCode:`自动换行`,expandCode:`展开全部 {{count}} 行`,collapseCode:`收起代码`,expandInput:`展开输入框`,collapseInput:`收起输入框`,deleteWorkspace:`删除工作区`,describeTask:`描述任务`,editMessage:`修改并从这里重跑`,enterHint:`按 Enter 发送,Shift+Enter 换行。`,expandSidebar:`展开侧边栏`,importWorkspace:`导入工作区`,loadingModels:`正在加载模型...`,modelsTruncated:`当前显示 {{shown}} 个模型,还有 {{omitted}} 个可用;搜索即可查找。`,searchModels:`搜索可用模型`,searchModelsPlaceholder:`搜索服务商、模型名称或 ID...`,searchingModels:`正在搜索模型...`,noMatchingModels:`没有匹配的模型`,modelSearchFailed:`模型搜索失败,请重试。`,retryModelSearch:`重试模型搜索`,fileReferenceDraftChanged:`草稿已变化,请重新打开文件引用。`,modelSearchTruncated:`还有 {{omitted}} 个匹配模型未显示。`,modelPreparing:`正在准备任务...`,modelRetrying:`模型请求重试中...`,modelRunning:`正在运行…`,modelRequestFailed:`模型请求失败`,modelRequestStopped:`模型请求已停止`,modelFailureUnknown:`服务商没有返回具体失败原因。`,retryPrompt:`重试消息`,retryingPrompt:`正在重试…`,newSession:`新建会话`,noConversations:`暂无对话`,noMatching:`没有匹配的会话`,noMatchingLoaded:`已加载历史中没有匹配的会话`,noModels:`没有可用模型`,noOutput:`无输出`,noSessions:`暂无会话`,openSidebar:`打开侧边栏`,promptMessage:`发消息或创建任务,/ 调用指令`,promptReadonly:`非当前会话不能接收消息`,promptStart:`选择一个工作区开始`,promptTask:`描述你想要构建的任务`,queuedHint:`当前回合结束后将发送消息。`,reconnecting:`正在重连`,removeWorkspace:`从侧边栏移除`,workspaceOptions:`工作区选项`,renameFailed:`无法保存名称,已保留你的修改。`,savingName:`正在保存...`,workspaceRemoveFailed:`无法移出工作区,请重试。`,removingWorkspace:`正在移出...`,renameConversation:`重命名会话`,renameWorkspace:`重命名工作区`,save:`保存`,searchConversations:`搜索会话`,searchPlaceholder:`筛选标题与工作目录…`,selectModel:`选择模型`,configureModels:`配置模型`,openModelSettings:`模型设置`,selectThinking:`选择思考等级`,thinkingAvailableLevels:`可选等级:{{levels}}`,resetThinking:`恢复打开时的等级({{level}})`,modelThinkingNotEnabled:`此模型未启用思考。如提供商支持,可在模型设置中开启「支持推理」。`,providerReasoningHint:`按提供商能力开启,在聊天输入框调节当前思考等级。`,providerThinkingLevels:`支持的思考等级`,providerThinkingLevelsHint:`选择此模型支持的等级,保存后同步到会话选择器。`,providerThinkingAutomatic:`自动(Pi 默认)`,providerThinkingSelected:`已选 {{count}} 项`,providerThinkingReset:`使用 Pi 默认等级`,providerImageHint:`未勾选图片时,模型不会收到图片附件。`,selectWorkspace:`选择工作区`,send:`发送`,processDetails:`执行过程`,processRunning:`正在执行`,processThinkingCount:`{{count}} 段思考`,processToolCount:`{{count}} 次工具调用`,processFailureCount:`{{count}} 次失败`,runtimeActivities:`执行活动`,activityAgentProgress:`{{completed}}/{{total}} 个子代理已结束`,activityCapacity:`并行任务:{{running}}/{{limit}} · {{queued}} 个等待中`,composerQueuedCount:`排队 {{count}}`,composerSteeringCount:`引导 {{count}}`,runtimeActivityRunning:`{{count}} 项进行中`,runtimeActivityCount:`{{count}} 项活动`,processActivityCount:`{{count}} 项 Agent 活动`,switchingSession:`正在切换会话...`,thinkingActive:`思考中...`,thinkingActiveLevel:`思考中({{level}})...`,thinkingDone:`思考过程`,thinkingLoadFull:`查看完整思考`,thinkingLoadingFull:`正在加载思考…`,thinkingLoadFailed:`思考加载失败,点击重试`,thinkingPartialText:`当前显示部分已保存的思考,可继续加载下方内容。`,thinkingPreviewOnly:`思考预览已达到显示上限,此消息保存后可查看完整内容。`,toolState_running:`执行中`,toolState_returned:`已返回`,toolState_failed:`失败`,toolState_cancelled:`已停止`,toolState_timed_out:`超时`,toolState_unknown:`未确认`,toolSnapshotMissingResult:`分叉时尚无结果`,toolActivity_running:`正在{{action}}`,toolActivity_failed:`{{action}}失败`,toolActivity_cancelled:`{{action}}已停止`,toolActivity_timed_out:`{{action}}超时`,toolActivity_unknown:`{{action}}`,toolAction_read:`读取`,toolAction_write:`写入文件`,toolAction_edit:`编辑文件`,toolAction_command:`运行`,toolAction_search:`搜索`,toolAction_list:`列出文件`,toolAction_web:`浏览网页`,toolAction_agent:`使用子代理`,subagentAction_spawn:`启动子代理`,subagentAction_send:`发送补充消息`,subagentAction_check:`查询子代理`,subagentAction_wait:`等待子代理`,subagentAction_cancel:`停止子代理`,subagentActionDone_spawn:`已启动子代理`,subagentActionDone_send:`已发送补充消息`,subagentActionDone_check:`已查询子代理`,subagentActionDone_wait:`已结束等待`,subagentActionDone_cancel:`停止请求已返回`,toolAction_workflow:`调用工作流`,toolAction_plan:`准备计划`,toolAction_git:`查看变更`,toolAction_call:`调用工具`,toolActionDone_read:`已读取`,toolActionDone_write:`已写入`,toolActionDone_edit:`已编辑`,toolActionDone_command:`已运行`,toolActionDone_search:`已搜索`,toolActionDone_list:`已列出的文件`,toolActionDone_web:`已浏览网页`,toolActionDone_agent:`子代理工具已返回`,toolActionDone_workflow:`工作流工具已返回`,toolActionDone_plan:`计划工具已返回`,toolActionDone_git:`已查看变更`,toolActionDone_call:`已调用工具`,toolActionGroup_read:`读取文件`,toolActionGroup_write:`写入文件`,toolActionGroup_edit:`编辑文件`,toolActionGroup_command:`运行命令`,toolActionGroup_search:`搜索`,toolActionGroup_list:`列出文件`,toolActionGroup_web:`浏览网页`,toolActionGroup_agent:`子代理活动`,toolActionGroup_workflow:`工作流活动`,toolActionGroup_plan:`准备计划`,toolActionGroup_git:`查看变更`,toolActionGroup_call:`调用工具`,toolGroup_done:`{{actions}}`,toolGroup_running:`正在{{actions}}`,toolGroup_unknown:`{{actions}}`,toolGroupSeparator:`、`,toolSearchTarget:`“{{pattern}}” · {{path}}`,toolDiffStatsHelp:`当前显示差异中的新增和删除行数`,toolRequestedFile:`文件:`,toolWorkspace:`工作区`,toolRawEvidence:`参数与原始结果`,toolCodemodeDetails:`脚本与原始结果`,toolNestedOutputMissing:`会话记录保留了调用和状态,未保存此子工具的输出。`,toolNestedArgumentsMissing:`会话记录未保留完整参数和此子工具的输出。`,toolNestedIncomplete:`子调用记录不完整,部分调用、参数或最终状态不可用。`,toolPartialEvidence:`输出未完整显示:已达到字节、行数或条目上限。原始结果也可能被截断。`,toolFileChange_created:`已创建文件`,toolFileChange_unchanged:`文件内容未改变`,toolFileChange_overwritten:`已覆盖文件`,toolChangeUnavailable:`此工具结果未提供修改对比。`,toolTestResults:`测试结果摘要 · {{format}}`,toolTestCounts:`{{tests}} 项测试 · {{passed}} 通过 · {{failed}} 失败 · {{cancelled}} 取消`,toolTestCountsHelp:`数量来自命令输出,执行状态单独显示。`,toolReadMore:`可使用文件路径和 offset 继续读取,具体方式见原始结果。`,toolFullOutputReference:`完整输出:`,subagentBackgroundResult:`后台子代理结果 · {{count}}`,thinkingDraftHint:`请先选择工作区并创建会话。`,thinkingInactiveHint:`只有当前会话可以更改思考等级。`,thinkingLevelMismatch:`当前确认的思考等级不在此模型支持范围内;选择其它等级即可修正。`,thinkingLockedRunning:`请先停止当前轮次,再更改思考等级。`,thinkingModelPendingHint:`请等待模型切换完成。`,thinkingNotConfirmed:`思考等级未获确认,请重试。`,thinkingPendingHint:`正在应用思考等级...`,thinkingUnsupported:`暂不支持思考`,thinkingUnsupportedHint:`尚未选择模型,或当前模型不支持思考。`,unavailable:`不可用`,ungrouped:`未分组`,untitledSession:`新会话`,workspaceDeleteConfirm:`文件夹与会话记录会保留,其中的会话会被放到“未分组”;再次打开此目录时将是一个干净的工作区。`,workspaceName:`工作区名称`,workspaces:`工作区`,sidebarProjects:`项目`}}},dG=navigator.language?.toLowerCase().startsWith(`zh`)?`zh`:`en`;Xl.use(Zl).init({fallbackLng:`en`,initAsync:!1,interpolation:{escapeValue:!1},lng:dG,resources:uG}),document.documentElement.lang=dG===`zh`?`zh-CN`:`en`;var fG=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},pG=10,mG=13,hG=32,gG=6;function _G(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{maxBufferSize:t,onComment:n,onError:r,onEvent:i,onId:a,onRetry:o}=e,s=[],c=0,l=!0,u,d=``,f=0,p,m=!1,h=!1,g=!1;function _(e){if(m)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l&&(l=!1,e.charCodeAt(0)===65279?e=e.slice(1):e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),(h||g)&&(e=v(e),!e))return;if(!s.length){let t=S(e);t!==``&&y(t),x();return}if(e.indexOf(` `)===-1&&e.indexOf(`\r`)===-1){if(c0&&i?.({id:u,event:p,data:d}),u=void 0,d=``,f=0,p=void 0,t=n+1,n=e.indexOf(` @@ -113,12 +113,13 @@ Try polyfilling it using "@formatjs/intl-pluralrules" `),C=`${e.id}:${S}`,w=c?.source===C?c.status:null,T=`${e.id}:diff:${d.diff}`,E=c?.source===T?c.status:null,D=d.output.split(` `).map((e,t)=>({text:e,number:d.offset+t})),O=d.diff?yK(d.diff):[],k=O.filter(e=>e.kind===`added`).length,A=O.filter(e=>e.kind===`removed`).length,j=d.diff||d.change===`created`?(0,q.jsxs)(`span`,{className:`evidence-summary-meta`,title:s(`toolDiffStatsHelp`),children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,k.toLocaleString()]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,A.toLocaleString()]}),d.truncated&&(0,q.jsx)(`span`,{children:s(`gitReviewPartialLabel`)})]}):null,M=d.tests?.failures.map((e,t)=>({text:e,number:t+1}))??[];return(0,q.jsxs)(`details`,{className:`tool-evidence-card evidence-${d.kind}`,"data-state":f,"data-tool":e.name,open:a||void 0,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(`span`,{className:`evidence-icon`,"aria-hidden":`true`,children:(0,q.jsx)(y,{})}),(0,q.jsxs)(`span`,{className:`evidence-target`,title:h||b,children:[(0,q.jsx)(`span`,{className:`tool-action`,children:f===`returned`&&d.change===`created`?s(`toolFileChange_created`):gK(s,e.name,f)}),v?(0,q.jsx)(`span`,{className:`evidence-filename`,children:v}):b?(0,q.jsx)(`span`,{className:`evidence-command`,children:b}):null]}),j,(0,q.jsx)(os,{className:`evidence-chevron`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`evidence-status`,children:p})]}),(0,q.jsxs)(`div`,{className:`evidence-content`,children:[(m||d.displayPath||d.pathUnavailable)&&!d.diff&&(0,q.jsxs)(`p`,{children:[(0,q.jsx)(`strong`,{children:s(`toolRequestedFile`)}),` `,u&&m?(0,q.jsx)(`button`,{className:`artifact-link`,type:`button`,onClick:()=>u.open(m),children:(0,q.jsx)(`code`,{children:g})}):(0,q.jsx)(`code`,{children:g}),i&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`br`,{}),(0,q.jsxs)(`small`,{children:[s(`toolWorkspace`),`: `,i]})]})]}),d.pathUnavailable&&(0,q.jsx)(`p`,{className:`evidence-warning`,children:d.pathUnavailable}),x&&(0,q.jsxs)(`figure`,{className:`evidence-shell`,"aria-label":s(`toolCallOutput`),children:[(0,q.jsxs)(`figcaption`,{children:[(0,q.jsxs)(`span`,{className:`evidence-shell-label`,children:[(0,q.jsx)(Vc,{"aria-hidden":`true`}),e.name===`bash`?`Bash`:`Shell`]}),(0,q.jsxs)(`span`,{className:`evidence-process-meta`,children:[p,d.exitCode===void 0?d.signal?` · ${d.signal}`:``:` · exit ${d.exitCode}`]}),(0,q.jsx)(`button`,{type:`button`,"data-copied":w===`copiedCode`||void 0,"aria-label":s(w===`copiedCode`?`copiedCode`:`copyCode`),title:s(w===`copiedCode`?`copiedCode`:`copyCode`),onClick:async()=>{let e=await td(S);l({source:C,status:e?`copiedCode`:`copyCodeFailed`})},children:w===`copiedCode`?(0,q.jsx)(rs,{}):(0,q.jsx)(_s,{})})]}),d.command&&(0,q.jsxs)(`pre`,{className:`evidence-shell-command`,children:[`$ `,d.command]}),(d.output||!d.command)&&(0,q.jsx)(`pre`,{className:`evidence-shell-output`,tabIndex:0,children:d.output||s(`noOutput`)}),w===`copyCodeFailed`&&(0,q.jsx)(`p`,{role:`status`,className:`evidence-warning`,children:s(w)})]}),d.truncated&&(0,q.jsx)(`p`,{className:`evidence-warning`,children:s(`toolPartialEvidence`)}),d.change&&!d.diff&&(0,q.jsx)(`p`,{children:s(`toolFileChange_${d.change}`)}),d.kind===`change`&&!d.diff&&!d.change&&(0,q.jsx)(`p`,{children:d.evidenceUnavailable??s(`toolChangeUnavailable`)}),d.tests&&(0,q.jsxs)(`figure`,{className:`evidence-test-summary`,"aria-label":`Test evidence`,children:[(0,q.jsx)(`figcaption`,{children:(0,q.jsx)(`strong`,{children:s(`toolTestResults`,{format:d.tests.format})})}),(0,q.jsx)(`p`,{children:s(`toolTestCounts`,d.tests)}),(0,q.jsx)(`p`,{children:s(`toolTestCountsHelp`)}),M.map(e=>(0,q.jsx)(bK,{"aria-label":`Failure excerpt ${e.number}`,children:e.text},e.number))]}),x?null:d.diff?(0,q.jsxs)(`figure`,{className:`evidence-diff`,"aria-label":`Change diff`,children:[(0,q.jsxs)(`figcaption`,{children:[u&&m?(0,q.jsx)(`button`,{className:`evidence-diff-file`,type:`button`,title:g,"aria-label":g,onClick:()=>u.open(m),children:v}):(0,q.jsx)(`span`,{className:`evidence-diff-file`,title:g,children:v}),j,(0,q.jsx)(`button`,{className:`evidence-copy`,type:`button`,"data-copied":E===`copiedCode`||void 0,"aria-label":s(E===`copiedCode`?`copiedCode`:`copyCode`),title:s(E===`copiedCode`?`copiedCode`:`copyCode`),onClick:async()=>{let e=await td(d.diff??``);l({source:T,status:e?`copiedCode`:`copyCodeFailed`})},children:E===`copiedCode`?(0,q.jsx)(rs,{}):(0,q.jsx)(_s,{})})]}),(0,q.jsx)(`pre`,{className:`evidence-diff-lines`,children:O.map(e=>(0,q.jsxs)(`span`,{className:`evidence-diff-row diff-${e.kind}`,children:[(0,q.jsx)(`span`,{className:`evidence-line-number`,"aria-hidden":`true`,children:e.newLine??e.oldLine??``}),(0,q.jsx)(`span`,{className:`evidence-diff-marker`,children:e.marker}),(0,q.jsx)(`span`,{children:e.code}),` `]},e.id))}),E===`copyCodeFailed`&&(0,q.jsx)(`p`,{role:`status`,className:`evidence-warning`,children:s(E)})]}):d.numberLines?(0,q.jsx)(bK,{className:`evidence-lines`,"aria-label":`File content`,children:D.map(e=>(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`span`,{className:`evidence-line-number`,"aria-hidden":`true`,children:e.number}),e.text,` -`]},e.number))}):(0,q.jsx)(bK,{className:`evidence-log`,"aria-label":`Tool output`,children:d.output||s(`noOutput`)}),d.kind===`file`&&d.truncated&&(0,q.jsx)(`p`,{children:s(`toolReadMore`)}),d.recovery&&(0,q.jsxs)(`p`,{children:[s(`toolFullOutputReference`),` `,(0,q.jsx)(`code`,{children:d.recovery})]}),d.readRecovery&&(0,q.jsx)(`p`,{className:`evidence-warning`,children:d.readRecovery}),(0,q.jsxs)(`details`,{children:[(0,q.jsx)(`summary`,{children:s(`toolRawEvidence`)}),(0,q.jsx)(`p`,{children:(0,q.jsx)(`code`,{children:e.name})}),(0,q.jsx)(`p`,{children:(0,q.jsx)(`strong`,{children:s(`toolCallArguments`)})}),(0,q.jsx)(`pre`,{children:d.rawArguments}),(0,q.jsx)(`p`,{children:(0,q.jsx)(`strong`,{children:s(`toolCallOutput`)})}),(0,q.jsx)(`pre`,{children:d.rawResult})]}),o]})]})}function SK({changes:e,onReview:t}){let{t:n}=W(),[r,i]=(0,K.useState)(!1),a=(0,K.useId)();if(e.state===`unavailable`||e.files.length===0)return null;let o=e.state===`partial`,s=e.source===`file-tools`,c=e.fileCount===null;return(0,q.jsxs)(`section`,{className:`turn-changes`,"aria-label":n(`turnChangesReview`),children:[(0,q.jsxs)(`header`,{className:`turn-changes-header`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`turn-changes-summary`,"aria-expanded":r,"aria-controls":a,onClick:()=>i(e=>!e),children:[(0,q.jsx)(Ms,{className:`turn-changes-icon`,"aria-hidden":`true`}),(0,q.jsx)(`strong`,{title:n(s?`turnEditsScope`:`turnChangesScope`),children:n(s?c?`turnEditsPartial`:`turnEdits`:o?`turnChangesPartial`:`turnChanges`,{count:e.fileCount??e.files.length})}),!c&&!e.files.some(e=>e.binary||e.statsUnavailable)&&(0,q.jsxs)(`span`,{className:`turn-changes-totals`,children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,e.additions]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,e.deletions]})]}),o&&!s&&(0,q.jsx)(`span`,{className:`turn-changes-warning`,children:n(`turnChangesIncomplete`)}),(0,q.jsx)(is,{className:r?`up`:``,"aria-hidden":`true`})]}),(0,q.jsx)(`button`,{type:`button`,className:`turn-changes-review-button`,"aria-label":n(`turnChangesReview`),disabled:!t,onClick:()=>t?.(e.promptEntryId,e.files[0]?.path),children:n(`reviewChanges`)})]}),(0,q.jsx)(`div`,{className:`turn-changes-list`,id:a,hidden:!r,children:e.files.map(r=>{let i=Math.max(r.path.lastIndexOf(`/`),r.path.lastIndexOf(`\\`));return(0,q.jsxs)(`button`,{type:`button`,className:`turn-changes-file`,title:r.path,"aria-label":r.path,disabled:!t,onClick:()=>t?.(e.promptEntryId,r.path),children:[(0,q.jsxs)(`span`,{className:`turn-changes-path`,children:[(0,q.jsx)(`strong`,{children:r.path.slice(i+1)}),i>=0&&(0,q.jsx)(`span`,{children:r.path.slice(0,i)})]}),(0,q.jsx)(`span`,{className:`turn-changes-file-stats`,children:r.binary?(0,q.jsx)(`span`,{children:n(`gitReviewBinaryShort`)}):r.statsUnavailable?(0,q.jsx)(`span`,{title:n(`turnEditReason_${r.statsUnavailable}`),children:n(`turnEditStatsUnknown`)}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,r.additions]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,r.deletions]})]})})]},r.path)})})]})}function CK({item:e,position:t,current:n,onNavigate:r,onPreview:i}){let{t:a}=W(),o=(0,K.useRef)(()=>{}),s=ed({placement:`start`,delay:150,hideDelay:100,touchTrigger:`none`,onShow:(0,K.useCallback)(()=>i(e.entryId,()=>o.current()),[e.entryId,i])});return o.current=s.hide,(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{ref:s.ref,className:`turn-tick`,type:`button`,"data-turn-entry":e.entryId,"aria-label":a(`conversationTurnPosition`,{position:t}),"aria-describedby":s.describedBy,"aria-current":n?`location`:void 0,onClick:()=>{s.hide(),r(e.entryId)},children:(0,q.jsx)(`span`,{className:`turn-tick-mark`,"aria-hidden":`true`})}),s.renderHoverCard((0,q.jsx)(`span`,{className:`turn-preview`,children:e.previewState===`idle`||e.previewState===`loading`?(0,q.jsx)(`span`,{role:`status`,children:a(`turnPreviewLoading`)}):e.previewState===`unavailable`?(0,q.jsx)(`span`,{role:`status`,children:a(`turnPreviewUnavailable`)}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`turn-preview-prompt`,children:e.title}),e.reply&&(0,q.jsx)(`span`,{className:`turn-preview-reply`,children:e.reply})]})}),{className:`turn-preview-layer`})]})}function wK({items:e,viewport:t,onNavigate:n,readingHistory:r,onRequestPreview:i,enabled:a=!0,onHidden:o}){let{t:s}=W(),c=(0,K.useRef)(null),l=JSON.stringify(e.map(e=>e.entryId)),u=(0,K.useRef)(null),d=(0,K.useRef)(null),f=(0,K.useRef)(!1),p=(0,K.useRef)(0),[m,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)({top:0,height:0,visible:!1,current:[]}),v=(0,K.useCallback)(()=>{u.current?.hide(),u.current=null,d.current&&d.current.captureTarget.hasPointerCapture?.(d.current.pointerId)&&d.current.captureTarget.releasePointerCapture(d.current.pointerId),d.current=null,p.current++,o?.()},[o]),y=(0,K.useCallback)((e,n)=>{if(!a||!t.current||!c.current||c.current.style.visibility===`hidden`||t.current.checkVisibility?.()===!1||c.current.checkVisibility?.()===!1||getComputedStyle(t.current).display===`none`||getComputedStyle(c.current).display===`none`){n();return}u.current?.entryId!==e&&u.current?.hide(),u.current={entryId:e,hide:n},i?.(e)},[a,t,i]),b=(0,K.useCallback)((e,t=!1)=>{u.current?.hide();let r=++p.current;h(!1),Promise.resolve(n(e,t)).then(e=>{p.current===r&&e===!1&&h(!0)})},[n]);return(0,K.useLayoutEffect)(()=>{let e=t.current,n=e?.parentElement,i=JSON.parse(l);if(!e||!n){v();return}let o,s=r?n.querySelector(`.jump-to-latest`):null,u=()=>{o=void 0;let t=e.getBoundingClientRect(),r=n.getBoundingClientRect(),l=new Map;for(let t of e.querySelectorAll(`[data-history-entry]`)){let e=t.dataset.historyEntry;e&&!l.has(e)&&l.set(e,t)}let u=e.querySelector(`.conversation-turn`)??l.values().next().value,d=e.offsetWidth>0?t.width/e.offsetWidth:1,f=a&&t.height>0&&d>0&&!!u&&(t.right-u.getBoundingClientRect().right)/d>=48&&e.checkVisibility?.()!==!1&&getComputedStyle(e).display!==`none`&&(!c.current||getComputedStyle(c.current).display!==`none`);f||v();let p=s?.getBoundingClientRect(),m=Math.min(t.bottom-8,p&&p.height>0?p.top-12:1/0),h=Math.max(0,m-t.top-8),g=i.flatMap(e=>{let n=l.get(e);if(!n)return[];let r=(n.closest(`.conversation-turn`)??n).getBoundingClientRect();return r.bottom>t.top+16&&r.tope.top===y.top&&e.height===y.height&&e.visible===f&&e.current.join(`\0`)===g.join(`\0`)?e:y)},d=()=>{o===void 0&&(o=requestAnimationFrame(u))};u(),e.addEventListener(`scroll`,d),window.addEventListener(`resize`,d);let f=typeof ResizeObserver>`u`?void 0:new ResizeObserver(d);f?.observe(e),f?.observe(n),s&&f?.observe(s);for(let t of e.children)f?.observe(t);let p=new MutationObserver(d);return p.observe(e,{childList:!0,subtree:!0}),()=>{o!==void 0&&cancelAnimationFrame(o),e.removeEventListener(`scroll`,d),window.removeEventListener(`resize`,d),f?.disconnect(),p.disconnect()}},[l,t,r,a,v]),(0,K.useLayoutEffect)(()=>{if(g.height,!g.visible||d.current)return;let e=c.current,t=Array.from(e?.querySelectorAll(`[data-turn-entry]`)??[]),n=t.find(e=>e===document.activeElement)??t.find(e=>e.matches(`:hover`))??t.find(e=>g.current.includes(e.dataset.turnEntry??``));if(!e||!n)return;let r=e.getBoundingClientRect(),i=n.getBoundingClientRect();i.topr.bottom&&(e.scrollTop+=i.bottom-r.bottom)},[g.current,g.height,g.visible,l]),(0,K.useLayoutEffect)(()=>{let n=t.current;if(!n)return;let r=t=>{if(!a||t.defaultPrevented||t.isComposing||!t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||![`ArrowUp`,`ArrowDown`].includes(t.key)||!n.parentElement?.contains(document.activeElement)||n.checkVisibility?.()===!1||getComputedStyle(n).display===`none`||getComputedStyle(n).visibility===`hidden`||n.getBoundingClientRect().height<=0)return;let r=new Map;for(let e of n.querySelectorAll(`[data-history-entry]`)){let t=e.dataset.historyEntry;t&&!r.has(t)&&r.set(t,e)}let i=e.flatMap((e,t)=>{let n=r.get(e.entryId);return n?[{item:e,index:t,top:n.getBoundingClientRect().top}]:[]}),o=n.getBoundingClientRect().top,s;if(t.key===`ArrowDown`){let t=i.findIndex(e=>e.top>o+24);s=i.length===0?e[0]:t<0?e[i.at(-1).index+1]:e[(i[t-1]?.index??-1)+1]}else{for(let t=i.length-1;t>=0;t--){let n=i[t];if(Math.abs(n.top-o)<=24){s=e[n.index-1];break}if(n.tope.top>o+24)&&(s=i[0]?.item),i.length===0&&(s=e.at(-1))}s&&(t.preventDefault(),b(s.entryId))};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[t,a,e,b]),(0,K.useLayoutEffect)(()=>()=>v(),[v]),e.length<4?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`nav`,{ref:c,className:`turn-rail`,"aria-label":s(`conversationTurns`),style:{top:g.top,maxHeight:g.height,visibility:g.visible?`visible`:`hidden`},onClickCapture:e=>{f.current&&=(e.preventDefault(),e.stopPropagation(),!1)},onPointerDown:e=>{if(!e.isPrimary||e.button!==0)return;let t=e.target instanceof Element?e.target.closest(`.turn-tick`):null;!t||!e.currentTarget.contains(t)||(f.current=!1,d.current={pointerId:e.pointerId,captureTarget:t,y:e.clientY,moved:!1},t.setPointerCapture?.(e.pointerId))},onPointerMove:e=>{let t=d.current;if(!t||t.pointerId!==e.pointerId||Math.abs(e.clientY-t.y)<3&&!t.moved)return;t.moved=!0,f.current=!0;let n=Array.from(e.currentTarget.querySelectorAll(`[data-turn-entry]`)).find(t=>{let n=t.getBoundingClientRect();return e.clientY>=n.top&&e.clientY{let t=d.current;d.current=null,t?.captureTarget.hasPointerCapture?.(e.pointerId)&&t.captureTarget.releasePointerCapture(e.pointerId)},onPointerCancel:e=>{let t=d.current;d.current=null,t?.captureTarget.hasPointerCapture?.(e.pointerId)&&t.captureTarget.releasePointerCapture(e.pointerId),f.current=!1},children:e.map((e,t)=>(0,q.jsx)(CK,{item:e,position:t+1,current:g.current.includes(e.entryId),onNavigate:b,onPreview:y},e.entryId))}),m&&(0,q.jsx)(`span`,{className:`turn-navigation-error`,role:`status`,children:s(`turnPreviewUnavailable`)})]})}function TK(e){if(e.role!==`custom`||e.customType!==`openpi-setup-request`||e.truncation?.details)return e;let t=e.details;return!t||typeof t!=`object`||Array.isArray(t)||!(`command`in t)||t.command!==`openpi-setup`&&t.command!==`my-pi-setup`||!(`request`in t)||typeof t.request!=`string`?e:{...e,role:`user`,content:`/${t.command}${t.request?` ${t.request}`:``}`,parts:void 0}}function EK(e,t){let n=e.parentId,r=new Set;for(let e=0;n&&e<32;e++){if(r.has(n))return;r.add(n);let e=t(n);if(!e||e.id!==n)return;if(e.message?.role!==`system`)return e.message;n=e.parentId}}function DK(e,t){let n=TK(e);return e.customType===`openpi-setup-request`&&n.role===`user`&&t?.role===`user`&&t.customType===`openpi-web-command-input`&&typeof t.commandId==`string`&&t.commandId.length>0&&t.commandId.length<=128&&!/[\u0000-\u001f\u007f]/u.test(t.commandId)&&t.content===n.content}function OK(e){if(e.role===`toolResult`&&e.toolCallId&&!e.toolCallId.includes(`[truncated]`))return`tool-result-${e.toolCallId}`;if(e.role!==`assistant`||e.truncation?.partsOmitted)return;let t=e.parts?.filter(e=>e.type===`toolCall`);if(!(!t?.length||t.some(e=>!e.id||e.id.includes(`[truncated]`))))return`tool-calls-${JSON.stringify(t.map(e=>e.id))}`}function kK(e){let t=OK(e);if(t)return t;if(e.timestamp!==void 0)return`message-${e.role}-${e.timestamp}`}function AK(e){return[`assistant`,`toolResult`].includes(e.role??``)&&!e.truncation?.truncated?JSON.stringify(e):null}function jK(e){return JSON.stringify([e.role,e.content,(e.parts??[]).filter(t=>e.role!==`user`||t.type!==`text`).map(t=>t.type===`image`?[t.type,t.mimeType,e.role===`user`?void 0:t.name]:t.type),e.stopReason,e.errorMessage,e.toolCallId])}function MK(e){return e.role===`user`?jK(e):JSON.stringify({...e,timestamp:void 0})}var NK=new WeakMap;function PK(e,t){let n=NK.get(e),r=n?.get(t);if(r&&r.length===e.length&&r.head===e[0]&&r.tail===e[e.length-1])return r.projection;let i=new Map(e.map(e=>[e.id,e])),a=new Map;for(let t of e){let e=t.message&&AK(t.message);if(!e)continue;let n=a.get(e)??[];n.push(t),a.set(e,n)}let o=e.flatMap(e=>{if(e.forkSnapshotBoundary)return[{key:e.id,entryId:e.id,timestamp:e.timestamp,forkSnapshotBoundary:!0,message:{role:`custom`,content:``}}];if(e.type===`compaction`)return[{key:e.id,entryId:e.id,timestamp:e.timestamp,compaction:!0,message:{role:`custom`,content:``}}];if(`turnTiming`in e&&e.turnTiming&&e.turnTiming.sessionId===t)return[{key:e.id,timestamp:e.timestamp,timing:e.turnTiming,message:{role:`custom`,content:``}}];if(e.type!==`message`||!e.message)return[];let n=TK(e.message),r=EK(e,e=>i.get(e));return DK(e.message,r)?[]:[{key:e.id,entryId:e.id,timestamp:e.timestamp,message:n}]}),s=new Map,c=new Map;o.forEach((e,t)=>{if(e.entryId&&s.set(e.entryId,t),e.timing||e.compaction||e.forkSnapshotBoundary)return;let n=kK(e.message)??e.entryId??e.key,r=c.get(n)??[];r.push(t),c.set(n,r)});let l=[];for(let e of c.values())if(!(e.length<2))for(let t of e){let e=o[t].entryId;e&&l.push(e)}let u=new Map,d=0;for(let t of e){if(t.message?.role!==`custom`||t.message.truncation?.truncated)continue;let e=MK(t.message),n=u.get(e)??[];n.push(d),u.set(e,n),d++}let f=o.map(e=>({identity:kK(e.message),signature:MK(e.message),content:e.message.content})),p=new Map,m=new Map;f.forEach((e,t)=>{let n=m.get(e.signature)??[];if(n.push(t),m.set(e.signature,n),e.identity===void 0)return;let r=p.get(e.identity)??[];r.push(t),p.set(e.identity,r)});let h=new Map(e.map((e,t)=>[e.id,t])),g=o.filter(e=>e.message.role===`user`).map(e=>({key:e.entryId??e.key,position:h.get(e.entryId??e.key),parentId:i.get(e.entryId??e.key)?.parentId,signature:jK(e.message)})),_=new Map;for(let e of g){let t=_.get(e.signature)??[];t.push(e),_.set(e.signature,t)}let v={nativeById:i,exactNative:a,baseEntries:o,indexById:s,lookupIndexes:c,ambiguousNativeIds:l,customIndexes:u,nativeByIdentity:p,nativeByLegacySignature:m,nativeMessages:f,promptCandidates:g,promptsBySignature:_,commandInputs:new Map(o.flatMap(e=>e.message.role===`user`&&e.message.customType===`openpi-web-command-input`&&e.message.commandId?[[e.message.commandId,e.entryId??e.key]]:[])),persistedPositions:h};return n||(n=new Map,NK.set(e,n)),n.set(t,{projection:v,length:e.length,head:e[0],tail:e[e.length-1]}),v}function FK(e,t){if(!e)return-1;for(let n of e)if(!t.has(n))return n;return-1}function IK(e,t){let n=[e.timingKey,e.key,e.entryId,e.ambiguousTimingIdentity?void 0:kK(e.message)];for(let e of n){if(!e)continue;let n=t[e];if(n!==void 0)return n}}function LK(e,t,n){let{nativeRowKeys:r,ambiguousTimingIds:i}=n,a=e.selectedSession,o=PK(a?.entries??[],a?.id);for(let e of r.keys())o.nativeById.has(e)||r.delete(e);for(let e of i)o.nativeById.has(e)||i.delete(e);let s=new Map;for(let e of t){if(e.optimistic)continue;let t=AK(e.message);if(!t)continue;let n=s.get(t)??[];n.push(e),s.set(t,n)}let c=new Set(r.values());for(let[e,t]of s){let n=o.exactNative.get(e);if(n?.length!==1||t.length!==1)continue;let a=n[0].id,s=t[0].key;r.has(a)||i.has(a)||c.has(s)||o.nativeById.has(s)||(r.set(a,s),c.add(s))}for(let e of o.ambiguousNativeIds)i.add(e);let l=new Map,u=new Set;for(let e of t){let t=kK(e.message)??e.key,n=o.lookupIndexes.get(t);if(!n)continue;let a=MK(e.message),s=n.filter(e=>o.nativeMessages[e]?.signature===a);if((s.length!==n.length||n.length>1)&&u.add(t),s.length===1){let n=s[0],a=o.baseEntries[n].entryId,c=a?r.get(a):void 0;if(c&&c!==e.key||a&&i.has(a)&&!c&&e.key!==a){u.add(t);continue}let d=l.get(n);d===void 0||d===e.key?l.set(n,e.key):(l.set(n,null),u.add(t))}}for(let e of u)for(let t of o.lookupIndexes.get(e)??[]){let e=o.baseEntries[t].entryId;e&&i.add(e)}let d=new Set(t.flatMap(e=>e.optimistic?.projectedEntryId?[e.optimistic.projectedEntryId]:[])),f=[],p=[],m=e.selectedExecution?.sessionId===a?.id&&e.selectedExecution?.sessionPath===a?.path?e.selectedExecution:void 0,h=m?.pendingFollowUps??0,g=Math.max(0,t.filter(e=>e.optimistic?.admitted&&!e.optimistic.projectedEntryId&&!o.commandInputs.has(e.optimistic.commandId)).length-h),_=0,v=new Set,y=new Set,b=new Set,x=[];for(let e of t){if(e.optimistic?.projectedEntryId)continue;if(e.message.role===`custom`&&!e.message.truncation?.truncated){let t=MK(e.message),n=FK(o.customIndexes.get(t),y);if(n>=0){y.add(n);continue}}let n=e.optimistic?.commandId??(e.key.startsWith(`optimistic-`)?e.key.slice(11):void 0),r=n?o.commandInputs.get(n):void 0;if(r){e.optimistic&&f.push({key:e.key,entryId:r});continue}let i=TK(e.message);if(i.role===`user`&&e.optimistic){let t=e.optimistic.afterEntryId===null?-1:o.persistedPositions.get(e.optimistic.afterEntryId),n=!e.optimistic.admitted||_>=g?void 0:o.promptsBySignature.get(jK(i))?.find(n=>n.position!==void 0&&(t===void 0?n.parentId===e.optimistic?.afterEntryId:n.position>t)&&!d.has(n.key));if(n){d.add(n.key),f.push({key:e.key,entryId:n.key}),_++;continue}}else{let e=i.role===`user`?t.find(e=>e.optimistic?.admitted&&!e.optimistic.projectedEntryId&&!v.has(e.key)&&!f.some(t=>t.key===e.key)&&e.optimistic.sessionId===a?.id&&e.optimistic.sessionPath===a?.path&&jK(TK(e.message))===jK(i)):void 0;if(e){v.add(e.key);continue}let n=kK(i),r=OK(i),s=MK(i),c=i.truncation?.transport?i.content.replace(/\n\[truncated\]$/,``):void 0,l=n===void 0?FK(o.nativeByLegacySignature.get(s),b):(o.nativeByIdentity.get(n)??[]).find(e=>(r!==void 0||!b.has(e))&&(r!==void 0||(c===void 0?o.nativeMessages[e]?.signature===s:o.nativeMessages[e]?.content.startsWith(c))))??-1;if(l>=0){b.add(l);continue}}let s={key:e.key,timingKey:e.key,ambiguousTimingIdentity:u.has(kK(i)??e.key)?!0:void 0,timestamp:e.timestamp??new Date().toISOString(),message:i,optimistic:e.optimistic};i.role===`user`&&e.optimistic?p.push(s):x.push(s)}let S=new Map;for(let e of m?.queuedMessages??[])S.set(e,(S.get(e)??0)+1);let C=p.filter(e=>{if(!e.optimistic?.admitted||e.optimistic.commandId===m?.activeTurn?.commandId)return!0;let t=S.get(e.message.content)??0;return!t||(S.set(e.message.content,t-1),!1)}),w=new Map(t.flatMap(e=>e.optimistic?.projectedEntryId?[[e.optimistic.projectedEntryId,e.key]]:[]));for(let e of f)w.set(e.entryId,e.key);let T=o.baseEntries,E=(e,t)=>{T===o.baseEntries&&(T=o.baseEntries.slice()),T[e]=t};for(let e of i){let t=o.indexById.get(e);if(t===void 0)continue;let n=T[t];!n||n.ambiguousTimingIdentity||E(t,{...n,ambiguousTimingIdentity:!0})}for(let[e,t]of l){if(t===null)continue;let n=T[e];!n||n.timingKey===t||E(e,{...n,timingKey:t})}for(let[e,t]of r){let n=o.indexById.get(e);if(n===void 0)continue;let r=T[n];!r||r.key===t||E(n,{...r,key:t})}for(let[e,t]of w){let n=o.indexById.get(e);if(n===void 0)continue;let r=T[n];!r||r.key===t||E(n,{...r,key:t})}return{entries:T.concat(x,C),projectedPrompts:f}}function RK({message:e,sessionId:t,path:n,entryId:r}){let{t:i}=W(),[a,o]=(0,K.useState)(null),s=JSON.stringify([t,n,r]),c=e.parts?.filter(e=>e.type===`image`)??[];if(c.length===0)return null;let l=new Map,u=a?.scope===s?a:null,d=()=>o(e=>e?{...e,open:!1}:null);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`section`,{className:`message-attachments`,"aria-label":i(`imageAttachments`),children:c.map(e=>{let a=`${e.mimeType}:${e.name??``}:${e.previewUrl??``}`,c=l.get(a)??0;l.set(a,c+1);let u=`${a}:${c}`,d=t&&n&&r&&typeof e.sourcePartIndex==`number`&&Number.isSafeInteger(e.sourcePartIndex)&&e.sourcePartIndex>=0?{id:`${r}:${e.sourcePartIndex}`,entryId:r,partIndex:e.sourcePartIndex,kind:`image`,name:e.name??i(`attachedImage`)}:null,f=e.previewUrl?(0,q.jsx)(`img`,{src:e.previewUrl,alt:e.name??i(`attachedImage`)},`preview`):d&&t&&n?(0,q.jsx)(`span`,{className:`message-attachment-preview`,children:(0,q.jsx)(tG,{sessionId:t,path:n,source:d,thumbnail:!0})},`preview`):(0,q.jsx)(qs,{"aria-hidden":`true`},`preview`),p=(0,q.jsx)(`span`,{children:e.name??i(`attachedImage`)},`name`);return d?(0,q.jsxs)(`button`,{className:`message-attachment`,type:`button`,title:d.name,"aria-label":d.name,onClick:()=>o({scope:s,source:d,open:!0}),children:[f,p]},u):(0,q.jsxs)(`div`,{className:`message-attachment`,children:[f,p]},u)})}),t&&n&&u&&(0,q.jsx)(aG,{sessionId:t,path:n,source:u.source,open:u.open,onSelect:d,onClose:d})]})}function zK(e,t,n){let r=(0,K.useMemo)(()=>new de,[]),i=e?.history?.leafEntryId??e?.entries.at(-1)?.id,a=e?.id,o=e?.path,s=JSON.stringify([e?.id,e?.path,i]),c=(0,K.useRef)(s);c.current=s;let[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)({}),p=(0,K.useRef)(new Map),m=(0,K.useMemo)(()=>a&&o&&i?{sessionId:a,sessionPath:o,entryId:i}:null,[a,o,i]);(0,K.useEffect)(()=>{if(u(null),f({}),!n||!m)return;let e=new AbortController,t=async()=>{try{let t=null,n=[],i=new Set;for(let a=0;a<10;a++){let a=await r.sessionPromptHistory(m,t,e.signal);if(e.signal.aborted||c.current!==s||a.sessionId!==m.sessionId||a.sessionPath!==m.sessionPath||a.anchorEntryId!==m.entryId||a.requestedBeforeEntryId!==t||a.entryIds.length>100||a.entryIds.some(e=>!e||i.has(e))||new Set(a.entryIds).size!==a.entryIds.length||a.nextBeforeEntryId!==null&&(a.entryIds.length===0||a.nextBeforeEntryId!==a.entryIds[0]))return;for(let e of a.entryIds)i.add(e);if(n=[...a.entryIds,...n],a.nextBeforeEntryId===null){u({scope:s,ids:n});return}t=a.nextBeforeEntryId}}catch{}},i=typeof window.requestIdleCallback==`function`?window.requestIdleCallback(()=>void t(),{timeout:2e3}):void 0,a=i===void 0?window.setTimeout(()=>void t(),0):void 0;return()=>{e.abort(),i!==void 0&&window.cancelIdleCallback(i),a!==void 0&&window.clearTimeout(a);for(let e of p.current.values())e.abort();p.current.clear()}},[s,n,m,r]);let h=(0,K.useMemo)(()=>{let e=new Map(t.map(e=>[e.entryId,e]));if(l?.scope!==s)return t;let n=new Set(l.ids);return[...l.ids.map(t=>e.get(t)??d[t]??{entryId:t,title:``,previewState:`idle`}),...t.filter(e=>!n.has(e.entryId))]},[l,s,t,d]),g=(0,K.useRef)(h);return g.current=h,{items:h,requestPreview:(0,K.useCallback)(e=>{if(!n||!m||c.current!==s||p.current.has(e))return;let t=g.current.find(t=>t.entryId===e);if(!t||t.previewState===void 0||t.previewState===`ready`)return;let i=new AbortController;p.current.set(e,i),f(t=>({...t,[e]:{entryId:e,title:``,previewState:`loading`}})),r.sessionPromptPreview(m,e,i.signal).then(t=>{if(!(i.signal.aborted||c.current!==s)){if(t.sessionId!==m.sessionId||t.sessionPath!==m.sessionPath||t.anchorEntryId!==m.entryId||t.entryId!==e||typeof t.prompt!=`string`||typeof t.response!=`string`||Array.from(t.prompt).length>240||Array.from(t.response).length>240)throw Error(`Unverified preview`);f(n=>({...n,[e]:{entryId:e,title:t.prompt,reply:t.response,previewState:`ready`}}))}}).catch(()=>{!i.signal.aborted&&c.current===s&&f(t=>({...t,[e]:{entryId:e,title:``,previewState:`unavailable`}}))}).finally(()=>{p.current.get(e)===i&&p.current.delete(e)})},[n,m,s,r])}}var BK=`[data-history-entry], [data-history-message], [data-history-result]`;function VK(e,t,n,r){let i=(0,K.useRef)(null),a=(0,K.useCallback)(()=>{let r=e.current;if(!r||t.current){i.current=null;return}let a=r.getBoundingClientRect(),o=Array.from(r.querySelectorAll(BK)).filter(e=>{let t=e.getBoundingClientRect();if(t.height<=0||t.bottom<=a.top||t.top>=a.bottom)return!1;for(let t=e.parentElement;t&&t!==r;t=t.parentElement){if(t.hidden)return!1;let e=getComputedStyle(t);if(/^(auto|scroll|overlay)$/.test(e.overflowY)&&t.scrollHeight>t.clientHeight)return!1}return!0}),s=o.find(e=>!o.some(t=>t!==e&&e.contains(t)));i.current=s?{scope:n,element:s,offset:s.getBoundingClientRect().top-a.top}:null},[e,t,n]),o=(0,K.useCallback)(()=>{let a=e.current,o=i.current;if(!a||t.current||!o||o.scope!==n)return;if(!a.contains(o.element)||!o.element.getClientRects().length){i.current=null;return}let s=o.element.getBoundingClientRect().top-a.getBoundingClientRect().top-o.offset;if(Math.abs(s)>.5){let e=a.scrollTop+s;typeof a.scrollTo==`function`?a.scrollTo({top:e,behavior:`instant`}):a.scrollTop=e,r.current=a.scrollTop}},[e,t,n,r]);return(0,K.useLayoutEffect)(()=>{o(),a()}),{capture:a,restore:o,clear:(0,K.useCallback)(()=>{i.current=null},[])}}var HK=1e3,UK=ye*4;function WK(e,t){return t.history?.leafEntryId===e.validatedLeaf||t.history?.anchorEntryId===e.anchor&&t.history.anchorOnBranch===!0}function GK(e,t,n=t.entriesOmitted){let r=e.filter(e=>e.message?.truncation).length,i=e.reduce((e,t)=>e+(t.message?.truncation?.partsOmitted??0),0);return{...t,entriesOmitted:n,messagesTruncated:r,messagePartsOmitted:i,truncated:n>0||r>0||i>0}}function KK(e,t){let n=t.history?.leafEntryId??null;if(n===e.validatedLeaf)return e;let r=t.entries.findIndex(t=>t.id===e.anchor),i=r>=0?t.entries.slice(r+1):t.entries[0]?.parentId===e.anchor?t.entries:null,a=i?.reduce((e,t)=>e+pe(t)+1,0)??0;return i&&e.session.entries.length+i.length<=HK&&e.session.bytes+a<=UK?{...e,anchor:n??e.anchor,validatedLeaf:n,session:{...e.session,entries:[...e.session.entries,...i],bytes:e.session.bytes+a,truncation:GK([...e.session.entries,...i],e.session.truncation)}}:{...e,validatedLeaf:n}}function qK(e,t,n,r){let i=(0,K.useMemo)(()=>new de,[]),a=(0,K.useMemo)(()=>n??new Map,[n]),o=lK(e),s=(0,K.useRef)({scope:o,state:a.get(o)});s.current.scope!==o&&(s.current={scope:o,state:a.get(o)});let c=(0,K.useRef)({selected:e,callbacks:t});c.current={selected:e,callbacks:t};let l=(0,K.useRef)(s.current.state?.window??null),u=(0,K.useRef)(null),d=(0,K.useRef)(null),f=(0,K.useRef)(null),[p,m]=(0,K.useState)(l.current),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(null),[y,b]=(0,K.useState)(0),x=(0,K.useRef)(o),S=(0,K.useRef)(null),C=r?JSON.stringify([r.sessionId,r.sessionPath,r.entryId,r.revision]):null,w=r&&e&&C!==S.current&&r.sessionId===e.id&&r.sessionPath===e.path&&r.session.id===e.id&&r.session.path===e.path&&r.session.history?.anchorEntryId===r.entryId&&r.session.history.anchorOnBranch===!0&&r.session.entries.some(e=>e.id===r.entryId)?{session:r.session,anchor:r.session.entries.at(-1).id,validatedLeaf:r.session.history?.leafEntryId??null}:null,T=(0,K.useCallback)(e=>{l.current=e,uK(a,lK(e.session),{window:e}),m(e),c.current.callbacks.onAnchorChange?.({sessionId:e.session.id,sessionPath:e.session.path,entryId:e.anchor})},[a]),E=(0,K.useCallback)((e=!1)=>{u.current?.controller.abort(),u.current=null,d.current=null,a.delete(lK(l.current?.session??c.current.selected)),l.current=null,a.persist?.(),m(null),g(!1),v(e?`historyChanged`:null),f.current=null,c.current.callbacks.onAnchorChange?.(null),b(e=>e+1)},[a]),D=(0,K.useCallback)((e=!1)=>{let t=l.current,n=c.current.selected;if(!t||!n)return;let r=JSON.stringify([lK(n),t.anchor,n.history?.leafEntryId]);if(!e&&f.current?.key===r)return;let i={key:r};f.current=i,v(null);let a=()=>{f.current===i&&l.current===t&&(u.current?.controller.abort(),u.current=null,g(!1),v(`historyValidationUnavailable`))};c.current.callbacks.onAnchorChange?.({sessionId:t.session.id,sessionPath:t.session.path,entryId:t.anchor});let o=c.current.callbacks.onRefresh?.();if(!o){a();return}o.then(e=>{e||a()}).catch(a)},[]),O=(0,K.useCallback)(e=>{let t=l.current,n=c.current.selected;if(!e.page||!e.consuming||u.current!==e||e.controller.signal.aborted||!t||!n||e.scope!==lK(n)||t.session.history?.beforeEntryId!==e.before||!WK(t,n))return;let r=e.page,i=new Set(t.session.entries.map(e=>e.id)),a=[...r.entries.filter(e=>!i.has(e.id)),...t.session.entries],o=pe(a);for(;a.length>HK||o>UK;){let e=a.pop();if(!e)break;o-=pe(e)+ +!!a.length}c.current.callbacks.beforePrepend(),T({...t,anchor:a.at(-1)?.id??t.anchor,session:{...t.session,entries:a,bytes:o,truncation:GK(a,t.session.truncation,r.truncation.entriesOmitted),history:{...t.session.history,beforeEntryId:r.history?.beforeEntryId??null}}}),u.current=null,g(!1),v(null)},[T]);(0,K.useLayoutEffect)(()=>{if(w&&C!==S.current){x.current=o,u.current?.controller.abort(),u.current=null,d.current=null,f.current=null,g(!1),v(null),S.current=C,T(w);return}x.current!==o&&(x.current=o,u.current?.controller.abort(),u.current=null,d.current=null,l.current=s.current.state?.window??null,m(l.current),g(!1),v(null),f.current=null,b(e=>e+1),l.current||c.current.callbacks.onAnchorChange?.(null));let t=u.current;t&&!t.consuming&&e&&!WK(t.source,e)&&(t.controller.abort(),u.current=null);let n=l.current;if(!(!n||!e)){if(e.history?.anchorEntryId===n.anchor&&e.history.anchorOnBranch===!1){E(!0),c.current.callbacks.onRefresh?.();return}if(!WK(n,e)){D();return}v(e=>e===`historyValidationUnavailable`?null:e),(e.history?.leafEntryId??null)!==n.validatedLeaf&&(n=KK(n,e),T(n)),u.current?.page&&O(u.current)}},[o,e,E,D,T,O,w,C]),(0,K.useLayoutEffect)(()=>{let e=l.current;return e&&(uK(a,o,{...s.current.state,window:e}),c.current.callbacks.onAnchorChange?.({sessionId:e.session.id,sessionPath:e.session.path,entryId:e.anchor})),()=>{u.current?.controller.abort(),u.current=null,d.current=null,c.current.callbacks.onAnchorChange?.(null)}},[o,a]);let k=(0,K.useCallback)(()=>{let e=c.current.selected;return!l.current&&e?.history?.leafEntryId&&T({session:e,anchor:e.history.leafEntryId,validatedLeaf:e.history.leafEntryId}),l.current},[T]),A=(0,K.useCallback)((e,t)=>{let n=c.current.selected;if(!n||u.current)return;let r=e.session.history?.beforeEntryId;if(!r)return;let a={controller:new AbortController,scope:lK(n),before:r,source:e,consuming:t,anchor:{sessionId:n.id,sessionPath:n.path,entryId:e.anchor}};return u.current=a,t&&(g(!0),v(null)),a.done=(async()=>{try{let e=await i.sessionHistory(a.anchor,r,a.controller.signal);if(u.current!==a||a.controller.signal.aborted||a.scope!==lK(c.current.selected))return;if(e.id!==n.id||e.path!==n.path||e.anchorEntryId!==a.anchor.entryId||e.requestedBeforeEntryId!==r||e.history?.anchorEntryId!==a.anchor.entryId||e.history.anchorOnBranch!==!0)throw new ge(`Session history identity changed`,409,`SESSION_HISTORY_CHANGED`);a.page=e,a.consuming&&(O(a),u.current===a&&D())}catch(e){if(u.current!==a||a.controller.signal.aborted||(u.current=null,!a.consuming))return;g(!1),e instanceof ge&&e.code===`SESSION_HISTORY_CHANGED`?(E(!0),c.current.callbacks.onRefresh?.()):v(`historyUnavailable`)}})(),a.done},[O,E,i,D]),j=(0,K.useCallback)(async()=>{let e=c.current.selected;if(!e?.history?.leafEntryId)return;let t=l.current;if(t&&!WK(t,e)){D(!0);return}if(t||=k(),!t)return;let n=u.current;if(n){if(n.scope===lK(e)&&n.before===t.session.history?.beforeEntryId&&WK(n.source,e))return n.consuming=!0,g(!0),v(null),n.page&&O(n),n.done;n.controller.abort(),u.current=null}return A(t,!0)},[O,A,D,k]);(0,K.useEffect)(()=>{if(!t.preload){let e=u.current;e&&!e.consuming&&(e.controller.abort(),u.current=null,d.current=null);return}if(_||u.current||!e||p!==l.current)return;let n=p;if(n&&!WK(n,e))return;let r=n??(e.history?.leafEntryId?{session:e,anchor:e.history.leafEntryId,validatedLeaf:e.history.leafEntryId}:null);if(!r?.session.history?.beforeEntryId)return;let i=JSON.stringify([o,n?r.anchor:`initial`,n?r.session.history.beforeEntryId:null]);d.current!==i&&(d.current=i,A(r,!1))},[t.preload,_,o,e,p,A]);let M=p&&lK(p.session)===o?p:null,N=w??(M&&e&&WK(M,e)?KK(M,e):M),P=(0,K.useCallback)(()=>E(),[E]),F=!!(N&&e&&!WK(N,e));return{session:N?.session??e,engaged:!!N,hasMore:!!(N?.session??e)?.history?.beforeEntryId,hasNewer:!!(N&&N.anchor!==e?.history?.leafEntryId),verifying:F,loading:h,error:_,reset:y,retainReading:k,loadOlder:j,resetToLatest:P}}function JK(e){return e&&typeof e==`object`?e:{}}function YK(e){try{return JK(JSON.parse(e))}catch{return{}}}function XK(e){return e===`running`?`running`:e===`done`||e===`completed`?`done`:[`error`,`failed`,`aborted`,`killed`,`timed_out`].includes(String(e))?`error`:e===`uncertain`?`warn`:`unknown`}function ZK(e,t){if(e?.forkSnapshotToolResult)return`unknown`;if(t===`running`)return`running`;if(t===`unknown`)return`unknown`;if(t===`failed`||e?.isError)return`error`;if(t===`cancelled`||t===`timed_out`)return`warn`;if(!e?.toolName?.startsWith(`subagent`)){let t=XK(JK(e?.details).status);if(t!==`unknown`&&t!==`running`)return t}return t===`returned`||e?.isError===!1?`done`:`unknown`}function QK({status:e}){let{t}=W();return e===`running`?(0,q.jsx)(`span`,{className:`status-mark running`,role:`img`,"aria-label":t(`toolState_running`),children:(0,q.jsx)(`i`,{})}):e===`done`?(0,q.jsx)(rs,{className:`status-mark done`,"aria-label":t(`execution_done`)}):e===`error`?(0,q.jsx)(je,{className:`status-mark error`,"aria-label":t(`toolState_failed`)}):e===`warn`?(0,q.jsx)(`span`,{className:`status-mark warn`,role:`img`,"aria-label":t(`toolState_unknown`),children:`?`}):null}function $K({label:e,message:t,children:n}){return(0,q.jsxs)(`div`,{className:`execution-error`,role:`alert`,"aria-label":e,children:[(0,q.jsx)(ls,{"aria-hidden":`true`}),(0,q.jsxs)(`div`,{className:`execution-error-content`,children:[(0,q.jsx)(`p`,{children:t}),n]})]})}function eq({failed:e,error:t,retryPrompt:n,retryEntryId:r,canRetry:i,onRetry:a}){let{t:o}=W(),[s,c]=(0,K.useState)(!1);return e?(0,q.jsx)($K,{label:o(`modelRequestFailed`),message:t||o(`modelFailureUnknown`),children:n!==void 0&&r&&a&&(0,q.jsx)(`div`,{className:`provider-outcome-actions`,children:(0,q.jsxs)(`button`,{type:`button`,disabled:!i||s,onClick:()=>{c(!0),a(n,r).finally(()=>c(!1))},children:[(0,q.jsx)(he,{"aria-hidden":`true`}),o(s?`retryingPrompt`:`retryPrompt`)]})})}):(0,q.jsx)(`div`,{className:`provider-outcome aborted`,role:`status`,children:o(`modelRequestStopped`)})}function tq({attempts:e,state:t,retry:n,observed:r=!0}){let{t:i}=W(),a=t===`retrying`&&!r,o=n?.attempt,s=n?.maxAttempts,c=typeof o==`number`&&Number.isSafeInteger(o)&&o>0&&typeof s==`number`&&Number.isSafeInteger(s)&&s>=o,l=e.length>0||!!n?.errorMessage,u=(0,q.jsxs)(q.Fragment,{children:[t===`retrying`?(0,q.jsx)(Jc,{"aria-hidden":`true`}):(0,q.jsx)(wc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{role:t===`retrying`?`status`:void 0,children:[i(a?`modelReconnectUnknown`:t===`recovered`?`modelRequestRecovered`:t===`retrying`?n?`modelRetrying`:`modelEarlierAttempts`:t===`interrupted`?`modelRequestStopped`:`modelEarlierAttempts`),t===`retrying`&&c&&` ${o}/${s}`]}),t!==`retrying`&&(0,q.jsx)(`span`,{className:`provider-attempts-count`,children:i(`modelFailedAttempts`,{count:e.length})}),l&&(0,q.jsx)(os,{className:`reconnect-chevron`,"aria-hidden":`true`})]}),d=`provider-attempts ${t}${a?` unavailable`:``}`;return l?(0,q.jsxs)(`details`,{className:d,children:[(0,q.jsx)(`summary`,{children:u}),(0,q.jsxs)(`ol`,{children:[e.length===0&&(0,q.jsx)(`li`,{children:(0,q.jsx)(`p`,{children:n?.errorMessage})}),e.map(({entry:e,content:t},n)=>(0,q.jsxs)(`li`,{"data-history-entry":e.entryId??e.key,children:[(0,q.jsx)(`span`,{className:`provider-attempt-index`,"aria-hidden":`true`,children:String(n+1).padStart(2,`0`)}),(0,q.jsxs)(`div`,{className:`provider-attempt-body`,children:[(0,q.jsx)(`p`,{children:e.message.errorMessage||i(`modelFailureUnknown`)}),t?.map(e=>(0,q.jsx)(K.Fragment,{children:e.content},e.key))]})]},e.key))]})]}):(0,q.jsx)(`div`,{className:d,children:u})}function nq(e,t,n){let r=new Set,i=new Map,a=[],o=-1,s=(s,c=!1,l=!1)=>{if(a.length>0){let u=e[o]?.message.stopReason,d=s?.outcome===`cancelled`||u===`aborted`,f=u===`error`&&!d&&!(c&&t)&&!l;f&&r.add(o);let p=f?a.slice(0,-1):a,m=p.at(-1);m!==void 0&&i.set(m,{attempts:p.map(t=>e[t]),state:d?`interrupted`:u===`stop`||u===`length`||u===`toolUse`?`recovered`:c&&t&&n?`retrying`:`earlier`})}a=[],o=-1};return e.forEach((e,t)=>{e.optimistic||(e.timing?s(e.timing):e.forkSnapshotBoundary?s(void 0,!1,!0):e.message.role===`user`||e.message.role===`custom`&&e.message.customType===`openpi-setup-request`?s():e.message.role===`assistant`&&(o=t,e.message.stopReason===`error`&&a.push(t)))}),s(void 0,!0),{finalErrors:r,groups:i}}function rq(e,t){return zD(vK(e,t).split(` -`).find(Boolean),120)}function iq(e){let t=e.split(` -`).map(e=>e.trim()).find(Boolean);return t?zD(t.replace(/^#{1,6}\s+/u,``).replace(/^>\s*/u,``).replace(/[*_~`]+/gu,``).replace(/\[([^\]]+)\]\([^)]*\)/gu,`$1`).trim(),600):``}function aq({body:e,icon:t,name:n,status:r,summary:i,output:a,evidenceState:o,note:s,rawDetails:c,children:l,snapshotMissingResult:u=!1,defaultOpen:d=!1}){let{t:f}=W(),[p,m]=(0,K.useState)(d);(0,K.useEffect)(()=>m(d),[d]);let h=o??(r===`done`?`returned`:r===`error`?`failed`:r===`running`?`running`:`unknown`);return(0,q.jsxs)(`details`,{className:`message-details tool-line ${r}`,"data-tool":n,open:p,onToggle:e=>m(e.currentTarget.open),children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(`span`,{className:`tool-icon`,"aria-hidden":`true`,children:t}),hK(n).action===`call`&&(0,q.jsx)(`span`,{className:`tool-kind`,title:n,children:_K(n)}),(0,q.jsxs)(`span`,{className:`details-title`,children:[(0,q.jsx)(`span`,{className:`tool-action`,children:gK(f,n,h)}),i&&(0,q.jsx)(`span`,{className:`tool-summary`,children:i})]}),u&&(0,q.jsx)(`span`,{className:`evidence-status`,children:f(`toolSnapshotMissingResult`)}),(0,q.jsx)(os,{className:`tool-disclosure`,"aria-hidden":`true`}),(0,q.jsx)(QK,{status:r})]}),s&&(0,q.jsx)(`p`,{className:`evidence-note`,children:s}),a===void 0?(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:pd(e).text}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`figure`,{"aria-label":f(`toolCallArguments`),style:{margin:0},children:(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:pd(e).text})}),(0,q.jsx)(`figure`,{"aria-label":f(`toolCallOutput`),style:{margin:0},children:(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:pd(a).text||f(`noOutput`)})})]}),c!==void 0&&(0,q.jsxs)(`details`,{className:`evidence-raw`,children:[(0,q.jsx)(`summary`,{children:f(`toolRawEvidence`)}),(0,q.jsx)(`pre`,{children:pd(JSON.stringify(c,null,2)).text})]}),l]})}function oq({body:e,family:t,meta:n,status:r,title:i,defaultOpen:a=!1}){return(0,q.jsxs)(`details`,{className:`message-details activity-card ${t}`,open:a||void 0,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(`span`,{className:`activity-icon`,"aria-hidden":`true`,children:t===`subagent`?(0,q.jsx)($o,{}):(0,q.jsx)(Yc,{})}),(0,q.jsxs)(`span`,{className:`activity-main`,children:[(0,q.jsx)(`span`,{className:`activity-title`,children:i}),n&&(0,q.jsx)(`span`,{className:`activity-meta`,children:n})]}),(0,q.jsx)(QK,{status:r}),(0,q.jsx)(os,{className:`tool-disclosure`,"aria-hidden":`true`})]}),(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:e})]})}function sq(e,t){let n=typeof e.id==`string`?[e.id]:Array.isArray(e.ids)?e.ids:typeof t.id==`string`?[t.id]:Array.isArray(t.results)?t.results.map(e=>JK(e).id):[];return[...new Set(n.filter(e=>typeof e==`string`&&!!e))]}function cq({call:e,result:t,status:n,sessionId:r,subagents:i,records:a,onInspect:o,defaultOpen:s}){let{t:c}=W(),l=sq(YK(e.arguments),JK(t?.details)),u=gK(c,e.name,n===`done`?`returned`:n===`error`?`failed`:n);return(0,q.jsxs)(`section`,{className:`subagent-operation`,children:[(l.length?l:[void 0]).map(t=>(0,q.jsx)(JG,{identity:`${r}:${t??e.id}`,title:t?UD(t,i,a):``,action:u,state:n===`warn`?`unknown`:n,label:c(`toolState_${n===`done`?`returned`:n===`error`?`failed`:n===`warn`?`unknown`:n}`),onInspect:t&&o?()=>o(t):void 0},t??e.id)),(0,q.jsxs)(`details`,{className:`subagent-operation-receipt`,open:s||void 0,children:[(0,q.jsx)(`summary`,{"aria-label":c(`toolRawEvidence`),title:c(`toolRawEvidence`),children:(0,q.jsx)(Ds,{"aria-hidden":`true`})}),e.arguments!==`{}`&&(0,q.jsx)(`pre`,{children:pd(e.arguments).text}),(0,q.jsx)(`pre`,{children:pd(t?.content??``).text||c(`noOutput`)})]})]})}function lq(e,t,n={sessionId:``}){if(t?.forkSnapshotToolResult)return null;let{sessionId:r,subagents:i=[],records:a=[],workflows:o=[],onInspectSubagent:s,liveState:c,defaultOpen:l=!1,observed:u=!0}=n,d=e.name||``,f=YK(e.arguments),p=JK(t?.details),m=ZK(t,c),h=!u&&m===`running`?`unknown`:m;if(d===`subagent_spawn`)return(0,q.jsx)(uq,{sessionId:r,id:typeof p.id==`string`?p.id:void 0,title:String(p.title||f.name||`subagent`),body:t?.content||String(f.prompt||e.arguments),activity:i.find(e=>e.id===p.id),saved:a.find(e=>e.id===p.id),spawnFailed:t?.isError===!0,observed:u,defaultOpen:l,onInspect:s});if(d.startsWith(`subagent`))return(0,q.jsx)(cq,{call:e,result:t,sessionId:r,subagents:i,records:a,onInspect:s,defaultOpen:l,status:h});if(d===`workflow`){let n=typeof f.script==`string`?f.script:e.arguments,i=String(p.name||n.match(/\bname:\s*["'`]([^"'`]+)["'`]/u)?.[1]||`unnamed`),a=JK(p.agents),c=o.find(e=>e.runId===p.runId)?.children,l=[p.runId,p.status,a.total?`${Number(a.total)-Number(a.running||0)}/${a.total} agents`:``].filter(Boolean).join(` · `);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(oq,{family:`workflow`,title:`Workflow · ${i}`,meta:l,body:t?.content||n,status:h}),(0,q.jsx)(dq,{sessionId:r,tasks:c,observed:u,onInspect:s})]})}return d.startsWith(`workflow`)?(0,q.jsx)(oq,{family:`workflow`,title:d.replaceAll(`_`,` `),meta:String(f.runId||``),body:t?.content||e.arguments,status:h}):null}function uq({sessionId:e,id:t,title:n,body:r,activity:i,saved:a,spawnFailed:o,onInspect:s,defaultOpen:c=!1,observed:l=!0}){let{t:u}=W(),d=i?.outcome===`interrupted`?`interrupted`:i?.status??(a?.state===`running`?void 0:a?.state),f=!l&&(d===`running`||!d&&!o)?`unknown`:d,p=u(f===`unknown`?`toolState_unknown`:f?`subagentState_${f}`:o?`subagentSpawnFailed`:t?`subagentStateUnavailable`:`subagentStarting`);return(0,q.jsxs)(`section`,{className:`activity-card subagent subagent-activity`,children:[(0,q.jsx)(JG,{identity:`${e}:${t??n}`,title:n,state:f,label:p,onInspect:t&&s?()=>s(t):void 0}),(c||o)&&(0,q.jsxs)(`details`,{className:`subagent-receipt`,open:c||void 0,children:[(0,q.jsx)(`summary`,{children:u(`subagentSpawnReceipt`)}),(0,q.jsx)(`p`,{children:u(`subagentSpawnReceiptHint`)}),(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:r})]})]})}function dq({sessionId:e,tasks:t,observed:n,onInspect:r}){let{t:i}=W();return(0,q.jsxs)(q.Fragment,{children:[t?.items.map(t=>{let a=t.outcome===`interrupted`?`interrupted`:!n&&t.status===`running`?`unknown`:t.status;return(0,q.jsx)(JG,{identity:`${e}:${t.id}`,title:t.title,state:a,label:i(a===`unknown`?`toolState_unknown`:`subagentState_${a}`),onInspect:r?()=>r(t.id,`workflows`):void 0},t.id)}),!!t?.omitted&&(0,q.jsx)(`p`,{className:`inspection-note`,children:i(`subagentListTruncated`,{count:t?.omitted})})]})}function fq({body:e,duration:t,status:n,level:r,defaultOpen:i,truncated:a,source:o}){let{t:s}=W(),c=n===`running`,[l,u]=(0,K.useState)(i),[d,f]=(0,K.useState)();(0,K.useEffect)(()=>u(i),[i]);let p=t===void 0?``:VD(0,t),m=iq(e),h=[n===`unknown`?s(`toolState_unknown`):c?r?s(`thinkingActiveLevel`,{level:r}):s(`thinkingActive`):s(`thinkingDone`),p].filter(Boolean).join(` · `);return(0,q.jsxs)(`details`,{className:`message-details tool-line thinking-line ${n}`,open:l,onToggle:e=>u(e.currentTarget.open),children:[(0,q.jsxs)(`summary`,{"aria-label":[h,m].filter(Boolean).join(` · `),title:m,children:[(0,q.jsx)(`span`,{className:`tool-icon`,"aria-hidden":`true`,children:(0,q.jsx)(Zs,{})}),(0,q.jsx)(`span`,{className:`details-title`,children:(0,q.jsx)(`span`,{className:`tool-summary`,children:m||h})}),(0,q.jsx)(os,{className:`tool-disclosure`,"aria-hidden":`true`})]}),l&&(0,q.jsx)(`div`,{className:`details-body thinking-evidence`,children:a&&o&&!c?(0,q.jsx)(iK,{...o,preview:e,markdown:!0,purpose:`thinking`,fullText:d,onComplete:f}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(vD,{children:e}),a&&(0,q.jsx)(`p`,{className:`evidence-warning`,children:s(`thinkingPreviewOnly`)})]})})]})}function pq({content:e,editable:t,copyRequiresFull:n=!1,timestamp:r,onResend:i,onRegenerate:a,onFork:o,canFork:s=!1,forkPending:c=!1}){let{t:l}=W(),[u,d]=(0,K.useState)(!1),[f,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(!1),g=(0,K.useRef)(0),_=(0,K.useRef)(void 0);(0,K.useEffect)(()=>()=>{g.current+=1,window.clearTimeout(_.current)},[]);let[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(e),[S,C]=(0,K.useState)(!1),w=(0,K.useRef)(null),T=(0,K.useId)();(0,K.useEffect)(()=>{v&&w.current?.focus()},[v]);let E=async()=>{if(!(S||!b.trim()||!t||!i)){C(!0);try{await i(b.trim())&&y(!1)}finally{C(!1)}}};if(v)return(0,q.jsxs)(`div`,{className:`message-editor`,children:[(0,q.jsx)(`textarea`,{ref:w,value:b,"aria-label":l(`editMessage`),"aria-describedby":T,readOnly:S,onChange:e=>x(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||S||(e.key===`Escape`&&y(!1),e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),E()))}}),(0,q.jsx)(`p`,{className:`message-edit-hint`,id:T,children:l(`editMessageHint`)}),(0,q.jsxs)(`div`,{className:`message-edit-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:S,onClick:()=>y(!1),children:l(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`confirm`,disabled:S||!b.trim()||!t,onClick:()=>void E(),children:l(`confirmEdit`)})]})]});let D=BD(r);return(0,q.jsxs)(`div`,{className:`message-actions${f?` copy-failed`:``}`,children:[D&&(0,q.jsx)(`time`,{dateTime:r,children:D}),o&&(0,q.jsx)(V,{content:l(c?`forkSessionPending`:s?`forkMessageHint`:`forkSessionUnavailable`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":l(`forkMessage`),disabled:!s||c,onClick:()=>void o(),children:(0,q.jsx)(Ws,{"aria-hidden":`true`})})}),t&&(0,q.jsx)(V,{content:l(`editMessage`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":l(`editMessage`),onClick:()=>{x(e),y(!0)},children:(0,q.jsx)(yc,{})})}),a&&(0,q.jsx)(V,{content:l(`regenerateMessageHint`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":l(`regenerateMessage`),disabled:!s||c,onClick:()=>void a(),children:(0,q.jsx)(he,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:l(n?`messageCopyRequiresFull`:u?`copiedMessage`:`copyMessage`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":l(u?`copiedMessage`:`copyMessage`),"data-copied":u||void 0,disabled:m||n,onClick:()=>{let t=++g.current;window.clearTimeout(_.current),h(!0),d(!1),p(!1),td(e).then(e=>{t===g.current&&(h(!1),d(e),p(!e),e&&(_.current=window.setTimeout(()=>d(!1),1200)))})},children:u?(0,q.jsx)(rs,{}):(0,q.jsx)(_s,{})})}),f&&(0,q.jsx)(`span`,{className:`copy-error`,role:`status`,children:l(`copyFailed`)})]})}function mq({message:e,fullSubagent:t=!1,sessionId:n,onInspectSubagent:r}){let{t:i}=W();if(e.customType===`openpi-web-command-feedback`)return(0,q.jsxs)(`div`,{className:`command-feedback`,role:`status`,children:[e.content,e.truncation?.truncated&&(0,q.jsx)(`p`,{children:i(`commandFeedbackTruncated`)})]});let a=JK(e.details);if(e.customType===`openpi-setup-request`||e.customType===`openpi-setup-closed`)return(0,q.jsx)(aq,{body:e.content,icon:(0,q.jsx)(Xc,{}),name:i(`configureOpenPi`),summary:e.customType===`openpi-setup-closed`?zD(e.content):void 0,status:`unknown`});if(e.customType===`subagent-result`){let o=Array.isArray(a.results)?a.results.map(JK):[a],s=new Set(GD([e]).map(e=>e.id));return(0,q.jsxs)(`section`,{className:`activity-card subagent subagent-activity`,children:[o.map(e=>{let t=typeof e.id==`string`?e.id:``,a=e.outcome===`interrupted`?`interrupted`:e.status===`done`||e.status===`error`||e.status===`running`?e.status:`unknown`;return(0,q.jsx)(JG,{identity:`${n}:${t}`,title:String(e.title||t||i(`subagentDetails`)),state:a,label:i(a===`unknown`?`unknownState`:`subagentState_${a}`),onInspect:r&&s.has(t)?()=>r(t):void 0},t||JSON.stringify(e))}),(0,q.jsxs)(`details`,{className:`subagent-result-evidence`,open:t||void 0,children:[(0,q.jsx)(`summary`,{children:i(`subagentBackgroundResult`,{count:o.length})}),(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:!t&&typeof a.displayContent==`string`?a.displayContent:e.content})]})]})}if(e.customType===`workflow-result`){let t=Array.isArray(a.entries)?a.entries.map(JK):[],n=t.map(e=>XK(e.status)),r=n.includes(`error`)?`error`:n.includes(`warn`)?`warn`:n.length>0&&n.every(e=>e===`done`)?`done`:n.includes(`running`)?`running`:`unknown`,i=t.length?t.map(e=>`${e.status===`completed`?`✓`:`✗`} ${String(e.summary||e.runId||`run`)}${e.resultPreview?`\nResult: ${e.resultPreview}`:``}`).join(` -`):e.content;return(0,q.jsx)(oq,{family:`workflow`,title:t.length>1?`Workflow results · ${t.length} runs`:`Workflow ${String(t[0]?.runId||`result`)}`,body:i,status:r})}return null}function hq(e){return[``,`[]`,`{}`,`null`].includes(e.trim())}function gq({rows:e,active:t}){let{t:n}=W(),[r,i]=(0,K.useState)(!1),a=e.length===1,o=(0,K.useRef)(a),s=(0,K.useRef)(null),c=(0,K.useRef)(null),l=(0,K.useRef)(!0),u=(0,K.useRef)(0),d=(0,K.useRef)(void 0),[f,p]=(0,K.useState)({above:!1,below:!1}),m=(0,K.useCallback)(()=>{let e=c.current;if(!e)return;let t=e.scrollTop>1,n=e.scrollHeight-e.clientHeight-e.scrollTop>1;p(e=>e.above===t&&e.below===n?e:{above:t,below:n})},[]);(0,K.useLayoutEffect)(()=>{let n=c.current,s=o.current&&!a;if(s&&!r&&n?.querySelector(`.thinking-line[open]`)){i(!0);return}o.current=a,!(!n||a||!r||e.length===0)&&(!s&&n.scrollTop!==u.current&&n.scrollHeight-n.clientHeight-n.scrollTop>24&&(l.current=!1),s&&!l.current&&(n.scrollTop=u.current),t&&l.current&&(n.scrollTop=n.scrollHeight,u.current=n.scrollTop),m())},[e,t,r,a,m]),(0,K.useEffect)(()=>{let e=c.current,n=e?.firstElementChild;if(!e||!n||a||typeof ResizeObserver>`u`)return;let i=new ResizeObserver(()=>{r&&t&&l.current&&(e.scrollTop=e.scrollHeight,u.current=e.scrollTop),m()});return i.observe(e),i.observe(n),()=>i.disconnect()},[t,r,a,m]);let h=e.filter(e=>e.processType===`thinking`).length,g=e.filter(e=>e.processType===`tool`).length,_=e.filter(e=>e.processType===`activity`).length,v=[h?n(`processThinkingCount`,{count:h}):``,g?n(`processToolCount`,{count:g}):``,_?n(`processActivityCount`,{count:_}):``].filter(Boolean),y=[...e].reverse().find(e=>e.processStatus===`running`),b=y?.processPreview??(t?[...e].reverse():e).find(e=>e.processPreview)?.processPreview,x=y?.processToolName&&[`read`,`write`,`edit`].includes(y.processToolName)?b?.slice(Math.max(b.lastIndexOf(`/`),b.lastIndexOf(`\\`))+1):b,S=e.filter(e=>e.error||e.processStatus===`error`).length,C=S>0,w=y?`running`:C?`error`:e.some(e=>e.processStatus===`warn`)?`warn`:e.every(e=>e.processStatus===`done`)?`done`:`unknown`,T=e.flatMap(e=>e.processToolName?[e.processToolName]:[]),E=[...new Set(T.map(e=>hK(e).action))],D=E.map(e=>n(`toolActionGroup_${e}`)),O=E.length?n(`toolGroup_${w===`done`?`done`:w===`running`?`running`:`unknown`}`,{actions:D.join(n(`toolGroupSeparator`))}):n(w===`running`?`processRunning`:`processDetails`),k=y?.processToolName?gK(n,y.processToolName,`running`):y?.processType===`thinking`?n(`thinkingActive`):r?n(`processDetails`):O,A=y?.processToolName??T[0],j=y?.processType===`thinking`?Zs:A?hK(A).Icon:Xc;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`details`,{className:`process-sequence ${a?`single-process `:``}${w}`,open:a||r,"data-status":w,"data-running":w===`running`?`true`:void 0,"data-history-entry":e[0]?.key,onToggle:e=>{a||i(e.currentTarget.open)},children:[(0,q.jsxs)(`summary`,{ref:s,hidden:a,"aria-label":[k,y?b:``,...v,C?n(`processFailureCount`,{count:S}):``].filter(Boolean).join(` · `),children:[(0,q.jsx)(`span`,{className:`tool-icon`,"aria-hidden":`true`,children:(0,q.jsx)(j,{})}),(0,q.jsx)(`span`,{className:`process-sequence-title`,children:(0,q.jsx)(`strong`,{children:k})}),b&&(y||!t&&!E.length)&&(0,q.jsx)(`span`,{className:`process-sequence-preview`,title:b,children:x}),(0,q.jsx)(os,{className:`tool-disclosure`,"aria-hidden":`true`}),!C&&(0,q.jsx)(QK,{status:w})]}),(0,q.jsx)(`section`,{ref:c,className:`process-sequence-scroll`,"aria-label":a?void 0:[n(`processDetails`),...v].join(` · `),tabIndex:a?void 0:0,"data-scroll-above":f.above||void 0,"data-scroll-below":f.below||void 0,onScrollCapture:e=>{let t=e.target;if(a&&t instanceof HTMLElement&&t.classList.contains(`thinking-evidence`)){let n=t.getBoundingClientRect().top-e.currentTarget.getBoundingClientRect().top+t.scrollTop,r=n>u.current;u.current=n,l.current=(l.current||r)&&t.scrollHeight-t.clientHeight-t.scrollTop<=24}},onScroll:e=>{if(a)return;let t=e.currentTarget,n=t.scrollTop>u.current;u.current=t.scrollTop,l.current=(l.current||n)&&t.scrollHeight-t.clientHeight-t.scrollTop<=24,m()},onWheel:e=>{!e.defaultPrevented&&!e.ctrlKey&&!e.metaKey&&e.deltaY<0&&(a||Tq(e.nativeEvent,e.currentTarget))&&(l.current=!1)},onKeyDown:e=>{let t=e.target;!e.defaultPrevented&&!e.altKey&&!e.metaKey&&(!e.ctrlKey||e.key===`Home`)&&([`ArrowUp`,`PageUp`,`Home`].includes(e.key)||e.key===` `&&e.shiftKey)&&t instanceof HTMLElement&&!t.isContentEditable&&!t.closest(`input, textarea, select`)&&!(e.key===` `&&t.closest(`button, summary`))&&(a||Tq(e.nativeEvent,e.currentTarget))&&(l.current=!1)},onTouchStart:e=>{d.current=e.touches[0]?.clientY},onTouchMove:e=>{let t=e.touches[0]?.clientY;t!==void 0&&d.current!==void 0&&t>d.current&&(a||Tq(e.nativeEvent,e.currentTarget))&&(l.current=!1),d.current=t},children:(0,q.jsx)(`div`,{className:`process-sequence-body`,children:e.map(e=>(0,q.jsx)(`div`,{className:`process-step ${a?`single-tool-step `:``}${e.processStatus??`unknown`}`,"data-status":e.processStatus??`unknown`,children:e.content},e.key))})})]}),(0,q.jsx)(V,{anchorRef:s,focusTrigger:`always`,content:[...v,C?n(`processFailureCount`,{count:S}):``].filter(Boolean).join(` · `),placement:`above`,isEnabled:!a})]})}function _q(e,t){let n=[];for(let t of e){let e=n.at(-1),r=t.kind===`process`;r&&e?.process?e.rows.push(t):n.push({process:r,rows:[t]})}return n.flatMap((e,r)=>{let i=`${e.process?`process`:`rows`}-${e.rows[0]?.key}`;return e.process?(0,q.jsx)(gq,{rows:e.rows,active:t&&r===n.length-1},i):e.rows.map(e=>(0,q.jsx)(K.Fragment,{children:e.content},e.key))})}function vq({rows:e,timing:t,active:n,timedTurn:r}){let{t:i}=W(),a=(0,K.useId)(),[o,s]=(0,K.useState)(t?.outcome!==`completed`),c=(0,K.useRef)(!1),l=(0,K.useRef)(t?.outcome);(0,K.useEffect)(()=>{l.current!==t?.outcome&&t?.outcome===`completed`&&s(!1),l.current=t?.outcome},[t?.outcome]);let u=!!(t||r),d=[];for(let r of e){if(r.content===null)continue;let e=t?.resultEntryId?r.responseEntryId===t.resultEntryId&&r.final!==!1:!n&&r.final,i=r.kind!==`prompt`&&!e,a=d.at(-1);i&&a?.foldable?a.rows.push(r):d.push({foldable:i,rows:[r]})}let f=d.filter(e=>e.foldable),p=e=>e===0?a:`${a}-${e}`,m=f.length>0,h=t?(0,q.jsx)(ZG,{timing:t}):r?(0,q.jsx)(XG,{elapsedMs:r.elapsedMs},JSON.stringify([r.sessionId,r.sessionPath,r.commandId,r.epoch,r.startedAt])):null;return(0,q.jsxs)(q.Fragment,{children:[u&&(0,q.jsxs)(`header`,{className:`turn-duration`,"data-outcome":t?.outcome,children:[m?(0,q.jsxs)(`button`,{type:`button`,className:`turn-duration-toggle`,"aria-expanded":o,"aria-controls":f.map((e,t)=>p(t)).join(` `),onClick:e=>{c.current=e.nativeEvent.isTrusted,s(e=>!e)},children:[(0,q.jsx)(vs,{className:`turn-duration-icon`,"aria-hidden":`true`}),h,(0,q.jsx)(os,{className:`turn-duration-chevron`,"aria-hidden":`true`})]}):h,t&&t.outcome!==`completed`&&(0,q.jsx)(`span`,{className:`turn-duration-outcome`,children:i(`turnElapsedOutcome_${t.outcome}`)})]}),u?d.map(e=>e.foldable?(0,q.jsx)(`div`,{className:`turn-response-body`,id:p(f.indexOf(e)),hidden:!o,inert:!o,"data-user-toggle":c.current||void 0,children:_q(e.rows,n&&e===f.at(-1))},e.rows[0].key):(0,q.jsx)(K.Fragment,{children:_q(e.rows,!1)},e.rows[0].key)):_q(e,n)]})}function yq({id:e,rows:t,active:n,observed:r=!0,changes:i,session:a,timedTurn:o,onReviewTurn:s}){let{t:c}=W(),l=[...t].reverse().find(e=>e.outcome||e.timing),u=l?.timing?.outcome??l?.outcome,d=t.some(e=>e.kind===`response`),f=t.find(e=>e.kind===`prompt`),p=!!(f?.promptEntryId&&t.some(e=>e.commandHandledInputId===f.promptEntryId&&e.commandHandledCommandId===f.promptCommandId)),m=t.some(e=>e.forkSnapshotBoundary),h=m?`forked`:n?r?`running`:`unknown`:u===`failed`?`failed`:u===`interrupted`||u===`cancelled`?`interrupted`:u===`completed`||d||p?`complete`:`waiting`,g=h===`failed`?`error`:h===`interrupted`?`warning`:h===`running`?`accent`:h===`complete`?`success`:`neutral`,_=c(h===`unknown`?`toolState_unknown`:`turnState_${h}`),v=t.some(e=>e.timing&&e.timing.commandId===o?.commandId&&e.timing.epoch===o?.epoch)?void 0:o,y=[],b=[],x=0,S=(e,t=!1)=>{y.push((0,q.jsx)(vq,{rows:b,timing:e,active:n&&t,timedTurn:t?v:void 0},`run-${x++}`)),b=[]};for(let e of t)e.kind===`prompt`?b.length?b.push(e):y.push((0,q.jsx)(K.Fragment,{children:e.content},e.key)):e.timing?S(e.timing):b.push(e);let C=n&&r&&(b.length>0||!!v||!t.some(e=>e.timing))&&!b.some(e=>e.kind!==`prompt`&&e.content!==null);(b.length||v)&&S(void 0,!0);let w=!!(o||t.some(e=>e.timing));return(0,q.jsxs)(`section`,{className:`conversation-turn${e===0?` prelude`:``}`,"data-turn":e,children:[e>0&&h!==`complete`&&(!w||m)&&(0,q.jsxs)(`header`,{className:`turn-heading`,children:[(0,q.jsx)(`span`,{className:`sr-only`,children:c(`turnLabel`,{number:e})}),(0,q.jsxs)(`span`,{className:`turn-state ${h}`,children:[(0,q.jsx)(qG,{variant:g,label:_,isPulsing:h===`running`,icon:h===`failed`||h===`interrupted`?(0,q.jsx)(je,{"aria-hidden":`true`}):h===`forked`?(0,q.jsx)(Ws,{"aria-hidden":`true`}):void 0}),_]})]}),y,C&&(0,q.jsxs)(`div`,{className:`conversation-waiting`,"aria-hidden":`true`,children:[(0,q.jsxs)(`span`,{className:`conversation-waiting-dots`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]}),(0,q.jsx)(`span`,{children:c(`modelRunning`)})]}),i&&a&&(0,q.jsx)(SK,{changes:i,onReview:s},`${a.id}:${a.path}:${i.promptEntryId}`)]})}function bq(e,t,n,r){let i=new Map;for(let t=0;t{if(!t)return;let r=i.get(t);if(!(r===void 0||r>=n)){for(let t=r+1;te.rows.some(e=>e.promptCommandId===n||r?.promptEntryId&&e.promptEntryId===r.promptEntryId)):void 0,l=s.length-1;for(;l>=0&&s[l].id!==0&&!s[l].rows.some(e=>e.kind===`prompt`&&!e.pendingPrompt);)l--;return{turns:s,activeTurn:c?.id??s[l]?.id}}function xq(e,t,n,r,i,a,o,s=!0,c=t){let{turns:l,activeTurn:u}=bq(e,c,n,a);return l.map(e=>(0,q.jsx)(yq,{id:e.id,rows:e.rows,active:t&&e.id===u&&!e.rows.some(e=>e.forkSnapshotBoundary),observed:s,changes:c&&e.id===u?void 0:r?.get(e.rows.find(e=>e.kind===`prompt`&&!e.pendingPrompt)?.promptEntryId??``),session:i,timedTurn:t&&e.id===u&&!e.rows.some(e=>e.forkSnapshotBoundary)?a:void 0,onReviewTurn:o},`turn-group-${e.rows[0]?.key}`))}function Sq(e,t,n){let r=e.getBoundingClientRect(),i=r.top,a=Array.from(e.querySelectorAll(`[data-history-entry], [data-history-message], [data-history-result]`)).filter(t=>{let n=t.getBoundingClientRect(),i=Math.max(n.top,r.top),a=Math.min(n.bottom,r.bottom);for(let n=t;n&&n!==e;n=n.parentElement){if(n.hidden||n instanceof HTMLDetailsElement&&!n.open&&n!==t&&!n.querySelector(`:scope > summary`)?.contains(t))return!1;if(n===t)continue;let e=getComputedStyle(n);if(!/^(auto|scroll|overlay|hidden|clip)$/.test(e.overflowY))continue;let r=n.getBoundingClientRect();i=Math.max(i,r.top),a=Math.min(a,r.bottom)}return a>i}),o=a.find(e=>!a.some(t=>t!==e&&e.contains(t))),s=o?.dataset.historyResult??o?.dataset.historyEntry??o?.dataset.historyMessage,c=o?.dataset.historyResult??o?.dataset.historyMessage,l=n?.entries.find(e=>e.id===c||e.id===s)?.id;if(!l&&s)for(let e of n?.entries??[])s.startsWith(`${e.id}-`)&&(!l||e.id.length>l.length)&&(l=e.id);return{key:l?s:void 0,entryId:l,offset:(o?.getBoundingClientRect().top??i)-i,scrollTop:e.scrollTop,pinned:t}}function Cq(e,t){let n=!1;for(let r=e.parentElement;r&&r!==t;r=r.parentElement)if(r instanceof HTMLDetailsElement&&(r.open=!0),r.classList.contains(`turn-response-body`)&&r.hidden){let e=Array.from(t.querySelectorAll(`button[aria-controls]`)).find(e=>e.getAttribute(`aria-controls`)?.split(` `).includes(r.id));e&&(e.click(),n=!0)}return n}function wq(e,t,n){if(e.scrollIntoView?.({block:`nearest`,inline:`nearest`,behavior:`instant`}),n){t.scrollTop=n.scrollTop;for(let r=e.parentElement;r&&r!==t;r=r.parentElement)!/^(auto|scroll|overlay)$/.test(getComputedStyle(r).overflowY)||r.scrollHeight<=r.clientHeight||(r.scrollTop+=e.getBoundingClientRect().top-t.getBoundingClientRect().top-n.offset)}return Math.max(0,t.scrollTop+e.getBoundingClientRect().top-t.getBoundingClientRect().top-(n?.offset??24))}function Tq(e,t){return Eq(e,t,`up`)}function Eq(e,t,n){for(let r of e.composedPath()){if(r===t)return!0;if(!(r instanceof HTMLElement))continue;let e=getComputedStyle(r);if(/^(auto|scroll|overlay)$/.test(e.overflowY)&&((n===`up`?r.scrollTop:r.scrollHeight-r.clientHeight-r.scrollTop)>0||/^(contain|none)$/.test(e.overscrollBehaviorY)))return!1}return!1}function Dq(e){let{t}=W(),n=(0,K.useRef)(null),r=(0,K.useRef)(null),i=(0,K.useRef)(!0),a=(0,K.useRef)(0),o=(0,K.useRef)(null);(0,K.useEffect)(()=>{let e=n.current,t=()=>{o.current=null};return e?.addEventListener(`scrollend`,t),()=>e?.removeEventListener(`scrollend`,t)},[]);let s=(0,K.useRef)(null),c=(0,K.useCallback)(()=>{s.current!==null&&cancelAnimationFrame(s.current),s.current=null},[]),l=(0,K.useCallback)(e=>{let t=n.current;if(!t)return;let r=window.matchMedia?.(`(prefers-reduced-motion: reduce)`),o=(e=t.scrollHeight)=>{c(),typeof t.scrollTo==`function`?t.scrollTo({top:e,behavior:`instant`}):t.scrollTop=e,a.current=t.scrollTop};if(!e||r?.matches||document.visibilityState===`hidden`||!t.clientHeight){o();return}if(s.current!==null)return;let l=t.scrollHeight-t.clientHeight-t.scrollTop;if(l<=1||l>t.clientHeight){o();return}let u=performance.now(),d=e=>{if(s.current=null,!i.current||n.current!==t)return;if(r?.matches||document.visibilityState===`hidden`){o();return}let a=Math.max(0,t.scrollHeight-t.clientHeight),c=a-t.scrollTop;if(c<=1){o(a);return}let l=Math.min(64,Math.max(1,e-u));u=e,o(t.scrollTop+Math.max(1,c*(1-Math.exp(-l/48)))),s.current=requestAnimationFrame(d)};s.current=requestAnimationFrame(d)},[c]),u=(0,K.useRef)(void 0),d=(0,K.useRef)(0),f=(0,K.useRef)(e.readingRestorePending);f.current=e.readingRestorePending;let[p,m]=(0,K.useState)(!1),h=(0,K.useRef)(null),g=e.activityObserved!==!1&&e.resultExposureEnabled!==!1,_=(0,K.useCallback)(()=>{h.current?.abort(),h.current=null},[]),v=(0,K.useRef)(void 0),y=(0,K.useRef)(e.scrollToBottom),b=(0,K.useRef)(null),x=(0,K.useMemo)(()=>e.readingCache??new Map,[e.readingCache]),S=e.historyNavigation,C=S?JSON.stringify([S.sessionId,S.sessionPath,S.entryId,S.revision]):null,w=(0,K.useRef)(null),[T,E]=(0,K.useState)(null),D=qK(e.snapshot.selectedSession,{onAnchorChange:e.onHistoryAnchorChange,onRefresh:e.onRefreshHistory,preload:e.activityObserved!==!1&&e.resultExposureEnabled!==!1,beforePrepend:()=>{let e=n.current;e&&(b.current={...Sq(e,!1,k.current),scrollHeight:e.scrollHeight},i.current=!1)}},x,S),O=D.session,k=(0,K.useRef)(O);k.current=O;let A=O?.id,j=O?.path,M=O?.cwd,N=T&&T.sessionId===A&&T.sessionPath===j?T.entryId:void 0,P=JSON.stringify([A,j]),{capture:F,restore:I,clear:ee}=VK(n,i,P,a);(0,K.useLayoutEffect)(()=>c,[P,c]);let L=JSON.stringify([e.snapshot.selectedSession?.id,e.snapshot.selectedSession?.path,e.snapshot.selectedSession?.history?.leafEntryId??e.snapshot.selectedSession?.entries.at(-1)?.id]);(0,K.useLayoutEffect)(()=>(g||_(),_),[L,C,g,_]),(0,K.useLayoutEffect)(()=>{let e=n.current;if(!e||!A||!j)return;let t=()=>{f.current||uK(x,P,{position:Sq(e,i.current,k.current)})};window.addEventListener(`pagehide`,t);let r=()=>{document.visibilityState===`hidden`&&t()};return document.addEventListener(`visibilitychange`,r),()=>{window.clearTimeout(d.current),window.removeEventListener(`pagehide`,t),document.removeEventListener(`visibilitychange`,r),t()}},[P,x,A,j]);let R=(0,K.useRef)(P),[te,z]=(0,K.useState)({});(0,K.useLayoutEffect)(()=>{R.current!==P&&(R.current=P,z({}))},[P]);let B=(0,K.useMemo)(()=>new Map((O?.entries??[]).flatMap(e=>e.turnChanges&&e.turnChanges.sessionId===O?.id?[[e.turnChanges.promptEntryId,e.turnChanges]]:[])),[O?.entries,O?.id]),ne=(0,K.useRef)(D.reset),re=D.hasNewer||D.verifying,ie=HD(e.snapshot,O),ae=e.snapshot.selectedExecution?.sessionId===O?.id&&e.snapshot.selectedExecution?.sessionPath===O?.path?e.snapshot.selectedExecution:void 0,oe=ie&&e.liveActiveTurn!==void 0?e.liveRunning:ie&&e.liveRunning||(ae?ae.status===`running`:ie&&e.snapshot.runtime.status===`running`),se=!re&&oe?ie&&e.liveActiveTurn!==void 0?e.liveRetry??void 0:ae?ae.retry:ie?e.liveRetry??void 0:void 0:void 0,ce=(0,K.useRef)({scope:P,nativeRowKeys:new Map,ambiguousTimingIds:new Set});ce.current.scope!==P&&(ce.current={scope:P,nativeRowKeys:new Map,ambiguousTimingIds:new Set});let{entries:le,projectedPrompts:H}=(0,K.useMemo)(()=>LK({...e.snapshot,selectedSession:O},re?[]:e.liveMessages.filter(e=>e.optimistic?e.optimistic.sessionId===O?.id&&e.optimistic.sessionPath===O?.path:ie),ce.current),[e.snapshot,O,ie,re,e.liveMessages]);(0,K.useEffect)(()=>{O&&H.length>0&&e.onPromptProjection?.(O.id,O.path,H)},[O,H,e.onPromptProjection]),(0,K.useEffect)(()=>{let e=n.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{if(!i.current){I(),F();return}l(oe)});return t.observe(e),r.current&&t.observe(r.current),()=>t.disconnect()},[l,oe,I,F]);let{rows:de,turns:fe}=(0,K.useMemo)(()=>{let n=GD(le.map(e=>e.message)),r=nq(le,oe&&!re,!!se),i=[...r.finalErrors].at(-1),a=-1;for(let e=le.length-1;e>=0;e--)if(le[e].message.role===`assistant`){a=e;break}let o=new Map,s,c=new Map,l=new Set,u=ie?e.snapshot.runtime.liveTools??[]:[],d=ae?.liveTools??[],f=re?[]:[...u,...d.filter(e=>!u.some(t=>t.call.id===e.call.id))];le.forEach(e=>{let{message:t}=e;t.role===`toolResult`&&t.toolCallId&&c.set(t.toolCallId,e),t.parts?.forEach(e=>{e.type===`toolCall`&&e.id&&![`ask_user`,`human_handoff`].includes(e.name)&&l.add(e.id)})});let p=[],m=0,h,g=-1,_=-1;for(let e=le.length-1;e>=0;e--){if(le[e]?.message.role===`user`){_=e;break}if(le[e]?.message.role===`custom`&&le[e]?.message.customType===`openpi-setup-request`)break}let v=new Set,y=-1;le.forEach(({message:e},t)=>{e.role===`user`||e.role===`custom`&&e.customType===`openpi-setup-request`?(y>=0&&v.add(y),y=-1):e.role===`assistant`&&e.content.trim()&&(y=t)}),y>=0&&v.add(y);let b=le.flatMap((u,d)=>{let y=u.message;if(u.forkSnapshotBoundary)return[{key:u.key,turn:m,kind:`custom`,forkSnapshotBoundary:!0,content:null}];if(u.timing)return[{key:u.key,turn:m,kind:`custom`,timing:u.timing,content:null}];if(u.compaction)return[{key:u.key,turn:m,kind:`custom`,content:(0,q.jsx)(QG,{compaction:{state:`completed`}})}];if(y.role===`custom`){if(y.customType===`openpi-web-command-handled`){let e=y.details;return e&&typeof e==`object`&&`inputEntryId`in e&&typeof e.inputEntryId==`string`?[{key:u.key,turn:m,kind:`custom`,commandHandledInputId:e.inputEntryId,commandHandledCommandId:`commandId`in e&&typeof e.commandId==`string`?e.commandId:void 0,content:null}]:[]}return y.display===!1||![`openpi-web-command-feedback`,`openpi-setup-request`,`openpi-setup-closed`,`subagent-result`,`workflow-result`].includes(y.customType??``)?[]:(y.customType===`openpi-setup-request`&&(h=void 0,g=-1,m++),[{key:u.key,turn:m,kind:`custom`,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-entry":u.entryId??u.key,tabIndex:-1,children:(0,q.jsx)(`div`,{className:`message-content`,children:(0,q.jsx)(mq,{message:y,sessionId:A??``,onInspectSubagent:e.onInspectSubagent,fullSubagent:e.snapshot.preferences.subagentResultDisplay===`full`})})})}])}if(y.role===`user`){h=y.content,g=d,m++,p.push({entryId:u.entryId??u.key,title:Array.from((y.content||t(`attachedImage`)).replace(/\s+/g,` `).trim()).slice(0,240).join(``)});let n=u.entryId?JSON.stringify([A,j,u.entryId]):``,r=te[n],i=!!(y.truncation?.visibleText&&r===void 0);return[{key:u.key,turn:m,kind:`prompt`,pendingPrompt:!!u.optimistic,promptCommandId:u.optimistic?.commandId??y.commandId,promptEntryId:u.entryId,content:(0,q.jsxs)(`article`,{className:`message-row user`,id:`turn-${m}`,"data-history-entry":u.entryId??u.key,"data-history-highlighted":N&&u.entryId===N||void 0,tabIndex:-1,children:[(0,q.jsxs)(`div`,{className:`message-content`,children:[(0,q.jsx)(RK,{message:y,sessionId:A,path:j,entryId:u.entryId}),(y.content||y.truncation?.visibleText)&&(u.entryId&&A&&j&&y.truncation?.visibleText?(0,q.jsx)(iK,{preview:y.content,sessionId:A,sessionPath:j,entryId:u.entryId,markdown:!1,fullText:r,onComplete:e=>z(t=>({...t,[n]:e}))},`${A}:${j}:${u.entryId}`):(0,q.jsx)(rK,{content:y.content}))]}),(0,q.jsx)(pq,{content:r??y.content,editable:ie&&!oe&&!!(e.forkAvailable&&e.onEdit&&u.entryId&&A&&j&&!u.optimistic)&&!i,copyRequiresFull:i,timestamp:u.timestamp,onResend:t=>e.onEdit&&u.entryId&&A&&j?e.onEdit({sessionId:A,sessionPath:j,entryId:u.entryId},t):Promise.resolve(!1),onFork:u.entryId&&A&&j&&e.onFork&&!u.optimistic?()=>e.onFork({sessionId:A,sessionPath:j,entryId:u.entryId}):void 0,canFork:ie&&!oe&&e.forkAvailable,forkPending:e.forkPending})]})}]}if(y.role===`assistant`){let b=p.at(-1);b&&y.content.trim()&&(b.reply=Array.from(y.content.replace(/\s+/g,` `).trim()).slice(0,240).join(``));let x=[],S=y.parts??[],C=y.webSearch??[],w=e=>Math.min(S.length,e.beforePartIndex??0),T=e=>{for(let[t,n]of C.entries()){if(w(n)!==e)continue;let r=n.status===`completed`?`done`:n.status===`failed`?`error`:`warn`;x.push({key:`${u.key}-native-search-${t}`,turn:m,kind:`process`,processType:`tool`,processToolName:`web_search`,processPreview:n.query,processStatus:r,error:n.status===`failed`,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-entry":`${u.entryId??u.key}-native-search-${t}-body`,"data-history-message":u.entryId??u.key,tabIndex:-1,children:(0,q.jsx)(`div`,{className:`message-content`,children:(0,q.jsx)(aq,{body:n.query,icon:(0,q.jsx)(Gs,{}),name:`web_search`,summary:n.query,status:r})})})})}},E=S.reduce((e,t,n)=>(t.type===`thinking`||t.type===`text`)&&!t.text.trim()?e:n,-1),D=S.reduce((e,t,n)=>t.type===`text`?n:e,-1),O=!!(u.entryId&&A&&j&&y.truncation?.visibleText),k=y.content,F=u.entryId?JSON.stringify([A,j,u.entryId]):``,I=te[F],ee=!!(y.truncation?.visibleText&&I===void 0),L=(t,n,r)=>{if(O&&!r||!O&&!t.trim())return;let i=r&&!re&&!se&&e.activityObserved!==!1&&oe&&ae?.compaction?.state!==`running`&&!y.stopReason&&d===le.length-1&&E===D,a=r&&v.has(d)&&!i&&(y.stopReason===`stop`||y.stopReason===`length`||y.stopReason===`error`||y.stopReason===`aborted`||!oe&&!y.parts?.some(e=>e.type===`toolCall`));x.push({key:n,turn:m,kind:`response`,responseEntryId:u.entryId,final:r&&(y.stopReason===`stop`||y.stopReason===`length`),content:(0,q.jsxs)(`article`,{className:`message-row assistant response${a?` final-response`:``}`,"data-streaming":i||void 0,"data-history-message":u.entryId??u.key,"data-history-highlighted":N&&u.entryId===N||void 0,tabIndex:-1,"data-history-entry":u.entryId?`${u.entryId}-${n.slice(u.key.length+1)}`:n,children:[(0,q.jsx)(`div`,{className:`message-content`,children:O&&A&&j&&u.entryId?(0,q.jsx)(iK,{preview:k,sessionId:A,sessionPath:j,entryId:u.entryId,markdown:!0,fullText:I,onComplete:e=>z(t=>({...t,[F]:e}))},`${A}:${j}:${u.entryId}`):(0,q.jsx)(vD,{streaming:i,children:t},P)}),a&&(0,q.jsx)(pq,{content:I??y.content,editable:!1,copyRequiresFull:ee,timestamp:u.timestamp,onResend:e.onResend,onRegenerate:b?.entryId&&A&&j&&e.onRegenerate&&!u.optimistic&&!y.isError&&(y.stopReason===`stop`||y.stopReason===`length`)?()=>e.onRegenerate({sessionId:A,sessionPath:j,entryId:b.entryId}):void 0,onFork:u.entryId&&A&&j&&e.onFork?()=>e.onFork({sessionId:A,sessionPath:j,entryId:u.entryId}):void 0,canFork:ie&&!oe&&e.forkAvailable,forkPending:e.forkPending})]})})};y.parts?.forEach((r,i)=>{if(T(i),r.type===`text`&&(S[i-1]?.type!==`text`||C.some(e=>w(e)===i))){let e=r.text,t=i+1;for(;S[t]?.type===`text`&&!C.some(e=>w(e)===t);){let n=S[t];n?.type===`text`&&(e+=n.text),t++}L(e,`${u.key}-text-${i}`,t>D)}if(r.type===`thinking`&&r.text.trim()){let t=!re&&!se&&!y.stopReason&&ae?.compaction?.state!==`running`&&oe&&d===le.length-1&&i===E?e.activityObserved===!1?`unknown`:`running`:`done`;x.push({key:`${u.key}-thinking-${i}`,turn:m,kind:`process`,processType:`thinking`,processPreview:iq(r.text),processStatus:t,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-entry":`${u.entryId??u.key}-thinking-${i}-body`,"data-history-message":u.entryId??u.key,"data-history-highlighted":N&&u.entryId===N||void 0,tabIndex:-1,children:(0,q.jsx)(`div`,{className:`message-content`,children:(0,q.jsx)(fq,{body:r.text,truncated:r.textTruncated,source:u.entryId&&A&&j&&r.sourcePartIndex!==void 0?{sessionId:A,sessionPath:j,entryId:u.entryId,partIndex:r.sourcePartIndex}:void 0,status:t,level:t===`running`?e.snapshot.thinking?.level:void 0,duration:IK(u,e.thinkingDurations),defaultOpen:e.snapshot.preferences.expandThinking===!0},JSON.stringify([A,j,u.key,i]))})})})}if(r.type===`toolCall`){let a=r,o=f.find(e=>e.call.id===a.id),s=a.id?c.get(a.id):void 0,d=s?.message??o?.result,p=$G(a,d,f,s?void 0:o?.state),h=p?[...p.children.map(e=>({call:e.call,child:e})),...p.showWrapper?[{call:a}]:[]]:[{call:a}];for(let[r,{call:o,child:g}]of h.entries()){let _=o.name.startsWith(`subagent`)?e.snapshot.preferences.subagentResultDisplay===`full`:o.name===`bash`?e.snapshot.preferences.bashToolDisplay===`full`:o.name===`write`||o.name===`edit`?e.snapshot.preferences.fileMutationDisplay===`full`:!1,v=o.id?f.find(e=>e.call.id===o.id):void 0,y=g?s:o.id?c.get(o.id):void 0,b=g?void 0:y?.message,S=g?g.result:b??v?.result,C=g?g.state:b?void 0:v?.state,w=g?g.state===`returned`?`done`:g.state===`failed`?`error`:g.state===`cancelled`||g.state===`timed_out`?`warn`:g.state:ZK(S,C),T=e.activityObserved===!1&&w===`running`?`unknown`:w,E=p&&r===h.length-1&&!p.showWrapper?(0,q.jsxs)(`details`,{className:`evidence-raw`,children:[(0,q.jsx)(`summary`,{children:t(`toolCodemodeDetails`)}),(0,q.jsx)(`pre`,{children:pd(a.arguments).text}),(0,q.jsx)(`pre`,{children:pd(d?.content??``).text})]}):null,D=o.name===`plan_ready`&&S&&aK(S)?(0,q.jsx)(oK,{result:S,sessionId:A,sessionPath:j,entryId:y?.entryId},`${u.key}-${o.id||i}-plan`):hd(o.name)&&!g?.outputMissing?(0,q.jsx)(xK,{call:o,result:S,liveState:C,observed:e.activityObserved,cwd:M,defaultOpen:_,children:E},`${u.key}-${o.id||i}-evidence`):g?.outputMissing?null:lq(o,S,{sessionId:A??``,subagents:ie?e.snapshot.runtime.capabilities.subagents?.items:void 0,workflows:ie?e.snapshot.runtime.capabilities.workflows?.items:void 0,records:n,onInspectSubagent:e.onInspectSubagent,liveState:C,defaultOpen:_,observed:e.activityObserved!==!1}),O=YK(o.arguments),{Icon:k,action:P}=hK(o.name),F=P===`agent`?sq(O,JK(S?.details)).map(t=>UD(t,ie?e.snapshot.runtime.capabilities.subagents?.items:void 0,n)).join(t(`toolGroupSeparator`)):vK(o.name,O),I=(0,q.jsx)(k,{},`${u.key}-${o.id||i}-icon`);x.push({key:`${u.key}-tool-${o.id||i}`,turn:m,kind:o.name===`plan_ready`&&S&&aK(S)?`response`:D&&(o.name===`subagent_spawn`||o.name===`workflow`)?`custom`:`process`,processType:/^(subagent|workflow)/u.test(o.name)?`activity`:`tool`,processToolName:o.name,processPreview:F.split(` -`).find(Boolean),processStatus:T,error:T===`error`,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-message":u.entryId??u.key,"data-history-result":y?.entryId,"data-history-highlighted":N&&(u.entryId===N||y?.entryId===N)||void 0,tabIndex:-1,children:(0,q.jsxs)(`div`,{className:`message-content`,children:[D||(0,q.jsx)(aq,{body:o.name===`bash`&&typeof O.command==`string`?O.command:o.arguments,icon:I,name:o.name||`tool`,summary:P===`search`&&typeof O.path==`string`?t(`toolSearchTarget`,{path:O.path,pattern:rq(o.name,O)}):rq(o.name,O),output:g?g.error??S?.content:o.id&&l.has(o.id)?S?.content:void 0,status:T,evidenceState:e.activityObserved===!1&&g?.state===`running`?`unknown`:g?.state,rawDetails:p?.showWrapper&&o.id===a.id?d?.details:void 0,note:g?.outputMissing?t(g.argumentsOmitted?`toolNestedArgumentsMissing`:`toolNestedOutputMissing`):void 0,snapshotMissingResult:S?.forkSnapshotToolResult,defaultOpen:_,children:E}),p?.incomplete&&r===h.length-1&&(0,q.jsx)(`p`,{className:`evidence-note`,role:`status`,children:t(`toolNestedIncomplete`)}),D&&!hd(o.name)&&E]})})})}}}),T(S.length),D<0&&L(y.content,`${u.key}-answer`,!0),y.stopReason===`error`&&!r.finalErrors.has(d)&&(o.set(u.key,[...x]),x.length=0);let R=r.groups.get(d);if(R&&(R.state===`retrying`&&se&&(s=`${R.attempts[0].key}-attempts`),x.push({key:`${R.attempts[0].key}-attempts`,turn:m,kind:`outcome`,outcome:R.state===`interrupted`?`interrupted`:void 0,content:(0,q.jsx)(`article`,{className:`message-row assistant outcome-row`,children:(0,q.jsx)(tq,{state:R.state,retry:R.state===`retrying`?se:void 0,observed:e.activityObserved!==!1&&ae?.status!==`unknown`,attempts:R.attempts.map(e=>({entry:e,content:o.get(e.key)}))})})})),r.finalErrors.has(d)||y.stopReason===`aborted`){let t=y.stopReason===`error`,n=g===_&&d===i&&d===a?h:void 0;x.push({key:`${u.key}-outcome`,turn:m,kind:`outcome`,error:t,outcome:t?`failed`:`interrupted`,content:(0,q.jsx)(`article`,{className:`message-row assistant outcome-row`,children:(0,q.jsx)(eq,{failed:t,error:y.errorMessage,retryPrompt:n,retryEntryId:u.entryId,canRetry:ie&&!re&&!oe,onRetry:e.onResend})})})}else(y.stopReason===`stop`||y.stopReason===`length`)&&x.push({key:`${u.key}-completed`,turn:m,kind:`outcome`,outcome:`completed`,content:null});return x}if(y.role===`toolResult`){if(y.toolCallId&&l.has(y.toolCallId))return[];if(aK(y))return[{key:u.key,turn:m,kind:`response`,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-message":u.entryId??u.key,"data-history-highlighted":N&&u.entryId===N||void 0,tabIndex:-1,children:(0,q.jsx)(`div`,{className:`message-content`,children:(0,q.jsx)(oK,{result:y,sessionId:A,sessionPath:j,entryId:u.entryId})})})}];let r=y.toolName?.startsWith(`subagent`)?`subagent`:y.toolName?.startsWith(`workflow`)?`workflow`:null,i=ZK(y),a=e.activityObserved===!1&&i===`running`?`unknown`:i,o=y.toolName||`tool`,s=r===`subagent`?e.snapshot.preferences.subagentResultDisplay===`full`:o===`bash`?e.snapshot.preferences.bashToolDisplay===`full`:o===`write`||o===`edit`?e.snapshot.preferences.fileMutationDisplay===`full`:!1,{Icon:c}=hK(o),d=(0,q.jsx)(c,{},`${u.key}-icon`),f=r===`subagent`&&!y.forkSnapshotToolResult?lq({type:`toolCall`,id:y.toolCallId,name:o,arguments:`{}`},y,{sessionId:A??``,subagents:ie?e.snapshot.runtime.capabilities.subagents?.items:void 0,records:n,onInspectSubagent:e.onInspectSubagent,defaultOpen:s,observed:e.activityObserved!==!1}):r&&!y.forkSnapshotToolResult?(0,q.jsx)(oq,{family:r,title:`${o.replaceAll(`_`,` `)} · ${zD(y.content)}`,body:y.content,status:a,defaultOpen:s},`${u.key}-card`):hq(y.content)&&!y.forkSnapshotToolResult?(0,q.jsxs)(`div`,{className:`tool-line-empty`,children:[(0,q.jsx)(`span`,{className:`tool-icon`,children:d}),(0,q.jsx)(`span`,{className:`tool-name`,children:o}),(0,q.jsx)(`span`,{className:`tool-summary`,children:t(`noOutput`)}),(0,q.jsx)(QK,{status:a})]},`${u.key}-empty`):(0,q.jsx)(aq,{body:y.content,icon:d,name:o,summary:zD(y.content),status:a,snapshotMissingResult:y.forkSnapshotToolResult,defaultOpen:s},`${u.key}-evidence`);return[{key:u.key,turn:m,kind:o===`ask_user`||o===`human_handoff`?`response`:`process`,processType:r?`activity`:`tool`,processToolName:o,processStatus:a,error:a===`error`,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-entry":`${u.entryId??u.key}-body`,"data-history-message":u.entryId??u.key,"data-history-highlighted":N&&u.entryId===N||void 0,tabIndex:-1,children:(0,q.jsx)(`div`,{className:`message-content`,children:f})})}]}return[]}),x=b.length;for(;x>0&&b[x-1].pendingPrompt;)x--;let S=b.length-x,C=b[x-1]?.turn??0;se&&!s&&(s=`native-retry`,b.splice(x,0,{key:`native-retry`,turn:C,kind:`outcome`,content:(0,q.jsx)(`article`,{className:`message-row assistant outcome-row`,children:(0,q.jsx)(tq,{attempts:[],state:`retrying`,retry:se,observed:e.activityObserved!==!1&&ae?.status!==`unknown`})})}));let w=!re&&ae?.compaction;if(w&&w.state!==`completed`){let n=b.findIndex(e=>e.key===s),r={key:`native-compaction-${w.startedAt??w.state}`,turn:b[n]?.turn??C,kind:`custom`,content:(0,q.jsx)(QG,{compaction:w,observed:e.activityObserved!==!1&&ae?.status!==`unknown`})};b.splice(n<0?x:n,0,r),w.state===`failed`&&w.errorMessage&&b.splice(b.length-S,0,{key:`native-compaction-error`,turn:r.turn,kind:`custom`,content:(0,q.jsx)(`article`,{className:`message-row assistant outcome-row`,children:(0,q.jsx)($K,{label:t(`compactionFailed`),message:w.errorMessage})})})}return{rows:b,turns:p}},[ie,oe,ae,se,e.activityObserved,re,le,e.onResend,e.onEdit,e.onRegenerate,e.onFork,e.forkAvailable,e.forkPending,e.onInspectSubagent,e.snapshot.runtime.capabilities.subagents,e.snapshot.runtime.capabilities.workflows?.items,e.snapshot.preferences.expandThinking,e.snapshot.preferences.subagentResultDisplay,e.snapshot.preferences.bashToolDisplay,e.snapshot.preferences.fileMutationDisplay,e.snapshot.thinking?.level,e.thinkingDurations,e.snapshot.runtime.liveTools,A,j,M,te,P,N,t]),pe=zK(e.snapshot.selectedSession,fe,g),me=(0,K.useCallback)(async(t,r=!1)=>{if(_(),!g||!A||!j)return!1;let s=n.current,c=Array.from(s?.querySelectorAll(`[data-history-entry]`)??[]).find(e=>e.dataset.historyEntry===t);if(s&&c){o.current=null,ee(),i.current=!1,m(!0),E({sessionId:A,sessionPath:j,entryId:t});let e=Math.max(0,s.scrollTop+c.getBoundingClientRect().top-s.getBoundingClientRect().top-16),n=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return s.scrollTo?.({top:e,behavior:r||n?`instant`:`smooth`}),typeof s.scrollTo!=`function`&&(s.scrollTop=e),a.current=s.scrollTop,F(),c.focus({preventScroll:!0}),!0}if(r)return;if(!e.onNavigateToMessage)return!1;let l=new AbortController;h.current=l;let u=await e.onNavigateToMessage({sessionId:A,sessionPath:j,entryId:t},l.signal);if(!(l.signal.aborted||h.current!==l))return h.current=null,u},[_,F,ee,g,A,j,e.onNavigateToMessage]);(0,K.useLayoutEffect)(()=>{let t=n.current;if(!t||!O)return;let r=lK(O),s=v.current!==r,c=ne.current!==D.reset,u=s||c;ne.current=D.reset;let d=y.current!==e.scrollToBottom;if(y.current=e.scrollToBottom,S&&C!==w.current&&S.sessionId===O.id&&S.sessionPath===O.path){i.current=!1,b.current=null,v.current=r;return}if(d&&D.engaged){b.current=null,D.resetToLatest();return}let p=s&&!c&&!d?x.get(r)?.position:void 0,h=p?.key&&Array.from(t.querySelectorAll(`[data-history-entry], [data-history-message], [data-history-result]`)).some(e=>e.dataset.historyEntry===p.key||e.dataset.historyMessage===p.key||e.dataset.historyResult===p.key),g=b.current??(p&&!p.pinned&&(!f.current||h)?{...p,scrollHeight:t.scrollHeight}:null);if(b.current=null,g&&(!u||p)&&!d){let e=Array.from(t.querySelectorAll(`[data-history-entry], [data-history-message], [data-history-result]`)),n=g.key===void 0?void 0:e.find(e=>e.dataset.historyEntry===g.key)??e.reverse().find(e=>e.dataset.historyMessage===g.key||e.dataset.historyResult===g.key);i.current=!1,o.current=null,ee(),m(!0),v.current=r;let s=()=>{if(n&&!t.contains(n))return;b.current===g&&(b.current=null);let e=n?wq(n,t,g):g.scrollTop+t.scrollHeight-g.scrollHeight;typeof t.scrollTo==`function`?t.scrollTo({top:e,behavior:`instant`}):t.scrollTop=e,a.current=t.scrollTop,F()};if(n&&Cq(n,t)){b.current=g;let e=requestAnimationFrame(s);return()=>cancelAnimationFrame(e)}s();return}(u||d||i.current)&&(i.current=!0,m(!1),l(oe&&!u&&!d)),v.current=r},[O,le,D.reset,D.engaged,D.resetToLatest,e.scrollToBottom,x,S,C,l,F,ee,oe]),(0,K.useLayoutEffect)(()=>{let e=n.current;if(!e||!O||!S||C===w.current||S.sessionId!==O.id||S.sessionPath!==O.path)return;let t=Array.from(e.querySelectorAll(`[data-history-entry], [data-history-message], [data-history-result]`)),r=t.filter(e=>e.dataset.historyEntry===S.entryId||e.dataset.historyMessage===S.entryId||e.dataset.historyResult===S.entryId),s=S.restorePosition?.key?t.find(e=>e.dataset.historyEntry===S.restorePosition.key)??[...t].reverse().find(e=>e.dataset.historyMessage===S.restorePosition.key||e.dataset.historyResult===S.restorePosition.key):void 0,c=s??r.find(e=>e.classList.contains(`response`))??r.find(e=>e.dataset.historyMessage===S.entryId||e.dataset.historyResult===S.entryId)??r[0];if(!c)return;o.current=null,ee(),Cq(c,e);let l=()=>{if(!e.contains(c)||S.restorePosition&&w.current===C)return;let t=wq(c,e,s?S.restorePosition:void 0);e.scrollTo?.({top:t,behavior:`instant`}),typeof e.scrollTo!=`function`&&(e.scrollTop=t),a.current=e.scrollTop,S.restorePosition||c.focus({preventScroll:!0}),i.current=!1,F(),m(!0),S.restorePosition||E(S),w.current=C,uK(x,lK(O),{position:Sq(e,!1,O)})},u=document.querySelector(`dialog[open]`),d,f=()=>{d=requestAnimationFrame(l)};return u?u.addEventListener(`close`,f,{once:!0}):f(),()=>{u?.removeEventListener(`close`,f),d!==void 0&&cancelAnimationFrame(d)}},[O,S,C,x,ee,F]);let he=ie?se?`${t(`modelRetrying`)}${se.attempt&&se.maxAttempts?` (${se.attempt}/${se.maxAttempts})`:``}`:e.livePhase===`preparing`?t(`modelPreparing`):t(`modelRunning`):t(`backgroundSessionRunning`),ge=ie?0:ae?.liveTools.filter(e=>e.state===`running`).length??0,_e=ie&&e.liveActiveTurn!==void 0?e.liveActiveTurn:ae?ae.activeTurn:ie?e.snapshot.runtime.activeTurn:void 0,ve=oe&&_e&&O&&_e.sessionId===O.id&&_e.sessionPath===O?.path&&typeof _e.startedAt==`number`&&Number.isFinite(_e.startedAt)&&typeof _e.elapsedMs==`number`&&Number.isFinite(_e.elapsedMs)&&_e.elapsedMs>=0?_e:void 0,ye=!D.verifying&&ve&&(!re||ve.promptEntryId&&de.some(e=>e.promptEntryId===ve.promptEntryId))?ve:void 0,be=t=>{D.hasMore&&!D.error&&!D.verifying&&e.activityObserved!==!1&&e.resultExposureEnabled!==!1&&t.scrollTop<=Math.max(t.clientHeight,160)&&D.loadOlder()},xe=()=>{o.current=`up`,c(),i.current=!1,m(!0),D.retainReading()};return(0,q.jsxs)(`div`,{className:`transcript-surface`,children:[(0,q.jsx)(`div`,{ref:n,className:`conversation`,role:`log`,"aria-label":e.label??`Conversation`,tabIndex:0,onPointerDownCapture:e=>{e.target===e.currentTarget&&(o.current=`pointer`),S?.restorePosition&&(w.current=C)},onTouchStartCapture:e=>{u.current=e.touches[0]?.clientY,o.current=null,S?.restorePosition&&(w.current=C)},onTouchMove:e=>{let t=e.touches[0]?.clientY;t!==void 0&&u.current!==void 0&&t>u.current&&Tq(e.nativeEvent,e.currentTarget)?xe():t!==void 0&&u.current!==void 0&&t{let t=e.currentTarget,n=t.scrollTopa.current;a.current=t.scrollTop;let s=t.scrollTop+t.clientHeight>=t.scrollHeight-48;i.current=i.current?!n||s:r&&s&&(o.current===`down`||o.current===`pointer`),i.current||D.retainReading(),m(!i.current),F(),window.clearTimeout(d.current),d.current=window.setTimeout(()=>{!f.current&&A&&j&&t.isConnected&&uK(x,P,{position:Sq(t,i.current,k.current)})},200),n&&be(t)},onWheel:e=>{!e.defaultPrevented&&!e.ctrlKey&&!e.metaKey&&e.deltaY>0&&Eq(e.nativeEvent,e.currentTarget,`down`)&&(o.current=`down`),S?.restorePosition&&(w.current=C),!e.defaultPrevented&&!e.ctrlKey&&!e.metaKey&&e.deltaY<0&&Tq(e.nativeEvent,e.currentTarget)&&(xe(),be(e.currentTarget))},onKeyDown:e=>{S?.restorePosition&&[`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `].includes(e.key)&&(w.current=C);let t=e.target;!e.defaultPrevented&&!e.altKey&&!e.metaKey&&(!e.ctrlKey||e.key===`End`)&&([`ArrowDown`,`PageDown`,`End`].includes(e.key)||e.key===` `&&!e.shiftKey)&&t instanceof HTMLElement&&!t.isContentEditable&&!t.closest(`input, textarea, select`)&&!(e.key===` `&&t.closest(`button, summary`))&&Eq(e.nativeEvent,e.currentTarget,`down`)&&(o.current=`down`),!e.defaultPrevented&&!e.altKey&&!e.metaKey&&(!e.ctrlKey||e.key===`Home`)&&([`ArrowUp`,`PageUp`,`Home`].includes(e.key)||e.key===` `&&e.shiftKey)&&t instanceof HTMLElement&&!t.isContentEditable&&!t.closest(`input, textarea, select`)&&!(e.key===` `&&t.closest(`button, summary`))&&Tq(e.nativeEvent,e.currentTarget)&&(xe(),be(e.currentTarget))},children:(0,q.jsxs)(`div`,{ref:r,className:`conversation-content`,children:[e.notice,O?.rerun&&e.onOpenOriginal&&(0,q.jsxs)(`div`,{className:`message-branch-origin`,children:[(0,q.jsxs)(`button`,{type:`button`,onClick:()=>void e.onOpenOriginal(O.rerun.source),children:[(0,q.jsx)(Ws,{"aria-hidden":`true`}),` `,t(`openOriginalConversation`)]}),(0,q.jsx)(`span`,{children:t(`messageRerunWorkspaceHint`)})]}),(D.hasMore||D.error||D.verifying)&&(0,q.jsxs)(`div`,{className:`conversation-history`,children:[D.error&&(0,q.jsx)(`p`,{role:`alert`,children:t(D.error)}),D.error&&D.error!==`historyChanged`&&(0,q.jsx)(`button`,{type:`button`,className:`secondary`,disabled:D.loading,onClick:()=>void D.loadOlder(),children:t(`retryAdmissionCheck`)}),D.loading&&(0,q.jsx)(`p`,{role:`status`,children:t(`historyLoading`)}),D.verifying&&!D.error&&!D.loading&&(0,q.jsx)(`p`,{role:`status`,children:t(`historyVerifying`)}),D.hasMore&&(0,q.jsx)(`span`,{children:t(`historyOmitted`,{count:O?.truncation.entriesOmitted??0})})]}),xq(de,oe&&(!re||!!ye)&&ae?.compaction?.state!==`running`,_e?.commandId,B,O,e.activityObserved===!1?void 0:ye,e.onReviewTurn,e.activityObserved!==!1,oe&&(!re||!!ye)),oe&&e.activityObserved!==!1&&ae?.compaction?.state!==`running`&&(0,q.jsxs)(`div`,{className:`conversation-execution-status sr-only`,role:`status`,"aria-live":`polite`,children:[(0,q.jsx)(`span`,{children:he}),ge>0&&(0,q.jsx)(`span`,{children:t(`observedSessionTools`,{count:ge})}),(ae?.pendingFollowUps??0)>0&&(0,q.jsx)(`span`,{children:t(`pendingFollowUpsHint`,{count:ae.pendingFollowUps})})]})]})}),(p||D.hasNewer)&&de.length>0&&(0,q.jsx)(V,{content:t(`jumpToLatest`),placement:`above`,children:(0,q.jsx)(`button`,{className:`jump-to-latest`,type:`button`,"aria-label":t(`jumpToLatest`),onClick:()=>{let e=n.current;e&&(c(),i.current=!0,m(!1),E(null),D.resetToLatest(),e.scrollTo({top:e.scrollHeight,behavior:window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`}),queueMicrotask(()=>{n.current===e&&(Array.from(e.querySelectorAll(`.message-row[tabindex="-1"]`)).reverse().find(e=>!e.closest(`[hidden], details:not([open])`))??e).focus({preventScroll:!0})}))},children:oe&&e.activityObserved!==!1?(0,q.jsxs)(`span`,{className:`latest-activity-dots`,"aria-hidden":`true`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]}):(0,q.jsx)(ue,{"aria-hidden":`true`})})}),(0,q.jsx)(wK,{items:pe.items,viewport:n,enabled:g,onHidden:_,onRequestPreview:pe.requestPreview,readingHistory:p||D.hasNewer,onNavigate:me},L)]})}function Oq(e,t,n,r){let i=JSON.stringify([e,t.kind,t.id]),a=[],o=new Set,s=new Map,c=new Map,l=e=>({type:`toolCall`,id:e.toolId,name:e.name,arguments:e.argsPreview??`{}`}),u=(e,t)=>{a.push({type:`message`,id:e,timestamp:``,message:t})};for(let e of t.transcript){let t=JSON.stringify(e),n=c.get(t)??0;c.set(t,n+1);let i=e.id??`${t}:${n}`;if(e.kind===`user`)u(i,{role:`user`,content:e.text});else if(e.kind===`toolResult`){let t={role:`toolResult`,toolCallId:e.toolId,toolName:e.name,isError:e.isError,content:e.outputPreview??``};s.set(e.toolId,t),u(i,t)}else{let t=e.parts.map(e=>e.type===`toolCall`?(o.add(e.toolId),l(e)):e.type===`thinking`?{type:`thinking`,text:e.redacted?r:e.text}:e);u(i,{role:`assistant`,content:t.flatMap(e=>e.type===`text`?[e.text]:[]).join(` -`),parts:t,...t.some(e=>e.type===`toolCall`)?{stopReason:`toolUse`}:{}})}}let d=t.status===`running`,f=t.liveTools.map(e=>({call:l(e),result:s.get(e.toolId)??{role:`toolResult`,toolCallId:e.toolId,toolName:e.name,content:e.outputPreview??``,...e.done?{isError:e.isError===!0}:{}},state:s.has(e.toolId)?s.get(e.toolId).isError?`failed`:`returned`:e.done?e.isError?`failed`:`returned`:d?`running`:`unknown`})),p=[];return t.liveAssistant?.thinking&&p.push({type:`thinking`,text:t.liveAssistant.thinking}),t.liveAssistant?.text&&p.push({type:`text`,text:t.liveAssistant.text}),p.push(...f.filter(e=>!o.has(e.call.id)&&!s.has(e.call.id)).map(e=>e.call)),p.length&&u(t.nextEntryId??`live-assistant`,{role:`assistant`,content:t.liveAssistant?.text??``,parts:p}),t.finalText&&!a.some(e=>e.message?.role===`assistant`&&e.message.content.trim()===t.finalText.trim())&&u(`final-result`,{role:`assistant`,content:t.finalText,parts:[{type:`text`,text:t.finalText}]}),{protocolVersion:1,generatedAt:new Date(t.createdAt).toISOString(),cursor:0,preferences:n,sessions:[],workspaces:[],models:[],runtime:{status:`idle`,capabilities:{}},selectedSession:{id:i,path:``,cwd:t.cwd,entries:a,bytes:0,truncation:{truncated:t.truncated,entriesOmitted:t.omittedEntries,messagePartsOmitted:0,messagesTruncated:0,maxBytes:65536}},selectedExecution:{sessionId:i,sessionPath:``,status:d?`running`:t.status===`unknown`?`unknown`:`idle`,liveTools:f,liveToolsOmitted:0},truncation:{truncated:!1,sessionsOmitted:0,workspacesOmitted:0,modelsOmitted:0,maxBytes:0,bytes:0}}}function kq({sessionId:e,sessionPath:t,id:n,kind:r=`subagents`,activity:i,client:a,saved:o,liveAvailable:s,fullView:c,readOnlyNote:l=!0,active:u=!0,refreshRevision:d=0,onDetail:f,showModel:p=!0}){let{t:m}=W(),[h,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(null),[y,b]=(0,K.useState)(!0),[x,S]=(0,K.useState)(0),[C,w]=(0,K.useState)(null),T=nu(WG,e=>e.snapshot?.preferences),E=(0,K.useMemo)(()=>h?Oq(e,h,T??{theme:`system`},m(`subagentThinkingRedacted`)):null,[e,h,T,m]),D=(0,K.useRef)(f);D.current=f,(0,K.useEffect)(()=>{if(!u)return;if(!s){b(!1),v(m(`subagentUnavailable`));return}let o=new AbortController,c,l=!1,d=async()=>{if(l||o.signal.aborted||document.visibilityState===`hidden`)return;l=!0;let s=i?.status===`running`;try{let i=await(r===`workflows`?a.workflowAgentDetail(e,n,o.signal,...t?[t]:[]):a.subagentDetail(e,n,o.signal,...t?[t]:[]));if(o.signal.aborted)return;if(i.sessionId!==e||i.detail.kind!==r||i.detail.id!==n)throw g(null),s=!1,Error(m(`inspectionChanged`));s=i.detail.status===`running`,g(i.detail),D.current?.(i.detail),v(null),w(new Date().toLocaleTimeString())}catch(e){if(o.signal.aborted)return;v(e instanceof ge&&[404,501].includes(e.status)?m(`subagentUnavailable`):e instanceof Error?e.message:m(`inspectionUnavailable`))}finally{l=!1,o.signal.aborted||(b(!1),s&&(c=setTimeout(()=>void d(),1e3)))}},f=()=>{document.visibilityState===`visible`&&(clearTimeout(c),d())};return document.addEventListener(`visibilitychange`,f),d(),()=>{o.abort(),clearTimeout(c),document.removeEventListener(`visibilitychange`,f)}},[u,a,e,t,n,r,i?.status,x,d,s,m]);let O=h?.outcome===`interrupted`?`interrupted`:h?.status===`unknown`?void 0:h?.status,k=cG(h?.spend),A=c?`h2`:`h3`;return(0,q.jsxs)(`section`,{className:`subagent-detail`,"aria-label":m(`subagentDetails`),hidden:!u,children:[(0,q.jsxs)(`header`,{className:`subagent-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`subagent-state ${O??`unknown`}`,children:O?m(`subagentState_${O}`):!h&&o?.state?`${m(`subagentRecordedState`)}: ${m(`subagentState_${o.state}`)}`:m(`unknownState`)}),h&&(h.status===`running`||h.settledAt!==void 0)&&(0,q.jsx)(`span`,{className:`subagent-duration`,children:VD(h.createdAt,h.settledAt)})]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":m(`refreshStatus`),disabled:y||!s,onClick:()=>{b(!0),S(e=>e+1)},children:(0,q.jsx)(me,{})})]}),y&&!h&&(0,q.jsxs)(`div`,{className:`inspection-loading`,role:`status`,children:[(0,q.jsx)(`p`,{children:m(`inspectionLoading`)}),(0,q.jsxs)(`div`,{"aria-hidden":`true`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]})]}),_&&(0,q.jsxs)(`div`,{className:`inspection-warning`,role:`alert`,children:[(0,q.jsx)(`p`,{children:m(h?`subagentStale`:`subagentUnavailable`)}),_!==m(`subagentUnavailable`)&&(0,q.jsx)(`small`,{children:_})]}),h&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`subagent-metadata`,children:[(0,q.jsx)(`code`,{children:h.id}),p&&h.model&&(0,q.jsx)(`span`,{children:h.model}),k&&(0,q.jsx)(`span`,{title:m(`subagentSpend`),children:k}),(0,q.jsx)(`span`,{title:h.cwd,children:h.cwd})]}),(0,q.jsxs)(`details`,{className:`subagent-task`,children:[(0,q.jsx)(`summary`,{children:m(`subagentTask`)}),(0,q.jsx)(`pre`,{children:h.prompt})]}),h.errorText&&(0,q.jsx)(`p`,{className:`inspection-warning`,role:`alert`,children:h.errorText}),(0,q.jsx)(`div`,{className:`subagent-conversation`,children:(0,q.jsx)($E.Provider,{value:null,children:E&&(0,q.jsx)(Dq,{snapshot:E,label:m(`subagentTranscript`),activityObserved:u&&!_,liveMessages:[],liveRunning:h.status===`running`,livePhase:h.status===`running`?`running`:`idle`,liveRetry:null,thinkingStarts:{},thinkingDurations:{},scrollToBottom:0,notice:(0,q.jsxs)(q.Fragment,{children:[h.truncated&&(0,q.jsx)(`p`,{className:`inspection-note`,children:m(h.omittedEntries>0?`subagentTruncated`:`subagentTextTruncated`,{count:h.omittedEntries})}),h.kind===`workflows`&&h.transcriptUnavailable?(0,q.jsx)(`p`,{className:`inspection-note`,children:m(`subagentTranscriptUnavailable`)}):!h.transcript.length&&!h.liveAssistant?.text&&!h.liveAssistant?.thinking&&!h.liveTools.length&&!h.finalText?(0,q.jsx)(`p`,{className:`inspection-note`,children:m(`subagentNoMessages`)}):null]})})})}),(l||C)&&(0,q.jsxs)(`p`,{className:`subagent-footnote`,children:[l&&m(`subagentReadOnly`),l&&C&&` · `,C]})]}),!h&&!y&&o&&(0,q.jsxs)(`section`,{className:`subagent-transcript`,"aria-label":m(`subagentSaved`),children:[(0,q.jsx)(A,{children:m(`subagentSaved`)}),(0,q.jsx)(`p`,{className:`inspection-note`,children:m(`subagentSavedHint`)}),o.state&&(0,q.jsxs)(`p`,{children:[m(`subagentRecordedState`),`: `,m(`subagentState_${o.state}`)]}),o.result&&(0,q.jsx)(vD,{children:o.result}),o.receipt&&(0,q.jsxs)(`details`,{className:`subagent-task`,children:[(0,q.jsx)(`summary`,{children:m(`subagentSpawnReceipt`)}),(0,q.jsx)(`pre`,{children:o.receipt})]})]})]})}function Aq({sessionId:e,sessionPath:t,initialId:n,initialKind:r=`subagents`,activity:i,workflows:a,observed:o=!0,records:s=[],liveAvailable:c=!0,onClose:l}){let{t:u,i18n:d}=W(),[f,p]=(0,K.useState)([]),m=(0,K.useRef)(null),h=(0,K.useRef)(0),[g,_]=(0,K.useState)(n?{id:n,kind:r}:null),[v,y]=(0,K.useState)(g),[b,x]=(0,K.useState)(null),S=g?.id;(0,K.useLayoutEffect)(()=>{!S&&m.current&&(m.current.scrollTop=h.current)},[S]);let C=(e,t=`subagents`)=>{let n=e?{id:e,kind:t}:null;n&&y(n),_(n)},[w,T]=(0,K.useState)(()=>window.matchMedia?.(`(max-width: 1100px)`).matches??!1);(0,K.useEffect)(()=>{let e=window.matchMedia?.(`(max-width: 1100px)`);if(!e)return;let t=()=>T(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let E=(0,K.useMemo)(()=>new de,[]),D=c?i?.items??[]:[],O=c?a?.items??[]:[],k=KD(D,s,O,o),[A,j]=(0,K.useState)(Date.now),M=k.some(e=>e.state===`running`);(0,K.useEffect)(()=>{if(!M||S)return;j(Date.now());let e=setInterval(()=>j(Date.now()),1e3);return()=>clearInterval(e)},[M,S]);let N=(i?.omitted??0)+O.reduce((e,t)=>e+(t.children?.omitted??0),0),P=k.find(e=>e.id===S&&e.kind===g?.kind),F=g?.kind===`subagents`?s.find(e=>e.id===S):void 0,I=b?.id===S&&b?.kind===g?.kind?b?.model:F?.model,ee=(0,K.useRef)(null),L=(0,K.useRef)(document.activeElement);(0,K.useEffect)(()=>{ee.current?.focus()},[g]),(0,K.useEffect)(()=>()=>{queueMicrotask(()=>{!document.querySelector(`.subagent-panel`)&&L.current instanceof HTMLElement&&L.current.isConnected&&L.current.focus()})},[]);let R=[{key:`active`,label:`subagentActiveGroup`,items:k.filter(e=>e.state===`running`),empty:`subagentNoneRunning`},{key:`done`,label:`subagentFinishedGroup`,items:k.filter(e=>e.state===`done`),empty:`subagentNoneFinished`},{key:`attention`,label:`subagentOtherGroup`,items:k.filter(e=>e.state===`error`||e.state===`interrupted`)},{key:`saved`,label:`subagentUnconfirmedGroup`,items:k.filter(e=>!e.state)}],te=e=>{let t=Math.max(0,Date.now()-e),n=t<36e5?`minute`:t<864e5?`hour`:`day`,r=n===`minute`?6e4:n===`hour`?36e5:864e5;return new Intl.RelativeTimeFormat(d.language,{numeric:`auto`}).format(-Math.floor(t/r),n)},z=w?`main`:`aside`,B=w?`h1`:`h2`,ne=w?`h2`:`h3`;return(0,q.jsxs)(z,{className:`subagent-panel`,"aria-label":u(`subagentDetails`),onKeyDown:e=>{e.key===`Escape`&&!e.nativeEvent.isComposing&&!e.defaultPrevented&&(e.preventDefault(),S?C(null):l())},children:[(0,q.jsxs)(`header`,{className:`subagent-panel-heading`,children:[(0,q.jsxs)(`div`,{className:`subagent-breadcrumb`,children:[S&&(0,q.jsx)(`button`,{ref:ee,type:`button`,className:`icon-button`,"aria-label":u(`backToSubagents`),onClick:()=>C(null),children:(0,q.jsx)(Ko,{})}),S?(0,q.jsx)($W,{identity:`${e}:${S}`}):(0,q.jsx)($o,{"aria-hidden":`true`}),(0,q.jsx)(B,{title:P?.title||F?.title||S,children:S?P?.title||F?.title||S:u(`subagentDetails`)})]}),S&&I&&(0,q.jsx)(`span`,{className:`subagent-panel-model`,title:I,children:I.split(`/`).at(-1)}),(0,q.jsx)(`button`,{ref:S?void 0:ee,type:`button`,className:`icon-button`,"aria-label":u(`close`),onClick:l,children:(0,q.jsx)(je,{})})]}),v&&(0,q.jsx)(kq,{sessionId:e,sessionPath:t,id:v.id,kind:v.kind,activity:v.kind===`subagents`?D.find(e=>e.id===v.id):O.flatMap(e=>e.children?.items??[]).find(e=>e.id===v.id),client:E,saved:v.kind===`subagents`?s.find(e=>e.id===v.id):void 0,liveAvailable:c,fullView:w,showModel:!1,active:!!S,onDetail:e=>x(t=>t?.id===e.id&&t.kind===e.kind&&t.model===e.model?t:{id:e.id,kind:e.kind,model:e.model})},`${e}:${v.kind}:${v.id}`),!S&&(0,q.jsxs)(`nav`,{className:`subagent-list`,"aria-label":u(`subagentTasks`),ref:m,onScroll:e=>{h.current=e.currentTarget.scrollTop},children:[R.map(t=>{if(!t.items.length&&!t.empty)return null;let n=f.includes(t.key)?t.items:t.items.slice(0,t.key===`active`?4:10);return(0,q.jsxs)(`section`,{className:`subagent-list-group`,children:[(0,q.jsxs)(ne,{children:[u(t.label),(0,q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,q.jsx)(`span`,{children:t.items.length})]}),!t.items.length&&t.empty&&(0,q.jsx)(`p`,{children:u(t.empty)}),(0,q.jsx)(`ul`,{className:`subagent-task-list`,children:n.map(t=>{let n=t.state??`unknown`,r=u(`subagentState_${n}`),i=t.state===`running`?t.taskPreview||u(`subagentProcessing`):t.state===`done`?void 0:r;return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,className:`subagent-task-row ${n}`,"aria-label":`${t.title||t.id} · ${r}${t.taskPreview&&i?` · ${i}`:``}`,onClick:()=>C(t.id,t.kind),children:[(0,q.jsx)($W,{identity:`${e}:${t.id}`}),(n===`running`||n===`done`)&&(0,q.jsx)(`span`,{className:`subagent-task-status`,children:r}),(0,q.jsx)(`span`,{className:`subagent-task-title`,title:t.title||t.id,children:t.title||t.id}),t.state===`running`?(0,q.jsx)(`span`,{className:`subagent-task-end`,children:VD(t.createdAt,A)}):t.timestamp?(0,q.jsx)(`time`,{className:`subagent-task-end`,dateTime:new Date(t.timestamp).toISOString(),title:new Date(t.timestamp).toLocaleString(d.language),children:te(t.timestamp)}):null,i&&(0,q.jsx)(`span`,{className:`subagent-task-description`,children:i})]})},`${t.kind}:${t.id}`)})}),n.lengthp(e=>[...e,t.key]),children:u(`subagentShowMore`,{count:t.items.length-n.length})})]},t.key)}),N>0&&(0,q.jsx)(`p`,{children:u(`subagentListTruncated`,{count:N})}),!!a?.omitted&&(0,q.jsx)(`p`,{children:u(`subagentWorkflowsTruncated`,{count:a?.omitted})})]})]})}var jq=`openpi:subagent-panel:v1`;function Mq(){try{let e=JSON.parse(sessionStorage.getItem(jq)??`null`);if(!e||typeof e!=`object`)return null;let{sessionId:t,sessionPath:n}=e;return typeof t!=`string`||!t||t.length>160||typeof n!=`string`||!n||n.length>4096?null:{sessionId:t,sessionPath:n,navigation:0}}catch{return null}}function Nq(e){try{e?sessionStorage.setItem(jq,JSON.stringify({sessionId:e.sessionId,sessionPath:e.sessionPath})):sessionStorage.removeItem(jq)}catch{}}function Pq({text:e,code:t=!1}){let{t:n}=W(),[r,i]=(0,K.useState)(!0),[a,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(``);return(0,K.useEffect)(()=>{let n=!1;return c(``),o(!1),t&&e.length<=1e5&&Ee(async()=>{let{default:e}=await import(`./app-common.js`);return{default:e}},__vite__mapDeps([3,1])).then(({default:t})=>{let r=t.highlight(e,{language:`javascript`,ignoreIllegals:!0}).value;n||c(Me.sanitize(r,{ALLOWED_TAGS:[`span`],ALLOWED_ATTR:[`class`]}))}).catch(()=>{}),()=>{n=!0}},[t,e]),(0,q.jsxs)(`div`,{className:`trajectory-payload`,"data-wrap":r,children:[(0,q.jsxs)(`div`,{className:`trajectory-payload-actions`,children:[(0,q.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>i(!r),children:n(`trajectoryWrap`)}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{td(e).then(o)},children:n(a?`trajectoryCopied`:`trajectoryCopy`)})]}),(0,q.jsx)(`pre`,{children:s?(0,q.jsx)(`code`,{dangerouslySetInnerHTML:{__html:s}}):(0,q.jsx)(`code`,{children:e})})]})}function Fq(e){return e.map((e,t)=>({key:e.key,start:t,end:t+1,lane:e.kind===`call`||e.kind===`result`?2:+(e.kind===`assistant`),error:e.outcome===`error`||e.kind===`assistant`&&(e.message?.stopReason===`error`||e.message?.stopReason===`aborted`)}))}function Iq(e,t){return t===null?null:new Set(Fq(e).filter(e=>e.start<=t.end&&e.end>=t.start).map(e=>e.key))}function Lq(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&(n.kind!==`event`||n.message||n.input!==void 0||n.result))return n}return e.at(-1)}function Rq(e){let t=[];for(let n of e){(n.kind===`user`||!t.length)&&t.push({key:n.key,...n.kind===`user`?{prompt:n}:{},runs:[]});let e=t.at(-1),r=e.runs.at(-1);n.kind===`event`&&r?.[0]?.kind===`event`?r.push(n):e.runs.push([n])}return t}function zq(e){let t=new Map(e.map((e,t)=>[e.id,t])),n=new Map,r=new Map,i=new Map;for(let a of e){let e=`message`in a?a.message:void 0;for(let t of e?.parts??[])t.type===`toolCall`&&t.id&&r.set(t.id,(r.get(t.id)??0)+1);if(e?.role===`toolResult`&&e.toolCallId){let r=i.get(e.toolCallId)??[];r.push(e),n.set(e,t.get(a.id)??-1),i.set(e.toolCallId,r)}}let a=new Set,o=[];for(let s of e){let e=`message`in s?s.message:void 0;if(!e){o.push({key:s.id,kind:`event`,title:s.type,timestamp:s.timestamp});continue}if(e.role!==`toolResult`){(e.role!==`assistant`||e.content||!e.parts?.length||e.parts?.some(e=>e.type!==`toolCall`))&&o.push({key:s.id,kind:e.role===`user`?`user`:e.role===`assistant`?`assistant`:`event`,title:e.customType||e.role||s.type,timestamp:s.timestamp,message:e});for(let[c,l]of(e.parts??[]).entries()){if(l.type!==`toolCall`)continue;let u=l.id?i.get(l.id):void 0,d=l.id&&r.get(l.id)===1&&u?.length===1&&u[0]?.toolName===l.name&&!l.id.includes(`[truncated]`)&&(n.get(u[0])??-1)>(t.get(s.id)??-1)?u[0]:void 0;d&&a.add(d),o.push({key:`${s.id}:call:${c}`,kind:`call`,title:l.name,timestamp:s.timestamp,callId:l.id,input:l.arguments,message:e,result:d,outcome:d?.isError===!0?`error`:d?.isError===!1?`returned`:`unknown`})}}}let s=new Map(o.map(e=>[e.key,t.get(e.key)??-1]));for(let n of e){let e=`message`in n?n.message:void 0;e?.role===`toolResult`&&!a.has(e)&&(o.push({key:n.id,kind:`result`,title:e.toolName||`toolResult`,timestamp:n.timestamp,callId:e.toolCallId,result:e,outcome:e.isError===!0?`error`:e.isError===!1?`returned`:`unknown`}),s.set(n.id,t.get(n.id)??0));for(let[r,i]of(e?.parts??[]).entries())i.type===`toolCall`&&s.set(`${n.id}:call:${r}`,t.get(n.id)??0)}return o.sort((e,t)=>(s.get(e.key)??0)-(s.get(t.key)??0)),o}function Bq(e,t=[]){let n=zq(e),r=new Set(n.map(e=>e.key)),i=e.flatMap(e=>e.message?.role===`assistant`&&!r.has(e.id)?[{key:e.id,kind:`assistant`,title:`assistant`,timestamp:e.timestamp,message:e.message}]:[]),a=new Map(e.map((e,t)=>[e.id,t])),o=new Map,s=new Map;for(let t of e)for(let[e,n]of(t.message?.parts??[]).entries())n.type===`toolCall`&&(o.set(`${t.id}:call:${e}`,t.id),n.id&&s.set(n.id,(s.get(n.id)??0)+1));return[...n,...i].sort((e,t)=>{let n=e=>a.get(o.get(e.key)??e.key)??-1;return n(e)-n(t)||Number(e.kind===`call`)-Number(t.kind===`call`)}).flatMap(e=>{if(e.kind!==`call`||e.title!==`codemode`)return[e];let n=e.message?.parts?.find(t=>t.type===`toolCall`&&t.id===e.callId);return n?.type!==`toolCall`||!n.id||s.get(n.id)!==1?[e]:[e,...($G(n,e.result,t)?.children??[]).map(t=>{let n=e.result?.nestedCalls?.calls.find(e=>e.call.id===t.call.id)?.durationMs;return{key:`${e.key}:nested:${t.call.id}`,kind:`call`,title:t.call.name,parentKey:e.key,callId:t.call.id,input:t.call.arguments,result:t.result,missingOutput:t.outputMissing,error:t.error,state:t.state,outcome:t.state===`returned`?`returned`:[`failed`,`cancelled`,`timed_out`].includes(t.state)?`error`:`unknown`,...n===void 0?{}:{durationMs:n}}})]})}function Vq(e){return e===void 0||!Number.isFinite(e)?`—`:e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(2)} s`}function Hq({nodes:e,selectedKey:t,range:n,onSelect:r,onRange:i}){let{t:a}=W(),o=Fq(e),s=(0,K.useRef)(null),c=Math.max(1,o.length);function l(e){let t=e.currentTarget.getBoundingClientRect();return Math.max(0,Math.min(c,(e.clientX-t.left)/Math.max(1,t.width)*c))}return(0,q.jsx)(`section`,{className:`trajectory-overview`,"aria-label":a(`trajectoryOverview`),children:(0,q.jsxs)(`div`,{className:`trajectory-overview-track`,children:[(0,q.jsxs)(`div`,{className:`trajectory-lane-labels`,children:[(0,q.jsx)(`span`,{children:a(`trajectoryContextLane`)}),(0,q.jsx)(`span`,{children:a(`trajectoryModelLane`)}),(0,q.jsx)(`span`,{children:a(`trajectoryToolLane`)})]}),(0,q.jsxs)(`svg`,{viewBox:`0 0 ${c} 3`,preserveAspectRatio:`none`,onPointerDown:e=>{e.button===0&&(s.current={start:l(e),key:e.target.getAttribute(`data-record-key`)},e.currentTarget.setPointerCapture(e.pointerId))},onPointerUp:e=>{let t=s.current;if(s.current=null,t===null)return;let n=t.start,a=l(e);Math.abs(a-n)>c/100?i({start:Math.min(n,a),end:Math.max(n,a)}):t.key&&r(t.key)},onPointerCancel:()=>{s.current=null},children:[(0,q.jsx)(`title`,{children:a(`trajectoryOverview`)}),[0,1,2].map(e=>(0,q.jsx)(`line`,{x1:`0`,x2:c,y1:e+.5,y2:e+.5},e)),o.map((n,i)=>(0,q.jsx)(`rect`,{x:n.start+.08,y:n.lane+.39,width:.84,height:.22,rx:.04,className:`${n.error?`error`:``} ${t===n.key?`selected`:``}`,"data-lane":n.lane,"data-kind":e[i].kind,"data-record-key":n.key,role:`button`,tabIndex:0,"aria-label":a(`trajectorySelectRecord`,{number:i+1,name:e[i].title}),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r(n.key))},children:(0,q.jsx)(`title`,{children:`${i+1} · ${e[i].title} · ${Vq(e[i].durationMs)}`})},n.key)),n&&(0,q.jsx)(`rect`,{className:`trajectory-range`,x:n.start,y:`0`,width:n.end-n.start,height:`3`})]}),n&&(0,q.jsx)(`button`,{type:`button`,className:`trajectory-clear-range`,onClick:()=>i(null),children:a(`trajectoryClearRange`)})]})})}var Uq=[];function Wq(e){return e.kind===`call`||e.kind===`result`?``:(e.message?.parts??[]).filter(e=>e.type===`thinking`).map(e=>e.text).join(` +`]},e.number))}):(0,q.jsx)(bK,{className:`evidence-log`,"aria-label":`Tool output`,children:d.output||s(`noOutput`)}),d.kind===`file`&&d.truncated&&(0,q.jsx)(`p`,{children:s(`toolReadMore`)}),d.recovery&&(0,q.jsxs)(`p`,{children:[s(`toolFullOutputReference`),` `,(0,q.jsx)(`code`,{children:d.recovery})]}),d.readRecovery&&(0,q.jsx)(`p`,{className:`evidence-warning`,children:d.readRecovery}),(0,q.jsxs)(`details`,{children:[(0,q.jsx)(`summary`,{children:s(`toolRawEvidence`)}),(0,q.jsx)(`p`,{children:(0,q.jsx)(`code`,{children:e.name})}),(0,q.jsx)(`p`,{children:(0,q.jsx)(`strong`,{children:s(`toolCallArguments`)})}),(0,q.jsx)(`pre`,{children:d.rawArguments}),(0,q.jsx)(`p`,{children:(0,q.jsx)(`strong`,{children:s(`toolCallOutput`)})}),(0,q.jsx)(`pre`,{children:d.rawResult})]}),o]})]})}function SK({changes:e,onReview:t}){let{t:n}=W(),[r,i]=(0,K.useState)(!1),a=(0,K.useId)();if(e.state===`unavailable`||e.files.length===0)return null;let o=e.state===`partial`,s=e.source===`file-tools`,c=e.fileCount===null;return(0,q.jsxs)(`section`,{className:`turn-changes`,"aria-label":n(`turnChangesReview`),children:[(0,q.jsxs)(`header`,{className:`turn-changes-header`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`turn-changes-summary`,"aria-expanded":r,"aria-controls":a,onClick:()=>i(e=>!e),children:[(0,q.jsx)(Ms,{className:`turn-changes-icon`,"aria-hidden":`true`}),(0,q.jsx)(`strong`,{title:n(s?`turnEditsScope`:`turnChangesScope`),children:n(s?c?`turnEditsPartial`:`turnEdits`:o?`turnChangesPartial`:`turnChanges`,{count:e.fileCount??e.files.length})}),!c&&!e.files.some(e=>e.binary||e.statsUnavailable)&&(0,q.jsxs)(`span`,{className:`turn-changes-totals`,children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,e.additions]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,e.deletions]})]}),o&&!s&&(0,q.jsx)(`span`,{className:`turn-changes-warning`,children:n(`turnChangesIncomplete`)}),(0,q.jsx)(is,{className:r?`up`:``,"aria-hidden":`true`})]}),(0,q.jsx)(`button`,{type:`button`,className:`turn-changes-review-button`,"aria-label":n(`turnChangesReview`),disabled:!t,onClick:()=>t?.(e.promptEntryId,e.files[0]?.path),children:n(`reviewChanges`)})]}),(0,q.jsx)(`div`,{className:`turn-changes-list`,id:a,hidden:!r,children:e.files.map(r=>{let i=Math.max(r.path.lastIndexOf(`/`),r.path.lastIndexOf(`\\`));return(0,q.jsxs)(`button`,{type:`button`,className:`turn-changes-file`,title:r.path,"aria-label":r.path,disabled:!t,onClick:()=>t?.(e.promptEntryId,r.path),children:[(0,q.jsxs)(`span`,{className:`turn-changes-path`,children:[(0,q.jsx)(`strong`,{children:r.path.slice(i+1)}),i>=0&&(0,q.jsx)(`span`,{children:r.path.slice(0,i)})]}),(0,q.jsx)(`span`,{className:`turn-changes-file-stats`,children:r.binary?(0,q.jsx)(`span`,{children:n(`gitReviewBinaryShort`)}):r.statsUnavailable?(0,q.jsx)(`span`,{title:n(`turnEditReason_${r.statsUnavailable}`),children:n(`turnEditStatsUnknown`)}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,r.additions]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,r.deletions]})]})})]},r.path)})})]})}function CK({item:e,position:t,current:n,onNavigate:r,onPreview:i}){let{t:a}=W(),o=(0,K.useRef)(()=>{}),s=ed({placement:`start`,delay:150,hideDelay:100,touchTrigger:`none`,onShow:(0,K.useCallback)(()=>i(e.entryId,()=>o.current()),[e.entryId,i])});return o.current=s.hide,(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{ref:s.ref,className:`turn-tick`,type:`button`,"data-turn-entry":e.entryId,"aria-label":a(`conversationTurnPosition`,{position:t}),"aria-describedby":s.describedBy,"aria-current":n?`location`:void 0,onClick:()=>{s.hide(),r(e.entryId)},children:(0,q.jsx)(`span`,{className:`turn-tick-mark`,"aria-hidden":`true`})}),s.renderHoverCard((0,q.jsx)(`span`,{className:`turn-preview`,children:e.previewState===`idle`||e.previewState===`loading`?(0,q.jsx)(`span`,{role:`status`,children:a(`turnPreviewLoading`)}):e.previewState===`unavailable`?(0,q.jsx)(`span`,{role:`status`,children:a(`turnPreviewUnavailable`)}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`turn-preview-prompt`,children:e.title}),e.reply&&(0,q.jsx)(`span`,{className:`turn-preview-reply`,children:e.reply})]})}),{className:`turn-preview-layer`})]})}function wK({items:e,viewport:t,onNavigate:n,readingHistory:r,onRequestPreview:i,enabled:a=!0,onHidden:o}){let{t:s}=W(),c=(0,K.useRef)(null),l=JSON.stringify(e.map(e=>e.entryId)),u=(0,K.useRef)(null),d=(0,K.useRef)(null),f=(0,K.useRef)(!1),p=(0,K.useRef)(0),[m,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)({top:0,height:0,visible:!1,current:[]}),v=(0,K.useCallback)(()=>{u.current?.hide(),u.current=null,d.current&&d.current.captureTarget.hasPointerCapture?.(d.current.pointerId)&&d.current.captureTarget.releasePointerCapture(d.current.pointerId),d.current=null,p.current++,o?.()},[o]),y=(0,K.useCallback)((e,n)=>{if(!a||!t.current||!c.current||c.current.style.visibility===`hidden`||t.current.checkVisibility?.()===!1||c.current.checkVisibility?.()===!1||getComputedStyle(t.current).display===`none`||getComputedStyle(c.current).display===`none`){n();return}u.current?.entryId!==e&&u.current?.hide(),u.current={entryId:e,hide:n},i?.(e)},[a,t,i]),b=(0,K.useCallback)((e,t=!1)=>{u.current?.hide();let r=++p.current;h(!1),Promise.resolve(n(e,t)).then(e=>{p.current===r&&e===!1&&h(!0)})},[n]);return(0,K.useLayoutEffect)(()=>{let e=t.current,n=e?.parentElement,i=JSON.parse(l);if(!e||!n){v();return}let o,s=r?n.querySelector(`.jump-to-latest`):null,u=()=>{o=void 0;let t=e.getBoundingClientRect(),r=n.getBoundingClientRect(),l=new Map;for(let t of e.querySelectorAll(`[data-history-entry]`)){let e=t.dataset.historyEntry;e&&!l.has(e)&&l.set(e,t)}let u=e.querySelector(`.conversation-turn`)??l.values().next().value,d=e.offsetWidth>0?t.width/e.offsetWidth:1,f=a&&t.height>0&&d>0&&!!u&&(t.right-u.getBoundingClientRect().right)/d>=48&&e.checkVisibility?.()!==!1&&getComputedStyle(e).display!==`none`&&(!c.current||getComputedStyle(c.current).display!==`none`);f||v();let p=s?.getBoundingClientRect(),m=Math.min(t.bottom-8,p&&p.height>0?p.top-12:1/0),h=Math.max(0,m-t.top-8),g=i.flatMap(e=>{let n=l.get(e);if(!n)return[];let r=(n.closest(`.conversation-turn`)??n).getBoundingClientRect();return r.bottom>t.top+16&&r.tope.top===y.top&&e.height===y.height&&e.visible===f&&e.current.join(`\0`)===g.join(`\0`)?e:y)},d=()=>{o===void 0&&(o=requestAnimationFrame(u))};u(),e.addEventListener(`scroll`,d),window.addEventListener(`resize`,d);let f=typeof ResizeObserver>`u`?void 0:new ResizeObserver(d);f?.observe(e),f?.observe(n),s&&f?.observe(s);for(let t of e.children)f?.observe(t);let p=new MutationObserver(d);return p.observe(e,{childList:!0,subtree:!0}),()=>{o!==void 0&&cancelAnimationFrame(o),e.removeEventListener(`scroll`,d),window.removeEventListener(`resize`,d),f?.disconnect(),p.disconnect()}},[l,t,r,a,v]),(0,K.useLayoutEffect)(()=>{if(g.height,!g.visible||d.current)return;let e=c.current,t=Array.from(e?.querySelectorAll(`[data-turn-entry]`)??[]),n=t.find(e=>e===document.activeElement)??t.find(e=>e.matches(`:hover`))??t.find(e=>g.current.includes(e.dataset.turnEntry??``));if(!e||!n)return;let r=e.getBoundingClientRect(),i=n.getBoundingClientRect();i.topr.bottom&&(e.scrollTop+=i.bottom-r.bottom)},[g.current,g.height,g.visible,l]),(0,K.useLayoutEffect)(()=>{let n=t.current;if(!n)return;let r=t=>{if(!a||t.defaultPrevented||t.isComposing||!t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||![`ArrowUp`,`ArrowDown`].includes(t.key)||!n.parentElement?.contains(document.activeElement)||n.checkVisibility?.()===!1||getComputedStyle(n).display===`none`||getComputedStyle(n).visibility===`hidden`||n.getBoundingClientRect().height<=0)return;let r=new Map;for(let e of n.querySelectorAll(`[data-history-entry]`)){let t=e.dataset.historyEntry;t&&!r.has(t)&&r.set(t,e)}let i=e.flatMap((e,t)=>{let n=r.get(e.entryId);return n?[{item:e,index:t,top:n.getBoundingClientRect().top}]:[]}),o=n.getBoundingClientRect().top,s;if(t.key===`ArrowDown`){let t=i.findIndex(e=>e.top>o+24);s=i.length===0?e[0]:t<0?e[i.at(-1).index+1]:e[(i[t-1]?.index??-1)+1]}else{for(let t=i.length-1;t>=0;t--){let n=i[t];if(Math.abs(n.top-o)<=24){s=e[n.index-1];break}if(n.tope.top>o+24)&&(s=i[0]?.item),i.length===0&&(s=e.at(-1))}s&&(t.preventDefault(),b(s.entryId))};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[t,a,e,b]),(0,K.useLayoutEffect)(()=>()=>v(),[v]),e.length<4?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`nav`,{ref:c,className:`turn-rail`,"aria-label":s(`conversationTurns`),style:{top:g.top,maxHeight:g.height,visibility:g.visible?`visible`:`hidden`},onClickCapture:e=>{f.current&&=(e.preventDefault(),e.stopPropagation(),!1)},onPointerDown:e=>{if(!e.isPrimary||e.button!==0)return;let t=e.target instanceof Element?e.target.closest(`.turn-tick`):null;!t||!e.currentTarget.contains(t)||(f.current=!1,d.current={pointerId:e.pointerId,captureTarget:t,y:e.clientY,moved:!1},t.setPointerCapture?.(e.pointerId))},onPointerMove:e=>{let t=d.current;if(!t||t.pointerId!==e.pointerId||Math.abs(e.clientY-t.y)<3&&!t.moved)return;t.moved=!0,f.current=!0;let n=Array.from(e.currentTarget.querySelectorAll(`[data-turn-entry]`)).find(t=>{let n=t.getBoundingClientRect();return e.clientY>=n.top&&e.clientY{let t=d.current;d.current=null,t?.captureTarget.hasPointerCapture?.(e.pointerId)&&t.captureTarget.releasePointerCapture(e.pointerId)},onPointerCancel:e=>{let t=d.current;d.current=null,t?.captureTarget.hasPointerCapture?.(e.pointerId)&&t.captureTarget.releasePointerCapture(e.pointerId),f.current=!1},children:e.map((e,t)=>(0,q.jsx)(CK,{item:e,position:t+1,current:g.current.includes(e.entryId),onNavigate:b,onPreview:y},e.entryId))}),m&&(0,q.jsx)(`span`,{className:`turn-navigation-error`,role:`status`,children:s(`turnPreviewUnavailable`)})]})}function TK(e){if(e.role!==`custom`||e.customType!==`openpi-setup-request`||e.truncation?.details)return e;let t=e.details;return!t||typeof t!=`object`||Array.isArray(t)||!(`command`in t)||t.command!==`openpi-setup`&&t.command!==`my-pi-setup`||!(`request`in t)||typeof t.request!=`string`?e:{...e,role:`user`,content:`/${t.command}${t.request?` ${t.request}`:``}`,parts:void 0}}function EK(e,t){let n=e.parentId,r=new Set;for(let e=0;n&&e<32;e++){if(r.has(n))return;r.add(n);let e=t(n);if(!e||e.id!==n)return;if(e.message?.role!==`system`)return e.message;n=e.parentId}}function DK(e,t){let n=TK(e);return e.customType===`openpi-setup-request`&&n.role===`user`&&t?.role===`user`&&t.customType===`openpi-web-command-input`&&typeof t.commandId==`string`&&t.commandId.length>0&&t.commandId.length<=128&&!/[\u0000-\u001f\u007f]/u.test(t.commandId)&&t.content===n.content}function OK(e){if(e.role===`toolResult`&&e.toolCallId&&!e.toolCallId.includes(`[truncated]`))return`tool-result-${e.toolCallId}`;if(e.role!==`assistant`||e.truncation?.partsOmitted)return;let t=e.parts?.filter(e=>e.type===`toolCall`);if(!(!t?.length||t.some(e=>!e.id||e.id.includes(`[truncated]`))))return`tool-calls-${JSON.stringify(t.map(e=>e.id))}`}function kK(e){let t=OK(e);if(t)return t;if(e.timestamp!==void 0)return`message-${e.role}-${e.timestamp}`}function AK(e){return[`assistant`,`toolResult`].includes(e.role??``)&&!e.truncation?.truncated?JSON.stringify(e):null}function jK(e){return JSON.stringify([e.role,e.content,(e.parts??[]).filter(t=>e.role!==`user`||t.type!==`text`).map(t=>t.type===`image`?[t.type,t.mimeType,e.role===`user`?void 0:t.name]:t.type),e.stopReason,e.errorMessage,e.toolCallId])}function MK(e){return e.role===`user`?jK(e):JSON.stringify({...e,timestamp:void 0})}function NK(e,t){let n=!1,r=(e,t)=>{if(e===t)return!0;if(!e.endsWith(` +[truncated]`))return!1;let r=e.slice(0,-12);return r.length&&(n=!0),t.startsWith(r)};if(!r(e.content,t.content)||e.parts?.length!==t.parts?.length)return!1;let i=e.parts?.map((e,n)=>{let i=t.parts?.[n];return(e.type===`text`||e.type===`thinking`)&&i?.type===e.type&&r(e.text,i.text)?e.type===`thinking`&&i.type===`thinking`?{...e,text:i.text,textTruncated:i.textTruncated}:{...e,text:i.text}:e});return n&&JSON.stringify({...e,content:t.content,parts:i,truncation:t.truncation,timestamp:void 0})===JSON.stringify({...t,timestamp:void 0})}var PK=new WeakMap;function FK(e,t){let n=PK.get(e),r=n?.get(t);if(r&&r.length===e.length&&r.head===e[0]&&r.tail===e[e.length-1])return r.projection;let i=new Map(e.map(e=>[e.id,e])),a=new Map;for(let t of e){let e=t.message&&AK(t.message);if(!e)continue;let n=a.get(e)??[];n.push(t),a.set(e,n)}let o=e.flatMap(e=>{if(e.forkSnapshotBoundary)return[{key:e.id,entryId:e.id,timestamp:e.timestamp,forkSnapshotBoundary:!0,message:{role:`custom`,content:``}}];if(e.type===`compaction`)return[{key:e.id,entryId:e.id,timestamp:e.timestamp,compaction:!0,message:{role:`custom`,content:``}}];if(`turnTiming`in e&&e.turnTiming&&e.turnTiming.sessionId===t)return[{key:e.id,timestamp:e.timestamp,timing:e.turnTiming,message:{role:`custom`,content:``}}];if(e.type!==`message`||!e.message)return[];let n=TK(e.message),r=EK(e,e=>i.get(e));return DK(e.message,r)?[]:[{key:e.id,entryId:e.id,timestamp:e.timestamp,message:n}]}),s=new Map,c=new Map;o.forEach((e,t)=>{if(e.entryId&&s.set(e.entryId,t),e.timing||e.compaction||e.forkSnapshotBoundary)return;let n=kK(e.message)??e.entryId??e.key,r=c.get(n)??[];r.push(t),c.set(n,r)});let l=[];for(let e of c.values())if(!(e.length<2))for(let t of e){let e=o[t].entryId;e&&l.push(e)}let u=new Map,d=0;for(let t of e){if(t.message?.role!==`custom`||t.message.truncation?.truncated)continue;let e=MK(t.message),n=u.get(e)??[];n.push(d),u.set(e,n),d++}let f=o.map(e=>({identity:kK(e.message),signature:MK(e.message)})),p=new Map,m=new Map;f.forEach((e,t)=>{let n=m.get(e.signature)??[];if(n.push(t),m.set(e.signature,n),e.identity===void 0)return;let r=p.get(e.identity)??[];r.push(t),p.set(e.identity,r)});let h=new Map(e.map((e,t)=>[e.id,t])),g=o.filter(e=>e.message.role===`user`).map(e=>({key:e.entryId??e.key,position:h.get(e.entryId??e.key),parentId:i.get(e.entryId??e.key)?.parentId,signature:jK(e.message)})),_=new Map;for(let e of g){let t=_.get(e.signature)??[];t.push(e),_.set(e.signature,t)}let v={nativeById:i,exactNative:a,baseEntries:o,indexById:s,lookupIndexes:c,ambiguousNativeIds:l,customIndexes:u,nativeByIdentity:p,nativeByLegacySignature:m,nativeMessages:f,promptCandidates:g,promptsBySignature:_,commandInputs:new Map(o.flatMap(e=>e.message.role===`user`&&e.message.customType===`openpi-web-command-input`&&e.message.commandId?[[e.message.commandId,e.entryId??e.key]]:[])),persistedPositions:h};return n||(n=new Map,PK.set(e,n)),n.set(t,{projection:v,length:e.length,head:e[0],tail:e[e.length-1]}),v}function IK(e,t){if(!e)return-1;for(let n of e)if(!t.has(n))return n;return-1}function LK(e,t){let n=[e.timingKey,e.key,e.entryId,e.ambiguousTimingIdentity?void 0:kK(e.message)];for(let e of n){if(!e)continue;let n=t[e];if(n!==void 0)return n}}function RK(e,t,n){let{nativeRowKeys:r,ambiguousTimingIds:i}=n,a=new Set(i),o=n.nativeTimingKeys??=new Map,s=e.selectedSession,c=FK(s?.entries??[],s?.id);for(let e of r.keys())c.nativeById.has(e)||r.delete(e);for(let e of i)c.nativeById.has(e)||i.delete(e);for(let e of o.keys())c.nativeById.has(e)||o.delete(e);let l=new Map;for(let e of t){if(e.optimistic)continue;let t=AK(e.message);if(!t)continue;let n=l.get(t)??[];n.push(e),l.set(t,n)}let u=new Set(r.values());for(let[e,t]of l){let n=c.exactNative.get(e);if(n?.length!==1||t.length!==1)continue;let a=n[0].id,o=t[0].key;r.has(a)||i.has(a)||u.has(o)||c.nativeById.has(o)||(r.set(a,o),u.add(o))}for(let e of c.ambiguousNativeIds)i.add(e);let d=e=>{let t=kK(e);return e.truncation?.transport?(t===void 0?c.baseEntries.map((e,t)=>t):c.nativeByIdentity.get(t)??[]).filter(t=>NK(e,c.baseEntries[t].message)):t===void 0?c.nativeByLegacySignature.get(MK(e))??[]:(c.nativeByIdentity.get(t)??[]).filter(t=>c.nativeMessages[t]?.signature===MK(e))},f=new Map,p=new Set;for(let e of t){let t=kK(e.message)??e.key,n=c.lookupIndexes.get(t)??[],s=d(e.message);if(s.length>1)for(let e of s){let t=c.baseEntries[e].entryId;t&&i.add(t)}if((s.length!==n.length||n.length>1)&&p.add(t),s.length===1){let n=s[0],l=c.baseEntries[n].entryId,u=l?r.get(l)??o.get(l):void 0;if(u&&u!==e.key||l&&i.has(l)&&!(e.message.truncation?.transport&&!a.has(l))&&!u&&e.key!==l){p.add(t),l&&i.add(l);continue}let d=f.get(n);d===void 0||d===e.key?f.set(n,e.key):(f.set(n,null),p.add(t),l&&i.add(l))}}for(let e of p)for(let t of c.lookupIndexes.get(e)??[]){let e=c.baseEntries[t].entryId;e&&i.add(e)}let m=new Set(t.flatMap(e=>e.optimistic?.projectedEntryId?[e.optimistic.projectedEntryId]:[])),h=[],g=[],_=e.selectedExecution?.sessionId===s?.id&&e.selectedExecution?.sessionPath===s?.path?e.selectedExecution:void 0,v=_?.pendingFollowUps??0,y=Math.max(0,t.filter(e=>e.optimistic?.admitted&&!e.optimistic.projectedEntryId&&!c.commandInputs.has(e.optimistic.commandId)).length-v),b=0,x=new Set,S=new Set,C=new Set,w=[];for(let e of t){if(e.optimistic?.projectedEntryId)continue;if(e.message.role===`custom`&&!e.message.truncation?.truncated){let t=MK(e.message),n=IK(c.customIndexes.get(t),S);if(n>=0){S.add(n);continue}}let n=e.optimistic?.commandId??(e.key.startsWith(`optimistic-`)?e.key.slice(11):void 0),r=n?c.commandInputs.get(n):void 0;if(r){e.optimistic&&h.push({key:e.key,entryId:r});continue}let i=TK(e.message);if(i.role===`user`&&e.optimistic){let t=e.optimistic.afterEntryId===null?-1:c.persistedPositions.get(e.optimistic.afterEntryId),n=!e.optimistic.admitted||b>=y?void 0:c.promptsBySignature.get(jK(i))?.find(n=>n.position!==void 0&&(t===void 0?n.parentId===e.optimistic?.afterEntryId:n.position>t)&&!m.has(n.key));if(n){m.add(n.key),h.push({key:e.key,entryId:n.key}),b++;continue}}else{let e=i.role===`user`?t.find(e=>e.optimistic?.admitted&&!e.optimistic.projectedEntryId&&!x.has(e.key)&&!h.some(t=>t.key===e.key)&&e.optimistic.sessionId===s?.id&&e.optimistic.sessionPath===s?.path&&jK(TK(e.message))===jK(i)):void 0;if(e){x.add(e.key);continue}let n=kK(i),r=OK(i),a=MK(i),o=i.truncation?.transport?IK(d(i),C):n===void 0?IK(c.nativeByLegacySignature.get(a),C):(c.nativeByIdentity.get(n)??[]).find(e=>(r!==void 0||!C.has(e))&&(r!==void 0||c.nativeMessages[e]?.signature===a))??-1;if(o>=0){C.add(o);continue}}let a={key:e.key,timingKey:e.key,ambiguousTimingIdentity:p.has(kK(i)??e.key)?!0:void 0,timestamp:e.timestamp??new Date().toISOString(),message:i,optimistic:e.optimistic};i.role===`user`&&e.optimistic?g.push(a):w.push(a)}let T=new Map;for(let e of _?.queuedMessages??[])T.set(e,(T.get(e)??0)+1);let E=g.filter(e=>{if(!e.optimistic?.admitted||e.optimistic.commandId===_?.activeTurn?.commandId)return!0;let t=T.get(e.message.content)??0;return!t||(T.set(e.message.content,t-1),!1)}),D=new Map(t.flatMap(e=>e.optimistic?.projectedEntryId?[[e.optimistic.projectedEntryId,e.key]]:[]));for(let e of h)D.set(e.entryId,e.key);let O=c.baseEntries,k=(e,t)=>{O===c.baseEntries&&(O=c.baseEntries.slice()),O[e]=t};for(let e of i){let t=c.indexById.get(e);if(t===void 0)continue;let n=O[t];!n||n.ambiguousTimingIdentity||k(t,{...n,ambiguousTimingIdentity:!0})}for(let[e,t]of f){if(t===null)continue;let n=O[e];n&&n.entryId&&o.set(n.entryId,t)}for(let[e,t]of o){let n=c.indexById.get(e);if(n===void 0)continue;let r=O[n];!r||r.timingKey===t||k(n,{...r,timingKey:t})}for(let[e,t]of r){let n=c.indexById.get(e);if(n===void 0)continue;let r=O[n];!r||r.key===t||k(n,{...r,key:t})}for(let[e,t]of D){let n=c.indexById.get(e);if(n===void 0)continue;let r=O[n];!r||r.key===t||k(n,{...r,key:t})}return{entries:O.concat(w,E),projectedPrompts:h}}function zK({message:e,sessionId:t,path:n,entryId:r}){let{t:i}=W(),[a,o]=(0,K.useState)(null),s=JSON.stringify([t,n,r]),c=e.parts?.filter(e=>e.type===`image`)??[];if(c.length===0)return null;let l=new Map,u=a?.scope===s?a:null,d=()=>o(e=>e?{...e,open:!1}:null);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`section`,{className:`message-attachments`,"aria-label":i(`imageAttachments`),children:c.map(e=>{let a=`${e.mimeType}:${e.name??``}:${e.previewUrl??``}`,c=l.get(a)??0;l.set(a,c+1);let u=`${a}:${c}`,d=t&&n&&r&&typeof e.sourcePartIndex==`number`&&Number.isSafeInteger(e.sourcePartIndex)&&e.sourcePartIndex>=0?{id:`${r}:${e.sourcePartIndex}`,entryId:r,partIndex:e.sourcePartIndex,kind:`image`,name:e.name??i(`attachedImage`)}:null,f=e.previewUrl?(0,q.jsx)(`img`,{src:e.previewUrl,alt:e.name??i(`attachedImage`)},`preview`):d&&t&&n?(0,q.jsx)(`span`,{className:`message-attachment-preview`,children:(0,q.jsx)(tG,{sessionId:t,path:n,source:d,thumbnail:!0})},`preview`):(0,q.jsx)(qs,{"aria-hidden":`true`},`preview`),p=(0,q.jsx)(`span`,{children:e.name??i(`attachedImage`)},`name`);return d?(0,q.jsxs)(`button`,{className:`message-attachment`,type:`button`,title:d.name,"aria-label":d.name,onClick:()=>o({scope:s,source:d,open:!0}),children:[f,p]},u):(0,q.jsxs)(`div`,{className:`message-attachment`,children:[f,p]},u)})}),t&&n&&u&&(0,q.jsx)(aG,{sessionId:t,path:n,source:u.source,open:u.open,onSelect:d,onClose:d})]})}function BK(e,t,n){let r=(0,K.useMemo)(()=>new de,[]),i=e?.history?.leafEntryId??e?.entries.at(-1)?.id,a=e?.id,o=e?.path,s=JSON.stringify([e?.id,e?.path,i]),c=(0,K.useRef)(s);c.current=s;let[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)({}),p=(0,K.useRef)(new Map),m=(0,K.useMemo)(()=>a&&o&&i?{sessionId:a,sessionPath:o,entryId:i}:null,[a,o,i]);(0,K.useEffect)(()=>{if(u(null),f({}),!n||!m)return;let e=new AbortController,t=async()=>{try{let t=null,n=[],i=new Set;for(let a=0;a<10;a++){let a=await r.sessionPromptHistory(m,t,e.signal);if(e.signal.aborted||c.current!==s||a.sessionId!==m.sessionId||a.sessionPath!==m.sessionPath||a.anchorEntryId!==m.entryId||a.requestedBeforeEntryId!==t||a.entryIds.length>100||a.entryIds.some(e=>!e||i.has(e))||new Set(a.entryIds).size!==a.entryIds.length||a.nextBeforeEntryId!==null&&(a.entryIds.length===0||a.nextBeforeEntryId!==a.entryIds[0]))return;for(let e of a.entryIds)i.add(e);if(n=[...a.entryIds,...n],a.nextBeforeEntryId===null){u({scope:s,ids:n});return}t=a.nextBeforeEntryId}}catch{}},i=typeof window.requestIdleCallback==`function`?window.requestIdleCallback(()=>void t(),{timeout:2e3}):void 0,a=i===void 0?window.setTimeout(()=>void t(),0):void 0;return()=>{e.abort(),i!==void 0&&window.cancelIdleCallback(i),a!==void 0&&window.clearTimeout(a);for(let e of p.current.values())e.abort();p.current.clear()}},[s,n,m,r]);let h=(0,K.useMemo)(()=>{let e=new Map(t.map(e=>[e.entryId,e]));if(l?.scope!==s)return t;let n=new Set(l.ids);return[...l.ids.map(t=>e.get(t)??d[t]??{entryId:t,title:``,previewState:`idle`}),...t.filter(e=>!n.has(e.entryId))]},[l,s,t,d]),g=(0,K.useRef)(h);return g.current=h,{items:h,requestPreview:(0,K.useCallback)(e=>{if(!n||!m||c.current!==s||p.current.has(e))return;let t=g.current.find(t=>t.entryId===e);if(!t||t.previewState===void 0||t.previewState===`ready`)return;let i=new AbortController;p.current.set(e,i),f(t=>({...t,[e]:{entryId:e,title:``,previewState:`loading`}})),r.sessionPromptPreview(m,e,i.signal).then(t=>{if(!(i.signal.aborted||c.current!==s)){if(t.sessionId!==m.sessionId||t.sessionPath!==m.sessionPath||t.anchorEntryId!==m.entryId||t.entryId!==e||typeof t.prompt!=`string`||typeof t.response!=`string`||Array.from(t.prompt).length>240||Array.from(t.response).length>240)throw Error(`Unverified preview`);f(n=>({...n,[e]:{entryId:e,title:t.prompt,reply:t.response,previewState:`ready`}}))}}).catch(()=>{!i.signal.aborted&&c.current===s&&f(t=>({...t,[e]:{entryId:e,title:``,previewState:`unavailable`}}))}).finally(()=>{p.current.get(e)===i&&p.current.delete(e)})},[n,m,s,r])}}var VK=`[data-history-entry], [data-history-message], [data-history-result]`;function HK(e,t,n,r){let i=(0,K.useRef)(null),a=(0,K.useCallback)(()=>{let r=e.current;if(!r||t.current){i.current=null;return}let a=r.getBoundingClientRect(),o=Array.from(r.querySelectorAll(VK)).filter(e=>{let t=e.getBoundingClientRect();if(t.height<=0||t.bottom<=a.top||t.top>=a.bottom)return!1;for(let t=e.parentElement;t&&t!==r;t=t.parentElement){if(t.hidden)return!1;let e=getComputedStyle(t);if(/^(auto|scroll|overlay)$/.test(e.overflowY)&&t.scrollHeight>t.clientHeight)return!1}return!0}),s=o.find(e=>!o.some(t=>t!==e&&e.contains(t)));i.current=s?{scope:n,element:s,offset:s.getBoundingClientRect().top-a.top}:null},[e,t,n]),o=(0,K.useCallback)(()=>{let a=e.current,o=i.current;if(!a||t.current||!o||o.scope!==n)return;if(!a.contains(o.element)||!o.element.getClientRects().length){i.current=null;return}let s=o.element.getBoundingClientRect().top-a.getBoundingClientRect().top-o.offset;if(Math.abs(s)>.5){let e=a.scrollTop+s;typeof a.scrollTo==`function`?a.scrollTo({top:e,behavior:`instant`}):a.scrollTop=e,r.current=a.scrollTop}},[e,t,n,r]);return(0,K.useLayoutEffect)(()=>{o(),a()}),{capture:a,restore:o,clear:(0,K.useCallback)(()=>{i.current=null},[])}}var UK=1e3,WK=ye*4;function GK(e,t){return t.history?.leafEntryId===e.validatedLeaf||t.history?.anchorEntryId===e.anchor&&t.history.anchorOnBranch===!0}function KK(e,t,n=t.entriesOmitted){let r=e.filter(e=>e.message?.truncation).length,i=e.reduce((e,t)=>e+(t.message?.truncation?.partsOmitted??0),0);return{...t,entriesOmitted:n,messagesTruncated:r,messagePartsOmitted:i,truncated:n>0||r>0||i>0}}function qK(e,t){let n=t.history?.leafEntryId??null;if(n===e.validatedLeaf)return e;let r=t.entries.findIndex(t=>t.id===e.anchor),i=r>=0?t.entries.slice(r+1):t.entries[0]?.parentId===e.anchor?t.entries:null,a=i?.reduce((e,t)=>e+pe(t)+1,0)??0;return i&&e.session.entries.length+i.length<=UK&&e.session.bytes+a<=WK?{...e,anchor:n??e.anchor,validatedLeaf:n,session:{...e.session,entries:[...e.session.entries,...i],bytes:e.session.bytes+a,truncation:KK([...e.session.entries,...i],e.session.truncation)}}:{...e,validatedLeaf:n}}function JK(e,t,n,r){let i=(0,K.useMemo)(()=>new de,[]),a=(0,K.useMemo)(()=>n??new Map,[n]),o=lK(e),s=(0,K.useRef)({scope:o,state:a.get(o)});s.current.scope!==o&&(s.current={scope:o,state:a.get(o)});let c=(0,K.useRef)({selected:e,callbacks:t});c.current={selected:e,callbacks:t};let l=(0,K.useRef)(s.current.state?.window??null),u=(0,K.useRef)(null),d=(0,K.useRef)(null),f=(0,K.useRef)(null),[p,m]=(0,K.useState)(l.current),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(null),[y,b]=(0,K.useState)(0),x=(0,K.useRef)(o),S=(0,K.useRef)(null),C=r?JSON.stringify([r.sessionId,r.sessionPath,r.entryId,r.revision]):null,w=r&&e&&C!==S.current&&r.sessionId===e.id&&r.sessionPath===e.path&&r.session.id===e.id&&r.session.path===e.path&&r.session.history?.anchorEntryId===r.entryId&&r.session.history.anchorOnBranch===!0&&r.session.entries.some(e=>e.id===r.entryId)?{session:r.session,anchor:r.session.entries.at(-1).id,validatedLeaf:r.session.history?.leafEntryId??null}:null,T=(0,K.useCallback)(e=>{l.current=e,uK(a,lK(e.session),{window:e}),m(e),c.current.callbacks.onAnchorChange?.({sessionId:e.session.id,sessionPath:e.session.path,entryId:e.anchor})},[a]),E=(0,K.useCallback)((e=!1)=>{u.current?.controller.abort(),u.current=null,d.current=null,a.delete(lK(l.current?.session??c.current.selected)),l.current=null,a.persist?.(),m(null),g(!1),v(e?`historyChanged`:null),f.current=null,c.current.callbacks.onAnchorChange?.(null),b(e=>e+1)},[a]),D=(0,K.useCallback)((e=!1)=>{let t=l.current,n=c.current.selected;if(!t||!n)return;let r=JSON.stringify([lK(n),t.anchor,n.history?.leafEntryId]);if(!e&&f.current?.key===r)return;let i={key:r};f.current=i,v(null);let a=()=>{f.current===i&&l.current===t&&(u.current?.controller.abort(),u.current=null,g(!1),v(`historyValidationUnavailable`))};c.current.callbacks.onAnchorChange?.({sessionId:t.session.id,sessionPath:t.session.path,entryId:t.anchor});let o=c.current.callbacks.onRefresh?.();if(!o){a();return}o.then(e=>{e||a()}).catch(a)},[]),O=(0,K.useCallback)(e=>{let t=l.current,n=c.current.selected;if(!e.page||!e.consuming||u.current!==e||e.controller.signal.aborted||!t||!n||e.scope!==lK(n)||t.session.history?.beforeEntryId!==e.before||!GK(t,n))return;let r=e.page,i=new Set(t.session.entries.map(e=>e.id)),a=[...r.entries.filter(e=>!i.has(e.id)),...t.session.entries],o=pe(a);for(;a.length>UK||o>WK;){let e=a.pop();if(!e)break;o-=pe(e)+ +!!a.length}c.current.callbacks.beforePrepend(),T({...t,anchor:a.at(-1)?.id??t.anchor,session:{...t.session,entries:a,bytes:o,truncation:KK(a,t.session.truncation,r.truncation.entriesOmitted),history:{...t.session.history,beforeEntryId:r.history?.beforeEntryId??null}}}),u.current=null,g(!1),v(null)},[T]);(0,K.useLayoutEffect)(()=>{if(w&&C!==S.current){x.current=o,u.current?.controller.abort(),u.current=null,d.current=null,f.current=null,g(!1),v(null),S.current=C,T(w);return}x.current!==o&&(x.current=o,u.current?.controller.abort(),u.current=null,d.current=null,l.current=s.current.state?.window??null,m(l.current),g(!1),v(null),f.current=null,b(e=>e+1),l.current||c.current.callbacks.onAnchorChange?.(null));let t=u.current;t&&!t.consuming&&e&&!GK(t.source,e)&&(t.controller.abort(),u.current=null);let n=l.current;if(!(!n||!e)){if(e.history?.anchorEntryId===n.anchor&&e.history.anchorOnBranch===!1){E(!0),c.current.callbacks.onRefresh?.();return}if(!GK(n,e)){D();return}v(e=>e===`historyValidationUnavailable`?null:e),(e.history?.leafEntryId??null)!==n.validatedLeaf&&(n=qK(n,e),T(n)),u.current?.page&&O(u.current)}},[o,e,E,D,T,O,w,C]),(0,K.useLayoutEffect)(()=>{let e=l.current;return e&&(uK(a,o,{...s.current.state,window:e}),c.current.callbacks.onAnchorChange?.({sessionId:e.session.id,sessionPath:e.session.path,entryId:e.anchor})),()=>{u.current?.controller.abort(),u.current=null,d.current=null,c.current.callbacks.onAnchorChange?.(null)}},[o,a]);let k=(0,K.useCallback)(()=>{let e=c.current.selected;return!l.current&&e?.history?.leafEntryId&&T({session:e,anchor:e.history.leafEntryId,validatedLeaf:e.history.leafEntryId}),l.current},[T]),A=(0,K.useCallback)((e,t)=>{let n=c.current.selected;if(!n||u.current)return;let r=e.session.history?.beforeEntryId;if(!r)return;let a={controller:new AbortController,scope:lK(n),before:r,source:e,consuming:t,anchor:{sessionId:n.id,sessionPath:n.path,entryId:e.anchor}};return u.current=a,t&&(g(!0),v(null)),a.done=(async()=>{try{let e=await i.sessionHistory(a.anchor,r,a.controller.signal);if(u.current!==a||a.controller.signal.aborted||a.scope!==lK(c.current.selected))return;if(e.id!==n.id||e.path!==n.path||e.anchorEntryId!==a.anchor.entryId||e.requestedBeforeEntryId!==r||e.history?.anchorEntryId!==a.anchor.entryId||e.history.anchorOnBranch!==!0)throw new ge(`Session history identity changed`,409,`SESSION_HISTORY_CHANGED`);a.page=e,a.consuming&&(O(a),u.current===a&&D())}catch(e){if(u.current!==a||a.controller.signal.aborted||(u.current=null,!a.consuming))return;g(!1),e instanceof ge&&e.code===`SESSION_HISTORY_CHANGED`?(E(!0),c.current.callbacks.onRefresh?.()):v(`historyUnavailable`)}})(),a.done},[O,E,i,D]),j=(0,K.useCallback)(async()=>{let e=c.current.selected;if(!e?.history?.leafEntryId)return;let t=l.current;if(t&&!GK(t,e)){D(!0);return}if(t||=k(),!t)return;let n=u.current;if(n){if(n.scope===lK(e)&&n.before===t.session.history?.beforeEntryId&&GK(n.source,e))return n.consuming=!0,g(!0),v(null),n.page&&O(n),n.done;n.controller.abort(),u.current=null}return A(t,!0)},[O,A,D,k]);(0,K.useEffect)(()=>{if(!t.preload){let e=u.current;e&&!e.consuming&&(e.controller.abort(),u.current=null,d.current=null);return}if(_||u.current||!e||p!==l.current)return;let n=p;if(n&&!GK(n,e))return;let r=n??(e.history?.leafEntryId?{session:e,anchor:e.history.leafEntryId,validatedLeaf:e.history.leafEntryId}:null);if(!r?.session.history?.beforeEntryId)return;let i=JSON.stringify([o,n?r.anchor:`initial`,n?r.session.history.beforeEntryId:null]);d.current!==i&&(d.current=i,A(r,!1))},[t.preload,_,o,e,p,A]);let M=p&&lK(p.session)===o?p:null,N=w??(M&&e&&GK(M,e)?qK(M,e):M),P=(0,K.useCallback)(()=>E(),[E]),F=!!(N&&e&&!GK(N,e));return{session:N?.session??e,engaged:!!N,hasMore:!!(N?.session??e)?.history?.beforeEntryId,hasNewer:!!(N&&N.anchor!==e?.history?.leafEntryId),verifying:F,loading:h,error:_,reset:y,retainReading:k,loadOlder:j,resetToLatest:P}}function YK(e){return e&&typeof e==`object`?e:{}}function XK(e){try{return YK(JSON.parse(e))}catch{return{}}}function ZK(e){return e===`running`?`running`:e===`done`||e===`completed`?`done`:[`error`,`failed`,`aborted`,`killed`,`timed_out`].includes(String(e))?`error`:e===`uncertain`?`warn`:`unknown`}function QK(e,t){if(e?.forkSnapshotToolResult)return`unknown`;if(t===`running`)return`running`;if(t===`unknown`)return`unknown`;if(t===`failed`||e?.isError)return`error`;if(t===`cancelled`||t===`timed_out`)return`warn`;if(!e?.toolName?.startsWith(`subagent`)){let t=ZK(YK(e?.details).status);if(t!==`unknown`&&t!==`running`)return t}return t===`returned`||e?.isError===!1?`done`:`unknown`}function $K({status:e}){let{t}=W();return e===`running`?(0,q.jsx)(`span`,{className:`status-mark running`,role:`img`,"aria-label":t(`toolState_running`),children:(0,q.jsx)(`i`,{})}):e===`done`?(0,q.jsx)(rs,{className:`status-mark done`,"aria-label":t(`execution_done`)}):e===`error`?(0,q.jsx)(je,{className:`status-mark error`,"aria-label":t(`toolState_failed`)}):e===`warn`?(0,q.jsx)(`span`,{className:`status-mark warn`,role:`img`,"aria-label":t(`toolState_unknown`),children:`?`}):null}function eq({label:e,message:t,children:n}){return(0,q.jsxs)(`div`,{className:`execution-error`,role:`alert`,"aria-label":e,children:[(0,q.jsx)(ls,{"aria-hidden":`true`}),(0,q.jsxs)(`div`,{className:`execution-error-content`,children:[(0,q.jsx)(`p`,{children:t}),n]})]})}function tq({failed:e,error:t,retryPrompt:n,retryEntryId:r,canRetry:i,onRetry:a}){let{t:o}=W(),[s,c]=(0,K.useState)(!1);return e?(0,q.jsx)(eq,{label:o(`modelRequestFailed`),message:t||o(`modelFailureUnknown`),children:n!==void 0&&r&&a&&(0,q.jsx)(`div`,{className:`provider-outcome-actions`,children:(0,q.jsxs)(`button`,{type:`button`,disabled:!i||s,onClick:()=>{c(!0),a(n,r).finally(()=>c(!1))},children:[(0,q.jsx)(he,{"aria-hidden":`true`}),o(s?`retryingPrompt`:`retryPrompt`)]})})}):(0,q.jsx)(`div`,{className:`provider-outcome aborted`,role:`status`,children:o(`modelRequestStopped`)})}function nq({attempts:e,state:t,retry:n,observed:r=!0}){let{t:i}=W(),a=t===`retrying`&&!r,o=n?.attempt,s=n?.maxAttempts,c=typeof o==`number`&&Number.isSafeInteger(o)&&o>0&&typeof s==`number`&&Number.isSafeInteger(s)&&s>=o,l=e.length>0||!!n?.errorMessage,u=(0,q.jsxs)(q.Fragment,{children:[t===`retrying`?(0,q.jsx)(Jc,{"aria-hidden":`true`}):(0,q.jsx)(wc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{role:t===`retrying`?`status`:void 0,children:[i(a?`modelReconnectUnknown`:t===`recovered`?`modelRequestRecovered`:t===`retrying`?n?`modelRetrying`:`modelEarlierAttempts`:t===`interrupted`?`modelRequestStopped`:`modelEarlierAttempts`),t===`retrying`&&c&&` ${o}/${s}`]}),t!==`retrying`&&(0,q.jsx)(`span`,{className:`provider-attempts-count`,children:i(`modelFailedAttempts`,{count:e.length})}),l&&(0,q.jsx)(os,{className:`reconnect-chevron`,"aria-hidden":`true`})]}),d=`provider-attempts ${t}${a?` unavailable`:``}`;return l?(0,q.jsxs)(`details`,{className:d,children:[(0,q.jsx)(`summary`,{children:u}),(0,q.jsxs)(`ol`,{children:[e.length===0&&(0,q.jsx)(`li`,{children:(0,q.jsx)(`p`,{children:n?.errorMessage})}),e.map(({entry:e,content:t},n)=>(0,q.jsxs)(`li`,{"data-history-entry":e.entryId??e.key,children:[(0,q.jsx)(`span`,{className:`provider-attempt-index`,"aria-hidden":`true`,children:String(n+1).padStart(2,`0`)}),(0,q.jsxs)(`div`,{className:`provider-attempt-body`,children:[(0,q.jsx)(`p`,{children:e.message.errorMessage||i(`modelFailureUnknown`)}),t?.map(e=>(0,q.jsx)(K.Fragment,{children:e.content},e.key))]})]},e.key))]})]}):(0,q.jsx)(`div`,{className:d,children:u})}function rq(e,t,n){let r=new Set,i=new Map,a=[],o=-1,s=(s,c=!1,l=!1)=>{if(a.length>0){let u=e[o]?.message.stopReason,d=s?.outcome===`cancelled`||u===`aborted`,f=u===`error`&&!d&&!(c&&t)&&!l;f&&r.add(o);let p=f?a.slice(0,-1):a,m=p.at(-1);m!==void 0&&i.set(m,{attempts:p.map(t=>e[t]),state:d?`interrupted`:u===`stop`||u===`length`||u===`toolUse`?`recovered`:c&&t&&n?`retrying`:`earlier`})}a=[],o=-1};return e.forEach((e,t)=>{e.optimistic||(e.timing?s(e.timing):e.forkSnapshotBoundary?s(void 0,!1,!0):e.message.role===`user`||e.message.role===`custom`&&e.message.customType===`openpi-setup-request`?s():e.message.role===`assistant`&&(o=t,e.message.stopReason===`error`&&a.push(t)))}),s(void 0,!0),{finalErrors:r,groups:i}}function iq(e,t){return zD(vK(e,t).split(` +`).find(Boolean),120)}function aq(e){let t=e.split(` +`).map(e=>e.trim()).find(Boolean);return t?zD(t.replace(/^#{1,6}\s+/u,``).replace(/^>\s*/u,``).replace(/[*_~`]+/gu,``).replace(/\[([^\]]+)\]\([^)]*\)/gu,`$1`).trim(),600):``}function oq({body:e,icon:t,name:n,status:r,summary:i,output:a,evidenceState:o,note:s,rawDetails:c,children:l,snapshotMissingResult:u=!1,defaultOpen:d=!1}){let{t:f}=W(),[p,m]=(0,K.useState)(d);(0,K.useEffect)(()=>m(d),[d]);let h=o??(r===`done`?`returned`:r===`error`?`failed`:r===`running`?`running`:`unknown`);return(0,q.jsxs)(`details`,{className:`message-details tool-line ${r}`,"data-tool":n,open:p,onToggle:e=>m(e.currentTarget.open),children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(`span`,{className:`tool-icon`,"aria-hidden":`true`,children:t}),hK(n).action===`call`&&(0,q.jsx)(`span`,{className:`tool-kind`,title:n,children:_K(n)}),(0,q.jsxs)(`span`,{className:`details-title`,children:[(0,q.jsx)(`span`,{className:`tool-action`,children:gK(f,n,h)}),i&&(0,q.jsx)(`span`,{className:`tool-summary`,children:i})]}),u&&(0,q.jsx)(`span`,{className:`evidence-status`,children:f(`toolSnapshotMissingResult`)}),(0,q.jsx)(os,{className:`tool-disclosure`,"aria-hidden":`true`}),(0,q.jsx)($K,{status:r})]}),s&&(0,q.jsx)(`p`,{className:`evidence-note`,children:s}),a===void 0?(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:pd(e).text}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`figure`,{"aria-label":f(`toolCallArguments`),style:{margin:0},children:(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:pd(e).text})}),(0,q.jsx)(`figure`,{"aria-label":f(`toolCallOutput`),style:{margin:0},children:(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:pd(a).text||f(`noOutput`)})})]}),c!==void 0&&(0,q.jsxs)(`details`,{className:`evidence-raw`,children:[(0,q.jsx)(`summary`,{children:f(`toolRawEvidence`)}),(0,q.jsx)(`pre`,{children:pd(JSON.stringify(c,null,2)).text})]}),l]})}function sq({body:e,family:t,meta:n,status:r,title:i,defaultOpen:a=!1}){return(0,q.jsxs)(`details`,{className:`message-details activity-card ${t}`,open:a||void 0,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(`span`,{className:`activity-icon`,"aria-hidden":`true`,children:t===`subagent`?(0,q.jsx)($o,{}):(0,q.jsx)(Yc,{})}),(0,q.jsxs)(`span`,{className:`activity-main`,children:[(0,q.jsx)(`span`,{className:`activity-title`,children:i}),n&&(0,q.jsx)(`span`,{className:`activity-meta`,children:n})]}),(0,q.jsx)($K,{status:r}),(0,q.jsx)(os,{className:`tool-disclosure`,"aria-hidden":`true`})]}),(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:e})]})}function cq(e,t){let n=typeof e.id==`string`?[e.id]:Array.isArray(e.ids)?e.ids:typeof t.id==`string`?[t.id]:Array.isArray(t.results)?t.results.map(e=>YK(e).id):[];return[...new Set(n.filter(e=>typeof e==`string`&&!!e))]}function lq({call:e,result:t,status:n,sessionId:r,subagents:i,records:a,onInspect:o,defaultOpen:s}){let{t:c}=W(),l=cq(XK(e.arguments),YK(t?.details)),u=gK(c,e.name,n===`done`?`returned`:n===`error`?`failed`:n);return(0,q.jsxs)(`section`,{className:`subagent-operation`,children:[(l.length?l:[void 0]).map(t=>(0,q.jsx)(JG,{identity:`${r}:${t??e.id}`,title:t?UD(t,i,a):``,action:u,state:n===`warn`?`unknown`:n,label:c(`toolState_${n===`done`?`returned`:n===`error`?`failed`:n===`warn`?`unknown`:n}`),onInspect:t&&o?()=>o(t):void 0},t??e.id)),(0,q.jsxs)(`details`,{className:`subagent-operation-receipt`,open:s||void 0,children:[(0,q.jsx)(`summary`,{"aria-label":c(`toolRawEvidence`),title:c(`toolRawEvidence`),children:(0,q.jsx)(Ds,{"aria-hidden":`true`})}),e.arguments!==`{}`&&(0,q.jsx)(`pre`,{children:pd(e.arguments).text}),(0,q.jsx)(`pre`,{children:pd(t?.content??``).text||c(`noOutput`)})]})]})}function uq(e,t,n={sessionId:``}){if(t?.forkSnapshotToolResult)return null;let{sessionId:r,subagents:i=[],records:a=[],workflows:o=[],onInspectSubagent:s,liveState:c,defaultOpen:l=!1,observed:u=!0}=n,d=e.name||``,f=XK(e.arguments),p=YK(t?.details),m=QK(t,c),h=!u&&m===`running`?`unknown`:m;if(d===`subagent_spawn`)return(0,q.jsx)(dq,{sessionId:r,id:typeof p.id==`string`?p.id:void 0,title:String(p.title||f.name||`subagent`),body:t?.content||String(f.prompt||e.arguments),activity:i.find(e=>e.id===p.id),saved:a.find(e=>e.id===p.id),spawnFailed:t?.isError===!0,observed:u,defaultOpen:l,onInspect:s});if(d.startsWith(`subagent`))return(0,q.jsx)(lq,{call:e,result:t,sessionId:r,subagents:i,records:a,onInspect:s,defaultOpen:l,status:h});if(d===`workflow`){let n=typeof f.script==`string`?f.script:e.arguments,i=String(p.name||n.match(/\bname:\s*["'`]([^"'`]+)["'`]/u)?.[1]||`unnamed`),a=YK(p.agents),c=o.find(e=>e.runId===p.runId)?.children,l=[p.runId,p.status,a.total?`${Number(a.total)-Number(a.running||0)}/${a.total} agents`:``].filter(Boolean).join(` · `);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(sq,{family:`workflow`,title:`Workflow · ${i}`,meta:l,body:t?.content||n,status:h}),(0,q.jsx)(fq,{sessionId:r,tasks:c,observed:u,onInspect:s})]})}return d.startsWith(`workflow`)?(0,q.jsx)(sq,{family:`workflow`,title:d.replaceAll(`_`,` `),meta:String(f.runId||``),body:t?.content||e.arguments,status:h}):null}function dq({sessionId:e,id:t,title:n,body:r,activity:i,saved:a,spawnFailed:o,onInspect:s,defaultOpen:c=!1,observed:l=!0}){let{t:u}=W(),d=i?.outcome===`interrupted`?`interrupted`:i?.status??(a?.state===`running`?void 0:a?.state),f=!l&&(d===`running`||!d&&!o)?`unknown`:d,p=u(f===`unknown`?`toolState_unknown`:f?`subagentState_${f}`:o?`subagentSpawnFailed`:t?`subagentStateUnavailable`:`subagentStarting`);return(0,q.jsxs)(`section`,{className:`activity-card subagent subagent-activity`,children:[(0,q.jsx)(JG,{identity:`${e}:${t??n}`,title:n,state:f,label:p,onInspect:t&&s?()=>s(t):void 0}),(c||o)&&(0,q.jsxs)(`details`,{className:`subagent-receipt`,open:c||void 0,children:[(0,q.jsx)(`summary`,{children:u(`subagentSpawnReceipt`)}),(0,q.jsx)(`p`,{children:u(`subagentSpawnReceiptHint`)}),(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:r})]})]})}function fq({sessionId:e,tasks:t,observed:n,onInspect:r}){let{t:i}=W();return(0,q.jsxs)(q.Fragment,{children:[t?.items.map(t=>{let a=t.outcome===`interrupted`?`interrupted`:!n&&t.status===`running`?`unknown`:t.status;return(0,q.jsx)(JG,{identity:`${e}:${t.id}`,title:t.title,state:a,label:i(a===`unknown`?`toolState_unknown`:`subagentState_${a}`),onInspect:r?()=>r(t.id,`workflows`):void 0},t.id)}),!!t?.omitted&&(0,q.jsx)(`p`,{className:`inspection-note`,children:i(`subagentListTruncated`,{count:t?.omitted})})]})}function pq({body:e,duration:t,status:n,level:r,defaultOpen:i,truncated:a,source:o}){let{t:s}=W(),c=n===`running`,[l,u]=(0,K.useState)(i),[d,f]=(0,K.useState)();(0,K.useEffect)(()=>u(i),[i]);let p=t===void 0?``:VD(0,t),m=aq(e),h=[n===`unknown`?s(`toolState_unknown`):c?r?s(`thinkingActiveLevel`,{level:r}):s(`thinkingActive`):s(`thinkingDone`),p].filter(Boolean).join(` · `);return(0,q.jsxs)(`details`,{className:`message-details tool-line thinking-line ${n}`,open:l,onToggle:e=>u(e.currentTarget.open),children:[(0,q.jsxs)(`summary`,{"aria-label":[h,m].filter(Boolean).join(` · `),title:m,children:[(0,q.jsx)(`span`,{className:`tool-icon`,"aria-hidden":`true`,children:(0,q.jsx)(Zs,{})}),(0,q.jsx)(`span`,{className:`details-title`,children:(0,q.jsx)(`span`,{className:`tool-summary`,children:m||h})}),(0,q.jsx)(os,{className:`tool-disclosure`,"aria-hidden":`true`})]}),l&&(0,q.jsx)(`div`,{className:`details-body thinking-evidence`,children:a&&o&&!c?(0,q.jsx)(iK,{...o,preview:e,markdown:!0,purpose:`thinking`,fullText:d,onComplete:f}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(vD,{children:e}),a&&(0,q.jsx)(`p`,{className:`evidence-warning`,children:s(`thinkingPreviewOnly`)})]})})]})}function mq({content:e,editable:t,copyRequiresFull:n=!1,timestamp:r,onResend:i,onRegenerate:a,onFork:o,canFork:s=!1,forkPending:c=!1}){let{t:l}=W(),[u,d]=(0,K.useState)(!1),[f,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(!1),g=(0,K.useRef)(0),_=(0,K.useRef)(void 0);(0,K.useEffect)(()=>()=>{g.current+=1,window.clearTimeout(_.current)},[]);let[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(e),[S,C]=(0,K.useState)(!1),w=(0,K.useRef)(null),T=(0,K.useId)();(0,K.useEffect)(()=>{v&&w.current?.focus()},[v]);let E=async()=>{if(!(S||!b.trim()||!t||!i)){C(!0);try{await i(b.trim())&&y(!1)}finally{C(!1)}}};if(v)return(0,q.jsxs)(`div`,{className:`message-editor`,children:[(0,q.jsx)(`textarea`,{ref:w,value:b,"aria-label":l(`editMessage`),"aria-describedby":T,readOnly:S,onChange:e=>x(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||S||(e.key===`Escape`&&y(!1),e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),E()))}}),(0,q.jsx)(`p`,{className:`message-edit-hint`,id:T,children:l(`editMessageHint`)}),(0,q.jsxs)(`div`,{className:`message-edit-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:S,onClick:()=>y(!1),children:l(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`confirm`,disabled:S||!b.trim()||!t,onClick:()=>void E(),children:l(`confirmEdit`)})]})]});let D=BD(r);return(0,q.jsxs)(`div`,{className:`message-actions${f?` copy-failed`:``}`,children:[D&&(0,q.jsx)(`time`,{dateTime:r,children:D}),o&&(0,q.jsx)(V,{content:l(c?`forkSessionPending`:s?`forkMessageHint`:`forkSessionUnavailable`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":l(`forkMessage`),disabled:!s||c,onClick:()=>void o(),children:(0,q.jsx)(Ws,{"aria-hidden":`true`})})}),t&&(0,q.jsx)(V,{content:l(`editMessage`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":l(`editMessage`),onClick:()=>{x(e),y(!0)},children:(0,q.jsx)(yc,{})})}),a&&(0,q.jsx)(V,{content:l(`regenerateMessageHint`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":l(`regenerateMessage`),disabled:!s||c,onClick:()=>void a(),children:(0,q.jsx)(he,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:l(n?`messageCopyRequiresFull`:u?`copiedMessage`:`copyMessage`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":l(u?`copiedMessage`:`copyMessage`),"data-copied":u||void 0,disabled:m||n,onClick:()=>{let t=++g.current;window.clearTimeout(_.current),h(!0),d(!1),p(!1),td(e).then(e=>{t===g.current&&(h(!1),d(e),p(!e),e&&(_.current=window.setTimeout(()=>d(!1),1200)))})},children:u?(0,q.jsx)(rs,{}):(0,q.jsx)(_s,{})})}),f&&(0,q.jsx)(`span`,{className:`copy-error`,role:`status`,children:l(`copyFailed`)})]})}function hq({message:e,fullSubagent:t=!1,sessionId:n,onInspectSubagent:r}){let{t:i}=W();if(e.customType===`openpi-web-command-feedback`)return(0,q.jsxs)(`div`,{className:`command-feedback`,role:`status`,children:[e.content,e.truncation?.truncated&&(0,q.jsx)(`p`,{children:i(`commandFeedbackTruncated`)})]});let a=YK(e.details);if(e.customType===`openpi-setup-request`||e.customType===`openpi-setup-closed`)return(0,q.jsx)(oq,{body:e.content,icon:(0,q.jsx)(Xc,{}),name:i(`configureOpenPi`),summary:e.customType===`openpi-setup-closed`?zD(e.content):void 0,status:`unknown`});if(e.customType===`subagent-result`){let o=Array.isArray(a.results)?a.results.map(YK):[a],s=new Set(GD([e]).map(e=>e.id));return(0,q.jsxs)(`section`,{className:`activity-card subagent subagent-activity`,children:[o.map(e=>{let t=typeof e.id==`string`?e.id:``,a=e.outcome===`interrupted`?`interrupted`:e.status===`done`||e.status===`error`||e.status===`running`?e.status:`unknown`;return(0,q.jsx)(JG,{identity:`${n}:${t}`,title:String(e.title||t||i(`subagentDetails`)),state:a,label:i(a===`unknown`?`unknownState`:`subagentState_${a}`),onInspect:r&&s.has(t)?()=>r(t):void 0},t||JSON.stringify(e))}),(0,q.jsxs)(`details`,{className:`subagent-result-evidence`,open:t||void 0,children:[(0,q.jsx)(`summary`,{children:i(`subagentBackgroundResult`,{count:o.length})}),(0,q.jsx)(`pre`,{className:`details-body tool-evidence`,children:!t&&typeof a.displayContent==`string`?a.displayContent:e.content})]})]})}if(e.customType===`workflow-result`){let t=Array.isArray(a.entries)?a.entries.map(YK):[],n=t.map(e=>ZK(e.status)),r=n.includes(`error`)?`error`:n.includes(`warn`)?`warn`:n.length>0&&n.every(e=>e===`done`)?`done`:n.includes(`running`)?`running`:`unknown`,i=t.length?t.map(e=>`${e.status===`completed`?`✓`:`✗`} ${String(e.summary||e.runId||`run`)}${e.resultPreview?`\nResult: ${e.resultPreview}`:``}`).join(` +`):e.content;return(0,q.jsx)(sq,{family:`workflow`,title:t.length>1?`Workflow results · ${t.length} runs`:`Workflow ${String(t[0]?.runId||`result`)}`,body:i,status:r})}return null}function gq(e){return[``,`[]`,`{}`,`null`].includes(e.trim())}function _q({rows:e,active:t}){let{t:n}=W(),[r,i]=(0,K.useState)(!1),a=e.length===1,o=(0,K.useRef)(a),s=(0,K.useRef)(null),c=(0,K.useRef)(null),l=(0,K.useRef)(!0),u=(0,K.useRef)(0),d=(0,K.useRef)(void 0),[f,p]=(0,K.useState)({above:!1,below:!1}),m=(0,K.useCallback)(()=>{let e=c.current;if(!e)return;let t=e.scrollTop>1,n=e.scrollHeight-e.clientHeight-e.scrollTop>1;p(e=>e.above===t&&e.below===n?e:{above:t,below:n})},[]);(0,K.useLayoutEffect)(()=>{let n=c.current,s=o.current&&!a;if(s&&!r&&n?.querySelector(`.thinking-line[open]`)){i(!0);return}o.current=a,!(!n||a||!r||e.length===0)&&(!s&&n.scrollTop!==u.current&&n.scrollHeight-n.clientHeight-n.scrollTop>24&&(l.current=!1),s&&!l.current&&(n.scrollTop=u.current),t&&l.current&&(n.scrollTop=n.scrollHeight,u.current=n.scrollTop),m())},[e,t,r,a,m]),(0,K.useEffect)(()=>{let e=c.current,n=e?.firstElementChild;if(!e||!n||a||typeof ResizeObserver>`u`)return;let i=new ResizeObserver(()=>{r&&t&&l.current&&(e.scrollTop=e.scrollHeight,u.current=e.scrollTop),m()});return i.observe(e),i.observe(n),()=>i.disconnect()},[t,r,a,m]);let h=e.filter(e=>e.processType===`thinking`).length,g=e.filter(e=>e.processType===`tool`).length,_=e.filter(e=>e.processType===`activity`).length,v=[h?n(`processThinkingCount`,{count:h}):``,g?n(`processToolCount`,{count:g}):``,_?n(`processActivityCount`,{count:_}):``].filter(Boolean),y=[...e].reverse().find(e=>e.processStatus===`running`),b=y?.processPreview??(t?[...e].reverse():e).find(e=>e.processPreview)?.processPreview,x=y?.processToolName&&[`read`,`write`,`edit`].includes(y.processToolName)?b?.slice(Math.max(b.lastIndexOf(`/`),b.lastIndexOf(`\\`))+1):b,S=e.filter(e=>e.error||e.processStatus===`error`).length,C=S>0,w=y?`running`:C?`error`:e.some(e=>e.processStatus===`warn`)?`warn`:e.every(e=>e.processStatus===`done`)?`done`:`unknown`,T=e.flatMap(e=>e.processToolName?[e.processToolName]:[]),E=[...new Set(T.map(e=>hK(e).action))],D=E.map(e=>n(`toolActionGroup_${e}`)),O=E.length?n(`toolGroup_${w===`done`?`done`:w===`running`?`running`:`unknown`}`,{actions:D.join(n(`toolGroupSeparator`))}):n(w===`running`?`processRunning`:`processDetails`),k=y?.processToolName?gK(n,y.processToolName,`running`):y?.processType===`thinking`?n(`thinkingActive`):r?n(`processDetails`):O,A=y?.processToolName??T[0],j=y?.processType===`thinking`?Zs:A?hK(A).Icon:Xc;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`details`,{className:`process-sequence ${a?`single-process `:``}${w}`,open:a||r,"data-status":w,"data-running":w===`running`?`true`:void 0,"data-history-entry":e[0]?.key,onToggle:e=>{a||i(e.currentTarget.open)},children:[(0,q.jsxs)(`summary`,{ref:s,hidden:a,"aria-label":[k,y?b:``,...v,C?n(`processFailureCount`,{count:S}):``].filter(Boolean).join(` · `),children:[(0,q.jsx)(`span`,{className:`tool-icon`,"aria-hidden":`true`,children:(0,q.jsx)(j,{})}),(0,q.jsx)(`span`,{className:`process-sequence-title`,children:(0,q.jsx)(`strong`,{children:k})}),b&&(y||!t&&!E.length)&&(0,q.jsx)(`span`,{className:`process-sequence-preview`,title:b,children:x}),(0,q.jsx)(os,{className:`tool-disclosure`,"aria-hidden":`true`}),!C&&(0,q.jsx)($K,{status:w})]}),(0,q.jsx)(`section`,{ref:c,className:`process-sequence-scroll`,"aria-label":a?void 0:[n(`processDetails`),...v].join(` · `),tabIndex:a?void 0:0,"data-scroll-above":f.above||void 0,"data-scroll-below":f.below||void 0,onScrollCapture:e=>{let t=e.target;if(a&&t instanceof HTMLElement&&t.classList.contains(`thinking-evidence`)){let n=t.getBoundingClientRect().top-e.currentTarget.getBoundingClientRect().top+t.scrollTop,r=n>u.current;u.current=n,l.current=(l.current||r)&&t.scrollHeight-t.clientHeight-t.scrollTop<=24}},onScroll:e=>{if(a)return;let t=e.currentTarget,n=t.scrollTop>u.current;u.current=t.scrollTop,l.current=(l.current||n)&&t.scrollHeight-t.clientHeight-t.scrollTop<=24,m()},onWheel:e=>{!e.defaultPrevented&&!e.ctrlKey&&!e.metaKey&&e.deltaY<0&&(a||Eq(e.nativeEvent,e.currentTarget))&&(l.current=!1)},onKeyDown:e=>{let t=e.target;!e.defaultPrevented&&!e.altKey&&!e.metaKey&&(!e.ctrlKey||e.key===`Home`)&&([`ArrowUp`,`PageUp`,`Home`].includes(e.key)||e.key===` `&&e.shiftKey)&&t instanceof HTMLElement&&!t.isContentEditable&&!t.closest(`input, textarea, select`)&&!(e.key===` `&&t.closest(`button, summary`))&&(a||Eq(e.nativeEvent,e.currentTarget))&&(l.current=!1)},onTouchStart:e=>{d.current=e.touches[0]?.clientY},onTouchMove:e=>{let t=e.touches[0]?.clientY;t!==void 0&&d.current!==void 0&&t>d.current&&(a||Eq(e.nativeEvent,e.currentTarget))&&(l.current=!1),d.current=t},children:(0,q.jsx)(`div`,{className:`process-sequence-body`,children:e.map(e=>(0,q.jsx)(`div`,{className:`process-step ${a?`single-tool-step `:``}${e.processStatus??`unknown`}`,"data-status":e.processStatus??`unknown`,children:e.content},e.key))})})]}),(0,q.jsx)(V,{anchorRef:s,focusTrigger:`always`,content:[...v,C?n(`processFailureCount`,{count:S}):``].filter(Boolean).join(` · `),placement:`above`,isEnabled:!a})]})}function vq(e,t){let n=[];for(let t of e){let e=n.at(-1),r=t.kind===`process`;r&&e?.process?e.rows.push(t):n.push({process:r,rows:[t]})}return n.flatMap((e,r)=>{let i=`${e.process?`process`:`rows`}-${e.rows[0]?.key}`;return e.process?(0,q.jsx)(_q,{rows:e.rows,active:t&&r===n.length-1},i):e.rows.map(e=>(0,q.jsx)(K.Fragment,{children:e.content},e.key))})}function yq({rows:e,timing:t,active:n,timedTurn:r}){let{t:i}=W(),a=(0,K.useId)(),[o,s]=(0,K.useState)(t?.outcome!==`completed`),c=(0,K.useRef)(!1),l=(0,K.useRef)(t?.outcome);(0,K.useEffect)(()=>{l.current!==t?.outcome&&t?.outcome===`completed`&&s(!1),l.current=t?.outcome},[t?.outcome]);let u=!!(t||r),d=[];for(let r of e){if(r.content===null)continue;let e=t?.resultEntryId?r.responseEntryId===t.resultEntryId&&r.final!==!1:!n&&r.final,i=r.kind!==`prompt`&&!e,a=d.at(-1);i&&a?.foldable?a.rows.push(r):d.push({foldable:i,rows:[r]})}let f=d.filter(e=>e.foldable),p=e=>e===0?a:`${a}-${e}`,m=f.length>0,h=t?(0,q.jsx)(ZG,{timing:t}):r?(0,q.jsx)(XG,{elapsedMs:r.elapsedMs},JSON.stringify([r.sessionId,r.sessionPath,r.commandId,r.epoch,r.startedAt])):null;return(0,q.jsxs)(q.Fragment,{children:[u&&(0,q.jsxs)(`header`,{className:`turn-duration`,"data-outcome":t?.outcome,children:[m?(0,q.jsxs)(`button`,{type:`button`,className:`turn-duration-toggle`,"aria-expanded":o,"aria-controls":f.map((e,t)=>p(t)).join(` `),onClick:e=>{c.current=e.nativeEvent.isTrusted,s(e=>!e)},children:[(0,q.jsx)(vs,{className:`turn-duration-icon`,"aria-hidden":`true`}),h,(0,q.jsx)(os,{className:`turn-duration-chevron`,"aria-hidden":`true`})]}):h,t&&t.outcome!==`completed`&&(0,q.jsx)(`span`,{className:`turn-duration-outcome`,children:i(`turnElapsedOutcome_${t.outcome}`)})]}),u?d.map(e=>e.foldable?(0,q.jsx)(`div`,{className:`turn-response-body`,id:p(f.indexOf(e)),hidden:!o,inert:!o,"data-user-toggle":c.current||void 0,children:vq(e.rows,n&&e===f.at(-1))},e.rows[0].key):(0,q.jsx)(K.Fragment,{children:vq(e.rows,!1)},e.rows[0].key)):vq(e,n)]})}function bq({id:e,rows:t,active:n,observed:r=!0,changes:i,session:a,timedTurn:o,onReviewTurn:s}){let{t:c}=W(),l=[...t].reverse().find(e=>e.outcome||e.timing),u=l?.timing?.outcome??l?.outcome,d=t.some(e=>e.kind===`response`),f=t.find(e=>e.kind===`prompt`),p=!!(f?.promptEntryId&&t.some(e=>e.commandHandledInputId===f.promptEntryId&&e.commandHandledCommandId===f.promptCommandId)),m=t.some(e=>e.forkSnapshotBoundary),h=m?`forked`:n?r?`running`:`unknown`:u===`failed`?`failed`:u===`interrupted`||u===`cancelled`?`interrupted`:u===`completed`||d||p?`complete`:`waiting`,g=h===`failed`?`error`:h===`interrupted`?`warning`:h===`running`?`accent`:h===`complete`?`success`:`neutral`,_=c(h===`unknown`?`toolState_unknown`:`turnState_${h}`),v=t.some(e=>e.timing&&e.timing.commandId===o?.commandId&&e.timing.epoch===o?.epoch)?void 0:o,y=[],b=[],x=0,S=(e,t=!1)=>{y.push((0,q.jsx)(yq,{rows:b,timing:e,active:n&&t,timedTurn:t?v:void 0},`run-${x++}`)),b=[]};for(let e of t)e.kind===`prompt`?b.length?b.push(e):y.push((0,q.jsx)(K.Fragment,{children:e.content},e.key)):e.timing?S(e.timing):b.push(e);let C=n&&r&&(b.length>0||!!v||!t.some(e=>e.timing))&&!b.some(e=>e.kind!==`prompt`&&e.content!==null);(b.length||v)&&S(void 0,!0);let w=!!(o||t.some(e=>e.timing));return(0,q.jsxs)(`section`,{className:`conversation-turn${e===0?` prelude`:``}`,"data-turn":e,children:[e>0&&h!==`complete`&&(!w||m)&&(0,q.jsxs)(`header`,{className:`turn-heading`,children:[(0,q.jsx)(`span`,{className:`sr-only`,children:c(`turnLabel`,{number:e})}),(0,q.jsxs)(`span`,{className:`turn-state ${h}`,children:[(0,q.jsx)(qG,{variant:g,label:_,isPulsing:h===`running`,icon:h===`failed`||h===`interrupted`?(0,q.jsx)(je,{"aria-hidden":`true`}):h===`forked`?(0,q.jsx)(Ws,{"aria-hidden":`true`}):void 0}),_]})]}),y,C&&(0,q.jsxs)(`div`,{className:`conversation-waiting`,"aria-hidden":`true`,children:[(0,q.jsxs)(`span`,{className:`conversation-waiting-dots`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]}),(0,q.jsx)(`span`,{children:c(`modelRunning`)})]}),i&&a&&(0,q.jsx)(SK,{changes:i,onReview:s},`${a.id}:${a.path}:${i.promptEntryId}`)]})}function xq(e,t,n,r){let i=new Map;for(let t=0;t{if(!t)return;let r=i.get(t);if(!(r===void 0||r>=n)){for(let t=r+1;te.rows.some(e=>e.promptCommandId===n||r?.promptEntryId&&e.promptEntryId===r.promptEntryId)):void 0,l=s.length-1;for(;l>=0&&s[l].id!==0&&!s[l].rows.some(e=>e.kind===`prompt`&&!e.pendingPrompt);)l--;return{turns:s,activeTurn:c?.id??s[l]?.id}}function Sq(e,t,n,r,i,a,o,s=!0,c=t){let{turns:l,activeTurn:u}=xq(e,c,n,a);return l.map(e=>(0,q.jsx)(bq,{id:e.id,rows:e.rows,active:t&&e.id===u&&!e.rows.some(e=>e.forkSnapshotBoundary),observed:s,changes:c&&e.id===u?void 0:r?.get(e.rows.find(e=>e.kind===`prompt`&&!e.pendingPrompt)?.promptEntryId??``),session:i,timedTurn:t&&e.id===u&&!e.rows.some(e=>e.forkSnapshotBoundary)?a:void 0,onReviewTurn:o},`turn-group-${e.rows[0]?.key}`))}function Cq(e,t,n){let r=e.getBoundingClientRect(),i=r.top,a=Array.from(e.querySelectorAll(`[data-history-entry], [data-history-message], [data-history-result]`)).filter(t=>{let n=t.getBoundingClientRect(),i=Math.max(n.top,r.top),a=Math.min(n.bottom,r.bottom);for(let n=t;n&&n!==e;n=n.parentElement){if(n.hidden||n instanceof HTMLDetailsElement&&!n.open&&n!==t&&!n.querySelector(`:scope > summary`)?.contains(t))return!1;if(n===t)continue;let e=getComputedStyle(n);if(!/^(auto|scroll|overlay|hidden|clip)$/.test(e.overflowY))continue;let r=n.getBoundingClientRect();i=Math.max(i,r.top),a=Math.min(a,r.bottom)}return a>i}),o=a.find(e=>!a.some(t=>t!==e&&e.contains(t))),s=o?.dataset.historyResult??o?.dataset.historyEntry??o?.dataset.historyMessage,c=o?.dataset.historyResult??o?.dataset.historyMessage,l=n?.entries.find(e=>e.id===c||e.id===s)?.id;if(!l&&s)for(let e of n?.entries??[])s.startsWith(`${e.id}-`)&&(!l||e.id.length>l.length)&&(l=e.id);return{key:l?s:void 0,entryId:l,offset:(o?.getBoundingClientRect().top??i)-i,scrollTop:e.scrollTop,pinned:t}}function wq(e,t){let n=!1;for(let r=e.parentElement;r&&r!==t;r=r.parentElement)if(r instanceof HTMLDetailsElement&&(r.open=!0),r.classList.contains(`turn-response-body`)&&r.hidden){let e=Array.from(t.querySelectorAll(`button[aria-controls]`)).find(e=>e.getAttribute(`aria-controls`)?.split(` `).includes(r.id));e&&(e.click(),n=!0)}return n}function Tq(e,t,n){if(e.scrollIntoView?.({block:`nearest`,inline:`nearest`,behavior:`instant`}),n){t.scrollTop=n.scrollTop;for(let r=e.parentElement;r&&r!==t;r=r.parentElement)!/^(auto|scroll|overlay)$/.test(getComputedStyle(r).overflowY)||r.scrollHeight<=r.clientHeight||(r.scrollTop+=e.getBoundingClientRect().top-t.getBoundingClientRect().top-n.offset)}return Math.max(0,t.scrollTop+e.getBoundingClientRect().top-t.getBoundingClientRect().top-(n?.offset??24))}function Eq(e,t){return Dq(e,t,`up`)}function Dq(e,t,n){for(let r of e.composedPath()){if(r===t)return!0;if(!(r instanceof HTMLElement))continue;let e=getComputedStyle(r);if(/^(auto|scroll|overlay)$/.test(e.overflowY)&&((n===`up`?r.scrollTop:r.scrollHeight-r.clientHeight-r.scrollTop)>0||/^(contain|none)$/.test(e.overscrollBehaviorY)))return!1}return!1}function Oq(e){let{t}=W(),n=(0,K.useRef)(null),r=(0,K.useRef)(null),i=(0,K.useRef)(!0),a=(0,K.useRef)(0),o=(0,K.useRef)(null);(0,K.useEffect)(()=>{let e=n.current,t=()=>{o.current=null};return e?.addEventListener(`scrollend`,t),()=>e?.removeEventListener(`scrollend`,t)},[]);let s=(0,K.useRef)(null),c=(0,K.useCallback)(()=>{s.current!==null&&cancelAnimationFrame(s.current),s.current=null},[]),l=(0,K.useCallback)(e=>{let t=n.current;if(!t)return;let r=window.matchMedia?.(`(prefers-reduced-motion: reduce)`),o=(e=t.scrollHeight)=>{c(),typeof t.scrollTo==`function`?t.scrollTo({top:e,behavior:`instant`}):t.scrollTop=e,a.current=t.scrollTop};if(!e||r?.matches||document.visibilityState===`hidden`||!t.clientHeight){o();return}if(s.current!==null)return;let l=t.scrollHeight-t.clientHeight-t.scrollTop;if(l<=1||l>t.clientHeight){o();return}let u=performance.now(),d=e=>{if(s.current=null,!i.current||n.current!==t)return;if(r?.matches||document.visibilityState===`hidden`){o();return}let a=Math.max(0,t.scrollHeight-t.clientHeight),c=a-t.scrollTop;if(c<=1){o(a);return}let l=Math.min(64,Math.max(1,e-u));u=e,o(t.scrollTop+Math.max(1,c*(1-Math.exp(-l/48)))),s.current=requestAnimationFrame(d)};s.current=requestAnimationFrame(d)},[c]),u=(0,K.useRef)(void 0),d=(0,K.useRef)(0),f=(0,K.useRef)(e.readingRestorePending);f.current=e.readingRestorePending;let[p,m]=(0,K.useState)(!1),h=(0,K.useRef)(null),g=e.activityObserved!==!1&&e.resultExposureEnabled!==!1,_=(0,K.useCallback)(()=>{h.current?.abort(),h.current=null},[]),v=(0,K.useRef)(void 0),y=(0,K.useRef)(e.scrollToBottom),b=(0,K.useRef)(null),x=(0,K.useMemo)(()=>e.readingCache??new Map,[e.readingCache]),S=e.historyNavigation,C=S?JSON.stringify([S.sessionId,S.sessionPath,S.entryId,S.revision]):null,w=(0,K.useRef)(null),[T,E]=(0,K.useState)(null),D=JK(e.snapshot.selectedSession,{onAnchorChange:e.onHistoryAnchorChange,onRefresh:e.onRefreshHistory,preload:e.activityObserved!==!1&&e.resultExposureEnabled!==!1,beforePrepend:()=>{let e=n.current;e&&(b.current={...Cq(e,!1,k.current),scrollHeight:e.scrollHeight},i.current=!1)}},x,S),O=D.session,k=(0,K.useRef)(O);k.current=O;let A=O?.id,j=O?.path,M=O?.cwd,N=T&&T.sessionId===A&&T.sessionPath===j?T.entryId:void 0,P=JSON.stringify([A,j]),{capture:F,restore:I,clear:ee}=HK(n,i,P,a);(0,K.useLayoutEffect)(()=>c,[P,c]);let L=JSON.stringify([e.snapshot.selectedSession?.id,e.snapshot.selectedSession?.path,e.snapshot.selectedSession?.history?.leafEntryId??e.snapshot.selectedSession?.entries.at(-1)?.id]);(0,K.useLayoutEffect)(()=>(g||_(),_),[L,C,g,_]),(0,K.useLayoutEffect)(()=>{let e=n.current;if(!e||!A||!j)return;let t=()=>{f.current||uK(x,P,{position:Cq(e,i.current,k.current)})};window.addEventListener(`pagehide`,t);let r=()=>{document.visibilityState===`hidden`&&t()};return document.addEventListener(`visibilitychange`,r),()=>{window.clearTimeout(d.current),window.removeEventListener(`pagehide`,t),document.removeEventListener(`visibilitychange`,r),t()}},[P,x,A,j]);let R=(0,K.useRef)(P),[te,z]=(0,K.useState)({});(0,K.useLayoutEffect)(()=>{R.current!==P&&(R.current=P,z({}))},[P]);let B=(0,K.useMemo)(()=>new Map((O?.entries??[]).flatMap(e=>e.turnChanges&&e.turnChanges.sessionId===O?.id?[[e.turnChanges.promptEntryId,e.turnChanges]]:[])),[O?.entries,O?.id]),ne=(0,K.useRef)(D.reset),re=D.hasNewer||D.verifying,ie=HD(e.snapshot,O),ae=e.snapshot.selectedExecution?.sessionId===O?.id&&e.snapshot.selectedExecution?.sessionPath===O?.path?e.snapshot.selectedExecution:void 0,oe=ie&&e.liveActiveTurn!==void 0?e.liveRunning:ie&&e.liveRunning||(ae?ae.status===`running`:ie&&e.snapshot.runtime.status===`running`),se=!re&&oe?ie&&e.liveActiveTurn!==void 0?e.liveRetry??void 0:ae?ae.retry:ie?e.liveRetry??void 0:void 0:void 0,ce=(0,K.useRef)({scope:P,nativeRowKeys:new Map,ambiguousTimingIds:new Set});ce.current.scope!==P&&(ce.current={scope:P,nativeRowKeys:new Map,ambiguousTimingIds:new Set});let{entries:le,projectedPrompts:H}=(0,K.useMemo)(()=>RK({...e.snapshot,selectedSession:O},re?[]:e.liveMessages.filter(e=>e.optimistic?e.optimistic.sessionId===O?.id&&e.optimistic.sessionPath===O?.path:ie),ce.current),[e.snapshot,O,ie,re,e.liveMessages]);(0,K.useEffect)(()=>{O&&H.length>0&&e.onPromptProjection?.(O.id,O.path,H)},[O,H,e.onPromptProjection]),(0,K.useEffect)(()=>{let e=n.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{if(!i.current){I(),F();return}l(oe)});return t.observe(e),r.current&&t.observe(r.current),()=>t.disconnect()},[l,oe,I,F]);let{rows:de,turns:fe}=(0,K.useMemo)(()=>{let n=GD(le.map(e=>e.message)),r=rq(le,oe&&!re,!!se),i=[...r.finalErrors].at(-1),a=-1;for(let e=le.length-1;e>=0;e--)if(le[e].message.role===`assistant`){a=e;break}let o=new Map,s,c=new Map,l=new Set,u=ie?e.snapshot.runtime.liveTools??[]:[],d=ae?.liveTools??[],f=re?[]:[...u,...d.filter(e=>!u.some(t=>t.call.id===e.call.id))];le.forEach(e=>{let{message:t}=e;t.role===`toolResult`&&t.toolCallId&&c.set(t.toolCallId,e),t.parts?.forEach(e=>{e.type===`toolCall`&&e.id&&![`ask_user`,`human_handoff`].includes(e.name)&&l.add(e.id)})});let p=[],m=0,h,g=-1,_=-1;for(let e=le.length-1;e>=0;e--){if(le[e]?.message.role===`user`){_=e;break}if(le[e]?.message.role===`custom`&&le[e]?.message.customType===`openpi-setup-request`)break}let v=new Set,y=-1;le.forEach(({message:e},t)=>{e.role===`user`||e.role===`custom`&&e.customType===`openpi-setup-request`?(y>=0&&v.add(y),y=-1):e.role===`assistant`&&e.content.trim()&&(y=t)}),y>=0&&v.add(y);let b=le.flatMap((u,d)=>{let y=u.message;if(u.forkSnapshotBoundary)return[{key:u.key,turn:m,kind:`custom`,forkSnapshotBoundary:!0,content:null}];if(u.timing)return[{key:u.key,turn:m,kind:`custom`,timing:u.timing,content:null}];if(u.compaction)return[{key:u.key,turn:m,kind:`custom`,content:(0,q.jsx)(QG,{compaction:{state:`completed`}})}];if(y.role===`custom`){if(y.customType===`openpi-web-command-handled`){let e=y.details;return e&&typeof e==`object`&&`inputEntryId`in e&&typeof e.inputEntryId==`string`?[{key:u.key,turn:m,kind:`custom`,commandHandledInputId:e.inputEntryId,commandHandledCommandId:`commandId`in e&&typeof e.commandId==`string`?e.commandId:void 0,content:null}]:[]}return y.display===!1||![`openpi-web-command-feedback`,`openpi-setup-request`,`openpi-setup-closed`,`subagent-result`,`workflow-result`].includes(y.customType??``)?[]:(y.customType===`openpi-setup-request`&&(h=void 0,g=-1,m++),[{key:u.key,turn:m,kind:`custom`,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-entry":u.entryId??u.key,tabIndex:-1,children:(0,q.jsx)(`div`,{className:`message-content`,children:(0,q.jsx)(hq,{message:y,sessionId:A??``,onInspectSubagent:e.onInspectSubagent,fullSubagent:e.snapshot.preferences.subagentResultDisplay===`full`})})})}])}if(y.role===`user`){h=y.content,g=d,m++,p.push({entryId:u.entryId??u.key,title:Array.from((y.content||t(`attachedImage`)).replace(/\s+/g,` `).trim()).slice(0,240).join(``)});let n=u.entryId?JSON.stringify([A,j,u.entryId]):``,r=te[n],i=!!(y.truncation?.visibleText&&r===void 0);return[{key:u.key,turn:m,kind:`prompt`,pendingPrompt:!!u.optimistic,promptCommandId:u.optimistic?.commandId??y.commandId,promptEntryId:u.entryId,content:(0,q.jsxs)(`article`,{className:`message-row user`,id:`turn-${m}`,"data-history-entry":u.entryId??u.key,"data-history-highlighted":N&&u.entryId===N||void 0,tabIndex:-1,children:[(0,q.jsxs)(`div`,{className:`message-content`,children:[(0,q.jsx)(zK,{message:y,sessionId:A,path:j,entryId:u.entryId}),(y.content||y.truncation?.visibleText)&&(u.entryId&&A&&j&&y.truncation?.visibleText?(0,q.jsx)(iK,{preview:y.content,sessionId:A,sessionPath:j,entryId:u.entryId,markdown:!1,fullText:r,onComplete:e=>z(t=>({...t,[n]:e}))},`${A}:${j}:${u.entryId}`):(0,q.jsx)(rK,{content:y.content}))]}),(0,q.jsx)(mq,{content:r??y.content,editable:ie&&!oe&&!!(e.forkAvailable&&e.onEdit&&u.entryId&&A&&j&&!u.optimistic)&&!i,copyRequiresFull:i,timestamp:u.timestamp,onResend:t=>e.onEdit&&u.entryId&&A&&j?e.onEdit({sessionId:A,sessionPath:j,entryId:u.entryId},t):Promise.resolve(!1),onFork:u.entryId&&A&&j&&e.onFork&&!u.optimistic?()=>e.onFork({sessionId:A,sessionPath:j,entryId:u.entryId}):void 0,canFork:ie&&!oe&&e.forkAvailable,forkPending:e.forkPending})]})}]}if(y.role===`assistant`){let b=p.at(-1);b&&y.content.trim()&&(b.reply=Array.from(y.content.replace(/\s+/g,` `).trim()).slice(0,240).join(``));let x=[],S=y.parts??[],C=y.webSearch??[],w=e=>Math.min(S.length,e.beforePartIndex??0),T=e=>{for(let[t,n]of C.entries()){if(w(n)!==e)continue;let r=n.status===`completed`?`done`:n.status===`failed`?`error`:`warn`;x.push({key:`${u.key}-native-search-${t}`,turn:m,kind:`process`,processType:`tool`,processToolName:`web_search`,processPreview:n.query,processStatus:r,error:n.status===`failed`,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-entry":`${u.entryId??u.key}-native-search-${t}-body`,"data-history-message":u.entryId??u.key,tabIndex:-1,children:(0,q.jsx)(`div`,{className:`message-content`,children:(0,q.jsx)(oq,{body:n.query,icon:(0,q.jsx)(Gs,{}),name:`web_search`,summary:n.query,status:r})})})})}},E=S.reduce((e,t,n)=>(t.type===`thinking`||t.type===`text`)&&!t.text.trim()?e:n,-1),D=S.reduce((e,t,n)=>t.type===`text`?n:e,-1),O=!!(u.entryId&&A&&j&&y.truncation?.visibleText),k=y.content,F=u.entryId?JSON.stringify([A,j,u.entryId]):``,I=te[F],ee=!!(y.truncation?.visibleText&&I===void 0),L=(t,n,r)=>{if(O&&!r||!O&&!t.trim())return;let i=r&&!re&&!se&&e.activityObserved!==!1&&oe&&ae?.compaction?.state!==`running`&&!y.stopReason&&d===le.length-1&&E===D,a=r&&v.has(d)&&!i&&(y.stopReason===`stop`||y.stopReason===`length`||y.stopReason===`error`||y.stopReason===`aborted`||!oe&&!y.parts?.some(e=>e.type===`toolCall`));x.push({key:n,turn:m,kind:`response`,responseEntryId:u.entryId,final:r&&(y.stopReason===`stop`||y.stopReason===`length`),content:(0,q.jsxs)(`article`,{className:`message-row assistant response${a?` final-response`:``}`,"data-streaming":i||void 0,"data-history-message":u.entryId??u.key,"data-history-highlighted":N&&u.entryId===N||void 0,tabIndex:-1,"data-history-entry":u.entryId?`${u.entryId}-${n.slice(u.key.length+1)}`:n,children:[(0,q.jsx)(`div`,{className:`message-content`,children:O&&A&&j&&u.entryId?(0,q.jsx)(iK,{preview:k,sessionId:A,sessionPath:j,entryId:u.entryId,markdown:!0,fullText:I,onComplete:e=>z(t=>({...t,[F]:e}))},`${A}:${j}:${u.entryId}`):(0,q.jsx)(vD,{streaming:i,children:t},P)}),a&&(0,q.jsx)(mq,{content:I??y.content,editable:!1,copyRequiresFull:ee,timestamp:u.timestamp,onResend:e.onResend,onRegenerate:b?.entryId&&A&&j&&e.onRegenerate&&!u.optimistic&&!y.isError&&(y.stopReason===`stop`||y.stopReason===`length`)?()=>e.onRegenerate({sessionId:A,sessionPath:j,entryId:b.entryId}):void 0,onFork:u.entryId&&A&&j&&e.onFork?()=>e.onFork({sessionId:A,sessionPath:j,entryId:u.entryId}):void 0,canFork:ie&&!oe&&e.forkAvailable,forkPending:e.forkPending})]})})};y.parts?.forEach((r,i)=>{if(T(i),r.type===`text`&&(S[i-1]?.type!==`text`||C.some(e=>w(e)===i))){let e=r.text,t=i+1;for(;S[t]?.type===`text`&&!C.some(e=>w(e)===t);){let n=S[t];n?.type===`text`&&(e+=n.text),t++}L(e,`${u.key}-text-${i}`,t>D)}if(r.type===`thinking`&&r.text.trim()){let t=!re&&!se&&!y.stopReason&&ae?.compaction?.state!==`running`&&oe&&d===le.length-1&&i===E?e.activityObserved===!1?`unknown`:`running`:`done`;x.push({key:`${u.key}-thinking-${i}`,turn:m,kind:`process`,processType:`thinking`,processPreview:aq(r.text),processStatus:t,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-entry":`${u.entryId??u.key}-thinking-${i}-body`,"data-history-message":u.entryId??u.key,"data-history-highlighted":N&&u.entryId===N||void 0,tabIndex:-1,children:(0,q.jsx)(`div`,{className:`message-content`,children:(0,q.jsx)(pq,{body:r.text,truncated:r.textTruncated,source:u.entryId&&A&&j&&r.sourcePartIndex!==void 0?{sessionId:A,sessionPath:j,entryId:u.entryId,partIndex:r.sourcePartIndex}:void 0,status:t,level:t===`running`?e.snapshot.thinking?.level:void 0,duration:LK(u,e.thinkingDurations),defaultOpen:e.snapshot.preferences.expandThinking===!0},JSON.stringify([A,j,u.key,i]))})})})}if(r.type===`toolCall`){let a=r,o=f.find(e=>e.call.id===a.id),s=a.id?c.get(a.id):void 0,d=s?.message??o?.result,p=$G(a,d,f,s?void 0:o?.state),h=p?[...p.children.map(e=>({call:e.call,child:e})),...p.showWrapper?[{call:a}]:[]]:[{call:a}];for(let[r,{call:o,child:g}]of h.entries()){let _=o.name.startsWith(`subagent`)?e.snapshot.preferences.subagentResultDisplay===`full`:o.name===`bash`?e.snapshot.preferences.bashToolDisplay===`full`:o.name===`write`||o.name===`edit`?e.snapshot.preferences.fileMutationDisplay===`full`:!1,v=o.id?f.find(e=>e.call.id===o.id):void 0,y=g?s:o.id?c.get(o.id):void 0,b=g?void 0:y?.message,S=g?g.result:b??v?.result,C=g?g.state:b?void 0:v?.state,w=g?g.state===`returned`?`done`:g.state===`failed`?`error`:g.state===`cancelled`||g.state===`timed_out`?`warn`:g.state:QK(S,C),T=e.activityObserved===!1&&w===`running`?`unknown`:w,E=p&&r===h.length-1&&!p.showWrapper?(0,q.jsxs)(`details`,{className:`evidence-raw`,children:[(0,q.jsx)(`summary`,{children:t(`toolCodemodeDetails`)}),(0,q.jsx)(`pre`,{children:pd(a.arguments).text}),(0,q.jsx)(`pre`,{children:pd(d?.content??``).text})]}):null,D=o.name===`plan_ready`&&S&&aK(S)?(0,q.jsx)(oK,{result:S,sessionId:A,sessionPath:j,entryId:y?.entryId},`${u.key}-${o.id||i}-plan`):hd(o.name)&&!g?.outputMissing?(0,q.jsx)(xK,{call:o,result:S,liveState:C,observed:e.activityObserved,cwd:M,defaultOpen:_,children:E},`${u.key}-${o.id||i}-evidence`):g?.outputMissing?null:uq(o,S,{sessionId:A??``,subagents:ie?e.snapshot.runtime.capabilities.subagents?.items:void 0,workflows:ie?e.snapshot.runtime.capabilities.workflows?.items:void 0,records:n,onInspectSubagent:e.onInspectSubagent,liveState:C,defaultOpen:_,observed:e.activityObserved!==!1}),O=XK(o.arguments),{Icon:k,action:P}=hK(o.name),F=P===`agent`?cq(O,YK(S?.details)).map(t=>UD(t,ie?e.snapshot.runtime.capabilities.subagents?.items:void 0,n)).join(t(`toolGroupSeparator`)):vK(o.name,O),I=(0,q.jsx)(k,{},`${u.key}-${o.id||i}-icon`);x.push({key:`${u.key}-tool-${o.id||i}`,turn:m,kind:o.name===`plan_ready`&&S&&aK(S)?`response`:D&&(o.name===`subagent_spawn`||o.name===`workflow`)?`custom`:`process`,processType:/^(subagent|workflow)/u.test(o.name)?`activity`:`tool`,processToolName:o.name,processPreview:F.split(` +`).find(Boolean),processStatus:T,error:T===`error`,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-message":u.entryId??u.key,"data-history-result":y?.entryId,"data-history-highlighted":N&&(u.entryId===N||y?.entryId===N)||void 0,tabIndex:-1,children:(0,q.jsxs)(`div`,{className:`message-content`,children:[D||(0,q.jsx)(oq,{body:o.name===`bash`&&typeof O.command==`string`?O.command:o.arguments,icon:I,name:o.name||`tool`,summary:P===`search`&&typeof O.path==`string`?t(`toolSearchTarget`,{path:O.path,pattern:iq(o.name,O)}):iq(o.name,O),output:g?g.error??S?.content:o.id&&l.has(o.id)?S?.content:void 0,status:T,evidenceState:e.activityObserved===!1&&g?.state===`running`?`unknown`:g?.state,rawDetails:p?.showWrapper&&o.id===a.id?d?.details:void 0,note:g?.outputMissing?t(g.argumentsOmitted?`toolNestedArgumentsMissing`:`toolNestedOutputMissing`):void 0,snapshotMissingResult:S?.forkSnapshotToolResult,defaultOpen:_,children:E}),p?.incomplete&&r===h.length-1&&(0,q.jsx)(`p`,{className:`evidence-note`,role:`status`,children:t(`toolNestedIncomplete`)}),D&&!hd(o.name)&&E]})})})}}}),T(S.length),D<0&&L(y.content,`${u.key}-answer`,!0),y.stopReason===`error`&&!r.finalErrors.has(d)&&(o.set(u.key,[...x]),x.length=0);let R=r.groups.get(d);if(R&&(R.state===`retrying`&&se&&(s=`${R.attempts[0].key}-attempts`),x.push({key:`${R.attempts[0].key}-attempts`,turn:m,kind:`outcome`,outcome:R.state===`interrupted`?`interrupted`:void 0,content:(0,q.jsx)(`article`,{className:`message-row assistant outcome-row`,children:(0,q.jsx)(nq,{state:R.state,retry:R.state===`retrying`?se:void 0,observed:e.activityObserved!==!1&&ae?.status!==`unknown`,attempts:R.attempts.map(e=>({entry:e,content:o.get(e.key)}))})})})),r.finalErrors.has(d)||y.stopReason===`aborted`){let t=y.stopReason===`error`,n=g===_&&d===i&&d===a?h:void 0;x.push({key:`${u.key}-outcome`,turn:m,kind:`outcome`,error:t,outcome:t?`failed`:`interrupted`,content:(0,q.jsx)(`article`,{className:`message-row assistant outcome-row`,children:(0,q.jsx)(tq,{failed:t,error:y.errorMessage,retryPrompt:n,retryEntryId:u.entryId,canRetry:ie&&!re&&!oe,onRetry:e.onResend})})})}else(y.stopReason===`stop`||y.stopReason===`length`)&&x.push({key:`${u.key}-completed`,turn:m,kind:`outcome`,outcome:`completed`,content:null});return x}if(y.role===`toolResult`){if(y.toolCallId&&l.has(y.toolCallId))return[];if(aK(y))return[{key:u.key,turn:m,kind:`response`,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-message":u.entryId??u.key,"data-history-highlighted":N&&u.entryId===N||void 0,tabIndex:-1,children:(0,q.jsx)(`div`,{className:`message-content`,children:(0,q.jsx)(oK,{result:y,sessionId:A,sessionPath:j,entryId:u.entryId})})})}];let r=y.toolName?.startsWith(`subagent`)?`subagent`:y.toolName?.startsWith(`workflow`)?`workflow`:null,i=QK(y),a=e.activityObserved===!1&&i===`running`?`unknown`:i,o=y.toolName||`tool`,s=r===`subagent`?e.snapshot.preferences.subagentResultDisplay===`full`:o===`bash`?e.snapshot.preferences.bashToolDisplay===`full`:o===`write`||o===`edit`?e.snapshot.preferences.fileMutationDisplay===`full`:!1,{Icon:c}=hK(o),d=(0,q.jsx)(c,{},`${u.key}-icon`),f=r===`subagent`&&!y.forkSnapshotToolResult?uq({type:`toolCall`,id:y.toolCallId,name:o,arguments:`{}`},y,{sessionId:A??``,subagents:ie?e.snapshot.runtime.capabilities.subagents?.items:void 0,records:n,onInspectSubagent:e.onInspectSubagent,defaultOpen:s,observed:e.activityObserved!==!1}):r&&!y.forkSnapshotToolResult?(0,q.jsx)(sq,{family:r,title:`${o.replaceAll(`_`,` `)} · ${zD(y.content)}`,body:y.content,status:a,defaultOpen:s},`${u.key}-card`):gq(y.content)&&!y.forkSnapshotToolResult?(0,q.jsxs)(`div`,{className:`tool-line-empty`,children:[(0,q.jsx)(`span`,{className:`tool-icon`,children:d}),(0,q.jsx)(`span`,{className:`tool-name`,children:o}),(0,q.jsx)(`span`,{className:`tool-summary`,children:t(`noOutput`)}),(0,q.jsx)($K,{status:a})]},`${u.key}-empty`):(0,q.jsx)(oq,{body:y.content,icon:d,name:o,summary:zD(y.content),status:a,snapshotMissingResult:y.forkSnapshotToolResult,defaultOpen:s},`${u.key}-evidence`);return[{key:u.key,turn:m,kind:o===`ask_user`||o===`human_handoff`?`response`:`process`,processType:r?`activity`:`tool`,processToolName:o,processStatus:a,error:a===`error`,content:(0,q.jsx)(`article`,{className:`message-row assistant detail-only`,"data-history-entry":`${u.entryId??u.key}-body`,"data-history-message":u.entryId??u.key,"data-history-highlighted":N&&u.entryId===N||void 0,tabIndex:-1,children:(0,q.jsx)(`div`,{className:`message-content`,children:f})})}]}return[]}),x=b.length;for(;x>0&&b[x-1].pendingPrompt;)x--;let S=b.length-x,C=b[x-1]?.turn??0;se&&!s&&(s=`native-retry`,b.splice(x,0,{key:`native-retry`,turn:C,kind:`outcome`,content:(0,q.jsx)(`article`,{className:`message-row assistant outcome-row`,children:(0,q.jsx)(nq,{attempts:[],state:`retrying`,retry:se,observed:e.activityObserved!==!1&&ae?.status!==`unknown`})})}));let w=!re&&ae?.compaction;if(w&&w.state!==`completed`){let n=b.findIndex(e=>e.key===s),r={key:`native-compaction-${w.startedAt??w.state}`,turn:b[n]?.turn??C,kind:`custom`,content:(0,q.jsx)(QG,{compaction:w,observed:e.activityObserved!==!1&&ae?.status!==`unknown`})};b.splice(n<0?x:n,0,r),w.state===`failed`&&w.errorMessage&&b.splice(b.length-S,0,{key:`native-compaction-error`,turn:r.turn,kind:`custom`,content:(0,q.jsx)(`article`,{className:`message-row assistant outcome-row`,children:(0,q.jsx)(eq,{label:t(`compactionFailed`),message:w.errorMessage})})})}return{rows:b,turns:p}},[ie,oe,ae,se,e.activityObserved,re,le,e.onResend,e.onEdit,e.onRegenerate,e.onFork,e.forkAvailable,e.forkPending,e.onInspectSubagent,e.snapshot.runtime.capabilities.subagents,e.snapshot.runtime.capabilities.workflows?.items,e.snapshot.preferences.expandThinking,e.snapshot.preferences.subagentResultDisplay,e.snapshot.preferences.bashToolDisplay,e.snapshot.preferences.fileMutationDisplay,e.snapshot.thinking?.level,e.thinkingDurations,e.snapshot.runtime.liveTools,A,j,M,te,P,N,t]),pe=BK(e.snapshot.selectedSession,fe,g),me=(0,K.useCallback)(async(t,r=!1)=>{if(_(),!g||!A||!j)return!1;let s=n.current,c=Array.from(s?.querySelectorAll(`[data-history-entry]`)??[]).find(e=>e.dataset.historyEntry===t);if(s&&c){o.current=null,ee(),i.current=!1,m(!0),E({sessionId:A,sessionPath:j,entryId:t});let e=Math.max(0,s.scrollTop+c.getBoundingClientRect().top-s.getBoundingClientRect().top-16),n=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;return s.scrollTo?.({top:e,behavior:r||n?`instant`:`smooth`}),typeof s.scrollTo!=`function`&&(s.scrollTop=e),a.current=s.scrollTop,F(),c.focus({preventScroll:!0}),!0}if(r)return;if(!e.onNavigateToMessage)return!1;let l=new AbortController;h.current=l;let u=await e.onNavigateToMessage({sessionId:A,sessionPath:j,entryId:t},l.signal);if(!(l.signal.aborted||h.current!==l))return h.current=null,u},[_,F,ee,g,A,j,e.onNavigateToMessage]);(0,K.useLayoutEffect)(()=>{let t=n.current;if(!t||!O)return;let r=lK(O),s=v.current!==r,c=ne.current!==D.reset,u=s||c;ne.current=D.reset;let d=y.current!==e.scrollToBottom;if(y.current=e.scrollToBottom,S&&C!==w.current&&S.sessionId===O.id&&S.sessionPath===O.path){i.current=!1,b.current=null,v.current=r;return}if(d&&D.engaged){b.current=null,D.resetToLatest();return}let p=s&&!c&&!d?x.get(r)?.position:void 0,h=p?.key&&Array.from(t.querySelectorAll(`[data-history-entry], [data-history-message], [data-history-result]`)).some(e=>e.dataset.historyEntry===p.key||e.dataset.historyMessage===p.key||e.dataset.historyResult===p.key),g=b.current??(p&&!p.pinned&&(!f.current||h)?{...p,scrollHeight:t.scrollHeight}:null);if(b.current=null,g&&(!u||p)&&!d){let e=Array.from(t.querySelectorAll(`[data-history-entry], [data-history-message], [data-history-result]`)),n=g.key===void 0?void 0:e.find(e=>e.dataset.historyEntry===g.key)??e.reverse().find(e=>e.dataset.historyMessage===g.key||e.dataset.historyResult===g.key);i.current=!1,o.current=null,ee(),m(!0),v.current=r;let s=()=>{if(n&&!t.contains(n))return;b.current===g&&(b.current=null);let e=n?Tq(n,t,g):g.scrollTop+t.scrollHeight-g.scrollHeight;typeof t.scrollTo==`function`?t.scrollTo({top:e,behavior:`instant`}):t.scrollTop=e,a.current=t.scrollTop,F()};if(n&&wq(n,t)){b.current=g;let e=requestAnimationFrame(s);return()=>cancelAnimationFrame(e)}s();return}(u||d||i.current)&&(i.current=!0,m(!1),l(oe&&!u&&!d)),v.current=r},[O,le,D.reset,D.engaged,D.resetToLatest,e.scrollToBottom,x,S,C,l,F,ee,oe]),(0,K.useLayoutEffect)(()=>{let e=n.current;if(!e||!O||!S||C===w.current||S.sessionId!==O.id||S.sessionPath!==O.path)return;let t=Array.from(e.querySelectorAll(`[data-history-entry], [data-history-message], [data-history-result]`)),r=t.filter(e=>e.dataset.historyEntry===S.entryId||e.dataset.historyMessage===S.entryId||e.dataset.historyResult===S.entryId),s=S.restorePosition?.key?t.find(e=>e.dataset.historyEntry===S.restorePosition.key)??[...t].reverse().find(e=>e.dataset.historyMessage===S.restorePosition.key||e.dataset.historyResult===S.restorePosition.key):void 0,c=s??r.find(e=>e.classList.contains(`response`))??r.find(e=>e.dataset.historyMessage===S.entryId||e.dataset.historyResult===S.entryId)??r[0];if(!c)return;o.current=null,ee(),wq(c,e);let l=()=>{if(!e.contains(c)||S.restorePosition&&w.current===C)return;let t=Tq(c,e,s?S.restorePosition:void 0);e.scrollTo?.({top:t,behavior:`instant`}),typeof e.scrollTo!=`function`&&(e.scrollTop=t),a.current=e.scrollTop,S.restorePosition||c.focus({preventScroll:!0}),i.current=!1,F(),m(!0),S.restorePosition||E(S),w.current=C,uK(x,lK(O),{position:Cq(e,!1,O)})},u=document.querySelector(`dialog[open]`),d,f=()=>{d=requestAnimationFrame(l)};return u?u.addEventListener(`close`,f,{once:!0}):f(),()=>{u?.removeEventListener(`close`,f),d!==void 0&&cancelAnimationFrame(d)}},[O,S,C,x,ee,F]);let he=ie?se?`${t(`modelRetrying`)}${se.attempt&&se.maxAttempts?` (${se.attempt}/${se.maxAttempts})`:``}`:e.livePhase===`preparing`?t(`modelPreparing`):t(`modelRunning`):t(`backgroundSessionRunning`),ge=ie?0:ae?.liveTools.filter(e=>e.state===`running`).length??0,_e=ie&&e.liveActiveTurn!==void 0?e.liveActiveTurn:ae?ae.activeTurn:ie?e.snapshot.runtime.activeTurn:void 0,ve=oe&&_e&&O&&_e.sessionId===O.id&&_e.sessionPath===O?.path&&typeof _e.startedAt==`number`&&Number.isFinite(_e.startedAt)&&typeof _e.elapsedMs==`number`&&Number.isFinite(_e.elapsedMs)&&_e.elapsedMs>=0?_e:void 0,ye=!D.verifying&&ve&&(!re||ve.promptEntryId&&de.some(e=>e.promptEntryId===ve.promptEntryId))?ve:void 0,be=t=>{D.hasMore&&!D.error&&!D.verifying&&e.activityObserved!==!1&&e.resultExposureEnabled!==!1&&t.scrollTop<=Math.max(t.clientHeight,160)&&D.loadOlder()},xe=()=>{o.current=`up`,c(),i.current=!1,m(!0),D.retainReading()};return(0,q.jsxs)(`div`,{className:`transcript-surface`,children:[(0,q.jsx)(`div`,{ref:n,className:`conversation`,role:`log`,"aria-label":e.label??`Conversation`,tabIndex:0,onPointerDownCapture:e=>{e.target===e.currentTarget&&(o.current=`pointer`),S?.restorePosition&&(w.current=C)},onTouchStartCapture:e=>{u.current=e.touches[0]?.clientY,o.current=null,S?.restorePosition&&(w.current=C)},onTouchMove:e=>{let t=e.touches[0]?.clientY;t!==void 0&&u.current!==void 0&&t>u.current&&Eq(e.nativeEvent,e.currentTarget)?xe():t!==void 0&&u.current!==void 0&&t{let t=e.currentTarget,n=t.scrollTopa.current;a.current=t.scrollTop;let s=t.scrollTop+t.clientHeight>=t.scrollHeight-48;i.current=i.current?!n||s:r&&s&&(o.current===`down`||o.current===`pointer`),i.current||D.retainReading(),m(!i.current),F(),window.clearTimeout(d.current),d.current=window.setTimeout(()=>{!f.current&&A&&j&&t.isConnected&&uK(x,P,{position:Cq(t,i.current,k.current)})},200),n&&be(t)},onWheel:e=>{!e.defaultPrevented&&!e.ctrlKey&&!e.metaKey&&e.deltaY>0&&Dq(e.nativeEvent,e.currentTarget,`down`)&&(o.current=`down`),S?.restorePosition&&(w.current=C),!e.defaultPrevented&&!e.ctrlKey&&!e.metaKey&&e.deltaY<0&&Eq(e.nativeEvent,e.currentTarget)&&(xe(),be(e.currentTarget))},onKeyDown:e=>{S?.restorePosition&&[`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `].includes(e.key)&&(w.current=C);let t=e.target;!e.defaultPrevented&&!e.altKey&&!e.metaKey&&(!e.ctrlKey||e.key===`End`)&&([`ArrowDown`,`PageDown`,`End`].includes(e.key)||e.key===` `&&!e.shiftKey)&&t instanceof HTMLElement&&!t.isContentEditable&&!t.closest(`input, textarea, select`)&&!(e.key===` `&&t.closest(`button, summary`))&&Dq(e.nativeEvent,e.currentTarget,`down`)&&(o.current=`down`),!e.defaultPrevented&&!e.altKey&&!e.metaKey&&(!e.ctrlKey||e.key===`Home`)&&([`ArrowUp`,`PageUp`,`Home`].includes(e.key)||e.key===` `&&e.shiftKey)&&t instanceof HTMLElement&&!t.isContentEditable&&!t.closest(`input, textarea, select`)&&!(e.key===` `&&t.closest(`button, summary`))&&Eq(e.nativeEvent,e.currentTarget)&&(xe(),be(e.currentTarget))},children:(0,q.jsxs)(`div`,{ref:r,className:`conversation-content`,children:[e.notice,O?.rerun&&e.onOpenOriginal&&(0,q.jsxs)(`div`,{className:`message-branch-origin`,children:[(0,q.jsxs)(`button`,{type:`button`,onClick:()=>void e.onOpenOriginal(O.rerun.source),children:[(0,q.jsx)(Ws,{"aria-hidden":`true`}),` `,t(`openOriginalConversation`)]}),(0,q.jsx)(`span`,{children:t(`messageRerunWorkspaceHint`)})]}),(D.hasMore||D.error||D.verifying)&&(0,q.jsxs)(`div`,{className:`conversation-history`,children:[D.error&&(0,q.jsx)(`p`,{role:`alert`,children:t(D.error)}),D.error&&D.error!==`historyChanged`&&(0,q.jsx)(`button`,{type:`button`,className:`secondary`,disabled:D.loading,onClick:()=>void D.loadOlder(),children:t(`retryAdmissionCheck`)}),D.loading&&(0,q.jsx)(`p`,{role:`status`,children:t(`historyLoading`)}),D.verifying&&!D.error&&!D.loading&&(0,q.jsx)(`p`,{role:`status`,children:t(`historyVerifying`)}),D.hasMore&&(0,q.jsx)(`span`,{children:t(`historyOmitted`,{count:O?.truncation.entriesOmitted??0})})]}),Sq(de,oe&&(!re||!!ye)&&ae?.compaction?.state!==`running`,_e?.commandId,B,O,e.activityObserved===!1?void 0:ye,e.onReviewTurn,e.activityObserved!==!1,oe&&(!re||!!ye)),oe&&e.activityObserved!==!1&&ae?.compaction?.state!==`running`&&(0,q.jsxs)(`div`,{className:`conversation-execution-status sr-only`,role:`status`,"aria-live":`polite`,children:[(0,q.jsx)(`span`,{children:he}),ge>0&&(0,q.jsx)(`span`,{children:t(`observedSessionTools`,{count:ge})}),(ae?.pendingFollowUps??0)>0&&(0,q.jsx)(`span`,{children:t(`pendingFollowUpsHint`,{count:ae.pendingFollowUps})})]})]})}),(p||D.hasNewer)&&de.length>0&&(0,q.jsx)(V,{content:t(`jumpToLatest`),placement:`above`,children:(0,q.jsx)(`button`,{className:`jump-to-latest`,type:`button`,"aria-label":t(`jumpToLatest`),onClick:()=>{let e=n.current;e&&(c(),i.current=!0,m(!1),E(null),D.resetToLatest(),e.scrollTo({top:e.scrollHeight,behavior:window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?`instant`:`smooth`}),queueMicrotask(()=>{n.current===e&&(Array.from(e.querySelectorAll(`.message-row[tabindex="-1"]`)).reverse().find(e=>!e.closest(`[hidden], details:not([open])`))??e).focus({preventScroll:!0})}))},children:oe&&e.activityObserved!==!1?(0,q.jsxs)(`span`,{className:`latest-activity-dots`,"aria-hidden":`true`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]}):(0,q.jsx)(ue,{"aria-hidden":`true`})})}),(0,q.jsx)(wK,{items:pe.items,viewport:n,enabled:g,onHidden:_,onRequestPreview:pe.requestPreview,readingHistory:p||D.hasNewer,onNavigate:me},L)]})}function kq(e,t,n,r){let i=JSON.stringify([e,t.kind,t.id]),a=[],o=new Set,s=new Map,c=new Map,l=e=>({type:`toolCall`,id:e.toolId,name:e.name,arguments:e.argsPreview??`{}`}),u=(e,t)=>{a.push({type:`message`,id:e,timestamp:``,message:t})};for(let e of t.transcript){let t=JSON.stringify(e),n=c.get(t)??0;c.set(t,n+1);let i=e.id??`${t}:${n}`;if(e.kind===`user`)u(i,{role:`user`,content:e.text});else if(e.kind===`toolResult`){let t={role:`toolResult`,toolCallId:e.toolId,toolName:e.name,isError:e.isError,content:e.outputPreview??``};s.set(e.toolId,t),u(i,t)}else{let t=e.parts.map(e=>e.type===`toolCall`?(o.add(e.toolId),l(e)):e.type===`thinking`?{type:`thinking`,text:e.redacted?r:e.text}:e);u(i,{role:`assistant`,content:t.flatMap(e=>e.type===`text`?[e.text]:[]).join(` +`),parts:t,...t.some(e=>e.type===`toolCall`)?{stopReason:`toolUse`}:{}})}}let d=t.status===`running`,f=t.liveTools.map(e=>({call:l(e),result:s.get(e.toolId)??{role:`toolResult`,toolCallId:e.toolId,toolName:e.name,content:e.outputPreview??``,...e.done?{isError:e.isError===!0}:{}},state:s.has(e.toolId)?s.get(e.toolId).isError?`failed`:`returned`:e.done?e.isError?`failed`:`returned`:d?`running`:`unknown`})),p=[];return t.liveAssistant?.thinking&&p.push({type:`thinking`,text:t.liveAssistant.thinking}),t.liveAssistant?.text&&p.push({type:`text`,text:t.liveAssistant.text}),p.push(...f.filter(e=>!o.has(e.call.id)&&!s.has(e.call.id)).map(e=>e.call)),p.length&&u(t.nextEntryId??`live-assistant`,{role:`assistant`,content:t.liveAssistant?.text??``,parts:p}),t.finalText&&!a.some(e=>e.message?.role===`assistant`&&e.message.content.trim()===t.finalText.trim())&&u(`final-result`,{role:`assistant`,content:t.finalText,parts:[{type:`text`,text:t.finalText}]}),{protocolVersion:1,generatedAt:new Date(t.createdAt).toISOString(),cursor:0,preferences:n,sessions:[],workspaces:[],models:[],runtime:{status:`idle`,capabilities:{}},selectedSession:{id:i,path:``,cwd:t.cwd,entries:a,bytes:0,truncation:{truncated:t.truncated,entriesOmitted:t.omittedEntries,messagePartsOmitted:0,messagesTruncated:0,maxBytes:65536}},selectedExecution:{sessionId:i,sessionPath:``,status:d?`running`:t.status===`unknown`?`unknown`:`idle`,liveTools:f,liveToolsOmitted:0},truncation:{truncated:!1,sessionsOmitted:0,workspacesOmitted:0,modelsOmitted:0,maxBytes:0,bytes:0}}}function Aq({sessionId:e,sessionPath:t,id:n,kind:r=`subagents`,activity:i,client:a,saved:o,liveAvailable:s,fullView:c,readOnlyNote:l=!0,active:u=!0,refreshRevision:d=0,onDetail:f,showModel:p=!0}){let{t:m}=W(),[h,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(null),[y,b]=(0,K.useState)(!0),[x,S]=(0,K.useState)(0),[C,w]=(0,K.useState)(null),T=nu(WG,e=>e.snapshot?.preferences),E=(0,K.useMemo)(()=>h?kq(e,h,T??{theme:`system`},m(`subagentThinkingRedacted`)):null,[e,h,T,m]),D=(0,K.useRef)(f);D.current=f,(0,K.useEffect)(()=>{if(!u)return;if(!s){b(!1),v(m(`subagentUnavailable`));return}let o=new AbortController,c,l=!1,d=async()=>{if(l||o.signal.aborted||document.visibilityState===`hidden`)return;l=!0;let s=i?.status===`running`;try{let i=await(r===`workflows`?a.workflowAgentDetail(e,n,o.signal,...t?[t]:[]):a.subagentDetail(e,n,o.signal,...t?[t]:[]));if(o.signal.aborted)return;if(i.sessionId!==e||i.detail.kind!==r||i.detail.id!==n)throw g(null),s=!1,Error(m(`inspectionChanged`));s=i.detail.status===`running`,g(i.detail),D.current?.(i.detail),v(null),w(new Date().toLocaleTimeString())}catch(e){if(o.signal.aborted)return;v(e instanceof ge&&[404,501].includes(e.status)?m(`subagentUnavailable`):e instanceof Error?e.message:m(`inspectionUnavailable`))}finally{l=!1,o.signal.aborted||(b(!1),s&&(c=setTimeout(()=>void d(),1e3)))}},f=()=>{document.visibilityState===`visible`&&(clearTimeout(c),d())};return document.addEventListener(`visibilitychange`,f),d(),()=>{o.abort(),clearTimeout(c),document.removeEventListener(`visibilitychange`,f)}},[u,a,e,t,n,r,i?.status,x,d,s,m]);let O=h?.outcome===`interrupted`?`interrupted`:h?.status===`unknown`?void 0:h?.status,k=cG(h?.spend),A=c?`h2`:`h3`;return(0,q.jsxs)(`section`,{className:`subagent-detail`,"aria-label":m(`subagentDetails`),hidden:!u,children:[(0,q.jsxs)(`header`,{className:`subagent-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`subagent-state ${O??`unknown`}`,children:O?m(`subagentState_${O}`):!h&&o?.state?`${m(`subagentRecordedState`)}: ${m(`subagentState_${o.state}`)}`:m(`unknownState`)}),h&&(h.status===`running`||h.settledAt!==void 0)&&(0,q.jsx)(`span`,{className:`subagent-duration`,children:VD(h.createdAt,h.settledAt)})]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":m(`refreshStatus`),disabled:y||!s,onClick:()=>{b(!0),S(e=>e+1)},children:(0,q.jsx)(me,{})})]}),y&&!h&&(0,q.jsxs)(`div`,{className:`inspection-loading`,role:`status`,children:[(0,q.jsx)(`p`,{children:m(`inspectionLoading`)}),(0,q.jsxs)(`div`,{"aria-hidden":`true`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]})]}),_&&(0,q.jsxs)(`div`,{className:`inspection-warning`,role:`alert`,children:[(0,q.jsx)(`p`,{children:m(h?`subagentStale`:`subagentUnavailable`)}),_!==m(`subagentUnavailable`)&&(0,q.jsx)(`small`,{children:_})]}),h&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`subagent-metadata`,children:[(0,q.jsx)(`code`,{children:h.id}),p&&h.model&&(0,q.jsx)(`span`,{children:h.model}),k&&(0,q.jsx)(`span`,{title:m(`subagentSpend`),children:k}),(0,q.jsx)(`span`,{title:h.cwd,children:h.cwd})]}),(0,q.jsxs)(`details`,{className:`subagent-task`,children:[(0,q.jsx)(`summary`,{children:m(`subagentTask`)}),(0,q.jsx)(`pre`,{children:h.prompt})]}),h.errorText&&(0,q.jsx)(`p`,{className:`inspection-warning`,role:`alert`,children:h.errorText}),(0,q.jsx)(`div`,{className:`subagent-conversation`,children:(0,q.jsx)($E.Provider,{value:null,children:E&&(0,q.jsx)(Oq,{snapshot:E,label:m(`subagentTranscript`),activityObserved:u&&!_,liveMessages:[],liveRunning:h.status===`running`,livePhase:h.status===`running`?`running`:`idle`,liveRetry:null,thinkingStarts:{},thinkingDurations:{},scrollToBottom:0,notice:(0,q.jsxs)(q.Fragment,{children:[h.truncated&&(0,q.jsx)(`p`,{className:`inspection-note`,children:m(h.omittedEntries>0?`subagentTruncated`:`subagentTextTruncated`,{count:h.omittedEntries})}),h.kind===`workflows`&&h.transcriptUnavailable?(0,q.jsx)(`p`,{className:`inspection-note`,children:m(`subagentTranscriptUnavailable`)}):!h.transcript.length&&!h.liveAssistant?.text&&!h.liveAssistant?.thinking&&!h.liveTools.length&&!h.finalText?(0,q.jsx)(`p`,{className:`inspection-note`,children:m(`subagentNoMessages`)}):null]})})})}),(l||C)&&(0,q.jsxs)(`p`,{className:`subagent-footnote`,children:[l&&m(`subagentReadOnly`),l&&C&&` · `,C]})]}),!h&&!y&&o&&(0,q.jsxs)(`section`,{className:`subagent-transcript`,"aria-label":m(`subagentSaved`),children:[(0,q.jsx)(A,{children:m(`subagentSaved`)}),(0,q.jsx)(`p`,{className:`inspection-note`,children:m(`subagentSavedHint`)}),o.state&&(0,q.jsxs)(`p`,{children:[m(`subagentRecordedState`),`: `,m(`subagentState_${o.state}`)]}),o.result&&(0,q.jsx)(vD,{children:o.result}),o.receipt&&(0,q.jsxs)(`details`,{className:`subagent-task`,children:[(0,q.jsx)(`summary`,{children:m(`subagentSpawnReceipt`)}),(0,q.jsx)(`pre`,{children:o.receipt})]})]})]})}function jq({sessionId:e,sessionPath:t,initialId:n,initialKind:r=`subagents`,activity:i,workflows:a,observed:o=!0,records:s=[],liveAvailable:c=!0,onClose:l}){let{t:u,i18n:d}=W(),[f,p]=(0,K.useState)([]),m=(0,K.useRef)(null),h=(0,K.useRef)(0),[g,_]=(0,K.useState)(n?{id:n,kind:r}:null),[v,y]=(0,K.useState)(g),[b,x]=(0,K.useState)(null),S=g?.id;(0,K.useLayoutEffect)(()=>{!S&&m.current&&(m.current.scrollTop=h.current)},[S]);let C=(e,t=`subagents`)=>{let n=e?{id:e,kind:t}:null;n&&y(n),_(n)},[w,T]=(0,K.useState)(()=>window.matchMedia?.(`(max-width: 1100px)`).matches??!1);(0,K.useEffect)(()=>{let e=window.matchMedia?.(`(max-width: 1100px)`);if(!e)return;let t=()=>T(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let E=(0,K.useMemo)(()=>new de,[]),D=c?i?.items??[]:[],O=c?a?.items??[]:[],k=KD(D,s,O,o),[A,j]=(0,K.useState)(Date.now),M=k.some(e=>e.state===`running`);(0,K.useEffect)(()=>{if(!M||S)return;j(Date.now());let e=setInterval(()=>j(Date.now()),1e3);return()=>clearInterval(e)},[M,S]);let N=(i?.omitted??0)+O.reduce((e,t)=>e+(t.children?.omitted??0),0),P=k.find(e=>e.id===S&&e.kind===g?.kind),F=g?.kind===`subagents`?s.find(e=>e.id===S):void 0,I=b?.id===S&&b?.kind===g?.kind?b?.model:F?.model,ee=(0,K.useRef)(null),L=(0,K.useRef)(document.activeElement);(0,K.useEffect)(()=>{ee.current?.focus()},[g]),(0,K.useEffect)(()=>()=>{queueMicrotask(()=>{!document.querySelector(`.subagent-panel`)&&L.current instanceof HTMLElement&&L.current.isConnected&&L.current.focus()})},[]);let R=[{key:`active`,label:`subagentActiveGroup`,items:k.filter(e=>e.state===`running`),empty:`subagentNoneRunning`},{key:`done`,label:`subagentFinishedGroup`,items:k.filter(e=>e.state===`done`),empty:`subagentNoneFinished`},{key:`attention`,label:`subagentOtherGroup`,items:k.filter(e=>e.state===`error`||e.state===`interrupted`)},{key:`saved`,label:`subagentUnconfirmedGroup`,items:k.filter(e=>!e.state)}],te=e=>{let t=Math.max(0,Date.now()-e),n=t<36e5?`minute`:t<864e5?`hour`:`day`,r=n===`minute`?6e4:n===`hour`?36e5:864e5;return new Intl.RelativeTimeFormat(d.language,{numeric:`auto`}).format(-Math.floor(t/r),n)},z=w?`main`:`aside`,B=w?`h1`:`h2`,ne=w?`h2`:`h3`;return(0,q.jsxs)(z,{className:`subagent-panel`,"aria-label":u(`subagentDetails`),onKeyDown:e=>{e.key===`Escape`&&!e.nativeEvent.isComposing&&!e.defaultPrevented&&(e.preventDefault(),S?C(null):l())},children:[(0,q.jsxs)(`header`,{className:`subagent-panel-heading`,children:[(0,q.jsxs)(`div`,{className:`subagent-breadcrumb`,children:[S&&(0,q.jsx)(`button`,{ref:ee,type:`button`,className:`icon-button`,"aria-label":u(`backToSubagents`),onClick:()=>C(null),children:(0,q.jsx)(Ko,{})}),S?(0,q.jsx)($W,{identity:`${e}:${S}`}):(0,q.jsx)($o,{"aria-hidden":`true`}),(0,q.jsx)(B,{title:P?.title||F?.title||S,children:S?P?.title||F?.title||S:u(`subagentDetails`)})]}),S&&I&&(0,q.jsx)(`span`,{className:`subagent-panel-model`,title:I,children:I.split(`/`).at(-1)}),(0,q.jsx)(`button`,{ref:S?void 0:ee,type:`button`,className:`icon-button`,"aria-label":u(`close`),onClick:l,children:(0,q.jsx)(je,{})})]}),v&&(0,q.jsx)(Aq,{sessionId:e,sessionPath:t,id:v.id,kind:v.kind,activity:v.kind===`subagents`?D.find(e=>e.id===v.id):O.flatMap(e=>e.children?.items??[]).find(e=>e.id===v.id),client:E,saved:v.kind===`subagents`?s.find(e=>e.id===v.id):void 0,liveAvailable:c,fullView:w,showModel:!1,active:!!S,onDetail:e=>x(t=>t?.id===e.id&&t.kind===e.kind&&t.model===e.model?t:{id:e.id,kind:e.kind,model:e.model})},`${e}:${v.kind}:${v.id}`),!S&&(0,q.jsxs)(`nav`,{className:`subagent-list`,"aria-label":u(`subagentTasks`),ref:m,onScroll:e=>{h.current=e.currentTarget.scrollTop},children:[R.map(t=>{if(!t.items.length&&!t.empty)return null;let n=f.includes(t.key)?t.items:t.items.slice(0,t.key===`active`?4:10);return(0,q.jsxs)(`section`,{className:`subagent-list-group`,children:[(0,q.jsxs)(ne,{children:[u(t.label),(0,q.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,q.jsx)(`span`,{children:t.items.length})]}),!t.items.length&&t.empty&&(0,q.jsx)(`p`,{children:u(t.empty)}),(0,q.jsx)(`ul`,{className:`subagent-task-list`,children:n.map(t=>{let n=t.state??`unknown`,r=u(`subagentState_${n}`),i=t.state===`running`?t.taskPreview||u(`subagentProcessing`):t.state===`done`?void 0:r;return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,className:`subagent-task-row ${n}`,"aria-label":`${t.title||t.id} · ${r}${t.taskPreview&&i?` · ${i}`:``}`,onClick:()=>C(t.id,t.kind),children:[(0,q.jsx)($W,{identity:`${e}:${t.id}`}),(n===`running`||n===`done`)&&(0,q.jsx)(`span`,{className:`subagent-task-status`,children:r}),(0,q.jsx)(`span`,{className:`subagent-task-title`,title:t.title||t.id,children:t.title||t.id}),t.state===`running`?(0,q.jsx)(`span`,{className:`subagent-task-end`,children:VD(t.createdAt,A)}):t.timestamp?(0,q.jsx)(`time`,{className:`subagent-task-end`,dateTime:new Date(t.timestamp).toISOString(),title:new Date(t.timestamp).toLocaleString(d.language),children:te(t.timestamp)}):null,i&&(0,q.jsx)(`span`,{className:`subagent-task-description`,children:i})]})},`${t.kind}:${t.id}`)})}),n.lengthp(e=>[...e,t.key]),children:u(`subagentShowMore`,{count:t.items.length-n.length})})]},t.key)}),N>0&&(0,q.jsx)(`p`,{children:u(`subagentListTruncated`,{count:N})}),!!a?.omitted&&(0,q.jsx)(`p`,{children:u(`subagentWorkflowsTruncated`,{count:a?.omitted})})]})]})}var Mq=`openpi:subagent-panel:v1`;function Nq(){try{let e=JSON.parse(sessionStorage.getItem(Mq)??`null`);if(!e||typeof e!=`object`)return null;let{sessionId:t,sessionPath:n}=e;return typeof t!=`string`||!t||t.length>160||typeof n!=`string`||!n||n.length>4096?null:{sessionId:t,sessionPath:n,navigation:0}}catch{return null}}function Pq(e){try{e?sessionStorage.setItem(Mq,JSON.stringify({sessionId:e.sessionId,sessionPath:e.sessionPath})):sessionStorage.removeItem(Mq)}catch{}}function Fq({text:e,code:t=!1}){let{t:n}=W(),[r,i]=(0,K.useState)(!0),[a,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(``);return(0,K.useEffect)(()=>{let n=!1;return c(``),o(!1),t&&e.length<=1e5&&Ee(async()=>{let{default:e}=await import(`./app-common.js`);return{default:e}},__vite__mapDeps([3,1])).then(({default:t})=>{let r=t.highlight(e,{language:`javascript`,ignoreIllegals:!0}).value;n||c(Me.sanitize(r,{ALLOWED_TAGS:[`span`],ALLOWED_ATTR:[`class`]}))}).catch(()=>{}),()=>{n=!0}},[t,e]),(0,q.jsxs)(`div`,{className:`trajectory-payload`,"data-wrap":r,children:[(0,q.jsxs)(`div`,{className:`trajectory-payload-actions`,children:[(0,q.jsx)(`button`,{type:`button`,"aria-pressed":r,onClick:()=>i(!r),children:n(`trajectoryWrap`)}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{td(e).then(o)},children:n(a?`trajectoryCopied`:`trajectoryCopy`)})]}),(0,q.jsx)(`pre`,{children:s?(0,q.jsx)(`code`,{dangerouslySetInnerHTML:{__html:s}}):(0,q.jsx)(`code`,{children:e})})]})}function Iq(e){return e.map((e,t)=>({key:e.key,start:t,end:t+1,lane:e.kind===`call`||e.kind===`result`?2:+(e.kind===`assistant`),error:e.outcome===`error`||e.kind===`assistant`&&(e.message?.stopReason===`error`||e.message?.stopReason===`aborted`)}))}function Lq(e,t){return t===null?null:new Set(Iq(e).filter(e=>e.start<=t.end&&e.end>=t.start).map(e=>e.key))}function Rq(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&(n.kind!==`event`||n.message||n.input!==void 0||n.result))return n}return e.at(-1)}function zq(e){let t=[];for(let n of e){(n.kind===`user`||!t.length)&&t.push({key:n.key,...n.kind===`user`?{prompt:n}:{},runs:[]});let e=t.at(-1),r=e.runs.at(-1);n.kind===`event`&&r?.[0]?.kind===`event`?r.push(n):e.runs.push([n])}return t}function Bq(e){let t=new Map(e.map((e,t)=>[e.id,t])),n=new Map,r=new Map,i=new Map;for(let a of e){let e=`message`in a?a.message:void 0;for(let t of e?.parts??[])t.type===`toolCall`&&t.id&&r.set(t.id,(r.get(t.id)??0)+1);if(e?.role===`toolResult`&&e.toolCallId){let r=i.get(e.toolCallId)??[];r.push(e),n.set(e,t.get(a.id)??-1),i.set(e.toolCallId,r)}}let a=new Set,o=[];for(let s of e){let e=`message`in s?s.message:void 0;if(!e){o.push({key:s.id,kind:`event`,title:s.type,timestamp:s.timestamp});continue}if(e.role!==`toolResult`){(e.role!==`assistant`||e.content||!e.parts?.length||e.parts?.some(e=>e.type!==`toolCall`))&&o.push({key:s.id,kind:e.role===`user`?`user`:e.role===`assistant`?`assistant`:`event`,title:e.customType||e.role||s.type,timestamp:s.timestamp,message:e});for(let[c,l]of(e.parts??[]).entries()){if(l.type!==`toolCall`)continue;let u=l.id?i.get(l.id):void 0,d=l.id&&r.get(l.id)===1&&u?.length===1&&u[0]?.toolName===l.name&&!l.id.includes(`[truncated]`)&&(n.get(u[0])??-1)>(t.get(s.id)??-1)?u[0]:void 0;d&&a.add(d),o.push({key:`${s.id}:call:${c}`,kind:`call`,title:l.name,timestamp:s.timestamp,callId:l.id,input:l.arguments,message:e,result:d,outcome:d?.isError===!0?`error`:d?.isError===!1?`returned`:`unknown`})}}}let s=new Map(o.map(e=>[e.key,t.get(e.key)??-1]));for(let n of e){let e=`message`in n?n.message:void 0;e?.role===`toolResult`&&!a.has(e)&&(o.push({key:n.id,kind:`result`,title:e.toolName||`toolResult`,timestamp:n.timestamp,callId:e.toolCallId,result:e,outcome:e.isError===!0?`error`:e.isError===!1?`returned`:`unknown`}),s.set(n.id,t.get(n.id)??0));for(let[r,i]of(e?.parts??[]).entries())i.type===`toolCall`&&s.set(`${n.id}:call:${r}`,t.get(n.id)??0)}return o.sort((e,t)=>(s.get(e.key)??0)-(s.get(t.key)??0)),o}function Vq(e,t=[]){let n=Bq(e),r=new Set(n.map(e=>e.key)),i=e.flatMap(e=>e.message?.role===`assistant`&&!r.has(e.id)?[{key:e.id,kind:`assistant`,title:`assistant`,timestamp:e.timestamp,message:e.message}]:[]),a=new Map(e.map((e,t)=>[e.id,t])),o=new Map,s=new Map;for(let t of e)for(let[e,n]of(t.message?.parts??[]).entries())n.type===`toolCall`&&(o.set(`${t.id}:call:${e}`,t.id),n.id&&s.set(n.id,(s.get(n.id)??0)+1));return[...n,...i].sort((e,t)=>{let n=e=>a.get(o.get(e.key)??e.key)??-1;return n(e)-n(t)||Number(e.kind===`call`)-Number(t.kind===`call`)}).flatMap(e=>{if(e.kind!==`call`||e.title!==`codemode`)return[e];let n=e.message?.parts?.find(t=>t.type===`toolCall`&&t.id===e.callId);return n?.type!==`toolCall`||!n.id||s.get(n.id)!==1?[e]:[e,...($G(n,e.result,t)?.children??[]).map(t=>{let n=e.result?.nestedCalls?.calls.find(e=>e.call.id===t.call.id)?.durationMs;return{key:`${e.key}:nested:${t.call.id}`,kind:`call`,title:t.call.name,parentKey:e.key,callId:t.call.id,input:t.call.arguments,result:t.result,missingOutput:t.outputMissing,error:t.error,state:t.state,outcome:t.state===`returned`?`returned`:[`failed`,`cancelled`,`timed_out`].includes(t.state)?`error`:`unknown`,...n===void 0?{}:{durationMs:n}}})]})}function Hq(e){return e===void 0||!Number.isFinite(e)?`—`:e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(2)} s`}function Uq({nodes:e,selectedKey:t,range:n,onSelect:r,onRange:i}){let{t:a}=W(),o=Iq(e),s=(0,K.useRef)(null),c=Math.max(1,o.length);function l(e){let t=e.currentTarget.getBoundingClientRect();return Math.max(0,Math.min(c,(e.clientX-t.left)/Math.max(1,t.width)*c))}return(0,q.jsx)(`section`,{className:`trajectory-overview`,"aria-label":a(`trajectoryOverview`),children:(0,q.jsxs)(`div`,{className:`trajectory-overview-track`,children:[(0,q.jsxs)(`div`,{className:`trajectory-lane-labels`,children:[(0,q.jsx)(`span`,{children:a(`trajectoryContextLane`)}),(0,q.jsx)(`span`,{children:a(`trajectoryModelLane`)}),(0,q.jsx)(`span`,{children:a(`trajectoryToolLane`)})]}),(0,q.jsxs)(`svg`,{viewBox:`0 0 ${c} 3`,preserveAspectRatio:`none`,onPointerDown:e=>{e.button===0&&(s.current={start:l(e),key:e.target.getAttribute(`data-record-key`)},e.currentTarget.setPointerCapture(e.pointerId))},onPointerUp:e=>{let t=s.current;if(s.current=null,t===null)return;let n=t.start,a=l(e);Math.abs(a-n)>c/100?i({start:Math.min(n,a),end:Math.max(n,a)}):t.key&&r(t.key)},onPointerCancel:()=>{s.current=null},children:[(0,q.jsx)(`title`,{children:a(`trajectoryOverview`)}),[0,1,2].map(e=>(0,q.jsx)(`line`,{x1:`0`,x2:c,y1:e+.5,y2:e+.5},e)),o.map((n,i)=>(0,q.jsx)(`rect`,{x:n.start+.08,y:n.lane+.39,width:.84,height:.22,rx:.04,className:`${n.error?`error`:``} ${t===n.key?`selected`:``}`,"data-lane":n.lane,"data-kind":e[i].kind,"data-record-key":n.key,role:`button`,tabIndex:0,"aria-label":a(`trajectorySelectRecord`,{number:i+1,name:e[i].title}),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r(n.key))},children:(0,q.jsx)(`title`,{children:`${i+1} · ${e[i].title} · ${Hq(e[i].durationMs)}`})},n.key)),n&&(0,q.jsx)(`rect`,{className:`trajectory-range`,x:n.start,y:`0`,width:n.end-n.start,height:`3`})]}),n&&(0,q.jsx)(`button`,{type:`button`,className:`trajectory-clear-range`,onClick:()=>i(null),children:a(`trajectoryClearRange`)})]})})}var Wq=[];function Gq(e){return e.kind===`call`||e.kind===`result`?``:(e.message?.parts??[]).filter(e=>e.type===`thinking`).map(e=>e.text).join(` -`)}function Gq(e,t){return e.kind===`event`?t(`trajectoryEvent_${e.title}`,{defaultValue:e.title}):e.kind===`call`||e.kind===`result`?e.title:e.kind===`assistant`&&!e.message?.content&&Wq(e)?t(`trajectoryReasoningTitle`):t(`trajectory_${e.kind}`)}function Kq(e){if(e.input)try{let t=JSON.parse(e.input);if(t&&typeof t==`object`&&!Array.isArray(t)){let n=vK(e.title,t);if(n)return n}}catch{}return e.input||e.message?.content||e.message?.errorMessage||e.error||Wq(e)||e.result?.content||``}function qq({node:e}){let{t}=W();if(!e.outcome)return null;let n=e.state??(e.result?yd({type:`toolCall`,name:e.title,id:e.callId,arguments:e.input??``},e.result).state:void 0),r=t(n===`cancelled`||n===`timed_out`||n===`running`?`toolState_${n}`:`trajectory_${e.outcome}`),i=n===`running`||n===`timed_out`?vs:e.outcome===`returned`?rs:e.outcome===`error`?je:fs;return(0,q.jsxs)(`span`,{className:`trajectory-outcome ${e.outcome}`,title:r,children:[(0,q.jsx)(i,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:r})]})}function Jq({label:e,value:t}){return(0,q.jsxs)(`section`,{className:`trajectory-evidence`,children:[(0,q.jsx)(`h3`,{children:e}),(0,q.jsx)(Pq,{text:t})]})}function Yq({node:e,number:t,onClose:n}){let{t:r,i18n:i}=W(),a=(0,K.useId)(),[o,s]=(0,K.useState)(`summary`),c=e.result,l=e.message,u=Wq(e),d=e.kind===`call`||e.kind===`result`,f=[{key:`summary`,label:r(`trajectorySummary`)},...e.input===void 0?[]:[{key:`input`,label:r(`trajectoryInputTab`)}],...d?[{key:`output`,label:r(`trajectoryResultTab`)}]:[],{key:`timing`,label:r(`trajectoryTimingTab`)},...!d&&l?.role===`assistant`?[{key:`usage`,label:r(`trajectoryUsageTab`)}]:[]],p=e.timestamp?new Date(e.timestamp):null,m=p&&Number.isFinite(p.getTime())?p.toLocaleString(i.language,{hour12:!1}):e.timestamp,h=(0,q.jsxs)(q.Fragment,{children:[c?(0,q.jsx)(Jq,{label:r(`trajectoryOutput`),value:c.content||r(`noOutput`)}):(0,q.jsx)(`p`,{className:`trajectory-missing`,children:r(e.missingOutput?`trajectoryNestedOutputMissing`:`trajectoryMissingResult`)}),o===`output`&&c?.details!==void 0&&(0,q.jsxs)(`details`,{className:`trajectory-disclosure`,children:[(0,q.jsx)(`summary`,{children:r(`trajectoryStructured`)}),(0,q.jsx)(`pre`,{children:JSON.stringify(c.details,null,2)})]})]}),g=l&&(0,q.jsxs)(q.Fragment,{children:[l.content&&(0,q.jsx)(Jq,{label:r(`trajectoryRecordedContent`),value:l.content}),u&&(0,q.jsxs)(`details`,{className:`trajectory-disclosure trajectory-reasoning`,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(Zs,{"aria-hidden":`true`}),r(`trajectoryThinking`)]}),(0,q.jsx)(`pre`,{children:u})]}),!l.content&&!u&&(0,q.jsx)(`p`,{children:r(`noOutput`)})]});return(0,q.jsxs)(`section`,{className:`trajectory-inspector`,"aria-label":r(`trajectoryDetails`),tabIndex:0,children:[(0,q.jsxs)(`header`,{className:`trajectory-inspector-heading`,children:[(0,q.jsx)(`span`,{className:`trajectory-role ${e.kind}`,children:r(`trajectoryRole_${e.kind}`)}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{children:r(`trajectoryRecordNumber`,{number:t})}),(0,q.jsx)(`h2`,{id:`${a}-title`,children:Gq(e,r)})]}),(0,q.jsx)(`button`,{type:`button`,className:`trajectory-inspector-close`,"aria-label":r(`close`),onClick:n,children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),e.outcome&&(0,q.jsx)(qq,{node:e}),e.error&&(0,q.jsx)(`p`,{className:`trajectory-failure`,children:e.error}),l?.errorMessage&&(0,q.jsx)(`p`,{className:`trajectory-failure`,children:l.errorMessage}),f.length>1&&(0,q.jsx)(`div`,{className:`trajectory-tabs`,role:`tablist`,"aria-label":r(`trajectoryDetails`),onKeyDown:e=>{let t=f.findIndex(e=>e.key===o),n=e.key===`ArrowRight`?(t+1)%f.length:e.key===`ArrowLeft`?(t+f.length-1)%f.length:e.key===`Home`?0:e.key===`End`?f.length-1:void 0;n!==void 0&&(e.preventDefault(),s(f[n].key),e.currentTarget.querySelectorAll(`button`)[n]?.focus())},children:f.map(e=>(0,q.jsx)(`button`,{type:`button`,role:`tab`,id:`${a}-${e.key}`,"aria-controls":`${a}-panel`,"aria-selected":o===e.key,tabIndex:o===e.key?0:-1,onClick:()=>s(e.key),children:e.label},e.key))}),(0,q.jsxs)(`section`,{className:`trajectory-detail-content`,role:f.length>1?`tabpanel`:void 0,id:`${a}-panel`,"aria-labelledby":f.length>1?`${a}-${o}`:`${a}-title`,children:[(l?.truncation||c?.truncation)&&(0,q.jsx)(`p`,{className:`trajectory-warning`,children:r(`trajectoryEvidenceTruncated`)}),(o===`summary`||o===`input`)&&e.input!==void 0&&(0,q.jsx)(Zq,{node:e}),(o===`summary`||o===`output`)&&d&&h,!d&&o===`summary`&&g,o===`timing`&&(0,q.jsxs)(`dl`,{className:`trajectory-facts`,children:[(0,q.jsx)(`dt`,{children:r(`trajectoryDurationLabel`)}),(0,q.jsx)(`dd`,{children:Vq(e.durationMs)}),(0,q.jsx)(`dt`,{children:r(`trajectoryTimingSource`)}),(0,q.jsx)(`dd`,{children:r(e.durationMs===void 0?`trajectoryTimingUnknown`:`trajectoryTimingNative`)}),(0,q.jsx)(`dt`,{children:r(`trajectoryTTFT`)}),(0,q.jsx)(`dd`,{children:r(`trajectoryNotRecorded`)}),(0,q.jsx)(`dt`,{children:r(`trajectoryGenerationTime`)}),(0,q.jsx)(`dd`,{children:r(`trajectoryNotRecorded`)}),(0,q.jsx)(`dt`,{children:r(`trajectoryThroughput`)}),(0,q.jsx)(`dd`,{children:r(`trajectoryNotRecorded`)})]}),o===`usage`&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Xq,{message:l}),(0,q.jsxs)(`dl`,{className:`trajectory-facts`,children:[(0,q.jsx)(`dt`,{children:r(`trajectoryProvider`)}),(0,q.jsx)(`dd`,{children:l?.provider??`—`}),(0,q.jsx)(`dt`,{children:r(`trajectoryModel`)}),(0,q.jsx)(`dd`,{children:l?.model??`—`})]})]}),e.kind===`event`&&!l&&o===`summary`&&(0,q.jsx)(`p`,{className:`trajectory-missing`,children:r(`trajectoryEventOnly`)}),(0,q.jsxs)(`details`,{className:`trajectory-disclosure trajectory-metadata`,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(Js,{"aria-hidden":`true`}),r(`trajectoryRecordInfo`)]}),(0,q.jsxs)(`dl`,{children:[m&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`dt`,{children:r(`trajectoryRecordedAt`)}),(0,q.jsx)(`dd`,{children:(0,q.jsx)(`time`,{dateTime:e.timestamp,children:m})})]}),e.callId&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`dt`,{children:r(`trajectoryCallId`)}),(0,q.jsx)(`dd`,{children:e.callId})]}),(0,q.jsx)(`dt`,{children:r(`trajectoryRecordId`)}),(0,q.jsx)(`dd`,{children:e.key}),e.kind===`event`&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`dt`,{children:r(`trajectoryEventType`)}),(0,q.jsx)(`dd`,{children:e.title})]})]})]})]})]})}function Xq({message:e}){let{t}=W(),n=e?.usage;return n?(0,q.jsx)(`dl`,{className:`trajectory-facts`,children:[`input`,`cacheRead`,`cacheWrite`,`output`].map(e=>(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`trajectoryUsage_${e}`)}),(0,q.jsx)(`dd`,{children:n[e]?.toLocaleString()??`—`})]},e))}):(0,q.jsx)(`p`,{className:`trajectory-missing`,children:t(`trajectoryUsageUnknown`)})}function Zq({node:e}){let{t}=W(),[n,r]=(0,K.useState)(!1),i;if(e.title===`codemode`)try{let t=JSON.parse(e.input??``);t&&typeof t==`object`&&`code`in t&&typeof t.code==`string`&&(i=t.code)}catch{}return(0,q.jsxs)(`section`,{className:`trajectory-evidence`,children:[(0,q.jsxs)(`h3`,{children:[t(i?`trajectoryCode`:`trajectoryArguments`),i&&(0,q.jsx)(`button`,{type:`button`,"aria-pressed":n,onClick:()=>r(!n),children:t(`trajectoryRawArguments`)})]}),(0,q.jsx)(Pq,{text:i&&!n?i:e.input??``,code:!!(i&&!n)})]})}var Qq=(0,K.memo)(function({snapshot:e,running:t}){let{t:n}=W(),r=(0,K.useRef)(null),i=(0,K.useRef)(!0),a=(0,K.useRef)(!1),o=(0,K.useRef)(null),s=qK(e.selectedSession,{beforePrepend:()=>{r.current&&(o.current={height:r.current.scrollHeight,top:r.current.scrollTop})}}),c=s.session?.entries??Uq,l=e.currentSessionPath===e.selectedSession?.path?e.runtime.liveTools:void 0,u=(0,K.useMemo)(()=>Bq(c,l),[c,l]),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(``),[_,v]=(0,K.useState)(50),[y,b]=(0,K.useState)(new Set),[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(!0),[T,E]=(0,K.useState)(null),D=(0,K.useMemo)(()=>{let e=h.trim().toLocaleLowerCase();return e?u.filter(t=>[Gq(t,n),t.title,t.callId,t.input,Kq(t),t.result?.content,Wq(t)].some(t=>t?.toLocaleLowerCase().includes(e))):u},[u,h,n]),O=D.findIndex(e=>e.key===d),k=Math.min(Math.max(0,D.length-_),O<0?D.length:O),A=D.slice(k,k+_),j=T?.keys.length===A.length&&T.keys.every((e,t)=>e===A[t]?.key)?T:null,M=(0,K.useMemo)(()=>Iq(A,j),[A,j]),N=A.find(e=>e.key===d)??Lq(A);(0,K.useLayoutEffect)(()=>{let e=o.current;e&&r.current&&(r.current.scrollTop=e.top+r.current.scrollHeight-e.height,o.current=null)}),(0,K.useEffect)(()=>{N?.key&&(!i.current&&!a.current||(a.current=!1,r.current?.querySelector(`.trajectory-record[aria-pressed="true"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})))},[N?.key]),(0,K.useEffect)(()=>{p&&r.current?.querySelector(`.trajectory-record[aria-pressed="true"]`)?.focus()},[p]);let P=(0,K.useMemo)(()=>Rq(u),[u]),F=new Set(A.map(e=>e.key)),I=P.flatMap(e=>{let t=e.runs.map(e=>e.filter(e=>F.has(e.key))).filter(e=>e.length>0);return t.length?[{...e,runs:t}]:[]}),ee=new Map(u.map((e,t)=>[e.key,t+1])),L=s.session?.truncation,R=u.filter(e=>e.kind===`assistant`),te=u.filter(e=>e.kind===`call`),z=c.flatMap(e=>e.turnTiming?[e.turnTiming]:[]).at(-1);function B(e){let t=Kq(e);return(0,q.jsx)(`li`,{"data-nested":!!e.parentKey||void 0,"data-outside-range":M&&!M.has(e.key)||void 0,hidden:x&&e.kind===`call`,children:(0,q.jsxs)(`button`,{type:`button`,"aria-pressed":e.key===N?.key,onClick:()=>{a.current=!0,f(e.key),m(!1)},className:`trajectory-record ${e.kind}`,"data-response-error":e.kind===`assistant`&&(e.message?.stopReason===`error`||e.message?.stopReason===`aborted`)||void 0,title:zD(t,220),children:[(0,q.jsx)(`span`,{className:`trajectory-row-number`,children:ee.get(e.key)}),(0,q.jsx)(`span`,{className:`trajectory-role ${e.kind}`,children:n(`trajectoryRole_${e.kind}`)}),(0,q.jsxs)(`span`,{className:`trajectory-record-main`,children:[(0,q.jsx)(`span`,{className:`trajectory-record-title`,children:(0,q.jsx)(`strong`,{children:Gq(e,n)})}),t&&(0,q.jsx)(`span`,{className:`trajectory-preview`,children:zD(t,180)})]}),(0,q.jsxs)(`span`,{className:`trajectory-record-end`,children:[(0,q.jsx)(qq,{node:e}),C&&e.durationMs!==void 0&&(0,q.jsx)(`span`,{className:`trajectory-row-duration`,children:Vq(e.durationMs)}),(0,q.jsx)(`time`,{dateTime:e.timestamp,title:n(`trajectoryRecordedAt`),children:BD(e.timestamp)})]})]})},e.key)}return(0,q.jsxs)(`section`,{className:`conversation trajectory`,"aria-label":n(`trajectory`),children:[(0,q.jsxs)(`header`,{className:`trajectory-toolbar`,children:[(0,q.jsxs)(`div`,{className:`trajectory-context`,children:[(0,q.jsx)(nc,{"aria-hidden":`true`}),(0,q.jsxs)(`button`,{type:`button`,"aria-pressed":C,onClick:()=>w(!C),children:[(0,q.jsx)(vs,{"aria-hidden":`true`}),n(`trajectoryDurationLabel`)]}),(0,q.jsx)(`button`,{type:`button`,"aria-pressed":y.size>0,onClick:()=>b(y.size?new Set:new Set(P.map(e=>e.key))),children:n(`trajectoryFoldTurns`)}),(0,q.jsx)(`button`,{type:`button`,"aria-pressed":x,onClick:()=>S(!x),children:n(`trajectoryFoldCalls`)}),(0,q.jsx)(`span`,{className:`trajectory-count`,children:n(h.trim()?`trajectoryMatches`:`trajectoryRecordCount`,{count:D.length})}),(0,q.jsxs)(`details`,{className:`trajectory-scope`,children:[(0,q.jsx)(`summary`,{"aria-label":n(`trajectoryScope`),title:n(`trajectoryScope`),children:(0,q.jsx)(Js,{"aria-hidden":`true`})}),(0,q.jsxs)(`div`,{className:`trajectory-scope-popover`,children:[(0,q.jsx)(`p`,{children:n(`trajectoryScope`)}),(0,q.jsxs)(`dl`,{"aria-label":n(`trajectoryMetrics`),children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:n(`trajectoryModelResponses`)}),(0,q.jsx)(`dd`,{children:n(`trajectoryRequestCount`,{count:R.length})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:n(`trajectoryToolCalls`)}),(0,q.jsx)(`dd`,{children:n(`trajectoryToolCount`,{count:te.length})})]}),z&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:n(`trajectoryLastTurn`)}),(0,q.jsx)(`dd`,{children:Vq(z.elapsedMs)})]})]})]})]})]}),(0,q.jsxs)(`label`,{className:`trajectory-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":n(`trajectorySearch`),placeholder:n(`trajectorySearch`),value:h,onChange:e=>g(e.currentTarget.value)})]})]}),u.length>0&&(0,q.jsx)(Hq,{nodes:A,selectedKey:N?.key,range:j,onRange:e=>E(e?{...e,keys:A.map(e=>e.key)}:null),onSelect:e=>{a.current=!0,f(e),m(!1),b(new Set),S(!1)}}),t&&(0,q.jsx)(`p`,{className:`trajectory-live`,role:`status`,children:n(`trajectoryRunning`)}),L?.truncated&&(0,q.jsx)(`p`,{className:`trajectory-warning`,children:n(`trajectoryTruncated`,{entries:L.entriesOmitted,parts:L.messagePartsOmitted,messages:L.messagesTruncated})}),A.length?(0,q.jsxs)(`div`,{className:`trajectory-body`,"data-inspector-open":N&&!p||void 0,children:[(0,q.jsxs)(`div`,{className:`trajectory-ledger`,"data-range":!!j||void 0,ref:r,onScroll:e=>{let t=e.currentTarget;i.current=t.scrollHeight-t.scrollTop-t.clientHeight<40},children:[k+_{a.current=!0,f(null),m(!1),v(50)},children:n(`trajectoryLatestRecords`)}),s.hasMore&&(0,q.jsx)(`button`,{type:`button`,className:`trajectory-load`,disabled:s.loading||s.verifying,onClick:()=>{s.loadOlder(),v(e=>e+50)},children:n(s.loading?`trajectoryHistoryLoading`:`trajectoryLoadHistory`)}),s.error&&(0,q.jsx)(`p`,{className:`trajectory-warning`,role:`alert`,children:n(s.error)}),k>0&&(0,q.jsx)(`button`,{type:`button`,className:`trajectory-load`,onClick:()=>v(e=>e+50),children:n(`trajectoryEarlier`,{count:k})}),I.map((e,t)=>{let r=!y.has(e.key);return(0,q.jsxs)(`section`,{className:`trajectory-group`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`trajectory-group-heading`,"aria-expanded":r,onClick:()=>b(t=>{let n=new Set(t);return r?n.add(e.key):n.delete(e.key),n}),children:[(0,q.jsx)(os,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`trajectory-group-label`,children:[(0,q.jsx)(`span`,{className:`trajectory-turn-number`,children:n(`trajectoryTurn`,{number:t+1})}),(0,q.jsx)(`span`,{className:`trajectory-group-name`,children:e.prompt?r&&!h.trim()?n(`trajectoryConversationGroup`):zD(e.prompt.message?.content||n(`trajectory_user`),80):n(`trajectoryEarlierGroup`)})]})]}),r&&(0,q.jsx)(`ol`,{children:e.runs.map(e=>e.length===1?B(e[0]):(0,q.jsx)(`li`,{className:`trajectory-event-group`,children:(0,q.jsxs)(`details`,{open:e.some(e=>e.key===N?.key)||!!h.trim(),children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(kc,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:n(`trajectoryEventCount`,{count:e.length})}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),(0,q.jsx)(`ol`,{children:e.map(B)})]})},e[0].key))})]},e.key)})]}),N&&!p&&(0,q.jsx)(Yq,{node:N,number:ee.get(N.key),onClose:()=>m(!0)},N.key)]}):(0,q.jsxs)(`div`,{className:`trajectory-empty`,children:[(0,q.jsx)(nc,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:n(h.trim()?`trajectoryNoMatches`:`trajectoryEmpty`)})]})]})});function $q(){(0,K.useEffect)(()=>{let e=new de,t=new AbortController,n,r=async r=>{let i=r.data;if(!(r.source!==window||r.origin!==location.origin||i?.source!==`openpi-browser-extension`||i.type!==`connector-hello`||typeof i.bridgeId!=`string`||!/^[\da-f-]{36}$/.test(i.bridgeId)||!Cj(i.browser)||n===i.bridgeId)){n=i.bridgeId;try{let r=await e.request(`/api/browser/connections`,{method:`POST`,signal:t.signal,body:JSON.stringify({browser:i.browser,profileId:i.profileId,extensionId:i.extensionId,extensionOrigin:i.extensionOrigin,version:i.version})});!t.signal.aborted&&n===i.bridgeId&&window.postMessage({source:`openpi-browser-ui`,type:`connector-authorize`,...r},location.origin)}catch{n===i.bridgeId&&(n=void 0)}}},i=()=>window.postMessage({source:`openpi-browser-ui`,type:`connector-probe`},location.origin);window.addEventListener(`message`,r),i();let a=setInterval(i,5e3);return()=>{t.abort(),clearInterval(a),window.removeEventListener(`message`,r)}},[])}function eJ(e,t){let n=e.trim();if(!n||n.length>16384)return null;let r=/^[a-z][a-z\d+.-]*:\/\//iu.test(n);try{let e=new URL(r?n:`https://${n}`);return!r&&(e.hostname===`localhost`||e.hostname.endsWith(`.localhost`)||e.hostname===`[::1]`||/^127(?:\.\d{1,3}){3}$/u.test(e.hostname))&&(e=new URL(`http://${n}`)),![`http:`,`https:`].includes(e.protocol)||e.username||e.password||e.origin===t?null:e.href}catch{return null}}function tJ(){return document.documentElement.dataset.openpiBrowserExtension===`ready`?[...document.querySelectorAll(`iframe[data-openpi-browser-document]`)].map(e=>({id:e.dataset.openpiBrowserPage,document:e.dataset.openpiBrowserDocument,url:e.dataset.openpiBrowserUrl,title:e.dataset.openpiBrowserTitle||``})):[]}function nJ(e,t,n){let r=(0,K.useRef)(n),i=(0,K.useRef)(0);r.current=n,(0,K.useEffect)(()=>{if(!e||!t)return;let n=new de,a=new AbortController,o,s,c,l=e=>window.postMessage({source:`openpi-browser-ui`,...e},location.origin),u=()=>{c?.(),c=void 0,s&&l({type:`control-cancel`,requestId:s}),s=void 0},d=(r,i,o)=>{r===s&&(c?.(),c=void 0,s=void 0,n.request(`/api/browser/control`,{method:`POST`,signal:a.signal,body:JSON.stringify({sessionId:e,sessionPath:t,requestId:r,result:i,error:o,pages:tJ()})}).catch(()=>{}))},f=e=>{let t=e.data;e.source===window&&e.origin===location.origin&&t?.source===`openpi-browser-extension`&&(t.type===`connector-hello`?i.current=Date.now():t.type===`control-result`&&d(t.requestId,t.result,t.error))},p=async(e,t)=>{let n=eJ(t||``,location.origin);if(!n){d(e,void 0,`Invalid internal browser URL.`);return}let i=new AbortController;c=()=>i.abort();let o=await r.current(n,AbortSignal.any([a.signal,i.signal]));if(a.signal.aborted||s!==e)return;if(!o){d(e,void 0,`The internal browser has reached its page limit.`);return}let l=()=>{let t=document.getElementById(o)?.querySelector(`iframe[data-openpi-browser-document]`),n=t&&tJ().find(e=>e.id===t.dataset.openpiBrowserPage);n&&d(e,{root:n.id})},u=new MutationObserver(l);u.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-openpi-browser-document`]});let f=setTimeout(()=>d(e,void 0,`The internal page did not bind. Inspect the browser's loading or embedding error.`),1e4);c=()=>{i.abort(),u.disconnect(),clearTimeout(f)},l()},m=async()=>{if(Date.now()-i.current>15e3&&document.documentElement.dataset.openpiBrowserExtension!==`ready`){u(),a.signal.aborted||(o=setTimeout(()=>void m(),1e3));return}try{let{pending:r}=await n.request(`/api/browser/control`,{method:`POST`,signal:a.signal,body:JSON.stringify({sessionId:e,sessionPath:t,pages:tJ()})});s&&s!==r?.requestId&&u(),r&&!r.running&&r.request&&!s&&(s=r.requestId,r.request.operation===`open`?p(r.requestId,r.request.url).catch(()=>d(r.requestId,void 0,`The embedded browser could not open.`)):r.page?l({type:`control`,id:r.page.id,document:r.page.document,requestId:r.requestId,request:r.request}):d(r.requestId,void 0,`The embedded page is unavailable.`))}catch{u()}a.signal.aborted||(o=setTimeout(()=>void m(),250))};return window.addEventListener(`message`,f),m(),()=>{clearTimeout(o),a.abort(),u(),window.removeEventListener(`message`,f)}},[e,t])}function rJ({usage:e,workspace:t,sessionId:n,model:r}){let{t:i,i18n:a}=W(),[o,s]=(0,K.useState)(!1);if(!e)return null;let c=e.context,l=e=>new Intl.NumberFormat(a.resolvedLanguage).format(e),u=e=>new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:0}).format(e).toLowerCase(),d=c?.percent==null?i(`usageUnknown`):`${Math.round(c.percent)}%`,f=c?.percent==null?i(`usageUnknown`):`${new Intl.NumberFormat(a.resolvedLanguage,{maximumFractionDigits:1}).format(c.percent)}%`,p=c?u(c.contextWindow):i(`usageUnknown`);return(0,q.jsx)(`div`,{className:`session-usage`,children:(0,q.jsx)(Zu,{isOpen:o,onOpenChange:s,placement:`below`,alignment:`end`,width:`min(360px, calc(100vw - 24px))`,label:i(`sessionUsage`),isModal:!1,hasCloseButton:!1,content:(0,q.jsxs)(`div`,{className:`session-usage-details`,children:[(0,q.jsxs)(`div`,{className:`usage-details-heading`,children:[(0,q.jsx)(`h2`,{children:i(`sessionOverview`)}),(0,q.jsx)(V,{content:i(`close`),placement:`below`,children:(0,q.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":i(`close`),onClick:()=>s(!1),children:(0,q.jsx)(je,{"aria-hidden":`true`})})})]}),(0,q.jsxs)(`section`,{className:`usage-section`,children:[(0,q.jsxs)(`div`,{className:`usage-context-heading`,children:[(0,q.jsx)(`h3`,{children:i(`usageContextLabel`)}),(0,q.jsx)(`span`,{children:f})]}),(0,q.jsxs)(`p`,{className:`usage-context-value`,children:[(0,q.jsx)(`strong`,{children:c?.tokens==null?i(`usageUnknown`):l(c.tokens)}),c&&(0,q.jsxs)(`span`,{children:[` / `,l(c.contextWindow),` tokens`]})]}),c?.percent!=null&&(0,q.jsx)(`progress`,{value:Math.max(0,Math.min(100,c.percent)),max:100,"aria-label":i(`sessionContextUsage`)}),(0,q.jsx)(`p`,{className:`usage-help`,children:i(`usageContextHelp`)}),r&&(0,q.jsxs)(`div`,{className:`usage-context-model`,children:[(0,q.jsx)(`span`,{children:r.name}),(0,q.jsxs)(`span`,{children:[r.provider,` / `,r.id]})]})]}),(0,q.jsxs)(`section`,{className:`usage-section`,children:[(0,q.jsx)(`h3`,{children:i(`usageSessionTotals`)}),(0,q.jsxs)(`dl`,{className:`usage-metrics`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:i(`usageInputLabel`)}),(0,q.jsx)(`dd`,{children:l(e.input)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:i(`usageOutputLabel`)}),(0,q.jsx)(`dd`,{children:l(e.output)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:i(`usageCacheReadLabel`)}),(0,q.jsx)(`dd`,{children:l(e.cacheRead)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:i(`usageCacheWriteLabel`)}),(0,q.jsx)(`dd`,{children:l(e.cacheWrite)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:i(`usageTotalLabel`)}),(0,q.jsx)(`dd`,{children:l(e.total)})]})]}),(0,q.jsx)(`p`,{className:`usage-help`,children:i(`usageTotalsHelp`)})]}),t&&(0,q.jsxs)(`dl`,{className:`usage-workspace`,children:[(0,q.jsx)(`dt`,{children:i(`usageWorkspaceLabel`)}),(0,q.jsx)(`dd`,{children:t})]}),n&&(0,q.jsxs)(`details`,{className:`usage-identity`,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(`span`,{children:i(`usageSessionId`)}),(0,q.jsx)(is,{"aria-hidden":`true`})]}),(0,q.jsx)(`code`,{children:n})]})]}),children:t=>(0,q.jsx)(V,{content:i(`usageOpenDetails`,{input:l(e.input),output:l(e.output),percent:f,capacity:p}),placement:`below`,isEnabled:!o,children:(0,q.jsxs)(`button`,{...t,className:`session-usage-trigger`,type:`button`,"aria-label":i(`usageOpenDetails`,{input:u(e.input),output:u(e.output),percent:d,capacity:p}),children:[(0,q.jsxs)(`span`,{className:`usage-stat`,children:[(0,q.jsx)(Xo,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:u(e.input)})]}),(0,q.jsxs)(`span`,{className:`usage-stat`,children:[(0,q.jsx)(ue,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:u(e.output)})]}),(0,q.jsxs)(`span`,{className:`usage-stat`,children:[(0,q.jsx)(Us,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[d,c&&(0,q.jsxs)(`span`,{className:`usage-capacity`,children:[` / `,p]})]})]})]})})})})}function iJ(e,t){return new Promise((n,r)=>{let i=new FileReader,a=e=>{t.removeEventListener(`abort`,o),e?r(e):typeof i.result==`string`?n(i.result.slice(i.result.indexOf(`,`)+1)):r(Error(`File read failed`))},o=()=>{i.abort(),a(new DOMException(`File read cancelled`,`AbortError`))};i.onload=()=>a(),i.onerror=()=>a(Error(`File read failed`)),t.addEventListener(`abort`,o,{once:!0}),t.aborted?o():i.readAsDataURL(e)})}function aJ({name:e,kind:t=`file`,expanded:n=!1}){let r=t===`directory`?`folder`:t===`symlink`?`link`:/\.(?:md|markdown)$/iu.test(e)?`markdown`:/\.(?:csv|tsv|xlsx?)$/iu.test(e)?`sheet`:/\.(?:png|jpe?g|gif|webp|svg|bmp|ico)$/iu.test(e)?`image`:/\.(?:pdf|docx?|pptx?)$/iu.test(e)?`document`:/\.(?:[cm]?[jt]sx?|json|html?|css|py|rs|go|sh|ya?ml|toml|xml)$/iu.test(e)?`code`:`file`;return(0,q.jsx)(r===`folder`?n?zs:Vs:r===`link`?Qs:r===`sheet`?jc:r===`image`?Ns:r===`markdown`||r===`document`?Fs:r===`code`?js:Is,{className:`file-icon file-icon-${r}`,"aria-hidden":`true`})}function oJ({sessionId:e,sessionPath:t,cwd:n,canWrite:r,active:i,selected:a,onSelect:o,dropTarget:s,onShowTree:c,onRemoved:l,onReadStateChange:u,refreshRequest:d}){let{t:f}=W(),p=(0,K.useContext)($E),m=be(),h=(0,K.useMemo)(()=>new de,[]),[g,_]=(0,K.useState)(m?.files?.query??``),[v,y]=(0,K.useState)(m?.files?.expanded??[`.`]),[b,x]=(0,K.useState)({}),[S,C]=(0,K.useState)(null),[w,T]=(0,K.useState)(null),[E,D]=(0,K.useState)(!1),[O,k]=(0,K.useState)(0);(0,K.useEffect)(()=>{u({error:w,loading:E})},[w,E,u]);let A=(0,K.useCallback)(e=>({message:f(e instanceof ge&&e.code===`ARTIFACT_DENIED`?`filesReadDenied`:`filesReadFailedDetail`),detail:e instanceof Error?e.message:void 0}),[f]),[j,M]=(0,K.useState)(a.includes(`/`)?a.slice(0,a.lastIndexOf(`/`)):`.`),[N,P]=(0,K.useState)(null),[F,I]=(0,K.useState)(``),[ee,L]=(0,K.useState)(null),[R,te]=(0,K.useState)(!1),[z,B]=(0,K.useState)(!1),[ne,re]=(0,K.useState)([]),[ie,ae]=(0,K.useState)(!1),[oe,se]=(0,K.useState)([]),[ce,le]=(0,K.useState)(null),[H,ue]=(0,K.useState)(`.`),[fe,pe]=(0,K.useState)(``),[he,_e]=(0,K.useState)([]),[ve,ye]=(0,K.useState)(!1),[xe,Se]=(0,K.useState)([]),[Ce,we]=(0,K.useState)(0),[Te,Ee]=(0,K.useState)(!1),[U,De]=(0,K.useState)(),Oe=(0,K.useRef)(0),[ke,Ae]=(0,K.useState)([]),[G,je]=(0,K.useState)(!1),[Me,Ne]=(0,K.useState)(``),Pe=(0,K.useRef)(null),Fe=(0,K.useRef)(null),Ie=(0,K.useRef)(null),Le=(0,K.useRef)(null),Re=(0,K.useRef)(null),ze=(0,K.useRef)(!1),Be=(0,K.useRef)(0),Ve=(0,K.useRef)(null),He=(0,K.useRef)(void 0),Ue=JSON.stringify([e,t,n]),We=(0,K.useRef)(Ue);We.current=Ue;let Ge=(0,K.useRef)(r);Ge.current=r;let Ke=(0,K.useRef)(null);(0,K.useEffect)(()=>(We.current=Ue,()=>{We.current=``,Ke.current?.abort(),clearTimeout(He.current)}),[Ue]),(0,K.useEffect)(()=>{Fe.current?.setAttribute(`webkitdirectory`,``)},[]),(0,K.useEffect)(()=>{if(!ve||!i)return;Oe.current++;let n=new AbortController;return Ee(!0),h.workspaceTrash(e,t,n.signal).then(r=>{!n.signal.aborted&&r.sessionId===e&&r.sessionPath===t&&(Se(r.entries),we(r.unavailable??0),De(r.nextCursor))}).catch(e=>{n.signal.aborted||(te(!0),L(A(e).message))}).finally(()=>{n.signal.aborted||Ee(!1)}),()=>n.abort()},[h,e,t,i,ve,O,A]),(0,K.useEffect)(()=>{ce&&(Le.current?.focus(),Le.current?.select())},[ce]),(0,K.useEffect)(()=>{N&&Ie.current?.focus()},[N]);let qe=(0,K.useRef)(null),Je=(0,K.useRef)(m?.files?.treeScroll??0);(0,K.useLayoutEffect)(()=>{m?.files&&Object.assign(m.files,{query:g,expanded:v})},[m,g,v]),(0,K.useLayoutEffect)(()=>{!i||!(S||b[`.`])||Je.current!==null&&qe.current&&(qe.current.scrollTop=Je.current,Je.current=null)},[i,S,b]);let Ye=(0,K.useRef)(b);Ye.current=b;let Xe=(0,K.useRef)(S);Xe.current=S;let Ze=(0,K.useRef)(``),Qe=(0,K.useRef)(null),$e=(0,K.useRef)(new Set),et=(0,K.useRef)(!1),[tt,nt]=(0,K.useState)(!1),rt=!!g.trim();(0,K.useLayoutEffect)(()=>{let e=Ve.current;if(!e||!i)return;let t=[...qe.current?.querySelectorAll(`[data-file-row]`)??[]].find(t=>t.dataset.fileRow===e);t&&(t.focus({preventScroll:!0}),Ve.current=null)});let it=e=>e instanceof ge&&e.code===`ARTIFACT_EXISTS`?f(`filesNameExists`):e instanceof Error?e.message:f(`filesMutationFailed`),at=e=>{_(``);let t=e.path.split(`/`),n=e.kind===`directory`?t.length:t.length-1;y(e=>[...new Set([...e,`.`,...t.slice(0,n).map((e,n)=>t.slice(0,n+1).join(`/`))])]),Ve.current=e.path,k(e=>e+1),e.kind===`file`&&(e.bytes??0)<=20971520&&(o(e.path),p?.open(encodeURI(e.path)))},ot=()=>{ze.current||(P(null),L(null),Re.current?.focus({preventScroll:!0}))},st=async n=>{if(n.preventDefault(),!N||!Ge.current||ze.current)return;if(!F||F===`.`||F===`..`||/[\\/\u0000-\u001f\u007f]/u.test(F)){te(!0),L(f(`filesNameInvalid`)),Ie.current?.focus();return}ze.current=!0,B(!0),L(null);let r=Ue;try{let n=await h.mutateWorkspaceFile(e,t,{kind:N,directory:j,name:F});if(We.current!==r||n.sessionId!==e||n.sessionPath!==t)return;P(null),I(``),te(!1),L(f(`filesCreated`,{path:n.path})),at(n)}catch(e){We.current===r&&(te(!0),L(it(e)),Ie.current?.focus())}finally{We.current===r&&(ze.current=!1,B(!1))}},ct=async n=>{if(!Ge.current||ze.current)return;let r=Ue;ze.current=!0,B(!0);let i=new AbortController;Ke.current=i;let a=(e,t)=>re(n=>n.map(n=>n.id===e.id?{...n,...t}:n));try{for(let o of n){if(We.current!==r)return;if(!Ge.current){a(o,{state:`error`,message:f(`filesWriteUnavailable`)});continue}if(!(!o.file&&o.kind!==`directory`)){a(o,{state:`running`,message:void 0});try{if(o.kind===`directory`){try{await h.mutateWorkspaceFile(e,t,{kind:`create-directory`,directory:o.directory,name:o.name})}catch(n){if(!(n instanceof ge)||n.code!==`ARTIFACT_EXISTS`)throw n;await h.workspaceFiles(e,t,[o.directory===`.`?``:o.directory,o.name].filter(Boolean).join(`/`),``,i.signal)}if(We.current!==r)return;a(o,{state:`done`,message:f(`filesImported`)}),k(e=>e+1);continue}if(!o.file)continue;if(o.file.size>52428800)throw Error(f(`filesImportTooLarge`));let n=await iJ(o.file,i.signal);if(We.current!==r)return;if(!Ge.current){a(o,{state:`error`,message:f(`filesWriteUnavailable`)});continue}let s=await h.mutateWorkspaceFile(e,t,{kind:`import-file`,directory:o.directory,name:o.name,data:n,...o.createParents?{createParents:!0}:{}});if(We.current!==r||s.sessionId!==e||s.sessionPath!==t)return;a(o,{state:`done`,file:void 0,message:(s.bytes??0)>20971520?f(`filesImportedNoPreview`):f(`filesImported`)}),at(s)}catch(e){if(We.current!==r)return;a(o,{state:`error`,message:it(e)})}}}}finally{Ke.current===i&&(Ke.current=null),We.current===r&&(ze.current=!1,B(!1))}},lt=(e,t=[],n=new Map,r=[])=>{if(!Ge.current||ze.current)return;if(e.length+r.length>2e3){te(!0),L(f(`filesImportFolderLimit`));return}c(!0);let i=[...[...new Set(r)].sort((e,t)=>e.split(`/`).length-t.split(`/`).length).map(e=>({id:++Be.current,name:e.split(`/`).at(-1),directory:[j===`.`?``:j,...e.split(`/`).slice(0,-1)].filter(Boolean).join(`/`)||`.`,kind:`directory`,state:`pending`})),...e.map(e=>{let t=n.get(e)??e.webkitRelativePath;return{id:++Be.current,name:e.name,directory:t?[j===`.`?``:j,...t.split(`/`).slice(0,-1)].filter(Boolean).join(`/`)||`.`:j,createParents:!!t,file:e,state:`pending`}})];re(e=>[...e,...t.map(e=>({id:++Be.current,name:e,directory:j,state:`error`,message:f(`filesImportDirectoryUnsupported`)})),...i]),ct(i)},ut=async(n,r)=>{if(!Ge.current||ze.current)return;let i=Ue,s=r.filter(e=>!r.some(t=>t.kind===`directory`&&e.path.startsWith(`${t.path}/`)));ze.current=!0,B(!0),_e([]);let c=[],u=new Set;try{for(let r of s){if(We.current!==i||!Ge.current)return;try{if(!r.identity)throw Error(f(`filesRefreshBeforeOrganizing`));let s=await h.mutateWorkspaceFile(e,t,n===`trash`?{kind:n,path:r.path,identity:r.identity}:{kind:n,path:r.path,identity:r.identity,directory:H,name:ce?.rename?fe:r.name});if(We.current!==i||s.sessionId!==e||s.sessionPath!==t)return;if(u.add(r.path),s.trashed&&c.push(s.trashed),s.moved&&MD(e,t,s.moved.from,s.moved.to),r.kind===`directory`){let e=e=>e===r.path||e.startsWith(`${r.path}/`);if(y(t=>n===`trash`?t.filter(t=>!e(t)):t.map(t=>e(t)?`${s.path}${t.slice(r.path.length)}`:t)),M(t=>e(t)?n===`move`?`${s.path}${t.slice(r.path.length)}`:r.path.split(`/`).slice(0,-1).join(`/`)||`.`:t),n===`move`&&e(a)){let e=`${s.path}${a.slice(r.path.length)}`;o(e),p?.open(encodeURI(e))}}n===`move`&&at(s),_e(e=>[...e,{path:r.path}])}catch(e){if(We.current!==i)return;_e(t=>[...t,{path:r.path,error:it(e)}])}}Ae(c),n===`trash`&&l([...u]),se(e=>e.filter(e=>![...u].some(t=>t===e.path||e.path.startsWith(`${t}/`)))),le(null),k(e=>e+1)}finally{We.current===i&&(ze.current=!1,B(!1))}},dt=async n=>{if(!Ge.current||ze.current)return;let r=Ue;ze.current=!0,B(!0),_e([]);try{for(let i of n){if(We.current!==r||!Ge.current)return;try{let n=await h.mutateWorkspaceFile(e,t,{kind:`restore`,id:i.id,identity:i.identity});if(We.current!==r||n.sessionId!==e||n.sessionPath!==t)return;Ae(e=>e.filter(e=>e.id!==i.id)),Se(e=>e.filter(e=>e.id!==i.id)),_e(e=>[...e,{path:i.path}]),at(n)}catch(e){if(We.current!==r)return;_e(t=>[...t,{path:i.path,error:it(e)}])}}k(e=>e+1)}finally{We.current===r&&(ze.current=!1,B(!1))}},ft=async()=>{if(!U||Te)return;let n=Oe.current,r=Ue;Ee(!0);try{let i=await h.workspaceTrash(e,t,void 0,U);if(n!==Oe.current||We.current!==r||i.sessionId!==e||i.sessionPath!==t)return;Se(e=>[...new Map([...e,...i.entries].map(e=>[e.id,e])).values()]),we(e=>e+(i.unavailable??0)),De(i.nextCursor)}catch(e){n===Oe.current&&We.current===r&&(te(!0),L(it(e)))}finally{n===Oe.current&&We.current===r&&Ee(!1)}},pt=e=>se(t=>t.some(t=>t.path===e.path)?t.filter(t=>t.path!==e.path):[...t,e]),mt=(e,t=!1)=>{le({entries:e,rename:t});let n=e[0]?.path??``;ue(t?n.split(`/`).slice(0,-1).join(`/`)||`.`:j),pe(e[0]?.name??``),L(null)},ht=(0,K.useRef)(lt);ht.current=lt,(0,K.useEffect)(()=>{let e=s.current;if(!e)return;let t=e=>{if(!e.dataTransfer?.types.includes(`Files`))return;e.preventDefault();let t=Ge.current&&!ze.current;e.dataTransfer.dropEffect=t?`copy`:`none`,je(t)},n=t=>{(!(t.relatedTarget instanceof Node)||!e.contains(t.relatedTarget))&&je(!1)},r=e=>{let t=e.dataTransfer;if(!t?.types.includes(`Files`)||(e.preventDefault(),je(!1),!Ge.current||ze.current))return;let n=[],r=[],i=[];for(let e of t.items){if(e.kind!==`file`)continue;let t=e.webkitGetAsEntry?.();if(t?.isDirectory&&`createReader`in t)i.push(t);else if(t?.isDirectory)r.push(t.name);else{let t=e.getAsFile();t&&n.push(t)}}if(i.length){let e=We.current,t=new Map,a=[],o=0,s=async(r,i)=>{if(We.current!==e||!Ge.current)throw new DOMException(`Import cancelled`,`AbortError`);if(++o>2e3||i.split(`/`).length>64)throw Error(f(`filesImportFolderLimit`));let c=i?`${i}/${r.name}`:r.name;if(r.isDirectory){a.push(c);let e=r.createReader();for(;;){let t=await new Promise((t,n)=>e.readEntries(t,n));if(!t.length)break;for(let e of t)await s(e,c)}}else if(r.isFile){let e=await new Promise((e,t)=>r.file(e,t));t.set(e,c),n.push(e)}};ze.current=!0,B(!0),(async()=>{try{for(let e of i)await s(e,``);if(We.current!==e||!Ge.current)return;ze.current=!1,B(!1),ht.current(n,r,t,a)}catch(t){We.current===e&&(te(!0),L(t instanceof Error?t.message:f(`filesMutationFailed`)))}finally{We.current===e&&!Ke.current&&(ze.current=!1,B(!1))}})();return}ht.current(t.items.length?n:[...t.files],r)};return e.addEventListener(`dragover`,t),e.addEventListener(`dragleave`,n),e.addEventListener(`drop`,r),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`dragleave`,n),e.removeEventListener(`drop`,r)}},[s,f]);let gt=async(e,t)=>{let r=Ue,i=n.includes(`\\`)?`\\`:`/`,a=await td(t?`${n.replace(/[\\/]$/u,``)}${i}${e.split(`/`).join(i)}`:e);We.current===r&&(clearTimeout(He.current),Ne(f(a?`filesPathCopied`:`copyFailed`,{path:e})),He.current=setTimeout(()=>Ne(``),3e3))};(0,K.useEffect)(()=>{if(!i)return;let n=new AbortController;Qe.current=n;let r;Ze.current!==g.trim()&&(Ze.current=g.trim(),Xe.current=null,C(null)),r=setTimeout(async()=>{if(document.visibilityState!==`hidden`){D(!0);try{let r=async(r,i,a)=>{let o=await h.workspaceFiles(e,t,r,i,n.signal);for(o.nextCursor&&$e.current.add(o.nextCursor);o.nextCursor&&o.entries.length{document.visibilityState!==`hidden`&&k(e=>e+1)};return window.addEventListener(`focus`,a),document.addEventListener(`visibilitychange`,a),()=>{n.abort(),clearTimeout(r),window.removeEventListener(`focus`,a),document.removeEventListener(`visibilitychange`,a);for(let e of $e.current)h.releaseFileListing(e).catch(()=>void 0);$e.current.clear(),et.current=!1,nt(!1)}},[i,h,v,g,rt,e,t,O,d,A]);let _t=e=>y(t=>t.includes(e)?t.filter(t=>t!==e&&!t.startsWith(`${e}/`)):[...t,e]),vt=async n=>{let r=rt?Xe.current:Ye.current[n],i=Qe.current;if(!(!r?.nextCursor||!i||i.signal.aborted||et.current||E)){et.current=!0,nt(!0),T(null);try{let a=await h.workspaceFiles(e,t,n,rt?g.trim():``,i.signal,r.nextCursor);if($e.current.delete(r.nextCursor),a.nextCursor&&$e.current.add(a.nextCursor),i.signal.aborted)return;let o=[...new Map([...r.entries,...a.entries].map(e=>[e.path,e])).values()],s={...a,entries:o};rt?C(s):x(e=>({...e,[n]:s}))}catch(e){i.signal.aborted||T(A(e))}finally{i.signal.aborted||(et.current=!1,nt(!1))}}},yt=(e,t)=>t?.nextCursor?(0,q.jsxs)(`li`,{className:`file-tree-more`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:E||tt,onClick:()=>void vt(e),children:f(tt?`readingFile`:`filesLoadMore`)}),(0,q.jsx)(`small`,{children:f(`filesLoaded`,{count:t.entries.length})})]}):null,bt=e=>{let t=[...qe.current?.querySelectorAll(`button[data-file-row]:not(:disabled)`)??[]],n=t.indexOf(document.activeElement),r=t[n];if(!r)return;let i;if(e.key===`ArrowDown`)i=t[Math.min(n+1,t.length-1)];else if(e.key===`ArrowUp`)i=t[Math.max(n-1,0)];else if(e.key===`Home`)i=t[0];else if(e.key===`End`)i=t.at(-1);else if(e.key===`ArrowRight`&&r.getAttribute(`aria-expanded`)===`false`)r.click();else if(e.key===`ArrowLeft`)r.getAttribute(`aria-expanded`)===`true`?r.click():i=t.find(e=>e.dataset.fileRow===r.dataset.fileRow?.split(`/`).slice(0,-1).join(`/`));else return;e.preventDefault(),i?.focus()},xt=(e,t=0)=>e.map(e=>{let n=e.kind===`directory`,i=v.includes(e.path),s=r&&!!e.identity&&!e.path.split(`/`).some(e=>[`.git`,`.pi`,`.openpi-trash`].includes(e.toLowerCase()))&&(n||e.kind===`file`);return(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{className:`file-tree-item`,children:[ie&&(0,q.jsx)(`input`,{type:`checkbox`,className:`file-tree-check`,"aria-label":f(`filesSelectItem`,{name:e.name}),checked:oe.some(t=>t.path===e.path),disabled:!s||z,onChange:()=>pt(e)}),(0,q.jsxs)(`button`,{type:`button`,"data-file-row":e.path,className:`file-tree-row`,style:{paddingInlineStart:10+t*16},"aria-expanded":n?i:void 0,"aria-current":!n&&a===e.path?`true`:void 0,disabled:e.kind===`symlink`||e.kind===`other`,title:e.kind===`symlink`?f(`filesSymlink`):e.path,onClick:t=>{if(s&&(t.metaKey||t.ctrlKey)){ae(!0),pt(e);return}n?(M(e.path),rt?(_(``),y([`.`,...e.path.split(`/`).map((e,t,n)=>n.slice(0,t+1).join(`/`))])):_t(e.path)):(M(e.path.includes(`/`)?e.path.slice(0,e.path.lastIndexOf(`/`)):`.`),o(e.path),p?.open(encodeURI(e.path),void 0,t.currentTarget))},children:[n?i?(0,q.jsx)(is,{className:`file-chevron`,"aria-hidden":`true`}):(0,q.jsx)(os,{className:`file-chevron`,"aria-hidden":`true`}):(0,q.jsx)(`span`,{className:`file-chevron`}),(0,q.jsx)(aJ,{name:e.name,kind:e.kind,expanded:i}),(0,q.jsxs)(`span`,{className:`file-tree-name`,children:[e.name,rt&&(0,q.jsx)(`small`,{children:e.path})]})]}),(0,q.jsx)(yo,{button:{label:f(`filesPathActions`,{name:e.name}),icon:(0,q.jsx)(Ds,{"aria-hidden":`true`}),isIconOnly:!0,size:`sm`,variant:`ghost`,className:`file-path-actions`},items:[{label:f(`filesCopyRelativePath`),onClick:()=>void gt(e.path,!1)},{label:f(`filesCopyAbsolutePath`),onClick:()=>void gt(e.path,!0)},{label:f(`filesRename`),isDisabled:!s||z,onClick:()=>mt([e],!0)},{label:f(`filesMove`),isDisabled:!s||z,onClick:()=>mt([e])},{label:f(`filesTrashAction`),isDisabled:!s||z,onClick:()=>void ut(`trash`,[e])}],menuWidth:200,alignment:`end`,hasChevron:!1})]}),!rt&&n&&i&&(0,q.jsxs)(`ul`,{children:[b[e.path]?xt(b[e.path].entries,t+1):(0,q.jsx)(`li`,{className:`file-tree-note`,children:f(`readingFile`)}),yt(e.path,b[e.path])]})]},e.path)});return(0,q.jsxs)(`aside`,{className:`file-explorer`,"aria-label":f(`filesExplorer`),"data-drag-over":G||void 0,children:[(0,q.jsxs)(`div`,{className:`file-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{value:g,onChange:e=>_(e.currentTarget.value.slice(0,200)),placeholder:f(`filesSearch`),"aria-label":f(`filesSearch`)}),(0,q.jsx)(`span`,{className:`file-search-progress`,"aria-hidden":`true`,"data-loading":E||void 0}),(0,q.jsx)(V,{content:f(`refreshFiles`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":f(`refreshFiles`),onClick:()=>k(e=>e+1),disabled:E,children:(0,q.jsx)(me,{"aria-hidden":`true`})})})]}),(0,q.jsxs)(`div`,{className:`file-create-toolbar`,children:[(0,q.jsxs)(`fieldset`,{className:`file-write-actions`,"aria-label":f(`filesWorkspaceActions`),children:[(0,q.jsx)(yo,{button:{ref:Re,label:f(`filesCreateMenu`),variant:`ghost`,className:`file-toolbar-button`,tooltip:r&&!z?f(`filesCreateMenu`):void 0,isDisabled:!r||z},items:[`create-file`,`create-directory`].map(e=>({label:f(e===`create-file`?`filesNewFile`:`filesNewDirectory`),icon:e===`create-file`?(0,q.jsx)(Ps,{"aria-hidden":`true`}):(0,q.jsx)(Bs,{"aria-hidden":`true`}),isDisabled:!r||z,onClick:()=>{P(e),I(``),L(null)}})),menuWidth:190}),(0,q.jsx)(yo,{button:{label:f(`filesImportMenu`),variant:`ghost`,className:`file-toolbar-button`,tooltip:r&&!z?f(`filesImportMenu`):void 0,isDisabled:!r||z},items:[{label:f(`filesImport`),icon:(0,q.jsx)(Kc,{"aria-hidden":`true`}),isDisabled:!r||z,onClick:()=>Pe.current?.click()},{label:f(`filesImportFolder`),icon:(0,q.jsx)(Rs,{"aria-hidden":`true`}),isDisabled:!r||z,onClick:()=>Fe.current?.click()}],menuWidth:190}),(0,q.jsx)(`input`,{ref:Pe,type:`file`,multiple:!0,hidden:!0,"aria-label":f(`filesImportChoose`),onChange:e=>{lt([...e.currentTarget.files??[]]),e.currentTarget.value=``}}),(0,q.jsx)(`input`,{ref:Fe,type:`file`,multiple:!0,hidden:!0,"aria-label":f(`filesImportFolderChoose`),onChange:e=>{lt([...e.currentTarget.files??[]]),e.currentTarget.value=``}}),(0,q.jsxs)(yo,{button:{label:f(`filesMoreMenu`),variant:`ghost`,className:`file-toolbar-button`,tooltip:f(`filesMoreMenu`)},menuWidth:210,children:[(0,q.jsx)(Ro,{label:f(`filesSelectMultiple`),icon:(0,q.jsx)($s,{"aria-hidden":`true`}),value:ie,isDisabled:!r||z,hasCloseOnSelect:!0,onChange:e=>{ae(e),se([])}}),(0,q.jsx)(Ro,{label:f(`filesTrash`),icon:(0,q.jsx)(Uc,{"aria-hidden":`true`}),value:ve,hasCloseOnSelect:!0,onChange:ye})]})]}),(0,q.jsxs)(`p`,{className:`file-write-directory`,title:j,children:[(0,q.jsxs)(`span`,{children:[f(`filesTargetDirectory`),`:`,` `,j===`.`?f(`filesWorkspaceRoot`):j]}),j!==`.`&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>M(`.`),children:f(`filesWorkspaceRoot`)})]})]}),ie&&(0,q.jsxs)(`div`,{className:`file-organization-bar`,children:[(0,q.jsx)(`span`,{children:f(`filesSelectedCount`,{count:oe.length})}),(0,q.jsx)(`button`,{type:`button`,disabled:!oe.length||z||!r,onClick:()=>mt(oe),children:f(`filesMove`)}),(0,q.jsx)(`button`,{type:`button`,disabled:!oe.length||z||!r,onClick:()=>void ut(`trash`,oe),children:f(`filesTrashAction`)})]}),ce&&(0,q.jsxs)(`form`,{className:`file-create-form`,onSubmit:e=>{e.preventDefault(),(!ce.rename||fe.trim())&&ut(`move`,ce.entries)},children:[(0,q.jsxs)(`label`,{children:[f(ce.rename?`filesRename`:`filesMoveDestination`),(0,q.jsx)(`input`,{ref:Le,value:ce.rename?fe:H,"aria-label":f(ce.rename?`filesNewName`:`filesMoveDestination`),disabled:z,onChange:e=>ce.rename?pe(e.currentTarget.value):ue(e.currentTarget.value)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`button`,{type:`submit`,disabled:z||!r,children:f(ce.rename?`filesRename`:`filesMove`)}),(0,q.jsx)(`button`,{type:`button`,disabled:z,onClick:()=>le(null),children:f(`cancel`)})]})]}),he.length>0&&(0,q.jsxs)(`div`,{className:`file-import-results`,children:[(0,q.jsx)(`ol`,{"aria-label":f(`filesOrganizationResults`),"aria-live":`polite`,children:he.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`span`,{children:e.path}),(0,q.jsx)(`small`,{role:e.error?`alert`:void 0,children:e.error??f(`filesOperationDone`)})]},e.path))}),ke.length>0&&(0,q.jsx)(`button`,{type:`button`,disabled:z||!r,onClick:()=>void dt(ke),children:f(`filesUndoTrash`)})]}),ve&&(0,q.jsxs)(`section`,{className:`file-trash-list`,"aria-label":f(`filesTrash`),children:[(0,q.jsx)(`p`,{children:f(`filesTrashDetail`)}),Ce>0&&(0,q.jsx)(`p`,{role:`alert`,children:f(`filesTrashUnavailable`,{count:Ce})}),Te&&xe.length===0?(0,q.jsx)(`p`,{children:f(`readingFile`)}):xe.length===0?(0,q.jsx)(`p`,{children:f(`filesTrashEmpty`)}):(0,q.jsx)(`ul`,{children:xe.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`span`,{title:e.path,children:e.path}),(0,q.jsx)(`button`,{type:`button`,disabled:!r||z,"aria-label":f(`filesRestoreItem`,{name:e.path}),onClick:()=>void dt([e]),children:f(`filesRestore`)})]},e.id))}),U&&(0,q.jsx)(`button`,{type:`button`,disabled:Te,onClick:()=>void ft(),children:f(`filesLoadMore`)})]}),N&&(0,q.jsxs)(`form`,{className:`file-create-form`,onSubmit:e=>void st(e),onKeyDown:e=>{e.key===`Escape`&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.stopPropagation(),ot())},children:[(0,q.jsxs)(`label`,{children:[f(N===`create-file`?`filesFileName`:`filesDirectoryName`),(0,q.jsx)(`input`,{ref:Ie,value:F,maxLength:255,disabled:z,"aria-invalid":!!(ee&&R),onChange:e=>I(e.currentTarget.value)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`button`,{type:`submit`,disabled:!r||z,children:f(z?`filesCreating`:`filesCreate`)}),(0,q.jsx)(`button`,{type:`button`,disabled:z,onClick:ot,children:f(`cancel`)})]})]}),ee&&(0,q.jsx)(`p`,{className:`file-tree-note${R?` evidence-warning`:``}`,role:R?`alert`:`status`,children:ee}),ne.length>0&&(0,q.jsxs)(`div`,{className:`file-import-results`,children:[(0,q.jsx)(`p`,{children:f(`filesImportLimit`)}),(0,q.jsx)(`ol`,{"aria-label":f(`filesImportResults`),"aria-live":`polite`,children:ne.map(e=>(0,q.jsxs)(`li`,{"data-import-state":e.state,children:[(0,q.jsx)(`span`,{title:`${e.directory}/${e.name}`,children:e.name}),(0,q.jsx)(`small`,{children:e.message??f(e.state===`running`?`filesImporting`:`filesImportPending`)}),e.state===`error`&&(e.file||e.kind===`directory`)&&(0,q.jsx)(`button`,{type:`button`,disabled:!r||z,onClick:()=>void ct([e]),children:f(`filesRetryImport`)})]},e.id))}),(0,q.jsx)(`button`,{type:`button`,disabled:z,onClick:()=>re(e=>e.filter(e=>e.state!==`done`)),children:f(`filesClearImported`)})]}),(0,q.jsx)(`span`,{className:`sr-only`,role:`status`,children:Me}),w&&a&&(0,q.jsxs)(`div`,{className:`file-tree-note file-tree-error`,role:`alert`,children:[(0,q.jsx)(`p`,{children:w.message}),w.detail&&(0,q.jsxs)(`details`,{children:[(0,q.jsx)(`summary`,{children:f(`filesErrorDetails`)}),(0,q.jsx)(`p`,{children:w.detail})]}),(0,q.jsx)(`button`,{type:`button`,disabled:E,onClick:()=>k(e=>e+1),children:f(E?`readingFile`:`filesRetryRead`)})]}),(0,q.jsxs)(`section`,{className:`file-tree`,"aria-label":f(`filesExplorer`),ref:qe,onKeyDown:bt,onScroll:e=>{m?.files&&(m.files.treeScroll=e.currentTarget.scrollTop)},"aria-busy":E,children:[(0,q.jsxs)(`ul`,{children:[xt(rt?S?.entries??[]:b[`.`]?.entries??[]),yt(`.`,rt?S:b[`.`])]}),(rt?S?.truncated:b[`.`]?.truncated)&&(0,q.jsx)(`p`,{className:`file-tree-note`,children:f(`filesTruncated`)}),!E&&!w&&(rt?S?.entries.length===0:b[`.`]?.entries.length===0)&&(0,q.jsx)(`p`,{className:`file-tree-note`,children:f(rt?`filesNoMatches`:`filesEmpty`)})]})]})}function sJ({sessionId:e,sessionPath:t,cwd:n,active:r,canWrite:i=!0}){let{t:a}=W(),o=be(),[s,c]=(0,K.useState)(o?.files?.selected??``),[l,u]=(0,K.useState)(o?.files?.treeVisible??!0),[d,f]=(0,K.useState)({error:null,loading:!0}),[p,m]=(0,K.useState)(0),h=(0,K.useRef)(null),g=(0,K.useRef)(null);return(0,K.useLayoutEffect)(()=>{o&&(o.files={query:``,expanded:[`.`],treeScroll:0,...o.files,selected:s,treeVisible:l})},[o,s,l]),(0,q.jsx)(`div`,{ref:h,className:`files-workspace`,"data-tree-visible":l,"data-preview-open":!!s,children:(0,q.jsxs)(FD,{ref:g,sessionId:e,sessionPath:t,embedded:!0,active:r,onClose:()=>{c(``),u(!0)},children:[(0,q.jsx)(V,{content:a(l?`filesHideTree`:`filesShowTree`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`files-tree-toggle icon-button`,"aria-label":a(l?`filesHideTree`:`filesShowTree`),"aria-pressed":l,onClick:()=>u(e=>!e),children:l?(0,q.jsx)(zs,{"aria-hidden":`true`}):(0,q.jsx)(Vs,{"aria-hidden":`true`})})}),!s&&(0,q.jsxs)(`div`,{className:`files-empty-header`,title:n,children:[(0,q.jsx)(zs,{"aria-hidden":`true`}),n.split(/[\\/]/u).filter(Boolean).at(-1)||n]}),!s&&(0,q.jsxs)(`div`,{className:`files-preview-empty`,children:[d.error?(0,q.jsx)(Wc,{"aria-hidden":`true`}):(0,q.jsx)(Fs,{"aria-hidden":`true`}),(0,q.jsx)(`h3`,{children:a(d.error?`filesReadFailed`:d.loading?`readingFile`:`filesChoose`)}),d.error?(0,q.jsxs)(`div`,{className:`files-read-failure`,role:`alert`,children:[(0,q.jsx)(`p`,{children:d.error.message}),d.error.detail&&(0,q.jsxs)(`details`,{children:[(0,q.jsx)(`summary`,{children:a(`filesErrorDetails`)}),(0,q.jsx)(`p`,{children:d.error.detail})]})]}):d.loading?null:(0,q.jsx)(`p`,{role:`status`,children:a(`filesChooseDetail`)}),d.error&&(0,q.jsxs)(`button`,{type:`button`,disabled:d.loading,onClick:()=>{u(!0),m(e=>e+1)},children:[(0,q.jsx)(me,{"aria-hidden":`true`}),a(d.loading?`readingFile`:`filesRetryRead`)]})]}),(0,q.jsx)(`div`,{className:`files-tree-container`,hidden:!l,children:(0,q.jsx)(oJ,{sessionId:e,sessionPath:t,cwd:n,canWrite:i,active:r&&l,selected:s,onSelect:c,dropTarget:h,onShowTree:u,onReadStateChange:f,refreshRequest:p,onRemoved:e=>{e.some(e=>e===s||s.startsWith(`${e}/`))&&g.current?.close({restoreFocus:!1})}},JSON.stringify([e,t,n]))})]})})}var cJ=(0,K.createContext)(null);cJ.displayName=`CollapsibleGroupContext`;var lJ=(0,K.createContext)(null);lJ.displayName=`CollapsibleGroupPresentationContext`;function uJ(e){let{isCollapsible:t,value:n}=e,r=(0,K.use)(cJ),i=r!=null&&n!=null,a=t===!0?{}:t||null,o=a!=null,[s,c]=(0,K.useState)(()=>i?!0:a?.isOpen===void 0?a?.defaultIsOpen??!0:a.isOpen),l;return l=i&&n!=null?r.isOpen(n):a?.isOpen===void 0?s:a.isOpen,{isEnabled:o,isOpen:l,toggle:()=>{if(i&&n!=null){r.toggle(n);return}let e=!l;a?.isOpen===void 0&&c(e),a?.onOpenChange?.(e)}}}var dJ={info:`info`,warning:`warning`,error:`error`,success:`success`},fJ={info:`status`,warning:`alert`,error:`alert`,success:`status`},pJ=`status`,mJ={info:`accent`,warning:`warning`,error:`error`,success:`success`},hJ={root:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kMv6JI:`xjb2p0i`,$$css:!0},rootElevatedCard:{kaIpWk:`x1vf2byn`,$$css:!0},header:{k1xSpc:`x78zum5`,kGNEyG:`x1cy8zhl`,kwnvtZ:`x1a02dak`,k1C7PZ:`xak3so`,khm7nJ:`x4olc9o`,k8WAf4:`x8o8v82`,kg3NbH:`x1pzlopt`,$$css:!0},headerCardStandalone:{kaIpWk:`x1vf2byn`,$$css:!0},headerCardWithContent:{krdFHd:`xwxb7qi`,kfmiAY:`x13nour3`,kVL7Gh:`xbiv7yw`,kT0f0o:`x16uus16`,$$css:!0},headerCentered:{kGNEyG:`x6s0dn4`,$$css:!0},endArea:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kwnvtZ:`x1a02dak`,kjj79g:`x13a6bvl`,kOIVth:`x1txdalj`,kmuXW:`x2lah0s`,ks0D6T:`x193iq5w`,keTefX:`xvc5jky`,kqGvvJ:`x81ka23`,$$css:!0},chevron:{k1ekBW:`x11xpdln`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,$$css:!0},chevronExpanded:{k3aq6I:`x19jd1h0`,$$css:!0}},gJ={info:{kWkggS:`xgcxg3y`,$$css:!0},warning:{kWkggS:`x24i8r5`,$$css:!0},error:{kWkggS:`x1pritpl`,$$css:!0},success:{kWkggS:`xu13z74`,$$css:!0}};function _J(e){return Object.prototype.hasOwnProperty.call(gJ,e)}var vJ={none:{kGVxlE:`x1gnnqk1`,$$css:!0},low:{kGVxlE:`x1i5ehqx`,$$css:!0},med:{kGVxlE:`x14hfi27`,$$css:!0},high:{kGVxlE:`x1kcpxr7`,$$css:!0}};function yJ({status:e,title:t,description:n,icon:r,isDismissable:i=!1,onDismiss:a,dismissLabel:o,endContent:s,container:c=`card`,elevation:l=`none`,collapsible:u=!0,children:d,xstyle:f,className:m,style:h,ref:g,onFocusCapture:_,onPointerDownCapture:v,...y}){let b=jr(),[x,S]=(0,K.useState)(!1),C=typeof u==`object`&&u?u:{},{isEnabled:T,isOpen:E,toggle:D}=uJ({isCollapsible:u!==!1&&{...C,defaultIsOpen:C.defaultIsOpen??!1}}),k=(0,K.useRef)(null),A=(0,K.useId)(),j=dJ[e],M=fJ[e]??pJ,N=mJ[e],P=mt(d),F=b(`@astryx.banner.dismiss`),I=o??F,ee=o??(typeof t==`string`?b(`@astryx.banner.dismissTitled`,{dismiss:F,title:t}):F);if(x)return null;let L=(e,t)=>{e instanceof HTMLElement&&e!==document.body&&!t.contains(e)&&(k.current=e)},R=e=>{L(e.relatedTarget,e.currentTarget)},te=e=>{L(document.activeElement,e.currentTarget)},z=()=>{let e=k.current;S(!0),a?.(),e?.isConnected&&e.focus()},B=T&&P,ne=mt(s)||i||B,re=mt(s)||i,V=!mt(n)&&re,ie=P&&(!T||E),ae=c===`card`;return(0,q.jsxs)(`div`,{ref:g,role:M,onFocusCapture:pt(_,R),onPointerDownCapture:pt(v,te),...H(w(hJ.root,vJ[l],ae&&l!==`none`&&hJ.rootElevatedCard,f),m,h),...y,children:[(0,q.jsxs)(`div`,{...H(O(`banner`,{container:c,status:e}),w(hJ.header,V&&hJ.headerCentered,_J(e)&&gJ[e],ae&&(ie?hJ.headerCardWithContent:hJ.headerCardStandalone))),children:[(0,q.jsx)(`div`,{...mt(r)?H(O(`banner-icon`,{status:e}),{className:`x78zum5 x6s0dn4 x2lah0s`}):{className:`x78zum5 x6s0dn4 x2lah0s`},"aria-hidden":`true`,children:mt(r)?r:j==null?null:(0,q.jsx)(ya,{icon:j,size:`md`,color:N,...O(`banner-icon`,{status:e})})}),(0,q.jsxs)(`div`,{...{0:{className:`x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli`},1:{className:`x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli xgualba`}}[!!mt(s)<<0],children:[(0,q.jsx)(`div`,{className:`x1ghz6dp xjb2p0i xcr08ib x2mo6ok x1kq96og x1tgivj0 xj0a0fe`,children:t}),mt(n)&&(0,q.jsx)(`div`,{className:`x1ghz6dp xjb2p0i x141an7d x1sodnla x1ltkj2j xv1l7n4 xj0a0fe`,children:n})]}),ne&&(0,q.jsxs)(`div`,{...w(hJ.endArea,Yt.inset(p[`--spacing-2`])),children:[s,B&&(0,q.jsx)(Br,{variant:`ghost`,size:`sm`,label:b(E?`@astryx.banner.collapse`:`@astryx.banner.expand`),tooltip:b(E?`@astryx.banner.collapse`:`@astryx.banner.expand`),icon:(0,q.jsx)(ya,{icon:`chevronDown`,size:`sm`,color:`inherit`,xstyle:[hJ.chevron,E&&hJ.chevronExpanded]}),onClick:D,"aria-expanded":E,"aria-controls":ie?A:void 0,isIconOnly:!0}),i&&(0,q.jsx)(Br,{variant:`ghost`,size:`sm`,label:ee,tooltip:I,icon:(0,q.jsx)(ya,{icon:`close`,size:`sm`,color:`inherit`}),onClick:z,isIconOnly:!0})]})]}),ie&&(0,q.jsx)(`div`,{id:B?A:void 0,...H(O(`banner-content`,{container:c,status:e}),{0:{className:`x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh`},1:{className:`x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh x1k5g1gk x1eprgri`}}[!!ae<<0]),children:d})]})}yJ.displayName=`Banner`;var bJ={container:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,k9WMMc:`x2b8uid`,kOIVth:`x18g69wz`,k8WAf4:`xmfvnks`,kg3NbH:`xm7rs69`,$$css:!0},containerCompact:{kOIVth:`x1txdalj`,k8WAf4:`x1na6nto`,kg3NbH:`x1pzlopt`,$$css:!0}};function xJ({title:e,description:t,icon:n,actions:r,headingLevel:i=3,isCompact:a=!1,xstyle:o,className:s,style:c,ref:l,...u}){let d=`h${i}`;return(0,q.jsxs)(`div`,{ref:l,...u,role:`status`,...H(O(`empty-state`,{variant:a?`compact`:null}),w(bJ.container,a&&bJ.containerCompact,o),s,c),children:[n!=null&&(0,q.jsx)(`div`,{"aria-hidden":`true`,children:n}),(0,q.jsxs)(`div`,{className:`x78zum5 xdt5ytf x6s0dn4 xxc7z9f`,children:[(0,K.createElement)(d,H(O(`empty-state-title`,{variant:a?`compact`:null}),{0:{className:`x1ghz6dp xjb2p0i x18juvz8 x2mo6ok xf74fhv x1tgivj0`},1:{className:`x1ghz6dp xjb2p0i x2mo6ok xf74fhv x1tgivj0 xcr08ib`}}[!!a<<0]),e),t!=null&&(0,q.jsx)(`div`,{...H(O(`empty-state-description`,{variant:a?`compact`:null}),{0:{className:`x1ghz6dp xjb2p0i xjm74w1 x1sodnla xw6l6zx xv1l7n4`},1:{className:`x1ghz6dp xjb2p0i x1sodnla xw6l6zx xv1l7n4 x141an7d`}}[!!a<<0]),children:t})]}),r!=null&&(0,q.jsx)(`div`,{...{0:{className:`x78zum5 x1q0g3np x6s0dn4 x1txdalj xcsaf9d`},1:{className:`x78zum5 x6s0dn4 x1txdalj xcsaf9d xdt5ytf`}}[!!a<<0],children:r})]})}xJ.displayName=`EmptyState`;var SJ=1e3,CJ=100,wJ={root:{kWkggS:`xprdx6m x1j0df82 x1o55y2u`,kSiTet:`xvpkmg4 x1tbh5bv`,$$css:!0},animate:{kILWW9:`xpz12be`,k44tkh:`xqgcaz`,ko0y90:`xa4qsjk`,kKVMdj:`xeuoslp x1aquc0h`,kyAemX:`x193epu2`,$$css:!0}},TJ={0:{kaIpWk:`xwksslw`,$$css:!0},1:{kaIpWk:`xx3sua9`,$$css:!0},2:{kaIpWk:`xh6dtrn`,$$css:!0},3:{kaIpWk:`x1hviunn`,$$css:!0},4:{kaIpWk:`x1hviunn`,$$css:!0},none:{kaIpWk:`x2u8bby`,$$css:!0},rounded:{kaIpWk:`xjspbzw`,$$css:!0}},EJ={kKxzle:`xvo38ju`,$$css:!0},DJ={animationDelay:e=>[EJ,{"--x-animationDelay":(e=>typeof e==`number`?e+`ms`:e??void 0)(`${SJ+CJ*e}ms`)}],dimensions:(e,t)=>[{kzqmXN:(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`x5lhr3w`,kZKoxP:(typeof t==`number`?`${t}px`:t)==null?typeof t==`number`?`${t}px`:t:`x16ye13r`,$$css:!0},{"--x-width":(e=>typeof e==`number`?e+`px`:e??void 0)(typeof e==`number`?`${e}px`:e),"--x-height":(e=>typeof e==`number`?e+`px`:e??void 0)(typeof t==`number`?`${t}px`:t)}]};function OJ({width:e=`100%`,height:t=`100%`,radius:n=3,index:r=0,"data-testid":i,xstyle:a,className:o,style:s,ref:c,...l}){return(0,q.jsx)(`div`,{ref:c,"aria-hidden":`true`,"data-testid":i,...H(O(`skeleton`),w(wJ.root,wJ.animate,TJ[n],DJ.dimensions(e,t),DJ.animationDelay(r),a),o,s),...l})}OJ.displayName=`Skeleton`;function kJ({branches:e,value:t,loading:n,onChange:r}){let{t:i}=W(),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(!1),l=(0,K.useRef)(null),u=(0,K.useRef)([]),d=(0,K.useRef)(null),f=(0,K.useId)(),p=e.options.filter(e=>`${e.label} ${e.ref}`.toLocaleLowerCase().includes(a.toLocaleLowerCase()));(0,K.useEffect)(()=>{if(!s)return;let e=requestAnimationFrame(()=>l.current?.focus());return()=>cancelAnimationFrame(e)},[s]),(0,K.useEffect)(()=>{if(!s)return;let e=e=>{let t=e.target;d.current=t instanceof Element&&!t.closest(`.review-base-picker, .review-base-popup`)?t.closest(`button:not(:disabled), input:not(:disabled), textarea:not(:disabled), select:not(:disabled), a[href], [tabindex], [contenteditable='true']`):null};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[s]);let m=e.options.find(e=>e.ref===t)?.label??t;return(0,q.jsx)(ok,{className:`review-base-picker`,label:i(`gitReviewBaseBranch`),isLabelHidden:!0,value:t??``,triggerLabel:(0,q.jsx)(`span`,{className:`review-base-label`,title:t,children:m||i(`gitReviewChooseBase`)}),variant:`ghost`,size:`sm`,isDisabled:e.options.length===0,isLoading:n,onOpenChange:e=>{c(e),e||(o(``),d.current?.isConnected&&d.current.focus({preventScroll:!0}),d.current=null)},children:(s,c,d)=>(0,q.jsxs)(`div`,{className:`review-base-popup`,children:[(0,q.jsxs)(`label`,{className:`review-base-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`sr-only`,children:i(`gitReviewSearchBranches`)}),(0,q.jsx)(`input`,{ref:l,type:`search`,value:a,"aria-controls":f,placeholder:i(`gitReviewSearchBranches`),onChange:e=>o(e.currentTarget.value),onKeyDown:e=>{e.nativeEvent.isComposing||e.keyCode===229||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),d()):e.key===`ArrowDown`&&p.length&&!n&&(e.preventDefault(),u.current[0]?.focus()))}})]}),e.truncated&&(0,q.jsx)(`p`,{role:`status`,children:i(`gitReviewBranchesTruncated`)}),(0,q.jsxs)(`div`,{id:f,role:`listbox`,"aria-label":i(`gitReviewBaseBranch`),className:`review-base-options`,children:[p.map((e,a)=>(0,q.jsxs)(`button`,{type:`button`,disabled:n,role:`option`,"aria-selected":t===e.ref,title:e.ref,ref:e=>{u.current[a]=e},onClick:()=>{r(e.ref),d()},onKeyDown:e=>{if(!(e.nativeEvent.isComposing||e.keyCode===229)){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),d();else if(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?0:e.key===`End`?p.length-1:(a+(e.key===`ArrowDown`?1:p.length-1))%p.length;u.current[t]?.focus()}}},children:[(0,q.jsxs)(`span`,{children:[e.label,(0,q.jsx)(`small`,{children:e.ref.startsWith(`refs/heads/`)?i(`gitReviewLocalBranch`):i(`gitReviewRemoteBranch`)})]}),t===e.ref&&(0,q.jsx)(rs,{"aria-hidden":`true`})]},e.ref)),!p.length&&(0,q.jsx)(`p`,{role:`status`,children:i(`gitReviewNoMatchingBranches`)})]})]})})}function AJ(e,t){return{path:e,name:t,directories:new Map,files:[]}}function jJ({files:e,selectedPath:t,collapsed:n,searching:r,onToggle:i,onSelect:a,viewed:o,onViewedChange:s,viewedLimitReached:c=!1}){let{t:l}=W(),u=(0,K.useMemo)(()=>{let t=AJ(``,``);for(let n of e){let e=t;for(let t of n.path.split(`/`).slice(0,-1)){let n=e.path?`${e.path}/${t}`:t,r=e.directories.get(t);r||(r=AJ(n,t),e.directories.set(t,r)),e=r}e.files.push(n)}return t},[e]),d=(e,u)=>(0,q.jsxs)(`ul`,{children:[[...e.directories.values()].map(e=>{let t=e,a=t.name;for(;t.files.length===0&&t.directories.size===1;){let e=t.directories.values().next().value;if(!e)break;t=e,a+=`/${t.name}`}let o=t.path,s=r||!n.has(o);return(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`button`,{type:`button`,className:`review-tree-directory`,style:{paddingLeft:8+u*10},title:o,"aria-expanded":s,disabled:r,onClick:()=>i(o),children:[(0,q.jsx)(os,{"aria-hidden":`true`,"data-open":s}),(0,q.jsx)(`span`,{children:a})]}),s&&d(t,u+1)]},e.path)}),e.files.map(e=>{let n=e.path.split(`/`).at(-1)??e.path,r=/\.(png|jpe?g|gif|webp|svg)$/iu.test(n)?qs:/\.(md|txt|log)$/iu.test(n)?Fs:js;return(0,q.jsxs)(`li`,{className:`review-tree-file-row`,children:[(0,q.jsxs)(`button`,{className:`session-review-file review-tree-file`,type:`button`,style:{paddingLeft:8+u*10},"data-review-file":e.path,title:e.path,"aria-label":e.path,"aria-description":l(`gitFileStatus_${e.status}`),"aria-current":t===e.path?`true`:void 0,onClick:()=>a(e.path),children:[(0,q.jsx)(r,{"aria-hidden":`true`,className:`review-tree-icon`}),(0,q.jsx)(`span`,{className:`review-tree-name`,children:n}),(0,q.jsx)(`span`,{className:`review-tree-status`,"aria-hidden":`true`,children:l(`gitFileStatus_${e.status}`)}),(0,q.jsx)(`span`,{className:`session-review-stats`,"aria-hidden":`true`,children:e.binary?(0,q.jsx)(`span`,{children:l(`gitReviewBinaryShort`)}):e.statsUnavailable?(0,q.jsx)(`span`,{title:l(`turnEditStatsUnknown`),children:`—`}):(0,q.jsxs)(q.Fragment,{children:[e.additions>0&&(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,e.additions]}),e.deletions>0&&(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`-`,e.deletions]})]})})]}),s&&(0,q.jsx)(`label`,{className:`review-viewed-control`,title:l(`gitReviewMarkViewed`,{path:e.path}),children:(0,q.jsx)(`input`,{type:`checkbox`,"aria-label":l(`gitReviewMarkViewed`,{path:e.path}),checked:o?.has(e.path)??!1,disabled:c&&!o?.has(e.path),onChange:t=>s(e.path,t.currentTarget.checked)})})]},e.path)})]});return(0,q.jsx)(`div`,{className:`session-review-list review-file-tree`,children:d(u,0)})}var MJ=20,NJ=200,PJ=[0,1,2,3];function FJ(e){return e.split(/[\\/]/u).at(-1)||e}function IJ(e,t){return e?e.reason===`not_git_repository`?t(`gitReviewNotRepository`):e.reason===`unborn_repository`?t(`gitReviewUnborn`):e.reason===`baseline_unavailable`?t(`gitReviewBaselineUnavailable`):e.reason===`base_branch_unavailable`?t(`gitReviewBaseUnavailable`):e.reason===`invalid_base_branch`?t(`gitReviewBaseInvalid`):t(`gitReviewFailed`):null}function LJ({review:e,initialFilePath:t,onClose:n,onOpenTools:r,embedded:i=!1,active:a=!0,onOpenFiles:o,readingScope:s,onReferenceLine:c}){let{t:l}=W(),u=be(),d=(0,K.useRef)(void 0);e.result?.branches?d.current=e.result.branches:e.result&&!e.loading&&(d.current=void 0);let f=e.result?.branches??(e.loading?d.current:void 0),p=`${s??e.source??`unstaged`}:${e.baseRef??``}`,m=u?.review?.scope===p?u.review:void 0,h=(0,K.useRef)(JSON.stringify([p,t])),g=(0,K.useRef)(null),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(new Set(m?.collapsedDirectories));(0,K.useEffect)(()=>{let e=g.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(([e])=>{e&&v(e.contentRect.width>=720)});return t.observe(e),()=>t.disconnect()},[]);let x=(0,K.useRef)(null),S=(0,K.useRef)(null),C=(0,K.useRef)(null),w=(0,K.useRef)(!0),T=(0,K.useRef)(!1),E=(0,K.useRef)(m?.listScroll??null),D=(0,K.useRef)(null),[O,k]=(0,K.useState)(m?.visibleFiles??MJ),[A,j]=(0,K.useState)(m?.query??``),[M,N]=(0,K.useState)(null),[P,F]=(0,K.useState)(m?m.selected:t??null),[I,ee]=(0,K.useState)(()=>m?.viewed?{scope:p,revision:m.viewed.revision,paths:new Set(m.viewed.paths.slice(0,NJ))}:null),L=(0,K.useRef)(m?{list:m.listScroll,preview:m.previewScroll}:null);(0,K.useLayoutEffect)(()=>{u&&(u.review={source:e.source??`unstaged`,baseRef:e.baseRef,scope:p,selected:P,query:A,collapsedDirectories:[...y],visibleFiles:O,listScroll:u.review?.scope===p?u.review.listScroll:0,previewScroll:u.review?.scope===p?u.review.previewScroll:0,viewed:I?.scope===p?{revision:I.revision,paths:[...I.paths].slice(0,NJ)}:void 0})},[u,e.source,e.baseRef,p,P,A,y,O,I]);let[R,te]=(0,K.useState)(null),[z,B]=(0,K.useState)(null),[ne,re]=(0,K.useState)(0),[ie,ae]=(0,K.useState)(()=>window.matchMedia?.(`(max-width: 1100px)`).matches??!1);(0,K.useEffect)(()=>{let e=window.matchMedia?.(`(max-width: 1100px)`);if(!e)return;let t=()=>ae(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,K.useEffect)(()=>{let e=JSON.stringify([p,t]);h.current!==e&&(h.current=e,w.current=!!t||!(document.activeElement instanceof Element&&document.activeElement.closest(`.review-base-picker, .review-base-popup`)),E.current=null,F(t??null),j(``),b(new Set),N(null),ee(null))},[t,p]);let oe=i?`section`:ie?`main`:`aside`,se=e.result?.ok?e.result.snapshot:null,ce=!e.historical&&P&&M&&M.comparison===(e.source??se?.comparison)?se?.revision===M.revision?se:M:se,le=!!(P&&ce&&se&&ce.revision!==se.revision);(0,K.useEffect)(()=>{P&&!M&&se&&N(se)},[P,M,se]);let H=e.source??ce?.comparison??`unstaged`,ue=IJ(e.result&&!e.result.ok?e.result:null,l),de=ce?.files.find(e=>e.path===P),fe=R?.source===H&&R?.revision===ce?.revision&&R?.file.path===P?R.file:de,pe=ce?.revision,he=I?.scope===p&&I.revision===pe?I.paths:new Set;(0,K.useEffect)(()=>{pe&&I&&(I.scope!==p||I.revision!==pe)&&ee(null)},[pe,p,I]);let ge=(e,t)=>{!pe||!ce?.files.some(t=>t.path===e)||ee(n=>{let r=new Set(n?.scope===p&&n.revision===pe?n.paths:[]);if(t){if(r.size>=NJ)return n;r.add(e)}else r.delete(e);return{scope:p,revision:pe,paths:r}})};(0,K.useLayoutEffect)(()=>{!a||!ce||!L.current||P&&fe?.diffLoaded===!1||(S.current&&(S.current.scrollTop=L.current.list),C.current&&(C.current.scrollTop=L.current.preview),L.current=null)},[a,ce,P,fe?.diffLoaded]);let _e=z?.source===H&&z?.path===P&&z?.revision===pe&&de?.diffLoaded===!1?z.message:null;(0,K.useEffect)(()=>{let t=de?.path;if(!a||!t||de?.diffLoaded!==!1||!e.readFile||!pe)return;let n=new AbortController;return B(null),e.readFile(t,n.signal,pe).then(e=>{n.signal.aborted||(e?te({source:H,revision:pe,file:e}):B({source:H,path:t,revision:pe,message:l(`gitReviewFileMissing`)}))},e=>{n.signal.aborted||B({source:H,path:t,revision:pe,message:e instanceof Error?e.message:l(`gitReviewFailed`)})}),()=>n.abort()},[de?.path,a,de?.diffLoaded,pe,H,e.readFile,ne,l]);let ve=(0,K.useMemo)(()=>(ce?.files??[]).filter(e=>e.path.toLocaleLowerCase().includes(A.toLocaleLowerCase())).sort((e,t)=>e.path.localeCompare(t.path,`en`,{numeric:!0})),[ce?.files,A]),ye=_?ve:ve.slice(0,O);(0,K.useEffect)(()=>{!_||P||!ce?.files.length||(w.current=!1,F(ce.files[0].path))},[_,P,ce]);let xe=Math.max(0,ve.length-ye.length),Se=ce?.listComplete===!1||ce?.listComplete===void 0&&ce?.truncated,Ce=Se||ce?.nextOffset!==void 0,we=e.historical?l(ce?.evidenceSource===`file-tools`?`turnEditsScope`:`turnChangesScope`):ce?ce.comparison===`session`?l(`gitReviewSessionSnapshot`):ce.comparison===`unstaged`?l(`gitReviewUnstaged`):ce.comparison===`staged`?l(`gitReviewStaged`):ce.baseBranch?l(`gitReviewComparison`,{current:ce.currentBranch??l(`gitReviewDetached`),base:ce.baseBranch.replace(/^refs\/(?:heads|remotes)\//u,``)}):l(`gitReviewWorkingTree`):null;(0,K.useEffect)(()=>{let e=a&&!T.current;T.current=a,a&&(!e&&!w.current||(w.current=!1,P?C.current?.focus():i?S.current?.focus():x.current?.focus()))},[a,i,P]);let Te=e=>{E.current=S.current?.scrollTop??null,e!==P&&(L.current={list:E.current??0,preview:0},C.current&&(C.current.scrollTop=0),u?.review?.scope===p&&(u.review.previewScroll=0)),w.current=!_,N(ce),F(e)};(0,K.useLayoutEffect)(()=>{let e=D.current;if(P||!e||!a)return;D.current=null;let t=S.current;if(!t?.isConnected||t.closest(`[hidden], [inert]`))return;let n=[...t.querySelectorAll(`[data-review-file]`)].find(t=>t.dataset.reviewFile===e);E.current!==null&&(t.scrollTop=E.current),n?n.focus({preventScroll:E.current!==null}):i?t.focus():x.current?.focus()},[a,i,P]);let Ee=()=>{let e=P,t=ve.findIndex(t=>t.path===e);t>=O&&k(Math.ceil((t+1)/MJ)*MJ),w.current=!1,D.current=e,F(null),N(null)};return(0,q.jsxs)(oe,{ref:g,className:`review-panel${i?` embedded`:``}${_?` review-wide`:``}`,"aria-label":l(`changeEvidence`),"aria-busy":e.loading||void 0,onKeyDown:e=>{e.key!==`Escape`||e.nativeEvent.isComposing||e.keyCode===229||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||e.defaultPrevented||(!P||_)&&i||(e.preventDefault(),e.stopPropagation(),P&&!_?Ee():i||n())},children:[(0,q.jsxs)(`div`,{className:`review-source-picker`,children:[e.setSource&&(0,q.jsxs)(`label`,{children:[l(`gitReviewSource`),` `,(0,q.jsxs)(`select`,{value:e.historical?`turn`:e.source??`unstaged`,onChange:t=>e.setSource?.(t.currentTarget.value),children:[e.historical&&(0,q.jsx)(`option`,{value:`turn`,children:l(`turnChangesReview`)}),(0,q.jsx)(`option`,{value:`unstaged`,children:l(`gitReviewUnstaged`)}),(0,q.jsx)(`option`,{value:`staged`,children:l(`gitReviewStaged`)}),(0,q.jsx)(`option`,{value:`branch`,children:l(`gitReviewBranch`)}),(0,q.jsx)(`option`,{value:`session`,children:l(`gitReviewSessionSnapshot`)})]})]}),e.source===`branch`&&e.setBaseRef&&f&&(0,q.jsx)(kJ,{branches:f,value:e.baseRef??(e.result?.ok?e.result.snapshot.baseBranch??void 0:void 0),loading:e.loading,onChange:e.setBaseRef}),we&&(!e.setSource||e.historical||ce?.comparison===`branch`)&&(0,q.jsx)(`span`,{className:`review-source-summary`,title:we,children:we}),(0,q.jsxs)(`div`,{className:`review-source-actions`,children:[o&&(0,q.jsx)(`button`,{type:`button`,onClick:o,children:l(`sessionFileRecords`)}),(0,q.jsx)(V,{content:l(`gitReviewRefresh`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":l(`gitReviewRefresh`),disabled:e.loading,"aria-busy":e.loading||void 0,onClick:()=>{e.loading||e.refresh()},children:(0,q.jsx)(me,{"aria-hidden":`true`})})})]})]}),le&&(0,q.jsxs)(`div`,{className:`review-update`,role:`status`,children:[(0,q.jsx)(`span`,{children:l(`gitReviewNewVersion`)}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{C.current?.focus(),N(se),te(null)},children:l(`gitReviewShowLatest`)})]}),(e.error||ue)&&(0,q.jsx)(yJ,{status:`error`,container:`section`,title:e.error||ue,description:ce?l(`gitReviewOlderResult`):void 0,className:`review-banner`,endContent:(0,q.jsx)(Br,{variant:`ghost`,size:`sm`,label:l(`gitReviewRetry`),isDisabled:e.loading,isLoading:e.loading,onClick:()=>{e.loading||e.refresh()}})}),(0,q.jsxs)(`div`,{className:`review-workspace`,children:[P&&(0,q.jsxs)(`div`,{className:`review-file-screen`,children:[(0,q.jsxs)(`header`,{className:`review-file-header`,children:[!_&&(0,q.jsx)(Br,{label:l(`gitReviewBackToFiles`),variant:`ghost`,size:`sm`,isIconOnly:!0,icon:(0,q.jsx)(Ko,{"aria-hidden":`true`}),onClick:Ee}),(0,q.jsxs)(`div`,{className:`review-file-heading`,children:[(0,q.jsx)(`strong`,{title:P,children:FJ(P)}),(0,q.jsx)(`span`,{title:P,children:P})]}),fe&&pe&&(0,q.jsxs)(`label`,{className:`review-file-viewed`,children:[(0,q.jsx)(`input`,{type:`checkbox`,"aria-label":l(`gitReviewMarkCurrentViewed`,{path:P}),checked:he.has(P),disabled:he.size>=NJ&&!he.has(P),onChange:e=>ge(P,e.currentTarget.checked)}),(0,q.jsx)(`span`,{children:l(`gitReviewViewedLabel`)})]}),!i&&(0,q.jsxs)(`div`,{className:`review-file-actions`,children:[r&&(0,q.jsx)(Br,{label:l(`openTools`),variant:`ghost`,size:`sm`,isIconOnly:!0,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:r}),(0,q.jsx)(Br,{label:l(`close`),variant:`ghost`,size:`sm`,isIconOnly:!0,icon:(0,q.jsx)(je,{"aria-hidden":`true`}),onClick:n})]})]}),(0,q.jsxs)(`div`,{className:`review-file-toolbar`,children:[(0,q.jsx)(`div`,{className:`review-file-context`,children:fe&&(0,q.jsx)(`span`,{children:l(`gitFileStatus_${fe.status}`)})}),(0,q.jsxs)(oj,{gap:2,align:`center`,className:`session-review-stats`,children:[fe&&!fe.binary&&!fe.statsUnavailable&&fe.additions>0&&(0,q.jsxs)(jt,{type:`supporting`,hasTabularNumbers:!0,className:`review-additions`,children:[`+`,fe.additions]}),fe&&!fe.binary&&!fe.statsUnavailable&&fe.deletions>0&&(0,q.jsxs)(jt,{type:`supporting`,hasTabularNumbers:!0,className:`review-deletions`,children:[`-`,fe.deletions]})]})]}),(0,q.jsx)(`section`,{ref:C,className:`review-file-preview`,"aria-label":l(`gitReviewFilePreview`,{file:P}),tabIndex:-1,onScroll:e=>{u?.review&&(u.review.previewScroll=e.currentTarget.scrollTop)},children:fe?_e?(0,q.jsxs)(`div`,{role:`alert`,children:[(0,q.jsx)(`p`,{children:_e}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>re(e=>e+1),children:l(`retryAdmissionCheck`)})]}):fe.diffLoaded===!1&&e.readFile?(0,q.jsx)(`p`,{role:`status`,children:l(`gitReviewLoading`)}):fe.binary?(0,q.jsx)(xJ,{icon:(0,q.jsx)(js,{"aria-hidden":`true`}),title:l(`gitReviewBinary`),isCompact:!0}):fe.statsUnavailable?(0,q.jsx)(xJ,{icon:(0,q.jsx)(js,{"aria-hidden":`true`}),title:l(`turnEditStatsUnknown`),description:l(`turnEditReason_${fe.statsUnavailable}`),isCompact:!0}):fe.diff?(0,q.jsxs)(q.Fragment,{children:[fe.diffTruncated&&(0,q.jsx)(`p`,{className:`review-hidden-lines`,children:l(`gitReviewDiffTruncated`)}),(0,q.jsx)(mK,{file:fe,onReferenceLine:c})]}):(0,q.jsx)(xJ,{icon:(0,q.jsx)(js,{"aria-hidden":`true`}),title:l(fe.diffTruncated?`gitReviewDiffTruncated`:`gitReviewNoDiff`),description:fe.diffTruncated?l(`gitReviewDiffTruncated`):void 0,isCompact:!0}):(0,q.jsx)(`p`,{role:`status`,children:l(e.loading?`gitReviewLoading`:`gitReviewFileMissing`)})})]}),(!P||_)&&(0,q.jsxs)(`div`,{className:`review-navigation`,children:[!i&&!_&&(0,q.jsxs)(`header`,{className:`review-heading`,children:[(0,q.jsx)(`div`,{children:(0,q.jsxs)(`h2`,{children:[(0,q.jsx)(Ms,{"aria-hidden":`true`}),` `,l(`changeEvidence`)]})}),(0,q.jsxs)(`div`,{className:`review-heading-actions`,children:[r&&(0,q.jsx)(V,{content:l(`openTools`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":l(`openTools`),onClick:r,children:(0,q.jsx)(Ae,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:l(`close`),placement:`below`,children:(0,q.jsx)(`button`,{ref:x,type:`button`,className:`icon-button review-close`,"aria-label":l(`close`),onClick:n,children:(0,q.jsx)(je,{"aria-hidden":`true`})})})]})]}),(0,q.jsxs)(`div`,{ref:S,onScroll:e=>{u?.review&&(u.review.listScroll=e.currentTarget.scrollTop)},className:`review-body`,tabIndex:i?-1:void 0,children:[ce&&(0,q.jsxs)(sj,{gap:1,align:`stretch`,className:`review-summary`,children:[(0,q.jsxs)(oj,{gap:3,align:`center`,justify:`between`,children:[(0,q.jsx)(jt,{type:`label`,children:l(Se?`gitReviewLoadedCount`:`filesChanged`,{count:Se?ce.files.length:ce.totalFiles??ce.files.length})}),ce.nextOffset!==void 0&&!Se&&(0,q.jsx)(jt,{type:`supporting`,color:`secondary`,children:l(`gitReviewLoadedCount`,{count:ce.files.length})}),!Se&&!ce.truncated&&ce.nextOffset===void 0&&(ce.additions>0||ce.deletions>0)&&!ce.files.some(e=>e.binary||e.statsUnavailable||e.status===`untracked`&&e.diffLoaded===!1)&&(0,q.jsxs)(oj,{gap:2,align:`center`,className:`review-summary-counts`,"aria-hidden":`true`,children:[ce.additions>0&&(0,q.jsxs)(jt,{type:`supporting`,hasTabularNumbers:!0,className:`review-additions`,children:[`+`,ce.additions]}),ce.deletions>0&&(0,q.jsxs)(jt,{type:`supporting`,hasTabularNumbers:!0,className:`review-deletions`,children:[`-`,ce.deletions]})]})]}),he.size>=NJ&&(0,q.jsx)(jt,{type:`supporting`,color:`secondary`,children:l(`gitReviewViewedLimit`,{count:NJ})})]}),e.loading&&!ce&&(0,q.jsxs)(`div`,{className:`review-loading`,role:`status`,children:[(0,q.jsx)(`span`,{className:`sr-only`,children:l(`gitReviewLoading`)}),(0,q.jsxs)(sj,{gap:2,align:`stretch`,"aria-hidden":`true`,children:[(0,q.jsx)(OJ,{width:`42%`,height:16,radius:`rounded`,index:0}),(0,q.jsx)(`div`,{className:`review-loading-list`,children:PJ.map(e=>(0,q.jsx)(OJ,{width:`100%`,height:36,radius:0,index:e+1},e))})]})]}),ce?.truncated&&(0,q.jsx)(yJ,{status:`info`,title:l(`gitReviewTruncated`),className:`review-banner`}),ce&&ce.files.length>0&&(0,q.jsxs)(`label`,{className:`review-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`sr-only`,children:l(Ce?`gitReviewSearchLoaded`:`gitReviewSearch`)}),(0,q.jsx)(`input`,{type:`search`,value:A,placeholder:l(Ce?`gitReviewSearchLoaded`:`gitReviewSearch`),onChange:e=>{j(e.target.value),k(MJ)}})]}),A&&ve.length===0&&(0,q.jsx)(`p`,{className:`review-search-empty`,role:`status`,children:l(Ce?`gitReviewNoLoadedMatch`:`gitReviewNoMatch`)}),ce&&ce.files.length===0&&(0,q.jsx)(xJ,{icon:(0,q.jsx)(Ws,{"aria-hidden":`true`}),title:l(`gitReviewEmpty`),isCompact:!0,className:`review-empty`}),ye.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(jJ,{files:ye,selectedPath:P,collapsed:y,searching:!!A,onToggle:e=>b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onSelect:Te,viewed:he,onViewedChange:ge,viewedLimitReached:he.size>=NJ}),xe>0&&(0,q.jsx)(`div`,{className:`session-review-more`,children:(0,q.jsx)(Br,{variant:`ghost`,size:`sm`,width:`100%`,label:l(`gitReviewShowMore`,{count:Math.min(MJ,xe)}),onClick:()=>k(e=>Math.min(e+MJ,ve.length))})})]}),ce?.nextOffset!==void 0&&e.loadMore&&(0,q.jsx)(`div`,{className:`session-review-more`,children:(0,q.jsx)(Br,{variant:`ghost`,size:`sm`,width:`100%`,label:l(`gitReviewLoadNext`),isLoading:e.loading,isDisabled:e.loading,onClick:()=>{e.loadMore?.()}})})]})]})]})]})}function RJ(e,t,n,r){let{t:i}=W(),a=(0,K.useMemo)(()=>new de,[]),[o,s]=(0,K.useState)(0),[c,l]=(0,K.useState)({identity:``,result:null,error:null}),u=JSON.stringify([e,t,r,o]);(0,K.useEffect)(()=>{if(!r)return;let o=new AbortController;return a.turnChanges(e,t,r,o.signal).then(t=>{if(o.signal.aborted)return;if(!t.ok||t.changes.sessionId!==e||t.changes.promptEntryId!==r||t.changes.state===`unavailable`){l({identity:u,result:null,error:i(`turnChangesUnavailable`)});return}let a=t.changes;l({identity:u,error:null,result:{ok:!0,snapshot:{...a.source?{evidenceSource:a.source}:{},...a.fileCount===null?{}:{totalFiles:a.fileCount,listComplete:!0},repositoryRoot:n,currentBranch:null,baseBranch:null,comparison:`session`,revision:u,files:a.files,additions:a.additions,deletions:a.deletions,truncated:a.state===`partial`}}})},()=>{o.signal.aborted||l({identity:u,result:null,error:i(`turnChangesUnavailable`)})}),()=>o.abort()},[a,e,t,r,u,n,i]);let d=(0,K.useCallback)(async()=>s(e=>e+1),[]);return{result:c.identity===u?c.result:null,error:c.identity===u?c.error:null,loading:!!r&&c.identity!==u,refresh:d,historical:!0}}function zJ(e,t,n){let r=(0,K.useRef)({onState:t,onOpen:n});r.current={onState:t,onOpen:n};let[i,a]=(0,K.useState)(),[o,s]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{let t=()=>{let e=document.documentElement.dataset.openpiBrowserExtension===`ready`;s(e),e||a(void 0)};t();let n=new MutationObserver(t);n.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-openpi-browser-extension`]});let i=t=>{if(t.source!==window||t.origin!==location.origin)return;let n=t.data;if(!n||n.source!==`openpi-browser-extension`||n.id!==e)return;if(n.type===`lost`){a(void 0);return}if(typeof n.url!=`string`)return;let i=eJ(n.url,location.origin);if(i&&(n.type===`open`&&r.current.onOpen(i),n.type===`state`&&typeof n.title==`string`)){let t={id:e,document:typeof n.document==`string`?n.document:void 0,url:i,title:n.title.slice(0,256),canGoBack:n.canGoBack===!0,canGoForward:n.canGoForward===!0};a(t),r.current.onState(t)}};return window.addEventListener(`message`,i),()=>{n.disconnect(),window.removeEventListener(`message`,i)}},[e]),{ready:o,page:o&&i?.id===e?i:void 0,command:t=>window.postMessage({source:`openpi-browser-ui`,type:`command`,id:e,action:t},location.origin)}}var BJ=8;function VJ({onTitle:e,onOpen:t,initialUrl:n=``,readingId:r}){let{t:i}=W(),a=(0,K.useId)(),o=(0,K.useRef)(null),s=be(),c=s?.browser?.pages[r],[l,u]=(0,K.useState)(c?.draft??n),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)({history:c?.history??(n?[n]:[]),index:c?.index??(n?0:-1),revision:0,loaded:!1,unknown:!1}),h=p.history[p.index],g=(0,K.useRef)(h);(0,K.useLayoutEffect)(()=>{s?.browser&&(s.browser.pages[r]={draft:l,history:p.history.map((e,t)=>t===p.index?g.current??e:e),index:p.index})},[s,r,l,p]);let _=`${a}-${p.revision}`,v=zJ(_,t=>{g.current=t.url;let n=s?.browser?.pages[r];n&&(n.history=n.history.map((e,r)=>r===n.index?t.url:e)),document.activeElement!==o.current&&u(t.url),e(t.title||new URL(t.url).host)},t),y=v.page?.url??h,b=(t,n)=>{let r=t[n];r&&(g.current=r,m(e=>({history:t,index:n,revision:e.revision+1,loaded:!1,unknown:!1})),u(r),f(null),e(new URL(r).host))};return(0,q.jsxs)(`div`,{className:`browser-tool browser-direct-tool`,children:[(0,q.jsxs)(`form`,{className:`browser-toolbar`,onSubmit:e=>{e.preventDefault();let t=eJ(l,window.location.origin);if(!t){f(i(`browserAddressNotAllowed`));return}if(t===h)b(p.history,p.index);else{let e=[...p.history.slice(0,p.index+1),t].slice(-64);b(e,e.length-1)}},children:[(0,q.jsxs)(`div`,{className:`browser-navigation`,children:[(0,q.jsx)(V,{content:i(`browserBack`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":i(`browserBack`),disabled:v.page?!v.page.canGoBack:p.unknown||p.index<=0,onClick:()=>v.page?v.command(`back`):b(p.history,p.index-1),children:(0,q.jsx)(Ko,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:i(`browserForward`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":i(`browserForward`),disabled:v.page?!v.page.canGoForward:p.unknown||p.index>=p.history.length-1,onClick:()=>v.page?v.command(`forward`):b(p.history,p.index+1),children:(0,q.jsx)(qo,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:i(`browserReload`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":i(`browserReload`),disabled:!h,onClick:()=>v.page?v.command(`reload`):b(p.history,p.index),children:(0,q.jsx)(me,{"aria-hidden":`true`})})})]}),(0,q.jsx)(`input`,{ref:o,"aria-label":i(`browserAddress`),title:i(v.page?`browserAddress`:`browserEnteredAddress`),value:l,placeholder:`https://`,spellCheck:!1,onChange:e=>{u(e.currentTarget.value),f(null)}}),(0,q.jsx)(V,{content:i(`browserGo`),placement:`below`,children:(0,q.jsx)(`button`,{type:`submit`,"aria-label":i(`browserGo`),disabled:!l.trim(),children:(0,q.jsx)(qo,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:i(`openExternalBrowser`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":i(`openExternalBrowser`),disabled:!y||!v.page&&p.unknown,onClick:()=>y&&window.open(y,`_blank`,`noopener,noreferrer`),children:(0,q.jsx)(Os,{"aria-hidden":`true`})})})]}),(0,q.jsxs)(`div`,{className:`browser-feedback`,children:[d&&(0,q.jsx)(`p`,{className:`workbar-error`,role:`alert`,children:d}),p.unknown&&!v.page&&(0,q.jsx)(`p`,{className:`browser-notice`,role:`status`,children:i(`browserLocationUnknown`)})]}),(0,q.jsx)(`div`,{className:`browser-direct-viewport`,children:h?(0,q.jsx)(`iframe`,{"data-openpi-browser-page":_,"data-openpi-browser-document":v.page?.document,"data-openpi-browser-url":v.page?.url,"data-openpi-browser-title":v.page?.title,src:h,title:i(`browserPageTitle`,{address:new URL(h).host}),referrerPolicy:`no-referrer`,sandbox:`allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox`,onLoad:()=>m(e=>e.revision===p.revision?{...e,loaded:!0,unknown:e.loaded}:e)},p.revision):(0,q.jsxs)(`div`,{className:`workbar-empty`,children:[(0,q.jsx)(Es,{"aria-hidden":`true`}),(0,q.jsx)(`strong`,{children:i(`browserReady`)}),(0,q.jsx)(`p`,{children:i(`browserDirectDescription`)})]})}),(0,q.jsx)(`p`,{className:`browser-notice`,children:i(v.ready?`browserEnhancedHint`:`browserDirectHint`)})]})}function HJ({onReady:e}={}){let{t}=W(),n=(0,K.useId)(),r=be(),[i,a]=(0,K.useState)(r?.browser?.tabs??[{id:0,title:``}]),o=(0,K.useRef)(Math.max(...i.map(e=>e.id))+1),s=(0,K.useRef)(i);s.current=i;let[c,l]=(0,K.useState)(),[u,d]=(0,K.useState)(r?.browser?.selected??0);(0,K.useLayoutEffect)(()=>{r&&(r.browser={tabs:i,selected:u,pages:r.browser?.pages??{}})},[r,i,u]);let f=e=>{requestAnimationFrame(()=>document.getElementById(`${n}-tab-${e}`)?.focus())},p=(e=``)=>{if(s.current.length>=BJ){e&&l(e);return}let t={id:o.current++,title:e?new URL(e).host:``,initialUrl:e},r=[...s.current,t];return s.current=r,a(r),d(t.id),l(void 0),f(t.id),`${n}-page-${t.id}`},m=(0,K.useRef)(p);m.current=p,(0,K.useEffect)(()=>(e?.(e=>m.current(e)),()=>e?.(void 0)),[e]);let h=e=>{r?.browser&&delete r.browser.pages[e],l(void 0);let t=i.filter(t=>t.id!==e);if(!t.length){let e={id:o.current++,title:``};a([e]),d(e.id),f(e.id)}else if(a(t),u===e){let n=i.findIndex(t=>t.id===e),r=t[Math.min(n,t.length-1)];d(r.id),f(r.id)}};return(0,q.jsxs)(`div`,{className:`browser-workspace`,children:[(0,q.jsxs)(`div`,{className:`browser-tabs-header`,children:[(0,q.jsx)(`div`,{role:`tablist`,"aria-label":t(`browserTabs`),className:`browser-tabs`,onKeyDown:e=>{if(!(e.target instanceof HTMLElement)||e.target.getAttribute(`role`)!==`tab`)return;let t=e.target.id,r=i.findIndex(e=>`${n}-tab-${e.id}`===t),a=r;if(e.key===`ArrowRight`)a=(r+1)%i.length;else if(e.key===`ArrowLeft`)a=(r+i.length-1)%i.length;else if(e.key===`Home`)a=0;else if(e.key===`End`)a=i.length-1;else if(e.key===`Delete`){e.preventDefault(),e.stopPropagation(),h(i[r].id);return}else return;e.preventDefault(),e.stopPropagation(),d(i[a].id),f(i[a].id)},children:i.map(e=>(0,q.jsxs)(`div`,{className:`browser-tab`,"data-active":e.id===u,children:[(0,q.jsxs)(`button`,{type:`button`,role:`tab`,id:`${n}-tab-${e.id}`,"aria-selected":e.id===u,"aria-controls":`${n}-page-${e.id}`,tabIndex:e.id===u?0:-1,onClick:()=>d(e.id),children:[(0,q.jsx)(Es,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:e.title||t(`browserNewTab`)})]}),(0,q.jsx)(V,{content:t(`close`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":t(`browserCloseTab`,{title:e.title||t(`browserNewTab`)}),onClick:()=>h(e.id),children:(0,q.jsx)(je,{"aria-hidden":`true`})})})]},e.id))}),(0,q.jsx)(V,{content:i.length>=BJ?t(`browserTabLimit`,{count:BJ}):t(`browserAddTab`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`browser-add-tab`,"aria-label":t(`browserAddTab`),disabled:i.length>=BJ,onClick:()=>p(),children:(0,q.jsx)(Ae,{"aria-hidden":`true`})})})]}),c&&(0,q.jsxs)(`p`,{className:`browser-notice`,role:`status`,children:[t(`browserTabLimit`,{count:BJ}),` ·`,` `,(0,q.jsx)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,children:t(`openExternalBrowser`)})]}),(0,q.jsx)(`div`,{className:`browser-pages`,children:i.map(e=>(0,q.jsx)(`div`,{role:`tabpanel`,id:`${n}-page-${e.id}`,"aria-labelledby":`${n}-tab-${e.id}`,className:`browser-page`,hidden:u!==e.id,children:(0,q.jsx)(VJ,{readingId:e.id,initialUrl:e.initialUrl,onOpen:p,onTitle:t=>a(n=>n.map(n=>n.id===e.id?{...n,title:t}:n))})},e.id))})]})}function UJ(e){return e.startsWith(`terminal:`)?`terminal`:e}function WJ(e){return e===`launcher`?{tabs:[],active:null,launcherOpen:!0,activationHistory:[]}:{tabs:[e],active:e,launcherOpen:!1,activationHistory:[e]}}function GJ(e,t){return t===`launcher`?{...e,launcherOpen:!0}:{tabs:e.tabs.includes(t)?e.tabs:[...e.tabs,t],active:t,launcherOpen:!1,activationHistory:[...e.activationHistory.filter(e=>e!==t),t]}}function KJ(e,t){return e.tabs.includes(t)?GJ(e,t):e}function qJ(e,t){if(!e.tabs.includes(t))return e;let n=e.tabs.filter(e=>e!==t),r=e.activationHistory.filter(e=>e!==t);if(e.active!==t)return{...e,tabs:n,activationHistory:r};let i=r.at(-1),a=e.tabs.indexOf(t),o=n[Math.min(a,n.length-1)],s=i??o??null;return{tabs:n,active:s,launcherOpen:e.launcherOpen||s===null,activationHistory:r}}function JJ(e){return{...e,launcherOpen:e.active===null}}var YJ=[{kind:`side-conversation`,icon:cc,title:`sideConversation`,description:`sideConversationDescription`},{kind:`review`,icon:Ms,title:`changeEvidence`,description:`workbarChangesDescription`},{kind:`terminal`,icon:Lc,title:`terminal`,description:`workbarTerminalDescription`},{kind:`browser`,icon:Es,title:`browser`,description:`workbarBrowserDescription`},{kind:`files`,icon:zs,title:`files`,description:`workbarFilesDescription`},{kind:`sources`,icon:Qs,title:`sessionSources`,description:`sourcesDescription`}];function XJ({onSelect:e}){let{t}=W();return(0,q.jsx)(`section`,{className:`workbar-launcher`,"aria-label":t(`openTools`),children:(0,q.jsx)(`div`,{className:`workbar-launcher-list`,children:YJ.map(n=>{let r=n.icon;return(0,q.jsxs)(`button`,{type:`button`,onClick:()=>e(n.kind),children:[(0,q.jsx)(r,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:t(n.title)}),(0,q.jsx)(`small`,{children:t(n.description)})]}),(0,q.jsx)(os,{"aria-hidden":`true`})]},n.kind)})})})}function ZJ({sessionId:e,cwd:t,snapshot:n,activity:r}){let{t:i}=W(),a=(0,K.useMemo)(()=>new de,[]),o=be(),[s,c]=(0,K.useState)(o?.sideConversation?.selectedId??null),[l,u]=(0,K.useState)(o?.sideConversation?.drafts??{});(0,K.useLayoutEffect)(()=>{o&&(o.sideConversation={selectedId:s,drafts:l})},[o,s,l]);let d=l[s??``]??``,f=(0,K.useRef)(0),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(!1),y=(0,K.useRef)(!1),[b,x]=(0,K.useState)(null),[S,C]=(0,K.useState)(0),[w,T]=(0,K.useState)(null),E=(0,K.useRef)(null);(0,K.useEffect)(()=>()=>E.current?.abort(),[]);let D=(r?.items??[]).filter(e=>e.origin===`btw`),O=D.find(e=>e.id===s),k=O?.status??w,A=p?.id===s?p:null,j=n?.models.find(e=>s?`${e.provider}/${e.id}`===A?.model:e.current),M=s?A?.model:j&&`${j.provider}/${j.id}`,N=j?.name||j?.id||M||i(`usageUnknown`),P=!s&&n?.thinking?.supported?n.thinking.level:void 0,F=A?.cwd??t,I=n?.workspaces.find(e=>e.path===F)?.name??LD(F),ee=i(s?`continueSideConversation`:`startSideConversation`),L=i(_?`sideConversationPending`:s?`send`:`start`),R=e=>{f.current++,c(e),T(null),x(null),g(null)},te=async t=>{t.preventDefault();let n=d.trim();if(!n||y.current)return;y.current=!0,E.current?.abort();let r=new AbortController,o=f.current,l=s??``;E.current=r,v(!0),x(null);try{let t=await a.subagentAction(e,s?{kind:`subagents`,action:`send-btw`,id:s,text:n}:{kind:`subagents`,action:`spawn-btw`,prompt:n},r.signal);if(r.signal.aborted)return;if(t.sessionId!==e||s&&t.detail.id!==s)throw Error(i(`inspectionChanged`));if(u(e=>e[l]===d?{...e,[l]:``}:e),o!==f.current)return;c(t.detail.id),T(t.detail.status),C(e=>e+1)}catch(e){!r.signal.aborted&&o===f.current&&x(e instanceof Error?e.message:i(`inspectionUnavailable`))}finally{r.signal.aborted||(y.current=!1,v(!1))}},z=async()=>{if(!s||y.current)return;y.current=!0,E.current?.abort();let t=new AbortController,n=f.current;E.current=t,v(!0),x(null);try{let r=await a.subagentAction(e,{kind:`subagents`,action:`cancel-btw`,id:s},t.signal);if(t.signal.aborted||n!==f.current)return;if(r.sessionId!==e||r.detail.id!==s)throw Error(i(`inspectionChanged`));T(r.detail.status),C(e=>e+1)}catch(e){!t.signal.aborted&&n===f.current&&x(e instanceof Error?e.message:i(`inspectionUnavailable`))}finally{t.signal.aborted||(y.current=!1,v(!1))}};return(0,q.jsxs)(`div`,{className:`side-conversation-body`,children:[s?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`button`,{type:`button`,className:`workbar-back`,onClick:()=>R(null),children:[(0,q.jsx)(Ko,{"aria-hidden":`true`}),` `,i(`backToSideConversations`)]}),(0,q.jsx)(kq,{sessionId:e,id:s,activity:O,client:a,liveAvailable:!0,refreshRevision:S,fullView:!1,readOnlyNote:!1,onDetail:e=>m({id:e.id,cwd:e.cwd,model:e.model})},`${e}:${s}`)]}):(0,q.jsxs)(`div`,{className:`side-conversation-list`,"data-empty":D.length===0,children:[(0,q.jsxs)(`div`,{className:`side-conversation-intro`,children:[(0,q.jsx)(cc,{"aria-hidden":`true`}),(0,q.jsx)(`h3`,{children:i(`sideConversation`)}),(0,q.jsx)(`p`,{children:i(`sideConversationDescription`)})]}),D.length>0&&(0,q.jsx)(`ul`,{children:D.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,onClick:()=>R(e.id),children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:e.title||e.id}),(0,q.jsx)(`small`,{children:i(`subagentState_${e.status}`)})]}),(0,q.jsx)(os,{"aria-hidden":`true`})]})},e.id))})]}),b&&(0,q.jsx)(`p`,{className:`workbar-error`,role:`alert`,children:b}),(0,q.jsx)(`div`,{className:`composer-dock`,children:(0,q.jsxs)(`form`,{className:`composer composer-m02 side-conversation-composer`,onSubmit:te,"aria-busy":_,children:[(0,q.jsx)(`textarea`,{rows:1,value:d,disabled:_,"aria-label":ee,placeholder:ee,onChange:e=>{let t=e.currentTarget.value;u(e=>({...e,[s??``]:t}))},onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.defaultPrevented&&!e.nativeEvent.isComposing&&e.nativeEvent.keyCode!==229&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())}}),(0,q.jsxs)(`div`,{className:`composer-toolbar`,children:[(0,q.jsxs)(`div`,{className:`composer-toolbar-context`,children:[(0,q.jsx)(V,{content:i(`fileReference`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`composer-context-trigger icon-button`,"aria-label":i(`addContext`),disabled:_,onClick:()=>g({key:s??``,generation:f.current}),children:(0,q.jsx)(Ae,{"aria-hidden":`true`})})}),(0,q.jsxs)(`span`,{className:`composer-workspace-label`,title:F,children:[(0,q.jsx)(Vs,{"aria-hidden":`true`}),` `,I]})]}),(0,q.jsxs)(`div`,{className:`composer-toolbar-controls`,children:[(0,q.jsx)(`div`,{className:`model-picker-wrap`,children:(0,q.jsx)(ok,{className:`model-selector model-picker`,label:`${i(`model`)}: ${N}`,isLabelHidden:!0,value:M??``,triggerLabel:(0,q.jsxs)(`span`,{className:`model-thinking-label`,title:M||N,children:[(0,q.jsx)(`span`,{className:`model-picker-label`,children:N}),P&&(0,q.jsx)(`span`,{className:`model-picker-thinking`,children:P[0].toUpperCase()+P.slice(1)})]}),variant:`ghost`,size:`sm`,placement:`above`,alignment:`end`,isDisabled:!M,children:()=>(0,q.jsxs)(`div`,{className:`side-conversation-model-details`,children:[(0,q.jsx)(`strong`,{children:N}),(0,q.jsx)(`code`,{children:M}),(0,q.jsx)(`p`,{children:i(s?`sideConversationModelFixed`:`sideConversationModelInherited`)})]})},s??`new`)}),s&&k===`running`&&(0,q.jsx)(V,{content:i(`stop`),children:(0,q.jsx)(`button`,{type:`button`,className:`send-button`,"aria-label":i(`stop`),disabled:_,onClick:()=>void z(),children:(0,q.jsx)(Rc,{"aria-hidden":`true`})})}),(!s||k!==`running`||!!d.trim())&&(0,q.jsx)(V,{content:L,children:(0,q.jsx)(`button`,{type:`submit`,className:`send-button`,disabled:_||!d.trim(),"aria-label":L,children:(0,q.jsx)(Xo,{"aria-hidden":`true`})})})]})]})]})}),(0,q.jsx)(tk,{open:h!==null,sessionId:e,onClose:()=>g(null),onInsert:e=>{if(!h||h.generation!==f.current||h.key!==(s??``)||y.current)return i(`fileReferenceDraftChanged`);let t=h.key;u(n=>({...n,[t]:`${n[t]??``}${n[t]?` -`:``}${nk(e)}`}))}})]})}function QJ({sessionId:e,cwd:t,tabId:n,active:r,onConnectionChange:i}){let{t:a}=W(),o=be(),s=(0,K.useRef)(null),c=(0,K.useRef)(i);c.current=i;let l=(0,K.useRef)(!0),[u,d]=(0,K.useState)(null),[f,p]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{let e=!1;l.current=!0;let t=e=>{let t=e.target;t instanceof Element&&!s.current?.contains(t)&&!t.matches(`.workbar-tab[data-active] > button:first-child`)&&(l.current=!1)};document.addEventListener(`focusin`,t);let r=o?.terminals?.[n]?.id??null;return c.current({id:r,pending:!0}),Ee(()=>import(`./app-InteractiveTerminal.js`).then(t=>{e||d(()=>t.InteractiveTerminal)},()=>{e||(p(!0),c.current({id:r,pending:!1}))}),__vite__mapDeps([31,1,2,0,32,6])),()=>{e=!0,document.removeEventListener(`focusin`,t)}},[o,n]),(0,q.jsx)(`div`,{className:`terminal-workspace`,ref:s,children:u?(0,q.jsx)(u,{sessionId:e,cwd:t,tabId:n,active:r,canFocusOnMount:()=>l.current,onConnectionChange:i}):(0,q.jsx)(`section`,{className:`interactive-terminal`,"aria-label":a(`terminal`),children:(0,q.jsxs)(`div`,{className:`interactive-terminal-notice`,"aria-live":`polite`,children:[(0,q.jsx)(`span`,{className:f?`error`:void 0,children:a(f?`terminalLoadError`:`terminalConnecting`)}),f&&(0,q.jsxs)(`button`,{type:`button`,className:`terminal-reconnect-action`,onClick:()=>window.location.reload(),children:[(0,q.jsx)(me,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:a(`reloadPage`)})]})]})})})}function $J({visible:e,requestedTool:t,requestRevision:n,sessionId:r,sessionPath:i,cwd:a,snapshot:o,capabilities:s,review:c,reviewInitialFilePath:l,reviewTurn:u,onWorkspaceReview:d,conversationCollapsed:f,onRestoreConversation:p,onExpandReview:m,onClose:h,onActiveToolChange:g,canControl:_=!0,onActivateSession:v,readingState:y,onReferenceLine:b,onBrowserReady:x}){let{t:S}=W(),C=(0,K.useRef)({}),w=y??C.current;w.terminal&&!w.terminals?.terminal&&((w.terminals??={}).terminal=w.terminal,w.terminal=void 0);let[T,E]=(0,K.useState)(()=>w?.tabs?w.requestRevision===n?w.tabs:GJ(w.tabs,t):WJ(t)),D=JSON.stringify([r,i]),O=(0,K.useRef)(new Map),k=(0,K.useRef)(null),A=(0,K.useRef)(null),M=(0,K.useRef)(null),N=(0,K.useMemo)(()=>new de,[]),[P,F]=(0,K.useState)({}),[I,ee]=(0,K.useState)([]),L=(0,K.useRef)(new Set),R=(0,K.useRef)(0);(0,K.useEffect)(()=>()=>{R.current++},[]);let[te,B]=(0,K.useState)(null),[ne,re]=(0,K.useState)(null),[ie,ae]=(0,K.useState)(``),[oe,se]=(0,K.useState)(()=>Object.fromEntries(Object.entries(w.terminals??{}).flatMap(([e,t])=>t.title?[[e,t.title]]:[]))),ce=e=>oe[e]??(e===`terminal`?S(`terminal`):`${S(`terminal`)} ${T.tabs.filter(e=>UJ(e)===`terminal`).indexOf(e)+1}`);(0,K.useLayoutEffect)(()=>{let t=M.current;if(M.current=null,!t||t.scope!==D||!e||(t.tool?T.launcherOpen||T.active!==t.tool:!T.launcherOpen))return;let n=requestAnimationFrame(()=>{let e=t.tool?O.current.get(t.tool):k.current;!e?.isConnected||e.closest(`[hidden], [inert]`)||document.activeElement!==document.body&&!e.closest(`.workbar-panel`)?.contains(document.activeElement)&&!document.getElementById(k.current?.getAttribute(`aria-controls`)??``)?.contains(document.activeElement)||e.focus({preventScroll:!0})});return()=>cancelAnimationFrame(n)},[T,D,e]);let le=e&&!T.launcherOpen&&T.active===`browser`&&_,[H,ue]=(0,K.useState)(null);(0,K.useLayoutEffect)(()=>{le?ue(D):(!e||!_||!T.tabs.includes(`browser`)||H!==D)&&ue(null)},[le,D,e,_,T,H]),(0,K.useLayoutEffect)(()=>{w&&(w.tabs=T,w.requestRevision=n)},[w,T,n]);let fe=RJ(r,i,a,u?.promptEntryId),pe=(0,K.useRef)(n);(0,K.useEffect)(()=>(g?.(e?T.launcherOpen?`launcher`:T.active?UJ(T.active):null:null),()=>g?.(null)),[e,T.launcherOpen,T.active,g]),(0,K.useEffect)(()=>{pe.current!==n&&(pe.current=n,E(e=>GJ(e,t)))},[n,t]);let me=e=>{let t=e===`terminal`&&T.tabs.some(e=>UJ(e)===`terminal`)?`terminal:${crypto.randomUUID()}`:e;if(t!==`launcher`&&(M.current={tool:t,scope:D}),t.startsWith(`terminal:`)){let e=Math.max(1,...Object.values(oe).map(e=>Number(e.match(/\s(\d+)$/u)?.[1])||0))+1,n=`${S(`terminal`)} ${e}`;se(e=>({...e,[t]:n})),(w.terminals??={})[t]={viewport:0,atBottom:!0,title:n}}E(e=>GJ(e,t))},he=async(e,t)=>{let n=R.current,i=t.contains(document.activeElement);if(UJ(e)===`terminal`&&_){if(L.current.has(e)||P[e]?.pending)return;let t=P[e]?.id??w.terminals?.[e]?.id;if(t){L.current.add(e),ee(t=>[...t,e]),B(null);try{await N.closeInteractiveTerminal(r,t)}catch(e){n===R.current&&B(e instanceof Error?e.message:S(`terminalError`));return}finally{n===R.current&&(L.current.delete(e),ee(t=>t.filter(t=>t!==e)))}if(n!==R.current)return}}UJ(e)===`terminal`&&w.terminals&&delete w.terminals[e],E(n=>{let r=qJ(n,e);return(t.contains(document.activeElement)||i&&document.activeElement===document.body)&&(M.current={tool:r.launcherOpen?null:r.active,scope:D}),r})},ge=T.active?UJ(T.active):null,_e=T.launcherOpen?`openTools`:YJ.find(e=>e.kind===ge)?.title??`openTools`;return j({isActive:e,onDismiss:()=>{T.launcherOpen&&T.active?(M.current={tool:T.active,scope:D},E(JJ)):h()},getContainer:()=>A.current,isPresent:()=>A.current?.contains(document.activeElement)??!1}),(0,q.jsx)(ve.Provider,{value:w,children:(0,q.jsx)(z,{children:(0,q.jsxs)(`aside`,{ref:A,className:`workbar-panel`,hidden:!e,"aria-label":S(_e??`openTools`),children:[(0,q.jsxs)(`header`,{className:`workbar-tabbar`,children:[(0,q.jsxs)(`div`,{className:`workbar-tabs`,role:`toolbar`,"aria-label":S(`openTools`),children:[T.tabs.length===0&&(0,q.jsxs)(`span`,{className:`workbar-tab-placeholder`,children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),` `,S(`openTools`)]}),T.tabs.map(e=>{let t=UJ(e),n=YJ.find(e=>e.kind===t),r=n.icon,i=!T.launcherOpen&&T.active===e,a=t===`terminal`?ce(e):S(n.title),o=()=>{t===`terminal`&&(ae(a),re(e))};return(0,q.jsxs)(`div`,{className:`workbar-tab`,"data-active":i||void 0,children:[(0,q.jsxs)(`button`,{type:`button`,ref:t=>{t?O.current.set(e,t):O.current.delete(e)},"aria-pressed":i,title:t===`terminal`?`${a} · ${S(`renameTerminal`)}`:a,onDoubleClick:o,onContextMenu:e=>{t===`terminal`&&(e.preventDefault(),o())},onKeyDown:e=>{t===`terminal`&&e.key===`F2`&&(e.preventDefault(),o())},onClick:()=>E(t=>KJ(t,e)),children:[(0,q.jsx)(r,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:a})]}),(0,q.jsx)(V,{content:t===`terminal`&&_?S(`workbarEndTerminal`,{name:a}):`${S(`close`)} ${a}`,placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`workbar-tab-close`,"aria-label":t===`terminal`&&_?S(`workbarEndTerminal`,{name:a}):`${S(`close`)} ${a}`,disabled:t===`terminal`&&_&&(I.includes(e)||P[e]?.pending!==!1),onClick:t=>void he(e,t.currentTarget),children:(0,q.jsx)(je,{"aria-hidden":`true`})})})]},e)})]}),(0,q.jsxs)(`div`,{className:`workbar-tabbar-actions`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`workbar-back-to-chat`,onClick:()=>{f?p():h(),requestAnimationFrame(()=>document.querySelector(`.composer textarea`)?.focus({preventScroll:!0}))},children:[(0,q.jsx)(Ko,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:S(`workbarBackToChat`)})]}),!f&&T.active===`review`&&m&&(0,q.jsx)(V,{content:S(`gitReviewExpand`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button review-expand`,"aria-label":S(`gitReviewExpand`),onClick:m,children:(0,q.jsx)(gc,{"aria-hidden":`true`,style:{transform:`rotate(180deg)`}})})}),T.active?(0,q.jsx)(yo,{className:`workbar-tool-picker`,button:{ref:k,className:`icon-button workbar-add-tab`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),label:S(`openTools`),isIconOnly:!0,variant:`ghost`,"aria-label":S(`openTools`),tooltip:S(`openTools`)},onOpenChange:e=>{e||(M.current??={tool:T.active,scope:D},E(JJ))},items:YJ.map(e=>({id:e.kind,icon:(0,q.jsx)(e.icon,{"aria-hidden":`true`}),label:S(e.kind===`terminal`?`workbarNewTerminal`:e.title),description:S(e.description),onClick:()=>me(e.kind)})),menuWidth:`min(300px, calc(100vw - 24px))`,alignment:`end`,hasChevron:!1}):(0,q.jsx)(V,{content:S(`openTools`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,ref:k,className:`icon-button workbar-add-tab`,"aria-label":S(`openTools`),"aria-pressed":T.launcherOpen,onClick:()=>E(e=>GJ(e,`launcher`)),children:(0,q.jsx)(Ae,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:S(`workbarCollapseTools`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":S(`workbarCollapseTools`),onClick:h,children:(0,q.jsx)(_c,{"aria-hidden":`true`})})})]})]}),te&&(0,q.jsx)(`p`,{className:`error`,role:`alert`,children:te}),(0,q.jsxs)(`div`,{className:`workbar-panels`,children:[(0,q.jsx)(`div`,{className:`workbar-tool-panel`,hidden:!T.launcherOpen,children:(0,q.jsx)(XJ,{onSelect:me})}),T.tabs.map(t=>{let n=UJ(t);return(0,q.jsx)(`div`,{className:`workbar-tool-panel`,"data-tool":n,"data-tab":t,hidden:T.launcherOpen||T.active!==t,inert:T.launcherOpen||T.active!==t||!e,children:n===`terminal`&&e&&_?(0,q.jsx)(QJ,{sessionId:r,cwd:a,tabId:t,active:!T.launcherOpen&&T.active===t,onConnectionChange:e=>F(n=>({...n,[t]:e}))}):n===`browser`&&e&&_&&(le||H===D)?(0,q.jsx)(HJ,{onReady:x},D):e&&!T.launcherOpen&&T.active===t?!_&&[`side-conversation`,`terminal`,`browser`].includes(n)?(0,q.jsxs)(`div`,{className:`workbar-empty`,children:[(0,q.jsx)(`p`,{children:S(`toolsRequireCurrentSession`)}),v&&(0,q.jsx)(`button`,{type:`button`,className:`secondary`,onClick:v,children:S(`activateViewedSession`)})]}):n===`side-conversation`?(0,q.jsx)(ZJ,{sessionId:r,cwd:a,snapshot:o,activity:s.subagents}):n===`sources`?(0,q.jsx)(iG,{sessionId:r,path:i,revision:o?.selectedSession?.history?.leafEntryId??void 0}):n===`review`?(0,q.jsx)(LJ,{review:u?{...fe,setSource:e=>{c.setSource?.(e),d?.()}}:c,initialFilePath:u?.filePath??l,readingScope:u?`turn:${u.promptEntryId}:${u.revision}`:`workspace:${c.source??`unstaged`}`,onOpenFiles:()=>me(`files`),onReferenceLine:_?b:void 0,onClose:()=>E(e=>qJ(e,`review`)),embedded:!0},u?`${u.promptEntryId}:${u.revision}`:c.source??`workspace`):(0,q.jsx)(sJ,{sessionId:r,sessionPath:i,cwd:a,active:!0,canWrite:_},JSON.stringify([r,i,a])):null},t)})]}),(0,q.jsx)(Se,{isOpen:ne!==null,purpose:`form`,"aria-label":S(`renameTerminal`),onOpenChange:e=>{e||re(null)},children:(0,q.jsxs)(`form`,{className:`openpi-dialog`,onSubmit:e=>{e.preventDefault();let t=ie.trim();if(!ne||!t)return;se(e=>({...e,[ne]:t}));let n=(w.terminals??={})[ne];w.terminals[ne]={...n??{viewport:0,atBottom:!0},title:t},re(null)},children:[(0,q.jsx)(`strong`,{children:S(`renameTerminal`)}),(0,q.jsx)(`input`,{"aria-label":S(`terminalName`),value:ie,maxLength:80,onChange:e=>ae(e.target.value)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>re(null),children:S(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,disabled:!ie.trim(),children:S(`save`)})]})]})})]})})})}var eY=`openpi:workbar-positions:v1`;function tY(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function nY(e,t=4096){return typeof e==`string`&&e.length<=t?e:``}function rY(e,t=0,n=0,r=5e7){return typeof e==`number`&&Number.isFinite(e)&&e>=n&&e<=r?e:t}function iY(e,t=100){return Array.isArray(e)?e.slice(0,t).filter(e=>typeof e==`string`&&e.length<=4096):[]}function aY(e){return eJ(nY(e),window.location.origin)}function oY(e){return typeof e==`string`&&([`files`,`review`,`browser`,`terminal`,`side-conversation`,`sources`].includes(e)||/^terminal:[a-zA-Z0-9-]{1,128}$/u.test(e))}function sY(e){return typeof e==`string`&&[`launcher`,`files`,`review`,`browser`,`terminal`,`side-conversation`,`sources`].includes(e)}function cY(e){let t={};if(!tY(e))return t;if(tY(e.sources)&&(t.sources={scroll:rY(e.sources.scroll)}),tY(e.tabs)){let n=Array.isArray(e.tabs.tabs)?[...new Set(e.tabs.tabs.filter(oY))].slice(0,16):[],r=oY(e.tabs.active)&&n.includes(e.tabs.active)?e.tabs.active:null;t.tabs={tabs:n,active:r,launcherOpen:e.tabs.launcherOpen===!0||r===null,activationHistory:Array.isArray(e.tabs.activationHistory)?[...new Set(e.tabs.activationHistory.filter(oY).filter(e=>n.includes(e)))].slice(-16):[]},t.requestRevision=rY(e.requestRevision)}if(tY(e.files)&&(t.files={selected:nY(e.files.selected),treeVisible:e.files.treeVisible!==!1,query:nY(e.files.query,200),expanded:iY(e.files.expanded),treeScroll:rY(e.files.treeScroll)}),tY(e.artifact)){t.artifact={reference:nY(e.artifact.reference),source:e.artifact.source===!0,editing:!1,scroll:rY(e.artifact.scroll)};let n=e.artifact.document;tY(n)&&typeof n.revision==`string`&&/^[a-f0-9]{64}$/u.test(n.revision)&&(t.artifact.document={path:nY(n.path),revision:n.revision,page:Math.floor(rY(n.page,1,1,1e5)),...typeof n.scale==`number`?{scale:rY(n.scale,1,.1,8)}:{}})}let n=e.review;tY(n)&&(n.source===`unstaged`||n.source===`staged`||n.source===`branch`||n.source===`session`)&&(t.review={scope:nY(n.scope),source:n.source,...typeof n.baseRef==`string`?{baseRef:nY(n.baseRef,1024)}:{},selected:typeof n.selected==`string`?nY(n.selected):null,query:nY(n.query,200),collapsedDirectories:iY(n.collapsedDirectories),visibleFiles:rY(n.visibleFiles,50,0,200),listScroll:rY(n.listScroll),previewScroll:rY(n.previewScroll)},tY(n.viewed)&&typeof n.viewed.revision==`string`&&(t.review.viewed={revision:nY(n.viewed.revision,128),paths:iY(n.viewed.paths,200)}));let r=e.browser;if(tY(r)&&Array.isArray(r.tabs)){let e=new Set,n=r.tabs.flatMap(t=>{if(!tY(t)||!Number.isSafeInteger(t.id)||typeof t.id!=`number`||t.id<0||t.id>5e7||e.has(t.id))return[];e.add(t.id);let n=aY(t.initialUrl);return[{id:t.id,title:nY(t.title,200),...n?{initialUrl:n}:{}}]}).slice(0,8),i={};for(let e of n){let t=tY(r.pages)?r.pages[e.id]:void 0;if(!tY(t))continue;let n=iY(t.history,32).flatMap(e=>aY(e)??[]);i[e.id]={draft:aY(t.draft)??``,history:n,index:n.length?Math.min(Math.floor(rY(t.index)),n.length-1):-1}}t.browser={tabs:n,selected:n.some(e=>e.id===r.selected)?Number(r.selected):n[0]?.id??0,pages:i}}if(tY(e.terminals)){t.terminals={};for(let[n,r]of Object.entries(e.terminals).slice(0,16))!oY(n)||n!==`terminal`&&!n.startsWith(`terminal:`)||!t.tabs?.tabs.includes(n)||!tY(r)||(t.terminals[n]={...typeof r.id==`string`?{id:nY(r.id,128)}:{},...typeof r.title==`string`?{title:nY(r.title,80)}:{},viewport:rY(r.viewport),atBottom:r.atBottom!==!1})}return tY(e.terminal)&&typeof e.terminal.id==`string`&&(t.terminal={id:nY(e.terminal.id,128),viewport:rY(e.terminal.viewport),atBottom:e.terminal.atBottom!==!1}),tY(e.sideConversation)&&(t.sideConversation={selectedId:typeof e.sideConversation.selectedId==`string`?nY(e.sideConversation.selectedId,128):null,drafts:{}}),t}function lY(e){if(!tY(e)||!nY(e.sessionId,128)||!nY(e.sessionPath)||!sY(e.tool))return null;let t={sessionId:nY(e.sessionId,128),sessionPath:nY(e.sessionPath),tool:e.tool,open:e.open===!0,requestRevision:rY(e.requestRevision),reading:cY(e.reading)};return tY(e.reviewTurn)&&nY(e.reviewTurn.promptEntryId,512)&&(t.reviewTurn={promptEntryId:nY(e.reviewTurn.promptEntryId,512),revision:rY(e.reviewTurn.revision),...typeof e.reviewTurn.filePath==`string`?{filePath:nY(e.reviewTurn.filePath)}:{}}),t}function uY(){try{let e=localStorage.getItem(eY);if(!e||e.length>256e3)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=new Map;for(let e of t.slice(-32)){let t=lY(e);t&&n.set(JSON.stringify([t.sessionId,t.sessionPath]),t)}return[...n.values()]}catch{return[]}}function dY(e){try{let t=e.slice(-32).flatMap(e=>lY(e)??[]),n=JSON.stringify(t);for(;n.length>256e3&&t.length;)t.shift(),n=JSON.stringify(t);localStorage.setItem(eY,n)}catch{}}var fY=260,pY=220,mY=520,hY=190,gY=520,_Y=360,vY=720,yY=320,bY=440,xY=1100;function SY(e,t,n){return Math.min(n,Math.max(t,e))}function CY(){$q();let e=nu(WG),{t}=W(),{actions:n}=e,r=(0,K.useRef)(null),i=(0,K.useRef)(null),a=(0,K.useRef)(null),o=(0,K.useRef)(null),s=(0,K.useRef)(!1),c=(0,K.useRef)(null),l=(0,K.useRef)(null),u=(0,K.useRef)(null),d=(0,K.useRef)(null),f=(0,K.useRef)(void 0),p=(0,K.useCallback)(e=>{f.current=e},[]),m=(0,K.useMemo)(cK,[]),h=(0,K.useRef)(new Set),[,g]=(0,K.useState)(0),[_,v]=(0,K.useState)(null),y=(0,K.useMemo)(()=>new Map,[]),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(),[w,T]=(0,K.useState)(!1),[E,D]=(0,K.useState)(!1),[O,k]=(0,K.useState)(()=>window.innerWidth),[A,j]=(0,K.useState)({sidebar:fY,auxiliary:gY}),[M,N]=(0,K.useState)(!1),P=!!e.snapshot,F=e.snapshot?.preferences.sidebarWidth,I=e.snapshot?.preferences.auxiliaryWidth;(0,K.useEffect)(()=>{!P||M||w||j({sidebar:F??fY,auxiliary:I??gY})},[F,I,P,M,w]),(0,K.useEffect)(()=>{if(!M||w)return;let e=window.setTimeout(()=>{n.savePreferences({sidebarWidth:A.sidebar,auxiliaryWidth:A.auxiliary}).catch(()=>void 0)},200);return()=>window.clearTimeout(e)},[n,A,M,w]);let ee=(e,t)=>{N(!0),j(n=>({...n,[e]:t}))},[L,R]=(0,K.useState)(()=>window.matchMedia?.(`(max-width: 760px)`).matches??!1),te=L&&e.mobileSidebarOpen;(0,K.useEffect)(()=>{let e=window.matchMedia?.(`(max-width: 760px)`);if(!e)return;let t=()=>{R(e.matches),e.matches||n.closeMobileSidebar()};return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[n]),(0,K.useEffect)(()=>{let e=()=>k(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let[z,B]=(0,K.useState)(`chat`),[ne,re]=(0,K.useState)(null),[ie,ae]=(0,K.useState)(null),[oe,se]=(0,K.useState)(uY);(0,K.useEffect)(()=>{let e=()=>dY(oe);e(),window.addEventListener(`pagehide`,e);let t=()=>{document.visibilityState===`hidden`&&e()};return document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`pagehide`,e),document.removeEventListener(`visibilitychange`,t),e()}},[oe]);let ce=e.workspaceDraft?void 0:e.snapshot?.selectedSession,le=oe.find(e=>e.sessionId===ce?.id&&e.sessionPath===ce?.path),H=le?.open??!1,ue=le?.reviewTurn,fe=(0,K.useCallback)(e=>{let t=WG.getState().snapshot?.selectedSession;t&&se(n=>n.map(n=>n.sessionId===t.id&&n.sessionPath===t.path?e(n):n))},[]),pe=(0,K.useCallback)(e=>fe(t=>({...t,open:e})),[fe]),he=e=>fe(t=>({...t,reviewTurn:e??void 0})),[ge,_e]=(0,K.useState)(null),[ve,ye]=(0,K.useState)(Mq),be=(0,K.useCallback)((e,t)=>{let n=WG.getState(),r=n.snapshot?.selectedSession;n.workspaceDraft||n.sessionSwitching||!r||!r.id||(s.current||(o.current=document.activeElement instanceof HTMLElement?document.activeElement:null),s.current=!0,u.current=null,pe(!1),ye(n=>({sessionId:r.id,sessionPath:r.path,id:e,kind:t,navigation:(n?.navigation??0)+1})))},[pe]),xe=ve&&!e.workspaceDraft&&!e.sessionSwitching&&ve.sessionId===e.snapshot?.selectedSession?.id&&ve.sessionPath===e.snapshot?.selectedSession?.path;(0,K.useEffect)(()=>{e.snapshot&&!e.sessionSwitching&&ve&&!xe&&ye(null)},[e.snapshot,e.sessionSwitching,ve,xe]),(0,K.useEffect)(()=>Nq(ve),[ve]),(0,K.useEffect)(()=>{if(xe||!s.current)return;s.current=!1;let e=o.current;o.current=null,queueMicrotask(()=>{e?.isConnected&&e.checkVisibility()&&e.focus()})},[xe]);let Se=e.snapshot?.models.find(e=>e.current),Ce=JSON.stringify([Se?.provider,Se?.id]),we=()=>{let t=e.snapshot,n=t?.selectedSession;e.workspaceDraft||!t||!n||e.sessionSwitching||!HD(t,n)||(u.current=null,pe(!1),re({sessionId:n.id,sessionPath:n.path,cwd:n.cwd,model:Se?.label??``,modelKey:Ce}))},Te=ne&&!e.workspaceDraft&&!e.sessionSwitching&&HD(e.snapshot,{id:ne.sessionId,path:ne.sessionPath})&&ne.sessionPath===e.snapshot?.selectedSession?.path&&ne.modelKey===Ce;(0,K.useEffect)(()=>{ne&&!Te&&re(null)},[ne,Te]);let Ee=(0,K.useCallback)(()=>{re(null);let e=c.current;c.current=null,e&&requestAnimationFrame(()=>{e.isConnected&&e.checkVisibility()&&e.focus()})},[]),U=ie&&!e.workspaceDraft&&!e.sessionSwitching&&HD(e.snapshot,{id:ie.sessionId,path:ie.sessionPath})&&ie.sessionPath===e.snapshot?.selectedSession?.path;(0,K.useEffect)(()=>{ie&&!U&&ae(null)},[ie,U]);let De=async(e=`general`)=>{l.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let t=await n.prepareSession();if(!t)return;let r=WG.getState(),i=r.snapshot,a=i?.selectedSession;r.workspaceDraft||!a||r.sessionSwitching||!HD(i,a)||a.id!==t.sessionId||a.path!==t.sessionPath||(n.closeMobileSidebar(),re(null),ye(null),u.current=null,pe(!1),ae({sessionId:a.id,sessionPath:a.path,cwd:a.cwd,entry:e}))},Oe=(0,K.useCallback)(()=>{ae(null);let e=new URL(window.location.href);e.searchParams.delete(`settings`),window.history.replaceState(window.history.state,``,e),requestAnimationFrame(()=>{let e=l.current;l.current=null,e?.isConnected&&e.checkVisibility()?e.focus():document.querySelector(`[data-provider-settings-trigger]`)?.focus()})},[]),ke=()=>{c.current=l.current??document.querySelector(`[data-provider-settings-trigger]`),ae(null),we()},Ae=async e=>{if(await n.sendPrompt(`/openpi-setup ${e}`))return!0;let r=WG.getState();throw Error((typeof r.notice==`string`?r.notice:null)||t(r.promptAdmissionRecovery?`setupResolveAdmission`:r.liveRunning||r.activeTurn?`settingsSetupBusyHint`:`setupRequestFailed`))};(0,K.useEffect)(()=>(n.start(),n.stop),[n]);let G=e.workspaceDraft?void 0:e.snapshot?.selectedSession,Me=lK(G),Ne=G?.id,Pe=G?.path,Fe=!!(G&&!h.current.has(Me)&&m.get(Me)?.position?.key&&m.get(Me)?.position?.pinned===!1);(0,K.useEffect)(()=>{let t=WG.getState(),n=t.workspaceDraft?void 0:t.snapshot?.selectedSession;if(!n||n.id!==Ne||n.path!==Pe||e.sessionSwitching||h.current.has(Me))return;let r=m.get(Me)?.position,i=()=>{h.current.add(Me),g(e=>e+1)};if(!r?.key||r.pinned||m.get(Me)?.window||e.historyNavigation?.sessionId===n.id&&e.historyNavigation.sessionPath===n.path){i();return}let a={sessionId:n.id,sessionPath:n.path,entryId:r.entryId??r.key},o=new AbortController,s,c=e=>{let t=e.target;!(t instanceof Element)||!t.closest(`.conversation, .turn-rail, .jump-to-latest`)||e instanceof KeyboardEvent&&![`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `].includes(e.key)||(o.abort(),i(),v(e=>e?.sessionId===a.sessionId&&e.sessionPath===a.sessionPath?null:e))};for(let e of[`wheel`,`touchstart`,`pointerdown`,`keydown`])document.addEventListener(e,c,!0);let l=e=>{let t=WG.getState();o.signal.aborted||h.current.has(Me)||t.historyNavigation||t.sessionSwitching||t.workspaceDraft||t.selectedPath!==a.sessionPath||t.snapshot?.selectedSession?.id!==a.sessionId||t.snapshot.selectedSession.path!==a.sessionPath||m.get(Me)?.position!==r||e.id!==a.sessionId||e.path!==a.sessionPath||e.history?.anchorEntryId!==a.entryId||e.history.anchorOnBranch!==!0||!e.entries.some(e=>e.id===a.entryId)||(v({...a,session:e,restorePosition:r,revision:-1}),i())};if(e.connection===`connected`)if(n.entries.some(e=>e.id===a.entryId))l({...n,history:{leafEntryId:n.history?.leafEntryId??null,beforeEntryId:n.history?.beforeEntryId??null,anchorEntryId:a.entryId,anchorOnBranch:!0}});else{let e=t=>{new de().sessionMessageWindow(a,o.signal).then(l,()=>{!o.signal.aborted&&t===0&&(s=window.setTimeout(()=>e(1),500))})};e(0)}return()=>{o.abort(),window.clearTimeout(s);for(let e of[`wheel`,`touchstart`,`pointerdown`,`keydown`])document.removeEventListener(e,c,!0)}},[Ne,Pe,e.connection,e.sessionSwitching,e.historyNavigation,Me,m]);let Ie=HD(e.snapshot,G),Le=(0,K.useMemo)(()=>GD((G?.entries??[]).flatMap(e=>e.message?[e.message]:[])),[G?.entries]),Re=Ie?e.snapshot?.runtime.capabilities??G?.capabilities:G?.capabilities,ze=Re?.subagents,Be=(0,K.useMemo)(()=>KD(ze?.items??[],Le,Re?.workflows?.items,e.connection===`connected`),[ze?.items,Le,Re?.workflows?.items,e.connection]),Ve=e.snapshot?.selectedExecution,He=Ve?.sessionId===G?.id&&Ve?.sessionPath===G?.path?Ve:void 0,Ue=Ie&&(e.liveRunning||!!e.activeTurn||e.snapshot?.runtime.status===`running`)||He?.status===`running`,We=hA(G,e.snapshot?.cursor,{active:H&&ge===`review`,running:Ue,initialSource:le?.reading.review?.scope.startsWith(`workspace:`)?le.reading.review.source:`unstaged`,initialBaseRef:le?.reading.review?.baseRef}),Ge=!!(le&&G&&e.selectedPath===G.path&&le.sessionId===G.id&&le.sessionPath===G.path),Ke=H&&Ge&&le?.tool!==`launcher`&&!e.sessionSwitching;(0,K.useEffect)(()=>{G?.id,G?.path,u.current=null},[G?.id,G?.path]),(0,K.useEffect)(()=>{!le||e.sessionSwitching||se(e=>e.at(-1)===le?e:[...e.filter(e=>e!==le),le])},[le,e.sessionSwitching]);let qe=(t=`launcher`)=>{!G||e.sessionSwitching||(b&&d.current?.close({restoreFocus:!1}),Ke||(u.current=document.activeElement instanceof HTMLElement?document.activeElement:null),re(null),ye(null),se(e=>{let n=e.find(e=>e.sessionId===G.id&&e.sessionPath===G.path),r={sessionId:G.id,sessionPath:G.path,tool:t,requestRevision:(n?.requestRevision??0)+1,open:!0,reading:n?.reading??{},reviewTurn:t===`review`?void 0:n?.reviewTurn};return[...e.filter(e=>e!==n),r].slice(-32)}))},Je=()=>{D(!1),pe(!1);let e=u.current;u.current=null,e&&requestAnimationFrame(()=>{let t=e.isConnected?e:i.current;t?.isConnected&&t.checkVisibility()&&t.focus()})},Ye=!e.sessionSwitching&&!e.workspaceDraft&&HD(e.snapshot,G)?G:void 0;nJ(Ye?.id,Ye?.path,async(e,t)=>{qe(`browser`);let n=Date.now()+5e3;for(;!f.current&&!t.aborted&&Date.now()setTimeout(e,40));return t.aborted?void 0:f.current?.(e)});let Xe=(0,K.useRef)(ZW(new URLSearchParams(location.search).get(`settings`))),Ze=(0,K.useEffectEvent)(e=>{De(e)});(0,K.useEffect)(()=>{if(!Xe.current||!e.snapshot||e.sessionSwitching)return;let t=Xe.current;Xe.current=void 0,Ze(t)},[e.snapshot,e.sessionSwitching]);let Qe=!!(xe||Ke||b);(0,K.useEffect)(()=>{(!Qe||O<=xY)&&D(!1)},[Qe,O]);let $e=Math.max(pY,Math.min(mY,O-bY-(Qe&&!E?A.auxiliary:0))),et=SY(A.sidebar,pY,$e),tt=Math.max(_Y,Math.min(vY,O-(e.sidebarCollapsed?56:et)-bY)),nt=SY(A.auxiliary,_Y,tt),rt={"--sidebar-width":`${et}px`,"--auxiliary-width":`${nt}px`},it=()=>{b?d.current?.close():Ke?Je():xe&&ye(null)},at=!e.snapshot,ot=e.sessionSwitching?e.snapshot?.sessions.find(t=>t.path===e.selectedPath)?.cwd:e.workspaceDraft?e.selectedWorkspace:G?.cwd??e.selectedWorkspace,st=e.snapshot?.workspaces.find(e=>e.path===ot),ct=e.snapshot?.sessions.find(e=>e.path===G?.path&&e.id===G?.id),lt=e.sessionSwitching?e.snapshot?.sessions.find(t=>t.path===e.selectedPath):void 0,ut=e.sessionSwitching&&!e.workspaceDraft?lt?ID(lt,t(`untitledSession`)):t(`switchingSession`):G?ID(ct??{},t(`untitledSession`)):e.selectedWorkspace?t(`newSession`):`OpenPI`,dt=!!G?.rerun||G?.entries.some(e=>e.type===`message`&&e.message||e.type===`compaction`)||!!G?.history?.beforeEntryId||e.liveMessages.length>0,ft=!at&&(!e.sessionSwitching||e.workspaceDraft)&&(!G||!dt&&!(e.snapshot?.selectedExecution?.sessionId===G.id&&e.snapshot.selectedExecution?.sessionPath===G.path&&e.snapshot.selectedExecution.compaction)),pt=(0,K.useCallback)((e,t)=>t?n.sendPrompt(``,[],void 0,{streamingBehavior:`followUp`,retryEntryId:t}):n.sendPrompt(e),[n]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{inert:U?!0:void 0,"aria-hidden":U?!0:void 0,className:`app-shell ${e.sidebarCollapsed?`sidebar-collapsed`:``} ${e.mobileSidebarOpen?`sidebar-open`:``} ${xe?`with-subagent-panel`:``} ${Ke?`with-workbar-panel`:``} ${b?`with-artifact-panel`:``} ${E?`center-collapsed`:``} ${w?`is-resizing`:``} ${at?`shell-loading`:``}`,style:rt,children:(0,q.jsxs)(FD,{ref:d,sessionId:G?.id,sessionPath:G?.path,disabled:!!(e.workspaceDraft||e.sessionSwitching||xe||U),onOpen:()=>{x(!0),ye(null),pe(!1),re(null)},onClose:()=>{x(!1)},children:[(0,q.jsx)(NA,{sessionViewVisible:z===`chat`&&!E&&!U&&!e.sessionSwitching&&!e.workspaceDraft,connected:e.connection===`connected`,snapshot:e.snapshot,selectedPath:e.workspaceDraft?null:e.selectedPath,selectedWorkspace:e.selectedWorkspace,collapsed:e.collapsed,query:e.query,searchOpen:e.searchOpen,mobileOpen:te,settingsDisabled:!!(e.sessionSwitching||e.modelSelectionPending||!e.snapshot),returnFocusRef:r,onOpenSettings:()=>void De(`general`),actions:n}),e.sidebarCollapsed&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{ref:a,className:`sidebar-expand`,type:`button`,"aria-label":t(`expandSidebar`),onClick:()=>n.toggleSidebar(!1),children:(0,q.jsx)(gc,{})}),(0,q.jsx)(V,{anchorRef:a,content:t(`expandSidebar`),placement:`end`})]}),(0,q.jsxs)(`main`,{inert:te,className:`conversation-shell ${G?`has-view`:``} ${ft&&(!G||z===`chat`)?`landing`:``}`,children:[(0,q.jsxs)(`header`,{className:`task-header`,children:[(0,q.jsx)(V,{content:t(L?`openSidebar`:e.sidebarCollapsed?`expandSidebar`:`collapseSidebar`),placement:`below`,children:(0,q.jsx)(`button`,{className:`task-header-menu sidebar-shell-toggle`,ref:r,type:`button`,"aria-label":t(L?`openSidebar`:e.sidebarCollapsed?`expandSidebar`:`collapseSidebar`),"aria-controls":`session-sidebar`,"aria-expanded":L?te:!e.sidebarCollapsed,onClick:()=>n.toggleSidebar(L),children:L?(0,q.jsx)(sc,{}):(0,q.jsx)(hc,{})})}),(0,q.jsxs)(`div`,{className:`task-identity`,children:[ot&&(0,q.jsxs)(`span`,{className:`task-workspace`,title:ot,children:[st?.name||LD(ot),(0,q.jsxs)(`span`,{className:`sr-only`,children:[` `,ot]})]}),(0,q.jsx)(`h1`,{title:ut,children:ut})]}),(0,q.jsx)(rJ,{usage:G&&!e.sessionSwitching?e.snapshot?.usage:void 0,workspace:st?.name||G&&LD(G.cwd),sessionId:G?.id,model:Ie?Se:void 0},G?`usage:${G.id}:${G.path}`:`usage:no-session`),G&&!e.sessionSwitching&&(0,q.jsx)(oG,{sessionId:G.id,workspace:st?.name||LD(G.cwd),agents:Be,omitted:(ze?.omitted??0)+(Re?.workflows?.items??[]).reduce((e,t)=>e+(t.children?.omitted??0),0),omittedWorkflows:Re?.workflows?.omitted??0,review:We.result,reviewLoading:We.loading,reviewError:We.error,sessionPath:G.path,revision:G.history?.leafEntryId??void 0,onAddSources:Ie?()=>C(e=>({sessionId:G.id,path:G.path,revision:(e?.revision??0)+1})):void 0,onSubagents:()=>be(),onReview:()=>qe(`review`),onSources:()=>qe(`sources`)},`overview:${G.id}:${G.path}`),Ge&&!Ke&&le?.tool!==`launcher`?(0,q.jsx)(V,{content:t(G?`openTools`:`openToolsUnavailable`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,ref:i,className:`task-tools-trigger`,"aria-label":t(`openTools`),disabled:!G||e.sessionSwitching,onClick:e=>{b&&d.current?.close({restoreFocus:!1}),u.current=e.currentTarget,pe(!0)},children:(0,q.jsx)(vc,{"aria-hidden":`true`})})}):(0,q.jsx)(yo,{button:{ref:i,className:`task-tools-trigger`,label:t(`openTools`),"aria-label":t(`openTools`),icon:(0,q.jsx)(vc,{"aria-hidden":`true`}),isIconOnly:!0,isDisabled:!G||e.sessionSwitching,variant:`ghost`,tooltip:t(G?`openTools`:`openToolsUnavailable`)},items:YJ.map(e=>({id:e.kind,icon:(0,q.jsx)(e.icon,{"aria-hidden":`true`}),label:t(e.title),description:t(e.description),onClick:()=>{qe(e.kind),u.current=i.current}})),menuWidth:`min(300px, calc(100vw - 24px))`,alignment:`end`,hasChevron:!1}),(0,q.jsx)(`span`,{className:`connection-state ${e.connection}`,role:`status`,title:t(e.connection),"aria-label":t(e.connection),children:(0,q.jsx)(`span`,{children:t(e.connection)})})]}),G&&!e.sessionSwitching&&(0,q.jsx)(`div`,{className:`conversation-view-row`,children:(0,q.jsxs)(`fieldset`,{className:`conversation-view-switch`,"data-view":z,"aria-label":t(`conversationView`),children:[(0,q.jsx)(`button`,{type:`button`,"aria-pressed":z===`chat`,onClick:()=>B(`chat`),children:t(`chatView`)}),(0,q.jsx)(`button`,{type:`button`,"aria-pressed":z===`trajectory`,onClick:()=>B(`trajectory`),children:t(`trajectory`)})]})}),at?(0,q.jsxs)(`section`,{className:`shell-state`,role:`status`,"aria-live":`polite`,children:[(0,q.jsx)(iu,{compact:!0}),(0,q.jsx)(`p`,{children:t(e.connection===`unavailable`?`unavailable`:`connecting`)}),e.connection===`unavailable`&&(0,q.jsxs)(`button`,{type:`button`,onClick:()=>void n.refreshSnapshot({resetCursor:!0}),children:[(0,q.jsx)(me,{"aria-hidden":`true`}),` `,t(`retryAdmissionCheck`)]})]}):e.sessionSwitching&&!ft?(0,q.jsx)(`div`,{className:`conversation switching`,role:`status`,children:(0,q.jsxs)(`div`,{className:`conversation-running`,children:[(0,q.jsx)(`span`,{className:`conversation-running-dot`}),(0,q.jsx)(`span`,{children:t(`switchingSession`)})]})}):z===`trajectory`&&G&&e.snapshot?(0,q.jsx)(Qq,{snapshot:e.snapshot,running:Ue},G.path):ft?(0,q.jsx)(`section`,{className:`conversation landing-conversation`,"aria-label":`Conversation`,children:(0,q.jsxs)(`div`,{className:`landing-welcome`,children:[(0,q.jsx)(`h1`,{className:`sr-only`,children:ut}),(0,q.jsx)(iu,{animated:!0}),e.sessionSwitching&&(0,q.jsx)(`span`,{className:`sr-only`,role:`status`,children:t(`switchingSession`)})]})}):e.snapshot?(0,q.jsx)(Dq,{resultExposureEnabled:!E&&!U&&!e.sessionSwitching&&!e.workspaceDraft&&z===`chat`,readingCache:m,readingRestorePending:Fe,snapshot:e.snapshot,liveMessages:e.liveMessages,liveRunning:e.liveRunning,liveActiveTurn:e.activeTurn,livePhase:e.livePhase,activityObserved:e.connection===`connected`,liveRetry:e.liveRetry,thinkingStarts:e.thinkingStarts,thinkingDurations:e.thinkingDurations,scrollToBottom:e.scrollToBottom,onResend:pt,onEdit:n.editMessage,onRegenerate:n.regenerateMessage,onOpenOriginal:n.navigateToMessage,onFork:n.forkMessage,forkPending:e.sessionForkPending,forkAvailable:Ie&&!Ue&&e.snapshot.runtime.status===`idle`&&!e.promptAdmissionPending&&!e.promptAdmissionRecovery&&!e.activeTurn&&!e.modelSelectionPending&&!e.sessionSwitching&&!G?.path.startsWith(`current:`)&&!(He?.pendingFollowUps||He?.pendingSteering||He?.compaction?.state===`running`),onInspectSubagent:be,onReviewTurn:(e,t)=>{qe(`review`),u.current=document.activeElement instanceof HTMLElement?document.activeElement:null,he({promptEntryId:e,filePath:t,revision:(ue?.revision??0)+1})},onHistoryAnchorChange:n.setHistoryAnchor,historyNavigation:e.historyNavigation??(_?.sessionId===G?.id&&_?.sessionPath===G?.path?_:null),onNavigateToMessage:n.navigateToMessage,onRefreshHistory:n.refreshSnapshot,onPromptProjection:n.rememberPromptProjection},`transcript:${JSON.stringify([G?.id,G?.path])}`):null,!U&&G&&e.snapshot&&!e.sessionSwitching&&HD(e.snapshot,G)&&(0,q.jsx)(mA,{sessionId:G.id,sessionPath:G.path,workingCache:y,revision:e.snapshot.cursor,connected:e.connection===`connected`},JSON.stringify([G.id,G.path])),e.snapshot&&(0,q.jsxs)(`div`,{className:`workbar-chat-context`,hidden:!Ke,children:[(0,q.jsx)(`span`,{className:`workbar-chat-title`,title:ut,children:ut}),(0,q.jsx)(`span`,{className:`workbar-chat-status`,role:`status`,children:t(Ue?`turnState_running`:e.connection)}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{Je(),requestAnimationFrame(()=>document.querySelector(`.composer textarea`)?.focus({preventScroll:!0}))},children:t(`workbarContinueInChat`)})]}),e.snapshot&&(0,q.jsx)(oA,{addSourcesRequest:S,planSelectionPending:e.planSelectionPending,workspaceDraft:e.workspaceDraft,draftModel:e.draftModel,createdSession:e.createdSession,modelSelectionPending:e.modelSelectionPending,modelSearch:e.modelSearch,thinkingPendingLevel:e.thinkingPendingLevel,onInspect:we,onOpenProviders:()=>void De(`credentials`),onCommandAction:e=>{let t=WG.getState();return t.sessionSwitching||t.workspaceDraft||!G||t.snapshot?.selectedSession?.path!==G.path||t.snapshot.selectedSession.id!==G.id?!1:(e===`terminal`||e===`review`||e===`side-conversation`?qe(e):e===`subagents`?be():we(),!0)},onInspectSubagent:be,activeTurn:e.activeTurn,activityObserved:e.connection===`connected`,turnCancellationPending:e.turnCancellationPending,turnTerminalStatus:e.turnTerminalStatus,pendingFollowUpsReceipt:e.pendingFollowUpsReceipt,pendingSteeringReceipt:e.pendingSteeringReceipt,commandDiscovery:e.commandDiscovery,snapshot:e.snapshot,selectedPath:e.selectedPath,selectedWorkspace:G?.cwd??e.selectedWorkspace,sessionSwitching:e.sessionSwitching||e.sessionForkPending,promptAdmissionPending:e.promptAdmissionPending,promptAdmissionRecovery:e.promptAdmissionRecovery,promptAdmissionResolution:e.promptAdmissionResolution,restoredPromptDraft:e.restoredPromptDraft,liveRunning:e.liveRunning,landing:ft,actions:n}),e.sessionForkPending&&(0,q.jsxs)(`div`,{className:`session-fork-progress`,role:`status`,children:[(0,q.jsx)(`span`,{className:`session-fork-progress-spinner`,"aria-hidden":`true`}),t(e.sessionForkCancellation===`too-late`?`sidebarForkFinishing`:e.sessionForkCancellation?`sidebarForkCancelling`:e.sessionForkEnvironment===`worktree`?`sidebarForkWorktreePending`:`forkSessionPending`),e.sessionForkEnvironment&&(0,q.jsx)(`button`,{type:`button`,disabled:e.sessionForkCancellation!==null,onClick:()=>void n.cancelSessionFork(),children:t(`cancel`)})]}),(0,q.jsx)(_A,{notices:e.archiveNotices,actions:n}),e.notice&&(0,q.jsxs)(`div`,{className:typeof e.notice==`string`?`notice`:`notice notice-success`,role:typeof e.notice==`string`?`alert`:`status`,children:[(0,q.jsx)(`span`,{children:typeof e.notice==`string`?e.notice:e.notice.message}),(0,q.jsx)(V,{content:t(`close`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":t(`close`),onClick:n.clearNotice,children:(0,q.jsx)(je,{})})})]})]}),Te&&(0,q.jsx)(sA,{target:ne,onClose:Ee,onOpenProviders:()=>void De(`credentials`)},`${ne.sessionId}:${ne.sessionPath}`),xe&&(0,q.jsx)(Aq,{sessionId:ve.sessionId,sessionPath:ve.sessionPath,initialId:ve.id,initialKind:ve.kind,observed:e.connection===`connected`,activity:ze,records:Le,workflows:Re?.workflows,liveAvailable:G?.id===ve.sessionId&&G.path===ve.sessionPath,onClose:()=>ye(null)},`${ve.sessionId}:${ve.navigation}`),Ke&&G&&le&&(0,q.jsx)($J,{visible:Ke,requestedTool:le.tool,requestRevision:le.requestRevision,sessionId:G.id,sessionPath:G.path,onBrowserReady:p,canControl:!e.sessionSwitching&&HD(e.snapshot,G),onActivateSession:()=>void n.selectSession(G.path),cwd:G.cwd,snapshot:e.snapshot??void 0,capabilities:HD(e.snapshot,G)?e.snapshot?.runtime.capabilities??{}:{},readingState:le.reading,onActiveToolChange:_e,review:We,reviewTurn:ue??void 0,onWorkspaceReview:()=>he(null),onReferenceLine:e=>{let t=WG.getState(),n=t.snapshot?.selectedSession;t.workspaceDraft||t.sessionSwitching||t.selectedPath!==G.path||n?.id!==G.id||n.path!==G.path||!HD(t.snapshot,n)||(B(`chat`),C(t=>({sessionId:G.id,path:G.path,revision:(t?.revision??0)+1,feedback:e})))},conversationCollapsed:E,onRestoreConversation:()=>D(!1),onExpandReview:()=>D(!0),onClose:Je},`${G.id}:${G.path}`),(0,q.jsxs)(`section`,{"aria-label":t(`resizePanes`),style:{display:`contents`},children:[!e.sidebarCollapsed&&!L&&(!Qe||O>xY)&&(0,q.jsx)(ou,{side:`left`,value:et,min:pY,max:$e,defaultValue:fY,collapseThreshold:hY,onCollapse:()=>n.toggleSidebar(!1),onChange:e=>ee(`sidebar`,e),onDraggingChange:T}),Qe&&!E&&O>xY&&(0,q.jsx)(ou,{side:`right`,value:nt,min:_Y,max:tt,defaultValue:gY,collapseThreshold:yY,onCollapse:it,onExpandPastMax:Ke?()=>D(!0):void 0,onChange:e=>ee(`auxiliary`,e),onDraggingChange:T})]}),(0,q.jsx)(`button`,{className:`sidebar-scrim`,type:`button`,tabIndex:-1,"aria-hidden":`true`,"aria-label":t(`close`),onClick:n.closeMobileSidebar})]})}),U&&(0,q.jsx)(QW,{sessionId:ie.sessionId,cwd:ie.cwd,entry:ie.entry,models:e.snapshot?.models??[],currentModel:Se,thinkingLevel:e.thinkingPendingLevel??e.snapshot?.thinking?.level??t(`unknownState`),theme:e.snapshot?.preferences.theme??`system`,preferences:e.snapshot?.preferences,workspaces:e.snapshot?.workspaces??[],onRestoreSession:e=>n.unarchiveSession(e),plan:e.snapshot?.runtime.plan,planSelectionPending:e.planSelectionPending,onExitPlan:()=>n.selectPlanMode(!1),setupOutcome:e.snapshot?.runtime.setup,capabilities:e.snapshot?.runtime.capabilities,setupBusy:e.liveRunning||e.promptAdmissionPending||!!e.activeTurn||e.modelSelectionPending||e.thinkingPendingLevel!==null||e.sessionSwitching,setupBlockedReason:e.promptAdmissionRecovery?t(`setupResolveAdmission`):void 0,modelSelectionPending:e.modelSelectionPending,sessionPath:ie.sessionPath,onSelectModel:e=>n.selectModel(e),onConfigureOpenPi:Ae,interaction:e.snapshot&&!e.sessionSwitching&&ie.sessionId===e.snapshot.currentSessionId?(0,q.jsxs)(`div`,{className:`settings-interaction`,children:[(0,q.jsx)(mA,{sessionId:ie.sessionId,sessionPath:ie.sessionPath,workingCache:y,revision:e.snapshot.cursor,connected:e.connection===`connected`},JSON.stringify([ie.sessionId,ie.sessionPath])),(e.activeTurn||e.liveRunning)&&(0,q.jsx)(`button`,{type:`button`,disabled:e.turnCancellationPending,onClick:()=>void n.cancelActiveTurn(),children:t(`stopTurn`)})]}):void 0,onPreferencesChanged:()=>n.refreshSnapshot(),onOpenRuntimeStatus:ke,onClose:Oe},`${ie.sessionId}:${ie.sessionPath}`)]})}var wY={size:`1em`,"aria-hidden":!0},TY={name:`neutral`,__built:!0,tokens:{"--font-size-4xs":`0.375rem`,"--font-size-3xs":`0.4375rem`,"--font-size-2xs":`0.5rem`,"--font-size-xs":`0.625rem`,"--font-size-sm":`0.75rem`,"--font-size-base":`0.875rem`,"--font-size-lg":`1.0625rem`,"--font-size-xl":`1.25rem`,"--font-size-2xl":`1.5rem`,"--font-size-3xl":`1.8125rem`,"--font-size-4xl":`2.1875rem`,"--font-size-5xl":`2.625rem`,"--text-heading-1-size":`var(--font-size-2xl)`,"--text-heading-1-weight":`var(--font-weight-semibold)`,"--text-heading-1-leading":`1.3333`,"--text-heading-2-size":`var(--font-size-xl)`,"--text-heading-2-weight":`var(--font-weight-semibold)`,"--text-heading-2-leading":`1.4`,"--text-heading-3-size":`var(--font-size-lg)`,"--text-heading-3-weight":`var(--font-weight-bold)`,"--text-heading-3-leading":`1.4118`,"--text-heading-4-size":`var(--font-size-base)`,"--text-heading-4-weight":`var(--font-weight-bold)`,"--text-heading-4-leading":`1.4286`,"--text-heading-5-size":`var(--font-size-sm)`,"--text-heading-5-weight":`var(--font-weight-semibold)`,"--text-heading-5-leading":`1.6667`,"--text-heading-6-size":`var(--font-size-xs)`,"--text-heading-6-weight":`var(--font-weight-semibold)`,"--text-heading-6-leading":`1.6`,"--text-body-size":`var(--font-size-base)`,"--text-body-weight":`var(--font-weight-normal)`,"--text-body-leading":`1.4286`,"--text-large-size":`var(--font-size-lg)`,"--text-large-weight":`var(--font-weight-semibold)`,"--text-large-leading":`1.4118`,"--text-label-size":`var(--font-size-base)`,"--text-label-weight":`var(--font-weight-medium)`,"--text-label-leading":`1.4286`,"--text-code-size":`var(--font-size-base)`,"--text-code-weight":`var(--font-weight-normal)`,"--text-code-leading":`1.4286`,"--text-supporting-size":`var(--font-size-sm)`,"--text-supporting-weight":`var(--font-weight-normal)`,"--text-supporting-leading":`1.6667`,"--text-display-1-size":`var(--font-size-5xl)`,"--text-display-1-weight":`var(--font-weight-normal)`,"--text-display-1-leading":`1.2381`,"--text-display-2-size":`var(--font-size-4xl)`,"--text-display-2-weight":`var(--font-weight-normal)`,"--text-display-2-leading":`1.2571`,"--text-display-3-size":`var(--font-size-3xl)`,"--text-display-3-weight":`var(--font-weight-normal)`,"--text-display-3-leading":`1.3793`,"--duration-fast-min":`95ms`,"--duration-fast":`125ms`,"--duration-fast-max":`165ms`,"--duration-medium-min":`225ms`,"--duration-medium":`300ms`,"--duration-medium-max":`400ms`,"--duration-slow-min":`525ms`,"--duration-slow":`700ms`,"--duration-slow-max":`935ms`,"--font-family-body":`Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,"--font-family-heading":`Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,"--font-family-code":`ui-monospace, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace`,"--color-syntax-keyword":`light-dark(#700084, #efa8ff)`,"--color-syntax-string":`light-dark(#005600, #a6d2a2)`,"--color-syntax-comment":`light-dark(#737373, #a3a3a3)`,"--color-syntax-number":`light-dark(#6e3500, #ffb37f)`,"--color-syntax-function":`light-dark(#00458c, #a0caff)`,"--color-syntax-type":`light-dark(#700084, #efa8ff)`,"--color-syntax-variable":`light-dark(#171717, #e5e5e5)`,"--color-syntax-operator":`light-dark(#737373, #a3a3a3)`,"--color-syntax-constant":`light-dark(#6e3500, #ffb37f)`,"--color-syntax-tag":`light-dark(#89001a, #ffaeaa)`,"--color-syntax-attribute":`light-dark(#584400, #eec12f)`,"--color-syntax-property":`light-dark(#005348, #83dac9)`,"--color-syntax-punctuation":`light-dark(#6e6e6e, #a0a0a0)`,"--color-syntax-background":`light-dark(#fafafa, #0a0a0a)`,"--color-background-surface":`light-dark(#ffffff, #262626)`,"--color-background-body":`light-dark(#f1f1f1, #1b1b1b)`,"--color-background-card":`light-dark(#ffffff, #1b1b1b)`,"--color-background-popover":`light-dark(#ffffff, #1b1b1b)`,"--color-background-muted":`light-dark(#f1f1f1, #1b1b1b)`,"--color-accent":`light-dark(#262626, #ebebeb)`,"--color-accent-muted":`light-dark(#f1f1f1, #262626)`,"--color-neutral":`light-dark(#0000000F, #FFFFFF1A)`,"--color-overlay":`light-dark(#00000080, #000000CC)`,"--color-overlay-hover":`light-dark(#0000000D, #FFFFFF0D)`,"--color-overlay-pressed":`light-dark(#0000001A, #FFFFFF1A)`,"--color-text-primary":`light-dark(#171717, #fafafa)`,"--color-text-secondary":`light-dark(#525252, #a3a3a3)`,"--color-text-disabled":`light-dark(#a3a3a3, #525252)`,"--color-text-accent":`light-dark(#262626, #ebebeb)`,"--color-on-dark":`#ffffff`,"--color-on-light":`#171717`,"--color-on-accent":`light-dark(#ffffff, #171717)`,"--color-on-success":`light-dark(#ffffff, #171717)`,"--color-on-error":`light-dark(#ffffff, #171717)`,"--color-on-warning":`#171717`,"--color-icon-accent":`light-dark(#262626, #ebebeb)`,"--color-icon-primary":`light-dark(#171717, #fafafa)`,"--color-icon-secondary":`light-dark(#737373, #a3a3a3)`,"--color-icon-disabled":`light-dark(#a3a3a3, #525252)`,"--color-success":`light-dark(#007004, #9fe59b)`,"--color-error":`light-dark(#a50c25, #ffc6c1)`,"--color-warning":`light-dark(#745b00, #fdcf4f)`,"--color-success-muted":`light-dark(#c5e5c0, #84c9803D)`,"--color-error-muted":`light-dark(#facecb, #ff9e973D)`,"--color-warning-muted":`light-dark(#f8da9d, #deb4333D)`,"--color-border":`light-dark(#00000014, #FFFFFF1A)`,"--color-border-emphasized":`light-dark(#d4d4d4, #525252)`,"--color-skeleton":`light-dark(#ebebeb, #525252)`,"--color-shadow":`light-dark(#0000001A, #0000004D)`,"--color-tint-hover":`light-dark(black, white)`,"--color-background-red":`light-dark(#facecb, #ff9e973D)`,"--color-border-red":`light-dark(#e6bab8, #ff6f6c)`,"--color-icon-red":`light-dark(#89001a, #ff9e97)`,"--color-text-red":`light-dark(#89001a, #ffc6c1)`,"--color-background-orange":`light-dark(#fad0b5, #ffa2583D)`,"--color-border-orange":`light-dark(#e6bda2, #e2883e)`,"--color-icon-orange":`light-dark(#6e3500, #ffa258)`,"--color-text-orange":`light-dark(#6e3500, #ffc9a2)`,"--color-background-yellow":`light-dark(#f8da9d, #deb4333D)`,"--color-border-yellow":`light-dark(#e4c279, #c0990e)`,"--color-icon-yellow":`light-dark(#584400, #deb433)`,"--color-text-yellow":`light-dark(#584400, #fdcf4f)`,"--color-background-green":`light-dark(#c5e5c0, #84c9803D)`,"--color-border-green":`light-dark(#b2d1ac, #69ad67)`,"--color-icon-green":`light-dark(#0c5700, #84c980)`,"--color-text-green":`light-dark(#0c5700, #9fe59b)`,"--color-background-teal":`light-dark(#a5e3d6, #7ec6b83D)`,"--color-border-teal":`light-dark(#94d6c8, #63ab9d)`,"--color-icon-teal":`light-dark(#005348, #7ec6b8)`,"--color-text-teal":`light-dark(#005348, #99e2d3)`,"--color-background-cyan":`light-dark(#a3e0ef, #83c2d43D)`,"--color-border-cyan":`light-dark(#91d3e3, #67a7b8)`,"--color-icon-cyan":`light-dark(#00505f, #83c2d4)`,"--color-text-cyan":`light-dark(#00505f, #9edef0)`,"--color-background-blue":`light-dark(#c4ddfb, #9eb7ff3D)`,"--color-border-blue":`light-dark(#b1c9e7, #6d9cfe)`,"--color-icon-blue":`light-dark(#00458c, #9eb7ff)`,"--color-text-blue":`light-dark(#00458c, #c7d3ff)`,"--color-background-purple":`light-dark(#eccef3, #f297ff3D)`,"--color-border-purple":`light-dark(#d8bbdf, #dd74f0)`,"--color-icon-purple":`light-dark(#700084, #f297ff)`,"--color-text-purple":`light-dark(#700084, #fac1ff)`,"--color-background-pink":`light-dark(#fccadc, #ff99c33D)`,"--color-border-pink":`light-dark(#e7b7c8, #f273aa)`,"--color-icon-pink":`light-dark(#83004b, #ff99c3)`,"--color-text-pink":`light-dark(#83004b, #ffc3da)`,"--color-background-gray":`light-dark(#e5e5e5, var(--color-neutral))`,"--color-border-gray":`light-dark(#d4d4d4, #262626)`,"--color-icon-gray":`light-dark(#525252, #a3a3a3)`,"--color-text-gray":`light-dark(#262626, #e5e5e5)`,"--radius-none":`0px`,"--radius-inner":`0.375rem`,"--radius-element":`0.625rem`,"--radius-container":`0.75rem`,"--radius-page":`1.75rem`,"--radius-full":`9999px`,"--shadow-low":`0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 25%)), 0 4px 8px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 40%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 8%))`,"--shadow-med":`0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 35%)), 0 4px 12px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 12%))`,"--shadow-high":`0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), 0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 70%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 15%))`,"--shadow-inset-hover":`inset 0px 0px 0px 2px #0074e24D`,"--shadow-inset-selected":`inset 0px 0px 0px 2px #0074e280`,"--shadow-inset-success":`inset 0px 0px 0px 2px #1981004D`,"--shadow-inset-warning":`inset 0px 0px 0px 2px #ffce2f4D`,"--shadow-inset-error":`inset 0px 0px 0px 2px #e33f4a4D`},components:{heading:{"level:1":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-1-size)`,fontWeight:`var(--text-heading-1-weight)`,lineHeight:`var(--text-heading-1-leading)`},"level:2":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-2-size)`,fontWeight:`var(--text-heading-2-weight)`,lineHeight:`var(--text-heading-2-leading)`},"level:3":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-3-size)`,fontWeight:`var(--text-heading-3-weight)`,lineHeight:`var(--text-heading-3-leading)`},"level:4":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-4-size)`,fontWeight:`var(--text-heading-4-weight)`,lineHeight:`var(--text-heading-4-leading)`},"level:5":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-5-size)`,fontWeight:`var(--text-heading-5-weight)`,lineHeight:`var(--text-heading-5-leading)`},"level:6":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-6-size)`,fontWeight:`var(--text-heading-6-weight)`,lineHeight:`var(--text-heading-6-leading)`},"type:display-1":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-display-1-size)`,lineHeight:`var(--text-display-1-leading)`},"type:display-2":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-display-2-size)`,lineHeight:`var(--text-display-2-leading)`},"type:display-3":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-display-3-size)`,lineHeight:`var(--text-display-3-leading)`}},text:{"type:body":{fontFamily:`var(--font-family-body)`,fontSize:`var(--text-body-size)`,lineHeight:`var(--text-body-leading)`},"type:large":{fontFamily:`var(--font-family-body)`,fontSize:`var(--text-large-size)`,lineHeight:`var(--text-large-leading)`},"type:label":{fontFamily:`var(--font-family-body)`,fontSize:`var(--text-label-size)`,lineHeight:`var(--text-label-leading)`},"type:code":{fontFamily:`var(--font-family-code)`,fontSize:`var(--text-code-size)`,lineHeight:`var(--text-code-leading)`},"type:supporting":{fontFamily:`var(--font-family-body)`,fontSize:`var(--text-supporting-size)`,lineHeight:`var(--text-supporting-leading)`},"type:display-1":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-display-1-size)`,lineHeight:`var(--text-display-1-leading)`},"type:display-2":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-display-2-size)`,lineHeight:`var(--text-display-2-leading)`},"type:display-3":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-display-3-size)`,lineHeight:`var(--text-display-3-leading)`}},button:{"variant:destructive":{backgroundColor:`var(--color-error-muted)`,color:`var(--color-error)`}},badge:{"variant:info":{backgroundColor:`light-dark(#0074e2, #6d9cfe)`,color:`light-dark(#ffffff, #171717)`},"variant:neutral":{backgroundColor:`var(--color-background-gray)`,color:`var(--color-text-gray)`},"variant:success":{backgroundColor:`light-dark(#198100, #64af4c)`,color:`light-dark(#ffffff, #171717)`},"variant:warning":{backgroundColor:`#ffce2f`,color:`#171717`},"variant:error":{backgroundColor:`light-dark(#c9303a, #ff705d)`,color:`light-dark(#ffffff, #171717)`},"variant:red":{backgroundColor:`var(--color-background-red)`,color:`var(--color-text-red)`},"variant:orange":{backgroundColor:`var(--color-background-orange)`,color:`var(--color-text-orange)`},"variant:yellow":{backgroundColor:`var(--color-background-yellow)`,color:`var(--color-text-yellow)`},"variant:green":{backgroundColor:`var(--color-background-green)`,color:`var(--color-text-green)`},"variant:teal":{backgroundColor:`var(--color-background-teal)`,color:`var(--color-text-teal)`},"variant:cyan":{backgroundColor:`var(--color-background-cyan)`,color:`var(--color-text-cyan)`},"variant:blue":{backgroundColor:`var(--color-background-blue)`,color:`var(--color-text-blue)`},"variant:purple":{backgroundColor:`var(--color-background-purple)`,color:`var(--color-text-purple)`},"variant:pink":{backgroundColor:`var(--color-background-pink)`,color:`var(--color-text-pink)`},"variant:gray":{backgroundColor:`var(--color-background-gray)`,color:`var(--color-text-gray)`}},statusdot:{"variant:success":{backgroundColor:`light-dark(#198100, #64af4c)`},"variant:warning":{backgroundColor:`#ffce2f`},"variant:error":{backgroundColor:`light-dark(#c9303a, #ff705d)`},"variant:accent":{backgroundColor:`light-dark(#0074e2, #6d9cfe)`}},banner:{"status:info":{"--color-accent-muted":`var(--color-background-blue)`,"--color-text-primary":`var(--color-text-blue)`,"--color-text-secondary":`var(--color-text-blue)`,"--color-accent":`var(--color-text-blue)`},"status:success":{"--color-text-primary":`var(--color-text-green)`,"--color-text-secondary":`var(--color-text-green)`,"--color-success":`var(--color-text-green)`},"status:warning":{"--color-text-primary":`var(--color-text-yellow)`,"--color-text-secondary":`var(--color-text-yellow)`,"--color-warning":`var(--color-text-yellow)`},"status:error":{"--color-text-primary":`var(--color-text-red)`,"--color-text-secondary":`var(--color-text-red)`,"--color-error":`var(--color-text-red)`}},switch:{base:{"--color-background-gray":`var(--color-border-emphasized)`}},progressbar:{base:{"--color-background-muted":`var(--color-border-emphasized)`},"variant:accent":{"--color-accent":`#0074e2`},"variant:success":{"--color-success":`#198100`},"variant:warning":{"--color-warning":`#ffce2f`},"variant:error":{"--color-error":`#c9303a`}},card:{base:{padding:`var(--spacing-3)`}},section:{base:{padding:`var(--spacing-3)`}}},__onDark:{tokens:{"color-scheme":`dark`,"--color-text-primary":`var(--color-on-dark)`,"--color-icon-primary":`var(--color-on-dark)`,"--color-accent":`var(--color-on-dark)`}},__onLight:{tokens:{"color-scheme":`light`,"--color-text-primary":`var(--color-on-light)`,"--color-icon-primary":`var(--color-on-light)`,"--color-accent":`var(--color-on-light)`}},icons:{close:(0,q.jsx)(je,{...wY}),chevronDown:(0,q.jsx)(is,{...wY}),chevronLeft:(0,q.jsx)(as,{...wY}),chevronRight:(0,q.jsx)(os,{...wY}),chevronsLeft:(0,q.jsx)(ss,{...wY}),chevronsRight:(0,q.jsx)(cs,{...wY}),check:(0,q.jsx)(rs,{...wY}),success:(0,q.jsx)(us,{...wY}),error:(0,q.jsx)(ms,{...wY}),warning:(0,q.jsx)(Wc,{...wY}),info:(0,q.jsx)(Js,{...wY}),calendar:(0,q.jsx)(ts,{...wY}),clock:(0,q.jsx)(ys,{...wY}),externalLink:(0,q.jsx)(Os,{...wY}),menu:(0,q.jsx)(sc,{...wY}),moreHorizontal:(0,q.jsx)(Ds,{...wY}),search:(0,q.jsx)(Dc,{...wY}),arrowUp:(0,q.jsx)(Xo,{...wY}),arrowDown:(0,q.jsx)(ue,{...wY}),arrowsUpDown:(0,q.jsx)(Jo,{...wY}),funnel:(0,q.jsx)(Hs,{...wY}),eyeSlash:(0,q.jsx)(ks,{...wY}),viewColumns:(0,q.jsx)(xs,{...wY}),copy:(0,q.jsx)(Ss,{...wY}),checkDouble:(0,q.jsx)(ns,{...wY}),wrench:(0,q.jsx)(Xc,{...wY}),stop:(0,q.jsx)(Rc,{...wY}),microphone:(0,q.jsx)(dc,{...wY})}};function EY({children:e}){let t=nu(WG,e=>e.snapshot?.preferences),n=t?.theme??`system`,r=t?.appearance??BW,i=HW(n,r),a=t?.chatWidth??820,o=t?.chatFontSize??14,[s,c]=(0,K.useState)(()=>window.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1);(0,K.useEffect)(()=>{let e=window.matchMedia?.(`(prefers-color-scheme: dark)`);if(!e)return;let t=()=>c(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let l=n===`system`?s?`dark`:`light`:n,u=l===`dark`||l===`pine`?`dark`:`light`;return(0,K.useEffect)(()=>{let e=document.documentElement;e.dataset.theme=l,e.dataset.palette=i,e.style.setProperty(`--conversation-content-width`,`${a}px`),e.style.setProperty(`--conversation-font-size`,`${o}px`);let t={};if(r.background&&(t[`--page`]=r.background),r.foreground&&(t[`--text`]=r.foreground),r.background||r.foreground)for(let[e,n]of Object.entries({sidebar:3,"sidebar-hover":7,"sidebar-active":10,border:12,"border-strong":22,muted:65,subtle:52,"settings-secondary-text":75}))t[`--${e}`]=`color-mix(in srgb, var(--text) ${n}%, var(--page))`;r.accent&&(t[`--accent`]=r.accent,t[`--focus`]=r.accent),e.style.setProperty(`--openpi-interface-font`,{codex:`var(--openpi-default-font)`,system:`var(--openpi-default-font)`,sans:`Arial, Helvetica, sans-serif`,serif:`Georgia, 'Times New Roman', serif`,mono:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`}[r.font]);for(let n of[`page`,`text`,`sidebar`,`sidebar-hover`,`sidebar-active`,`border`,`border-strong`,`muted`,`subtle`,`settings-secondary-text`,`accent`,`focus`]){let r=t[`--${n}`];r?e.style.setProperty(`--${n}`,r):e.style.removeProperty(`--${n}`)}},[r,o,a,i,l]),(0,q.jsx)(Ql,{i18n:Xl,children:(0,q.jsx)(Tu,{theme:TY,mode:u,children:e})})}var DY=document.getElementById(`root`);if(!DY)throw Error(`OpenPI Web root is missing`);(0,el.createRoot)(DY).render((0,q.jsx)(K.StrictMode,{children:(0,q.jsx)(EY,{children:(0,q.jsx)(CY,{})})})); \ No newline at end of file +`)}function Kq(e,t){return e.kind===`event`?t(`trajectoryEvent_${e.title}`,{defaultValue:e.title}):e.kind===`call`||e.kind===`result`?e.title:e.kind===`assistant`&&!e.message?.content&&Gq(e)?t(`trajectoryReasoningTitle`):t(`trajectory_${e.kind}`)}function qq(e){if(e.input)try{let t=JSON.parse(e.input);if(t&&typeof t==`object`&&!Array.isArray(t)){let n=vK(e.title,t);if(n)return n}}catch{}return e.input||e.message?.content||e.message?.errorMessage||e.error||Gq(e)||e.result?.content||``}function Jq({node:e}){let{t}=W();if(!e.outcome)return null;let n=e.state??(e.result?yd({type:`toolCall`,name:e.title,id:e.callId,arguments:e.input??``},e.result).state:void 0),r=t(n===`cancelled`||n===`timed_out`||n===`running`?`toolState_${n}`:`trajectory_${e.outcome}`),i=n===`running`||n===`timed_out`?vs:e.outcome===`returned`?rs:e.outcome===`error`?je:fs;return(0,q.jsxs)(`span`,{className:`trajectory-outcome ${e.outcome}`,title:r,children:[(0,q.jsx)(i,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:r})]})}function Yq({label:e,value:t}){return(0,q.jsxs)(`section`,{className:`trajectory-evidence`,children:[(0,q.jsx)(`h3`,{children:e}),(0,q.jsx)(Fq,{text:t})]})}function Xq({node:e,number:t,onClose:n}){let{t:r,i18n:i}=W(),a=(0,K.useId)(),[o,s]=(0,K.useState)(`summary`),c=e.result,l=e.message,u=Gq(e),d=e.kind===`call`||e.kind===`result`,f=[{key:`summary`,label:r(`trajectorySummary`)},...e.input===void 0?[]:[{key:`input`,label:r(`trajectoryInputTab`)}],...d?[{key:`output`,label:r(`trajectoryResultTab`)}]:[],{key:`timing`,label:r(`trajectoryTimingTab`)},...!d&&l?.role===`assistant`?[{key:`usage`,label:r(`trajectoryUsageTab`)}]:[]],p=e.timestamp?new Date(e.timestamp):null,m=p&&Number.isFinite(p.getTime())?p.toLocaleString(i.language,{hour12:!1}):e.timestamp,h=(0,q.jsxs)(q.Fragment,{children:[c?(0,q.jsx)(Yq,{label:r(`trajectoryOutput`),value:c.content||r(`noOutput`)}):(0,q.jsx)(`p`,{className:`trajectory-missing`,children:r(e.missingOutput?`trajectoryNestedOutputMissing`:`trajectoryMissingResult`)}),o===`output`&&c?.details!==void 0&&(0,q.jsxs)(`details`,{className:`trajectory-disclosure`,children:[(0,q.jsx)(`summary`,{children:r(`trajectoryStructured`)}),(0,q.jsx)(`pre`,{children:JSON.stringify(c.details,null,2)})]})]}),g=l&&(0,q.jsxs)(q.Fragment,{children:[l.content&&(0,q.jsx)(Yq,{label:r(`trajectoryRecordedContent`),value:l.content}),u&&(0,q.jsxs)(`details`,{className:`trajectory-disclosure trajectory-reasoning`,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(Zs,{"aria-hidden":`true`}),r(`trajectoryThinking`)]}),(0,q.jsx)(`pre`,{children:u})]}),!l.content&&!u&&(0,q.jsx)(`p`,{children:r(`noOutput`)})]});return(0,q.jsxs)(`section`,{className:`trajectory-inspector`,"aria-label":r(`trajectoryDetails`),tabIndex:0,children:[(0,q.jsxs)(`header`,{className:`trajectory-inspector-heading`,children:[(0,q.jsx)(`span`,{className:`trajectory-role ${e.kind}`,children:r(`trajectoryRole_${e.kind}`)}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{children:r(`trajectoryRecordNumber`,{number:t})}),(0,q.jsx)(`h2`,{id:`${a}-title`,children:Kq(e,r)})]}),(0,q.jsx)(`button`,{type:`button`,className:`trajectory-inspector-close`,"aria-label":r(`close`),onClick:n,children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),e.outcome&&(0,q.jsx)(Jq,{node:e}),e.error&&(0,q.jsx)(`p`,{className:`trajectory-failure`,children:e.error}),l?.errorMessage&&(0,q.jsx)(`p`,{className:`trajectory-failure`,children:l.errorMessage}),f.length>1&&(0,q.jsx)(`div`,{className:`trajectory-tabs`,role:`tablist`,"aria-label":r(`trajectoryDetails`),onKeyDown:e=>{let t=f.findIndex(e=>e.key===o),n=e.key===`ArrowRight`?(t+1)%f.length:e.key===`ArrowLeft`?(t+f.length-1)%f.length:e.key===`Home`?0:e.key===`End`?f.length-1:void 0;n!==void 0&&(e.preventDefault(),s(f[n].key),e.currentTarget.querySelectorAll(`button`)[n]?.focus())},children:f.map(e=>(0,q.jsx)(`button`,{type:`button`,role:`tab`,id:`${a}-${e.key}`,"aria-controls":`${a}-panel`,"aria-selected":o===e.key,tabIndex:o===e.key?0:-1,onClick:()=>s(e.key),children:e.label},e.key))}),(0,q.jsxs)(`section`,{className:`trajectory-detail-content`,role:f.length>1?`tabpanel`:void 0,id:`${a}-panel`,"aria-labelledby":f.length>1?`${a}-${o}`:`${a}-title`,children:[(l?.truncation||c?.truncation)&&(0,q.jsx)(`p`,{className:`trajectory-warning`,children:r(`trajectoryEvidenceTruncated`)}),(o===`summary`||o===`input`)&&e.input!==void 0&&(0,q.jsx)(Qq,{node:e}),(o===`summary`||o===`output`)&&d&&h,!d&&o===`summary`&&g,o===`timing`&&(0,q.jsxs)(`dl`,{className:`trajectory-facts`,children:[(0,q.jsx)(`dt`,{children:r(`trajectoryDurationLabel`)}),(0,q.jsx)(`dd`,{children:Hq(e.durationMs)}),(0,q.jsx)(`dt`,{children:r(`trajectoryTimingSource`)}),(0,q.jsx)(`dd`,{children:r(e.durationMs===void 0?`trajectoryTimingUnknown`:`trajectoryTimingNative`)}),(0,q.jsx)(`dt`,{children:r(`trajectoryTTFT`)}),(0,q.jsx)(`dd`,{children:r(`trajectoryNotRecorded`)}),(0,q.jsx)(`dt`,{children:r(`trajectoryGenerationTime`)}),(0,q.jsx)(`dd`,{children:r(`trajectoryNotRecorded`)}),(0,q.jsx)(`dt`,{children:r(`trajectoryThroughput`)}),(0,q.jsx)(`dd`,{children:r(`trajectoryNotRecorded`)})]}),o===`usage`&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Zq,{message:l}),(0,q.jsxs)(`dl`,{className:`trajectory-facts`,children:[(0,q.jsx)(`dt`,{children:r(`trajectoryProvider`)}),(0,q.jsx)(`dd`,{children:l?.provider??`—`}),(0,q.jsx)(`dt`,{children:r(`trajectoryModel`)}),(0,q.jsx)(`dd`,{children:l?.model??`—`})]})]}),e.kind===`event`&&!l&&o===`summary`&&(0,q.jsx)(`p`,{className:`trajectory-missing`,children:r(`trajectoryEventOnly`)}),(0,q.jsxs)(`details`,{className:`trajectory-disclosure trajectory-metadata`,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(Js,{"aria-hidden":`true`}),r(`trajectoryRecordInfo`)]}),(0,q.jsxs)(`dl`,{children:[m&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`dt`,{children:r(`trajectoryRecordedAt`)}),(0,q.jsx)(`dd`,{children:(0,q.jsx)(`time`,{dateTime:e.timestamp,children:m})})]}),e.callId&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`dt`,{children:r(`trajectoryCallId`)}),(0,q.jsx)(`dd`,{children:e.callId})]}),(0,q.jsx)(`dt`,{children:r(`trajectoryRecordId`)}),(0,q.jsx)(`dd`,{children:e.key}),e.kind===`event`&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`dt`,{children:r(`trajectoryEventType`)}),(0,q.jsx)(`dd`,{children:e.title})]})]})]})]})]})}function Zq({message:e}){let{t}=W(),n=e?.usage;return n?(0,q.jsx)(`dl`,{className:`trajectory-facts`,children:[`input`,`cacheRead`,`cacheWrite`,`output`].map(e=>(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`trajectoryUsage_${e}`)}),(0,q.jsx)(`dd`,{children:n[e]?.toLocaleString()??`—`})]},e))}):(0,q.jsx)(`p`,{className:`trajectory-missing`,children:t(`trajectoryUsageUnknown`)})}function Qq({node:e}){let{t}=W(),[n,r]=(0,K.useState)(!1),i;if(e.title===`codemode`)try{let t=JSON.parse(e.input??``);t&&typeof t==`object`&&`code`in t&&typeof t.code==`string`&&(i=t.code)}catch{}return(0,q.jsxs)(`section`,{className:`trajectory-evidence`,children:[(0,q.jsxs)(`h3`,{children:[t(i?`trajectoryCode`:`trajectoryArguments`),i&&(0,q.jsx)(`button`,{type:`button`,"aria-pressed":n,onClick:()=>r(!n),children:t(`trajectoryRawArguments`)})]}),(0,q.jsx)(Fq,{text:i&&!n?i:e.input??``,code:!!(i&&!n)})]})}var $q=(0,K.memo)(function({snapshot:e,running:t}){let{t:n}=W(),r=(0,K.useRef)(null),i=(0,K.useRef)(!0),a=(0,K.useRef)(!1),o=(0,K.useRef)(null),s=JK(e.selectedSession,{beforePrepend:()=>{r.current&&(o.current={height:r.current.scrollHeight,top:r.current.scrollTop})}}),c=s.session?.entries??Wq,l=e.currentSessionPath===e.selectedSession?.path?e.runtime.liveTools:void 0,u=(0,K.useMemo)(()=>Vq(c,l),[c,l]),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(``),[_,v]=(0,K.useState)(50),[y,b]=(0,K.useState)(new Set),[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(!0),[T,E]=(0,K.useState)(null),D=(0,K.useMemo)(()=>{let e=h.trim().toLocaleLowerCase();return e?u.filter(t=>[Kq(t,n),t.title,t.callId,t.input,qq(t),t.result?.content,Gq(t)].some(t=>t?.toLocaleLowerCase().includes(e))):u},[u,h,n]),O=D.findIndex(e=>e.key===d),k=Math.min(Math.max(0,D.length-_),O<0?D.length:O),A=D.slice(k,k+_),j=T?.keys.length===A.length&&T.keys.every((e,t)=>e===A[t]?.key)?T:null,M=(0,K.useMemo)(()=>Lq(A,j),[A,j]),N=A.find(e=>e.key===d)??Rq(A);(0,K.useLayoutEffect)(()=>{let e=o.current;e&&r.current&&(r.current.scrollTop=e.top+r.current.scrollHeight-e.height,o.current=null)}),(0,K.useEffect)(()=>{N?.key&&(!i.current&&!a.current||(a.current=!1,r.current?.querySelector(`.trajectory-record[aria-pressed="true"]`)?.scrollIntoView?.({block:`nearest`,inline:`nearest`})))},[N?.key]),(0,K.useEffect)(()=>{p&&r.current?.querySelector(`.trajectory-record[aria-pressed="true"]`)?.focus()},[p]);let P=(0,K.useMemo)(()=>zq(u),[u]),F=new Set(A.map(e=>e.key)),I=P.flatMap(e=>{let t=e.runs.map(e=>e.filter(e=>F.has(e.key))).filter(e=>e.length>0);return t.length?[{...e,runs:t}]:[]}),ee=new Map(u.map((e,t)=>[e.key,t+1])),L=s.session?.truncation,R=u.filter(e=>e.kind===`assistant`),te=u.filter(e=>e.kind===`call`),z=c.flatMap(e=>e.turnTiming?[e.turnTiming]:[]).at(-1);function B(e){let t=qq(e);return(0,q.jsx)(`li`,{"data-nested":!!e.parentKey||void 0,"data-outside-range":M&&!M.has(e.key)||void 0,hidden:x&&e.kind===`call`,children:(0,q.jsxs)(`button`,{type:`button`,"aria-pressed":e.key===N?.key,onClick:()=>{a.current=!0,f(e.key),m(!1)},className:`trajectory-record ${e.kind}`,"data-response-error":e.kind===`assistant`&&(e.message?.stopReason===`error`||e.message?.stopReason===`aborted`)||void 0,title:zD(t,220),children:[(0,q.jsx)(`span`,{className:`trajectory-row-number`,children:ee.get(e.key)}),(0,q.jsx)(`span`,{className:`trajectory-role ${e.kind}`,children:n(`trajectoryRole_${e.kind}`)}),(0,q.jsxs)(`span`,{className:`trajectory-record-main`,children:[(0,q.jsx)(`span`,{className:`trajectory-record-title`,children:(0,q.jsx)(`strong`,{children:Kq(e,n)})}),t&&(0,q.jsx)(`span`,{className:`trajectory-preview`,children:zD(t,180)})]}),(0,q.jsxs)(`span`,{className:`trajectory-record-end`,children:[(0,q.jsx)(Jq,{node:e}),C&&e.durationMs!==void 0&&(0,q.jsx)(`span`,{className:`trajectory-row-duration`,children:Hq(e.durationMs)}),(0,q.jsx)(`time`,{dateTime:e.timestamp,title:n(`trajectoryRecordedAt`),children:BD(e.timestamp)})]})]})},e.key)}return(0,q.jsxs)(`section`,{className:`conversation trajectory`,"aria-label":n(`trajectory`),children:[(0,q.jsxs)(`header`,{className:`trajectory-toolbar`,children:[(0,q.jsxs)(`div`,{className:`trajectory-context`,children:[(0,q.jsx)(nc,{"aria-hidden":`true`}),(0,q.jsxs)(`button`,{type:`button`,"aria-pressed":C,onClick:()=>w(!C),children:[(0,q.jsx)(vs,{"aria-hidden":`true`}),n(`trajectoryDurationLabel`)]}),(0,q.jsx)(`button`,{type:`button`,"aria-pressed":y.size>0,onClick:()=>b(y.size?new Set:new Set(P.map(e=>e.key))),children:n(`trajectoryFoldTurns`)}),(0,q.jsx)(`button`,{type:`button`,"aria-pressed":x,onClick:()=>S(!x),children:n(`trajectoryFoldCalls`)}),(0,q.jsx)(`span`,{className:`trajectory-count`,children:n(h.trim()?`trajectoryMatches`:`trajectoryRecordCount`,{count:D.length})}),(0,q.jsxs)(`details`,{className:`trajectory-scope`,children:[(0,q.jsx)(`summary`,{"aria-label":n(`trajectoryScope`),title:n(`trajectoryScope`),children:(0,q.jsx)(Js,{"aria-hidden":`true`})}),(0,q.jsxs)(`div`,{className:`trajectory-scope-popover`,children:[(0,q.jsx)(`p`,{children:n(`trajectoryScope`)}),(0,q.jsxs)(`dl`,{"aria-label":n(`trajectoryMetrics`),children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:n(`trajectoryModelResponses`)}),(0,q.jsx)(`dd`,{children:n(`trajectoryRequestCount`,{count:R.length})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:n(`trajectoryToolCalls`)}),(0,q.jsx)(`dd`,{children:n(`trajectoryToolCount`,{count:te.length})})]}),z&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:n(`trajectoryLastTurn`)}),(0,q.jsx)(`dd`,{children:Hq(z.elapsedMs)})]})]})]})]})]}),(0,q.jsxs)(`label`,{className:`trajectory-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":n(`trajectorySearch`),placeholder:n(`trajectorySearch`),value:h,onChange:e=>g(e.currentTarget.value)})]})]}),u.length>0&&(0,q.jsx)(Uq,{nodes:A,selectedKey:N?.key,range:j,onRange:e=>E(e?{...e,keys:A.map(e=>e.key)}:null),onSelect:e=>{a.current=!0,f(e),m(!1),b(new Set),S(!1)}}),t&&(0,q.jsx)(`p`,{className:`trajectory-live`,role:`status`,children:n(`trajectoryRunning`)}),L?.truncated&&(0,q.jsx)(`p`,{className:`trajectory-warning`,children:n(`trajectoryTruncated`,{entries:L.entriesOmitted,parts:L.messagePartsOmitted,messages:L.messagesTruncated})}),A.length?(0,q.jsxs)(`div`,{className:`trajectory-body`,"data-inspector-open":N&&!p||void 0,children:[(0,q.jsxs)(`div`,{className:`trajectory-ledger`,"data-range":!!j||void 0,ref:r,onScroll:e=>{let t=e.currentTarget;i.current=t.scrollHeight-t.scrollTop-t.clientHeight<40},children:[k+_{a.current=!0,f(null),m(!1),v(50)},children:n(`trajectoryLatestRecords`)}),s.hasMore&&(0,q.jsx)(`button`,{type:`button`,className:`trajectory-load`,disabled:s.loading||s.verifying,onClick:()=>{s.loadOlder(),v(e=>e+50)},children:n(s.loading?`trajectoryHistoryLoading`:`trajectoryLoadHistory`)}),s.error&&(0,q.jsx)(`p`,{className:`trajectory-warning`,role:`alert`,children:n(s.error)}),k>0&&(0,q.jsx)(`button`,{type:`button`,className:`trajectory-load`,onClick:()=>v(e=>e+50),children:n(`trajectoryEarlier`,{count:k})}),I.map((e,t)=>{let r=!y.has(e.key);return(0,q.jsxs)(`section`,{className:`trajectory-group`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`trajectory-group-heading`,"aria-expanded":r,onClick:()=>b(t=>{let n=new Set(t);return r?n.add(e.key):n.delete(e.key),n}),children:[(0,q.jsx)(os,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`trajectory-group-label`,children:[(0,q.jsx)(`span`,{className:`trajectory-turn-number`,children:n(`trajectoryTurn`,{number:t+1})}),(0,q.jsx)(`span`,{className:`trajectory-group-name`,children:e.prompt?r&&!h.trim()?n(`trajectoryConversationGroup`):zD(e.prompt.message?.content||n(`trajectory_user`),80):n(`trajectoryEarlierGroup`)})]})]}),r&&(0,q.jsx)(`ol`,{children:e.runs.map(e=>e.length===1?B(e[0]):(0,q.jsx)(`li`,{className:`trajectory-event-group`,children:(0,q.jsxs)(`details`,{open:e.some(e=>e.key===N?.key)||!!h.trim(),children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(kc,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:n(`trajectoryEventCount`,{count:e.length})}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),(0,q.jsx)(`ol`,{children:e.map(B)})]})},e[0].key))})]},e.key)})]}),N&&!p&&(0,q.jsx)(Xq,{node:N,number:ee.get(N.key),onClose:()=>m(!0)},N.key)]}):(0,q.jsxs)(`div`,{className:`trajectory-empty`,children:[(0,q.jsx)(nc,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:n(h.trim()?`trajectoryNoMatches`:`trajectoryEmpty`)})]})]})});function eJ(){(0,K.useEffect)(()=>{let e=new de,t=new AbortController,n,r=async r=>{let i=r.data;if(!(r.source!==window||r.origin!==location.origin||i?.source!==`openpi-browser-extension`||i.type!==`connector-hello`||typeof i.bridgeId!=`string`||!/^[\da-f-]{36}$/.test(i.bridgeId)||!Cj(i.browser)||n===i.bridgeId)){n=i.bridgeId;try{let r=await e.request(`/api/browser/connections`,{method:`POST`,signal:t.signal,body:JSON.stringify({browser:i.browser,profileId:i.profileId,extensionId:i.extensionId,extensionOrigin:i.extensionOrigin,version:i.version})});!t.signal.aborted&&n===i.bridgeId&&window.postMessage({source:`openpi-browser-ui`,type:`connector-authorize`,...r},location.origin)}catch{n===i.bridgeId&&(n=void 0)}}},i=()=>window.postMessage({source:`openpi-browser-ui`,type:`connector-probe`},location.origin);window.addEventListener(`message`,r),i();let a=setInterval(i,5e3);return()=>{t.abort(),clearInterval(a),window.removeEventListener(`message`,r)}},[])}function tJ(e,t){let n=e.trim();if(!n||n.length>16384)return null;let r=/^[a-z][a-z\d+.-]*:\/\//iu.test(n);try{let e=new URL(r?n:`https://${n}`);return!r&&(e.hostname===`localhost`||e.hostname.endsWith(`.localhost`)||e.hostname===`[::1]`||/^127(?:\.\d{1,3}){3}$/u.test(e.hostname))&&(e=new URL(`http://${n}`)),![`http:`,`https:`].includes(e.protocol)||e.username||e.password||e.origin===t?null:e.href}catch{return null}}function nJ(){return document.documentElement.dataset.openpiBrowserExtension===`ready`?[...document.querySelectorAll(`iframe[data-openpi-browser-document]`)].map(e=>({id:e.dataset.openpiBrowserPage,document:e.dataset.openpiBrowserDocument,url:e.dataset.openpiBrowserUrl,title:e.dataset.openpiBrowserTitle||``})):[]}function rJ(e,t,n){let r=(0,K.useRef)(n),i=(0,K.useRef)(0);r.current=n,(0,K.useEffect)(()=>{if(!e||!t)return;let n=new de,a=new AbortController,o,s,c,l=e=>window.postMessage({source:`openpi-browser-ui`,...e},location.origin),u=()=>{c?.(),c=void 0,s&&l({type:`control-cancel`,requestId:s}),s=void 0},d=(r,i,o)=>{r===s&&(c?.(),c=void 0,s=void 0,n.request(`/api/browser/control`,{method:`POST`,signal:a.signal,body:JSON.stringify({sessionId:e,sessionPath:t,requestId:r,result:i,error:o,pages:nJ()})}).catch(()=>{}))},f=e=>{let t=e.data;e.source===window&&e.origin===location.origin&&t?.source===`openpi-browser-extension`&&(t.type===`connector-hello`?i.current=Date.now():t.type===`control-result`&&d(t.requestId,t.result,t.error))},p=async(e,t)=>{let n=tJ(t||``,location.origin);if(!n){d(e,void 0,`Invalid internal browser URL.`);return}let i=new AbortController;c=()=>i.abort();let o=await r.current(n,AbortSignal.any([a.signal,i.signal]));if(a.signal.aborted||s!==e)return;if(!o){d(e,void 0,`The internal browser has reached its page limit.`);return}let l=()=>{let t=document.getElementById(o)?.querySelector(`iframe[data-openpi-browser-document]`),n=t&&nJ().find(e=>e.id===t.dataset.openpiBrowserPage);n&&d(e,{root:n.id})},u=new MutationObserver(l);u.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-openpi-browser-document`]});let f=setTimeout(()=>d(e,void 0,`The internal page did not bind. Inspect the browser's loading or embedding error.`),1e4);c=()=>{i.abort(),u.disconnect(),clearTimeout(f)},l()},m=async()=>{if(Date.now()-i.current>15e3&&document.documentElement.dataset.openpiBrowserExtension!==`ready`){u(),a.signal.aborted||(o=setTimeout(()=>void m(),1e3));return}try{let{pending:r}=await n.request(`/api/browser/control`,{method:`POST`,signal:a.signal,body:JSON.stringify({sessionId:e,sessionPath:t,pages:nJ()})});s&&s!==r?.requestId&&u(),r&&!r.running&&r.request&&!s&&(s=r.requestId,r.request.operation===`open`?p(r.requestId,r.request.url).catch(()=>d(r.requestId,void 0,`The embedded browser could not open.`)):r.page?l({type:`control`,id:r.page.id,document:r.page.document,requestId:r.requestId,request:r.request}):d(r.requestId,void 0,`The embedded page is unavailable.`))}catch{u()}a.signal.aborted||(o=setTimeout(()=>void m(),250))};return window.addEventListener(`message`,f),m(),()=>{clearTimeout(o),a.abort(),u(),window.removeEventListener(`message`,f)}},[e,t])}function iJ({usage:e,workspace:t,sessionId:n,model:r}){let{t:i,i18n:a}=W(),[o,s]=(0,K.useState)(!1);if(!e)return null;let c=e.context,l=e=>new Intl.NumberFormat(a.resolvedLanguage).format(e),u=e=>new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:0}).format(e).toLowerCase(),d=c?.percent==null?i(`usageUnknown`):`${Math.round(c.percent)}%`,f=c?.percent==null?i(`usageUnknown`):`${new Intl.NumberFormat(a.resolvedLanguage,{maximumFractionDigits:1}).format(c.percent)}%`,p=c?u(c.contextWindow):i(`usageUnknown`);return(0,q.jsx)(`div`,{className:`session-usage`,children:(0,q.jsx)(Zu,{isOpen:o,onOpenChange:s,placement:`below`,alignment:`end`,width:`min(360px, calc(100vw - 24px))`,label:i(`sessionUsage`),isModal:!1,hasCloseButton:!1,content:(0,q.jsxs)(`div`,{className:`session-usage-details`,children:[(0,q.jsxs)(`div`,{className:`usage-details-heading`,children:[(0,q.jsx)(`h2`,{children:i(`sessionOverview`)}),(0,q.jsx)(V,{content:i(`close`),placement:`below`,children:(0,q.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":i(`close`),onClick:()=>s(!1),children:(0,q.jsx)(je,{"aria-hidden":`true`})})})]}),(0,q.jsxs)(`section`,{className:`usage-section`,children:[(0,q.jsxs)(`div`,{className:`usage-context-heading`,children:[(0,q.jsx)(`h3`,{children:i(`usageContextLabel`)}),(0,q.jsx)(`span`,{children:f})]}),(0,q.jsxs)(`p`,{className:`usage-context-value`,children:[(0,q.jsx)(`strong`,{children:c?.tokens==null?i(`usageUnknown`):l(c.tokens)}),c&&(0,q.jsxs)(`span`,{children:[` / `,l(c.contextWindow),` tokens`]})]}),c?.percent!=null&&(0,q.jsx)(`progress`,{value:Math.max(0,Math.min(100,c.percent)),max:100,"aria-label":i(`sessionContextUsage`)}),(0,q.jsx)(`p`,{className:`usage-help`,children:i(`usageContextHelp`)}),r&&(0,q.jsxs)(`div`,{className:`usage-context-model`,children:[(0,q.jsx)(`span`,{children:r.name}),(0,q.jsxs)(`span`,{children:[r.provider,` / `,r.id]})]})]}),(0,q.jsxs)(`section`,{className:`usage-section`,children:[(0,q.jsx)(`h3`,{children:i(`usageSessionTotals`)}),(0,q.jsxs)(`dl`,{className:`usage-metrics`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:i(`usageInputLabel`)}),(0,q.jsx)(`dd`,{children:l(e.input)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:i(`usageOutputLabel`)}),(0,q.jsx)(`dd`,{children:l(e.output)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:i(`usageCacheReadLabel`)}),(0,q.jsx)(`dd`,{children:l(e.cacheRead)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:i(`usageCacheWriteLabel`)}),(0,q.jsx)(`dd`,{children:l(e.cacheWrite)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:i(`usageTotalLabel`)}),(0,q.jsx)(`dd`,{children:l(e.total)})]})]}),(0,q.jsx)(`p`,{className:`usage-help`,children:i(`usageTotalsHelp`)})]}),t&&(0,q.jsxs)(`dl`,{className:`usage-workspace`,children:[(0,q.jsx)(`dt`,{children:i(`usageWorkspaceLabel`)}),(0,q.jsx)(`dd`,{children:t})]}),n&&(0,q.jsxs)(`details`,{className:`usage-identity`,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(`span`,{children:i(`usageSessionId`)}),(0,q.jsx)(is,{"aria-hidden":`true`})]}),(0,q.jsx)(`code`,{children:n})]})]}),children:t=>(0,q.jsx)(V,{content:i(`usageOpenDetails`,{input:l(e.input),output:l(e.output),percent:f,capacity:p}),placement:`below`,isEnabled:!o,children:(0,q.jsxs)(`button`,{...t,className:`session-usage-trigger`,type:`button`,"aria-label":i(`usageOpenDetails`,{input:u(e.input),output:u(e.output),percent:d,capacity:p}),children:[(0,q.jsxs)(`span`,{className:`usage-stat`,children:[(0,q.jsx)(Xo,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:u(e.input)})]}),(0,q.jsxs)(`span`,{className:`usage-stat`,children:[(0,q.jsx)(ue,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:u(e.output)})]}),(0,q.jsxs)(`span`,{className:`usage-stat`,children:[(0,q.jsx)(Us,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[d,c&&(0,q.jsxs)(`span`,{className:`usage-capacity`,children:[` / `,p]})]})]})]})})})})}function aJ(e,t){return new Promise((n,r)=>{let i=new FileReader,a=e=>{t.removeEventListener(`abort`,o),e?r(e):typeof i.result==`string`?n(i.result.slice(i.result.indexOf(`,`)+1)):r(Error(`File read failed`))},o=()=>{i.abort(),a(new DOMException(`File read cancelled`,`AbortError`))};i.onload=()=>a(),i.onerror=()=>a(Error(`File read failed`)),t.addEventListener(`abort`,o,{once:!0}),t.aborted?o():i.readAsDataURL(e)})}function oJ({name:e,kind:t=`file`,expanded:n=!1}){let r=t===`directory`?`folder`:t===`symlink`?`link`:/\.(?:md|markdown)$/iu.test(e)?`markdown`:/\.(?:csv|tsv|xlsx?)$/iu.test(e)?`sheet`:/\.(?:png|jpe?g|gif|webp|svg|bmp|ico)$/iu.test(e)?`image`:/\.(?:pdf|docx?|pptx?)$/iu.test(e)?`document`:/\.(?:[cm]?[jt]sx?|json|html?|css|py|rs|go|sh|ya?ml|toml|xml)$/iu.test(e)?`code`:`file`;return(0,q.jsx)(r===`folder`?n?zs:Vs:r===`link`?Qs:r===`sheet`?jc:r===`image`?Ns:r===`markdown`||r===`document`?Fs:r===`code`?js:Is,{className:`file-icon file-icon-${r}`,"aria-hidden":`true`})}function sJ({sessionId:e,sessionPath:t,cwd:n,canWrite:r,active:i,selected:a,onSelect:o,dropTarget:s,onShowTree:c,onRemoved:l,onReadStateChange:u,refreshRequest:d}){let{t:f}=W(),p=(0,K.useContext)($E),m=be(),h=(0,K.useMemo)(()=>new de,[]),[g,_]=(0,K.useState)(m?.files?.query??``),[v,y]=(0,K.useState)(m?.files?.expanded??[`.`]),[b,x]=(0,K.useState)({}),[S,C]=(0,K.useState)(null),[w,T]=(0,K.useState)(null),[E,D]=(0,K.useState)(!1),[O,k]=(0,K.useState)(0);(0,K.useEffect)(()=>{u({error:w,loading:E})},[w,E,u]);let A=(0,K.useCallback)(e=>({message:f(e instanceof ge&&e.code===`ARTIFACT_DENIED`?`filesReadDenied`:`filesReadFailedDetail`),detail:e instanceof Error?e.message:void 0}),[f]),[j,M]=(0,K.useState)(a.includes(`/`)?a.slice(0,a.lastIndexOf(`/`)):`.`),[N,P]=(0,K.useState)(null),[F,I]=(0,K.useState)(``),[ee,L]=(0,K.useState)(null),[R,te]=(0,K.useState)(!1),[z,B]=(0,K.useState)(!1),[ne,re]=(0,K.useState)([]),[ie,ae]=(0,K.useState)(!1),[oe,se]=(0,K.useState)([]),[ce,le]=(0,K.useState)(null),[H,ue]=(0,K.useState)(`.`),[fe,pe]=(0,K.useState)(``),[he,_e]=(0,K.useState)([]),[ve,ye]=(0,K.useState)(!1),[xe,Se]=(0,K.useState)([]),[Ce,we]=(0,K.useState)(0),[Te,Ee]=(0,K.useState)(!1),[U,De]=(0,K.useState)(),Oe=(0,K.useRef)(0),[ke,Ae]=(0,K.useState)([]),[G,je]=(0,K.useState)(!1),[Me,Ne]=(0,K.useState)(``),Pe=(0,K.useRef)(null),Fe=(0,K.useRef)(null),Ie=(0,K.useRef)(null),Le=(0,K.useRef)(null),Re=(0,K.useRef)(null),ze=(0,K.useRef)(!1),Be=(0,K.useRef)(0),Ve=(0,K.useRef)(null),He=(0,K.useRef)(void 0),Ue=JSON.stringify([e,t,n]),We=(0,K.useRef)(Ue);We.current=Ue;let Ge=(0,K.useRef)(r);Ge.current=r;let Ke=(0,K.useRef)(null);(0,K.useEffect)(()=>(We.current=Ue,()=>{We.current=``,Ke.current?.abort(),clearTimeout(He.current)}),[Ue]),(0,K.useEffect)(()=>{Fe.current?.setAttribute(`webkitdirectory`,``)},[]),(0,K.useEffect)(()=>{if(!ve||!i)return;Oe.current++;let n=new AbortController;return Ee(!0),h.workspaceTrash(e,t,n.signal).then(r=>{!n.signal.aborted&&r.sessionId===e&&r.sessionPath===t&&(Se(r.entries),we(r.unavailable??0),De(r.nextCursor))}).catch(e=>{n.signal.aborted||(te(!0),L(A(e).message))}).finally(()=>{n.signal.aborted||Ee(!1)}),()=>n.abort()},[h,e,t,i,ve,O,A]),(0,K.useEffect)(()=>{ce&&(Le.current?.focus(),Le.current?.select())},[ce]),(0,K.useEffect)(()=>{N&&Ie.current?.focus()},[N]);let qe=(0,K.useRef)(null),Je=(0,K.useRef)(m?.files?.treeScroll??0);(0,K.useLayoutEffect)(()=>{m?.files&&Object.assign(m.files,{query:g,expanded:v})},[m,g,v]),(0,K.useLayoutEffect)(()=>{!i||!(S||b[`.`])||Je.current!==null&&qe.current&&(qe.current.scrollTop=Je.current,Je.current=null)},[i,S,b]);let Ye=(0,K.useRef)(b);Ye.current=b;let Xe=(0,K.useRef)(S);Xe.current=S;let Ze=(0,K.useRef)(``),Qe=(0,K.useRef)(null),$e=(0,K.useRef)(new Set),et=(0,K.useRef)(!1),[tt,nt]=(0,K.useState)(!1),rt=!!g.trim();(0,K.useLayoutEffect)(()=>{let e=Ve.current;if(!e||!i)return;let t=[...qe.current?.querySelectorAll(`[data-file-row]`)??[]].find(t=>t.dataset.fileRow===e);t&&(t.focus({preventScroll:!0}),Ve.current=null)});let it=e=>e instanceof ge&&e.code===`ARTIFACT_EXISTS`?f(`filesNameExists`):e instanceof Error?e.message:f(`filesMutationFailed`),at=e=>{_(``);let t=e.path.split(`/`),n=e.kind===`directory`?t.length:t.length-1;y(e=>[...new Set([...e,`.`,...t.slice(0,n).map((e,n)=>t.slice(0,n+1).join(`/`))])]),Ve.current=e.path,k(e=>e+1),e.kind===`file`&&(e.bytes??0)<=20971520&&(o(e.path),p?.open(encodeURI(e.path)))},ot=()=>{ze.current||(P(null),L(null),Re.current?.focus({preventScroll:!0}))},st=async n=>{if(n.preventDefault(),!N||!Ge.current||ze.current)return;if(!F||F===`.`||F===`..`||/[\\/\u0000-\u001f\u007f]/u.test(F)){te(!0),L(f(`filesNameInvalid`)),Ie.current?.focus();return}ze.current=!0,B(!0),L(null);let r=Ue;try{let n=await h.mutateWorkspaceFile(e,t,{kind:N,directory:j,name:F});if(We.current!==r||n.sessionId!==e||n.sessionPath!==t)return;P(null),I(``),te(!1),L(f(`filesCreated`,{path:n.path})),at(n)}catch(e){We.current===r&&(te(!0),L(it(e)),Ie.current?.focus())}finally{We.current===r&&(ze.current=!1,B(!1))}},ct=async n=>{if(!Ge.current||ze.current)return;let r=Ue;ze.current=!0,B(!0);let i=new AbortController;Ke.current=i;let a=(e,t)=>re(n=>n.map(n=>n.id===e.id?{...n,...t}:n));try{for(let o of n){if(We.current!==r)return;if(!Ge.current){a(o,{state:`error`,message:f(`filesWriteUnavailable`)});continue}if(!(!o.file&&o.kind!==`directory`)){a(o,{state:`running`,message:void 0});try{if(o.kind===`directory`){try{await h.mutateWorkspaceFile(e,t,{kind:`create-directory`,directory:o.directory,name:o.name})}catch(n){if(!(n instanceof ge)||n.code!==`ARTIFACT_EXISTS`)throw n;await h.workspaceFiles(e,t,[o.directory===`.`?``:o.directory,o.name].filter(Boolean).join(`/`),``,i.signal)}if(We.current!==r)return;a(o,{state:`done`,message:f(`filesImported`)}),k(e=>e+1);continue}if(!o.file)continue;if(o.file.size>52428800)throw Error(f(`filesImportTooLarge`));let n=await aJ(o.file,i.signal);if(We.current!==r)return;if(!Ge.current){a(o,{state:`error`,message:f(`filesWriteUnavailable`)});continue}let s=await h.mutateWorkspaceFile(e,t,{kind:`import-file`,directory:o.directory,name:o.name,data:n,...o.createParents?{createParents:!0}:{}});if(We.current!==r||s.sessionId!==e||s.sessionPath!==t)return;a(o,{state:`done`,file:void 0,message:(s.bytes??0)>20971520?f(`filesImportedNoPreview`):f(`filesImported`)}),at(s)}catch(e){if(We.current!==r)return;a(o,{state:`error`,message:it(e)})}}}}finally{Ke.current===i&&(Ke.current=null),We.current===r&&(ze.current=!1,B(!1))}},lt=(e,t=[],n=new Map,r=[])=>{if(!Ge.current||ze.current)return;if(e.length+r.length>2e3){te(!0),L(f(`filesImportFolderLimit`));return}c(!0);let i=[...[...new Set(r)].sort((e,t)=>e.split(`/`).length-t.split(`/`).length).map(e=>({id:++Be.current,name:e.split(`/`).at(-1),directory:[j===`.`?``:j,...e.split(`/`).slice(0,-1)].filter(Boolean).join(`/`)||`.`,kind:`directory`,state:`pending`})),...e.map(e=>{let t=n.get(e)??e.webkitRelativePath;return{id:++Be.current,name:e.name,directory:t?[j===`.`?``:j,...t.split(`/`).slice(0,-1)].filter(Boolean).join(`/`)||`.`:j,createParents:!!t,file:e,state:`pending`}})];re(e=>[...e,...t.map(e=>({id:++Be.current,name:e,directory:j,state:`error`,message:f(`filesImportDirectoryUnsupported`)})),...i]),ct(i)},ut=async(n,r)=>{if(!Ge.current||ze.current)return;let i=Ue,s=r.filter(e=>!r.some(t=>t.kind===`directory`&&e.path.startsWith(`${t.path}/`)));ze.current=!0,B(!0),_e([]);let c=[],u=new Set;try{for(let r of s){if(We.current!==i||!Ge.current)return;try{if(!r.identity)throw Error(f(`filesRefreshBeforeOrganizing`));let s=await h.mutateWorkspaceFile(e,t,n===`trash`?{kind:n,path:r.path,identity:r.identity}:{kind:n,path:r.path,identity:r.identity,directory:H,name:ce?.rename?fe:r.name});if(We.current!==i||s.sessionId!==e||s.sessionPath!==t)return;if(u.add(r.path),s.trashed&&c.push(s.trashed),s.moved&&MD(e,t,s.moved.from,s.moved.to),r.kind===`directory`){let e=e=>e===r.path||e.startsWith(`${r.path}/`);if(y(t=>n===`trash`?t.filter(t=>!e(t)):t.map(t=>e(t)?`${s.path}${t.slice(r.path.length)}`:t)),M(t=>e(t)?n===`move`?`${s.path}${t.slice(r.path.length)}`:r.path.split(`/`).slice(0,-1).join(`/`)||`.`:t),n===`move`&&e(a)){let e=`${s.path}${a.slice(r.path.length)}`;o(e),p?.open(encodeURI(e))}}n===`move`&&at(s),_e(e=>[...e,{path:r.path}])}catch(e){if(We.current!==i)return;_e(t=>[...t,{path:r.path,error:it(e)}])}}Ae(c),n===`trash`&&l([...u]),se(e=>e.filter(e=>![...u].some(t=>t===e.path||e.path.startsWith(`${t}/`)))),le(null),k(e=>e+1)}finally{We.current===i&&(ze.current=!1,B(!1))}},dt=async n=>{if(!Ge.current||ze.current)return;let r=Ue;ze.current=!0,B(!0),_e([]);try{for(let i of n){if(We.current!==r||!Ge.current)return;try{let n=await h.mutateWorkspaceFile(e,t,{kind:`restore`,id:i.id,identity:i.identity});if(We.current!==r||n.sessionId!==e||n.sessionPath!==t)return;Ae(e=>e.filter(e=>e.id!==i.id)),Se(e=>e.filter(e=>e.id!==i.id)),_e(e=>[...e,{path:i.path}]),at(n)}catch(e){if(We.current!==r)return;_e(t=>[...t,{path:i.path,error:it(e)}])}}k(e=>e+1)}finally{We.current===r&&(ze.current=!1,B(!1))}},ft=async()=>{if(!U||Te)return;let n=Oe.current,r=Ue;Ee(!0);try{let i=await h.workspaceTrash(e,t,void 0,U);if(n!==Oe.current||We.current!==r||i.sessionId!==e||i.sessionPath!==t)return;Se(e=>[...new Map([...e,...i.entries].map(e=>[e.id,e])).values()]),we(e=>e+(i.unavailable??0)),De(i.nextCursor)}catch(e){n===Oe.current&&We.current===r&&(te(!0),L(it(e)))}finally{n===Oe.current&&We.current===r&&Ee(!1)}},pt=e=>se(t=>t.some(t=>t.path===e.path)?t.filter(t=>t.path!==e.path):[...t,e]),mt=(e,t=!1)=>{le({entries:e,rename:t});let n=e[0]?.path??``;ue(t?n.split(`/`).slice(0,-1).join(`/`)||`.`:j),pe(e[0]?.name??``),L(null)},ht=(0,K.useRef)(lt);ht.current=lt,(0,K.useEffect)(()=>{let e=s.current;if(!e)return;let t=e=>{if(!e.dataTransfer?.types.includes(`Files`))return;e.preventDefault();let t=Ge.current&&!ze.current;e.dataTransfer.dropEffect=t?`copy`:`none`,je(t)},n=t=>{(!(t.relatedTarget instanceof Node)||!e.contains(t.relatedTarget))&&je(!1)},r=e=>{let t=e.dataTransfer;if(!t?.types.includes(`Files`)||(e.preventDefault(),je(!1),!Ge.current||ze.current))return;let n=[],r=[],i=[];for(let e of t.items){if(e.kind!==`file`)continue;let t=e.webkitGetAsEntry?.();if(t?.isDirectory&&`createReader`in t)i.push(t);else if(t?.isDirectory)r.push(t.name);else{let t=e.getAsFile();t&&n.push(t)}}if(i.length){let e=We.current,t=new Map,a=[],o=0,s=async(r,i)=>{if(We.current!==e||!Ge.current)throw new DOMException(`Import cancelled`,`AbortError`);if(++o>2e3||i.split(`/`).length>64)throw Error(f(`filesImportFolderLimit`));let c=i?`${i}/${r.name}`:r.name;if(r.isDirectory){a.push(c);let e=r.createReader();for(;;){let t=await new Promise((t,n)=>e.readEntries(t,n));if(!t.length)break;for(let e of t)await s(e,c)}}else if(r.isFile){let e=await new Promise((e,t)=>r.file(e,t));t.set(e,c),n.push(e)}};ze.current=!0,B(!0),(async()=>{try{for(let e of i)await s(e,``);if(We.current!==e||!Ge.current)return;ze.current=!1,B(!1),ht.current(n,r,t,a)}catch(t){We.current===e&&(te(!0),L(t instanceof Error?t.message:f(`filesMutationFailed`)))}finally{We.current===e&&!Ke.current&&(ze.current=!1,B(!1))}})();return}ht.current(t.items.length?n:[...t.files],r)};return e.addEventListener(`dragover`,t),e.addEventListener(`dragleave`,n),e.addEventListener(`drop`,r),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`dragleave`,n),e.removeEventListener(`drop`,r)}},[s,f]);let gt=async(e,t)=>{let r=Ue,i=n.includes(`\\`)?`\\`:`/`,a=await td(t?`${n.replace(/[\\/]$/u,``)}${i}${e.split(`/`).join(i)}`:e);We.current===r&&(clearTimeout(He.current),Ne(f(a?`filesPathCopied`:`copyFailed`,{path:e})),He.current=setTimeout(()=>Ne(``),3e3))};(0,K.useEffect)(()=>{if(!i)return;let n=new AbortController;Qe.current=n;let r;Ze.current!==g.trim()&&(Ze.current=g.trim(),Xe.current=null,C(null)),r=setTimeout(async()=>{if(document.visibilityState!==`hidden`){D(!0);try{let r=async(r,i,a)=>{let o=await h.workspaceFiles(e,t,r,i,n.signal);for(o.nextCursor&&$e.current.add(o.nextCursor);o.nextCursor&&o.entries.length{document.visibilityState!==`hidden`&&k(e=>e+1)};return window.addEventListener(`focus`,a),document.addEventListener(`visibilitychange`,a),()=>{n.abort(),clearTimeout(r),window.removeEventListener(`focus`,a),document.removeEventListener(`visibilitychange`,a);for(let e of $e.current)h.releaseFileListing(e).catch(()=>void 0);$e.current.clear(),et.current=!1,nt(!1)}},[i,h,v,g,rt,e,t,O,d,A]);let _t=e=>y(t=>t.includes(e)?t.filter(t=>t!==e&&!t.startsWith(`${e}/`)):[...t,e]),vt=async n=>{let r=rt?Xe.current:Ye.current[n],i=Qe.current;if(!(!r?.nextCursor||!i||i.signal.aborted||et.current||E)){et.current=!0,nt(!0),T(null);try{let a=await h.workspaceFiles(e,t,n,rt?g.trim():``,i.signal,r.nextCursor);if($e.current.delete(r.nextCursor),a.nextCursor&&$e.current.add(a.nextCursor),i.signal.aborted)return;let o=[...new Map([...r.entries,...a.entries].map(e=>[e.path,e])).values()],s={...a,entries:o};rt?C(s):x(e=>({...e,[n]:s}))}catch(e){i.signal.aborted||T(A(e))}finally{i.signal.aborted||(et.current=!1,nt(!1))}}},yt=(e,t)=>t?.nextCursor?(0,q.jsxs)(`li`,{className:`file-tree-more`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:E||tt,onClick:()=>void vt(e),children:f(tt?`readingFile`:`filesLoadMore`)}),(0,q.jsx)(`small`,{children:f(`filesLoaded`,{count:t.entries.length})})]}):null,bt=e=>{let t=[...qe.current?.querySelectorAll(`button[data-file-row]:not(:disabled)`)??[]],n=t.indexOf(document.activeElement),r=t[n];if(!r)return;let i;if(e.key===`ArrowDown`)i=t[Math.min(n+1,t.length-1)];else if(e.key===`ArrowUp`)i=t[Math.max(n-1,0)];else if(e.key===`Home`)i=t[0];else if(e.key===`End`)i=t.at(-1);else if(e.key===`ArrowRight`&&r.getAttribute(`aria-expanded`)===`false`)r.click();else if(e.key===`ArrowLeft`)r.getAttribute(`aria-expanded`)===`true`?r.click():i=t.find(e=>e.dataset.fileRow===r.dataset.fileRow?.split(`/`).slice(0,-1).join(`/`));else return;e.preventDefault(),i?.focus()},xt=(e,t=0)=>e.map(e=>{let n=e.kind===`directory`,i=v.includes(e.path),s=r&&!!e.identity&&!e.path.split(`/`).some(e=>[`.git`,`.pi`,`.openpi-trash`].includes(e.toLowerCase()))&&(n||e.kind===`file`);return(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{className:`file-tree-item`,children:[ie&&(0,q.jsx)(`input`,{type:`checkbox`,className:`file-tree-check`,"aria-label":f(`filesSelectItem`,{name:e.name}),checked:oe.some(t=>t.path===e.path),disabled:!s||z,onChange:()=>pt(e)}),(0,q.jsxs)(`button`,{type:`button`,"data-file-row":e.path,className:`file-tree-row`,style:{paddingInlineStart:10+t*16},"aria-expanded":n?i:void 0,"aria-current":!n&&a===e.path?`true`:void 0,disabled:e.kind===`symlink`||e.kind===`other`,title:e.kind===`symlink`?f(`filesSymlink`):e.path,onClick:t=>{if(s&&(t.metaKey||t.ctrlKey)){ae(!0),pt(e);return}n?(M(e.path),rt?(_(``),y([`.`,...e.path.split(`/`).map((e,t,n)=>n.slice(0,t+1).join(`/`))])):_t(e.path)):(M(e.path.includes(`/`)?e.path.slice(0,e.path.lastIndexOf(`/`)):`.`),o(e.path),p?.open(encodeURI(e.path),void 0,t.currentTarget))},children:[n?i?(0,q.jsx)(is,{className:`file-chevron`,"aria-hidden":`true`}):(0,q.jsx)(os,{className:`file-chevron`,"aria-hidden":`true`}):(0,q.jsx)(`span`,{className:`file-chevron`}),(0,q.jsx)(oJ,{name:e.name,kind:e.kind,expanded:i}),(0,q.jsxs)(`span`,{className:`file-tree-name`,children:[e.name,rt&&(0,q.jsx)(`small`,{children:e.path})]})]}),(0,q.jsx)(yo,{button:{label:f(`filesPathActions`,{name:e.name}),icon:(0,q.jsx)(Ds,{"aria-hidden":`true`}),isIconOnly:!0,size:`sm`,variant:`ghost`,className:`file-path-actions`},items:[{label:f(`filesCopyRelativePath`),onClick:()=>void gt(e.path,!1)},{label:f(`filesCopyAbsolutePath`),onClick:()=>void gt(e.path,!0)},{label:f(`filesRename`),isDisabled:!s||z,onClick:()=>mt([e],!0)},{label:f(`filesMove`),isDisabled:!s||z,onClick:()=>mt([e])},{label:f(`filesTrashAction`),isDisabled:!s||z,onClick:()=>void ut(`trash`,[e])}],menuWidth:200,alignment:`end`,hasChevron:!1})]}),!rt&&n&&i&&(0,q.jsxs)(`ul`,{children:[b[e.path]?xt(b[e.path].entries,t+1):(0,q.jsx)(`li`,{className:`file-tree-note`,children:f(`readingFile`)}),yt(e.path,b[e.path])]})]},e.path)});return(0,q.jsxs)(`aside`,{className:`file-explorer`,"aria-label":f(`filesExplorer`),"data-drag-over":G||void 0,children:[(0,q.jsxs)(`div`,{className:`file-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{value:g,onChange:e=>_(e.currentTarget.value.slice(0,200)),placeholder:f(`filesSearch`),"aria-label":f(`filesSearch`)}),(0,q.jsx)(`span`,{className:`file-search-progress`,"aria-hidden":`true`,"data-loading":E||void 0}),(0,q.jsx)(V,{content:f(`refreshFiles`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":f(`refreshFiles`),onClick:()=>k(e=>e+1),disabled:E,children:(0,q.jsx)(me,{"aria-hidden":`true`})})})]}),(0,q.jsxs)(`div`,{className:`file-create-toolbar`,children:[(0,q.jsxs)(`fieldset`,{className:`file-write-actions`,"aria-label":f(`filesWorkspaceActions`),children:[(0,q.jsx)(yo,{button:{ref:Re,label:f(`filesCreateMenu`),variant:`ghost`,className:`file-toolbar-button`,tooltip:r&&!z?f(`filesCreateMenu`):void 0,isDisabled:!r||z},items:[`create-file`,`create-directory`].map(e=>({label:f(e===`create-file`?`filesNewFile`:`filesNewDirectory`),icon:e===`create-file`?(0,q.jsx)(Ps,{"aria-hidden":`true`}):(0,q.jsx)(Bs,{"aria-hidden":`true`}),isDisabled:!r||z,onClick:()=>{P(e),I(``),L(null)}})),menuWidth:190}),(0,q.jsx)(yo,{button:{label:f(`filesImportMenu`),variant:`ghost`,className:`file-toolbar-button`,tooltip:r&&!z?f(`filesImportMenu`):void 0,isDisabled:!r||z},items:[{label:f(`filesImport`),icon:(0,q.jsx)(Kc,{"aria-hidden":`true`}),isDisabled:!r||z,onClick:()=>Pe.current?.click()},{label:f(`filesImportFolder`),icon:(0,q.jsx)(Rs,{"aria-hidden":`true`}),isDisabled:!r||z,onClick:()=>Fe.current?.click()}],menuWidth:190}),(0,q.jsx)(`input`,{ref:Pe,type:`file`,multiple:!0,hidden:!0,"aria-label":f(`filesImportChoose`),onChange:e=>{lt([...e.currentTarget.files??[]]),e.currentTarget.value=``}}),(0,q.jsx)(`input`,{ref:Fe,type:`file`,multiple:!0,hidden:!0,"aria-label":f(`filesImportFolderChoose`),onChange:e=>{lt([...e.currentTarget.files??[]]),e.currentTarget.value=``}}),(0,q.jsxs)(yo,{button:{label:f(`filesMoreMenu`),variant:`ghost`,className:`file-toolbar-button`,tooltip:f(`filesMoreMenu`)},menuWidth:210,children:[(0,q.jsx)(Ro,{label:f(`filesSelectMultiple`),icon:(0,q.jsx)($s,{"aria-hidden":`true`}),value:ie,isDisabled:!r||z,hasCloseOnSelect:!0,onChange:e=>{ae(e),se([])}}),(0,q.jsx)(Ro,{label:f(`filesTrash`),icon:(0,q.jsx)(Uc,{"aria-hidden":`true`}),value:ve,hasCloseOnSelect:!0,onChange:ye})]})]}),(0,q.jsxs)(`p`,{className:`file-write-directory`,title:j,children:[(0,q.jsxs)(`span`,{children:[f(`filesTargetDirectory`),`:`,` `,j===`.`?f(`filesWorkspaceRoot`):j]}),j!==`.`&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>M(`.`),children:f(`filesWorkspaceRoot`)})]})]}),ie&&(0,q.jsxs)(`div`,{className:`file-organization-bar`,children:[(0,q.jsx)(`span`,{children:f(`filesSelectedCount`,{count:oe.length})}),(0,q.jsx)(`button`,{type:`button`,disabled:!oe.length||z||!r,onClick:()=>mt(oe),children:f(`filesMove`)}),(0,q.jsx)(`button`,{type:`button`,disabled:!oe.length||z||!r,onClick:()=>void ut(`trash`,oe),children:f(`filesTrashAction`)})]}),ce&&(0,q.jsxs)(`form`,{className:`file-create-form`,onSubmit:e=>{e.preventDefault(),(!ce.rename||fe.trim())&&ut(`move`,ce.entries)},children:[(0,q.jsxs)(`label`,{children:[f(ce.rename?`filesRename`:`filesMoveDestination`),(0,q.jsx)(`input`,{ref:Le,value:ce.rename?fe:H,"aria-label":f(ce.rename?`filesNewName`:`filesMoveDestination`),disabled:z,onChange:e=>ce.rename?pe(e.currentTarget.value):ue(e.currentTarget.value)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`button`,{type:`submit`,disabled:z||!r,children:f(ce.rename?`filesRename`:`filesMove`)}),(0,q.jsx)(`button`,{type:`button`,disabled:z,onClick:()=>le(null),children:f(`cancel`)})]})]}),he.length>0&&(0,q.jsxs)(`div`,{className:`file-import-results`,children:[(0,q.jsx)(`ol`,{"aria-label":f(`filesOrganizationResults`),"aria-live":`polite`,children:he.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`span`,{children:e.path}),(0,q.jsx)(`small`,{role:e.error?`alert`:void 0,children:e.error??f(`filesOperationDone`)})]},e.path))}),ke.length>0&&(0,q.jsx)(`button`,{type:`button`,disabled:z||!r,onClick:()=>void dt(ke),children:f(`filesUndoTrash`)})]}),ve&&(0,q.jsxs)(`section`,{className:`file-trash-list`,"aria-label":f(`filesTrash`),children:[(0,q.jsx)(`p`,{children:f(`filesTrashDetail`)}),Ce>0&&(0,q.jsx)(`p`,{role:`alert`,children:f(`filesTrashUnavailable`,{count:Ce})}),Te&&xe.length===0?(0,q.jsx)(`p`,{children:f(`readingFile`)}):xe.length===0?(0,q.jsx)(`p`,{children:f(`filesTrashEmpty`)}):(0,q.jsx)(`ul`,{children:xe.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`span`,{title:e.path,children:e.path}),(0,q.jsx)(`button`,{type:`button`,disabled:!r||z,"aria-label":f(`filesRestoreItem`,{name:e.path}),onClick:()=>void dt([e]),children:f(`filesRestore`)})]},e.id))}),U&&(0,q.jsx)(`button`,{type:`button`,disabled:Te,onClick:()=>void ft(),children:f(`filesLoadMore`)})]}),N&&(0,q.jsxs)(`form`,{className:`file-create-form`,onSubmit:e=>void st(e),onKeyDown:e=>{e.key===`Escape`&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.stopPropagation(),ot())},children:[(0,q.jsxs)(`label`,{children:[f(N===`create-file`?`filesFileName`:`filesDirectoryName`),(0,q.jsx)(`input`,{ref:Ie,value:F,maxLength:255,disabled:z,"aria-invalid":!!(ee&&R),onChange:e=>I(e.currentTarget.value)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`button`,{type:`submit`,disabled:!r||z,children:f(z?`filesCreating`:`filesCreate`)}),(0,q.jsx)(`button`,{type:`button`,disabled:z,onClick:ot,children:f(`cancel`)})]})]}),ee&&(0,q.jsx)(`p`,{className:`file-tree-note${R?` evidence-warning`:``}`,role:R?`alert`:`status`,children:ee}),ne.length>0&&(0,q.jsxs)(`div`,{className:`file-import-results`,children:[(0,q.jsx)(`p`,{children:f(`filesImportLimit`)}),(0,q.jsx)(`ol`,{"aria-label":f(`filesImportResults`),"aria-live":`polite`,children:ne.map(e=>(0,q.jsxs)(`li`,{"data-import-state":e.state,children:[(0,q.jsx)(`span`,{title:`${e.directory}/${e.name}`,children:e.name}),(0,q.jsx)(`small`,{children:e.message??f(e.state===`running`?`filesImporting`:`filesImportPending`)}),e.state===`error`&&(e.file||e.kind===`directory`)&&(0,q.jsx)(`button`,{type:`button`,disabled:!r||z,onClick:()=>void ct([e]),children:f(`filesRetryImport`)})]},e.id))}),(0,q.jsx)(`button`,{type:`button`,disabled:z,onClick:()=>re(e=>e.filter(e=>e.state!==`done`)),children:f(`filesClearImported`)})]}),(0,q.jsx)(`span`,{className:`sr-only`,role:`status`,children:Me}),w&&a&&(0,q.jsxs)(`div`,{className:`file-tree-note file-tree-error`,role:`alert`,children:[(0,q.jsx)(`p`,{children:w.message}),w.detail&&(0,q.jsxs)(`details`,{children:[(0,q.jsx)(`summary`,{children:f(`filesErrorDetails`)}),(0,q.jsx)(`p`,{children:w.detail})]}),(0,q.jsx)(`button`,{type:`button`,disabled:E,onClick:()=>k(e=>e+1),children:f(E?`readingFile`:`filesRetryRead`)})]}),(0,q.jsxs)(`section`,{className:`file-tree`,"aria-label":f(`filesExplorer`),ref:qe,onKeyDown:bt,onScroll:e=>{m?.files&&(m.files.treeScroll=e.currentTarget.scrollTop)},"aria-busy":E,children:[(0,q.jsxs)(`ul`,{children:[xt(rt?S?.entries??[]:b[`.`]?.entries??[]),yt(`.`,rt?S:b[`.`])]}),(rt?S?.truncated:b[`.`]?.truncated)&&(0,q.jsx)(`p`,{className:`file-tree-note`,children:f(`filesTruncated`)}),!E&&!w&&(rt?S?.entries.length===0:b[`.`]?.entries.length===0)&&(0,q.jsx)(`p`,{className:`file-tree-note`,children:f(rt?`filesNoMatches`:`filesEmpty`)})]})]})}function cJ({sessionId:e,sessionPath:t,cwd:n,active:r,canWrite:i=!0}){let{t:a}=W(),o=be(),[s,c]=(0,K.useState)(o?.files?.selected??``),[l,u]=(0,K.useState)(o?.files?.treeVisible??!0),[d,f]=(0,K.useState)({error:null,loading:!0}),[p,m]=(0,K.useState)(0),h=(0,K.useRef)(null),g=(0,K.useRef)(null);return(0,K.useLayoutEffect)(()=>{o&&(o.files={query:``,expanded:[`.`],treeScroll:0,...o.files,selected:s,treeVisible:l})},[o,s,l]),(0,q.jsx)(`div`,{ref:h,className:`files-workspace`,"data-tree-visible":l,"data-preview-open":!!s,children:(0,q.jsxs)(FD,{ref:g,sessionId:e,sessionPath:t,embedded:!0,active:r,onClose:()=>{c(``),u(!0)},children:[(0,q.jsx)(V,{content:a(l?`filesHideTree`:`filesShowTree`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`files-tree-toggle icon-button`,"aria-label":a(l?`filesHideTree`:`filesShowTree`),"aria-pressed":l,onClick:()=>u(e=>!e),children:l?(0,q.jsx)(zs,{"aria-hidden":`true`}):(0,q.jsx)(Vs,{"aria-hidden":`true`})})}),!s&&(0,q.jsxs)(`div`,{className:`files-empty-header`,title:n,children:[(0,q.jsx)(zs,{"aria-hidden":`true`}),n.split(/[\\/]/u).filter(Boolean).at(-1)||n]}),!s&&(0,q.jsxs)(`div`,{className:`files-preview-empty`,children:[d.error?(0,q.jsx)(Wc,{"aria-hidden":`true`}):(0,q.jsx)(Fs,{"aria-hidden":`true`}),(0,q.jsx)(`h3`,{children:a(d.error?`filesReadFailed`:d.loading?`readingFile`:`filesChoose`)}),d.error?(0,q.jsxs)(`div`,{className:`files-read-failure`,role:`alert`,children:[(0,q.jsx)(`p`,{children:d.error.message}),d.error.detail&&(0,q.jsxs)(`details`,{children:[(0,q.jsx)(`summary`,{children:a(`filesErrorDetails`)}),(0,q.jsx)(`p`,{children:d.error.detail})]})]}):d.loading?null:(0,q.jsx)(`p`,{role:`status`,children:a(`filesChooseDetail`)}),d.error&&(0,q.jsxs)(`button`,{type:`button`,disabled:d.loading,onClick:()=>{u(!0),m(e=>e+1)},children:[(0,q.jsx)(me,{"aria-hidden":`true`}),a(d.loading?`readingFile`:`filesRetryRead`)]})]}),(0,q.jsx)(`div`,{className:`files-tree-container`,hidden:!l,children:(0,q.jsx)(sJ,{sessionId:e,sessionPath:t,cwd:n,canWrite:i,active:r&&l,selected:s,onSelect:c,dropTarget:h,onShowTree:u,onReadStateChange:f,refreshRequest:p,onRemoved:e=>{e.some(e=>e===s||s.startsWith(`${e}/`))&&g.current?.close({restoreFocus:!1})}},JSON.stringify([e,t,n]))})]})})}var lJ=(0,K.createContext)(null);lJ.displayName=`CollapsibleGroupContext`;var uJ=(0,K.createContext)(null);uJ.displayName=`CollapsibleGroupPresentationContext`;function dJ(e){let{isCollapsible:t,value:n}=e,r=(0,K.use)(lJ),i=r!=null&&n!=null,a=t===!0?{}:t||null,o=a!=null,[s,c]=(0,K.useState)(()=>i?!0:a?.isOpen===void 0?a?.defaultIsOpen??!0:a.isOpen),l;return l=i&&n!=null?r.isOpen(n):a?.isOpen===void 0?s:a.isOpen,{isEnabled:o,isOpen:l,toggle:()=>{if(i&&n!=null){r.toggle(n);return}let e=!l;a?.isOpen===void 0&&c(e),a?.onOpenChange?.(e)}}}var fJ={info:`info`,warning:`warning`,error:`error`,success:`success`},pJ={info:`status`,warning:`alert`,error:`alert`,success:`status`},mJ=`status`,hJ={info:`accent`,warning:`warning`,error:`error`,success:`success`},gJ={root:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kMv6JI:`xjb2p0i`,$$css:!0},rootElevatedCard:{kaIpWk:`x1vf2byn`,$$css:!0},header:{k1xSpc:`x78zum5`,kGNEyG:`x1cy8zhl`,kwnvtZ:`x1a02dak`,k1C7PZ:`xak3so`,khm7nJ:`x4olc9o`,k8WAf4:`x8o8v82`,kg3NbH:`x1pzlopt`,$$css:!0},headerCardStandalone:{kaIpWk:`x1vf2byn`,$$css:!0},headerCardWithContent:{krdFHd:`xwxb7qi`,kfmiAY:`x13nour3`,kVL7Gh:`xbiv7yw`,kT0f0o:`x16uus16`,$$css:!0},headerCentered:{kGNEyG:`x6s0dn4`,$$css:!0},endArea:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kwnvtZ:`x1a02dak`,kjj79g:`x13a6bvl`,kOIVth:`x1txdalj`,kmuXW:`x2lah0s`,ks0D6T:`x193iq5w`,keTefX:`xvc5jky`,kqGvvJ:`x81ka23`,$$css:!0},chevron:{k1ekBW:`x11xpdln`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,$$css:!0},chevronExpanded:{k3aq6I:`x19jd1h0`,$$css:!0}},_J={info:{kWkggS:`xgcxg3y`,$$css:!0},warning:{kWkggS:`x24i8r5`,$$css:!0},error:{kWkggS:`x1pritpl`,$$css:!0},success:{kWkggS:`xu13z74`,$$css:!0}};function vJ(e){return Object.prototype.hasOwnProperty.call(_J,e)}var yJ={none:{kGVxlE:`x1gnnqk1`,$$css:!0},low:{kGVxlE:`x1i5ehqx`,$$css:!0},med:{kGVxlE:`x14hfi27`,$$css:!0},high:{kGVxlE:`x1kcpxr7`,$$css:!0}};function bJ({status:e,title:t,description:n,icon:r,isDismissable:i=!1,onDismiss:a,dismissLabel:o,endContent:s,container:c=`card`,elevation:l=`none`,collapsible:u=!0,children:d,xstyle:f,className:m,style:h,ref:g,onFocusCapture:_,onPointerDownCapture:v,...y}){let b=jr(),[x,S]=(0,K.useState)(!1),C=typeof u==`object`&&u?u:{},{isEnabled:T,isOpen:E,toggle:D}=dJ({isCollapsible:u!==!1&&{...C,defaultIsOpen:C.defaultIsOpen??!1}}),k=(0,K.useRef)(null),A=(0,K.useId)(),j=fJ[e],M=pJ[e]??mJ,N=hJ[e],P=mt(d),F=b(`@astryx.banner.dismiss`),I=o??F,ee=o??(typeof t==`string`?b(`@astryx.banner.dismissTitled`,{dismiss:F,title:t}):F);if(x)return null;let L=(e,t)=>{e instanceof HTMLElement&&e!==document.body&&!t.contains(e)&&(k.current=e)},R=e=>{L(e.relatedTarget,e.currentTarget)},te=e=>{L(document.activeElement,e.currentTarget)},z=()=>{let e=k.current;S(!0),a?.(),e?.isConnected&&e.focus()},B=T&&P,ne=mt(s)||i||B,re=mt(s)||i,V=!mt(n)&&re,ie=P&&(!T||E),ae=c===`card`;return(0,q.jsxs)(`div`,{ref:g,role:M,onFocusCapture:pt(_,R),onPointerDownCapture:pt(v,te),...H(w(gJ.root,yJ[l],ae&&l!==`none`&&gJ.rootElevatedCard,f),m,h),...y,children:[(0,q.jsxs)(`div`,{...H(O(`banner`,{container:c,status:e}),w(gJ.header,V&&gJ.headerCentered,vJ(e)&&_J[e],ae&&(ie?gJ.headerCardWithContent:gJ.headerCardStandalone))),children:[(0,q.jsx)(`div`,{...mt(r)?H(O(`banner-icon`,{status:e}),{className:`x78zum5 x6s0dn4 x2lah0s`}):{className:`x78zum5 x6s0dn4 x2lah0s`},"aria-hidden":`true`,children:mt(r)?r:j==null?null:(0,q.jsx)(ya,{icon:j,size:`md`,color:N,...O(`banner-icon`,{status:e})})}),(0,q.jsxs)(`div`,{...{0:{className:`x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli`},1:{className:`x78zum5 xdt5ytf xxhr3t x98rzlu xeuugli xgualba`}}[!!mt(s)<<0],children:[(0,q.jsx)(`div`,{className:`x1ghz6dp xjb2p0i xcr08ib x2mo6ok x1kq96og x1tgivj0 xj0a0fe`,children:t}),mt(n)&&(0,q.jsx)(`div`,{className:`x1ghz6dp xjb2p0i x141an7d x1sodnla x1ltkj2j xv1l7n4 xj0a0fe`,children:n})]}),ne&&(0,q.jsxs)(`div`,{...w(gJ.endArea,Yt.inset(p[`--spacing-2`])),children:[s,B&&(0,q.jsx)(Br,{variant:`ghost`,size:`sm`,label:b(E?`@astryx.banner.collapse`:`@astryx.banner.expand`),tooltip:b(E?`@astryx.banner.collapse`:`@astryx.banner.expand`),icon:(0,q.jsx)(ya,{icon:`chevronDown`,size:`sm`,color:`inherit`,xstyle:[gJ.chevron,E&&gJ.chevronExpanded]}),onClick:D,"aria-expanded":E,"aria-controls":ie?A:void 0,isIconOnly:!0}),i&&(0,q.jsx)(Br,{variant:`ghost`,size:`sm`,label:ee,tooltip:I,icon:(0,q.jsx)(ya,{icon:`close`,size:`sm`,color:`inherit`}),onClick:z,isIconOnly:!0})]})]}),ie&&(0,q.jsx)(`div`,{id:B?A:void 0,...H(O(`banner-content`,{container:c,status:e}),{0:{className:`x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh`},1:{className:`x1de1mus x8o8v82 x1pzlopt xgbv0en xw8tdv1 x92x3c3 x1t7ytsu x18b5jzi x1q0q8m5 x1j92z86 x1gejf6u xw8gpjh x1k5g1gk x1eprgri`}}[!!ae<<0]),children:d})]})}bJ.displayName=`Banner`;var xJ={container:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,k9WMMc:`x2b8uid`,kOIVth:`x18g69wz`,k8WAf4:`xmfvnks`,kg3NbH:`xm7rs69`,$$css:!0},containerCompact:{kOIVth:`x1txdalj`,k8WAf4:`x1na6nto`,kg3NbH:`x1pzlopt`,$$css:!0}};function SJ({title:e,description:t,icon:n,actions:r,headingLevel:i=3,isCompact:a=!1,xstyle:o,className:s,style:c,ref:l,...u}){let d=`h${i}`;return(0,q.jsxs)(`div`,{ref:l,...u,role:`status`,...H(O(`empty-state`,{variant:a?`compact`:null}),w(xJ.container,a&&xJ.containerCompact,o),s,c),children:[n!=null&&(0,q.jsx)(`div`,{"aria-hidden":`true`,children:n}),(0,q.jsxs)(`div`,{className:`x78zum5 xdt5ytf x6s0dn4 xxc7z9f`,children:[(0,K.createElement)(d,H(O(`empty-state-title`,{variant:a?`compact`:null}),{0:{className:`x1ghz6dp xjb2p0i x18juvz8 x2mo6ok xf74fhv x1tgivj0`},1:{className:`x1ghz6dp xjb2p0i x2mo6ok xf74fhv x1tgivj0 xcr08ib`}}[!!a<<0]),e),t!=null&&(0,q.jsx)(`div`,{...H(O(`empty-state-description`,{variant:a?`compact`:null}),{0:{className:`x1ghz6dp xjb2p0i xjm74w1 x1sodnla xw6l6zx xv1l7n4`},1:{className:`x1ghz6dp xjb2p0i x1sodnla xw6l6zx xv1l7n4 x141an7d`}}[!!a<<0]),children:t})]}),r!=null&&(0,q.jsx)(`div`,{...{0:{className:`x78zum5 x1q0g3np x6s0dn4 x1txdalj xcsaf9d`},1:{className:`x78zum5 x6s0dn4 x1txdalj xcsaf9d xdt5ytf`}}[!!a<<0],children:r})]})}SJ.displayName=`EmptyState`;var CJ=1e3,wJ=100,TJ={root:{kWkggS:`xprdx6m x1j0df82 x1o55y2u`,kSiTet:`xvpkmg4 x1tbh5bv`,$$css:!0},animate:{kILWW9:`xpz12be`,k44tkh:`xqgcaz`,ko0y90:`xa4qsjk`,kKVMdj:`xeuoslp x1aquc0h`,kyAemX:`x193epu2`,$$css:!0}},EJ={0:{kaIpWk:`xwksslw`,$$css:!0},1:{kaIpWk:`xx3sua9`,$$css:!0},2:{kaIpWk:`xh6dtrn`,$$css:!0},3:{kaIpWk:`x1hviunn`,$$css:!0},4:{kaIpWk:`x1hviunn`,$$css:!0},none:{kaIpWk:`x2u8bby`,$$css:!0},rounded:{kaIpWk:`xjspbzw`,$$css:!0}},DJ={kKxzle:`xvo38ju`,$$css:!0},OJ={animationDelay:e=>[DJ,{"--x-animationDelay":(e=>typeof e==`number`?e+`ms`:e??void 0)(`${CJ+wJ*e}ms`)}],dimensions:(e,t)=>[{kzqmXN:(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`x5lhr3w`,kZKoxP:(typeof t==`number`?`${t}px`:t)==null?typeof t==`number`?`${t}px`:t:`x16ye13r`,$$css:!0},{"--x-width":(e=>typeof e==`number`?e+`px`:e??void 0)(typeof e==`number`?`${e}px`:e),"--x-height":(e=>typeof e==`number`?e+`px`:e??void 0)(typeof t==`number`?`${t}px`:t)}]};function kJ({width:e=`100%`,height:t=`100%`,radius:n=3,index:r=0,"data-testid":i,xstyle:a,className:o,style:s,ref:c,...l}){return(0,q.jsx)(`div`,{ref:c,"aria-hidden":`true`,"data-testid":i,...H(O(`skeleton`),w(TJ.root,TJ.animate,EJ[n],OJ.dimensions(e,t),OJ.animationDelay(r),a),o,s),...l})}kJ.displayName=`Skeleton`;function AJ({branches:e,value:t,loading:n,onChange:r}){let{t:i}=W(),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(!1),l=(0,K.useRef)(null),u=(0,K.useRef)([]),d=(0,K.useRef)(null),f=(0,K.useId)(),p=e.options.filter(e=>`${e.label} ${e.ref}`.toLocaleLowerCase().includes(a.toLocaleLowerCase()));(0,K.useEffect)(()=>{if(!s)return;let e=requestAnimationFrame(()=>l.current?.focus());return()=>cancelAnimationFrame(e)},[s]),(0,K.useEffect)(()=>{if(!s)return;let e=e=>{let t=e.target;d.current=t instanceof Element&&!t.closest(`.review-base-picker, .review-base-popup`)?t.closest(`button:not(:disabled), input:not(:disabled), textarea:not(:disabled), select:not(:disabled), a[href], [tabindex], [contenteditable='true']`):null};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[s]);let m=e.options.find(e=>e.ref===t)?.label??t;return(0,q.jsx)(ok,{className:`review-base-picker`,label:i(`gitReviewBaseBranch`),isLabelHidden:!0,value:t??``,triggerLabel:(0,q.jsx)(`span`,{className:`review-base-label`,title:t,children:m||i(`gitReviewChooseBase`)}),variant:`ghost`,size:`sm`,isDisabled:e.options.length===0,isLoading:n,onOpenChange:e=>{c(e),e||(o(``),d.current?.isConnected&&d.current.focus({preventScroll:!0}),d.current=null)},children:(s,c,d)=>(0,q.jsxs)(`div`,{className:`review-base-popup`,children:[(0,q.jsxs)(`label`,{className:`review-base-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`sr-only`,children:i(`gitReviewSearchBranches`)}),(0,q.jsx)(`input`,{ref:l,type:`search`,value:a,"aria-controls":f,placeholder:i(`gitReviewSearchBranches`),onChange:e=>o(e.currentTarget.value),onKeyDown:e=>{e.nativeEvent.isComposing||e.keyCode===229||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),d()):e.key===`ArrowDown`&&p.length&&!n&&(e.preventDefault(),u.current[0]?.focus()))}})]}),e.truncated&&(0,q.jsx)(`p`,{role:`status`,children:i(`gitReviewBranchesTruncated`)}),(0,q.jsxs)(`div`,{id:f,role:`listbox`,"aria-label":i(`gitReviewBaseBranch`),className:`review-base-options`,children:[p.map((e,a)=>(0,q.jsxs)(`button`,{type:`button`,disabled:n,role:`option`,"aria-selected":t===e.ref,title:e.ref,ref:e=>{u.current[a]=e},onClick:()=>{r(e.ref),d()},onKeyDown:e=>{if(!(e.nativeEvent.isComposing||e.keyCode===229)){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),d();else if(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?0:e.key===`End`?p.length-1:(a+(e.key===`ArrowDown`?1:p.length-1))%p.length;u.current[t]?.focus()}}},children:[(0,q.jsxs)(`span`,{children:[e.label,(0,q.jsx)(`small`,{children:e.ref.startsWith(`refs/heads/`)?i(`gitReviewLocalBranch`):i(`gitReviewRemoteBranch`)})]}),t===e.ref&&(0,q.jsx)(rs,{"aria-hidden":`true`})]},e.ref)),!p.length&&(0,q.jsx)(`p`,{role:`status`,children:i(`gitReviewNoMatchingBranches`)})]})]})})}function jJ(e,t){return{path:e,name:t,directories:new Map,files:[]}}function MJ({files:e,selectedPath:t,collapsed:n,searching:r,onToggle:i,onSelect:a,viewed:o,onViewedChange:s,viewedLimitReached:c=!1}){let{t:l}=W(),u=(0,K.useMemo)(()=>{let t=jJ(``,``);for(let n of e){let e=t;for(let t of n.path.split(`/`).slice(0,-1)){let n=e.path?`${e.path}/${t}`:t,r=e.directories.get(t);r||(r=jJ(n,t),e.directories.set(t,r)),e=r}e.files.push(n)}return t},[e]),d=(e,u)=>(0,q.jsxs)(`ul`,{children:[[...e.directories.values()].map(e=>{let t=e,a=t.name;for(;t.files.length===0&&t.directories.size===1;){let e=t.directories.values().next().value;if(!e)break;t=e,a+=`/${t.name}`}let o=t.path,s=r||!n.has(o);return(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`button`,{type:`button`,className:`review-tree-directory`,style:{paddingLeft:8+u*10},title:o,"aria-expanded":s,disabled:r,onClick:()=>i(o),children:[(0,q.jsx)(os,{"aria-hidden":`true`,"data-open":s}),(0,q.jsx)(`span`,{children:a})]}),s&&d(t,u+1)]},e.path)}),e.files.map(e=>{let n=e.path.split(`/`).at(-1)??e.path,r=/\.(png|jpe?g|gif|webp|svg)$/iu.test(n)?qs:/\.(md|txt|log)$/iu.test(n)?Fs:js;return(0,q.jsxs)(`li`,{className:`review-tree-file-row`,children:[(0,q.jsxs)(`button`,{className:`session-review-file review-tree-file`,type:`button`,style:{paddingLeft:8+u*10},"data-review-file":e.path,title:e.path,"aria-label":e.path,"aria-description":l(`gitFileStatus_${e.status}`),"aria-current":t===e.path?`true`:void 0,onClick:()=>a(e.path),children:[(0,q.jsx)(r,{"aria-hidden":`true`,className:`review-tree-icon`}),(0,q.jsx)(`span`,{className:`review-tree-name`,children:n}),(0,q.jsx)(`span`,{className:`review-tree-status`,"aria-hidden":`true`,children:l(`gitFileStatus_${e.status}`)}),(0,q.jsx)(`span`,{className:`session-review-stats`,"aria-hidden":`true`,children:e.binary?(0,q.jsx)(`span`,{children:l(`gitReviewBinaryShort`)}):e.statsUnavailable?(0,q.jsx)(`span`,{title:l(`turnEditStatsUnknown`),children:`—`}):(0,q.jsxs)(q.Fragment,{children:[e.additions>0&&(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,e.additions]}),e.deletions>0&&(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`-`,e.deletions]})]})})]}),s&&(0,q.jsx)(`label`,{className:`review-viewed-control`,title:l(`gitReviewMarkViewed`,{path:e.path}),children:(0,q.jsx)(`input`,{type:`checkbox`,"aria-label":l(`gitReviewMarkViewed`,{path:e.path}),checked:o?.has(e.path)??!1,disabled:c&&!o?.has(e.path),onChange:t=>s(e.path,t.currentTarget.checked)})})]},e.path)})]});return(0,q.jsx)(`div`,{className:`session-review-list review-file-tree`,children:d(u,0)})}var NJ=20,PJ=200,FJ=[0,1,2,3];function IJ(e){return e.split(/[\\/]/u).at(-1)||e}function LJ(e,t){return e?e.reason===`not_git_repository`?t(`gitReviewNotRepository`):e.reason===`unborn_repository`?t(`gitReviewUnborn`):e.reason===`baseline_unavailable`?t(`gitReviewBaselineUnavailable`):e.reason===`base_branch_unavailable`?t(`gitReviewBaseUnavailable`):e.reason===`invalid_base_branch`?t(`gitReviewBaseInvalid`):t(`gitReviewFailed`):null}function RJ({review:e,initialFilePath:t,onClose:n,onOpenTools:r,embedded:i=!1,active:a=!0,onOpenFiles:o,readingScope:s,onReferenceLine:c}){let{t:l}=W(),u=be(),d=(0,K.useRef)(void 0);e.result?.branches?d.current=e.result.branches:e.result&&!e.loading&&(d.current=void 0);let f=e.result?.branches??(e.loading?d.current:void 0),p=`${s??e.source??`unstaged`}:${e.baseRef??``}`,m=u?.review?.scope===p?u.review:void 0,h=(0,K.useRef)(JSON.stringify([p,t])),g=(0,K.useRef)(null),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(new Set(m?.collapsedDirectories));(0,K.useEffect)(()=>{let e=g.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(([e])=>{e&&v(e.contentRect.width>=720)});return t.observe(e),()=>t.disconnect()},[]);let x=(0,K.useRef)(null),S=(0,K.useRef)(null),C=(0,K.useRef)(null),w=(0,K.useRef)(!0),T=(0,K.useRef)(!1),E=(0,K.useRef)(m?.listScroll??null),D=(0,K.useRef)(null),[O,k]=(0,K.useState)(m?.visibleFiles??NJ),[A,j]=(0,K.useState)(m?.query??``),[M,N]=(0,K.useState)(null),[P,F]=(0,K.useState)(m?m.selected:t??null),[I,ee]=(0,K.useState)(()=>m?.viewed?{scope:p,revision:m.viewed.revision,paths:new Set(m.viewed.paths.slice(0,PJ))}:null),L=(0,K.useRef)(m?{list:m.listScroll,preview:m.previewScroll}:null);(0,K.useLayoutEffect)(()=>{u&&(u.review={source:e.source??`unstaged`,baseRef:e.baseRef,scope:p,selected:P,query:A,collapsedDirectories:[...y],visibleFiles:O,listScroll:u.review?.scope===p?u.review.listScroll:0,previewScroll:u.review?.scope===p?u.review.previewScroll:0,viewed:I?.scope===p?{revision:I.revision,paths:[...I.paths].slice(0,PJ)}:void 0})},[u,e.source,e.baseRef,p,P,A,y,O,I]);let[R,te]=(0,K.useState)(null),[z,B]=(0,K.useState)(null),[ne,re]=(0,K.useState)(0),[ie,ae]=(0,K.useState)(()=>window.matchMedia?.(`(max-width: 1100px)`).matches??!1);(0,K.useEffect)(()=>{let e=window.matchMedia?.(`(max-width: 1100px)`);if(!e)return;let t=()=>ae(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,K.useEffect)(()=>{let e=JSON.stringify([p,t]);h.current!==e&&(h.current=e,w.current=!!t||!(document.activeElement instanceof Element&&document.activeElement.closest(`.review-base-picker, .review-base-popup`)),E.current=null,F(t??null),j(``),b(new Set),N(null),ee(null))},[t,p]);let oe=i?`section`:ie?`main`:`aside`,se=e.result?.ok?e.result.snapshot:null,ce=!e.historical&&P&&M&&M.comparison===(e.source??se?.comparison)?se?.revision===M.revision?se:M:se,le=!!(P&&ce&&se&&ce.revision!==se.revision);(0,K.useEffect)(()=>{P&&!M&&se&&N(se)},[P,M,se]);let H=e.source??ce?.comparison??`unstaged`,ue=LJ(e.result&&!e.result.ok?e.result:null,l),de=ce?.files.find(e=>e.path===P),fe=R?.source===H&&R?.revision===ce?.revision&&R?.file.path===P?R.file:de,pe=ce?.revision,he=I?.scope===p&&I.revision===pe?I.paths:new Set;(0,K.useEffect)(()=>{pe&&I&&(I.scope!==p||I.revision!==pe)&&ee(null)},[pe,p,I]);let ge=(e,t)=>{!pe||!ce?.files.some(t=>t.path===e)||ee(n=>{let r=new Set(n?.scope===p&&n.revision===pe?n.paths:[]);if(t){if(r.size>=PJ)return n;r.add(e)}else r.delete(e);return{scope:p,revision:pe,paths:r}})};(0,K.useLayoutEffect)(()=>{!a||!ce||!L.current||P&&fe?.diffLoaded===!1||(S.current&&(S.current.scrollTop=L.current.list),C.current&&(C.current.scrollTop=L.current.preview),L.current=null)},[a,ce,P,fe?.diffLoaded]);let _e=z?.source===H&&z?.path===P&&z?.revision===pe&&de?.diffLoaded===!1?z.message:null;(0,K.useEffect)(()=>{let t=de?.path;if(!a||!t||de?.diffLoaded!==!1||!e.readFile||!pe)return;let n=new AbortController;return B(null),e.readFile(t,n.signal,pe).then(e=>{n.signal.aborted||(e?te({source:H,revision:pe,file:e}):B({source:H,path:t,revision:pe,message:l(`gitReviewFileMissing`)}))},e=>{n.signal.aborted||B({source:H,path:t,revision:pe,message:e instanceof Error?e.message:l(`gitReviewFailed`)})}),()=>n.abort()},[de?.path,a,de?.diffLoaded,pe,H,e.readFile,ne,l]);let ve=(0,K.useMemo)(()=>(ce?.files??[]).filter(e=>e.path.toLocaleLowerCase().includes(A.toLocaleLowerCase())).sort((e,t)=>e.path.localeCompare(t.path,`en`,{numeric:!0})),[ce?.files,A]),ye=_?ve:ve.slice(0,O);(0,K.useEffect)(()=>{!_||P||!ce?.files.length||(w.current=!1,F(ce.files[0].path))},[_,P,ce]);let xe=Math.max(0,ve.length-ye.length),Se=ce?.listComplete===!1||ce?.listComplete===void 0&&ce?.truncated,Ce=Se||ce?.nextOffset!==void 0,we=e.historical?l(ce?.evidenceSource===`file-tools`?`turnEditsScope`:`turnChangesScope`):ce?ce.comparison===`session`?l(`gitReviewSessionSnapshot`):ce.comparison===`unstaged`?l(`gitReviewUnstaged`):ce.comparison===`staged`?l(`gitReviewStaged`):ce.baseBranch?l(`gitReviewComparison`,{current:ce.currentBranch??l(`gitReviewDetached`),base:ce.baseBranch.replace(/^refs\/(?:heads|remotes)\//u,``)}):l(`gitReviewWorkingTree`):null;(0,K.useEffect)(()=>{let e=a&&!T.current;T.current=a,a&&(!e&&!w.current||(w.current=!1,P?C.current?.focus():i?S.current?.focus():x.current?.focus()))},[a,i,P]);let Te=e=>{E.current=S.current?.scrollTop??null,e!==P&&(L.current={list:E.current??0,preview:0},C.current&&(C.current.scrollTop=0),u?.review?.scope===p&&(u.review.previewScroll=0)),w.current=!_,N(ce),F(e)};(0,K.useLayoutEffect)(()=>{let e=D.current;if(P||!e||!a)return;D.current=null;let t=S.current;if(!t?.isConnected||t.closest(`[hidden], [inert]`))return;let n=[...t.querySelectorAll(`[data-review-file]`)].find(t=>t.dataset.reviewFile===e);E.current!==null&&(t.scrollTop=E.current),n?n.focus({preventScroll:E.current!==null}):i?t.focus():x.current?.focus()},[a,i,P]);let Ee=()=>{let e=P,t=ve.findIndex(t=>t.path===e);t>=O&&k(Math.ceil((t+1)/NJ)*NJ),w.current=!1,D.current=e,F(null),N(null)};return(0,q.jsxs)(oe,{ref:g,className:`review-panel${i?` embedded`:``}${_?` review-wide`:``}`,"aria-label":l(`changeEvidence`),"aria-busy":e.loading||void 0,onKeyDown:e=>{e.key!==`Escape`||e.nativeEvent.isComposing||e.keyCode===229||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||e.defaultPrevented||(!P||_)&&i||(e.preventDefault(),e.stopPropagation(),P&&!_?Ee():i||n())},children:[(0,q.jsxs)(`div`,{className:`review-source-picker`,children:[e.setSource&&(0,q.jsxs)(`label`,{children:[l(`gitReviewSource`),` `,(0,q.jsxs)(`select`,{value:e.historical?`turn`:e.source??`unstaged`,onChange:t=>e.setSource?.(t.currentTarget.value),children:[e.historical&&(0,q.jsx)(`option`,{value:`turn`,children:l(`turnChangesReview`)}),(0,q.jsx)(`option`,{value:`unstaged`,children:l(`gitReviewUnstaged`)}),(0,q.jsx)(`option`,{value:`staged`,children:l(`gitReviewStaged`)}),(0,q.jsx)(`option`,{value:`branch`,children:l(`gitReviewBranch`)}),(0,q.jsx)(`option`,{value:`session`,children:l(`gitReviewSessionSnapshot`)})]})]}),e.source===`branch`&&e.setBaseRef&&f&&(0,q.jsx)(AJ,{branches:f,value:e.baseRef??(e.result?.ok?e.result.snapshot.baseBranch??void 0:void 0),loading:e.loading,onChange:e.setBaseRef}),we&&(!e.setSource||e.historical||ce?.comparison===`branch`)&&(0,q.jsx)(`span`,{className:`review-source-summary`,title:we,children:we}),(0,q.jsxs)(`div`,{className:`review-source-actions`,children:[o&&(0,q.jsx)(`button`,{type:`button`,onClick:o,children:l(`sessionFileRecords`)}),(0,q.jsx)(V,{content:l(`gitReviewRefresh`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":l(`gitReviewRefresh`),disabled:e.loading,"aria-busy":e.loading||void 0,onClick:()=>{e.loading||e.refresh()},children:(0,q.jsx)(me,{"aria-hidden":`true`})})})]})]}),le&&(0,q.jsxs)(`div`,{className:`review-update`,role:`status`,children:[(0,q.jsx)(`span`,{children:l(`gitReviewNewVersion`)}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{C.current?.focus(),N(se),te(null)},children:l(`gitReviewShowLatest`)})]}),(e.error||ue)&&(0,q.jsx)(bJ,{status:`error`,container:`section`,title:e.error||ue,description:ce?l(`gitReviewOlderResult`):void 0,className:`review-banner`,endContent:(0,q.jsx)(Br,{variant:`ghost`,size:`sm`,label:l(`gitReviewRetry`),isDisabled:e.loading,isLoading:e.loading,onClick:()=>{e.loading||e.refresh()}})}),(0,q.jsxs)(`div`,{className:`review-workspace`,children:[P&&(0,q.jsxs)(`div`,{className:`review-file-screen`,children:[(0,q.jsxs)(`header`,{className:`review-file-header`,children:[!_&&(0,q.jsx)(Br,{label:l(`gitReviewBackToFiles`),variant:`ghost`,size:`sm`,isIconOnly:!0,icon:(0,q.jsx)(Ko,{"aria-hidden":`true`}),onClick:Ee}),(0,q.jsxs)(`div`,{className:`review-file-heading`,children:[(0,q.jsx)(`strong`,{title:P,children:IJ(P)}),(0,q.jsx)(`span`,{title:P,children:P})]}),fe&&pe&&(0,q.jsxs)(`label`,{className:`review-file-viewed`,children:[(0,q.jsx)(`input`,{type:`checkbox`,"aria-label":l(`gitReviewMarkCurrentViewed`,{path:P}),checked:he.has(P),disabled:he.size>=PJ&&!he.has(P),onChange:e=>ge(P,e.currentTarget.checked)}),(0,q.jsx)(`span`,{children:l(`gitReviewViewedLabel`)})]}),!i&&(0,q.jsxs)(`div`,{className:`review-file-actions`,children:[r&&(0,q.jsx)(Br,{label:l(`openTools`),variant:`ghost`,size:`sm`,isIconOnly:!0,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:r}),(0,q.jsx)(Br,{label:l(`close`),variant:`ghost`,size:`sm`,isIconOnly:!0,icon:(0,q.jsx)(je,{"aria-hidden":`true`}),onClick:n})]})]}),(0,q.jsxs)(`div`,{className:`review-file-toolbar`,children:[(0,q.jsx)(`div`,{className:`review-file-context`,children:fe&&(0,q.jsx)(`span`,{children:l(`gitFileStatus_${fe.status}`)})}),(0,q.jsxs)(oj,{gap:2,align:`center`,className:`session-review-stats`,children:[fe&&!fe.binary&&!fe.statsUnavailable&&fe.additions>0&&(0,q.jsxs)(jt,{type:`supporting`,hasTabularNumbers:!0,className:`review-additions`,children:[`+`,fe.additions]}),fe&&!fe.binary&&!fe.statsUnavailable&&fe.deletions>0&&(0,q.jsxs)(jt,{type:`supporting`,hasTabularNumbers:!0,className:`review-deletions`,children:[`-`,fe.deletions]})]})]}),(0,q.jsx)(`section`,{ref:C,className:`review-file-preview`,"aria-label":l(`gitReviewFilePreview`,{file:P}),tabIndex:-1,onScroll:e=>{u?.review&&(u.review.previewScroll=e.currentTarget.scrollTop)},children:fe?_e?(0,q.jsxs)(`div`,{role:`alert`,children:[(0,q.jsx)(`p`,{children:_e}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>re(e=>e+1),children:l(`retryAdmissionCheck`)})]}):fe.diffLoaded===!1&&e.readFile?(0,q.jsx)(`p`,{role:`status`,children:l(`gitReviewLoading`)}):fe.binary?(0,q.jsx)(SJ,{icon:(0,q.jsx)(js,{"aria-hidden":`true`}),title:l(`gitReviewBinary`),isCompact:!0}):fe.statsUnavailable?(0,q.jsx)(SJ,{icon:(0,q.jsx)(js,{"aria-hidden":`true`}),title:l(`turnEditStatsUnknown`),description:l(`turnEditReason_${fe.statsUnavailable}`),isCompact:!0}):fe.diff?(0,q.jsxs)(q.Fragment,{children:[fe.diffTruncated&&(0,q.jsx)(`p`,{className:`review-hidden-lines`,children:l(`gitReviewDiffTruncated`)}),(0,q.jsx)(mK,{file:fe,onReferenceLine:c})]}):(0,q.jsx)(SJ,{icon:(0,q.jsx)(js,{"aria-hidden":`true`}),title:l(fe.diffTruncated?`gitReviewDiffTruncated`:`gitReviewNoDiff`),description:fe.diffTruncated?l(`gitReviewDiffTruncated`):void 0,isCompact:!0}):(0,q.jsx)(`p`,{role:`status`,children:l(e.loading?`gitReviewLoading`:`gitReviewFileMissing`)})})]}),(!P||_)&&(0,q.jsxs)(`div`,{className:`review-navigation`,children:[!i&&!_&&(0,q.jsxs)(`header`,{className:`review-heading`,children:[(0,q.jsx)(`div`,{children:(0,q.jsxs)(`h2`,{children:[(0,q.jsx)(Ms,{"aria-hidden":`true`}),` `,l(`changeEvidence`)]})}),(0,q.jsxs)(`div`,{className:`review-heading-actions`,children:[r&&(0,q.jsx)(V,{content:l(`openTools`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":l(`openTools`),onClick:r,children:(0,q.jsx)(Ae,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:l(`close`),placement:`below`,children:(0,q.jsx)(`button`,{ref:x,type:`button`,className:`icon-button review-close`,"aria-label":l(`close`),onClick:n,children:(0,q.jsx)(je,{"aria-hidden":`true`})})})]})]}),(0,q.jsxs)(`div`,{ref:S,onScroll:e=>{u?.review&&(u.review.listScroll=e.currentTarget.scrollTop)},className:`review-body`,tabIndex:i?-1:void 0,children:[ce&&(0,q.jsxs)(sj,{gap:1,align:`stretch`,className:`review-summary`,children:[(0,q.jsxs)(oj,{gap:3,align:`center`,justify:`between`,children:[(0,q.jsx)(jt,{type:`label`,children:l(Se?`gitReviewLoadedCount`:`filesChanged`,{count:Se?ce.files.length:ce.totalFiles??ce.files.length})}),ce.nextOffset!==void 0&&!Se&&(0,q.jsx)(jt,{type:`supporting`,color:`secondary`,children:l(`gitReviewLoadedCount`,{count:ce.files.length})}),!Se&&!ce.truncated&&ce.nextOffset===void 0&&(ce.additions>0||ce.deletions>0)&&!ce.files.some(e=>e.binary||e.statsUnavailable||e.status===`untracked`&&e.diffLoaded===!1)&&(0,q.jsxs)(oj,{gap:2,align:`center`,className:`review-summary-counts`,"aria-hidden":`true`,children:[ce.additions>0&&(0,q.jsxs)(jt,{type:`supporting`,hasTabularNumbers:!0,className:`review-additions`,children:[`+`,ce.additions]}),ce.deletions>0&&(0,q.jsxs)(jt,{type:`supporting`,hasTabularNumbers:!0,className:`review-deletions`,children:[`-`,ce.deletions]})]})]}),he.size>=PJ&&(0,q.jsx)(jt,{type:`supporting`,color:`secondary`,children:l(`gitReviewViewedLimit`,{count:PJ})})]}),e.loading&&!ce&&(0,q.jsxs)(`div`,{className:`review-loading`,role:`status`,children:[(0,q.jsx)(`span`,{className:`sr-only`,children:l(`gitReviewLoading`)}),(0,q.jsxs)(sj,{gap:2,align:`stretch`,"aria-hidden":`true`,children:[(0,q.jsx)(kJ,{width:`42%`,height:16,radius:`rounded`,index:0}),(0,q.jsx)(`div`,{className:`review-loading-list`,children:FJ.map(e=>(0,q.jsx)(kJ,{width:`100%`,height:36,radius:0,index:e+1},e))})]})]}),ce?.truncated&&(0,q.jsx)(bJ,{status:`info`,title:l(`gitReviewTruncated`),className:`review-banner`}),ce&&ce.files.length>0&&(0,q.jsxs)(`label`,{className:`review-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`sr-only`,children:l(Ce?`gitReviewSearchLoaded`:`gitReviewSearch`)}),(0,q.jsx)(`input`,{type:`search`,value:A,placeholder:l(Ce?`gitReviewSearchLoaded`:`gitReviewSearch`),onChange:e=>{j(e.target.value),k(NJ)}})]}),A&&ve.length===0&&(0,q.jsx)(`p`,{className:`review-search-empty`,role:`status`,children:l(Ce?`gitReviewNoLoadedMatch`:`gitReviewNoMatch`)}),ce&&ce.files.length===0&&(0,q.jsx)(SJ,{icon:(0,q.jsx)(Ws,{"aria-hidden":`true`}),title:l(`gitReviewEmpty`),isCompact:!0,className:`review-empty`}),ye.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(MJ,{files:ye,selectedPath:P,collapsed:y,searching:!!A,onToggle:e=>b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onSelect:Te,viewed:he,onViewedChange:ge,viewedLimitReached:he.size>=PJ}),xe>0&&(0,q.jsx)(`div`,{className:`session-review-more`,children:(0,q.jsx)(Br,{variant:`ghost`,size:`sm`,width:`100%`,label:l(`gitReviewShowMore`,{count:Math.min(NJ,xe)}),onClick:()=>k(e=>Math.min(e+NJ,ve.length))})})]}),ce?.nextOffset!==void 0&&e.loadMore&&(0,q.jsx)(`div`,{className:`session-review-more`,children:(0,q.jsx)(Br,{variant:`ghost`,size:`sm`,width:`100%`,label:l(`gitReviewLoadNext`),isLoading:e.loading,isDisabled:e.loading,onClick:()=>{e.loadMore?.()}})})]})]})]})]})}function zJ(e,t,n,r){let{t:i}=W(),a=(0,K.useMemo)(()=>new de,[]),[o,s]=(0,K.useState)(0),[c,l]=(0,K.useState)({identity:``,result:null,error:null}),u=JSON.stringify([e,t,r,o]);(0,K.useEffect)(()=>{if(!r)return;let o=new AbortController;return a.turnChanges(e,t,r,o.signal).then(t=>{if(o.signal.aborted)return;if(!t.ok||t.changes.sessionId!==e||t.changes.promptEntryId!==r||t.changes.state===`unavailable`){l({identity:u,result:null,error:i(`turnChangesUnavailable`)});return}let a=t.changes;l({identity:u,error:null,result:{ok:!0,snapshot:{...a.source?{evidenceSource:a.source}:{},...a.fileCount===null?{}:{totalFiles:a.fileCount,listComplete:!0},repositoryRoot:n,currentBranch:null,baseBranch:null,comparison:`session`,revision:u,files:a.files,additions:a.additions,deletions:a.deletions,truncated:a.state===`partial`}}})},()=>{o.signal.aborted||l({identity:u,result:null,error:i(`turnChangesUnavailable`)})}),()=>o.abort()},[a,e,t,r,u,n,i]);let d=(0,K.useCallback)(async()=>s(e=>e+1),[]);return{result:c.identity===u?c.result:null,error:c.identity===u?c.error:null,loading:!!r&&c.identity!==u,refresh:d,historical:!0}}function BJ(e,t,n){let r=(0,K.useRef)({onState:t,onOpen:n});r.current={onState:t,onOpen:n};let[i,a]=(0,K.useState)(),[o,s]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{let t=()=>{let e=document.documentElement.dataset.openpiBrowserExtension===`ready`;s(e),e||a(void 0)};t();let n=new MutationObserver(t);n.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-openpi-browser-extension`]});let i=t=>{if(t.source!==window||t.origin!==location.origin)return;let n=t.data;if(!n||n.source!==`openpi-browser-extension`||n.id!==e)return;if(n.type===`lost`){a(void 0);return}if(typeof n.url!=`string`)return;let i=tJ(n.url,location.origin);if(i&&(n.type===`open`&&r.current.onOpen(i),n.type===`state`&&typeof n.title==`string`)){let t={id:e,document:typeof n.document==`string`?n.document:void 0,url:i,title:n.title.slice(0,256),canGoBack:n.canGoBack===!0,canGoForward:n.canGoForward===!0};a(t),r.current.onState(t)}};return window.addEventListener(`message`,i),()=>{n.disconnect(),window.removeEventListener(`message`,i)}},[e]),{ready:o,page:o&&i?.id===e?i:void 0,command:t=>window.postMessage({source:`openpi-browser-ui`,type:`command`,id:e,action:t},location.origin)}}var VJ=8;function HJ({onTitle:e,onOpen:t,initialUrl:n=``,readingId:r}){let{t:i}=W(),a=(0,K.useId)(),o=(0,K.useRef)(null),s=be(),c=s?.browser?.pages[r],[l,u]=(0,K.useState)(c?.draft??n),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)({history:c?.history??(n?[n]:[]),index:c?.index??(n?0:-1),revision:0,loaded:!1,unknown:!1}),h=p.history[p.index],g=(0,K.useRef)(h);(0,K.useLayoutEffect)(()=>{s?.browser&&(s.browser.pages[r]={draft:l,history:p.history.map((e,t)=>t===p.index?g.current??e:e),index:p.index})},[s,r,l,p]);let _=`${a}-${p.revision}`,v=BJ(_,t=>{g.current=t.url;let n=s?.browser?.pages[r];n&&(n.history=n.history.map((e,r)=>r===n.index?t.url:e)),document.activeElement!==o.current&&u(t.url),e(t.title||new URL(t.url).host)},t),y=v.page?.url??h,b=(t,n)=>{let r=t[n];r&&(g.current=r,m(e=>({history:t,index:n,revision:e.revision+1,loaded:!1,unknown:!1})),u(r),f(null),e(new URL(r).host))};return(0,q.jsxs)(`div`,{className:`browser-tool browser-direct-tool`,children:[(0,q.jsxs)(`form`,{className:`browser-toolbar`,onSubmit:e=>{e.preventDefault();let t=tJ(l,window.location.origin);if(!t){f(i(`browserAddressNotAllowed`));return}if(t===h)b(p.history,p.index);else{let e=[...p.history.slice(0,p.index+1),t].slice(-64);b(e,e.length-1)}},children:[(0,q.jsxs)(`div`,{className:`browser-navigation`,children:[(0,q.jsx)(V,{content:i(`browserBack`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":i(`browserBack`),disabled:v.page?!v.page.canGoBack:p.unknown||p.index<=0,onClick:()=>v.page?v.command(`back`):b(p.history,p.index-1),children:(0,q.jsx)(Ko,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:i(`browserForward`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":i(`browserForward`),disabled:v.page?!v.page.canGoForward:p.unknown||p.index>=p.history.length-1,onClick:()=>v.page?v.command(`forward`):b(p.history,p.index+1),children:(0,q.jsx)(qo,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:i(`browserReload`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":i(`browserReload`),disabled:!h,onClick:()=>v.page?v.command(`reload`):b(p.history,p.index),children:(0,q.jsx)(me,{"aria-hidden":`true`})})})]}),(0,q.jsx)(`input`,{ref:o,"aria-label":i(`browserAddress`),title:i(v.page?`browserAddress`:`browserEnteredAddress`),value:l,placeholder:`https://`,spellCheck:!1,onChange:e=>{u(e.currentTarget.value),f(null)}}),(0,q.jsx)(V,{content:i(`browserGo`),placement:`below`,children:(0,q.jsx)(`button`,{type:`submit`,"aria-label":i(`browserGo`),disabled:!l.trim(),children:(0,q.jsx)(qo,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:i(`openExternalBrowser`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":i(`openExternalBrowser`),disabled:!y||!v.page&&p.unknown,onClick:()=>y&&window.open(y,`_blank`,`noopener,noreferrer`),children:(0,q.jsx)(Os,{"aria-hidden":`true`})})})]}),(0,q.jsxs)(`div`,{className:`browser-feedback`,children:[d&&(0,q.jsx)(`p`,{className:`workbar-error`,role:`alert`,children:d}),p.unknown&&!v.page&&(0,q.jsx)(`p`,{className:`browser-notice`,role:`status`,children:i(`browserLocationUnknown`)})]}),(0,q.jsx)(`div`,{className:`browser-direct-viewport`,children:h?(0,q.jsx)(`iframe`,{"data-openpi-browser-page":_,"data-openpi-browser-document":v.page?.document,"data-openpi-browser-url":v.page?.url,"data-openpi-browser-title":v.page?.title,src:h,title:i(`browserPageTitle`,{address:new URL(h).host}),referrerPolicy:`no-referrer`,sandbox:`allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox`,onLoad:()=>m(e=>e.revision===p.revision?{...e,loaded:!0,unknown:e.loaded}:e)},p.revision):(0,q.jsxs)(`div`,{className:`workbar-empty`,children:[(0,q.jsx)(Es,{"aria-hidden":`true`}),(0,q.jsx)(`strong`,{children:i(`browserReady`)}),(0,q.jsx)(`p`,{children:i(`browserDirectDescription`)})]})}),(0,q.jsx)(`p`,{className:`browser-notice`,children:i(v.ready?`browserEnhancedHint`:`browserDirectHint`)})]})}function UJ({onReady:e}={}){let{t}=W(),n=(0,K.useId)(),r=be(),[i,a]=(0,K.useState)(r?.browser?.tabs??[{id:0,title:``}]),o=(0,K.useRef)(Math.max(...i.map(e=>e.id))+1),s=(0,K.useRef)(i);s.current=i;let[c,l]=(0,K.useState)(),[u,d]=(0,K.useState)(r?.browser?.selected??0);(0,K.useLayoutEffect)(()=>{r&&(r.browser={tabs:i,selected:u,pages:r.browser?.pages??{}})},[r,i,u]);let f=e=>{requestAnimationFrame(()=>document.getElementById(`${n}-tab-${e}`)?.focus())},p=(e=``)=>{if(s.current.length>=VJ){e&&l(e);return}let t={id:o.current++,title:e?new URL(e).host:``,initialUrl:e},r=[...s.current,t];return s.current=r,a(r),d(t.id),l(void 0),f(t.id),`${n}-page-${t.id}`},m=(0,K.useRef)(p);m.current=p,(0,K.useEffect)(()=>(e?.(e=>m.current(e)),()=>e?.(void 0)),[e]);let h=e=>{r?.browser&&delete r.browser.pages[e],l(void 0);let t=i.filter(t=>t.id!==e);if(!t.length){let e={id:o.current++,title:``};a([e]),d(e.id),f(e.id)}else if(a(t),u===e){let n=i.findIndex(t=>t.id===e),r=t[Math.min(n,t.length-1)];d(r.id),f(r.id)}};return(0,q.jsxs)(`div`,{className:`browser-workspace`,children:[(0,q.jsxs)(`div`,{className:`browser-tabs-header`,children:[(0,q.jsx)(`div`,{role:`tablist`,"aria-label":t(`browserTabs`),className:`browser-tabs`,onKeyDown:e=>{if(!(e.target instanceof HTMLElement)||e.target.getAttribute(`role`)!==`tab`)return;let t=e.target.id,r=i.findIndex(e=>`${n}-tab-${e.id}`===t),a=r;if(e.key===`ArrowRight`)a=(r+1)%i.length;else if(e.key===`ArrowLeft`)a=(r+i.length-1)%i.length;else if(e.key===`Home`)a=0;else if(e.key===`End`)a=i.length-1;else if(e.key===`Delete`){e.preventDefault(),e.stopPropagation(),h(i[r].id);return}else return;e.preventDefault(),e.stopPropagation(),d(i[a].id),f(i[a].id)},children:i.map(e=>(0,q.jsxs)(`div`,{className:`browser-tab`,"data-active":e.id===u,children:[(0,q.jsxs)(`button`,{type:`button`,role:`tab`,id:`${n}-tab-${e.id}`,"aria-selected":e.id===u,"aria-controls":`${n}-page-${e.id}`,tabIndex:e.id===u?0:-1,onClick:()=>d(e.id),children:[(0,q.jsx)(Es,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:e.title||t(`browserNewTab`)})]}),(0,q.jsx)(V,{content:t(`close`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":t(`browserCloseTab`,{title:e.title||t(`browserNewTab`)}),onClick:()=>h(e.id),children:(0,q.jsx)(je,{"aria-hidden":`true`})})})]},e.id))}),(0,q.jsx)(V,{content:i.length>=VJ?t(`browserTabLimit`,{count:VJ}):t(`browserAddTab`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`browser-add-tab`,"aria-label":t(`browserAddTab`),disabled:i.length>=VJ,onClick:()=>p(),children:(0,q.jsx)(Ae,{"aria-hidden":`true`})})})]}),c&&(0,q.jsxs)(`p`,{className:`browser-notice`,role:`status`,children:[t(`browserTabLimit`,{count:VJ}),` ·`,` `,(0,q.jsx)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,children:t(`openExternalBrowser`)})]}),(0,q.jsx)(`div`,{className:`browser-pages`,children:i.map(e=>(0,q.jsx)(`div`,{role:`tabpanel`,id:`${n}-page-${e.id}`,"aria-labelledby":`${n}-tab-${e.id}`,className:`browser-page`,hidden:u!==e.id,children:(0,q.jsx)(HJ,{readingId:e.id,initialUrl:e.initialUrl,onOpen:p,onTitle:t=>a(n=>n.map(n=>n.id===e.id?{...n,title:t}:n))})},e.id))})]})}function WJ(e){return e.startsWith(`terminal:`)?`terminal`:e}function GJ(e){return e===`launcher`?{tabs:[],active:null,launcherOpen:!0,activationHistory:[]}:{tabs:[e],active:e,launcherOpen:!1,activationHistory:[e]}}function KJ(e,t){return t===`launcher`?{...e,launcherOpen:!0}:{tabs:e.tabs.includes(t)?e.tabs:[...e.tabs,t],active:t,launcherOpen:!1,activationHistory:[...e.activationHistory.filter(e=>e!==t),t]}}function qJ(e,t){return e.tabs.includes(t)?KJ(e,t):e}function JJ(e,t){if(!e.tabs.includes(t))return e;let n=e.tabs.filter(e=>e!==t),r=e.activationHistory.filter(e=>e!==t);if(e.active!==t)return{...e,tabs:n,activationHistory:r};let i=r.at(-1),a=e.tabs.indexOf(t),o=n[Math.min(a,n.length-1)],s=i??o??null;return{tabs:n,active:s,launcherOpen:e.launcherOpen||s===null,activationHistory:r}}function YJ(e){return{...e,launcherOpen:e.active===null}}var XJ=[{kind:`side-conversation`,icon:cc,title:`sideConversation`,description:`sideConversationDescription`},{kind:`review`,icon:Ms,title:`changeEvidence`,description:`workbarChangesDescription`},{kind:`terminal`,icon:Lc,title:`terminal`,description:`workbarTerminalDescription`},{kind:`browser`,icon:Es,title:`browser`,description:`workbarBrowserDescription`},{kind:`files`,icon:zs,title:`files`,description:`workbarFilesDescription`},{kind:`sources`,icon:Qs,title:`sessionSources`,description:`sourcesDescription`}];function ZJ({onSelect:e}){let{t}=W();return(0,q.jsx)(`section`,{className:`workbar-launcher`,"aria-label":t(`openTools`),children:(0,q.jsx)(`div`,{className:`workbar-launcher-list`,children:XJ.map(n=>{let r=n.icon;return(0,q.jsxs)(`button`,{type:`button`,onClick:()=>e(n.kind),children:[(0,q.jsx)(r,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:t(n.title)}),(0,q.jsx)(`small`,{children:t(n.description)})]}),(0,q.jsx)(os,{"aria-hidden":`true`})]},n.kind)})})})}function QJ({sessionId:e,cwd:t,snapshot:n,activity:r}){let{t:i}=W(),a=(0,K.useMemo)(()=>new de,[]),o=be(),[s,c]=(0,K.useState)(o?.sideConversation?.selectedId??null),[l,u]=(0,K.useState)(o?.sideConversation?.drafts??{});(0,K.useLayoutEffect)(()=>{o&&(o.sideConversation={selectedId:s,drafts:l})},[o,s,l]);let d=l[s??``]??``,f=(0,K.useRef)(0),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(!1),y=(0,K.useRef)(!1),[b,x]=(0,K.useState)(null),[S,C]=(0,K.useState)(0),[w,T]=(0,K.useState)(null),E=(0,K.useRef)(null);(0,K.useEffect)(()=>()=>E.current?.abort(),[]);let D=(r?.items??[]).filter(e=>e.origin===`btw`),O=D.find(e=>e.id===s),k=O?.status??w,A=p?.id===s?p:null,j=n?.models.find(e=>s?`${e.provider}/${e.id}`===A?.model:e.current),M=s?A?.model:j&&`${j.provider}/${j.id}`,N=j?.name||j?.id||M||i(`usageUnknown`),P=!s&&n?.thinking?.supported?n.thinking.level:void 0,F=A?.cwd??t,I=n?.workspaces.find(e=>e.path===F)?.name??LD(F),ee=i(s?`continueSideConversation`:`startSideConversation`),L=i(_?`sideConversationPending`:s?`send`:`start`),R=e=>{f.current++,c(e),T(null),x(null),g(null)},te=async t=>{t.preventDefault();let n=d.trim();if(!n||y.current)return;y.current=!0,E.current?.abort();let r=new AbortController,o=f.current,l=s??``;E.current=r,v(!0),x(null);try{let t=await a.subagentAction(e,s?{kind:`subagents`,action:`send-btw`,id:s,text:n}:{kind:`subagents`,action:`spawn-btw`,prompt:n},r.signal);if(r.signal.aborted)return;if(t.sessionId!==e||s&&t.detail.id!==s)throw Error(i(`inspectionChanged`));if(u(e=>e[l]===d?{...e,[l]:``}:e),o!==f.current)return;c(t.detail.id),T(t.detail.status),C(e=>e+1)}catch(e){!r.signal.aborted&&o===f.current&&x(e instanceof Error?e.message:i(`inspectionUnavailable`))}finally{r.signal.aborted||(y.current=!1,v(!1))}},z=async()=>{if(!s||y.current)return;y.current=!0,E.current?.abort();let t=new AbortController,n=f.current;E.current=t,v(!0),x(null);try{let r=await a.subagentAction(e,{kind:`subagents`,action:`cancel-btw`,id:s},t.signal);if(t.signal.aborted||n!==f.current)return;if(r.sessionId!==e||r.detail.id!==s)throw Error(i(`inspectionChanged`));T(r.detail.status),C(e=>e+1)}catch(e){!t.signal.aborted&&n===f.current&&x(e instanceof Error?e.message:i(`inspectionUnavailable`))}finally{t.signal.aborted||(y.current=!1,v(!1))}};return(0,q.jsxs)(`div`,{className:`side-conversation-body`,children:[s?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`button`,{type:`button`,className:`workbar-back`,onClick:()=>R(null),children:[(0,q.jsx)(Ko,{"aria-hidden":`true`}),` `,i(`backToSideConversations`)]}),(0,q.jsx)(Aq,{sessionId:e,id:s,activity:O,client:a,liveAvailable:!0,refreshRevision:S,fullView:!1,readOnlyNote:!1,onDetail:e=>m({id:e.id,cwd:e.cwd,model:e.model})},`${e}:${s}`)]}):(0,q.jsxs)(`div`,{className:`side-conversation-list`,"data-empty":D.length===0,children:[(0,q.jsxs)(`div`,{className:`side-conversation-intro`,children:[(0,q.jsx)(cc,{"aria-hidden":`true`}),(0,q.jsx)(`h3`,{children:i(`sideConversation`)}),(0,q.jsx)(`p`,{children:i(`sideConversationDescription`)})]}),D.length>0&&(0,q.jsx)(`ul`,{children:D.map(e=>(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,onClick:()=>R(e.id),children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:e.title||e.id}),(0,q.jsx)(`small`,{children:i(`subagentState_${e.status}`)})]}),(0,q.jsx)(os,{"aria-hidden":`true`})]})},e.id))})]}),b&&(0,q.jsx)(`p`,{className:`workbar-error`,role:`alert`,children:b}),(0,q.jsx)(`div`,{className:`composer-dock`,children:(0,q.jsxs)(`form`,{className:`composer composer-m02 side-conversation-composer`,onSubmit:te,"aria-busy":_,children:[(0,q.jsx)(`textarea`,{rows:1,value:d,disabled:_,"aria-label":ee,placeholder:ee,onChange:e=>{let t=e.currentTarget.value;u(e=>({...e,[s??``]:t}))},onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.defaultPrevented&&!e.nativeEvent.isComposing&&e.nativeEvent.keyCode!==229&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())}}),(0,q.jsxs)(`div`,{className:`composer-toolbar`,children:[(0,q.jsxs)(`div`,{className:`composer-toolbar-context`,children:[(0,q.jsx)(V,{content:i(`fileReference`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`composer-context-trigger icon-button`,"aria-label":i(`addContext`),disabled:_,onClick:()=>g({key:s??``,generation:f.current}),children:(0,q.jsx)(Ae,{"aria-hidden":`true`})})}),(0,q.jsxs)(`span`,{className:`composer-workspace-label`,title:F,children:[(0,q.jsx)(Vs,{"aria-hidden":`true`}),` `,I]})]}),(0,q.jsxs)(`div`,{className:`composer-toolbar-controls`,children:[(0,q.jsx)(`div`,{className:`model-picker-wrap`,children:(0,q.jsx)(ok,{className:`model-selector model-picker`,label:`${i(`model`)}: ${N}`,isLabelHidden:!0,value:M??``,triggerLabel:(0,q.jsxs)(`span`,{className:`model-thinking-label`,title:M||N,children:[(0,q.jsx)(`span`,{className:`model-picker-label`,children:N}),P&&(0,q.jsx)(`span`,{className:`model-picker-thinking`,children:P[0].toUpperCase()+P.slice(1)})]}),variant:`ghost`,size:`sm`,placement:`above`,alignment:`end`,isDisabled:!M,children:()=>(0,q.jsxs)(`div`,{className:`side-conversation-model-details`,children:[(0,q.jsx)(`strong`,{children:N}),(0,q.jsx)(`code`,{children:M}),(0,q.jsx)(`p`,{children:i(s?`sideConversationModelFixed`:`sideConversationModelInherited`)})]})},s??`new`)}),s&&k===`running`&&(0,q.jsx)(V,{content:i(`stop`),children:(0,q.jsx)(`button`,{type:`button`,className:`send-button`,"aria-label":i(`stop`),disabled:_,onClick:()=>void z(),children:(0,q.jsx)(Rc,{"aria-hidden":`true`})})}),(!s||k!==`running`||!!d.trim())&&(0,q.jsx)(V,{content:L,children:(0,q.jsx)(`button`,{type:`submit`,className:`send-button`,disabled:_||!d.trim(),"aria-label":L,children:(0,q.jsx)(Xo,{"aria-hidden":`true`})})})]})]})]})}),(0,q.jsx)(tk,{open:h!==null,sessionId:e,onClose:()=>g(null),onInsert:e=>{if(!h||h.generation!==f.current||h.key!==(s??``)||y.current)return i(`fileReferenceDraftChanged`);let t=h.key;u(n=>({...n,[t]:`${n[t]??``}${n[t]?` +`:``}${nk(e)}`}))}})]})}function $J({sessionId:e,cwd:t,tabId:n,active:r,onConnectionChange:i}){let{t:a}=W(),o=be(),s=(0,K.useRef)(null),c=(0,K.useRef)(i);c.current=i;let l=(0,K.useRef)(!0),[u,d]=(0,K.useState)(null),[f,p]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{let e=!1;l.current=!0;let t=e=>{let t=e.target;t instanceof Element&&!s.current?.contains(t)&&!t.matches(`.workbar-tab[data-active] > button:first-child`)&&(l.current=!1)};document.addEventListener(`focusin`,t);let r=o?.terminals?.[n]?.id??null;return c.current({id:r,pending:!0}),Ee(()=>import(`./app-InteractiveTerminal.js`).then(t=>{e||d(()=>t.InteractiveTerminal)},()=>{e||(p(!0),c.current({id:r,pending:!1}))}),__vite__mapDeps([31,1,2,0,32,6])),()=>{e=!0,document.removeEventListener(`focusin`,t)}},[o,n]),(0,q.jsx)(`div`,{className:`terminal-workspace`,ref:s,children:u?(0,q.jsx)(u,{sessionId:e,cwd:t,tabId:n,active:r,canFocusOnMount:()=>l.current,onConnectionChange:i}):(0,q.jsx)(`section`,{className:`interactive-terminal`,"aria-label":a(`terminal`),children:(0,q.jsxs)(`div`,{className:`interactive-terminal-notice`,"aria-live":`polite`,children:[(0,q.jsx)(`span`,{className:f?`error`:void 0,children:a(f?`terminalLoadError`:`terminalConnecting`)}),f&&(0,q.jsxs)(`button`,{type:`button`,className:`terminal-reconnect-action`,onClick:()=>window.location.reload(),children:[(0,q.jsx)(me,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:a(`reloadPage`)})]})]})})})}function eY({visible:e,requestedTool:t,requestRevision:n,sessionId:r,sessionPath:i,cwd:a,snapshot:o,capabilities:s,review:c,reviewInitialFilePath:l,reviewTurn:u,onWorkspaceReview:d,conversationCollapsed:f,onRestoreConversation:p,onExpandReview:m,onClose:h,onActiveToolChange:g,canControl:_=!0,onActivateSession:v,readingState:y,onReferenceLine:b,onBrowserReady:x}){let{t:S}=W(),C=(0,K.useRef)({}),w=y??C.current;w.terminal&&!w.terminals?.terminal&&((w.terminals??={}).terminal=w.terminal,w.terminal=void 0);let[T,E]=(0,K.useState)(()=>w?.tabs?w.requestRevision===n?w.tabs:KJ(w.tabs,t):GJ(t)),D=JSON.stringify([r,i]),O=(0,K.useRef)(new Map),k=(0,K.useRef)(null),A=(0,K.useRef)(null),M=(0,K.useRef)(null),N=(0,K.useMemo)(()=>new de,[]),[P,F]=(0,K.useState)({}),[I,ee]=(0,K.useState)([]),L=(0,K.useRef)(new Set),R=(0,K.useRef)(0);(0,K.useEffect)(()=>()=>{R.current++},[]);let[te,B]=(0,K.useState)(null),[ne,re]=(0,K.useState)(null),[ie,ae]=(0,K.useState)(``),[oe,se]=(0,K.useState)(()=>Object.fromEntries(Object.entries(w.terminals??{}).flatMap(([e,t])=>t.title?[[e,t.title]]:[]))),ce=e=>oe[e]??(e===`terminal`?S(`terminal`):`${S(`terminal`)} ${T.tabs.filter(e=>WJ(e)===`terminal`).indexOf(e)+1}`);(0,K.useLayoutEffect)(()=>{let t=M.current;if(M.current=null,!t||t.scope!==D||!e||(t.tool?T.launcherOpen||T.active!==t.tool:!T.launcherOpen))return;let n=requestAnimationFrame(()=>{let e=t.tool?O.current.get(t.tool):k.current;!e?.isConnected||e.closest(`[hidden], [inert]`)||document.activeElement!==document.body&&!e.closest(`.workbar-panel`)?.contains(document.activeElement)&&!document.getElementById(k.current?.getAttribute(`aria-controls`)??``)?.contains(document.activeElement)||e.focus({preventScroll:!0})});return()=>cancelAnimationFrame(n)},[T,D,e]);let le=e&&!T.launcherOpen&&T.active===`browser`&&_,[H,ue]=(0,K.useState)(null);(0,K.useLayoutEffect)(()=>{le?ue(D):(!e||!_||!T.tabs.includes(`browser`)||H!==D)&&ue(null)},[le,D,e,_,T,H]),(0,K.useLayoutEffect)(()=>{w&&(w.tabs=T,w.requestRevision=n)},[w,T,n]);let fe=zJ(r,i,a,u?.promptEntryId),pe=(0,K.useRef)(n);(0,K.useEffect)(()=>(g?.(e?T.launcherOpen?`launcher`:T.active?WJ(T.active):null:null),()=>g?.(null)),[e,T.launcherOpen,T.active,g]),(0,K.useEffect)(()=>{pe.current!==n&&(pe.current=n,E(e=>KJ(e,t)))},[n,t]);let me=e=>{let t=e===`terminal`&&T.tabs.some(e=>WJ(e)===`terminal`)?`terminal:${crypto.randomUUID()}`:e;if(t!==`launcher`&&(M.current={tool:t,scope:D}),t.startsWith(`terminal:`)){let e=Math.max(1,...Object.values(oe).map(e=>Number(e.match(/\s(\d+)$/u)?.[1])||0))+1,n=`${S(`terminal`)} ${e}`;se(e=>({...e,[t]:n})),(w.terminals??={})[t]={viewport:0,atBottom:!0,title:n}}E(e=>KJ(e,t))},he=async(e,t)=>{let n=R.current,i=t.contains(document.activeElement);if(WJ(e)===`terminal`&&_){if(L.current.has(e)||P[e]?.pending)return;let t=P[e]?.id??w.terminals?.[e]?.id;if(t){L.current.add(e),ee(t=>[...t,e]),B(null);try{await N.closeInteractiveTerminal(r,t)}catch(e){n===R.current&&B(e instanceof Error?e.message:S(`terminalError`));return}finally{n===R.current&&(L.current.delete(e),ee(t=>t.filter(t=>t!==e)))}if(n!==R.current)return}}WJ(e)===`terminal`&&w.terminals&&delete w.terminals[e],E(n=>{let r=JJ(n,e);return(t.contains(document.activeElement)||i&&document.activeElement===document.body)&&(M.current={tool:r.launcherOpen?null:r.active,scope:D}),r})},ge=T.active?WJ(T.active):null,_e=T.launcherOpen?`openTools`:XJ.find(e=>e.kind===ge)?.title??`openTools`;return j({isActive:e,onDismiss:()=>{T.launcherOpen&&T.active?(M.current={tool:T.active,scope:D},E(YJ)):h()},getContainer:()=>A.current,isPresent:()=>A.current?.contains(document.activeElement)??!1}),(0,q.jsx)(ve.Provider,{value:w,children:(0,q.jsx)(z,{children:(0,q.jsxs)(`aside`,{ref:A,className:`workbar-panel`,hidden:!e,"aria-label":S(_e??`openTools`),children:[(0,q.jsxs)(`header`,{className:`workbar-tabbar`,children:[(0,q.jsxs)(`div`,{className:`workbar-tabs`,role:`toolbar`,"aria-label":S(`openTools`),children:[T.tabs.length===0&&(0,q.jsxs)(`span`,{className:`workbar-tab-placeholder`,children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),` `,S(`openTools`)]}),T.tabs.map(e=>{let t=WJ(e),n=XJ.find(e=>e.kind===t),r=n.icon,i=!T.launcherOpen&&T.active===e,a=t===`terminal`?ce(e):S(n.title),o=()=>{t===`terminal`&&(ae(a),re(e))};return(0,q.jsxs)(`div`,{className:`workbar-tab`,"data-active":i||void 0,children:[(0,q.jsxs)(`button`,{type:`button`,ref:t=>{t?O.current.set(e,t):O.current.delete(e)},"aria-pressed":i,title:t===`terminal`?`${a} · ${S(`renameTerminal`)}`:a,onDoubleClick:o,onContextMenu:e=>{t===`terminal`&&(e.preventDefault(),o())},onKeyDown:e=>{t===`terminal`&&e.key===`F2`&&(e.preventDefault(),o())},onClick:()=>E(t=>qJ(t,e)),children:[(0,q.jsx)(r,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:a})]}),(0,q.jsx)(V,{content:t===`terminal`&&_?S(`workbarEndTerminal`,{name:a}):`${S(`close`)} ${a}`,placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`workbar-tab-close`,"aria-label":t===`terminal`&&_?S(`workbarEndTerminal`,{name:a}):`${S(`close`)} ${a}`,disabled:t===`terminal`&&_&&(I.includes(e)||P[e]?.pending!==!1),onClick:t=>void he(e,t.currentTarget),children:(0,q.jsx)(je,{"aria-hidden":`true`})})})]},e)})]}),(0,q.jsxs)(`div`,{className:`workbar-tabbar-actions`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`workbar-back-to-chat`,onClick:()=>{f?p():h(),requestAnimationFrame(()=>document.querySelector(`.composer textarea`)?.focus({preventScroll:!0}))},children:[(0,q.jsx)(Ko,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:S(`workbarBackToChat`)})]}),!f&&T.active===`review`&&m&&(0,q.jsx)(V,{content:S(`gitReviewExpand`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button review-expand`,"aria-label":S(`gitReviewExpand`),onClick:m,children:(0,q.jsx)(gc,{"aria-hidden":`true`,style:{transform:`rotate(180deg)`}})})}),T.active?(0,q.jsx)(yo,{className:`workbar-tool-picker`,button:{ref:k,className:`icon-button workbar-add-tab`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),label:S(`openTools`),isIconOnly:!0,variant:`ghost`,"aria-label":S(`openTools`),tooltip:S(`openTools`)},onOpenChange:e=>{e||(M.current??={tool:T.active,scope:D},E(YJ))},items:XJ.map(e=>({id:e.kind,icon:(0,q.jsx)(e.icon,{"aria-hidden":`true`}),label:S(e.kind===`terminal`?`workbarNewTerminal`:e.title),description:S(e.description),onClick:()=>me(e.kind)})),menuWidth:`min(300px, calc(100vw - 24px))`,alignment:`end`,hasChevron:!1}):(0,q.jsx)(V,{content:S(`openTools`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,ref:k,className:`icon-button workbar-add-tab`,"aria-label":S(`openTools`),"aria-pressed":T.launcherOpen,onClick:()=>E(e=>KJ(e,`launcher`)),children:(0,q.jsx)(Ae,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:S(`workbarCollapseTools`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":S(`workbarCollapseTools`),onClick:h,children:(0,q.jsx)(_c,{"aria-hidden":`true`})})})]})]}),te&&(0,q.jsx)(`p`,{className:`error`,role:`alert`,children:te}),(0,q.jsxs)(`div`,{className:`workbar-panels`,children:[(0,q.jsx)(`div`,{className:`workbar-tool-panel`,hidden:!T.launcherOpen,children:(0,q.jsx)(ZJ,{onSelect:me})}),T.tabs.map(t=>{let n=WJ(t);return(0,q.jsx)(`div`,{className:`workbar-tool-panel`,"data-tool":n,"data-tab":t,hidden:T.launcherOpen||T.active!==t,inert:T.launcherOpen||T.active!==t||!e,children:n===`terminal`&&e&&_?(0,q.jsx)($J,{sessionId:r,cwd:a,tabId:t,active:!T.launcherOpen&&T.active===t,onConnectionChange:e=>F(n=>({...n,[t]:e}))}):n===`browser`&&e&&_&&(le||H===D)?(0,q.jsx)(UJ,{onReady:x},D):e&&!T.launcherOpen&&T.active===t?!_&&[`side-conversation`,`terminal`,`browser`].includes(n)?(0,q.jsxs)(`div`,{className:`workbar-empty`,children:[(0,q.jsx)(`p`,{children:S(`toolsRequireCurrentSession`)}),v&&(0,q.jsx)(`button`,{type:`button`,className:`secondary`,onClick:v,children:S(`activateViewedSession`)})]}):n===`side-conversation`?(0,q.jsx)(QJ,{sessionId:r,cwd:a,snapshot:o,activity:s.subagents}):n===`sources`?(0,q.jsx)(iG,{sessionId:r,path:i,revision:o?.selectedSession?.history?.leafEntryId??void 0}):n===`review`?(0,q.jsx)(RJ,{review:u?{...fe,setSource:e=>{c.setSource?.(e),d?.()}}:c,initialFilePath:u?.filePath??l,readingScope:u?`turn:${u.promptEntryId}:${u.revision}`:`workspace:${c.source??`unstaged`}`,onOpenFiles:()=>me(`files`),onReferenceLine:_?b:void 0,onClose:()=>E(e=>JJ(e,`review`)),embedded:!0},u?`${u.promptEntryId}:${u.revision}`:c.source??`workspace`):(0,q.jsx)(cJ,{sessionId:r,sessionPath:i,cwd:a,active:!0,canWrite:_},JSON.stringify([r,i,a])):null},t)})]}),(0,q.jsx)(Se,{isOpen:ne!==null,purpose:`form`,"aria-label":S(`renameTerminal`),onOpenChange:e=>{e||re(null)},children:(0,q.jsxs)(`form`,{className:`openpi-dialog`,onSubmit:e=>{e.preventDefault();let t=ie.trim();if(!ne||!t)return;se(e=>({...e,[ne]:t}));let n=(w.terminals??={})[ne];w.terminals[ne]={...n??{viewport:0,atBottom:!0},title:t},re(null)},children:[(0,q.jsx)(`strong`,{children:S(`renameTerminal`)}),(0,q.jsx)(`input`,{"aria-label":S(`terminalName`),value:ie,maxLength:80,onChange:e=>ae(e.target.value)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>re(null),children:S(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,disabled:!ie.trim(),children:S(`save`)})]})]})})]})})})}var tY=`openpi:workbar-positions:v1`;function nY(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function rY(e,t=4096){return typeof e==`string`&&e.length<=t?e:``}function iY(e,t=0,n=0,r=5e7){return typeof e==`number`&&Number.isFinite(e)&&e>=n&&e<=r?e:t}function aY(e,t=100){return Array.isArray(e)?e.slice(0,t).filter(e=>typeof e==`string`&&e.length<=4096):[]}function oY(e){return tJ(rY(e),window.location.origin)}function sY(e){return typeof e==`string`&&([`files`,`review`,`browser`,`terminal`,`side-conversation`,`sources`].includes(e)||/^terminal:[a-zA-Z0-9-]{1,128}$/u.test(e))}function cY(e){return typeof e==`string`&&[`launcher`,`files`,`review`,`browser`,`terminal`,`side-conversation`,`sources`].includes(e)}function lY(e){let t={};if(!nY(e))return t;if(nY(e.sources)&&(t.sources={scroll:iY(e.sources.scroll)}),nY(e.tabs)){let n=Array.isArray(e.tabs.tabs)?[...new Set(e.tabs.tabs.filter(sY))].slice(0,16):[],r=sY(e.tabs.active)&&n.includes(e.tabs.active)?e.tabs.active:null;t.tabs={tabs:n,active:r,launcherOpen:e.tabs.launcherOpen===!0||r===null,activationHistory:Array.isArray(e.tabs.activationHistory)?[...new Set(e.tabs.activationHistory.filter(sY).filter(e=>n.includes(e)))].slice(-16):[]},t.requestRevision=iY(e.requestRevision)}if(nY(e.files)&&(t.files={selected:rY(e.files.selected),treeVisible:e.files.treeVisible!==!1,query:rY(e.files.query,200),expanded:aY(e.files.expanded),treeScroll:iY(e.files.treeScroll)}),nY(e.artifact)){t.artifact={reference:rY(e.artifact.reference),source:e.artifact.source===!0,editing:!1,scroll:iY(e.artifact.scroll)};let n=e.artifact.document;nY(n)&&typeof n.revision==`string`&&/^[a-f0-9]{64}$/u.test(n.revision)&&(t.artifact.document={path:rY(n.path),revision:n.revision,page:Math.floor(iY(n.page,1,1,1e5)),...typeof n.scale==`number`?{scale:iY(n.scale,1,.1,8)}:{}})}let n=e.review;nY(n)&&(n.source===`unstaged`||n.source===`staged`||n.source===`branch`||n.source===`session`)&&(t.review={scope:rY(n.scope),source:n.source,...typeof n.baseRef==`string`?{baseRef:rY(n.baseRef,1024)}:{},selected:typeof n.selected==`string`?rY(n.selected):null,query:rY(n.query,200),collapsedDirectories:aY(n.collapsedDirectories),visibleFiles:iY(n.visibleFiles,50,0,200),listScroll:iY(n.listScroll),previewScroll:iY(n.previewScroll)},nY(n.viewed)&&typeof n.viewed.revision==`string`&&(t.review.viewed={revision:rY(n.viewed.revision,128),paths:aY(n.viewed.paths,200)}));let r=e.browser;if(nY(r)&&Array.isArray(r.tabs)){let e=new Set,n=r.tabs.flatMap(t=>{if(!nY(t)||!Number.isSafeInteger(t.id)||typeof t.id!=`number`||t.id<0||t.id>5e7||e.has(t.id))return[];e.add(t.id);let n=oY(t.initialUrl);return[{id:t.id,title:rY(t.title,200),...n?{initialUrl:n}:{}}]}).slice(0,8),i={};for(let e of n){let t=nY(r.pages)?r.pages[e.id]:void 0;if(!nY(t))continue;let n=aY(t.history,32).flatMap(e=>oY(e)??[]);i[e.id]={draft:oY(t.draft)??``,history:n,index:n.length?Math.min(Math.floor(iY(t.index)),n.length-1):-1}}t.browser={tabs:n,selected:n.some(e=>e.id===r.selected)?Number(r.selected):n[0]?.id??0,pages:i}}if(nY(e.terminals)){t.terminals={};for(let[n,r]of Object.entries(e.terminals).slice(0,16))!sY(n)||n!==`terminal`&&!n.startsWith(`terminal:`)||!t.tabs?.tabs.includes(n)||!nY(r)||(t.terminals[n]={...typeof r.id==`string`?{id:rY(r.id,128)}:{},...typeof r.title==`string`?{title:rY(r.title,80)}:{},viewport:iY(r.viewport),atBottom:r.atBottom!==!1})}return nY(e.terminal)&&typeof e.terminal.id==`string`&&(t.terminal={id:rY(e.terminal.id,128),viewport:iY(e.terminal.viewport),atBottom:e.terminal.atBottom!==!1}),nY(e.sideConversation)&&(t.sideConversation={selectedId:typeof e.sideConversation.selectedId==`string`?rY(e.sideConversation.selectedId,128):null,drafts:{}}),t}function uY(e){if(!nY(e)||!rY(e.sessionId,128)||!rY(e.sessionPath)||!cY(e.tool))return null;let t={sessionId:rY(e.sessionId,128),sessionPath:rY(e.sessionPath),tool:e.tool,open:e.open===!0,requestRevision:iY(e.requestRevision),reading:lY(e.reading)};return nY(e.reviewTurn)&&rY(e.reviewTurn.promptEntryId,512)&&(t.reviewTurn={promptEntryId:rY(e.reviewTurn.promptEntryId,512),revision:iY(e.reviewTurn.revision),...typeof e.reviewTurn.filePath==`string`?{filePath:rY(e.reviewTurn.filePath)}:{}}),t}function dY(){try{let e=localStorage.getItem(tY);if(!e||e.length>256e3)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=new Map;for(let e of t.slice(-32)){let t=uY(e);t&&n.set(JSON.stringify([t.sessionId,t.sessionPath]),t)}return[...n.values()]}catch{return[]}}function fY(e){try{let t=e.slice(-32).flatMap(e=>uY(e)??[]),n=JSON.stringify(t);for(;n.length>256e3&&t.length;)t.shift(),n=JSON.stringify(t);localStorage.setItem(tY,n)}catch{}}var pY=260,mY=220,hY=520,gY=190,_Y=520,vY=360,yY=720,bY=320,xY=440,SY=1100;function CY(e,t,n){return Math.min(n,Math.max(t,e))}function wY(){eJ();let e=nu(WG),{t}=W(),{actions:n}=e,r=(0,K.useRef)(null),i=(0,K.useRef)(null),a=(0,K.useRef)(null),o=(0,K.useRef)(null),s=(0,K.useRef)(!1),c=(0,K.useRef)(null),l=(0,K.useRef)(null),u=(0,K.useRef)(null),d=(0,K.useRef)(null),f=(0,K.useRef)(void 0),p=(0,K.useCallback)(e=>{f.current=e},[]),m=(0,K.useMemo)(cK,[]),h=(0,K.useRef)(new Set),[,g]=(0,K.useState)(0),[_,v]=(0,K.useState)(null),y=(0,K.useMemo)(()=>new Map,[]),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(),[w,T]=(0,K.useState)(!1),[E,D]=(0,K.useState)(!1),[O,k]=(0,K.useState)(()=>window.innerWidth),[A,j]=(0,K.useState)({sidebar:pY,auxiliary:_Y}),[M,N]=(0,K.useState)(!1),P=!!e.snapshot,F=e.snapshot?.preferences.sidebarWidth,I=e.snapshot?.preferences.auxiliaryWidth;(0,K.useEffect)(()=>{!P||M||w||j({sidebar:F??pY,auxiliary:I??_Y})},[F,I,P,M,w]),(0,K.useEffect)(()=>{if(!M||w)return;let e=window.setTimeout(()=>{n.savePreferences({sidebarWidth:A.sidebar,auxiliaryWidth:A.auxiliary}).catch(()=>void 0)},200);return()=>window.clearTimeout(e)},[n,A,M,w]);let ee=(e,t)=>{N(!0),j(n=>({...n,[e]:t}))},[L,R]=(0,K.useState)(()=>window.matchMedia?.(`(max-width: 760px)`).matches??!1),te=L&&e.mobileSidebarOpen;(0,K.useEffect)(()=>{let e=window.matchMedia?.(`(max-width: 760px)`);if(!e)return;let t=()=>{R(e.matches),e.matches||n.closeMobileSidebar()};return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[n]),(0,K.useEffect)(()=>{let e=()=>k(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let[z,B]=(0,K.useState)(`chat`),[ne,re]=(0,K.useState)(null),[ie,ae]=(0,K.useState)(null),[oe,se]=(0,K.useState)(dY);(0,K.useEffect)(()=>{let e=()=>fY(oe);e(),window.addEventListener(`pagehide`,e);let t=()=>{document.visibilityState===`hidden`&&e()};return document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(`pagehide`,e),document.removeEventListener(`visibilitychange`,t),e()}},[oe]);let ce=e.workspaceDraft?void 0:e.snapshot?.selectedSession,le=oe.find(e=>e.sessionId===ce?.id&&e.sessionPath===ce?.path),H=le?.open??!1,ue=le?.reviewTurn,fe=(0,K.useCallback)(e=>{let t=WG.getState().snapshot?.selectedSession;t&&se(n=>n.map(n=>n.sessionId===t.id&&n.sessionPath===t.path?e(n):n))},[]),pe=(0,K.useCallback)(e=>fe(t=>({...t,open:e})),[fe]),he=e=>fe(t=>({...t,reviewTurn:e??void 0})),[ge,_e]=(0,K.useState)(null),[ve,ye]=(0,K.useState)(Nq),be=(0,K.useCallback)((e,t)=>{let n=WG.getState(),r=n.snapshot?.selectedSession;n.workspaceDraft||n.sessionSwitching||!r||!r.id||(s.current||(o.current=document.activeElement instanceof HTMLElement?document.activeElement:null),s.current=!0,u.current=null,pe(!1),ye(n=>({sessionId:r.id,sessionPath:r.path,id:e,kind:t,navigation:(n?.navigation??0)+1})))},[pe]),xe=ve&&!e.workspaceDraft&&!e.sessionSwitching&&ve.sessionId===e.snapshot?.selectedSession?.id&&ve.sessionPath===e.snapshot?.selectedSession?.path;(0,K.useEffect)(()=>{e.snapshot&&!e.sessionSwitching&&ve&&!xe&&ye(null)},[e.snapshot,e.sessionSwitching,ve,xe]),(0,K.useEffect)(()=>Pq(ve),[ve]),(0,K.useEffect)(()=>{if(xe||!s.current)return;s.current=!1;let e=o.current;o.current=null,queueMicrotask(()=>{e?.isConnected&&e.checkVisibility()&&e.focus()})},[xe]);let Se=e.snapshot?.models.find(e=>e.current),Ce=JSON.stringify([Se?.provider,Se?.id]),we=()=>{let t=e.snapshot,n=t?.selectedSession;e.workspaceDraft||!t||!n||e.sessionSwitching||!HD(t,n)||(u.current=null,pe(!1),re({sessionId:n.id,sessionPath:n.path,cwd:n.cwd,model:Se?.label??``,modelKey:Ce}))},Te=ne&&!e.workspaceDraft&&!e.sessionSwitching&&HD(e.snapshot,{id:ne.sessionId,path:ne.sessionPath})&&ne.sessionPath===e.snapshot?.selectedSession?.path&&ne.modelKey===Ce;(0,K.useEffect)(()=>{ne&&!Te&&re(null)},[ne,Te]);let Ee=(0,K.useCallback)(()=>{re(null);let e=c.current;c.current=null,e&&requestAnimationFrame(()=>{e.isConnected&&e.checkVisibility()&&e.focus()})},[]),U=ie&&!e.workspaceDraft&&!e.sessionSwitching&&HD(e.snapshot,{id:ie.sessionId,path:ie.sessionPath})&&ie.sessionPath===e.snapshot?.selectedSession?.path;(0,K.useEffect)(()=>{ie&&!U&&ae(null)},[ie,U]);let De=async(e=`general`)=>{l.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let t=await n.prepareSession();if(!t)return;let r=WG.getState(),i=r.snapshot,a=i?.selectedSession;r.workspaceDraft||!a||r.sessionSwitching||!HD(i,a)||a.id!==t.sessionId||a.path!==t.sessionPath||(n.closeMobileSidebar(),re(null),ye(null),u.current=null,pe(!1),ae({sessionId:a.id,sessionPath:a.path,cwd:a.cwd,entry:e}))},Oe=(0,K.useCallback)(()=>{ae(null);let e=new URL(window.location.href);e.searchParams.delete(`settings`),window.history.replaceState(window.history.state,``,e),requestAnimationFrame(()=>{let e=l.current;l.current=null,e?.isConnected&&e.checkVisibility()?e.focus():document.querySelector(`[data-provider-settings-trigger]`)?.focus()})},[]),ke=()=>{c.current=l.current??document.querySelector(`[data-provider-settings-trigger]`),ae(null),we()},Ae=async e=>{if(await n.sendPrompt(`/openpi-setup ${e}`))return!0;let r=WG.getState();throw Error((typeof r.notice==`string`?r.notice:null)||t(r.promptAdmissionRecovery?`setupResolveAdmission`:r.liveRunning||r.activeTurn?`settingsSetupBusyHint`:`setupRequestFailed`))};(0,K.useEffect)(()=>(n.start(),n.stop),[n]);let G=e.workspaceDraft?void 0:e.snapshot?.selectedSession,Me=lK(G),Ne=G?.id,Pe=G?.path,Fe=!!(G&&!h.current.has(Me)&&m.get(Me)?.position?.key&&m.get(Me)?.position?.pinned===!1);(0,K.useEffect)(()=>{let t=WG.getState(),n=t.workspaceDraft?void 0:t.snapshot?.selectedSession;if(!n||n.id!==Ne||n.path!==Pe||e.sessionSwitching||h.current.has(Me))return;let r=m.get(Me)?.position,i=()=>{h.current.add(Me),g(e=>e+1)};if(!r?.key||r.pinned||m.get(Me)?.window||e.historyNavigation?.sessionId===n.id&&e.historyNavigation.sessionPath===n.path){i();return}let a={sessionId:n.id,sessionPath:n.path,entryId:r.entryId??r.key},o=new AbortController,s,c=e=>{let t=e.target;!(t instanceof Element)||!t.closest(`.conversation, .turn-rail, .jump-to-latest`)||e instanceof KeyboardEvent&&![`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `].includes(e.key)||(o.abort(),i(),v(e=>e?.sessionId===a.sessionId&&e.sessionPath===a.sessionPath?null:e))};for(let e of[`wheel`,`touchstart`,`pointerdown`,`keydown`])document.addEventListener(e,c,!0);let l=e=>{let t=WG.getState();o.signal.aborted||h.current.has(Me)||t.historyNavigation||t.sessionSwitching||t.workspaceDraft||t.selectedPath!==a.sessionPath||t.snapshot?.selectedSession?.id!==a.sessionId||t.snapshot.selectedSession.path!==a.sessionPath||m.get(Me)?.position!==r||e.id!==a.sessionId||e.path!==a.sessionPath||e.history?.anchorEntryId!==a.entryId||e.history.anchorOnBranch!==!0||!e.entries.some(e=>e.id===a.entryId)||(v({...a,session:e,restorePosition:r,revision:-1}),i())};if(e.connection===`connected`)if(n.entries.some(e=>e.id===a.entryId))l({...n,history:{leafEntryId:n.history?.leafEntryId??null,beforeEntryId:n.history?.beforeEntryId??null,anchorEntryId:a.entryId,anchorOnBranch:!0}});else{let e=t=>{new de().sessionMessageWindow(a,o.signal).then(l,()=>{!o.signal.aborted&&t===0&&(s=window.setTimeout(()=>e(1),500))})};e(0)}return()=>{o.abort(),window.clearTimeout(s);for(let e of[`wheel`,`touchstart`,`pointerdown`,`keydown`])document.removeEventListener(e,c,!0)}},[Ne,Pe,e.connection,e.sessionSwitching,e.historyNavigation,Me,m]);let Ie=HD(e.snapshot,G),Le=(0,K.useMemo)(()=>GD((G?.entries??[]).flatMap(e=>e.message?[e.message]:[])),[G?.entries]),Re=Ie?e.snapshot?.runtime.capabilities??G?.capabilities:G?.capabilities,ze=Re?.subagents,Be=(0,K.useMemo)(()=>KD(ze?.items??[],Le,Re?.workflows?.items,e.connection===`connected`),[ze?.items,Le,Re?.workflows?.items,e.connection]),Ve=e.snapshot?.selectedExecution,He=Ve?.sessionId===G?.id&&Ve?.sessionPath===G?.path?Ve:void 0,Ue=Ie&&(e.liveRunning||!!e.activeTurn||e.snapshot?.runtime.status===`running`)||He?.status===`running`,We=hA(G,e.snapshot?.cursor,{active:H&&ge===`review`,running:Ue,initialSource:le?.reading.review?.scope.startsWith(`workspace:`)?le.reading.review.source:`unstaged`,initialBaseRef:le?.reading.review?.baseRef}),Ge=!!(le&&G&&e.selectedPath===G.path&&le.sessionId===G.id&&le.sessionPath===G.path),Ke=H&&Ge&&le?.tool!==`launcher`&&!e.sessionSwitching;(0,K.useEffect)(()=>{G?.id,G?.path,u.current=null},[G?.id,G?.path]),(0,K.useEffect)(()=>{!le||e.sessionSwitching||se(e=>e.at(-1)===le?e:[...e.filter(e=>e!==le),le])},[le,e.sessionSwitching]);let qe=(t=`launcher`)=>{!G||e.sessionSwitching||(b&&d.current?.close({restoreFocus:!1}),Ke||(u.current=document.activeElement instanceof HTMLElement?document.activeElement:null),re(null),ye(null),se(e=>{let n=e.find(e=>e.sessionId===G.id&&e.sessionPath===G.path),r={sessionId:G.id,sessionPath:G.path,tool:t,requestRevision:(n?.requestRevision??0)+1,open:!0,reading:n?.reading??{},reviewTurn:t===`review`?void 0:n?.reviewTurn};return[...e.filter(e=>e!==n),r].slice(-32)}))},Je=()=>{D(!1),pe(!1);let e=u.current;u.current=null,e&&requestAnimationFrame(()=>{let t=e.isConnected?e:i.current;t?.isConnected&&t.checkVisibility()&&t.focus()})},Ye=!e.sessionSwitching&&!e.workspaceDraft&&HD(e.snapshot,G)?G:void 0;rJ(Ye?.id,Ye?.path,async(e,t)=>{qe(`browser`);let n=Date.now()+5e3;for(;!f.current&&!t.aborted&&Date.now()setTimeout(e,40));return t.aborted?void 0:f.current?.(e)});let Xe=(0,K.useRef)(ZW(new URLSearchParams(location.search).get(`settings`))),Ze=(0,K.useEffectEvent)(e=>{De(e)});(0,K.useEffect)(()=>{if(!Xe.current||!e.snapshot||e.sessionSwitching)return;let t=Xe.current;Xe.current=void 0,Ze(t)},[e.snapshot,e.sessionSwitching]);let Qe=!!(xe||Ke||b);(0,K.useEffect)(()=>{(!Qe||O<=SY)&&D(!1)},[Qe,O]);let $e=Math.max(mY,Math.min(hY,O-xY-(Qe&&!E?A.auxiliary:0))),et=CY(A.sidebar,mY,$e),tt=Math.max(vY,Math.min(yY,O-(e.sidebarCollapsed?56:et)-xY)),nt=CY(A.auxiliary,vY,tt),rt={"--sidebar-width":`${et}px`,"--auxiliary-width":`${nt}px`},it=()=>{b?d.current?.close():Ke?Je():xe&&ye(null)},at=!e.snapshot,ot=e.sessionSwitching?e.snapshot?.sessions.find(t=>t.path===e.selectedPath)?.cwd:e.workspaceDraft?e.selectedWorkspace:G?.cwd??e.selectedWorkspace,st=e.snapshot?.workspaces.find(e=>e.path===ot),ct=e.snapshot?.sessions.find(e=>e.path===G?.path&&e.id===G?.id),lt=e.sessionSwitching?e.snapshot?.sessions.find(t=>t.path===e.selectedPath):void 0,ut=e.sessionSwitching&&!e.workspaceDraft?lt?ID(lt,t(`untitledSession`)):t(`switchingSession`):G?ID(ct??{},t(`untitledSession`)):e.selectedWorkspace?t(`newSession`):`OpenPI`,dt=!!G?.rerun||G?.entries.some(e=>e.type===`message`&&e.message||e.type===`compaction`)||!!G?.history?.beforeEntryId||e.liveMessages.length>0,ft=!at&&(!e.sessionSwitching||e.workspaceDraft)&&(!G||!dt&&!(e.snapshot?.selectedExecution?.sessionId===G.id&&e.snapshot.selectedExecution?.sessionPath===G.path&&e.snapshot.selectedExecution.compaction)),pt=(0,K.useCallback)((e,t)=>t?n.sendPrompt(``,[],void 0,{streamingBehavior:`followUp`,retryEntryId:t}):n.sendPrompt(e),[n]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{inert:U?!0:void 0,"aria-hidden":U?!0:void 0,className:`app-shell ${e.sidebarCollapsed?`sidebar-collapsed`:``} ${e.mobileSidebarOpen?`sidebar-open`:``} ${xe?`with-subagent-panel`:``} ${Ke?`with-workbar-panel`:``} ${b?`with-artifact-panel`:``} ${E?`center-collapsed`:``} ${w?`is-resizing`:``} ${at?`shell-loading`:``}`,style:rt,children:(0,q.jsxs)(FD,{ref:d,sessionId:G?.id,sessionPath:G?.path,disabled:!!(e.workspaceDraft||e.sessionSwitching||xe||U),onOpen:()=>{x(!0),ye(null),pe(!1),re(null)},onClose:()=>{x(!1)},children:[(0,q.jsx)(NA,{sessionViewVisible:z===`chat`&&!E&&!U&&!e.sessionSwitching&&!e.workspaceDraft,connected:e.connection===`connected`,snapshot:e.snapshot,selectedPath:e.workspaceDraft?null:e.selectedPath,selectedWorkspace:e.selectedWorkspace,collapsed:e.collapsed,query:e.query,searchOpen:e.searchOpen,mobileOpen:te,settingsDisabled:!!(e.sessionSwitching||e.modelSelectionPending||!e.snapshot),returnFocusRef:r,onOpenSettings:()=>void De(`general`),actions:n}),e.sidebarCollapsed&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{ref:a,className:`sidebar-expand`,type:`button`,"aria-label":t(`expandSidebar`),onClick:()=>n.toggleSidebar(!1),children:(0,q.jsx)(gc,{})}),(0,q.jsx)(V,{anchorRef:a,content:t(`expandSidebar`),placement:`end`})]}),(0,q.jsxs)(`main`,{inert:te,className:`conversation-shell ${G?`has-view`:``} ${ft&&(!G||z===`chat`)?`landing`:``}`,children:[(0,q.jsxs)(`header`,{className:`task-header`,children:[(0,q.jsx)(V,{content:t(L?`openSidebar`:e.sidebarCollapsed?`expandSidebar`:`collapseSidebar`),placement:`below`,children:(0,q.jsx)(`button`,{className:`task-header-menu sidebar-shell-toggle`,ref:r,type:`button`,"aria-label":t(L?`openSidebar`:e.sidebarCollapsed?`expandSidebar`:`collapseSidebar`),"aria-controls":`session-sidebar`,"aria-expanded":L?te:!e.sidebarCollapsed,onClick:()=>n.toggleSidebar(L),children:L?(0,q.jsx)(sc,{}):(0,q.jsx)(hc,{})})}),(0,q.jsxs)(`div`,{className:`task-identity`,children:[ot&&(0,q.jsxs)(`span`,{className:`task-workspace`,title:ot,children:[st?.name||LD(ot),(0,q.jsxs)(`span`,{className:`sr-only`,children:[` `,ot]})]}),(0,q.jsx)(`h1`,{title:ut,children:ut})]}),(0,q.jsx)(iJ,{usage:G&&!e.sessionSwitching?e.snapshot?.usage:void 0,workspace:st?.name||G&&LD(G.cwd),sessionId:G?.id,model:Ie?Se:void 0},G?`usage:${G.id}:${G.path}`:`usage:no-session`),G&&!e.sessionSwitching&&(0,q.jsx)(oG,{sessionId:G.id,workspace:st?.name||LD(G.cwd),agents:Be,omitted:(ze?.omitted??0)+(Re?.workflows?.items??[]).reduce((e,t)=>e+(t.children?.omitted??0),0),omittedWorkflows:Re?.workflows?.omitted??0,review:We.result,reviewLoading:We.loading,reviewError:We.error,sessionPath:G.path,revision:G.history?.leafEntryId??void 0,onAddSources:Ie?()=>C(e=>({sessionId:G.id,path:G.path,revision:(e?.revision??0)+1})):void 0,onSubagents:()=>be(),onReview:()=>qe(`review`),onSources:()=>qe(`sources`)},`overview:${G.id}:${G.path}`),Ge&&!Ke&&le?.tool!==`launcher`?(0,q.jsx)(V,{content:t(G?`openTools`:`openToolsUnavailable`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,ref:i,className:`task-tools-trigger`,"aria-label":t(`openTools`),disabled:!G||e.sessionSwitching,onClick:e=>{b&&d.current?.close({restoreFocus:!1}),u.current=e.currentTarget,pe(!0)},children:(0,q.jsx)(vc,{"aria-hidden":`true`})})}):(0,q.jsx)(yo,{button:{ref:i,className:`task-tools-trigger`,label:t(`openTools`),"aria-label":t(`openTools`),icon:(0,q.jsx)(vc,{"aria-hidden":`true`}),isIconOnly:!0,isDisabled:!G||e.sessionSwitching,variant:`ghost`,tooltip:t(G?`openTools`:`openToolsUnavailable`)},items:XJ.map(e=>({id:e.kind,icon:(0,q.jsx)(e.icon,{"aria-hidden":`true`}),label:t(e.title),description:t(e.description),onClick:()=>{qe(e.kind),u.current=i.current}})),menuWidth:`min(300px, calc(100vw - 24px))`,alignment:`end`,hasChevron:!1}),(0,q.jsx)(`span`,{className:`connection-state ${e.connection}`,role:`status`,title:t(e.connection),"aria-label":t(e.connection),children:(0,q.jsx)(`span`,{children:t(e.connection)})})]}),G&&!e.sessionSwitching&&(0,q.jsx)(`div`,{className:`conversation-view-row`,children:(0,q.jsxs)(`fieldset`,{className:`conversation-view-switch`,"data-view":z,"aria-label":t(`conversationView`),children:[(0,q.jsx)(`button`,{type:`button`,"aria-pressed":z===`chat`,onClick:()=>B(`chat`),children:t(`chatView`)}),(0,q.jsx)(`button`,{type:`button`,"aria-pressed":z===`trajectory`,onClick:()=>B(`trajectory`),children:t(`trajectory`)})]})}),at?(0,q.jsxs)(`section`,{className:`shell-state`,role:`status`,"aria-live":`polite`,children:[(0,q.jsx)(iu,{compact:!0}),(0,q.jsx)(`p`,{children:t(e.connection===`unavailable`?`unavailable`:`connecting`)}),e.connection===`unavailable`&&(0,q.jsxs)(`button`,{type:`button`,onClick:()=>void n.refreshSnapshot({resetCursor:!0}),children:[(0,q.jsx)(me,{"aria-hidden":`true`}),` `,t(`retryAdmissionCheck`)]})]}):e.sessionSwitching&&!ft?(0,q.jsx)(`div`,{className:`conversation switching`,role:`status`,children:(0,q.jsxs)(`div`,{className:`conversation-running`,children:[(0,q.jsx)(`span`,{className:`conversation-running-dot`}),(0,q.jsx)(`span`,{children:t(`switchingSession`)})]})}):z===`trajectory`&&G&&e.snapshot?(0,q.jsx)($q,{snapshot:e.snapshot,running:Ue},G.path):ft?(0,q.jsx)(`section`,{className:`conversation landing-conversation`,"aria-label":`Conversation`,children:(0,q.jsxs)(`div`,{className:`landing-welcome`,children:[(0,q.jsx)(`h1`,{className:`sr-only`,children:ut}),(0,q.jsx)(iu,{animated:!0}),e.sessionSwitching&&(0,q.jsx)(`span`,{className:`sr-only`,role:`status`,children:t(`switchingSession`)})]})}):e.snapshot?(0,q.jsx)(Oq,{resultExposureEnabled:!E&&!U&&!e.sessionSwitching&&!e.workspaceDraft&&z===`chat`,readingCache:m,readingRestorePending:Fe,snapshot:e.snapshot,liveMessages:e.liveMessages,liveRunning:e.liveRunning,liveActiveTurn:e.activeTurn,livePhase:e.livePhase,activityObserved:e.connection===`connected`,liveRetry:e.liveRetry,thinkingStarts:e.thinkingStarts,thinkingDurations:e.thinkingDurations,scrollToBottom:e.scrollToBottom,onResend:pt,onEdit:n.editMessage,onRegenerate:n.regenerateMessage,onOpenOriginal:n.navigateToMessage,onFork:n.forkMessage,forkPending:e.sessionForkPending,forkAvailable:Ie&&!Ue&&e.snapshot.runtime.status===`idle`&&!e.promptAdmissionPending&&!e.promptAdmissionRecovery&&!e.activeTurn&&!e.modelSelectionPending&&!e.sessionSwitching&&!G?.path.startsWith(`current:`)&&!(He?.pendingFollowUps||He?.pendingSteering||He?.compaction?.state===`running`),onInspectSubagent:be,onReviewTurn:(e,t)=>{qe(`review`),u.current=document.activeElement instanceof HTMLElement?document.activeElement:null,he({promptEntryId:e,filePath:t,revision:(ue?.revision??0)+1})},onHistoryAnchorChange:n.setHistoryAnchor,historyNavigation:e.historyNavigation??(_?.sessionId===G?.id&&_?.sessionPath===G?.path?_:null),onNavigateToMessage:n.navigateToMessage,onRefreshHistory:n.refreshSnapshot,onPromptProjection:n.rememberPromptProjection},`transcript:${JSON.stringify([G?.id,G?.path])}`):null,!U&&G&&e.snapshot&&!e.sessionSwitching&&HD(e.snapshot,G)&&(0,q.jsx)(mA,{sessionId:G.id,sessionPath:G.path,workingCache:y,revision:e.snapshot.cursor,connected:e.connection===`connected`},JSON.stringify([G.id,G.path])),e.snapshot&&(0,q.jsxs)(`div`,{className:`workbar-chat-context`,hidden:!Ke,children:[(0,q.jsx)(`span`,{className:`workbar-chat-title`,title:ut,children:ut}),(0,q.jsx)(`span`,{className:`workbar-chat-status`,role:`status`,children:t(Ue?`turnState_running`:e.connection)}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{Je(),requestAnimationFrame(()=>document.querySelector(`.composer textarea`)?.focus({preventScroll:!0}))},children:t(`workbarContinueInChat`)})]}),e.snapshot&&(0,q.jsx)(oA,{addSourcesRequest:S,planSelectionPending:e.planSelectionPending,workspaceDraft:e.workspaceDraft,draftModel:e.draftModel,createdSession:e.createdSession,modelSelectionPending:e.modelSelectionPending,modelSearch:e.modelSearch,thinkingPendingLevel:e.thinkingPendingLevel,onInspect:we,onOpenProviders:()=>void De(`credentials`),onCommandAction:e=>{let t=WG.getState();return t.sessionSwitching||t.workspaceDraft||!G||t.snapshot?.selectedSession?.path!==G.path||t.snapshot.selectedSession.id!==G.id?!1:(e===`terminal`||e===`review`||e===`side-conversation`?qe(e):e===`subagents`?be():we(),!0)},onInspectSubagent:be,activeTurn:e.activeTurn,activityObserved:e.connection===`connected`,turnCancellationPending:e.turnCancellationPending,turnTerminalStatus:e.turnTerminalStatus,pendingFollowUpsReceipt:e.pendingFollowUpsReceipt,pendingSteeringReceipt:e.pendingSteeringReceipt,commandDiscovery:e.commandDiscovery,snapshot:e.snapshot,selectedPath:e.selectedPath,selectedWorkspace:G?.cwd??e.selectedWorkspace,sessionSwitching:e.sessionSwitching||e.sessionForkPending,promptAdmissionPending:e.promptAdmissionPending,promptAdmissionRecovery:e.promptAdmissionRecovery,promptAdmissionResolution:e.promptAdmissionResolution,restoredPromptDraft:e.restoredPromptDraft,liveRunning:e.liveRunning,landing:ft,actions:n}),e.sessionForkPending&&(0,q.jsxs)(`div`,{className:`session-fork-progress`,role:`status`,children:[(0,q.jsx)(`span`,{className:`session-fork-progress-spinner`,"aria-hidden":`true`}),t(e.sessionForkCancellation===`too-late`?`sidebarForkFinishing`:e.sessionForkCancellation?`sidebarForkCancelling`:e.sessionForkEnvironment===`worktree`?`sidebarForkWorktreePending`:`forkSessionPending`),e.sessionForkEnvironment&&(0,q.jsx)(`button`,{type:`button`,disabled:e.sessionForkCancellation!==null,onClick:()=>void n.cancelSessionFork(),children:t(`cancel`)})]}),(0,q.jsx)(_A,{notices:e.archiveNotices,actions:n}),e.notice&&(0,q.jsxs)(`div`,{className:typeof e.notice==`string`?`notice`:`notice notice-success`,role:typeof e.notice==`string`?`alert`:`status`,children:[(0,q.jsx)(`span`,{children:typeof e.notice==`string`?e.notice:e.notice.message}),(0,q.jsx)(V,{content:t(`close`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":t(`close`),onClick:n.clearNotice,children:(0,q.jsx)(je,{})})})]})]}),Te&&(0,q.jsx)(sA,{target:ne,onClose:Ee,onOpenProviders:()=>void De(`credentials`)},`${ne.sessionId}:${ne.sessionPath}`),xe&&(0,q.jsx)(jq,{sessionId:ve.sessionId,sessionPath:ve.sessionPath,initialId:ve.id,initialKind:ve.kind,observed:e.connection===`connected`,activity:ze,records:Le,workflows:Re?.workflows,liveAvailable:G?.id===ve.sessionId&&G.path===ve.sessionPath,onClose:()=>ye(null)},`${ve.sessionId}:${ve.navigation}`),Ke&&G&&le&&(0,q.jsx)(eY,{visible:Ke,requestedTool:le.tool,requestRevision:le.requestRevision,sessionId:G.id,sessionPath:G.path,onBrowserReady:p,canControl:!e.sessionSwitching&&HD(e.snapshot,G),onActivateSession:()=>void n.selectSession(G.path),cwd:G.cwd,snapshot:e.snapshot??void 0,capabilities:HD(e.snapshot,G)?e.snapshot?.runtime.capabilities??{}:{},readingState:le.reading,onActiveToolChange:_e,review:We,reviewTurn:ue??void 0,onWorkspaceReview:()=>he(null),onReferenceLine:e=>{let t=WG.getState(),n=t.snapshot?.selectedSession;t.workspaceDraft||t.sessionSwitching||t.selectedPath!==G.path||n?.id!==G.id||n.path!==G.path||!HD(t.snapshot,n)||(B(`chat`),C(t=>({sessionId:G.id,path:G.path,revision:(t?.revision??0)+1,feedback:e})))},conversationCollapsed:E,onRestoreConversation:()=>D(!1),onExpandReview:()=>D(!0),onClose:Je},`${G.id}:${G.path}`),(0,q.jsxs)(`section`,{"aria-label":t(`resizePanes`),style:{display:`contents`},children:[!e.sidebarCollapsed&&!L&&(!Qe||O>SY)&&(0,q.jsx)(ou,{side:`left`,value:et,min:mY,max:$e,defaultValue:pY,collapseThreshold:gY,onCollapse:()=>n.toggleSidebar(!1),onChange:e=>ee(`sidebar`,e),onDraggingChange:T}),Qe&&!E&&O>SY&&(0,q.jsx)(ou,{side:`right`,value:nt,min:vY,max:tt,defaultValue:_Y,collapseThreshold:bY,onCollapse:it,onExpandPastMax:Ke?()=>D(!0):void 0,onChange:e=>ee(`auxiliary`,e),onDraggingChange:T})]}),(0,q.jsx)(`button`,{className:`sidebar-scrim`,type:`button`,tabIndex:-1,"aria-hidden":`true`,"aria-label":t(`close`),onClick:n.closeMobileSidebar})]})}),U&&(0,q.jsx)(QW,{sessionId:ie.sessionId,cwd:ie.cwd,entry:ie.entry,models:e.snapshot?.models??[],currentModel:Se,thinkingLevel:e.thinkingPendingLevel??e.snapshot?.thinking?.level??t(`unknownState`),theme:e.snapshot?.preferences.theme??`system`,preferences:e.snapshot?.preferences,workspaces:e.snapshot?.workspaces??[],onRestoreSession:e=>n.unarchiveSession(e),plan:e.snapshot?.runtime.plan,planSelectionPending:e.planSelectionPending,onExitPlan:()=>n.selectPlanMode(!1),setupOutcome:e.snapshot?.runtime.setup,capabilities:e.snapshot?.runtime.capabilities,setupBusy:e.liveRunning||e.promptAdmissionPending||!!e.activeTurn||e.modelSelectionPending||e.thinkingPendingLevel!==null||e.sessionSwitching,setupBlockedReason:e.promptAdmissionRecovery?t(`setupResolveAdmission`):void 0,modelSelectionPending:e.modelSelectionPending,sessionPath:ie.sessionPath,onSelectModel:e=>n.selectModel(e),onConfigureOpenPi:Ae,interaction:e.snapshot&&!e.sessionSwitching&&ie.sessionId===e.snapshot.currentSessionId?(0,q.jsxs)(`div`,{className:`settings-interaction`,children:[(0,q.jsx)(mA,{sessionId:ie.sessionId,sessionPath:ie.sessionPath,workingCache:y,revision:e.snapshot.cursor,connected:e.connection===`connected`},JSON.stringify([ie.sessionId,ie.sessionPath])),(e.activeTurn||e.liveRunning)&&(0,q.jsx)(`button`,{type:`button`,disabled:e.turnCancellationPending,onClick:()=>void n.cancelActiveTurn(),children:t(`stopTurn`)})]}):void 0,onPreferencesChanged:()=>n.refreshSnapshot(),onOpenRuntimeStatus:ke,onClose:Oe},`${ie.sessionId}:${ie.sessionPath}`)]})}var TY={size:`1em`,"aria-hidden":!0},EY={name:`neutral`,__built:!0,tokens:{"--font-size-4xs":`0.375rem`,"--font-size-3xs":`0.4375rem`,"--font-size-2xs":`0.5rem`,"--font-size-xs":`0.625rem`,"--font-size-sm":`0.75rem`,"--font-size-base":`0.875rem`,"--font-size-lg":`1.0625rem`,"--font-size-xl":`1.25rem`,"--font-size-2xl":`1.5rem`,"--font-size-3xl":`1.8125rem`,"--font-size-4xl":`2.1875rem`,"--font-size-5xl":`2.625rem`,"--text-heading-1-size":`var(--font-size-2xl)`,"--text-heading-1-weight":`var(--font-weight-semibold)`,"--text-heading-1-leading":`1.3333`,"--text-heading-2-size":`var(--font-size-xl)`,"--text-heading-2-weight":`var(--font-weight-semibold)`,"--text-heading-2-leading":`1.4`,"--text-heading-3-size":`var(--font-size-lg)`,"--text-heading-3-weight":`var(--font-weight-bold)`,"--text-heading-3-leading":`1.4118`,"--text-heading-4-size":`var(--font-size-base)`,"--text-heading-4-weight":`var(--font-weight-bold)`,"--text-heading-4-leading":`1.4286`,"--text-heading-5-size":`var(--font-size-sm)`,"--text-heading-5-weight":`var(--font-weight-semibold)`,"--text-heading-5-leading":`1.6667`,"--text-heading-6-size":`var(--font-size-xs)`,"--text-heading-6-weight":`var(--font-weight-semibold)`,"--text-heading-6-leading":`1.6`,"--text-body-size":`var(--font-size-base)`,"--text-body-weight":`var(--font-weight-normal)`,"--text-body-leading":`1.4286`,"--text-large-size":`var(--font-size-lg)`,"--text-large-weight":`var(--font-weight-semibold)`,"--text-large-leading":`1.4118`,"--text-label-size":`var(--font-size-base)`,"--text-label-weight":`var(--font-weight-medium)`,"--text-label-leading":`1.4286`,"--text-code-size":`var(--font-size-base)`,"--text-code-weight":`var(--font-weight-normal)`,"--text-code-leading":`1.4286`,"--text-supporting-size":`var(--font-size-sm)`,"--text-supporting-weight":`var(--font-weight-normal)`,"--text-supporting-leading":`1.6667`,"--text-display-1-size":`var(--font-size-5xl)`,"--text-display-1-weight":`var(--font-weight-normal)`,"--text-display-1-leading":`1.2381`,"--text-display-2-size":`var(--font-size-4xl)`,"--text-display-2-weight":`var(--font-weight-normal)`,"--text-display-2-leading":`1.2571`,"--text-display-3-size":`var(--font-size-3xl)`,"--text-display-3-weight":`var(--font-weight-normal)`,"--text-display-3-leading":`1.3793`,"--duration-fast-min":`95ms`,"--duration-fast":`125ms`,"--duration-fast-max":`165ms`,"--duration-medium-min":`225ms`,"--duration-medium":`300ms`,"--duration-medium-max":`400ms`,"--duration-slow-min":`525ms`,"--duration-slow":`700ms`,"--duration-slow-max":`935ms`,"--font-family-body":`Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,"--font-family-heading":`Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,"--font-family-code":`ui-monospace, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace`,"--color-syntax-keyword":`light-dark(#700084, #efa8ff)`,"--color-syntax-string":`light-dark(#005600, #a6d2a2)`,"--color-syntax-comment":`light-dark(#737373, #a3a3a3)`,"--color-syntax-number":`light-dark(#6e3500, #ffb37f)`,"--color-syntax-function":`light-dark(#00458c, #a0caff)`,"--color-syntax-type":`light-dark(#700084, #efa8ff)`,"--color-syntax-variable":`light-dark(#171717, #e5e5e5)`,"--color-syntax-operator":`light-dark(#737373, #a3a3a3)`,"--color-syntax-constant":`light-dark(#6e3500, #ffb37f)`,"--color-syntax-tag":`light-dark(#89001a, #ffaeaa)`,"--color-syntax-attribute":`light-dark(#584400, #eec12f)`,"--color-syntax-property":`light-dark(#005348, #83dac9)`,"--color-syntax-punctuation":`light-dark(#6e6e6e, #a0a0a0)`,"--color-syntax-background":`light-dark(#fafafa, #0a0a0a)`,"--color-background-surface":`light-dark(#ffffff, #262626)`,"--color-background-body":`light-dark(#f1f1f1, #1b1b1b)`,"--color-background-card":`light-dark(#ffffff, #1b1b1b)`,"--color-background-popover":`light-dark(#ffffff, #1b1b1b)`,"--color-background-muted":`light-dark(#f1f1f1, #1b1b1b)`,"--color-accent":`light-dark(#262626, #ebebeb)`,"--color-accent-muted":`light-dark(#f1f1f1, #262626)`,"--color-neutral":`light-dark(#0000000F, #FFFFFF1A)`,"--color-overlay":`light-dark(#00000080, #000000CC)`,"--color-overlay-hover":`light-dark(#0000000D, #FFFFFF0D)`,"--color-overlay-pressed":`light-dark(#0000001A, #FFFFFF1A)`,"--color-text-primary":`light-dark(#171717, #fafafa)`,"--color-text-secondary":`light-dark(#525252, #a3a3a3)`,"--color-text-disabled":`light-dark(#a3a3a3, #525252)`,"--color-text-accent":`light-dark(#262626, #ebebeb)`,"--color-on-dark":`#ffffff`,"--color-on-light":`#171717`,"--color-on-accent":`light-dark(#ffffff, #171717)`,"--color-on-success":`light-dark(#ffffff, #171717)`,"--color-on-error":`light-dark(#ffffff, #171717)`,"--color-on-warning":`#171717`,"--color-icon-accent":`light-dark(#262626, #ebebeb)`,"--color-icon-primary":`light-dark(#171717, #fafafa)`,"--color-icon-secondary":`light-dark(#737373, #a3a3a3)`,"--color-icon-disabled":`light-dark(#a3a3a3, #525252)`,"--color-success":`light-dark(#007004, #9fe59b)`,"--color-error":`light-dark(#a50c25, #ffc6c1)`,"--color-warning":`light-dark(#745b00, #fdcf4f)`,"--color-success-muted":`light-dark(#c5e5c0, #84c9803D)`,"--color-error-muted":`light-dark(#facecb, #ff9e973D)`,"--color-warning-muted":`light-dark(#f8da9d, #deb4333D)`,"--color-border":`light-dark(#00000014, #FFFFFF1A)`,"--color-border-emphasized":`light-dark(#d4d4d4, #525252)`,"--color-skeleton":`light-dark(#ebebeb, #525252)`,"--color-shadow":`light-dark(#0000001A, #0000004D)`,"--color-tint-hover":`light-dark(black, white)`,"--color-background-red":`light-dark(#facecb, #ff9e973D)`,"--color-border-red":`light-dark(#e6bab8, #ff6f6c)`,"--color-icon-red":`light-dark(#89001a, #ff9e97)`,"--color-text-red":`light-dark(#89001a, #ffc6c1)`,"--color-background-orange":`light-dark(#fad0b5, #ffa2583D)`,"--color-border-orange":`light-dark(#e6bda2, #e2883e)`,"--color-icon-orange":`light-dark(#6e3500, #ffa258)`,"--color-text-orange":`light-dark(#6e3500, #ffc9a2)`,"--color-background-yellow":`light-dark(#f8da9d, #deb4333D)`,"--color-border-yellow":`light-dark(#e4c279, #c0990e)`,"--color-icon-yellow":`light-dark(#584400, #deb433)`,"--color-text-yellow":`light-dark(#584400, #fdcf4f)`,"--color-background-green":`light-dark(#c5e5c0, #84c9803D)`,"--color-border-green":`light-dark(#b2d1ac, #69ad67)`,"--color-icon-green":`light-dark(#0c5700, #84c980)`,"--color-text-green":`light-dark(#0c5700, #9fe59b)`,"--color-background-teal":`light-dark(#a5e3d6, #7ec6b83D)`,"--color-border-teal":`light-dark(#94d6c8, #63ab9d)`,"--color-icon-teal":`light-dark(#005348, #7ec6b8)`,"--color-text-teal":`light-dark(#005348, #99e2d3)`,"--color-background-cyan":`light-dark(#a3e0ef, #83c2d43D)`,"--color-border-cyan":`light-dark(#91d3e3, #67a7b8)`,"--color-icon-cyan":`light-dark(#00505f, #83c2d4)`,"--color-text-cyan":`light-dark(#00505f, #9edef0)`,"--color-background-blue":`light-dark(#c4ddfb, #9eb7ff3D)`,"--color-border-blue":`light-dark(#b1c9e7, #6d9cfe)`,"--color-icon-blue":`light-dark(#00458c, #9eb7ff)`,"--color-text-blue":`light-dark(#00458c, #c7d3ff)`,"--color-background-purple":`light-dark(#eccef3, #f297ff3D)`,"--color-border-purple":`light-dark(#d8bbdf, #dd74f0)`,"--color-icon-purple":`light-dark(#700084, #f297ff)`,"--color-text-purple":`light-dark(#700084, #fac1ff)`,"--color-background-pink":`light-dark(#fccadc, #ff99c33D)`,"--color-border-pink":`light-dark(#e7b7c8, #f273aa)`,"--color-icon-pink":`light-dark(#83004b, #ff99c3)`,"--color-text-pink":`light-dark(#83004b, #ffc3da)`,"--color-background-gray":`light-dark(#e5e5e5, var(--color-neutral))`,"--color-border-gray":`light-dark(#d4d4d4, #262626)`,"--color-icon-gray":`light-dark(#525252, #a3a3a3)`,"--color-text-gray":`light-dark(#262626, #e5e5e5)`,"--radius-none":`0px`,"--radius-inner":`0.375rem`,"--radius-element":`0.625rem`,"--radius-container":`0.75rem`,"--radius-page":`1.75rem`,"--radius-full":`9999px`,"--shadow-low":`0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 25%)), 0 4px 8px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 40%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 8%))`,"--shadow-med":`0 2px 4px light-dark(oklch(0 0 0 / 5%), oklch(0 0 0 / 35%)), 0 4px 12px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 12%))`,"--shadow-high":`0 4px 6px light-dark(oklch(0 0 0 / 10%), oklch(0 0 0 / 50%)), 0 12px 24px light-dark(oklch(0 0 0 / 15%), oklch(0 0 0 / 70%)), inset 0 0 0 1px light-dark(transparent, oklch(1 0 0 / 15%))`,"--shadow-inset-hover":`inset 0px 0px 0px 2px #0074e24D`,"--shadow-inset-selected":`inset 0px 0px 0px 2px #0074e280`,"--shadow-inset-success":`inset 0px 0px 0px 2px #1981004D`,"--shadow-inset-warning":`inset 0px 0px 0px 2px #ffce2f4D`,"--shadow-inset-error":`inset 0px 0px 0px 2px #e33f4a4D`},components:{heading:{"level:1":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-1-size)`,fontWeight:`var(--text-heading-1-weight)`,lineHeight:`var(--text-heading-1-leading)`},"level:2":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-2-size)`,fontWeight:`var(--text-heading-2-weight)`,lineHeight:`var(--text-heading-2-leading)`},"level:3":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-3-size)`,fontWeight:`var(--text-heading-3-weight)`,lineHeight:`var(--text-heading-3-leading)`},"level:4":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-4-size)`,fontWeight:`var(--text-heading-4-weight)`,lineHeight:`var(--text-heading-4-leading)`},"level:5":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-5-size)`,fontWeight:`var(--text-heading-5-weight)`,lineHeight:`var(--text-heading-5-leading)`},"level:6":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-heading-6-size)`,fontWeight:`var(--text-heading-6-weight)`,lineHeight:`var(--text-heading-6-leading)`},"type:display-1":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-display-1-size)`,lineHeight:`var(--text-display-1-leading)`},"type:display-2":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-display-2-size)`,lineHeight:`var(--text-display-2-leading)`},"type:display-3":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-display-3-size)`,lineHeight:`var(--text-display-3-leading)`}},text:{"type:body":{fontFamily:`var(--font-family-body)`,fontSize:`var(--text-body-size)`,lineHeight:`var(--text-body-leading)`},"type:large":{fontFamily:`var(--font-family-body)`,fontSize:`var(--text-large-size)`,lineHeight:`var(--text-large-leading)`},"type:label":{fontFamily:`var(--font-family-body)`,fontSize:`var(--text-label-size)`,lineHeight:`var(--text-label-leading)`},"type:code":{fontFamily:`var(--font-family-code)`,fontSize:`var(--text-code-size)`,lineHeight:`var(--text-code-leading)`},"type:supporting":{fontFamily:`var(--font-family-body)`,fontSize:`var(--text-supporting-size)`,lineHeight:`var(--text-supporting-leading)`},"type:display-1":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-display-1-size)`,lineHeight:`var(--text-display-1-leading)`},"type:display-2":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-display-2-size)`,lineHeight:`var(--text-display-2-leading)`},"type:display-3":{fontFamily:`var(--font-family-heading)`,fontSize:`var(--text-display-3-size)`,lineHeight:`var(--text-display-3-leading)`}},button:{"variant:destructive":{backgroundColor:`var(--color-error-muted)`,color:`var(--color-error)`}},badge:{"variant:info":{backgroundColor:`light-dark(#0074e2, #6d9cfe)`,color:`light-dark(#ffffff, #171717)`},"variant:neutral":{backgroundColor:`var(--color-background-gray)`,color:`var(--color-text-gray)`},"variant:success":{backgroundColor:`light-dark(#198100, #64af4c)`,color:`light-dark(#ffffff, #171717)`},"variant:warning":{backgroundColor:`#ffce2f`,color:`#171717`},"variant:error":{backgroundColor:`light-dark(#c9303a, #ff705d)`,color:`light-dark(#ffffff, #171717)`},"variant:red":{backgroundColor:`var(--color-background-red)`,color:`var(--color-text-red)`},"variant:orange":{backgroundColor:`var(--color-background-orange)`,color:`var(--color-text-orange)`},"variant:yellow":{backgroundColor:`var(--color-background-yellow)`,color:`var(--color-text-yellow)`},"variant:green":{backgroundColor:`var(--color-background-green)`,color:`var(--color-text-green)`},"variant:teal":{backgroundColor:`var(--color-background-teal)`,color:`var(--color-text-teal)`},"variant:cyan":{backgroundColor:`var(--color-background-cyan)`,color:`var(--color-text-cyan)`},"variant:blue":{backgroundColor:`var(--color-background-blue)`,color:`var(--color-text-blue)`},"variant:purple":{backgroundColor:`var(--color-background-purple)`,color:`var(--color-text-purple)`},"variant:pink":{backgroundColor:`var(--color-background-pink)`,color:`var(--color-text-pink)`},"variant:gray":{backgroundColor:`var(--color-background-gray)`,color:`var(--color-text-gray)`}},statusdot:{"variant:success":{backgroundColor:`light-dark(#198100, #64af4c)`},"variant:warning":{backgroundColor:`#ffce2f`},"variant:error":{backgroundColor:`light-dark(#c9303a, #ff705d)`},"variant:accent":{backgroundColor:`light-dark(#0074e2, #6d9cfe)`}},banner:{"status:info":{"--color-accent-muted":`var(--color-background-blue)`,"--color-text-primary":`var(--color-text-blue)`,"--color-text-secondary":`var(--color-text-blue)`,"--color-accent":`var(--color-text-blue)`},"status:success":{"--color-text-primary":`var(--color-text-green)`,"--color-text-secondary":`var(--color-text-green)`,"--color-success":`var(--color-text-green)`},"status:warning":{"--color-text-primary":`var(--color-text-yellow)`,"--color-text-secondary":`var(--color-text-yellow)`,"--color-warning":`var(--color-text-yellow)`},"status:error":{"--color-text-primary":`var(--color-text-red)`,"--color-text-secondary":`var(--color-text-red)`,"--color-error":`var(--color-text-red)`}},switch:{base:{"--color-background-gray":`var(--color-border-emphasized)`}},progressbar:{base:{"--color-background-muted":`var(--color-border-emphasized)`},"variant:accent":{"--color-accent":`#0074e2`},"variant:success":{"--color-success":`#198100`},"variant:warning":{"--color-warning":`#ffce2f`},"variant:error":{"--color-error":`#c9303a`}},card:{base:{padding:`var(--spacing-3)`}},section:{base:{padding:`var(--spacing-3)`}}},__onDark:{tokens:{"color-scheme":`dark`,"--color-text-primary":`var(--color-on-dark)`,"--color-icon-primary":`var(--color-on-dark)`,"--color-accent":`var(--color-on-dark)`}},__onLight:{tokens:{"color-scheme":`light`,"--color-text-primary":`var(--color-on-light)`,"--color-icon-primary":`var(--color-on-light)`,"--color-accent":`var(--color-on-light)`}},icons:{close:(0,q.jsx)(je,{...TY}),chevronDown:(0,q.jsx)(is,{...TY}),chevronLeft:(0,q.jsx)(as,{...TY}),chevronRight:(0,q.jsx)(os,{...TY}),chevronsLeft:(0,q.jsx)(ss,{...TY}),chevronsRight:(0,q.jsx)(cs,{...TY}),check:(0,q.jsx)(rs,{...TY}),success:(0,q.jsx)(us,{...TY}),error:(0,q.jsx)(ms,{...TY}),warning:(0,q.jsx)(Wc,{...TY}),info:(0,q.jsx)(Js,{...TY}),calendar:(0,q.jsx)(ts,{...TY}),clock:(0,q.jsx)(ys,{...TY}),externalLink:(0,q.jsx)(Os,{...TY}),menu:(0,q.jsx)(sc,{...TY}),moreHorizontal:(0,q.jsx)(Ds,{...TY}),search:(0,q.jsx)(Dc,{...TY}),arrowUp:(0,q.jsx)(Xo,{...TY}),arrowDown:(0,q.jsx)(ue,{...TY}),arrowsUpDown:(0,q.jsx)(Jo,{...TY}),funnel:(0,q.jsx)(Hs,{...TY}),eyeSlash:(0,q.jsx)(ks,{...TY}),viewColumns:(0,q.jsx)(xs,{...TY}),copy:(0,q.jsx)(Ss,{...TY}),checkDouble:(0,q.jsx)(ns,{...TY}),wrench:(0,q.jsx)(Xc,{...TY}),stop:(0,q.jsx)(Rc,{...TY}),microphone:(0,q.jsx)(dc,{...TY})}};function DY({children:e}){let t=nu(WG,e=>e.snapshot?.preferences),n=t?.theme??`system`,r=t?.appearance??BW,i=HW(n,r),a=t?.chatWidth??820,o=t?.chatFontSize??14,[s,c]=(0,K.useState)(()=>window.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1);(0,K.useEffect)(()=>{let e=window.matchMedia?.(`(prefers-color-scheme: dark)`);if(!e)return;let t=()=>c(e.matches);return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let l=n===`system`?s?`dark`:`light`:n,u=l===`dark`||l===`pine`?`dark`:`light`;return(0,K.useEffect)(()=>{let e=document.documentElement;e.dataset.theme=l,e.dataset.palette=i,e.style.setProperty(`--conversation-content-width`,`${a}px`),e.style.setProperty(`--conversation-font-size`,`${o}px`);let t={};if(r.background&&(t[`--page`]=r.background),r.foreground&&(t[`--text`]=r.foreground),r.background||r.foreground)for(let[e,n]of Object.entries({sidebar:3,"sidebar-hover":7,"sidebar-active":10,border:12,"border-strong":22,muted:65,subtle:52,"settings-secondary-text":75}))t[`--${e}`]=`color-mix(in srgb, var(--text) ${n}%, var(--page))`;r.accent&&(t[`--accent`]=r.accent,t[`--focus`]=r.accent),e.style.setProperty(`--openpi-interface-font`,{codex:`var(--openpi-default-font)`,system:`var(--openpi-default-font)`,sans:`Arial, Helvetica, sans-serif`,serif:`Georgia, 'Times New Roman', serif`,mono:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`}[r.font]);for(let n of[`page`,`text`,`sidebar`,`sidebar-hover`,`sidebar-active`,`border`,`border-strong`,`muted`,`subtle`,`settings-secondary-text`,`accent`,`focus`]){let r=t[`--${n}`];r?e.style.setProperty(`--${n}`,r):e.style.removeProperty(`--${n}`)}},[r,o,a,i,l]),(0,q.jsx)(Ql,{i18n:Xl,children:(0,q.jsx)(Tu,{theme:EY,mode:u,children:e})})}var OY=document.getElementById(`root`);if(!OY)throw Error(`OpenPI Web root is missing`);(0,el.createRoot)(OY).render((0,q.jsx)(K.StrictMode,{children:(0,q.jsx)(DY,{children:(0,q.jsx)(wY,{})})})); \ No newline at end of file diff --git a/web/dist/build-info.json b/web/dist/build-info.json index 9eb103922..2484725b3 100644 --- a/web/dist/build-info.json +++ b/web/dist/build-info.json @@ -1,5 +1,5 @@ { "version": "1.1.0", - "id": "f3ee7c6867d04f8c4196c6eac9e8b2bb2ab35767fca8d07d66124511dbd50d7d", + "id": "0746de8f104151b57ab00e1b97ff31bc252ab81b2e22c6739aa61c0100ae4658", "mode": "production" } diff --git a/web/ui/src/features/transcript/transcript-entries.ts b/web/ui/src/features/transcript/transcript-entries.ts index da0c2ecb4..22b152b04 100644 --- a/web/ui/src/features/transcript/transcript-entries.ts +++ b/web/ui/src/features/transcript/transcript-entries.ts @@ -86,9 +86,56 @@ function legacySignature(message: WebLiveMessage) { : JSON.stringify({ ...message, timestamp: undefined }); } +// Transport fitting only changes text and its truncation flags. Qualify every +// retained field and part, including thinking, rather than treating an empty +// visible reply (or a shared prefix) as proof of message identity. +function matchesTransportProjection( + live: WebLiveMessage, + native: WebLiveMessage, +) { + let retainedPrefix = false; + const textMatches = (short: string, full: string) => { + if (short === full) return true; + if (!short.endsWith("\n[truncated]")) return false; + const prefix = short.slice(0, -"\n[truncated]".length); + if (prefix.length) retainedPrefix = true; + return full.startsWith(prefix); + }; + if (!textMatches(live.content, native.content)) return false; + if (live.parts?.length !== native.parts?.length) return false; + const parts = live.parts?.map((part, index) => { + const original = native.parts?.[index]; + if ( + (part.type === "text" || part.type === "thinking") && + original?.type === part.type && + textMatches(part.text, original.text) + ) { + return part.type === "thinking" && original.type === "thinking" + ? { + ...part, + text: original.text, + textTruncated: original.textTruncated, + } + : { ...part, text: original.text }; + } + return part; + }); + return ( + retainedPrefix && + JSON.stringify({ + ...live, + content: native.content, + parts, + truncation: native.truncation, + timestamp: undefined, + }) === JSON.stringify({ ...native, timestamp: undefined }) + ); +} + export interface TranscriptPresentationState { nativeRowKeys: Map; ambiguousTimingIds: Set; + nativeTimingKeys?: Map; } interface PersistedProjection { @@ -104,7 +151,6 @@ interface PersistedProjection { nativeMessages: { identity: string | undefined; signature: string; - content: string; }[]; promptCandidates: { key: string; @@ -239,7 +285,6 @@ function persistedTranscriptProjection( const nativeMessages = baseEntries.map((entry) => ({ identity: messageIdentity(entry.message), signature: legacySignature(entry.message), - content: entry.message.content, })); const nativeByIdentity = new Map(); const nativeByLegacySignature = new Map(); @@ -343,6 +388,8 @@ export function buildEntries( presentation: TranscriptPresentationState, ) { const { nativeRowKeys, ambiguousTimingIds } = presentation; + const previouslyAmbiguous = new Set(ambiguousTimingIds); + const nativeTimingKeys = (presentation.nativeTimingKeys ??= new Map()); const selected = snapshot.selectedSession; const persisted = selected?.entries ?? []; const projection = persistedTranscriptProjection(persisted, selected?.id); @@ -350,6 +397,8 @@ export function buildEntries( if (!projection.nativeById.has(id)) nativeRowKeys.delete(id); for (const id of ambiguousTimingIds) if (!projection.nativeById.has(id)) ambiguousTimingIds.delete(id); + for (const id of nativeTimingKeys.keys()) + if (!projection.nativeById.has(id)) nativeTimingKeys.delete(id); // Native IDs own historic rows. A live disclosure can keep its existing DOM // only when both sides contain exactly one complete, equal projected payload. const exactLive = new Map(); @@ -378,29 +427,61 @@ export function buildEntries( aliasedKeys.add(key); } for (const id of projection.ambiguousNativeIds) ambiguousTimingIds.add(id); + const candidatesFor = (message: WebLiveMessage) => { + const identity = messageIdentity(message); + if (!message.truncation?.transport) + return identity === undefined + ? (projection.nativeByLegacySignature.get(legacySignature(message)) ?? + []) + : (projection.nativeByIdentity.get(identity) ?? []).filter( + (index) => + projection.nativeMessages[index]?.signature === + legacySignature(message), + ); + const indexes = + identity === undefined + ? projection.baseEntries.map((_, index) => index) + : (projection.nativeByIdentity.get(identity) ?? []); + return indexes.filter((index) => + matchesTransportProjection( + message, + projection.baseEntries[index]!.message, + ), + ); + }; const timingAt = new Map(); const ambiguousLiveTiming = new Set(); for (const live of liveMessages) { const lookup = messageIdentity(live.message) ?? live.key; - const indexes = projection.lookupIndexes.get(lookup); - if (!indexes) continue; + const indexes = projection.lookupIndexes.get(lookup) ?? []; // Provider timestamps can repeat; timing must follow the same payload // qualification as native/live message reconciliation. - const signature = legacySignature(live.message); - const matches = indexes.filter( - (index) => projection.nativeMessages[index]?.signature === signature, - ); + const matches = candidatesFor(live.message); + if (matches.length > 1) + for (const index of matches) { + const id = projection.baseEntries[index]!.entryId; + if (id) ambiguousTimingIds.add(id); + } if (matches.length !== indexes.length || indexes.length > 1) ambiguousLiveTiming.add(lookup); if (matches.length === 1) { const index = matches[0]!; const id = projection.baseEntries[index]!.entryId; - const establishedKey = id ? nativeRowKeys.get(id) : undefined; + const establishedKey = id + ? (nativeRowKeys.get(id) ?? nativeTimingKeys.get(id)) + : undefined; if ( (establishedKey && establishedKey !== live.key) || - (id && ambiguousTimingIds.has(id) && !establishedKey && live.key !== id) + (id && + ambiguousTimingIds.has(id) && + !( + live.message.truncation?.transport && !previouslyAmbiguous.has(id) + ) && + !establishedKey && + live.key !== id) ) { ambiguousLiveTiming.add(lookup); + if (id) ambiguousTimingIds.add(id); continue; } const previous = timingAt.get(index); @@ -410,6 +491,7 @@ export function buildEntries( // Equal payloads still cannot identify which live message owns timing. timingAt.set(index, null); ambiguousLiveTiming.add(lookup); + if (id) ambiguousTimingIds.add(id); } } } @@ -521,13 +603,9 @@ export function buildEntries( const identity = messageIdentity(message); const toolIdentity = toolMessageIdentity(message); const legacy = legacySignature(message); - // A live message shortened to fit one SSE event never equals its - // persisted entry; the same identity with a matching text prefix does. - const transportPrefix = message.truncation?.transport - ? message.content.replace(/\n\[truncated\]$/, "") - : undefined; - const match = - identity === undefined + const match = message.truncation?.transport + ? firstUnmatched(candidatesFor(message), matchedMessages) + : identity === undefined ? firstUnmatched( projection.nativeByLegacySignature.get(legacy), matchedMessages, @@ -536,11 +614,7 @@ export function buildEntries( (index) => (toolIdentity !== undefined || !matchedMessages.has(index)) && (toolIdentity !== undefined || - (transportPrefix !== undefined - ? projection.nativeMessages[index]?.content.startsWith( - transportPrefix, - ) - : projection.nativeMessages[index]?.signature === legacy)), + projection.nativeMessages[index]?.signature === legacy), ) ?? -1); if (match >= 0) { matchedMessages.add(match); @@ -603,6 +677,13 @@ export function buildEntries( for (const [index, timingKey] of timingAt) { if (timingKey === null) continue; const current = persistedRows[index]; + if (!current) continue; + if (current.entryId) nativeTimingKeys.set(current.entryId, timingKey); + } + for (const [id, timingKey] of nativeTimingKeys) { + const index = projection.indexById.get(id); + if (index === undefined) continue; + const current = persistedRows[index]; if (!current || current.timingKey === timingKey) continue; rewrite(index, { ...current, timingKey }); } From 0c68a241fc5604e3d5a3dde7e1fe23eca8d246e2 Mon Sep 17 00:00:00 2001 From: tt-a1i <53142663+tt-a1i@users.noreply.github.com> Date: Sat, 31 Oct 2026 08:53:55 +0800 Subject: [PATCH 3/3] fix(web): regenerate committed dist with locked CI dependencies --- web/dist/app-MermaidPreview.js | 10 ++--- web/dist/app-abnfDiagram-O67JEVCF.js | 2 +- web/dist/app-architectureDiagram-NJMV4G6O.js | 6 +-- web/dist/app-blockDiagram-BEXU5L5S.js | 8 ++-- web/dist/app-c4Diagram-YGBWAQC7.js | 2 +- web/dist/app-chunk-3FUC2YCW.js | 2 +- web/dist/app-chunk-7INBJB4K.js | 40 ++++++++++---------- web/dist/app-chunk-7M6MHVWA.js | 10 ++--- web/dist/app-chunk-GNY47TPC.js | 4 +- web/dist/app-chunk-UA2S7LBM.js | 2 +- web/dist/app-chunk-Z7XXMR3K.js | 6 +-- web/dist/app-classDiagram-v2-NBCMYWYE.js | 8 ++-- web/dist/app-dagre-6A5THRUB.js | 4 +- web/dist/app-diagram-22UHCM2B.js | 14 +++---- web/dist/app-diagram-3UASUU5V.js | 2 +- web/dist/app-diagram-ATOU4E4O.js | 6 +-- web/dist/app-diagram-CDSNMT55.js | 4 +- web/dist/app-ebnfDiagram-ZINNZB2B.js | 2 +- web/dist/app-elk-276RUBZZ.js | 4 +- web/dist/app-erDiagram-OPXOYQCR.js | 4 +- web/dist/app-flowDiagram-KWPJA3E3.js | 2 +- web/dist/app-kanban-definition-PNTS6WVX.js | 10 ++--- web/dist/app-mindmap-definition-NLK3R4M7.js | 4 +- web/dist/app-pegDiagram-GJSIUBJH.js | 2 +- web/dist/app-railroadDiagram-XR7U4H2S.js | 2 +- web/dist/app-requirementDiagram-PLB6GJNP.js | 4 +- web/dist/app-sequenceDiagram-PO4LG4MO.js | 10 ++--- web/dist/app-stateDiagram-v2-GCMORJYK.js | 4 +- web/dist/app-swimlanes-2SLR337P.js | 2 +- web/dist/app-swimlanesDiagram-TC7HE7FX.js | 2 +- web/dist/app-usecaseDiagram-POWQR4AR.js | 4 +- web/dist/app.js | 4 +- web/dist/build-info.json | 2 +- 33 files changed, 96 insertions(+), 96 deletions(-) diff --git a/web/dist/app-MermaidPreview.js b/web/dist/app-MermaidPreview.js index ad29af2fc..e38a406ce 100644 --- a/web/dist/app-MermaidPreview.js +++ b/web/dist/app-MermaidPreview.js @@ -1,11 +1,11 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["app-c4Diagram-YGBWAQC7.js","app-chunk-Y2CYZVJY.js","app-src.js","app-rolldown-runtime.js","app-chunk-O7XYJQB3.js","app-preload-helper.js","app-purify.es.js","app-chunk-ZIGJFQKS.js","app-dist.js","app-chunk-7PRAP22T.js","app-chunk-742MDFTN.js","app-chunk-MBY4JIJT.js","app-chunk-7INBJB4K.js","app-chunk-J5ZVWO5B.js","app-rough.esm.js","app-chunk-GWA4HPMP.js","app-flowDiagram-KWPJA3E3.js","app-chunk-LNGE3PJU.js","app-chunk-5DYCD2WN.js","app-chunk-UA2S7LBM.js","app-chunk-Z7XXMR3K.js","app-line.js","app-path.js","app-array.js","app-chunk-GNY47TPC.js","app-chunk-DUW6YSOI.js","app-chunk-XXDRQBXY.js","app-chunk-WEXAMYUT.js","app-chunk-7M6MHVWA.js","app-channel.js","app-chunk-5VM5RSS4.js","app-diagram-22UHCM2B.js","app-swimlanesDiagram-TC7HE7FX.js","app-erDiagram-OPXOYQCR.js","app-gitGraphDiagram-X574FWY7.js","app-chunk-JWPE2WC7.js","app-mermaid-parser.core.js","app-chunk-FOHPRMQF.js","app-chunk-6AZGARVD.js","app-chunk-6TQVIW2G.js","app-chunk-6EIED4P4.js","app-chunk-KI3K4JFJ.js","app-chunk-5V3GS4D5.js","app-chunk-UY3FDG6J.js","app-chunk-3Z5EZCMW.js","app-chunk-I5DQTOEV.js","app-chunk-OUJLGHUK.js","app-chunk-XHIXRSVI.js","app-chunk-2ZTRR5NV.js","app-chunk-747NJXEK.js","app-chunk-IH6LHLGP.js","app-chunk-6K3QC6MW.js","app-chunk-ICYGCRZG.js","app-chunk-2Q5K7J3B.js","app-ganttDiagram-FUAMR5RP.js","app-linear.js","app-defaultLocale.js","app-init.js","app-infoDiagram-VRGFBTTK.js","app-chunk-6AEJRKK7.js","app-pieDiagram-5QR66LMP.js","app-ordinal.js","app-arc.js","app-quadrantDiagram-O4NWA36T.js","app-xychartDiagram-PMCCYNJV.js","app-requirementDiagram-PLB6GJNP.js","app-sequenceDiagram-PO4LG4MO.js","app-classDiagram-v2-NBCMYWYE.js","app-stateDiagram-v2-GCMORJYK.js","app-journeyDiagram-ZHPQQLJL.js","app-timeline-definition-EJHVYXUP.js","app-mindmap-definition-NLK3R4M7.js","app-kanban-definition-PNTS6WVX.js","app-sankeyDiagram-IPEJSGJF.js","app-diagram-MLGK6HIB.js","app-diagram-MPIPVDR6.js","app-blockDiagram-BEXU5L5S.js","app-graphlib.js","app-diagram-CDSNMT55.js","app-architectureDiagram-NJMV4G6O.js","app-cytoscape.esm.js","app-diagram-ATOU4E4O.js","app-ishikawaDiagram-OU5B5YK6.js","app-vennDiagram-UO4OBE2U.js","app-diagram-3UASUU5V.js","app-usecaseDiagram-POWQR4AR.js","app-wardleyDiagram-VNRHLVJA.js","app-cynefinDiagram-VND7K2PF.js","app-railroadDiagram-XR7U4H2S.js","app-chunk-GTNCS2PH.js","app-ebnfDiagram-ZINNZB2B.js","app-abnfDiagram-O67JEVCF.js","app-pegDiagram-GJSIUBJH.js"])))=>i.map(i=>d[i]); -import{i as e}from"./app-rolldown-runtime.js";import{n as t,t as n}from"./app-jsx-runtime.js";import{t as r}from"./app-preload-helper.js";import{a as i,t as a}from"./app-useTranslation.js";import{n as o,r as s,t as c}from"./app-x.js";import{t as l}from"./app-purify.es.js";import{n as u}from"./app-chunk-Y2CYZVJY.js";import{h as d,m as f,p}from"./app-src.js";import{$ as m,C as h,E as g,I as _,J as v,K as y,L as b,N as x,P as S,Q as C,S as w,T as ee,V as te,W as ne,Z as T,_ as re,b as E,c as ie,f as ae,g as oe,l as D,m as O,n as se,p as ce,r as le,t as ue,u as de}from"./app-chunk-O7XYJQB3.js";import{S as fe,a as pe,f as me,g as k,h as he,i as ge,o as _e,v as ve,x as ye,y as be}from"./app-chunk-ZIGJFQKS.js";import{t as xe}from"./app-chunk-6AEJRKK7.js";import{n as Se,t as Ce}from"./app-chunk-LNGE3PJU.js";import"./app-chunk-7PRAP22T.js";import{r as we}from"./app-chunk-742MDFTN.js";import{a as Te}from"./app-chunk-MBY4JIJT.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{n as Ee}from"./app-chunk-GNY47TPC.js";var De=i(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]);function Oe(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function ke(e){if(e==null)return!0;if(ye(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!fe(e)&&!ve(e)&&!be(e)?!1:e.length===0;if(typeof e==`object`||typeof e==`function`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return Oe(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var Ae=`comm`,je=`rule`,Me=`decl`,Ne=`@import`,Pe=`@namespace`,Fe=`@keyframes`,Ie=`@layer`,Le=Math.abs,A=String.fromCharCode;function Re(e){return e.trim()}function ze(e,t,n){return e.replace(t,n)}function j(e,t){return e.charCodeAt(t)|0}function M(e,t,n){return e.slice(t,n)}function N(e){return e.length}function Be(e){return e.length}function P(e,t){return t.push(e),e}var F=1,I=1,Ve=0,L=0,R=0,z=``;function B(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:F,column:I,length:o,return:``,siblings:s}}function He(){return R}function Ue(){return R=L>0?j(z,--L):0,I--,R===10&&(I=1,F--),R}function V(){return R=L2||G(R)>3?``:` `}function Je(e,t){for(;--t&&V()&&!(R<48||R>102||R>57&&R<65||R>70&&R<97););return W(e,U()+(t<6&&H()==32&&V()==32))}function Ye(e){for(;V();)switch(R){case e:return L;case 34:case 39:e!==34&&e!==39&&Ye(R);break;case 40:e===41&&Ye(e);break;case 92:V();break}return L}function Xe(e,t){for(;V()&&e+R!==57&&(e+R!==84||H()!==47););return`/*`+W(t,L-1)+`*`+A(e===47?e:V())}function Ze(e){for(;!G(H());)V();return W(e,L)}function Qe(e){return Ge(K(``,null,null,null,[``],e=We(e),0,[0],e))}function K(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=V()){case 40:m!=108&&j(w,d-1)==58?(v++,w+=`(`):w+=Ke(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=Ke(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=A(y);break}w+=qe(m);break;case 92:w+=Je(U()-1,7);continue;case 47:switch(H()){case 42:case 47:P(et(Xe(V(),U()),t,n,c),c),(G(m||1)==5||G(H()||1)==5)&&N(w)&&M(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=N(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=A(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=ze(w,/\f/g,``)),p>0&&(N(w)-d||h===0)&&P(p>32?tt(w+`;`,r,n,d-1,c):tt(ze(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(P(C=$e(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)K(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(j(w,3)===110)break;case 108:if(j(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?K(e,C,C,r&&P($e(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):K(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+N(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&Ue()==125)continue}switch(w+=A(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(N(w)-1)*_,_=1;break;case 64:H()===45&&(w+=Ke(V())),f=H(),u=d=N(b=w+=Ze(U())),y++;break;case 45:m===45&&N(w)==2&&(h=0)}}return a}function $e(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=Be(p),h=0,g=0,_=0;h0?p[v]+` `+y:ze(y,/&\f/g,p[v])))&&(c[_++]=b);return B(e,t,n,i===0?je:s,c,l,u,d)}function et(e,t,n,r){return B(e,t,n,Ae,A(He()),M(e,2,-2),0,r)}function tt(e,t,n,r,i){return B(e,t,n,Me,M(e,0,r),M(e,r+1,-1),r,i)}function nt(e,t){for(var n=``,r=0;r/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-c4Diagram-YGBWAQC7.js`);return{diagram:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));return{id:at,diagram:e}},`loader`)},st=`flowchart-v2`,ct={id:st,detector:u(e=>/^\s*(graph|flowchart)/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-flowDiagram-KWPJA3E3.js`);return{diagram:e}},__vite__mapDeps([16,2,3,1,4,5,6,7,8,17,9,10,11,12,13,14,18,19,20,21,22,23,24,25,15,26,27,28,29,30]));return{id:st,diagram:e}},`loader`)},lt=`agentflow`,ut={id:lt,detector:u(e=>/^\s*agentflow-beta\b/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-22UHCM2B.js`);return{diagram:e}},__vite__mapDeps([31,6,1,2,3,4,5,29,7,8,17,9,10,11,13,12,14,18,19,20,21,22,23,24,25,30,15,26,27]));return{id:lt,diagram:e}},`loader`)},dt=`swimlane`,ft={id:dt,detector:u(e=>/^\s*swimlane-beta\b/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-swimlanesDiagram-TC7HE7FX.js`);return{diagram:e}},__vite__mapDeps([32,1,2,3,4,5,6,7,8,17,9,10,11,12,13,14,18,19,20,21,22,23,24,25,15,26,27,28,29,30]));return{id:dt,diagram:e}},`loader`)},pt=`er`,mt={id:pt,detector:u(e=>/^\s*erDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-erDiagram-OPXOYQCR.js`);return{diagram:e}},__vite__mapDeps([33,1,2,3,4,5,6,29,7,8,9,10,11,13,12,14,18,19,20,21,22,23,24,25,26,27]));return{id:pt,diagram:e}},`loader`)},ht=`gitGraph`,gt={id:ht,detector:u(e=>/^\s*gitGraph/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-gitGraphDiagram-X574FWY7.js`);return{diagram:e}},__vite__mapDeps([34,1,2,3,4,5,6,7,8,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53]));return{id:ht,diagram:e}},`loader`)},_t=`gantt`,vt={id:_t,detector:u(e=>/^\s*gantt/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-ganttDiagram-FUAMR5RP.js`);return{diagram:e}},__vite__mapDeps([54,3,1,2,4,5,6,55,56,57,8,7]));return{id:_t,diagram:e}},`loader`)},yt=`info`,bt={id:yt,detector:u(e=>/^\s*info/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-infoDiagram-VRGFBTTK.js`);return{diagram:e}},__vite__mapDeps([58,1,2,3,4,5,6,59,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:yt,diagram:e}},`loader`)},xt=`pie`,St={id:xt,detector:u(e=>/^\s*pie/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-pieDiagram-5QR66LMP.js`);return{diagram:e}},__vite__mapDeps([60,1,2,3,4,5,6,61,57,22,8,62,23,7,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:xt,diagram:e}},`loader`)},Ct=`quadrantChart`,wt={id:Ct,detector:u(e=>/^\s*quadrantChart/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-quadrantDiagram-O4NWA36T.js`);return{diagram:e}},__vite__mapDeps([63,1,2,3,4,5,6,55,56,57]));return{id:Ct,diagram:e}},`loader`)},Tt=`xychart`,Et={id:Tt,detector:u(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-xychartDiagram-PMCCYNJV.js`);return{diagram:e}},__vite__mapDeps([64,1,2,3,4,5,6,55,56,57,61,7,8,21,22,23,59,10,11]));return{id:Tt,diagram:e}},`loader`)},Dt=`requirement`,Ot={id:Dt,detector:u(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-requirementDiagram-PLB6GJNP.js`);return{diagram:e}},__vite__mapDeps([65,1,2,3,4,5,6,7,8,9,10,11,13,12,14,18,19,20,21,22,23,24,25,26,27]));return{id:Dt,diagram:e}},`loader`)},kt=`sequence`,At={id:kt,detector:u(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-sequenceDiagram-PO4LG4MO.js`);return{diagram:e}},__vite__mapDeps([66,1,2,3,4,5,6,8,7,17,15,53]));return{id:kt,diagram:e}},`loader`)},jt=`classDiagram`,Mt={id:jt,detector:u(e=>/^\s*classDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-classDiagram-v2-NBCMYWYE.js`);return{diagram:e}},__vite__mapDeps([67,6,1,2,3,4,5,7,8,9,10,11,13,12,14,18,19,20,21,22,23,24,25,30,15,26,27]));return{id:jt,diagram:e}},`loader`)},Nt=`stateDiagram`,Pt={id:Nt,detector:u(e=>/^\s*stateDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-stateDiagram-v2-GCMORJYK.js`);return{diagram:e}},__vite__mapDeps([68,6,1,2,3,4,5,7,8,9,10,11,13,12,14,18,19,20,21,22,23,24,25,15,26,27]));return{id:Nt,diagram:e}},`loader`)},Ft=`journey`,It={id:Ft,detector:u(e=>/^\s*journey/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-journeyDiagram-ZHPQQLJL.js`);return{diagram:e}},__vite__mapDeps([69,1,2,3,4,5,6,62,22,8,30,15]));return{id:Ft,diagram:e}},`loader`)},Lt={draw:u((e,t,n)=>{f.debug(`rendering svg for syntax error -`);let r=xe(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),ie(r,100,512,!0),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},Rt=Lt,zt={db:{},renderer:Lt,parser:{parse:u(()=>{},`parse`)}},Bt=`flowchart-elk`,Vt={id:Bt,detector:u((e,t={})=>/^\s*flowchart-elk/.test(e)?(t.layout=`elk`,!0):!1,`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-flowDiagram-KWPJA3E3.js`);return{diagram:e}},__vite__mapDeps([16,2,3,1,4,5,6,7,8,17,9,10,11,12,13,14,18,19,20,21,22,23,24,25,15,26,27,28,29,30]));return{id:Bt,diagram:e}},`loader`)},Ht=`timeline`,Ut={id:Ht,detector:u(e=>/^\s*timeline/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-timeline-definition-EJHVYXUP.js`);return{diagram:e}},__vite__mapDeps([70,1,2,3,4,5,6,62,22,8,7,59,13]));return{id:Ht,diagram:e}},`loader`)},Wt=`mindmap`,Gt={id:Wt,detector:u(e=>/^\s*mindmap/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-mindmap-definition-NLK3R4M7.js`);return{diagram:e}},__vite__mapDeps([71,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18,19,20,21,22,23,24,25,26,27]));return{id:Wt,diagram:e}},`loader`)},Kt=`kanban`,qt={id:Kt,detector:u(e=>/^\s*kanban/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-kanban-definition-PNTS6WVX.js`);return{diagram:e}},__vite__mapDeps([72,1,2,3,4,5,6,7,8,59,17,9,10,11,12,13,14,18,19,30]));return{id:Kt,diagram:e}},`loader`)},Jt=`sankey`,Yt={id:Jt,detector:u(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-sankeyDiagram-IPEJSGJF.js`);return{diagram:e}},__vite__mapDeps([73,1,2,3,4,5,6,61,57]));return{id:Jt,diagram:e}},`loader`)},Xt=`packet`,Zt={id:Xt,detector:u(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-MLGK6HIB.js`);return{diagram:e}},__vite__mapDeps([74,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:Xt,diagram:e}},`loader`)},Qt=`radar`,$t={id:Qt,detector:u(e=>/^\s*radar-beta/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-MPIPVDR6.js`);return{diagram:e}},__vite__mapDeps([75,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:Qt,diagram:e}},`loader`)},en=`block`,tn={id:en,detector:u(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-blockDiagram-BEXU5L5S.js`);return{diagram:e}},__vite__mapDeps([76,1,2,3,4,5,6,29,7,8,25,9,10,11,13,12,14,18,20,21,22,23,30,77]));return{id:en,diagram:e}},`loader`)},nn=`treeView`,rn={id:nn,detector:u(e=>/^\s*treeView-beta/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-CDSNMT55.js`);return{diagram:e}},__vite__mapDeps([78,1,2,3,4,5,6,7,8,59,10,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53]));return{id:nn,diagram:e}},`loader`)},an=`architecture`,on={id:an,detector:u(e=>/^\s*architecture/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-architectureDiagram-NJMV4G6O.js`);return{diagram:e}},__vite__mapDeps([79,3,1,2,4,5,6,7,8,59,10,11,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,80]));return{id:an,diagram:e}},`loader`)},sn=`eventmodeling`,cn={id:sn,detector:u(e=>/^\s*eventmodeling/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-ATOU4E4O.js`);return{diagram:e}},__vite__mapDeps([81,1,2,3,4,5,6,7,8,37,35,36,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:sn,diagram:e}},`loader`)},ln=`ishikawa`,un={id:ln,detector:u(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-ishikawaDiagram-OU5B5YK6.js`);return{diagram:e}},__vite__mapDeps([82,1,2,3,4,5,6,7,8,59,14]));return{id:ln,diagram:e}},`loader`)},dn=`venn`,fn={id:dn,detector:u(e=>/^\s*venn-beta/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-vennDiagram-UO4OBE2U.js`);return{diagram:e}},__vite__mapDeps([83,1,2,3,4,5,6,7,8,59,14]));return{id:dn,diagram:e}},`loader`)},pn=`treemap`,mn={id:pn,detector:u(e=>/^\s*treemap/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-3UASUU5V.js`);return{diagram:e}},__vite__mapDeps([84,1,2,3,4,5,6,61,57,56,7,8,59,9,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,27]));return{id:pn,diagram:e}},`loader`)},hn=`usecase`,gn={id:hn,detector:u(e=>/^\s*usecase-beta(?:\s|$)/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-usecaseDiagram-POWQR4AR.js`);return{diagram:e}},__vite__mapDeps([85,1,2,3,4,5,6,7,8,9,10,11,13,12,14,18,19,20,21,22,23,24,25,26,27]));return{id:hn,diagram:e}},`loader`)},_n=`wardley`,vn={id:_n,detector:u(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-wardleyDiagram-VNRHLVJA.js`);return{diagram:e}},__vite__mapDeps([86,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:_n,diagram:e}},`loader`)},yn=`cynefin`,bn={id:yn,detector:u(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-cynefinDiagram-VND7K2PF.js`);return{diagram:e}},__vite__mapDeps([87,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:yn,diagram:e}},`loader`)},xn=`railroad`,Sn={id:xn,detector:u(e=>/^\s*railroad-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-railroadDiagram-XR7U4H2S.js`);return{diagram:e}},__vite__mapDeps([88,1,2,3,4,5,6,59,46,37,89,35,36,38,39,40,41,42,43,44,45,47,48,49,50,51,52]));return{id:xn,diagram:e}},`loader`)},Cn=`railroadEbnf`,wn={id:Cn,detector:u(e=>/^\s*railroad-ebnf-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-ebnfDiagram-ZINNZB2B.js`);return{diagram:e}},__vite__mapDeps([90,1,2,3,4,5,6,59,48,37,89,35,36,38,39,40,41,42,43,44,45,46,47,49,50,51,52]));return{id:Cn,diagram:e}},`loader`)},Tn=`railroadAbnf`,En={id:Tn,detector:u(e=>/^\s*railroad-abnf-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-abnfDiagram-O67JEVCF.js`);return{diagram:e}},__vite__mapDeps([91,1,2,3,4,5,6,59,47,37,89,35,36,38,39,40,41,42,43,44,45,46,48,49,50,51,52]));return{id:Tn,diagram:e}},`loader`)},Dn=`railroadPeg`,On={id:Dn,detector:u(e=>/^\s*railroad-peg-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-pegDiagram-GJSIUBJH.js`);return{diagram:e}},__vite__mapDeps([92,1,2,3,4,5,6,59,49,37,89,35,36,38,39,40,41,42,43,44,45,46,47,48,50,51,52]));return{id:Dn,diagram:e}},`loader`)},kn=!1,q=u(()=>{kn||(kn=!0,x(`error`,zt,e=>e.toLowerCase().trim()===`error`),x(`---`,{db:{clear:u(()=>{},`clear`)},styles:{},renderer:{draw:u(()=>{},`draw`)},parser:{parse:u(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:u(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),S(Vt,Gt,on),S(ut,ot,qt,Mt,mt,vt,bt,St,Ot,At,ft,ct,Ut,gt,Pt,It,wt,Yt,Zt,Et,tn,cn,rn,$t,un,mn,Sn,wn,En,On,fn,vn,bn,gn))},`addDiagrams`),An=u(async()=>{f.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(O).map(async([e,{detector:t,loader:n}])=>{if(n)try{w(e)}catch{try{let{diagram:e,id:r}=await n();x(r,e,t)}catch(t){throw f.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete O[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){f.error(`Failed to load ${e.length} external diagrams`);for(let t of e)f.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),jn=`graphics-document document`;function Mn(e,t){e.attr(`role`,jn),t!==``&&e.attr(`aria-roledescription`,t)}u(Mn,`setA11yDiagramInfo`);function Nn(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}u(Nn,`addSVGa11yTitleDescription`);var J=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{u(this,`Diagram`)}static async fromText(t,n={}){let r=typeof t==`string`?{raw:t,cleaned:t}:t,i=E(),a=ce(r.cleaned,i);try{w(a)}catch{let e=h(a);if(!e)throw new ue(`Diagram ${a} not found.`);let{id:t,diagram:n}=await e();x(t,n)}let{db:o,parser:s,renderer:c,init:l}=w(a);s.parser&&(s.parser.yy=o),o.clear?.(),l?.(i),n.title&&o.setDiagramTitle?.(n.title);let u=r.cleaned;if(o.preserveCommentsWhenParsing&&r.withComments){let e=i.maxTextSize??ae.maxTextSize;r.withComments.length>e?f.warn(`Comment-preserving source exceeds maxTextSize (${r.withComments.length} > ${e}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):u=r.withComments}let d=_e(u)+` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["app-c4Diagram-YGBWAQC7.js","app-chunk-Y2CYZVJY.js","app-src.js","app-rolldown-runtime.js","app-chunk-O7XYJQB3.js","app-preload-helper.js","app-purify.es.js","app-chunk-ZIGJFQKS.js","app-dist.js","app-chunk-742MDFTN.js","app-chunk-MBY4JIJT.js","app-chunk-7PRAP22T.js","app-chunk-7INBJB4K.js","app-chunk-J5ZVWO5B.js","app-rough.esm.js","app-chunk-GWA4HPMP.js","app-flowDiagram-KWPJA3E3.js","app-chunk-5DYCD2WN.js","app-chunk-Z7XXMR3K.js","app-line.js","app-path.js","app-array.js","app-chunk-XXDRQBXY.js","app-chunk-WEXAMYUT.js","app-chunk-UA2S7LBM.js","app-chunk-GNY47TPC.js","app-chunk-DUW6YSOI.js","app-chunk-LNGE3PJU.js","app-chunk-7M6MHVWA.js","app-channel.js","app-chunk-5VM5RSS4.js","app-diagram-22UHCM2B.js","app-swimlanesDiagram-TC7HE7FX.js","app-erDiagram-OPXOYQCR.js","app-gitGraphDiagram-X574FWY7.js","app-chunk-JWPE2WC7.js","app-mermaid-parser.core.js","app-chunk-FOHPRMQF.js","app-chunk-6AZGARVD.js","app-chunk-6TQVIW2G.js","app-chunk-6EIED4P4.js","app-chunk-KI3K4JFJ.js","app-chunk-5V3GS4D5.js","app-chunk-UY3FDG6J.js","app-chunk-3Z5EZCMW.js","app-chunk-I5DQTOEV.js","app-chunk-OUJLGHUK.js","app-chunk-XHIXRSVI.js","app-chunk-2ZTRR5NV.js","app-chunk-747NJXEK.js","app-chunk-IH6LHLGP.js","app-chunk-6K3QC6MW.js","app-chunk-ICYGCRZG.js","app-chunk-2Q5K7J3B.js","app-ganttDiagram-FUAMR5RP.js","app-linear.js","app-defaultLocale.js","app-init.js","app-infoDiagram-VRGFBTTK.js","app-chunk-6AEJRKK7.js","app-pieDiagram-5QR66LMP.js","app-ordinal.js","app-arc.js","app-quadrantDiagram-O4NWA36T.js","app-xychartDiagram-PMCCYNJV.js","app-requirementDiagram-PLB6GJNP.js","app-sequenceDiagram-PO4LG4MO.js","app-classDiagram-v2-NBCMYWYE.js","app-stateDiagram-v2-GCMORJYK.js","app-journeyDiagram-ZHPQQLJL.js","app-timeline-definition-EJHVYXUP.js","app-mindmap-definition-NLK3R4M7.js","app-kanban-definition-PNTS6WVX.js","app-sankeyDiagram-IPEJSGJF.js","app-diagram-MLGK6HIB.js","app-diagram-MPIPVDR6.js","app-blockDiagram-BEXU5L5S.js","app-graphlib.js","app-diagram-CDSNMT55.js","app-architectureDiagram-NJMV4G6O.js","app-cytoscape.esm.js","app-diagram-ATOU4E4O.js","app-ishikawaDiagram-OU5B5YK6.js","app-vennDiagram-UO4OBE2U.js","app-diagram-3UASUU5V.js","app-usecaseDiagram-POWQR4AR.js","app-wardleyDiagram-VNRHLVJA.js","app-cynefinDiagram-VND7K2PF.js","app-railroadDiagram-XR7U4H2S.js","app-chunk-GTNCS2PH.js","app-ebnfDiagram-ZINNZB2B.js","app-abnfDiagram-O67JEVCF.js","app-pegDiagram-GJSIUBJH.js"])))=>i.map(i=>d[i]); +import{i as e}from"./app-rolldown-runtime.js";import{n as t,t as n}from"./app-jsx-runtime.js";import{t as r}from"./app-preload-helper.js";import{a as i,t as a}from"./app-useTranslation.js";import{n as o,r as s,t as c}from"./app-x.js";import{t as l}from"./app-purify.es.js";import{n as u}from"./app-chunk-Y2CYZVJY.js";import{h as d,m as f,p}from"./app-src.js";import{$ as m,C as h,E as g,I as _,J as v,K as y,L as b,N as x,P as S,Q as C,S as w,T as ee,V as te,W as ne,Z as T,_ as re,b as E,c as ie,f as ae,g as oe,l as D,m as O,n as se,p as ce,r as le,t as ue,u as de}from"./app-chunk-O7XYJQB3.js";import{S as fe,a as pe,f as me,g as k,h as he,i as ge,o as _e,v as ve,x as ye,y as be}from"./app-chunk-ZIGJFQKS.js";import{t as xe}from"./app-chunk-6AEJRKK7.js";import{r as Se}from"./app-chunk-742MDFTN.js";import{a as Ce}from"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import"./app-chunk-UA2S7LBM.js";import{n as we}from"./app-chunk-GNY47TPC.js";import{n as Te,t as Ee}from"./app-chunk-LNGE3PJU.js";var De=i(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]);function Oe(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function ke(e){if(e==null)return!0;if(ye(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!fe(e)&&!ve(e)&&!be(e)?!1:e.length===0;if(typeof e==`object`||typeof e==`function`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return Oe(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var Ae=`comm`,je=`rule`,Me=`decl`,Ne=`@import`,Pe=`@namespace`,Fe=`@keyframes`,Ie=`@layer`,Le=Math.abs,A=String.fromCharCode;function Re(e){return e.trim()}function ze(e,t,n){return e.replace(t,n)}function j(e,t){return e.charCodeAt(t)|0}function M(e,t,n){return e.slice(t,n)}function N(e){return e.length}function Be(e){return e.length}function P(e,t){return t.push(e),e}var F=1,I=1,Ve=0,L=0,R=0,z=``;function B(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:F,column:I,length:o,return:``,siblings:s}}function He(){return R}function Ue(){return R=L>0?j(z,--L):0,I--,R===10&&(I=1,F--),R}function V(){return R=L2||G(R)>3?``:` `}function Je(e,t){for(;--t&&V()&&!(R<48||R>102||R>57&&R<65||R>70&&R<97););return W(e,U()+(t<6&&H()==32&&V()==32))}function Ye(e){for(;V();)switch(R){case e:return L;case 34:case 39:e!==34&&e!==39&&Ye(R);break;case 40:e===41&&Ye(e);break;case 92:V();break}return L}function Xe(e,t){for(;V()&&e+R!==57&&(e+R!==84||H()!==47););return`/*`+W(t,L-1)+`*`+A(e===47?e:V())}function Ze(e){for(;!G(H());)V();return W(e,L)}function Qe(e){return Ge(K(``,null,null,null,[``],e=We(e),0,[0],e))}function K(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=V()){case 40:m!=108&&j(w,d-1)==58?(v++,w+=`(`):w+=Ke(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=Ke(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=A(y);break}w+=qe(m);break;case 92:w+=Je(U()-1,7);continue;case 47:switch(H()){case 42:case 47:P(et(Xe(V(),U()),t,n,c),c),(G(m||1)==5||G(H()||1)==5)&&N(w)&&M(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=N(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=A(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=ze(w,/\f/g,``)),p>0&&(N(w)-d||h===0)&&P(p>32?tt(w+`;`,r,n,d-1,c):tt(ze(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(P(C=$e(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)K(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(j(w,3)===110)break;case 108:if(j(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?K(e,C,C,r&&P($e(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):K(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+N(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&Ue()==125)continue}switch(w+=A(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(N(w)-1)*_,_=1;break;case 64:H()===45&&(w+=Ke(V())),f=H(),u=d=N(b=w+=Ze(U())),y++;break;case 45:m===45&&N(w)==2&&(h=0)}}return a}function $e(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=Be(p),h=0,g=0,_=0;h0?p[v]+` `+y:ze(y,/&\f/g,p[v])))&&(c[_++]=b);return B(e,t,n,i===0?je:s,c,l,u,d)}function et(e,t,n,r){return B(e,t,n,Ae,A(He()),M(e,2,-2),0,r)}function tt(e,t,n,r,i){return B(e,t,n,Me,M(e,0,r),M(e,r+1,-1),r,i)}function nt(e,t){for(var n=``,r=0;r/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-c4Diagram-YGBWAQC7.js`);return{diagram:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));return{id:at,diagram:e}},`loader`)},st=`flowchart-v2`,ct={id:st,detector:u(e=>/^\s*(graph|flowchart)/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-flowDiagram-KWPJA3E3.js`);return{diagram:e}},__vite__mapDeps([16,2,3,1,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,15,22,23,24,25,26,27,28,29,30]));return{id:st,diagram:e}},`loader`)},lt=`agentflow`,ut={id:lt,detector:u(e=>/^\s*agentflow-beta\b/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-22UHCM2B.js`);return{diagram:e}},__vite__mapDeps([31,6,1,2,3,4,5,29,7,8,9,10,30,11,13,12,14,17,18,19,20,21,15,22,23,24,25,26,27]));return{id:lt,diagram:e}},`loader`)},dt=`swimlane`,ft={id:dt,detector:u(e=>/^\s*swimlane-beta\b/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-swimlanesDiagram-TC7HE7FX.js`);return{diagram:e}},__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,15,22,23,24,25,26,27,28,29,30]));return{id:dt,diagram:e}},`loader`)},pt=`er`,mt={id:pt,detector:u(e=>/^\s*erDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-erDiagram-OPXOYQCR.js`);return{diagram:e}},__vite__mapDeps([33,1,2,3,4,5,6,29,7,8,9,10,11,13,12,14,17,18,19,20,21,22,23,24,25,26]));return{id:pt,diagram:e}},`loader`)},ht=`gitGraph`,gt={id:ht,detector:u(e=>/^\s*gitGraph/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-gitGraphDiagram-X574FWY7.js`);return{diagram:e}},__vite__mapDeps([34,1,2,3,4,5,6,7,8,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53]));return{id:ht,diagram:e}},`loader`)},_t=`gantt`,vt={id:_t,detector:u(e=>/^\s*gantt/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-ganttDiagram-FUAMR5RP.js`);return{diagram:e}},__vite__mapDeps([54,3,1,2,4,5,6,55,56,57,8,7]));return{id:_t,diagram:e}},`loader`)},yt=`info`,bt={id:yt,detector:u(e=>/^\s*info/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-infoDiagram-VRGFBTTK.js`);return{diagram:e}},__vite__mapDeps([58,1,2,3,4,5,6,59,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:yt,diagram:e}},`loader`)},xt=`pie`,St={id:xt,detector:u(e=>/^\s*pie/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-pieDiagram-5QR66LMP.js`);return{diagram:e}},__vite__mapDeps([60,1,2,3,4,5,6,61,57,20,8,62,21,7,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:xt,diagram:e}},`loader`)},Ct=`quadrantChart`,wt={id:Ct,detector:u(e=>/^\s*quadrantChart/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-quadrantDiagram-O4NWA36T.js`);return{diagram:e}},__vite__mapDeps([63,1,2,3,4,5,6,55,56,57]));return{id:Ct,diagram:e}},`loader`)},Tt=`xychart`,Et={id:Tt,detector:u(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-xychartDiagram-PMCCYNJV.js`);return{diagram:e}},__vite__mapDeps([64,1,2,3,4,5,6,55,56,57,61,7,8,19,20,21,59,9,10]));return{id:Tt,diagram:e}},`loader`)},Dt=`requirement`,Ot={id:Dt,detector:u(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-requirementDiagram-PLB6GJNP.js`);return{diagram:e}},__vite__mapDeps([65,1,2,3,4,5,6,7,8,9,10,11,13,12,14,17,18,19,20,21,22,23,24,25,26]));return{id:Dt,diagram:e}},`loader`)},kt=`sequence`,At={id:kt,detector:u(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-sequenceDiagram-PO4LG4MO.js`);return{diagram:e}},__vite__mapDeps([66,1,2,3,4,5,6,8,7,15,27,53]));return{id:kt,diagram:e}},`loader`)},jt=`classDiagram`,Mt={id:jt,detector:u(e=>/^\s*classDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-classDiagram-v2-NBCMYWYE.js`);return{diagram:e}},__vite__mapDeps([67,6,1,2,3,4,5,7,8,9,10,30,11,13,12,14,17,18,19,20,21,15,22,23,24,25,26]));return{id:jt,diagram:e}},`loader`)},Nt=`stateDiagram`,Pt={id:Nt,detector:u(e=>/^\s*stateDiagram/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-stateDiagram-v2-GCMORJYK.js`);return{diagram:e}},__vite__mapDeps([68,6,1,2,3,4,5,7,8,9,10,11,13,12,14,17,18,19,20,21,15,22,23,24,25,26]));return{id:Nt,diagram:e}},`loader`)},Ft=`journey`,It={id:Ft,detector:u(e=>/^\s*journey/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-journeyDiagram-ZHPQQLJL.js`);return{diagram:e}},__vite__mapDeps([69,1,2,3,4,5,6,62,20,8,30,15]));return{id:Ft,diagram:e}},`loader`)},Lt={draw:u((e,t,n)=>{f.debug(`rendering svg for syntax error +`);let r=xe(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),ie(r,100,512,!0),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},Rt=Lt,zt={db:{},renderer:Lt,parser:{parse:u(()=>{},`parse`)}},Bt=`flowchart-elk`,Vt={id:Bt,detector:u((e,t={})=>/^\s*flowchart-elk/.test(e)?(t.layout=`elk`,!0):!1,`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-flowDiagram-KWPJA3E3.js`);return{diagram:e}},__vite__mapDeps([16,2,3,1,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,15,22,23,24,25,26,27,28,29,30]));return{id:Bt,diagram:e}},`loader`)},Ht=`timeline`,Ut={id:Ht,detector:u(e=>/^\s*timeline/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-timeline-definition-EJHVYXUP.js`);return{diagram:e}},__vite__mapDeps([70,1,2,3,4,5,6,62,20,8,7,59,13]));return{id:Ht,diagram:e}},`loader`)},Wt=`mindmap`,Gt={id:Wt,detector:u(e=>/^\s*mindmap/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-mindmap-definition-NLK3R4M7.js`);return{diagram:e}},__vite__mapDeps([71,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,18,19,20,21,22,23,24,25,26]));return{id:Wt,diagram:e}},`loader`)},Kt=`kanban`,qt={id:Kt,detector:u(e=>/^\s*kanban/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-kanban-definition-PNTS6WVX.js`);return{diagram:e}},__vite__mapDeps([72,1,2,3,4,5,6,7,8,59,9,10,30,11,12,13,14,17,24,27]));return{id:Kt,diagram:e}},`loader`)},Jt=`sankey`,Yt={id:Jt,detector:u(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-sankeyDiagram-IPEJSGJF.js`);return{diagram:e}},__vite__mapDeps([73,1,2,3,4,5,6,61,57]));return{id:Jt,diagram:e}},`loader`)},Xt=`packet`,Zt={id:Xt,detector:u(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-MLGK6HIB.js`);return{diagram:e}},__vite__mapDeps([74,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:Xt,diagram:e}},`loader`)},Qt=`radar`,$t={id:Qt,detector:u(e=>/^\s*radar-beta/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-MPIPVDR6.js`);return{diagram:e}},__vite__mapDeps([75,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:Qt,diagram:e}},`loader`)},en=`block`,tn={id:en,detector:u(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-blockDiagram-BEXU5L5S.js`);return{diagram:e}},__vite__mapDeps([76,1,2,3,4,5,6,29,7,8,9,10,30,26,11,13,12,14,17,18,19,20,21,77]));return{id:en,diagram:e}},`loader`)},nn=`treeView`,rn={id:nn,detector:u(e=>/^\s*treeView-beta/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-CDSNMT55.js`);return{diagram:e}},__vite__mapDeps([78,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,9,53]));return{id:nn,diagram:e}},`loader`)},an=`architecture`,on={id:an,detector:u(e=>/^\s*architecture/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-architectureDiagram-NJMV4G6O.js`);return{diagram:e}},__vite__mapDeps([79,3,1,2,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,9,10,80]));return{id:an,diagram:e}},`loader`)},sn=`eventmodeling`,cn={id:sn,detector:u(e=>/^\s*eventmodeling/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-ATOU4E4O.js`);return{diagram:e}},__vite__mapDeps([81,37,1,2,3,4,5,6,7,8,35,36,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:sn,diagram:e}},`loader`)},ln=`ishikawa`,un={id:ln,detector:u(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-ishikawaDiagram-OU5B5YK6.js`);return{diagram:e}},__vite__mapDeps([82,1,2,3,4,5,6,7,8,59,14]));return{id:ln,diagram:e}},`loader`)},dn=`venn`,fn={id:dn,detector:u(e=>/^\s*venn-beta/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-vennDiagram-UO4OBE2U.js`);return{diagram:e}},__vite__mapDeps([83,1,2,3,4,5,6,7,8,59,14]));return{id:dn,diagram:e}},`loader`)},pn=`treemap`,mn={id:pn,detector:u(e=>/^\s*treemap/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-diagram-3UASUU5V.js`);return{diagram:e}},__vite__mapDeps([84,1,2,3,4,5,6,61,57,56,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,11,23]));return{id:pn,diagram:e}},`loader`)},hn=`usecase`,gn={id:hn,detector:u(e=>/^\s*usecase-beta(?:\s|$)/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-usecaseDiagram-POWQR4AR.js`);return{diagram:e}},__vite__mapDeps([85,1,2,3,4,5,6,7,8,9,10,11,13,12,14,17,18,19,20,21,22,23,24,25,26]));return{id:hn,diagram:e}},`loader`)},_n=`wardley`,vn={id:_n,detector:u(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-wardleyDiagram-VNRHLVJA.js`);return{diagram:e}},__vite__mapDeps([86,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:_n,diagram:e}},`loader`)},yn=`cynefin`,bn={id:yn,detector:u(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-cynefinDiagram-VND7K2PF.js`);return{diagram:e}},__vite__mapDeps([87,1,2,3,4,5,6,7,8,59,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52]));return{id:yn,diagram:e}},`loader`)},xn=`railroad`,Sn={id:xn,detector:u(e=>/^\s*railroad-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-railroadDiagram-XR7U4H2S.js`);return{diagram:e}},__vite__mapDeps([88,46,37,1,2,3,4,5,6,59,89,35,36,38,39,40,41,42,43,44,45,47,48,49,50,51,52]));return{id:xn,diagram:e}},`loader`)},Cn=`railroadEbnf`,wn={id:Cn,detector:u(e=>/^\s*railroad-ebnf-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-ebnfDiagram-ZINNZB2B.js`);return{diagram:e}},__vite__mapDeps([90,48,37,1,2,3,4,5,6,59,89,35,36,38,39,40,41,42,43,44,45,46,47,49,50,51,52]));return{id:Cn,diagram:e}},`loader`)},Tn=`railroadAbnf`,En={id:Tn,detector:u(e=>/^\s*railroad-abnf-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-abnfDiagram-O67JEVCF.js`);return{diagram:e}},__vite__mapDeps([91,47,37,1,2,3,4,5,6,59,89,35,36,38,39,40,41,42,43,44,45,46,48,49,50,51,52]));return{id:Tn,diagram:e}},`loader`)},Dn=`railroadPeg`,On={id:Dn,detector:u(e=>/^\s*railroad-peg-beta/i.test(e),`detector`),loader:u(async()=>{let{diagram:e}=await r(async()=>{let{diagram:e}=await import(`./app-pegDiagram-GJSIUBJH.js`);return{diagram:e}},__vite__mapDeps([92,49,37,1,2,3,4,5,6,59,89,35,36,38,39,40,41,42,43,44,45,46,47,48,50,51,52]));return{id:Dn,diagram:e}},`loader`)},kn=!1,q=u(()=>{kn||(kn=!0,x(`error`,zt,e=>e.toLowerCase().trim()===`error`),x(`---`,{db:{clear:u(()=>{},`clear`)},styles:{},renderer:{draw:u(()=>{},`draw`)},parser:{parse:u(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:u(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),S(Vt,Gt,on),S(ut,ot,qt,Mt,mt,vt,bt,St,Ot,At,ft,ct,Ut,gt,Pt,It,wt,Yt,Zt,Et,tn,cn,rn,$t,un,mn,Sn,wn,En,On,fn,vn,bn,gn))},`addDiagrams`),An=u(async()=>{f.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(O).map(async([e,{detector:t,loader:n}])=>{if(n)try{w(e)}catch{try{let{diagram:e,id:r}=await n();x(r,e,t)}catch(t){throw f.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete O[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){f.error(`Failed to load ${e.length} external diagrams`);for(let t of e)f.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),jn=`graphics-document document`;function Mn(e,t){e.attr(`role`,jn),t!==``&&e.attr(`aria-roledescription`,t)}u(Mn,`setA11yDiagramInfo`);function Nn(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}u(Nn,`addSVGa11yTitleDescription`);var J=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{u(this,`Diagram`)}static async fromText(t,n={}){let r=typeof t==`string`?{raw:t,cleaned:t}:t,i=E(),a=ce(r.cleaned,i);try{w(a)}catch{let e=h(a);if(!e)throw new ue(`Diagram ${a} not found.`);let{id:t,diagram:n}=await e();x(t,n)}let{db:o,parser:s,renderer:c,init:l}=w(a);s.parser&&(s.parser.yy=o),o.clear?.(),l?.(i),n.title&&o.setDiagramTitle?.(n.title);let u=r.cleaned;if(o.preserveCommentsWhenParsing&&r.withComments){let e=i.maxTextSize??ae.maxTextSize;r.withComments.length>e?f.warn(`Comment-preserving source exceeds maxTextSize (${r.withComments.length} > ${e}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):u=r.withComments}let d=_e(u)+` `;return r.frontmatterLineOffset&&o.setFrontmatterLineOffset?.(r.frontmatterLineOffset),await s.parse(d),new e(a,d,o,s,c)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},Pn=[],Fn=u(()=>{Pn.forEach(e=>{e()}),Pn=[]},`attachFunctions`),In=u(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,``).trimStart(),`cleanupComments`);function Ln(e){let t=e.match(re);if(!t)return{text:e,metadata:{}};let n=t[1],r=n?t[2].split(` `).map(e=>e.startsWith(n)?e.slice(n.length):e).join(` -`):t[2],i=Se(r,{schema:Ce})??{};i=typeof i==`object`&&!Array.isArray(i)?i:{};let a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:e.slice(t[0].length),metadata:a}}u(Ln,`extractFrontMatter`);var Rn=u(e=>e.replace(/\r\n?/g,` +`):t[2],i=Te(r,{schema:Ee})??{};i=typeof i==`object`&&!Array.isArray(i)?i:{};let a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:e.slice(t[0].length),metadata:a}}u(Ln,`extractFrontMatter`);var Rn=u(e=>e.replace(/\r\n?/g,` `).replace(/<(\w+)([^>]*)>/g,(e,t,n)=>`<`+t+n.replace(/="([^"]*)"/g,`='$1'`)+`>`),`cleanupText`),zn=u(e=>{let{text:t,metadata:n}=Ln(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||={},a.gantt.displayMode=r),{title:i,config:a,text:t}},`processFrontmatter`),Bn=u(e=>{let t=k.detectInit(e)??{},n=k.detectDirective(e,`wrap`);return Array.isArray(n)?t.wrap=n.some(({type:e})=>e===`wrap`):n?.type===`wrap`&&(t.wrap=!0),{text:he(e),directive:t}},`processDirectives`);function Vn(e){let t=e,n=Rn(e),r=zn(n),i=Bn(r.text),a=ge(r.config,i.directive),o=i.text;return{code:{raw:t,cleaned:In(o),withComments:o,frontmatterLineOffset:n.length>r.text.length?(n.substring(0,n.length-r.text.length).match(/\n/g)??[]).length:0},title:r.title,config:a}}u(Vn,`preprocessDiagram`);function Hn(e){let t=new TextEncoder().encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join(``);return btoa(n)}u(Hn,`toBase64`);var Un=5e4,Wn=`graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa`,Gn=`sandbox`,Kn=`loose`,qn=`http://www.w3.org/2000/svg`,Jn=`http://www.w3.org/1999/xlink`,Yn=`http://www.w3.org/1999/xhtml`,Xn=`100%`,Zn=`100%`,Qn=`border:0;margin:0;`,$n=`margin:0`,er=`allow-top-navigation-by-user-activation allow-popups`,tr=`The "iframe" tag is not supported by your browser.`,nr=[`foreignobject`],rr=[`dominant-baseline`];function ir(e){let t=Vn(e);_();let n;try{n=ce(t.code.cleaned,E())}catch{n=void 0}return y(n),se(t.config??{}),t}u(ir,`processAndSetConfigs`);async function ar(e,t){q();try{let{code:t,config:n}=ir(e);return{diagramType:(await J.fromText(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}finally{y(void 0)}}u(ar,`parse`);var or=u((e,t,n=[])=>`.${e} ${t} ${b(`{ ${n.join(` !important; `)} !important; }`)}`,`cssImportantStyles`),sr=u((e,t=new Map)=>{let n=new CSSStyleSheet;if(e.fontFamily!==void 0&&n.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,n.cssRules.length),e.altFontFamily!==void 0&&n.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,n.cssRules.length),t instanceof Map){let r=ee(e)?[`> *`,`span`]:[`rect`,`polygon`,`ellipse`,`circle`,`path`];t.forEach(e=>{ke(e.styles)||r.forEach(t=>{n.insertRule(or(e.id,t,e.styles),n.cssRules.length)}),ke(e.textStyles)||n.insertRule(or(e.id,`tspan`,(e?.textStyles||[]).map(e=>e.replace(`color`,`fill`))),n.cssRules.length)})}let r=``;if(e.themeCSS!==void 0)if(typeof n.replaceSync==`function`){let t=new CSSStyleSheet;t.replaceSync(e.themeCSS),r=D(t)+` `}else r+=`${e.themeCSS} `;return r+D(n)},`createCssStyles`),cr=u((e,t)=>nt(Qe(`${e}{${t}}`),it([u(function(t,n,r,i){if(t.type===`rule`&&Array.isArray(t.props)){if(t.parent&&t.parent.type===`@keyframes`)return;t.props=t.props.map(n=>n===e&&Array.isArray(t.children)&&t.children.every(e=>e.type===`decl`&&new Set([`font-family`,`font-size`,`fill`]).has(e.props))||(n.startsWith(`${e} `)||n.startsWith(`${e}>`))&&!n.startsWith(`${e} ||`)?n:`${e} ${n}`)}else t.type.startsWith(`@`)&&([`@media`,`@supports`,`@layer`,`@scope`,`@container`,`@starting-style`,`@keyframes`].includes(t.type)||(f.warn(`Removing unsupported at-rule ${t.type} from CSS`),t.type=Ae))},`addNamespace`),rt])),`compileCSS`),lr=u((e,t,n,r)=>{let i=sr(e,n);return cr(r,T(t,i,{...e.themeVariables,theme:e.theme,look:e.look},r))},`createUserStyles`),ur=u((e=``,t,n)=>{let r=e;return!n&&!t&&(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,`marker-end="url(#`)),r=pe(r),r=r.replace(/
/g,`
`),r},`cleanUpSvgCode`),dr=u((e=``,t)=>``,`putIntoIFrame`),fr=u((e,t,n,r,i)=>{let a=e.append(`div`);a.attr(`id`,n),r&&a.attr(`style`,r);let o=a.append(`svg`).attr(`id`,t).attr(`width`,`100%`).attr(`xmlns`,qn);return i&&o.attr(`xmlns:xlink`,i),o.append(`g`),e},`appendDivSvgG`);function pr(e,t){return e.append(`iframe`).attr(`id`,t).attr(`style`,`width: 100%; height: 100%;`).attr(`sandbox`,``)}u(pr,`sandboxedIframe`);var mr=u((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},`removeExistingElements`),hr=u(async function(e,t,n){q();let r=ir(t),i=r.code;t=i.cleaned;let a=E();f.debug(a),t.length>(a?.maxTextSize??Un)&&(t=Wn,i={raw:t,cleaned:t});let o=`#${e}`,s=`i`+e,c=`#`+s,d=`d`+e,m=`#`+d,h=u(()=>{let e=p(_?c:m).node();e&&`remove`in e&&e.remove()},`removeTempElements`),g=p(document.body),_=a.securityLevel===Gn,v=a.securityLevel===Kn,y=a.fontFamily;if(n!==void 0){if(n&&(n.innerHTML=``),_){let e=pr(p(n),s);g=p(e.nodes()[0].contentDocument.body),g.node().style.margin=`0`}else g=p(n);fr(g,e,d,`font-family: ${y}`,Jn)}else{if(mr(document,e,d,s),_){let e=pr(p(document.body),s);g=p(e.nodes()[0].contentDocument.body),g.node().style.margin=`0`}else g=p(`body`);fr(g,e,d)}let b,x;try{b=await J.fromText(i,{title:r.title})}catch(e){if(a.suppressErrorRendering)throw h(),e;b=await J.fromText(`error`),x=e}let S=g.select(m).node(),C=b.type,w=S.firstChild,ee=w.firstChild,te=b.renderer.getClasses?.(t,b),ne=lr(a,C,te,o),T=document.createElement(`style`);T.innerHTML=ne,w.insertBefore(T,ee);try{await b.renderer.draw(t,e,`12.0.0`,b)}catch(n){throw a.suppressErrorRendering?h():Rt.draw(t,e,`12.0.0`),n}let re=g.select(`${m} svg`),ie=b.db.getAccTitle?.(),ae=b.db.getAccDescription?.();yr(C,re,ie,ae);let D=u(()=>{g.select(`[id="${e}"]`).selectAll(`foreignobject > *`).attr(`xmlns`,Yn);let t=g.select(m).node().innerHTML;if(f.debug(`config.arrowMarkerAbsolute`,a.arrowMarkerAbsolute),t=ur(t,_,oe(a.arrowMarkerAbsolute)),_){let e=g.select(m+` svg`).node();t=dr(t,e)}else v||(t=l.sanitize(t,{ADD_TAGS:nr,ADD_ATTR:rr,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return Fn(),t},`serializeSvg`)();if(x)throw x;return h(),{diagramType:C,svg:D,bindFunctions:b.db.bindFunctions}},`renderDiagram`),gr=u(async function(e,t,n){try{return await hr(e,t,n)}finally{y(void 0)}},`render`);function _r(e={}){let t=le({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||={},t.themeVariables.fontFamily=t.fontFamily),te(t);let n=de.theme;t?.theme&&Object.hasOwn(C,t.theme)?t.themeVariables=C[t.theme].getThemeVariables(t.themeVariables):t&&(t.theme!=null&&t.theme!==`null`&&(t.theme=n),t.themeVariables=C[n].getThemeVariables(t.themeVariables));let r=typeof t==`object`?v(t):g();d(r.logLevel),q()}u(_r,`initialize`);var vr=u((e,t={})=>{let{code:n}=Vn(e);return J.fromText(n,t)},`getDiagramFromText`);function yr(e,t,n,r){Mn(t,e),Nn(t,n,r,t.attr(`id`))}u(yr,`addA11yInfo`);var Y=Object.freeze({render:gr,parse:ar,getDiagramFromText:vr,initialize:_r,getConfig:E,setConfig:ne,getSiteConfig:g,updateSiteConfig:m,reset:u(()=>{_()},`reset`),globalReset:u(()=>{_(de)},`globalReset`),defaultConfig:de});d(E().logLevel),_(E());var br=u((e,t,n)=>{f.warn(e),me(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},`handleError`),xr=u(async function(e={querySelector:`.mermaid`}){try{await Sr(e)}catch(t){if(me(t)&&f.error(t.str),Z.parseError&&Z.parseError(t),!e.suppressErrors)throw f.error(`Use the suppressErrors option to suppress these errors`),t}},`run`),Sr=u(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:`.mermaid`}){let r=Y.getConfig();f.debug(`${e?``:`No `}Callback function found`);let i;if(n)i=n;else if(t)i=document.querySelectorAll(t);else throw Error(`Nodes and querySelector are both undefined`);f.debug(`Found ${i.length} diagrams`),r?.startOnLoad!==void 0&&(f.debug(`Start On Load: `+r?.startOnLoad),Y.updateSiteConfig({startOnLoad:r?.startOnLoad}));let a=new k.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed),o,s=[];for(let t of Array.from(i)){if(f.info(`Rendering diagram: `+t.id),t.getAttribute(`data-processed`))continue;t.setAttribute(`data-processed`,`true`);let n=`mermaid-${a.next()}`;o=t.innerHTML,o=Te(k.entityDecode(o)).trim().replace(//gi,`
`);let r=k.detectInit(o);r&&f.debug(`Detected early reinit: `,r);try{let{svg:r,bindFunctions:i}=await jr(n,o,t);t.innerHTML=r,e&&await e(n),i&&i(t)}catch(e){br(e,s,Z.parseError)}}if(s.length>0)throw s[0]},`runThrowsErrors`),Cr=u(function(e){Y.initialize(e)},`initialize`),wr=u(async function(e,t,n){f.warn(`mermaid.init is deprecated. Please use run instead.`),e&&Cr(e);let r={postRenderCallback:n,querySelector:`.mermaid`};typeof t==`string`?r.querySelector=t:t&&(r.nodes=t instanceof HTMLElement?[t]:t),await xr(r)},`init`),Tr=u(async(e,{lazyLoad:t=!0}={})=>{q(),S(...e),t===!1&&await An()},`registerExternalDiagrams`),Er=u(function(){if(Z.startOnLoad){let{startOnLoad:e}=Y.getConfig();e&&Z.run().catch(e=>f.error(`Mermaid failed to initialize`,e))}},`contentLoaded`);typeof document<`u`&&window.addEventListener(`load`,Er,!1);var Dr=u(function(e){Z.parseError=e},`setParseErrorHandler`),X=[],Or=!1,kr=u(async()=>{if(!Or){for(Or=!0;X.length>0;){let e=X.shift();if(e)try{await e()}catch(e){f.error(`Error executing queue`,e)}}Or=!1}},`executeQueue`),Ar=u(async(e,t)=>new Promise((n,r)=>{let i=u(()=>new Promise((i,a)=>{Y.parse(e,t).then(e=>{i(e),n(e)},e=>{f.error(`Error parsing`,e),Z.parseError?.(e),a(e),r(e)})}),`performCall`);X.push(i),kr().catch(r)}),`parse`),jr=u((e,t,n)=>new Promise((r,i)=>{let a=u(()=>new Promise((a,o)=>{Y.render(e,t,n).then(e=>{a(e),r(e)},e=>{f.error(`Error parsing`,e),Z.parseError?.(e),o(e),i(e)})}),`performCall`);X.push(a),kr().catch(i)}),`render`),Z={startOnLoad:!0,mermaidAPI:Y,parse:Ar,render:jr,init:wr,run:xr,registerExternalDiagrams:Tr,registerLayoutLoaders:Ee,initialize:Cr,parseError:void 0,contentLoaded:Er,setParseErrorHandler:Dr,detectType:ce,registerIconPacks:we,getRegisteredDiagramsMetadata:u(()=>Object.keys(O).map(e=>({id:e})),`getRegisteredDiagramsMetadata`)},Mr=Z,Q=e(t(),1),$=n();Mr.initialize({startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0,maxTextSize:5e4,maxEdges:500,theme:`neutral`,htmlLabels:!1,secure:[`securityLevel`,`startOnLoad`,`maxTextSize`,`maxEdges`,`suppressErrorRendering`,`htmlLabels`]});var Nr=Promise.resolve();function Pr({source:e}){let{t}=a(),n=`diagram-${(0,Q.useId)().replace(/[^a-z0-9]/giu,``)}`,[r,i]=(0,Q.useState)(null),u=r?.source===e?r:null,d=u?.image,f=u?.error,[p,m]=(0,Q.useState)(1),h=(0,Q.useRef)(null),g=(0,Q.useRef)(null),_=(0,Q.useRef)(null);return(0,Q.useEffect)(()=>{let r=!1;return Nr=Nr.then(async()=>{if(!r)try{if(e.length>5e4)throw Error(t(`filesDocumentLimit`));let a=await Mr.render(n,e),o=l.sanitize(a.svg,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:[`foreignObject`,`a`,`image`,`use`]});r||i({source:e,image:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(o)}`})}catch(n){r||i({source:e,error:n instanceof Error?n.message:t(`filesPreviewFailed`)})}}),()=>{r=!0}},[n,e,t]),f?(0,$.jsxs)(`div`,{className:`evidence-warning`,children:[(0,$.jsx)(`p`,{children:f}),(0,$.jsx)(`pre`,{children:e})]}):(0,$.jsxs)(`div`,{className:`file-diagram`,children:[d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`img`,{src:d,alt:t(`filesDiagram`)}),(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`filesExpandDiagram`),onClick:()=>{m(1),h.current?.showModal()},children:(0,$.jsx)(De,{})})]}):(0,$.jsx)(`p`,{role:`status`,children:t(`readingFile`)}),(0,$.jsxs)(`dialog`,{ref:h,className:`file-diagram-dialog`,"aria-label":t(`filesDiagram`),onCancel:e=>{e.stopPropagation()},onKeyDown:e=>{e.key===`Escape`&&e.stopPropagation()},children:[(0,$.jsxs)(`div`,{className:`file-preview-toolbar`,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`filesZoomOut`),onClick:()=>m(e=>Math.max(.25,e-.25)),children:(0,$.jsx)(s,{})}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>m(1),children:[Math.round(p*100),`%`]}),(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`filesZoomIn`),onClick:()=>m(e=>Math.min(4,e+.25)),children:(0,$.jsx)(o,{})}),(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`close`),onClick:()=>h.current?.close(),children:(0,$.jsx)(c,{})})]}),(0,$.jsx)(`section`,{ref:g,className:`file-media-viewport`,tabIndex:0,"aria-label":t(`filesDiagram`),onWheel:e=>{(e.ctrlKey||e.metaKey)&&m(t=>Math.max(.25,Math.min(4,t+(e.deltaY>0?-.1:.1))))},onPointerDown:e=>{let t=e.currentTarget;_.current={x:e.clientX,y:e.clientY,left:t.scrollLeft,top:t.scrollTop},t.setPointerCapture(e.pointerId)},onPointerMove:e=>{_.current&&(e.currentTarget.scrollLeft=_.current.left+_.current.x-e.clientX,e.currentTarget.scrollTop=_.current.top+_.current.y-e.clientY)},onPointerUp:()=>{_.current=null},onPointerCancel:()=>{_.current=null},children:d&&(0,$.jsx)(`img`,{src:d,alt:t(`filesDiagram`),draggable:!1,style:{width:`${p*100}%`}})})]})]})}export{Pr as default}; \ No newline at end of file +`,`putIntoIFrame`),fr=u((e,t,n,r,i)=>{let a=e.append(`div`);a.attr(`id`,n),r&&a.attr(`style`,r);let o=a.append(`svg`).attr(`id`,t).attr(`width`,`100%`).attr(`xmlns`,qn);return i&&o.attr(`xmlns:xlink`,i),o.append(`g`),e},`appendDivSvgG`);function pr(e,t){return e.append(`iframe`).attr(`id`,t).attr(`style`,`width: 100%; height: 100%;`).attr(`sandbox`,``)}u(pr,`sandboxedIframe`);var mr=u((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},`removeExistingElements`),hr=u(async function(e,t,n){q();let r=ir(t),i=r.code;t=i.cleaned;let a=E();f.debug(a),t.length>(a?.maxTextSize??Un)&&(t=Wn,i={raw:t,cleaned:t});let o=`#${e}`,s=`i`+e,c=`#`+s,d=`d`+e,m=`#`+d,h=u(()=>{let e=p(_?c:m).node();e&&`remove`in e&&e.remove()},`removeTempElements`),g=p(document.body),_=a.securityLevel===Gn,v=a.securityLevel===Kn,y=a.fontFamily;if(n!==void 0){if(n&&(n.innerHTML=``),_){let e=pr(p(n),s);g=p(e.nodes()[0].contentDocument.body),g.node().style.margin=`0`}else g=p(n);fr(g,e,d,`font-family: ${y}`,Jn)}else{if(mr(document,e,d,s),_){let e=pr(p(document.body),s);g=p(e.nodes()[0].contentDocument.body),g.node().style.margin=`0`}else g=p(`body`);fr(g,e,d)}let b,x;try{b=await J.fromText(i,{title:r.title})}catch(e){if(a.suppressErrorRendering)throw h(),e;b=await J.fromText(`error`),x=e}let S=g.select(m).node(),C=b.type,w=S.firstChild,ee=w.firstChild,te=b.renderer.getClasses?.(t,b),ne=lr(a,C,te,o),T=document.createElement(`style`);T.innerHTML=ne,w.insertBefore(T,ee);try{await b.renderer.draw(t,e,`12.0.0`,b)}catch(n){throw a.suppressErrorRendering?h():Rt.draw(t,e,`12.0.0`),n}let re=g.select(`${m} svg`),ie=b.db.getAccTitle?.(),ae=b.db.getAccDescription?.();yr(C,re,ie,ae);let D=u(()=>{g.select(`[id="${e}"]`).selectAll(`foreignobject > *`).attr(`xmlns`,Yn);let t=g.select(m).node().innerHTML;if(f.debug(`config.arrowMarkerAbsolute`,a.arrowMarkerAbsolute),t=ur(t,_,oe(a.arrowMarkerAbsolute)),_){let e=g.select(m+` svg`).node();t=dr(t,e)}else v||(t=l.sanitize(t,{ADD_TAGS:nr,ADD_ATTR:rr,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return Fn(),t},`serializeSvg`)();if(x)throw x;return h(),{diagramType:C,svg:D,bindFunctions:b.db.bindFunctions}},`renderDiagram`),gr=u(async function(e,t,n){try{return await hr(e,t,n)}finally{y(void 0)}},`render`);function _r(e={}){let t=le({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||={},t.themeVariables.fontFamily=t.fontFamily),te(t);let n=de.theme;t?.theme&&Object.hasOwn(C,t.theme)?t.themeVariables=C[t.theme].getThemeVariables(t.themeVariables):t&&(t.theme!=null&&t.theme!==`null`&&(t.theme=n),t.themeVariables=C[n].getThemeVariables(t.themeVariables));let r=typeof t==`object`?v(t):g();d(r.logLevel),q()}u(_r,`initialize`);var vr=u((e,t={})=>{let{code:n}=Vn(e);return J.fromText(n,t)},`getDiagramFromText`);function yr(e,t,n,r){Mn(t,e),Nn(t,n,r,t.attr(`id`))}u(yr,`addA11yInfo`);var Y=Object.freeze({render:gr,parse:ar,getDiagramFromText:vr,initialize:_r,getConfig:E,setConfig:ne,getSiteConfig:g,updateSiteConfig:m,reset:u(()=>{_()},`reset`),globalReset:u(()=>{_(de)},`globalReset`),defaultConfig:de});d(E().logLevel),_(E());var br=u((e,t,n)=>{f.warn(e),me(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},`handleError`),xr=u(async function(e={querySelector:`.mermaid`}){try{await Sr(e)}catch(t){if(me(t)&&f.error(t.str),Z.parseError&&Z.parseError(t),!e.suppressErrors)throw f.error(`Use the suppressErrors option to suppress these errors`),t}},`run`),Sr=u(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:`.mermaid`}){let r=Y.getConfig();f.debug(`${e?``:`No `}Callback function found`);let i;if(n)i=n;else if(t)i=document.querySelectorAll(t);else throw Error(`Nodes and querySelector are both undefined`);f.debug(`Found ${i.length} diagrams`),r?.startOnLoad!==void 0&&(f.debug(`Start On Load: `+r?.startOnLoad),Y.updateSiteConfig({startOnLoad:r?.startOnLoad}));let a=new k.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed),o,s=[];for(let t of Array.from(i)){if(f.info(`Rendering diagram: `+t.id),t.getAttribute(`data-processed`))continue;t.setAttribute(`data-processed`,`true`);let n=`mermaid-${a.next()}`;o=t.innerHTML,o=Ce(k.entityDecode(o)).trim().replace(//gi,`
`);let r=k.detectInit(o);r&&f.debug(`Detected early reinit: `,r);try{let{svg:r,bindFunctions:i}=await jr(n,o,t);t.innerHTML=r,e&&await e(n),i&&i(t)}catch(e){br(e,s,Z.parseError)}}if(s.length>0)throw s[0]},`runThrowsErrors`),Cr=u(function(e){Y.initialize(e)},`initialize`),wr=u(async function(e,t,n){f.warn(`mermaid.init is deprecated. Please use run instead.`),e&&Cr(e);let r={postRenderCallback:n,querySelector:`.mermaid`};typeof t==`string`?r.querySelector=t:t&&(r.nodes=t instanceof HTMLElement?[t]:t),await xr(r)},`init`),Tr=u(async(e,{lazyLoad:t=!0}={})=>{q(),S(...e),t===!1&&await An()},`registerExternalDiagrams`),Er=u(function(){if(Z.startOnLoad){let{startOnLoad:e}=Y.getConfig();e&&Z.run().catch(e=>f.error(`Mermaid failed to initialize`,e))}},`contentLoaded`);typeof document<`u`&&window.addEventListener(`load`,Er,!1);var Dr=u(function(e){Z.parseError=e},`setParseErrorHandler`),X=[],Or=!1,kr=u(async()=>{if(!Or){for(Or=!0;X.length>0;){let e=X.shift();if(e)try{await e()}catch(e){f.error(`Error executing queue`,e)}}Or=!1}},`executeQueue`),Ar=u(async(e,t)=>new Promise((n,r)=>{let i=u(()=>new Promise((i,a)=>{Y.parse(e,t).then(e=>{i(e),n(e)},e=>{f.error(`Error parsing`,e),Z.parseError?.(e),a(e),r(e)})}),`performCall`);X.push(i),kr().catch(r)}),`parse`),jr=u((e,t,n)=>new Promise((r,i)=>{let a=u(()=>new Promise((a,o)=>{Y.render(e,t,n).then(e=>{a(e),r(e)},e=>{f.error(`Error parsing`,e),Z.parseError?.(e),o(e),i(e)})}),`performCall`);X.push(a),kr().catch(i)}),`render`),Z={startOnLoad:!0,mermaidAPI:Y,parse:Ar,render:jr,init:wr,run:xr,registerExternalDiagrams:Tr,registerLayoutLoaders:we,initialize:Cr,parseError:void 0,contentLoaded:Er,setParseErrorHandler:Dr,detectType:ce,registerIconPacks:Se,getRegisteredDiagramsMetadata:u(()=>Object.keys(O).map(e=>({id:e})),`getRegisteredDiagramsMetadata`)},Mr=Z,Q=e(t(),1),$=n();Mr.initialize({startOnLoad:!1,securityLevel:`strict`,suppressErrorRendering:!0,maxTextSize:5e4,maxEdges:500,theme:`neutral`,htmlLabels:!1,secure:[`securityLevel`,`startOnLoad`,`maxTextSize`,`maxEdges`,`suppressErrorRendering`,`htmlLabels`]});var Nr=Promise.resolve();function Pr({source:e}){let{t}=a(),n=`diagram-${(0,Q.useId)().replace(/[^a-z0-9]/giu,``)}`,[r,i]=(0,Q.useState)(null),u=r?.source===e?r:null,d=u?.image,f=u?.error,[p,m]=(0,Q.useState)(1),h=(0,Q.useRef)(null),g=(0,Q.useRef)(null),_=(0,Q.useRef)(null);return(0,Q.useEffect)(()=>{let r=!1;return Nr=Nr.then(async()=>{if(!r)try{if(e.length>5e4)throw Error(t(`filesDocumentLimit`));let a=await Mr.render(n,e),o=l.sanitize(a.svg,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:[`foreignObject`,`a`,`image`,`use`]});r||i({source:e,image:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(o)}`})}catch(n){r||i({source:e,error:n instanceof Error?n.message:t(`filesPreviewFailed`)})}}),()=>{r=!0}},[n,e,t]),f?(0,$.jsxs)(`div`,{className:`evidence-warning`,children:[(0,$.jsx)(`p`,{children:f}),(0,$.jsx)(`pre`,{children:e})]}):(0,$.jsxs)(`div`,{className:`file-diagram`,children:[d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`img`,{src:d,alt:t(`filesDiagram`)}),(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`filesExpandDiagram`),onClick:()=>{m(1),h.current?.showModal()},children:(0,$.jsx)(De,{})})]}):(0,$.jsx)(`p`,{role:`status`,children:t(`readingFile`)}),(0,$.jsxs)(`dialog`,{ref:h,className:`file-diagram-dialog`,"aria-label":t(`filesDiagram`),onCancel:e=>{e.stopPropagation()},onKeyDown:e=>{e.key===`Escape`&&e.stopPropagation()},children:[(0,$.jsxs)(`div`,{className:`file-preview-toolbar`,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`filesZoomOut`),onClick:()=>m(e=>Math.max(.25,e-.25)),children:(0,$.jsx)(s,{})}),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>m(1),children:[Math.round(p*100),`%`]}),(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`filesZoomIn`),onClick:()=>m(e=>Math.min(4,e+.25)),children:(0,$.jsx)(o,{})}),(0,$.jsx)(`button`,{type:`button`,"aria-label":t(`close`),onClick:()=>h.current?.close(),children:(0,$.jsx)(c,{})})]}),(0,$.jsx)(`section`,{ref:g,className:`file-media-viewport`,tabIndex:0,"aria-label":t(`filesDiagram`),onWheel:e=>{(e.ctrlKey||e.metaKey)&&m(t=>Math.max(.25,Math.min(4,t+(e.deltaY>0?-.1:.1))))},onPointerDown:e=>{let t=e.currentTarget;_.current={x:e.clientX,y:e.clientY,left:t.scrollLeft,top:t.scrollTop},t.setPointerCapture(e.pointerId)},onPointerMove:e=>{_.current&&(e.currentTarget.scrollLeft=_.current.left+_.current.x-e.clientX,e.currentTarget.scrollTop=_.current.top+_.current.y-e.clientY)},onPointerUp:()=>{_.current=null},onPointerCancel:()=>{_.current=null},children:d&&(0,$.jsx)(`img`,{src:d,alt:t(`filesDiagram`),draggable:!1,style:{width:`${p*100}%`}})})]})]})}export{Pr as default}; \ No newline at end of file diff --git a/web/dist/app-abnfDiagram-O67JEVCF.js b/web/dist/app-abnfDiagram-O67JEVCF.js index 5c2d9188c..1ab3376a7 100644 --- a/web/dist/app-abnfDiagram-O67JEVCF.js +++ b/web/dist/app-abnfDiagram-O67JEVCF.js @@ -1 +1 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n}from"./app-chunk-XHIXRSVI.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=n().RailroadAbnf.parser.LangiumParser,l=e(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=e(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=e(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=e(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=e(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=e(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:e(e=>{a.clear(),t.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new s(n);let r=n.value;t.debug(`[ABNF Parser] Parsed rules:`,r.rules.length),h(r),t.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{g as diagram}; \ No newline at end of file +import{n as e}from"./app-chunk-XHIXRSVI.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=e().RailroadAbnf.parser.LangiumParser,l=t(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=t(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=t(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=t(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=t(e=>{switch(e.$type){case`AbnfStringLiteral`:return{type:`terminal`,value:e.value};case`AbnfNumVal`:return{type:`terminal`,value:e.value};case`AbnfRuleName`:return{type:`nonterminal`,name:e.name};case`AbnfGroup`:return l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=t(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=t(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:t(e=>{a.clear(),n.debug(`[ABNF Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;n.debug(`[ABNF Parser] Parsed rules:`,r.rules.length),h(r),n.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{g as diagram}; \ No newline at end of file diff --git a/web/dist/app-architectureDiagram-NJMV4G6O.js b/web/dist/app-architectureDiagram-NJMV4G6O.js index 83f076457..f3b509c50 100644 --- a/web/dist/app-architectureDiagram-NJMV4G6O.js +++ b/web/dist/app-architectureDiagram-NJMV4G6O.js @@ -1,4 +1,4 @@ -import{i as e,t}from"./app-rolldown-runtime.js";import{n}from"./app-chunk-Y2CYZVJY.js";import{m as r,p as i}from"./app-src.js";import{H as a,U as o,Y as s,a as c,b as l,f as u,q as d,v as f,w as p,x as m,y as h,z as g}from"./app-chunk-O7XYJQB3.js";import{c as _,i as v}from"./app-chunk-ZIGJFQKS.js";import{t as y}from"./app-chunk-6AEJRKK7.js";import{i as b,r as x,t as S}from"./app-chunk-742MDFTN.js";import{n as C}from"./app-chunk-MBY4JIJT.js";import{t as w}from"./app-chunk-JWPE2WC7.js";import{n as T}from"./app-mermaid-parser.core.js";import{t as E}from"./app-cytoscape.esm.js";var D=t(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.layoutBase=r():n.layoutBase=r()})(e,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=28)})([(function(e,t,n){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r}),(function(e,t,n){var r=n(2),i=n(8),a=n(9);function o(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw`Node is not incident with this edge`},o.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var e=[,,,,];this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=o}),(function(e,t,n){function r(e){this.vGraphObject=e}e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(13),o=n(0),s=n(16),c=n(5);function l(e,t,n,o){n==null&&o==null&&(o=t),r.call(this,o),e.graphManager!=null&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=e,this.rect=n!=null&&t!=null?new a(t.x,t.y,n.width,n.height):new a}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.getEdges=function(){return this.edges},l.prototype.getChild=function(){return this.child},l.prototype.getOwner=function(){return this.owner},l.prototype.getWidth=function(){return this.rect.width},l.prototype.setWidth=function(e){this.rect.width=e},l.prototype.getHeight=function(){return this.rect.height},l.prototype.setHeight=function(e){this.rect.height=e},l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},l.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},l.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},l.prototype.getRect=function(){return this.rect},l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},l.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},l.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},l.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},l.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},l.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.target==e){if(r.source!=n)throw`Incorrect edge source!`;t.push(r)}}),t},l.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw`Incorrect edge source and/or target`;(r.target==e||r.source==e)&&t.push(r)}),t},l.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach(function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw`Incorrect incidency!`;e.add(n.source)}}),e},l.prototype.withChildren=function(){var e=new Set,t,n;if(e.add(this),this.child!=null)for(var r=this.child.getNodes(),i=0;it?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal==`right`&&this.setWidth(t+this.labelWidth)),this.labelHeight&&(this.labelPosVertical==`top`?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):this.labelPosVertical==`center`&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):this.labelPosVertical==`bottom`&&this.setHeight(n+this.labelHeight))}}},l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw`assert failed`;return this.inclusionTreeDepth},l.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new c(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},l.prototype.getLeft=function(){return this.rect.x},l.prototype.getRight=function(){return this.rect.x+this.rect.width},l.prototype.getTop=function(){return this.rect.y},l.prototype.getBottom=function(){return this.rect.y+this.rect.height},l.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},e.exports=l}),(function(e,t,n){var r=n(0);function i(){}for(var a in r)i[a]=r[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=i.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i}),(function(e,t,n){function r(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(0),o=n(7),s=n(3),c=n(1),l=n(13),u=n(12),d=n(11);function f(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,t!=null&&t instanceof o?this.graphManager=t:t!=null&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in f.prototype=Object.create(r.prototype),r)f[p]=r[p];f.prototype.getNodes=function(){return this.nodes},f.prototype.getEdges=function(){return this.edges},f.prototype.getGraphManager=function(){return this.graphManager},f.prototype.getParent=function(){return this.parent},f.prototype.getLeft=function(){return this.left},f.prototype.getRight=function(){return this.right},f.prototype.getTop=function(){return this.top},f.prototype.getBottom=function(){return this.bottom},f.prototype.isConnected=function(){return this.isConnected},f.prototype.add=function(e,t,n){if(t==null&&n==null){var r=e;if(this.graphManager==null)throw`Graph has no graph mgr!`;if(this.getNodes().indexOf(r)>-1)throw`Node already in graph!`;return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw`Source or target not in graph!`;if(t.owner!=n.owner||t.owner!=this)throw`Both owners must be this graph!`;return t.owner==n.owner?(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i):null},f.prototype.remove=function(e){var t=e;if(e instanceof s){if(t==null)throw`Node is null!`;if(t.owner==null||t.owner!=this)throw`Owner graph is invalid!`;if(this.graphManager==null)throw`Owner graph manager is invalid!`;for(var n=t.edges.slice(),r,i=n.length,a=0;a-1&&u>-1))throw`Source and/or target doesn't know this edge!`;r.source.edges.splice(l,1),r.target!=r.source&&r.target.edges.splice(u,1);var o=r.source.owner.getEdges().indexOf(r);if(o==-1)throw`Not in owner's edge list!`;r.source.owner.getEdges().splice(o,1)}},f.prototype.updateLeftTop=function(){for(var e=i.MAX_VALUE,t=i.MAX_VALUE,n,r,a,o=this.getNodes(),s=o.length,c=0;cn&&(e=n),t>r&&(t=r)}return e==i.MAX_VALUE?null:(a=o[0].getParent().paddingLeft==null?this.margin:o[0].getParent().paddingLeft,this.left=t-a,this.top=e-a,new u(this.left,this.top))},f.prototype.updateBounds=function(e){for(var t=i.MAX_VALUE,n=-i.MAX_VALUE,r=i.MAX_VALUE,a=-i.MAX_VALUE,o,s,c,u,d,f=this.nodes,p=f.length,m=0;mo&&(t=o),nc&&(r=c),ao&&(t=o),nc&&(r=c),a=this.nodes.length){var c=0;n.forEach(function(t){t.owner==e&&c++}),c==this.nodes.length&&(this.isConnected=!0)}},e.exports=f}),(function(e,t,n){var r,i=n(1);function a(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(n==null&&r==null&&i==null){if(e==null)throw`Graph is null!`;if(t==null)throw`Parent node is null!`;if(this.graphs.indexOf(e)>-1)throw`Graph already in this graph mgr!`;if(this.graphs.push(e),e.parent!=null)throw`Already has a parent!`;if(t.child!=null)throw`Already has a child!`;return e.parent=t,t.child=e,e}i=n,r=t,n=e;var a=r.getOwner(),o=i.getOwner();if(a==null||a.getGraphManager()!=this)throw`Source not in this graph mgr!`;if(o==null||o.getGraphManager()!=this)throw`Target not in this graph mgr!`;if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw`Edge already in inter-graph edge list!`;if(this.edges.push(n),n.source==null||n.target==null)throw`Edge source and/or target is null!`;if(n.source.edges.indexOf(n)!=-1||n.target.edges.indexOf(n)!=-1)throw`Edge already in source and/or target incidency list!`;return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw`Graph not in this graph mgr`;if(!(t==this.rootGraph||t.parent!=null&&t.parent.graphManager==this))throw`Invalid parent node!`;var n=[];n=n.concat(t.getEdges());for(var a,o=n.length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]o)return n[0]=r,n[1]=c,n[2]=a,n[3]=y,!1;if(ia)return n[0]=s,n[1]=i,n[2]=_,n[3]=o,!1;if(ra?(n[0]=u,n[1]=d,C=!0):(n[0]=l,n[1]=c,C=!0):T===D&&(r>a?(n[0]=s,n[1]=c,C=!0):(n[0]=f,n[1]=d,C=!0)),-E===D?a>r?(n[2]=v,n[3]=y,w=!0):(n[2]=_,n[3]=g,w=!0):E===D&&(a>r?(n[2]=h,n[3]=g,w=!0):(n[2]=b,n[3]=y,w=!0)),C&&w)return!1;if(r>a?i>o?(O=this.getCardinalDirection(T,D,4),k=this.getCardinalDirection(E,D,2)):(O=this.getCardinalDirection(-T,D,3),k=this.getCardinalDirection(-E,D,1)):i>o?(O=this.getCardinalDirection(-T,D,1),k=this.getCardinalDirection(-E,D,3)):(O=this.getCardinalDirection(T,D,2),k=this.getCardinalDirection(E,D,4)),!C)switch(O){case 1:j=c,A=r+-m/D,n[0]=A,n[1]=j;break;case 2:A=f,j=i+p*D,n[0]=A,n[1]=j;break;case 3:j=d,A=r+m/D,n[0]=A,n[1]=j;break;case 4:A=u,j=i+-p*D,n[0]=A,n[1]=j}if(!w)switch(k){case 1:N=g,M=a+-S/D,n[2]=M,n[3]=N;break;case 2:M=b,N=o+x*D,n[2]=M,n[3]=N;break;case 3:N=y,M=a+S/D,n[2]=M,n[3]=N;break;case 4:M=v,N=o+-x*D,n[2]=M,n[3]=N}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(i==null)return this.getIntersection2(e,t,n);var a=e.x,o=e.y,s=t.x,c=t.y,l=n.x,u=n.y,d=i.x,f=i.y,p=void 0,m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0;return h=c-o,_=a-s,y=s*o-a*c,g=f-u,v=l-d,b=d*u-l*f,x=h*v-g*_,x===0?null:(p=(_*b-v*y)/x,m=(g*y-h*b)/x,new r(p,m))},i.angleOfVector=function(e,t,n,r){var i=void 0;return e===n?i=r=0){var u=(-c+Math.sqrt(c*c-4*s*l))/(2*s),d=(-c-Math.sqrt(c*c-4*s*l))/(2*s);return u>=0&&u<=1?[u]:d>=0&&d<=1?[d]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i}),(function(e,t,n){function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r}),(function(e,t,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(l[0]);s.length>0&&t;){var u=s[0];s.splice(0,1),o.add(u);for(var d=u.getEdges(),a=0;a-1&&l.splice(h,1)}o=new Set,c=new Map}}return e},f.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),a=0;a=0&&t.splice(d,1),s.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;t==1&&l.push(e),r.set(e,t)}})}n=n.concat(l),(t.length==1||t.length==2)&&(i=!0,a=t[0])}return a},f.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=f}),(function(e,t,n){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=Math.sin(r.seed++)*1e4,r.x-Math.floor(r.x)},e.exports=r}),(function(e,t,n){var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return n!=0&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return n!=0&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return n!=0&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return n!=0&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i}),(function(e,t,n){function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);ta.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(this.coolingFactor=e>a.ADAPTATION_LOWER_NODE_LIMIT?Math.max(a.COOLING_ADAPTATION_FACTOR,1-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e=this.getAllEdges(),t,n=0;n0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n,r,i,o,s=this.getAllNodes(),c;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&e&&this.updateGrid(),c=new Set,n=0;nc||s>c)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a)):(c=t.getEstimatedSize()*this.compoundGravityRangeFactor,(o>c||s>c)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant))},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=c.length||u>=c[0].length)){for(var d=0;de}}]),e}()}),(function(e,t,n){function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-->0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function(e){return function e(t){if(t.length==0)return 0;for(var n=[],r=0;r0;)t.push(0);return t}(this.n),i=function(e){for(var t=[];e-->0;)t.push(0);return t}(this.m),a=!0,o=!0,s=Math.min(this.m-1,this.n),c=Math.max(0,Math.min(this.n-2,this.m)),l=0;l=0;k--)if(this.s[k]!==0){for(var A=k+1;A=0;L--){if(function(e,t){return e&&t}(L0;){var U=void 0,W=void 0;for(U=E-2;U>=-1&&U!==-1;U--)if(Math.abs(n[U])<=re+ne*(Math.abs(this.s[U])+Math.abs(this.s[U+1]))){n[U]=0;break}if(U===E-2)W=4;else{var G=void 0;for(G=E-1;G>=U&&G!==U;G--){var ie=(G===E?0:Math.abs(n[G]))+(G===U+1?0:Math.abs(n[G-1]));if(Math.abs(this.s[G])<=re+ne*ie){this.s[G]=0;break}}G===U?W=3:G===E-1?W=1:(W=2,U=G)}switch(U++,W){case 1:var K=n[E-2];n[E-2]=0;for(var q=E-2;q>=U;q--){var ae=r.hypot(this.s[q],K),J=this.s[q]/ae,Y=K/ae;if(this.s[q]=ae,q!==U&&(K=-Y*n[q-1],n[q-1]=J*n[q-1]),o)for(var X=0;X=this.s[U+1]);){var De=this.s[U];if(this.s[U]=this.s[U+1],this.s[U+1]=De,o&&UMath.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):t==0?n=0:(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)),n},e.exports=r}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=a,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=Array(this.iMax);for(var s=0;s=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(D()):typeof define==`function`&&define.amd?define([`layout-base`],r):typeof e==`object`?e.coseBase=r(D()):n.coseBase=r(n.layoutBase)})(e,function(e){return(()=>{var t={45:((e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r}),806:((e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i}),767:((e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),880:((e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),578:((e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),765:((e,t,n)=>{var r=n(551).FDLayout,i=n(578),a=n(880),o=n(991),s=n(767),c=n(806),l=n(902),u=n(551).FDLayoutConstants,d=n(551).LayoutConstants,f=n(551).Point,p=n(551).PointD,m=n(551).DimensionD,h=n(551).Layout,g=n(551).Integer,_=n(551).IGeometry,v=n(551).LGraph,y=n(551).Transform,b=n(551).LinkedList;function x(){r.call(this),this.toBeTiled={},this.constraints={}}for(var S in x.prototype=Object.create(r.prototype),r)x[S]=r[S];x.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},x.prototype.newGraph=function(e){return new a(null,this.graphManager,e)},x.prototype.newNode=function(e){return new o(this.graphManager,e)},x.prototype.newEdge=function(e){return new s(null,null,e)},x.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH<10?10:c.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},x.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},x.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},x.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),!this.incremental){var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n)}return Object.keys(this.constraints).length>0&&(l.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),c.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},x.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-this.coolingCycle**+(Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=c.PURE_INCREMENTAL?u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=c.PURE_INCREMENTAL?u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements();for(var n=0;n0&&(r.fixedNodeWeight=a)}}if(this.constraints.relativePlacementConstraint){var o=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var l=this.constraints.alignmentConstraint.vertical,n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var n=o.has(t.left)?o.get(t.left):t.left,r=o.has(t.right)?o.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,a=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(a)||(e.nodesInRelativeVertical.push(a),e.nodeToRelativeConstraintMapVertical.set(a,[]),e.dummyToNodeForHorizontalAlignment.has(a)?e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(a).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:a,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(a).push({top:i,gap:t.gap})}});else{var d=new Map,f=new Map;this.constraints.relativePlacementConstraint.forEach(function(e){if(e.left){var t=o.has(e.left)?o.get(e.left):e.left,n=o.has(e.right)?o.get(e.right):e.right;d.has(t)?d.get(t).push(n):d.set(t,[n]),d.has(n)?d.get(n).push(t):d.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;f.has(r)?f.get(r).push(i):f.set(r,[i]),f.has(i)?f.get(i).push(r):f.set(i,[r])}});var p=function(e,t){var n=[],r=[],i=new b,a=new Set,o=0;return e.forEach(function(s,c){if(!a.has(c)){n[o]=[],r[o]=!1;var l=c;for(i.push(l),a.add(l),n[o].push(l);i.length!=0;)l=i.shift(),t.has(l)&&(r[o]=!0),e.get(l).forEach(function(e){a.has(e)||(i.push(e),a.add(e),n[o].push(e))});o++}}),{components:n,isFixed:r}},m=p(d,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=m.components,this.fixedComponentsOnHorizontal=m.isFixed;var h=p(f,e.fixedNodesOnVertical);this.componentsOnVertical=h.components,this.fixedComponentsOnVertical=h.isFixed}}},x.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1){var s;for(s=0;sr&&(r=Math.floor(o.y)),a=Math.floor(o.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-o.x/2,d.WORLD_CENTER_Y-o.y/2))},x.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),c.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(t,null,0,359,0,r);var i=v.calculateBounds(e),a=new y;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o1;){var g=h[0];h.splice(0,1);var v=u.indexOf(g);v>=0&&u.splice(v,1),p--,d--}m=t==null?0:(u.indexOf(h[0])+1)%p;for(var y=Math.abs(r-n)/d,b=m;f!=d;b=++b%p){var S=u[b].getOtherEnd(e);if(S!=t){var C=(n+f*y)%360,w=(C+y)%360;x.branchRadialLayout(S,e,C,w,i+a,a),f++}}},x.maxDiagonalInTree=function(e){for(var t=g.MIN_VALUE,n=0;nt&&(t=r)}return t},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r=`DummyCompound_`+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),c=i.getChild();c.add(a);for(var l=0;li?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):r.labelPosHorizontal==`right`&&r.setWidth(i+r.labelWidth)),r.labelHeight&&(r.labelPosVertical==`top`?(r.rect.y-=r.labelHeight,r.setHeight(a+r.labelHeight),r.labelMarginTop=r.labelHeight):r.labelPosVertical==`center`&&r.labelHeight>a?(r.rect.y-=(r.labelHeight-a)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-a)/2):r.labelPosVertical==`bottom`&&r.setHeight(a+r.labelHeight))}})},x.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,a=t.labelMarginLeft,o=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,a,o)}},x.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop,o=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a,o,s)})},x.prototype.getToBeTiled=function(e){var t=e.id;if(this.toBeTiled[t]!=null)return this.toBeTiled[t];var n=e.getChild();if(n==null)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(a.getChild()==null){this.toBeTiled[a.id]=!1;continue}if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}return this.toBeTiled[t]=!0,!0},x.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;ru&&(u=f.rect.height)}n+=u+e.verticalPadding}},x.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var a=i.rect.width,o=i.rect.height;i.labelWidth&&(i.labelPosHorizontal==`left`?(i.rect.x-=i.labelWidth,i.setWidth(a+i.labelWidth),i.labelMarginLeft=i.labelWidth):i.labelPosHorizontal==`center`&&i.labelWidth>a?(i.rect.x-=(i.labelWidth-a)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-a)/2):i.labelPosHorizontal==`right`&&i.setWidth(a+i.labelWidth)),i.labelHeight&&(i.labelPosVertical==`top`?(i.rect.y-=i.labelHeight,i.setHeight(o+i.labelHeight),i.labelMarginTop=i.labelHeight):i.labelPosVertical==`center`&&i.labelHeight>o?(i.rect.y-=(i.labelHeight-o)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-o)/2):i.labelPosVertical==`bottom`&&i.setHeight(o+i.labelHeight))}})},x.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())});var l=a/i,u=o/i,d=(n-r)**2+4*(l+r)*(u+n)*i,f=(r-n+Math.sqrt(d))/(2*(l+r)),p;t?(p=Math.ceil(f),p==f&&p++):p=Math.floor(f);var m=p*(l+r)-r;return s>m&&(m=s),m+=r*2,m},x.prototype.tileNodesByFavoringDim=function(e,t,n){var r=c.TILING_PADDING_VERTICAL,i=c.TILING_PADDING_HORIZONTAL,a=c.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};a&&(o.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},l=function(e,t){return s(t)-s(e)};e.sort(function(e,t){var n=l;return o.idealRowWidth?(n=a,n(e.id,t.id)):n(e,t)});for(var u=0,d=0,f=0;f0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},x.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},x.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var a=e.rowWidth[i];if(a+e.horizontalPadding+t<=e.width)return!0;var o=0;e.rowHeight[i]0&&(o=n+e.verticalPadding-e.rowHeight[i]);var s=e.width-a>=t+e.horizontalPadding?(e.height+o)/(a+t+e.horizontalPadding):(e.height+o)/e.width;o=n+e.verticalPadding;var c=e.widtha&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;so&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var c=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]0)for(var d=i;d<=a;d++)l[0]+=this.grid[d][o-1].length+this.grid[d][o].length-1;if(a0)for(var d=o;d<=s;d++)l[3]+=this.grid[i-1][d].length+this.grid[i][d].length-1;for(var f=g.MAX_VALUE,p,m,h=0;h{var r=n(551).FDLayoutNode,i=n(551).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n=this.getChild().getNodes(),r,i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var a=0;r.forEach(function(e){t==`horizontal`?(f.set(e,c.has(e)?l[c.get(e)]:i.get(e)),a+=f.get(e)):(f.set(e,c.has(e)?u[c.get(e)]:i.get(e)),a+=f.get(e))}),a/=r.length,e.forEach(function(e){n.has(e)||f.set(e,a)})}else{var o=0;e.forEach(function(e){o+=t==`horizontal`?c.has(e)?l[c.get(e)]:i.get(e):c.has(e)?u[c.get(e)]:i.get(e)}),o/=e.length,e.forEach(function(e){f.set(e,o)})}});for(var h=function(){var r=m.shift();e.get(r).forEach(function(e){if(f.get(e.id)o&&(o=v),ys&&(s=y)}}catch(e){p=!0,m=e}finally{try{!d&&h.return&&h.return()}finally{if(p)throw m}}var b=(r+o)/2-(a+s)/2,x=!0,S=!1,C=void 0;try{for(var w=e[Symbol.iterator](),T;!(x=(T=w.next()).done);x=!0){var E=T.value;f.set(E,f.get(E)+b)}}catch(e){S=!0,C=e}finally{try{!x&&w.return&&w.return()}finally{if(S)throw C}}})}return f},v=function(e){var t=0,n=0,r=0,i=0;if(e.forEach(function(e){e.left?l[c.get(e.left)]-l[c.get(e.right)]>=0?t++:n++:u[c.get(e.top)]-u[c.get(e.bottom)]>=0?r++:i++}),t>n&&r>i)for(var a=0;an)for(var o=0;oi)for(var s=0;s1)t.fixedNodeConstraint.forEach(function(e,t){S[t]=[e.position.x,e.position.y],C[t]=[l[c.get(e.nodeId)],u[c.get(e.nodeId)]]}),w=!0;else if(t.alignmentConstraint)(function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach(function(e){i.add(e)});var a=new Set([].concat(r(i)).filter(function(e){return E.has(e)})),o=void 0;o=a.size>0?l[c.get(a.values().next().value)]:g(i).x,n[t].forEach(function(t){S[e]=[o,u[c.get(t)]],C[e]=[l[c.get(t)],u[c.get(t)]],e++})},a=0;a0?l[c.get(i.values().next().value)]:g(n).y,o[t].forEach(function(t){S[e]=[l[c.get(t)],a],C[e]=[l[c.get(t)],u[c.get(t)]],e++})},d=0;dA&&(A=k[M].length,j=M);if(A0){var W={x:0,y:0};t.fixedNodeConstraint.forEach(function(e,t){var n={x:l[c.get(e.nodeId)],y:u[c.get(e.nodeId)]},r=e.position,i=h(r,n);W.x+=i.x,W.y+=i.y}),W.x/=t.fixedNodeConstraint.length,W.y/=t.fixedNodeConstraint.length,l.forEach(function(e,t){l[t]+=W.x}),u.forEach(function(e,t){u[t]+=W.y}),t.fixedNodeConstraint.forEach(function(e){l[c.get(e.nodeId)]=e.position.x,u[c.get(e.nodeId)]=e.position.y})}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var G=t.alignmentConstraint.vertical,ie=function(e){var t=new Set;G[e].forEach(function(e){t.add(e)});var n=new Set([].concat(r(t)).filter(function(e){return E.has(e)})),i=void 0;i=n.size>0?l[c.get(n.values().next().value)]:g(t).x,t.forEach(function(e){E.has(e)||(l[c.get(e)]=i)})},K=0;K0?u[c.get(n.values().next().value)]:g(t).y,t.forEach(function(e){E.has(e)||(u[c.get(e)]=i)})},J=0;J{t.exports=e})},n={};function r(e){var i=n[e];if(i!==void 0)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}return r(45)})()})})),k=e(t(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(O()):typeof define==`function`&&define.amd?define([`cose-base`],r):typeof e==`object`?e.cytoscapeFcose=r(O()):n.cytoscapeFcose=r(n.coseBase)})(e,function(e){return(()=>{var t={658:(e=>{e.exports=Object.assign==null?function(e){return[...arguments].slice(1).forEach(function(t){Object.keys(t).forEach(function(n){return e[n]=t[n]})}),e}:Object.assign.bind(Object)}),548:((e,t,n)=>{var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=n(140).layoutBase.LinkedList,a={};a.getTopMostNodes=function(e){for(var t={},n=0;n0&&l.merge(e)});for(var u=0;u1){l=s[0],u=l.connectedEdges().length,s.forEach(function(e){e.connectedEdges().length0&&r.set(`dummy`+(r.size+1),p),m},a.relocateComponent=function(e,t,n){if(!n.fixedNodeConstraint){var i=1/0,a=-1/0,o=1/0,s=-1/0;if(n.quality==`draft`){var c=!0,l=!1,u=void 0;try{for(var d=t.nodeIndexes[Symbol.iterator](),f;!(c=(f=d.next()).done);c=!0){var p=f.value,m=r(p,2),h=m[0],g=m[1],_=n.cy.getElementById(h);if(_){var v=_.boundingBox(),y=t.xCoords[g]-v.w/2,b=t.xCoords[g]+v.w/2,x=t.yCoords[g]-v.h/2,S=t.yCoords[g]+v.h/2;ya&&(a=b),xs&&(s=S)}}}catch(e){l=!0,u=e}finally{try{!c&&d.return&&d.return()}finally{if(l)throw u}}var C=e.x-(a+i)/2,w=e.y-(s+o)/2;t.xCoords=t.xCoords.map(function(e){return e+C}),t.yCoords=t.yCoords.map(function(e){return e+w})}else{Object.keys(t).forEach(function(e){var n=t[e],r=n.getRect().x,c=n.getRect().x+n.getRect().width,l=n.getRect().y,u=n.getRect().y+n.getRect().height;ra&&(a=c),ls&&(s=u)});var T=e.x-(a+i)/2,E=e.y-(s+o)/2;Object.keys(t).forEach(function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+E)})}}},a.calcBoundingBox=function(e,t,n,r){for(var i=2**53-1,a=-(2**53-1),o=2**53-1,s=-(2**53-1),c=void 0,l=void 0,u=void 0,d=void 0,f=e.descendants().not(`:parent`),p=f.length,m=0;mc&&(i=c),au&&(o=u),s{var r=n(548),i=n(140).CoSELayout,a=n(140).CoSENode,o=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,c=n(140).layoutBase.LayoutConstants,l=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,d=e.eles,f=d.nodes(),p=d.edges(),m=void 0,h=void 0,g=void 0,_={};e.randomize&&(m=t.nodeIndexes,h=t.xCoords,g=t.yCoords);var v=function(e){return typeof e==`function`},y=function(e,t){return v(e)?e(t):e},b=r.calcParentsWithoutChildren(n,d),x=function e(t,n,i,c){for(var l=n.length,u=0;u0){var S=void 0;S=i.getGraphManager().add(i.newGraph(),p),e(S,f,i,c)}}},S=function(t,n,r){for(var i=0,a=0,o=0;o0?i/a:v(e.idealEdgeLength)?50:e.idealEdgeLength,u.MIN_REPULSION_DIST=l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH)},C=function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)};e.nestingFactor!=null&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),e.gravity!=null&&(u.DEFAULT_GRAVITY_STRENGTH=l.DEFAULT_GRAVITY_STRENGTH=e.gravity),e.numIter!=null&&(u.MAX_ITERATIONS=l.MAX_ITERATIONS=e.numIter),e.gravityRange!=null&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=l.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),e.gravityCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),e.gravityRangeCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),e.initialEnergyOnIncremental!=null&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=l.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),e.tilingCompareBy!=null&&(u.TILING_COMPARE_BY=e.tilingCompareBy),c.QUALITY=e.quality==`proof`?2:0,u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!e.randomize,u.ANIMATE=l.ANIMATE=c.ANIMATE=e.animate,u.TILE=e.tile,u.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==`function`?e.tilingPaddingVertical.call():e.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==`function`?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!e.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,e.step==`transformed`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),e.step==`enforced`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),e.step==`cose`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),e.step==`all`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!!e.randomize,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),u.TREE_REDUCTION_ON_INCREMENTAL=!(e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint);var w=new i,T=w.newGraphManager();return x(T.addRoot(),r.getTopMostNodes(f),w,e),S(w,T,p),C(w,e),w.runLayout(),_}}}),212:((e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(f){var p=o.getTopMostNodes(t.eles.nodes());if(l=o.connectComponents(n,t.eles,p),l.forEach(function(e){var t=e.boundingBox();u.push({x:t.x1+t.w/2,y:t.y1+t.h/2})}),t.randomize&&l.forEach(function(e){t.eles=e,i.push(s(t))}),t.quality=="default"||t.quality==`proof`){var m=n.collection();if(t.tile){var h=new Map,g=[],_=[],v=0,y={nodeIndexes:h,xCoords:g,yCoords:_},b=[];if(l.forEach(function(e,t){e.edges().length==0&&(e.nodes().forEach(function(t,n){m.merge(e.nodes()[n]),t.isParent()||(y.nodeIndexes.set(e.nodes()[n].id(),v++),y.xCoords.push(e.nodes()[0].position().x),y.yCoords.push(e.nodes()[0].position().y))}),b.push(t))}),m.length>1){var x=m.boundingBox();u.push({x:x.x1+x.w/2,y:x.y1+x.h/2}),l.push(m),i.push(y);for(var S=b.length-1;S>=0;S--)l.splice(b[S],1),i.splice(b[S],1),u.splice(b[S],1)}}l.forEach(function(e,n){t.eles=e,a.push(c(t,i[n])),o.relocateComponent(u[n],a[n],t)})}else l.forEach(function(e,n){o.relocateComponent(u[n],i[n],t)});var C=new Set;if(l.length>1){var w=[],T=r.filter(function(e){return e.css(`display`)==`none`});l.forEach(function(e,n){var r=void 0;if(t.quality==`draft`&&(r=i[n].nodeIndexes),e.nodes().not(T).length>0){var s={};s.edges=[],s.nodes=[];var c=void 0;e.nodes().not(T).forEach(function(e){if(t.quality==`draft`)if(!e.isParent())c=r.get(e.id()),s.nodes.push({x:i[n].xCoords[c]-e.boundingbox().w/2,y:i[n].yCoords[c]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h});else{var l=o.calcBoundingBox(e,i[n].xCoords,i[n].yCoords,r);s.nodes.push({x:l.topLeftX,y:l.topLeftY,width:l.width,height:l.height})}else a[n][e.id()]&&s.nodes.push({x:a[n][e.id()].getLeft(),y:a[n][e.id()].getTop(),width:a[n][e.id()].getWidth(),height:a[n][e.id()].getHeight()})}),e.edges().forEach(function(e){var c=e.source(),l=e.target();if(c.css(`display`)!=`none`&&l.css(`display`)!=`none`)if(t.quality==`draft`){var u=r.get(c.id()),d=r.get(l.id()),f=[],p=[];if(c.isParent()){var m=o.calcBoundingBox(c,i[n].xCoords,i[n].yCoords,r);f.push(m.topLeftX+m.width/2),f.push(m.topLeftY+m.height/2)}else f.push(i[n].xCoords[u]),f.push(i[n].yCoords[u]);if(l.isParent()){var h=o.calcBoundingBox(l,i[n].xCoords,i[n].yCoords,r);p.push(h.topLeftX+h.width/2),p.push(h.topLeftY+h.height/2)}else p.push(i[n].xCoords[d]),p.push(i[n].yCoords[d]);s.edges.push({startX:f[0],startY:f[1],endX:p[0],endY:p[1]})}else a[n][c.id()]&&a[n][l.id()]&&s.edges.push({startX:a[n][c.id()].getCenterX(),startY:a[n][c.id()].getCenterY(),endX:a[n][l.id()].getCenterX(),endY:a[n][l.id()].getCenterY()})}),s.nodes.length>0&&(w.push(s),C.add(n))}});var E=d.packComponents(w,t.randomize).shifts;if(t.quality==`draft`)i.forEach(function(e,t){var n=e.xCoords.map(function(e){return e+E[t].dx}),r=e.yCoords.map(function(e){return e+E[t].dy});e.xCoords=n,e.yCoords=r});else{var D=0;C.forEach(function(e){Object.keys(a[e]).forEach(function(t){var n=a[e][t];n.setCenter(n.getCenterX()+E[D].dx,n.getCenterY()+E[D].dy)}),D++})}}}else{var O=t.eles.boundingBox();if(u.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),t.randomize){var k=s(t);i.push(k)}t.quality=="default"||t.quality==`proof`?(a.push(c(t,i[0])),o.relocateComponent(u[0],a[0],t)):o.relocateComponent(u[0],i[0],t)}var A=function(e,n){if(t.quality=="default"||t.quality==`proof`){typeof e==`number`&&(e=n);var r=void 0,o=void 0,s=e.data(`id`);return a.forEach(function(e){s in e&&(r={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},o=e[s])}),t.nodeDimensionsIncludeLabels&&(o.labelWidth&&(o.labelPosHorizontal==`left`?r.x+=o.labelWidth/2:o.labelPosHorizontal==`right`&&(r.x-=o.labelWidth/2)),o.labelHeight&&(o.labelPosVertical==`top`?r.y+=o.labelHeight/2:o.labelPosVertical==`bottom`&&(r.y-=o.labelHeight/2))),r??={x:e.position(`x`),y:e.position(`y`)},{x:r.x,y:r.y}}var c=void 0;return i.forEach(function(t){var n=t.nodeIndexes.get(e.id());n!=null&&(c={x:t.xCoords[n],y:t.yCoords[n]})}),c??={x:e.position(`x`),y:e.position(`y`)},{x:c.x,y:c.y}};if(t.quality=="default"||t.quality==`proof`||t.randomize){var j=o.calcParentsWithoutChildren(n,r),M=r.filter(function(e){return e.css(`display`)==`none`});t.eles=r.not(M),r.nodes().not(`:parent`).not(M).layoutPositions(e,t,A),j.length>0&&j.forEach(function(e){e.position(A(e))})}else console.log(`If randomize option is set to false, then quality option must be 'default' or 'proof'.`)}}]),e}()}),657:((e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,a=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,o=n.nodes(),s=n.nodes(`:parent`),c=new Map,l=new Map,u=new Map,d=[],f=[],p=[],m=[],h=[],g=[],_=[],v=[],y=void 0,b=1e8,x=1e-9,S=e.piTol,C=e.samplingType,w=e.nodeSeparation,T=void 0,E=function(){for(var e=0,t=0,n=!1;t=i;){o=r[i++];for(var m=d[o],_=0;_u&&(u=h[x],f=x)}return f},O=function(e){var t=void 0;if(e){t=Math.floor(Math.random()*y);for(var n=0;n=1)break;u=l}for(var h=0;h=1)break;u=l}for(var b=0;b0&&(r.isParent()?d[t].push(u.get(r.id())):d[t].push(r.id()))})});var B=function(e){var n=l.get(e),r=void 0;c.get(e).forEach(function(i){r=t.getElementById(i).isParent()?u.get(i):i,d[n].push(r),d[l.get(r)].push(e)})},V=!0,ee=!1,te=void 0;try{for(var H=c.keys()[Symbol.iterator](),ne;!(V=(ne=H.next()).done);V=!0){var re=ne.value;B(re)}}catch(e){ee=!0,te=e}finally{try{!V&&H.return&&H.return()}finally{if(ee)throw te}}y=l.size;var U=void 0;if(y>2){T=y{var r=n(212),i=function(e){e&&e(`layout`,`fcose`,r)};typeof cytoscape<`u`&&i(cytoscape),e.exports=i}),140:(t=>{t.exports=e})},n={};function r(e){var i=n[e];if(i!==void 0)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}return r(579)})()})}))(),1),A={L:`left`,R:`right`,T:`top`,B:`bottom`},j={L:n(e=>`${e},${e/2} 0,${e} 0,0`,`L`),R:n(e=>`0,${e/2} ${e},0 ${e},${e}`,`R`),T:n(e=>`0,0 ${e},0 ${e/2},${e}`,`T`),B:n(e=>`${e/2},0 ${e},${e} 0,${e}`,`B`)},M={L:n((e,t)=>e-t+2,`L`),R:n((e,t)=>e-2,`R`),T:n((e,t)=>e-t+2,`T`),B:n((e,t)=>e-2,`B`)},N=n(function(e){return F(e)?e===`L`?`R`:`L`:e===`T`?`B`:`T`},`getOppositeArchitectureDirection`),P=n(function(e){let t=e;return t===`L`||t===`R`||t===`T`||t===`B`},`isArchitectureDirection`),F=n(function(e){let t=e;return t===`L`||t===`R`},`isArchitectureDirectionX`),I=n(function(e){let t=e;return t===`T`||t===`B`},`isArchitectureDirectionY`),L=n(function(e,t){let n=F(e)&&I(t),r=I(e)&&F(t);return n||r},`isArchitectureDirectionXY`),R=n(function(e){let t=e[0],n=e[1],r=F(t)&&I(n),i=I(t)&&F(n);return r||i},`isArchitecturePairXY`),z=n(function(e){return e!==`LL`&&e!==`RR`&&e!==`TT`&&e!==`BB`},`isValidArchitectureDirectionPair`),B=n(function(e,t){let n=`${e}${t}`;return z(n)?n:void 0},`getArchitectureDirectionPair`),V=n(function([e,t],n){let r=n[0],i=n[1];return F(r)?I(i)?[e+(r===`L`?-1:1),t+(i===`T`?1:-1)]:[e+(r===`L`?-1:1),t]:F(i)?[e+(i===`L`?1:-1),t+(r===`T`?1:-1)]:[e,t+(r===`T`?1:-1)]},`shiftPositionByArchitectureDirectionPair`),ee=n(function(e){return e===`LT`||e===`TL`?[1,1]:e===`BL`||e===`LB`?[1,-1]:e===`BR`||e===`RB`?[-1,-1]:[-1,1]},`getArchitectureDirectionXYFactors`),te=n(function(e,t){return L(e,t)?`bend`:F(e)?`horizontal`:`vertical`},`getArchitectureDirectionAlignment`),H=n(function(e){return e.type===`service`},`isArchitectureService`),ne=n(function(e){return e.type===`junction`},`isArchitectureJunction`),re=n((e,t)=>{let[n,r]=[e,t].sort();return`${JSON.stringify(n)}-${JSON.stringify(r)}`},`architectureGroupAlignmentKey`),U=n(e=>e.data(),`edgeData`),W=n(e=>e.data(),`nodeData`),G=u.architecture,ie=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId=``,this.setAccTitle=o,this.getAccTitle=h,this.setDiagramTitle=d,this.getDiagramTitle=p,this.getAccDescription=f,this.setAccDescription=a,this.clear()}static{n(this,`ArchitectureDB`)}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId=``,c()}addService({id:e,icon:t,in:n,title:r,iconText:i}){if(this.registeredIds.has(e))throw Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(n)===`node`)throw Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,`node`),this.nodes.set(e,{id:e,type:`service`,icon:t,iconText:i,title:r,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(H)}addJunction({id:e,in:t}){if(this.registeredIds.has(e))throw Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(t!==void 0){if(e===t)throw Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(t))throw Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(t)===`node`)throw Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,`node`),this.nodes.set(e,{id:e,type:`junction`,edges:[],in:t})}getJunctions(){return[...this.nodes.values()].filter(ne)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:t,in:n,title:r}){if(this.registeredIds.has(e))throw Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(n)===`node`)throw Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,`group`),this.groups.set(e,{id:e,icon:t,title:r,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:t,lhsDir:n,rhsDir:r,lhsInto:i,rhsInto:a,lhsGroup:o,rhsGroup:s,title:c}){if(!P(n))throw Error(`Invalid direction given for left hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(n)}`);if(!P(r))throw Error(`Invalid direction given for right hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(r)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(t)&&!this.groups.has(t))throw Error(`The right-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);let l=this.nodes.get(e).in,u=this.nodes.get(t).in;if(o&&l&&u&&l==u)throw Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(s&&l&&u&&l==u)throw Error(`The right-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let d={lhsId:e,lhsDir:n,lhsInto:i,lhsGroup:o,rhsId:t,rhsDir:r,rhsInto:a,rhsGroup:s,title:c};this.edges.push(d);let f=this.nodes.get(e),p=this.nodes.get(t);f&&p&&(f.edges.push(this.edges[this.edges.length-1]),p.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw Error(`An align directive requires at least two members; got ${e.members.length}`);let t=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!==`node`)throw Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(t.has(n))throw Error(`align ${e.direction} lists [${n}] more than once`);t.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let e=new Map,t=new Map;for(let[n,r]of this.nodes.entries()){let i=new Map;for(let t of r.edges){let r=this.getNode(t.lhsId)?.in,a=this.getNode(t.rhsId)?.in;if(r&&a&&r!==a){let n=te(t.lhsDir,t.rhsDir);n!==`bend`&&e.set(re(r,a),n)}if(t.lhsId===n){let e=B(t.lhsDir,t.rhsDir);e&&i.set(e,t.rhsId)}else{let e=B(t.rhsDir,t.lhsDir);e&&i.set(e,t.lhsId)}}t.set(n,i)}let r=new Set,i=new Set(t.keys()),a=n(e=>{let n=new Map([[e,[0,0]]]),a=[e];for(;a.length>0;){let e=a.shift();if(e){r.add(e),i.delete(e);let o=t.get(e);if(!o)throw Error(`BFS error: adjacency list for id ${e} not found. Please report this as a bug.`);let s=n.get(e);if(!s)throw Error(`BFS error: position for id ${e} not found in spatial map. Please report this as a bug.`);let[c,l]=s;o.forEach((e,t)=>{r.has(e)||(n.set(e,V([c,l],t)),a.push(e))})}}return n},`BFS`),o=[];for(;i.size>0;){let e=i.values().next().value;o.push(a(e))}this.dataStructures={adjList:t,spatialMaps:o,groupAlignments:e}}return this.dataStructures}setElementForId(e,t){this.elements.set(e,t)}getElementById(e){return this.elements.get(e)}getConfig(){return v({...G,...l().architecture})}getConfigField(e){return this.getConfig()[e]}},K=n((e,t)=>{w(e,t),e.groups.map(e=>t.addGroup(e)),e.services.map(e=>t.addService({...e,type:`service`})),e.junctions.map(e=>t.addJunction({...e,type:`junction`})),e.edges.map(e=>t.addEdge(e)),e.alignments?.map(e=>t.addLayoutHint({direction:e.direction,members:[...e.members]}))},`populateDb`),q={parser:{yy:void 0},parse:n(async e=>{let t=await T(`architecture`,e);r.debug(t);let n=q.parser?.yy;if(!(n instanceof ie))throw Error(`parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);K(t,n)},`parse`)},ae=n(e=>` +import{i as e,t}from"./app-rolldown-runtime.js";import{n}from"./app-chunk-Y2CYZVJY.js";import{m as r,p as i}from"./app-src.js";import{H as a,U as o,Y as s,a as c,b as l,f as u,q as d,v as f,w as p,x as m,y as h,z as g}from"./app-chunk-O7XYJQB3.js";import{c as _,i as v}from"./app-chunk-ZIGJFQKS.js";import{t as y}from"./app-chunk-6AEJRKK7.js";import{t as b}from"./app-chunk-JWPE2WC7.js";import{n as x}from"./app-mermaid-parser.core.js";import{i as S,r as C,t as w}from"./app-chunk-742MDFTN.js";import{n as T}from"./app-chunk-MBY4JIJT.js";import{t as E}from"./app-cytoscape.esm.js";var D=t(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.layoutBase=r():n.layoutBase=r()})(e,function(){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=28)})([(function(e,t,n){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r}),(function(e,t,n){var r=n(2),i=n(8),a=n(9);function o(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in o.prototype=Object.create(r.prototype),r)o[s]=r[s];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw`Node is not incident with this edge`},o.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var e=[,,,,];this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=o}),(function(e,t,n){function r(e){this.vGraphObject=e}e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(13),o=n(0),s=n(16),c=n(5);function l(e,t,n,o){n==null&&o==null&&(o=t),r.call(this,o),e.graphManager!=null&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=e,this.rect=n!=null&&t!=null?new a(t.x,t.y,n.width,n.height):new a}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.getEdges=function(){return this.edges},l.prototype.getChild=function(){return this.child},l.prototype.getOwner=function(){return this.owner},l.prototype.getWidth=function(){return this.rect.width},l.prototype.setWidth=function(e){this.rect.width=e},l.prototype.getHeight=function(){return this.rect.height},l.prototype.setHeight=function(e){this.rect.height=e},l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},l.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},l.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},l.prototype.getRect=function(){return this.rect},l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},l.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},l.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},l.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},l.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},l.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.target==e){if(r.source!=n)throw`Incorrect edge source!`;t.push(r)}}),t},l.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw`Incorrect edge source and/or target`;(r.target==e||r.source==e)&&t.push(r)}),t},l.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach(function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw`Incorrect incidency!`;e.add(n.source)}}),e},l.prototype.withChildren=function(){var e=new Set,t,n;if(e.add(this),this.child!=null)for(var r=this.child.getNodes(),i=0;it?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal==`right`&&this.setWidth(t+this.labelWidth)),this.labelHeight&&(this.labelPosVertical==`top`?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):this.labelPosVertical==`center`&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):this.labelPosVertical==`bottom`&&this.setHeight(n+this.labelHeight))}}},l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw`assert failed`;return this.inclusionTreeDepth},l.prototype.transform=function(e){var t=this.rect.x;t>o.WORLD_BOUNDARY?t=o.WORLD_BOUNDARY:t<-o.WORLD_BOUNDARY&&(t=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new c(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},l.prototype.getLeft=function(){return this.rect.x},l.prototype.getRight=function(){return this.rect.x+this.rect.width},l.prototype.getTop=function(){return this.rect.y},l.prototype.getBottom=function(){return this.rect.y+this.rect.height},l.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},e.exports=l}),(function(e,t,n){var r=n(0);function i(){}for(var a in r)i[a]=r[a];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=i.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i}),(function(e,t,n){function r(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r}),(function(e,t,n){var r=n(2),i=n(10),a=n(0),o=n(7),s=n(3),c=n(1),l=n(13),u=n(12),d=n(11);function f(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,t!=null&&t instanceof o?this.graphManager=t:t!=null&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in f.prototype=Object.create(r.prototype),r)f[p]=r[p];f.prototype.getNodes=function(){return this.nodes},f.prototype.getEdges=function(){return this.edges},f.prototype.getGraphManager=function(){return this.graphManager},f.prototype.getParent=function(){return this.parent},f.prototype.getLeft=function(){return this.left},f.prototype.getRight=function(){return this.right},f.prototype.getTop=function(){return this.top},f.prototype.getBottom=function(){return this.bottom},f.prototype.isConnected=function(){return this.isConnected},f.prototype.add=function(e,t,n){if(t==null&&n==null){var r=e;if(this.graphManager==null)throw`Graph has no graph mgr!`;if(this.getNodes().indexOf(r)>-1)throw`Node already in graph!`;return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw`Source or target not in graph!`;if(t.owner!=n.owner||t.owner!=this)throw`Both owners must be this graph!`;return t.owner==n.owner?(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i):null},f.prototype.remove=function(e){var t=e;if(e instanceof s){if(t==null)throw`Node is null!`;if(t.owner==null||t.owner!=this)throw`Owner graph is invalid!`;if(this.graphManager==null)throw`Owner graph manager is invalid!`;for(var n=t.edges.slice(),r,i=n.length,a=0;a-1&&u>-1))throw`Source and/or target doesn't know this edge!`;r.source.edges.splice(l,1),r.target!=r.source&&r.target.edges.splice(u,1);var o=r.source.owner.getEdges().indexOf(r);if(o==-1)throw`Not in owner's edge list!`;r.source.owner.getEdges().splice(o,1)}},f.prototype.updateLeftTop=function(){for(var e=i.MAX_VALUE,t=i.MAX_VALUE,n,r,a,o=this.getNodes(),s=o.length,c=0;cn&&(e=n),t>r&&(t=r)}return e==i.MAX_VALUE?null:(a=o[0].getParent().paddingLeft==null?this.margin:o[0].getParent().paddingLeft,this.left=t-a,this.top=e-a,new u(this.left,this.top))},f.prototype.updateBounds=function(e){for(var t=i.MAX_VALUE,n=-i.MAX_VALUE,r=i.MAX_VALUE,a=-i.MAX_VALUE,o,s,c,u,d,f=this.nodes,p=f.length,m=0;mo&&(t=o),nc&&(r=c),ao&&(t=o),nc&&(r=c),a=this.nodes.length){var c=0;n.forEach(function(t){t.owner==e&&c++}),c==this.nodes.length&&(this.isConnected=!0)}},e.exports=f}),(function(e,t,n){var r,i=n(1);function a(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}a.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},a.prototype.add=function(e,t,n,r,i){if(n==null&&r==null&&i==null){if(e==null)throw`Graph is null!`;if(t==null)throw`Parent node is null!`;if(this.graphs.indexOf(e)>-1)throw`Graph already in this graph mgr!`;if(this.graphs.push(e),e.parent!=null)throw`Already has a parent!`;if(t.child!=null)throw`Already has a child!`;return e.parent=t,t.child=e,e}i=n,r=t,n=e;var a=r.getOwner(),o=i.getOwner();if(a==null||a.getGraphManager()!=this)throw`Source not in this graph mgr!`;if(o==null||o.getGraphManager()!=this)throw`Target not in this graph mgr!`;if(a==o)return n.isInterGraph=!1,a.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw`Edge already in inter-graph edge list!`;if(this.edges.push(n),n.source==null||n.target==null)throw`Edge source and/or target is null!`;if(n.source.edges.indexOf(n)!=-1||n.target.edges.indexOf(n)!=-1)throw`Edge already in source and/or target incidency list!`;return n.source.edges.push(n),n.target.edges.push(n),n},a.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw`Graph not in this graph mgr`;if(!(t==this.rootGraph||t.parent!=null&&t.parent.graphManager==this))throw`Invalid parent node!`;var n=[];n=n.concat(t.getEdges());for(var a,o=n.length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var a=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(a=1);var o=a*n[0],s=n[1]/a;n[0]o)return n[0]=r,n[1]=c,n[2]=a,n[3]=y,!1;if(ia)return n[0]=s,n[1]=i,n[2]=_,n[3]=o,!1;if(ra?(n[0]=u,n[1]=d,C=!0):(n[0]=l,n[1]=c,C=!0):T===D&&(r>a?(n[0]=s,n[1]=c,C=!0):(n[0]=f,n[1]=d,C=!0)),-E===D?a>r?(n[2]=v,n[3]=y,w=!0):(n[2]=_,n[3]=g,w=!0):E===D&&(a>r?(n[2]=h,n[3]=g,w=!0):(n[2]=b,n[3]=y,w=!0)),C&&w)return!1;if(r>a?i>o?(O=this.getCardinalDirection(T,D,4),k=this.getCardinalDirection(E,D,2)):(O=this.getCardinalDirection(-T,D,3),k=this.getCardinalDirection(-E,D,1)):i>o?(O=this.getCardinalDirection(-T,D,1),k=this.getCardinalDirection(-E,D,3)):(O=this.getCardinalDirection(T,D,2),k=this.getCardinalDirection(E,D,4)),!C)switch(O){case 1:j=c,A=r+-m/D,n[0]=A,n[1]=j;break;case 2:A=f,j=i+p*D,n[0]=A,n[1]=j;break;case 3:j=d,A=r+m/D,n[0]=A,n[1]=j;break;case 4:A=u,j=i+-p*D,n[0]=A,n[1]=j}if(!w)switch(k){case 1:N=g,M=a+-S/D,n[2]=M,n[3]=N;break;case 2:M=b,N=o+x*D,n[2]=M,n[3]=N;break;case 3:N=y,M=a+S/D,n[2]=M,n[3]=N;break;case 4:M=v,N=o+-x*D,n[2]=M,n[3]=N}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(i==null)return this.getIntersection2(e,t,n);var a=e.x,o=e.y,s=t.x,c=t.y,l=n.x,u=n.y,d=i.x,f=i.y,p=void 0,m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0;return h=c-o,_=a-s,y=s*o-a*c,g=f-u,v=l-d,b=d*u-l*f,x=h*v-g*_,x===0?null:(p=(_*b-v*y)/x,m=(g*y-h*b)/x,new r(p,m))},i.angleOfVector=function(e,t,n,r){var i=void 0;return e===n?i=r=0){var u=(-c+Math.sqrt(c*c-4*s*l))/(2*s),d=(-c-Math.sqrt(c*c-4*s*l))/(2*s);return u>=0&&u<=1?[u]:d>=0&&d<=1?[d]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i}),(function(e,t,n){function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r}),(function(e,t,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(l[0]);s.length>0&&t;){var u=s[0];s.splice(0,1),o.add(u);for(var d=u.getEdges(),a=0;a-1&&l.splice(h,1)}o=new Set,c=new Map}}return e},f.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),a=0;a=0&&t.splice(d,1),s.getNeighborsList().forEach(function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;t==1&&l.push(e),r.set(e,t)}})}n=n.concat(l),(t.length==1||t.length==2)&&(i=!0,a=t[0])}return a},f.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=f}),(function(e,t,n){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=Math.sin(r.seed++)*1e4,r.x-Math.floor(r.x)},e.exports=r}),(function(e,t,n){var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return n!=0&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return n!=0&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return n!=0&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return n!=0&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i}),(function(e,t,n){function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);ta.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(this.coolingFactor=e>a.ADAPTATION_LOWER_NODE_LIMIT?Math.max(a.COOLING_ADAPTATION_FACTOR,1-(e-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e=this.getAllEdges(),t,n=0;n0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n,r,i,o,s=this.getAllNodes(),c;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&e&&this.updateGrid(),c=new Set,n=0;nc||s>c)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*a)):(c=t.getEstimatedSize()*this.compoundGravityRangeFactor,(o>c||s>c)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*a*this.compoundGravityConstant))},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=c.length||u>=c[0].length)){for(var d=0;de}}]),e}()}),(function(e,t,n){function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-->0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function(e){return function e(t){if(t.length==0)return 0;for(var n=[],r=0;r0;)t.push(0);return t}(this.n),i=function(e){for(var t=[];e-->0;)t.push(0);return t}(this.m),a=!0,o=!0,s=Math.min(this.m-1,this.n),c=Math.max(0,Math.min(this.n-2,this.m)),l=0;l=0;k--)if(this.s[k]!==0){for(var A=k+1;A=0;L--){if(function(e,t){return e&&t}(L0;){var U=void 0,W=void 0;for(U=E-2;U>=-1&&U!==-1;U--)if(Math.abs(n[U])<=re+ne*(Math.abs(this.s[U])+Math.abs(this.s[U+1]))){n[U]=0;break}if(U===E-2)W=4;else{var G=void 0;for(G=E-1;G>=U&&G!==U;G--){var ie=(G===E?0:Math.abs(n[G]))+(G===U+1?0:Math.abs(n[G-1]));if(Math.abs(this.s[G])<=re+ne*ie){this.s[G]=0;break}}G===U?W=3:G===E-1?W=1:(W=2,U=G)}switch(U++,W){case 1:var K=n[E-2];n[E-2]=0;for(var q=E-2;q>=U;q--){var ae=r.hypot(this.s[q],K),J=this.s[q]/ae,Y=K/ae;if(this.s[q]=ae,q!==U&&(K=-Y*n[q-1],n[q-1]=J*n[q-1]),o)for(var X=0;X=this.s[U+1]);){var De=this.s[U];if(this.s[U]=this.s[U+1],this.s[U+1]=De,o&&UMath.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):t==0?n=0:(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)),n},e.exports=r}),(function(e,t,n){var r=function(){function e(e,t){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;i(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=a,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=Array(this.iMax);for(var s=0;s=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(D()):typeof define==`function`&&define.amd?define([`layout-base`],r):typeof e==`object`?e.coseBase=r(D()):n.coseBase=r(n.layoutBase)})(e,function(e){return(()=>{var t={45:((e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r}),806:((e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i}),767:((e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),880:((e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),578:((e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i}),765:((e,t,n)=>{var r=n(551).FDLayout,i=n(578),a=n(880),o=n(991),s=n(767),c=n(806),l=n(902),u=n(551).FDLayoutConstants,d=n(551).LayoutConstants,f=n(551).Point,p=n(551).PointD,m=n(551).DimensionD,h=n(551).Layout,g=n(551).Integer,_=n(551).IGeometry,v=n(551).LGraph,y=n(551).Transform,b=n(551).LinkedList;function x(){r.call(this),this.toBeTiled={},this.constraints={}}for(var S in x.prototype=Object.create(r.prototype),r)x[S]=r[S];x.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},x.prototype.newGraph=function(e){return new a(null,this.graphManager,e)},x.prototype.newNode=function(e){return new o(this.graphManager,e)},x.prototype.newEdge=function(e){return new s(null,null,e)},x.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH<10?10:c.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},x.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},x.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},x.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),!this.incremental){var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(e){return t.has(e)});this.graphManager.setAllNodesToApplyGravitation(n)}return Object.keys(this.constraints).length>0&&(l.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),c.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},x.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%u.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-this.coolingCycle**+(Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(t){return e.has(t)});this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=c.PURE_INCREMENTAL?u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:u.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=c.PURE_INCREMENTAL?u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements();for(var n=0;n0&&(r.fixedNodeWeight=a)}}if(this.constraints.relativePlacementConstraint){var o=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var l=this.constraints.alignmentConstraint.vertical,n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var n=o.has(t.left)?o.get(t.left):t.left,r=o.has(t.right)?o.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,a=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(a)||(e.nodesInRelativeVertical.push(a),e.nodeToRelativeConstraintMapVertical.set(a,[]),e.dummyToNodeForHorizontalAlignment.has(a)?e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(a).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:a,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(a).push({top:i,gap:t.gap})}});else{var d=new Map,f=new Map;this.constraints.relativePlacementConstraint.forEach(function(e){if(e.left){var t=o.has(e.left)?o.get(e.left):e.left,n=o.has(e.right)?o.get(e.right):e.right;d.has(t)?d.get(t).push(n):d.set(t,[n]),d.has(n)?d.get(n).push(t):d.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;f.has(r)?f.get(r).push(i):f.set(r,[i]),f.has(i)?f.get(i).push(r):f.set(i,[r])}});var p=function(e,t){var n=[],r=[],i=new b,a=new Set,o=0;return e.forEach(function(s,c){if(!a.has(c)){n[o]=[],r[o]=!1;var l=c;for(i.push(l),a.add(l),n[o].push(l);i.length!=0;)l=i.shift(),t.has(l)&&(r[o]=!0),e.get(l).forEach(function(e){a.has(e)||(i.push(e),a.add(e),n[o].push(e))});o++}}),{components:n,isFixed:r}},m=p(d,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=m.components,this.fixedComponentsOnHorizontal=m.isFixed;var h=p(f,e.fixedNodesOnVertical);this.componentsOnVertical=h.components,this.fixedComponentsOnVertical=h.isFixed}}},x.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1){var s;for(s=0;sr&&(r=Math.floor(o.y)),a=Math.floor(o.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-o.x/2,d.WORLD_CENTER_Y-o.y/2))},x.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),c.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(t,null,0,359,0,r);var i=v.calculateBounds(e),a=new y;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o1;){var g=h[0];h.splice(0,1);var v=u.indexOf(g);v>=0&&u.splice(v,1),p--,d--}m=t==null?0:(u.indexOf(h[0])+1)%p;for(var y=Math.abs(r-n)/d,b=m;f!=d;b=++b%p){var S=u[b].getOtherEnd(e);if(S!=t){var C=(n+f*y)%360,w=(C+y)%360;x.branchRadialLayout(S,e,C,w,i+a,a),f++}}},x.maxDiagonalInTree=function(e){for(var t=g.MIN_VALUE,n=0;nt&&(t=r)}return t},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r=`DummyCompound_`+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),c=i.getChild();c.add(a);for(var l=0;li?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):r.labelPosHorizontal==`right`&&r.setWidth(i+r.labelWidth)),r.labelHeight&&(r.labelPosVertical==`top`?(r.rect.y-=r.labelHeight,r.setHeight(a+r.labelHeight),r.labelMarginTop=r.labelHeight):r.labelPosVertical==`center`&&r.labelHeight>a?(r.rect.y-=(r.labelHeight-a)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-a)/2):r.labelPosVertical==`bottom`&&r.setHeight(a+r.labelHeight))}})},x.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,a=t.labelMarginLeft,o=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,a,o)}},x.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach(function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop,o=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a,o,s)})},x.prototype.getToBeTiled=function(e){var t=e.id;if(this.toBeTiled[t]!=null)return this.toBeTiled[t];var n=e.getChild();if(n==null)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(a.getChild()==null){this.toBeTiled[a.id]=!1;continue}if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}return this.toBeTiled[t]=!0,!0},x.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;ru&&(u=f.rect.height)}n+=u+e.verticalPadding}},x.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var a=i.rect.width,o=i.rect.height;i.labelWidth&&(i.labelPosHorizontal==`left`?(i.rect.x-=i.labelWidth,i.setWidth(a+i.labelWidth),i.labelMarginLeft=i.labelWidth):i.labelPosHorizontal==`center`&&i.labelWidth>a?(i.rect.x-=(i.labelWidth-a)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-a)/2):i.labelPosHorizontal==`right`&&i.setWidth(a+i.labelWidth)),i.labelHeight&&(i.labelPosVertical==`top`?(i.rect.y-=i.labelHeight,i.setHeight(o+i.labelHeight),i.labelMarginTop=i.labelHeight):i.labelPosVertical==`center`&&i.labelHeight>o?(i.rect.y-=(i.labelHeight-o)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-o)/2):i.labelPosVertical==`bottom`&&i.setHeight(o+i.labelHeight))}})},x.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())});var l=a/i,u=o/i,d=(n-r)**2+4*(l+r)*(u+n)*i,f=(r-n+Math.sqrt(d))/(2*(l+r)),p;t?(p=Math.ceil(f),p==f&&p++):p=Math.floor(f);var m=p*(l+r)-r;return s>m&&(m=s),m+=r*2,m},x.prototype.tileNodesByFavoringDim=function(e,t,n){var r=c.TILING_PADDING_VERTICAL,i=c.TILING_PADDING_HORIZONTAL,a=c.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};a&&(o.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},l=function(e,t){return s(t)-s(e)};e.sort(function(e,t){var n=l;return o.idealRowWidth?(n=a,n(e.id,t.id)):n(e,t)});for(var u=0,d=0,f=0;f0&&(a+=e.horizontalPadding),e.rowWidth[n]=a,e.width0&&(o+=e.verticalPadding);var s=0;o>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=o,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},x.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},x.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var a=e.rowWidth[i];if(a+e.horizontalPadding+t<=e.width)return!0;var o=0;e.rowHeight[i]0&&(o=n+e.verticalPadding-e.rowHeight[i]);var s=e.width-a>=t+e.horizontalPadding?(e.height+o)/(a+t+e.horizontalPadding):(e.height+o)/e.width;o=n+e.verticalPadding;var c=e.widtha&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;so&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var c=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]0)for(var d=i;d<=a;d++)l[0]+=this.grid[d][o-1].length+this.grid[d][o].length-1;if(a0)for(var d=o;d<=s;d++)l[3]+=this.grid[i-1][d].length+this.grid[i][d].length-1;for(var f=g.MAX_VALUE,p,m,h=0;h{var r=n(551).FDLayoutNode,i=n(551).IMath;function a(e,t,n,i){r.call(this,e,t,n,i)}for(var o in a.prototype=Object.create(r.prototype),r)a[o]=r[o];a.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},a.prototype.propogateDisplacementToChildren=function(e,t){for(var n=this.getChild().getNodes(),r,i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var a=0;r.forEach(function(e){t==`horizontal`?(f.set(e,c.has(e)?l[c.get(e)]:i.get(e)),a+=f.get(e)):(f.set(e,c.has(e)?u[c.get(e)]:i.get(e)),a+=f.get(e))}),a/=r.length,e.forEach(function(e){n.has(e)||f.set(e,a)})}else{var o=0;e.forEach(function(e){o+=t==`horizontal`?c.has(e)?l[c.get(e)]:i.get(e):c.has(e)?u[c.get(e)]:i.get(e)}),o/=e.length,e.forEach(function(e){f.set(e,o)})}});for(var h=function(){var r=m.shift();e.get(r).forEach(function(e){if(f.get(e.id)o&&(o=v),ys&&(s=y)}}catch(e){p=!0,m=e}finally{try{!d&&h.return&&h.return()}finally{if(p)throw m}}var b=(r+o)/2-(a+s)/2,x=!0,S=!1,C=void 0;try{for(var w=e[Symbol.iterator](),T;!(x=(T=w.next()).done);x=!0){var E=T.value;f.set(E,f.get(E)+b)}}catch(e){S=!0,C=e}finally{try{!x&&w.return&&w.return()}finally{if(S)throw C}}})}return f},v=function(e){var t=0,n=0,r=0,i=0;if(e.forEach(function(e){e.left?l[c.get(e.left)]-l[c.get(e.right)]>=0?t++:n++:u[c.get(e.top)]-u[c.get(e.bottom)]>=0?r++:i++}),t>n&&r>i)for(var a=0;an)for(var o=0;oi)for(var s=0;s1)t.fixedNodeConstraint.forEach(function(e,t){S[t]=[e.position.x,e.position.y],C[t]=[l[c.get(e.nodeId)],u[c.get(e.nodeId)]]}),w=!0;else if(t.alignmentConstraint)(function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach(function(e){i.add(e)});var a=new Set([].concat(r(i)).filter(function(e){return E.has(e)})),o=void 0;o=a.size>0?l[c.get(a.values().next().value)]:g(i).x,n[t].forEach(function(t){S[e]=[o,u[c.get(t)]],C[e]=[l[c.get(t)],u[c.get(t)]],e++})},a=0;a0?l[c.get(i.values().next().value)]:g(n).y,o[t].forEach(function(t){S[e]=[l[c.get(t)],a],C[e]=[l[c.get(t)],u[c.get(t)]],e++})},d=0;dA&&(A=k[M].length,j=M);if(A0){var W={x:0,y:0};t.fixedNodeConstraint.forEach(function(e,t){var n={x:l[c.get(e.nodeId)],y:u[c.get(e.nodeId)]},r=e.position,i=h(r,n);W.x+=i.x,W.y+=i.y}),W.x/=t.fixedNodeConstraint.length,W.y/=t.fixedNodeConstraint.length,l.forEach(function(e,t){l[t]+=W.x}),u.forEach(function(e,t){u[t]+=W.y}),t.fixedNodeConstraint.forEach(function(e){l[c.get(e.nodeId)]=e.position.x,u[c.get(e.nodeId)]=e.position.y})}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var G=t.alignmentConstraint.vertical,ie=function(e){var t=new Set;G[e].forEach(function(e){t.add(e)});var n=new Set([].concat(r(t)).filter(function(e){return E.has(e)})),i=void 0;i=n.size>0?l[c.get(n.values().next().value)]:g(t).x,t.forEach(function(e){E.has(e)||(l[c.get(e)]=i)})},K=0;K0?u[c.get(n.values().next().value)]:g(t).y,t.forEach(function(e){E.has(e)||(u[c.get(e)]=i)})},J=0;J{t.exports=e})},n={};function r(e){var i=n[e];if(i!==void 0)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}return r(45)})()})})),k=e(t(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(O()):typeof define==`function`&&define.amd?define([`cose-base`],r):typeof e==`object`?e.cytoscapeFcose=r(O()):n.cytoscapeFcose=r(n.coseBase)})(e,function(e){return(()=>{var t={658:(e=>{e.exports=Object.assign==null?function(e){return[...arguments].slice(1).forEach(function(t){Object.keys(t).forEach(function(n){return e[n]=t[n]})}),e}:Object.assign.bind(Object)}),548:((e,t,n)=>{var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}}(),i=n(140).layoutBase.LinkedList,a={};a.getTopMostNodes=function(e){for(var t={},n=0;n0&&l.merge(e)});for(var u=0;u1){l=s[0],u=l.connectedEdges().length,s.forEach(function(e){e.connectedEdges().length0&&r.set(`dummy`+(r.size+1),p),m},a.relocateComponent=function(e,t,n){if(!n.fixedNodeConstraint){var i=1/0,a=-1/0,o=1/0,s=-1/0;if(n.quality==`draft`){var c=!0,l=!1,u=void 0;try{for(var d=t.nodeIndexes[Symbol.iterator](),f;!(c=(f=d.next()).done);c=!0){var p=f.value,m=r(p,2),h=m[0],g=m[1],_=n.cy.getElementById(h);if(_){var v=_.boundingBox(),y=t.xCoords[g]-v.w/2,b=t.xCoords[g]+v.w/2,x=t.yCoords[g]-v.h/2,S=t.yCoords[g]+v.h/2;ya&&(a=b),xs&&(s=S)}}}catch(e){l=!0,u=e}finally{try{!c&&d.return&&d.return()}finally{if(l)throw u}}var C=e.x-(a+i)/2,w=e.y-(s+o)/2;t.xCoords=t.xCoords.map(function(e){return e+C}),t.yCoords=t.yCoords.map(function(e){return e+w})}else{Object.keys(t).forEach(function(e){var n=t[e],r=n.getRect().x,c=n.getRect().x+n.getRect().width,l=n.getRect().y,u=n.getRect().y+n.getRect().height;ra&&(a=c),ls&&(s=u)});var T=e.x-(a+i)/2,E=e.y-(s+o)/2;Object.keys(t).forEach(function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+E)})}}},a.calcBoundingBox=function(e,t,n,r){for(var i=2**53-1,a=-(2**53-1),o=2**53-1,s=-(2**53-1),c=void 0,l=void 0,u=void 0,d=void 0,f=e.descendants().not(`:parent`),p=f.length,m=0;mc&&(i=c),au&&(o=u),s{var r=n(548),i=n(140).CoSELayout,a=n(140).CoSENode,o=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,c=n(140).layoutBase.LayoutConstants,l=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,d=e.eles,f=d.nodes(),p=d.edges(),m=void 0,h=void 0,g=void 0,_={};e.randomize&&(m=t.nodeIndexes,h=t.xCoords,g=t.yCoords);var v=function(e){return typeof e==`function`},y=function(e,t){return v(e)?e(t):e},b=r.calcParentsWithoutChildren(n,d),x=function e(t,n,i,c){for(var l=n.length,u=0;u0){var S=void 0;S=i.getGraphManager().add(i.newGraph(),p),e(S,f,i,c)}}},S=function(t,n,r){for(var i=0,a=0,o=0;o0?i/a:v(e.idealEdgeLength)?50:e.idealEdgeLength,u.MIN_REPULSION_DIST=l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH)},C=function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)};e.nestingFactor!=null&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),e.gravity!=null&&(u.DEFAULT_GRAVITY_STRENGTH=l.DEFAULT_GRAVITY_STRENGTH=e.gravity),e.numIter!=null&&(u.MAX_ITERATIONS=l.MAX_ITERATIONS=e.numIter),e.gravityRange!=null&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=l.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),e.gravityCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),e.gravityRangeCompound!=null&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),e.initialEnergyOnIncremental!=null&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=l.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),e.tilingCompareBy!=null&&(u.TILING_COMPARE_BY=e.tilingCompareBy),c.QUALITY=e.quality==`proof`?2:0,u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!e.randomize,u.ANIMATE=l.ANIMATE=c.ANIMATE=e.animate,u.TILE=e.tile,u.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==`function`?e.tilingPaddingVertical.call():e.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==`function`?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!e.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,e.step==`transformed`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),e.step==`enforced`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),e.step==`cose`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),e.step==`all`&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!!e.randomize,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),u.TREE_REDUCTION_ON_INCREMENTAL=!(e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint);var w=new i,T=w.newGraphManager();return x(T.addRoot(),r.getTopMostNodes(f),w,e),S(w,T,p),C(w,e),w.runLayout(),_}}}),212:((e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(f){var p=o.getTopMostNodes(t.eles.nodes());if(l=o.connectComponents(n,t.eles,p),l.forEach(function(e){var t=e.boundingBox();u.push({x:t.x1+t.w/2,y:t.y1+t.h/2})}),t.randomize&&l.forEach(function(e){t.eles=e,i.push(s(t))}),t.quality=="default"||t.quality==`proof`){var m=n.collection();if(t.tile){var h=new Map,g=[],_=[],v=0,y={nodeIndexes:h,xCoords:g,yCoords:_},b=[];if(l.forEach(function(e,t){e.edges().length==0&&(e.nodes().forEach(function(t,n){m.merge(e.nodes()[n]),t.isParent()||(y.nodeIndexes.set(e.nodes()[n].id(),v++),y.xCoords.push(e.nodes()[0].position().x),y.yCoords.push(e.nodes()[0].position().y))}),b.push(t))}),m.length>1){var x=m.boundingBox();u.push({x:x.x1+x.w/2,y:x.y1+x.h/2}),l.push(m),i.push(y);for(var S=b.length-1;S>=0;S--)l.splice(b[S],1),i.splice(b[S],1),u.splice(b[S],1)}}l.forEach(function(e,n){t.eles=e,a.push(c(t,i[n])),o.relocateComponent(u[n],a[n],t)})}else l.forEach(function(e,n){o.relocateComponent(u[n],i[n],t)});var C=new Set;if(l.length>1){var w=[],T=r.filter(function(e){return e.css(`display`)==`none`});l.forEach(function(e,n){var r=void 0;if(t.quality==`draft`&&(r=i[n].nodeIndexes),e.nodes().not(T).length>0){var s={};s.edges=[],s.nodes=[];var c=void 0;e.nodes().not(T).forEach(function(e){if(t.quality==`draft`)if(!e.isParent())c=r.get(e.id()),s.nodes.push({x:i[n].xCoords[c]-e.boundingbox().w/2,y:i[n].yCoords[c]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h});else{var l=o.calcBoundingBox(e,i[n].xCoords,i[n].yCoords,r);s.nodes.push({x:l.topLeftX,y:l.topLeftY,width:l.width,height:l.height})}else a[n][e.id()]&&s.nodes.push({x:a[n][e.id()].getLeft(),y:a[n][e.id()].getTop(),width:a[n][e.id()].getWidth(),height:a[n][e.id()].getHeight()})}),e.edges().forEach(function(e){var c=e.source(),l=e.target();if(c.css(`display`)!=`none`&&l.css(`display`)!=`none`)if(t.quality==`draft`){var u=r.get(c.id()),d=r.get(l.id()),f=[],p=[];if(c.isParent()){var m=o.calcBoundingBox(c,i[n].xCoords,i[n].yCoords,r);f.push(m.topLeftX+m.width/2),f.push(m.topLeftY+m.height/2)}else f.push(i[n].xCoords[u]),f.push(i[n].yCoords[u]);if(l.isParent()){var h=o.calcBoundingBox(l,i[n].xCoords,i[n].yCoords,r);p.push(h.topLeftX+h.width/2),p.push(h.topLeftY+h.height/2)}else p.push(i[n].xCoords[d]),p.push(i[n].yCoords[d]);s.edges.push({startX:f[0],startY:f[1],endX:p[0],endY:p[1]})}else a[n][c.id()]&&a[n][l.id()]&&s.edges.push({startX:a[n][c.id()].getCenterX(),startY:a[n][c.id()].getCenterY(),endX:a[n][l.id()].getCenterX(),endY:a[n][l.id()].getCenterY()})}),s.nodes.length>0&&(w.push(s),C.add(n))}});var E=d.packComponents(w,t.randomize).shifts;if(t.quality==`draft`)i.forEach(function(e,t){var n=e.xCoords.map(function(e){return e+E[t].dx}),r=e.yCoords.map(function(e){return e+E[t].dy});e.xCoords=n,e.yCoords=r});else{var D=0;C.forEach(function(e){Object.keys(a[e]).forEach(function(t){var n=a[e][t];n.setCenter(n.getCenterX()+E[D].dx,n.getCenterY()+E[D].dy)}),D++})}}}else{var O=t.eles.boundingBox();if(u.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),t.randomize){var k=s(t);i.push(k)}t.quality=="default"||t.quality==`proof`?(a.push(c(t,i[0])),o.relocateComponent(u[0],a[0],t)):o.relocateComponent(u[0],i[0],t)}var A=function(e,n){if(t.quality=="default"||t.quality==`proof`){typeof e==`number`&&(e=n);var r=void 0,o=void 0,s=e.data(`id`);return a.forEach(function(e){s in e&&(r={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},o=e[s])}),t.nodeDimensionsIncludeLabels&&(o.labelWidth&&(o.labelPosHorizontal==`left`?r.x+=o.labelWidth/2:o.labelPosHorizontal==`right`&&(r.x-=o.labelWidth/2)),o.labelHeight&&(o.labelPosVertical==`top`?r.y+=o.labelHeight/2:o.labelPosVertical==`bottom`&&(r.y-=o.labelHeight/2))),r??={x:e.position(`x`),y:e.position(`y`)},{x:r.x,y:r.y}}var c=void 0;return i.forEach(function(t){var n=t.nodeIndexes.get(e.id());n!=null&&(c={x:t.xCoords[n],y:t.yCoords[n]})}),c??={x:e.position(`x`),y:e.position(`y`)},{x:c.x,y:c.y}};if(t.quality=="default"||t.quality==`proof`||t.randomize){var j=o.calcParentsWithoutChildren(n,r),M=r.filter(function(e){return e.css(`display`)==`none`});t.eles=r.not(M),r.nodes().not(`:parent`).not(M).layoutPositions(e,t,A),j.length>0&&j.forEach(function(e){e.position(A(e))})}else console.log(`If randomize option is set to false, then quality option must be 'default' or 'proof'.`)}}]),e}()}),657:((e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,a=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,o=n.nodes(),s=n.nodes(`:parent`),c=new Map,l=new Map,u=new Map,d=[],f=[],p=[],m=[],h=[],g=[],_=[],v=[],y=void 0,b=1e8,x=1e-9,S=e.piTol,C=e.samplingType,w=e.nodeSeparation,T=void 0,E=function(){for(var e=0,t=0,n=!1;t=i;){o=r[i++];for(var m=d[o],_=0;_u&&(u=h[x],f=x)}return f},O=function(e){var t=void 0;if(e){t=Math.floor(Math.random()*y);for(var n=0;n=1)break;u=l}for(var h=0;h=1)break;u=l}for(var b=0;b0&&(r.isParent()?d[t].push(u.get(r.id())):d[t].push(r.id()))})});var B=function(e){var n=l.get(e),r=void 0;c.get(e).forEach(function(i){r=t.getElementById(i).isParent()?u.get(i):i,d[n].push(r),d[l.get(r)].push(e)})},V=!0,ee=!1,te=void 0;try{for(var H=c.keys()[Symbol.iterator](),ne;!(V=(ne=H.next()).done);V=!0){var re=ne.value;B(re)}}catch(e){ee=!0,te=e}finally{try{!V&&H.return&&H.return()}finally{if(ee)throw te}}y=l.size;var U=void 0;if(y>2){T=y{var r=n(212),i=function(e){e&&e(`layout`,`fcose`,r)};typeof cytoscape<`u`&&i(cytoscape),e.exports=i}),140:(t=>{t.exports=e})},n={};function r(e){var i=n[e];if(i!==void 0)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}return r(579)})()})}))(),1),A={L:`left`,R:`right`,T:`top`,B:`bottom`},j={L:n(e=>`${e},${e/2} 0,${e} 0,0`,`L`),R:n(e=>`0,${e/2} ${e},0 ${e},${e}`,`R`),T:n(e=>`0,0 ${e},0 ${e/2},${e}`,`T`),B:n(e=>`${e/2},0 ${e},${e} 0,${e}`,`B`)},M={L:n((e,t)=>e-t+2,`L`),R:n((e,t)=>e-2,`R`),T:n((e,t)=>e-t+2,`T`),B:n((e,t)=>e-2,`B`)},N=n(function(e){return F(e)?e===`L`?`R`:`L`:e===`T`?`B`:`T`},`getOppositeArchitectureDirection`),P=n(function(e){let t=e;return t===`L`||t===`R`||t===`T`||t===`B`},`isArchitectureDirection`),F=n(function(e){let t=e;return t===`L`||t===`R`},`isArchitectureDirectionX`),I=n(function(e){let t=e;return t===`T`||t===`B`},`isArchitectureDirectionY`),L=n(function(e,t){let n=F(e)&&I(t),r=I(e)&&F(t);return n||r},`isArchitectureDirectionXY`),R=n(function(e){let t=e[0],n=e[1],r=F(t)&&I(n),i=I(t)&&F(n);return r||i},`isArchitecturePairXY`),z=n(function(e){return e!==`LL`&&e!==`RR`&&e!==`TT`&&e!==`BB`},`isValidArchitectureDirectionPair`),B=n(function(e,t){let n=`${e}${t}`;return z(n)?n:void 0},`getArchitectureDirectionPair`),V=n(function([e,t],n){let r=n[0],i=n[1];return F(r)?I(i)?[e+(r===`L`?-1:1),t+(i===`T`?1:-1)]:[e+(r===`L`?-1:1),t]:F(i)?[e+(i===`L`?1:-1),t+(r===`T`?1:-1)]:[e,t+(r===`T`?1:-1)]},`shiftPositionByArchitectureDirectionPair`),ee=n(function(e){return e===`LT`||e===`TL`?[1,1]:e===`BL`||e===`LB`?[1,-1]:e===`BR`||e===`RB`?[-1,-1]:[-1,1]},`getArchitectureDirectionXYFactors`),te=n(function(e,t){return L(e,t)?`bend`:F(e)?`horizontal`:`vertical`},`getArchitectureDirectionAlignment`),H=n(function(e){return e.type===`service`},`isArchitectureService`),ne=n(function(e){return e.type===`junction`},`isArchitectureJunction`),re=n((e,t)=>{let[n,r]=[e,t].sort();return`${JSON.stringify(n)}-${JSON.stringify(r)}`},`architectureGroupAlignmentKey`),U=n(e=>e.data(),`edgeData`),W=n(e=>e.data(),`nodeData`),G=u.architecture,ie=class{constructor(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.elements=new Map,this.diagramId=``,this.setAccTitle=o,this.getAccTitle=h,this.setDiagramTitle=d,this.getDiagramTitle=p,this.getAccDescription=f,this.setAccDescription=a,this.clear()}static{n(this,`ArchitectureDB`)}setDiagramId(e){this.diagramId=e}getDiagramId(){return this.diagramId}clear(){this.nodes=new Map,this.groups=new Map,this.edges=[],this.layoutHints=[],this.registeredIds=new Map,this.dataStructures=void 0,this.elements=new Map,this.diagramId=``,c()}addService({id:e,icon:t,in:n,title:r,iconText:i}){if(this.registeredIds.has(e))throw Error(`The service id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw Error(`The service [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw Error(`The service [${e}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds.get(n)===`node`)throw Error(`The service [${e}]'s parent is not a group`)}this.registeredIds.set(e,`node`),this.nodes.set(e,{id:e,type:`service`,icon:t,iconText:i,title:r,edges:[],in:n})}getServices(){return[...this.nodes.values()].filter(H)}addJunction({id:e,in:t}){if(this.registeredIds.has(e))throw Error(`The junction id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(t!==void 0){if(e===t)throw Error(`The junction [${e}] cannot be placed within itself`);if(!this.registeredIds.has(t))throw Error(`The junction [${e}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds.get(t)===`node`)throw Error(`The junction [${e}]'s parent is not a group`)}this.registeredIds.set(e,`node`),this.nodes.set(e,{id:e,type:`junction`,edges:[],in:t})}getJunctions(){return[...this.nodes.values()].filter(ne)}getNodes(){return[...this.nodes.values()]}getNode(e){return this.nodes.get(e)??null}addGroup({id:e,icon:t,in:n,title:r}){if(this.registeredIds.has(e))throw Error(`The group id [${e}] is already in use by another ${this.registeredIds.get(e)}`);if(n!==void 0){if(e===n)throw Error(`The group [${e}] cannot be placed within itself`);if(!this.registeredIds.has(n))throw Error(`The group [${e}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds.get(n)===`node`)throw Error(`The group [${e}]'s parent is not a group`)}this.registeredIds.set(e,`group`),this.groups.set(e,{id:e,icon:t,title:r,in:n})}getGroups(){return[...this.groups.values()]}addEdge({lhsId:e,rhsId:t,lhsDir:n,rhsDir:r,lhsInto:i,rhsInto:a,lhsGroup:o,rhsGroup:s,title:c}){if(!P(n))throw Error(`Invalid direction given for left hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(n)}`);if(!P(r))throw Error(`Invalid direction given for right hand side of edge ${e}--${t}. Expected (L,R,T,B) got ${String(r)}`);if(!this.nodes.has(e)&&!this.groups.has(e))throw Error(`The left-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(!this.nodes.has(t)&&!this.groups.has(t))throw Error(`The right-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`);let l=this.nodes.get(e).in,u=this.nodes.get(t).in;if(o&&l&&u&&l==u)throw Error(`The left-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(s&&l&&u&&l==u)throw Error(`The right-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let d={lhsId:e,lhsDir:n,lhsInto:i,lhsGroup:o,rhsId:t,rhsDir:r,rhsInto:a,rhsGroup:s,title:c};this.edges.push(d);let f=this.nodes.get(e),p=this.nodes.get(t);f&&p&&(f.edges.push(this.edges[this.edges.length-1]),p.edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(e){if(e.members.length<2)throw Error(`An align directive requires at least two members; got ${e.members.length}`);let t=new Set;e.members.forEach(n=>{if(this.registeredIds.get(n)!==`node`)throw Error(`align ${e.direction} references [${n}], which is not a service or junction`);if(t.has(n))throw Error(`align ${e.direction} lists [${n}] more than once`);t.add(n)}),this.layoutHints.push(e)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){let e=new Map,t=new Map;for(let[n,r]of this.nodes.entries()){let i=new Map;for(let t of r.edges){let r=this.getNode(t.lhsId)?.in,a=this.getNode(t.rhsId)?.in;if(r&&a&&r!==a){let n=te(t.lhsDir,t.rhsDir);n!==`bend`&&e.set(re(r,a),n)}if(t.lhsId===n){let e=B(t.lhsDir,t.rhsDir);e&&i.set(e,t.rhsId)}else{let e=B(t.rhsDir,t.lhsDir);e&&i.set(e,t.lhsId)}}t.set(n,i)}let r=new Set,i=new Set(t.keys()),a=n(e=>{let n=new Map([[e,[0,0]]]),a=[e];for(;a.length>0;){let e=a.shift();if(e){r.add(e),i.delete(e);let o=t.get(e);if(!o)throw Error(`BFS error: adjacency list for id ${e} not found. Please report this as a bug.`);let s=n.get(e);if(!s)throw Error(`BFS error: position for id ${e} not found in spatial map. Please report this as a bug.`);let[c,l]=s;o.forEach((e,t)=>{r.has(e)||(n.set(e,V([c,l],t)),a.push(e))})}}return n},`BFS`),o=[];for(;i.size>0;){let e=i.values().next().value;o.push(a(e))}this.dataStructures={adjList:t,spatialMaps:o,groupAlignments:e}}return this.dataStructures}setElementForId(e,t){this.elements.set(e,t)}getElementById(e){return this.elements.get(e)}getConfig(){return v({...G,...l().architecture})}getConfigField(e){return this.getConfig()[e]}},K=n((e,t)=>{b(e,t),e.groups.map(e=>t.addGroup(e)),e.services.map(e=>t.addService({...e,type:`service`})),e.junctions.map(e=>t.addJunction({...e,type:`junction`})),e.edges.map(e=>t.addEdge(e)),e.alignments?.map(e=>t.addLayoutHint({direction:e.direction,members:[...e.members]}))},`populateDb`),q={parser:{yy:void 0},parse:n(async e=>{let t=await x(`architecture`,e);r.debug(t);let n=q.parser?.yy;if(!(n instanceof ie))throw Error(`parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);K(t,n)},`parse`)},ae=n(e=>` .edge { stroke-width: ${e.archEdgeWidth}; stroke: ${e.archEdgeColor}; @@ -29,8 +29,8 @@ import{i as e,t}from"./app-rolldown-runtime.js";import{n}from"./app-chunk-Y2CYZV display: -webkit-box; -webkit-box-orient: vertical; } -`,`getStyles`);function J(e,t){if(e===0)return t();let n=Math.random,r=e>>>0;Math.random=function(){r=r+1831565813>>>0;let e=r;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296};try{return t()}finally{Math.random=n}}n(J,`withSeededRandom`);var Y=n(e=>`${e}`,`wrapIcon`),X={prefix:`mermaid-architecture`,height:80,width:80,icons:{database:{body:Y(``)},server:{body:Y(``)},disk:{body:Y(``)},internet:{body:Y(``)},cloud:{body:Y(``)},unknown:b,blank:{body:Y(``)}}},oe=n(async function(e,t,n,r){let i=n.getConfigField(`padding`),a=n.getConfigField(`iconSize`),o=a/2,s=a/6,c=s/2;await Promise.all(t.edges().map(async t=>{let{source:a,sourceDir:l,sourceArrow:u,sourceGroup:d,target:f,targetDir:p,targetArrow:h,targetGroup:g,label:v}=U(t),{x:y,y:b}=t[0].sourceEndpoint(),{x,y:S}=t[0].midpoint(),{x:w,y:T}=t[0].targetEndpoint(),E=i+4;if(d&&(F(l)?y+=l===`L`?-E:E:b+=l===`T`?-E:E+18),g&&(F(p)?w+=p===`L`?-E:E:T+=p===`T`?-E:E+18),!d&&n.getNode(a)?.type===`junction`&&(F(l)?y+=l===`L`?o:-o:b+=l===`T`?o:-o),!g&&n.getNode(f)?.type===`junction`&&(F(p)?w+=p===`L`?o:-o:T+=p===`T`?o:-o),t[0]._private.rscratch){let t=e.insert(`g`);if(t.insert(`path`).attr(`d`,`M ${y},${b} L ${x},${S} L${w},${T} `).attr(`class`,`edge`).attr(`id`,`${r}-${_(a,f,{prefix:`L`})}`),u){let e=F(l)?M[l](y,s):y-c,n=I(l)?M[l](b,s):b-c;t.insert(`polygon`).attr(`points`,j[l](s)).attr(`transform`,`translate(${e},${n})`).attr(`class`,`arrow`)}if(h){let e=F(p)?M[p](w,s):w-c,n=I(p)?M[p](T,s):T-c;t.insert(`polygon`).attr(`points`,j[p](s)).attr(`transform`,`translate(${e},${n})`).attr(`class`,`arrow`)}if(v){let e=L(l,p)?`XY`:F(l)?`X`:`Y`,n=0;n=e===`X`?Math.abs(y-w):e===`Y`?Math.abs(b-T)/1.5:Math.abs(y-w)/2;let r=t.append(`g`);if(await C(r,v,{useHtmlLabels:!1,width:n,classes:`architecture-service-label`},m()),r.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`),e===`X`)r.attr(`transform`,`translate(`+x+`, `+S+`)`);else if(e===`Y`)r.attr(`transform`,`translate(`+x+`, `+S+`) rotate(-90)`);else if(e===`XY`){let e=B(l,p);if(e&&R(e)){let t=r.node().getBoundingClientRect(),[n,i]=ee(e);r.attr(`dominant-baseline`,`auto`).attr(`transform`,`rotate(${-1*n*i*45})`);let a=r.node().getBoundingClientRect();r.attr(`transform`,` +`,`getStyles`);function J(e,t){if(e===0)return t();let n=Math.random,r=e>>>0;Math.random=function(){r=r+1831565813>>>0;let e=r;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296};try{return t()}finally{Math.random=n}}n(J,`withSeededRandom`);var Y=n(e=>`${e}`,`wrapIcon`),X={prefix:`mermaid-architecture`,height:80,width:80,icons:{database:{body:Y(``)},server:{body:Y(``)},disk:{body:Y(``)},internet:{body:Y(``)},cloud:{body:Y(``)},unknown:S,blank:{body:Y(``)}}},oe=n(async function(e,t,n,r){let i=n.getConfigField(`padding`),a=n.getConfigField(`iconSize`),o=a/2,s=a/6,c=s/2;await Promise.all(t.edges().map(async t=>{let{source:a,sourceDir:l,sourceArrow:u,sourceGroup:d,target:f,targetDir:p,targetArrow:h,targetGroup:g,label:v}=U(t),{x:y,y:b}=t[0].sourceEndpoint(),{x,y:S}=t[0].midpoint(),{x:C,y:w}=t[0].targetEndpoint(),E=i+4;if(d&&(F(l)?y+=l===`L`?-E:E:b+=l===`T`?-E:E+18),g&&(F(p)?C+=p===`L`?-E:E:w+=p===`T`?-E:E+18),!d&&n.getNode(a)?.type===`junction`&&(F(l)?y+=l===`L`?o:-o:b+=l===`T`?o:-o),!g&&n.getNode(f)?.type===`junction`&&(F(p)?C+=p===`L`?o:-o:w+=p===`T`?o:-o),t[0]._private.rscratch){let t=e.insert(`g`);if(t.insert(`path`).attr(`d`,`M ${y},${b} L ${x},${S} L${C},${w} `).attr(`class`,`edge`).attr(`id`,`${r}-${_(a,f,{prefix:`L`})}`),u){let e=F(l)?M[l](y,s):y-c,n=I(l)?M[l](b,s):b-c;t.insert(`polygon`).attr(`points`,j[l](s)).attr(`transform`,`translate(${e},${n})`).attr(`class`,`arrow`)}if(h){let e=F(p)?M[p](C,s):C-c,n=I(p)?M[p](w,s):w-c;t.insert(`polygon`).attr(`points`,j[p](s)).attr(`transform`,`translate(${e},${n})`).attr(`class`,`arrow`)}if(v){let e=L(l,p)?`XY`:F(l)?`X`:`Y`,n=0;n=e===`X`?Math.abs(y-C):e===`Y`?Math.abs(b-w)/1.5:Math.abs(y-C)/2;let r=t.append(`g`);if(await T(r,v,{useHtmlLabels:!1,width:n,classes:`architecture-service-label`},m()),r.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`),e===`X`)r.attr(`transform`,`translate(`+x+`, `+S+`)`);else if(e===`Y`)r.attr(`transform`,`translate(`+x+`, `+S+`) rotate(-90)`);else if(e===`XY`){let e=B(l,p);if(e&&R(e)){let t=r.node().getBoundingClientRect(),[n,i]=ee(e);r.attr(`dominant-baseline`,`auto`).attr(`transform`,`rotate(${-1*n*i*45})`);let a=r.node().getBoundingClientRect();r.attr(`transform`,` translate(${x}, ${S-t.height/2}) translate(${n*a.width/2}, ${i*a.height/2}) rotate(${-1*n*i*45}, 0, ${t.height/2}) - `)}}}}}))},`drawEdges`),Z=n(async function(e,t,n,r){let i=n.getConfigField(`padding`)*.75,a=n.getConfigField(`fontSize`),o=n.getConfigField(`iconSize`)/2;await Promise.all(t.nodes().map(async t=>{let s=W(t);if(s.type===`group`){let{h:c,w:l,x1:u,y1:d}=t.boundingBox(),f=e.append(`rect`);f.attr(`id`,`${r}-group-${s.id}`).attr(`x`,u+o).attr(`y`,d+o).attr(`width`,l).attr(`height`,c).attr(`class`,`node-bkg`);let p=e.append(`g`),h=u,g=d;if(s.icon){let e=p.append(`g`);e.html(`${await S(s.icon,{height:i,width:i,fallbackPrefix:X.prefix})}`),e.attr(`transform`,`translate(`+(h+o+1)+`, `+(g+o+1)+`)`),h+=i,g+=a/2-1-2}if(s.label){let e=p.append(`g`);await C(e,s.label,{useHtmlLabels:!1,width:l,classes:`architecture-service-label`},m()),e.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`start`).attr(`text-anchor`,`start`),e.attr(`transform`,`translate(`+(h+o+4)+`, `+(g+o+2)+`)`)}n.setElementForId(s.id,f)}}))},`drawGroups`),se=n(async function(e,t,n,r){let i=m();for(let a of n){let n=t.append(`g`),o=e.getConfigField(`iconSize`);if(a.title){let e=n.append(`g`);await C(e,a.title,{useHtmlLabels:!1,width:o*1.5,classes:`architecture-service-label`},i),e.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`),e.attr(`transform`,`translate(`+o/2+`, `+o+`)`)}let s=n.append(`g`);if(a.icon)s.html(`${await S(a.icon,{height:o,width:o,fallbackPrefix:X.prefix})}`);else if(a.iconText){s.html(`${await S(`blank`,{height:o,width:o,fallbackPrefix:X.prefix})}`);let e=s.append(`g`).append(`foreignObject`).attr(`width`,o).attr(`height`,o).append(`div`).attr(`class`,`node-icon-text`).attr(`style`,`height: ${o}px;`).append(`div`).html(g(a.iconText,i)),t=parseInt(window.getComputedStyle(e.node(),null).getPropertyValue(`font-size`).replace(/\D/g,``))??16;e.attr(`style`,`-webkit-line-clamp: ${Math.floor((o-2)/t)};`)}else s.append(`path`).attr(`class`,`node-bkg`).attr(`id`,`${r}-node-${a.id}`).attr(`d`,`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);n.attr(`id`,`${r}-service-${a.id}`).attr(`class`,`architecture-service`);let{width:c,height:l}=n.node().getBBox();a.width=c,a.height=l,e.setElementForId(a.id,n)}return 0},`drawServices`),ce=n(function(e,t,n,r){n.forEach(n=>{let i=t.append(`g`),a=e.getConfigField(`iconSize`);i.append(`g`).append(`rect`).attr(`id`,`${r}-node-${n.id}`).attr(`fill-opacity`,`0`).attr(`width`,a).attr(`height`,a),i.attr(`class`,`architecture-junction`);let{width:o,height:s}=i._groups[0][0].getBBox();i.width=o,i.height=s,e.setElementForId(n.id,i)})},`drawJunctions`);x([{name:X.prefix,icons:X}]),E.use(k.default);function le(e,t,n){e.forEach(e=>{t.add({group:`nodes`,data:{type:`service`,id:e.id,icon:e.icon,label:e.title,parent:e.in,width:n.getConfigField(`iconSize`),height:n.getConfigField(`iconSize`)},classes:`node-service`})})}n(le,`addServices`);function ue(e,t,n){e.forEach(e=>{t.add({group:`nodes`,data:{type:`junction`,id:e.id,parent:e.in,width:n.getConfigField(`iconSize`),height:n.getConfigField(`iconSize`)},classes:`node-junction`})})}n(ue,`addJunctions`);function de(e,t){t.nodes().map(t=>{let n=W(t);n.type!==`group`&&(n.x=t.position().x,n.y=t.position().y,e.getElementById(n.id).attr(`transform`,`translate(`+(n.x||0)+`,`+(n.y||0)+`)`))})}n(de,`positionNodes`);function fe(e,t){e.forEach(e=>{t.add({group:`nodes`,data:{type:`group`,id:e.id,icon:e.icon,label:e.title,parent:e.in},classes:`node-group`})})}n(fe,`addGroups`);function pe(e,t){e.forEach(e=>{let{lhsId:n,rhsId:r,lhsInto:i,lhsGroup:a,rhsInto:o,lhsDir:s,rhsDir:c,rhsGroup:l,title:u}=e,d=L(e.lhsDir,e.rhsDir)?`segments`:`straight`,f={id:`${n}-${r}`,label:u,source:n,sourceDir:s,sourceArrow:i,sourceGroup:a,sourceEndpoint:s===`L`?`0 50%`:s===`R`?`100% 50%`:s===`T`?`50% 0`:`50% 100%`,target:r,targetDir:c,targetArrow:o,targetGroup:l,targetEndpoint:c===`L`?`0 50%`:c===`R`?`100% 50%`:c===`T`?`50% 0`:`50% 100%`};t.add({group:`edges`,data:f,classes:d})})}n(pe,`addEdges`);function me(e,t,r,i=[]){let a=n((e,t)=>{let n=new Map;for(let[i,a]of e.entries()){let e=`${i}`,o=0,s=[...a.entries()];if(s.length===1){n.set(e,s[0][1]);continue}for(let i=0;i{let n=new Map,r=new Map;return t.forEach(([t,i],a)=>{let o=e.getNode(a)?.in??`default`,s=n.get(i)??new Map;n.has(i)||n.set(i,s);let c=r.get(t)??new Map;r.has(t)||r.set(t,c);for(let e of[s,c]){let t=e.get(o)??[];e.has(o)||e.set(o,t),t.push(a)}}),{horiz:[...a(n,`horizontal`).values()].filter(e=>e.length>1),vert:[...a(r,`vertical`).values()].filter(e=>e.length>1)}}).reduce(([e,t],{horiz:n,vert:r})=>[[...e,...n],[...t,...r]],[[],[]]),c=new Set;i.forEach(e=>e.members.forEach(e=>c.add(e)));let l=n(e=>e.filter(e=>!e.some(e=>c.has(e))),`dropOverlapping`),u=l(o),d=l(s);return i.forEach(e=>{e.members.length<2||(e.direction===`row`?u.push([...e.members]):d.push([...e.members]))}),{horizontal:u,vertical:d}}n(me,`getAlignments`);function he(e,t,r=[]){let i=[],a=t.getConfigField(`iconSize`),o=t.getConfigField(`idealEdgeLengthMultiplier`),s=o*a,c=new Set;r.forEach(e=>{for(let t=0;t`${e[0]},${e[1]}`,`posToStr`),u=n(e=>e.split(`,`).map(e=>parseInt(e)),`strToPos`);return e.forEach(e=>{let t=new Map([...e.entries()].map(([e,t])=>[l(t),e])),n=[l([0,0])],r={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;n.length>0;){let e=n.shift();if(e){r[e]=1;let d=t.get(e);if(d){let f=u(e);Object.entries(s).forEach(([e,s])=>{let u=l([f[0]+s[0],f[1]+s[1]]),p=t.get(u);if(p&&!r[u]){if(n.push(u),c.has(`${d}|${p}`))return;i.push({[A[e]]:p,[A[N(e)]]:d,gap:o*a})}})}}}}),i}n(he,`getRelativeConstraints`);function ge(e,t,a,o,s,{spatialMaps:c,groupAlignments:l}){return new Promise(u=>{let d=i(`body`).append(`div`).attr(`id`,`cy`).attr(`style`,`display:none`),f=E({container:document.getElementById(`cy`),style:[{selector:`edge`,style:{"curve-style":`straight`,"source-endpoint":`data(sourceEndpoint)`,"target-endpoint":`data(targetEndpoint)`}},{selector:`edge[label]`,style:{label:`data(label)`}},{selector:`edge.segments`,style:{"curve-style":`segments`,"segment-weights":`0`,"segment-distances":[.5],"edge-distances":`endpoints`,"source-endpoint":`data(sourceEndpoint)`,"target-endpoint":`data(targetEndpoint)`}},{selector:`node`,style:{"compound-sizing-wrt-labels":`include`}},{selector:`node[label]`,style:{"text-valign":`bottom`,"text-halign":`center`,"font-size":`${s.getConfigField(`fontSize`)}px`}},{selector:`.node-service`,style:{label:`data(label)`,width:`data(width)`,height:`data(height)`}},{selector:`.node-junction`,style:{width:`data(width)`,height:`data(height)`}},{selector:`.node-group`,style:{padding:`${s.getConfigField(`padding`)}px`}}],layout:{name:`grid`,boundingBox:{x1:0,x2:100,y1:0,y2:100}}});d.remove(),fe(a,f),le(e,f,s),ue(t,f,s),pe(o,f);let p=s.getLayoutHints(),m=me(s,c,l,p),h=he(c,s,p),g=s.getConfigField(`iconSize`),_=s.getConfigField(`idealEdgeLengthMultiplier`)*g,v=.5*g,y=s.getConfigField(`edgeElasticity`),b=s.getConfigField(`seed`),x=f.layout({name:`fcose`,quality:`proof`,randomize:s.getConfigField(`randomize`),nodeSeparation:s.getConfigField(`nodeSeparation`),numIter:s.getConfigField(`numIter`),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(e){let[t,n]=e.connectedNodes(),{parent:r}=W(t),{parent:i}=W(n);return r===i?_:v},edgeElasticity(e){let[t,n]=e.connectedNodes(),{parent:r}=W(t),{parent:i}=W(n);return r===i?y:.001},alignmentConstraint:m,relativePlacementConstraint:h});x.one(`layoutstop`,()=>{function e(e,t,n,r){let i,a,{x:o,y:s}=e,{x:c,y:l}=t;a=(r-s+(o-n)*(s-l)/(o-c))/Math.sqrt(1+((s-l)/(o-c))**2),i=Math.sqrt((r-s)**2+(n-o)**2-a**2);let u=Math.sqrt((c-o)**2+(l-s)**2);i/=u;let d=(c-o)*(r-s)-(l-s)*(n-o);switch(!0){case d>=0:d=1;break;case d<0:d=-1}let f=(c-o)*(n-o)+(l-s)*(r-s);switch(!0){case f>=0:f=1;break;case f<0:f=-1}return a=Math.abs(a)*d,i*=f,{distances:a,weights:i}}n(e,`getSegmentWeights`),f.startBatch();for(let t of Object.values(f.edges()))if(t.data?.()){let{x:n,y:r}=t.source().position(),{x:i,y:a}=t.target().position();if(n!==i&&r!==a){let n=t.sourceEndpoint(),r=t.targetEndpoint(),{sourceDir:i}=U(t),[a,o]=I(i)?[n.x,r.y]:[r.x,n.y],{weights:s,distances:c}=e(n,r,a,o);t.style(`segment-distances`,c),t.style(`segment-weights`,s)}}f.endBatch(),J(b,()=>x.run())});try{J(b,()=>x.run())}catch(e){throw e instanceof RangeError&&e.message.includes(`Invalid array length`)?Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):e}f.ready(e=>{r.info(`Ready`,e),u(f)})})}n(ge,`layoutArchitecture`);var _e={parser:q,get db(){return new ie},renderer:{draw:n(async(e,t,n,r)=>{let i=r.db;i.setDiagramId(t);let a=i.getServices(),o=i.getJunctions(),c=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),d=y(t),f=d.append(`g`);f.attr(`class`,`architecture-edges`);let p=d.append(`g`);p.attr(`class`,`architecture-services`);let m=d.append(`g`);m.attr(`class`,`architecture-groups`),await se(i,p,a,t),ce(i,p,o,t);let h=await ge(a,o,c,l,i,u);await oe(f,h,i,t),await Z(m,h,i,t),de(i,h),s(void 0,d,i.getConfigField(`padding`),i.getConfigField(`useMaxWidth`))},`draw`)},styles:ae};export{_e as diagram}; \ No newline at end of file + `)}}}}}))},`drawEdges`),Z=n(async function(e,t,n,r){let i=n.getConfigField(`padding`)*.75,a=n.getConfigField(`fontSize`),o=n.getConfigField(`iconSize`)/2;await Promise.all(t.nodes().map(async t=>{let s=W(t);if(s.type===`group`){let{h:c,w:l,x1:u,y1:d}=t.boundingBox(),f=e.append(`rect`);f.attr(`id`,`${r}-group-${s.id}`).attr(`x`,u+o).attr(`y`,d+o).attr(`width`,l).attr(`height`,c).attr(`class`,`node-bkg`);let p=e.append(`g`),h=u,g=d;if(s.icon){let e=p.append(`g`);e.html(`${await w(s.icon,{height:i,width:i,fallbackPrefix:X.prefix})}`),e.attr(`transform`,`translate(`+(h+o+1)+`, `+(g+o+1)+`)`),h+=i,g+=a/2-1-2}if(s.label){let e=p.append(`g`);await T(e,s.label,{useHtmlLabels:!1,width:l,classes:`architecture-service-label`},m()),e.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`start`).attr(`text-anchor`,`start`),e.attr(`transform`,`translate(`+(h+o+4)+`, `+(g+o+2)+`)`)}n.setElementForId(s.id,f)}}))},`drawGroups`),se=n(async function(e,t,n,r){let i=m();for(let a of n){let n=t.append(`g`),o=e.getConfigField(`iconSize`);if(a.title){let e=n.append(`g`);await T(e,a.title,{useHtmlLabels:!1,width:o*1.5,classes:`architecture-service-label`},i),e.attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`),e.attr(`transform`,`translate(`+o/2+`, `+o+`)`)}let s=n.append(`g`);if(a.icon)s.html(`${await w(a.icon,{height:o,width:o,fallbackPrefix:X.prefix})}`);else if(a.iconText){s.html(`${await w(`blank`,{height:o,width:o,fallbackPrefix:X.prefix})}`);let e=s.append(`g`).append(`foreignObject`).attr(`width`,o).attr(`height`,o).append(`div`).attr(`class`,`node-icon-text`).attr(`style`,`height: ${o}px;`).append(`div`).html(g(a.iconText,i)),t=parseInt(window.getComputedStyle(e.node(),null).getPropertyValue(`font-size`).replace(/\D/g,``))??16;e.attr(`style`,`-webkit-line-clamp: ${Math.floor((o-2)/t)};`)}else s.append(`path`).attr(`class`,`node-bkg`).attr(`id`,`${r}-node-${a.id}`).attr(`d`,`M0,${o} V5 Q0,0 5,0 H${o-5} Q${o},0 ${o},5 V${o} Z`);n.attr(`id`,`${r}-service-${a.id}`).attr(`class`,`architecture-service`);let{width:c,height:l}=n.node().getBBox();a.width=c,a.height=l,e.setElementForId(a.id,n)}return 0},`drawServices`),ce=n(function(e,t,n,r){n.forEach(n=>{let i=t.append(`g`),a=e.getConfigField(`iconSize`);i.append(`g`).append(`rect`).attr(`id`,`${r}-node-${n.id}`).attr(`fill-opacity`,`0`).attr(`width`,a).attr(`height`,a),i.attr(`class`,`architecture-junction`);let{width:o,height:s}=i._groups[0][0].getBBox();i.width=o,i.height=s,e.setElementForId(n.id,i)})},`drawJunctions`);C([{name:X.prefix,icons:X}]),E.use(k.default);function le(e,t,n){e.forEach(e=>{t.add({group:`nodes`,data:{type:`service`,id:e.id,icon:e.icon,label:e.title,parent:e.in,width:n.getConfigField(`iconSize`),height:n.getConfigField(`iconSize`)},classes:`node-service`})})}n(le,`addServices`);function ue(e,t,n){e.forEach(e=>{t.add({group:`nodes`,data:{type:`junction`,id:e.id,parent:e.in,width:n.getConfigField(`iconSize`),height:n.getConfigField(`iconSize`)},classes:`node-junction`})})}n(ue,`addJunctions`);function de(e,t){t.nodes().map(t=>{let n=W(t);n.type!==`group`&&(n.x=t.position().x,n.y=t.position().y,e.getElementById(n.id).attr(`transform`,`translate(`+(n.x||0)+`,`+(n.y||0)+`)`))})}n(de,`positionNodes`);function fe(e,t){e.forEach(e=>{t.add({group:`nodes`,data:{type:`group`,id:e.id,icon:e.icon,label:e.title,parent:e.in},classes:`node-group`})})}n(fe,`addGroups`);function pe(e,t){e.forEach(e=>{let{lhsId:n,rhsId:r,lhsInto:i,lhsGroup:a,rhsInto:o,lhsDir:s,rhsDir:c,rhsGroup:l,title:u}=e,d=L(e.lhsDir,e.rhsDir)?`segments`:`straight`,f={id:`${n}-${r}`,label:u,source:n,sourceDir:s,sourceArrow:i,sourceGroup:a,sourceEndpoint:s===`L`?`0 50%`:s===`R`?`100% 50%`:s===`T`?`50% 0`:`50% 100%`,target:r,targetDir:c,targetArrow:o,targetGroup:l,targetEndpoint:c===`L`?`0 50%`:c===`R`?`100% 50%`:c===`T`?`50% 0`:`50% 100%`};t.add({group:`edges`,data:f,classes:d})})}n(pe,`addEdges`);function me(e,t,r,i=[]){let a=n((e,t)=>{let n=new Map;for(let[i,a]of e.entries()){let e=`${i}`,o=0,s=[...a.entries()];if(s.length===1){n.set(e,s[0][1]);continue}for(let i=0;i{let n=new Map,r=new Map;return t.forEach(([t,i],a)=>{let o=e.getNode(a)?.in??`default`,s=n.get(i)??new Map;n.has(i)||n.set(i,s);let c=r.get(t)??new Map;r.has(t)||r.set(t,c);for(let e of[s,c]){let t=e.get(o)??[];e.has(o)||e.set(o,t),t.push(a)}}),{horiz:[...a(n,`horizontal`).values()].filter(e=>e.length>1),vert:[...a(r,`vertical`).values()].filter(e=>e.length>1)}}).reduce(([e,t],{horiz:n,vert:r})=>[[...e,...n],[...t,...r]],[[],[]]),c=new Set;i.forEach(e=>e.members.forEach(e=>c.add(e)));let l=n(e=>e.filter(e=>!e.some(e=>c.has(e))),`dropOverlapping`),u=l(o),d=l(s);return i.forEach(e=>{e.members.length<2||(e.direction===`row`?u.push([...e.members]):d.push([...e.members]))}),{horizontal:u,vertical:d}}n(me,`getAlignments`);function he(e,t,r=[]){let i=[],a=t.getConfigField(`iconSize`),o=t.getConfigField(`idealEdgeLengthMultiplier`),s=o*a,c=new Set;r.forEach(e=>{for(let t=0;t`${e[0]},${e[1]}`,`posToStr`),u=n(e=>e.split(`,`).map(e=>parseInt(e)),`strToPos`);return e.forEach(e=>{let t=new Map([...e.entries()].map(([e,t])=>[l(t),e])),n=[l([0,0])],r={},s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;n.length>0;){let e=n.shift();if(e){r[e]=1;let d=t.get(e);if(d){let f=u(e);Object.entries(s).forEach(([e,s])=>{let u=l([f[0]+s[0],f[1]+s[1]]),p=t.get(u);if(p&&!r[u]){if(n.push(u),c.has(`${d}|${p}`))return;i.push({[A[e]]:p,[A[N(e)]]:d,gap:o*a})}})}}}}),i}n(he,`getRelativeConstraints`);function ge(e,t,a,o,s,{spatialMaps:c,groupAlignments:l}){return new Promise(u=>{let d=i(`body`).append(`div`).attr(`id`,`cy`).attr(`style`,`display:none`),f=E({container:document.getElementById(`cy`),style:[{selector:`edge`,style:{"curve-style":`straight`,"source-endpoint":`data(sourceEndpoint)`,"target-endpoint":`data(targetEndpoint)`}},{selector:`edge[label]`,style:{label:`data(label)`}},{selector:`edge.segments`,style:{"curve-style":`segments`,"segment-weights":`0`,"segment-distances":[.5],"edge-distances":`endpoints`,"source-endpoint":`data(sourceEndpoint)`,"target-endpoint":`data(targetEndpoint)`}},{selector:`node`,style:{"compound-sizing-wrt-labels":`include`}},{selector:`node[label]`,style:{"text-valign":`bottom`,"text-halign":`center`,"font-size":`${s.getConfigField(`fontSize`)}px`}},{selector:`.node-service`,style:{label:`data(label)`,width:`data(width)`,height:`data(height)`}},{selector:`.node-junction`,style:{width:`data(width)`,height:`data(height)`}},{selector:`.node-group`,style:{padding:`${s.getConfigField(`padding`)}px`}}],layout:{name:`grid`,boundingBox:{x1:0,x2:100,y1:0,y2:100}}});d.remove(),fe(a,f),le(e,f,s),ue(t,f,s),pe(o,f);let p=s.getLayoutHints(),m=me(s,c,l,p),h=he(c,s,p),g=s.getConfigField(`iconSize`),_=s.getConfigField(`idealEdgeLengthMultiplier`)*g,v=.5*g,y=s.getConfigField(`edgeElasticity`),b=s.getConfigField(`seed`),x=f.layout({name:`fcose`,quality:`proof`,randomize:s.getConfigField(`randomize`),nodeSeparation:s.getConfigField(`nodeSeparation`),numIter:s.getConfigField(`numIter`),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(e){let[t,n]=e.connectedNodes(),{parent:r}=W(t),{parent:i}=W(n);return r===i?_:v},edgeElasticity(e){let[t,n]=e.connectedNodes(),{parent:r}=W(t),{parent:i}=W(n);return r===i?y:.001},alignmentConstraint:m,relativePlacementConstraint:h});x.one(`layoutstop`,()=>{function e(e,t,n,r){let i,a,{x:o,y:s}=e,{x:c,y:l}=t;a=(r-s+(o-n)*(s-l)/(o-c))/Math.sqrt(1+((s-l)/(o-c))**2),i=Math.sqrt((r-s)**2+(n-o)**2-a**2);let u=Math.sqrt((c-o)**2+(l-s)**2);i/=u;let d=(c-o)*(r-s)-(l-s)*(n-o);switch(!0){case d>=0:d=1;break;case d<0:d=-1}let f=(c-o)*(n-o)+(l-s)*(r-s);switch(!0){case f>=0:f=1;break;case f<0:f=-1}return a=Math.abs(a)*d,i*=f,{distances:a,weights:i}}n(e,`getSegmentWeights`),f.startBatch();for(let t of Object.values(f.edges()))if(t.data?.()){let{x:n,y:r}=t.source().position(),{x:i,y:a}=t.target().position();if(n!==i&&r!==a){let n=t.sourceEndpoint(),r=t.targetEndpoint(),{sourceDir:i}=U(t),[a,o]=I(i)?[n.x,r.y]:[r.x,n.y],{weights:s,distances:c}=e(n,r,a,o);t.style(`segment-distances`,c),t.style(`segment-weights`,s)}}f.endBatch(),J(b,()=>x.run())});try{J(b,()=>x.run())}catch(e){throw e instanceof RangeError&&e.message.includes(`Invalid array length`)?Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):e}f.ready(e=>{r.info(`Ready`,e),u(f)})})}n(ge,`layoutArchitecture`);var _e={parser:q,get db(){return new ie},renderer:{draw:n(async(e,t,n,r)=>{let i=r.db;i.setDiagramId(t);let a=i.getServices(),o=i.getJunctions(),c=i.getGroups(),l=i.getEdges(),u=i.getDataStructures(),d=y(t),f=d.append(`g`);f.attr(`class`,`architecture-edges`);let p=d.append(`g`);p.attr(`class`,`architecture-services`);let m=d.append(`g`);m.attr(`class`,`architecture-groups`),await se(i,p,a,t),ce(i,p,o,t);let h=await ge(a,o,c,l,i,u);await oe(f,h,i,t),await Z(m,h,i,t),de(i,h),s(void 0,d,i.getConfigField(`padding`),i.getConfigField(`useMaxWidth`))},`draw`)},styles:ae};export{_e as diagram}; \ No newline at end of file diff --git a/web/dist/app-blockDiagram-BEXU5L5S.js b/web/dist/app-blockDiagram-BEXU5L5S.js index 571efdf08..b61fbc5ee 100644 --- a/web/dist/app-blockDiagram-BEXU5L5S.js +++ b/web/dist/app-blockDiagram-BEXU5L5S.js @@ -1,9 +1,9 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{a as r,b as i,c as a,it as o,s,x as c}from"./app-chunk-O7XYJQB3.js";import{t as l}from"./app-channel.js";import{A as u,B as d,C as f,D as p,E as m,F as h,G as g,H as _,I as v,L as y,M as b,N as x,O as S,P as C,R as w,T,U as E,V as D,W as O,b as k,j as A,k as j,l as M,v as ee,w as te,z as ne}from"./app-chunk-ZIGJFQKS.js";import{t as re}from"./app-chunk-DUW6YSOI.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{i as ie,n as ae,o as oe,r as se,s as ce}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import{i as le,r as ue}from"./app-chunk-5DYCD2WN.js";import{a as de,c as fe,i as pe,l as me}from"./app-chunk-Z7XXMR3K.js";import{t as he}from"./app-chunk-5VM5RSS4.js";import{t as ge}from"./app-graphlib.js";function _e(e){return Array.isArray(e)}function ve(e){if(k(e))return e;let t=g(e);if(!ye(e))return{};if(_e(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(ee(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?xe(r,e):N(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return N(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Se(n,e),N(n,e),be(n,e),n}function ye(e){switch(g(e)){case f:case T:case te:case p:case m:case S:case j:case u:case x:case A:case b:case C:case h:case v:case y:case w:case ne:case d:case E:case O:case D:case _:return!0;default:return!1}}function N(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function be(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r=n)&&(e[r]=t[r])}function Se(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}var P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,15],r=[1,7],i=[1,13],a=[1,14],o=[1,19],s=[1,16],c=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],p=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],h=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],_={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACELINE`,5:`NL`,7:`SPACE`,8:`EOF`,10:`BLOCK_DIAGRAM_KEY`,15:`LINK`,16:`START_LINK`,17:`LINK_LABEL`,18:`STR`,21:`SPACE_BLOCK`,27:`SIZE`,28:`COLUMNS`,29:`id-block`,30:`end`,31:`NODE_ID`,34:`DIR`,35:`NODE_DSTART`,36:`NODE_DEND`,37:`BLOCK_ARROW_START`,38:`BLOCK_ARROW_END`,39:`classDef`,40:`CLASSDEF_ID`,41:`CLASSDEF_STYLEOPTS`,42:`DEFAULT`,43:`class`,44:`CLASSENTITY_IDS`,45:`STYLECLASS`,46:`style`,47:`STYLE_ENTITY_IDS`,48:`STYLE_DEFINITION_DATA`},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug(`Rule: separator (NL) `);break;case 5:r.getLogger().debug(`Rule: separator (Space) `);break;case 6:r.getLogger().debug(`Rule: separator (EOF) `);break;case 7:r.getLogger().debug(`Rule: hierarchy: `,a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug(`Stop NL `);break;case 9:r.getLogger().debug(`Stop EOF `);break;case 10:r.getLogger().debug(`Stop NL2 `);break;case 11:r.getLogger().debug(`Stop EOF2 `);break;case 12:r.getLogger().debug(`Rule: statement: `,a[s]),this.$=typeof a[s].length==`number`?a[s]:[a[s]];break;case 13:r.getLogger().debug(`Rule: statement #2: `,a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug(`Rule: link: `,a[s],e),this.$={edgeTypeStr:a[s],label:``};break;case 15:r.getLogger().debug(`Rule: LABEL link: `,a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:let t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:`space`,label:``,width:t,children:[]};break;case 23:r.getLogger().debug(`Rule: (nodeStatement link node) `,a[s-2],a[s-1],a[s],` typestr: `,a[s-1].edgeTypeStr);let i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr),o=r.edgeStrToEdgeStartData(a[s-1].edgeTypeStr),c=r.edgeStrToThickness(a[s-1].edgeTypeStr),l=r.edgeStrToPattern(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+`-`+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:`edge`,thickness:c,pattern:l,directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug(`Rule: nodeStatement (abc88 node size) `,a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug(`Rule: nodeStatement (node) `,a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug(`APA123`,this?this:`na`),r.getLogger().debug(`COLUMNS: `,a[s]),this.$={type:`column-setting`,columns:a[s]===`auto`?-1:parseInt(a[s])};break;case 27:r.getLogger().debug(`Rule: id-block statement : `,a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:`composite`,children:a[s-1]};break;case 28:r.getLogger().debug(`Rule: blockStatement : `,a[s-2],a[s-1],a[s]);let u=r.generateId();this.$={id:u,type:`composite`,label:``,children:a[s-1]};break;case 29:r.getLogger().debug(`Rule: node (NODE_ID separator): `,a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug(`Rule: node (NODE_ID nodeShapeNLabel separator): `,a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug(`Rule: dirList: `,a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug(`Rule: dirList: `,a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug(`Rule: nodeShapeNLabel: `,a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug(`Rule: BLOCK_ARROW nodeShapeNLabel: `,a[s-3],a[s-2],` #3:`,a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:`classDef`,id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:`applyStyles`,id:a[s-1].trim(),stylesStr:a[s].trim()}}},`anonymous`),table:[{9:1,10:[1,2]},{1:[3]},{10:n,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:n,21:r,28:i,29:a,31:o,39:s,43:c,46:l}),t(d,[2,16],{14:22,15:f,16:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(m,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:o},{10:n,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(h,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},t(m,[2,24]),{10:n,11:37,13:4,14:22,15:f,16:p,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(h,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},t(d,[2,27]),t(h,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},t(h,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{a as r,b as i,c as a,it as o,s,x as c}from"./app-chunk-O7XYJQB3.js";import{t as l}from"./app-channel.js";import{A as u,B as d,C as f,D as p,E as m,F as h,G as g,H as _,I as v,L as y,M as b,N as x,O as S,P as C,R as w,T,U as E,V as D,W as O,b as k,j as A,k as j,l as M,v as ee,w as te,z as ne}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{t as re}from"./app-chunk-5VM5RSS4.js";import{t as ie}from"./app-chunk-DUW6YSOI.js";import"./app-chunk-7PRAP22T.js";import{i as ae,n as oe,o as se,r as ce,s as le}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import{i as ue,r as de}from"./app-chunk-5DYCD2WN.js";import{a as fe,c as pe,i as me,l as he}from"./app-chunk-Z7XXMR3K.js";import{t as ge}from"./app-graphlib.js";function _e(e){return Array.isArray(e)}function ve(e){if(k(e))return e;let t=g(e);if(!ye(e))return{};if(_e(e)){let t=Array.from(e);return e.length>0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(ee(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?xe(r,e):N(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return N(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Se(n,e),N(n,e),be(n,e),n}function ye(e){switch(g(e)){case f:case T:case te:case p:case m:case S:case j:case u:case x:case A:case b:case C:case h:case v:case y:case w:case ne:case d:case E:case O:case D:case _:return!0;default:return!1}}function N(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function be(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r=n)&&(e[r]=t[r])}function Se(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}var P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,15],r=[1,7],i=[1,13],a=[1,14],o=[1,19],s=[1,16],c=[1,17],l=[1,18],u=[8,30],d=[8,10,21,28,29,30,31,39,43,46],f=[1,23],p=[1,24],m=[8,10,15,16,21,28,29,30,31,39,43,46],h=[8,10,15,16,21,27,28,29,30,31,39,43,46],g=[1,49],_={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACELINE`,5:`NL`,7:`SPACE`,8:`EOF`,10:`BLOCK_DIAGRAM_KEY`,15:`LINK`,16:`START_LINK`,17:`LINK_LABEL`,18:`STR`,21:`SPACE_BLOCK`,27:`SIZE`,28:`COLUMNS`,29:`id-block`,30:`end`,31:`NODE_ID`,34:`DIR`,35:`NODE_DSTART`,36:`NODE_DEND`,37:`BLOCK_ARROW_START`,38:`BLOCK_ARROW_END`,39:`classDef`,40:`CLASSDEF_ID`,41:`CLASSDEF_STYLEOPTS`,42:`DEFAULT`,43:`class`,44:`CLASSENTITY_IDS`,45:`STYLECLASS`,46:`style`,47:`STYLE_ENTITY_IDS`,48:`STYLE_DEFINITION_DATA`},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:r.getLogger().debug(`Rule: separator (NL) `);break;case 5:r.getLogger().debug(`Rule: separator (Space) `);break;case 6:r.getLogger().debug(`Rule: separator (EOF) `);break;case 7:r.getLogger().debug(`Rule: hierarchy: `,a[s-1]),r.setHierarchy(a[s-1]);break;case 8:r.getLogger().debug(`Stop NL `);break;case 9:r.getLogger().debug(`Stop EOF `);break;case 10:r.getLogger().debug(`Stop NL2 `);break;case 11:r.getLogger().debug(`Stop EOF2 `);break;case 12:r.getLogger().debug(`Rule: statement: `,a[s]),this.$=typeof a[s].length==`number`?a[s]:[a[s]];break;case 13:r.getLogger().debug(`Rule: statement #2: `,a[s-1]),this.$=[a[s-1]].concat(a[s]);break;case 14:r.getLogger().debug(`Rule: link: `,a[s],e),this.$={edgeTypeStr:a[s],label:``};break;case 15:r.getLogger().debug(`Rule: LABEL link: `,a[s-3],a[s-1],a[s]),this.$={edgeTypeStr:a[s],label:a[s-1]};break;case 18:let t=parseInt(a[s]),n=r.generateId();this.$={id:n,type:`space`,label:``,width:t,children:[]};break;case 23:r.getLogger().debug(`Rule: (nodeStatement link node) `,a[s-2],a[s-1],a[s],` typestr: `,a[s-1].edgeTypeStr);let i=r.edgeStrToEdgeData(a[s-1].edgeTypeStr),o=r.edgeStrToEdgeStartData(a[s-1].edgeTypeStr),c=r.edgeStrToThickness(a[s-1].edgeTypeStr),l=r.edgeStrToPattern(a[s-1].edgeTypeStr);this.$=[{id:a[s-2].id,label:a[s-2].label,type:a[s-2].type,directions:a[s-2].directions},{id:a[s-2].id+`-`+a[s].id,start:a[s-2].id,end:a[s].id,label:a[s-1].label,type:`edge`,thickness:c,pattern:l,directions:a[s].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions}];break;case 24:r.getLogger().debug(`Rule: nodeStatement (abc88 node size) `,a[s-1],a[s]),this.$={id:a[s-1].id,label:a[s-1].label,type:r.typeStr2Type(a[s-1].typeStr),directions:a[s-1].directions,widthInColumns:parseInt(a[s],10)};break;case 25:r.getLogger().debug(`Rule: nodeStatement (node) `,a[s]),this.$={id:a[s].id,label:a[s].label,type:r.typeStr2Type(a[s].typeStr),directions:a[s].directions,widthInColumns:1};break;case 26:r.getLogger().debug(`APA123`,this?this:`na`),r.getLogger().debug(`COLUMNS: `,a[s]),this.$={type:`column-setting`,columns:a[s]===`auto`?-1:parseInt(a[s])};break;case 27:r.getLogger().debug(`Rule: id-block statement : `,a[s-2],a[s-1]),r.generateId(),this.$={...a[s-2],type:`composite`,children:a[s-1]};break;case 28:r.getLogger().debug(`Rule: blockStatement : `,a[s-2],a[s-1],a[s]);let u=r.generateId();this.$={id:u,type:`composite`,label:``,children:a[s-1]};break;case 29:r.getLogger().debug(`Rule: node (NODE_ID separator): `,a[s]),this.$={id:a[s]};break;case 30:r.getLogger().debug(`Rule: node (NODE_ID nodeShapeNLabel separator): `,a[s-1],a[s]),this.$={id:a[s-1],label:a[s].label,typeStr:a[s].typeStr,directions:a[s].directions};break;case 31:r.getLogger().debug(`Rule: dirList: `,a[s]),this.$=[a[s]];break;case 32:r.getLogger().debug(`Rule: dirList: `,a[s-1],a[s]),this.$=[a[s-1]].concat(a[s]);break;case 33:r.getLogger().debug(`Rule: nodeShapeNLabel: `,a[s-2],a[s-1],a[s]),this.$={typeStr:a[s-2]+a[s],label:a[s-1]};break;case 34:r.getLogger().debug(`Rule: BLOCK_ARROW nodeShapeNLabel: `,a[s-3],a[s-2],` #3:`,a[s-1],a[s]),this.$={typeStr:a[s-3]+a[s],label:a[s-2],directions:a[s-1]};break;case 35:case 36:this.$={type:`classDef`,id:a[s-1].trim(),css:a[s].trim()};break;case 37:this.$={type:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:this.$={type:`applyStyles`,id:a[s-1].trim(),stylesStr:a[s].trim()}}},`anonymous`),table:[{9:1,10:[1,2]},{1:[3]},{10:n,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{8:[1,20]},t(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:n,21:r,28:i,29:a,31:o,39:s,43:c,46:l}),t(d,[2,16],{14:22,15:f,16:p}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(m,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:o},{10:n,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(h,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(u,[2,13]),{26:35,31:o},{31:[2,14]},{17:[1,36]},t(m,[2,24]),{10:n,11:37,13:4,14:22,15:f,16:p,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:i,29:a,31:o,39:s,43:c,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(h,[2,30]),{18:[1,43]},{18:[1,44]},t(m,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:g},{15:[1,50]},t(d,[2,27]),t(h,[2,33]),{38:[1,51]},{33:52,34:g,38:[2,31]},{31:[2,15]},t(h,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};_.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:e(function(e,t,n,r){switch(n){case 0:return e.getLogger().debug(`Found block-beta`),10;case 1:return e.getLogger().debug(`Found id-block`),29;case 2:return e.getLogger().debug(`Found block`),10;case 3:e.getLogger().debug(`.`,t.yytext);break;case 4:e.getLogger().debug(`_`,t.yytext);break;case 5:return 5;case 6:return t.yytext=-1,28;case 7:return t.yytext=t.yytext.replace(/columns\s+/,``),e.getLogger().debug(`COLUMNS (LEX)`,t.yytext),28;case 8:this.pushState(`md_string`);break;case 9:return`MD_STR`;case 10:this.popState();break;case 11:this.pushState(`string`);break;case 12:e.getLogger().debug(`LEX: POPPING STR:`,t.yytext),this.popState();break;case 13:return e.getLogger().debug(`LEX: STR end:`,t.yytext),`STR`;case 14:return t.yytext=t.yytext.replace(/space\:/,``),e.getLogger().debug(`SPACE NUM (LEX)`,t.yytext),21;case 15:return t.yytext=`1`,e.getLogger().debug(`COLUMNS (LEX)`,t.yytext),21;case 16:return 42;case 17:return`LINKSTYLE`;case 18:return`INTERPOLATE`;case 19:return this.pushState(`CLASSDEF`),39;case 20:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 21:return this.popState(),this.pushState(`CLASSDEFID`),40;case 22:return this.popState(),41;case 23:return this.pushState(`CLASS`),43;case 24:return this.popState(),this.pushState(`CLASS_STYLE`),44;case 25:return this.popState(),45;case 26:return this.pushState(`STYLE_STMNT`),46;case 27:return this.popState(),this.pushState(`STYLE_DEFINITION`),47;case 28:return this.popState(),48;case 29:return this.pushState(`acc_title`),`acc_title`;case 30:return this.popState(),`acc_title_value`;case 31:return this.pushState(`acc_descr`),`acc_descr`;case 32:return this.popState(),`acc_descr_value`;case 33:this.pushState(`acc_descr_multiline`);break;case 34:this.popState();break;case 35:return`acc_descr_multiline_value`;case 36:return 30;case 37:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 38:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 39:return this.popState(),e.getLogger().debug(`Lex: ))`),`NODE_DEND`;case 40:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 41:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 42:return this.popState(),e.getLogger().debug(`Lex: (-`),`NODE_DEND`;case 43:return this.popState(),e.getLogger().debug(`Lex: -)`),`NODE_DEND`;case 44:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 45:return this.popState(),e.getLogger().debug(`Lex: ]]`),`NODE_DEND`;case 46:return this.popState(),e.getLogger().debug(`Lex: (`),`NODE_DEND`;case 47:return this.popState(),e.getLogger().debug(`Lex: ])`),`NODE_DEND`;case 48:return this.popState(),e.getLogger().debug(`Lex: /]`),`NODE_DEND`;case 49:return this.popState(),e.getLogger().debug(`Lex: /]`),`NODE_DEND`;case 50:return this.popState(),e.getLogger().debug(`Lex: )]`),`NODE_DEND`;case 51:return this.popState(),e.getLogger().debug(`Lex: )`),`NODE_DEND`;case 52:return this.popState(),e.getLogger().debug(`Lex: ]>`),`NODE_DEND`;case 53:return this.popState(),e.getLogger().debug(`Lex: ]`),`NODE_DEND`;case 54:return e.getLogger().debug(`Lexa: -)`),this.pushState(`NODE`),35;case 55:return e.getLogger().debug(`Lexa: (-`),this.pushState(`NODE`),35;case 56:return e.getLogger().debug(`Lexa: ))`),this.pushState(`NODE`),35;case 57:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 58:return e.getLogger().debug(`Lex: (((`),this.pushState(`NODE`),35;case 59:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 60:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 61:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 62:return e.getLogger().debug(`Lexc: >`),this.pushState(`NODE`),35;case 63:return e.getLogger().debug(`Lexa: ([`),this.pushState(`NODE`),35;case 64:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 65:return this.pushState(`NODE`),35;case 66:return this.pushState(`NODE`),35;case 67:return this.pushState(`NODE`),35;case 68:return this.pushState(`NODE`),35;case 69:return this.pushState(`NODE`),35;case 70:return this.pushState(`NODE`),35;case 71:return this.pushState(`NODE`),35;case 72:return e.getLogger().debug(`Lexa: [`),this.pushState(`NODE`),35;case 73:return this.pushState(`BLOCK_ARROW`),e.getLogger().debug(`LEX ARR START`),37;case 74:return e.getLogger().debug(`Lex: NODE_ID`,t.yytext),31;case 75:return e.getLogger().debug(`Lex: EOF`,t.yytext),8;case 76:this.pushState(`md_string`);break;case 77:this.pushState(`md_string`);break;case 78:return`NODE_DESCR`;case 79:this.popState();break;case 80:e.getLogger().debug(`Lex: Starting string`),this.pushState(`string`);break;case 81:e.getLogger().debug(`LEX ARR: Starting string`),this.pushState(`string`);break;case 82:return e.getLogger().debug(`LEX: NODE_DESCR:`,t.yytext),`NODE_DESCR`;case 83:e.getLogger().debug(`LEX POPPING`),this.popState();break;case 84:e.getLogger().debug(`Lex: =>BAE`),this.pushState(`ARROW_DIR`);break;case 85:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (right): dir:`,t.yytext),`DIR`;case 86:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (left):`,t.yytext),`DIR`;case 87:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (x):`,t.yytext),`DIR`;case 88:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (y):`,t.yytext),`DIR`;case 89:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (up):`,t.yytext),`DIR`;case 90:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (down):`,t.yytext),`DIR`;case 91:return t.yytext=`]>`,e.getLogger().debug(`Lex (ARROW_DIR end):`,t.yytext),this.popState(),this.popState(),`BLOCK_ARROW_END`;case 92:return e.getLogger().debug(`Lex: LINK`,`#`+t.yytext+`#`),15;case 93:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 94:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 95:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 96:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 97:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 98:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 99:this.pushState(`md_string`);break;case 100:return e.getLogger().debug(`Lex: Starting string`),this.pushState(`string`),`LINK_LABEL`;case 101:return this.popState(),e.getLogger().debug(`Lex: LINK`,`#`+t.yytext+`#`),15;case 102:return this.popState(),e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 103:return this.popState(),e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 104:return e.getLogger().debug(`Lex: COLON`,t.yytext),t.yytext=t.yytext.slice(1),27}},`anonymous`),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}}})();function v(){this.yy={}}return e(v,`Parser`),v.prototype=_,_.Parser=v,new v})();P.parser=P;var Ce=P,F=new Map,I=[],L=new Map,R=`color`,z=`fill`,we=`bgFill`,B=`,`,V=new Map,H=``,Te=e(e=>s.sanitizeText(e,c()),`sanitizeText`),Ee=e(function(e,t=``){let n=V.get(e);n||(n={id:e,styles:[],textStyles:[]},V.set(e,n)),t?.split(B).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(R).exec(e)){let e=t.replace(z,we).replace(R,z);n.textStyles.push(e)}n.styles.push(t)})},`addStyleClass`),De=e(function(e,t=``){let n=F.get(e);t!=null&&(n.styles=t.split(B))},`addStyle2Node`),Oe=e(function(e,t){e.split(`,`).forEach(function(e){let n=F.get(e);if(n===void 0){let t=e.trim();n={id:t,type:`na`,children:[]},F.set(t,n)}n.classes||(n.classes=[]),n.classes.push(t)})},`setCssClass`),U=0,ke=e((e,n)=>{let r=e.flat(),i=[],a=r.find(e=>e?.type===`column-setting`)?.columns??-1;for(let e of r){if(typeof a==`number`&&a>0&&e.type!==`column-setting`&&typeof e.widthInColumns==`number`&&e.widthInColumns>a&&t.warn(`Block ${e.id} width ${e.widthInColumns} exceeds configured column width ${a}`),e.label&&=Te(e.label),e.type===`classDef`){Ee(e.id,e.css);continue}if(e.type===`applyClass`){Oe(e.id,e?.styleClass??``);continue}if(e.type===`applyStyles`){e?.stylesStr&&De(e.id,e?.stylesStr);continue}if(e.type===`column-setting`)n.columns=e.columns??-1;else if(e.type===`edge`){let t=(L.get(e.id)??0)+1;L.set(e.id,t),e.id=t+`-`+e.id,I.push(e)}else{e.label||=e.type===`composite`?``:e.id;let t=F.get(e.id);if(t===void 0?(e.type===`composite`&&(e.colorIndex=U++),F.set(e.id,e)):(e.type!==`na`&&(t.type=e.type),e.label!==e.id&&(t.label=e.label)),e.children&&ke(e.children,e),e.type===`space`){let t=e.width??1;for(let n=0;n{t.debug(`Clear called`),r(),G={id:`root`,type:`composite`,children:[],columns:-1},F=new Map([[`root`,G]]),W=[],V=new Map,I=[],L=new Map,H=``,U=0},`clear`);function je(e){switch(t.debug(`typeStr2Type`,e),e){case`[]`:return`square`;case`()`:return t.debug(`we have a round`),`round`;case`(())`:return`circle`;case`>]`:return`rect_left_inv_arrow`;case`{}`:return`diamond`;case`{{}}`:return`hexagon`;case`([])`:return`stadium`;case`[[]]`:return`subroutine`;case`[()]`:return`cylinder`;case`((()))`:return`doublecircle`;case`[//]`:return`lean_right`;case`[\\\\]`:return`lean_left`;case`[/\\]`:return`trapezoid`;case`[\\/]`:return`inv_trapezoid`;case`<[]>`:return`block_arrow`;default:return`na`}}e(je,`typeStr2Type`);function Me(e){switch(t.debug(`typeStr2Type`,e),e){case`==`:return`thick`;default:return`normal`}}e(Me,`edgeTypeStr2Type`);function Ne(e){switch(e.trim().slice(-1)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`>`:return`arrow_point`;default:return``}}e(Ne,`edgeStrToEdgeData`);function Pe(e){switch(e.trim().charAt(0)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`<`:return`arrow_point`;default:return`arrow_open`}}e(Pe,`edgeStrToEdgeStartData`);function Fe(e){return e.includes(`==`)?`thick`:`normal`}e(Fe,`edgeStrToThickness`);function Ie(e){return e.includes(`.-`)?`dotted`:`solid`}e(Ie,`edgeStrToPattern`);var Le=0,Re={getConfig:e(()=>i().block,`getConfig`),typeStr2Type:je,edgeTypeStr2Type:Me,edgeStrToEdgeData:Ne,edgeStrToEdgeStartData:Pe,edgeStrToThickness:Fe,edgeStrToPattern:Ie,getLogger:e(()=>t,`getLogger`),getBlocksFlat:e(()=>[...F.values()],`getBlocksFlat`),getBlocks:e(()=>W||[],`getBlocks`),getEdges:e(()=>I,`getEdges`),setHierarchy:e(e=>{G.children=e,ke(e,G),W=G.children},`setHierarchy`),getBlock:e(e=>F.get(e),`getBlock`),setBlock:e(e=>{F.set(e.id,e)},`setBlock`),getColumns:e(e=>{let t=F.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},`getColumns`),getClasses:e(function(){return V},`getClasses`),clear:Ae,generateId:e(()=>(Le++,`id-`+Math.random().toString(36).substr(2,12)+`-`+Le),`generateId`),setDiagramId:e(e=>{H=e},`setDiagramId`),getDiagramId:e(()=>H,`getDiagramId`)},ze=e(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!ie(t,r))return``;let i=oe(e.look),a=se(n),o=``;for(let t=0;t0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:e(function(e,t,n,r){switch(n){case 0:return e.getLogger().debug(`Found block-beta`),10;case 1:return e.getLogger().debug(`Found id-block`),29;case 2:return e.getLogger().debug(`Found block`),10;case 3:e.getLogger().debug(`.`,t.yytext);break;case 4:e.getLogger().debug(`_`,t.yytext);break;case 5:return 5;case 6:return t.yytext=-1,28;case 7:return t.yytext=t.yytext.replace(/columns\s+/,``),e.getLogger().debug(`COLUMNS (LEX)`,t.yytext),28;case 8:this.pushState(`md_string`);break;case 9:return`MD_STR`;case 10:this.popState();break;case 11:this.pushState(`string`);break;case 12:e.getLogger().debug(`LEX: POPPING STR:`,t.yytext),this.popState();break;case 13:return e.getLogger().debug(`LEX: STR end:`,t.yytext),`STR`;case 14:return t.yytext=t.yytext.replace(/space\:/,``),e.getLogger().debug(`SPACE NUM (LEX)`,t.yytext),21;case 15:return t.yytext=`1`,e.getLogger().debug(`COLUMNS (LEX)`,t.yytext),21;case 16:return 42;case 17:return`LINKSTYLE`;case 18:return`INTERPOLATE`;case 19:return this.pushState(`CLASSDEF`),39;case 20:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 21:return this.popState(),this.pushState(`CLASSDEFID`),40;case 22:return this.popState(),41;case 23:return this.pushState(`CLASS`),43;case 24:return this.popState(),this.pushState(`CLASS_STYLE`),44;case 25:return this.popState(),45;case 26:return this.pushState(`STYLE_STMNT`),46;case 27:return this.popState(),this.pushState(`STYLE_DEFINITION`),47;case 28:return this.popState(),48;case 29:return this.pushState(`acc_title`),`acc_title`;case 30:return this.popState(),`acc_title_value`;case 31:return this.pushState(`acc_descr`),`acc_descr`;case 32:return this.popState(),`acc_descr_value`;case 33:this.pushState(`acc_descr_multiline`);break;case 34:this.popState();break;case 35:return`acc_descr_multiline_value`;case 36:return 30;case 37:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 38:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 39:return this.popState(),e.getLogger().debug(`Lex: ))`),`NODE_DEND`;case 40:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 41:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 42:return this.popState(),e.getLogger().debug(`Lex: (-`),`NODE_DEND`;case 43:return this.popState(),e.getLogger().debug(`Lex: -)`),`NODE_DEND`;case 44:return this.popState(),e.getLogger().debug(`Lex: ((`),`NODE_DEND`;case 45:return this.popState(),e.getLogger().debug(`Lex: ]]`),`NODE_DEND`;case 46:return this.popState(),e.getLogger().debug(`Lex: (`),`NODE_DEND`;case 47:return this.popState(),e.getLogger().debug(`Lex: ])`),`NODE_DEND`;case 48:return this.popState(),e.getLogger().debug(`Lex: /]`),`NODE_DEND`;case 49:return this.popState(),e.getLogger().debug(`Lex: /]`),`NODE_DEND`;case 50:return this.popState(),e.getLogger().debug(`Lex: )]`),`NODE_DEND`;case 51:return this.popState(),e.getLogger().debug(`Lex: )`),`NODE_DEND`;case 52:return this.popState(),e.getLogger().debug(`Lex: ]>`),`NODE_DEND`;case 53:return this.popState(),e.getLogger().debug(`Lex: ]`),`NODE_DEND`;case 54:return e.getLogger().debug(`Lexa: -)`),this.pushState(`NODE`),35;case 55:return e.getLogger().debug(`Lexa: (-`),this.pushState(`NODE`),35;case 56:return e.getLogger().debug(`Lexa: ))`),this.pushState(`NODE`),35;case 57:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 58:return e.getLogger().debug(`Lex: (((`),this.pushState(`NODE`),35;case 59:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 60:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 61:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 62:return e.getLogger().debug(`Lexc: >`),this.pushState(`NODE`),35;case 63:return e.getLogger().debug(`Lexa: ([`),this.pushState(`NODE`),35;case 64:return e.getLogger().debug(`Lexa: )`),this.pushState(`NODE`),35;case 65:return this.pushState(`NODE`),35;case 66:return this.pushState(`NODE`),35;case 67:return this.pushState(`NODE`),35;case 68:return this.pushState(`NODE`),35;case 69:return this.pushState(`NODE`),35;case 70:return this.pushState(`NODE`),35;case 71:return this.pushState(`NODE`),35;case 72:return e.getLogger().debug(`Lexa: [`),this.pushState(`NODE`),35;case 73:return this.pushState(`BLOCK_ARROW`),e.getLogger().debug(`LEX ARR START`),37;case 74:return e.getLogger().debug(`Lex: NODE_ID`,t.yytext),31;case 75:return e.getLogger().debug(`Lex: EOF`,t.yytext),8;case 76:this.pushState(`md_string`);break;case 77:this.pushState(`md_string`);break;case 78:return`NODE_DESCR`;case 79:this.popState();break;case 80:e.getLogger().debug(`Lex: Starting string`),this.pushState(`string`);break;case 81:e.getLogger().debug(`LEX ARR: Starting string`),this.pushState(`string`);break;case 82:return e.getLogger().debug(`LEX: NODE_DESCR:`,t.yytext),`NODE_DESCR`;case 83:e.getLogger().debug(`LEX POPPING`),this.popState();break;case 84:e.getLogger().debug(`Lex: =>BAE`),this.pushState(`ARROW_DIR`);break;case 85:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (right): dir:`,t.yytext),`DIR`;case 86:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (left):`,t.yytext),`DIR`;case 87:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (x):`,t.yytext),`DIR`;case 88:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (y):`,t.yytext),`DIR`;case 89:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (up):`,t.yytext),`DIR`;case 90:return t.yytext=t.yytext.replace(/^,\s*/,``),e.getLogger().debug(`Lex (down):`,t.yytext),`DIR`;case 91:return t.yytext=`]>`,e.getLogger().debug(`Lex (ARROW_DIR end):`,t.yytext),this.popState(),this.popState(),`BLOCK_ARROW_END`;case 92:return e.getLogger().debug(`Lex: LINK`,`#`+t.yytext+`#`),15;case 93:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 94:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 95:return e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 96:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 97:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 98:return e.getLogger().debug(`Lex: START_LINK`,t.yytext),this.pushState(`LLABEL`),16;case 99:this.pushState(`md_string`);break;case 100:return e.getLogger().debug(`Lex: Starting string`),this.pushState(`string`),`LINK_LABEL`;case 101:return this.popState(),e.getLogger().debug(`Lex: LINK`,`#`+t.yytext+`#`),15;case 102:return this.popState(),e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 103:return this.popState(),e.getLogger().debug(`Lex: LINK`,t.yytext),15;case 104:return e.getLogger().debug(`Lex: COLON`,t.yytext),t.yytext=t.yytext.slice(1),27}},`anonymous`),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}}})();function v(){this.yy={}}return e(v,`Parser`),v.prototype=_,_.Parser=v,new v})();P.parser=P;var Ce=P,F=new Map,I=[],L=new Map,R=`color`,z=`fill`,we=`bgFill`,B=`,`,V=new Map,H=``,Te=e(e=>s.sanitizeText(e,c()),`sanitizeText`),Ee=e(function(e,t=``){let n=V.get(e);n||(n={id:e,styles:[],textStyles:[]},V.set(e,n)),t?.split(B).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(R).exec(e)){let e=t.replace(z,we).replace(R,z);n.textStyles.push(e)}n.styles.push(t)})},`addStyleClass`),De=e(function(e,t=``){let n=F.get(e);t!=null&&(n.styles=t.split(B))},`addStyle2Node`),Oe=e(function(e,t){e.split(`,`).forEach(function(e){let n=F.get(e);if(n===void 0){let t=e.trim();n={id:t,type:`na`,children:[]},F.set(t,n)}n.classes||(n.classes=[]),n.classes.push(t)})},`setCssClass`),U=0,ke=e((e,n)=>{let r=e.flat(),i=[],a=r.find(e=>e?.type===`column-setting`)?.columns??-1;for(let e of r){if(typeof a==`number`&&a>0&&e.type!==`column-setting`&&typeof e.widthInColumns==`number`&&e.widthInColumns>a&&t.warn(`Block ${e.id} width ${e.widthInColumns} exceeds configured column width ${a}`),e.label&&=Te(e.label),e.type===`classDef`){Ee(e.id,e.css);continue}if(e.type===`applyClass`){Oe(e.id,e?.styleClass??``);continue}if(e.type===`applyStyles`){e?.stylesStr&&De(e.id,e?.stylesStr);continue}if(e.type===`column-setting`)n.columns=e.columns??-1;else if(e.type===`edge`){let t=(L.get(e.id)??0)+1;L.set(e.id,t),e.id=t+`-`+e.id,I.push(e)}else{e.label||=e.type===`composite`?``:e.id;let t=F.get(e.id);if(t===void 0?(e.type===`composite`&&(e.colorIndex=U++),F.set(e.id,e)):(e.type!==`na`&&(t.type=e.type),e.label!==e.id&&(t.label=e.label)),e.children&&ke(e.children,e),e.type===`space`){let t=e.width??1;for(let n=0;n{t.debug(`Clear called`),r(),G={id:`root`,type:`composite`,children:[],columns:-1},F=new Map([[`root`,G]]),W=[],V=new Map,I=[],L=new Map,H=``,U=0},`clear`);function je(e){switch(t.debug(`typeStr2Type`,e),e){case`[]`:return`square`;case`()`:return t.debug(`we have a round`),`round`;case`(())`:return`circle`;case`>]`:return`rect_left_inv_arrow`;case`{}`:return`diamond`;case`{{}}`:return`hexagon`;case`([])`:return`stadium`;case`[[]]`:return`subroutine`;case`[()]`:return`cylinder`;case`((()))`:return`doublecircle`;case`[//]`:return`lean_right`;case`[\\\\]`:return`lean_left`;case`[/\\]`:return`trapezoid`;case`[\\/]`:return`inv_trapezoid`;case`<[]>`:return`block_arrow`;default:return`na`}}e(je,`typeStr2Type`);function Me(e){switch(t.debug(`typeStr2Type`,e),e){case`==`:return`thick`;default:return`normal`}}e(Me,`edgeTypeStr2Type`);function Ne(e){switch(e.trim().slice(-1)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`>`:return`arrow_point`;default:return``}}e(Ne,`edgeStrToEdgeData`);function Pe(e){switch(e.trim().charAt(0)){case`x`:return`arrow_cross`;case`o`:return`arrow_circle`;case`<`:return`arrow_point`;default:return`arrow_open`}}e(Pe,`edgeStrToEdgeStartData`);function Fe(e){return e.includes(`==`)?`thick`:`normal`}e(Fe,`edgeStrToThickness`);function Ie(e){return e.includes(`.-`)?`dotted`:`solid`}e(Ie,`edgeStrToPattern`);var Le=0,Re={getConfig:e(()=>i().block,`getConfig`),typeStr2Type:je,edgeTypeStr2Type:Me,edgeStrToEdgeData:Ne,edgeStrToEdgeStartData:Pe,edgeStrToThickness:Fe,edgeStrToPattern:Ie,getLogger:e(()=>t,`getLogger`),getBlocksFlat:e(()=>[...F.values()],`getBlocksFlat`),getBlocks:e(()=>W||[],`getBlocks`),getEdges:e(()=>I,`getEdges`),setHierarchy:e(e=>{G.children=e,ke(e,G),W=G.children},`setHierarchy`),getBlock:e(e=>F.get(e),`getBlock`),setBlock:e(e=>{F.set(e.id,e)},`setBlock`),getColumns:e(e=>{let t=F.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},`getColumns`),getClasses:e(function(){return V},`getClasses`),clear:Ae,generateId:e(()=>(Le++,`id-`+Math.random().toString(36).substr(2,12)+`-`+Le),`generateId`),setDiagramId:e(e=>{H=e},`setDiagramId`),getDiagramId:e(()=>H,`getDiagramId`)},ze=e(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!ae(t,r))return``;let i=se(e.look),a=ce(n),o=``;for(let t=0;t{let n=0,r=0;for(let i of e.children){let{width:e,height:a,x:o,y:s}=i.size??{width:0,height:0,x:0,y:0};if(t.debug(`getMaxChildSize abc95 child:`,i.id,`width:`,e,`height:`,a,`x:`,o,`y:`,s,i.type),i.type===`space`)continue;let c=e/(i.widthInColumns??1);c>n&&(n=c),a>r&&(r=a)}return{width:n,height:r}},`getMaxChildSize`);function J(e,n,r=0,i=0,a=8){t.debug(`setBlockSizes abc95 (start)`,e.id,e?.size?.x,`block width =`,e?.size,`siblingWidth`,r),e?.size?.width||(e.size={width:r,height:i,x:0,y:0});let o=0,s=0;if(e.children?.length>0){for(let t of e.children)J(t,n,0,0,a);let c=Ve(e);o=c.width,s=c.height,t.debug(`setBlockSizes abc95 maxWidth of`,e.id,`:s children is `,o,s);for(let n of e.children)n.size&&(t.debug(`abc95 Setting size of children of ${e.id} id=${n.id} ${o} ${s} ${JSON.stringify(n.size)}`),n.size.width=o*(n.widthInColumns??1)+a*((n.widthInColumns??1)-1),n.size.height=s,n.size.x=0,n.size.y=0,t.debug(`abc95 updating size of ${e.id} children child:${n.id} maxWidth:${o} maxHeight:${s}`));for(let t of e.children)J(t,n,o,s,a);let l=e.columns??-1,u=0;for(let t of e.children)u+=t.widthInColumns??1;let d=e.children.length;l>0&&l0?Math.min(e.children.length,l):e.children.length;if(n>0){let r=(p-n*a-a)/n;t.debug(`abc95 (growing to fit) width`,e.id,p,e.size?.width,r);for(let t of e.children)t.size&&(t.size.width=r)}}e.size={width:p,height:m,x:0,y:0}}t.debug(`setBlockSizes abc94 (done)`,e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}e(J,`setBlockSizes`);function Y(e,n,r=8){t.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);let i=e.columns??-1;if(t.debug(`layoutBlocks columns abc95`,e.id,`=>`,i,e),e.children&&e.children.length>0){let a=e?.children[0]?.size?.width??0,o=e.children.length*a+(e.children.length-1)*r;t.debug(`widthOfChildren 88`,o,`posX`);let s=new Map;{let t=0;for(let n of e.children){if(!n.size)continue;let{py:e}=q(i,t),r=s.get(e)??0;n.size.height>r&&s.set(e,n.size.height);let a=n?.widthInColumns??1;i>0&&(a=Math.min(a,i-t%i)),t+=a}}let c=new Map;{let e=0,t=[...s.keys()].sort((e,t)=>e-t);for(let n of t)c.set(n,e),e+=(s.get(n)??0)+r}let l=0;t.debug(`abc91 block?.size?.x`,e.id,e?.size?.x);let u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,d=0;for(let a of e.children){let o=e;if(!a.size)continue;let{width:f,height:p}=a.size,{px:m,py:h}=q(i,l);if(h!=d&&(d=h,u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,t.debug(`New row in layout for block`,e.id,` and child `,a.id,d)),t.debug(`abc89 layout blocks (child) id: ${a.id} Pos: ${l} (px, py) ${m},${h} (${o?.size?.x},${o?.size?.y}) parent: ${o.id} width: ${f}${r}`),o.size){let e=f/2;a.size.x=u+r+e,t.debug(`abc91 layout blocks (calc) px, pyid:${a.id} startingPos=X${u} new startingPosX${a.size.x} ${e} padding=${r} width=${f} halfWidth=${e} => x:${a.size.x} y:${a.size.y} ${a.widthInColumns} (width * (child?.w || 1)) / 2 ${f*(a?.widthInColumns??1)/2}`),u=a.size.x+e;let n=c.get(h)??0,i=s.get(h)??p;a.size.y=o.size.y-o.size.height/2+n+i/2+r,t.debug(`abc88 layout blocks (calc) px, pyid:${a.id}startingPosX${u}${r}${e}=>x:${a.size.x}y:${a.size.y}${a.widthInColumns}(width * (child?.w || 1)) / 2${f*(a?.widthInColumns??1)/2}`)}a.children&&Y(a,n,r);let g=a?.widthInColumns??1;i>0&&(g=Math.min(g,i-l%i)),l+=g,t.debug(`abc88 columnsPos`,a,l)}}t.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}e(Y,`layoutBlocks`);function X(e,{minX:t,minY:n,maxX:r,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!==`root`){let{x:a,y:o,width:s,height:c}=e.size;a-s/2r&&(r=a+s/2),o+c/2>i&&(i=o+c/2)}if(e.children)for(let a of e.children)({minX:t,minY:n,maxX:r,maxY:i}=X(a,{minX:t,minY:n,maxX:r,maxY:i}));return{minX:t,minY:n,maxX:r,maxY:i}}e(X,`findBounds`);function He(e){let n=e.getBlock(`root`);if(!n)return;let r=c()?.block?.padding??8;J(n,e,0,0,r),Y(n,e,r),t.debug(`getBlocks`,JSON.stringify(n,null,2));let{minX:i,minY:a,maxX:o,maxY:s}=X(n),l=s-a;return{x:i,y:a,width:o-i,height:l}}e(He,`layout`);function Z(e,t,n=!1){let r=e,a=`default`;(r?.classes?.length||0)>0&&(a=(r?.classes??[]).join(` `)),a+=` flowchart-label`;let o=(r?.classes??[]).flatMap(e=>t.getClasses().get(e)?.styles??[]),s=0,c=`rect`,l;switch(r.type){case`round`:s=5,c=`rect`;break;case`composite`:s=0,c=`composite`,l=0;break;case`square`:c=`rect`;break;case`diamond`:c=`question`;break;case`hexagon`:c=`hexagon`;break;case`block_arrow`:c=`block_arrow`;break;case`odd`:c=`rect_left_inv_arrow`;break;case`lean_right`:c=`lean_right`;break;case`lean_left`:c=`lean_left`;break;case`trapezoid`:c=`trapezoid`;break;case`inv_trapezoid`:c=`inv_trapezoid`;break;case`rect_left_inv_arrow`:c=`rect_left_inv_arrow`;break;case`circle`:c=`circle`;break;case`ellipse`:c=`ellipse`;break;case`stadium`:c=`stadium`;break;case`subroutine`:c=`subroutine`;break;case`cylinder`:c=`cylinder`;break;case`group`:c=`rect`;break;case`doublecircle`:c=`doublecircle`;break;default:c=`rect`}let u=M(r?.styles??[]),d=r.label,f=r.size??{width:0,height:0,x:0,y:0},p=t.getDiagramId();return{labelStyle:u.labelStyle,shape:c,label:d,labelText:d,rx:s,ry:s,class:a,cssClasses:a,cssStyles:r?.styles??[],cssCompiledStyles:o,style:u.style,id:r.id,domId:p?`${p}-${r.id}`:r.id,isGroup:!1,directions:r.directions,width:f.width||void 0,height:f.height||void 0,wrappingWidth:f.width||1/0,x:f.x,y:f.y,positioned:n,intersect:void 0,padding:l??i()?.block?.padding??0,widthInColumns:r.widthInColumns??1,colorIndex:r.colorIndex,look:i().look}}e(Z,`getNodeFromBlock`);async function Ue(e,t,n){let r=Z(t,n,!1);if(t.type===`group`)return;let a=i(),o=await ue(e,r,{config:a}),s=o.node()?.getBBox()??{width:0,height:0},c=n.getBlock(r.id);c.size={width:s.width,height:s.height,x:0,y:0,node:o},n.setBlock(c),o.remove()}e(Ue,`calculateBlockSize`);async function We(e,t,n){let r=Z(t,n,!0);if(n.getBlock(r.id).type!==`space`){let n=i(),a=await ue(e,r,{config:n});r.colorIndex!==void 0&&ce(a,r.colorIndex,n.theme,n.themeVariables?.borderColorArray),t.intersect=r?.intersect,le(r)}}e(We,`insertBlockPositioned`);async function Q(e,t,n,r){for(let i of t)await r(e,i,n),i.children&&await Q(e,i.children,n,r)}e(Q,`performOperations`);async function Ge(e,t,n){await Q(e,t,n,Ue)}e(Ge,`calculateBlockSizes`);async function Ke(e,t,n){await Q(e,t,n,We)}e(Ke,`insertBlocks`);async function $(e,t,n,r,i){let a=new ge({multigraph:!0,compound:!0});a.setGraph({rankdir:`TB`,nodesep:10,ranksep:10,marginx:8,marginy:8});for(let e of n)e.size&&a.setNode(e.id,{width:e.size.width,height:e.size.height,intersect:e.intersect});for(let n of t)if(n.start&&n.end){let t=r.getBlock(n.start),o=r.getBlock(n.end);if(t?.size&&o?.size){let r=t.size,s=o.size,c=[{x:r.x,y:r.y},{x:r.x+(s.x-r.x)/2,y:r.y+(s.y-r.y)/2},{x:s.x,y:s.y}],l=i?`${i}-${n.id}`:n.id,u=`${n.thickness===`thick`?`edge-thickness-thick`:`edge-thickness-normal`} ${n.pattern===`dotted`?`edge-pattern-dotted`:`edge-pattern-solid`} flowchart-link LS-a1 LE-b1`;pe(e,{...n,id:l,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:c,classes:u},{},`block`,a.node(n.start),a.node(n.end),i),n.label&&(await de(e,{...n,label:n.label,labelStyle:`stroke: #333; stroke-width: 1.5px;fill:none;`,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:c,classes:u}),me({...n,x:c[1].x,y:c[1].y},{originalPath:c}))}}}e($,`insertEdges`);var qe={parser:Ce,db:Re,renderer:{draw:e(async function(e,r,o,s){let{securityLevel:c,block:l}=i(),u=s.db;u.setDiagramId(r);let d;c===`sandbox`&&(d=n(`#i`+r));let f=n(c===`sandbox`?d.nodes()[0].contentDocument.body:`body`),p=c===`sandbox`?f.select(`[id="${r}"]`):n(`[id="${r}"]`);re(p,i()),fe(p,[`point`,`circle`,`cross`],s.type,r);let m=u.getBlocks(),h=u.getBlocksFlat(),g=u.getEdges(),_=p.insert(`g`).attr(`class`,`block`);await Ge(_,m,u);let v=He(u);await Ke(_,m,u),await $(_,g,h,u,r);let y=_.node()?.getBBox(),b=y&&Number.isFinite(y.width)&&Number.isFinite(y.height)?y:v;if(b){let e=Math.max(1,Math.round(.125*(b.width/b.height))),n=b.height+e+10,r=b.width+10,{useMaxWidth:i}=l;a(p,n,r,!!i),t.debug(`Here Bounds`,v,b),p.attr(`viewBox`,`${b.x-5} ${b.y-5} ${b.width+10} ${b.height+10}`)}},`draw`),getClasses:e(function(e,t){return t.db.getClasses()},`getClasses`)},styles:Be};export{qe as diagram}; \ No newline at end of file + ${re()} +`,`getStyles`);function q(e,t){if(e===0||!Number.isInteger(e))throw Error(`Columns must be an integer !== 0.`);if(t<0||!Number.isInteger(t))throw Error(`Position must be a non-negative integer.`+t);return e<0?{px:t,py:0}:e===1?{px:0,py:t}:{px:t%e,py:Math.floor(t/e)}}e(q,`calculateBlockPosition`);var Ve=e(e=>{let n=0,r=0;for(let i of e.children){let{width:e,height:a,x:o,y:s}=i.size??{width:0,height:0,x:0,y:0};if(t.debug(`getMaxChildSize abc95 child:`,i.id,`width:`,e,`height:`,a,`x:`,o,`y:`,s,i.type),i.type===`space`)continue;let c=e/(i.widthInColumns??1);c>n&&(n=c),a>r&&(r=a)}return{width:n,height:r}},`getMaxChildSize`);function J(e,n,r=0,i=0,a=8){t.debug(`setBlockSizes abc95 (start)`,e.id,e?.size?.x,`block width =`,e?.size,`siblingWidth`,r),e?.size?.width||(e.size={width:r,height:i,x:0,y:0});let o=0,s=0;if(e.children?.length>0){for(let t of e.children)J(t,n,0,0,a);let c=Ve(e);o=c.width,s=c.height,t.debug(`setBlockSizes abc95 maxWidth of`,e.id,`:s children is `,o,s);for(let n of e.children)n.size&&(t.debug(`abc95 Setting size of children of ${e.id} id=${n.id} ${o} ${s} ${JSON.stringify(n.size)}`),n.size.width=o*(n.widthInColumns??1)+a*((n.widthInColumns??1)-1),n.size.height=s,n.size.x=0,n.size.y=0,t.debug(`abc95 updating size of ${e.id} children child:${n.id} maxWidth:${o} maxHeight:${s}`));for(let t of e.children)J(t,n,o,s,a);let l=e.columns??-1,u=0;for(let t of e.children)u+=t.widthInColumns??1;let d=e.children.length;l>0&&l0?Math.min(e.children.length,l):e.children.length;if(n>0){let r=(p-n*a-a)/n;t.debug(`abc95 (growing to fit) width`,e.id,p,e.size?.width,r);for(let t of e.children)t.size&&(t.size.width=r)}}e.size={width:p,height:m,x:0,y:0}}t.debug(`setBlockSizes abc94 (done)`,e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}e(J,`setBlockSizes`);function Y(e,n,r=8){t.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);let i=e.columns??-1;if(t.debug(`layoutBlocks columns abc95`,e.id,`=>`,i,e),e.children&&e.children.length>0){let a=e?.children[0]?.size?.width??0,o=e.children.length*a+(e.children.length-1)*r;t.debug(`widthOfChildren 88`,o,`posX`);let s=new Map;{let t=0;for(let n of e.children){if(!n.size)continue;let{py:e}=q(i,t),r=s.get(e)??0;n.size.height>r&&s.set(e,n.size.height);let a=n?.widthInColumns??1;i>0&&(a=Math.min(a,i-t%i)),t+=a}}let c=new Map;{let e=0,t=[...s.keys()].sort((e,t)=>e-t);for(let n of t)c.set(n,e),e+=(s.get(n)??0)+r}let l=0;t.debug(`abc91 block?.size?.x`,e.id,e?.size?.x);let u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,d=0;for(let a of e.children){let o=e;if(!a.size)continue;let{width:f,height:p}=a.size,{px:m,py:h}=q(i,l);if(h!=d&&(d=h,u=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-r,t.debug(`New row in layout for block`,e.id,` and child `,a.id,d)),t.debug(`abc89 layout blocks (child) id: ${a.id} Pos: ${l} (px, py) ${m},${h} (${o?.size?.x},${o?.size?.y}) parent: ${o.id} width: ${f}${r}`),o.size){let e=f/2;a.size.x=u+r+e,t.debug(`abc91 layout blocks (calc) px, pyid:${a.id} startingPos=X${u} new startingPosX${a.size.x} ${e} padding=${r} width=${f} halfWidth=${e} => x:${a.size.x} y:${a.size.y} ${a.widthInColumns} (width * (child?.w || 1)) / 2 ${f*(a?.widthInColumns??1)/2}`),u=a.size.x+e;let n=c.get(h)??0,i=s.get(h)??p;a.size.y=o.size.y-o.size.height/2+n+i/2+r,t.debug(`abc88 layout blocks (calc) px, pyid:${a.id}startingPosX${u}${r}${e}=>x:${a.size.x}y:${a.size.y}${a.widthInColumns}(width * (child?.w || 1)) / 2${f*(a?.widthInColumns??1)/2}`)}a.children&&Y(a,n,r);let g=a?.widthInColumns??1;i>0&&(g=Math.min(g,i-l%i)),l+=g,t.debug(`abc88 columnsPos`,a,l)}}t.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}e(Y,`layoutBlocks`);function X(e,{minX:t,minY:n,maxX:r,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!==`root`){let{x:a,y:o,width:s,height:c}=e.size;a-s/2r&&(r=a+s/2),o+c/2>i&&(i=o+c/2)}if(e.children)for(let a of e.children)({minX:t,minY:n,maxX:r,maxY:i}=X(a,{minX:t,minY:n,maxX:r,maxY:i}));return{minX:t,minY:n,maxX:r,maxY:i}}e(X,`findBounds`);function He(e){let n=e.getBlock(`root`);if(!n)return;let r=c()?.block?.padding??8;J(n,e,0,0,r),Y(n,e,r),t.debug(`getBlocks`,JSON.stringify(n,null,2));let{minX:i,minY:a,maxX:o,maxY:s}=X(n),l=s-a;return{x:i,y:a,width:o-i,height:l}}e(He,`layout`);function Z(e,t,n=!1){let r=e,a=`default`;(r?.classes?.length||0)>0&&(a=(r?.classes??[]).join(` `)),a+=` flowchart-label`;let o=(r?.classes??[]).flatMap(e=>t.getClasses().get(e)?.styles??[]),s=0,c=`rect`,l;switch(r.type){case`round`:s=5,c=`rect`;break;case`composite`:s=0,c=`composite`,l=0;break;case`square`:c=`rect`;break;case`diamond`:c=`question`;break;case`hexagon`:c=`hexagon`;break;case`block_arrow`:c=`block_arrow`;break;case`odd`:c=`rect_left_inv_arrow`;break;case`lean_right`:c=`lean_right`;break;case`lean_left`:c=`lean_left`;break;case`trapezoid`:c=`trapezoid`;break;case`inv_trapezoid`:c=`inv_trapezoid`;break;case`rect_left_inv_arrow`:c=`rect_left_inv_arrow`;break;case`circle`:c=`circle`;break;case`ellipse`:c=`ellipse`;break;case`stadium`:c=`stadium`;break;case`subroutine`:c=`subroutine`;break;case`cylinder`:c=`cylinder`;break;case`group`:c=`rect`;break;case`doublecircle`:c=`doublecircle`;break;default:c=`rect`}let u=M(r?.styles??[]),d=r.label,f=r.size??{width:0,height:0,x:0,y:0},p=t.getDiagramId();return{labelStyle:u.labelStyle,shape:c,label:d,labelText:d,rx:s,ry:s,class:a,cssClasses:a,cssStyles:r?.styles??[],cssCompiledStyles:o,style:u.style,id:r.id,domId:p?`${p}-${r.id}`:r.id,isGroup:!1,directions:r.directions,width:f.width||void 0,height:f.height||void 0,wrappingWidth:f.width||1/0,x:f.x,y:f.y,positioned:n,intersect:void 0,padding:l??i()?.block?.padding??0,widthInColumns:r.widthInColumns??1,colorIndex:r.colorIndex,look:i().look}}e(Z,`getNodeFromBlock`);async function Ue(e,t,n){let r=Z(t,n,!1);if(t.type===`group`)return;let a=i(),o=await de(e,r,{config:a}),s=o.node()?.getBBox()??{width:0,height:0},c=n.getBlock(r.id);c.size={width:s.width,height:s.height,x:0,y:0,node:o},n.setBlock(c),o.remove()}e(Ue,`calculateBlockSize`);async function We(e,t,n){let r=Z(t,n,!0);if(n.getBlock(r.id).type!==`space`){let n=i(),a=await de(e,r,{config:n});r.colorIndex!==void 0&&le(a,r.colorIndex,n.theme,n.themeVariables?.borderColorArray),t.intersect=r?.intersect,ue(r)}}e(We,`insertBlockPositioned`);async function Q(e,t,n,r){for(let i of t)await r(e,i,n),i.children&&await Q(e,i.children,n,r)}e(Q,`performOperations`);async function Ge(e,t,n){await Q(e,t,n,Ue)}e(Ge,`calculateBlockSizes`);async function Ke(e,t,n){await Q(e,t,n,We)}e(Ke,`insertBlocks`);async function $(e,t,n,r,i){let a=new ge({multigraph:!0,compound:!0});a.setGraph({rankdir:`TB`,nodesep:10,ranksep:10,marginx:8,marginy:8});for(let e of n)e.size&&a.setNode(e.id,{width:e.size.width,height:e.size.height,intersect:e.intersect});for(let n of t)if(n.start&&n.end){let t=r.getBlock(n.start),o=r.getBlock(n.end);if(t?.size&&o?.size){let r=t.size,s=o.size,c=[{x:r.x,y:r.y},{x:r.x+(s.x-r.x)/2,y:r.y+(s.y-r.y)/2},{x:s.x,y:s.y}],l=i?`${i}-${n.id}`:n.id,u=`${n.thickness===`thick`?`edge-thickness-thick`:`edge-thickness-normal`} ${n.pattern===`dotted`?`edge-pattern-dotted`:`edge-pattern-solid`} flowchart-link LS-a1 LE-b1`;me(e,{...n,id:l,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:c,classes:u},{},`block`,a.node(n.start),a.node(n.end),i),n.label&&(await fe(e,{...n,label:n.label,labelStyle:`stroke: #333; stroke-width: 1.5px;fill:none;`,arrowTypeEnd:n.arrowTypeEnd,arrowTypeStart:n.arrowTypeStart,points:c,classes:u}),he({...n,x:c[1].x,y:c[1].y},{originalPath:c}))}}}e($,`insertEdges`);var qe={parser:Ce,db:Re,renderer:{draw:e(async function(e,r,o,s){let{securityLevel:c,block:l}=i(),u=s.db;u.setDiagramId(r);let d;c===`sandbox`&&(d=n(`#i`+r));let f=n(c===`sandbox`?d.nodes()[0].contentDocument.body:`body`),p=c===`sandbox`?f.select(`[id="${r}"]`):n(`[id="${r}"]`);ie(p,i()),pe(p,[`point`,`circle`,`cross`],s.type,r);let m=u.getBlocks(),h=u.getBlocksFlat(),g=u.getEdges(),_=p.insert(`g`).attr(`class`,`block`);await Ge(_,m,u);let v=He(u);await Ke(_,m,u),await $(_,g,h,u,r);let y=_.node()?.getBBox(),b=y&&Number.isFinite(y.width)&&Number.isFinite(y.height)?y:v;if(b){let e=Math.max(1,Math.round(.125*(b.width/b.height))),n=b.height+e+10,r=b.width+10,{useMaxWidth:i}=l;a(p,n,r,!!i),t.debug(`Here Bounds`,v,b),p.attr(`viewBox`,`${b.x-5} ${b.y-5} ${b.width+10} ${b.height+10}`)}},`draw`),getClasses:e(function(e,t){return t.db.getClasses()},`getClasses`)},styles:Be};export{qe as diagram}; \ No newline at end of file diff --git a/web/dist/app-c4Diagram-YGBWAQC7.js b/web/dist/app-c4Diagram-YGBWAQC7.js index c522e0381..39e4e4de0 100644 --- a/web/dist/app-c4Diagram-YGBWAQC7.js +++ b/web/dist/app-c4Diagram-YGBWAQC7.js @@ -1,4 +1,4 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{H as r,U as i,c as a,r as o,s,v as l,x as u,y as d,z as f}from"./app-chunk-O7XYJQB3.js";import{_ as p,n as m,r as h}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{r as g,s as _}from"./app-chunk-7INBJB4K.js";import{a as v}from"./app-chunk-GWA4HPMP.js";var y=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,24],r=[1,25],i=[1,26],a=[1,27],o=[1,28],s=[1,63],l=[1,64],u=[1,65],d=[1,66],f=[1,67],p=[1,68],m=[1,69],h=[1,29],g=[1,30],_=[1,31],v=[1,32],y=[1,33],b=[1,34],x=[1,35],S=[1,36],C=[1,37],w=[1,38],T=[1,39],E=[1,40],D=[1,41],O=[1,42],k=[1,43],A=[1,44],j=[1,45],M=[1,46],N=[1,47],P=[1,48],F=[1,50],I=[1,51],L=[1,52],R=[1,53],z=[1,54],B=[1,55],V=[1,56],H=[1,57],U=[1,58],W=[1,59],G=[1,60],ee=[14,42],te=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ne=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],K=[1,82],q=[1,83],J=[1,84],Y=[1,85],X=[12,14,42],re=[12,14,33,42],ie=[12,14,33,42,76,77,79,80],Z=[12,33],ae=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],oe={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:`error`,6:`direction_tb`,7:`direction_bt`,8:`direction_rl`,9:`direction_lr`,11:`C4_CONTEXT`,12:`NEWLINE`,14:`EOF`,15:`C4_CONTAINER`,16:`C4_COMPONENT`,17:`C4_DYNAMIC`,18:`C4_DEPLOYMENT`,22:`title`,23:`accDescription`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`LBRACE`,34:`ENTERPRISE_BOUNDARY`,36:`SYSTEM_BOUNDARY`,37:`BOUNDARY`,38:`CONTAINER_BOUNDARY`,39:`NODE`,40:`NODE_L`,41:`NODE_R`,42:`RBRACE`,44:`PERSON`,45:`PERSON_EXT`,46:`SYSTEM`,47:`SYSTEM_DB`,48:`SYSTEM_QUEUE`,49:`SYSTEM_EXT`,50:`SYSTEM_EXT_DB`,51:`SYSTEM_EXT_QUEUE`,52:`CONTAINER`,53:`CONTAINER_DB`,54:`CONTAINER_QUEUE`,55:`CONTAINER_EXT`,56:`CONTAINER_EXT_DB`,57:`CONTAINER_EXT_QUEUE`,58:`COMPONENT`,59:`COMPONENT_DB`,60:`COMPONENT_QUEUE`,61:`COMPONENT_EXT`,62:`COMPONENT_EXT_DB`,63:`COMPONENT_EXT_QUEUE`,64:`REL`,65:`BIREL`,66:`REL_U`,67:`REL_D`,68:`REL_L`,69:`REL_R`,70:`REL_B`,71:`REL_INDEX`,72:`UPDATE_EL_STYLE`,73:`UPDATE_REL_STYLE`,74:`UPDATE_LAYOUT_CONFIG`,76:`STR`,77:`STR_KEY`,78:`STR_VALUE`,79:`ATTRIBUTE`,80:`ATTRIBUTE_EMPTY`},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:r.setDirection(`TB`);break;case 4:r.setDirection(`BT`);break;case 5:r.setDirection(`RL`);break;case 6:r.setDirection(`LR`);break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(a[s-3]);break;case 19:r.setTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 20:r.setAccDescription(a[s].substring(15)),this.$=a[s].substring(15);break;case 21:this.$=a[s].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 28:a[s].splice(2,0,`ENTERPRISE`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 29:a[s].splice(2,0,`SYSTEM`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 30:r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 31:a[s].splice(2,0,`CONTAINER`),r.addContainerBoundary(...a[s]),this.$=a[s];break;case 32:r.addDeploymentNode(`node`,...a[s]),this.$=a[s];break;case 33:r.addDeploymentNode(`nodeL`,...a[s]),this.$=a[s];break;case 34:r.addDeploymentNode(`nodeR`,...a[s]),this.$=a[s];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem(`person`,...a[s]),this.$=a[s];break;case 40:r.addPersonOrSystem(`external_person`,...a[s]),this.$=a[s];break;case 41:r.addPersonOrSystem(`system`,...a[s]),this.$=a[s];break;case 42:r.addPersonOrSystem(`system_db`,...a[s]),this.$=a[s];break;case 43:r.addPersonOrSystem(`system_queue`,...a[s]),this.$=a[s];break;case 44:r.addPersonOrSystem(`external_system`,...a[s]),this.$=a[s];break;case 45:r.addPersonOrSystem(`external_system_db`,...a[s]),this.$=a[s];break;case 46:r.addPersonOrSystem(`external_system_queue`,...a[s]),this.$=a[s];break;case 47:r.addContainer(`container`,...a[s]),this.$=a[s];break;case 48:r.addContainer(`container_db`,...a[s]),this.$=a[s];break;case 49:r.addContainer(`container_queue`,...a[s]),this.$=a[s];break;case 50:r.addContainer(`external_container`,...a[s]),this.$=a[s];break;case 51:r.addContainer(`external_container_db`,...a[s]),this.$=a[s];break;case 52:r.addContainer(`external_container_queue`,...a[s]),this.$=a[s];break;case 53:r.addComponent(`component`,...a[s]),this.$=a[s];break;case 54:r.addComponent(`component_db`,...a[s]),this.$=a[s];break;case 55:r.addComponent(`component_queue`,...a[s]),this.$=a[s];break;case 56:r.addComponent(`external_component`,...a[s]),this.$=a[s];break;case 57:r.addComponent(`external_component_db`,...a[s]),this.$=a[s];break;case 58:r.addComponent(`external_component_queue`,...a[s]),this.$=a[s];break;case 60:r.addRel(`rel`,...a[s]),this.$=a[s];break;case 61:r.addRel(`birel`,...a[s]),this.$=a[s];break;case 62:r.addRel(`rel_u`,...a[s]),this.$=a[s];break;case 63:r.addRel(`rel_d`,...a[s]),this.$=a[s];break;case 64:r.addRel(`rel_l`,...a[s]),this.$=a[s];break;case 65:r.addRel(`rel_r`,...a[s]),this.$=a[s];break;case 66:r.addRel(`rel_b`,...a[s]),this.$=a[s];break;case 67:a[s].splice(0,1),r.addRel(`rel`,...a[s]),this.$=a[s];break;case 68:r.updateElStyle(`update_el_style`,...a[s]),this.$=a[s];break;case 69:r.updateRelStyle(`update_rel_style`,...a[s]),this.$=a[s];break;case 70:r.updateLayoutConfig(`update_layout_config`,...a[s]),this.$=a[s];break;case 71:this.$=[a[s]];break;case 72:a[s].unshift(a[s-1]),this.$=a[s];break;case 73:case 75:this.$=a[s].trim();break;case 74:let e={};e[a[s-1].trim()]=a[s].trim(),this.$=e;break;case 76:this.$=``}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:70,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:71,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:72,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:73,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{14:[1,74]},t(ee,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ee,[2,14]),t(te,[2,16],{12:[1,76]}),t(ee,[2,36],{12:[1,77]}),t(ne,[2,19]),t(ne,[2,20]),{25:[1,78]},{27:[1,79]},t(ne,[2,23]),{35:80,75:81,76:K,77:q,79:J,80:Y},{35:86,75:81,76:K,77:q,79:J,80:Y},{35:87,75:81,76:K,77:q,79:J,80:Y},{35:88,75:81,76:K,77:q,79:J,80:Y},{35:89,75:81,76:K,77:q,79:J,80:Y},{35:90,75:81,76:K,77:q,79:J,80:Y},{35:91,75:81,76:K,77:q,79:J,80:Y},{35:92,75:81,76:K,77:q,79:J,80:Y},{35:93,75:81,76:K,77:q,79:J,80:Y},{35:94,75:81,76:K,77:q,79:J,80:Y},{35:95,75:81,76:K,77:q,79:J,80:Y},{35:96,75:81,76:K,77:q,79:J,80:Y},{35:97,75:81,76:K,77:q,79:J,80:Y},{35:98,75:81,76:K,77:q,79:J,80:Y},{35:99,75:81,76:K,77:q,79:J,80:Y},{35:100,75:81,76:K,77:q,79:J,80:Y},{35:101,75:81,76:K,77:q,79:J,80:Y},{35:102,75:81,76:K,77:q,79:J,80:Y},{35:103,75:81,76:K,77:q,79:J,80:Y},{35:104,75:81,76:K,77:q,79:J,80:Y},t(X,[2,59]),{35:105,75:81,76:K,77:q,79:J,80:Y},{35:106,75:81,76:K,77:q,79:J,80:Y},{35:107,75:81,76:K,77:q,79:J,80:Y},{35:108,75:81,76:K,77:q,79:J,80:Y},{35:109,75:81,76:K,77:q,79:J,80:Y},{35:110,75:81,76:K,77:q,79:J,80:Y},{35:111,75:81,76:K,77:q,79:J,80:Y},{35:112,75:81,76:K,77:q,79:J,80:Y},{35:113,75:81,76:K,77:q,79:J,80:Y},{35:114,75:81,76:K,77:q,79:J,80:Y},{35:115,75:81,76:K,77:q,79:J,80:Y},{20:116,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{12:[1,118],33:[1,117]},{35:119,75:81,76:K,77:q,79:J,80:Y},{35:120,75:81,76:K,77:q,79:J,80:Y},{35:121,75:81,76:K,77:q,79:J,80:Y},{35:122,75:81,76:K,77:q,79:J,80:Y},{35:123,75:81,76:K,77:q,79:J,80:Y},{35:124,75:81,76:K,77:q,79:J,80:Y},{35:125,75:81,76:K,77:q,79:J,80:Y},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ee,[2,15]),t(te,[2,17],{21:22,19:130,22:n,23:r,24:i,26:a,28:o}),t(ee,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:n,23:r,24:i,26:a,28:o,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ne,[2,21]),t(ne,[2,22]),t(X,[2,39]),t(re,[2,71],{75:81,35:132,76:K,77:q,79:J,80:Y}),t(ie,[2,73]),{78:[1,133]},t(ie,[2,75]),t(ie,[2,76]),t(X,[2,40]),t(X,[2,41]),t(X,[2,42]),t(X,[2,43]),t(X,[2,44]),t(X,[2,45]),t(X,[2,46]),t(X,[2,47]),t(X,[2,48]),t(X,[2,49]),t(X,[2,50]),t(X,[2,51]),t(X,[2,52]),t(X,[2,53]),t(X,[2,54]),t(X,[2,55]),t(X,[2,56]),t(X,[2,57]),t(X,[2,58]),t(X,[2,60]),t(X,[2,61]),t(X,[2,62]),t(X,[2,63]),t(X,[2,64]),t(X,[2,65]),t(X,[2,66]),t(X,[2,67]),t(X,[2,68]),t(X,[2,69]),t(X,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(Z,[2,28]),t(Z,[2,29]),t(Z,[2,30]),t(Z,[2,31]),t(Z,[2,32]),t(Z,[2,33]),t(Z,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(te,[2,18]),t(ee,[2,38]),t(re,[2,72]),t(ie,[2,74]),t(X,[2,24]),t(X,[2,35]),t(ae,[2,25]),t(ae,[2,26],{12:[1,138]}),t(ae,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,l=``,u=0,d=0,f=0,p=2,m=1,h=o.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(t,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;o.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){r.length-=2*e,a.length-=e,o.length-=e}e(x,`popStack`);function S(){var e=i.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=r[r.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=s[T]&&s[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],s[T])this.terminals_[k]&&k>p&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(u+1)+`: +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{H as r,U as i,c as a,r as o,s,v as l,x as u,y as d,z as f}from"./app-chunk-O7XYJQB3.js";import{_ as p,n as m,r as h}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import{r as g,s as _}from"./app-chunk-7INBJB4K.js";import{a as v}from"./app-chunk-GWA4HPMP.js";var y=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,24],r=[1,25],i=[1,26],a=[1,27],o=[1,28],s=[1,63],l=[1,64],u=[1,65],d=[1,66],f=[1,67],p=[1,68],m=[1,69],h=[1,29],g=[1,30],_=[1,31],v=[1,32],y=[1,33],b=[1,34],x=[1,35],S=[1,36],C=[1,37],w=[1,38],T=[1,39],E=[1,40],D=[1,41],O=[1,42],k=[1,43],A=[1,44],j=[1,45],M=[1,46],N=[1,47],P=[1,48],F=[1,50],I=[1,51],L=[1,52],R=[1,53],z=[1,54],B=[1,55],V=[1,56],H=[1,57],U=[1,58],W=[1,59],G=[1,60],ee=[14,42],te=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],ne=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],K=[1,82],q=[1,83],J=[1,84],Y=[1,85],X=[12,14,42],re=[12,14,33,42],ie=[12,14,33,42,76,77,79,80],Z=[12,33],ae=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],oe={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:`error`,6:`direction_tb`,7:`direction_bt`,8:`direction_rl`,9:`direction_lr`,11:`C4_CONTEXT`,12:`NEWLINE`,14:`EOF`,15:`C4_CONTAINER`,16:`C4_COMPONENT`,17:`C4_DYNAMIC`,18:`C4_DEPLOYMENT`,22:`title`,23:`accDescription`,24:`acc_title`,25:`acc_title_value`,26:`acc_descr`,27:`acc_descr_value`,28:`acc_descr_multiline_value`,33:`LBRACE`,34:`ENTERPRISE_BOUNDARY`,36:`SYSTEM_BOUNDARY`,37:`BOUNDARY`,38:`CONTAINER_BOUNDARY`,39:`NODE`,40:`NODE_L`,41:`NODE_R`,42:`RBRACE`,44:`PERSON`,45:`PERSON_EXT`,46:`SYSTEM`,47:`SYSTEM_DB`,48:`SYSTEM_QUEUE`,49:`SYSTEM_EXT`,50:`SYSTEM_EXT_DB`,51:`SYSTEM_EXT_QUEUE`,52:`CONTAINER`,53:`CONTAINER_DB`,54:`CONTAINER_QUEUE`,55:`CONTAINER_EXT`,56:`CONTAINER_EXT_DB`,57:`CONTAINER_EXT_QUEUE`,58:`COMPONENT`,59:`COMPONENT_DB`,60:`COMPONENT_QUEUE`,61:`COMPONENT_EXT`,62:`COMPONENT_EXT_DB`,63:`COMPONENT_EXT_QUEUE`,64:`REL`,65:`BIREL`,66:`REL_U`,67:`REL_D`,68:`REL_L`,69:`REL_R`,70:`REL_B`,71:`REL_INDEX`,72:`UPDATE_EL_STYLE`,73:`UPDATE_REL_STYLE`,74:`UPDATE_LAYOUT_CONFIG`,76:`STR`,77:`STR_KEY`,78:`STR_VALUE`,79:`ATTRIBUTE`,80:`ATTRIBUTE_EMPTY`},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:r.setDirection(`TB`);break;case 4:r.setDirection(`BT`);break;case 5:r.setDirection(`RL`);break;case 6:r.setDirection(`LR`);break;case 8:case 9:case 10:case 11:case 12:r.setC4Type(a[s-3]);break;case 19:r.setTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 20:r.setAccDescription(a[s].substring(15)),this.$=a[s].substring(15);break;case 21:this.$=a[s].trim(),r.setTitle(this.$);break;case 22:case 23:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 28:a[s].splice(2,0,`ENTERPRISE`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 29:a[s].splice(2,0,`SYSTEM`),r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 30:r.addPersonOrSystemBoundary(...a[s]),this.$=a[s];break;case 31:a[s].splice(2,0,`CONTAINER`),r.addContainerBoundary(...a[s]),this.$=a[s];break;case 32:r.addDeploymentNode(`node`,...a[s]),this.$=a[s];break;case 33:r.addDeploymentNode(`nodeL`,...a[s]),this.$=a[s];break;case 34:r.addDeploymentNode(`nodeR`,...a[s]),this.$=a[s];break;case 35:r.popBoundaryParseStack();break;case 39:r.addPersonOrSystem(`person`,...a[s]),this.$=a[s];break;case 40:r.addPersonOrSystem(`external_person`,...a[s]),this.$=a[s];break;case 41:r.addPersonOrSystem(`system`,...a[s]),this.$=a[s];break;case 42:r.addPersonOrSystem(`system_db`,...a[s]),this.$=a[s];break;case 43:r.addPersonOrSystem(`system_queue`,...a[s]),this.$=a[s];break;case 44:r.addPersonOrSystem(`external_system`,...a[s]),this.$=a[s];break;case 45:r.addPersonOrSystem(`external_system_db`,...a[s]),this.$=a[s];break;case 46:r.addPersonOrSystem(`external_system_queue`,...a[s]),this.$=a[s];break;case 47:r.addContainer(`container`,...a[s]),this.$=a[s];break;case 48:r.addContainer(`container_db`,...a[s]),this.$=a[s];break;case 49:r.addContainer(`container_queue`,...a[s]),this.$=a[s];break;case 50:r.addContainer(`external_container`,...a[s]),this.$=a[s];break;case 51:r.addContainer(`external_container_db`,...a[s]),this.$=a[s];break;case 52:r.addContainer(`external_container_queue`,...a[s]),this.$=a[s];break;case 53:r.addComponent(`component`,...a[s]),this.$=a[s];break;case 54:r.addComponent(`component_db`,...a[s]),this.$=a[s];break;case 55:r.addComponent(`component_queue`,...a[s]),this.$=a[s];break;case 56:r.addComponent(`external_component`,...a[s]),this.$=a[s];break;case 57:r.addComponent(`external_component_db`,...a[s]),this.$=a[s];break;case 58:r.addComponent(`external_component_queue`,...a[s]),this.$=a[s];break;case 60:r.addRel(`rel`,...a[s]),this.$=a[s];break;case 61:r.addRel(`birel`,...a[s]),this.$=a[s];break;case 62:r.addRel(`rel_u`,...a[s]),this.$=a[s];break;case 63:r.addRel(`rel_d`,...a[s]),this.$=a[s];break;case 64:r.addRel(`rel_l`,...a[s]),this.$=a[s];break;case 65:r.addRel(`rel_r`,...a[s]),this.$=a[s];break;case 66:r.addRel(`rel_b`,...a[s]),this.$=a[s];break;case 67:a[s].splice(0,1),r.addRel(`rel`,...a[s]),this.$=a[s];break;case 68:r.updateElStyle(`update_el_style`,...a[s]),this.$=a[s];break;case 69:r.updateRelStyle(`update_rel_style`,...a[s]),this.$=a[s];break;case 70:r.updateLayoutConfig(`update_layout_config`,...a[s]),this.$=a[s];break;case 71:this.$=[a[s]];break;case 72:a[s].unshift(a[s-1]),this.$=a[s];break;case 73:case 75:this.$=a[s].trim();break;case 74:let e={};e[a[s-1].trim()]=a[s].trim(),this.$=e;break;case 76:this.$=``}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:70,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:71,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:72,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{13:73,19:20,20:21,21:22,22:n,23:r,24:i,26:a,28:o,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{14:[1,74]},t(ee,[2,13],{43:23,29:49,30:61,32:62,20:75,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ee,[2,14]),t(te,[2,16],{12:[1,76]}),t(ee,[2,36],{12:[1,77]}),t(ne,[2,19]),t(ne,[2,20]),{25:[1,78]},{27:[1,79]},t(ne,[2,23]),{35:80,75:81,76:K,77:q,79:J,80:Y},{35:86,75:81,76:K,77:q,79:J,80:Y},{35:87,75:81,76:K,77:q,79:J,80:Y},{35:88,75:81,76:K,77:q,79:J,80:Y},{35:89,75:81,76:K,77:q,79:J,80:Y},{35:90,75:81,76:K,77:q,79:J,80:Y},{35:91,75:81,76:K,77:q,79:J,80:Y},{35:92,75:81,76:K,77:q,79:J,80:Y},{35:93,75:81,76:K,77:q,79:J,80:Y},{35:94,75:81,76:K,77:q,79:J,80:Y},{35:95,75:81,76:K,77:q,79:J,80:Y},{35:96,75:81,76:K,77:q,79:J,80:Y},{35:97,75:81,76:K,77:q,79:J,80:Y},{35:98,75:81,76:K,77:q,79:J,80:Y},{35:99,75:81,76:K,77:q,79:J,80:Y},{35:100,75:81,76:K,77:q,79:J,80:Y},{35:101,75:81,76:K,77:q,79:J,80:Y},{35:102,75:81,76:K,77:q,79:J,80:Y},{35:103,75:81,76:K,77:q,79:J,80:Y},{35:104,75:81,76:K,77:q,79:J,80:Y},t(X,[2,59]),{35:105,75:81,76:K,77:q,79:J,80:Y},{35:106,75:81,76:K,77:q,79:J,80:Y},{35:107,75:81,76:K,77:q,79:J,80:Y},{35:108,75:81,76:K,77:q,79:J,80:Y},{35:109,75:81,76:K,77:q,79:J,80:Y},{35:110,75:81,76:K,77:q,79:J,80:Y},{35:111,75:81,76:K,77:q,79:J,80:Y},{35:112,75:81,76:K,77:q,79:J,80:Y},{35:113,75:81,76:K,77:q,79:J,80:Y},{35:114,75:81,76:K,77:q,79:J,80:Y},{35:115,75:81,76:K,77:q,79:J,80:Y},{20:116,29:49,30:61,32:62,34:s,36:l,37:u,38:d,39:f,40:p,41:m,43:23,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G},{12:[1,118],33:[1,117]},{35:119,75:81,76:K,77:q,79:J,80:Y},{35:120,75:81,76:K,77:q,79:J,80:Y},{35:121,75:81,76:K,77:q,79:J,80:Y},{35:122,75:81,76:K,77:q,79:J,80:Y},{35:123,75:81,76:K,77:q,79:J,80:Y},{35:124,75:81,76:K,77:q,79:J,80:Y},{35:125,75:81,76:K,77:q,79:J,80:Y},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ee,[2,15]),t(te,[2,17],{21:22,19:130,22:n,23:r,24:i,26:a,28:o}),t(ee,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:n,23:r,24:i,26:a,28:o,34:s,36:l,37:u,38:d,39:f,40:p,41:m,44:h,45:g,46:_,47:v,48:y,49:b,50:x,51:S,52:C,53:w,54:T,55:E,56:D,57:O,58:k,59:A,60:j,61:M,62:N,63:P,64:F,65:I,66:L,67:R,68:z,69:B,70:V,71:H,72:U,73:W,74:G}),t(ne,[2,21]),t(ne,[2,22]),t(X,[2,39]),t(re,[2,71],{75:81,35:132,76:K,77:q,79:J,80:Y}),t(ie,[2,73]),{78:[1,133]},t(ie,[2,75]),t(ie,[2,76]),t(X,[2,40]),t(X,[2,41]),t(X,[2,42]),t(X,[2,43]),t(X,[2,44]),t(X,[2,45]),t(X,[2,46]),t(X,[2,47]),t(X,[2,48]),t(X,[2,49]),t(X,[2,50]),t(X,[2,51]),t(X,[2,52]),t(X,[2,53]),t(X,[2,54]),t(X,[2,55]),t(X,[2,56]),t(X,[2,57]),t(X,[2,58]),t(X,[2,60]),t(X,[2,61]),t(X,[2,62]),t(X,[2,63]),t(X,[2,64]),t(X,[2,65]),t(X,[2,66]),t(X,[2,67]),t(X,[2,68]),t(X,[2,69]),t(X,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(Z,[2,28]),t(Z,[2,29]),t(Z,[2,30]),t(Z,[2,31]),t(Z,[2,32]),t(Z,[2,33]),t(Z,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(te,[2,18]),t(ee,[2,38]),t(re,[2,72]),t(ie,[2,74]),t(X,[2,24]),t(X,[2,35]),t(ae,[2,25]),t(ae,[2,26],{12:[1,138]}),t(ae,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,l=``,u=0,d=0,f=0,p=2,m=1,h=o.slice.call(arguments,1),g=Object.create(this.lexer),_={yy:{}};for(var v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(_.yy[v]=this.yy[v]);g.setInput(t,_.yy),_.yy.lexer=g,_.yy.parser=this,g.yylloc===void 0&&(g.yylloc={});var y=g.yylloc;o.push(y);var b=g.options&&g.options.ranges;this.parseError=typeof _.yy.parseError==`function`?_.yy.parseError:Object.getPrototypeOf(this).parseError;function x(e){r.length-=2*e,a.length-=e,o.length-=e}e(x,`popStack`);function S(){var e=i.pop()||g.lex()||m;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(S,`lex`);for(var C,w,T,E,D,O={},k,A,j,M;;){if(T=r[r.length-1],this.defaultActions[T]?E=this.defaultActions[T]:(C??=S(),E=s[T]&&s[T][C]),E===void 0||!E.length||!E[0]){var N=``;for(k in M=[],s[T])this.terminals_[k]&&k>p&&M.push(`'`+this.terminals_[k]+`'`);N=g.showPosition?`Parse error on line `+(u+1)+`: `+g.showPosition()+` Expecting `+M.join(`, `)+`, got '`+(this.terminals_[C]||C)+`'`:`Parse error on line `+(u+1)+`: Unexpected `+(C==m?`end of input`:`'`+(this.terminals_[C]||C)+`'`),this.parseError(N,{text:g.match,token:this.terminals_[C]||C,line:g.yylineno,loc:y,expected:M})}if(E[0]instanceof Array&&E.length>1)throw Error(`Parse Error: multiple actions possible at state: `+T+`, token: `+C);switch(E[0]){case 1:r.push(C),a.push(g.yytext),o.push(g.yylloc),r.push(E[1]),C=null,w?(C=w,w=null):(d=g.yyleng,l=g.yytext,u=g.yylineno,y=g.yylloc,f>0&&f--);break;case 2:if(A=this.productions_[E[1]][1],O.$=a[a.length-A],O._$={first_line:o[o.length-(A||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(A||1)].first_column,last_column:o[o.length-1].last_column},b&&(O._$.range=[o[o.length-(A||1)].range[0],o[o.length-1].range[1]]),D=this.performAction.apply(O,[l,d,u,_.yy,E[1],a,o].concat(h)),D!==void 0)return D;A&&(r=r.slice(0,-1*A*2),a=a.slice(0,-1*A),o=o.slice(0,-1*A)),r.push(this.productions_[E[1]][0]),a.push(O.$),o.push(O._$),j=s[r[r.length-2]][r[r.length-1]],r.push(j);break;case 3:return!0}}return!0},`parse`)};oe.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` diff --git a/web/dist/app-chunk-3FUC2YCW.js b/web/dist/app-chunk-3FUC2YCW.js index 256a8d282..50e9053f1 100644 --- a/web/dist/app-chunk-3FUC2YCW.js +++ b/web/dist/app-chunk-3FUC2YCW.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["app-sizeCapture-INFHLROL.js","app-chunk-Y2CYZVJY.js"])))=>i.map(i=>d[i]); -import{t as e}from"./app-preload-helper.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import{b as r,x as i}from"./app-chunk-O7XYJQB3.js";import{g as a}from"./app-chunk-ZIGJFQKS.js";import{o}from"./app-chunk-7INBJB4K.js";import{i as s,n as c,r as l,t as u}from"./app-chunk-5DYCD2WN.js";import{r as d,t as f}from"./app-chunk-UA2S7LBM.js";import{a as p,c as m,i as h,n as g,r as _,t as ee,u as v}from"./app-chunk-Z7XXMR3K.js";import{t as y}from"./app-graphlib.js";function b(e,{edgePathsClass:t=`edges edgePaths`}={}){let n=e.insert(`g`).attr(`class`,`root`);return{clusters:n.insert(`g`).attr(`class`,`clusters`),edgePaths:n.insert(`g`).attr(`class`,t),edgeLabels:n.insert(`g`).attr(`class`,`edgeLabels`),nodes:n.insert(`g`).attr(`class`,`nodes`),rootGroups:n}}t(b,`createLayoutElementGroups`);async function x(e,t,n){if(t.label){let{shapeSvg:r,bbox:i}=await o(e,n===void 0?t:{...t,width:n});t.labelBBox={width:i.width,height:i.height},r.remove()}else t.labelBBox={width:0,height:0}}t(x,`measureGroupLabel`);async function S(e,t,n){let r=await l(e,t,n),i=r.node()?.getBBox()??{width:0,height:0};return t.width=i.width,t.height=i.height,r}t(S,`insertMeasuredNode`);function C(e,t,n){let r=e,i=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||i.has(r.parentId))break;i.add(r.parentId),r=t.get(r.parentId)}return n}t(C,`resolveNodeDir`);async function w(t,n,r={}){let a=new y({multigraph:!0,compound:!0}),o=[...n.edges],s=i(),c=b(t),{edgeLabels:l,nodes:u}=c,d=new Map,f=new Map(n.nodes.map(e=>[e.id,e])),m=n.direction,h=t.node()!=null;await Promise.all(n.nodes.map(async e=>{if(e.isGroup){if(h){let t=r.unwrapGroupLabels&&e.labelType!==`markdown`;await x(u,e,t?1/0:void 0)}a.setNode(e.id,{...e})}else{if(h){let t=await S(u,e,{config:s,dir:C(e,f,m)});d.set(e.id,t)}a.setNode(e.id,{...e})}}));for(let e of o)h&&_(e)&&await p(l,e),a.setEdge(e.start,e.end,{...e},e.id),n.edges.some(t=>t.id===e.id)||n.edges.push(e);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:r}=await e(async()=>{let{captureNodeSizes:e}=await import(`./app-sizeCapture-INFHLROL.js`);return{captureNodeSizes:e}},__vite__mapDeps([0,1]));r(t,n)}return{graph:a,groups:c,nodeElements:d}}t(w,`createGraphWithElements`);var T=new Map,E=new Map,D=new Map,O=t(()=>{E.clear(),D.clear(),T.clear()},`clear`),k=t((e,t)=>{let r=E.get(t)||[];return n.trace(`In isDescendant`,t,` `,e,` = `,r.includes(e)),r.includes(e)},`isDescendant`),A=t((e,t)=>{let r=E.get(t)||[];return n.info(`Descendants of `,t,` is `,r),n.info(`Edge is `,e),e.v===t||e.w===t?!1:r?r.includes(e.v)||k(e.v,t)||k(e.w,t)||r.includes(e.w):(n.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),j=t((e,t,r,i)=>{n.debug(`Copying children of `,e,`root`,i,`data`,t.node(e),i);let a=t.children(e)||[];e!==i&&a.push(e),n.debug(`Copying (nodes) clusterId`,e,`nodes`,a),a.forEach(a=>{if(t.children(a).length>0)j(a,t,r,i);else{let o=t.node(a);n.info(`cp `,a,` to `,i,` with parent `,e),r.setNode(a,o),i!==t.parent(a)&&(n.debug(`Setting parent`,a,t.parent(a)),r.setParent(a,t.parent(a))),e!==i&&a!==e?(n.debug(`Setting parent`,a,e),r.setParent(a,e)):(n.info(`In copy `,e,`root`,i,`data`,t.node(e),i),n.debug(`Not Setting parent for node=`,a,`cluster!==rootId`,e!==i,`node!==clusterId`,a!==e));let s=t.edges(a);n.debug(`Copying Edges`,s),s.forEach(a=>{n.info(`Edge`,a);let o=t.edge(a.v,a.w,a.name);n.info(`Edge data`,o,i);try{A(a,i)?(n.info(`Copying as `,a.v,a.w,o,a.name),r.setEdge(a.v,a.w,o,a.name),n.info(`newGraph edges `,r.edges(),r.edge(r.edges()[0]))):n.info(`Skipping copy of edge `,a.v,`-->`,a.w,` rootId: `,i,` clusterId:`,e)}catch(e){n.error(e)}})}n.debug(`Removing node`,a),t.removeNode(a)})},`copy`),M=t((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)D.set(i,e),r=[...r,...M(i,t)];return r},`extractDescendants`),N=t((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),P=t((e,t,r)=>{let i=t.children(e);if(n.trace(`Searching children of id `,e,i),i.length<1)return e;let a;for(let e of i){let n=P(e,t,r),i=N(t,r,n);if(n)if(i.length>0)a=n;else return n}return a},`findNonClusterChild`),F=t(e=>!T.has(e)||!T.get(e).externalConnections?e:T.has(e)?T.get(e).id:e,`getAnchorId`),I=t((e,t)=>{if(!e||t>10){n.debug(`Opting out, no graph `);return}n.debug(`Opting in, graph `),e.nodes().forEach(function(t){e.children(t).length>0&&(n.debug(`Cluster identified`,t,` Replacement id in edges: `,P(t,e,t)),E.set(t,M(t,e)),T.set(t,{id:P(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let r=e.children(t),i=e.edges();r.length>0?(n.debug(`Cluster identified`,t,E),i.forEach(e=>{k(e.v,t)^k(e.w,t)&&(n.debug(`Edge: `,e,` leaves cluster `,t),n.debug(`Descendants of XXX `,t,`: `,E.get(t)),T.get(t).externalConnections=!0)})):n.debug(`Not a cluster `,t,E)});for(let t of T.keys()){let n=T.get(t).id,r=e.parent(n);r!==t&&T.has(r)&&!T.get(r).externalConnections&&(T.get(t).id=r);let i=e.edges().some(e=>e.v===t);if(n&&T.get(t)?.externalConnections&&i&&B(e,n,t)){let r=V(e,t,e.parent(n));r&&(T.get(t).id=r)}}e.edges().forEach(function(t){let r=e.edge(t);n.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),n.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let i=t.v,a=t.w;if(n.debug(`Fix XXX`,T,`ids:`,t.v,t.w,`Translating: `,T.get(t.v),` --- `,T.get(t.w)),T.get(t.v)||T.get(t.w)){if(n.debug(`Fixing and trying - removing XXX`,t.v,t.w,t.name),i=F(t.v),a=F(t.w),e.removeEdge(t.v,t.w,t.name),i!==t.v){let n=e.parent(i);T.get(n).externalConnections=!0,r.fromCluster=t.v}if(a!==t.w){let n=e.parent(a);T.get(n).externalConnections=!0,r.toCluster=t.w}n.debug(`Fix Replacing with XXX`,i,a,t.name),e.setEdge(i,a,r,t.name)}}),L(e,0),n.trace(T)},`adjustClustersAndEdges`),L=t((e,t)=>{if(t>10){n.error(`Bailing out`);return}let r=e.nodes(),i=!1;for(let t of r){let n=e.children(t);i||=n.length>0}if(!i){n.debug(`Done, no node has children`,e.nodes());return}n.debug(`Nodes = `,r,t);for(let i of r)if(n.debug(`Extracting node`,i,T,T.has(i)&&!T.get(i).externalConnections,!e.parent(i),e.node(i),e.children(`D`),` Depth `,t),!T.has(i))n.debug(`Not a cluster`,i,t);else if(!T.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){n.debug(`Cluster without external connections, without a parent and with children`,i,t);let r=e.graph().rankdir===`TB`?`LR`:`TB`;T.get(i)?.clusterData?.dir&&(r=T.get(i).clusterData.dir,n.debug(`Fixing dir`,T.get(i).clusterData.dir,r));let a=new y({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});j(i,e,a,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:T.get(i).clusterData,label:T.get(i).label,graph:a})}else n.debug(`Cluster ** `,i,` **not meeting the criteria !externalConnections:`,!T.get(i).externalConnections,` no parent: `,!e.parent(i),` children `,e.children(i)&&e.children(i).length>0,e.children(`D`),t),n.debug(T);r=e.nodes(),n.debug(`New list of nodes`,r);for(let i of r){let r=e.node(i);n.debug(` Now next level`,i,r),r?.clusterNode&&L(r.graph,t+1)}},`extractor`),R=t((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=R(e,e.children(t));n=[...n,...r]}),n},`sorter`),z=t(e=>R(e,e.children()),`sortNodesByHierarchy`),B=t((e,t,n)=>{let r=e.parent(t);for(;r&&r!==n;){let t=T.get(r);if(t&&!t.externalConnections)return!0;r=e.parent(r)}return!1},`isNodeInExtractableCluster`),V=t((e,t,n)=>{let r=e.children(t)??[];for(let i of r){if(i===n||k(i,n))continue;let r=P(i,e,t);if(r&&!B(e,r,t))return r}return null},`findSafeAnchorNode`);function H({prepareLayout:e,measureLayout:n,runLayoutCore:r,paintLayout:i,afterPaint:a,paintOptions:o}){let s=n??W;return t(async function(t,n,c,l){let u=n.select(`g`);(c?.insertMarkers??m)(u,t.markers,t.type,t.diagramId),U();let d={element:u,helpers:c,options:l};d.preparedLayout=await e?.(t,d);let f=await s(t,d),p=await r(t,d),h={...d,measure:f};i?await i(t,h,p):await G(t,h,o),await a?.(t,h,p)},`render`)}t(H,`createCommonLayoutRenderer`);function U(){u(),ee(),f(),O()}t(U,`clearLayoutRenderState`);async function W(e,{element:t},n){return await w(t,e,n)}t(W,`defaultMeasureLayout`);async function G(e,t,n={}){let{measure:r}=t,{groups:i}=r;for(let r of n.getNodes?.(e,t)??e.nodes)n.skipNode?.(r,t)||await K(i,r,t,n);let a=J(e.nodes);for(let r of e.edges)Y(r,n)||await X(i,r,a,e,n,t)}t(G,`paintLayoutData`);async function K(e,t,n,r){t.clusterNode?s(t):q(t,n,r)?await d(e.clusters,t):s(t)}t(K,`paintLayoutNode`);function q(e,t,n){return e.isGroup===!0&&(n.isCluster?.(e,t)??!0)}t(q,`shouldPaintAsCluster`);function J(e){let t=new Map;for(let n of e)n?.id&&t.set(n.id,n);return t}t(J,`buildNodeLookup`);function Y(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}t(Y,`shouldSkipPaintEdge`);async function X(e,t,n,r,i,a){let o=h(e.edgePaths,{...t},i.clusterDb??new Map,r.type,Z(t.start,t,n,a,i),Z(t.end,t,n,a,i),r.diagramId,Q(t,i));_(t)&&(g.has(t.id)||await p(e.edgeLabels,t),$(t,o))}t(X,`paintLayoutEdge`);function Z(e,t,n,r,i){return i.getEdgeNode?.(e,t,r)??(e?n.get(e)??{}:{})}t(Z,`getRenderedNode`);function Q(e,t){return typeof t.skipIntersect==`function`?t.skipIntersect(e):t.skipIntersect??!1}t(Q,`shouldSkipIntersect`);function $(e,t){let i=t?.updatedPath??t?.originalPath,o=r(),{subGraphTitleTotalMargin:s}=c({flowchart:o.flowchart??{}});if(e.label){let r=g.get(e.id),o=e.x,c=e.y;if(i){let r=a.calcLabelPosition(i);n.debug(`Moving label `+e.label+` from (`,o,`,`,c,`) to (`,r.x,`,`,r.y,`) abc88`),t?.updatedPath&&(o=r.x,c=r.y)}r.attr(`transform`,`translate(${o}, ${c+s/2})`)}if(e?.startLabelLeft){let t=v.get(e.id).startLeft,n=e?.x,r=e?.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.startLabelRight){let t=v.get(e.id).startRight,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.endLabelLeft){let t=v.get(e.id).endLeft,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.endLabelRight){let t=v.get(e.id).endRight,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}}t($,`positionRenderedEdgeLabel`);export{W as a,z as c,b as i,T as n,P as o,H as r,S as s,I as t}; \ No newline at end of file +import{t as e}from"./app-preload-helper.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import{b as r,x as i}from"./app-chunk-O7XYJQB3.js";import{g as a}from"./app-chunk-ZIGJFQKS.js";import{o}from"./app-chunk-7INBJB4K.js";import{i as s,n as c,r as l,t as u}from"./app-chunk-5DYCD2WN.js";import{a as d,c as f,i as p,n as m,r as h,t as g,u as _}from"./app-chunk-Z7XXMR3K.js";import{t as v}from"./app-graphlib.js";import{r as y,t as b}from"./app-chunk-UA2S7LBM.js";function x(e,{edgePathsClass:t=`edges edgePaths`}={}){let n=e.insert(`g`).attr(`class`,`root`);return{clusters:n.insert(`g`).attr(`class`,`clusters`),edgePaths:n.insert(`g`).attr(`class`,t),edgeLabels:n.insert(`g`).attr(`class`,`edgeLabels`),nodes:n.insert(`g`).attr(`class`,`nodes`),rootGroups:n}}t(x,`createLayoutElementGroups`);async function S(e,t,n){if(t.label){let{shapeSvg:r,bbox:i}=await o(e,n===void 0?t:{...t,width:n});t.labelBBox={width:i.width,height:i.height},r.remove()}else t.labelBBox={width:0,height:0}}t(S,`measureGroupLabel`);async function C(e,t,n){let r=await l(e,t,n),i=r.node()?.getBBox()??{width:0,height:0};return t.width=i.width,t.height=i.height,r}t(C,`insertMeasuredNode`);function w(e,t,n){let r=e,i=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||i.has(r.parentId))break;i.add(r.parentId),r=t.get(r.parentId)}return n}t(w,`resolveNodeDir`);async function T(t,n,r={}){let a=new v({multigraph:!0,compound:!0}),o=[...n.edges],s=i(),c=x(t),{edgeLabels:l,nodes:u}=c,f=new Map,p=new Map(n.nodes.map(e=>[e.id,e])),m=n.direction,g=t.node()!=null;await Promise.all(n.nodes.map(async e=>{if(e.isGroup){if(g){let t=r.unwrapGroupLabels&&e.labelType!==`markdown`;await S(u,e,t?1/0:void 0)}a.setNode(e.id,{...e})}else{if(g){let t=await C(u,e,{config:s,dir:w(e,p,m)});f.set(e.id,t)}a.setNode(e.id,{...e})}}));for(let e of o)g&&h(e)&&await d(l,e),a.setEdge(e.start,e.end,{...e},e.id),n.edges.some(t=>t.id===e.id)||n.edges.push(e);if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:r}=await e(async()=>{let{captureNodeSizes:e}=await import(`./app-sizeCapture-INFHLROL.js`);return{captureNodeSizes:e}},__vite__mapDeps([0,1]));r(t,n)}return{graph:a,groups:c,nodeElements:f}}t(T,`createGraphWithElements`);var E=new Map,D=new Map,O=new Map,k=t(()=>{D.clear(),O.clear(),E.clear()},`clear`),A=t((e,t)=>{let r=D.get(t)||[];return n.trace(`In isDescendant`,t,` `,e,` = `,r.includes(e)),r.includes(e)},`isDescendant`),j=t((e,t)=>{let r=D.get(t)||[];return n.info(`Descendants of `,t,` is `,r),n.info(`Edge is `,e),e.v===t||e.w===t?!1:r?r.includes(e.v)||A(e.v,t)||A(e.w,t)||r.includes(e.w):(n.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),M=t((e,t,r,i)=>{n.debug(`Copying children of `,e,`root`,i,`data`,t.node(e),i);let a=t.children(e)||[];e!==i&&a.push(e),n.debug(`Copying (nodes) clusterId`,e,`nodes`,a),a.forEach(a=>{if(t.children(a).length>0)M(a,t,r,i);else{let o=t.node(a);n.info(`cp `,a,` to `,i,` with parent `,e),r.setNode(a,o),i!==t.parent(a)&&(n.debug(`Setting parent`,a,t.parent(a)),r.setParent(a,t.parent(a))),e!==i&&a!==e?(n.debug(`Setting parent`,a,e),r.setParent(a,e)):(n.info(`In copy `,e,`root`,i,`data`,t.node(e),i),n.debug(`Not Setting parent for node=`,a,`cluster!==rootId`,e!==i,`node!==clusterId`,a!==e));let s=t.edges(a);n.debug(`Copying Edges`,s),s.forEach(a=>{n.info(`Edge`,a);let o=t.edge(a.v,a.w,a.name);n.info(`Edge data`,o,i);try{j(a,i)?(n.info(`Copying as `,a.v,a.w,o,a.name),r.setEdge(a.v,a.w,o,a.name),n.info(`newGraph edges `,r.edges(),r.edge(r.edges()[0]))):n.info(`Skipping copy of edge `,a.v,`-->`,a.w,` rootId: `,i,` clusterId:`,e)}catch(e){n.error(e)}})}n.debug(`Removing node`,a),t.removeNode(a)})},`copy`),N=t((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)O.set(i,e),r=[...r,...N(i,t)];return r},`extractDescendants`),P=t((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),F=t((e,t,r)=>{let i=t.children(e);if(n.trace(`Searching children of id `,e,i),i.length<1)return e;let a;for(let e of i){let n=F(e,t,r),i=P(t,r,n);if(n)if(i.length>0)a=n;else return n}return a},`findNonClusterChild`),I=t(e=>!E.has(e)||!E.get(e).externalConnections?e:E.has(e)?E.get(e).id:e,`getAnchorId`),L=t((e,t)=>{if(!e||t>10){n.debug(`Opting out, no graph `);return}n.debug(`Opting in, graph `),e.nodes().forEach(function(t){e.children(t).length>0&&(n.debug(`Cluster identified`,t,` Replacement id in edges: `,F(t,e,t)),D.set(t,N(t,e)),E.set(t,{id:F(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let r=e.children(t),i=e.edges();r.length>0?(n.debug(`Cluster identified`,t,D),i.forEach(e=>{A(e.v,t)^A(e.w,t)&&(n.debug(`Edge: `,e,` leaves cluster `,t),n.debug(`Descendants of XXX `,t,`: `,D.get(t)),E.get(t).externalConnections=!0)})):n.debug(`Not a cluster `,t,D)});for(let t of E.keys()){let n=E.get(t).id,r=e.parent(n);r!==t&&E.has(r)&&!E.get(r).externalConnections&&(E.get(t).id=r);let i=e.edges().some(e=>e.v===t);if(n&&E.get(t)?.externalConnections&&i&&V(e,n,t)){let r=ee(e,t,e.parent(n));r&&(E.get(t).id=r)}}e.edges().forEach(function(t){let r=e.edge(t);n.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),n.debug(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let i=t.v,a=t.w;if(n.debug(`Fix XXX`,E,`ids:`,t.v,t.w,`Translating: `,E.get(t.v),` --- `,E.get(t.w)),E.get(t.v)||E.get(t.w)){if(n.debug(`Fixing and trying - removing XXX`,t.v,t.w,t.name),i=I(t.v),a=I(t.w),e.removeEdge(t.v,t.w,t.name),i!==t.v){let n=e.parent(i);E.get(n).externalConnections=!0,r.fromCluster=t.v}if(a!==t.w){let n=e.parent(a);E.get(n).externalConnections=!0,r.toCluster=t.w}n.debug(`Fix Replacing with XXX`,i,a,t.name),e.setEdge(i,a,r,t.name)}}),R(e,0),n.trace(E)},`adjustClustersAndEdges`),R=t((e,t)=>{if(t>10){n.error(`Bailing out`);return}let r=e.nodes(),i=!1;for(let t of r){let n=e.children(t);i||=n.length>0}if(!i){n.debug(`Done, no node has children`,e.nodes());return}n.debug(`Nodes = `,r,t);for(let i of r)if(n.debug(`Extracting node`,i,E,E.has(i)&&!E.get(i).externalConnections,!e.parent(i),e.node(i),e.children(`D`),` Depth `,t),!E.has(i))n.debug(`Not a cluster`,i,t);else if(!E.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){n.debug(`Cluster without external connections, without a parent and with children`,i,t);let r=e.graph().rankdir===`TB`?`LR`:`TB`;E.get(i)?.clusterData?.dir&&(r=E.get(i).clusterData.dir,n.debug(`Fixing dir`,E.get(i).clusterData.dir,r));let a=new v({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});M(i,e,a,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:E.get(i).clusterData,label:E.get(i).label,graph:a})}else n.debug(`Cluster ** `,i,` **not meeting the criteria !externalConnections:`,!E.get(i).externalConnections,` no parent: `,!e.parent(i),` children `,e.children(i)&&e.children(i).length>0,e.children(`D`),t),n.debug(E);r=e.nodes(),n.debug(`New list of nodes`,r);for(let i of r){let r=e.node(i);n.debug(` Now next level`,i,r),r?.clusterNode&&R(r.graph,t+1)}},`extractor`),z=t((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=z(e,e.children(t));n=[...n,...r]}),n},`sorter`),B=t(e=>z(e,e.children()),`sortNodesByHierarchy`),V=t((e,t,n)=>{let r=e.parent(t);for(;r&&r!==n;){let t=E.get(r);if(t&&!t.externalConnections)return!0;r=e.parent(r)}return!1},`isNodeInExtractableCluster`),ee=t((e,t,n)=>{let r=e.children(t)??[];for(let i of r){if(i===n||A(i,n))continue;let r=F(i,e,t);if(r&&!V(e,r,t))return r}return null},`findSafeAnchorNode`);function H({prepareLayout:e,measureLayout:n,runLayoutCore:r,paintLayout:i,afterPaint:a,paintOptions:o}){let s=n??W;return t(async function(t,n,c,l){let u=n.select(`g`);(c?.insertMarkers??f)(u,t.markers,t.type,t.diagramId),U();let d={element:u,helpers:c,options:l};d.preparedLayout=await e?.(t,d);let p=await s(t,d),m=await r(t,d),h={...d,measure:p};i?await i(t,h,m):await G(t,h,o),await a?.(t,h,m)},`render`)}t(H,`createCommonLayoutRenderer`);function U(){u(),g(),b(),k()}t(U,`clearLayoutRenderState`);async function W(e,{element:t},n){return await T(t,e,n)}t(W,`defaultMeasureLayout`);async function G(e,t,n={}){let{measure:r}=t,{groups:i}=r;for(let r of n.getNodes?.(e,t)??e.nodes)n.skipNode?.(r,t)||await K(i,r,t,n);let a=J(e.nodes);for(let r of e.edges)Y(r,n)||await X(i,r,a,e,n,t)}t(G,`paintLayoutData`);async function K(e,t,n,r){t.clusterNode?s(t):q(t,n,r)?await y(e.clusters,t):s(t)}t(K,`paintLayoutNode`);function q(e,t,n){return e.isGroup===!0&&(n.isCluster?.(e,t)??!0)}t(q,`shouldPaintAsCluster`);function J(e){let t=new Map;for(let n of e)n?.id&&t.set(n.id,n);return t}t(J,`buildNodeLookup`);function Y(e,t){return e.isLayoutOnly||!!t.skipEdge?.(e)}t(Y,`shouldSkipPaintEdge`);async function X(e,t,n,r,i,a){let o=p(e.edgePaths,{...t},i.clusterDb??new Map,r.type,Z(t.start,t,n,a,i),Z(t.end,t,n,a,i),r.diagramId,Q(t,i));h(t)&&(m.has(t.id)||await d(e.edgeLabels,t),$(t,o))}t(X,`paintLayoutEdge`);function Z(e,t,n,r,i){return i.getEdgeNode?.(e,t,r)??(e?n.get(e)??{}:{})}t(Z,`getRenderedNode`);function Q(e,t){return typeof t.skipIntersect==`function`?t.skipIntersect(e):t.skipIntersect??!1}t(Q,`shouldSkipIntersect`);function $(e,t){let i=t?.updatedPath??t?.originalPath,o=r(),{subGraphTitleTotalMargin:s}=c({flowchart:o.flowchart??{}});if(e.label){let r=m.get(e.id),o=e.x,c=e.y;if(i){let r=a.calcLabelPosition(i);n.debug(`Moving label `+e.label+` from (`,o,`,`,c,`) to (`,r.x,`,`,r.y,`) abc88`),t?.updatedPath&&(o=r.x,c=r.y)}r.attr(`transform`,`translate(${o}, ${c+s/2})`)}if(e?.startLabelLeft){let t=_.get(e.id).startLeft,n=e?.x,r=e?.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.startLabelRight){let t=_.get(e.id).startRight,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.endLabelLeft){let t=_.get(e.id).endLeft,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}if(e.endLabelRight){let t=_.get(e.id).endRight,n=e.x,r=e.y;if(i){let t=a.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,i);n=t.x,r=t.y}t.attr(`transform`,`translate(${n}, ${r})`)}}t($,`positionRenderedEdgeLabel`);export{W as a,B as c,x as i,E as n,F as o,H as r,C as s,L as t}; \ No newline at end of file diff --git a/web/dist/app-chunk-7INBJB4K.js b/web/dist/app-chunk-7INBJB4K.js index 1066e2439..529c81f17 100644 --- a/web/dist/app-chunk-7INBJB4K.js +++ b/web/dist/app-chunk-7INBJB4K.js @@ -1,31 +1,31 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{A as r,B as i,M as a,T as o,b as s,f as c,g as l,x as u,z as d}from"./app-chunk-O7XYJQB3.js";import{a as f,p,r as m,u as h}from"./app-chunk-ZIGJFQKS.js";import{a as g,i as _,r as v,t as y}from"./app-chunk-7PRAP22T.js";import{n as b,t as x}from"./app-chunk-742MDFTN.js";import{n as S,r as C}from"./app-chunk-MBY4JIJT.js";import{s as w}from"./app-chunk-J5ZVWO5B.js";import{t as T}from"./app-rough.esm.js";var E=1,D=3;async function O(t){let n=t.getElementsByTagName(`img`);if(!n||n.length===0)return;let r=!k(t);await Promise.all([...n].map(t=>new Promise(n=>{function i(){if(t.style.display=`flex`,t.style.flexDirection=`column`,r){let e=u().fontSize?u().fontSize:window.getComputedStyle(document.body).fontSize,[n=c.fontSize]=p(e),r=n*5+`px`;t.style.minWidth=r,t.style.maxWidth=r}else t.style.width=`100%`;n(t)}e(i,`setupImage`),setTimeout(()=>{t.complete&&i()}),t.addEventListener(`error`,i),t.addEventListener(`load`,i)})))}e(O,`configureLabelImages`);function k(e){return e.nodeType===D?e.textContent?.trim()!==``:e.nodeType!==E||e.tagName.toLowerCase()===`img`?!1:[...e.childNodes].some(k)}e(k,`hasTextBesidesImages`);var A=3,j=32,M=e(async(e,t,r)=>{let i=u(),a=e.insert(`g`).attr(`class`,r??`node default`).attr(`id`,t.domId||t.id),o=a.insert(`g`).attr(`class`,`label`).attr(`style`,h(t.labelStyle)),s=[{text:typeof t.label==`string`?t.label:t.label?.[0]??``,cssClass:`c4-name`},{text:t.stereotype,cssClass:`c4-type`},...(t.description??[]).map(e=>({text:e,cssClass:`c4-descr`}))].filter(e=>e.text),c=t.width?Math.max(t.width-2*(t.padding??0),j):u().flowchart?.wrappingWidth??200,l=i.c4?.wrap??!0?c:1/0,p=await Promise.all(s.map(async e=>{let r=o.append(`g`).attr(`class`,e.cssClass),a=await S(r,d(f(e.text??``),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:l,style:t.labelStyle},i);return n(a).selectAll(`tspan.text-outer-tspan`).attr(`text-anchor`,`middle`),n(a).selectAll(`tspan.text-inner-tspan`).attr(`font-weight`,null).attr(`font-style`,null),{el:r,box:r.node().getBBox()}})),m=Math.max(...p.map(({box:e})=>e.width),0),g=0;for(let{el:e,box:t}of p)e.attr(`transform`,`translate(${m/2-t.x-t.width/2}, ${g-t.y})`),g+=t.height+A;let _=p.length>0?g-A:0;return o.insert(`rect`,`:first-child`),o.attr(`transform`,`translate(${-m/2}, ${-_/2})`),{shapeSvg:a,bbox:o.node().getBBox(),halfPadding:(t.padding??0)/2,label:o}},`c4LabelHelper`),N=e((t,n)=>{let{x:r,y:i,width:a,height:o}=t;return a>=n?t:`left`in t?{x:r,y:i,width:n,height:o,top:i,left:r,bottom:i+o,right:r+n,toJSON:e(()=>({}),`toJSON`)}:{x:r-(n-a)/2,y:i,width:n,height:o}},`withMinWidth`),P=e(async(e,t,r)=>{if(t.stereotype!==void 0)return M(e,t,r);let i,a=t.useHtmlLabels||l(u()?.htmlLabels);i=r||`node default`;let o=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),s=o.insert(`g`).attr(`class`,`label`).attr(`style`,h(t.labelStyle)),c;c=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let p=!!t.icon||!!t.img,m=t.labelType===`markdown`,g=c&&!t.width?t.minWidth??0:0,_=await S(s,d(f(c),u()),{useHtmlLabels:a,width:t.width||t.wrappingWidth||u().flowchart?.wrappingWidth,minWidth:g,classes:m?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:p,markdown:m},u()),v=(t?.padding??0)/2,y;if(a){let e=_.children[0],t=n(_);await O(e),y=await C.measure(()=>e.getBoundingClientRect()),y=N(y,g),t.attr(`width`,y.width),t.attr(`height`,y.height)}else y=await C.measure(()=>_.getBBox()),y=N(y,g);return a?s.attr(`transform`,`translate(`+-y.width/2+`, `+-y.height/2+`)`):s.attr(`transform`,`translate(0, `+-y.height/2+`)`),t.centerLabel&&s.attr(`transform`,`translate(`+-y.width/2+`, `+-y.height/2+`)`),s.insert(`rect`,`:first-child`),{shapeSvg:o,bbox:y,halfPadding:v,label:s}},`labelHelper`),F=e(async(e,t,r)=>{let i=r.useHtmlLabels??o(u()),a=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await S(a,d(f(t),u()),{useHtmlLabels:i,width:r.width||u()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),c=r.padding/2,l;if(o(u())){let e=s.children[0],t=n(s);l=await C.measure(()=>e.getBoundingClientRect()),t.attr(`width`,l.width),t.attr(`height`,l.height)}else l=await C.measure(()=>s.getBBox());return i?a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`):a.attr(`transform`,`translate(0, `+-l.height/2+`)`),r.centerLabel&&a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`),a.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:l,halfPadding:c,label:a}},`insertLabel`),I=e((e,t,n)=>{if(n){e.width=n.width,e.height=n.height;return}let r=t.node().getBBox();e.width=r.width,e.height=r.height},`updateNodeBounds`),L=e((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function R(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}e(R,`createPathFromPoints`);function z(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}e(z,`generateFullSineWavePoints`);function B(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;ie.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=e((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}e(ee,`mergePaths`);var V=e((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`);function te(e,t){return e.intersect(t)}e(te,`intersectNode`);var H=te;function U(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x0}e(G,`sameSign`);var ae=W;function oe(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),se=e(async(e,t,n,r=!1,i=!1)=>{let a=t||``;typeof a==`object`&&(a=a[0]);let s=u(),c=o(s);return await S(e,a,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`);function ce(e,n){let{labelStyles:r}=_(n);n.labelStyle=r;let i=L(n),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=T.svg(o),l=g(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,h(s)),I(n,d),n.intersect=function(e){return t.info(`Circle intersect`,n,1,e),K.circle(n,1,e)},o}e(ce,`anchor`);function le(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}e(le,`generateArcPoints`);function ue(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}e(ue,`calculateArcSagitta`);async function de(t,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=e(e=>e+s,`calcTotalHeight`),l=e(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await P(t,n,L(n)),f=c(n?.height?n?.height:d.height),[p,m]=l(f),h=ue(f,p,m),v=(n?.width?n?.width:d.width)+o*2+h-h,y=f,{cssStyles:b}=n,x=[{x:v/2,y:-y/2},{x:-v/2,y:-y/2},...le(-v/2,-y/2,-v/2,y/2,p,m,!1),{x:v/2,y:y/2},...le(v/2,y/2,v/2,-y/2,p,m,!0)],S=T.svg(u),C=g(n,{});n.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let w=R(x),E=S.path(w,C),D=u.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),b&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,b),i&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,i),D.attr(`transform`,`translate(${p/2}, 0)`),I(n,D),n.intersect=function(e){return K.polygon(n,x,e)},u}e(de,`bowTieRect`);async function fe(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=_(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await P(t,n,L(n)),l=r?.nodeBorder??r?.lineColor??`currentColor`,u=n.padding??12,d=Math.max(s.width+u*2,n.width??0,80),f=Math.max(Math.min(d*.08,12),5),p=Math.max(s.height+u*2+f,n.height??0),m=-p/2+f,h=p/2,v=d*.72,y=[`M${-d/2},${m}`,`L${-v/2},${h}`,`A${v/2},${f} 0 0 0 ${v/2},${h}`,`L${d/2},${m}`,`A${d/2},${f} 0 0 0 ${-d/2},${m}`,`Z`].join(` `),{cssStyles:b}=n,x=o.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(n.look===`handDrawn`){let e=T.svg(o).path(y,g(n,{}));x.node()?.appendChild(e),b&&x.attr(`style`,b)}else x.append(`path`).attr(`d`,y).attr(`style`,a);x.append(`ellipse`).attr(`cx`,0).attr(`cy`,m).attr(`rx`,d/2).attr(`ry`,f).attr(`style`,`fill:none;stroke:${l};stroke-width:1px`),I(n,x);let S=m+(h-m)/2;c.attr(`transform`,`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${S-s.height/2-(s.y-(s.top??0))})`);let C=e((e,t,n)=>Array.from({length:13},(r,i)=>{let a=Math.PI-i*Math.PI/12;return{x:e*Math.cos(a),y:t+n*f*Math.sin(a)}}),`arc`),w=[...C(d/2,m,-1),...C(v/2,h,1).reverse()];return n.intersect=function(e){return K.polygon(n,w,e)},o}e(fe,`bucket`);var pe=20,me=8,he=80,ge=8;function _e(e){let{themeVariables:t}=u(),n=t.clusterBkg,r=t.clusterBorder;switch(e){case`flow`:return{rx:10,fill:`none`,stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:`flow-collapsed`};default:return{rx:ge,fill:n,stroke:r,cssClass:`collapsed-group`}}}e(_e,`getCollapsedStyle`);async function ve(e,t){let n=_e(t.metadata?.containerType),{fill:r,stroke:i}=n,{nodeStyles:a}=_(t),{shapeSvg:s,bbox:c}=await P(e,t,L(t)),{theme:l,themeVariables:d}=u();w(s,t.colorIndex,l,d.borderColorArray);let f=t.padding??8,p=c.height,m=Math.max(c.width+f*2,he,t?.width??0),v=Math.max(p+me+pe+f*2,t?.height??0),y=-m/2,b=-v/2,x=-(me+pe)/2,S=s.select(`.label`);S&&(t.useHtmlLabels??o(u())?S.attr(`transform`,`translate(${-c.width/2}, ${-c.height/2+x})`):S.attr(`transform`,`translate(0, ${-c.height/2+x})`));let C;if(t.look===`handDrawn`){let e=T.svg(s),a=g(t,{fill:r,stroke:i,...n.strokeWidth===void 0?{}:{strokeWidth:n.strokeWidth},...r===`none`?{fillWeight:0}:{fillStyle:`solid`}}),o=e.path(q(y,b,m,v,n.rx),a);C=s.insert(()=>o,`:first-child`),C.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,h(t.cssStyles))}else C=s.insert(`rect`,`:first-child`),C.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,a).attr(`rx`,n.rx).attr(`ry`,n.rx).attr(`x`,y).attr(`y`,b).attr(`width`,m).attr(`height`,v).attr(`fill`,r).attr(`stroke`,i),n.strokeWidth!==void 0&&C.attr(`stroke-width`,n.strokeWidth+`px`);let E=b+f+p+me;s.append(`line`).attr(`class`,`collapsed-separator`).attr(`x1`,y+8).attr(`y1`,E).attr(`x2`,y+m-8).attr(`y2`,E).attr(`stroke`,i).attr(`stroke-dasharray`,`3, 3`);let D=E+pe/2;for(let e=-1;e<=1;e++)s.append(`circle`).attr(`class`,`collapsed-indicator`).attr(`cx`,e*10).attr(`cy`,D).attr(`r`,2.5).attr(`fill`,i);return I(t,C),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},s}e(ve,`collapsedGroup`);function J(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}e(J,`insertPolygonShape`);var ye=[`right`,`left`,`up`,`down`],be=`point`,xe=e(e=>{let t=new Set;for(let n of e)switch(n){case`x`:t.add(`right`),t.add(`left`);break;case`y`:t.add(`up`),t.add(`down`);break;default:t.add(n)}return t},`expandAndDeduplicateDirections`),Se=e(e=>ye.filter(t=>e.has(t)).join(`|`)||be,`getDirectionKey`),Ce={"right|left|up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*n},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*n,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*n},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*n,y:-e/2},{x:0,y:-e/3}],`right|left|up|down`),"right|left|up":e(({height:e,midpoint:t,width:n})=>[{x:t,y:0},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],`right|left|up`),"right|left|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:t,y:-e},{x:n-t,y:-e},{x:n,y:0}],`right|left|down`),"right|up|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:n,y:-e+t},{x:0,y:-e}],`right|up|down`),"left|up|down":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:n,y:-e}],`left|up|down`),"right|left":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`right|left`),"up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`up|down`),"right|up":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:0,y:-e}],`right|up`),"right|down":e(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],`right|down`),"left|up":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:n,y:-e}],`left|up`),"left|down":e(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],`left|down`),right:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e+n}],`right`),left:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`left`),up:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n}],`up`),down:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`down`),[be]:()=>[{x:0,y:0}]},we=e((e,t,n,r)=>{let i=xe(e),a=(n.padding??0)/2,o=t.height+4*a,s=o/2,c=r??t.width+2*s+2*a;return(Ce[Se(i)]??Ce[be])({height:o,midpoint:s,padding:a,width:c})},`getArrowPoints`);async function Te(e,t){let n=t,{shapeSvg:r,bbox:i}=await P(e,n,L(n)),a=n.padding??0,o=i.height+2*a,s=o/2,c=i.width+2*s+a,l=n.width??0,u=n.positioned&&(n.widthInColumns??1)>1&&l>c?l:c,d=we(n.directions??[],i,n,u),f=J(r,u,o,d);return f.attr(`style`,n.style??null),I(n,f),n.intersect=function(e){return K.polygon(n,d,e)},r}e(Te,`block_arrow`);async function Ee(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await P(e,t,L(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+18,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=T.svg(a).path(q(-u/2,f,u,d,12),g(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`line`).attr(`x1`,-u/2).attr(`y1`,f+18).attr(`x2`,u/2).attr(`y2`,f+18).attr(`style`,`stroke:${c};stroke-width:1px`);for(let e=0;e<3;e++)m.append(`circle`).attr(`cx`,-u/2+12+e*9).attr(`cy`,f+18/2).attr(`r`,2.5).attr(`style`,`fill:${c};stroke:none`);m.append(`rect`).attr(`class`,`browser-address-bar`).attr(`x`,-u/2+44).attr(`y`,f+4).attr(`width`,Math.max(u-56,10)).attr(`height`,10).attr(`rx`,3).attr(`ry`,3).attr(`style`,`fill:none;stroke:${c};stroke-width:1px;opacity:0.6`),I(t,m);let h=f+18+(d-18)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Ee,`browser`);var De=12;async function Oe(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+De),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+De,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+De},{x:0+De,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=g(t,{}),r=R(p),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=J(s,l,u,p);return r&&m.attr(`style`,r),I(t,m),t.intersect=function(e){return K.polygon(t,p,e)},s}e(Oe,`card`);function ke(e,t){let{nodeStyles:n}=_(t);t.label=``;let r=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=T.svg(r),c=g(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=R(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return K.polygon(t,o,e)},r}e(ke,`choice`);async function Ae(e,n,r){let{labelStyles:i,nodeStyles:a}=_(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await P(e,n,L(n)),l=r?.padding??c,u=Math.sqrt(s.width**2+s.height**2)/2,d=n.look===`neo`?u+32:u+l,f,{cssStyles:p}=n;if(n.look===`handDrawn`){let e=T.svg(o),t=g(n,{}),r=e.circle(0,0,d*2,t);f=o.insert(()=>r,`:first-child`),f.attr(`class`,`basic label-container`).attr(`style`,h(p))}else f=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,d).attr(`cx`,0).attr(`cy`,0);return I(n,f),n.calcIntersect=function(e,t){let n=e.width/2;return K.circle(e,n,t)},n.intersect=function(e){return t.info(`Circle intersect`,n,d,e),K.circle(n,d,e)},o}e(Ae,`circle`);async function je(e,t){let n=t,{shapeSvg:r,bbox:i,halfPadding:a}=await P(e,n,[`node`,n.cssClasses,n.class].filter(Boolean).join(` `)),o=r.insert(`rect`,`:first-child`),s=n.padding??0,c=n.positioned?n.width??0:i.width+s,l=n.positioned?n.height??0:i.height+s,u=n.positioned?-c/2:-i.width/2-a,d=n.positioned?-l/2:-i.height/2-a;return o.attr(`class`,`basic cluster composite label-container`).attr(`style`,n.style??null).attr(`rx`,n.rx??null).attr(`ry`,n.ry??null).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l),I(n,o),n.intersect=function(e){return K.rect(n,e)},r}e(je,`composite`);async function Me(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await P(e,t,L(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+20,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=T.svg(a).path(q(-u/2,f,u,d,12),g(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`text`).attr(`x`,-u/2+12).attr(`y`,f+16).attr(`class`,`console-glyph`).attr(`style`,`font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(`>_`),I(t,m);let h=f+20+(d-20)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Me,`consoleWindow`);function Ne(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y} - M ${i.x},${i.y} L ${o.x},${o.y}`}e(Ne,`createLine`);function Pe(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r,n.label=``;let a=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),o=Math.max(30,n?.width??0),{cssStyles:s}=n,c=T.svg(a),l=g(n,{});n.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=Ne(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),s&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,s),i&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,i),I(n,p),n.intersect=function(e){return t.info(`crossedCircle intersect`,n,{radius:o,point:e}),K.circle(n,o,e)},a}e(Pe,`crossedCircle`);function Y(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;iS,`:first-child`).attr(`stroke-opacity`,0),C.insert(()=>b,`:first-child`),C.attr(`class`,`text`),f&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),C.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Fe,`curlyBraceLeft`);function X(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;iS,`:first-child`).attr(`stroke-opacity`,0),C.insert(()=>b,`:first-child`),C.attr(`class`,`text`),f&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),C.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Ie,`curlyBraceRight`);function Z(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;iE,`:first-child`).attr(`stroke-opacity`,0),D.insert(()=>x,`:first-child`),D.insert(()=>C,`:first-child`),D.attr(`class`,`text`),f&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,D),t.intersect=function(e){return K.polygon(t,h,e)},i}e(Le,`curlyBraces`);async function Re(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(5,c.height+o*2,t?.height??0),u=l/2,d=u-Math.sqrt(Math.max(0,u**2-(c.height/2)**2)),f=Math.max(l/4,d),p=Math.max(20,c.width+a*2+f*2,(c.width+a*2)*1.25,t?.width??0),{cssStyles:m}=t,h=T.svg(s),v=g(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=p,b=l,x=y-u,S=b/4,C=[{x,y:0},{x:S,y:0},{x:0,y:b/2},{x:S,y:b},{x,y:b},...B(-x,-b/2,u,50,270,90)],w=R(C),E=h.path(w,v),D=s.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&D.selectChildren(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&D.selectChildren(`path`).attr(`style`,r),D.attr(`transform`,`translate(${-p/2}, ${-l/2})`),I(t,D),t.intersect=function(e){return K.polygon(t,C,e)},s}e(Re,`curvedTrapezoid`);async function ze(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??20,c=Math.max(a.width+s*2,t.width??0,100),l=Math.min(Math.max(c*.23,16),56),u=l*.27,d=Math.max(a.height+s*2,t.height?t.height-(2*l-u):0),f=Math.min(c*.177,d*.45),p=d+2*l-u,m=-p/2,h=m+2*l-u,v=i.insert(`g`,`:first-child`).attr(`class`,`basic label-container`),{cssStyles:y}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=g(t,{}),r=e.path(q(-c/2,h,c,d,f),n),a=e.circle(0,m+l,l*2,n);v.insert(()=>a,`:first-child`),v.insert(()=>r,`:first-child`),y&&v.attr(`style`,y)}else v.append(`rect`).attr(`x`,-c/2).attr(`y`,h).attr(`width`,c).attr(`height`,d).attr(`rx`,f).attr(`ry`,f).attr(`style`,r),v.append(`circle`).attr(`cx`,0).attr(`cy`,m+l).attr(`r`,l).attr(`style`,r);I(t,v);let b=h+d/2;o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${b-a.height/2-(a.y-(a.top??0))})`);let x=m+l,S=Math.asin(Math.min(1,(h-x)/l))*180/Math.PI,C=[...B(0,-x,l,24,180+S,-S),...B(-(-c/2+f),-(h+f),f,12,90,0),...B(-(-c/2+f),-(p/2-f),f,12,360,270),...B(-(c/2-f),-(p/2-f),f,12,270,180),...B(-(c/2-f),-(h+f),f,12,180,90)];return t.intersect=function(e){return K.polygon(t,C,e)},i}e(ze,`person`);var Be=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),Ve=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),He=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Ue=8,We=8;async function Ge(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i,s=t.width??0;if(t.width&&(t.width-=o,t.widtho,`:first-child`),v=c.insert(()=>a,`:first-child`),v.attr(`class`,`basic label-container`),y&&v.attr(`style`,y)}else{let e=Be(0,0,d,m,f,p);v=c.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,h(y)).attr(`style`,r)}return v.attr(`label-offset-y`,p),v.attr(`transform`,`translate(${-d/2}, ${-(m/2+p)})`),I(t,v),u.attr(`transform`,`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(f!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-p)){let i=p*p*(1-r*r/(f*f));i>0&&(i=Math.sqrt(i)),i=p-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},c}e(Ge,`cylinder`);async function Ke(e,t,n){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await P(e,t,L(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:f,ry:p}=t,{cssStyles:m}=t;if(n?.rx&&n.ry&&(f=n.rx,p=n.ry),t.look===`handDrawn`){let e=T.svg(a),n=g(t,{}),r=f||p?e.path(q(l,u,s,c,f||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,h(m))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,h(f)).attr(`ry`,h(p)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return I(t,d,t.look===`handDrawn`?void 0:{width:s,height:c}),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},a}e(Ke,`drawRect`);async function qe(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await Ke(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=T.svg(c),n=g(t,{}),r=c.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return c;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return c;return c.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),c.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),c}let l=c.select(`.basic.label-container`),u=(Number(l.attr(`width`))||o)??0,d=(Number(l.attr(`height`))||s)??0;return u>0&&d>0&&l.attr(`stroke-dasharray`,`${u} ${d}`),c}e(qe,`datastore`);async function Je(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:m}=t,h=T.svg(o),v=g(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],b=h.polygon(y.map(e=>[e.x,e.y]),v),x=o.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(t.padding??0)/2-(s.y-(s.top??0))})`),I(t,x),t.intersect=function(e){return K.rect(t,e)},o}e(Je,`dividedRectangle`);async function Ye(e,n){let{labelStyles:r,nodeStyles:i}=_(n),a=n.look===`neo`?12:5;n.labelStyle=r;let o=n.padding??0,s=n.look===`neo`?16:o,{shapeSvg:c,bbox:l}=await P(e,n,L(n)),u=Math.sqrt(l.width**2+l.height**2)/2,d=(n?.width?n?.width/2:u)+(s??0),f=d+a,p,{cssStyles:m}=n;if(n.look===`handDrawn`){let e=T.svg(c),t=g(n,{roughness:.2,strokeWidth:2.5}),r=g(n,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,f*2,t),a=e.circle(0,0,d*2,r);p=c.insert(`g`,`:first-child`),p.attr(`class`,h(n.cssClasses)).attr(`style`,h(m)),p.node()?.appendChild(i),p.node()?.appendChild(a)}else{p=c.insert(`g`,`:first-child`);let e=p.insert(`circle`,`:first-child`),t=p.insert(`circle`);p.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,f).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return I(n,p),n.intersect=function(e){return t.info(`DoubleCircle intersect`,n,f,e),K.circle(n,f,e)},c}e(Ye,`doublecircle`);async function Xe(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o}=await P(e,t,L(t)),{theme:s,themeVariables:c}=u();w(i,t.colorIndex,s,c.borderColorArray);let l=o??10,d=a.width/2+l*2,f=a.height/2+l*2,p,{cssStyles:m}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=g(t,{}),r=e.ellipse(0,0,d*2,f*2,n);p=i.insert(()=>r,`:first-child`),p.attr(`class`,`basic label-container`),m&&p.attr(`style`,m)}else p=i.insert(`ellipse`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,r).attr(`rx`,d).attr(`ry`,f).attr(`cx`,0).attr(`cy`,0);return t.width=d*2,t.height=f*2,I(t,p),t.calcIntersect=function(e,t){let n=e.width/2,r=e.height/2;return K.ellipse(e,n,r,t)},t.intersect=function(e){return K.ellipse(t,d,f,e)},i}e(Xe,`usecaseEllipse`);function Ze(e,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=_(n);n.label=``,n.labelStyle=i;let o=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),{cssStyles:s}=n,c=T.svg(o),{nodeBorder:l}=r,u=g(n,{fillStyle:`solid`});n.look!==`handDrawn`&&(u.roughness=0);let d=c.circle(0,0,14,u),f=o.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),s&&s.length>0&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,s),a&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,a),I(n,f),n.intersect=function(e){return t.info(`filledCircle intersect`,n,{radius:7,point:e}),K.circle(n,7,e)},o}e(Ze,`filledCircle`);var Qe=10,$e=10;async function et(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.height=n?.height??0,n.heightb,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return m&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,m),i&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,i),n.width=u,n.height=d,I(n,x),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-d/2+(n.padding??0)/2+(c.y-(c.top??0))})`),n.intersect=function(e){return t.info(`Triangle intersect`,n,p,e),K.polygon(n,p,e)},s}e(et,`flippedTriangle`);async function tt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??12,c=Math.max(a.width+s*2,t.width??0,90),l=a.height+s*2,u=Math.max(Math.min(l*.16,14),8),d=Math.max(l+u,t.height??0),f=d-u,p=Math.max(c*.38,28),m=-d/2,h=[{x:-c/2,y:m},{x:-c/2+p,y:m},{x:-c/2+p,y:m+u},{x:c/2,y:m+u},{x:c/2,y:d/2},{x:-c/2,y:d/2}],v=[`M${h[0].x},${h[0].y}`,...h.slice(1).map(e=>`L${e.x},${e.y}`),`Z`].join(` `),{cssStyles:y}=t,b;if(t.look===`handDrawn`){let e=T.svg(i).path(v,g(t,{}));b=i.insert(()=>e,`:first-child`).attr(`class`,`basic label-container`),y&&b.attr(`style`,y)}else b=i.insert(`path`,`:first-child`).attr(`d`,v).attr(`class`,`basic label-container`).attr(`style`,r);t.look===`handDrawn`?I(t,b):I(t,b,{width:c,height:d});let x=m+u+f/2;return o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${x-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(e){return K.polygon(t,h,e)},i}e(tt,`folder`);function nt(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=_(t);t.label=``;let o=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);(n===`LR`||n===`RL`)&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=T.svg(o),p=g(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=f.rectangle(u,d,c,l,p),h=o.insert(()=>m,`:first-child`);s&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,a),I(t,h);let v=r?.padding??0;return t.width&&t.height&&(t.width+=v/2||0,t.height+=v/2||0),t.intersect=function(e){return K.rect(t,e)},o}e(nt,`forkJoin`);async function rt(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.look===`neo`?16:n.padding??0,o=n.look===`neo`?12:n.padding??0;(n.width||n.height)&&(n.height=(n?.height??0)-o*2,n.height<10&&(n.height=10),n.width=(n?.width??0)-a*2,n.width<15&&(n.width=15));let{shapeSvg:s,bbox:c}=await P(e,n,L(n)),l=(n?.height?n?.height:Math.max(10,c.height))+o*2,u=l/2,d=u-Math.sqrt(Math.max(0,u**2-(c.height/2)**2)),f=(n?.width?n?.width:Math.max(15,c.width)+d*2)+a*2,{cssStyles:p}=n,m=T.svg(s),h=g(n,{});n.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let v=[{x:-f/2,y:-l/2},{x:f/2-u,y:-l/2},...B(-f/2+u,0,u,50,90,270),{x:f/2-u,y:l/2},{x:-f/2,y:l/2}],y=R(v),b=m.path(y,h),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),p&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,p),i&&n.look!==`handDrawn`&&x.selectChildren(`path`).attr(`style`,i),I(n,x),n.intersect=function(e){return t.info(`Pill intersect`,n,{radius:u,point:e}),K.polygon(n,v,e)},s}e(rt,`halfRoundedRectangle`);var it=e((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function at(e,t){let{labelStyles:n,nodeStyles:r}=_(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await P(e,t,L(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,f=(t?.width?t?.width:l.width)+2*d+s,p=[{x:d,y:0},{x:f-d,y:0},{x:f,y:-u/2},{x:f-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=T.svg(c),n=g(t,{}),r=it(0,0,f,u,d),i=e.path(r,n);m=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-f/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=J(c,f,u,p);return r&&m.attr(`style`,r),t.width=f,t.height=u,I(t,m),t.intersect=function(e){return K.polygon(t,p,e)},c}e(at,`hexagon`);async function ot(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.label=``,n.labelStyle=r;let{shapeSvg:a}=await P(e,n,L(n)),o=Math.max(30,n?.width??0),s=Math.max(30,n?.height??0),{cssStyles:c}=n,l=T.svg(a),u=g(n,{});n.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],f=R(d),p=l.path(f,u),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container outer-path`),c&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,c),i&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,i),m.attr(`transform`,`translate(${-o/2}, ${-s/2})`),I(n,m),n.intersect=function(e){return t.info(`Pill intersect`,n,{points:d}),K.polygon(n,d,e)},a}e(ot,`hourglass`);async function st(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await P(e,n,`icon-shape default`),p=n.pos===`t`,m=c,h=c,{nodeBorder:v}=r,{stylesMap:b}=y(n),S=-h/2,C=-m/2,w=n.label?8:0,E=T.svg(u),D=g(n,{stroke:`none`,fill:`none`});n.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(S,C,h,m,D),k=Math.max(h,d.width),A=m+d.height+w,j=E.rectangle(-k/2,-A/2,k,A,{...D,fill:`transparent`,stroke:`none`}),M=u.insert(()=>O,`:first-child`),N=u.insert(()=>j);if(n.icon){let e=u.append(`g`);e.html(`${await x(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+w/2-i/2-o:-d.height/2-w/2-i/2-o})`),e.attr(`style`,`color: ${b.get(`stroke`)??v};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-A/2:A/2-d.height})`),M.attr(`transform`,`translate(0,${p?d.height/2+w/2:-d.height/2-w/2})`),I(n,N),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=p?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+w},{x:r+h/2,y:i-a/2+d.height+w},{x:r+h/2,y:i+a/2},{x:r-h/2,y:i+a/2},{x:r-h/2,y:i-a/2+d.height+w},{x:r-d.width/2,y:i-a/2+d.height+w}]:[{x:r-h/2,y:i-a/2},{x:r+h/2,y:i-a/2},{x:r+h/2,y:i-a/2+m},{x:r+d.width/2,y:i-a/2+m},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+m},{x:r-h/2,y:i-a/2+m}],K.polygon(n,o,e)},u}e(st,`icon`);async function ct(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await P(e,n,`icon-shape default`),p=n.label?8:0,m=n.pos===`t`,{nodeBorder:h,mainBkg:v}=r,{stylesMap:b}=y(n),S=T.svg(u),C=g(n,{});n.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`),C.stroke=b.get(`fill`)??v;let w=u.append(`g`);n.icon&&w.html(`${await x(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let E=w.node().getBBox(),D=E.width,O=E.height,k=E.x,A=E.y,j=Math.max(D,O)*Math.SQRT2+40,M=S.circle(0,0,j,C),N=Math.max(j,d.width),F=j+d.height+p,L=S.rectangle(-N/2,-F/2,N,F,{...C,fill:`transparent`,stroke:`none`}),R=u.insert(()=>M,`:first-child`),z=u.insert(()=>L);return w.attr(`transform`,`translate(${-D/2-k},${m?d.height/2+p/2-O/2-A:-d.height/2-p/2-O/2-A})`),w.attr(`style`,`color: ${b.get(`stroke`)??h};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-F/2:F/2-d.height})`),R.attr(`transform`,`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),I(n,z),n.intersect=function(e){return t.info(`iconSquare intersect`,n,e),K.rect(n,e)},u}e(ct,`iconCircle`);async function lt(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await P(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,v=c+f*2,{nodeBorder:b,mainBkg:S}=r,{stylesMap:C}=y(n),w=-v/2,E=-h/2,D=n.label?8:0,O=T.svg(u),k=g(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=C.get(`fill`)??S;let A=O.path(q(w,E,v,h,5),k),j=Math.max(v,d.width),M=h+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),F=u.insert(()=>A,`:first-child`).attr(`class`,`icon-shape2`),L=u.insert(()=>N);if(n.icon){let e=u.append(`g`);e.html(`${await x(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${C.get(`stroke`)??b};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-M/2:M/2-d.height})`),F.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),I(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+v/2,y:i-a/2+d.height+D},{x:r+v/2,y:i+a/2},{x:r-v/2,y:i+a/2},{x:r-v/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-v/2,y:i-a/2},{x:r+v/2,y:i-a/2},{x:r+v/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-v/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(lt,`iconRounded`);async function ut(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=_(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await P(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,v=c+f*2,{nodeBorder:b,mainBkg:S}=r,{stylesMap:C}=y(n),w=-v/2,E=-h/2,D=n.label?8:0,O=T.svg(u),k=g(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=C.get(`fill`)??S;let A=O.path(q(w,E,v,h,.1),k),j=Math.max(v,d.width),M=h+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),F=u.insert(()=>A,`:first-child`),L=u.insert(()=>N);if(n.icon){let e=u.append(`g`);e.html(`${await x(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${C.get(`stroke`)??b};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-M/2:M/2-d.height})`),F.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),I(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+v/2,y:i-a/2+d.height+D},{x:r+v/2,y:i+a/2},{x:r-v/2,y:i+a/2},{x:r-v/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-v/2,y:i-a/2},{x:r+v/2,y:i-a/2},{x:r+v/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-v/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(ut,`iconSquare`);async function dt(e,n,{config:{flowchart:r}}){let i=new Image;i.src=n?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));n.imageAspectRatio=a/o;let{labelStyles:s}=_(n);n.labelStyle=s;let c=r?.wrappingWidth;n.defaultWidth=r?.wrappingWidth;let l=Math.max(n.label?c??0:0,n?.assetWidth??a),u=n.constraint===`on`&&n?.assetHeight?n.assetHeight*n.imageAspectRatio:l,d=n.constraint===`on`?u/n.imageAspectRatio:n?.assetHeight??o;n.width=Math.max(u,c??0);let{shapeSvg:f,bbox:p,label:m}=await P(e,n,`image-shape default`),h=n.pos===`t`,v=-u/2,y=-d/2,b=n.label?8:0,x=T.svg(f),S=g(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let C=x.rectangle(v,y,u,d,S),w=Math.max(u,p.width),E=d+p.height+b,D=x.rectangle(-w/2,-E/2,w,E,{...S,fill:`none`,stroke:`none`}),O=f.insert(()=>C,`:first-child`),k=f.insert(()=>D);if(n.img){let e=f.append(`image`);e.attr(`href`,n.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?E/2-d:-E/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-b/2:d/2-p.height/2+b/2})`),O.attr(`transform`,`translate(0,${h?p.height/2+b/2:-p.height/2-b/2})`),I(n,k),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=h?[{x:r-p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2+p.height+b},{x:r+u/2,y:i-a/2+p.height+b},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+p.height+b},{x:r-p.width/2,y:i-a/2+p.height+b}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+p.width/2,y:i-a/2+d},{x:r+p.width/2/2,y:i+a/2},{x:r-p.width/2,y:i+a/2},{x:r-p.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],K.polygon(n,o,e)},f}e(dt,`imageSquare`);async function ft(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a*2,t.height??0),u=Math.max(c.width+o*2,(t.width??0)-l),d=[{x:0,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:-3*l/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=g(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ft,`inv_trapezoid`);async function pt(e,t){let{shapeSvg:n,bbox:r,label:i}=await P(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),I(t,a),t.intersect=function(e){return K.rect(t,e)},n}e(pt,`labelRect`);async function mt(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=g(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(mt,`lean_left`);async function ht(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=g(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ht,`lean_right`);function gt(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.label=``,n.labelStyle=r;let a=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),{cssStyles:o}=n,s=Math.max(35,n?.width??0),c=Math.max(35,n?.height??0),l=[{x:s,y:0},{x:0,y:c+7/2},{x:s-14,y:c+7/2},{x:0,y:2*c},{x:s,y:c-7/2},{x:14,y:c-7/2}],u=T.svg(a),d=g(n,{});n.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=R(l),p=u.path(f,d),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`outer-path`),o&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,o),i&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,i),m.attr(`transform`,`translate(-${s/2},${-c})`),I(n,m),n.intersect=function(e){return t.info(`lightningBolt intersect`,n,e),K.polygon(n,l,e)},a}e(gt,`lightningBolt`);var _t=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),vt=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),yt=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),bt=10,xt=10;async function St(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.widtho,`:first-child`).attr(`class`,`line`),v=s.insert(()=>a,`:first-child`),v.attr(`class`,`basic label-container`),y&&v.attr(`style`,y)}else{let e=_t(0,0,u,p,d,f,m);v=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,h(y)).attr(`style`,r)}return v.attr(`label-offset-y`,f),v.attr(`transform`,`translate(${-u/2}, ${-(p/2+f)})`),I(t,v),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+f-(c.y-(c.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}e(St,`linedCylinder`);async function Ct(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,f=t.look===`neo`?d/4:d/8,p=d+f,{cssStyles:m}=t,h=T.svg(s),v=g(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...z(-u/2-u/2*.1,p/2,u/2+u/2*.1,p/2,f,.8),{x:u/2+u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:-p/2},{x:-u/2,y:-p/2},{x:-u/2,y:p/2*1.1},{x:-u/2,y:-p/2}],b=h.polygon(y.map(e=>[e.x,e.y]),v),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(0,${-f/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-f-(c.y-(c.top??0))})`),I(t,x),t.intersect=function(e){return K.polygon(t,y,e)},s}e(Ct,`linedWaveEdgedRect`);var wt=56,Tt=72,Et=8,Dt=2,Ot=8,kt={normal:`usecase-actor-shape usecase-actor-normal`,hollow:`usecase-actor-hollow`,awesome:`usecase-actor-awesome`,icon:`usecase-actor-icon`},At=Math.PI/3,jt=.6,Mt=e((e,t)=>{let n=t*jt,r=t*Math.sqrt(1-jt**2),i=Math.cos(At),a=-Math.sin(At),o=n*-a,s=e+n*i,c=r*i,l=r*a;return`M ${o-c} ${s-l} L ${o+c} ${s+l}`},`businessMarkerPathForCircle`),Nt={normal:Mt(-24,12),hollow:Mt(-23,9),awesome:Mt(-21,13),icon:`M 12 -8 L 26 -26`},Pt=e((e,t,n)=>{let r=(t.x??0)-(t.left??0),i=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${-t.width/2-r},${n-t.height/2-i})`)},`positionLabel`),Ft=e((e,t,n,r,i=!1)=>{if(t.look===`handDrawn`){let a=T.svg(e).path(n,g(t,i?{fill:`none`}:{}));return e.insert(()=>a,`:first-child`).attr(`class`,r)}let a=e.append(`path`).attr(`class`,r).attr(`d`,n);return i&&a.attr(`fill`,`none`),a},`appendActorPath`),It=e((e,t,n,r,i,a,o=!1)=>{if(t.look===`handDrawn`){let s=T.svg(e).circle(n,r,i*2,g(t,o?{fill:`none`}:{}));return e.insert(()=>s,`:first-child`).attr(`class`,a)}let s=e.append(`circle`).attr(`class`,a).attr(`cx`,n).attr(`cy`,r).attr(`r`,i);return o&&s.attr(`fill`,`none`),s},`appendActorCircle`),Lt=e((e,t,n)=>{t.business&&e.append(`path`).attr(`class`,`usecase-business-marker usecase-actor-business-marker`).attr(`d`,Nt[n]).attr(`fill`,`none`).attr(`style`,`stroke: inherit !important; stroke-width: inherit !important`)},`appendBusinessActorMarker`);async function Rt(e,t,n,r){let{labelStyles:i,nodeStyles:a}=_(t);t.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await P(e,n===`icon`||t.stereotype!==void 0?{...t,icon:n===`icon`?void 0:t.icon,stereotype:void 0}:t,L(t,`usecase-actor-variant usecase-actor-${n}`)),l=t.accessibleName??t.label;l&&o.attr(`role`,`img`).attr(`aria-label`,l),c.attr(`class`,`label actor-label usecase-actor-label`);let{theme:d,themeVariables:f}=u();w(o,t.colorIndex,d,f.borderColorArray);let p,m;if(t.stereotype){let e=await F(o,`\xAB${t.stereotype}\xBB`,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});p=e.label.attr(`class`,`label usecase-stereotype`),m=e.bbox}let h=o.append(`g`).attr(`class`,`usecase-actor-glyph ${kt[n]}`).attr(`style`,a||null);await r(h,t),Lt(h,t,n);let g=t.padding??Ot,v=m?.height??0,y=Tt+Et+s.height+(m?v+Dt:0),b=Math.max(wt,s.width,m?.width??0)+g*2,x=y+g*2,S=-y/2;h.attr(`transform`,`translate(0,${S+Tt/2})`);let C=S+Tt+Et;return p&&m&&(C+=v/2,Pt(p,m,C),C+=v/2+Dt),Pt(c,s,C+s.height/2),I(t,o.insert(`rect`,`:first-child`).attr(`class`,`usecase-actor-outline`).attr(`x`,-b/2).attr(`y`,-x/2).attr(`width`,b).attr(`height`,x).attr(`opacity`,0).attr(`aria-hidden`,`true`)),t.intersect=e=>K.rect(t,e),o}e(Rt,`renderUsecaseActor`);var zt=[`M 0 -12`,`C 6.627 -12 12 -17.373 12 -24`,`C 12 -30.627 6.627 -36 0 -36`,`C -6.627 -36 -12 -30.627 -12 -24`,`C -12 -17.373 -6.627 -12 0 -12 Z`,`M 0 -12 V 8`,`M -17 -5 H 17`,`M 0 8 L -15 28`,`M 0 8 L 15 28`].join(` `);async function Bt(e,t){return Rt(e,t,`normal`,(e,t)=>{Ft(e,t,zt,`usecase-actor-stick`)})}e(Bt,`usecaseActor`);var Vt=[`M 0 -34`,`C 7.18 -34 13 -28.18 13 -21`,`C 13 -13.82 7.18 -8 0 -8`,`C -7.18 -8 -13 -13.82 -13 -21`,`C -13 -28.18 -7.18 -34 0 -34 Z`,`M -24 25`,`C -24 7 -14 -3 0 -3`,`C 14 -3 24 7 24 25`,`C 24 28 21 30 18 30`,`H -18`,`C -21 30 -24 28 -24 25 Z`].join(` `);async function Ht(e,t){return Rt(e,t,`awesome`,(e,t)=>{Ft(e,t,Vt,`usecase-actor-awesome-silhouette`)})}e(Ht,`usecaseActorAwesome`);var Ut=[`M -22 -10`,`H 22`,`V 0`,`H 6`,`L 22 17`,`L 13 28`,`L 0 13`,`L -13 28`,`L -22 17`,`L -6 0`,`H -22`,`Z`].join(` `);async function Wt(e,t){return Rt(e,t,`hollow`,(e,t)=>{It(e,t,0,-23,9,`usecase-actor-hollow-head`,!0),Ft(e,t,Ut,`usecase-actor-hollow-body`,!0)})}e(Wt,`usecaseActorHollow`);var Gt=52,Kt=42,qt=-2,Jt=e(async(e,t)=>{let n=-Gt/2,r=qt-Gt/2;if(t.look===`handDrawn`){let i=T.svg(e).rectangle(n,r,Gt,Gt,g(t,{}));e.insert(()=>i,`:first-child`).attr(`class`,`usecase-actor-icon-frame`)}else e.append(`rect`).attr(`class`,`usecase-actor-icon-frame`).attr(`x`,n).attr(`y`,r).attr(`width`,Gt).attr(`height`,Gt).attr(`rx`,4).attr(`ry`,4);let i=t.icon??``,a=await b(i.includes(`:`)?i:`fa:${i}`),o=await x(i,{height:Kt,width:Kt,fallbackPrefix:`fa`}),s=e.append(`g`).attr(`class`,`usecase-actor-icon-symbol${a?``:` usecase-actor-icon-fallback`}`).attr(`aria-hidden`,`true`).html(`${o}`),c=s.node()?.getBBox();c&&s.attr(`transform`,`translate(${-c.width/2-c.x},${qt-c.height/2-c.y})`)},`drawIconActor`);async function Yt(e,t){return Rt(e,t,`icon`,Jt)}e(Yt,`usecaseActorIcon`);var Xt=e((e,t,n)=>{let r=(t.x??0)-(t.left??0),i=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${-t.width/2-r},${n-t.height/2-i})`)},`positionLabel`);async function Zt(e,t){let n=t,{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await P(e,n.stereotype?{...t,stereotype:void 0}:t,L(t,`usecase-business-shape`));c.attr(`class`,`label usecase-label`);let{theme:l,themeVariables:d}=u();w(a,t.colorIndex,l,d.borderColorArray);let f,p;if(n.stereotype){let e=await F(a,`\xAB${n.stereotype}\xBB`,{labelStyle:r,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});f=e.label.attr(`class`,`label usecase-stereotype`),p=e.bbox}let m=p?2:0,h=o.height+(p?.height??0)+m,v=Math.max(o.width,p?.width??0),y=s??10,b=v/2+y*2,x=h/2+y*2,S=Math.min(Math.max(y/5,1),y/2),C=v/2+S,E=b-S,D=C/b,O=E/b,k=x*Math.sqrt(Math.max(0,1-D*D)),A=-x*Math.sqrt(Math.max(0,1-O*O));f&&p&&Xt(f,p,-h/2+p.height/2),Xt(c,o,h/2-o.height/2);let j;if(t.look===`handDrawn`){let e=T.svg(a).ellipse(0,0,b*2,x*2,g(t,{}));j=a.insert(()=>e,`:first-child`).attr(`class`,`basic label-container usecase-business-ellipse`)}else j=a.insert(`ellipse`,`:first-child`).attr(`class`,`basic label-container usecase-business-ellipse`).attr(`style`,i).attr(`rx`,b).attr(`ry`,x).attr(`cx`,0).attr(`cy`,0);a.append(`path`).attr(`class`,`usecase-business-marker`).attr(`d`,`M ${C} ${k} L ${E} ${A}`).attr(`fill`,`none`).attr(`style`,i||null);let M=n.accessibleName??n.label;return M&&a.attr(`role`,`img`).attr(`aria-label`,M),I(t,j),t.calcIntersect=(e,t)=>K.ellipse(e,e.width/2,e.height/2,t),t.intersect=e=>K.ellipse(t,b,x,e),a}e(Zt,`usecaseBusiness`);var Qt=8,$t=4,en=1,tn=e((e,t,n,r)=>{let i=(t.x??0)-(t.left??0),a=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${n-t.width/2-i},${r-t.height/2-a})`)},`positionLabel`),nn=e(e=>{let t=Number.parseFloat(e??``);return Number.isFinite(t)&&t>=0?t:en},`numericStrokeWidth`);async function rn(t,n){let r=n,{labelStyles:i,nodeStyles:a}=_(n),{stylesMap:o}=y(n);n.labelStyle=i;let{shapeSvg:s,bbox:c,label:l}=await P(t,n,L(n,`usecase-json-table`));s.attr(`role`,`img`),r.accessibleName&&s.attr(`aria-label`,r.accessibleName),l.attr(`class`,`label usecase-json-title`);let u=s.append(`g`).attr(`class`,`usecase-json-table-grid`),d=[];for(let e of r.jsonRows??[]){let t=await F(u,e.key,{labelStyle:i,useHtmlLabels:n.useHtmlLabels,padding:0,centerLabel:!0}),r=await F(u,e.value,{labelStyle:i,useHtmlLabels:n.useHtmlLabels,padding:0,centerLabel:!0});d.push({key:{label:t.label.attr(`class`,`label usecase-json-key`),bbox:t.bbox},value:{label:r.label.attr(`class`,`label usecase-json-value`),bbox:r.bbox}})}let f=Math.max(0,...d.map(({key:e})=>e.bbox.width))+Qt*2,p=Math.max(0,...d.map(({value:e})=>e.bbox.width))+Qt*2,m=c.width+Qt*2,h=Math.max(m,f+p),v=p+Math.max(0,h-f-p),b=c.height+$t*2,x=d.map(({key:e,value:t})=>Math.max(e.bbox.height,t.bbox.height)+$t*2),S=b+x.reduce((e,t)=>e+t,0),C=nn(o.get(`stroke-width`)),w=h+C*2,E=S+C*2,D=-h/2,O=-S/2,k=n.look===`handDrawn`?T.svg(s):void 0,A=k?g(n,{}):void 0,j=e((e,t,n,r,i,o)=>{if(k&&A){let a=k.rectangle(n,r,i,o,A);return e.insert(()=>a,`:first-child`).attr(`class`,t)}return e.insert(`rect`,`:first-child`).attr(`class`,t).attr(`x`,n).attr(`y`,r).attr(`width`,i).attr(`height`,o).attr(`style`,a)},`insertCell`),M=j(s,`label-container usecase-json-border`,-w/2,-E/2,w,E);j(u,`usecase-json-cell usecase-json-title-cell`,D,O,h,b),u.node()?.append(l.node()),tn(l,c,0,O+b/2);let N=O+b;return d.forEach(({key:e,value:t},n)=>{let r=x[n],i=u.append(`g`).attr(`class`,`usecase-json-row`).attr(`data-row-index`,n).attr(`transform`,`translate(0,${N})`);j(i,`usecase-json-cell usecase-json-key-cell`,D,0,f,r),j(i,`usecase-json-cell usecase-json-value-cell`,D+f,0,v,r),i.node()?.append(e.label.node(),t.label.node()),tn(e.label,e.bbox,D+f/2,r/2),tn(t.label,t.bbox,D+f+v/2,r/2),N+=r}),I(n,M),n.intersect=e=>K.rect(n,e),s}e(rn,`usecaseJsonTable`);async function an(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await P(e,t,L(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,f=(t?.height?t?.height:l.height)+o*2+2*s,p=d-2*s,m=f-2*s,h=-p/2,v=-m/2,{cssStyles:y}=t,b=T.svg(c),x=g(t,{}),S=[{x:h-s,y:v+s},{x:h-s,y:v+m+s},{x:h+p-s,y:v+m+s},{x:h+p-s,y:v+m},{x:h+p,y:v+m},{x:h+p,y:v+m-s},{x:h+p+s,y:v+m-s},{x:h+p+s,y:v-s},{x:h+s,y:v-s},{x:h+s,y:v},{x:h,y:v},{x:h,y:v+s}],C=[{x:h,y:v+s},{x:h+p-s,y:v+s},{x:h+p-s,y:v+m},{x:h+p,y:v+m},{x:h+p,y:v},{x:h,y:v}];t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let w=R(S),E=b.path(w,x),D=R(C),O=b.path(D,x);t.look!==`handDrawn`&&(E=ee(E),O=ee(O));let k=c.insert(`g`,`:first-child`);return k.insert(()=>E),k.insert(()=>O),k.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),I(t,k),t.intersect=function(e){return K.polygon(t,S,e)},c}e(an,`multiRect`);async function on(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,f=Math.max(a.height,t?.height??0)+l*3,p=t.look===`neo`?f/4:f/8,m=f+(u?p/2:-p/2),h=-d/2,v=-m/2,{cssStyles:y}=t,b=z(h-10,v+m+10,h+d-10,v+m+10,p,.8),x=b?.[b.length-1],S=[{x:h-10,y:v+10},{x:h-10,y:v+m+10},...b,{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:x.y-20},{x:h+d+10,y:x.y-20},{x:h+d+10,y:v-10},{x:h+10,y:v-10},{x:h+10,y:v},{x:h,y:v},{x:h,y:v+10}],C=[{x:h,y:v+10},{x:h+d-10,y:v+10},{x:h+d-10,y:x.y-10},{x:h+d,y:x.y-10},{x:h+d,y:v},{x:h,y:v}],w=T.svg(i),E=g(t,{});t.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`);let D=R(S),O=w.path(D,E),k=R(C),A=w.path(k,E),j=i.insert(()=>O,`:first-child`);return j.insert(()=>A),j.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p-(a.y-(a.top??0))})`),I(t,j),t.intersect=function(e){return K.polygon(t,S,e)},i}e(on,`multiWaveEdgedRectangle`);async function sn(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r,t.useHtmlLabels||o(s())||(t.centerLabel=!0);let{shapeSvg:a,bbox:c,label:l}=await P(e,t,L(t)),u=Math.max(c.width+(t.padding??0)*2,t?.width??0),d=Math.max(c.height+(t.padding??0)*2,t?.height??0),f=-u/2,p=-d/2,{cssStyles:m}=t,h=T.svg(a),v=g(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=h.rectangle(f,p,u,d,v),b=a.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),l.attr(`class`,`label noteLabel`),m&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,m),i&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,i),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),I(t,b),t.intersect=function(e){return K.rect(t,e)},a}e(sn,`note`);var cn=e((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function ln(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await P(e,t,L(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=g(t,{}),r=cn(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=J(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),I(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}];return K.polygon(e,r,t)},t.intersect=function(e){return this.calcIntersect(t,e)},i}e(ln,`question`);async function un(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=c.width+(t.look===`neo`?a*2:a),d=Math.max(c.height+(t.look===`neo`?o*2:o),t.height??0),f=d/4,p=-Math.max(u,(t.width??0)-f)/2,m=-d/2,h=m/2,v=[{x:p+h,y:m},{x:p,y:0},{x:p+h,y:-m},{x:-p,y:-m},{x:-p,y:m}],{cssStyles:y}=t,b=T.svg(s),x=g(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=R(v),C=b.path(S,x),w=s.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),y&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,y),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${-h/2},0)`),l.attr(`transform`,`translate(${-h/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),I(t,w),t.intersect=function(e){return K.polygon(t,v,e)},s}e(un,`rect_left_inv_arrow`);async function dn(e,r){let{labelStyles:i,nodeStyles:a}=_(r);r.labelStyle=i;let s;s=r.cssClasses?`node `+r.cssClasses:`node default`;let c=e.insert(`g`).attr(`class`,s).attr(`id`,r.domId||r.id),l=c.insert(`g`),d=c.insert(`g`).attr(`class`,`label`).attr(`style`,a),f=r.description,p=r.label,m=await se(d,p,r.labelStyle,!0,!0),h={width:0,height:0};if(o(u())){let e=m.children[0],t=n(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}t.info(`Text 2`,f);let v=f||[],y=m.getBBox(),b=await se(d,Array.isArray(v)?v.join(`
`):v,r.labelStyle,!0,!0),x=b.children[0],S=n(b);h=x.getBoundingClientRect(),S.attr(`width`,h.width),S.attr(`height`,h.height);let C=(r.padding||0)/2;n(b).attr(`transform`,`translate( `+(h.width>y.width?0:(y.width-h.width)/2)+`, `+(y.height+C+5)+`)`),n(m).attr(`transform`,`translate( `+(h.width(t.debug(`Rough node insert CXC`,i),a),`:first-child`),k=c.insert(()=>(t.debug(`Rough node insert CXC`,i),i),`:first-child`)}else k=l.insert(`rect`,`:first-child`),A=l.insert(`line`),k.attr(`class`,`outer title-state`).attr(`style`,a).attr(`x`,-h.width/2-C).attr(`y`,-h.height/2-C).attr(`width`,h.width+(r.padding||0)).attr(`height`,h.height+(r.padding||0)),A.attr(`class`,`divider`).attr(`x1`,-h.width/2-C).attr(`x2`,h.width/2+C).attr(`y1`,-h.height/2-C+y.height+C).attr(`y2`,-h.height/2-C+y.height+C);return I(r,k),r.intersect=function(e){return K.rect(r,e)},c}e(dn,`rectWithTitle`);async function fn(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return Ke(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}e(fn,`roundedRect`);var pn=8;async function mn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?pn:pn*2),u=(t?.height??s.height)+a*2,d=l-pn,f=u,p=pn-l/2,m=-u/2,{cssStyles:v}=t,y=T.svg(o),b=g(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:p,y:m},{x:p+d,y:m},{x:p+d,y:m+f},{x:p-pn,y:m+f},{x:p-pn,y:m},{x:p,y:m},{x:p,y:m+f}],S=y.polygon(x.map(e=>[e.x,e.y]),b),C=o.insert(()=>S,`:first-child`);return C.attr(`class`,`basic label-container outer-path`).attr(`style`,h(v)),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),v&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${pn/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),I(t,C),t.intersect=function(e){return K.rect(t,e)},o}e(mn,`shadedProcess`);async function hn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,f=u,p=d/1.5,m=-f/2,h=-p/2,{cssStyles:v}=t,y=T.svg(s),b=g(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=[{x:m,y:h},{x:m,y:h+p},{x:m+f,y:h+p},{x:m+f,y:h-p/2}],S=R(x),C=y.path(S,b),w=s.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,r),w.attr(`transform`,`translate(0, ${p/4})`),l.attr(`transform`,`translate(${-f/2+(t.padding??0)-(c.x-(c.left??0))}, ${-p/4+(t.padding??0)-(c.y-(c.top??0))})`),I(t,w),t.intersect=function(e){return K.polygon(t,x,e)},s}e(hn,`slopedRect`);async function gn(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n,a=await Ke(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i});if(t.colorIndex!==void 0){let{theme:e,themeVariables:n}=u();w(a,t.colorIndex,e,n.borderColorArray)}return a}e(gn,`squareRect`);var _n=50,vn=e((e,t,n)=>{let r=e.height+n,i=r*Math.cos(Math.PI/(2*(_n-1))),a=Math.sqrt(Math.max(0,i**2-e.height**2));return{w:Math.max(e.width+r/4+t,1.5*r+(r-i),e.width+t+r-a),h:r}},`stadiumDimensions`);async function yn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?40:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),{w:l,h:u}=vn(c,a,o),d=u/2,{cssStyles:f}=t,p=T.svg(s),m=g(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-l/2+d,y:-u/2},{x:l/2-d,y:-u/2},...B(-l/2+d,0,d,_n,90,270),{x:l/2-d,y:u/2},...B(l/2-d,0,d,_n,270,450)],v=R(h),y=p.path(v,m),b=s.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&b.selectChildren(`path`).attr(`style`,r),I(t,b),t.intersect=function(e){return K.polygon(t,h,e)},s}e(yn,`stadium`);async function bn(e,t){return Ke(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}e(bn,`state`);function xn(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=T.svg(u),f=g(t,{});t.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=d.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),m=s??c,h=(t.width??0)*5/14,v=d.circle(0,0,h,{...f,fill:m,stroke:m,strokeWidth:2,fillStyle:`solid`}),y=u.insert(()=>p,`:first-child`);if(y.insert(()=>v),t.look!==`handDrawn`&&y.attr(`class`,`outer-path`),a&&y.selectAll(`path`).attr(`style`,a),i&&y.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;y.attr(`style`,`filter:url(#${n})`)}return I(t,y),t.intersect=function(e){return K.circle(t,(t.width??0)/2,e)},u}e(xn,`stateEnd`);function Sn(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=T.svg(a).circle(0,0,t.width,v(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return I(t,o),t.intersect=function(e){return K.circle(t,(t.width??7)/2,e)},a}e(Sn,`stateStart`);var Cn=8;async function wn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.width+2*Cn+a,t.width??0),u=Math.max(c.height+o,t.height??0),d=l-2*Cn,f=u,p=-l/2,m=-u/2,v=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look===`handDrawn`){let e=T.svg(s),n=g(t,{}),r=e.rectangle(p,m,d+16,f,n),i=e.line(p+Cn,m,p+Cn,m+f,n),a=e.line(p+Cn+d,m,p+Cn+d,m+f,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:c}=t;o.attr(`class`,`basic label-container`).attr(`style`,h(c)),I(t,o)}else{let e=J(s,d,f,v);r&&e.attr(`style`,r),I(t,e)}return t.intersect=function(e){return K.polygon(t,v,e)},s}e(wn,`subroutine`);var Tn=.2;async function En(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-Tn*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.height?t?.height:c.height)+o*2,u=Tn*l,d=Tn*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,m=-f/2,h=-p/2,{cssStyles:v}=t,y=T.svg(s),b=g(t,{}),x=[{x:m-u/2,y:h},{x:m+f+u/2,y:h},{x:m+f+u/2,y:h+p},{x:m-u/2,y:h+p}],S=[{x:m+f-u/2,y:h+p},{x:m+f+u/2,y:h+p},{x:m+f+u/2,y:h+p-d}];t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let C=R(x),w=y.path(C,b),E=R(S),D=y.path(E,{...b,fillStyle:`solid`}),O=s.insert(()=>D,`:first-child`);return O.insert(()=>w,`:first-child`),O.attr(`class`,`basic label-container outer-path`),v&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,v),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),I(t,O),t.intersect=function(e){return K.polygon(t,x,e)},s}e(En,`taggedRect`);async function Dn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,m=T.svg(i),h=g(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let v=[{x:-s/2-s/2*.1,y:f/2},...z(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],y=-s/2+s/2*.1,b=-f/2-d*.4,x=[{x:y+s-u,y:(b+c)*1.3},{x:y+s,y:b+c-d},{x:y+s,y:(b+c)*.9},...z(y+s,(b+c)*1.25,y+s-u,(b+c)*1.3,-c*.02,.5)],S=R(v),C=m.path(S,h),w=R(x),E=m.path(w,{...h,fillStyle:`solid`}),D=i.insert(()=>E,`:first-child`);return D.insert(()=>C,`:first-child`),D.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),I(t,D),t.intersect=function(e){return K.polygon(t,v,e)},i}e(Dn,`taggedWaveEdgedRectangle`);async function On(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await P(e,t,L(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),I(t,u),t.intersect=function(e){return K.rect(t,e)},i}e(On,`text`);var kn=e((e,t,n,r,i,a)=>`M${e},${t} +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{A as r,B as i,M as a,T as o,b as s,f as c,g as l,x as u,z as d}from"./app-chunk-O7XYJQB3.js";import{a as f,p,r as m,u as h}from"./app-chunk-ZIGJFQKS.js";import{n as g,t as _}from"./app-chunk-742MDFTN.js";import{n as v,r as y}from"./app-chunk-MBY4JIJT.js";import{a as b,i as x,r as S,t as C}from"./app-chunk-7PRAP22T.js";import{s as w}from"./app-chunk-J5ZVWO5B.js";import{t as T}from"./app-rough.esm.js";var E=1,D=3;async function O(t){let n=t.getElementsByTagName(`img`);if(!n||n.length===0)return;let r=!k(t);await Promise.all([...n].map(t=>new Promise(n=>{function i(){if(t.style.display=`flex`,t.style.flexDirection=`column`,r){let e=u().fontSize?u().fontSize:window.getComputedStyle(document.body).fontSize,[n=c.fontSize]=p(e),r=n*5+`px`;t.style.minWidth=r,t.style.maxWidth=r}else t.style.width=`100%`;n(t)}e(i,`setupImage`),setTimeout(()=>{t.complete&&i()}),t.addEventListener(`error`,i),t.addEventListener(`load`,i)})))}e(O,`configureLabelImages`);function k(e){return e.nodeType===D?e.textContent?.trim()!==``:e.nodeType!==E||e.tagName.toLowerCase()===`img`?!1:[...e.childNodes].some(k)}e(k,`hasTextBesidesImages`);var A=3,j=32,M=e(async(e,t,r)=>{let i=u(),a=e.insert(`g`).attr(`class`,r??`node default`).attr(`id`,t.domId||t.id),o=a.insert(`g`).attr(`class`,`label`).attr(`style`,h(t.labelStyle)),s=[{text:typeof t.label==`string`?t.label:t.label?.[0]??``,cssClass:`c4-name`},{text:t.stereotype,cssClass:`c4-type`},...(t.description??[]).map(e=>({text:e,cssClass:`c4-descr`}))].filter(e=>e.text),c=t.width?Math.max(t.width-2*(t.padding??0),j):u().flowchart?.wrappingWidth??200,l=i.c4?.wrap??!0?c:1/0,p=await Promise.all(s.map(async e=>{let r=o.append(`g`).attr(`class`,e.cssClass),a=await v(r,d(f(e.text??``),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:l,style:t.labelStyle},i);return n(a).selectAll(`tspan.text-outer-tspan`).attr(`text-anchor`,`middle`),n(a).selectAll(`tspan.text-inner-tspan`).attr(`font-weight`,null).attr(`font-style`,null),{el:r,box:r.node().getBBox()}})),m=Math.max(...p.map(({box:e})=>e.width),0),g=0;for(let{el:e,box:t}of p)e.attr(`transform`,`translate(${m/2-t.x-t.width/2}, ${g-t.y})`),g+=t.height+A;let _=p.length>0?g-A:0;return o.insert(`rect`,`:first-child`),o.attr(`transform`,`translate(${-m/2}, ${-_/2})`),{shapeSvg:a,bbox:o.node().getBBox(),halfPadding:(t.padding??0)/2,label:o}},`c4LabelHelper`),N=e((t,n)=>{let{x:r,y:i,width:a,height:o}=t;return a>=n?t:`left`in t?{x:r,y:i,width:n,height:o,top:i,left:r,bottom:i+o,right:r+n,toJSON:e(()=>({}),`toJSON`)}:{x:r-(n-a)/2,y:i,width:n,height:o}},`withMinWidth`),P=e(async(e,t,r)=>{if(t.stereotype!==void 0)return M(e,t,r);let i,a=t.useHtmlLabels||l(u()?.htmlLabels);i=r||`node default`;let o=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),s=o.insert(`g`).attr(`class`,`label`).attr(`style`,h(t.labelStyle)),c;c=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let p=!!t.icon||!!t.img,m=t.labelType===`markdown`,g=c&&!t.width?t.minWidth??0:0,_=await v(s,d(f(c),u()),{useHtmlLabels:a,width:t.width||t.wrappingWidth||u().flowchart?.wrappingWidth,minWidth:g,classes:m?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:p,markdown:m},u()),b=(t?.padding??0)/2,x;if(a){let e=_.children[0],t=n(_);await O(e),x=await y.measure(()=>e.getBoundingClientRect()),x=N(x,g),t.attr(`width`,x.width),t.attr(`height`,x.height)}else x=await y.measure(()=>_.getBBox()),x=N(x,g);return a?s.attr(`transform`,`translate(`+-x.width/2+`, `+-x.height/2+`)`):s.attr(`transform`,`translate(0, `+-x.height/2+`)`),t.centerLabel&&s.attr(`transform`,`translate(`+-x.width/2+`, `+-x.height/2+`)`),s.insert(`rect`,`:first-child`),{shapeSvg:o,bbox:x,halfPadding:b,label:s}},`labelHelper`),F=e(async(e,t,r)=>{let i=r.useHtmlLabels??o(u()),a=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.labelStyle||``),s=await v(a,d(f(t),u()),{useHtmlLabels:i,width:r.width||u()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),c=r.padding/2,l;if(o(u())){let e=s.children[0],t=n(s);l=await y.measure(()=>e.getBoundingClientRect()),t.attr(`width`,l.width),t.attr(`height`,l.height)}else l=await y.measure(()=>s.getBBox());return i?a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`):a.attr(`transform`,`translate(0, `+-l.height/2+`)`),r.centerLabel&&a.attr(`transform`,`translate(`+-l.width/2+`, `+-l.height/2+`)`),a.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:l,halfPadding:c,label:a}},`insertLabel`),I=e((e,t,n)=>{if(n){e.width=n.width,e.height=n.height;return}let r=t.node().getBBox();e.width=r.width,e.height=r.height},`updateNodeBounds`),L=e((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function R(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}e(R,`createPathFromPoints`);function z(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}e(z,`generateFullSineWavePoints`);function B(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;ie.tagName===`path`),r=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),i=n.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);r.setAttribute(`d`,i);let a=n.find(e=>e.getAttribute(`fill`)!==`none`),o=n.find(e=>e.getAttribute(`stroke`)!==`none`),s=e((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(a){let e={fill:s(a,`fill`),"fill-opacity":s(a,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}if(o){let e={stroke:s(o,`stroke`),"stroke-width":s(o,`stroke-width`)??`1`,"stroke-opacity":s(o,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&r.setAttribute(e,t)})}let c=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return c.appendChild(r),c}e(ee,`mergePaths`);var V=e((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`);function te(e,t){return e.intersect(t)}e(te,`intersectNode`);var H=te;function U(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x0}e(G,`sameSign`);var ae=W;function oe(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),se=e(async(e,t,n,r=!1,i=!1)=>{let a=t||``;typeof a==`object`&&(a=a[0]);let s=u(),c=o(s);return await v(e,a,{style:n,isTitle:r,useHtmlLabels:c,markdown:!1,isNode:i,width:1/0},s)},`createLabel`);function ce(e,n){let{labelStyles:r}=x(n);n.labelStyle=r;let i=L(n),a=i;i||(a=`anchor`);let o=e.insert(`g`).attr(`class`,a).attr(`id`,n.domId||n.id),{cssStyles:s}=n,c=T.svg(o),l=b(n,{fill:`black`,stroke:`none`,fillStyle:`solid`});n.look!==`handDrawn`&&(l.roughness=0);let u=c.circle(0,0,2,l),d=o.insert(()=>u,`:first-child`);return d.attr(`class`,`anchor`).attr(`style`,h(s)),I(n,d),n.intersect=function(e){return t.info(`Circle intersect`,n,1,e),K.circle(n,1,e)},o}e(ce,`anchor`);function le(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}e(le,`generateArcPoints`);function ue(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}e(ue,`calculateArcSagitta`);async function de(t,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?16:a,s=n.look===`neo`?12:a,c=e(e=>e+s,`calcTotalHeight`),l=e(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:u,bbox:d}=await P(t,n,L(n)),f=c(n?.height?n?.height:d.height),[p,m]=l(f),h=ue(f,p,m),g=(n?.width?n?.width:d.width)+o*2+h-h,_=f,{cssStyles:v}=n,y=[{x:g/2,y:-_/2},{x:-g/2,y:-_/2},...le(-g/2,-_/2,-g/2,_/2,p,m,!1),{x:g/2,y:_/2},...le(g/2,_/2,g/2,-_/2,p,m,!0)],S=T.svg(u),C=b(n,{});n.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let w=R(y),E=S.path(w,C),D=u.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),v&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,v),i&&n.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,i),D.attr(`transform`,`translate(${p/2}, 0)`),I(n,D),n.intersect=function(e){return K.polygon(n,y,e)},u}e(de,`bowTieRect`);async function fe(t,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=x(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await P(t,n,L(n)),l=r?.nodeBorder??r?.lineColor??`currentColor`,u=n.padding??12,d=Math.max(s.width+u*2,n.width??0,80),f=Math.max(Math.min(d*.08,12),5),p=Math.max(s.height+u*2+f,n.height??0),m=-p/2+f,h=p/2,g=d*.72,_=[`M${-d/2},${m}`,`L${-g/2},${h}`,`A${g/2},${f} 0 0 0 ${g/2},${h}`,`L${d/2},${m}`,`A${d/2},${f} 0 0 0 ${-d/2},${m}`,`Z`].join(` `),{cssStyles:v}=n,y=o.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(n.look===`handDrawn`){let e=T.svg(o).path(_,b(n,{}));y.node()?.appendChild(e),v&&y.attr(`style`,v)}else y.append(`path`).attr(`d`,_).attr(`style`,a);y.append(`ellipse`).attr(`cx`,0).attr(`cy`,m).attr(`rx`,d/2).attr(`ry`,f).attr(`style`,`fill:none;stroke:${l};stroke-width:1px`),I(n,y);let S=m+(h-m)/2;c.attr(`transform`,`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${S-s.height/2-(s.y-(s.top??0))})`);let C=e((e,t,n)=>Array.from({length:13},(r,i)=>{let a=Math.PI-i*Math.PI/12;return{x:e*Math.cos(a),y:t+n*f*Math.sin(a)}}),`arc`),w=[...C(d/2,m,-1),...C(g/2,h,1).reverse()];return n.intersect=function(e){return K.polygon(n,w,e)},o}e(fe,`bucket`);var pe=20,me=8,he=80,ge=8;function _e(e){let{themeVariables:t}=u(),n=t.clusterBkg,r=t.clusterBorder;switch(e){case`flow`:return{rx:10,fill:`none`,stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:`flow-collapsed`};default:return{rx:ge,fill:n,stroke:r,cssClass:`collapsed-group`}}}e(_e,`getCollapsedStyle`);async function ve(e,t){let n=_e(t.metadata?.containerType),{fill:r,stroke:i}=n,{nodeStyles:a}=x(t),{shapeSvg:s,bbox:c}=await P(e,t,L(t)),{theme:l,themeVariables:d}=u();w(s,t.colorIndex,l,d.borderColorArray);let f=t.padding??8,p=c.height,m=Math.max(c.width+f*2,he,t?.width??0),g=Math.max(p+me+pe+f*2,t?.height??0),_=-m/2,v=-g/2,y=-(me+pe)/2,S=s.select(`.label`);S&&(t.useHtmlLabels??o(u())?S.attr(`transform`,`translate(${-c.width/2}, ${-c.height/2+y})`):S.attr(`transform`,`translate(0, ${-c.height/2+y})`));let C;if(t.look===`handDrawn`){let e=T.svg(s),a=b(t,{fill:r,stroke:i,...n.strokeWidth===void 0?{}:{strokeWidth:n.strokeWidth},...r===`none`?{fillWeight:0}:{fillStyle:`solid`}}),o=e.path(q(_,v,m,g,n.rx),a);C=s.insert(()=>o,`:first-child`),C.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,h(t.cssStyles))}else C=s.insert(`rect`,`:first-child`),C.attr(`class`,`basic label-container `+n.cssClass).attr(`style`,a).attr(`rx`,n.rx).attr(`ry`,n.rx).attr(`x`,_).attr(`y`,v).attr(`width`,m).attr(`height`,g).attr(`fill`,r).attr(`stroke`,i),n.strokeWidth!==void 0&&C.attr(`stroke-width`,n.strokeWidth+`px`);let E=v+f+p+me;s.append(`line`).attr(`class`,`collapsed-separator`).attr(`x1`,_+8).attr(`y1`,E).attr(`x2`,_+m-8).attr(`y2`,E).attr(`stroke`,i).attr(`stroke-dasharray`,`3, 3`);let D=E+pe/2;for(let e=-1;e<=1;e++)s.append(`circle`).attr(`class`,`collapsed-indicator`).attr(`cx`,e*10).attr(`cy`,D).attr(`r`,2.5).attr(`fill`,i);return I(t,C),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},s}e(ve,`collapsedGroup`);function J(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}e(J,`insertPolygonShape`);var ye=[`right`,`left`,`up`,`down`],be=`point`,xe=e(e=>{let t=new Set;for(let n of e)switch(n){case`x`:t.add(`right`),t.add(`left`);break;case`y`:t.add(`up`),t.add(`down`);break;default:t.add(n)}return t},`expandAndDeduplicateDirections`),Se=e(e=>ye.filter(t=>e.has(t)).join(`|`)||be,`getDirectionKey`),Ce={"right|left|up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:0,y:0},{x:t,y:0},{x:r/2,y:2*n},{x:r-t,y:0},{x:r,y:0},{x:r,y:-e/3},{x:r+2*n,y:-e/2},{x:r,y:-2*e/3},{x:r,y:-e},{x:r-t,y:-e},{x:r/2,y:-e-2*n},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*n,y:-e/2},{x:0,y:-e/3}],`right|left|up|down`),"right|left|up":e(({height:e,midpoint:t,width:n})=>[{x:t,y:0},{x:n-t,y:0},{x:n,y:-e/2},{x:n-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],`right|left|up`),"right|left|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:t,y:-e},{x:n-t,y:-e},{x:n,y:0}],`right|left|down`),"right|up|down":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:n,y:-e+t},{x:0,y:-e}],`right|up|down`),"left|up|down":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:n,y:-e}],`left|up|down`),"right|left":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`right|left`),"up|down":e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`up|down`),"right|up":e(({height:e,midpoint:t,width:n})=>[{x:0,y:0},{x:n,y:-t},{x:0,y:-e}],`right|up`),"right|down":e(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],`right|down`),"left|up":e(({height:e,midpoint:t,width:n})=>[{x:n,y:0},{x:0,y:-t},{x:n,y:-e}],`left|up`),"left|down":e(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],`left|down`),right:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e+n}],`right`),left:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:0},{x:t,y:-n},{x:r-t,y:-n},{x:r-t,y:-e+n},{x:t,y:-e+n},{x:t,y:-e},{x:0,y:-e/2}],`left`),up:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:t,y:-n},{x:t,y:-e+n},{x:0,y:-e+n},{x:r/2,y:-e},{x:r,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n}],`up`),down:e(({height:e,midpoint:t,padding:n,width:r})=>[{x:r/2,y:0},{x:0,y:-n},{x:t,y:-n},{x:t,y:-e+n},{x:r-t,y:-e+n},{x:r-t,y:-n},{x:r,y:-n}],`down`),[be]:()=>[{x:0,y:0}]},we=e((e,t,n,r)=>{let i=xe(e),a=(n.padding??0)/2,o=t.height+4*a,s=o/2,c=r??t.width+2*s+2*a;return(Ce[Se(i)]??Ce[be])({height:o,midpoint:s,padding:a,width:c})},`getArrowPoints`);async function Te(e,t){let n=t,{shapeSvg:r,bbox:i}=await P(e,n,L(n)),a=n.padding??0,o=i.height+2*a,s=o/2,c=i.width+2*s+a,l=n.width??0,u=n.positioned&&(n.widthInColumns??1)>1&&l>c?l:c,d=we(n.directions??[],i,n,u),f=J(r,u,o,d);return f.attr(`style`,n.style??null),I(n,f),n.intersect=function(e){return K.polygon(n,d,e)},r}e(Te,`block_arrow`);async function Ee(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await P(e,t,L(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+18,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=T.svg(a).path(q(-u/2,f,u,d,12),b(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`line`).attr(`x1`,-u/2).attr(`y1`,f+18).attr(`x2`,u/2).attr(`y2`,f+18).attr(`style`,`stroke:${c};stroke-width:1px`);for(let e=0;e<3;e++)m.append(`circle`).attr(`cx`,-u/2+12+e*9).attr(`cy`,f+18/2).attr(`r`,2.5).attr(`style`,`fill:${c};stroke:none`);m.append(`rect`).attr(`class`,`browser-address-bar`).attr(`x`,-u/2+44).attr(`y`,f+4).attr(`width`,Math.max(u-56,10)).attr(`height`,10).attr(`rx`,3).attr(`ry`,3).attr(`style`,`fill:none;stroke:${c};stroke-width:1px;opacity:0.6`),I(t,m);let h=f+18+(d-18)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Ee,`browser`);var De=12;async function Oe(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+De),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+De,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+De},{x:0+De,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(p),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=J(s,l,u,p);return r&&m.attr(`style`,r),I(t,m),t.intersect=function(e){return K.polygon(t,p,e)},s}e(Oe,`card`);function ke(e,t){let{nodeStyles:n}=x(t);t.label=``;let r=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=T.svg(r),c=b(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=R(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return K.polygon(t,o,e)},r}e(ke,`choice`);async function Ae(e,n,r){let{labelStyles:i,nodeStyles:a}=x(n);n.labelStyle=i;let{shapeSvg:o,bbox:s,halfPadding:c}=await P(e,n,L(n)),l=r?.padding??c,u=Math.sqrt(s.width**2+s.height**2)/2,d=n.look===`neo`?u+32:u+l,f,{cssStyles:p}=n;if(n.look===`handDrawn`){let e=T.svg(o),t=b(n,{}),r=e.circle(0,0,d*2,t);f=o.insert(()=>r,`:first-child`),f.attr(`class`,`basic label-container`).attr(`style`,h(p))}else f=o.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,a).attr(`r`,d).attr(`cx`,0).attr(`cy`,0);return I(n,f),n.calcIntersect=function(e,t){let n=e.width/2;return K.circle(e,n,t)},n.intersect=function(e){return t.info(`Circle intersect`,n,d,e),K.circle(n,d,e)},o}e(Ae,`circle`);async function je(e,t){let n=t,{shapeSvg:r,bbox:i,halfPadding:a}=await P(e,n,[`node`,n.cssClasses,n.class].filter(Boolean).join(` `)),o=r.insert(`rect`,`:first-child`),s=n.padding??0,c=n.positioned?n.width??0:i.width+s,l=n.positioned?n.height??0:i.height+s,u=n.positioned?-c/2:-i.width/2-a,d=n.positioned?-l/2:-i.height/2-a;return o.attr(`class`,`basic cluster composite label-container`).attr(`style`,n.style??null).attr(`rx`,n.rx??null).attr(`ry`,n.ry??null).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l),I(n,o),n.intersect=function(e){return K.rect(n,e)},r}e(je,`composite`);async function Me(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,label:s}=await P(e,t,L(t)),c=n?.nodeBorder??n?.lineColor??`currentColor`,l=t.padding??12,u=Math.max(o.width+l*2,t.width??0,90),d=Math.max(o.height+l*2+20,t.height??0),f=-d/2,{cssStyles:p}=t,m=a.insert(`g`,`:first-child`).attr(`class`,`basic label-container`);if(t.look===`handDrawn`){let e=T.svg(a).path(q(-u/2,f,u,d,12),b(t,{}));m.node()?.appendChild(e),p&&m.attr(`style`,p)}else m.append(`rect`).attr(`x`,-u/2).attr(`y`,f).attr(`width`,u).attr(`height`,d).attr(`rx`,12).attr(`ry`,12).attr(`style`,i);m.append(`text`).attr(`x`,-u/2+12).attr(`y`,f+16).attr(`class`,`console-glyph`).attr(`style`,`font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(`>_`),I(t,m);let h=f+20+(d-20)/2;return s.attr(`transform`,`translate(${-(o.width/2)-(o.x-(o.left??0))}, ${h-o.height/2-(o.y-(o.top??0))})`),t.intersect=function(e){return K.rect(t,e)},a}e(Me,`consoleWindow`);function Ne(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y} + M ${i.x},${i.y} L ${o.x},${o.y}`}e(Ne,`createLine`);function Pe(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r,n.label=``;let a=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),o=Math.max(30,n?.width??0),{cssStyles:s}=n,c=T.svg(a),l=b(n,{});n.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=c.circle(0,0,o*2,l),d=Ne(o),f=c.path(d,l),p=a.insert(()=>u,`:first-child`);return p.insert(()=>f),p.attr(`class`,`outer-path`),s&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,s),i&&n.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,i),I(n,p),n.intersect=function(e){return t.info(`crossedCircle intersect`,n,{radius:o,point:e}),K.circle(n,o,e)},a}e(Pe,`crossedCircle`);function Y(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;iS,`:first-child`).attr(`stroke-opacity`,0),C.insert(()=>v,`:first-child`),C.attr(`class`,`text`),f&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),C.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Fe,`curlyBraceLeft`);function X(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;iS,`:first-child`).attr(`stroke-opacity`,0),C.insert(()=>v,`:first-child`),C.attr(`class`,`text`),f&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),C.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,m,e)},i}e(Ie,`curlyBraceRight`);function Z(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;iE,`:first-child`).attr(`stroke-opacity`,0),D.insert(()=>y,`:first-child`),D.insert(()=>C,`:first-child`),D.attr(`class`,`text`),f&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),I(t,D),t.intersect=function(e){return K.polygon(t,h,e)},i}e(Le,`curlyBraces`);async function Re(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(5,c.height+o*2,t?.height??0),u=l/2,d=u-Math.sqrt(Math.max(0,u**2-(c.height/2)**2)),f=Math.max(l/4,d),p=Math.max(20,c.width+a*2+f*2,(c.width+a*2)*1.25,t?.width??0),{cssStyles:m}=t,h=T.svg(s),g=b(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=p,v=l,y=_-u,S=v/4,C=[{x:y,y:0},{x:S,y:0},{x:0,y:v/2},{x:S,y:v},{x:y,y:v},...B(-y,-v/2,u,50,270,90)],w=R(C),E=h.path(w,g),D=s.insert(()=>E,`:first-child`);return D.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&D.selectChildren(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&D.selectChildren(`path`).attr(`style`,r),D.attr(`transform`,`translate(${-p/2}, ${-l/2})`),I(t,D),t.intersect=function(e){return K.polygon(t,C,e)},s}e(Re,`curvedTrapezoid`);async function ze(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??20,c=Math.max(a.width+s*2,t.width??0,100),l=Math.min(Math.max(c*.23,16),56),u=l*.27,d=Math.max(a.height+s*2,t.height?t.height-(2*l-u):0),f=Math.min(c*.177,d*.45),p=d+2*l-u,m=-p/2,h=m+2*l-u,g=i.insert(`g`,`:first-child`).attr(`class`,`basic label-container`),{cssStyles:_}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=b(t,{}),r=e.path(q(-c/2,h,c,d,f),n),a=e.circle(0,m+l,l*2,n);g.insert(()=>a,`:first-child`),g.insert(()=>r,`:first-child`),_&&g.attr(`style`,_)}else g.append(`rect`).attr(`x`,-c/2).attr(`y`,h).attr(`width`,c).attr(`height`,d).attr(`rx`,f).attr(`ry`,f).attr(`style`,r),g.append(`circle`).attr(`cx`,0).attr(`cy`,m+l).attr(`r`,l).attr(`style`,r);I(t,g);let v=h+d/2;o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${v-a.height/2-(a.y-(a.top??0))})`);let y=m+l,S=Math.asin(Math.min(1,(h-y)/l))*180/Math.PI,C=[...B(0,-y,l,24,180+S,-S),...B(-(-c/2+f),-(h+f),f,12,90,0),...B(-(-c/2+f),-(p/2-f),f,12,360,270),...B(-(c/2-f),-(p/2-f),f,12,270,180),...B(-(c/2-f),-(h+f),f,12,180,90)];return t.intersect=function(e){return K.polygon(t,C,e)},i}e(ze,`person`);var Be=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),Ve=e((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),He=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),Ue=8,We=8;async function Ge(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i,s=t.width??0;if(t.width&&(t.width-=o,t.widtho,`:first-child`),g=c.insert(()=>a,`:first-child`),g.attr(`class`,`basic label-container`),_&&g.attr(`style`,_)}else{let e=Be(0,0,d,m,f,p);g=c.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,h(_)).attr(`style`,r)}return g.attr(`label-offset-y`,p),g.attr(`transform`,`translate(${-d/2}, ${-(m/2+p)})`),I(t,g),u.attr(`transform`,`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+(t.padding??0)/1.5-(l.y-(l.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(f!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-p)){let i=p*p*(1-r*r/(f*f));i>0&&(i=Math.sqrt(i)),i=p-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},c}e(Ge,`cylinder`);async function Ke(e,t,n){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await P(e,t,L(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:f,ry:p}=t,{cssStyles:m}=t;if(n?.rx&&n.ry&&(f=n.rx,p=n.ry),t.look===`handDrawn`){let e=T.svg(a),n=b(t,{}),r=f||p?e.path(q(l,u,s,c,f||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,h(m))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,h(f)).attr(`ry`,h(p)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return I(t,d,t.look===`handDrawn`?void 0:{width:s,height:c}),t.calcIntersect=function(e,t){return K.rect(e,t)},t.intersect=function(e){return K.rect(t,e)},a}e(Ke,`drawRect`);async function qe(e,t){let{cssClasses:n,labelPaddingX:r,labelPaddingY:i,padding:a,width:o,height:s}=t,c=await Ke(e,t,{rx:0,ry:0,classes:n??``,labelPaddingX:r??(a??0)*2,labelPaddingY:i??a??0});if(t.look===`handDrawn`){let e=T.svg(c),n=b(t,{}),r=c.select(`.basic.label-container > path:nth-child(2)`),i=r.node();if(!i)return c;let a=null;if(i instanceof SVGGraphicsElement)a=i.getBBox();else return c;return c.insert(()=>e.line(a.x,a.y,a.x+a.width,a.y,n),`.basic.label-container g.label`),c.insert(()=>e.line(a.x,a.y+a.height,a.x+a.width,a.y+a.height,n),`.basic.label-container g.label`),r.remove(),c}let l=c.select(`.basic.label-container`),u=(Number(l.attr(`width`))||o)??0,d=(Number(l.attr(`height`))||s)??0;return u>0&&d>0&&l.attr(`stroke-dasharray`,`${u} ${d}`),c}e(qe,`datastore`);async function Je(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:m}=t,h=T.svg(o),g=b(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],v=h.polygon(_.map(e=>[e.x,e.y]),g),y=o.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(t.padding??0)/2-(s.y-(s.top??0))})`),I(t,y),t.intersect=function(e){return K.rect(t,e)},o}e(Je,`dividedRectangle`);async function Ye(e,n){let{labelStyles:r,nodeStyles:i}=x(n),a=n.look===`neo`?12:5;n.labelStyle=r;let o=n.padding??0,s=n.look===`neo`?16:o,{shapeSvg:c,bbox:l}=await P(e,n,L(n)),u=Math.sqrt(l.width**2+l.height**2)/2,d=(n?.width?n?.width/2:u)+(s??0),f=d+a,p,{cssStyles:m}=n;if(n.look===`handDrawn`){let e=T.svg(c),t=b(n,{roughness:.2,strokeWidth:2.5}),r=b(n,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,f*2,t),a=e.circle(0,0,d*2,r);p=c.insert(`g`,`:first-child`),p.attr(`class`,h(n.cssClasses)).attr(`style`,h(m)),p.node()?.appendChild(i),p.node()?.appendChild(a)}else{p=c.insert(`g`,`:first-child`);let e=p.insert(`circle`,`:first-child`),t=p.insert(`circle`);p.attr(`class`,`basic label-container`).attr(`style`,i),e.attr(`class`,`outer-circle`).attr(`style`,i).attr(`r`,f).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,i).attr(`r`,d).attr(`cx`,0).attr(`cy`,0)}return I(n,p),n.intersect=function(e){return t.info(`DoubleCircle intersect`,n,f,e),K.circle(n,f,e)},c}e(Ye,`doublecircle`);async function Xe(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o}=await P(e,t,L(t)),{theme:s,themeVariables:c}=u();w(i,t.colorIndex,s,c.borderColorArray);let l=o??10,d=a.width/2+l*2,f=a.height/2+l*2,p,{cssStyles:m}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=b(t,{}),r=e.ellipse(0,0,d*2,f*2,n);p=i.insert(()=>r,`:first-child`),p.attr(`class`,`basic label-container`),m&&p.attr(`style`,m)}else p=i.insert(`ellipse`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,r).attr(`rx`,d).attr(`ry`,f).attr(`cx`,0).attr(`cy`,0);return t.width=d*2,t.height=f*2,I(t,p),t.calcIntersect=function(e,t){let n=e.width/2,r=e.height/2;return K.ellipse(e,n,r,t)},t.intersect=function(e){return K.ellipse(t,d,f,e)},i}e(Xe,`usecaseEllipse`);function Ze(e,n,{config:{themeVariables:r}}){let{labelStyles:i,nodeStyles:a}=x(n);n.label=``,n.labelStyle=i;let o=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),{cssStyles:s}=n,c=T.svg(o),{nodeBorder:l}=r,u=b(n,{fillStyle:`solid`});n.look!==`handDrawn`&&(u.roughness=0);let d=c.circle(0,0,14,u),f=o.insert(()=>d,`:first-child`);return f.selectAll(`path`).attr(`style`,`fill: ${l} !important;`),s&&s.length>0&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,s),a&&n.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,a),I(n,f),n.intersect=function(e){return t.info(`filledCircle intersect`,n,{radius:7,point:e}),K.circle(n,7,e)},o}e(Ze,`filledCircle`);var Qe=10,$e=10;async function et(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.height=n?.height??0,n.heightv,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return m&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,m),i&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,i),n.width=u,n.height=d,I(n,y),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-d/2+(n.padding??0)/2+(c.y-(c.top??0))})`),n.intersect=function(e){return t.info(`Triangle intersect`,n,p,e),K.polygon(n,p,e)},s}e(et,`flippedTriangle`);async function tt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??12,c=Math.max(a.width+s*2,t.width??0,90),l=a.height+s*2,u=Math.max(Math.min(l*.16,14),8),d=Math.max(l+u,t.height??0),f=d-u,p=Math.max(c*.38,28),m=-d/2,h=[{x:-c/2,y:m},{x:-c/2+p,y:m},{x:-c/2+p,y:m+u},{x:c/2,y:m+u},{x:c/2,y:d/2},{x:-c/2,y:d/2}],g=[`M${h[0].x},${h[0].y}`,...h.slice(1).map(e=>`L${e.x},${e.y}`),`Z`].join(` `),{cssStyles:_}=t,v;if(t.look===`handDrawn`){let e=T.svg(i).path(g,b(t,{}));v=i.insert(()=>e,`:first-child`).attr(`class`,`basic label-container`),_&&v.attr(`style`,_)}else v=i.insert(`path`,`:first-child`).attr(`d`,g).attr(`class`,`basic label-container`).attr(`style`,r);t.look===`handDrawn`?I(t,v):I(t,v,{width:c,height:d});let y=m+u+f/2;return o.attr(`transform`,`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${y-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(e){return K.polygon(t,h,e)},i}e(tt,`folder`);function nt(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=x(t);t.label=``;let o=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);(n===`LR`||n===`RL`)&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=T.svg(o),p=b(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=f.rectangle(u,d,c,l,p),h=o.insert(()=>m,`:first-child`);s&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,a),I(t,h);let g=r?.padding??0;return t.width&&t.height&&(t.width+=g/2||0,t.height+=g/2||0),t.intersect=function(e){return K.rect(t,e)},o}e(nt,`forkJoin`);async function rt(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let a=n.look===`neo`?16:n.padding??0,o=n.look===`neo`?12:n.padding??0;(n.width||n.height)&&(n.height=(n?.height??0)-o*2,n.height<10&&(n.height=10),n.width=(n?.width??0)-a*2,n.width<15&&(n.width=15));let{shapeSvg:s,bbox:c}=await P(e,n,L(n)),l=(n?.height?n?.height:Math.max(10,c.height))+o*2,u=l/2,d=u-Math.sqrt(Math.max(0,u**2-(c.height/2)**2)),f=(n?.width?n?.width:Math.max(15,c.width)+d*2)+a*2,{cssStyles:p}=n,m=T.svg(s),h=b(n,{});n.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-f/2,y:-l/2},{x:f/2-u,y:-l/2},...B(-f/2+u,0,u,50,90,270),{x:f/2-u,y:l/2},{x:-f/2,y:l/2}],_=R(g),v=m.path(_,h),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),p&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,p),i&&n.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,i),I(n,y),n.intersect=function(e){return t.info(`Pill intersect`,n,{radius:u,point:e}),K.polygon(n,g,e)},s}e(rt,`halfRoundedRectangle`);var it=e((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function at(e,t){let{labelStyles:n,nodeStyles:r}=x(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await P(e,t,L(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,f=(t?.width?t?.width:l.width)+2*d+s,p=[{x:d,y:0},{x:f-d,y:0},{x:f,y:-u/2},{x:f-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=T.svg(c),n=b(t,{}),r=it(0,0,f,u,d),i=e.path(r,n);m=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-f/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=J(c,f,u,p);return r&&m.attr(`style`,r),t.width=f,t.height=u,I(t,m),t.intersect=function(e){return K.polygon(t,p,e)},c}e(at,`hexagon`);async function ot(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.label=``,n.labelStyle=r;let{shapeSvg:a}=await P(e,n,L(n)),o=Math.max(30,n?.width??0),s=Math.max(30,n?.height??0),{cssStyles:c}=n,l=T.svg(a),u=b(n,{});n.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=[{x:0,y:0},{x:o,y:0},{x:0,y:s},{x:o,y:s}],f=R(d),p=l.path(f,u),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`basic label-container outer-path`),c&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,c),i&&n.look!==`handDrawn`&&m.selectChildren(`path`).attr(`style`,i),m.attr(`transform`,`translate(${-o/2}, ${-s/2})`),I(n,m),n.intersect=function(e){return t.info(`Pill intersect`,n,{points:d}),K.polygon(n,d,e)},a}e(ot,`hourglass`);async function st(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await P(e,n,`icon-shape default`),p=n.pos===`t`,m=c,h=c,{nodeBorder:g}=r,{stylesMap:v}=C(n),y=-h/2,S=-m/2,w=n.label?8:0,E=T.svg(u),D=b(n,{stroke:`none`,fill:`none`});n.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(y,S,h,m,D),k=Math.max(h,d.width),A=m+d.height+w,j=E.rectangle(-k/2,-A/2,k,A,{...D,fill:`transparent`,stroke:`none`}),M=u.insert(()=>O,`:first-child`),N=u.insert(()=>j);if(n.icon){let e=u.append(`g`);e.html(`${await _(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${p?d.height/2+w/2-i/2-o:-d.height/2-w/2-i/2-o})`),e.attr(`style`,`color: ${v.get(`stroke`)??g};`)}return f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${p?-A/2:A/2-d.height})`),M.attr(`transform`,`translate(0,${p?d.height/2+w/2:-d.height/2-w/2})`),I(n,N),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=p?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+w},{x:r+h/2,y:i-a/2+d.height+w},{x:r+h/2,y:i+a/2},{x:r-h/2,y:i+a/2},{x:r-h/2,y:i-a/2+d.height+w},{x:r-d.width/2,y:i-a/2+d.height+w}]:[{x:r-h/2,y:i-a/2},{x:r+h/2,y:i-a/2},{x:r+h/2,y:i-a/2+m},{x:r+d.width/2,y:i-a/2+m},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+m},{x:r-h/2,y:i-a/2+m}],K.polygon(n,o,e)},u}e(st,`icon`);async function ct(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,label:f}=await P(e,n,`icon-shape default`),p=n.label?8:0,m=n.pos===`t`,{nodeBorder:h,mainBkg:g}=r,{stylesMap:v}=C(n),y=T.svg(u),S=b(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`),S.stroke=v.get(`fill`)??g;let w=u.append(`g`);n.icon&&w.html(`${await _(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let E=w.node().getBBox(),D=E.width,O=E.height,k=E.x,A=E.y,j=Math.max(D,O)*Math.SQRT2+40,M=y.circle(0,0,j,S),N=Math.max(j,d.width),F=j+d.height+p,L=y.rectangle(-N/2,-F/2,N,F,{...S,fill:`transparent`,stroke:`none`}),R=u.insert(()=>M,`:first-child`),z=u.insert(()=>L);return w.attr(`transform`,`translate(${-D/2-k},${m?d.height/2+p/2-O/2-A:-d.height/2-p/2-O/2-A})`),w.attr(`style`,`color: ${v.get(`stroke`)??h};`),f.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-F/2:F/2-d.height})`),R.attr(`transform`,`translate(0,${m?d.height/2+p/2:-d.height/2-p/2})`),I(n,z),n.intersect=function(e){return t.info(`iconSquare intersect`,n,e),K.rect(n,e)},u}e(ct,`iconCircle`);async function lt(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await P(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,g=c+f*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:S}=C(n),w=-g/2,E=-h/2,D=n.label?8:0,O=T.svg(u),k=b(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=S.get(`fill`)??y;let A=O.path(q(w,E,g,h,5),k),j=Math.max(g,d.width),M=h+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),F=u.insert(()=>A,`:first-child`).attr(`class`,`icon-shape2`),L=u.insert(()=>N);if(n.icon){let e=u.append(`g`);e.html(`${await _(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${S.get(`stroke`)??v};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-M/2:M/2-d.height})`),F.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),I(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+g/2,y:i-a/2+d.height+D},{x:r+g/2,y:i+a/2},{x:r-g/2,y:i+a/2},{x:r-g/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-g/2,y:i-a/2},{x:r+g/2,y:i-a/2},{x:r+g/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-g/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(lt,`iconRounded`);async function ut(e,n,{config:{themeVariables:r,flowchart:i}}){let{labelStyles:a}=x(n);n.labelStyle=a;let o=n.assetHeight??48,s=n.assetWidth??48,c=Math.max(o,s),l=i?.wrappingWidth;n.width=Math.max(c,l??0);let{shapeSvg:u,bbox:d,halfPadding:f,label:p}=await P(e,n,`icon-shape default`),m=n.pos===`t`,h=c+f*2,g=c+f*2,{nodeBorder:v,mainBkg:y}=r,{stylesMap:S}=C(n),w=-g/2,E=-h/2,D=n.label?8:0,O=T.svg(u),k=b(n,{});n.look!==`handDrawn`&&(k.roughness=0,k.fillStyle=`solid`),k.stroke=S.get(`fill`)??y;let A=O.path(q(w,E,g,h,.1),k),j=Math.max(g,d.width),M=h+d.height+D,N=O.rectangle(-j/2,-M/2,j,M,{...k,fill:`transparent`,stroke:`none`}),F=u.insert(()=>A,`:first-child`),L=u.insert(()=>N);if(n.icon){let e=u.append(`g`);e.html(`${await _(n.icon,{height:c,width:c,fallbackPrefix:``})}`);let t=e.node().getBBox(),r=t.width,i=t.height,a=t.x,o=t.y;e.attr(`transform`,`translate(${-r/2-a},${m?d.height/2+D/2-i/2-o:-d.height/2-D/2-i/2-o})`),e.attr(`style`,`color: ${S.get(`stroke`)??v};`)}return p.attr(`transform`,`translate(${-d.width/2-(d.x-(d.left??0))},${m?-M/2:M/2-d.height})`),F.attr(`transform`,`translate(0,${m?d.height/2+D/2:-d.height/2-D/2})`),I(n,L),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=m?[{x:r-d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2},{x:r+d.width/2,y:i-a/2+d.height+D},{x:r+g/2,y:i-a/2+d.height+D},{x:r+g/2,y:i+a/2},{x:r-g/2,y:i+a/2},{x:r-g/2,y:i-a/2+d.height+D},{x:r-d.width/2,y:i-a/2+d.height+D}]:[{x:r-g/2,y:i-a/2},{x:r+g/2,y:i-a/2},{x:r+g/2,y:i-a/2+h},{x:r+d.width/2,y:i-a/2+h},{x:r+d.width/2/2,y:i+a/2},{x:r-d.width/2,y:i+a/2},{x:r-d.width/2,y:i-a/2+h},{x:r-g/2,y:i-a/2+h}],K.polygon(n,o,e)},u}e(ut,`iconSquare`);async function dt(e,n,{config:{flowchart:r}}){let i=new Image;i.src=n?.img??``,await i.decode();let a=Number(i.naturalWidth.toString().replace(`px`,``)),o=Number(i.naturalHeight.toString().replace(`px`,``));n.imageAspectRatio=a/o;let{labelStyles:s}=x(n);n.labelStyle=s;let c=r?.wrappingWidth;n.defaultWidth=r?.wrappingWidth;let l=Math.max(n.label?c??0:0,n?.assetWidth??a),u=n.constraint===`on`&&n?.assetHeight?n.assetHeight*n.imageAspectRatio:l,d=n.constraint===`on`?u/n.imageAspectRatio:n?.assetHeight??o;n.width=Math.max(u,c??0);let{shapeSvg:f,bbox:p,label:m}=await P(e,n,`image-shape default`),h=n.pos===`t`,g=-u/2,_=-d/2,v=n.label?8:0,y=T.svg(f),S=b(n,{});n.look!==`handDrawn`&&(S.roughness=0,S.fillStyle=`solid`);let C=y.rectangle(g,_,u,d,S),w=Math.max(u,p.width),E=d+p.height+v,D=y.rectangle(-w/2,-E/2,w,E,{...S,fill:`none`,stroke:`none`}),O=f.insert(()=>C,`:first-child`),k=f.insert(()=>D);if(n.img){let e=f.append(`image`);e.attr(`href`,n.img),e.attr(`width`,u),e.attr(`height`,d),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-u/2},${h?E/2-d:-E/2})`)}return m.attr(`transform`,`translate(${-p.width/2-(p.x-(p.left??0))},${h?-d/2-p.height/2-v/2:d/2-p.height/2+v/2})`),O.attr(`transform`,`translate(0,${h?p.height/2+v/2:-p.height/2-v/2})`),I(n,k),n.intersect=function(e){if(t.info(`iconSquare intersect`,n,e),!n.label)return K.rect(n,e);let r=n.x??0,i=n.y??0,a=n.height??0,o=[];return o=h?[{x:r-p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2},{x:r+p.width/2,y:i-a/2+p.height+v},{x:r+u/2,y:i-a/2+p.height+v},{x:r+u/2,y:i+a/2},{x:r-u/2,y:i+a/2},{x:r-u/2,y:i-a/2+p.height+v},{x:r-p.width/2,y:i-a/2+p.height+v}]:[{x:r-u/2,y:i-a/2},{x:r+u/2,y:i-a/2},{x:r+u/2,y:i-a/2+d},{x:r+p.width/2,y:i-a/2+d},{x:r+p.width/2/2,y:i+a/2},{x:r-p.width/2,y:i+a/2},{x:r-p.width/2,y:i-a/2+d},{x:r-u/2,y:i-a/2+d}],K.polygon(n,o,e)},f}e(dt,`imageSquare`);async function ft(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a*2,t.height??0),u=Math.max(c.width+o*2,(t.width??0)-l),d=[{x:0,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:-3*l/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ft,`inv_trapezoid`);async function pt(e,t){let{shapeSvg:n,bbox:r,label:i}=await P(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),I(t,a),t.intersect=function(e){return K.rect(t,e)},n}e(pt,`labelRect`);async function mt(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(mt,`lean_left`);async function ht(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(ht,`lean_right`);function gt(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.label=``,n.labelStyle=r;let a=e.insert(`g`).attr(`class`,L(n)).attr(`id`,n.domId??n.id),{cssStyles:o}=n,s=Math.max(35,n?.width??0),c=Math.max(35,n?.height??0),l=[{x:s,y:0},{x:0,y:c+7/2},{x:s-14,y:c+7/2},{x:0,y:2*c},{x:s,y:c-7/2},{x:14,y:c-7/2}],u=T.svg(a),d=b(n,{});n.look!==`handDrawn`&&(d.roughness=0,d.fillStyle=`solid`);let f=R(l),p=u.path(f,d),m=a.insert(()=>p,`:first-child`);return m.attr(`class`,`outer-path`),o&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,o),i&&n.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,i),m.attr(`transform`,`translate(-${s/2},${-c})`),I(n,m),n.intersect=function(e){return t.info(`lightningBolt intersect`,n,e),K.polygon(n,l,e)},a}e(gt,`lightningBolt`);var _t=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),vt=e((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),yt=e((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),bt=10,xt=10;async function St(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.widtho,`:first-child`).attr(`class`,`line`),g=s.insert(()=>a,`:first-child`),g.attr(`class`,`basic label-container`),_&&g.attr(`style`,_)}else{let e=_t(0,0,u,p,d,f,m);g=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,h(_)).attr(`style`,r)}return g.attr(`label-offset-y`,f),g.attr(`transform`,`translate(${-u/2}, ${-(p/2+f)})`),I(t,g),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+f-(c.y-(c.top??0))})`),t.intersect=function(e){let n=K.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}e(St,`linedCylinder`);async function Ct(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,f=t.look===`neo`?d/4:d/8,p=d+f,{cssStyles:m}=t,h=T.svg(s),g=b(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...z(-u/2-u/2*.1,p/2,u/2+u/2*.1,p/2,f,.8),{x:u/2+u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:-p/2},{x:-u/2,y:-p/2},{x:-u/2,y:p/2*1.1},{x:-u/2,y:-p/2}],v=h.polygon(_.map(e=>[e.x,e.y]),g),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),y.attr(`transform`,`translate(0,${-f/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-f-(c.y-(c.top??0))})`),I(t,y),t.intersect=function(e){return K.polygon(t,_,e)},s}e(Ct,`linedWaveEdgedRect`);var wt=56,Tt=72,Et=8,Dt=2,Ot=8,kt={normal:`usecase-actor-shape usecase-actor-normal`,hollow:`usecase-actor-hollow`,awesome:`usecase-actor-awesome`,icon:`usecase-actor-icon`},At=Math.PI/3,jt=.6,Mt=e((e,t)=>{let n=t*jt,r=t*Math.sqrt(1-jt**2),i=Math.cos(At),a=-Math.sin(At),o=n*-a,s=e+n*i,c=r*i,l=r*a;return`M ${o-c} ${s-l} L ${o+c} ${s+l}`},`businessMarkerPathForCircle`),Nt={normal:Mt(-24,12),hollow:Mt(-23,9),awesome:Mt(-21,13),icon:`M 12 -8 L 26 -26`},Pt=e((e,t,n)=>{let r=(t.x??0)-(t.left??0),i=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${-t.width/2-r},${n-t.height/2-i})`)},`positionLabel`),Ft=e((e,t,n,r,i=!1)=>{if(t.look===`handDrawn`){let a=T.svg(e).path(n,b(t,i?{fill:`none`}:{}));return e.insert(()=>a,`:first-child`).attr(`class`,r)}let a=e.append(`path`).attr(`class`,r).attr(`d`,n);return i&&a.attr(`fill`,`none`),a},`appendActorPath`),It=e((e,t,n,r,i,a,o=!1)=>{if(t.look===`handDrawn`){let s=T.svg(e).circle(n,r,i*2,b(t,o?{fill:`none`}:{}));return e.insert(()=>s,`:first-child`).attr(`class`,a)}let s=e.append(`circle`).attr(`class`,a).attr(`cx`,n).attr(`cy`,r).attr(`r`,i);return o&&s.attr(`fill`,`none`),s},`appendActorCircle`),Lt=e((e,t,n)=>{t.business&&e.append(`path`).attr(`class`,`usecase-business-marker usecase-actor-business-marker`).attr(`d`,Nt[n]).attr(`fill`,`none`).attr(`style`,`stroke: inherit !important; stroke-width: inherit !important`)},`appendBusinessActorMarker`);async function Rt(e,t,n,r){let{labelStyles:i,nodeStyles:a}=x(t);t.labelStyle=i;let{shapeSvg:o,bbox:s,label:c}=await P(e,n===`icon`||t.stereotype!==void 0?{...t,icon:n===`icon`?void 0:t.icon,stereotype:void 0}:t,L(t,`usecase-actor-variant usecase-actor-${n}`)),l=t.accessibleName??t.label;l&&o.attr(`role`,`img`).attr(`aria-label`,l),c.attr(`class`,`label actor-label usecase-actor-label`);let{theme:d,themeVariables:f}=u();w(o,t.colorIndex,d,f.borderColorArray);let p,m;if(t.stereotype){let e=await F(o,`\xAB${t.stereotype}\xBB`,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});p=e.label.attr(`class`,`label usecase-stereotype`),m=e.bbox}let h=o.append(`g`).attr(`class`,`usecase-actor-glyph ${kt[n]}`).attr(`style`,a||null);await r(h,t),Lt(h,t,n);let g=t.padding??Ot,_=m?.height??0,v=Tt+Et+s.height+(m?_+Dt:0),y=Math.max(wt,s.width,m?.width??0)+g*2,b=v+g*2,S=-v/2;h.attr(`transform`,`translate(0,${S+Tt/2})`);let C=S+Tt+Et;return p&&m&&(C+=_/2,Pt(p,m,C),C+=_/2+Dt),Pt(c,s,C+s.height/2),I(t,o.insert(`rect`,`:first-child`).attr(`class`,`usecase-actor-outline`).attr(`x`,-y/2).attr(`y`,-b/2).attr(`width`,y).attr(`height`,b).attr(`opacity`,0).attr(`aria-hidden`,`true`)),t.intersect=e=>K.rect(t,e),o}e(Rt,`renderUsecaseActor`);var zt=[`M 0 -12`,`C 6.627 -12 12 -17.373 12 -24`,`C 12 -30.627 6.627 -36 0 -36`,`C -6.627 -36 -12 -30.627 -12 -24`,`C -12 -17.373 -6.627 -12 0 -12 Z`,`M 0 -12 V 8`,`M -17 -5 H 17`,`M 0 8 L -15 28`,`M 0 8 L 15 28`].join(` `);async function Bt(e,t){return Rt(e,t,`normal`,(e,t)=>{Ft(e,t,zt,`usecase-actor-stick`)})}e(Bt,`usecaseActor`);var Vt=[`M 0 -34`,`C 7.18 -34 13 -28.18 13 -21`,`C 13 -13.82 7.18 -8 0 -8`,`C -7.18 -8 -13 -13.82 -13 -21`,`C -13 -28.18 -7.18 -34 0 -34 Z`,`M -24 25`,`C -24 7 -14 -3 0 -3`,`C 14 -3 24 7 24 25`,`C 24 28 21 30 18 30`,`H -18`,`C -21 30 -24 28 -24 25 Z`].join(` `);async function Ht(e,t){return Rt(e,t,`awesome`,(e,t)=>{Ft(e,t,Vt,`usecase-actor-awesome-silhouette`)})}e(Ht,`usecaseActorAwesome`);var Ut=[`M -22 -10`,`H 22`,`V 0`,`H 6`,`L 22 17`,`L 13 28`,`L 0 13`,`L -13 28`,`L -22 17`,`L -6 0`,`H -22`,`Z`].join(` `);async function Wt(e,t){return Rt(e,t,`hollow`,(e,t)=>{It(e,t,0,-23,9,`usecase-actor-hollow-head`,!0),Ft(e,t,Ut,`usecase-actor-hollow-body`,!0)})}e(Wt,`usecaseActorHollow`);var Gt=52,Kt=42,qt=-2,Jt=e(async(e,t)=>{let n=-Gt/2,r=qt-Gt/2;if(t.look===`handDrawn`){let i=T.svg(e).rectangle(n,r,Gt,Gt,b(t,{}));e.insert(()=>i,`:first-child`).attr(`class`,`usecase-actor-icon-frame`)}else e.append(`rect`).attr(`class`,`usecase-actor-icon-frame`).attr(`x`,n).attr(`y`,r).attr(`width`,Gt).attr(`height`,Gt).attr(`rx`,4).attr(`ry`,4);let i=t.icon??``,a=await g(i.includes(`:`)?i:`fa:${i}`),o=await _(i,{height:Kt,width:Kt,fallbackPrefix:`fa`}),s=e.append(`g`).attr(`class`,`usecase-actor-icon-symbol${a?``:` usecase-actor-icon-fallback`}`).attr(`aria-hidden`,`true`).html(`${o}`),c=s.node()?.getBBox();c&&s.attr(`transform`,`translate(${-c.width/2-c.x},${qt-c.height/2-c.y})`)},`drawIconActor`);async function Yt(e,t){return Rt(e,t,`icon`,Jt)}e(Yt,`usecaseActorIcon`);var Xt=e((e,t,n)=>{let r=(t.x??0)-(t.left??0),i=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${-t.width/2-r},${n-t.height/2-i})`)},`positionLabel`);async function Zt(e,t){let n=t,{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await P(e,n.stereotype?{...t,stereotype:void 0}:t,L(t,`usecase-business-shape`));c.attr(`class`,`label usecase-label`);let{theme:l,themeVariables:d}=u();w(a,t.colorIndex,l,d.borderColorArray);let f,p;if(n.stereotype){let e=await F(a,`\xAB${n.stereotype}\xBB`,{labelStyle:r,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});f=e.label.attr(`class`,`label usecase-stereotype`),p=e.bbox}let m=p?2:0,h=o.height+(p?.height??0)+m,g=Math.max(o.width,p?.width??0),_=s??10,v=g/2+_*2,y=h/2+_*2,S=Math.min(Math.max(_/5,1),_/2),C=g/2+S,E=v-S,D=C/v,O=E/v,k=y*Math.sqrt(Math.max(0,1-D*D)),A=-y*Math.sqrt(Math.max(0,1-O*O));f&&p&&Xt(f,p,-h/2+p.height/2),Xt(c,o,h/2-o.height/2);let j;if(t.look===`handDrawn`){let e=T.svg(a).ellipse(0,0,v*2,y*2,b(t,{}));j=a.insert(()=>e,`:first-child`).attr(`class`,`basic label-container usecase-business-ellipse`)}else j=a.insert(`ellipse`,`:first-child`).attr(`class`,`basic label-container usecase-business-ellipse`).attr(`style`,i).attr(`rx`,v).attr(`ry`,y).attr(`cx`,0).attr(`cy`,0);a.append(`path`).attr(`class`,`usecase-business-marker`).attr(`d`,`M ${C} ${k} L ${E} ${A}`).attr(`fill`,`none`).attr(`style`,i||null);let M=n.accessibleName??n.label;return M&&a.attr(`role`,`img`).attr(`aria-label`,M),I(t,j),t.calcIntersect=(e,t)=>K.ellipse(e,e.width/2,e.height/2,t),t.intersect=e=>K.ellipse(t,v,y,e),a}e(Zt,`usecaseBusiness`);var Qt=8,$t=4,en=1,tn=e((e,t,n,r)=>{let i=(t.x??0)-(t.left??0),a=(t.y??0)-(t.top??0);e.attr(`transform`,`translate(${n-t.width/2-i},${r-t.height/2-a})`)},`positionLabel`),nn=e(e=>{let t=Number.parseFloat(e??``);return Number.isFinite(t)&&t>=0?t:en},`numericStrokeWidth`);async function rn(t,n){let r=n,{labelStyles:i,nodeStyles:a}=x(n),{stylesMap:o}=C(n);n.labelStyle=i;let{shapeSvg:s,bbox:c,label:l}=await P(t,n,L(n,`usecase-json-table`));s.attr(`role`,`img`),r.accessibleName&&s.attr(`aria-label`,r.accessibleName),l.attr(`class`,`label usecase-json-title`);let u=s.append(`g`).attr(`class`,`usecase-json-table-grid`),d=[];for(let e of r.jsonRows??[]){let t=await F(u,e.key,{labelStyle:i,useHtmlLabels:n.useHtmlLabels,padding:0,centerLabel:!0}),r=await F(u,e.value,{labelStyle:i,useHtmlLabels:n.useHtmlLabels,padding:0,centerLabel:!0});d.push({key:{label:t.label.attr(`class`,`label usecase-json-key`),bbox:t.bbox},value:{label:r.label.attr(`class`,`label usecase-json-value`),bbox:r.bbox}})}let f=Math.max(0,...d.map(({key:e})=>e.bbox.width))+Qt*2,p=Math.max(0,...d.map(({value:e})=>e.bbox.width))+Qt*2,m=c.width+Qt*2,h=Math.max(m,f+p),g=p+Math.max(0,h-f-p),_=c.height+$t*2,v=d.map(({key:e,value:t})=>Math.max(e.bbox.height,t.bbox.height)+$t*2),y=_+v.reduce((e,t)=>e+t,0),S=nn(o.get(`stroke-width`)),w=h+S*2,E=y+S*2,D=-h/2,O=-y/2,k=n.look===`handDrawn`?T.svg(s):void 0,A=k?b(n,{}):void 0,j=e((e,t,n,r,i,o)=>{if(k&&A){let a=k.rectangle(n,r,i,o,A);return e.insert(()=>a,`:first-child`).attr(`class`,t)}return e.insert(`rect`,`:first-child`).attr(`class`,t).attr(`x`,n).attr(`y`,r).attr(`width`,i).attr(`height`,o).attr(`style`,a)},`insertCell`),M=j(s,`label-container usecase-json-border`,-w/2,-E/2,w,E);j(u,`usecase-json-cell usecase-json-title-cell`,D,O,h,_),u.node()?.append(l.node()),tn(l,c,0,O+_/2);let N=O+_;return d.forEach(({key:e,value:t},n)=>{let r=v[n],i=u.append(`g`).attr(`class`,`usecase-json-row`).attr(`data-row-index`,n).attr(`transform`,`translate(0,${N})`);j(i,`usecase-json-cell usecase-json-key-cell`,D,0,f,r),j(i,`usecase-json-cell usecase-json-value-cell`,D+f,0,g,r),i.node()?.append(e.label.node(),t.label.node()),tn(e.label,e.bbox,D+f/2,r/2),tn(t.label,t.bbox,D+f+g/2,r/2),N+=r}),I(n,M),n.intersect=e=>K.rect(n,e),s}e(rn,`usecaseJsonTable`);async function an(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await P(e,t,L(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,f=(t?.height?t?.height:l.height)+o*2+2*s,p=d-2*s,m=f-2*s,h=-p/2,g=-m/2,{cssStyles:_}=t,v=T.svg(c),y=b(t,{}),S=[{x:h-s,y:g+s},{x:h-s,y:g+m+s},{x:h+p-s,y:g+m+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g+m-s},{x:h+p+s,y:g+m-s},{x:h+p+s,y:g-s},{x:h+s,y:g-s},{x:h+s,y:g},{x:h,y:g},{x:h,y:g+s}],C=[{x:h,y:g+s},{x:h+p-s,y:g+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g},{x:h,y:g}];t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let w=R(S),E=v.path(w,y),D=R(C),O=v.path(D,y);t.look!==`handDrawn`&&(E=ee(E),O=ee(O));let k=c.insert(`g`,`:first-child`);return k.insert(()=>E),k.insert(()=>O),k.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&k.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),I(t,k),t.intersect=function(e){return K.polygon(t,S,e)},c}e(an,`multiRect`);async function on(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,f=Math.max(a.height,t?.height??0)+l*3,p=t.look===`neo`?f/4:f/8,m=f+(u?p/2:-p/2),h=-d/2,g=-m/2,{cssStyles:_}=t,v=z(h-10,g+m+10,h+d-10,g+m+10,p,.8),y=v?.[v.length-1],S=[{x:h-10,y:g+10},{x:h-10,y:g+m+10},...v,{x:h+d-10,y:y.y-10},{x:h+d,y:y.y-10},{x:h+d,y:y.y-20},{x:h+d+10,y:y.y-20},{x:h+d+10,y:g-10},{x:h+10,y:g-10},{x:h+10,y:g},{x:h,y:g},{x:h,y:g+10}],C=[{x:h,y:g+10},{x:h+d-10,y:g+10},{x:h+d-10,y:y.y-10},{x:h+d,y:y.y-10},{x:h+d,y:g},{x:h,y:g}],w=T.svg(i),E=b(t,{});t.look!==`handDrawn`&&(E.roughness=0,E.fillStyle=`solid`);let D=R(S),O=w.path(D,E),k=R(C),A=w.path(k,E),j=i.insert(()=>O,`:first-child`);return j.insert(()=>A),j.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&j.selectAll(`path`).attr(`style`,r),j.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p-(a.y-(a.top??0))})`),I(t,j),t.intersect=function(e){return K.polygon(t,S,e)},i}e(on,`multiWaveEdgedRectangle`);async function sn(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r,t.useHtmlLabels||o(s())||(t.centerLabel=!0);let{shapeSvg:a,bbox:c,label:l}=await P(e,t,L(t)),u=Math.max(c.width+(t.padding??0)*2,t?.width??0),d=Math.max(c.height+(t.padding??0)*2,t?.height??0),f=-u/2,p=-d/2,{cssStyles:m}=t,h=T.svg(a),g=b(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=h.rectangle(f,p,u,d,g),v=a.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),l.attr(`class`,`label noteLabel`),m&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,m),i&&t.look!==`handDrawn`&&v.selectAll(`path`).attr(`style`,i),l.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),I(t,v),t.intersect=function(e){return K.rect(t,e)},a}e(sn,`note`);var cn=e((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function ln(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await P(e,t,L(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=T.svg(i),n=b(t,{}),r=cn(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=J(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),I(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}];return K.polygon(e,r,t)},t.intersect=function(e){return this.calcIntersect(t,e)},i}e(ln,`question`);async function un(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=c.width+(t.look===`neo`?a*2:a),d=Math.max(c.height+(t.look===`neo`?o*2:o),t.height??0),f=d/4,p=-Math.max(u,(t.width??0)-f)/2,m=-d/2,h=m/2,g=[{x:p+h,y:m},{x:p,y:0},{x:p+h,y:-m},{x:-p,y:-m},{x:-p,y:m}],{cssStyles:_}=t,v=T.svg(s),y=b(t,{});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let S=R(g),C=v.path(S,y),w=s.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${-h/2},0)`),l.attr(`transform`,`translate(${-h/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),I(t,w),t.intersect=function(e){return K.polygon(t,g,e)},s}e(un,`rect_left_inv_arrow`);async function dn(e,r){let{labelStyles:i,nodeStyles:a}=x(r);r.labelStyle=i;let s;s=r.cssClasses?`node `+r.cssClasses:`node default`;let c=e.insert(`g`).attr(`class`,s).attr(`id`,r.domId||r.id),l=c.insert(`g`),d=c.insert(`g`).attr(`class`,`label`).attr(`style`,a),f=r.description,p=r.label,m=await se(d,p,r.labelStyle,!0,!0),h={width:0,height:0};if(o(u())){let e=m.children[0],t=n(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}t.info(`Text 2`,f);let g=f||[],_=m.getBBox(),v=await se(d,Array.isArray(g)?g.join(`
`):g,r.labelStyle,!0,!0),y=v.children[0],S=n(v);h=y.getBoundingClientRect(),S.attr(`width`,h.width),S.attr(`height`,h.height);let C=(r.padding||0)/2;n(v).attr(`transform`,`translate( `+(h.width>_.width?0:(_.width-h.width)/2)+`, `+(_.height+C+5)+`)`),n(m).attr(`transform`,`translate( `+(h.width<_.width?0:-(_.width-h.width)/2)+`, 0)`),h=d.node().getBBox(),d.attr(`transform`,`translate(`+-h.width/2+`, `+(-h.height/2-C+3)+`)`);let w=h.width+(r.padding||0),E=h.height+(r.padding||0),D=-h.width/2-C,O=-h.height/2-C,k,A;if(r.look===`handDrawn`){let e=T.svg(c),n=b(r,{}),i=e.path(q(D,O,w,E,r.rx||0),n),a=e.line(-h.width/2-C,-h.height/2-C+_.height+C,h.width/2+C,-h.height/2-C+_.height+C,n);A=c.insert(()=>(t.debug(`Rough node insert CXC`,i),a),`:first-child`),k=c.insert(()=>(t.debug(`Rough node insert CXC`,i),i),`:first-child`)}else k=l.insert(`rect`,`:first-child`),A=l.insert(`line`),k.attr(`class`,`outer title-state`).attr(`style`,a).attr(`x`,-h.width/2-C).attr(`y`,-h.height/2-C).attr(`width`,h.width+(r.padding||0)).attr(`height`,h.height+(r.padding||0)),A.attr(`class`,`divider`).attr(`x1`,-h.width/2-C).attr(`x2`,h.width/2+C).attr(`y1`,-h.height/2-C+_.height+C).attr(`y2`,-h.height/2-C+_.height+C);return I(r,k),r.intersect=function(e){return K.rect(r,e)},c}e(dn,`rectWithTitle`);async function fn(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return Ke(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}e(fn,`roundedRect`);var pn=8;async function mn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?pn:pn*2),u=(t?.height??s.height)+a*2,d=l-pn,f=u,p=pn-l/2,m=-u/2,{cssStyles:g}=t,_=T.svg(o),v=b(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:p,y:m},{x:p+d,y:m},{x:p+d,y:m+f},{x:p-pn,y:m+f},{x:p-pn,y:m},{x:p,y:m},{x:p,y:m+f}],S=_.polygon(y.map(e=>[e.x,e.y]),v),C=o.insert(()=>S,`:first-child`);return C.attr(`class`,`basic label-container outer-path`).attr(`style`,h(g)),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),g&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${pn/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),I(t,C),t.intersect=function(e){return K.rect(t,e)},o}e(mn,`shadedProcess`);async function hn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await P(e,t,L(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,f=u,p=d/1.5,m=-f/2,h=-p/2,{cssStyles:g}=t,_=T.svg(s),v=b(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:m,y:h},{x:m,y:h+p},{x:m+f,y:h+p},{x:m+f,y:h-p/2}],S=R(y),C=_.path(S,v),w=s.insert(()=>C,`:first-child`);return w.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,r),w.attr(`transform`,`translate(0, ${p/4})`),l.attr(`transform`,`translate(${-f/2+(t.padding??0)-(c.x-(c.left??0))}, ${-p/4+(t.padding??0)-(c.y-(c.top??0))})`),I(t,w),t.intersect=function(e){return K.polygon(t,y,e)},s}e(hn,`slopedRect`);async function gn(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n,a=await Ke(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i});if(t.colorIndex!==void 0){let{theme:e,themeVariables:n}=u();w(a,t.colorIndex,e,n.borderColorArray)}return a}e(gn,`squareRect`);var _n=50,vn=e((e,t,n)=>{let r=e.height+n,i=r*Math.cos(Math.PI/(2*(_n-1))),a=Math.sqrt(Math.max(0,i**2-e.height**2));return{w:Math.max(e.width+r/4+t,1.5*r+(r-i),e.width+t+r-a),h:r}},`stadiumDimensions`);async function yn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?40:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),{w:l,h:u}=vn(c,a,o),d=u/2,{cssStyles:f}=t,p=T.svg(s),m=b(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-l/2+d,y:-u/2},{x:l/2-d,y:-u/2},...B(-l/2+d,0,d,_n,90,270),{x:l/2-d,y:u/2},...B(l/2-d,0,d,_n,270,450)],g=R(h),_=p.path(g,m),v=s.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,r),I(t,v),t.intersect=function(e){return K.polygon(t,h,e)},s}e(yn,`stadium`);async function bn(e,t){return Ke(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}e(bn,`state`);function xn(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=T.svg(u),f=b(t,{});t.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=d.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),m=s??c,h=(t.width??0)*5/14,g=d.circle(0,0,h,{...f,fill:m,stroke:m,strokeWidth:2,fillStyle:`solid`}),_=u.insert(()=>p,`:first-child`);if(_.insert(()=>g),t.look!==`handDrawn`&&_.attr(`class`,`outer-path`),a&&_.selectAll(`path`).attr(`style`,a),i&&_.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;_.attr(`style`,`filter:url(#${n})`)}return I(t,_),t.intersect=function(e){return K.circle(t,(t.width??0)/2,e)},u}e(xn,`stateEnd`);function Sn(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=T.svg(a).circle(0,0,t.width,S(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return I(t,o),t.intersect=function(e){return K.circle(t,(t.width??7)/2,e)},a}e(Sn,`stateStart`);var Cn=8;async function wn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.width+2*Cn+a,t.width??0),u=Math.max(c.height+o,t.height??0),d=l-2*Cn,f=u,p=-l/2,m=-u/2,g=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=e.rectangle(p,m,d+16,f,n),i=e.line(p+Cn,m,p+Cn,m+f,n),a=e.line(p+Cn+d,m,p+Cn+d,m+f,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:c}=t;o.attr(`class`,`basic label-container`).attr(`style`,h(c)),I(t,o)}else{let e=J(s,d,f,g);r&&e.attr(`style`,r),I(t,e)}return t.intersect=function(e){return K.polygon(t,g,e)},s}e(wn,`subroutine`);var Tn=.2;async function En(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-Tn*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.height?t?.height:c.height)+o*2,u=Tn*l,d=Tn*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,m=-f/2,h=-p/2,{cssStyles:g}=t,_=T.svg(s),v=b(t,{}),y=[{x:m-u/2,y:h},{x:m+f+u/2,y:h},{x:m+f+u/2,y:h+p},{x:m-u/2,y:h+p}],S=[{x:m+f-u/2,y:h+p},{x:m+f+u/2,y:h+p},{x:m+f+u/2,y:h+p-d}];t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let C=R(y),w=_.path(C,v),E=R(S),D=_.path(E,{...v,fillStyle:`solid`}),O=s.insert(()=>D,`:first-child`);return O.insert(()=>w,`:first-child`),O.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),I(t,O),t.intersect=function(e){return K.polygon(t,y,e)},s}e(En,`taggedRect`);async function Dn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await P(e,t,L(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,m=T.svg(i),h=b(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-s/2-s/2*.1,y:f/2},...z(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],_=-s/2+s/2*.1,v=-f/2-d*.4,y=[{x:_+s-u,y:(v+c)*1.3},{x:_+s,y:v+c-d},{x:_+s,y:(v+c)*.9},...z(_+s,(v+c)*1.25,_+s-u,(v+c)*1.3,-c*.02,.5)],S=R(g),C=m.path(S,h),w=R(y),E=m.path(w,{...h,fillStyle:`solid`}),D=i.insert(()=>E,`:first-child`);return D.insert(()=>C,`:first-child`),D.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&D.selectAll(`path`).attr(`style`,r),D.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),I(t,D),t.intersect=function(e){return K.polygon(t,g,e)},i}e(Dn,`taggedWaveEdgedRectangle`);async function On(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await P(e,t,L(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),I(t,u),t.intersect=function(e){return K.rect(t,e)},i}e(On,`text`);var kn=e((e,t,n,r,i,a)=>`M${e},${t} a${i},${a} 0,0,1 0,${-r} l${n},0 a${i},${a} 0,0,1 0,${r} M${n},${-r} a${i},${a} 0,0,0 0,${r} - l${-n},0`,`createCylinderPathD`),An=e((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),jn=e((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`),Mn=5,Nn=10;async function Pn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?12:i/2,o=t.height??0;if(t.height&&(t.height-=a,t.heighta,`:first-child`),v=s.insert(()=>i,`:first-child`),v.attr(`class`,`basic label-container`),m&&v.attr(`style`,m)}else{let e=kn(0,0,p,u,f,d);v=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,h(m)).attr(`style`,r),v.attr(`class`,`basic label-container outer-path`),m&&v.selectAll(`path`).attr(`style`,m),r&&v.selectAll(`path`).attr(`style`,r)}return v.attr(`label-offset-x`,f),v.attr(`transform`,`translate(${-p/2}, ${u/2} )`),l.attr(`transform`,`translate(${-(c.width/2)-f-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),I(t,v),t.intersect=function(e){let n=K.rect(t,e),r=n.y-(t.y??0);if(d!=0&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-f)){let i=f*f*(1-r*r/(d*d));i!=0&&(i=Math.sqrt(Math.abs(i))),i=f-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},s}e(Pn,`tiltedCylinder`);async function Fn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=(t.look,i),o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=g(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(Fn,`trapezoid`);async function In(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=(t.height??0)-o*2,t.height<5&&(t.height=5),t.width=(t.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o*2,{cssStyles:d}=t,f=T.svg(s),p=g(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{x:-l/2*.8,y:-u/2},{x:l/2*.8,y:-u/2},{x:l/2,y:-u/2*.6},{x:l/2,y:u/2},{x:-l/2,y:u/2},{x:-l/2,y:-u/2*.6}],h=R(m),v=f.path(h,p),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),d&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,r),I(t,y),t.intersect=function(e){return K.polygon(t,m,e)},s}e(In,`trapezoidalPentagon`);var Ln=10,Rn=10;async function zn(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.width=((n?.width??0)-o)/2,n.widthC,`:first-child`).attr(`transform`,`translate(${-m/2}, ${m/2})`).attr(`class`,`outer-path`);return y&&n.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,y),i&&n.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,i),n.width=p,n.height=m,I(n,w),d.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${m/2-(c.height+(n.padding??0)/(f?2:1)-(c.y-(c.top??0)))})`),n.intersect=function(e){return t.info(`Triangle intersect`,n,v,e),K.polygon(n,v,e)},s}e(zn,`triangle`);async function Bn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:c,bbox:l,label:u}=await P(e,t,L(t)),d=(t?.width?t?.width:l.width)+(a??0)*2,f=(t?.height?t?.height:l.height)+(o??0)*2,p=t.look===`neo`?f/4:f/8,m=f+(s?p:-p),{cssStyles:h}=t,v=14-d,y=v>0?v/2:0,b=T.svg(c),x=g(t,{});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=[{x:-d/2-y,y:m/2},...z(-d/2-y,m/2,d/2+y,m/2,p,.8),{x:d/2+y,y:-m/2},{x:-d/2-y,y:-m/2}],C=R(S),w=b.path(C,x),E=c.insert(()=>w,`:first-child`);return E.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,r),E.attr(`transform`,`translate(0,${-p/2})`),u.attr(`transform`,`translate(${-d/2+(t.padding??0)-(l.x-(l.left??0))},${-f/2+(t.padding??0)-p-(l.y-(l.top??0))})`),I(t,E),t.intersect=function(e){return K.polygon(t,S,e)},c}e(Bn,`waveEdgedRectangle`);async function Vn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let e=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-20/9*e),t.width-=a*2}let{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o,d=u/8,f=u+d*2,{cssStyles:p}=t,m=T.svg(s),h=g(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let v=[{x:-l/2,y:f/2},...z(-l/2,f/2,l/2,f/2,d,1),{x:l/2,y:-f/2},...z(l/2,-f/2,-l/2,-f/2,d,-1)],y=R(v),b=m.path(y,h),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),I(t,x),t.intersect=function(e){return K.polygon(t,v,e)},s}e(Vn,`waveRectangle`);var Q=10;async function Hn(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-Q,10),t.height=Math.max((t?.height??0)-a*2-Q,10));let{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=(t?.width?t?.width:s.width)+i*2+Q,u=(t?.height?t?.height:s.height)+a*2+Q,d=l-Q,f=u-Q,p=-d/2,m=-f/2,{cssStyles:h}=t,v=T.svg(o),y=g(t,{}),b=[{x:p-Q,y:m-Q},{x:p-Q,y:m+f},{x:p+d,y:m+f},{x:p+d,y:m-Q}],x=`M${p-Q},${m-Q} L${p+d},${m-Q} L${p+d},${m+f} L${p-Q},${m+f} L${p-Q},${m-Q} + l${-n},0`,`createCylinderPathD`),An=e((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),jn=e((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`),Mn=5,Nn=10;async function Pn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?12:i/2,o=t.height??0;if(t.height&&(t.height-=a,t.heighta,`:first-child`),g=s.insert(()=>i,`:first-child`),g.attr(`class`,`basic label-container`),m&&g.attr(`style`,m)}else{let e=kn(0,0,p,u,f,d);g=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,h(m)).attr(`style`,r),g.attr(`class`,`basic label-container outer-path`),m&&g.selectAll(`path`).attr(`style`,m),r&&g.selectAll(`path`).attr(`style`,r)}return g.attr(`label-offset-x`,f),g.attr(`transform`,`translate(${-p/2}, ${u/2} )`),l.attr(`transform`,`translate(${-(c.width/2)-f-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),I(t,g),t.intersect=function(e){let n=K.rect(t,e),r=n.y-(t.y??0);if(d!=0&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-f)){let i=f*f*(1-r*r/(d*d));i!=0&&(i=Math.sqrt(Math.abs(i))),i=f-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},s}e(Pn,`tiltedCylinder`);async function Fn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=(t.look,i),o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=Math.max(c.height+a,t.height??0),u=Math.max(c.width+o,(t.width??0)-l),d=[{x:-3*l/6,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=T.svg(s),n=b(t,{}),r=R(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=J(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,I(t,f),t.intersect=function(e){return K.polygon(t,d,e)},s}e(Fn,`trapezoid`);async function In(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=(t.height??0)-o*2,t.height<5&&(t.height=5),t.width=(t.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o*2,{cssStyles:d}=t,f=T.svg(s),p=b(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{x:-l/2*.8,y:-u/2},{x:l/2*.8,y:-u/2},{x:l/2,y:-u/2*.6},{x:l/2,y:u/2},{x:-l/2,y:u/2},{x:-l/2,y:-u/2*.6}],h=R(m),g=f.path(h,p),_=s.insert(()=>g,`:first-child`);return _.attr(`class`,`basic label-container outer-path`),d&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,r),I(t,_),t.intersect=function(e){return K.polygon(t,m,e)},s}e(In,`trapezoidalPentagon`);var Ln=10,Rn=10;async function zn(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let a=n.padding??0,o=n.look===`neo`?a*2:a;(n.width||n.height)&&(n.width=((n?.width??0)-o)/2,n.widthC,`:first-child`).attr(`transform`,`translate(${-m/2}, ${m/2})`).attr(`class`,`outer-path`);return _&&n.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,_),i&&n.look!==`handDrawn`&&w.selectChildren(`path`).attr(`style`,i),n.width=p,n.height=m,I(n,w),d.attr(`transform`,`translate(${-c.width/2-(c.x-(c.left??0))}, ${m/2-(c.height+(n.padding??0)/(f?2:1)-(c.y-(c.top??0)))})`),n.intersect=function(e){return t.info(`Triangle intersect`,n,g,e),K.polygon(n,g,e)},s}e(zn,`triangle`);async function Bn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:c,bbox:l,label:u}=await P(e,t,L(t)),d=(t?.width?t?.width:l.width)+(a??0)*2,f=(t?.height?t?.height:l.height)+(o??0)*2,p=t.look===`neo`?f/4:f/8,m=f+(s?p:-p),{cssStyles:h}=t,g=14-d,_=g>0?g/2:0,v=T.svg(c),y=b(t,{});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let S=[{x:-d/2-_,y:m/2},...z(-d/2-_,m/2,d/2+_,m/2,p,.8),{x:d/2+_,y:-m/2},{x:-d/2-_,y:-m/2}],C=R(S),w=v.path(C,y),E=c.insert(()=>w,`:first-child`);return E.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,r),E.attr(`transform`,`translate(0,${-p/2})`),u.attr(`transform`,`translate(${-d/2+(t.padding??0)-(l.x-(l.left??0))},${-f/2+(t.padding??0)-p-(l.y-(l.top??0))})`),I(t,E),t.intersect=function(e){return K.polygon(t,S,e)},c}e(Bn,`waveEdgedRectangle`);async function Vn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let e=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-20/9*e),t.width-=a*2}let{shapeSvg:s,bbox:c}=await P(e,t,L(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o,d=u/8,f=u+d*2,{cssStyles:p}=t,m=T.svg(s),h=b(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-l/2,y:f/2},...z(-l/2,f/2,l/2,f/2,d,1),{x:l/2,y:-f/2},...z(l/2,-f/2,-l/2,-f/2,d,-1)],_=R(g),v=m.path(_,h),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),I(t,y),t.intersect=function(e){return K.polygon(t,g,e)},s}e(Vn,`waveRectangle`);var Q=10;async function Hn(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-Q,10),t.height=Math.max((t?.height??0)-a*2-Q,10));let{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=(t?.width?t?.width:s.width)+i*2+Q,u=(t?.height?t?.height:s.height)+a*2+Q,d=l-Q,f=u-Q,p=-d/2,m=-f/2,{cssStyles:h}=t,g=T.svg(o),_=b(t,{}),v=[{x:p-Q,y:m-Q},{x:p-Q,y:m+f},{x:p+d,y:m+f},{x:p+d,y:m-Q}],y=`M${p-Q},${m-Q} L${p+d},${m-Q} L${p+d},${m+f} L${p-Q},${m+f} L${p-Q},${m-Q} M${p-Q},${m} L${p+d},${m} - M${p},${m-Q} L${p},${m+f}`;t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let S=v.path(x,y),C=o.insert(()=>S,`:first-child`);return C.attr(`transform`,`translate(${Q/2}, ${Q/2})`),C.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${-(s.width/2)+Q/2-(s.x-(s.left??0))}, ${-(s.height/2)+Q/2-(s.y-(s.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,b,e)},o}e(Hn,`windowPane`);var Un=new Set([`redux-color`,`redux-dark-color`]),Wn=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]);async function Gn(e,t){let r=t;r.alias&&(t.label=r.alias);let{theme:i,themeVariables:a}=s(),{rowEven:o,rowOdd:c,nodeBorder:u,borderColorArray:d}=a;if(t.look===`handDrawn`){let{themeVariables:n}=s(),{background:r}=n;await Gn(e,{...t,id:t.id+`-background`,domId:(t.domId||t.id)+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let f=s();t.useHtmlLabels=f.htmlLabels;let p=f.er?.diagramPadding??10,h=f.er?.entityPadding??6,{cssStyles:v}=t,{labelStyles:y,nodeStyles:b}=_(t);if(r.attributes.length===0&&t.label){let n={rx:0,ry:0,labelPaddingX:p,labelPaddingY:p*1.5,classes:``};m(t.label,f)+n.labelPaddingX*20){let e=C.width+p*2-(O+k+A+j);O+=e/P,k+=e/P,A>0&&(A+=e/P),j>0&&(j+=e/P)}let R=O+k+A+j,z=T.svg(S),B=g(t,{});t.look!==`handDrawn`&&(B.roughness=0,B.fillStyle=`solid`);let ee=0;D.length>0&&(ee=D.reduce((e,t)=>e+(t?.rowHeight??0),0));let V=Math.max(F.width+p*2,t?.width||0,R),te=Math.max((ee??0)+C.height,t?.height||0),H=-V/2,U=-te/2;if(S.selectAll(`g:not(:first-child)`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]),i.attr(`class`).includes(`attribute-name`)?o+=O:i.attr(`class`).includes(`attribute-keys`)?o+=O+k:i.attr(`class`).includes(`attribute-comment`)&&(o+=O+k+A))}i.attr(`transform`,`translate(${H+p/2+o}, ${s+U+C.height+h/2})`)}),S.select(`.name`).attr(`transform`,`translate(`+-C.width/2+`, `+(U+h/2)+`)`),i!=null&&Un.has(i)){let e=r.colorIndex??0;S.attr(`data-color-id`,`color-${e%d.length}`)}let ne=z.rectangle(H,U,V,te,B),re=S.insert(()=>ne,`:first-child`).attr(`class`,`outer-path`).attr(`style`,v.join(``));E.push(0);for(let[e,t]of D.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=z.rectangle(H,C.height+U+t?.yOffset,V,t?.rowHeight,{...B,fill:n?o:c,stroke:u});S.insert(()=>r,`g.label`).attr(`style`,v.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let ie=1e-4,W=qn(H,C.height+U,V+H,C.height+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B);if(S.insert(()=>G).attr(`class`,`divider`),W=qn(O+H,C.height+U,O+H,te+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`),M){let e=O+k+H;W=qn(e,C.height+U,e,te+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`)}if(N){let e=O+k+A+H;W=qn(e,C.height+U,e,te+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`)}for(let e of E){let t=C.height+U+e;W=qn(H,t,V+H,t,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`)}if(I(t,re),b&&t.look!==`handDrawn`)if(i!=null&&Wn.has(i))S.selectAll(`path`).attr(`style`,b);else{let e=b.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);S.selectAll(`path`).attr(`style`,e??``),S.selectAll(`.row-rect-even path`).attr(`style`,b)}return t.intersect=function(e){return K.rect(t,e)},S}e(Gn,`erBox`);async function Kn(e,t,r,i=0,o=0,s=[],c=``){let u=e.insert(`g`).attr(`class`,`label ${s.join(` `)}`).attr(`transform`,`translate(${i}, ${o})`).attr(`style`,c);t!==a(t)&&(t=a(t),t=t.replaceAll(`<`,`<`).replaceAll(`>`,`>`));let d=u.node().appendChild(await S(u,t,{width:m(t,r)+100,style:c,useHtmlLabels:r.htmlLabels},r));if(t.includes(`<`)||t.includes(`>`)){let e=d.children[0];for(e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`)}let f=d.getBBox();if(l(r.htmlLabels)){let e=d.children[0];e.style.textAlign=`start`;let t=n(d);f=e.getBoundingClientRect(),t.attr(`width`,f.width),t.attr(`height`,f.height)}return f}e(Kn,`addText`);function qn(e,t,n,r,i){return e===n?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}e(qn,`lineToPolygon`);async function Jn(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId||t.id),s=null,c=null,l=null,u=null,d=0,f=0,p=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await Yn(s,{text:`\xAB${e}\xBB`},0),d=s.node().getBBox().height}c=o.insert(`g`).attr(`class`,`label-group text`),await Yn(c,t,0,[`font-weight: bolder`]);let m=c.node().getBBox();f=m.height,l=o.insert(`g`).attr(`class`,`members-group text`);let h=0;for(let e of t.members){let t=await Yn(l,e,h,[e.parseClassifier()]);h+=t+a}p=l.node().getBBox().height,p<=0&&(p=i/2),u=o.insert(`g`).attr(`class`,`methods-group text`);let g=0;for(let e of t.methods){let t=await Yn(u,e,g,[e.parseClassifier()]);g+=t+a}let _=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return c.attr(`transform`,`translate(${-m.width/2}, ${d})`),_=o.node().getBBox(),l.attr(`transform`,`translate(0, ${d+f+i*2})`),_=o.node().getBBox(),u.attr(`transform`,`translate(0, ${d+f+(p?p+i*4:i*2)})`),_=o.node().getBBox(),{shapeSvg:o,bbox:_}}e(Jn,`textHelper`);async function Yn(e,t,a,o=[]){let c=e.insert(`g`).attr(`class`,`label`).attr(`style`,o.join(`; `)),u=s(),d=`useHtmlLabels`in t?t.useHtmlLabels:l(u.htmlLabels)??!0,p=``;p=`text`in t?t.text:t.label,!d&&p.startsWith(`\\`)&&(p=p.substring(1)),r(p)&&(d=!0);let h=await S(c,i(f(p)),{width:m(p,u)+50,classes:`markdown-node-label`,useHtmlLabels:d},u),g,_=1;if(d){let e=h.children[0],t=n(h);_=e.innerHTML.split(`
`).length,e.innerHTML.includes(``)&&(_+=e.innerHTML.split(``).length-1),await O(e),g=e.getBoundingClientRect(),t.attr(`width`,g.width),t.attr(`height`,g.height)}else{o.includes(`font-weight: bolder`)&&n(h).selectAll(`tspan`).attr(`font-weight`,``),_=h.children.length;let e=h.children[0];(h.textContent===``||h.textContent.includes(`>`))&&(e.textContent=p[0]+p.substring(1).replaceAll(`>`,`>`).replaceAll(`<`,`<`).trim(),p[1]===` `&&(e.textContent=e.textContent[0]+` `+e.textContent.substring(1))),e.textContent===`undefined`&&(e.textContent=``),g=h.getBBox()}return c.attr(`transform`,`translate(0,`+(-g.height/(2*_)+a)+`)`),g.height}e(Yn,`addText`);async function Xn(e,t){let r=u(),{theme:i,themeVariables:a}=r,{useGradient:o,borderColorArray:s}=a,c=r.class.padding??12,d=c,f=t.useHtmlLabels??l(r.htmlLabels)??!0,p=t;p.annotations=p.annotations??[],p.members=p.members??[],p.methods=p.methods??[];let{shapeSvg:m,bbox:h}=await Jn(e,t,r,f,d);w(m,t.colorIndex,i,s);let{labelStyles:v,nodeStyles:y}=_(t);t.labelStyle=v,t.cssStyles=p.styles||``;let b=p.styles?.join(`;`)||y||``;t.cssStyles||=b.replaceAll(`!important`,``).split(`;`);let x=p.members.length===0&&p.methods.length===0&&!r.class?.hideEmptyMembersBox,S=T.svg(m),C=g(t,{});t.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let E=Math.max(t.width??0,h.width),D=Math.max(t.height??0,h.height),O=(t.height??0)>h.height;p.members.length===0&&p.methods.length===0?D+=d:p.members.length>0&&p.methods.length===0&&(D+=d*2);let k=-E/2,A=-D/2,j=x?c*2:p.members.length===0&&p.methods.length===0?-c:0;O&&(j=c*2);let M=S.rectangle(k-c,A-c-(x?c:p.members.length===0&&p.methods.length===0?-c/2:0),E+2*c,D+2*c+j,C),N=m.insert(()=>M,`:first-child`);N.attr(`class`,`basic label-container outer-path`);let P=N.node().getBBox(),F=m.select(`.annotation-group`).node().getBBox().height-(x?c/2:0)||0,L=m.select(`.label-group`).node().getBBox().height-(x?c/2:0)||0,R=m.select(`.members-group`).node().getBBox().height-(x?c/2:0)||0,z=(F+L+A+c-(A-c-(x?c:p.members.length===0&&p.methods.length===0?-c/2:0)))/2;if(m.selectAll(`.text`).each((e,t,i)=>{let a=n(i[t]),o=a.attr(`transform`),s=0;if(o){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);e&&(s=parseFloat(e[2]))}let l=s+A+c-(x?c:p.members.length===0&&p.methods.length===0?-c/2:0);if(a.attr(`class`).includes(`methods-group`)){let e=Math.max(R,d/2);l=O?Math.max(z,F+L+e+A+d*2+c)+d*2:F+L+e+A+d*4+c}p.members.length===0&&p.methods.length===0&&r.class?.hideEmptyMembersBox&&(l=p.annotations.length>0?s-d:s),f||(l-=4);let u=k;(a.attr(`class`).includes(`label-group`)||a.attr(`class`).includes(`annotation-group`))&&(u=-a.node()?.getBBox().width/2||0,m.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(u=0)})),a.attr(`transform`,`translate(${u}, ${l})`)}),p.members.length>0||p.methods.length>0||x){let e=F+L+A+c,n=S.line(P.x,e,P.x+P.width,e+.001,C);m.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!o?` neo-line`:``}`).attr(`style`,b)}if(x||p.members.length>0||p.methods.length>0){let e=F+L+R+A+d*2+c,n=S.line(P.x,O?Math.max(z,e):e,P.x+P.width,(O?Math.max(z,e):e)+.001,C);m.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!o?` neo-line`:``}`).attr(`style`,b)}if(p.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,b),N.select(`:nth-child(2)`).attr(`style`,b),m.selectAll(`.divider`).select(`path`).attr(`style`,b),t.labelStyle?m.selectAll(`span`).attr(`style`,t.labelStyle):m.selectAll(`span`).attr(`style`,b),!f){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(b);if(t){let e=t[0].replace(`color`,`fill`);m.selectAll(`tspan`).attr(`style`,e)}else if(v){let t=e.exec(v);if(t){let e=t[0].replace(`color`,`fill`);m.selectAll(`tspan`).attr(`style`,e)}}}return I(t,N),t.intersect=function(e){return K.rect(t,e)},m}e(Xn,`classBox`);async function Zn(e,t){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r;let a=t,o=t,s=`verifyMethod`in t,c=L(t),l=u(),{themeVariables:d}=l,{borderColorArray:f,requirementEdgeLabelBackground:p}=d,m=l.layout===`elk`?`start`:`center`,h=e.insert(`g`).attr(`class`,c).attr(`id`,t.domId??t.id),v;v=s?await $(h,`<<${a.type}>>`,0,t.labelStyle):await $(h,`<<Element>>`,0,t.labelStyle);let y=v,b=await $(h,a.name,y,t.labelStyle+`; font-weight: bold;`);if(y+=b+20,s){let e=await $(h,`${a.requirementId?`ID: ${a.requirementId}`:``}`,y,t.labelStyle,m);y+=e;let n=await $(h,`${a.text?`Text: ${a.text}`:``}`,y,t.labelStyle,m);y+=n;let r=await $(h,`${a.risk?`Risk: ${a.risk}`:``}`,y,t.labelStyle,m);y+=r,await $(h,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:``}`,y,t.labelStyle,m)}else{let e=await $(h,`${o.type?`Type: ${o.type}`:``}`,y,t.labelStyle,m);y+=e,await $(h,`${o.docRef?`Doc Ref: ${o.docRef}`:``}`,y,t.labelStyle,m)}let x=(h.node()?.getBBox().width??200)+20,S=(h.node()?.getBBox().height??200)+20,C=-x/2,w=-S/2,E=T.svg(h),D=g(t,{});t.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(C,w,x,S,D),k=h.insert(()=>O,`:first-child`);if(k.attr(`class`,`basic label-container outer-path`).attr(`style`,i),f?.length){let e=t.colorIndex??0;h.attr(`data-color-id`,`color-${e%f.length}`)}if(h.selectAll(`.label`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]))}let c=s-S/2,l=C+20/2;(t===0||t===1)&&(l=o),i.attr(`transform`,`translate(${l}, ${c+20})`)}),y>v+b+20){let e=w+v+b+20,n;if(t.look===`neo`){let t=.001,r=[[C,e],[C+x,e],[C+x,e+t],[C,e+t]];n=E.polygon(r,D)}else n=E.line(C,e,C+x,e,D);h.insert(()=>n).attr(`class`,`divider`)}return I(t,k),t.intersect=function(e){return K.rect(t,e)},i&&t.look!==`handDrawn`&&(p||f?.length)&&h.selectAll(`path`).attr(`style`,i),h}e(Zn,`requirementBox`);async function $(e,t,r,a=``,o=`center`){if(t===``)return 0;let s=e.insert(`g`).attr(`class`,`label`).attr(`style`,a),c=u(),l=c.htmlLabels??!0,d=await S(s,i(f(t)),{width:m(t,c)+50,classes:`markdown-node-label`,useHtmlLabels:l,style:a},c),p;if(l){let e=d.children[0],t=n(d);o===`start`&&n(e).style(`text-align`,`left`),p=e.getBoundingClientRect(),t.attr(`width`,p.width),t.attr(`height`,p.height)}else{let e=d.children[0];for(let t of e.children)a&&t.setAttribute(`style`,a);if(o===`start`){e.setAttribute(`text-anchor`,`start`);for(let t of e.children)t.setAttribute(`text-anchor`,`start`)}p=d.getBBox(),p.height+=6}return s.attr(`transform`,`translate(${-p.width/2},${-p.height/2+r})`),p.height}e($,`addText`);var Qn=e(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`);async function $n(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=_(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=t.padding||10,u=``,d;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),d=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,u).attr(`target`,`_blank`));let f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},p,m;d?{label:p,bbox:m}=await F(d,`ticket`in t&&t.ticket||``,f):{label:p,bbox:m}=await F(o,`ticket`in t&&t.ticket||``,f);let{label:h,bbox:v}=await F(o,`assigned`in t&&t.assigned||``,f);t.width=a;let y=t?.width||0,b=Math.max(m.height,v.height)/2,x=Math.max(s.height+20,t?.height||0)+b,S=-y/2,C=-x/2;c.attr(`transform`,`translate(`+(l-y/2)+`, `+(-b-s.height/2)+`)`),p.attr(`transform`,`translate(`+(l-y/2)+`, `+(-b+s.height/2)+`)`),h.attr(`transform`,`translate(`+(l+y/2-v.width-20)+`, `+(-b+s.height/2)+`)`);let w,{rx:E,ry:D}=t,{cssStyles:O}=t;if(t.look===`handDrawn`){let e=T.svg(o),n=g(t,{}),r=E||D?e.path(q(S,C,y,x,E||0),n):e.rectangle(S,C,y,x,n);w=o.insert(()=>r,`:first-child`),w.attr(`class`,`basic label-container`).attr(`style`,O||null)}else{w=o.insert(`rect`,`:first-child`),w.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,E??5).attr(`ry`,D??5).attr(`x`,S).attr(`y`,C).attr(`width`,y).attr(`height`,x);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=S+2,r=C+Math.floor((E??0)/2),i=C+x-Math.floor((E??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,Qn(e))}}return I(t,w),t.height=x,t.intersect=function(e){return K.rect(t,e)},o}e($n,`kanbanItem`);async function er(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await P(e,n,L(n)),l=o.width+10*s,u=o.height+8*s,d=.15*l,{cssStyles:f}=n,p=o.width+20,m=o.height+20,v=Math.max(l,p),y=Math.max(u,m);c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`);let b,x=`M0 0 - a${d},${d} 1 0,0 ${v*.25},${-1*y*.1} - a${d},${d} 1 0,0 ${v*.25},0 - a${d},${d} 1 0,0 ${v*.25},0 - a${d},${d} 1 0,0 ${v*.25},${y*.1} + M${p},${m-Q} L${p},${m+f}`;t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let S=g.path(y,_),C=o.insert(()=>S,`:first-child`);return C.attr(`transform`,`translate(${Q/2}, ${Q/2})`),C.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${-(s.width/2)+Q/2-(s.x-(s.left??0))}, ${-(s.height/2)+Q/2-(s.y-(s.top??0))})`),I(t,C),t.intersect=function(e){return K.polygon(t,v,e)},o}e(Hn,`windowPane`);var Un=new Set([`redux-color`,`redux-dark-color`]),Wn=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]);async function Gn(e,t){let r=t;r.alias&&(t.label=r.alias);let{theme:i,themeVariables:a}=s(),{rowEven:o,rowOdd:c,nodeBorder:u,borderColorArray:d}=a;if(t.look===`handDrawn`){let{themeVariables:n}=s(),{background:r}=n;await Gn(e,{...t,id:t.id+`-background`,domId:(t.domId||t.id)+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let f=s();t.useHtmlLabels=f.htmlLabels;let p=f.er?.diagramPadding??10,h=f.er?.entityPadding??6,{cssStyles:g}=t,{labelStyles:_,nodeStyles:v}=x(t);if(r.attributes.length===0&&t.label){let n={rx:0,ry:0,labelPaddingX:p,labelPaddingY:p*1.5,classes:``};m(t.label,f)+n.labelPaddingX*20){let e=C.width+p*2-(O+k+A+j);O+=e/P,k+=e/P,A>0&&(A+=e/P),j>0&&(j+=e/P)}let R=O+k+A+j,z=T.svg(S),B=b(t,{});t.look!==`handDrawn`&&(B.roughness=0,B.fillStyle=`solid`);let ee=0;D.length>0&&(ee=D.reduce((e,t)=>e+(t?.rowHeight??0),0));let V=Math.max(F.width+p*2,t?.width||0,R),te=Math.max((ee??0)+C.height,t?.height||0),H=-V/2,U=-te/2;if(S.selectAll(`g:not(:first-child)`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]),i.attr(`class`).includes(`attribute-name`)?o+=O:i.attr(`class`).includes(`attribute-keys`)?o+=O+k:i.attr(`class`).includes(`attribute-comment`)&&(o+=O+k+A))}i.attr(`transform`,`translate(${H+p/2+o}, ${s+U+C.height+h/2})`)}),S.select(`.name`).attr(`transform`,`translate(`+-C.width/2+`, `+(U+h/2)+`)`),i!=null&&Un.has(i)){let e=r.colorIndex??0;S.attr(`data-color-id`,`color-${e%d.length}`)}let ne=z.rectangle(H,U,V,te,B),re=S.insert(()=>ne,`:first-child`).attr(`class`,`outer-path`).attr(`style`,g.join(``));E.push(0);for(let[e,t]of D.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=z.rectangle(H,C.height+U+t?.yOffset,V,t?.rowHeight,{...B,fill:n?o:c,stroke:u});S.insert(()=>r,`g.label`).attr(`style`,g.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let ie=1e-4,W=qn(H,C.height+U,V+H,C.height+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B);if(S.insert(()=>G).attr(`class`,`divider`),W=qn(O+H,C.height+U,O+H,te+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`),M){let e=O+k+H;W=qn(e,C.height+U,e,te+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`)}if(N){let e=O+k+A+H;W=qn(e,C.height+U,e,te+U,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`)}for(let e of E){let t=C.height+U+e;W=qn(H,t,V+H,t,ie),G=z.polygon(W.map(e=>[e.x,e.y]),B),S.insert(()=>G).attr(`class`,`divider`)}if(I(t,re),v&&t.look!==`handDrawn`)if(i!=null&&Wn.has(i))S.selectAll(`path`).attr(`style`,v);else{let e=v.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);S.selectAll(`path`).attr(`style`,e??``),S.selectAll(`.row-rect-even path`).attr(`style`,v)}return t.intersect=function(e){return K.rect(t,e)},S}e(Gn,`erBox`);async function Kn(e,t,r,i=0,o=0,s=[],c=``){let u=e.insert(`g`).attr(`class`,`label ${s.join(` `)}`).attr(`transform`,`translate(${i}, ${o})`).attr(`style`,c);t!==a(t)&&(t=a(t),t=t.replaceAll(`<`,`<`).replaceAll(`>`,`>`));let d=u.node().appendChild(await v(u,t,{width:m(t,r)+100,style:c,useHtmlLabels:r.htmlLabels},r));if(t.includes(`<`)||t.includes(`>`)){let e=d.children[0];for(e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`<`,`<`).replaceAll(`>`,`>`)}let f=d.getBBox();if(l(r.htmlLabels)){let e=d.children[0];e.style.textAlign=`start`;let t=n(d);f=e.getBoundingClientRect(),t.attr(`width`,f.width),t.attr(`height`,f.height)}return f}e(Kn,`addText`);function qn(e,t,n,r,i){return e===n?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}e(qn,`lineToPolygon`);async function Jn(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,L(t)).attr(`id`,t.domId||t.id),s=null,c=null,l=null,u=null,d=0,f=0,p=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await Yn(s,{text:`\xAB${e}\xBB`},0),d=s.node().getBBox().height}c=o.insert(`g`).attr(`class`,`label-group text`),await Yn(c,t,0,[`font-weight: bolder`]);let m=c.node().getBBox();f=m.height,l=o.insert(`g`).attr(`class`,`members-group text`);let h=0;for(let e of t.members){let t=await Yn(l,e,h,[e.parseClassifier()]);h+=t+a}p=l.node().getBBox().height,p<=0&&(p=i/2),u=o.insert(`g`).attr(`class`,`methods-group text`);let g=0;for(let e of t.methods){let t=await Yn(u,e,g,[e.parseClassifier()]);g+=t+a}let _=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return c.attr(`transform`,`translate(${-m.width/2}, ${d})`),_=o.node().getBBox(),l.attr(`transform`,`translate(0, ${d+f+i*2})`),_=o.node().getBBox(),u.attr(`transform`,`translate(0, ${d+f+(p?p+i*4:i*2)})`),_=o.node().getBBox(),{shapeSvg:o,bbox:_}}e(Jn,`textHelper`);async function Yn(e,t,a,o=[]){let c=e.insert(`g`).attr(`class`,`label`).attr(`style`,o.join(`; `)),u=s(),d=`useHtmlLabels`in t?t.useHtmlLabels:l(u.htmlLabels)??!0,p=``;p=`text`in t?t.text:t.label,!d&&p.startsWith(`\\`)&&(p=p.substring(1)),r(p)&&(d=!0);let h=await v(c,i(f(p)),{width:m(p,u)+50,classes:`markdown-node-label`,useHtmlLabels:d},u),g,_=1;if(d){let e=h.children[0],t=n(h);_=e.innerHTML.split(`
`).length,e.innerHTML.includes(``)&&(_+=e.innerHTML.split(``).length-1),await O(e),g=e.getBoundingClientRect(),t.attr(`width`,g.width),t.attr(`height`,g.height)}else{o.includes(`font-weight: bolder`)&&n(h).selectAll(`tspan`).attr(`font-weight`,``),_=h.children.length;let e=h.children[0];(h.textContent===``||h.textContent.includes(`>`))&&(e.textContent=p[0]+p.substring(1).replaceAll(`>`,`>`).replaceAll(`<`,`<`).trim(),p[1]===` `&&(e.textContent=e.textContent[0]+` `+e.textContent.substring(1))),e.textContent===`undefined`&&(e.textContent=``),g=h.getBBox()}return c.attr(`transform`,`translate(0,`+(-g.height/(2*_)+a)+`)`),g.height}e(Yn,`addText`);async function Xn(e,t){let r=u(),{theme:i,themeVariables:a}=r,{useGradient:o,borderColorArray:s}=a,c=r.class.padding??12,d=c,f=t.useHtmlLabels??l(r.htmlLabels)??!0,p=t;p.annotations=p.annotations??[],p.members=p.members??[],p.methods=p.methods??[];let{shapeSvg:m,bbox:h}=await Jn(e,t,r,f,d);w(m,t.colorIndex,i,s);let{labelStyles:g,nodeStyles:_}=x(t);t.labelStyle=g,t.cssStyles=p.styles||``;let v=p.styles?.join(`;`)||_||``;t.cssStyles||=v.replaceAll(`!important`,``).split(`;`);let y=p.members.length===0&&p.methods.length===0&&!r.class?.hideEmptyMembersBox,S=T.svg(m),C=b(t,{});t.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let E=Math.max(t.width??0,h.width),D=Math.max(t.height??0,h.height),O=(t.height??0)>h.height;p.members.length===0&&p.methods.length===0?D+=d:p.members.length>0&&p.methods.length===0&&(D+=d*2);let k=-E/2,A=-D/2,j=y?c*2:p.members.length===0&&p.methods.length===0?-c:0;O&&(j=c*2);let M=S.rectangle(k-c,A-c-(y?c:p.members.length===0&&p.methods.length===0?-c/2:0),E+2*c,D+2*c+j,C),N=m.insert(()=>M,`:first-child`);N.attr(`class`,`basic label-container outer-path`);let P=N.node().getBBox(),F=m.select(`.annotation-group`).node().getBBox().height-(y?c/2:0)||0,L=m.select(`.label-group`).node().getBBox().height-(y?c/2:0)||0,R=m.select(`.members-group`).node().getBBox().height-(y?c/2:0)||0,z=(F+L+A+c-(A-c-(y?c:p.members.length===0&&p.methods.length===0?-c/2:0)))/2;if(m.selectAll(`.text`).each((e,t,i)=>{let a=n(i[t]),o=a.attr(`transform`),s=0;if(o){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);e&&(s=parseFloat(e[2]))}let l=s+A+c-(y?c:p.members.length===0&&p.methods.length===0?-c/2:0);if(a.attr(`class`).includes(`methods-group`)){let e=Math.max(R,d/2);l=O?Math.max(z,F+L+e+A+d*2+c)+d*2:F+L+e+A+d*4+c}p.members.length===0&&p.methods.length===0&&r.class?.hideEmptyMembersBox&&(l=p.annotations.length>0?s-d:s),f||(l-=4);let u=k;(a.attr(`class`).includes(`label-group`)||a.attr(`class`).includes(`annotation-group`))&&(u=-a.node()?.getBBox().width/2||0,m.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(u=0)})),a.attr(`transform`,`translate(${u}, ${l})`)}),p.members.length>0||p.methods.length>0||y){let e=F+L+A+c,n=S.line(P.x,e,P.x+P.width,e+.001,C);m.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!o?` neo-line`:``}`).attr(`style`,v)}if(y||p.members.length>0||p.methods.length>0){let e=F+L+R+A+d*2+c,n=S.line(P.x,O?Math.max(z,e):e,P.x+P.width,(O?Math.max(z,e):e)+.001,C);m.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!o?` neo-line`:``}`).attr(`style`,v)}if(p.look!==`handDrawn`&&m.selectAll(`path`).attr(`style`,v),N.select(`:nth-child(2)`).attr(`style`,v),m.selectAll(`.divider`).select(`path`).attr(`style`,v),t.labelStyle?m.selectAll(`span`).attr(`style`,t.labelStyle):m.selectAll(`span`).attr(`style`,v),!f){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(v);if(t){let e=t[0].replace(`color`,`fill`);m.selectAll(`tspan`).attr(`style`,e)}else if(g){let t=e.exec(g);if(t){let e=t[0].replace(`color`,`fill`);m.selectAll(`tspan`).attr(`style`,e)}}}return I(t,N),t.intersect=function(e){return K.rect(t,e)},m}e(Xn,`classBox`);async function Zn(e,t){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r;let a=t,o=t,s=`verifyMethod`in t,c=L(t),l=u(),{themeVariables:d}=l,{borderColorArray:f,requirementEdgeLabelBackground:p}=d,m=l.layout===`elk`?`start`:`center`,h=e.insert(`g`).attr(`class`,c).attr(`id`,t.domId??t.id),g;g=s?await $(h,`<<${a.type}>>`,0,t.labelStyle):await $(h,`<<Element>>`,0,t.labelStyle);let _=g,v=await $(h,a.name,_,t.labelStyle+`; font-weight: bold;`);if(_+=v+20,s){let e=await $(h,`${a.requirementId?`ID: ${a.requirementId}`:``}`,_,t.labelStyle,m);_+=e;let n=await $(h,`${a.text?`Text: ${a.text}`:``}`,_,t.labelStyle,m);_+=n;let r=await $(h,`${a.risk?`Risk: ${a.risk}`:``}`,_,t.labelStyle,m);_+=r,await $(h,`${a.verifyMethod?`Verification: ${a.verifyMethod}`:``}`,_,t.labelStyle,m)}else{let e=await $(h,`${o.type?`Type: ${o.type}`:``}`,_,t.labelStyle,m);_+=e,await $(h,`${o.docRef?`Doc Ref: ${o.docRef}`:``}`,_,t.labelStyle,m)}let y=(h.node()?.getBBox().width??200)+20,S=(h.node()?.getBBox().height??200)+20,C=-y/2,w=-S/2,E=T.svg(h),D=b(t,{});t.look!==`handDrawn`&&(D.roughness=0,D.fillStyle=`solid`);let O=E.rectangle(C,w,y,S,D),k=h.insert(()=>O,`:first-child`);if(k.attr(`class`,`basic label-container outer-path`).attr(`style`,i),f?.length){let e=t.colorIndex??0;h.attr(`data-color-id`,`color-${e%f.length}`)}if(h.selectAll(`.label`).each((e,t,r)=>{let i=n(r[t]),a=i.attr(`transform`),o=0,s=0;if(a){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);e&&(o=parseFloat(e[1]),s=parseFloat(e[2]))}let c=s-S/2,l=C+20/2;(t===0||t===1)&&(l=o),i.attr(`transform`,`translate(${l}, ${c+20})`)}),_>g+v+20){let e=w+g+v+20,n;if(t.look===`neo`){let t=.001,r=[[C,e],[C+y,e],[C+y,e+t],[C,e+t]];n=E.polygon(r,D)}else n=E.line(C,e,C+y,e,D);h.insert(()=>n).attr(`class`,`divider`)}return I(t,k),t.intersect=function(e){return K.rect(t,e)},i&&t.look!==`handDrawn`&&(p||f?.length)&&h.selectAll(`path`).attr(`style`,i),h}e(Zn,`requirementBox`);async function $(e,t,r,a=``,o=`center`){if(t===``)return 0;let s=e.insert(`g`).attr(`class`,`label`).attr(`style`,a),c=u(),l=c.htmlLabels??!0,d=await v(s,i(f(t)),{width:m(t,c)+50,classes:`markdown-node-label`,useHtmlLabels:l,style:a},c),p;if(l){let e=d.children[0],t=n(d);o===`start`&&n(e).style(`text-align`,`left`),p=e.getBoundingClientRect(),t.attr(`width`,p.width),t.attr(`height`,p.height)}else{let e=d.children[0];for(let t of e.children)a&&t.setAttribute(`style`,a);if(o===`start`){e.setAttribute(`text-anchor`,`start`);for(let t of e.children)t.setAttribute(`text-anchor`,`start`)}p=d.getBBox(),p.height+=6}return s.attr(`transform`,`translate(${-p.width/2},${-p.height/2+r})`),p.height}e($,`addText`);var Qn=e(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`);async function $n(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=x(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:c}=await P(e,t,L(t)),l=t.padding||10,u=``,d;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),d=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,u).attr(`target`,`_blank`));let f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},p,m;d?{label:p,bbox:m}=await F(d,`ticket`in t&&t.ticket||``,f):{label:p,bbox:m}=await F(o,`ticket`in t&&t.ticket||``,f);let{label:h,bbox:g}=await F(o,`assigned`in t&&t.assigned||``,f);t.width=a;let _=t?.width||0,v=Math.max(m.height,g.height)/2,y=Math.max(s.height+20,t?.height||0)+v,S=-_/2,C=-y/2;c.attr(`transform`,`translate(`+(l-_/2)+`, `+(-v-s.height/2)+`)`),p.attr(`transform`,`translate(`+(l-_/2)+`, `+(-v+s.height/2)+`)`),h.attr(`transform`,`translate(`+(l+_/2-g.width-20)+`, `+(-v+s.height/2)+`)`);let w,{rx:E,ry:D}=t,{cssStyles:O}=t;if(t.look===`handDrawn`){let e=T.svg(o),n=b(t,{}),r=E||D?e.path(q(S,C,_,y,E||0),n):e.rectangle(S,C,_,y,n);w=o.insert(()=>r,`:first-child`),w.attr(`class`,`basic label-container`).attr(`style`,O||null)}else{w=o.insert(`rect`,`:first-child`),w.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,E??5).attr(`ry`,D??5).attr(`x`,S).attr(`y`,C).attr(`width`,_).attr(`height`,y);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=S+2,r=C+Math.floor((E??0)/2),i=C+y-Math.floor((E??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,Qn(e))}}return I(t,w),t.height=y,t.intersect=function(e){return K.rect(t,e)},o}e($n,`kanbanItem`);async function er(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await P(e,n,L(n)),l=o.width+10*s,u=o.height+8*s,d=.15*l,{cssStyles:f}=n,p=o.width+20,m=o.height+20,g=Math.max(l,p),_=Math.max(u,m);c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`);let v,y=`M0 0 + a${d},${d} 1 0,0 ${g*.25},${-1*_*.1} + a${d},${d} 1 0,0 ${g*.25},0 + a${d},${d} 1 0,0 ${g*.25},0 + a${d},${d} 1 0,0 ${g*.25},${_*.1} - a${d},${d} 1 0,0 ${v*.15},${y*.33} - a${d*.8},${d*.8} 1 0,0 0,${y*.34} - a${d},${d} 1 0,0 ${-1*v*.15},${y*.33} + a${d},${d} 1 0,0 ${g*.15},${_*.33} + a${d*.8},${d*.8} 1 0,0 0,${_*.34} + a${d},${d} 1 0,0 ${-1*g*.15},${_*.33} - a${d},${d} 1 0,0 ${-1*v*.25},${y*.15} - a${d},${d} 1 0,0 ${-1*v*.25},0 - a${d},${d} 1 0,0 ${-1*v*.25},0 - a${d},${d} 1 0,0 ${-1*v*.25},${-1*y*.15} + a${d},${d} 1 0,0 ${-1*g*.25},${_*.15} + a${d},${d} 1 0,0 ${-1*g*.25},0 + a${d},${d} 1 0,0 ${-1*g*.25},0 + a${d},${d} 1 0,0 ${-1*g*.25},${-1*_*.15} - a${d},${d} 1 0,0 ${-1*v*.1},${-1*y*.33} - a${d*.8},${d*.8} 1 0,0 0,${-1*y*.34} - a${d},${d} 1 0,0 ${v*.1},${-1*y*.33} - H0 V0 Z`;if(n.look===`handDrawn`){let e=T.svg(a),t=g(n,{}),r=e.path(x,t);b=a.insert(()=>r,`:first-child`),b.attr(`class`,`basic label-container`).attr(`style`,h(f))}else b=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,x);return b.attr(`transform`,`translate(${-v/2}, ${-y/2})`),I(n,b),n.calcIntersect=function(e,t){return K.rect(e,t)},n.intersect=function(e){return t.info(`Bang intersect`,n,e),K.rect(n,e)},a}e(er,`bang`);async function tr(e,n){let{labelStyles:r,nodeStyles:i}=_(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await P(e,n,L(n)),l=o.width+2*s,u=o.height+2*s,d=.15*l,f=.25*l,p=.35*l,m=.2*l,{cssStyles:v}=n,y,b=`M0 0 + a${d},${d} 1 0,0 ${-1*g*.1},${-1*_*.33} + a${d*.8},${d*.8} 1 0,0 0,${-1*_*.34} + a${d},${d} 1 0,0 ${g*.1},${-1*_*.33} + H0 V0 Z`;if(n.look===`handDrawn`){let e=T.svg(a),t=b(n,{}),r=e.path(y,t);v=a.insert(()=>r,`:first-child`),v.attr(`class`,`basic label-container`).attr(`style`,h(f))}else v=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,y);return v.attr(`transform`,`translate(${-g/2}, ${-_/2})`),I(n,v),n.calcIntersect=function(e,t){return K.rect(e,t)},n.intersect=function(e){return t.info(`Bang intersect`,n,e),K.rect(n,e)},a}e(er,`bang`);async function tr(e,n){let{labelStyles:r,nodeStyles:i}=x(n);n.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s,label:c}=await P(e,n,L(n)),l=o.width+2*s,u=o.height+2*s,d=.15*l,f=.25*l,p=.35*l,m=.2*l,{cssStyles:g}=n,_,v=`M0 0 a${d},${d} 0 0,1 ${l*.25},${-1*l*.1} a${p},${p} 1 0,1 ${l*.4},${-1*l*.1} a${f},${f} 1 0,1 ${l*.35},${l*.2} @@ -39,7 +39,7 @@ import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src. a${d},${d} 1 0,1 ${-1*l*.1},${-1*u*.35} a${m},${m} 1 0,1 ${l*.1},${-1*u*.65} - H0 V0 Z`;if(n.look===`handDrawn`){let e=T.svg(a),t=g(n,{}),r=e.path(b,t);y=a.insert(()=>r,`:first-child`),y.attr(`class`,`basic label-container`).attr(`style`,h(v))}else y=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,b);return c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`),y.attr(`transform`,`translate(${-l/2}, ${-u/2})`),I(n,y),n.calcIntersect=function(e,t){return K.rect(e,t)},n.intersect=function(e){return t.info(`Cloud intersect`,n,e),K.rect(n,e)},a}e(tr,`cloud`);async function nr(e,t){let{labelStyles:n,nodeStyles:r}=_(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await P(e,t,L(t)),c=a.width+8*o,l=a.height+2*o,u=t.look===`neo`?` + H0 V0 Z`;if(n.look===`handDrawn`){let e=T.svg(a),t=b(n,{}),r=e.path(v,t);_=a.insert(()=>r,`:first-child`),_.attr(`class`,`basic label-container`).attr(`style`,h(g))}else _=a.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`d`,v);return c.attr(`transform`,`translate(${-o.width/2}, ${-o.height/2})`),_.attr(`transform`,`translate(${-l/2}, ${-u/2})`),I(n,_),n.calcIntersect=function(e,t){return K.rect(e,t)},n.intersect=function(e){return t.info(`Cloud intersect`,n,e),K.rect(n,e)},a}e(tr,`cloud`);async function nr(e,t){let{labelStyles:n,nodeStyles:r}=x(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await P(e,t,L(t)),c=a.width+8*o,l=a.height+2*o,u=t.look===`neo`?` M${-c/2} ${l/2-5} v${-l+10} q0,-5 5,-5 diff --git a/web/dist/app-chunk-7M6MHVWA.js b/web/dist/app-chunk-7M6MHVWA.js index bbee9fe8f..dcaa7fc5f 100644 --- a/web/dist/app-chunk-7M6MHVWA.js +++ b/web/dist/app-chunk-7M6MHVWA.js @@ -1,18 +1,18 @@ -import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{G as i,H as a,U as o,a as s,d as c,it as l,q as u,s as d,v as f,w as p,x as m,y as h}from"./app-chunk-O7XYJQB3.js";import{t as g}from"./app-channel.js";import{c as _,g as v}from"./app-chunk-ZIGJFQKS.js";import{n as ee,t as te}from"./app-chunk-LNGE3PJU.js";import{i as ne,n as y,o as b,r as x}from"./app-chunk-J5ZVWO5B.js";import{a as S}from"./app-chunk-7INBJB4K.js";import{r as C,t as w}from"./app-chunk-GNY47TPC.js";import{t as T}from"./app-chunk-5VM5RSS4.js";import{t as E}from"./app-chunk-GWA4HPMP.js";import{t as D}from"./app-chunk-XXDRQBXY.js";import{t as O}from"./app-chunk-WEXAMYUT.js";var re=`flowchart-`,ie=class{constructor(){this.vertexCounter=0,this.config=m(),this.diagramId=``,this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=o,this.setAccDescription=a,this.setDiagramTitle=u,this.getAccTitle=h,this.getAccDescription=f,this.getDiagramTitle=p,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen(`gen-2`)}static{t(this,`FlowDB`)}sanitizeText(e){return d.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,r,i,a,o,s={},c){if(!e||e.trim().length===0)return;let l;if(c!==void 0){let e;e=c.includes(` +import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{G as i,H as a,U as o,a as s,d as c,it as l,q as u,s as d,v as f,w as p,x as m,y as h}from"./app-chunk-O7XYJQB3.js";import{t as g}from"./app-channel.js";import{c as _,g as v}from"./app-chunk-ZIGJFQKS.js";import{t as ee}from"./app-chunk-5VM5RSS4.js";import{i as te,n as ne,o as y,r as b}from"./app-chunk-J5ZVWO5B.js";import{a as x}from"./app-chunk-7INBJB4K.js";import{t as S}from"./app-chunk-GWA4HPMP.js";import{t as C}from"./app-chunk-XXDRQBXY.js";import{t as w}from"./app-chunk-WEXAMYUT.js";import{r as T,t as E}from"./app-chunk-GNY47TPC.js";import{n as D,t as O}from"./app-chunk-LNGE3PJU.js";var re=`flowchart-`,ie=class{constructor(){this.vertexCounter=0,this.config=m(),this.diagramId=``,this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=o,this.setAccDescription=a,this.setDiagramTitle=u,this.getAccTitle=h,this.getAccDescription=f,this.getDiagramTitle=p,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen(`gen-2`)}static{t(this,`FlowDB`)}sanitizeText(e){return d.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,r,i,a,o,s={},c){if(!e||e.trim().length===0)return;let l;if(c!==void 0){let e;e=c.includes(` `)?c+` `:`{ `+c+` -}`,l=ee(e,{schema:te})}let u=this.subGraphLookup.get(e);if(u&&l){u.metadata={...u.metadata,...l};return}let d=this.edges.find(t=>t.id===e);if(d){let e=l;e?.animate!==void 0&&(d.animate=e.animate),e?.animation!==void 0&&(d.animation=e.animation),e?.curve!==void 0&&(d.interpolate=e.curve);return}let f,p=this.vertices.get(e);if(p===void 0&&(t===void 0&&r===void 0&&i!=null&&n.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),p={id:e,labelType:`text`,domId:re+e+`-`+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,p)),this.vertexCounter++,t===void 0?p.text===void 0&&(p.text=e):(this.config=m(),f=this.sanitizeText(t.text.trim()),p.labelType=t.type,f.startsWith(`"`)&&f.endsWith(`"`)&&(f=f.substring(1,f.length-1)),p.text=f),r!==void 0&&(p.type=r),i?.forEach(e=>{p.styles.push(e)}),a?.forEach(e=>{p.classes.push(e)}),o!==void 0&&(p.dir=o),p.props===void 0?p.props=s:s!==void 0&&Object.assign(p.props,s),l!==void 0){if(l.shape){if(l.shape!==l.shape.toLowerCase()||l.shape.includes(`_`))throw Error(`No such shape: ${l.shape}. Shape names should be lowercase.`);if(!S(l.shape))throw Error(`No such shape: ${l.shape}.`);p.type=l?.shape}l?.label&&(p.text=l?.label,p.labelType=this.sanitizeNodeLabelType(l?.labelType)),l?.icon&&(p.icon=l?.icon,!l.label?.trim()&&p.text===e&&(p.text=``)),l?.form&&(p.form=l?.form),l?.pos&&(p.pos=l?.pos),l?.img&&(p.img=l?.img,!l.label?.trim()&&p.text===e&&(p.text=``)),l?.constraint&&(p.constraint=l.constraint),l.w&&(p.assetWidth=Number(l.w)),l.h&&(p.assetHeight=Number(l.h))}}addSingleLink(e,t,r,i){let a={start:e,end:t,type:void 0,text:``,labelType:`text`,classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};n.info(`abc78 Got edge...`,a);let o=r.text;if(o!==void 0&&(a.text=this.sanitizeText(o.text.trim()),a.text.startsWith(`"`)&&a.text.endsWith(`"`)&&(a.text=a.text.substring(1,a.text.length-1)),a.labelType=this.sanitizeNodeLabelType(o.type)),r!==void 0&&(a.type=r.type,a.stroke=r.stroke,a.length=r.length>10?10:r.length),i&&!this.edges.some(e=>e.id===i))a.id=i,a.isUserDefinedId=!0;else{let e=this.edges.filter(e=>e.start===a.start&&e.end===a.end);a.id=e.length===0?_(a.start,a.end,{counter:0,prefix:`L`}):_(a.start,a.end,{counter:e.length+1,prefix:`L`})}if(this.edges.length<(this.config.maxEdges??500))n.info(`Pushing edge...`),this.edges.push(a);else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. +}`,l=D(e,{schema:O})}let u=this.subGraphLookup.get(e);if(u&&l){u.metadata={...u.metadata,...l};return}let d=this.edges.find(t=>t.id===e);if(d){let e=l;e?.animate!==void 0&&(d.animate=e.animate),e?.animation!==void 0&&(d.animation=e.animation),e?.curve!==void 0&&(d.interpolate=e.curve);return}let f,p=this.vertices.get(e);if(p===void 0&&(t===void 0&&r===void 0&&i!=null&&n.warn(`Style applied to unknown node "${e}". This may indicate a typo. The node will be created automatically.`),p={id:e,labelType:`text`,domId:re+e+`-`+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,p)),this.vertexCounter++,t===void 0?p.text===void 0&&(p.text=e):(this.config=m(),f=this.sanitizeText(t.text.trim()),p.labelType=t.type,f.startsWith(`"`)&&f.endsWith(`"`)&&(f=f.substring(1,f.length-1)),p.text=f),r!==void 0&&(p.type=r),i?.forEach(e=>{p.styles.push(e)}),a?.forEach(e=>{p.classes.push(e)}),o!==void 0&&(p.dir=o),p.props===void 0?p.props=s:s!==void 0&&Object.assign(p.props,s),l!==void 0){if(l.shape){if(l.shape!==l.shape.toLowerCase()||l.shape.includes(`_`))throw Error(`No such shape: ${l.shape}. Shape names should be lowercase.`);if(!x(l.shape))throw Error(`No such shape: ${l.shape}.`);p.type=l?.shape}l?.label&&(p.text=l?.label,p.labelType=this.sanitizeNodeLabelType(l?.labelType)),l?.icon&&(p.icon=l?.icon,!l.label?.trim()&&p.text===e&&(p.text=``)),l?.form&&(p.form=l?.form),l?.pos&&(p.pos=l?.pos),l?.img&&(p.img=l?.img,!l.label?.trim()&&p.text===e&&(p.text=``)),l?.constraint&&(p.constraint=l.constraint),l.w&&(p.assetWidth=Number(l.w)),l.h&&(p.assetHeight=Number(l.h))}}addSingleLink(e,t,r,i){let a={start:e,end:t,type:void 0,text:``,labelType:`text`,classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};n.info(`abc78 Got edge...`,a);let o=r.text;if(o!==void 0&&(a.text=this.sanitizeText(o.text.trim()),a.text.startsWith(`"`)&&a.text.endsWith(`"`)&&(a.text=a.text.substring(1,a.text.length-1)),a.labelType=this.sanitizeNodeLabelType(o.type)),r!==void 0&&(a.type=r.type,a.stroke=r.stroke,a.length=r.length>10?10:r.length),i&&!this.edges.some(e=>e.id===i))a.id=i,a.isUserDefinedId=!0;else{let e=this.edges.filter(e=>e.start===a.start&&e.end===a.end);a.id=e.length===0?_(a.start,a.end,{counter:0,prefix:`L`}):_(a.start,a.end,{counter:e.length+1,prefix:`L`})}if(this.edges.length<(this.config.maxEdges??500))n.info(`Pushing edge...`),this.edges.push(a);else throw Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}. Initialize mermaid with maxEdges set to a higher number to allow more edges. You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return typeof e==`object`&&!!e&&`id`in e&&typeof e.id==`string`}addLink(e,t,r){let i=this.isLinkData(r)?r.id.replace(`@`,``):void 0;n.info(`addLink`,e,t,i);for(let n of e)for(let a of t){let o=n===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(n,a,r,i):this.addSingleLink(n,a,r,void 0)}}updateLinkInterpolate(e,t){e.forEach(e=>{e==="default"?this.edges.defaultInterpolate=t:this.edges[e].interpolate=t})}updateLink(e,t){e.forEach(e=>{if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);e==="default"?this.edges.defaultStyle=t:(this.edges[e].style=t,(this.edges[e]?.style?.length??0)>0&&!this.edges[e]?.style?.some(e=>e?.startsWith(`fill`))&&this.edges[e]?.style?.push(`fill:none`))})}addClass(e,t){let n=t.join().replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);e.split(`,`).forEach(e=>{let t=this.classes.get(e);t===void 0&&(t={id:e,styles:[],textStyles:[]},this.classes.set(e,t)),n?.forEach(e=>{if(/color/.exec(e)){let n=e.replace(`fill`,`bgFill`);t.textStyles.push(n)}t.styles.push(e)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction=`LR`),/.*v/.exec(this.direction)&&(this.direction=`TB`),this.direction===`TD`&&(this.direction=`TB`)}setClass(e,t){for(let n of e.split(`,`)){let e=this.vertices.get(n);e&&e.classes.push(t);let r=this.edges.find(e=>e.id===n);r&&r.classes.push(t);let i=this.subGraphLookup.get(n);i&&i.classes.push(t)}}setTooltip(e,t){if(t!==void 0){t=this.sanitizeText(t);for(let n of e.split(`,`))this.tooltips.set(this.version===`gen-1`?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){if(m().securityLevel!==`loose`||t===void 0)return;let r=[];if(typeof n==`string`){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{let n=this.lookUpDomId(e),i=document.querySelector(`[id="${n}"]`);i!==null&&i.addEventListener(`click`,()=>{v.runFunc(t,...r)},!1)}))}setLink(e,t,n){e.split(`,`).forEach(e=>{let r=this.vertices.get(e);r!==void 0&&(r.link=v.formatUrl(t,this.config),r.linkTarget=n)}),this.setClass(e,`clickable`)}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFun(e,t,n)}),this.setClass(e,`clickable`)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){let n=E();r(t).select(`svg`).selectAll(`g.node`).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(a===null)return;let o=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.text(i.attr(`title`)).style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),n.html(e.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})}clear(e=`gen-2`){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId=``,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=m(),s()}setGen(e){this.version=e||`gen-2`}defaultStyle(){return`fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;`}addSubGraph(e,r,i){let a=e.text.trim(),o=i.text;e===i&&/\s/.exec(i.text)&&(a=void 0);let s=t(e=>{let t={boolean:{},number:{},string:{}},n=[],r;return{nodeList:e.filter(function(e){let i=typeof e;return e.stmt&&e.stmt===`dir`?(r=e.value,!1):e.trim()===``?!1:i in t?t[i].hasOwnProperty(e)?!1:t[i][e]=!0:!n.includes(e)&&n.push(e)}),dir:r}},`uniq`)(r.flat()),c=s.nodeList,l=s.dir,u=m().flowchart??{};if(l??=u.inheritDir?this.getDirection()??m().direction??void 0:void 0,this.version===`gen-1`)for(let e=0;e2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let r=0,i=1;for(;r=0){let n=this.indexNodes2(e,t);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2(`none`,this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let t=e.trim(),n=`arrow_open`;switch(t[0]){case`<`:n=`arrow_point`,t=t.slice(1);break;case`x`:n=`arrow_cross`,t=t.slice(1);break;case`o`:n=`arrow_circle`,t=t.slice(1)}let r=`normal`;return t.includes(`=`)&&(r=`thick`),t.includes(`.`)&&(r=`dotted`),{type:n,stroke:r}}countChar(e,t){let n=t.length,r=0;for(let i=0;i`:r=`arrow_point`,t.startsWith(`<`)&&(r=`double_`+r,n=n.slice(1));break;case`o`:r=`arrow_circle`,t.startsWith(`o`)&&(r=`double_`+r,n=n.slice(1))}let i=`normal`,a=n.length-1;n.startsWith(`=`)&&(i=`thick`),n.startsWith(`~`)&&(i=`invisible`);let o=this.countChar(`.`,n);return o&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}destructLink(e,t){let n=this.destructEndLink(e),r;if(t){if(r=this.destructStartLink(t),r.stroke!==n.stroke)return{type:`INVALID`,stroke:`INVALID`};if(r.type===`arrow_open`)r.type=n.type;else{if(r.type!==n.type)return{type:`INVALID`,stroke:`INVALID`};r.type=`double_`+r.type}return r.type===`double_arrow`&&(r.type=`double_arrow_point`),r.length=n.length,r}return n}exists(e,t){for(let n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){let n=[];return e.nodes.forEach((r,i)=>{this.exists(t,r)||n.push(e.nodes[i])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return`imageSquare`;if(e.icon)return e.form===`circle`?`iconCircle`:e.form===`square`?`iconSquare`:e.form===`rounded`?`iconRounded`:`icon`;switch(e.type){case`square`:case void 0:return`squareRect`;case`round`:return`roundedRect`;case`ellipse`:return`ellipse`;default:return e.type}}findNode(e,t){return e.find(e=>e.id===t)}destructEdgeType(e){let t=`none`,n=`arrow_point`;switch(e){case`arrow_point`:case`arrow_circle`:case`arrow_cross`:n=e;break;case`double_arrow_point`:case`double_arrow_circle`:case`double_arrow_cross`:t=e.replace(`double_`,``),n=t}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,a){let o=n.get(e.id),s=r.get(e.id)??!1,c=this.findNode(t,e.id);if(c)c.cssStyles=e.styles,c.cssCompiledStyles=this.getCompiledStyles(e.classes),c.cssClasses=e.classes.join(` `);else{let n={id:e.id,label:e.text,labelType:e.labelType,labelStyle:``,parentId:o,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles([`default`,`node`,...e.classes]),cssClasses:`default `+e.classes.join(` `),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};s?t.push({...n,isGroup:!0,shape:`rect`}):t.push({...n,isGroup:!1,shape:this.getTypeFromVertex(e),minWidth:i.flowchart?.minNodeWidth})}}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}getData(){let e=m(),n=[],r=[],i=this.getSubGraphs(),a=new Map,o=new Map,s=new Map;for(let e of i)for(let t of e.nodes)this.subGraphLookup.has(t)&&s.set(t,e.id);let c=new Map,l=new Map;for(let e of i){let t=s.get(e.id);t!==void 0&&l.set(t,[...l.get(t)??[],e.id])}let u=0,d=t(e=>{c.set(e,u++);for(let t of l.get(e)??[])d(t)},`walk`);for(let e of i)s.has(e.id)||d(e.id);let f=t(e=>this.subGraphLookup.get(e)?.metadata?.view===`collapsed`,`isCollapsed`),p=t(e=>{let t,n=new Set,r=e;for(;r!==void 0&&!n.has(r);)n.add(r),f(r)&&(t=r),r=s.get(r);return t},`outermostCollapsed`),h=new Set,g=new Map;for(let e of i){let t=p(e.id);if(t!==void 0){e.id!==t&&(h.add(e.id),g.set(e.id,t));for(let n of e.nodes)n!==t&&(h.add(n),g.set(n,t))}}for(let e=i.length-1;e>=0;e--){let t=i[e];if(!h.has(t.id)){t.nodes.length>0&&o.set(t.id,!0);for(let e of t.nodes)a.set(e,t.id)}}for(let t=i.length-1;t>=0;t--){let r=i[t];h.has(r.id)||(r.metadata?.view===`collapsed`?n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:`collapsedGroup`,dir:r.dir,isGroup:!1,look:e.look,colorIndex:c.get(r.id)}):n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:`rect`,dir:r.dir,isGroup:!0,look:e.look,colorIndex:c.get(r.id),metadata:r.metadata}))}this.getVertices().forEach(t=>{h.has(t.id)||this.addNodeFromVertex(t,n,a,o,e,e.look||`classic`)});let v=this.getEdges();return v.forEach((t,n)=>{let{arrowTypeStart:i,arrowTypeEnd:a}=this.destructEdgeType(t.type),o=[...v.defaultStyle??[]],s=g.get(t.start)??t.start,c=g.get(t.end)??t.end;if(s===c&&(g.has(t.start)||g.has(t.end)))return;t.style&&o.push(...t.style);let l={id:_(s,c,{counter:n,prefix:`L`},t.id),isUserDefinedId:t.isUserDefinedId,start:s,end:c,type:t.type??`normal`,label:t.text,labelType:t.labelType,labelpos:`c`,thickness:t.stroke,minlen:t.length,classes:t?.stroke===`invisible`?``:`edge-thickness-normal edge-pattern-solid flowchart-link`,arrowTypeStart:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:i,arrowTypeEnd:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:a,arrowheadStyle:`fill: #333`,cssCompiledStyles:this.getCompiledStyles(t.classes),labelStyle:o,style:o,pattern:t.stroke,look:e.look,animate:t.animate,animation:t.animation,curve:t.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(l)}),{nodes:n,edges:r,other:{},config:e}}defaultConfig(){return c.flowchart}},ae={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing state diagram (v2)`,t);let{securityLevel:a,flowchart:o,layout:s}=m();i.db.setDiagramId(t),n.debug(`Before getData: `);let c=i.db.getData();n.debug(`Data: `,c);let l=D(t,a),u=i.db.getDirection();c.type=i.type,c.layoutAlgorithm=w(s),c.direction=u,c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=[`point`,`circle`,`cross`],c.diagramId=t,n.debug(`REF1:`,c),await C(c,l);let d=c.config.flowchart?.diagramPadding??8;v.insertTitle(l,`flowchartTitleText`,o?.titleTopMargin||0,i.db.getDiagramTitle()),O(l,d,`flowchart`,o?.useMaxWidth||!1)},`draw`)},oe=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,3],i=[1,5],a=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],o=[2,2],s=[1,13],c=[1,14],l=[1,15],u=[1,16],d=[1,23],f=[1,25],p=[1,26],m=[1,27],h=[1,50],g=[1,49],_=[1,29],v=[1,30],ee=[1,31],te=[1,32],ne=[1,33],y=[1,45],b=[1,47],x=[1,43],S=[1,48],C=[1,44],w=[1,51],T=[1,46],E=[1,52],D=[1,53],O=[1,34],re=[1,35],ie=[1,36],ae=[1,37],oe=[1,38],k=[1,58],A=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],j=[1,62],M=[1,61],N=[1,63],se=[8,9,11,75,77,78],ce=[1,79],le=[1,92],ue=[1,97],de=[1,96],fe=[1,93],pe=[1,89],me=[1,95],he=[1,91],ge=[1,98],_e=[1,94],ve=[1,99],ye=[1,90],be=[8,9,10,11,40,75,77,78],P=[8,9,10,11,40,46,75,77,78],F=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],xe=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Se=[44,60,89,102,105,106,109,111,114,115,116],Ce=[1,122],we=[1,123],Te=[1,125],Ee=[1,124],De=[44,60,62,74,89,102,105,106,109,111,114,115,116],Oe=[1,134],ke=[1,148],Ae=[1,149],je=[1,150],Me=[1,151],Ne=[1,136],Pe=[1,138],Fe=[1,142],Ie=[1,143],Le=[1,144],Re=[1,145],ze=[1,146],Be=[1,147],Ve=[1,152],He=[1,153],Ue=[1,132],We=[1,133],Ge=[1,140],Ke=[1,135],qe=[1,139],Je=[1,137],Ye=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Xe=[1,155],Ze=[1,157],I=[8,9,11],L=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],R=[1,177],z=[1,173],B=[1,174],V=[1,178],H=[1,175],U=[1,176],Qe=[77,116,119],W=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],$e=[10,106],et=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],G=[1,248],K=[1,246],q=[1,250],J=[1,244],Y=[1,245],X=[1,247],Z=[1,249],Q=[1,251],tt=[1,269],nt=[8,9,11,106],$=[8,9,10,11,60,84,105,106,109,110,111,112],rt={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:`error`,8:`SEMI`,9:`NEWLINE`,10:`SPACE`,11:`EOF`,12:`GRAPH`,13:`NODIR`,14:`DIR`,27:`subgraph`,29:`SQS`,31:`SQE`,32:`end`,34:`acc_title`,35:`acc_title_value`,36:`acc_descr`,37:`acc_descr_value`,38:`acc_descr_multiline_value`,40:`SHAPE_DATA`,44:`AMP`,46:`STYLE_SEPARATOR`,48:`DOUBLECIRCLESTART`,49:`DOUBLECIRCLEEND`,50:`PS`,51:`PE`,52:`(-`,53:`-)`,54:`STADIUMSTART`,55:`STADIUMEND`,56:`SUBROUTINESTART`,57:`SUBROUTINEEND`,58:`VERTEX_WITH_PROPS_START`,59:`NODE_STRING[field]`,60:`COLON`,61:`NODE_STRING[value]`,62:`PIPE`,63:`CYLINDERSTART`,64:`CYLINDEREND`,65:`DIAMOND_START`,66:`DIAMOND_STOP`,67:`TAGEND`,68:`TRAPSTART`,69:`TRAPEND`,70:`INVTRAPSTART`,71:`INVTRAPEND`,74:`TESTSTR`,75:`START_LINK`,77:`LINK`,78:`LINK_ID`,80:`STR`,81:`MD_STR`,84:`STYLE`,85:`LINKSTYLE`,86:`CLASSDEF`,87:`CLASS`,88:`CLICK`,89:`DOWN`,90:`UP`,93:`idString[vertex]`,94:`idString[class]`,95:`CALLBACKNAME`,96:`CALLBACKARGS`,97:`HREF`,98:`LINK_TARGET`,99:`STR[link]`,100:`STR[tooltip]`,102:`DEFAULT`,104:`INTERPOLATE`,105:`NUM`,106:`COMMA`,109:`NODE_STRING`,110:`UNIT`,111:`BRKT`,112:`PCT`,114:`MINUS`,115:`MULT`,116:`UNICODE_TEXT`,117:`TEXT`,118:`TAGSTART`,119:`EDGE_TEXT`,121:`direction_tb`,122:`direction_bt`,123:`direction_rl`,124:`direction_lr`,125:`direction_td`},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:(!Array.isArray(a[s])||a[s].length>0)&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 183:this.$=a[s];break;case 11:r.setDirection(`TB`),this.$=`TB`;break;case 12:r.setDirection(a[s-1]),this.$=a[s-1];break;case 27:this.$=a[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4]);break;case 34:this.$=r.addSubGraph(a[s-3],a[s-1],a[s-3]);break;case 35:this.$=r.addSubGraph(void 0,a[s-1],void 0);break;case 37:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 38:case 39:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 43:this.$=a[s-1]+a[s];break;case 44:this.$=a[s];break;case 45:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 46:r.addLink(a[s-2].stmt,a[s],a[s-1]),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 47:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 48:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 49:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),this.$={stmt:a[s-1],nodes:a[s-1],shapeData:a[s]};break;case 50:this.$={stmt:a[s],nodes:a[s]};break;case 51:this.$=[a[s]];break;case 52:r.addVertex(a[s-5][a[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s-4]),this.$=a[s-5].concat(a[s]);break;case 53:this.$=a[s-4].concat(a[s]);break;case 54:this.$=a[s];break;case 55:this.$=a[s-2],r.setClass(a[s-2],a[s]);break;case 56:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`square`);break;case 57:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`doublecircle`);break;case 58:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`circle`);break;case 59:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`ellipse`);break;case 60:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`stadium`);break;case 61:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`subroutine`);break;case 62:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],`rect`,void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]]));break;case 63:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`cylinder`);break;case 64:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`round`);break;case 65:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`diamond`);break;case 66:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`hexagon`);break;case 67:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`odd`);break;case 68:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`trapezoid`);break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`inv_trapezoid`);break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_right`);break;case 71:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_left`);break;case 72:this.$=a[s],r.addVertex(a[s]);break;case 73:a[s-1].text=a[s],this.$=a[s-1];break;case 74:case 75:a[s-2].text=a[s-1],this.$=a[s-2];break;case 76:this.$=a[s];break;case 77:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,text:a[s-1]};break;case 78:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,text:a[s-1],id:a[s-3]};break;case 79:this.$={text:a[s],type:`text`};break;case 80:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 81:this.$={text:a[s],type:`string`};break;case 82:this.$={text:a[s],type:`markdown`};break;case 83:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length};break;case 84:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,id:a[s-1]};break;case 85:this.$=a[s-1];break;case 86:this.$={text:a[s],type:`text`};break;case 87:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 88:this.$={text:a[s],type:`string`};break;case 89:case 104:this.$={text:a[s],type:`markdown`};break;case 101:this.$={text:a[s],type:`text`};break;case 102:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 103:this.$={text:a[s],type:`text`};break;case 105:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 106:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 107:case 115:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 108:case 116:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 109:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 110:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 111:this.$=a[s-2],r.setLink(a[s-2],a[s]);break;case 112:this.$=a[s-4],r.setLink(a[s-4],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 113:this.$=a[s-4],r.setLink(a[s-4],a[s-2],a[s]);break;case 114:this.$=a[s-6],r.setLink(a[s-6],a[s-4],a[s]),r.setTooltip(a[s-6],a[s-2]);break;case 117:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 118:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 119:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 120:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 121:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 122:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 123:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 124:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 125:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 126:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 127:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 128:case 130:this.$=[a[s]];break;case 129:case 131:a[s-2].push(a[s]),this.$=a[s-2];break;case 133:this.$=a[s-1]+a[s];break;case 181:this.$=a[s];break;case 182:this.$=a[s-1]+``+a[s];break;case 184:this.$=a[s-1]+``+a[s];break;case 185:this.$={stmt:`dir`,value:`TB`};break;case 186:this.$={stmt:`dir`,value:`BT`};break;case 187:this.$={stmt:`dir`,value:`RL`};break;case 188:this.$={stmt:`dir`,value:`LR`};break;case 189:this.$={stmt:`dir`,value:`TD`}}},`anonymous`),table:[{3:1,4:2,9:n,10:r,12:i},{1:[3]},e(a,o,{5:6}),{4:7,9:n,10:r,12:i},{4:8,9:n,10:r,12:i},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},e(a,[2,9]),e(a,[2,10]),e(a,[2,11]),{8:[1,55],9:[1,56],10:k,15:54,18:57},e(A,[2,3]),e(A,[2,4]),e(A,[2,5]),e(A,[2,6]),e(A,[2,7]),e(A,[2,8]),{8:j,9:M,11:N,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:j,9:M,11:N,21:68},{8:j,9:M,11:N,21:69},{8:j,9:M,11:N,21:70},{8:j,9:M,11:N,21:71},{8:j,9:M,11:N,21:72},{8:j,9:M,10:[1,73],11:N,21:74},e(A,[2,36]),{35:[1,75]},{37:[1,76]},e(A,[2,39]),e(se,[2,50],{18:77,39:78,10:k,40:ce}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:le,44:ue,60:de,80:[1,87],89:fe,95:[1,84],97:[1,85],101:86,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye,120:88},e(A,[2,185]),e(A,[2,186]),e(A,[2,187]),e(A,[2,188]),e(A,[2,189]),e(be,[2,51]),e(be,[2,54],{46:[1,100]}),e(P,[2,72],{113:113,29:[1,101],44:h,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:g,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:y,102:b,105:x,106:S,109:C,111:w,114:T,115:E,116:D}),e(F,[2,181]),e(F,[2,142]),e(F,[2,143]),e(F,[2,144]),e(F,[2,145]),e(F,[2,146]),e(F,[2,147]),e(F,[2,148]),e(F,[2,149]),e(F,[2,150]),e(F,[2,151]),e(F,[2,152]),e(a,[2,12]),e(a,[2,18]),e(a,[2,19]),{9:[1,114]},e(xe,[2,26],{18:115,10:k}),e(A,[2,27]),{42:116,43:39,44:h,45:40,47:41,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(A,[2,40]),e(A,[2,41]),e(A,[2,42]),e(Se,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Ce,81:we,116:Te,119:Ee},{75:[1,126],77:[1,127]},e(De,[2,83]),e(A,[2,28]),e(A,[2,29]),e(A,[2,30]),e(A,[2,31]),e(A,[2,32]),{10:Oe,12:ke,14:Ae,27:je,28:128,32:Me,44:Ne,60:Pe,75:Fe,80:[1,130],81:[1,131],83:141,84:Ie,85:Le,86:Re,87:ze,88:Be,89:Ve,90:He,91:129,105:Ue,109:We,111:Ge,114:Ke,115:qe,116:Je},e(Ye,o,{5:154}),e(A,[2,37]),e(A,[2,38]),e(se,[2,48],{44:Xe}),e(se,[2,49],{18:156,10:k,40:Ze}),e(be,[2,44]),{44:h,47:158,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{102:[1,159],103:160,105:[1,161]},{44:h,47:162,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{44:h,47:163,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(I,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(I,[2,115],{120:168,10:[1,167],14:le,44:ue,60:de,89:fe,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye}),e(I,[2,117],{10:[1,169]}),e(L,[2,183]),e(L,[2,170]),e(L,[2,171]),e(L,[2,172]),e(L,[2,173]),e(L,[2,174]),e(L,[2,175]),e(L,[2,176]),e(L,[2,177]),e(L,[2,178]),e(L,[2,179]),e(L,[2,180]),{44:h,47:170,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{30:171,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:179,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:181,50:[1,180],67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:182,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:183,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:184,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{109:[1,185]},{30:186,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:187,65:[1,188],67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:189,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:190,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:191,67:R,80:z,81:B,82:172,116:V,117:H,118:U},e(F,[2,182]),e(a,[2,20]),e(xe,[2,25]),e(se,[2,46],{39:192,18:193,10:k,40:ce}),e(Se,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{77:[1,197],79:198,116:Te,119:Ee},e(Qe,[2,79]),e(Qe,[2,81]),e(Qe,[2,82]),e(Qe,[2,168]),e(Qe,[2,169]),{76:199,79:121,80:Ce,81:we,116:Te,119:Ee},e(De,[2,84]),{8:j,9:M,10:Oe,11:N,12:ke,14:Ae,21:201,27:je,29:[1,200],32:Me,44:Ne,60:Pe,75:Fe,83:141,84:Ie,85:Le,86:Re,87:ze,88:Be,89:Ve,90:He,91:202,105:Ue,109:We,111:Ge,114:Ke,115:qe,116:Je},e(W,[2,101]),e(W,[2,103]),e(W,[2,104]),e(W,[2,157]),e(W,[2,158]),e(W,[2,159]),e(W,[2,160]),e(W,[2,161]),e(W,[2,162]),e(W,[2,163]),e(W,[2,164]),e(W,[2,165]),e(W,[2,166]),e(W,[2,167]),e(W,[2,90]),e(W,[2,91]),e(W,[2,92]),e(W,[2,93]),e(W,[2,94]),e(W,[2,95]),e(W,[2,96]),e(W,[2,97]),e(W,[2,98]),e(W,[2,99]),e(W,[2,100]),{6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,203],33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},{10:k,18:204},{44:[1,205]},e(be,[2,43]),{10:[1,206],44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:113,114:T,115:E,116:D},{10:[1,207]},{10:[1,208],106:[1,209]},e($e,[2,128]),{10:[1,210],44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:113,114:T,115:E,116:D},{10:[1,211],44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:113,114:T,115:E,116:D},{80:[1,212]},e(I,[2,109],{10:[1,213]}),e(I,[2,111],{10:[1,214]}),{80:[1,215]},e(L,[2,184]),{80:[1,216],98:[1,217]},e(be,[2,55],{113:113,44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,114:T,115:E,116:D}),{31:[1,218],67:R,82:219,116:V,117:H,118:U},e(et,[2,86]),e(et,[2,88]),e(et,[2,89]),e(et,[2,153]),e(et,[2,154]),e(et,[2,155]),e(et,[2,156]),{49:[1,220],67:R,82:219,116:V,117:H,118:U},{30:221,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{51:[1,222],67:R,82:219,116:V,117:H,118:U},{53:[1,223],67:R,82:219,116:V,117:H,118:U},{55:[1,224],67:R,82:219,116:V,117:H,118:U},{57:[1,225],67:R,82:219,116:V,117:H,118:U},{60:[1,226]},{64:[1,227],67:R,82:219,116:V,117:H,118:U},{66:[1,228],67:R,82:219,116:V,117:H,118:U},{30:229,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{31:[1,230],67:R,82:219,116:V,117:H,118:U},{67:R,69:[1,231],71:[1,232],82:219,116:V,117:H,118:U},{67:R,69:[1,234],71:[1,233],82:219,116:V,117:H,118:U},e(se,[2,45],{18:156,10:k,40:Ze}),e(se,[2,47],{44:Xe}),e(Se,[2,75]),e(Se,[2,74]),{62:[1,235],67:R,82:219,116:V,117:H,118:U},e(Se,[2,77]),e(Qe,[2,80]),{77:[1,236],79:198,116:Te,119:Ee},{30:237,67:R,80:z,81:B,82:172,116:V,117:H,118:U},e(Ye,o,{5:238}),e(W,[2,102]),e(A,[2,35]),{43:239,44:h,45:40,47:41,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{10:k,18:240},{10:G,60:K,84:q,92:241,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{10:G,60:K,84:q,92:252,104:[1,253],105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{10:G,60:K,84:q,92:254,104:[1,255],105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{105:[1,256]},{10:G,60:K,84:q,92:257,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{44:h,47:258,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(I,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(I,[2,116]),e(I,[2,118],{10:[1,262]}),e(I,[2,119]),e(P,[2,56]),e(et,[2,87]),e(P,[2,57]),{51:[1,263],67:R,82:219,116:V,117:H,118:U},e(P,[2,64]),e(P,[2,59]),e(P,[2,60]),e(P,[2,61]),{109:[1,264]},e(P,[2,63]),e(P,[2,65]),{66:[1,265],67:R,82:219,116:V,117:H,118:U},e(P,[2,67]),e(P,[2,68]),e(P,[2,70]),e(P,[2,69]),e(P,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(Se,[2,78]),{31:[1,266],67:R,82:219,116:V,117:H,118:U},{6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,267],33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},e(be,[2,53]),{43:268,44:h,45:40,47:41,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(I,[2,121],{106:tt}),e(nt,[2,130],{108:270,10:G,60:K,84:q,105:J,109:Y,110:X,111:Z,112:Q}),e($,[2,132]),e($,[2,134]),e($,[2,135]),e($,[2,136]),e($,[2,137]),e($,[2,138]),e($,[2,139]),e($,[2,140]),e($,[2,141]),e(I,[2,122],{106:tt}),{10:[1,271]},e(I,[2,123],{106:tt}),{10:[1,272]},e($e,[2,129]),e(I,[2,105],{106:tt}),e(I,[2,106],{113:113,44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,114:T,115:E,116:D}),e(I,[2,110]),e(I,[2,112],{10:[1,273]}),e(I,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:j,9:M,11:N,21:278},e(A,[2,34]),e(be,[2,52]),{10:G,60:K,84:q,105:J,107:279,108:243,109:Y,110:X,111:Z,112:Q},e($,[2,133]),{14:le,44:ue,60:de,89:fe,101:280,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye,120:88},{14:le,44:ue,60:de,89:fe,101:281,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye,120:88},{98:[1,282]},e(I,[2,120]),e(P,[2,58]),{30:283,67:R,80:z,81:B,82:172,116:V,117:H,118:U},e(P,[2,66]),e(Ye,o,{5:284}),e(nt,[2,131],{108:270,10:G,60:K,84:q,105:J,109:Y,110:X,111:Z,112:Q}),e(I,[2,126],{120:168,10:[1,285],14:le,44:ue,60:de,89:fe,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye}),e(I,[2,127],{120:168,10:[1,286],14:le,44:ue,60:de,89:fe,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye}),e(I,[2,114]),{31:[1,287],67:R,82:219,116:V,117:H,118:U},{6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,288],33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},{10:G,60:K,84:q,92:289,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{10:G,60:K,84:q,92:290,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},e(P,[2,62]),e(A,[2,33]),e(I,[2,124],{106:tt}),e(I,[2,125],{106:tt})],defaultActions:{},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var ee=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function te(e){r.length-=2*e,a.length-=e,o.length-=e}t(te,`popStack`);function ne(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(ne,`lex`);for(var y,b,x,S,C,w={},T,E,D,O;;){if(x=r[r.length-1],this.defaultActions[x]?S=this.defaultActions[x]:(y??=ne(),S=s[x]&&s[x][y]),S===void 0||!S.length||!S[0]){var re=``;for(T in O=[],s[x])this.terminals_[T]&&T>f&&O.push(`'`+this.terminals_[T]+`'`);re=h.showPosition?`Parse error on line `+(l+1)+`: +You have to call mermaid.initialize.`)}isLinkData(e){return typeof e==`object`&&!!e&&`id`in e&&typeof e.id==`string`}addLink(e,t,r){let i=this.isLinkData(r)?r.id.replace(`@`,``):void 0;n.info(`addLink`,e,t,i);for(let n of e)for(let a of t){let o=n===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(n,a,r,i):this.addSingleLink(n,a,r,void 0)}}updateLinkInterpolate(e,t){e.forEach(e=>{e==="default"?this.edges.defaultInterpolate=t:this.edges[e].interpolate=t})}updateLink(e,t){e.forEach(e=>{if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);e==="default"?this.edges.defaultStyle=t:(this.edges[e].style=t,(this.edges[e]?.style?.length??0)>0&&!this.edges[e]?.style?.some(e=>e?.startsWith(`fill`))&&this.edges[e]?.style?.push(`fill:none`))})}addClass(e,t){let n=t.join().replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);e.split(`,`).forEach(e=>{let t=this.classes.get(e);t===void 0&&(t={id:e,styles:[],textStyles:[]},this.classes.set(e,t)),n?.forEach(e=>{if(/color/.exec(e)){let n=e.replace(`fill`,`bgFill`);t.textStyles.push(n)}t.styles.push(e)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction=`LR`),/.*v/.exec(this.direction)&&(this.direction=`TB`),this.direction===`TD`&&(this.direction=`TB`)}setClass(e,t){for(let n of e.split(`,`)){let e=this.vertices.get(n);e&&e.classes.push(t);let r=this.edges.find(e=>e.id===n);r&&r.classes.push(t);let i=this.subGraphLookup.get(n);i&&i.classes.push(t)}}setTooltip(e,t){if(t!==void 0){t=this.sanitizeText(t);for(let n of e.split(`,`))this.tooltips.set(this.version===`gen-1`?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){if(m().securityLevel!==`loose`||t===void 0)return;let r=[];if(typeof n==`string`){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{let n=this.lookUpDomId(e),i=document.querySelector(`[id="${n}"]`);i!==null&&i.addEventListener(`click`,()=>{v.runFunc(t,...r)},!1)}))}setLink(e,t,n){e.split(`,`).forEach(e=>{let r=this.vertices.get(e);r!==void 0&&(r.link=v.formatUrl(t,this.config),r.linkTarget=n)}),this.setClass(e,`clickable`)}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFun(e,t,n)}),this.setClass(e,`clickable`)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){let n=S();r(t).select(`svg`).selectAll(`g.node`).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(a===null)return;let o=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.text(i.attr(`title`)).style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),n.html(e.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})}clear(e=`gen-2`){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId=``,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=m(),s()}setGen(e){this.version=e||`gen-2`}defaultStyle(){return`fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;`}addSubGraph(e,r,i){let a=e.text.trim(),o=i.text;e===i&&/\s/.exec(i.text)&&(a=void 0);let s=t(e=>{let t={boolean:{},number:{},string:{}},n=[],r;return{nodeList:e.filter(function(e){let i=typeof e;return e.stmt&&e.stmt===`dir`?(r=e.value,!1):e.trim()===``?!1:i in t?t[i].hasOwnProperty(e)?!1:t[i][e]=!0:!n.includes(e)&&n.push(e)}),dir:r}},`uniq`)(r.flat()),c=s.nodeList,l=s.dir,u=m().flowchart??{};if(l??=u.inheritDir?this.getDirection()??m().direction??void 0:void 0,this.version===`gen-1`)for(let e=0;e2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let r=0,i=1;for(;r=0){let n=this.indexNodes2(e,t);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2(`none`,this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}destructStartLink(e){let t=e.trim(),n=`arrow_open`;switch(t[0]){case`<`:n=`arrow_point`,t=t.slice(1);break;case`x`:n=`arrow_cross`,t=t.slice(1);break;case`o`:n=`arrow_circle`,t=t.slice(1)}let r=`normal`;return t.includes(`=`)&&(r=`thick`),t.includes(`.`)&&(r=`dotted`),{type:n,stroke:r}}countChar(e,t){let n=t.length,r=0;for(let i=0;i`:r=`arrow_point`,t.startsWith(`<`)&&(r=`double_`+r,n=n.slice(1));break;case`o`:r=`arrow_circle`,t.startsWith(`o`)&&(r=`double_`+r,n=n.slice(1))}let i=`normal`,a=n.length-1;n.startsWith(`=`)&&(i=`thick`),n.startsWith(`~`)&&(i=`invisible`);let o=this.countChar(`.`,n);return o&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}destructLink(e,t){let n=this.destructEndLink(e),r;if(t){if(r=this.destructStartLink(t),r.stroke!==n.stroke)return{type:`INVALID`,stroke:`INVALID`};if(r.type===`arrow_open`)r.type=n.type;else{if(r.type!==n.type)return{type:`INVALID`,stroke:`INVALID`};r.type=`double_`+r.type}return r.type===`double_arrow`&&(r.type=`double_arrow_point`),r.length=n.length,r}return n}exists(e,t){for(let n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){let n=[];return e.nodes.forEach((r,i)=>{this.exists(t,r)||n.push(e.nodes[i])}),{nodes:n}}getTypeFromVertex(e){if(e.img)return`imageSquare`;if(e.icon)return e.form===`circle`?`iconCircle`:e.form===`square`?`iconSquare`:e.form===`rounded`?`iconRounded`:`icon`;switch(e.type){case`square`:case void 0:return`squareRect`;case`round`:return`roundedRect`;case`ellipse`:return`ellipse`;default:return e.type}}findNode(e,t){return e.find(e=>e.id===t)}destructEdgeType(e){let t=`none`,n=`arrow_point`;switch(e){case`arrow_point`:case`arrow_circle`:case`arrow_cross`:n=e;break;case`double_arrow_point`:case`double_arrow_circle`:case`double_arrow_cross`:t=e.replace(`double_`,``),n=t}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,a){let o=n.get(e.id),s=r.get(e.id)??!1,c=this.findNode(t,e.id);if(c)c.cssStyles=e.styles,c.cssCompiledStyles=this.getCompiledStyles(e.classes),c.cssClasses=e.classes.join(` `);else{let n={id:e.id,label:e.text,labelType:e.labelType,labelStyle:``,parentId:o,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles([`default`,`node`,...e.classes]),cssClasses:`default `+e.classes.join(` `),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};s?t.push({...n,isGroup:!0,shape:`rect`}):t.push({...n,isGroup:!1,shape:this.getTypeFromVertex(e),minWidth:i.flowchart?.minNodeWidth})}}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}getData(){let e=m(),n=[],r=[],i=this.getSubGraphs(),a=new Map,o=new Map,s=new Map;for(let e of i)for(let t of e.nodes)this.subGraphLookup.has(t)&&s.set(t,e.id);let c=new Map,l=new Map;for(let e of i){let t=s.get(e.id);t!==void 0&&l.set(t,[...l.get(t)??[],e.id])}let u=0,d=t(e=>{c.set(e,u++);for(let t of l.get(e)??[])d(t)},`walk`);for(let e of i)s.has(e.id)||d(e.id);let f=t(e=>this.subGraphLookup.get(e)?.metadata?.view===`collapsed`,`isCollapsed`),p=t(e=>{let t,n=new Set,r=e;for(;r!==void 0&&!n.has(r);)n.add(r),f(r)&&(t=r),r=s.get(r);return t},`outermostCollapsed`),h=new Set,g=new Map;for(let e of i){let t=p(e.id);if(t!==void 0){e.id!==t&&(h.add(e.id),g.set(e.id,t));for(let n of e.nodes)n!==t&&(h.add(n),g.set(n,t))}}for(let e=i.length-1;e>=0;e--){let t=i[e];if(!h.has(t.id)){t.nodes.length>0&&o.set(t.id,!0);for(let e of t.nodes)a.set(e,t.id)}}for(let t=i.length-1;t>=0;t--){let r=i[t];h.has(r.id)||(r.metadata?.view===`collapsed`?n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:`collapsedGroup`,dir:r.dir,isGroup:!1,look:e.look,colorIndex:c.get(r.id)}):n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:`rect`,dir:r.dir,isGroup:!0,look:e.look,colorIndex:c.get(r.id),metadata:r.metadata}))}this.getVertices().forEach(t=>{h.has(t.id)||this.addNodeFromVertex(t,n,a,o,e,e.look||`classic`)});let v=this.getEdges();return v.forEach((t,n)=>{let{arrowTypeStart:i,arrowTypeEnd:a}=this.destructEdgeType(t.type),o=[...v.defaultStyle??[]],s=g.get(t.start)??t.start,c=g.get(t.end)??t.end;if(s===c&&(g.has(t.start)||g.has(t.end)))return;t.style&&o.push(...t.style);let l={id:_(s,c,{counter:n,prefix:`L`},t.id),isUserDefinedId:t.isUserDefinedId,start:s,end:c,type:t.type??`normal`,label:t.text,labelType:t.labelType,labelpos:`c`,thickness:t.stroke,minlen:t.length,classes:t?.stroke===`invisible`?``:`edge-thickness-normal edge-pattern-solid flowchart-link`,arrowTypeStart:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:i,arrowTypeEnd:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:a,arrowheadStyle:`fill: #333`,cssCompiledStyles:this.getCompiledStyles(t.classes),labelStyle:o,style:o,pattern:t.stroke,look:e.look,animate:t.animate,animation:t.animation,curve:t.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};r.push(l)}),{nodes:n,edges:r,other:{},config:e}}defaultConfig(){return c.flowchart}},ae={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing state diagram (v2)`,t);let{securityLevel:a,flowchart:o,layout:s}=m();i.db.setDiagramId(t),n.debug(`Before getData: `);let c=i.db.getData();n.debug(`Data: `,c);let l=C(t,a),u=i.db.getDirection();c.type=i.type,c.layoutAlgorithm=E(s),c.direction=u,c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=[`point`,`circle`,`cross`],c.diagramId=t,n.debug(`REF1:`,c),await T(c,l);let d=c.config.flowchart?.diagramPadding??8;v.insertTitle(l,`flowchartTitleText`,o?.titleTopMargin||0,i.db.getDiagramTitle()),w(l,d,`flowchart`,o?.useMaxWidth||!1)},`draw`)},oe=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,3],i=[1,5],a=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],o=[2,2],s=[1,13],c=[1,14],l=[1,15],u=[1,16],d=[1,23],f=[1,25],p=[1,26],m=[1,27],h=[1,50],g=[1,49],_=[1,29],v=[1,30],ee=[1,31],te=[1,32],ne=[1,33],y=[1,45],b=[1,47],x=[1,43],S=[1,48],C=[1,44],w=[1,51],T=[1,46],E=[1,52],D=[1,53],O=[1,34],re=[1,35],ie=[1,36],ae=[1,37],oe=[1,38],k=[1,58],A=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],j=[1,62],M=[1,61],N=[1,63],se=[8,9,11,75,77,78],ce=[1,79],le=[1,92],ue=[1,97],de=[1,96],fe=[1,93],pe=[1,89],me=[1,95],he=[1,91],ge=[1,98],_e=[1,94],ve=[1,99],ye=[1,90],be=[8,9,10,11,40,75,77,78],P=[8,9,10,11,40,46,75,77,78],F=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],xe=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Se=[44,60,89,102,105,106,109,111,114,115,116],Ce=[1,122],we=[1,123],Te=[1,125],Ee=[1,124],De=[44,60,62,74,89,102,105,106,109,111,114,115,116],Oe=[1,134],ke=[1,148],Ae=[1,149],je=[1,150],Me=[1,151],Ne=[1,136],Pe=[1,138],Fe=[1,142],Ie=[1,143],Le=[1,144],Re=[1,145],ze=[1,146],Be=[1,147],Ve=[1,152],He=[1,153],Ue=[1,132],We=[1,133],Ge=[1,140],Ke=[1,135],qe=[1,139],Je=[1,137],Ye=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Xe=[1,155],Ze=[1,157],I=[8,9,11],L=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],R=[1,177],z=[1,173],B=[1,174],V=[1,178],H=[1,175],U=[1,176],Qe=[77,116,119],W=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],$e=[10,106],et=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],G=[1,248],K=[1,246],q=[1,250],J=[1,244],Y=[1,245],X=[1,247],Z=[1,249],Q=[1,251],tt=[1,269],nt=[8,9,11,106],$=[8,9,10,11,60,84,105,106,109,110,111,112],rt={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:`error`,8:`SEMI`,9:`NEWLINE`,10:`SPACE`,11:`EOF`,12:`GRAPH`,13:`NODIR`,14:`DIR`,27:`subgraph`,29:`SQS`,31:`SQE`,32:`end`,34:`acc_title`,35:`acc_title_value`,36:`acc_descr`,37:`acc_descr_value`,38:`acc_descr_multiline_value`,40:`SHAPE_DATA`,44:`AMP`,46:`STYLE_SEPARATOR`,48:`DOUBLECIRCLESTART`,49:`DOUBLECIRCLEEND`,50:`PS`,51:`PE`,52:`(-`,53:`-)`,54:`STADIUMSTART`,55:`STADIUMEND`,56:`SUBROUTINESTART`,57:`SUBROUTINEEND`,58:`VERTEX_WITH_PROPS_START`,59:`NODE_STRING[field]`,60:`COLON`,61:`NODE_STRING[value]`,62:`PIPE`,63:`CYLINDERSTART`,64:`CYLINDEREND`,65:`DIAMOND_START`,66:`DIAMOND_STOP`,67:`TAGEND`,68:`TRAPSTART`,69:`TRAPEND`,70:`INVTRAPSTART`,71:`INVTRAPEND`,74:`TESTSTR`,75:`START_LINK`,77:`LINK`,78:`LINK_ID`,80:`STR`,81:`MD_STR`,84:`STYLE`,85:`LINKSTYLE`,86:`CLASSDEF`,87:`CLASS`,88:`CLICK`,89:`DOWN`,90:`UP`,93:`idString[vertex]`,94:`idString[class]`,95:`CALLBACKNAME`,96:`CALLBACKARGS`,97:`HREF`,98:`LINK_TARGET`,99:`STR[link]`,100:`STR[tooltip]`,102:`DEFAULT`,104:`INTERPOLATE`,105:`NUM`,106:`COMMA`,109:`NODE_STRING`,110:`UNIT`,111:`BRKT`,112:`PCT`,114:`MINUS`,115:`MULT`,116:`UNICODE_TEXT`,117:`TEXT`,118:`TAGSTART`,119:`EDGE_TEXT`,121:`direction_tb`,122:`direction_bt`,123:`direction_rl`,124:`direction_lr`,125:`direction_td`},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:(!Array.isArray(a[s])||a[s].length>0)&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 183:this.$=a[s];break;case 11:r.setDirection(`TB`),this.$=`TB`;break;case 12:r.setDirection(a[s-1]),this.$=a[s-1];break;case 27:this.$=a[s-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4]);break;case 34:this.$=r.addSubGraph(a[s-3],a[s-1],a[s-3]);break;case 35:this.$=r.addSubGraph(void 0,a[s-1],void 0);break;case 37:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 38:case 39:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 43:this.$=a[s-1]+a[s];break;case 44:this.$=a[s];break;case 45:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 46:r.addLink(a[s-2].stmt,a[s],a[s-1]),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 47:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 48:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 49:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s]),this.$={stmt:a[s-1],nodes:a[s-1],shapeData:a[s]};break;case 50:this.$={stmt:a[s],nodes:a[s]};break;case 51:this.$=[a[s]];break;case 52:r.addVertex(a[s-5][a[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s-4]),this.$=a[s-5].concat(a[s]);break;case 53:this.$=a[s-4].concat(a[s]);break;case 54:this.$=a[s];break;case 55:this.$=a[s-2],r.setClass(a[s-2],a[s]);break;case 56:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`square`);break;case 57:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`doublecircle`);break;case 58:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`circle`);break;case 59:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`ellipse`);break;case 60:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`stadium`);break;case 61:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`subroutine`);break;case 62:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],`rect`,void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]]));break;case 63:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`cylinder`);break;case 64:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`round`);break;case 65:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`diamond`);break;case 66:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`hexagon`);break;case 67:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`odd`);break;case 68:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`trapezoid`);break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`inv_trapezoid`);break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_right`);break;case 71:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_left`);break;case 72:this.$=a[s],r.addVertex(a[s]);break;case 73:a[s-1].text=a[s],this.$=a[s-1];break;case 74:case 75:a[s-2].text=a[s-1],this.$=a[s-2];break;case 76:this.$=a[s];break;case 77:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,text:a[s-1]};break;case 78:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,text:a[s-1],id:a[s-3]};break;case 79:this.$={text:a[s],type:`text`};break;case 80:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 81:this.$={text:a[s],type:`string`};break;case 82:this.$={text:a[s],type:`markdown`};break;case 83:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length};break;case 84:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,id:a[s-1]};break;case 85:this.$=a[s-1];break;case 86:this.$={text:a[s],type:`text`};break;case 87:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 88:this.$={text:a[s],type:`string`};break;case 89:case 104:this.$={text:a[s],type:`markdown`};break;case 101:this.$={text:a[s],type:`text`};break;case 102:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 103:this.$={text:a[s],type:`text`};break;case 105:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 106:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 107:case 115:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 108:case 116:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 109:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 110:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 111:this.$=a[s-2],r.setLink(a[s-2],a[s]);break;case 112:this.$=a[s-4],r.setLink(a[s-4],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 113:this.$=a[s-4],r.setLink(a[s-4],a[s-2],a[s]);break;case 114:this.$=a[s-6],r.setLink(a[s-6],a[s-4],a[s]),r.setTooltip(a[s-6],a[s-2]);break;case 117:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 118:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 119:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 120:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 121:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 122:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 123:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 124:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 125:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 126:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 127:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 128:case 130:this.$=[a[s]];break;case 129:case 131:a[s-2].push(a[s]),this.$=a[s-2];break;case 133:this.$=a[s-1]+a[s];break;case 181:this.$=a[s];break;case 182:this.$=a[s-1]+``+a[s];break;case 184:this.$=a[s-1]+``+a[s];break;case 185:this.$={stmt:`dir`,value:`TB`};break;case 186:this.$={stmt:`dir`,value:`BT`};break;case 187:this.$={stmt:`dir`,value:`RL`};break;case 188:this.$={stmt:`dir`,value:`LR`};break;case 189:this.$={stmt:`dir`,value:`TD`}}},`anonymous`),table:[{3:1,4:2,9:n,10:r,12:i},{1:[3]},e(a,o,{5:6}),{4:7,9:n,10:r,12:i},{4:8,9:n,10:r,12:i},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},e(a,[2,9]),e(a,[2,10]),e(a,[2,11]),{8:[1,55],9:[1,56],10:k,15:54,18:57},e(A,[2,3]),e(A,[2,4]),e(A,[2,5]),e(A,[2,6]),e(A,[2,7]),e(A,[2,8]),{8:j,9:M,11:N,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:j,9:M,11:N,21:68},{8:j,9:M,11:N,21:69},{8:j,9:M,11:N,21:70},{8:j,9:M,11:N,21:71},{8:j,9:M,11:N,21:72},{8:j,9:M,10:[1,73],11:N,21:74},e(A,[2,36]),{35:[1,75]},{37:[1,76]},e(A,[2,39]),e(se,[2,50],{18:77,39:78,10:k,40:ce}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:le,44:ue,60:de,80:[1,87],89:fe,95:[1,84],97:[1,85],101:86,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye,120:88},e(A,[2,185]),e(A,[2,186]),e(A,[2,187]),e(A,[2,188]),e(A,[2,189]),e(be,[2,51]),e(be,[2,54],{46:[1,100]}),e(P,[2,72],{113:113,29:[1,101],44:h,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:g,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:y,102:b,105:x,106:S,109:C,111:w,114:T,115:E,116:D}),e(F,[2,181]),e(F,[2,142]),e(F,[2,143]),e(F,[2,144]),e(F,[2,145]),e(F,[2,146]),e(F,[2,147]),e(F,[2,148]),e(F,[2,149]),e(F,[2,150]),e(F,[2,151]),e(F,[2,152]),e(a,[2,12]),e(a,[2,18]),e(a,[2,19]),{9:[1,114]},e(xe,[2,26],{18:115,10:k}),e(A,[2,27]),{42:116,43:39,44:h,45:40,47:41,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(A,[2,40]),e(A,[2,41]),e(A,[2,42]),e(Se,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Ce,81:we,116:Te,119:Ee},{75:[1,126],77:[1,127]},e(De,[2,83]),e(A,[2,28]),e(A,[2,29]),e(A,[2,30]),e(A,[2,31]),e(A,[2,32]),{10:Oe,12:ke,14:Ae,27:je,28:128,32:Me,44:Ne,60:Pe,75:Fe,80:[1,130],81:[1,131],83:141,84:Ie,85:Le,86:Re,87:ze,88:Be,89:Ve,90:He,91:129,105:Ue,109:We,111:Ge,114:Ke,115:qe,116:Je},e(Ye,o,{5:154}),e(A,[2,37]),e(A,[2,38]),e(se,[2,48],{44:Xe}),e(se,[2,49],{18:156,10:k,40:Ze}),e(be,[2,44]),{44:h,47:158,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{102:[1,159],103:160,105:[1,161]},{44:h,47:162,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{44:h,47:163,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(I,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(I,[2,115],{120:168,10:[1,167],14:le,44:ue,60:de,89:fe,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye}),e(I,[2,117],{10:[1,169]}),e(L,[2,183]),e(L,[2,170]),e(L,[2,171]),e(L,[2,172]),e(L,[2,173]),e(L,[2,174]),e(L,[2,175]),e(L,[2,176]),e(L,[2,177]),e(L,[2,178]),e(L,[2,179]),e(L,[2,180]),{44:h,47:170,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{30:171,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:179,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:181,50:[1,180],67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:182,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:183,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:184,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{109:[1,185]},{30:186,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:187,65:[1,188],67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:189,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:190,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{30:191,67:R,80:z,81:B,82:172,116:V,117:H,118:U},e(F,[2,182]),e(a,[2,20]),e(xe,[2,25]),e(se,[2,46],{39:192,18:193,10:k,40:ce}),e(Se,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{77:[1,197],79:198,116:Te,119:Ee},e(Qe,[2,79]),e(Qe,[2,81]),e(Qe,[2,82]),e(Qe,[2,168]),e(Qe,[2,169]),{76:199,79:121,80:Ce,81:we,116:Te,119:Ee},e(De,[2,84]),{8:j,9:M,10:Oe,11:N,12:ke,14:Ae,21:201,27:je,29:[1,200],32:Me,44:Ne,60:Pe,75:Fe,83:141,84:Ie,85:Le,86:Re,87:ze,88:Be,89:Ve,90:He,91:202,105:Ue,109:We,111:Ge,114:Ke,115:qe,116:Je},e(W,[2,101]),e(W,[2,103]),e(W,[2,104]),e(W,[2,157]),e(W,[2,158]),e(W,[2,159]),e(W,[2,160]),e(W,[2,161]),e(W,[2,162]),e(W,[2,163]),e(W,[2,164]),e(W,[2,165]),e(W,[2,166]),e(W,[2,167]),e(W,[2,90]),e(W,[2,91]),e(W,[2,92]),e(W,[2,93]),e(W,[2,94]),e(W,[2,95]),e(W,[2,96]),e(W,[2,97]),e(W,[2,98]),e(W,[2,99]),e(W,[2,100]),{6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,203],33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},{10:k,18:204},{44:[1,205]},e(be,[2,43]),{10:[1,206],44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:113,114:T,115:E,116:D},{10:[1,207]},{10:[1,208],106:[1,209]},e($e,[2,128]),{10:[1,210],44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:113,114:T,115:E,116:D},{10:[1,211],44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:113,114:T,115:E,116:D},{80:[1,212]},e(I,[2,109],{10:[1,213]}),e(I,[2,111],{10:[1,214]}),{80:[1,215]},e(L,[2,184]),{80:[1,216],98:[1,217]},e(be,[2,55],{113:113,44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,114:T,115:E,116:D}),{31:[1,218],67:R,82:219,116:V,117:H,118:U},e(et,[2,86]),e(et,[2,88]),e(et,[2,89]),e(et,[2,153]),e(et,[2,154]),e(et,[2,155]),e(et,[2,156]),{49:[1,220],67:R,82:219,116:V,117:H,118:U},{30:221,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{51:[1,222],67:R,82:219,116:V,117:H,118:U},{53:[1,223],67:R,82:219,116:V,117:H,118:U},{55:[1,224],67:R,82:219,116:V,117:H,118:U},{57:[1,225],67:R,82:219,116:V,117:H,118:U},{60:[1,226]},{64:[1,227],67:R,82:219,116:V,117:H,118:U},{66:[1,228],67:R,82:219,116:V,117:H,118:U},{30:229,67:R,80:z,81:B,82:172,116:V,117:H,118:U},{31:[1,230],67:R,82:219,116:V,117:H,118:U},{67:R,69:[1,231],71:[1,232],82:219,116:V,117:H,118:U},{67:R,69:[1,234],71:[1,233],82:219,116:V,117:H,118:U},e(se,[2,45],{18:156,10:k,40:Ze}),e(se,[2,47],{44:Xe}),e(Se,[2,75]),e(Se,[2,74]),{62:[1,235],67:R,82:219,116:V,117:H,118:U},e(Se,[2,77]),e(Qe,[2,80]),{77:[1,236],79:198,116:Te,119:Ee},{30:237,67:R,80:z,81:B,82:172,116:V,117:H,118:U},e(Ye,o,{5:238}),e(W,[2,102]),e(A,[2,35]),{43:239,44:h,45:40,47:41,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},{10:k,18:240},{10:G,60:K,84:q,92:241,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{10:G,60:K,84:q,92:252,104:[1,253],105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{10:G,60:K,84:q,92:254,104:[1,255],105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{105:[1,256]},{10:G,60:K,84:q,92:257,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{44:h,47:258,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(I,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(I,[2,116]),e(I,[2,118],{10:[1,262]}),e(I,[2,119]),e(P,[2,56]),e(et,[2,87]),e(P,[2,57]),{51:[1,263],67:R,82:219,116:V,117:H,118:U},e(P,[2,64]),e(P,[2,59]),e(P,[2,60]),e(P,[2,61]),{109:[1,264]},e(P,[2,63]),e(P,[2,65]),{66:[1,265],67:R,82:219,116:V,117:H,118:U},e(P,[2,67]),e(P,[2,68]),e(P,[2,70]),e(P,[2,69]),e(P,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(Se,[2,78]),{31:[1,266],67:R,82:219,116:V,117:H,118:U},{6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,267],33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},e(be,[2,53]),{43:268,44:h,45:40,47:41,60:g,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D},e(I,[2,121],{106:tt}),e(nt,[2,130],{108:270,10:G,60:K,84:q,105:J,109:Y,110:X,111:Z,112:Q}),e($,[2,132]),e($,[2,134]),e($,[2,135]),e($,[2,136]),e($,[2,137]),e($,[2,138]),e($,[2,139]),e($,[2,140]),e($,[2,141]),e(I,[2,122],{106:tt}),{10:[1,271]},e(I,[2,123],{106:tt}),{10:[1,272]},e($e,[2,129]),e(I,[2,105],{106:tt}),e(I,[2,106],{113:113,44:h,60:g,89:y,102:b,105:x,106:S,109:C,111:w,114:T,115:E,116:D}),e(I,[2,110]),e(I,[2,112],{10:[1,273]}),e(I,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:j,9:M,11:N,21:278},e(A,[2,34]),e(be,[2,52]),{10:G,60:K,84:q,105:J,107:279,108:243,109:Y,110:X,111:Z,112:Q},e($,[2,133]),{14:le,44:ue,60:de,89:fe,101:280,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye,120:88},{14:le,44:ue,60:de,89:fe,101:281,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye,120:88},{98:[1,282]},e(I,[2,120]),e(P,[2,58]),{30:283,67:R,80:z,81:B,82:172,116:V,117:H,118:U},e(P,[2,66]),e(Ye,o,{5:284}),e(nt,[2,131],{108:270,10:G,60:K,84:q,105:J,109:Y,110:X,111:Z,112:Q}),e(I,[2,126],{120:168,10:[1,285],14:le,44:ue,60:de,89:fe,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye}),e(I,[2,127],{120:168,10:[1,286],14:le,44:ue,60:de,89:fe,105:pe,106:me,109:he,111:ge,114:_e,115:ve,116:ye}),e(I,[2,114]),{31:[1,287],67:R,82:219,116:V,117:H,118:U},{6:11,7:12,8:s,9:c,10:l,11:u,20:17,22:18,23:19,24:20,25:21,26:22,27:d,32:[1,288],33:24,34:f,36:p,38:m,42:28,43:39,44:h,45:40,47:41,60:g,84:_,85:v,86:ee,87:te,88:ne,89:y,102:b,105:x,106:S,109:C,111:w,113:42,114:T,115:E,116:D,121:O,122:re,123:ie,124:ae,125:oe},{10:G,60:K,84:q,92:289,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},{10:G,60:K,84:q,92:290,105:J,107:242,108:243,109:Y,110:X,111:Z,112:Q},e(P,[2,62]),e(A,[2,33]),e(I,[2,124],{106:tt}),e(I,[2,125],{106:tt})],defaultActions:{},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var ee=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function te(e){r.length-=2*e,a.length-=e,o.length-=e}t(te,`popStack`);function ne(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(ne,`lex`);for(var y,b,x,S,C,w={},T,E,D,O;;){if(x=r[r.length-1],this.defaultActions[x]?S=this.defaultActions[x]:(y??=ne(),S=s[x]&&s[x][y]),S===void 0||!S.length||!S[0]){var re=``;for(T in O=[],s[x])this.terminals_[T]&&T>f&&O.push(`'`+this.terminals_[T]+`'`);re=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+O.join(`, `)+`, got '`+(this.terminals_[y]||y)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(y==p?`end of input`:`'`+(this.terminals_[y]||y)+`'`),this.parseError(re,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:v,expected:O})}if(S[0]instanceof Array&&S.length>1)throw Error(`Parse Error: multiple actions possible at state: `+x+`, token: `+y);switch(S[0]){case 1:r.push(y),a.push(h.yytext),o.push(h.yylloc),r.push(S[1]),y=null,b?(y=b,b=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(E=this.productions_[S[1]][1],w.$=a[a.length-E],w._$={first_line:o[o.length-(E||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(E||1)].first_column,last_column:o[o.length-1].last_column},ee&&(w._$.range=[o[o.length-(E||1)].range[0],o[o.length-1].range[1]]),C=this.performAction.apply(w,[c,u,l,g.yy,S[1],a,o].concat(m)),C!==void 0)return C;E&&(r=r.slice(0,-1*E*2),a=a.slice(0,-1*E),o=o.slice(0,-1*E)),r.push(this.productions_[S[1]][0]),a.push(w.$),o.push(w._$),D=s[r[r.length-2]][r[r.length-1]],r.push(D);break;case 3:return!0}}return!0},`parse`)};rt.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:t(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),34;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),36;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return this.pushState(`shapeData`),t.yytext=``,40;case 8:return this.pushState(`shapeDataStr`),40;case 9:return this.popState(),40;case 10:return t.yytext=t.yytext.replace(/\n\s*/g,`
`),40;case 11:return 40;case 12:this.popState();break;case 13:this.begin(`callbackname`);break;case 14:this.popState();break;case 15:this.popState(),this.begin(`callbackargs`);break;case 16:return 95;case 17:this.popState();break;case 18:return 96;case 19:return`MD_STR`;case 20:this.popState();break;case 21:this.begin(`md_string`);break;case 22:return`STR`;case 23:this.popState();break;case 24:this.pushState(`string`);break;case 25:return 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin(`click`);break;case 33:this.popState();break;case 34:return 88;case 35:return e.lex.firstGraph()&&this.begin(`dir`),12;case 36:return e.lex.firstGraph()&&this.begin(`dir`),12;case 37:return e.lex.firstGraph()&&this.begin(`dir`),12;case 38:return e.lex.firstGraph()&&this.begin(`dir`),12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;case 46:return this.popState(),14;case 47:return this.popState(),14;case 48:return this.popState(),14;case 49:return this.popState(),14;case 50:return this.popState(),14;case 51:return this.popState(),14;case 52:return this.popState(),14;case 53:return this.popState(),14;case 54:return this.popState(),14;case 55:return this.popState(),14;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;case 71:return this.pushState(`edgeText`),75;case 72:return 119;case 73:return this.popState(),77;case 74:return this.pushState(`thickEdgeText`),75;case 75:return 119;case 76:return this.popState(),77;case 77:return this.pushState(`dottedEdgeText`),75;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;case 81:return`TEXT`;case 82:return this.pushState(`ellipseText`),52;case 83:return this.popState(),55;case 84:return this.pushState(`text`),54;case 85:return this.popState(),57;case 86:return this.pushState(`text`),56;case 87:return 58;case 88:return this.pushState(`text`),67;case 89:return this.popState(),64;case 90:return this.pushState(`text`),63;case 91:return this.popState(),49;case 92:return this.pushState(`text`),48;case 93:return this.popState(),69;case 94:return this.popState(),71;case 95:return 117;case 96:return this.pushState(`trapText`),68;case 97:return this.pushState(`trapText`),70;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return`SEP`;case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;case 110:return this.pushState(`text`),62;case 111:return this.popState(),51;case 112:return this.pushState(`text`),50;case 113:return this.popState(),31;case 114:return this.pushState(`text`),29;case 115:return this.popState(),66;case 116:return this.pushState(`text`),65;case 117:return`TEXT`;case 118:return`QUOTE`;case 119:return 9;case 120:return 10;case 121:return 11}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\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\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\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\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-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\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-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\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\u2183\u2184]|[\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\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\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])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:[^\S\n\r]+)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}}})();function it(){this.yy={}}return t(it,`Parser`),it.prototype=rt,rt.Parser=it,new it})();oe.parser=oe;var k=oe,A=Object.assign({},k);A.parse=e=>{let t=e.replace(/}\s*\n/g,`} -`);return k.parse(t)};var j=A,M=t(e=>{let{theme:n,bkgColorArray:r,borderColorArray:i}=e;if(!ne(n,i))return``;let a=b(e.look),o=x(r),s=``;for(let n=0;n`${l}.node ${e}, ${l}.rough-node ${e}`,`collapsedRule`),d=t(e=>`${l}.swimlane.cluster .swimlane-title${e}, ${l}.swimlane.cluster .swimlane-body${e}`,`laneRule`);s+=` +`);return k.parse(t)};var j=A,M=t(e=>{let{theme:n,bkgColorArray:r,borderColorArray:i}=e;if(!te(n,i))return``;let a=y(e.look),o=b(r),s=``;for(let n=0;n`${l}.node ${e}, ${l}.rough-node ${e}`,`collapsedRule`),d=t(e=>`${l}.swimlane.cluster .swimlane-title${e}, ${l}.swimlane.cluster .swimlane-body${e}`,`laneRule`);s+=` ${l}.cluster:not(.swimlane) rect { stroke: ${e}; @@ -209,5 +209,5 @@ ${o?` } text-align: center; } - ${T()} + ${ee()} `,`getStyles`),ce=t(({styles:e=se}={})=>({parser:j,get db(){return new ie},renderer:ae,styles:e,init:t(e=>{e.flowchart||={},e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,i({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},`init`)}),`createFlowDiagram`),le=ce();export{le as n,se as r,ce as t}; \ No newline at end of file diff --git a/web/dist/app-chunk-GNY47TPC.js b/web/dist/app-chunk-GNY47TPC.js index caa2b288d..613f71291 100644 --- a/web/dist/app-chunk-GNY47TPC.js +++ b/web/dist/app-chunk-GNY47TPC.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["app-elk-276RUBZZ.js","app-rolldown-runtime.js","app-chunk-Y2CYZVJY.js","app-src.js","app-chunk-O7XYJQB3.js","app-preload-helper.js","app-purify.es.js","app-chunk-ZIGJFQKS.js","app-dist.js","app-chunk-7PRAP22T.js","app-chunk-742MDFTN.js","app-chunk-MBY4JIJT.js","app-chunk-7INBJB4K.js","app-chunk-J5ZVWO5B.js","app-rough.esm.js","app-chunk-5DYCD2WN.js","app-chunk-UA2S7LBM.js","app-chunk-Z7XXMR3K.js","app-line.js","app-path.js","app-array.js","app-chunk-3FUC2YCW.js","app-graphlib.js","app-chunk-NETBCI7D.js","app-dagre-6A5THRUB.js","app-swimlanes-2SLR337P.js","app-cose-bilkent-JH36ORCC.js","app-cytoscape.esm.js"])))=>i.map(i=>d[i]); -import{t as e}from"./app-preload-helper.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import{b as r,s as i}from"./app-chunk-O7XYJQB3.js";import{d as a}from"./app-chunk-ZIGJFQKS.js";import{t as o}from"./app-chunk-DUW6YSOI.js";import{o as s}from"./app-chunk-7INBJB4K.js";import{r as c}from"./app-chunk-5DYCD2WN.js";import{r as l}from"./app-chunk-UA2S7LBM.js";import{a as u,c as d,i as f,l as p}from"./app-chunk-Z7XXMR3K.js";var m={common:i,getConfig:r,insertCluster:l,insertEdge:f,insertEdgeLabel:u,insertMarkers:d,insertNode:c,interpolateToCurve:a,labelHelper:s,log:n,positionEdgeLabel:p},h=[`elk.stress`,`elk.force`,`elk.mrtree`,`elk.sporeOverlap`,`elk.box`,`elk.rectpacking`],g=Object.create(null),_=t(e=>{for(let t of e)g[t.name]=t},`registerLayoutLoaders`),v=t(()=>{let n=t(async()=>await e(()=>import(`./app-elk-276RUBZZ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])),`loader`);return[{name:`elk`,loader:n,algorithm:`elk.layered`},...h.map(e=>({name:e,loader:n,algorithm:e}))]},`elkLayoutLoaders`);t(()=>{_([{name:`dagre`,loader:t(async()=>await e(()=>import(`./app-dagre-6A5THRUB.js`),__vite__mapDeps([24,2,3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,21])),`loader`)},{name:`swimlane`,loader:t(async()=>await e(()=>import(`./app-swimlanes-2SLR337P.js`),__vite__mapDeps([25,2,3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])),`loader`)},{name:`cose-bilkent`,loader:t(async()=>await e(()=>import(`./app-cose-bilkent-JH36ORCC.js`),__vite__mapDeps([26,1,2,3,27])),`loader`)},...v()])},`registerDefaultLayoutLoaders`)();var y=t(async(e,t)=>{if(!Object.hasOwn(g,e.layoutAlgorithm))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=g[e.layoutAlgorithm],r=await n.loader();return o(t,e.config),r.render(e,t,m,{algorithm:n.algorithm})},`render`),b=`dagre`,x=t((e=``,{fallback:t=b}={})=>{if(Object.hasOwn(g,e))return e;for(let r of[t,b])if(Object.hasOwn(g,r))return n.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw Error(`Neither layout algorithm ${e}, ${t}, nor ${b} is registered.`)},`getRegisteredLayoutAlgorithm`);export{_ as n,y as r,x as t}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["app-elk-276RUBZZ.js","app-rolldown-runtime.js","app-chunk-Y2CYZVJY.js","app-src.js","app-chunk-O7XYJQB3.js","app-preload-helper.js","app-purify.es.js","app-chunk-ZIGJFQKS.js","app-dist.js","app-chunk-742MDFTN.js","app-chunk-MBY4JIJT.js","app-chunk-7PRAP22T.js","app-chunk-7INBJB4K.js","app-chunk-J5ZVWO5B.js","app-rough.esm.js","app-chunk-5DYCD2WN.js","app-chunk-Z7XXMR3K.js","app-line.js","app-path.js","app-array.js","app-chunk-UA2S7LBM.js","app-chunk-3FUC2YCW.js","app-graphlib.js","app-chunk-NETBCI7D.js","app-dagre-6A5THRUB.js","app-swimlanes-2SLR337P.js","app-cose-bilkent-JH36ORCC.js","app-cytoscape.esm.js"])))=>i.map(i=>d[i]); +import{t as e}from"./app-preload-helper.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import{b as r,s as i}from"./app-chunk-O7XYJQB3.js";import{d as a}from"./app-chunk-ZIGJFQKS.js";import{t as o}from"./app-chunk-DUW6YSOI.js";import{o as s}from"./app-chunk-7INBJB4K.js";import{r as c}from"./app-chunk-5DYCD2WN.js";import{a as l,c as u,i as d,l as f}from"./app-chunk-Z7XXMR3K.js";import{r as p}from"./app-chunk-UA2S7LBM.js";var m={common:i,getConfig:r,insertCluster:p,insertEdge:d,insertEdgeLabel:l,insertMarkers:u,insertNode:c,interpolateToCurve:a,labelHelper:s,log:n,positionEdgeLabel:f},h=[`elk.stress`,`elk.force`,`elk.mrtree`,`elk.sporeOverlap`,`elk.box`,`elk.rectpacking`],g=Object.create(null),_=t(e=>{for(let t of e)g[t.name]=t},`registerLayoutLoaders`),v=t(()=>{let n=t(async()=>await e(()=>import(`./app-elk-276RUBZZ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])),`loader`);return[{name:`elk`,loader:n,algorithm:`elk.layered`},...h.map(e=>({name:e,loader:n,algorithm:e}))]},`elkLayoutLoaders`);t(()=>{_([{name:`dagre`,loader:t(async()=>await e(()=>import(`./app-dagre-6A5THRUB.js`),__vite__mapDeps([24,2,3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,22,20,21])),`loader`)},{name:`swimlane`,loader:t(async()=>await e(()=>import(`./app-swimlanes-2SLR337P.js`),__vite__mapDeps([25,2,3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])),`loader`)},{name:`cose-bilkent`,loader:t(async()=>await e(()=>import(`./app-cose-bilkent-JH36ORCC.js`),__vite__mapDeps([26,1,2,3,27])),`loader`)},...v()])},`registerDefaultLayoutLoaders`)();var y=t(async(e,t)=>{if(!Object.hasOwn(g,e.layoutAlgorithm))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=g[e.layoutAlgorithm],r=await n.loader();return o(t,e.config),r.render(e,t,m,{algorithm:n.algorithm})},`render`),b=`dagre`,x=t((e=``,{fallback:t=b}={})=>{if(Object.hasOwn(g,e))return e;for(let r of[t,b])if(Object.hasOwn(g,r))return n.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw Error(`Neither layout algorithm ${e}, ${t}, nor ${b} is registered.`)},`getRegisteredLayoutAlgorithm`);export{_ as n,y as r,x as t}; \ No newline at end of file diff --git a/web/dist/app-chunk-UA2S7LBM.js b/web/dist/app-chunk-UA2S7LBM.js index 638b27ad9..6150383e0 100644 --- a/web/dist/app-chunk-UA2S7LBM.js +++ b/web/dist/app-chunk-UA2S7LBM.js @@ -1 +1 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{T as r,g as i,x as a}from"./app-chunk-O7XYJQB3.js";import{a as o,i as s,t as c}from"./app-chunk-7PRAP22T.js";import{n as l}from"./app-chunk-MBY4JIJT.js";import{s as u}from"./app-chunk-J5ZVWO5B.js";import{t as d}from"./app-rough.esm.js";import{i as f,n as p,t as m}from"./app-chunk-7INBJB4K.js";import{n as h}from"./app-chunk-5DYCD2WN.js";var g=e(async(e,r)=>{let c=a(),{theme:p,themeVariables:m,handDrawnSeed:h}=c,{clusterBkg:g,clusterBorder:_,borderColorArray:v}=m,y=_,{labelStyles:b,nodeStyles:x,borderStyles:S,backgroundStyles:C}=s(r),w=e.insert(`g`).attr(`class`,`cluster swimlane `+(r.cssClasses||``)).attr(`id`,r.id).attr(`data-id`,r.id).attr(`data-et`,`cluster`).attr(`data-look`,r.look);u(w,r.colorIndex,p,v);let T=i(c.flowchart.htmlLabels),E=r.direction===`LR`,D=w.insert(`g`).attr(`class`,`cluster-label swimlane-label`),O=await l(D,r.label,{style:r.labelStyle,useHtmlLabels:T,isNode:!0,width:r.width}),k=O.getBBox();if(T){let e=O.children[0],t=n(O);k=e.getBoundingClientRect(),t.attr(`width`,k.width),t.attr(`height`,k.height)}let A=r.padding??0,j=r.width<=k.width+A?k.width+A:r.width;r.diff=r.width<=k.width+A?(j-r.width)/2-A:-A;let M=r.height,N=r.y-M/2,P=r.y+M/2,F=r.x-j/2,I=r.swimlaneContentTop===void 0?N+M/3:r.swimlaneContentTop,L=E?4:0,R=k.height+2*L,z,B;if(E){let e=Math.max(R,k.height+2*L),t=F+e,n=Math.max(0,j-e);if(r.look===`handDrawn`){let i=d.svg(w),a=o(r,{roughness:.7,fill:g,stroke:y,seed:h}),s=o(r,{roughness:.7,fill:`none`,stroke:y,seed:h}),c=i.rectangle(F,N,e,M,a);z=w.insert(()=>c,`:first-child`).attr(`class`,`swimlane-title`);let l=i.rectangle(t,N,n,M,s);B=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,F).attr(`y`,N).attr(`width`,e).attr(`height`,M).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,t).attr(`y`,N).attr(`width`,n).attr(`height`,M).attr(`fill`,`none`).attr(`stroke`,y);let i=F+e/2,a=r.y;D.attr(`transform`,`translate(${i}, ${a}) rotate(-90) translate(${-k.width/2}, ${-k.height/2})`)}else{let e=Math.max(0,I-N),t=Math.min(R,e),n=N+t,i=Math.max(0,P-n),a=r.x-j/2;if(r.look===`handDrawn`){let e=d.svg(w),s=o(r,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:h}),c=o(r,{roughness:.7,fill:`none`,stroke:y,seed:h}),l=e.rectangle(a,N,j,t,s);z=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-title`);let u=e.rectangle(a,n,j,i,c);B=w.insert(()=>u,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,a).attr(`y`,N).attr(`width`,j).attr(`height`,t).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,a).attr(`y`,n).attr(`width`,j).attr(`height`,i).attr(`fill`,`none`).attr(`stroke`,y);let s=r.x-k.width/2,c=N+(t-k.height)/2;D.attr(`transform`,`translate(${s}, ${c})`)}if(t.trace(`Swimlane data `,r,JSON.stringify(r)),b){let e=D.select(`span`);e&&e.attr(`style`,b)}return r.offsetX=0,r.width=j,r.height=M,r.offsetY=k.height-A/2,r.intersect=function(e){return f(r,e)},{cluster:w,labelBBox:k}},`swimlane`),_=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let c=a(),{theme:g,themeVariables:_,handDrawnSeed:v}=c,{clusterBkg:y,clusterBorder:b,borderColorArray:x}=_,{labelStyles:S,nodeStyles:C,borderStyles:w,backgroundStyles:T}=s(i),E=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look);u(E,i.colorIndex,g,x);let D=r(c),O=E.insert(`g`).attr(`class`,`cluster-label `),k;k=i.labelType===`markdown`?await l(O,i.label,{style:i.labelStyle,useHtmlLabels:D,isNode:!0,width:i.width}):await m(O,i.label,i.labelStyle||``,!1,!0);let A=k.getBBox();if(r(c)){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let j=i.width<=A.width+i.padding?A.width+i.padding:i.width;i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let M=i.height,N=i.x-j/2,P=i.y-M/2;t.trace(`Data `,i,JSON.stringify(i));let F;if(i.look===`handDrawn`){let e=d.svg(E),n=o(i,{roughness:.7,fill:y,stroke:b,fillWeight:3,seed:v}),r=e.path(p(N,P,j,M,0),n);F=E.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),F.select(`path:nth-child(2)`).attr(`style`,w.join(`;`)),F.select(`path`).attr(`style`,T.join(`;`).replace(`fill`,`stroke`))}else F=E.insert(`rect`,`:first-child`),F.attr(`style`,C).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,N).attr(`y`,P).attr(`width`,j).attr(`height`,M);let{subGraphTitleTopMargin:I}=h(c);if(O.attr(`transform`,`translate(${i.x-A.width/2}, ${i.y-i.height/2+I})`),S){let e=O.select(`span`);e&&e.attr(`style`,S)}let L=F.node().getBBox();return i.offsetX=0,i.width=L.width,i.height=L.height,i.offsetY=A.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`rect`),v=e((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return f(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),y=e(async(e,t)=>{let i=a(),{theme:o,themeVariables:s,handDrawnSeed:c}=i,{altBackground:l,borderColorArray:h,compositeBackground:g,compositeTitleBackground:_,nodeBorder:v}=s,y=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look);u(y,t.colorIndex,o,h);let b=y.insert(`g`,`:first-child`),x=y.insert(`g`).attr(`class`,`cluster-label`),S=y.append(`rect`),C=await m(x,t.label,t.labelStyle,void 0,!0),w=C.getBBox();if(r(i)){let e=C.children[0],t=n(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=0*t.padding,E=T/2,D=(t.width<=w.width+t.padding?w.width+t.padding:t.width)+T;t.diff=t.width<=w.width+t.padding?(D-t.width)/2-t.padding:-t.padding;let O=t.height+T,k=t.height+T-w.height-6,A=t.x-D/2,j=t.y-O/2;t.width=D;let M=t.y-t.height/2-E+w.height+2,N;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=d.svg(y),r=t.rx||t.ry?n.path(p(A,j,D,O,10),{roughness:.7,fill:_,fillStyle:`solid`,stroke:v,seed:c}):n.rectangle(A,j,D,O,{seed:c});N=y.insert(()=>r,`:first-child`);let i=n.rectangle(A,M,D,k,{fill:e?l:g,fillStyle:e?`hachure`:`solid`,stroke:v,seed:c});N=y.insert(()=>r,`:first-child`),S=y.insert(()=>i),N.attr(`class`,`outer`),S.attr(`class`,`inner`)}else N=b.insert(`rect`,`:first-child`),N.attr(`class`,`outer`).attr(`x`,A).attr(`y`,j).attr(`width`,D).attr(`height`,O).attr(`data-look`,t.look),S.attr(`class`,`inner`).attr(`x`,A).attr(`y`,M).attr(`width`,D).attr(`height`,k);return x.attr(`transform`,`translate(${t.x-w.width/2}, ${j+1-(r(i)?0:3)})`),t.height=N.node().getBBox().height,t.offsetX=0,t.offsetY=w.height-t.padding/2,t.labelBBox=w,t.intersect=function(e){return f(t,e)},{cluster:y,labelBBox:w}},`roundedWithTitle`),b=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let c=a(),{themeVariables:u,handDrawnSeed:m}=c,{clusterBkg:g,clusterBorder:_}=u,{labelStyles:v,nodeStyles:y,borderStyles:b,backgroundStyles:x}=s(i),S=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look),C=r(c),w=S.insert(`g`).attr(`class`,`cluster-label `),T=await l(w,i.label,{style:i.labelStyle,useHtmlLabels:C,isNode:!0,width:i.width}),E=T.getBBox();if(r(c)){let e=T.children[0],t=n(T);E=e.getBoundingClientRect(),t.attr(`width`,E.width),t.attr(`height`,E.height)}let D=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(D-i.width)/2-i.padding:-i.padding;let O=i.height,k=i.x-D/2,A=i.y-O/2;t.trace(`Data `,i,JSON.stringify(i));let j;if(i.look===`handDrawn`){let e=d.svg(S),n=o(i,{roughness:.7,fill:g,stroke:_,fillWeight:4,seed:m}),r=e.path(p(k,A,D,O,i.rx),n);j=S.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),j.select(`path:nth-child(2)`).attr(`style`,b.join(`;`)),j.select(`path`).attr(`style`,x.join(`;`).replace(`fill`,`stroke`))}else j=S.insert(`rect`,`:first-child`),j.attr(`style`,y).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,k).attr(`y`,A).attr(`width`,D).attr(`height`,O);let{subGraphTitleTopMargin:M}=h(c);if(w.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+M})`),v){let e=w.select(`span`);e&&e.attr(`style`,v)}let N=j.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:S,labelBBox:E}},`kanbanSection`),x=e((e,t)=>{let{theme:n,themeVariables:r,handDrawnSeed:i}=a(),{altBackground:o,nodeBorder:s,borderColorArray:c}=r,l=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look);u(l,t.colorIndex,n,c);let p=l.insert(`g`,`:first-child`),m=0*t.padding,h=t.width+m;t.diff=-t.padding;let g=t.height+m,_=t.x-h/2,v=t.y-g/2;t.width=h;let y;if(t.look===`handDrawn`){let e=d.svg(l).rectangle(_,v,h,g,{fill:o??`#efefef`,fillStyle:`solid`,roughness:.5,strokeLineDash:[5],stroke:s,seed:i});y=l.insert(()=>e,`:first-child`).attr(`class`,`divider`)}else{y=p.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),y.attr(`class`,e).attr(`x`,_).attr(`y`,v).attr(`width`,h).attr(`height`,g).attr(`data-look`,t.look)}return t.height=y.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return f(t,e)},{cluster:l,labelBBox:{}}},`divider`),S=e(async(e,i,c)=>{t.info(`Creating ${c.cssClass} for `,i.id,i);let g=a(),{theme:_,themeVariables:v,handDrawnSeed:y}=g,{borderColorArray:b}=v,{labelStyles:x,borderStyles:S}=s(i),C=e.insert(`g`).attr(`class`,`cluster `+c.cssClass+` `+i.cssClasses).attr(`id`,i.domId??i.id).attr(`data-look`,i.look);u(C,i.colorIndex,_,b);let w=r(g),T=C.insert(`g`).attr(`class`,`cluster-label`),E={width:0,height:0},D=i.label?.trim();if(D){let e;if(e=i.labelType===`markdown`?await l(T,i.label,{style:i.labelStyle,useHtmlLabels:w,isNode:!0,width:i.width}):await m(T,i.label,i.labelStyle||``,!1,!0),E=e.getBBox(),w){let t=e.children[0],r=n(e);E=t.getBoundingClientRect(),r.attr(`width`,E.width),r.attr(`height`,E.height)}}let O=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(O-i.width)/2-i.padding:-i.padding;let k=i.height,A=i.x-O/2,j=i.y-k/2,M;if(i.look===`handDrawn`){let e=d.svg(C),t=o(i,{roughness:c.roughness,fill:c.fill,stroke:c.stroke,strokeWidth:c.strokeWidth,seed:y,...c.fill===`none`?{fillWeight:0}:{fillStyle:`solid`},...c.strokeDash?{strokeLineDash:c.strokeDash}:{}}),n=e.path(p(A,j,O,k,c.rx),t);M=C.insert(()=>n,`:first-child`),M.select(`path:nth-child(2)`).attr(`style`,S.join(`;`))}else M=C.insert(`rect`,`:first-child`),M.attr(`rx`,c.rx).attr(`ry`,c.rx).attr(`x`,A).attr(`y`,j).attr(`width`,O).attr(`height`,k).attr(`fill`,c.fill).attr(`stroke`,c.stroke).attr(`stroke-width`,c.strokeWidth+`px`),c.strokeDash&&M.attr(`stroke-dasharray`,c.strokeDash.join(`, `));if(D){let{subGraphTitleTopMargin:e}=h(g);if(T.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+e})`),x){let e=T.select(`span`);e&&e.attr(`style`,x)}}let N=M.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:C,labelBBox:E}},`createContainerGroup`),C=e(async(e,t)=>{let{themeVariables:n}=a();return S(e,t,{cssClass:`flow-cluster`,rx:10,fill:`none`,stroke:n.flowContainerStroke||n.secondaryBorderColor,strokeWidth:.75,roughness:.7})},`flowGroup`),w=e((e,t)=>{let n=e.boundaryType||`rect`,r=n===`package`?20:e.padding,i=n===`package`?t.height+10:0,a=Math.max(e.width,t.width+r),o=n===`package`?Math.max(e.height,i+e.padding*2):e.height,s=e.x-a/2,c=e.y-o/2;return{boundaryType:n,width:a,height:o,x:s,y:c,bodyY:c+i,bodyHeight:o-i,tabHeight:i,tabWidth:n===`package`?Math.min(a,Math.max(80,t.width+20)):0}},`getUsecaseSystemBoundaryGeometry`),T={rect:_,squareRect:_,roundedWithTitle:y,noteGroup:v,divider:x,kanbanSection:b,flowGroup:C,usecaseSystemBoundary:e(async(e,i)=>{t.info(`Creating usecase system boundary for `,i.id,i);let p=a(),{theme:m,themeVariables:g,handDrawnSeed:_}=p,{clusterBkg:v,clusterBorder:y,borderColorArray:b}=g,{labelStyles:x,nodeStyles:S}=s(i),{stylesMap:C}=c(i),T=i.boundaryType||`rect`,E=e.insert(`g`).attr(`class`,`cluster usecase-system-boundary usecase-system-boundary-${T} ${i.cssClasses}`).attr(`id`,typeof i.domId==`string`?i.domId:i.id).attr(`data-boundary-type`,T).attr(`data-look`,i.look);u(E,i.colorIndex,m,b);let D=r(p),O=E.insert(`g`).attr(`class`,`cluster-label system-boundary-title`),k=await l(O,i.label,{style:x,useHtmlLabels:D,isNode:!0}),A=k.getBBox();if(D){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let{width:j,height:M,x:N,y:P,bodyY:F,bodyHeight:I,tabHeight:L,tabWidth:R}=w(i,A);i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let z=o(i,{fill:C.get(`fill`)||v,stroke:C.get(`stroke`)||y,strokeWidth:C.get(`stroke-width`)?.replace(`px`,``)||1,seed:_});if(i.look===`handDrawn`){let e=d.svg(E),t=e.rectangle(N,F,j,I,z);if(E.insert(()=>t,`:first-child`).attr(`class`,`boundary-body label-container`),T===`package`){let t=e.rectangle(N,P,R,L,z);E.insert(()=>t,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`)}}else E.insert(`rect`,`:first-child`).attr(`class`,`boundary-body label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,F).attr(`width`,j).attr(`height`,I),T===`package`&&E.insert(`rect`,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,P).attr(`width`,R).attr(`height`,L);let{subGraphTitleTopMargin:B}=h(p);return T===`package`?O.attr(`transform`,`translate(${N+(R-A.width)/2}, ${P+(L-A.height)/2})`):O.attr(`transform`,`translate(${i.x-A.width/2}, ${P+B})`),x&&(O.attr(`style`,x),O.select(`span`).attr(`style`,x)),i.offsetX=0,i.width=j,i.height=M,i.offsetY=A.height-i.padding/2,i.labelBBox=A,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`usecaseSystemBoundary`),swimlane:g},E=new Set([`noteGroup`,`divider`]),D=e(e=>!E.has(e??`rect`),`clusterPaintsTitle`),O=new Map,k=e(async(e,t)=>{let n=await T[t.shape||`rect`](e,t);return O.set(t.id,n),n},`insertCluster`),A=e(()=>{O=new Map},`clear`);export{D as n,k as r,A as t}; \ No newline at end of file +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{T as r,g as i,x as a}from"./app-chunk-O7XYJQB3.js";import{n as o}from"./app-chunk-MBY4JIJT.js";import{a as s,i as c,t as l}from"./app-chunk-7PRAP22T.js";import{s as u}from"./app-chunk-J5ZVWO5B.js";import{t as d}from"./app-rough.esm.js";import{i as f,n as p,t as m}from"./app-chunk-7INBJB4K.js";import{n as h}from"./app-chunk-5DYCD2WN.js";var g=e(async(e,r)=>{let l=a(),{theme:p,themeVariables:m,handDrawnSeed:h}=l,{clusterBkg:g,clusterBorder:_,borderColorArray:v}=m,y=_,{labelStyles:b,nodeStyles:x,borderStyles:S,backgroundStyles:C}=c(r),w=e.insert(`g`).attr(`class`,`cluster swimlane `+(r.cssClasses||``)).attr(`id`,r.id).attr(`data-id`,r.id).attr(`data-et`,`cluster`).attr(`data-look`,r.look);u(w,r.colorIndex,p,v);let T=i(l.flowchart.htmlLabels),E=r.direction===`LR`,D=w.insert(`g`).attr(`class`,`cluster-label swimlane-label`),O=await o(D,r.label,{style:r.labelStyle,useHtmlLabels:T,isNode:!0,width:r.width}),k=O.getBBox();if(T){let e=O.children[0],t=n(O);k=e.getBoundingClientRect(),t.attr(`width`,k.width),t.attr(`height`,k.height)}let A=r.padding??0,j=r.width<=k.width+A?k.width+A:r.width;r.diff=r.width<=k.width+A?(j-r.width)/2-A:-A;let M=r.height,N=r.y-M/2,P=r.y+M/2,F=r.x-j/2,I=r.swimlaneContentTop===void 0?N+M/3:r.swimlaneContentTop,L=E?4:0,R=k.height+2*L,z,B;if(E){let e=Math.max(R,k.height+2*L),t=F+e,n=Math.max(0,j-e);if(r.look===`handDrawn`){let i=d.svg(w),a=s(r,{roughness:.7,fill:g,stroke:y,seed:h}),o=s(r,{roughness:.7,fill:`none`,stroke:y,seed:h}),c=i.rectangle(F,N,e,M,a);z=w.insert(()=>c,`:first-child`).attr(`class`,`swimlane-title`);let l=i.rectangle(t,N,n,M,o);B=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,F).attr(`y`,N).attr(`width`,e).attr(`height`,M).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,t).attr(`y`,N).attr(`width`,n).attr(`height`,M).attr(`fill`,`none`).attr(`stroke`,y);let i=F+e/2,a=r.y;D.attr(`transform`,`translate(${i}, ${a}) rotate(-90) translate(${-k.width/2}, ${-k.height/2})`)}else{let e=Math.max(0,I-N),t=Math.min(R,e),n=N+t,i=Math.max(0,P-n),a=r.x-j/2;if(r.look===`handDrawn`){let e=d.svg(w),o=s(r,{roughness:.7,fill:g,stroke:y,fillWeight:3,seed:h}),c=s(r,{roughness:.7,fill:`none`,stroke:y,seed:h}),l=e.rectangle(a,N,j,t,o);z=w.insert(()=>l,`:first-child`).attr(`class`,`swimlane-title`);let u=e.rectangle(a,n,j,i,c);B=w.insert(()=>u,`:first-child`).attr(`class`,`swimlane-body`),z.select(`path:nth-child(2)`).attr(`style`,S.join(`;`)),z.select(`path`).attr(`style`,C.join(`;`).replace(`fill`,`stroke`))}else z=w.insert(`rect`,`:first-child`),B=w.insert(`rect`,`:first-child`),z.attr(`class`,`swimlane-title`).attr(`style`,x).attr(`x`,a).attr(`y`,N).attr(`width`,j).attr(`height`,t).attr(`fill`,g).attr(`stroke`,y),B.attr(`class`,`swimlane-body`).attr(`style`,x).attr(`x`,a).attr(`y`,n).attr(`width`,j).attr(`height`,i).attr(`fill`,`none`).attr(`stroke`,y);let o=r.x-k.width/2,c=N+(t-k.height)/2;D.attr(`transform`,`translate(${o}, ${c})`)}if(t.trace(`Swimlane data `,r,JSON.stringify(r)),b){let e=D.select(`span`);e&&e.attr(`style`,b)}return r.offsetX=0,r.width=j,r.height=M,r.offsetY=k.height-A/2,r.intersect=function(e){return f(r,e)},{cluster:w,labelBBox:k}},`swimlane`),_=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let l=a(),{theme:g,themeVariables:_,handDrawnSeed:v}=l,{clusterBkg:y,clusterBorder:b,borderColorArray:x}=_,{labelStyles:S,nodeStyles:C,borderStyles:w,backgroundStyles:T}=c(i),E=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look);u(E,i.colorIndex,g,x);let D=r(l),O=E.insert(`g`).attr(`class`,`cluster-label `),k;k=i.labelType===`markdown`?await o(O,i.label,{style:i.labelStyle,useHtmlLabels:D,isNode:!0,width:i.width}):await m(O,i.label,i.labelStyle||``,!1,!0);let A=k.getBBox();if(r(l)){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let j=i.width<=A.width+i.padding?A.width+i.padding:i.width;i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let M=i.height,N=i.x-j/2,P=i.y-M/2;t.trace(`Data `,i,JSON.stringify(i));let F;if(i.look===`handDrawn`){let e=d.svg(E),n=s(i,{roughness:.7,fill:y,stroke:b,fillWeight:3,seed:v}),r=e.path(p(N,P,j,M,0),n);F=E.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),F.select(`path:nth-child(2)`).attr(`style`,w.join(`;`)),F.select(`path`).attr(`style`,T.join(`;`).replace(`fill`,`stroke`))}else F=E.insert(`rect`,`:first-child`),F.attr(`style`,C).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,N).attr(`y`,P).attr(`width`,j).attr(`height`,M);let{subGraphTitleTopMargin:I}=h(l);if(O.attr(`transform`,`translate(${i.x-A.width/2}, ${i.y-i.height/2+I})`),S){let e=O.select(`span`);e&&e.attr(`style`,S)}let L=F.node().getBBox();return i.offsetX=0,i.width=L.width,i.height=L.height,i.offsetY=A.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`rect`),v=e((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return f(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),y=e(async(e,t)=>{let i=a(),{theme:o,themeVariables:s,handDrawnSeed:c}=i,{altBackground:l,borderColorArray:h,compositeBackground:g,compositeTitleBackground:_,nodeBorder:v}=s,y=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look);u(y,t.colorIndex,o,h);let b=y.insert(`g`,`:first-child`),x=y.insert(`g`).attr(`class`,`cluster-label`),S=y.append(`rect`),C=await m(x,t.label,t.labelStyle,void 0,!0),w=C.getBBox();if(r(i)){let e=C.children[0],t=n(C);w=e.getBoundingClientRect(),t.attr(`width`,w.width),t.attr(`height`,w.height)}let T=0*t.padding,E=T/2,D=(t.width<=w.width+t.padding?w.width+t.padding:t.width)+T;t.diff=t.width<=w.width+t.padding?(D-t.width)/2-t.padding:-t.padding;let O=t.height+T,k=t.height+T-w.height-6,A=t.x-D/2,j=t.y-O/2;t.width=D;let M=t.y-t.height/2-E+w.height+2,N;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=d.svg(y),r=t.rx||t.ry?n.path(p(A,j,D,O,10),{roughness:.7,fill:_,fillStyle:`solid`,stroke:v,seed:c}):n.rectangle(A,j,D,O,{seed:c});N=y.insert(()=>r,`:first-child`);let i=n.rectangle(A,M,D,k,{fill:e?l:g,fillStyle:e?`hachure`:`solid`,stroke:v,seed:c});N=y.insert(()=>r,`:first-child`),S=y.insert(()=>i),N.attr(`class`,`outer`),S.attr(`class`,`inner`)}else N=b.insert(`rect`,`:first-child`),N.attr(`class`,`outer`).attr(`x`,A).attr(`y`,j).attr(`width`,D).attr(`height`,O).attr(`data-look`,t.look),S.attr(`class`,`inner`).attr(`x`,A).attr(`y`,M).attr(`width`,D).attr(`height`,k);return x.attr(`transform`,`translate(${t.x-w.width/2}, ${j+1-(r(i)?0:3)})`),t.height=N.node().getBBox().height,t.offsetX=0,t.offsetY=w.height-t.padding/2,t.labelBBox=w,t.intersect=function(e){return f(t,e)},{cluster:y,labelBBox:w}},`roundedWithTitle`),b=e(async(e,i)=>{t.info(`Creating subgraph rect for `,i.id,i);let l=a(),{themeVariables:u,handDrawnSeed:m}=l,{clusterBkg:g,clusterBorder:_}=u,{labelStyles:v,nodeStyles:y,borderStyles:b,backgroundStyles:x}=c(i),S=e.insert(`g`).attr(`class`,`cluster `+i.cssClasses).attr(`id`,i.domId).attr(`data-look`,i.look),C=r(l),w=S.insert(`g`).attr(`class`,`cluster-label `),T=await o(w,i.label,{style:i.labelStyle,useHtmlLabels:C,isNode:!0,width:i.width}),E=T.getBBox();if(r(l)){let e=T.children[0],t=n(T);E=e.getBoundingClientRect(),t.attr(`width`,E.width),t.attr(`height`,E.height)}let D=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(D-i.width)/2-i.padding:-i.padding;let O=i.height,k=i.x-D/2,A=i.y-O/2;t.trace(`Data `,i,JSON.stringify(i));let j;if(i.look===`handDrawn`){let e=d.svg(S),n=s(i,{roughness:.7,fill:g,stroke:_,fillWeight:4,seed:m}),r=e.path(p(k,A,D,O,i.rx),n);j=S.insert(()=>(t.debug(`Rough node insert CXC`,r),r),`:first-child`),j.select(`path:nth-child(2)`).attr(`style`,b.join(`;`)),j.select(`path`).attr(`style`,x.join(`;`).replace(`fill`,`stroke`))}else j=S.insert(`rect`,`:first-child`),j.attr(`style`,y).attr(`rx`,i.rx).attr(`ry`,i.ry).attr(`x`,k).attr(`y`,A).attr(`width`,D).attr(`height`,O);let{subGraphTitleTopMargin:M}=h(l);if(w.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+M})`),v){let e=w.select(`span`);e&&e.attr(`style`,v)}let N=j.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:S,labelBBox:E}},`kanbanSection`),x=e((e,t)=>{let{theme:n,themeVariables:r,handDrawnSeed:i}=a(),{altBackground:o,nodeBorder:s,borderColorArray:c}=r,l=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look);u(l,t.colorIndex,n,c);let p=l.insert(`g`,`:first-child`),m=0*t.padding,h=t.width+m;t.diff=-t.padding;let g=t.height+m,_=t.x-h/2,v=t.y-g/2;t.width=h;let y;if(t.look===`handDrawn`){let e=d.svg(l).rectangle(_,v,h,g,{fill:o??`#efefef`,fillStyle:`solid`,roughness:.5,strokeLineDash:[5],stroke:s,seed:i});y=l.insert(()=>e,`:first-child`).attr(`class`,`divider`)}else{y=p.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),y.attr(`class`,e).attr(`x`,_).attr(`y`,v).attr(`width`,h).attr(`height`,g).attr(`data-look`,t.look)}return t.height=y.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return f(t,e)},{cluster:l,labelBBox:{}}},`divider`),S=e(async(e,i,l)=>{t.info(`Creating ${l.cssClass} for `,i.id,i);let g=a(),{theme:_,themeVariables:v,handDrawnSeed:y}=g,{borderColorArray:b}=v,{labelStyles:x,borderStyles:S}=c(i),C=e.insert(`g`).attr(`class`,`cluster `+l.cssClass+` `+i.cssClasses).attr(`id`,i.domId??i.id).attr(`data-look`,i.look);u(C,i.colorIndex,_,b);let w=r(g),T=C.insert(`g`).attr(`class`,`cluster-label`),E={width:0,height:0},D=i.label?.trim();if(D){let e;if(e=i.labelType===`markdown`?await o(T,i.label,{style:i.labelStyle,useHtmlLabels:w,isNode:!0,width:i.width}):await m(T,i.label,i.labelStyle||``,!1,!0),E=e.getBBox(),w){let t=e.children[0],r=n(e);E=t.getBoundingClientRect(),r.attr(`width`,E.width),r.attr(`height`,E.height)}}let O=i.width<=E.width+i.padding?E.width+i.padding:i.width;i.diff=i.width<=E.width+i.padding?(O-i.width)/2-i.padding:-i.padding;let k=i.height,A=i.x-O/2,j=i.y-k/2,M;if(i.look===`handDrawn`){let e=d.svg(C),t=s(i,{roughness:l.roughness,fill:l.fill,stroke:l.stroke,strokeWidth:l.strokeWidth,seed:y,...l.fill===`none`?{fillWeight:0}:{fillStyle:`solid`},...l.strokeDash?{strokeLineDash:l.strokeDash}:{}}),n=e.path(p(A,j,O,k,l.rx),t);M=C.insert(()=>n,`:first-child`),M.select(`path:nth-child(2)`).attr(`style`,S.join(`;`))}else M=C.insert(`rect`,`:first-child`),M.attr(`rx`,l.rx).attr(`ry`,l.rx).attr(`x`,A).attr(`y`,j).attr(`width`,O).attr(`height`,k).attr(`fill`,l.fill).attr(`stroke`,l.stroke).attr(`stroke-width`,l.strokeWidth+`px`),l.strokeDash&&M.attr(`stroke-dasharray`,l.strokeDash.join(`, `));if(D){let{subGraphTitleTopMargin:e}=h(g);if(T.attr(`transform`,`translate(${i.x-E.width/2}, ${i.y-i.height/2+e})`),x){let e=T.select(`span`);e&&e.attr(`style`,x)}}let N=M.node().getBBox();return i.offsetX=0,i.width=N.width,i.height=N.height,i.offsetY=E.height-i.padding/2,i.intersect=function(e){return f(i,e)},{cluster:C,labelBBox:E}},`createContainerGroup`),C=e(async(e,t)=>{let{themeVariables:n}=a();return S(e,t,{cssClass:`flow-cluster`,rx:10,fill:`none`,stroke:n.flowContainerStroke||n.secondaryBorderColor,strokeWidth:.75,roughness:.7})},`flowGroup`),w=e((e,t)=>{let n=e.boundaryType||`rect`,r=n===`package`?20:e.padding,i=n===`package`?t.height+10:0,a=Math.max(e.width,t.width+r),o=n===`package`?Math.max(e.height,i+e.padding*2):e.height,s=e.x-a/2,c=e.y-o/2;return{boundaryType:n,width:a,height:o,x:s,y:c,bodyY:c+i,bodyHeight:o-i,tabHeight:i,tabWidth:n===`package`?Math.min(a,Math.max(80,t.width+20)):0}},`getUsecaseSystemBoundaryGeometry`),T={rect:_,squareRect:_,roundedWithTitle:y,noteGroup:v,divider:x,kanbanSection:b,flowGroup:C,usecaseSystemBoundary:e(async(e,i)=>{t.info(`Creating usecase system boundary for `,i.id,i);let p=a(),{theme:m,themeVariables:g,handDrawnSeed:_}=p,{clusterBkg:v,clusterBorder:y,borderColorArray:b}=g,{labelStyles:x,nodeStyles:S}=c(i),{stylesMap:C}=l(i),T=i.boundaryType||`rect`,E=e.insert(`g`).attr(`class`,`cluster usecase-system-boundary usecase-system-boundary-${T} ${i.cssClasses}`).attr(`id`,typeof i.domId==`string`?i.domId:i.id).attr(`data-boundary-type`,T).attr(`data-look`,i.look);u(E,i.colorIndex,m,b);let D=r(p),O=E.insert(`g`).attr(`class`,`cluster-label system-boundary-title`),k=await o(O,i.label,{style:x,useHtmlLabels:D,isNode:!0}),A=k.getBBox();if(D){let e=k.children[0],t=n(k);A=e.getBoundingClientRect(),t.attr(`width`,A.width),t.attr(`height`,A.height)}let{width:j,height:M,x:N,y:P,bodyY:F,bodyHeight:I,tabHeight:L,tabWidth:R}=w(i,A);i.diff=i.width<=A.width+i.padding?(j-i.width)/2-i.padding:-i.padding;let z=s(i,{fill:C.get(`fill`)||v,stroke:C.get(`stroke`)||y,strokeWidth:C.get(`stroke-width`)?.replace(`px`,``)||1,seed:_});if(i.look===`handDrawn`){let e=d.svg(E),t=e.rectangle(N,F,j,I,z);if(E.insert(()=>t,`:first-child`).attr(`class`,`boundary-body label-container`),T===`package`){let t=e.rectangle(N,P,R,L,z);E.insert(()=>t,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`)}}else E.insert(`rect`,`:first-child`).attr(`class`,`boundary-body label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,F).attr(`width`,j).attr(`height`,I),T===`package`&&E.insert(`rect`,`:first-child`).attr(`class`,`boundary-tab system-boundary-package-tab label-container`).attr(`style`,S).attr(`x`,N).attr(`y`,P).attr(`width`,R).attr(`height`,L);let{subGraphTitleTopMargin:B}=h(p);return T===`package`?O.attr(`transform`,`translate(${N+(R-A.width)/2}, ${P+(L-A.height)/2})`):O.attr(`transform`,`translate(${i.x-A.width/2}, ${P+B})`),x&&(O.attr(`style`,x),O.select(`span`).attr(`style`,x)),i.offsetX=0,i.width=j,i.height=M,i.offsetY=A.height-i.padding/2,i.labelBBox=A,i.intersect=function(e){return f(i,e)},{cluster:E,labelBBox:A}},`usecaseSystemBoundary`),swimlane:g},E=new Set([`noteGroup`,`divider`]),D=e(e=>!E.has(e??`rect`),`clusterPaintsTitle`),O=new Map,k=e(async(e,t)=>{let n=await T[t.shape||`rect`](e,t);return O.set(t.id,n),n},`insertCluster`),A=e(()=>{O=new Map},`clear`);export{D as n,k as r,A as t}; \ No newline at end of file diff --git a/web/dist/app-chunk-Z7XXMR3K.js b/web/dist/app-chunk-Z7XXMR3K.js index 0f6a3727e..e9f53839b 100644 --- a/web/dist/app-chunk-Z7XXMR3K.js +++ b/web/dist/app-chunk-Z7XXMR3K.js @@ -1,10 +1,10 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{T as r,b as i,x as a}from"./app-chunk-O7XYJQB3.js";import{$ as o,J as s,K as c,Q as l,X as u,Y as d,Z as f,et as p,g as m,nt as h,q as g,rt as _,tt as v,u as y}from"./app-chunk-ZIGJFQKS.js";import{t as b}from"./app-line.js";import{i as x,n as S}from"./app-chunk-7PRAP22T.js";import{n as C,r as w}from"./app-chunk-MBY4JIJT.js";import{t as ee}from"./app-rough.esm.js";import{t as T}from"./app-chunk-7INBJB4K.js";import{n as E}from"./app-chunk-5DYCD2WN.js";var D=e((e,t)=>{if(t)return`translate(`+-e.width/2+`, `+-e.height/2+`)`;let n=e.x??0,r=e.y??0;return`translate(`+-(n+e.width/2)+`, `+-(r+e.height/2)+`)`},`computeLabelTransform`),O={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},k={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function A(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=j(e),t=j(t);let[n,r]=[e.x,e.y],[i,a]=[t.x,t.y],o=i-n,s=a-r;return{angle:Math.atan(s/o),deltaX:o,deltaY:s}}e(A,`calculateDeltaAndAngle`);var j=e(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,`pointTransformer`),te=e(t=>({x:e(function(e,n,r){let i=0,a=j(r[0]).x=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(O,t.arrowTypeEnd)){let{angle:e,deltaX:n}=A(r[r.length-1],r[r.length-2]);i=O[t.arrowTypeEnd]*Math.cos(e)*(n>=0?1:-1)}let o=Math.abs(j(e).x-j(r[r.length-1]).x),s=Math.abs(j(e).y-j(r[r.length-1]).y),c=Math.abs(j(e).x-j(r[0]).x),l=Math.abs(j(e).y-j(r[0]).y),u=O[t.arrowTypeStart],d=O[t.arrowTypeEnd];if(o0&&s0&&l=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(O,t.arrowTypeEnd)){let{angle:e,deltaY:n}=A(r[r.length-1],r[r.length-2]);i=O[t.arrowTypeEnd]*Math.abs(Math.sin(e))*(n>=0?1:-1)}let o=Math.abs(j(e).y-j(r[r.length-1]).y),s=Math.abs(j(e).x-j(r[r.length-1]).x),c=Math.abs(j(e).y-j(r[0]).y),l=Math.abs(j(e).x-j(r[0]).x),u=O[t.arrowTypeStart],d=O[t.arrowTypeEnd];if(o0&&s0&&l{t.arrowTypeStart&&P(e,`start`,t.arrowTypeStart,n,r,i,a,o),t.arrowTypeEnd&&P(e,`end`,t.arrowTypeEnd,n,r,i,a,o)},`addEdgeMarkers`),M={arrow_cross:{type:`cross`,fill:!1},arrow_point:{type:`point`,fill:!0},arrow_barb:{type:`barb`,fill:!0},arrow_barb_neo:{type:`barb`,fill:!0},arrow_circle:{type:`circle`,fill:!1},arrow_hierarchy:{type:`hierarchy`,fill:!1},aggregation:{type:`aggregation`,fill:!1},extension:{type:`extension`,fill:!1},composition:{type:`composition`,fill:!0},dependency:{type:`dependency`,fill:!0},lollipop:{type:`lollipop`,fill:!1},only_one:{type:`onlyOne`,fill:!1},zero_or_one:{type:`zeroOrOne`,fill:!1},one_or_more:{type:`oneOrMore`,fill:!1},zero_or_more:{type:`zeroOrMore`,fill:!1},requirement_arrow:{type:`requirement_arrow`,fill:!1},requirement_contains:{type:`requirement_contains`,fill:!1}},N=[`cross`,`point`,`circle`,`lollipop`,`aggregation`,`extension`,`composition`,`dependency`,`barb`],P=e((e,n,r,i,a,o,s=!1,c)=>{if(!r||r===`none`)return;let l=M[r],u=l&&N.includes(l.type);if(!l){t.warn(`Unknown arrow type: ${r}`);return}let d=`${a}_${o}-${l.type}${n===`start`?`Start`:`End`}${s&&u?`-margin`:``}`;if(c&&c.trim()!==``){let t=`${d}_${c.replace(/[^\dA-Za-z]/g,`_`)}`;if(!document.getElementById(t)){let e=document.getElementById(d);if(e){let n=e.cloneNode(!0);n.id=t,n.querySelectorAll(`path, circle, line`).forEach(e=>{e.setAttribute(`stroke`,c),l.fill&&e.setAttribute(`fill`,c)}),e.parentNode?.appendChild(n)}}e.attr(`marker-${n}`,`url(${i}#${t})`)}else e.attr(`marker-${n}`,`url(${i}#${d})`)},`addEdgeMarker`),re=e(e=>typeof e==`string`?e:a()?.flowchart?.curve,`resolveEdgeCurveType`),F=new Map,I=new Map,L=e(()=>{F.clear(),I.clear()},`clear`),R=e(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),`hasEdgeLabel`),z=e(e=>e?typeof e==`string`?e:e.reduce((e,t)=>e+`;`+t,``):``,`getLabelStyles`),ie=e(async(e,i)=>{let o=a(),s=r(o),{labelStyles:c}=x(i);i.labelStyle=c;let l=e.insert(`g`).attr(`class`,`edgeLabel`),u=l.insert(`g`).attr(`class`,`label`).attr(`data-id`,i.id),d=i.labelType===`markdown`,f=await C(e,i.label,{style:z(i.labelStyle),useHtmlLabels:s,addSvgBackground:!0,isNode:!1,markdown:d,width:void 0},o);u.node().appendChild(f),t.info(`abc82`,i,i.labelType);let p,m;if(s){let e=f.children[0],t=n(f);p=await w.measure(()=>e.getBoundingClientRect()),m=p,t.attr(`width`,p.width),t.attr(`height`,p.height)}else{let e=n(f).select(`text`).node();await w.measure(()=>{p=f.getBBox(),m=e&&typeof e.getBBox==`function`?e.getBBox():p})}u.attr(`transform`,D(m,s)),F.set(i.id,l),i.width=p.width,i.height=p.height;let h;if(i.startLabelLeft){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await T(r,i.startLabelLeft,z(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,D(o,s)),I.get(i.id)||I.set(i.id,{}),I.get(i.id).startLeft=t,B(h,i.startLabelLeft)}if(i.startLabelRight){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await T(r,i.startLabelRight,z(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,D(o,s)),I.get(i.id)||I.set(i.id,{}),I.get(i.id).startRight=t,B(h,i.startLabelRight)}if(i.endLabelLeft){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await T(t,i.endLabelLeft,z(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,D(o,s)),I.get(i.id)||I.set(i.id,{}),I.get(i.id).endLeft=t,B(h,i.endLabelLeft)}if(i.endLabelRight){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await T(t,i.endLabelRight,z(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,D(o,s)),I.get(i.id)||I.set(i.id,{}),I.get(i.id).endRight=t,B(h,i.endLabelRight)}return f},`insertEdgeLabel`);function B(e,t){r(a())&&e&&(e.style.width=t.length*9+`px`,e.style.height=`12px`)}e(B,`setTerminalWidth`);var V=e((e,n)=>{t.debug(`Moving label abc88 `,e.id,e.label,F.get(e.id),n);let r=n.updatedPath?n.updatedPath:n.originalPath,i=a(),{subGraphTitleTotalMargin:o}=E(i);if(e.label){let i=F.get(e.id),a=e.x,s=e.y;if(r){let i=m.calcLabelPosition(r);t.debug(`Moving label `+e.label+` from (`,a,`,`,s,`) to (`,i.x,`,`,i.y,`) abc88`),n.updatedPath&&(a=i.x,s=i.y)}i.attr(`transform`,`translate(${a}, ${s+o/2})`)}if(e.startLabelLeft){let t=I.get(e.id).startLeft,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.startLabelRight){let t=I.get(e.id).startRight,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.endLabelLeft){let t=I.get(e.id).endLeft,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.endLabelRight){let t=I.get(e.id).endRight,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}},`positionEdgeLabel`),ae=e((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith(`-to-label`)||!Array.isArray(t)||t.length!==2)return t;let[n,r]=t,i=Math.abs(r.x-n.x),a=Math.abs(r.y-n.y);return i<.001||a<.001?t:a>=i?[n,{x:n.x,y:r.y},r]:[n,{x:r.x,y:n.y},r]},`orthogonalizeToLabelClippedPoints`),H=e((e,t)=>{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),U=e((e,n,r)=>{t.debug(`intersection calc abc89: +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{T as r,b as i,x as a}from"./app-chunk-O7XYJQB3.js";import{$ as o,J as s,K as c,Q as l,X as u,Y as d,Z as f,et as p,g as m,nt as h,q as g,rt as _,tt as v,u as y}from"./app-chunk-ZIGJFQKS.js";import{t as b}from"./app-line.js";import{n as x,r as S}from"./app-chunk-MBY4JIJT.js";import{i as C,n as ee}from"./app-chunk-7PRAP22T.js";import{t as te}from"./app-rough.esm.js";import{t as w}from"./app-chunk-7INBJB4K.js";import{n as T}from"./app-chunk-5DYCD2WN.js";var E=e((e,t)=>{if(t)return`translate(`+-e.width/2+`, `+-e.height/2+`)`;let n=e.x??0,r=e.y??0;return`translate(`+-(n+e.width/2)+`, `+-(r+e.height/2)+`)`},`computeLabelTransform`),D={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},O={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function k(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=A(e),t=A(t);let[n,r]=[e.x,e.y],[i,a]=[t.x,t.y],o=i-n,s=a-r;return{angle:Math.atan(s/o),deltaX:o,deltaY:s}}e(k,`calculateDeltaAndAngle`);var A=e(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,`pointTransformer`),ne=e(t=>({x:e(function(e,n,r){let i=0,a=A(r[0]).x=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(D,t.arrowTypeEnd)){let{angle:e,deltaX:n}=k(r[r.length-1],r[r.length-2]);i=D[t.arrowTypeEnd]*Math.cos(e)*(n>=0?1:-1)}let o=Math.abs(A(e).x-A(r[r.length-1]).x),s=Math.abs(A(e).y-A(r[r.length-1]).y),c=Math.abs(A(e).x-A(r[0]).x),l=Math.abs(A(e).y-A(r[0]).y),u=D[t.arrowTypeStart],d=D[t.arrowTypeEnd];if(o0&&s0&&l=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(D,t.arrowTypeEnd)){let{angle:e,deltaY:n}=k(r[r.length-1],r[r.length-2]);i=D[t.arrowTypeEnd]*Math.abs(Math.sin(e))*(n>=0?1:-1)}let o=Math.abs(A(e).y-A(r[r.length-1]).y),s=Math.abs(A(e).x-A(r[r.length-1]).x),c=Math.abs(A(e).y-A(r[0]).y),l=Math.abs(A(e).x-A(r[0]).x),u=D[t.arrowTypeStart],d=D[t.arrowTypeEnd];if(o0&&s0&&l{t.arrowTypeStart&&N(e,`start`,t.arrowTypeStart,n,r,i,a,o),t.arrowTypeEnd&&N(e,`end`,t.arrowTypeEnd,n,r,i,a,o)},`addEdgeMarkers`),j={arrow_cross:{type:`cross`,fill:!1},arrow_point:{type:`point`,fill:!0},arrow_barb:{type:`barb`,fill:!0},arrow_barb_neo:{type:`barb`,fill:!0},arrow_circle:{type:`circle`,fill:!1},arrow_hierarchy:{type:`hierarchy`,fill:!1},aggregation:{type:`aggregation`,fill:!1},extension:{type:`extension`,fill:!1},composition:{type:`composition`,fill:!0},dependency:{type:`dependency`,fill:!0},lollipop:{type:`lollipop`,fill:!1},only_one:{type:`onlyOne`,fill:!1},zero_or_one:{type:`zeroOrOne`,fill:!1},one_or_more:{type:`oneOrMore`,fill:!1},zero_or_more:{type:`zeroOrMore`,fill:!1},requirement_arrow:{type:`requirement_arrow`,fill:!1},requirement_contains:{type:`requirement_contains`,fill:!1}},M=[`cross`,`point`,`circle`,`lollipop`,`aggregation`,`extension`,`composition`,`dependency`,`barb`],N=e((e,n,r,i,a,o,s=!1,c)=>{if(!r||r===`none`)return;let l=j[r],u=l&&M.includes(l.type);if(!l){t.warn(`Unknown arrow type: ${r}`);return}let d=`${a}_${o}-${l.type}${n===`start`?`Start`:`End`}${s&&u?`-margin`:``}`;if(c&&c.trim()!==``){let t=`${d}_${c.replace(/[^\dA-Za-z]/g,`_`)}`;if(!document.getElementById(t)){let e=document.getElementById(d);if(e){let n=e.cloneNode(!0);n.id=t,n.querySelectorAll(`path, circle, line`).forEach(e=>{e.setAttribute(`stroke`,c),l.fill&&e.setAttribute(`fill`,c)}),e.parentNode?.appendChild(n)}}e.attr(`marker-${n}`,`url(${i}#${t})`)}else e.attr(`marker-${n}`,`url(${i}#${d})`)},`addEdgeMarker`),ie=e(e=>typeof e==`string`?e:a()?.flowchart?.curve,`resolveEdgeCurveType`),P=new Map,F=new Map,I=e(()=>{P.clear(),F.clear()},`clear`),L=e(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),`hasEdgeLabel`),R=e(e=>e?typeof e==`string`?e:e.reduce((e,t)=>e+`;`+t,``):``,`getLabelStyles`),ae=e(async(e,i)=>{let o=a(),s=r(o),{labelStyles:c}=C(i);i.labelStyle=c;let l=e.insert(`g`).attr(`class`,`edgeLabel`),u=l.insert(`g`).attr(`class`,`label`).attr(`data-id`,i.id),d=i.labelType===`markdown`,f=await x(e,i.label,{style:R(i.labelStyle),useHtmlLabels:s,addSvgBackground:!0,isNode:!1,markdown:d,width:void 0},o);u.node().appendChild(f),t.info(`abc82`,i,i.labelType);let p,m;if(s){let e=f.children[0],t=n(f);p=await S.measure(()=>e.getBoundingClientRect()),m=p,t.attr(`width`,p.width),t.attr(`height`,p.height)}else{let e=n(f).select(`text`).node();await S.measure(()=>{p=f.getBBox(),m=e&&typeof e.getBBox==`function`?e.getBBox():p})}u.attr(`transform`,E(m,s)),P.set(i.id,l),i.width=p.width,i.height=p.height;let h;if(i.startLabelLeft){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await w(r,i.startLabelLeft,R(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,E(o,s)),F.get(i.id)||F.set(i.id,{}),F.get(i.id).startLeft=t,z(h,i.startLabelLeft)}if(i.startLabelRight){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await w(r,i.startLabelRight,R(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,E(o,s)),F.get(i.id)||F.set(i.id,{}),F.get(i.id).startRight=t,z(h,i.startLabelRight)}if(i.endLabelLeft){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await w(t,i.endLabelLeft,R(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,E(o,s)),F.get(i.id)||F.set(i.id,{}),F.get(i.id).endLeft=t,z(h,i.endLabelLeft)}if(i.endLabelRight){let t=e.insert(`g`).attr(`class`,`edgeTerminals`),r=t.insert(`g`).attr(`class`,`inner`),a=await w(t,i.endLabelRight,R(i.labelStyle)||``,!1,!1);h=a;let o=a.getBBox();if(s){let e=a.children[0],t=n(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}r.attr(`transform`,E(o,s)),F.get(i.id)||F.set(i.id,{}),F.get(i.id).endRight=t,z(h,i.endLabelRight)}return f},`insertEdgeLabel`);function z(e,t){r(a())&&e&&(e.style.width=t.length*9+`px`,e.style.height=`12px`)}e(z,`setTerminalWidth`);var B=e((e,n)=>{t.debug(`Moving label abc88 `,e.id,e.label,P.get(e.id),n);let r=n.updatedPath?n.updatedPath:n.originalPath,i=a(),{subGraphTitleTotalMargin:o}=T(i);if(e.label){let i=P.get(e.id),a=e.x,s=e.y;if(r){let i=m.calcLabelPosition(r);t.debug(`Moving label `+e.label+` from (`,a,`,`,s,`) to (`,i.x,`,`,i.y,`) abc88`),n.updatedPath&&(a=i.x,s=i.y)}i.attr(`transform`,`translate(${a}, ${s+o/2})`)}if(e.startLabelLeft){let t=F.get(e.id).startLeft,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.startLabelRight){let t=F.get(e.id).startRight,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.endLabelLeft){let t=F.get(e.id).endLeft,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.endLabelRight){let t=F.get(e.id).endRight,n=e.x,i=e.y;if(r){let t=m.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}},`positionEdgeLabel`),oe=e((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith(`-to-label`)||!Array.isArray(t)||t.length!==2)return t;let[n,r]=t,i=Math.abs(r.x-n.x),a=Math.abs(r.y-n.y);return i<.001||a<.001?t:a>=i?[n,{x:n.x,y:r.y},r]:[n,{x:r.x,y:n.y},r]},`orthogonalizeToLabelClippedPoints`),V=e((e,t)=>{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),H=e((e,n,r)=>{t.debug(`intersection calc abc89: outsidePoint: ${JSON.stringify(n)} insidePoint : ${JSON.stringify(r)} - node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let i=e.x,a=e.y,o=Math.abs(i-r.x),s=e.width/2,c=r.xMath.abs(i-n.x)*l){let e=r.y{t.warn(`abc88 cutPathAtIntersect`,e,n);let r=[],i=e[0],a=!1;return e.forEach(e=>{if(t.info(`abc88 checking point`,e,n),!H(n,e)&&!a){let o=U(n,i,e);t.debug(`abc88 inside`,e,i,o),t.debug(`abc88 intersection`,o,n);let s=!1;r.forEach(e=>{s||=e.x===o.x&&e.y===o.y}),r.some(e=>e.x===o.x&&e.y===o.y)?t.warn(`abc88 no intersect`,o,r):r.push(o),a=!0}else t.warn(`abc88 outside`,e,i),i=e,a||r.push(e)}),t.debug(`returning points`,r),r},`cutPathAtIntersect`);function G(e){let t=[],n=[];for(let r=1;r5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),n.push(r))}return{cornerPoints:t,cornerPointPositions:n}}e(G,`extractCornerPoints`);var K=e(function(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=n/Math.sqrt(r*r+i*i);return{x:t.x-a*r,y:t.y-a*i}},`findAdjacentPoint`),oe=e(function(e){let{cornerPointPositions:n}=G(e),r=[];for(let i=0;i10&&Math.abs(a.y-n.y)>=10?(t.debug(`Corner point fixing`,Math.abs(a.x-n.x),Math.abs(a.y-n.y)),f=o.x===s.x?{x:l<0?s.x-5+d:s.x+5-d,y:u<0?s.y-d:s.y+d}:{x:l<0?s.x-d:s.x+d,y:u<0?s.y-5+d:s.y+5-d}):t.debug(`Corner point skipping fixing`,Math.abs(a.x-n.x),Math.abs(a.y-n.y)),r.push(f,c)}else r.push(e[i]);return r},`fixCorners`),se=e((e,t,n)=>{let r=e-t-n,i=Math.floor(r/4);return`0 ${t} ${Array(Number.isFinite(i)?Math.max(0,i):0).fill(`2 2`).join(` `)} ${n}`},`generateDashArray`),q=e(function(e,r,i,x,C,w,T,E=!1){if(!T)throw Error(`insertEdge: missing diagramId for edge "${r.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:D,layout:O}=a(),A=r.points,j=!1,M=C;var N=w;let P=[];for(let e in r.cssCompiledStyles)S(e)||P.push(r.cssCompiledStyles[e]);if(O===`swimlane`){if(N.intersect&&M.intersect&&Array.isArray(A)&&A.length>=2)if(A.length===2)A=[M.intersect(A[0]),N.intersect(A[1])];else{let e=A.slice(1,-1),t=e[0],n=e[e.length-1],r=.5,i=Math.abs(A[A.length-1].x-n.x)!Number.isNaN(e.y)),L=re(r.curve);L!==`rounded`&&(I=oe(I));let R=_;switch(L){case`linear`:R=_;break;case`basis`:R=p;break;case`cardinal`:R=o;break;case`bumpX`:R=v;break;case`bumpY`:R=h;break;case`catmullRom`:R=l;break;case`monotoneX`:R=u;break;case`monotoneY`:R=f;break;case`natural`:R=d;break;case`step`:R=s;break;case`stepAfter`:R=c;break;case`stepBefore`:R=g;break;case`rounded`:R=_;break;default:R=p}let{x:z,y:ie}=te(r),B=b().x(z).y(ie).curve(R),V;switch(r.thickness){case`normal`:V=`edge-thickness-normal`;break;case`thick`:V=`edge-thickness-thick`;break;case`invisible`:V=`edge-thickness-invisible`;break;default:V=`edge-thickness-normal`}switch(r.pattern){case`solid`:V+=` edge-pattern-solid`;break;case`dotted`:V+=` edge-pattern-dotted`;break;case`dashed`:V+=` edge-pattern-dashed`;break;default:V+=` edge-pattern-solid`}let H,U=L===`rounded`?J(X(I,r),5):B(I),G=Array.isArray(r.style)?r.style:[r.style],K=G.find(e=>e?.startsWith(`stroke:`)),q=``;r.animate&&(q=`edge-animation-fast`),r.animation&&(q=`edge-animation-`+r.animation);let Y=!1;if(r.look===`handDrawn`){let t=ee.svg(e);Object.assign([],I);let i=t.path(U,{roughness:.3,seed:D});V+=` transition`,H=n(i).select(`path`).attr(`id`,`${T}-${r.id}`).attr(`class`,` `+V+(r.classes?` `+r.classes:``)+(q?` `+q:``)).attr(`style`,G?G.reduce((e,t)=>e+`;`+t,``):``);let a=H.attr(`d`);H.attr(`d`,a),e.node().appendChild(H.node())}else{let t=P.join(`;`),n=G?G.reduce((e,t)=>e+t+`;`,``):``,i=(t?t+`;`+n+`;`:n)+`;`+(G?G.reduce((e,t)=>e+`;`+t,``):``);H=e.append(`path`).attr(`d`,U).attr(`id`,`${T}-${r.id}`).attr(`class`,` `+V+(r.classes?` `+r.classes:``)+(q?` `+q:``)).attr(`style`,i),K=i.match(/stroke:([^;]+)/)?.[1],Y=r.animate===!0||!!r.animation||t.includes(`animation`);let a=H.node(),o=typeof a.getTotalLength==`function`?a.getTotalLength():0,s=k[r.arrowTypeStart]||0,c=k[r.arrowTypeEnd]||0;if(r.look===`neo`&&!Y){let e=`stroke-dasharray: ${r.pattern===`dotted`||r.pattern===`dashed`?se(o,s,c):`0 ${s} ${o-s-c} ${c}`}; stroke-dashoffset: 0;`;H.attr(`style`,e+H.attr(`style`))}}H.attr(`data-edge`,!0),H.attr(`data-et`,`edge`),H.attr(`data-id`,r.id),H.attr(`data-points`,F),H.attr(`data-look`,y(r.look)),r.showPoints&&I.forEach(t=>{e.append(`circle`).style(`stroke`,`red`).style(`fill`,`red`).attr(`r`,1).attr(`cx`,t.x).attr(`cy`,t.y)});let Z=``;(a().flowchart.arrowMarkerAbsolute||a().state.arrowMarkerAbsolute)&&(Z=window.location.protocol+`//`+window.location.host+window.location.pathname+window.location.search,Z=Z.replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)),t.info(`arrowTypeStart`,r.arrowTypeStart),t.info(`arrowTypeEnd`,r.arrowTypeEnd);let Q=!Y&&r?.look===`neo`;ne(H,r,Z,T,x,Q,K);let ce=Math.floor(A.length/2),le=A[ce];m.isLabelCoordinateInPath(le,H.attr(`d`))||(j=!0);let $={};return j&&($.updatedPath=A),$.originalPath=r.points,$},`insertEdge`);function J(e,t){if(e.length<2)return``;let n=``,r=e.length,i=1e-5;for(let a=0;a({...e}));if(e.length>=2&&O[t.arrowTypeStart]){let r=O[t.arrowTypeStart],i=e[0],a=e[1],{angle:o}=Y(i,a),s=r*Math.cos(o),c=r*Math.sin(o);n[0].x=i.x+s,n[0].y=i.y+c}let r=e.length;if(r>=2&&O[t.arrowTypeEnd]){let i=O[t.arrowTypeEnd],a=e[r-1],o=e[r-2],{angle:s}=Y(o,a),c=i*Math.cos(s),l=i*Math.sin(s);n[r-1].x=a.x-c,n[r-1].y=a.y-l}return n}e(X,`applyMarkerOffsetsToPoints`);var Z=e((e,t,n,r)=>{t.forEach(t=>{Q[t](e,n,r)})},`insertMarkers`),Q={extension:e((e,n,r)=>{t.trace(`Making markers for `,r),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionStart`).attr(`class`,`marker extension `+n).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,7 L18,13 V 1 Z`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionEnd`).attr(`class`,`marker extension `+n).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,1 V 13 L18,7 Z`),e.append(`marker`).attr(`id`,r+`_`+n+`-extensionStart-margin`).attr(`class`,`marker extension `+n).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,7 18,13 18,1`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionEnd-margin`).attr(`class`,`marker extension `+n).attr(`refX`,9).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,1 10,13 18,7`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`)},`extension`),composition:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart`).attr(`class`,`marker composition `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd`).attr(`class`,`marker composition `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart-margin`).attr(`class`,`marker composition `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`viewBox`,`0 0 15 15`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd-margin`).attr(`class`,`marker composition `+t).attr(`refX`,3.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`composition`),aggregation:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart`).attr(`class`,`marker aggregation `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`aggregation`),dependency:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart`).attr(`class`,`marker dependency `+t).attr(`refX`,6).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd`).attr(`class`,`marker dependency `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,4).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,16).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`dependency`),lollipop:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2)},`lollipop`),point:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,4.5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 5 L 10 10 L 10 0 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,11.5).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,10.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 11.5 7 L 0 14 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,1).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0,7 11.5,14 11.5,0`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`point`),circle:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,11).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-1).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refY`,5).attr(`refX`,12.25).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`circle`),cross:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,12).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,-1).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,17.7).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,-3.5).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5).style(`stroke-dasharray`,`1,0`)},`cross`),barb:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`barb`),barbNeo:e((e,t,n)=>{let{themeVariables:r}=i(),{transitionColor:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd-margin`).attr(`refX`,17).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`).attr(`fill`,`${a}`)},`barbNeo`),hierarchy:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-hierarchyEnd`).attr(`class`,`marker hierarchy `+t).attr(`viewBox`,`0 0 12 10`).attr(`refX`,10).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,10).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`).style(`fill`,`none`),e.append(`marker`).attr(`id`,n+`_`+t+`-hierarchyStart`).attr(`class`,`marker hierarchy `+t).attr(`viewBox`,`0 0 12 10`).attr(`refX`,2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,10).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`).style(`fill`,`none`)},`hierarchy`),only_one:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`)},`only_one`),zero_or_one:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,21).attr(`cy`,9).attr(`r`,6),r.append(`path`).attr(`d`,`M9,0 L9,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,9).attr(`r`,6),i.append(`path`).attr(`d`,`M21,0 L21,18`)},`zero_or_one`),one_or_more:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`)},`one_or_more`),zero_or_more:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,48).attr(`cy`,18).attr(`r`,6),r.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,18).attr(`r`,6),i.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`)},`zero_or_more`),only_one_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`).attr(`stroke-width`,`${a}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`).attr(`stroke-width`,`${a}`)},`only_one_neo`),zero_or_one_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a,mainBkg:o}=r,s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);s.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,21).attr(`cy`,9).attr(`stroke-width`,`${a}`).attr(`r`,6),s.append(`path`).attr(`d`,`M9,0 L9,18`).attr(`stroke-width`,`${a}`);let c=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);c.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,9).attr(`cy`,9).attr(`stroke-width`,`${a}`).attr(`r`,6),c.append(`path`).attr(`d`,`M21,0 L21,18`).attr(`stroke-width`,`${a}`)},`zero_or_one_neo`),one_or_more_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`).attr(`stroke-width`,`${a}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`).attr(`stroke-width`,`${a}`)},`one_or_more_neo`),zero_or_more_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a,mainBkg:o}=r,s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);s.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,45.5).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${a}`),s.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`).attr(`stroke-width`,`${a}`);let c=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);c.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,11).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${a}`),c.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`).attr(`stroke-width`,`${a}`)},`zero_or_more_neo`),requirement_arrow:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,0 + node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let i=e.x,a=e.y,o=Math.abs(i-r.x),s=e.width/2,c=r.xMath.abs(i-n.x)*l){let e=r.y{t.warn(`abc88 cutPathAtIntersect`,e,n);let r=[],i=e[0],a=!1;return e.forEach(e=>{if(t.info(`abc88 checking point`,e,n),!V(n,e)&&!a){let o=H(n,i,e);t.debug(`abc88 inside`,e,i,o),t.debug(`abc88 intersection`,o,n);let s=!1;r.forEach(e=>{s||=e.x===o.x&&e.y===o.y}),r.some(e=>e.x===o.x&&e.y===o.y)?t.warn(`abc88 no intersect`,o,r):r.push(o),a=!0}else t.warn(`abc88 outside`,e,i),i=e,a||r.push(e)}),t.debug(`returning points`,r),r},`cutPathAtIntersect`);function W(e){let t=[],n=[];for(let r=1;r5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),n.push(r))}return{cornerPoints:t,cornerPointPositions:n}}e(W,`extractCornerPoints`);var G=e(function(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=n/Math.sqrt(r*r+i*i);return{x:t.x-a*r,y:t.y-a*i}},`findAdjacentPoint`),se=e(function(e){let{cornerPointPositions:n}=W(e),r=[];for(let i=0;i10&&Math.abs(a.y-n.y)>=10?(t.debug(`Corner point fixing`,Math.abs(a.x-n.x),Math.abs(a.y-n.y)),f=o.x===s.x?{x:l<0?s.x-5+d:s.x+5-d,y:u<0?s.y-d:s.y+d}:{x:l<0?s.x-d:s.x+d,y:u<0?s.y-5+d:s.y+5-d}):t.debug(`Corner point skipping fixing`,Math.abs(a.x-n.x),Math.abs(a.y-n.y)),r.push(f,c)}else r.push(e[i]);return r},`fixCorners`),ce=e((e,t,n)=>{let r=e-t-n,i=Math.floor(r/4);return`0 ${t} ${Array(Number.isFinite(i)?Math.max(0,i):0).fill(`2 2`).join(` `)} ${n}`},`generateDashArray`),K=e(function(e,r,i,x,S,C,w,T=!1){if(!w)throw Error(`insertEdge: missing diagramId for edge "${r.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:E,layout:D}=a(),k=r.points,A=!1,j=S;var M=C;let N=[];for(let e in r.cssCompiledStyles)ee(e)||N.push(r.cssCompiledStyles[e]);if(D===`swimlane`){if(M.intersect&&j.intersect&&Array.isArray(k)&&k.length>=2)if(k.length===2)k=[j.intersect(k[0]),M.intersect(k[1])];else{let e=k.slice(1,-1),t=e[0],n=e[e.length-1],r=.5,i=Math.abs(k[k.length-1].x-n.x)!Number.isNaN(e.y)),I=ie(r.curve);I!==`rounded`&&(F=se(F));let L=_;switch(I){case`linear`:L=_;break;case`basis`:L=p;break;case`cardinal`:L=o;break;case`bumpX`:L=v;break;case`bumpY`:L=h;break;case`catmullRom`:L=l;break;case`monotoneX`:L=u;break;case`monotoneY`:L=f;break;case`natural`:L=d;break;case`step`:L=s;break;case`stepAfter`:L=c;break;case`stepBefore`:L=g;break;case`rounded`:L=_;break;default:L=p}let{x:R,y:ae}=ne(r),z=b().x(R).y(ae).curve(L),B;switch(r.thickness){case`normal`:B=`edge-thickness-normal`;break;case`thick`:B=`edge-thickness-thick`;break;case`invisible`:B=`edge-thickness-invisible`;break;default:B=`edge-thickness-normal`}switch(r.pattern){case`solid`:B+=` edge-pattern-solid`;break;case`dotted`:B+=` edge-pattern-dotted`;break;case`dashed`:B+=` edge-pattern-dashed`;break;default:B+=` edge-pattern-solid`}let V,H=I===`rounded`?q(Y(F,r),5):z(F),W=Array.isArray(r.style)?r.style:[r.style],G=W.find(e=>e?.startsWith(`stroke:`)),K=``;r.animate&&(K=`edge-animation-fast`),r.animation&&(K=`edge-animation-`+r.animation);let J=!1;if(r.look===`handDrawn`){let t=te.svg(e);Object.assign([],F);let i=t.path(H,{roughness:.3,seed:E});B+=` transition`,V=n(i).select(`path`).attr(`id`,`${w}-${r.id}`).attr(`class`,` `+B+(r.classes?` `+r.classes:``)+(K?` `+K:``)).attr(`style`,W?W.reduce((e,t)=>e+`;`+t,``):``);let a=V.attr(`d`);V.attr(`d`,a),e.node().appendChild(V.node())}else{let t=N.join(`;`),n=W?W.reduce((e,t)=>e+t+`;`,``):``,i=(t?t+`;`+n+`;`:n)+`;`+(W?W.reduce((e,t)=>e+`;`+t,``):``);V=e.append(`path`).attr(`d`,H).attr(`id`,`${w}-${r.id}`).attr(`class`,` `+B+(r.classes?` `+r.classes:``)+(K?` `+K:``)).attr(`style`,i),G=i.match(/stroke:([^;]+)/)?.[1],J=r.animate===!0||!!r.animation||t.includes(`animation`);let a=V.node(),o=typeof a.getTotalLength==`function`?a.getTotalLength():0,s=O[r.arrowTypeStart]||0,c=O[r.arrowTypeEnd]||0;if(r.look===`neo`&&!J){let e=`stroke-dasharray: ${r.pattern===`dotted`||r.pattern===`dashed`?ce(o,s,c):`0 ${s} ${o-s-c} ${c}`}; stroke-dashoffset: 0;`;V.attr(`style`,e+V.attr(`style`))}}V.attr(`data-edge`,!0),V.attr(`data-et`,`edge`),V.attr(`data-id`,r.id),V.attr(`data-points`,P),V.attr(`data-look`,y(r.look)),r.showPoints&&F.forEach(t=>{e.append(`circle`).style(`stroke`,`red`).style(`fill`,`red`).attr(`r`,1).attr(`cx`,t.x).attr(`cy`,t.y)});let X=``;(a().flowchart.arrowMarkerAbsolute||a().state.arrowMarkerAbsolute)&&(X=window.location.protocol+`//`+window.location.host+window.location.pathname+window.location.search,X=X.replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)),t.info(`arrowTypeStart`,r.arrowTypeStart),t.info(`arrowTypeEnd`,r.arrowTypeEnd);let Z=!J&&r?.look===`neo`;re(V,r,X,w,x,Z,G);let Q=Math.floor(k.length/2),le=k[Q];m.isLabelCoordinateInPath(le,V.attr(`d`))||(A=!0);let $={};return A&&($.updatedPath=k),$.originalPath=r.points,$},`insertEdge`);function q(e,t){if(e.length<2)return``;let n=``,r=e.length,i=1e-5;for(let a=0;a({...e}));if(e.length>=2&&D[t.arrowTypeStart]){let r=D[t.arrowTypeStart],i=e[0],a=e[1],{angle:o}=J(i,a),s=r*Math.cos(o),c=r*Math.sin(o);n[0].x=i.x+s,n[0].y=i.y+c}let r=e.length;if(r>=2&&D[t.arrowTypeEnd]){let i=D[t.arrowTypeEnd],a=e[r-1],o=e[r-2],{angle:s}=J(o,a),c=i*Math.cos(s),l=i*Math.sin(s);n[r-1].x=a.x-c,n[r-1].y=a.y-l}return n}e(Y,`applyMarkerOffsetsToPoints`);var X=e((e,t,n,r)=>{t.forEach(t=>{Z[t](e,n,r)})},`insertMarkers`),Z={extension:e((e,n,r)=>{t.trace(`Making markers for `,r),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionStart`).attr(`class`,`marker extension `+n).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,7 L18,13 V 1 Z`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionEnd`).attr(`class`,`marker extension `+n).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,1 V 13 L18,7 Z`),e.append(`marker`).attr(`id`,r+`_`+n+`-extensionStart-margin`).attr(`class`,`marker extension `+n).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,7 18,13 18,1`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+n+`-extensionEnd-margin`).attr(`class`,`marker extension `+n).attr(`refX`,9).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,1 10,13 18,7`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`)},`extension`),composition:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart`).attr(`class`,`marker composition `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd`).attr(`class`,`marker composition `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart-margin`).attr(`class`,`marker composition `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`viewBox`,`0 0 15 15`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd-margin`).attr(`class`,`marker composition `+t).attr(`refX`,3.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`composition`),aggregation:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart`).attr(`class`,`marker aggregation `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`aggregation`),dependency:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart`).attr(`class`,`marker dependency `+t).attr(`refX`,6).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd`).attr(`class`,`marker dependency `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,4).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,16).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`dependency`),lollipop:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2)},`lollipop`),point:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,4.5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 5 L 10 10 L 10 0 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,11.5).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,10.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 11.5 7 L 0 14 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,1).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0,7 11.5,14 11.5,0`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`point`),circle:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,11).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-1).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refY`,5).attr(`refX`,12.25).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`circle`),cross:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,12).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,-1).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,17.7).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,-3.5).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5).style(`stroke-dasharray`,`1,0`)},`cross`),barb:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`barb`),barbNeo:e((e,t,n)=>{let{themeVariables:r}=i(),{transitionColor:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd-margin`).attr(`refX`,17).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`).attr(`fill`,`${a}`)},`barbNeo`),hierarchy:e((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-hierarchyEnd`).attr(`class`,`marker hierarchy `+t).attr(`viewBox`,`0 0 12 10`).attr(`refX`,10).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,10).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`).style(`fill`,`none`),e.append(`marker`).attr(`id`,n+`_`+t+`-hierarchyStart`).attr(`class`,`marker hierarchy `+t).attr(`viewBox`,`0 0 12 10`).attr(`refX`,2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,10).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`).style(`fill`,`none`)},`hierarchy`),only_one:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`)},`only_one`),zero_or_one:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,21).attr(`cy`,9).attr(`r`,6),r.append(`path`).attr(`d`,`M9,0 L9,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,9).attr(`r`,6),i.append(`path`).attr(`d`,`M21,0 L21,18`)},`zero_or_one`),one_or_more:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`)},`one_or_more`),zero_or_more:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,48).attr(`cy`,18).attr(`r`,6),r.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,18).attr(`r`,6),i.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`)},`zero_or_more`),only_one_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`).attr(`stroke-width`,`${a}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`).attr(`stroke-width`,`${a}`)},`only_one_neo`),zero_or_one_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a,mainBkg:o}=r,s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);s.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,21).attr(`cy`,9).attr(`stroke-width`,`${a}`).attr(`r`,6),s.append(`path`).attr(`d`,`M9,0 L9,18`).attr(`stroke-width`,`${a}`);let c=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);c.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,9).attr(`cy`,9).attr(`stroke-width`,`${a}`).attr(`r`,6),c.append(`path`).attr(`d`,`M21,0 L21,18`).attr(`stroke-width`,`${a}`)},`zero_or_one_neo`),one_or_more_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`).attr(`stroke-width`,`${a}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`).attr(`stroke-width`,`${a}`)},`one_or_more_neo`),zero_or_more_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a,mainBkg:o}=r,s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);s.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,45.5).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${a}`),s.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`).attr(`stroke-width`,`${a}`);let c=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);c.append(`circle`).attr(`fill`,o??`white`).attr(`cx`,11).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${a}`),c.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`).attr(`stroke-width`,`${a}`)},`zero_or_more_neo`),requirement_arrow:e((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,0 L20,10 M20,10 L0,20`)},`requirement_arrow`),requirement_contains:e((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`g`);r.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),r.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),r.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10)},`requirement_contains`),requirement_arrow_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`stroke-width`,`${a}`).attr(`viewBox`,`0 0 25 20`).append(`path`).attr(`d`,`M0,0 L20,10 M20,10 - L0,20`).attr(`stroke-linejoin`,`miter`)},`requirement_arrow_neo`),requirement_contains_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r,o=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`g`);o.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),o.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),o.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10),o.selectAll(`*`).attr(`stroke-width`,`${a}`)},`requirement_contains_neo`)},ce=Z;export{ie as a,ce as c,q as i,V as l,F as n,O as o,R as r,k as s,L as t,I as u}; \ No newline at end of file + L0,20`).attr(`stroke-linejoin`,`miter`)},`requirement_arrow_neo`),requirement_contains_neo:e((e,t,n)=>{let{themeVariables:r}=i(),{strokeWidth:a}=r,o=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`g`);o.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),o.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),o.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10),o.selectAll(`*`).attr(`stroke-width`,`${a}`)},`requirement_contains_neo`)},Q=X;export{ae as a,Q as c,K as i,B as l,P as n,D as o,L as r,O as s,I as t,F as u}; \ No newline at end of file diff --git a/web/dist/app-classDiagram-v2-NBCMYWYE.js b/web/dist/app-classDiagram-v2-NBCMYWYE.js index af4720c61..2bdce788e 100644 --- a/web/dist/app-classDiagram-v2-NBCMYWYE.js +++ b/web/dist/app-classDiagram-v2-NBCMYWYE.js @@ -1,9 +1,9 @@ -import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,M as a,U as o,a as s,q as c,s as l,v as u,w as d,x as f,y as p,z as m}from"./app-chunk-O7XYJQB3.js";import{c as h,g}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{i as _,n as v,o as y,r as b}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as x,t as S}from"./app-chunk-GNY47TPC.js";import{t as C}from"./app-chunk-5VM5RSS4.js";import{t as w}from"./app-chunk-GWA4HPMP.js";import{t as T}from"./app-chunk-XXDRQBXY.js";import{t as E}from"./app-chunk-WEXAMYUT.js";var D=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,18],r=[1,19],i=[1,20],a=[1,41],o=[1,26],s=[1,42],c=[1,24],l=[1,25],u=[1,32],d=[1,33],f=[1,34],p=[1,45],m=[1,35],h=[1,36],g=[1,37],_=[1,38],v=[1,27],y=[1,28],b=[1,29],x=[1,30],S=[1,31],C=[1,44],w=[1,46],T=[1,43],E=[1,47],D=[1,9],O=[1,8,9],k=[1,58],A=[1,59],j=[1,60],M=[1,61],N=[1,62],P=[1,63],F=[1,64],I=[1,8,9,41],ee=[1,77],L=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],R=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],z=[13,60,86,100,102,103],B=[13,60,73,74,86,100,102,103],te=[13,60,68,69,70,71,72,86,100,102,103],V=[1,103],H=[1,121],U=[1,117],W=[1,113],G=[1,119],K=[1,114],q=[1,115],J=[1,116],Y=[1,118],X=[1,120],ne=[22,50,60,61,82,86,87,88,89,90],re=[1,128],Z=[12,39],ie=[1,8,9,39,41,44,46],Q=[1,8,9,22],ae=[1,153],oe=[1,8,9,61],$=[1,8,9,22,50,60,61,82,86,87,88,89,90],se={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:`error`,7:`CLASS_DIAGRAM`,8:`NEWLINE`,9:`EOF`,12:`SQS`,13:`STR`,14:`SQE`,18:`DOT`,20:`GENERICTYPE`,22:`LABEL`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,39:`STRUCT_START`,41:`STRUCT_STOP`,42:`NAMESPACE`,44:`STYLE_SEPARATOR`,46:`ANNOTATION_START`,47:`ANNOTATION_END`,48:`CLASS`,50:`SPACE`,51:`MEMBER`,52:`SEPARATOR`,54:`NOTE_FOR`,56:`NOTE`,57:`CLASSDEF`,60:`ALPHA`,61:`COMMA`,62:`direction_tb`,63:`direction_bt`,64:`direction_rl`,65:`direction_lr`,68:`AGGREGATION`,69:`EXTENSION`,70:`COMPOSITION`,71:`DEPENDENCY`,72:`LOLLIPOP`,73:`LINE`,74:`DOTTED_LINE`,75:`CALLBACK`,76:`LINK`,77:`LINK_TARGET`,78:`CLICK`,79:`CALLBACK_NAME`,80:`CALLBACK_ARGS`,81:`HREF`,82:`STYLE`,83:`CSSCLASS`,86:`NUM`,87:`COLON`,88:`UNIT`,89:`BRKT`,90:`PCT`,93:`graphCodeTokens`,95:`TAGSTART`,96:`TAGEND`,97:`==`,98:`--`,99:`DEFAULT`,100:`MINUS`,101:`keywords`,102:`UNICODE_TEXT`,103:`BQUOTE_STR`},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 8:this.$=a[s-1];break;case 9:case 10:case 13:case 15:this.$=a[s];break;case 11:case 14:this.$=a[s-2]+`.`+a[s];break;case 12:case 16:this.$=a[s-1]+a[s];break;case 17:case 18:this.$=a[s-1]+`~`+a[s]+`~`;break;case 19:r.addRelation(a[s]);break;case 20:a[s-1].title=r.cleanupLabel(a[s]),r.addRelation(a[s-1]);break;case 31:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 34:r.addClassesToNamespace(a[s-3],a[s-1][0],a[s-1][1]),r.popNamespace();break;case 35:r.addClassesToNamespace(a[s-4],a[s-1][0],a[s-1][1]),r.popNamespace();break;case 36:this.$=r.addNamespace(a[s]);break;case 37:this.$=r.addNamespace(a[s-1],a[s]);break;case 38:this.$=[[a[s]],[]];break;case 39:this.$=[[a[s-1]],[]];break;case 40:a[s][0].unshift(a[s-2]),this.$=a[s];break;case 41:this.$=[[],[a[s]]];break;case 42:this.$=[[],[a[s-1]]];break;case 43:a[s][1].unshift(a[s-2]),this.$=a[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=a[s];break;case 48:r.setCssClass(a[s-2],a[s]);break;case 49:r.addMembers(a[s-3],a[s-1]);break;case 51:r.setCssClass(a[s-5],a[s-3]),r.addMembers(a[s-5],a[s-1]);break;case 52:r.addAnnotation(a[s-3],a[s-1]);break;case 53:r.addAnnotation(a[s-6],a[s-4]),r.addMembers(a[s-6],a[s-1]);break;case 54:r.addAnnotation(a[s-5],a[s-3]);break;case 55:this.$=a[s],r.addClass(a[s]);break;case 56:this.$=a[s-1],r.addClass(a[s-1]),r.setClassLabel(a[s-1],a[s]);break;case 60:r.addAnnotation(a[s],a[s-2]);break;case 61:case 74:this.$=[a[s]];break;case 62:a[s].push(a[s-1]),this.$=a[s];break;case 63:break;case 64:r.addMember(a[s-1],r.cleanupLabel(a[s]));break;case 65:break;case 66:break;case 67:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:`none`,relationTitle2:`none`};break;case 68:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:`none`};break;case 69:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:`none`,relationTitle2:a[s-1]};break;case 70:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 71:this.$=r.addNote(a[s],a[s-1]);break;case 72:this.$=r.addNote(a[s]);break;case 73:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 75:this.$=a[s-2].concat([a[s]]);break;case 76:r.setDirection(`TB`);break;case 77:r.setDirection(`BT`);break;case 78:r.setDirection(`RL`);break;case 79:r.setDirection(`LR`);break;case 80:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 81:this.$={type1:`none`,type2:a[s],lineType:a[s-1]};break;case 82:this.$={type1:a[s-1],type2:`none`,lineType:a[s]};break;case 83:this.$={type1:`none`,type2:`none`,lineType:a[s]};break;case 84:this.$=r.relationType.AGGREGATION;break;case 85:this.$=r.relationType.EXTENSION;break;case 86:this.$=r.relationType.COMPOSITION;break;case 87:this.$=r.relationType.DEPENDENCY;break;case 88:this.$=r.relationType.LOLLIPOP;break;case 89:this.$=r.lineType.LINE;break;case 90:this.$=r.lineType.DOTTED_LINE;break;case 91:case 97:this.$=a[s-2],r.setClickEvent(a[s-1],a[s]);break;case 92:case 98:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 93:this.$=a[s-2],r.setLink(a[s-1],a[s]);break;case 94:this.$=a[s-3],r.setLink(a[s-2],a[s-1],a[s]);break;case 95:this.$=a[s-3],r.setLink(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 96:this.$=a[s-4],r.setLink(a[s-3],a[s-2],a[s]),r.setTooltip(a[s-3],a[s-1]);break;case 99:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 100:this.$=a[s-4],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 101:this.$=a[s-3],r.setLink(a[s-2],a[s]);break;case 102:this.$=a[s-4],r.setLink(a[s-3],a[s-1],a[s]);break;case 103:this.$=a[s-4],r.setLink(a[s-3],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 104:this.$=a[s-5],r.setLink(a[s-4],a[s-2],a[s]),r.setTooltip(a[s-4],a[s-1]);break;case 105:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 106:r.setCssClass(a[s-1],a[s]);break;case 107:this.$=[a[s]];break;case 108:a[s-2].push(a[s]),this.$=a[s-2];break;case 110:this.$=a[s-1]+a[s]}},`anonymous`),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:n,35:r,37:i,38:22,42:a,43:23,46:o,48:s,51:c,52:l,54:u,56:d,57:f,60:p,62:m,63:h,64:g,65:_,75:v,76:y,78:b,82:x,83:S,86:C,100:w,102:T,103:E},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},e(D,[2,5],{8:[1,48]}),{8:[1,49]},e(O,[2,19],{22:[1,50]}),e(O,[2,21]),e(O,[2,22]),e(O,[2,23]),e(O,[2,24]),e(O,[2,25]),e(O,[2,26]),e(O,[2,27]),e(O,[2,28]),e(O,[2,29]),e(O,[2,30]),{34:[1,51]},{36:[1,52]},e(O,[2,33]),e(O,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:k,69:A,70:j,71:M,72:N,73:P,74:F}),{39:[1,65]},e(I,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),e(O,[2,65]),e(O,[2,66]),{16:69,60:p,86:C,100:w,102:T},{16:39,17:40,19:70,60:p,86:C,100:w,102:T,103:E},{16:39,17:40,19:71,60:p,86:C,100:w,102:T,103:E},{16:39,17:40,19:72,60:p,86:C,100:w,102:T,103:E},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:p,86:C,100:w,102:T,103:E},{13:ee,55:76},{58:78,60:[1,79]},e(O,[2,76]),e(O,[2,77]),e(O,[2,78]),e(O,[2,79]),e(L,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:p,86:C,100:w,102:T,103:E}),e(L,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:p,86:C,100:w,102:T,103:E},{16:39,17:40,19:87,60:p,86:C,100:w,102:T,103:E},e(R,[2,133]),e(R,[2,134]),e(R,[2,135]),e(R,[2,136]),e([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),e(D,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:n,35:r,37:i,42:a,46:o,48:s,51:c,52:l,54:u,56:d,57:f,60:p,62:m,63:h,64:g,65:_,75:v,76:y,78:b,82:x,83:S,86:C,100:w,102:T,103:E}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:n,35:r,37:i,38:22,42:a,43:23,46:o,48:s,51:c,52:l,54:u,56:d,57:f,60:p,62:m,63:h,64:g,65:_,75:v,76:y,78:b,82:x,83:S,86:C,100:w,102:T,103:E},e(O,[2,20]),e(O,[2,31]),e(O,[2,32]),{13:[1,91],16:39,17:40,19:90,60:p,86:C,100:w,102:T,103:E},{53:92,66:56,67:57,68:k,69:A,70:j,71:M,72:N,73:P,74:F},e(O,[2,64]),{67:93,73:P,74:F},e(z,[2,83],{66:94,68:k,69:A,70:j,71:M,72:N}),e(B,[2,84]),e(B,[2,85]),e(B,[2,86]),e(B,[2,87]),e(B,[2,88]),e(te,[2,89]),e(te,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:a,43:23,48:s,54:u,56:d},{16:100,60:p,86:C,100:w,102:T},{41:[1,102],45:101,51:V},{16:104,60:p,86:C,100:w,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:H,50:U,59:110,60:W,82:G,84:111,85:112,86:K,87:q,88:J,89:Y,90:X},{60:[1,122]},{13:ee,55:123},e(I,[2,72]),e(I,[2,138]),{22:H,50:U,59:124,60:W,61:[1,125],82:G,84:111,85:112,86:K,87:q,88:J,89:Y,90:X},e(ne,[2,74]),{16:39,17:40,19:126,60:p,86:C,100:w,102:T,103:E},e(L,[2,16]),e(L,[2,17]),e(L,[2,18]),{11:127,12:re,39:[2,36]},e(Z,[2,9],{16:85,17:86,15:130,18:[1,129],60:p,86:C,100:w,102:T,103:E}),e(Z,[2,10]),e(ie,[2,55],{11:131,12:re}),e(D,[2,7]),{9:[1,132]},e(Q,[2,67]),{16:39,17:40,19:133,60:p,86:C,100:w,102:T,103:E},{13:[1,135],16:39,17:40,19:134,60:p,86:C,100:w,102:T,103:E},e(z,[2,82],{66:136,68:k,69:A,70:j,71:M,72:N}),e(z,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:a,43:23,48:s,54:u,56:d},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},e(I,[2,48],{39:[1,142]}),{41:[1,143]},e(I,[2,50]),{41:[2,61],45:144,51:V},{47:[1,145]},{16:39,17:40,19:146,60:p,86:C,100:w,102:T,103:E},e(O,[2,91],{13:[1,147]}),e(O,[2,93],{13:[1,149],77:[1,148]}),e(O,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},e(O,[2,105],{61:ae}),e(oe,[2,107],{85:154,22:H,50:U,60:W,82:G,86:K,87:q,88:J,89:Y,90:X}),e($,[2,109]),e($,[2,111]),e($,[2,112]),e($,[2,113]),e($,[2,114]),e($,[2,115]),e($,[2,116]),e($,[2,117]),e($,[2,118]),e($,[2,119]),e(O,[2,106]),e(I,[2,71]),e(O,[2,73],{61:ae}),{60:[1,155]},e(L,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:p,86:C,100:w,102:T,103:E},e(Z,[2,12]),e(ie,[2,56]),{1:[2,4]},e(Q,[2,69]),e(Q,[2,68]),{16:39,17:40,19:158,60:p,86:C,100:w,102:T,103:E},e(z,[2,80]),e(I,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:a,43:23,48:s,54:u,56:d},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:a,43:23,48:s,54:u,56:d},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:a,43:23,48:s,54:u,56:d},{45:163,51:V},e(I,[2,49]),{41:[2,62]},e(I,[2,52],{39:[1,164]}),e(O,[2,60]),e(O,[2,92]),e(O,[2,94]),e(O,[2,95],{77:[1,165]}),e(O,[2,98]),e(O,[2,99],{13:[1,166]}),e(O,[2,101],{13:[1,168],77:[1,167]}),{22:H,50:U,60:W,82:G,84:169,85:112,86:K,87:q,88:J,89:Y,90:X},e($,[2,110]),e(ne,[2,75]),{14:[1,170]},e(Z,[2,11]),e(Q,[2,70]),e(I,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:V},e(O,[2,96]),e(O,[2,100]),e(O,[2,102]),e(O,[2,103],{77:[1,174]}),e(oe,[2,108],{85:154,22:H,50:U,60:W,82:G,86:K,87:q,88:J,89:Y,90:X}),e(ie,[2,8]),e(I,[2,51]),{41:[1,175]},e(I,[2,54]),e(O,[2,104]),e(I,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,M as a,U as o,a as s,q as c,s as l,v as u,w as d,x as f,y as p,z as m}from"./app-chunk-O7XYJQB3.js";import{c as h,g}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{t as _}from"./app-chunk-5VM5RSS4.js";import"./app-chunk-7PRAP22T.js";import{i as v,n as y,o as b,r as x}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import{t as S}from"./app-chunk-GWA4HPMP.js";import{t as C}from"./app-chunk-XXDRQBXY.js";import{t as w}from"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import{r as T,t as E}from"./app-chunk-GNY47TPC.js";var D=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,18],r=[1,19],i=[1,20],a=[1,41],o=[1,26],s=[1,42],c=[1,24],l=[1,25],u=[1,32],d=[1,33],f=[1,34],p=[1,45],m=[1,35],h=[1,36],g=[1,37],_=[1,38],v=[1,27],y=[1,28],b=[1,29],x=[1,30],S=[1,31],C=[1,44],w=[1,46],T=[1,43],E=[1,47],D=[1,9],O=[1,8,9],k=[1,58],A=[1,59],j=[1,60],M=[1,61],N=[1,62],P=[1,63],F=[1,64],I=[1,8,9,41],ee=[1,77],L=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],R=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],z=[13,60,86,100,102,103],B=[13,60,73,74,86,100,102,103],te=[13,60,68,69,70,71,72,86,100,102,103],V=[1,103],H=[1,121],U=[1,117],W=[1,113],G=[1,119],K=[1,114],q=[1,115],J=[1,116],Y=[1,118],X=[1,120],ne=[22,50,60,61,82,86,87,88,89,90],re=[1,128],Z=[12,39],ie=[1,8,9,39,41,44,46],Q=[1,8,9,22],ae=[1,153],oe=[1,8,9,61],$=[1,8,9,22,50,60,61,82,86,87,88,89,90],se={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:`error`,7:`CLASS_DIAGRAM`,8:`NEWLINE`,9:`EOF`,12:`SQS`,13:`STR`,14:`SQE`,18:`DOT`,20:`GENERICTYPE`,22:`LABEL`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,39:`STRUCT_START`,41:`STRUCT_STOP`,42:`NAMESPACE`,44:`STYLE_SEPARATOR`,46:`ANNOTATION_START`,47:`ANNOTATION_END`,48:`CLASS`,50:`SPACE`,51:`MEMBER`,52:`SEPARATOR`,54:`NOTE_FOR`,56:`NOTE`,57:`CLASSDEF`,60:`ALPHA`,61:`COMMA`,62:`direction_tb`,63:`direction_bt`,64:`direction_rl`,65:`direction_lr`,68:`AGGREGATION`,69:`EXTENSION`,70:`COMPOSITION`,71:`DEPENDENCY`,72:`LOLLIPOP`,73:`LINE`,74:`DOTTED_LINE`,75:`CALLBACK`,76:`LINK`,77:`LINK_TARGET`,78:`CLICK`,79:`CALLBACK_NAME`,80:`CALLBACK_ARGS`,81:`HREF`,82:`STYLE`,83:`CSSCLASS`,86:`NUM`,87:`COLON`,88:`UNIT`,89:`BRKT`,90:`PCT`,93:`graphCodeTokens`,95:`TAGSTART`,96:`TAGEND`,97:`==`,98:`--`,99:`DEFAULT`,100:`MINUS`,101:`keywords`,102:`UNICODE_TEXT`,103:`BQUOTE_STR`},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 8:this.$=a[s-1];break;case 9:case 10:case 13:case 15:this.$=a[s];break;case 11:case 14:this.$=a[s-2]+`.`+a[s];break;case 12:case 16:this.$=a[s-1]+a[s];break;case 17:case 18:this.$=a[s-1]+`~`+a[s]+`~`;break;case 19:r.addRelation(a[s]);break;case 20:a[s-1].title=r.cleanupLabel(a[s]),r.addRelation(a[s-1]);break;case 31:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 34:r.addClassesToNamespace(a[s-3],a[s-1][0],a[s-1][1]),r.popNamespace();break;case 35:r.addClassesToNamespace(a[s-4],a[s-1][0],a[s-1][1]),r.popNamespace();break;case 36:this.$=r.addNamespace(a[s]);break;case 37:this.$=r.addNamespace(a[s-1],a[s]);break;case 38:this.$=[[a[s]],[]];break;case 39:this.$=[[a[s-1]],[]];break;case 40:a[s][0].unshift(a[s-2]),this.$=a[s];break;case 41:this.$=[[],[a[s]]];break;case 42:this.$=[[],[a[s-1]]];break;case 43:a[s][1].unshift(a[s-2]),this.$=a[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=a[s];break;case 48:r.setCssClass(a[s-2],a[s]);break;case 49:r.addMembers(a[s-3],a[s-1]);break;case 51:r.setCssClass(a[s-5],a[s-3]),r.addMembers(a[s-5],a[s-1]);break;case 52:r.addAnnotation(a[s-3],a[s-1]);break;case 53:r.addAnnotation(a[s-6],a[s-4]),r.addMembers(a[s-6],a[s-1]);break;case 54:r.addAnnotation(a[s-5],a[s-3]);break;case 55:this.$=a[s],r.addClass(a[s]);break;case 56:this.$=a[s-1],r.addClass(a[s-1]),r.setClassLabel(a[s-1],a[s]);break;case 60:r.addAnnotation(a[s],a[s-2]);break;case 61:case 74:this.$=[a[s]];break;case 62:a[s].push(a[s-1]),this.$=a[s];break;case 63:break;case 64:r.addMember(a[s-1],r.cleanupLabel(a[s]));break;case 65:break;case 66:break;case 67:this.$={id1:a[s-2],id2:a[s],relation:a[s-1],relationTitle1:`none`,relationTitle2:`none`};break;case 68:this.$={id1:a[s-3],id2:a[s],relation:a[s-1],relationTitle1:a[s-2],relationTitle2:`none`};break;case 69:this.$={id1:a[s-3],id2:a[s],relation:a[s-2],relationTitle1:`none`,relationTitle2:a[s-1]};break;case 70:this.$={id1:a[s-4],id2:a[s],relation:a[s-2],relationTitle1:a[s-3],relationTitle2:a[s-1]};break;case 71:this.$=r.addNote(a[s],a[s-1]);break;case 72:this.$=r.addNote(a[s]);break;case 73:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 75:this.$=a[s-2].concat([a[s]]);break;case 76:r.setDirection(`TB`);break;case 77:r.setDirection(`BT`);break;case 78:r.setDirection(`RL`);break;case 79:r.setDirection(`LR`);break;case 80:this.$={type1:a[s-2],type2:a[s],lineType:a[s-1]};break;case 81:this.$={type1:`none`,type2:a[s],lineType:a[s-1]};break;case 82:this.$={type1:a[s-1],type2:`none`,lineType:a[s]};break;case 83:this.$={type1:`none`,type2:`none`,lineType:a[s]};break;case 84:this.$=r.relationType.AGGREGATION;break;case 85:this.$=r.relationType.EXTENSION;break;case 86:this.$=r.relationType.COMPOSITION;break;case 87:this.$=r.relationType.DEPENDENCY;break;case 88:this.$=r.relationType.LOLLIPOP;break;case 89:this.$=r.lineType.LINE;break;case 90:this.$=r.lineType.DOTTED_LINE;break;case 91:case 97:this.$=a[s-2],r.setClickEvent(a[s-1],a[s]);break;case 92:case 98:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 93:this.$=a[s-2],r.setLink(a[s-1],a[s]);break;case 94:this.$=a[s-3],r.setLink(a[s-2],a[s-1],a[s]);break;case 95:this.$=a[s-3],r.setLink(a[s-2],a[s-1]),r.setTooltip(a[s-2],a[s]);break;case 96:this.$=a[s-4],r.setLink(a[s-3],a[s-2],a[s]),r.setTooltip(a[s-3],a[s-1]);break;case 99:this.$=a[s-3],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 100:this.$=a[s-4],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 101:this.$=a[s-3],r.setLink(a[s-2],a[s]);break;case 102:this.$=a[s-4],r.setLink(a[s-3],a[s-1],a[s]);break;case 103:this.$=a[s-4],r.setLink(a[s-3],a[s-1]),r.setTooltip(a[s-3],a[s]);break;case 104:this.$=a[s-5],r.setLink(a[s-4],a[s-2],a[s]),r.setTooltip(a[s-4],a[s-1]);break;case 105:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 106:r.setCssClass(a[s-1],a[s]);break;case 107:this.$=[a[s]];break;case 108:a[s-2].push(a[s]),this.$=a[s-2];break;case 110:this.$=a[s-1]+a[s]}},`anonymous`),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:n,35:r,37:i,38:22,42:a,43:23,46:o,48:s,51:c,52:l,54:u,56:d,57:f,60:p,62:m,63:h,64:g,65:_,75:v,76:y,78:b,82:x,83:S,86:C,100:w,102:T,103:E},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},e(D,[2,5],{8:[1,48]}),{8:[1,49]},e(O,[2,19],{22:[1,50]}),e(O,[2,21]),e(O,[2,22]),e(O,[2,23]),e(O,[2,24]),e(O,[2,25]),e(O,[2,26]),e(O,[2,27]),e(O,[2,28]),e(O,[2,29]),e(O,[2,30]),{34:[1,51]},{36:[1,52]},e(O,[2,33]),e(O,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:k,69:A,70:j,71:M,72:N,73:P,74:F}),{39:[1,65]},e(I,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),e(O,[2,65]),e(O,[2,66]),{16:69,60:p,86:C,100:w,102:T},{16:39,17:40,19:70,60:p,86:C,100:w,102:T,103:E},{16:39,17:40,19:71,60:p,86:C,100:w,102:T,103:E},{16:39,17:40,19:72,60:p,86:C,100:w,102:T,103:E},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:p,86:C,100:w,102:T,103:E},{13:ee,55:76},{58:78,60:[1,79]},e(O,[2,76]),e(O,[2,77]),e(O,[2,78]),e(O,[2,79]),e(L,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:p,86:C,100:w,102:T,103:E}),e(L,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:p,86:C,100:w,102:T,103:E},{16:39,17:40,19:87,60:p,86:C,100:w,102:T,103:E},e(R,[2,133]),e(R,[2,134]),e(R,[2,135]),e(R,[2,136]),e([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),e(D,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:n,35:r,37:i,42:a,46:o,48:s,51:c,52:l,54:u,56:d,57:f,60:p,62:m,63:h,64:g,65:_,75:v,76:y,78:b,82:x,83:S,86:C,100:w,102:T,103:E}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:n,35:r,37:i,38:22,42:a,43:23,46:o,48:s,51:c,52:l,54:u,56:d,57:f,60:p,62:m,63:h,64:g,65:_,75:v,76:y,78:b,82:x,83:S,86:C,100:w,102:T,103:E},e(O,[2,20]),e(O,[2,31]),e(O,[2,32]),{13:[1,91],16:39,17:40,19:90,60:p,86:C,100:w,102:T,103:E},{53:92,66:56,67:57,68:k,69:A,70:j,71:M,72:N,73:P,74:F},e(O,[2,64]),{67:93,73:P,74:F},e(z,[2,83],{66:94,68:k,69:A,70:j,71:M,72:N}),e(B,[2,84]),e(B,[2,85]),e(B,[2,86]),e(B,[2,87]),e(B,[2,88]),e(te,[2,89]),e(te,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:a,43:23,48:s,54:u,56:d},{16:100,60:p,86:C,100:w,102:T},{41:[1,102],45:101,51:V},{16:104,60:p,86:C,100:w,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:H,50:U,59:110,60:W,82:G,84:111,85:112,86:K,87:q,88:J,89:Y,90:X},{60:[1,122]},{13:ee,55:123},e(I,[2,72]),e(I,[2,138]),{22:H,50:U,59:124,60:W,61:[1,125],82:G,84:111,85:112,86:K,87:q,88:J,89:Y,90:X},e(ne,[2,74]),{16:39,17:40,19:126,60:p,86:C,100:w,102:T,103:E},e(L,[2,16]),e(L,[2,17]),e(L,[2,18]),{11:127,12:re,39:[2,36]},e(Z,[2,9],{16:85,17:86,15:130,18:[1,129],60:p,86:C,100:w,102:T,103:E}),e(Z,[2,10]),e(ie,[2,55],{11:131,12:re}),e(D,[2,7]),{9:[1,132]},e(Q,[2,67]),{16:39,17:40,19:133,60:p,86:C,100:w,102:T,103:E},{13:[1,135],16:39,17:40,19:134,60:p,86:C,100:w,102:T,103:E},e(z,[2,82],{66:136,68:k,69:A,70:j,71:M,72:N}),e(z,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:a,43:23,48:s,54:u,56:d},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},e(I,[2,48],{39:[1,142]}),{41:[1,143]},e(I,[2,50]),{41:[2,61],45:144,51:V},{47:[1,145]},{16:39,17:40,19:146,60:p,86:C,100:w,102:T,103:E},e(O,[2,91],{13:[1,147]}),e(O,[2,93],{13:[1,149],77:[1,148]}),e(O,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},e(O,[2,105],{61:ae}),e(oe,[2,107],{85:154,22:H,50:U,60:W,82:G,86:K,87:q,88:J,89:Y,90:X}),e($,[2,109]),e($,[2,111]),e($,[2,112]),e($,[2,113]),e($,[2,114]),e($,[2,115]),e($,[2,116]),e($,[2,117]),e($,[2,118]),e($,[2,119]),e(O,[2,106]),e(I,[2,71]),e(O,[2,73],{61:ae}),{60:[1,155]},e(L,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:p,86:C,100:w,102:T,103:E},e(Z,[2,12]),e(ie,[2,56]),{1:[2,4]},e(Q,[2,69]),e(Q,[2,68]),{16:39,17:40,19:158,60:p,86:C,100:w,102:T,103:E},e(z,[2,80]),e(I,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:a,43:23,48:s,54:u,56:d},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:a,43:23,48:s,54:u,56:d},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:a,43:23,48:s,54:u,56:d},{45:163,51:V},e(I,[2,49]),{41:[2,62]},e(I,[2,52],{39:[1,164]}),e(O,[2,60]),e(O,[2,92]),e(O,[2,94]),e(O,[2,95],{77:[1,165]}),e(O,[2,98]),e(O,[2,99],{13:[1,166]}),e(O,[2,101],{13:[1,168],77:[1,167]}),{22:H,50:U,60:W,82:G,84:169,85:112,86:K,87:q,88:J,89:Y,90:X},e($,[2,110]),e(ne,[2,75]),{14:[1,170]},e(Z,[2,11]),e(Q,[2,70]),e(I,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:V},e(O,[2,96]),e(O,[2,100]),e(O,[2,102]),e(O,[2,103],{77:[1,174]}),e(oe,[2,108],{85:154,22:H,50:U,60:W,82:G,86:K,87:q,88:J,89:Y,90:X}),e(ie,[2,8]),e(I,[2,51]),{41:[1,175]},e(I,[2,54]),e(O,[2,104]),e(I,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};se.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:t(function(e,t,n,r){switch(n){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin(`acc_title`),33;case 7:return this.popState(),`acc_title_value`;case 8:return this.begin(`acc_descr`),35;case 9:return this.popState(),`acc_descr_value`;case 10:this.begin(`acc_descr_multiline`);break;case 11:this.popState();break;case 12:return`acc_descr_multiline_value`;case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return`EDGE_STATE`;case 18:this.begin(`callback_name`);break;case 19:this.popState();break;case 20:this.popState(),this.begin(`callback_args`);break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return`STR`;case 26:this.begin(`string`);break;case 27:return 82;case 28:return 57;case 29:return this.begin(`namespace`),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin(`namespace-body`),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return`EOF_IN_STRUCT`;case 36:return 8;case 37:break;case 38:return`EDGE_STATE`;case 39:return this.begin(`class`),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin(`class-body`),39;case 44:return this.popState(),41;case 45:return`EOF_IN_STRUCT`;case 46:return`EDGE_STATE`;case 47:return`OPEN_IN_STRUCT`;case 48:break;case 49:return`MEMBER`;case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return`GENERICTYPE`;case 61:this.begin(`generic`);break;case 62:this.popState();break;case 63:return`BQUOTE_STR`;case 64:this.begin(`bqstring`);break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return`PLUS`;case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return`EQUALS`;case 89:return`EQUALS`;case 90:return 60;case 91:return 12;case 92:return 14;case 93:return`PUNCTUATION`;case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},`anonymous`),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\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\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\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\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-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\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-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\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\u2183\u2184]|[\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\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\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])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}}})();function ce(){this.yy={}}return t(ce,`Parser`),ce.prototype=se,se.Parser=ce,new ce})();D.parser=D;var O=D,k=[`#`,`+`,`~`,`-`,``],A=class{static{t(this,`ClassMember`)}constructor(e,t){this.memberType=t,this.visibility=``,this.classifier=``,this.text=``;let n=m(e,f());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+a(this.id);this.memberType===`method`&&(e+=`(${a(this.parameters.trim())})`,this.returnType&&(e+=` : `+a(this.returnType))),e=e.trim();let t=this.parseClassifier();return{displayText:e,cssStyle:t}}parseMember(e){let t=``;if(this.memberType===`method`){let n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(n){let e=n[1]?n[1].trim():``;if(k.includes(e)&&(this.visibility=e),this.id=n[2],this.parameters=n[3]?n[3].trim():``,t=n[4]?n[4].trim():``,this.returnType=n[5]?n[5].trim():``,t===``){let e=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(e)&&(t=e,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{let n=e.length,r=e.substring(0,1),i=e.substring(n-1);k.includes(r)&&(this.visibility=r),/[$*]/.exec(i)&&(t=i),this.id=e.substring(this.visibility===``?0:1,t===``?n:n-1)}this.classifier=t,this.id=this.id.startsWith(` `)?` `+this.id.trim():this.id.trim();let n=`${this.visibility?`\\`+this.visibility:``}${a(this.id)}${this.memberType===`method`?`(${a(this.parameters)})${this.returnType?` : `+a(this.returnType):``}`:``}`;this.text=n.replaceAll(`<`,`<`).replaceAll(`>`,`>`),this.text.startsWith(`\\<`)&&(this.text=this.text.replace(`\\<`,`~`))}parseClassifier(){switch(this.classifier){case`*`:return`font-style:italic;`;case`$`:return`text-decoration:underline;`;default:return``}}},j=`classId-`,M=0,N=t(e=>l.sanitizeText(e,f()),`sanitizeText`),P=class a{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId=``,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=t(t=>{let n=w();r(t).select(`svg`).selectAll(`g`).filter(function(){return r(this).attr(`title`)!==null}).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(!a)return;let o=t.currentTarget.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.html(e.sanitize(a)).style(`left`,`${window.scrollX+o.left+o.width/2}px`).style(`top`,`${window.scrollY+o.bottom+4}px`),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})},`setupToolTips`),this.direction=`TB`,this.setAccTitle=o,this.getAccTitle=p,this.setAccDescription=i,this.getAccDescription=u,this.setDiagramTitle=c,this.getDiagramTitle=d,this.getConfig=t(()=>f().class,`getConfig`),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{t(this,`ClassDB`)}splitClassNameAndType(e){let t=l.sanitizeText(e,f()),n=``,r=t;if(t.indexOf(`~`)>0){let e=t.split(`~`);r=N(e[0]),n=N(e[1])}return{className:r,type:n}}setClassLabel(e,t){let n=l.sanitizeText(e,f());t&&=N(t);let{className:r}=this.splitClassNameAndType(n);this.classes.get(r).label=t,this.classes.get(r).text=`${t}${this.classes.get(r).type?`<${this.classes.get(r).type}>`:``}`}addClass(e){let t=l.sanitizeText(e,f()),{className:n,type:r}=this.splitClassNameAndType(t);if(this.classes.has(n))return;let i=l.sanitizeText(n,f());this.classes.set(i,{id:i,type:r,label:i,text:`${i}${r?`<${r}>`:``}`,shape:`classBox`,cssClasses:`default`,methods:[],members:[],annotations:[],styles:[],domId:j+i+`-`+M}),M++}addInterface(e,t){let n={id:`interface${this.interfaces.length}`,label:e,classId:t};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){let t=l.sanitizeText(e,f());if(this.classes.has(t)){let e=this.classes.get(t).domId;return this.diagramId?`${this.diagramId}-${e}`:e}throw Error(`Class not found: `+t)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId=``,this.direction=`TB`,s()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){let t=typeof e==`number`?`note${e}`:e;return this.notes.get(t)}getNotes(){return this.notes}addRelation(e){n.debug(`Adding relation: `+JSON.stringify(e));let t=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!t.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!t.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=l.sanitizeText(e.relationTitle1.trim(),f()),e.relationTitle2=l.sanitizeText(e.relationTitle2.trim(),f()),this.relations.push(e)}addAnnotation(e,t){let n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(t)}addMember(e,t){this.addClass(e);let n=this.splitClassNameAndType(e).className,r=this.classes.get(n);if(typeof t==`string`){let e=t.trim();e.startsWith(`<<`)&&e.endsWith(`>>`)?r.annotations.push(N(e.substring(2,e.length-2))):e.indexOf(`)`)>0?r.methods.push(new A(e,`method`)):e&&r.members.push(new A(e,`attribute`))}}addMembers(e,t){Array.isArray(t)&&(t.reverse(),t.forEach(t=>this.addMember(e,t)))}addNote(e,t){let n=this.notes.size,r={id:`note${n}`,class:t,text:e,index:n};return this.notes.set(r.id,r),r.id}cleanupLabel(e){return e.startsWith(`:`)&&(e=e.substring(1)),N(e.trim())}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=e;/\d/.exec(e[0])&&(n=j+n),n=this.splitClassNameAndType(n).className;let r=this.classes.get(n);r&&(r.cssClasses+=` `+t)})}defineClass(e,t){for(let n of e){let e=this.styleClasses.get(n);e===void 0&&(e={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,e)),t&&t.forEach(t=>{if(/color/.exec(t)){let n=t.replace(`fill`,`bgFill`);e.textStyles.push(n)}e.styles.push(t)}),this.classes.forEach(e=>{e.cssClasses.includes(n)&&e.styles.push(...t.flatMap(e=>e.split(`,`)))})}}setTooltip(e,t){e.split(`,`).forEach(e=>{if(t!==void 0){let n=this.splitClassNameAndType(e).className,r=this.classes.get(n);r&&(r.tooltip=N(t))}})}getTooltip(e,t){return t&&this.namespaces.has(t)?this.namespaces.get(t).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,t,n){let r=f();e.split(`,`).forEach(e=>{let i=e;/\d/.exec(e[0])&&(i=j+i),i=this.splitClassNameAndType(i).className;let a=this.classes.get(i);a&&(a.link=g.formatUrl(t,r),a.linkTarget=r.securityLevel===`sandbox`?`_top`:typeof n==`string`?N(n):`_blank`)}),this.setCssClass(e,`clickable`)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFunc(e,t,n);let r=this.splitClassNameAndType(e).className,i=this.classes.get(r);i&&(i.haveCallback=!0)}),this.setCssClass(e,`clickable`)}setClickFunc(e,t,n){let r=l.sanitizeText(e,f());if(f().securityLevel!==`loose`||t===void 0)return;let i=this.splitClassNameAndType(r).className;if(this.classes.has(i)){let e=[];if(typeof n==`string`){e=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t{let n=this.lookUpDomId(i),r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener(`click`,()=>{g.runFunc(t,...e)},!1)})}}bindFunctions(e){this.functions.forEach(t=>{t(e)})}escapeHtml(e){return e.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,t){let n=t.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){let t=e.split(`.`),n=Array(t.length);n[0]=t[0];for(let e=1;e0?i[e-1]:void 0,o=e===i.length-1,s=o&&t?t:r[e];this.namespaces.has(n)?o&&(this.namespaces.get(n).explicit=!0):this.namespaces.set(n,this.createNamespaceNode(n,s,a,o)),a&&this.linkParentChild(a,n)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,t,n){if(this.namespaces.has(e)){for(let n of t){let{className:t}=this.splitClassNameAndType(n),r=this.getClass(t);r.parent=e,this.namespaces.get(e).classes.set(t,r)}for(let t of n){let n=this.getNote(t);n.parent=e,this.namespaces.get(e).notes.set(t,n)}}}setCssStyle(e,t){let n=this.classes.get(e);if(!(!t||!n))for(let e of t)e.includes(`,`)?n.styles.push(...e.split(`,`)):n.styles.push(e)}getArrowMarker(e){let t;switch(e){case 0:t=`aggregation`;break;case 1:t=`extension`;break;case 2:t=`composition`;break;case 3:t=`dependency`;break;case 4:t=`lollipop`;break;default:t=`none`}return t}resolveExplicitAncestor(e){let t=e;for(;t;){let e=this.namespaces.get(t);if(!e)return;if(e.explicit)return t;t=e.parent}}getData(){let e=[],t=[],n=f(),r=n.class?.hierarchicalNamespaces??!0;for(let t of this.namespaces.values()){if(!r&&!t.explicit)continue;let i={id:t.id,label:r?t.label:t.id,isGroup:!0,padding:n.class.padding??16,shape:`rect`,cssStyles:[],look:n.look,parentId:r?t.parent:void 0};e.push(i)}let i=0;for(let t of this.classes.values()){let a=r?t.parent:this.resolveExplicitAncestor(t.parent),o={...t,type:void 0,isGroup:!1,parentId:a,look:n.look,colorIndex:i++};e.push(o)}for(let i of this.notes.values()){let a=r?i.parent:this.resolveExplicitAncestor(i.parent),o={id:i.id,label:i.text,isGroup:!1,shape:`note`,padding:n.class.padding??6,cssStyles:[`text-align: left`,`white-space: nowrap`,`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:a,labelType:`markdown`};e.push(o);let s=this.classes.get(i.class)?.id;if(s){let e={id:`edgeNote${i.index}`,start:i.id,end:s,type:`normal`,thickness:`normal`,classes:`relation`,arrowTypeStart:`none`,arrowTypeEnd:`none`,arrowheadStyle:``,labelStyle:[``],style:[`fill: none`],pattern:`dotted`,look:n.look};t.push(e)}}for(let t of this.interfaces){let r={id:t.id,label:t.label,isGroup:!1,shape:`rect`,cssStyles:[`opacity: 0;`],look:n.look};e.push(r)}let a=0;for(let e of this.relations){a++;let r={id:h(e.id1,e.id2,{prefix:`id`,counter:a}),start:e.id1,end:e.id2,type:`normal`,label:e.title,labelpos:`c`,thickness:`normal`,classes:`relation`,arrowTypeStart:this.getArrowMarker(e.relation.type1),arrowTypeEnd:this.getArrowMarker(e.relation.type2),startLabelRight:e.relationTitle1===`none`?``:e.relationTitle1,endLabelLeft:e.relationTitle2===`none`?``:e.relationTitle2,arrowheadStyle:``,labelStyle:[`display: inline-block`],style:e.style||``,pattern:e.relation.lineType==1?`dashed`:`solid`,look:n.look,labelType:`markdown`};t.push(r)}return{nodes:e,edges:t,other:{},config:n,direction:this.getDirection()}}},F=t(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!_(t,r))return``;let i=y(e.look),a=b(n),o=``;for(let t=0;t0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:t(function(e,t,n,r){switch(n){case 0:return 62;case 1:return 63;case 2:return 64;case 3:return 65;case 4:break;case 5:break;case 6:return this.begin(`acc_title`),33;case 7:return this.popState(),`acc_title_value`;case 8:return this.begin(`acc_descr`),35;case 9:return this.popState(),`acc_descr_value`;case 10:this.begin(`acc_descr_multiline`);break;case 11:this.popState();break;case 12:return`acc_descr_multiline_value`;case 13:return 8;case 14:break;case 15:return 7;case 16:return 7;case 17:return`EDGE_STATE`;case 18:this.begin(`callback_name`);break;case 19:this.popState();break;case 20:this.popState(),this.begin(`callback_args`);break;case 21:return 79;case 22:this.popState();break;case 23:return 80;case 24:this.popState();break;case 25:return`STR`;case 26:this.begin(`string`);break;case 27:return 82;case 28:return 57;case 29:return this.begin(`namespace`),42;case 30:return this.popState(),8;case 31:break;case 32:return this.begin(`namespace-body`),39;case 33:this.popState(),this.less(0);break;case 34:return this.popState(),41;case 35:return`EOF_IN_STRUCT`;case 36:return 8;case 37:break;case 38:return`EDGE_STATE`;case 39:return this.begin(`class`),48;case 40:return this.popState(),8;case 41:break;case 42:return this.popState(),this.popState(),41;case 43:return this.begin(`class-body`),39;case 44:return this.popState(),41;case 45:return`EOF_IN_STRUCT`;case 46:return`EDGE_STATE`;case 47:return`OPEN_IN_STRUCT`;case 48:break;case 49:return`MEMBER`;case 50:return 83;case 51:return 75;case 52:return 76;case 53:return 78;case 54:return 54;case 55:return 56;case 56:return 46;case 57:return 47;case 58:return 81;case 59:this.popState();break;case 60:return`GENERICTYPE`;case 61:this.begin(`generic`);break;case 62:this.popState();break;case 63:return`BQUOTE_STR`;case 64:this.begin(`bqstring`);break;case 65:return 77;case 66:return 77;case 67:return 77;case 68:return 77;case 69:return 69;case 70:return 69;case 71:return 71;case 72:return 71;case 73:return 70;case 74:return 68;case 75:return 72;case 76:return 73;case 77:return 74;case 78:return 22;case 79:return 44;case 80:return 100;case 81:return 18;case 82:return`PLUS`;case 83:return 87;case 84:return 61;case 85:return 89;case 86:return 89;case 87:return 90;case 88:return`EQUALS`;case 89:return`EQUALS`;case 90:return 60;case 91:return 12;case 92:return 14;case 93:return`PUNCTUATION`;case 94:return 86;case 95:return 102;case 96:return 50;case 97:return 50;case 98:return 9}},`anonymous`),rules:[/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:\[\*\])/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:["])/,/^(?:[^"]*)/,/^(?:["])/,/^(?:style\b)/,/^(?:classDef\b)/,/^(?:namespace\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[{])/,/^(?:[}])/,/^(?:[}])/,/^(?:$)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:\[\*\])/,/^(?:class\b)/,/^(?:\s*(\r?\n)+)/,/^(?:\s+)/,/^(?:[}])/,/^(?:[{])/,/^(?:[}])/,/^(?:$)/,/^(?:\[\*\])/,/^(?:[{])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:note for\b)/,/^(?:note\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:href\b)/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:~)/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:[`])/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:\s*\(\))/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?::)/,/^(?:,)/,/^(?:#)/,/^(?:#)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:\[)/,/^(?:\])/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\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\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\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\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-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\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-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\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\u2183\u2184]|[\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\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\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])/,/^(?:\s)/,/^(?:\s)/,/^(?:$)/],conditions:{"namespace-body":{rules:[26,29,34,35,36,37,38,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},namespace:{rules:[26,29,30,31,32,33,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},"class-body":{rules:[26,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},class:{rules:[26,40,41,42,43,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr_multiline:{rules:[11,12,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_descr:{rules:[9,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},acc_title:{rules:[7,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_args:{rules:[22,23,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},callback_name:{rules:[19,20,21,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},href:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},struct:{rules:[26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},generic:{rules:[26,50,51,52,53,54,55,56,57,58,59,60,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},bqstring:{rules:[26,50,51,52,53,54,55,56,57,58,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},string:{rules:[24,25,26,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,87,88,89,90,91,92,93,94,95,96,98],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,8,10,13,14,15,16,17,18,26,27,28,29,39,50,51,52,53,54,55,56,57,58,61,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],inclusive:!0}}}})();function ce(){this.yy={}}return t(ce,`Parser`),ce.prototype=se,se.Parser=ce,new ce})();D.parser=D;var O=D,k=[`#`,`+`,`~`,`-`,``],A=class{static{t(this,`ClassMember`)}constructor(e,t){this.memberType=t,this.visibility=``,this.classifier=``,this.text=``;let n=m(e,f());this.parseMember(n)}getDisplayDetails(){let e=this.visibility+a(this.id);this.memberType===`method`&&(e+=`(${a(this.parameters.trim())})`,this.returnType&&(e+=` : `+a(this.returnType))),e=e.trim();let t=this.parseClassifier();return{displayText:e,cssStyle:t}}parseMember(e){let t=``;if(this.memberType===`method`){let n=/([#+~-])?(.+)\((.*)\)([\s$*])?(.*)([$*])?/.exec(e);if(n){let e=n[1]?n[1].trim():``;if(k.includes(e)&&(this.visibility=e),this.id=n[2],this.parameters=n[3]?n[3].trim():``,t=n[4]?n[4].trim():``,this.returnType=n[5]?n[5].trim():``,t===``){let e=this.returnType.substring(this.returnType.length-1);/[$*]/.exec(e)&&(t=e,this.returnType=this.returnType.substring(0,this.returnType.length-1))}}}else{let n=e.length,r=e.substring(0,1),i=e.substring(n-1);k.includes(r)&&(this.visibility=r),/[$*]/.exec(i)&&(t=i),this.id=e.substring(this.visibility===``?0:1,t===``?n:n-1)}this.classifier=t,this.id=this.id.startsWith(` `)?` `+this.id.trim():this.id.trim();let n=`${this.visibility?`\\`+this.visibility:``}${a(this.id)}${this.memberType===`method`?`(${a(this.parameters)})${this.returnType?` : `+a(this.returnType):``}`:``}`;this.text=n.replaceAll(`<`,`<`).replaceAll(`>`,`>`),this.text.startsWith(`\\<`)&&(this.text=this.text.replace(`\\<`,`~`))}parseClassifier(){switch(this.classifier){case`*`:return`font-style:italic;`;case`$`:return`text-decoration:underline;`;default:return``}}},j=`classId-`,M=0,N=t(e=>l.sanitizeText(e,f()),`sanitizeText`),P=class a{constructor(){this.relations=[],this.classes=new Map,this.styleClasses=new Map,this.notes=new Map,this.interfaces=[],this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId=``,this.functions=[],this.lineType={LINE:0,DOTTED_LINE:1},this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3,LOLLIPOP:4},this.setupToolTips=t(t=>{let n=S();r(t).select(`svg`).selectAll(`g`).filter(function(){return r(this).attr(`title`)!==null}).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(!a)return;let o=t.currentTarget.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.html(e.sanitize(a)).style(`left`,`${window.scrollX+o.left+o.width/2}px`).style(`top`,`${window.scrollY+o.bottom+4}px`),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})},`setupToolTips`),this.direction=`TB`,this.setAccTitle=o,this.getAccTitle=p,this.setAccDescription=i,this.getAccDescription=u,this.setDiagramTitle=c,this.getDiagramTitle=d,this.getConfig=t(()=>f().class,`getConfig`),this.functions.push(this.setupToolTips.bind(this)),this.clear(),this.addRelation=this.addRelation.bind(this),this.addClassesToNamespace=this.addClassesToNamespace.bind(this),this.addNamespace=this.addNamespace.bind(this),this.popNamespace=this.popNamespace.bind(this),this.setCssClass=this.setCssClass.bind(this),this.addMembers=this.addMembers.bind(this),this.addClass=this.addClass.bind(this),this.setClassLabel=this.setClassLabel.bind(this),this.addAnnotation=this.addAnnotation.bind(this),this.addMember=this.addMember.bind(this),this.cleanupLabel=this.cleanupLabel.bind(this),this.addNote=this.addNote.bind(this),this.defineClass=this.defineClass.bind(this),this.setDirection=this.setDirection.bind(this),this.setLink=this.setLink.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.clear=this.clear.bind(this),this.setTooltip=this.setTooltip.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setCssStyle=this.setCssStyle.bind(this)}static{t(this,`ClassDB`)}splitClassNameAndType(e){let t=l.sanitizeText(e,f()),n=``,r=t;if(t.indexOf(`~`)>0){let e=t.split(`~`);r=N(e[0]),n=N(e[1])}return{className:r,type:n}}setClassLabel(e,t){let n=l.sanitizeText(e,f());t&&=N(t);let{className:r}=this.splitClassNameAndType(n);this.classes.get(r).label=t,this.classes.get(r).text=`${t}${this.classes.get(r).type?`<${this.classes.get(r).type}>`:``}`}addClass(e){let t=l.sanitizeText(e,f()),{className:n,type:r}=this.splitClassNameAndType(t);if(this.classes.has(n))return;let i=l.sanitizeText(n,f());this.classes.set(i,{id:i,type:r,label:i,text:`${i}${r?`<${r}>`:``}`,shape:`classBox`,cssClasses:`default`,methods:[],members:[],annotations:[],styles:[],domId:j+i+`-`+M}),M++}addInterface(e,t){let n={id:`interface${this.interfaces.length}`,label:e,classId:t};this.interfaces.push(n)}setDiagramId(e){this.diagramId=e}lookUpDomId(e){let t=l.sanitizeText(e,f());if(this.classes.has(t)){let e=this.classes.get(t).domId;return this.diagramId?`${this.diagramId}-${e}`:e}throw Error(`Class not found: `+t)}clear(){this.relations=[],this.classes=new Map,this.notes=new Map,this.interfaces=[],this.functions=[],this.functions.push(this.setupToolTips.bind(this)),this.namespaces=new Map,this.namespaceCounter=0,this.namespaceStack=[],this.diagramId=``,this.direction=`TB`,s()}getClass(e){return this.classes.get(e)}getClasses(){return this.classes}getRelations(){return this.relations}getNote(e){let t=typeof e==`number`?`note${e}`:e;return this.notes.get(t)}getNotes(){return this.notes}addRelation(e){n.debug(`Adding relation: `+JSON.stringify(e));let t=[this.relationType.LOLLIPOP,this.relationType.AGGREGATION,this.relationType.COMPOSITION,this.relationType.DEPENDENCY,this.relationType.EXTENSION];e.relation.type1===this.relationType.LOLLIPOP&&!t.includes(e.relation.type2)?(this.addClass(e.id2),this.addInterface(e.id1,e.id2),e.id1=`interface${this.interfaces.length-1}`):e.relation.type2===this.relationType.LOLLIPOP&&!t.includes(e.relation.type1)?(this.addClass(e.id1),this.addInterface(e.id2,e.id1),e.id2=`interface${this.interfaces.length-1}`):(this.addClass(e.id1),this.addClass(e.id2)),e.id1=this.splitClassNameAndType(e.id1).className,e.id2=this.splitClassNameAndType(e.id2).className,e.relationTitle1=l.sanitizeText(e.relationTitle1.trim(),f()),e.relationTitle2=l.sanitizeText(e.relationTitle2.trim(),f()),this.relations.push(e)}addAnnotation(e,t){let n=this.splitClassNameAndType(e).className;this.classes.get(n).annotations.push(t)}addMember(e,t){this.addClass(e);let n=this.splitClassNameAndType(e).className,r=this.classes.get(n);if(typeof t==`string`){let e=t.trim();e.startsWith(`<<`)&&e.endsWith(`>>`)?r.annotations.push(N(e.substring(2,e.length-2))):e.indexOf(`)`)>0?r.methods.push(new A(e,`method`)):e&&r.members.push(new A(e,`attribute`))}}addMembers(e,t){Array.isArray(t)&&(t.reverse(),t.forEach(t=>this.addMember(e,t)))}addNote(e,t){let n=this.notes.size,r={id:`note${n}`,class:t,text:e,index:n};return this.notes.set(r.id,r),r.id}cleanupLabel(e){return e.startsWith(`:`)&&(e=e.substring(1)),N(e.trim())}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=e;/\d/.exec(e[0])&&(n=j+n),n=this.splitClassNameAndType(n).className;let r=this.classes.get(n);r&&(r.cssClasses+=` `+t)})}defineClass(e,t){for(let n of e){let e=this.styleClasses.get(n);e===void 0&&(e={id:n,styles:[],textStyles:[]},this.styleClasses.set(n,e)),t&&t.forEach(t=>{if(/color/.exec(t)){let n=t.replace(`fill`,`bgFill`);e.textStyles.push(n)}e.styles.push(t)}),this.classes.forEach(e=>{e.cssClasses.includes(n)&&e.styles.push(...t.flatMap(e=>e.split(`,`)))})}}setTooltip(e,t){e.split(`,`).forEach(e=>{if(t!==void 0){let n=this.splitClassNameAndType(e).className,r=this.classes.get(n);r&&(r.tooltip=N(t))}})}getTooltip(e,t){return t&&this.namespaces.has(t)?this.namespaces.get(t).classes.get(e).tooltip:this.classes.get(e).tooltip}setLink(e,t,n){let r=f();e.split(`,`).forEach(e=>{let i=e;/\d/.exec(e[0])&&(i=j+i),i=this.splitClassNameAndType(i).className;let a=this.classes.get(i);a&&(a.link=g.formatUrl(t,r),a.linkTarget=r.securityLevel===`sandbox`?`_top`:typeof n==`string`?N(n):`_blank`)}),this.setCssClass(e,`clickable`)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFunc(e,t,n);let r=this.splitClassNameAndType(e).className,i=this.classes.get(r);i&&(i.haveCallback=!0)}),this.setCssClass(e,`clickable`)}setClickFunc(e,t,n){let r=l.sanitizeText(e,f());if(f().securityLevel!==`loose`||t===void 0)return;let i=this.splitClassNameAndType(r).className;if(this.classes.has(i)){let e=[];if(typeof n==`string`){e=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t{let n=this.lookUpDomId(i),r=document.querySelector(`[id="${n}"]`);r!==null&&r.addEventListener(`click`,()=>{g.runFunc(t,...e)},!1)})}}bindFunctions(e){this.functions.forEach(t=>{t(e)})}escapeHtml(e){return e.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}getDirection(){return this.direction}setDirection(e){this.direction=e}static resolveQualifiedId(e,t){let n=t.at(-1);return n?`${n}.${e}`:e}static getAncestorIds(e){let t=e.split(`.`),n=Array(t.length);n[0]=t[0];for(let e=1;e0?i[e-1]:void 0,o=e===i.length-1,s=o&&t?t:r[e];this.namespaces.has(n)?o&&(this.namespaces.get(n).explicit=!0):this.namespaces.set(n,this.createNamespaceNode(n,s,a,o)),a&&this.linkParentChild(a,n)}return n}popNamespace(){this.namespaceStack.pop()}getNamespace(e){return this.namespaces.get(e)}getNamespaces(){return this.namespaces}addClassesToNamespace(e,t,n){if(this.namespaces.has(e)){for(let n of t){let{className:t}=this.splitClassNameAndType(n),r=this.getClass(t);r.parent=e,this.namespaces.get(e).classes.set(t,r)}for(let t of n){let n=this.getNote(t);n.parent=e,this.namespaces.get(e).notes.set(t,n)}}}setCssStyle(e,t){let n=this.classes.get(e);if(!(!t||!n))for(let e of t)e.includes(`,`)?n.styles.push(...e.split(`,`)):n.styles.push(e)}getArrowMarker(e){let t;switch(e){case 0:t=`aggregation`;break;case 1:t=`extension`;break;case 2:t=`composition`;break;case 3:t=`dependency`;break;case 4:t=`lollipop`;break;default:t=`none`}return t}resolveExplicitAncestor(e){let t=e;for(;t;){let e=this.namespaces.get(t);if(!e)return;if(e.explicit)return t;t=e.parent}}getData(){let e=[],t=[],n=f(),r=n.class?.hierarchicalNamespaces??!0;for(let t of this.namespaces.values()){if(!r&&!t.explicit)continue;let i={id:t.id,label:r?t.label:t.id,isGroup:!0,padding:n.class.padding??16,shape:`rect`,cssStyles:[],look:n.look,parentId:r?t.parent:void 0};e.push(i)}let i=0;for(let t of this.classes.values()){let a=r?t.parent:this.resolveExplicitAncestor(t.parent),o={...t,type:void 0,isGroup:!1,parentId:a,look:n.look,colorIndex:i++};e.push(o)}for(let i of this.notes.values()){let a=r?i.parent:this.resolveExplicitAncestor(i.parent),o={id:i.id,label:i.text,isGroup:!1,shape:`note`,padding:n.class.padding??6,cssStyles:[`text-align: left`,`white-space: nowrap`,`fill: ${n.themeVariables.noteBkgColor}`,`stroke: ${n.themeVariables.noteBorderColor}`],look:n.look,parentId:a,labelType:`markdown`};e.push(o);let s=this.classes.get(i.class)?.id;if(s){let e={id:`edgeNote${i.index}`,start:i.id,end:s,type:`normal`,thickness:`normal`,classes:`relation`,arrowTypeStart:`none`,arrowTypeEnd:`none`,arrowheadStyle:``,labelStyle:[``],style:[`fill: none`],pattern:`dotted`,look:n.look};t.push(e)}}for(let t of this.interfaces){let r={id:t.id,label:t.label,isGroup:!1,shape:`rect`,cssStyles:[`opacity: 0;`],look:n.look};e.push(r)}let a=0;for(let e of this.relations){a++;let r={id:h(e.id1,e.id2,{prefix:`id`,counter:a}),start:e.id1,end:e.id2,type:`normal`,label:e.title,labelpos:`c`,thickness:`normal`,classes:`relation`,arrowTypeStart:this.getArrowMarker(e.relation.type1),arrowTypeEnd:this.getArrowMarker(e.relation.type2),startLabelRight:e.relationTitle1===`none`?``:e.relationTitle1,endLabelLeft:e.relationTitle2===`none`?``:e.relationTitle2,arrowheadStyle:``,labelStyle:[`display: inline-block`],style:e.style||``,pattern:e.relation.lineType==1?`dashed`:`solid`,look:n.look,labelType:`markdown`};t.push(r)}return{nodes:e,edges:t,other:{},config:n,direction:this.getDirection()}}},F=t(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!v(t,r))return``;let i=b(e.look),a=x(n),o=``;for(let t=0;t{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`)},styles:t(e=>`${F(e)} + `}return o},`genColor`),I={parser:O,get db(){return new P},renderer:{getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing class diagram (v3)`,t);let{securityLevel:a,state:o,layout:s}=f();i.db.setDiagramId(t);let c=i.db.getData(),l=C(t,a);c.type=i.type,c.layoutAlgorithm=E(s),c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=[`aggregation`,`extension`,`composition`,`dependency`,`lollipop`],c.diagramId=t,await T(c,l),g.insertTitle(l,`classDiagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),w(l,8,`classDiagram`,o?.useMaxWidth??!0)},`draw`),getDir:t((e,t=`TB`)=>{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`)},styles:t(e=>`${F(e)} g.classGroup text { fill: ${e.nodeBorder||e.classText}; stroke: none; @@ -213,5 +213,5 @@ g.classGroup line { } text-align: center; } - ${C()} + ${_()} `,`getStyles`),init:t(e=>{e.class||={},e.class.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{I as diagram}; \ No newline at end of file diff --git a/web/dist/app-dagre-6A5THRUB.js b/web/dist/app-dagre-6A5THRUB.js index ce1d1c98a..fa3547919 100644 --- a/web/dist/app-dagre-6A5THRUB.js +++ b/web/dist/app-dagre-6A5THRUB.js @@ -1,4 +1,4 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{x as n}from"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{c as r}from"./app-chunk-7INBJB4K.js";import{a as i,i as a,n as o}from"./app-chunk-5DYCD2WN.js";import{r as s}from"./app-chunk-UA2S7LBM.js";import{a as c,i as l,l as u}from"./app-chunk-Z7XXMR3K.js";import{$ as d,A as f,B as p,C as m,D as h,E as g,F as _,G as ee,H as v,I as te,J as ne,K as re,L as ie,M as ae,N as oe,O as se,P as y,Q as b,R as ce,S as le,T as ue,U as de,V as fe,W as pe,X as me,Y as he,Z as x,_ as S,a as C,b as ge,c as _e,d as ve,et as w,f as T,g as ye,h as be,i as E,it as xe,j as Se,k as Ce,l as we,m as Te,n as D,nt as Ee,o as O,p as De,q as Oe,r as k,rt as ke,s as Ae,t as A,tt as j,u as je,v as Me,w as Ne,x as Pe,y as Fe,z as M}from"./app-graphlib.js";import{c as Ie,i as Le,n as N,o as Re,r as ze,s as Be,t as Ve}from"./app-chunk-3FUC2YCW.js";var He=/\s/;function Ue(e){for(var t=e.length;t--&&He.test(e.charAt(t)););return t}var We=/^\s+/;function Ge(e){return e&&e.slice(0,Ue(e)+1).replace(We,``)}var Ke=NaN,qe=/^[-+]0x[0-9a-f]+$/i,Je=/^0b[01]+$/i,Ye=/^0o[0-7]+$/i,Xe=parseInt;function Ze(e){if(typeof e==`number`)return e;if(w(e))return Ke;if(x(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=x(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=Ge(e);var n=Je.test(e);return n||Ye.test(e)?Xe(e.slice(2),n?2:8):qe.test(e)?Ke:+e}var Qe=1/0,$e=17976931348623157e292;function P(e){return e?(e=Ze(e),e===Qe||e===-Qe?(e<0?-1:1)*$e:e===e?e:0):e===0?e:0}function et(e){var t=P(e),n=t%1;return t===t?n?t-n:t:0}var tt=Object.create,nt=function(){function e(){}return function(t){if(!x(t))return{};if(tt)return tt(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function rt(e,t){var n=-1,r=e.length;for(t||=Array(r);++n1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&L(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r2?t[2]:void 0;for(i&&L(t[0],t[1],i)&&(r=1);++n-1?i[a?t[o]:o]:void 0}}var or=Math.max;function sr(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:et(n);return i<0&&(i=or(r+i,0)),pe(e,T(t,3),i)}var cr=ar(sr);function lr(e,t){var n=-1,r=M(e)?Array(e.length):[];return we(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function U(e,t){return(b(e)?d:lr)(e,T(t,3))}function ur(e,t){return e==null?e:ve(e,Ae(t),R)}function dr(e,t){return e&&je(e,Ae(t))}function fr(e,t){return e>t}var pr=Object.prototype.hasOwnProperty;function mr(e,t){return e!=null&&pr.call(e,t)}function hr(e,t){return e!=null&&be(e,t,mr)}var gr=`[object String]`;function _r(e){return typeof e==`string`||!b(e)&&j(e)&&Ee(e)==gr}function vr(e,t){return et||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Dr(e,t,n){t=t.length?d(t,function(e){return b(e)?function(t){return ue(t,e.length===1?e[0]:e)}:e}):[me];var r=-1;return t=d(t,_(T)),wr(lr(e,function(e,n,i){return{criteria:d(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return Er(e,t,n)})}var Or=De(`length`),kr=`\\ud800-\\udfff`,Ar=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,jr=`\\ufe0e\\ufe0f`,Mr=`[`+kr+`]`,Nr=`[`+Ar+`]`,Pr=`\\ud83c[\\udffb-\\udfff]`,Fr=`(?:`+Nr+`|`+Pr+`)`,Ir=`[^`+kr+`]`,Lr=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Rr=`[\\ud800-\\udbff][\\udc00-\\udfff]`,zr=`\\u200d`,Br=Fr+`?`,Vr=`[`+jr+`]?`,Hr=`(?:`+zr+`(?:`+[Ir,Lr,Rr].join(`|`)+`)`+Vr+Br+`)*`,Ur=Vr+Br+Hr,Wr=`(?:`+[Ir+Nr+`?`,Nr,Lr,Rr,Mr].join(`|`)+`)`,Gr=RegExp(Pr+`(?=`+Pr+`)|`+Wr+Ur,`g`);function Kr(e){for(var t=Gr.lastIndex=0;Gr.test(e);)++t;return t}function qr(e){return bt(e)?Kr(e):Or(e)}function Jr(e,t){return Cr(e,t,function(t,n){return Te(e,n)})}var q=ut(function(e,t){return e==null?{}:Jr(e,t)}),Yr=Math.ceil,Xr=Math.max;function Zr(e,t,n,r){for(var i=-1,a=Xr(Yr((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function Qr(e){return function(t,n,r){return r&&typeof r!=`number`&&L(t,n,r)&&(n=r=void 0),t=P(t),n===void 0?(n=t,t=0):n=P(n),r=r===void 0?t1&&L(e,t[0],t[1])?t=[]:n>2&&L(t[0],t[1],t[2])&&(t=[t[0]]),Dr(e,m(t,1),[])}),ni=0;function ri(e){var t=++ni;return se(e)+t}function ii(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r0;--s)if(o=t[s].dequeue(),o){r=r.concat(fi(e,t,n,o,!0));break}}}return r}function fi(e,t,n,r,i){var a=i?[]:void 0;return O(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,mi(t,n,s)}),O(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,mi(t,n,o)}),e.removeNode(r.v),a}function pi(e,t){var n=new A,r=0,i=0;O(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),O(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=J(i+r+3).map(function(){return new oi}),o=r+1;return O(n.nodes(),function(e){mi(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function mi(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function hi(e){var t=e.graph().acyclicer===`greedy`?ui(e,n(e)):gi(e);O(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,ri(`rev`))});function n(e){return function(t){return e.edge(t).weight}}}function gi(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,O(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return O(e.nodes(),i),t}function _i(e){O(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function X(e,t,n,r){var i;do i=ri(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function vi(e){var t=new A().setGraph(e.graph());return O(e.nodes(),function(n){t.setNode(n,e.node(n))}),O(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function yi(e){var t=new A({multigraph:e.isMultigraph()}).setGraph(e.graph());return O(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),O(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function bi(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function Z(e){var t=U(J(wi(e)+1),function(){return[]});return O(e.nodes(),function(n){var r=e.node(n),i=r.rank;k(i)||(t[i][r.order]=n)}),t}function xi(e){var t=K(U(e.nodes(),function(t){return e.node(t).rank}));O(e.nodes(),function(n){var r=e.node(n);hr(r,`rank`)&&(r.rank-=t)})}function Si(e){var t=K(U(e.nodes(),function(t){return e.node(t).rank})),n=[];O(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;O(n,function(t,n){k(t)&&n%i!==0?--r:r&&O(t,function(t){e.node(t).rank+=r})})}function Ci(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),X(e,`border`,i,t)}function wi(e){return G(U(e.nodes(),function(t){var n=e.node(t).rank;if(!k(n))return n}))}function Ti(e,t){var n={lhs:[],rhs:[]};return O(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Ei(e,t){var n=Xn();try{return t()}finally{console.log(e+` time: `+(Xn()-n)+`ms`)}}function Di(e,t){return t()}function Oi(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&O(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;ao.lim&&(s=o,c=!0),xr(C(t.edges(),function(t){return c===ca(e,e.node(t.v),s)&&c!==ca(e,e.node(t.w),s)}),function(e){return Q(t,e)})}function aa(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),ta(e),Qi(e,t),oa(e,t)}function oa(e,t){var n=Zi(e,cr(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),O(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function sa(e,t,n){return e.hasEdge(t,n)}function ca(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function la(e){switch(e.graph().ranker){case`network-simplex`:fa(e);break;case`tight-tree`:da(e);break;case`longest-path`:ua(e);break;default:fa(e)}}var ua=Vi;function da(e){Vi(e),Hi(e)}function fa(e){$(e)}function pa(e){var t=X(e,`root`,{},`_root`),n=ha(e),r=G(E(n))-1,i=2*r+1;e.graph().nestingRoot=t,O(e.edges(),function(t){e.edge(t).minlen*=i});var a=ga(e)+1;O(e.children(),function(o){ma(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function ma(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var c=Ci(e,`_bt`),l=Ci(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,O(s,function(s){ma(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function ha(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&O(a,function(e){n(e,i+1)}),t[r]=i}return O(e.children(),function(e){n(e,1)}),t}function ga(e){return D(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function _a(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,O(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function va(e,t,n){var r={},i;O(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function ya(e,t,n){var r=ba(e),i=new A({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return O(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),O(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=k(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function ba(e){for(var t;e.hasNode(t=ri(`_root`)););return t}function xa(e,t){for(var n=0,r=1;r0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function Ca(e){var t={},n=C(e.nodes(),function(t){return!e.children(t).length}),r=U(J(G(U(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){hr(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),O(e.successors(n),i))}var a=Y(n,function(t){return e.node(t).rank});return O(a,i),r}function wa(e,t){return U(t,function(t){var n=e.inEdges(t);if(n.length){var r=D(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}function Ta(e,t){var n={};return O(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};k(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),O(t.edges(),function(e){var t=n[e.v],r=n[e.w];!k(t)&&!k(r)&&(r.indegree++,t.out.push(n[e.w]))}),Ea(C(n,function(e){return!e.indegree}))}function Ea(e){var t=[];function n(e){return function(t){t.merged||(k(t.barycenter)||k(e.barycenter)||t.barycenter>=e.barycenter)&&Da(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),O(i.in.reverse(),n(i)),O(i.out,r(i))}return U(C(t,function(e){return!e.merged}),function(e){return q(e,[`vs`,`i`,`barycenter`,`weight`])})}function Da(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Oa(e,t){var n=Ti(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=Y(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Aa(!!t)),c=ka(a,i,c),O(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=ka(a,i,c)});var l={vs:z(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function ka(e,t,n){for(var r;t.length&&(r=H(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Aa(e){return function(t,n){return t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}}function ja(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=C(i,function(e){return e!==o&&e!==s}));var l=wa(e,i);O(l,function(t){if(e.children(t.v).length){var i=ja(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&Na(t,i)}});var u=Ta(l,n);Ma(u,c);var d=Oa(u,r);if(o&&(d.vs=z([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function Ma(e,t){O(e,function(e){e.vs=z(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function Na(e,t){k(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Pa(e){var t=wi(e),n=Fa(e,J(1,t+1),`inEdges`),r=Fa(e,J(t-1,-1,-1),`outEdges`),i=Ca(e);La(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){Ia(s%2?n:r,s%4>=2),i=Z(e);var l=xa(e,i);lo||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Ba(e){var t={},n=0;function r(i){var a=n;O(e.children(i),r),t[i]={low:a,lim:n++}}return O(e.children(),r),t}function Va(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=H(r);return O(r,function(t,c){var l=Ua(e,t),u=l?e.node(l).order:o;(l||t===s)&&(O(r.slice(a,c+1),function(t){O(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(oo)&&Wa(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return O(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return D(t,i),n}function Ua(e,t){if(e.node(t).dummy)return cr(e.predecessors(t),function(t){return e.node(t).dummy})}function Wa(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ga(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Ka(e,t,n,r){var i={},a={},o={};return O(t,function(e){O(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),O(t,function(e){var t=-1;O(e,function(e){var s=r(e);if(s.length){s=Y(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t{var t=n(` buildLayoutGraph`,()=>ho(e));n(` runLayout`,()=>io(t,n)),n(` updateInputGraph`,()=>ao(e,t))})}function io(e,t){t(` makeSpaceForEdgeLabels`,()=>go(e)),t(` removeSelfEdges`,()=>To(e)),t(` acyclic`,()=>hi(e)),t(` nestingGraph.run`,()=>pa(e)),t(` rank`,()=>la(yi(e))),t(` injectEdgeLabelProxies`,()=>_o(e)),t(` removeEmptyRanks`,()=>Si(e)),t(` nestingGraph.cleanup`,()=>_a(e)),t(` normalizeRanks`,()=>xi(e)),t(` assignRankMinMax`,()=>vo(e)),t(` removeEdgeLabelProxies`,()=>yo(e)),t(` normalize.run`,()=>Ri(e)),t(` parentDummyChains`,()=>Ra(e)),t(` addBorderSegments`,()=>Oi(e)),t(` order`,()=>Pa(e)),t(` insertSelfEdges`,()=>Eo(e)),t(` adjustCoordinateSystem`,()=>Ai(e)),t(` position`,()=>to(e)),t(` positionSelfEdges`,()=>Do(e)),t(` removeBorderNodes`,()=>wo(e)),t(` normalize.undo`,()=>Bi(e)),t(` fixupEdgeLabelCoords`,()=>So(e)),t(` undoCoordinateSystem`,()=>ji(e)),t(` translateGraph`,()=>bo(e)),t(` assignNodeIntersects`,()=>xo(e)),t(` reversePoints`,()=>Co(e)),t(` acyclic.undo`,()=>_i(e))}function ao(e,t){O(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),O(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var oo=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],so={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},co=[`acyclicer`,`ranker`,`rankdir`,`align`],lo=[`width`,`height`],uo={width:0,height:0},fo=[`minlen`,`weight`,`width`,`height`,`labeloffset`],po={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},mo=[`labelpos`];function ho(e){var t=new A({multigraph:!0,compound:!0}),n=ko(e.graph());return t.setGraph(br({},so,Oo(n,oo),q(n,co))),O(e.nodes(),function(n){var r=ko(e.node(n));t.setNode(n,$n(Oo(r,lo),uo)),t.setParent(n,e.parent(n))}),O(e.edges(),function(n){var r=ko(e.edge(n));t.setEdge(n,br({},po,Oo(r,fo),q(r,mo)))}),t}function go(e){var t=e.graph();t.ranksep/=2,O(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function _o(e){O(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);X(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function vo(e){var t=0;O(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=G(t,r.maxRank))}),e.graph().maxRank=t}function yo(e){O(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function bo(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}O(e.nodes(),function(t){c(e.node(t))}),O(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,O(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),O(e.edges(),function(n){var i=e.edge(n);O(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function xo(e){O(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(bi(r,a)),n.points.push(bi(i,o))})}function So(e){O(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(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}})}function Co(e){O(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function wo(e){O(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(H(n.borderLeft)),o=e.node(H(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),O(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function To(e){O(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Eo(e){var t=Z(e);O(t,function(t){var n=0;O(t,function(t,r){var i=e.node(t);i.order=r+n,O(i.selfEdges,function(t){X(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Do(e){O(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Oo(e,t){return W(q(e,t),Number)}function ko(e){var t={};return O(e,function(e,n){t[n.toLowerCase()]=e}),t}var Ao=e((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),jo=e((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),Mo=e(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`||e===`er`||e===`classDiagram`,`shouldMergeSelfLoopSegments`),No=[`x`,`y`,`width`,`height`,`labelBBox`,`intersect`,`calcIntersect`,`diff`,`clusterNode`],Po=e((e,t,n,r,i)=>{let a=[],o=new Set;if(n.forEach(({start:e,end:t})=>{e!==r&&o.add(e),t!==r&&o.add(t)}),o.forEach(t=>{let n=e.node(t);typeof n?.x==`number`&&typeof n?.y==`number`&&a.push(n)}),a.length===0&&n.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{typeof e?.x==`number`&&typeof e?.y==`number`&&a.push(e)})}),a.length===0)return jo(i);let s=a.reduce((e,t)=>({x:e.x+t.x/a.length,y:e.y+t.y/a.length}),{x:0,y:0}),c=s.x-t.x,l=s.y-t.y;return Math.abs(c)>Math.abs(l)?c>0?`right`:`left`:Math.abs(l)>0?l>0?`bottom`:`top`:jo(i)},`getSelfLoopSide`),Fo=e((e,t=`top`,n=0,r=0)=>{let i=e.x,a=e.y-n,o=e.width/2,s=e.height/2,c=Math.max(36,Math.min(100,e.width*.8)),l=Ao(Math.max(r,e.width*.35),36,c),u=Ao(Math.min(e.width,e.height)*.45,24,48);switch(t){case`bottom`:{let e=a+s;return[{x:i-l/2,y:e},{x:i-l/2,y:e+u},{x:i+l/2,y:e+u},{x:i+l/2,y:e}]}case`right`:{let e=i+o;return[{x:e,y:a-l/2},{x:e+u,y:a-l/2},{x:e+u,y:a+l/2},{x:e,y:a+l/2}]}case`left`:{let e=i-o;return[{x:e,y:a-l/2},{x:e-u,y:a-l/2},{x:e-u,y:a+l/2},{x:e,y:a+l/2}]}default:{let e=a-s;return[{x:i-l/2,y:e},{x:i-l/2,y:e-u},{x:i+l/2,y:e-u},{x:i+l/2,y:e}]}}},`getSelfLoopPoints`),Io=e((e,t,n=`top`,r=0,i={})=>{let a=e.x,o=e.y-r,s=i.width??0,c=i.height??0;switch(n){case`bottom`:return{x:a,y:Math.max(...t.map(e=>e.y))+c/2+4};case`right`:return{x:Math.max(...t.map(e=>e.x))+s/2+4,y:o};case`left`:return{x:Math.min(...t.map(e=>e.x))-s/2-4,y:o};default:return{x:a,y:Math.min(...t.map(e=>e.y))-c/2-4}}},`getSelfLoopLabelPosition`),Lo=e((e,t=0,{mergeSelfLoops:n=!0}={})=>{let r=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(t=>{let a=e.edge(t);if(n&&a.selfLoop){let e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:t.v,end:t.w})}else i.push({edge:a,start:t.v,end:t.w})}),r.forEach(n=>{if(n.length!==3){n.forEach(e=>i.push(e));return}n.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);let[r,o,s]=n,c=r.edge.originalEdge??o.edge.originalEdge??s.edge.originalEdge??o.edge,l=e.node(c.start);if(!l){n.forEach(e=>i.push(e));return}let u={width:o.edge.width,height:o.edge.height},d=Po(e,l,n,c.start,a),f=Fo(l,d,t,u.width??0),p=Io(l,f,d,t,u),m={...o.edge,...c,id:c.id,points:f,start:c.start,end:c.end,x:p.x,y:p.y,width:u.width,height:u.height,labelStyle:o.edge.labelStyle,fromCluster:r.edge.fromCluster??o.edge.fromCluster??s.edge.fromCluster,toCluster:r.edge.toCluster??o.edge.toCluster??s.edge.toCluster};delete m.selfLoop,delete m.originalEdge,i.push({edge:m,start:m.start,end:m.end})}),i},`getEdgesToRender`),Ro=e(async({element:n,graph:a,diagramType:s,id:l,parentCluster:u,siteConfig:d})=>{let f=a.graph().rankdir;t.trace(`Dir in recursive render - dir:`,f);let{clusters:p,edgePaths:m,edgeLabels:h,nodes:g,rootGroups:_}=Le(n,{edgePathsClass:`edgePaths`});a.nodes()?t.info(`Recursive render XXX`,a.nodes()):t.info(`No nodes found for`,a),a.edges().length>0&&t.info(`Recursive edges`,a.edge(a.edges()[0]));let ee=Mo(s);await Promise.all(a.nodes().map(async function(e){let n=a.node(e);if(u!==void 0){let n=JSON.parse(JSON.stringify(u.clusterData));t.trace(`Setting data for parent cluster XXX +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{x as n}from"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import{c as r}from"./app-chunk-7INBJB4K.js";import{a as i,i as a,n as o}from"./app-chunk-5DYCD2WN.js";import{a as s,i as c,l}from"./app-chunk-Z7XXMR3K.js";import{$ as u,A as d,B as f,C as p,D as m,E as h,F as g,G as ee,H as _,I as te,J as ne,K as re,L as ie,M as ae,N as oe,O as se,P as v,Q as y,R as ce,S as le,T as ue,U as de,V as fe,W as pe,X as me,Y as he,Z as b,_ as x,a as S,b as ge,c as _e,d as ve,et as ye,f as C,g as be,h as xe,i as w,it as Se,j as Ce,k as we,l as Te,m as Ee,n as T,nt as De,o as E,p as Oe,q as ke,r as D,rt as Ae,s as je,t as O,tt as k,u as Me,v as Ne,w as Pe,x as Fe,y as Ie,z as A}from"./app-graphlib.js";import{r as Le}from"./app-chunk-UA2S7LBM.js";import{c as Re,i as ze,n as j,o as Be,r as Ve,s as He,t as Ue}from"./app-chunk-3FUC2YCW.js";var We=/\s/;function Ge(e){for(var t=e.length;t--&&We.test(e.charAt(t)););return t}var Ke=/^\s+/;function qe(e){return e&&e.slice(0,Ge(e)+1).replace(Ke,``)}var Je=NaN,Ye=/^[-+]0x[0-9a-f]+$/i,Xe=/^0b[01]+$/i,Ze=/^0o[0-7]+$/i,Qe=parseInt;function $e(e){if(typeof e==`number`)return e;if(ye(e))return Je;if(b(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=b(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=qe(e);var n=Xe.test(e);return n||Ze.test(e)?Qe(e.slice(2),n?2:8):Ye.test(e)?Je:+e}var et=1/0,tt=17976931348623157e292;function M(e){return e?(e=$e(e),e===et||e===-et?(e<0?-1:1)*tt:e===e?e:0):e===0?e:0}function nt(e){var t=M(e),n=t%1;return t===t?n?t-n:t:0}var rt=Object.create,it=function(){function e(){}return function(t){if(!b(t))return{};if(rt)return rt(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function at(e,t){var n=-1,r=e.length;for(t||=Array(r);++n1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&I(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r2?t[2]:void 0;for(i&&I(t[0],t[1],i)&&(r=1);++n-1?i[a?t[o]:o]:void 0}}var sr=Math.max;function cr(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:nt(n);return i<0&&(i=sr(r+i,0)),pe(e,C(t,3),i)}var lr=or(cr);function ur(e,t){var n=-1,r=A(e)?Array(e.length):[];return Te(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function H(e,t){return(y(e)?u:ur)(e,C(t,3))}function dr(e,t){return e==null?e:ve(e,je(t),L)}function fr(e,t){return e&&Me(e,je(t))}function pr(e,t){return e>t}var mr=Object.prototype.hasOwnProperty;function hr(e,t){return e!=null&&mr.call(e,t)}function gr(e,t){return e!=null&&xe(e,t,hr)}var _r=`[object String]`;function vr(e){return typeof e==`string`||!y(e)&&k(e)&&De(e)==_r}function yr(e,t){return et||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Or(e,t,n){t=t.length?u(t,function(e){return y(e)?function(t){return ue(t,e.length===1?e[0]:e)}:e}):[me];var r=-1;return t=u(t,g(C)),Tr(ur(e,function(e,n,i){return{criteria:u(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return Dr(e,t,n)})}var kr=Oe(`length`),Ar=`\\ud800-\\udfff`,jr=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,Mr=`\\ufe0e\\ufe0f`,Nr=`[`+Ar+`]`,Pr=`[`+jr+`]`,Fr=`\\ud83c[\\udffb-\\udfff]`,Ir=`(?:`+Pr+`|`+Fr+`)`,Lr=`[^`+Ar+`]`,Rr=`(?:\\ud83c[\\udde6-\\uddff]){2}`,zr=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Br=`\\u200d`,Vr=Ir+`?`,Hr=`[`+Mr+`]?`,Ur=`(?:`+Br+`(?:`+[Lr,Rr,zr].join(`|`)+`)`+Hr+Vr+`)*`,Wr=Hr+Vr+Ur,Gr=`(?:`+[Lr+Pr+`?`,Pr,Rr,zr,Nr].join(`|`)+`)`,Kr=RegExp(Fr+`(?=`+Fr+`)|`+Gr+Wr,`g`);function qr(e){for(var t=Kr.lastIndex=0;Kr.test(e);)++t;return t}function Jr(e){return xt(e)?qr(e):kr(e)}function Yr(e,t){return wr(e,t,function(t,n){return Ee(e,n)})}var K=dt(function(e,t){return e==null?{}:Yr(e,t)}),Xr=Math.ceil,Zr=Math.max;function Qr(e,t,n,r){for(var i=-1,a=Zr(Xr((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function $r(e){return function(t,n,r){return r&&typeof r!=`number`&&I(t,n,r)&&(n=r=void 0),t=M(t),n===void 0?(n=t,t=0):n=M(n),r=r===void 0?t1&&I(e,t[0],t[1])?t=[]:n>2&&I(t[0],t[1],t[2])&&(t=[t[0]]),Or(e,p(t,1),[])}),ri=0;function ii(e){var t=++ri;return se(e)+t}function ai(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r0;--s)if(o=t[s].dequeue(),o){r=r.concat(pi(e,t,n,o,!0));break}}}return r}function pi(e,t,n,r,i){var a=i?[]:void 0;return E(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,hi(t,n,s)}),E(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,hi(t,n,o)}),e.removeNode(r.v),a}function mi(e,t){var n=new O,r=0,i=0;E(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),E(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=q(i+r+3).map(function(){return new si}),o=r+1;return E(n.nodes(),function(e){hi(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function hi(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function gi(e){var t=e.graph().acyclicer===`greedy`?di(e,n(e)):_i(e);E(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,ii(`rev`))});function n(e){return function(t){return e.edge(t).weight}}}function _i(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,E(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return E(e.nodes(),i),t}function vi(e){E(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function Y(e,t,n,r){var i;do i=ii(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function yi(e){var t=new O().setGraph(e.graph());return E(e.nodes(),function(n){t.setNode(n,e.node(n))}),E(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function bi(e){var t=new O({multigraph:e.isMultigraph()}).setGraph(e.graph());return E(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),E(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function xi(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function X(e){var t=H(q(Ti(e)+1),function(){return[]});return E(e.nodes(),function(n){var r=e.node(n),i=r.rank;D(i)||(t[i][r.order]=n)}),t}function Si(e){var t=G(H(e.nodes(),function(t){return e.node(t).rank}));E(e.nodes(),function(n){var r=e.node(n);gr(r,`rank`)&&(r.rank-=t)})}function Ci(e){var t=G(H(e.nodes(),function(t){return e.node(t).rank})),n=[];E(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;E(n,function(t,n){D(t)&&n%i!==0?--r:r&&E(t,function(t){e.node(t).rank+=r})})}function wi(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Y(e,`border`,i,t)}function Ti(e){return W(H(e.nodes(),function(t){var n=e.node(t).rank;if(!D(n))return n}))}function Ei(e,t){var n={lhs:[],rhs:[]};return E(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Di(e,t){var n=Zn();try{return t()}finally{console.log(e+` time: `+(Zn()-n)+`ms`)}}function Oi(e,t){return t()}function ki(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&E(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;ao.lim&&(s=o,c=!0),Sr(S(t.edges(),function(t){return c===ca(e,e.node(t.v),s)&&c!==ca(e,e.node(t.w),s)}),function(e){return Z(t,e)})}function aa(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),ta(e),Qi(e,t),oa(e,t)}function oa(e,t){var n=Zi(e,lr(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),E(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function sa(e,t,n){return e.hasEdge(t,n)}function ca(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function la(e){switch(e.graph().ranker){case`network-simplex`:fa(e);break;case`tight-tree`:da(e);break;case`longest-path`:ua(e);break;default:fa(e)}}var ua=Hi;function da(e){Hi(e),Ui(e)}function fa(e){$(e)}function pa(e){var t=Y(e,`root`,{},`_root`),n=ha(e),r=W(w(n))-1,i=2*r+1;e.graph().nestingRoot=t,E(e.edges(),function(t){e.edge(t).minlen*=i});var a=ga(e)+1;E(e.children(),function(o){ma(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function ma(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var c=wi(e,`_bt`),l=wi(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,E(s,function(s){ma(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function ha(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&E(a,function(e){n(e,i+1)}),t[r]=i}return E(e.children(),function(e){n(e,1)}),t}function ga(e){return T(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function _a(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,E(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function va(e,t,n){var r={},i;E(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function ya(e,t,n){var r=ba(e),i=new O({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return E(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),E(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=D(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function ba(e){for(var t;e.hasNode(t=ii(`_root`)););return t}function xa(e,t){for(var n=0,r=1;r0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function Ca(e){var t={},n=S(e.nodes(),function(t){return!e.children(t).length}),r=H(q(W(H(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){gr(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),E(e.successors(n),i))}var a=J(n,function(t){return e.node(t).rank});return E(a,i),r}function wa(e,t){return H(t,function(t){var n=e.inEdges(t);if(n.length){var r=T(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}return{v:t}})}function Ta(e,t){var n={};return E(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};D(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),E(t.edges(),function(e){var t=n[e.v],r=n[e.w];!D(t)&&!D(r)&&(r.indegree++,t.out.push(n[e.w]))}),Ea(S(n,function(e){return!e.indegree}))}function Ea(e){var t=[];function n(e){return function(t){t.merged||(D(t.barycenter)||D(e.barycenter)||t.barycenter>=e.barycenter)&&Da(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),E(i.in.reverse(),n(i)),E(i.out,r(i))}return H(S(t,function(e){return!e.merged}),function(e){return K(e,[`vs`,`i`,`barycenter`,`weight`])})}function Da(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Oa(e,t){var n=Ei(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=J(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Aa(!!t)),c=ka(a,i,c),E(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=ka(a,i,c)});var l={vs:R(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function ka(e,t,n){for(var r;t.length&&(r=V(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Aa(e){return function(t,n){return t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}}function ja(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=S(i,function(e){return e!==o&&e!==s}));var l=wa(e,i);E(l,function(t){if(e.children(t.v).length){var i=ja(e,t.v,n,r);c[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&Na(t,i)}});var u=Ta(l,n);Ma(u,c);var d=Oa(u,r);if(o&&(d.vs=R([o,d.vs,s]),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function Ma(e,t){E(e,function(e){e.vs=R(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function Na(e,t){D(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Pa(e){var t=Ti(e),n=Fa(e,q(1,t+1),`inEdges`),r=Fa(e,q(t-1,-1,-1),`outEdges`),i=Ca(e);La(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){Ia(s%2?n:r,s%4>=2),i=X(e);var l=xa(e,i);lo||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Ba(e){var t={},n=0;function r(i){var a=n;E(e.children(i),r),t[i]={low:a,lim:n++}}return E(e.children(),r),t}function Va(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=V(r);return E(r,function(t,c){var l=Ua(e,t),u=l?e.node(l).order:o;(l||t===s)&&(E(r.slice(a,c+1),function(t){E(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(oo)&&Wa(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return E(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return T(t,i),n}function Ua(e,t){if(e.node(t).dummy)return lr(e.predecessors(t),function(t){return e.node(t).dummy})}function Wa(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Ga(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Ka(e,t,n,r){var i={},a={},o={};return E(t,function(e){E(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),E(t,function(e){var t=-1;E(e,function(e){var s=r(e);if(s.length){s=J(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t{var t=n(` buildLayoutGraph`,()=>ho(e));n(` runLayout`,()=>io(t,n)),n(` updateInputGraph`,()=>ao(e,t))})}function io(e,t){t(` makeSpaceForEdgeLabels`,()=>go(e)),t(` removeSelfEdges`,()=>To(e)),t(` acyclic`,()=>gi(e)),t(` nestingGraph.run`,()=>pa(e)),t(` rank`,()=>la(bi(e))),t(` injectEdgeLabelProxies`,()=>_o(e)),t(` removeEmptyRanks`,()=>Ci(e)),t(` nestingGraph.cleanup`,()=>_a(e)),t(` normalizeRanks`,()=>Si(e)),t(` assignRankMinMax`,()=>vo(e)),t(` removeEdgeLabelProxies`,()=>yo(e)),t(` normalize.run`,()=>zi(e)),t(` parentDummyChains`,()=>Ra(e)),t(` addBorderSegments`,()=>ki(e)),t(` order`,()=>Pa(e)),t(` insertSelfEdges`,()=>Eo(e)),t(` adjustCoordinateSystem`,()=>ji(e)),t(` position`,()=>to(e)),t(` positionSelfEdges`,()=>Do(e)),t(` removeBorderNodes`,()=>wo(e)),t(` normalize.undo`,()=>Vi(e)),t(` fixupEdgeLabelCoords`,()=>So(e)),t(` undoCoordinateSystem`,()=>Mi(e)),t(` translateGraph`,()=>bo(e)),t(` assignNodeIntersects`,()=>xo(e)),t(` reversePoints`,()=>Co(e)),t(` acyclic.undo`,()=>vi(e))}function ao(e,t){E(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),E(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var oo=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],so={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},co=[`acyclicer`,`ranker`,`rankdir`,`align`],lo=[`width`,`height`],uo={width:0,height:0},fo=[`minlen`,`weight`,`width`,`height`,`labeloffset`],po={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},mo=[`labelpos`];function ho(e){var t=new O({multigraph:!0,compound:!0}),n=ko(e.graph());return t.setGraph(xr({},so,Oo(n,oo),K(n,co))),E(e.nodes(),function(n){var r=ko(e.node(n));t.setNode(n,er(Oo(r,lo),uo)),t.setParent(n,e.parent(n))}),E(e.edges(),function(n){var r=ko(e.edge(n));t.setEdge(n,xr({},po,Oo(r,fo),K(r,mo)))}),t}function go(e){var t=e.graph();t.ranksep/=2,E(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function _o(e){E(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);Y(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function vo(e){var t=0;E(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=W(t,r.maxRank))}),e.graph().maxRank=t}function yo(e){E(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function bo(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}E(e.nodes(),function(t){c(e.node(t))}),E(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,E(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),E(e.edges(),function(n){var i=e.edge(n);E(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function xo(e){E(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(xi(r,a)),n.points.push(xi(i,o))})}function So(e){E(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(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}})}function Co(e){E(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function wo(e){E(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(V(n.borderLeft)),o=e.node(V(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),E(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function To(e){E(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Eo(e){var t=X(e);E(t,function(t){var n=0;E(t,function(t,r){var i=e.node(t);i.order=r+n,E(i.selfEdges,function(t){Y(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Do(e){E(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function Oo(e,t){return U(K(e,t),Number)}function ko(e){var t={};return E(e,function(e,n){t[n.toLowerCase()]=e}),t}var Ao=e((e,t,n)=>Math.max(t,Math.min(n,e)),`clamp`),jo=e((e=`TB`)=>{switch(e){case`BT`:return`bottom`;case`LR`:return`right`;case`RL`:return`left`;default:return`top`}},`getDefaultSelfLoopSide`),Mo=e(e=>e===`flowchart`||e===`flowchart-v2`||e===`stateDiagram`||e===`er`||e===`classDiagram`,`shouldMergeSelfLoopSegments`),No=[`x`,`y`,`width`,`height`,`labelBBox`,`intersect`,`calcIntersect`,`diff`,`clusterNode`],Po=e((e,t,n,r,i)=>{let a=[],o=new Set;if(n.forEach(({start:e,end:t})=>{e!==r&&o.add(e),t!==r&&o.add(t)}),o.forEach(t=>{let n=e.node(t);typeof n?.x==`number`&&typeof n?.y==`number`&&a.push(n)}),a.length===0&&n.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{typeof e?.x==`number`&&typeof e?.y==`number`&&a.push(e)})}),a.length===0)return jo(i);let s=a.reduce((e,t)=>({x:e.x+t.x/a.length,y:e.y+t.y/a.length}),{x:0,y:0}),c=s.x-t.x,l=s.y-t.y;return Math.abs(c)>Math.abs(l)?c>0?`right`:`left`:Math.abs(l)>0?l>0?`bottom`:`top`:jo(i)},`getSelfLoopSide`),Fo=e((e,t=`top`,n=0,r=0)=>{let i=e.x,a=e.y-n,o=e.width/2,s=e.height/2,c=Math.max(36,Math.min(100,e.width*.8)),l=Ao(Math.max(r,e.width*.35),36,c),u=Ao(Math.min(e.width,e.height)*.45,24,48);switch(t){case`bottom`:{let e=a+s;return[{x:i-l/2,y:e},{x:i-l/2,y:e+u},{x:i+l/2,y:e+u},{x:i+l/2,y:e}]}case`right`:{let e=i+o;return[{x:e,y:a-l/2},{x:e+u,y:a-l/2},{x:e+u,y:a+l/2},{x:e,y:a+l/2}]}case`left`:{let e=i-o;return[{x:e,y:a-l/2},{x:e-u,y:a-l/2},{x:e-u,y:a+l/2},{x:e,y:a+l/2}]}default:{let e=a-s;return[{x:i-l/2,y:e},{x:i-l/2,y:e-u},{x:i+l/2,y:e-u},{x:i+l/2,y:e}]}}},`getSelfLoopPoints`),Io=e((e,t,n=`top`,r=0,i={})=>{let a=e.x,o=e.y-r,s=i.width??0,c=i.height??0;switch(n){case`bottom`:return{x:a,y:Math.max(...t.map(e=>e.y))+c/2+4};case`right`:return{x:Math.max(...t.map(e=>e.x))+s/2+4,y:o};case`left`:return{x:Math.min(...t.map(e=>e.x))-s/2-4,y:o};default:return{x:a,y:Math.min(...t.map(e=>e.y))-c/2-4}}},`getSelfLoopLabelPosition`),Lo=e((e,t=0,{mergeSelfLoops:n=!0}={})=>{let r=new Map,i=[],a=e.graph()?.rankdir;return e.edges().forEach(t=>{let a=e.edge(t);if(n&&a.selfLoop){let e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:t.v,end:t.w})}else i.push({edge:a,start:t.v,end:t.w})}),r.forEach(n=>{if(n.length!==3){n.forEach(e=>i.push(e));return}n.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);let[r,o,s]=n,c=r.edge.originalEdge??o.edge.originalEdge??s.edge.originalEdge??o.edge,l=e.node(c.start);if(!l){n.forEach(e=>i.push(e));return}let u={width:o.edge.width,height:o.edge.height},d=Po(e,l,n,c.start,a),f=Fo(l,d,t,u.width??0),p=Io(l,f,d,t,u),m={...o.edge,...c,id:c.id,points:f,start:c.start,end:c.end,x:p.x,y:p.y,width:u.width,height:u.height,labelStyle:o.edge.labelStyle,fromCluster:r.edge.fromCluster??o.edge.fromCluster??s.edge.fromCluster,toCluster:r.edge.toCluster??o.edge.toCluster??s.edge.toCluster};delete m.selfLoop,delete m.originalEdge,i.push({edge:m,start:m.start,end:m.end})}),i},`getEdgesToRender`),Ro=e(async({element:n,graph:a,diagramType:c,id:l,parentCluster:u,siteConfig:d})=>{let f=a.graph().rankdir;t.trace(`Dir in recursive render - dir:`,f);let{clusters:p,edgePaths:m,edgeLabels:h,nodes:g,rootGroups:ee}=ze(n,{edgePathsClass:`edgePaths`});a.nodes()?t.info(`Recursive render XXX`,a.nodes()):t.info(`No nodes found for`,a),a.edges().length>0&&t.info(`Recursive edges`,a.edge(a.edges()[0]));let _=Mo(c);await Promise.all(a.nodes().map(async function(e){let n=a.node(e);if(u!==void 0){let n=JSON.parse(JSON.stringify(u.clusterData));t.trace(`Setting data for parent cluster XXX Node.id = `,e,` data=`,n.height,` -Parent cluster`,u.height),a.setNode(u.id,n),a.parent(e)||(t.trace(`Setting parent`,e,u.id),a.setParent(e,u.id,n))}if(t.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(a.node(e))),n?.clusterNode){t.info(`Cluster identified XBX`,e,n.width,a.node(e));let{ranksep:o,nodesep:c}=a.graph();n.graph.setGraph({...n.graph.graph(),ranksep:o+25,nodesep:c});let u=await Go({element:g,graph:n.graph,diagramType:s,id:l,parentCluster:a.node(e),siteConfig:d}),f=u.elem;r(n,f),n.diff=u.diff||0,t.info(`New compound node after recursive render XAX`,e,`width`,n.width,`height`,n.height),i(f,n)}else a.children(e).length>0?(t.trace(`Cluster - the non recursive path XBX`,e,n.id,n,n.width,`Graph:`,a),t.trace(Re(n.id,a)),N.set(n.id,{id:Re(n.id,a),node:n})):(t.trace(`Node - the non recursive path XAX`,e,g,a.node(e),f),await Be(g,a.node(e),{config:d,dir:f}))})),await e(async()=>{let e=a.edges().map(async function(e){let n=a.edge(e.v,e.w,e.name);if(t.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),t.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(a.edge(e))),t.info(`Fix`,N,`ids:`,e.v,e.w,`Translating: `,N.get(e.v),N.get(e.w)),ee&&n.selfLoop){if(n.selfLoop.order!==1)return;let e={...n.originalEdge,...n,id:n.selfLoop.id,startLabelLeft:n.originalEdge?.startLabelLeft??n.startLabelLeft,startLabelRight:n.originalEdge?.startLabelRight??n.startLabelRight,endLabelLeft:n.originalEdge?.endLabelLeft??n.endLabelLeft,endLabelRight:n.originalEdge?.endLabelRight??n.endLabelRight};await c(h,e),n.width=e.width,n.height=e.height,n.labelStyle=e.labelStyle;return}await c(h,n)});await Promise.all(e)},`processEdges`)();let{subGraphTitleTotalMargin:v}=o(d);return{elem:_,graph:a,groups:{clusters:p,edgePaths:m,edgeLabels:h,nodes:g,rootGroups:_},diagramType:s,id:l,mergeSelfLoops:ee,subGraphTitleTotalMargin:v}},`measureDagreGraph`),zo=e(e=>{t.info(`############################################# XXX`),t.info(`### Layout ### XXX`),t.info(`############################################# XXX`),ro(e)},`runDagreGraphLayout`),Bo=e((e,t,n)=>{let r=e.node(t);if(!r)return;let i={...r};return r?.clusterNode?i.y=(r.y??0)+n:e.children(t).length>0?i.height=(r.height??0)+n:i.y=(r.y??0)+n/2,i},`normalizeDagreNode`),Vo=e((e,t)=>{No.forEach(n=>{t[n]!==void 0&&(e[n]=t[n])})},`applyDagreNodeLayout`),Ho=e((e,t,n,r)=>({...e,start:e.start??t,end:e.end??n,points:(e.points??[]).map(e=>({...e,y:typeof e.y==`number`?e.y+r:e.y}))}),`normalizeDagreEdge`),Uo=e((e,t)=>{let{graph:n,mergeSelfLoops:r,subGraphTitleTotalMargin:i=0}=t,a=new Map(e.nodes.map(e=>[e.id,e]));Ie(n).forEach(e=>{let t=Bo(n,e,i);if(!t)return;Vo(n.node(e),t);let r=a.get(e);r&&Vo(r,t)});let o=i/2;return e.edges=Lo(n,o,{mergeSelfLoops:r}).map(({edge:e,start:t,end:n})=>Ho(e,t,n,o)),e},`applyDagreLayoutResult`),Wo=e(async({elem:e,graph:n,groups:{clusters:r,edgePaths:i},diagramType:o,id:c,mergeSelfLoops:d,subGraphTitleTotalMargin:f})=>{let p=0;await Promise.all(Ie(n).map(async function(e){let i=n.node(e);if(t.info(`Position XBX => `+e+`: (`+i.x,`,`+i.y,`) width: `,i.width,` height: `,i.height),i?.clusterNode)i.y+=f,t.info(`A tainted cluster node XBX1`,e,i.id,i.width,i.height,i.x,i.y,n.parent(e)),N.get(i.id).node=i,a(i);else if(n.children(e).length>0){t.info(`A pure cluster node XBX1`,e,i.id,i.x,i.y,i.width,i.height,n.parent(e)),i.height+=f,n.node(i.parentId);let a=i?.padding/2||0,o=i?.labelBBox?.height||0,c=o-a||0;t.debug(`OffsetY`,c,`labelHeight`,o,`halfPadding`,a),await s(r,i),N.get(i.id).node=i}else{let e=n.node(i.parentId);i.y+=f/2,t.info(`A regular node XBX1 - using the padding`,i.id,`parent`,i.parentId,i.width,i.height,i.x,i.y,`offsetY`,i.offsetY,`parent`,e,e?.offsetY,i),a(i)}}));let m=f/2;return Lo(n,m,{mergeSelfLoops:d}).forEach(function({edge:e,start:r,end:a}){t.info(`Edge `+r+` -> `+a+`: `+JSON.stringify(e),e),e.points.forEach(e=>e.y+=m);let s=n.node(r),d=n.node(a),f=l(i,e,N,o,s,d,c);u(e,f)}),n.nodes().forEach(function(e){let r=n.node(e);t.info(e,r.type,r.diff),r.isGroup&&(p=r.diff)}),t.warn(`Returning from recursive render XAX`,e,p),{elem:e,diff:p}},`paintDagreLayoutCore`),Go=e(async e=>{let t=await Ro(e);return zo(t.graph),await Wo(t)},`renderDagreSubgraph`),Ko=e(e=>{let n=new A({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(e=>{n.setNode(e.id,{...e}),e.parentId&&n.setParent(e.id,e.parentId)}),t.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,r=t+`---`+t+`---1`,i=t+`---`+t+`---2`,a=n.node(t);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),n.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e),l=structuredClone(e);s.originalEdge=o,s.selfLoop={id:o.id,order:0},c.originalEdge=o,c.selfLoop={id:o.id,order:1},l.originalEdge=o,l.selfLoop={id:o.id,order:2},s.label=``,s.arrowTypeEnd=`none`,s.endLabelLeft=``,s.endLabelRight=``,s.startLabelLeft=``,s.id=t+`-cyclic-special-1`,c.startLabelRight=``,c.startLabelLeft=``,c.endLabelLeft=``,c.endLabelRight=``,c.arrowTypeStart=`none`,c.arrowTypeEnd=`none`,c.id=t+`-cyclic-special-mid`,l.label=``,l.startLabelRight=``,l.startLabelLeft=``,l.arrowTypeStart=`none`,a.isGroup&&(s.fromCluster=t,l.toCluster=t),l.id=t+`-cyclic-special-2`,l.arrowTypeStart=`none`,n.setEdge(t,r,s,t+`-cyclic-special-0`),n.setEdge(r,i,c,t+`-cyclic-special-1`),n.setEdge(i,t,l,t+`-cyclic-special-2`)}else n.setEdge(e.start,e.end,{...e},e.id)}),Ve(n),{graph:n}},`prepareLayoutForDagre`),qo=e(async(e,{element:t,preparedLayout:r})=>{let i=r??Ko(e),a=n(),o=await Ro({element:t,graph:i.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:a});return i.measuredLayout=o,o},`measureDagreLayout`),Jo=e((e,t)=>{let n=t.preparedLayout?.measuredLayout;if(!n)throw Error(`runDagreLayoutCore requires measureDagreLayout to run first`);return zo(n.graph),Uo(e,n),n},`runDagreLayoutCore`),Yo=ze({prepareLayout:Ko,measureLayout:qo,runLayoutCore:Jo,paintOptions:{clusterDb:N,getNodes:e((e,{measure:t})=>Ie(t.graph).map(e=>t.graph.node(e)).filter(Boolean),`getDagrePaintNodes`),getEdgeNode:e((e,t,{measure:n})=>e?n.graph.node(e):void 0,`getDagreEdgeNode`),skipNode:e((e,{measure:t})=>!t.graph.hasNode(e.id),`skipNode`),isCluster:e((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,`isCluster`)}});export{Uo as applyDagreLayoutResult,Lo as getEdgesToRender,qo as measureDagreLayout,Ko as prepareLayoutForDagre,Yo as render,Jo as runDagreLayoutCore}; \ No newline at end of file +Parent cluster`,u.height),a.setNode(u.id,n),a.parent(e)||(t.trace(`Setting parent`,e,u.id),a.setParent(e,u.id,n))}if(t.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(a.node(e))),n?.clusterNode){t.info(`Cluster identified XBX`,e,n.width,a.node(e));let{ranksep:o,nodesep:s}=a.graph();n.graph.setGraph({...n.graph.graph(),ranksep:o+25,nodesep:s});let u=await Go({element:g,graph:n.graph,diagramType:c,id:l,parentCluster:a.node(e),siteConfig:d}),f=u.elem;r(n,f),n.diff=u.diff||0,t.info(`New compound node after recursive render XAX`,e,`width`,n.width,`height`,n.height),i(f,n)}else a.children(e).length>0?(t.trace(`Cluster - the non recursive path XBX`,e,n.id,n,n.width,`Graph:`,a),t.trace(Be(n.id,a)),j.set(n.id,{id:Be(n.id,a),node:n})):(t.trace(`Node - the non recursive path XAX`,e,g,a.node(e),f),await He(g,a.node(e),{config:d,dir:f}))})),await e(async()=>{let e=a.edges().map(async function(e){let n=a.edge(e.v,e.w,e.name);if(t.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),t.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(a.edge(e))),t.info(`Fix`,j,`ids:`,e.v,e.w,`Translating: `,j.get(e.v),j.get(e.w)),_&&n.selfLoop){if(n.selfLoop.order!==1)return;let e={...n.originalEdge,...n,id:n.selfLoop.id,startLabelLeft:n.originalEdge?.startLabelLeft??n.startLabelLeft,startLabelRight:n.originalEdge?.startLabelRight??n.startLabelRight,endLabelLeft:n.originalEdge?.endLabelLeft??n.endLabelLeft,endLabelRight:n.originalEdge?.endLabelRight??n.endLabelRight};await s(h,e),n.width=e.width,n.height=e.height,n.labelStyle=e.labelStyle;return}await s(h,n)});await Promise.all(e)},`processEdges`)();let{subGraphTitleTotalMargin:te}=o(d);return{elem:ee,graph:a,groups:{clusters:p,edgePaths:m,edgeLabels:h,nodes:g,rootGroups:ee},diagramType:c,id:l,mergeSelfLoops:_,subGraphTitleTotalMargin:te}},`measureDagreGraph`),zo=e(e=>{t.info(`############################################# XXX`),t.info(`### Layout ### XXX`),t.info(`############################################# XXX`),ro(e)},`runDagreGraphLayout`),Bo=e((e,t,n)=>{let r=e.node(t);if(!r)return;let i={...r};return r?.clusterNode?i.y=(r.y??0)+n:e.children(t).length>0?i.height=(r.height??0)+n:i.y=(r.y??0)+n/2,i},`normalizeDagreNode`),Vo=e((e,t)=>{No.forEach(n=>{t[n]!==void 0&&(e[n]=t[n])})},`applyDagreNodeLayout`),Ho=e((e,t,n,r)=>({...e,start:e.start??t,end:e.end??n,points:(e.points??[]).map(e=>({...e,y:typeof e.y==`number`?e.y+r:e.y}))}),`normalizeDagreEdge`),Uo=e((e,t)=>{let{graph:n,mergeSelfLoops:r,subGraphTitleTotalMargin:i=0}=t,a=new Map(e.nodes.map(e=>[e.id,e]));Re(n).forEach(e=>{let t=Bo(n,e,i);if(!t)return;Vo(n.node(e),t);let r=a.get(e);r&&Vo(r,t)});let o=i/2;return e.edges=Lo(n,o,{mergeSelfLoops:r}).map(({edge:e,start:t,end:n})=>Ho(e,t,n,o)),e},`applyDagreLayoutResult`),Wo=e(async({elem:e,graph:n,groups:{clusters:r,edgePaths:i},diagramType:o,id:s,mergeSelfLoops:u,subGraphTitleTotalMargin:d})=>{let f=0;await Promise.all(Re(n).map(async function(e){let i=n.node(e);if(t.info(`Position XBX => `+e+`: (`+i.x,`,`+i.y,`) width: `,i.width,` height: `,i.height),i?.clusterNode)i.y+=d,t.info(`A tainted cluster node XBX1`,e,i.id,i.width,i.height,i.x,i.y,n.parent(e)),j.get(i.id).node=i,a(i);else if(n.children(e).length>0){t.info(`A pure cluster node XBX1`,e,i.id,i.x,i.y,i.width,i.height,n.parent(e)),i.height+=d,n.node(i.parentId);let a=i?.padding/2||0,o=i?.labelBBox?.height||0,s=o-a||0;t.debug(`OffsetY`,s,`labelHeight`,o,`halfPadding`,a),await Le(r,i),j.get(i.id).node=i}else{let e=n.node(i.parentId);i.y+=d/2,t.info(`A regular node XBX1 - using the padding`,i.id,`parent`,i.parentId,i.width,i.height,i.x,i.y,`offsetY`,i.offsetY,`parent`,e,e?.offsetY,i),a(i)}}));let p=d/2;return Lo(n,p,{mergeSelfLoops:u}).forEach(function({edge:e,start:r,end:a}){t.info(`Edge `+r+` -> `+a+`: `+JSON.stringify(e),e),e.points.forEach(e=>e.y+=p);let u=n.node(r),d=n.node(a),f=c(i,e,j,o,u,d,s);l(e,f)}),n.nodes().forEach(function(e){let r=n.node(e);t.info(e,r.type,r.diff),r.isGroup&&(f=r.diff)}),t.warn(`Returning from recursive render XAX`,e,f),{elem:e,diff:f}},`paintDagreLayoutCore`),Go=e(async e=>{let t=await Ro(e);return zo(t.graph),await Wo(t)},`renderDagreSubgraph`),Ko=e(e=>{let n=new O({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(e=>{n.setNode(e.id,{...e}),e.parentId&&n.setParent(e.id,e.parentId)}),t.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,r=t+`---`+t+`---1`,i=t+`---`+t+`---2`,a=n.node(t);n.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),n.setParent(r,a.parentId),n.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),n.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e),l=structuredClone(e);s.originalEdge=o,s.selfLoop={id:o.id,order:0},c.originalEdge=o,c.selfLoop={id:o.id,order:1},l.originalEdge=o,l.selfLoop={id:o.id,order:2},s.label=``,s.arrowTypeEnd=`none`,s.endLabelLeft=``,s.endLabelRight=``,s.startLabelLeft=``,s.id=t+`-cyclic-special-1`,c.startLabelRight=``,c.startLabelLeft=``,c.endLabelLeft=``,c.endLabelRight=``,c.arrowTypeStart=`none`,c.arrowTypeEnd=`none`,c.id=t+`-cyclic-special-mid`,l.label=``,l.startLabelRight=``,l.startLabelLeft=``,l.arrowTypeStart=`none`,a.isGroup&&(s.fromCluster=t,l.toCluster=t),l.id=t+`-cyclic-special-2`,l.arrowTypeStart=`none`,n.setEdge(t,r,s,t+`-cyclic-special-0`),n.setEdge(r,i,c,t+`-cyclic-special-1`),n.setEdge(i,t,l,t+`-cyclic-special-2`)}else n.setEdge(e.start,e.end,{...e},e.id)}),Ue(n),{graph:n}},`prepareLayoutForDagre`),qo=e(async(e,{element:t,preparedLayout:r})=>{let i=r??Ko(e),a=n(),o=await Ro({element:t,graph:i.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:a});return i.measuredLayout=o,o},`measureDagreLayout`),Jo=e((e,t)=>{let n=t.preparedLayout?.measuredLayout;if(!n)throw Error(`runDagreLayoutCore requires measureDagreLayout to run first`);return zo(n.graph),Uo(e,n),n},`runDagreLayoutCore`),Yo=Ve({prepareLayout:Ko,measureLayout:qo,runLayoutCore:Jo,paintOptions:{clusterDb:j,getNodes:e((e,{measure:t})=>Re(t.graph).map(e=>t.graph.node(e)).filter(Boolean),`getDagrePaintNodes`),getEdgeNode:e((e,t,{measure:n})=>e?n.graph.node(e):void 0,`getDagreEdgeNode`),skipNode:e((e,{measure:t})=>!t.graph.hasNode(e.id),`skipNode`),isCluster:e((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,`isCluster`)}});export{Uo as applyDagreLayoutResult,Lo as getEdgesToRender,qo as measureDagreLayout,Ko as prepareLayoutForDagre,Yo as render,Jo as runDagreLayoutCore}; \ No newline at end of file diff --git a/web/dist/app-diagram-22UHCM2B.js b/web/dist/app-diagram-22UHCM2B.js index 72cb5aa47..07fb75314 100644 --- a/web/dist/app-diagram-22UHCM2B.js +++ b/web/dist/app-diagram-22UHCM2B.js @@ -1,12 +1,12 @@ -import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{G as i,H as a,U as o,a as s,d as c,it as l,q as u,s as d,v as f,w as p,x as m,y as h}from"./app-chunk-O7XYJQB3.js";import{t as g}from"./app-channel.js";import{c as _,g as v}from"./app-chunk-ZIGJFQKS.js";import{n as y,t as b}from"./app-chunk-LNGE3PJU.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{i as x,n as S,o as C,r as w}from"./app-chunk-J5ZVWO5B.js";import{a as T}from"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as E,t as D}from"./app-chunk-GNY47TPC.js";import{t as O}from"./app-chunk-5VM5RSS4.js";import{t as k}from"./app-chunk-GWA4HPMP.js";import{t as A}from"./app-chunk-XXDRQBXY.js";import{t as j}from"./app-chunk-WEXAMYUT.js";var M={SHAPE_UNSUPPORTED:`SHAPE_UNSUPPORTED`,SHAPE_REMOVED:`SHAPE_REMOVED`,EDGE_OPERATOR_UNSUPPORTED:`EDGE_OPERATOR_UNSUPPORTED`,REFERENCE_EDGE_LABEL_REJECTED:`REFERENCE_EDGE_LABEL_REJECTED`,CONNECTOR_REF_UNRESOLVED:`CONNECTOR_REF_UNRESOLVED`,CONNECTOR_REF_NOT_A_CONNECTOR:`CONNECTOR_REF_NOT_A_CONNECTOR`,METADATA_KEY_MISAPPLIED:`METADATA_KEY_MISAPPLIED`,DUPLICATE_ID_NODE:`DUPLICATE_ID_NODE`,RESERVED_SYNTHETIC_ID:`RESERVED_SYNTHETIC_ID`,CONTAINMENT_VIOLATION:`CONTAINMENT_VIOLATION`,EDGE_SEMANTIC_CONTRADICTION:`EDGE_SEMANTIC_CONTRADICTION`,FLOW_NO_INPUT:`FLOW_NO_INPUT`},N=new Set([M.SHAPE_UNSUPPORTED,M.SHAPE_REMOVED,M.CONTAINMENT_VIOLATION]);new Set(Object.values(M).filter(e=>!N.has(e)));var P=new Map([[`task`,`roundedRect`],[`tool`,`subroutine`],[`input`,`lean-right`],[`decision`,`diamond`],[`refdoc`,`lin-doc`],[`action`,`hexagon`],[`round`,`rect`]]),ee=new Set(`doc.stadium.terminal.circle.trapezoid.inv_trapezoid.inv-trapezoid.doublecircle.double-circle.typeDeclaration.procs.lean_left.lean-left.in-out.cylinder.ellipse.odd.tag-rect.tagged-rectangle.delay.half-rounded-rectangle.lin-rect.lined-rectangle.win-pane.window-pane.curv-trap.curved-trapezoid`.split(`.`)),te=new Set([`roundedRect`,`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`lean-right`,`diamond`,`lin-doc`,`lined-document`,`hexagon`,`hex`,`connector`,`collapsedGroup`]),F=`roundedRect`;function I(e){return e&&(P.get(e)??e)}t(I,`resolveShapeAlias`);function ne(e,t){for(let r of e)if(!r.isGroup){if((!r.shape||r.shape===`squareRect`||r.shape===`rect`)&&(r.shape=F),ee.has(r.shape)){let e=`shape "${r.shape}" was removed in v0.8.1, using "${F}"`;t?.emitError?t.emitError(`SHAPE_REMOVED`,e,{nodeId:r.id}):n.warn(`agentflow: ${e}`),r.shape=F;continue}if(!te.has(r.shape)){let e=`shape "${r.shape}" is not supported, using "${F}"`;t?.emitWarning?t.emitWarning(`SHAPE_UNSUPPORTED`,e,{nodeId:r.id}):n.warn(`agentflow: ${e}`),r.shape=F}}}t(ne,`normaliseNodeShapes`);var L=new Map([[`tool`,0],[`task`,1],[`decision`,2],[`input`,3],[`refdoc`,4],[`connector`,5],[`action`,6]]),R=L.size,z=t(e=>`af-kind-${e}`,`kindClass`),B=[...L.keys()],V=t(e=>Math.max(1,e-R),`containerSlotCount`),H=t((e,t)=>{let n=R+e%V(t);return t>0?n%t:n},`containerSlot`);function re(e,t,n){let r=m().themeVariables?.borderColorArray,i=Array.isArray(r)?r.length:0,a=n.size;for(let r of e??[]){if(r.isGroup||r.shape===`collapsedGroup`){r.colorIndex=H(n.get(String(r.id))??a++,i);continue}let e=t(String(r.id));e&&L.has(e)&&(r.cssClasses=`${r.cssClasses??``} ${z(e)}`.replace(/\s+/g,` `).trim())}}t(re,`assignColorSlots`);var ie=`agentflow-`,ae=new Set([`shape`,`view`,`icon`,`img`,`form`,`pos`,`w`,`h`,`class`,`style`,`labelType`]),oe=new Set([`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`tool`]),se={flow:`flowGroup`};function ce(e){if(Array.isArray(e))return e.map(e=>ce(e));if(typeof e!=`object`||!e)return e;let t={};for(let n of Object.keys(e))n!==`__proto__`&&n!==`constructor`&&n!==`prototype`&&(t[n]=ce(e[n]));return t}t(ce,`stripPrototypeKeys`);function le(e){let t=!1,n=!1,r=0,i,a=[];for(let o of e.split(` +import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{G as i,H as a,U as o,a as s,d as c,it as l,q as u,s as d,v as f,w as p,x as m,y as h}from"./app-chunk-O7XYJQB3.js";import{t as g}from"./app-channel.js";import{c as _,g as v}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{t as y}from"./app-chunk-5VM5RSS4.js";import"./app-chunk-7PRAP22T.js";import{i as b,n as x,o as S,r as C}from"./app-chunk-J5ZVWO5B.js";import{a as w}from"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import{t as T}from"./app-chunk-GWA4HPMP.js";import{t as E}from"./app-chunk-XXDRQBXY.js";import{t as D}from"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import{r as O,t as k}from"./app-chunk-GNY47TPC.js";import{n as A,t as j}from"./app-chunk-LNGE3PJU.js";var M={SHAPE_UNSUPPORTED:`SHAPE_UNSUPPORTED`,SHAPE_REMOVED:`SHAPE_REMOVED`,EDGE_OPERATOR_UNSUPPORTED:`EDGE_OPERATOR_UNSUPPORTED`,REFERENCE_EDGE_LABEL_REJECTED:`REFERENCE_EDGE_LABEL_REJECTED`,CONNECTOR_REF_UNRESOLVED:`CONNECTOR_REF_UNRESOLVED`,CONNECTOR_REF_NOT_A_CONNECTOR:`CONNECTOR_REF_NOT_A_CONNECTOR`,METADATA_KEY_MISAPPLIED:`METADATA_KEY_MISAPPLIED`,DUPLICATE_ID_NODE:`DUPLICATE_ID_NODE`,RESERVED_SYNTHETIC_ID:`RESERVED_SYNTHETIC_ID`,CONTAINMENT_VIOLATION:`CONTAINMENT_VIOLATION`,EDGE_SEMANTIC_CONTRADICTION:`EDGE_SEMANTIC_CONTRADICTION`,FLOW_NO_INPUT:`FLOW_NO_INPUT`},N=new Set([M.SHAPE_UNSUPPORTED,M.SHAPE_REMOVED,M.CONTAINMENT_VIOLATION]);new Set(Object.values(M).filter(e=>!N.has(e)));var P=new Map([[`task`,`roundedRect`],[`tool`,`subroutine`],[`input`,`lean-right`],[`decision`,`diamond`],[`refdoc`,`lin-doc`],[`action`,`hexagon`],[`round`,`rect`]]),ee=new Set(`doc.stadium.terminal.circle.trapezoid.inv_trapezoid.inv-trapezoid.doublecircle.double-circle.typeDeclaration.procs.lean_left.lean-left.in-out.cylinder.ellipse.odd.tag-rect.tagged-rectangle.delay.half-rounded-rectangle.lin-rect.lined-rectangle.win-pane.window-pane.curv-trap.curved-trapezoid`.split(`.`)),te=new Set([`roundedRect`,`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`lean-right`,`diamond`,`lin-doc`,`lined-document`,`hexagon`,`hex`,`connector`,`collapsedGroup`]),F=`roundedRect`;function I(e){return e&&(P.get(e)??e)}t(I,`resolveShapeAlias`);function ne(e,t){for(let r of e)if(!r.isGroup){if((!r.shape||r.shape===`squareRect`||r.shape===`rect`)&&(r.shape=F),ee.has(r.shape)){let e=`shape "${r.shape}" was removed in v0.8.1, using "${F}"`;t?.emitError?t.emitError(`SHAPE_REMOVED`,e,{nodeId:r.id}):n.warn(`agentflow: ${e}`),r.shape=F;continue}if(!te.has(r.shape)){let e=`shape "${r.shape}" is not supported, using "${F}"`;t?.emitWarning?t.emitWarning(`SHAPE_UNSUPPORTED`,e,{nodeId:r.id}):n.warn(`agentflow: ${e}`),r.shape=F}}}t(ne,`normaliseNodeShapes`);var L=new Map([[`tool`,0],[`task`,1],[`decision`,2],[`input`,3],[`refdoc`,4],[`connector`,5],[`action`,6]]),R=L.size,z=t(e=>`af-kind-${e}`,`kindClass`),B=[...L.keys()],V=t(e=>Math.max(1,e-R),`containerSlotCount`),H=t((e,t)=>{let n=R+e%V(t);return t>0?n%t:n},`containerSlot`);function re(e,t,n){let r=m().themeVariables?.borderColorArray,i=Array.isArray(r)?r.length:0,a=n.size;for(let r of e??[]){if(r.isGroup||r.shape===`collapsedGroup`){r.colorIndex=H(n.get(String(r.id))??a++,i);continue}let e=t(String(r.id));e&&L.has(e)&&(r.cssClasses=`${r.cssClasses??``} ${z(e)}`.replace(/\s+/g,` `).trim())}}t(re,`assignColorSlots`);var ie=`agentflow-`,ae=new Set([`shape`,`view`,`icon`,`img`,`form`,`pos`,`w`,`h`,`class`,`style`,`labelType`]),oe=new Set([`subroutine`,`subprocess`,`subproc`,`framed-rectangle`,`tool`]),se={flow:`flowGroup`};function ce(e){if(Array.isArray(e))return e.map(e=>ce(e));if(typeof e!=`object`||!e)return e;let t={};for(let n of Object.keys(e))n!==`__proto__`&&n!==`constructor`&&n!==`prototype`&&(t[n]=ce(e[n]));return t}t(ce,`stripPrototypeKeys`);function le(e){let t=!1,n=!1,r=0,i,a=[];for(let o of e.split(` `)){if(i!==void 0){let e=o.length-o.trimStart().length;if(o.trim()===``||e>i){a.push(o);continue}i=void 0}let e=-1;for(let i=0;i0){a.push(o);continue}let s=e>=0?o.slice(0,e):o,c=e>=0?o.slice(e):``;if(/:\s*[>|][\d+-]*\s*$/.test(s)){i=o.length-o.trimStart().length,a.push(o);continue}a.push(s.replace(/,([\t ]*)$/,`$1`)+c)}return a.join(` `)}t(le,`stripLineTrailingCommas`);var ue=class{constructor(){this.vertexCounter=0,this.config=m(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId=``,this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=o,this.setAccDescription=a,this.setDiagramTitle=u,this.getAccTitle=h,this.getAccDescription=f,this.getDiagramTitle=p,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen(`gen-2`)}static{t(this,`AgentFlowDB`)}sanitizeText(e){return d.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let t of this.vertices.values())if(t.id===e)return this.diagramId?`${this.diagramId}-${t.domId}`:t.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,t,n,r,i,a,o={},s,c){if(!e||e.trim().length===0)return;let l;if(s!==void 0){let e;e=s.includes(` `)?s+` `:`{ `+s+` -}`;try{l=y(e,{schema:b})??{}}catch(e){let t=s.includes(` -`)?le(s):s;if(t!==s)try{l=y(t+` -`,{schema:b})??{}}catch{this.rethrowMetadataYamlError(e,s,c)}else this.rethrowMetadataYamlError(e,s,c)}l=ce(l)}let u;if(l&&typeof l.shape==`string`){let e=l;u=e.shape;let t=I(u);t&&t!==u&&(e.shape=t)}let d=this.subGraphLookup.get(e);if(d&&l){d.metadata={...d.metadata,...l};return}let f=this.connectors.get(e);if(f&&l){f.metadata={...f.metadata,...l};return}if(e===`connectors`)return;let p=this.edges.find(t=>t.id===e);if(p){let e=l;e?.animate!==void 0&&(p.animate=e.animate),e?.animation!==void 0&&(p.animation=e.animation),e?.curve!==void 0&&(p.interpolate=e.curve),l&&(p.metadata={...p.metadata,...l});return}let h,g=this.vertices.get(e);if(g===void 0&&(g={id:e,labelType:`text`,domId:ie+e+`-`+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,g)),this.vertexCounter++,t===void 0?g.text===void 0&&(g.text=e):(this.config=m(),h=this.sanitizeText(t.text.trim()),g.labelType=t.type,h.startsWith(`"`)&&h.endsWith(`"`)&&(h=h.substring(1,h.length-1)),g.text=h),n!==void 0&&(g.type=n),r?.forEach(e=>{g.styles.push(e)}),i?.forEach(e=>{g.classes.push(e)}),a!==void 0&&(g.dir=a),g.props===void 0?g.props=o:o!==void 0&&Object.assign(g.props,o),l){if(g.metadata={...g.metadata,...l},l.shape){let e=u??l.shape;if(typeof e!=`string`)throw this.positionedShapeError(`No such shape: ${JSON.stringify(e)}.`,c);if(e!==e.toLowerCase()||e.includes(`_`))throw this.positionedShapeError(`No such shape: ${e}. Shape names should be lowercase.`,c);if(!T(l.shape))throw this.positionedShapeError(`No such shape: ${l.shape}.`,c);g.type=l?.shape}l?.label&&(g.text=this.sanitizeText(l.label),g.labelType=this.sanitizeNodeLabelType(l?.labelType))}}positionedShapeError(e,t){let n=Error(e);if(!t)return n;let r=t.first_line+this.frontmatterLineOffset;return Object.assign(n,{hash:{text:``,token:null,line:r-1,loc:{first_line:r,last_line:t.last_line+this.frontmatterLineOffset,first_column:t.first_column,last_column:t.last_column},expected:[]}}),n}rethrowMetadataYamlError(e,n,r){let i=e;if(!i||i.name!==`YAMLException`||!i.mark||!r)throw e;let a;try{let e=!n.includes(` +}`;try{l=A(e,{schema:j})??{}}catch(e){let t=s.includes(` +`)?le(s):s;if(t!==s)try{l=A(t+` +`,{schema:j})??{}}catch{this.rethrowMetadataYamlError(e,s,c)}else this.rethrowMetadataYamlError(e,s,c)}l=ce(l)}let u;if(l&&typeof l.shape==`string`){let e=l;u=e.shape;let t=I(u);t&&t!==u&&(e.shape=t)}let d=this.subGraphLookup.get(e);if(d&&l){d.metadata={...d.metadata,...l};return}let f=this.connectors.get(e);if(f&&l){f.metadata={...f.metadata,...l};return}if(e===`connectors`)return;let p=this.edges.find(t=>t.id===e);if(p){let e=l;e?.animate!==void 0&&(p.animate=e.animate),e?.animation!==void 0&&(p.animation=e.animation),e?.curve!==void 0&&(p.interpolate=e.curve),l&&(p.metadata={...p.metadata,...l});return}let h,g=this.vertices.get(e);if(g===void 0&&(g={id:e,labelType:`text`,domId:ie+e+`-`+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,g)),this.vertexCounter++,t===void 0?g.text===void 0&&(g.text=e):(this.config=m(),h=this.sanitizeText(t.text.trim()),g.labelType=t.type,h.startsWith(`"`)&&h.endsWith(`"`)&&(h=h.substring(1,h.length-1)),g.text=h),n!==void 0&&(g.type=n),r?.forEach(e=>{g.styles.push(e)}),i?.forEach(e=>{g.classes.push(e)}),a!==void 0&&(g.dir=a),g.props===void 0?g.props=o:o!==void 0&&Object.assign(g.props,o),l){if(g.metadata={...g.metadata,...l},l.shape){let e=u??l.shape;if(typeof e!=`string`)throw this.positionedShapeError(`No such shape: ${JSON.stringify(e)}.`,c);if(e!==e.toLowerCase()||e.includes(`_`))throw this.positionedShapeError(`No such shape: ${e}. Shape names should be lowercase.`,c);if(!w(l.shape))throw this.positionedShapeError(`No such shape: ${l.shape}.`,c);g.type=l?.shape}l?.label&&(g.text=this.sanitizeText(l.label),g.labelType=this.sanitizeNodeLabelType(l?.labelType))}}positionedShapeError(e,t){let n=Error(e);if(!t)return n;let r=t.first_line+this.frontmatterLineOffset;return Object.assign(n,{hash:{text:``,token:null,line:r-1,loc:{first_line:r,last_line:t.last_line+this.frontmatterLineOffset,first_column:t.first_column,last_column:t.last_column},expected:[]}}),n}rethrowMetadataYamlError(e,n,r){let i=e;if(!i||i.name!==`YAMLException`||!i.mark||!r)throw e;let a;try{let e=!n.includes(` `),o=e?`{ `+n+` }`:n+` @@ -19,13 +19,13 @@ ${h.join(` Initialize mermaid with maxEdges set to a higher number to allow more edges. You cannot set this config via configuration inside the diagram as it is a secure config. -You have to call mermaid.initialize.`)}isLinkData(e){return typeof e==`object`&&!!e&&`id`in e&&typeof e.id==`string`}addLink(e,t,r){let i=this.isLinkData(r)?r.id.replace(`@`,``):void 0;n.info(`addLink`,e,t,i);for(let n of e)for(let a of t){let o=n===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(n,a,r,i):this.addSingleLink(n,a,r,void 0)}}updateLinkInterpolate(e,t){e.forEach(e=>{if(e==="default"){this.edges.defaultInterpolate=t;return}if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[e].interpolate=t})}updateLink(e,t){e.forEach(e=>{if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);e==="default"?this.edges.defaultStyle=t:(this.edges[e].style=t,(this.edges[e]?.style?.length??0)>0&&!this.edges[e]?.style?.some(e=>e?.startsWith(`fill`))&&this.edges[e]?.style?.push(`fill:none`))})}addClass(e,t){let n=t.join().replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);e.split(`,`).forEach(e=>{let t=this.classes.get(e);t===void 0&&(t={id:e,styles:[],textStyles:[]},this.classes.set(e,t)),n?.forEach(e=>{if(/color/.exec(e)){let n=e.replace(`fill`,`bgFill`);t.textStyles.push(n)}t.styles.push(e)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction=`LR`),/.*v/.exec(this.direction)&&(this.direction=`TB`),this.direction===`TD`&&(this.direction=`TB`)}setClass(e,t){for(let n of e.split(`,`)){let e=this.vertices.get(n);e&&e.classes.push(t);let r=this.edges.find(e=>e.id===n);r&&r.classes.push(t);let i=this.subGraphLookup.get(n);i&&i.classes.push(t)}}setTooltip(e,t){if(t!==void 0){t=this.sanitizeText(t);for(let n of e.split(`,`))this.tooltips.set(this.version===`gen-1`?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){if(m().securityLevel!==`loose`||t===void 0)return;let r=[];if(typeof n==`string`){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{let n=this.lookUpDomId(e),i=document.querySelector(`[id="${n}"]`);i!==null&&i.addEventListener(`click`,()=>{v.runFunc(t,...r)},!1)}))}setLink(e,t,n){e.split(`,`).forEach(e=>{let r=this.vertices.get(e);r!==void 0&&(r.link=v.formatUrl(t,this.config),r.linkTarget=n)}),this.setClass(e,`clickable`)}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFun(e,t,n)}),this.setClass(e,`clickable`)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(e){return oe.has(e.type)}getTools(){let e=[];for(let t of this.vertices.values())this.isToolDefinition(t)&&e.push(t);return e}getClasses(){return this.classes}setupToolTips(t){let n=k();r(t).select(`svg`).selectAll(`g.node`).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(a===null)return;let o=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.text(i.attr(`title`)).style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),n.html(e.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})}clear(e=`gen-2`){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=m(),this.diagramId=``,this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,s()}setGen(e){this.version=e||`gen-2`}defaultStyle(){return`fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;`}addSubGraph(e,r,i,a){let o=e?.text?.trim(),s=i?.text;e===i&&i?.text&&/\s/.exec(i.text)&&(o=void 0);let c=t(e=>{let t={boolean:{},number:{},string:{}},n=[],r;return{nodeList:e.filter(function(e){let i=typeof e;return e.stmt&&e.stmt===`dir`?(r=e.value,!1):e.trim()===``?!1:i in t?t[i].hasOwnProperty(e)?!1:t[i][e]=!0:!n.includes(e)&&n.push(e)}),dir:r}},`uniq`)(r.flat()),l=c.nodeList,u=c.dir,d=m().flowchart??{};if(u??=d.inheritDir?this.getDirection()??m().direction??void 0:void 0,this.version===`gen-1`)for(let e=0;ee!==o&&!this.globalNodes.has(e)),title:s.trim(),classes:[],dir:u,labelType:this.sanitizeNodeLabelType(i?.type),type:a??`flow`};n.info(`Adding`,f.id,f.nodes,f.dir),f.nodes=this.makeUniq(f,this.subGraphs).nodes;let p=this.getPosForId(o);if(p!==-1){let e=this.subGraphs[p];for(let t of f.nodes)e.nodes.includes(t)||e.nodes.push(t);f.title&&(e.title=f.title),f.dir&&(e.dir=f.dir),f.type&&(e.type=f.type),this.subGraphLookup.set(o,e)}else this.subGraphs.push(f),this.subGraphLookup.set(o,f);return o}addGlobal(e){for(let t of e.flat()){if(typeof t!=`string`)continue;let e=t.trim();e!==``&&this.globalNodes.add(e)}for(let e of this.subGraphs)e.nodes=e.nodes.filter(e=>!this.globalNodes.has(e))}getPosForId(e){for(let[t,n]of this.subGraphs.entries())if(n.id===e)return t;return-1}indexNodes2(e,t){let n=this.subGraphs[t].nodes;if(this.secCount+=1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let r=0,i=1;for(;r=0){let n=this.indexNodes2(e,t);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2(`none`,this.subGraphs.length-1)}addConnector(e,t){let n=e?.text?.trim();if(!n)return``;let r=t?.text?.trim()??``,i=r.length>0?this.sanitizeText(r):n,a=this.connectors.get(n);return a?r.length>0&&(a.text=i):(a={id:n,labelType:`text`,domId:ie+n+`-`+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:i},this.connectors.set(n,a),this.vertices.set(n,a),this.vertexCounter++),n}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}computeEdgeSemantic(e,t){if(e===`arrow_point`&&t===`normal`)return`sequence`;if(e===`arrow_cross`&&t===`normal`)return`failure`;if(e===`arrow_open`&&t===`dotted`)return`reference`}destructStartLink(e){let t=e.trim(),n=`normal`;return t.includes(`.`)&&(n=`dotted`),{type:`arrow_open`,stroke:n}}countChar(e,t){let n=t.length,r=0;for(let i=0;i`:r=`arrow_point`;break;case`-`:case`.`:r=`arrow_open`,n=t}let i=`normal`,a=n.length-1,o=this.countChar(`.`,n);return o>0&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}destructLink(e,t){let n=this.destructEndLink(e),r;return t?(r=this.destructStartLink(t),r.stroke===n.stroke?(r.type=n.type,r.length=n.length,{...r,edgeSemantic:this.computeEdgeSemantic(r.type,r.stroke)}):{type:`INVALID`,stroke:`INVALID`}):{...n,edgeSemantic:this.computeEdgeSemantic(n.type,n.stroke)}}exists(e,t){for(let n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){let n=[];return e.nodes.forEach((r,i)=>{this.exists(t,r)||n.push(e.nodes[i])}),{nodes:n}}getTypeFromVertex(e){let t=typeof e.type==`string`?I(e.type):e.type;switch(t){case`square`:case void 0:return`squareRect`;case`round`:return`roundedRect`;case`ellipse`:return`ellipse`;default:return t}}findNode(e,t){return e.find(e=>e.id===t)}destructEdgeType(e){let t=`none`,n=`arrow_point`;switch(e){case`arrow_point`:case`arrow_circle`:case`arrow_cross`:case`arrow_hierarchy`:n=e;break;case`double_arrow_point`:case`double_arrow_circle`:case`double_arrow_cross`:t=e.replace(`double_`,``),n=t}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,a){let o=n.get(e.id),s=r.get(e.id)??!1,c=this.findNode(t,e.id);if(c)c.cssStyles=e.styles,c.cssCompiledStyles=this.getCompiledStyles(e.classes),c.cssClasses=e.classes.join(` `);else{let n={id:e.id,label:e.text,labelType:e.labelType,labelStyle:``,parentId:o,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles([`default`,`node`,...e.classes]),cssClasses:`default `+e.classes.join(` `),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),metadata:e.metadata};s?t.push({...n,isGroup:!0,shape:`rect`}):t.push({...n,isGroup:!1,shape:this.getTypeFromVertex(e),wrappingWidth:i.agentflow?.wrappingWidth,minWidth:i.agentflow?.minNodeWidth})}}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}runPostParseValidators(){this.postParseValidationRun||=!0}getData(){this.runPostParseValidators();let e=m(),n=[],r=[],i=this.getSubGraphs(),a=new Map,o=new Map,s=new Set,c=new Map,l=t((e,t,n=new Set)=>{if(n.has(e))return;n.add(e);let r=this.subGraphLookup.get(e);if(r)for(let e of r.nodes)e===t||n.has(e)||(s.add(e),c.set(e,t),l(e,t,n))},`collectDescendants`);for(let e of i)e.metadata?.view===`collapsed`&&!s.has(e.id)&&l(e.id,e.id);let u=t((e,t)=>{let n=new Set,r=t;for(;r!==void 0&&!n.has(r);){if(r===e)return!0;n.add(r),r=a.get(r)}return!1},`wouldCloseContainmentCycle`);for(let e=i.length-1;e>=0;e--){let t=i[e];if(!s.has(t.id)){t.nodes.length>0&&o.set(t.id,!0);for(let e of t.nodes){if(u(e,t.id)){this.emitWarning(M.CONTAINMENT_VIOLATION,`Container "${t.id}" cannot contain "${e}" because "${e}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:e});continue}a.set(e,t.id)}}}for(let t=i.length-1;t>=0;t--){let r=i[t];if(!s.has(r.id))if(r.metadata?.view===`collapsed`){let t={...r.metadata,containerType:r.type};n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:`collapsedGroup`,dir:r.dir,isGroup:!1,look:e.look,metadata:t})}else n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:se[r.type??`flow`],dir:r.dir,isGroup:!0,look:e.look,metadata:r.metadata})}this.getVertices().forEach(t=>{s.has(t.id)||this.addNodeFromVertex(t,n,a,o,e,e.look||`classic`)});let d=this.getEdges();d.forEach((t,n)=>{let i=c.get(t.start)??t.start,a=c.get(t.end)??t.end;if(i===a&&t.start!==t.end)return;let{arrowTypeStart:o,arrowTypeEnd:s}=this.destructEdgeType(t.type),l=[...d.defaultStyle??[]];t.style&&l.push(...t.style);let u={id:_(i,a,{counter:n,prefix:`L`},t.id),isUserDefinedId:t.isUserDefinedId,start:i,end:a,type:t.type??`normal`,label:t.text,labelType:t.labelType,labelpos:`c`,thickness:t.stroke,minlen:t.length,classes:t?.stroke===`invisible`?``:`edge-thickness-normal edge-pattern-solid flowchart-link`,arrowTypeStart:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:o,arrowTypeEnd:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:s,arrowheadStyle:`fill: #333`,cssCompiledStyles:this.getCompiledStyles(t.classes),labelStyle:l,style:l,pattern:t.stroke,look:e.look,animate:t.animate,animation:t.animation,curve:t.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve,metadata:t.metadata};r.push(u)}),ne(n,this);let f=new Map,p=new Map;for(let e of i){let t=a.get(e.id);t!==void 0&&p.set(t,[...p.get(t)??[],e.id])}let h=0,g=t(e=>{if(!f.has(e)){f.set(e,h++);for(let t of p.get(e)??[])g(t)}},`walkContainers`);for(let e of i)a.get(e.id)===void 0&&g(e.id);let v=new Set(this.getConnectors().map(e=>e.id));return re(n,e=>{if(v.has(e))return`connector`;let t=this.vertices.get(e);return t?this.deriveVertexKind(t,I(t.type)):void 0},f),{nodes:n,edges:r,other:{},config:e,connectors:this.getConnectors()}}defaultConfig(){return c.flowchart}deriveVertexKind(e,t){return this.isToolDefinition(e)?`tool`:t===`hexagon`||t===`hex`?`action`:t===`lean-right`||t===`lean_right`?`input`:t===`lin-doc`||t===`lined-document`?`refdoc`:t===`diamond`?`decision`:`task`}getSemanticModel(){this.runPostParseValidators();let e=new Set(this.subGraphs.map(e=>e.id)),t=[],n=[];for(let[r,i]of this.vertices){if(e.has(r))continue;if(i.isConnector){let e={id:r};if(i.text!==void 0&&i.text!==r&&(e.title=i.text),i.metadata&&Object.keys(i.metadata).length>0){let t={};for(let[e,n]of Object.entries(i.metadata))ae.has(e)||(t[e]=n);Object.keys(t).length>0&&(e.metadata=t)}n.push(e);continue}let a={id:r};i.text!==void 0&&(a.label=i.text);let o=typeof i.type==`string`?I(i.type):i.type;if(o!==void 0&&(a.shape=o),a.vertexKind=this.deriveVertexKind(i,o),i.metadata&&Object.keys(i.metadata).length>0){let e={};for(let[t,n]of Object.entries(i.metadata))ae.has(t)||(e[t]=n);Object.keys(e).length>0&&(a.metadata=e)}t.push(a)}let r={vertices:t,edges:this.edges.map(e=>{let t={start:e.start,end:e.end};return e.id!==void 0&&(t.id=e.id),typeof e.text==`string`&&e.text.length>0&&(t.label=e.text),e.type!==void 0&&(t.type=e.type),e.stroke!==void 0&&(t.stroke=e.stroke),e.edgeSemantic!==void 0&&(t.edgeSemantic=e.edgeSemantic),e.length!==void 0&&(t.length=e.length),e.metadata&&Object.keys(e.metadata).length>0&&(t.metadata={...e.metadata}),t}),subGraphs:this.subGraphs.map(e=>{let t={id:e.id,nodes:[...e.nodes]};if(e.type!==void 0&&(t.type=e.type),e.title!==void 0&&(t.title=e.title),e.dir!==void 0&&(t.direction=e.dir),e.metadata&&Object.keys(e.metadata).length>0){let n={};for(let[t,r]of Object.entries(e.metadata))ae.has(t)||(n[t]=r);Object.keys(n).length>0&&(t.metadata=n)}return t}),connectors:n,diagnostics:this.diagnostics};return this.direction!==void 0&&(r.direction=this.direction),r}setFrontmatterLineOffset(e){this.frontmatterLineOffset=e??0}toElementPosition(e){let t=e?.first_line??0,n=e?.first_column??0,r=e?.last_line??t,i=e?.last_column??n,[a,o]=e?.range??[0,0];return{startLine:t+this.frontmatterLineOffset,startColumn:n,endLine:r+this.frontmatterLineOffset,endColumn:i,startIndex:a,endIndex:o}}pushMapping(e,t,n){if(!e)return;let r={id:e,type:t,position:this.toElementPosition(n)};return this.elementMappings.push(r),r}addVertexMapping(e,t,n,r){let i=this.pushMapping(e,`vertex`,r);i&&n==null&&this.bareVertexMappings.add(i)}extendVertexMapping(e,t){if(!e||!t)return;let n=this.toElementPosition(t);for(let t=this.elementMappings.length-1;t>=0;t--){let r=this.elementMappings[t];if(r.type===`vertex`&&r.id===e){this.bareVertexMappings.has(r)&&(r.type=`attachment`,this.bareVertexMappings.delete(r)),(n.endLine>r.position.endLine||n.endLine===r.position.endLine&&n.endColumn>r.position.endColumn)&&(r.position.endLine=n.endLine,r.position.endColumn=n.endColumn,r.position.endIndex=n.endIndex);return}}this.pushMapping(e,`attachment`,t)}addEdgeMapping(e,t,n,r){let i=Array.isArray(t)?t.map(e=>typeof e==`string`?e:e?.id??``).filter(Boolean):[],a=i.length>0?i.join(`>`):`edge`;this.pushMapping(a,`edge`,r)}addSubgraphMapping(e,t,n,r){let i=(typeof e==`string`?e:e?.text)??``,a=this.toElementPosition(n),o=r?this.toElementPosition(r):a;i&&this.elementMappings.push({id:i,type:`subgraph`,position:{startLine:a.startLine,startColumn:a.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:a.startIndex,endIndex:o.endIndex}})}addConnectorMapping(e,t,n,r){let i=e?.text?.trim()??``;if(!i)return;let a=this.toElementPosition(n),o=r?this.toElementPosition(r):a;this.elementMappings.push({id:i,type:`connector`,position:{startLine:a.startLine,startColumn:a.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:a.startIndex,endIndex:o.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(e){return this.elementMappings.find(t=>t.id===e)}getElementsOnLine(e){return this.elementMappings.filter(t=>e>=t.position.startLine&&e<=t.position.endLine)}getElementAtPosition(e,n){let r=this.elementMappings.filter(t=>{let{startLine:r,startColumn:i,endLine:a,endColumn:o}=t.position;return!(ea||e===r&&no)});if(r.length===0)return;let i=t(({position:e})=>[e.endLine-e.startLine,e.endColumn-e.startColumn],`span`);return r.reduce((e,t)=>{let[n,r]=i(e),[a,o]=i(t);return a===n?oe.id===s.id&&e.severity===s.severity&&e.message===s.message&&e.nodeId===s.nodeId&&e.edgeId===s.edgeId))return;this.diagnostics.push(s);let c=`agentflow[${e}]: ${r}`;t===`error`?n.error(c):n.warn(c)}emitWarning(e,t,n){this.emitDiagnostic(e,`warning`,t,n)}emitError(e,t,n){this.emitDiagnostic(e,`error`,t,n)}getDiagnostics(){return[...this.diagnostics]}},de={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.debug(`Drawing agentflow diagram`,t);let{securityLevel:a,agentflow:o,layout:s}=m();i.db.setDiagramId(t),n.debug(`Before getData: `);let c=i.db.getData();n.debug(`Data: `,c);let l=A(t,a),u=i.db.getDirection();c.type=i.type,c.layoutAlgorithm=D(s),c.layoutAlgorithm===`dagre`&&s===`elk`&&n.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),c.direction=u,c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=[`point`,`circle`,`cross`,`hierarchy`],c.diagramId=t,n.debug(`REF1:`,c),await E(c,l);let d=o?.diagramPadding??8;v.insertTitle(l,`agentflowTitleText`,o?.titleTopMargin??0,i.db.getDiagramTitle()),j(l,d,`agentflow`,o?.useMaxWidth??!0)},`draw`)},fe=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,5],r=[1,4],i=[1,3],a=[1,6],o=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],s=[2,2],c=[1,15],l=[1,16],u=[1,17],d=[1,18],f=[1,19],p=[1,26],m=[1,27],h=[1,28],g=[1,30],_=[1,31],v=[1,32],y=[1,55],b=[1,54],x=[1,34],S=[1,35],C=[1,36],w=[1,37],T=[1,38],E=[1,50],D=[1,52],O=[1,48],k=[1,53],A=[1,49],j=[1,56],M=[1,51],N=[1,57],P=[1,58],ee=[1,39],te=[1,40],F=[1,41],I=[1,42],ne=[1,43],L=[1,64],R=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],z=[1,70],B=[1,68],V=[1,67],H=[1,69],re=[8,9,10,12,78,80,81],ie=[1,88],ae=[1,101],oe=[1,106],se=[1,105],ce=[1,102],le=[1,98],ue=[1,104],de=[1,100],fe=[1,107],pe=[1,103],me=[1,108],he=[1,99],ge=[8,9,10,11,12,43,78,80,81],U=[8,9,10,11,12,43,49,78,80,81],W=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],_e=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],ve=[47,63,92,105,108,109,112,114,117,118,119],ye=[1,131],be=[1,132],xe=[1,134],Se=[1,133],Ce=[47,63,65,77,92,105,108,109,112,114,117,118,119],we=[1,143],Te=[1,157],Ee=[1,158],De=[1,159],Oe=[1,162],ke=[1,161],Ae=[1,160],je=[1,145],Me=[1,147],Ne=[1,151],Pe=[1,139],Fe=[1,140],Ie=[1,152],Le=[1,153],Re=[1,154],ze=[1,155],Be=[1,156],Ve=[1,163],He=[1,164],Ue=[1,141],We=[1,142],Ge=[1,149],Ke=[1,144],qe=[1,148],Je=[1,146],Ye=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],Xe=[1,168],Ze=[1,170],G=[8,9,10,12],K=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],q=[1,190],J=[1,186],Y=[1,187],X=[1,191],Z=[1,188],Q=[1,189],Qe=[80,119,122],$=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],$e=[11,109],et=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],tt=[1,269],nt=[1,267],rt=[1,271],it=[1,265],at=[1,266],ot=[1,268],st=[1,270],ct=[1,272],lt=[1,292],ut=[8,9,10,12,109],dt=[8,9,10,11,12,63,87,108,109,112,113,114,115],ft={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:`error`,8:`COMMENT`,9:`SEMI`,10:`NEWLINE`,11:`SPACE`,12:`EOF`,13:`GRAPH`,14:`NODIR`,15:`DIR`,28:`flow`,30:`SQS`,32:`SQE`,33:`end`,35:`global`,36:`connector`,38:`acc_title`,39:`acc_title_value`,40:`acc_descr`,41:`acc_descr_value`,42:`acc_descr_multiline_value`,43:`SHAPE_DATA`,47:`AMP`,49:`STYLE_SEPARATOR`,51:`DOUBLECIRCLESTART`,52:`DOUBLECIRCLEEND`,53:`PS`,54:`PE`,55:`(-`,56:`-)`,57:`STADIUMSTART`,58:`STADIUMEND`,59:`SUBROUTINESTART`,60:`SUBROUTINEEND`,61:`VERTEX_WITH_PROPS_START`,62:`NODE_STRING[field]`,63:`COLON`,64:`NODE_STRING[value]`,65:`PIPE`,66:`CYLINDERSTART`,67:`CYLINDEREND`,68:`DIAMOND_START`,69:`DIAMOND_STOP`,70:`TAGEND`,71:`TRAPSTART`,72:`TRAPEND`,73:`INVTRAPSTART`,74:`INVTRAPEND`,77:`TESTSTR`,78:`START_LINK`,80:`LINK`,81:`LINK_ID`,83:`STR`,84:`MD_STR`,87:`STYLE`,88:`LINKSTYLE`,89:`CLASSDEF`,90:`CLASS`,91:`CLICK`,92:`DOWN`,93:`UP`,96:`idString[vertex]`,97:`idString[class]`,98:`CALLBACKNAME`,99:`CALLBACKARGS`,100:`HREF`,101:`LINK_TARGET`,102:`STR[link]`,103:`STR[tooltip]`,105:`DEFAULT`,107:`INTERPOLATE`,108:`NUM`,109:`COMMA`,112:`NODE_STRING`,113:`UNIT`,114:`BRKT`,115:`PCT`,117:`MINUS`,118:`MULT`,119:`UNICODE_TEXT`,120:`TEXT`,121:`TAGSTART`,122:`EDGE_TEXT`,124:`direction_tb`,125:`direction_bt`,126:`direction_rl`,127:`direction_lr`,128:`direction_td`},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:(!Array.isArray(a[s])||a[s].length>0)&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 198:this.$=a[s];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:r.setDirection(`TB`),this.$=`TB`;break;case 14:r.setDirection(a[s-1]),this.$=a[s-1];break;case 32:this.$=a[s-1].nodes;break;case 38:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4],`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-6],a[s-4],o[s-8],o[s]);break;case 39:this.$=r.addSubGraph(a[s-7],a[s-1],a[s-5],`flow`),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-3],o[s-3]),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-7],a[s-5],o[s-9],o[s]);break;case 40:this.$=r.addSubGraph(a[s-3],a[s-1],{text:``,type:`text`},`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-3],{text:``,type:`text`},o[s-5],o[s]);break;case 41:this.$=r.addSubGraph(a[s-4],a[s-1],{text:``,type:`text`},`flow`),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-3],o[s-3]),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-4],{text:``,type:`text`},o[s-6],o[s]);break;case 42:this.$=r.addSubGraph(void 0,a[s-1],void 0,`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(void 0,void 0,o[s-3],o[s]);break;case 43:r.addGlobal(a[s-1]),this.$=[];break;case 44:this.$=r.addConnector(a[s-4],a[s-2]),r.addConnectorMapping&&r.addConnectorMapping(a[s-4],a[s-2],o[s-6],o[s]);break;case 45:this.$=r.addConnector(a[s-5],a[s-3]),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-1],o[s-1]),r.addConnectorMapping&&r.addConnectorMapping(a[s-5],a[s-3],o[s-7],o[s]);break;case 46:this.$=r.addConnector(a[s-1],{text:``,type:`text`}),r.addConnectorMapping&&r.addConnectorMapping(a[s-1],{text:``,type:`text`},o[s-3],o[s]);break;case 47:this.$=r.addConnector(a[s-2],{text:``,type:`text`}),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-1],o[s-1]),r.addConnectorMapping&&r.addConnectorMapping(a[s-2],{text:``,type:`text`},o[s-4],o[s]);break;case 49:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 50:case 51:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 56:this.$=a[s-1]+a[s];break;case 57:this.$=a[s];break;case 58:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s],o[s]),r.extendVertexMapping&&r.extendVertexMapping(a[s-1][a[s-1].length-1],o[s]),r.addLink(a[s-3].stmt,a[s-1],a[s-2]),r.addEdgeMapping&&r.addEdgeMapping(a[s-3].stmt,a[s-1],a[s-2],this._$),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 59:r.addLink(a[s-2].stmt,a[s],a[s-1]),r.addEdgeMapping&&r.addEdgeMapping(a[s-2].stmt,a[s],a[s-1],this._$),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 60:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),r.addEdgeMapping&&r.addEdgeMapping(a[s-3].stmt,a[s-1],a[s-2],this._$),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 61:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 62:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s],o[s]),r.extendVertexMapping&&r.extendVertexMapping(a[s-1][a[s-1].length-1],o[s]),this.$={stmt:a[s-1],nodes:a[s-1],shapeData:a[s]};break;case 63:this.$={stmt:a[s],nodes:a[s]};break;case 64:this.$=[a[s]];break;case 65:r.addVertex(a[s-5][a[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s-4],o[s-4]),r.extendVertexMapping&&r.extendVertexMapping(a[s-5][a[s-5].length-1],o[s-4]),this.$=a[s-5].concat(a[s]);break;case 66:this.$=a[s-4].concat(a[s]);break;case 67:this.$=a[s];break;case 68:this.$=a[s-2],r.setClass(a[s-2],a[s]);break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`square`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`square`,this._$);break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`doublecircle`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`doublecircle`,this._$);break;case 71:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`circle`),r.addVertexMapping&&r.addVertexMapping(a[s-5],a[s-2],`circle`,this._$);break;case 72:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`ellipse`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`ellipse`,this._$);break;case 73:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`stadium`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`stadium`,this._$);break;case 74:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`subroutine`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`subroutine`,this._$);break;case 75:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],`rect`,void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]])),r.addVertexMapping&&r.addVertexMapping(a[s-7],a[s-1],`rect`,this._$);break;case 76:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`cylinder`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`cylinder`,this._$);break;case 77:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`round`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`round`,this._$);break;case 78:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`diamond`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`diamond`,this._$);break;case 79:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`hexagon`),r.addVertexMapping&&r.addVertexMapping(a[s-5],a[s-2],`hexagon`,this._$);break;case 80:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`odd`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`odd`,this._$);break;case 81:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`trapezoid`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`trapezoid`,this._$);break;case 82:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`inv_trapezoid`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`inv_trapezoid`,this._$);break;case 83:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_right`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`lean_right`,this._$);break;case 84:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_left`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`lean_left`,this._$);break;case 85:this.$=a[s],r.addVertex(a[s]),r.addVertexMapping&&r.addVertexMapping(a[s],void 0,void 0,this._$);break;case 86:a[s-1].text=a[s],this.$=a[s-1];break;case 87:case 88:a[s-2].text=a[s-1],this.$=a[s-2];break;case 89:this.$=a[s];break;case 90:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,text:a[s-1]};break;case 91:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,text:a[s-1],id:a[s-3]};break;case 92:this.$={text:a[s],type:`text`};break;case 93:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 94:this.$={text:a[s],type:`string`};break;case 95:this.$={text:a[s],type:`markdown`};break;case 96:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic};break;case 97:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,id:a[s-1]};break;case 98:this.$=a[s-1];break;case 99:this.$={text:a[s],type:`text`};break;case 100:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 101:this.$={text:a[s],type:`string`};break;case 102:case 119:this.$={text:a[s],type:`markdown`};break;case 116:this.$={text:a[s],type:`text`};break;case 117:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 118:this.$={text:a[s],type:`text`};break;case 120:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 121:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 122:case 130:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 123:case 131:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 124:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 125:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 126:this.$=a[s-2],r.setLink(a[s-2],a[s]);break;case 127:this.$=a[s-4],r.setLink(a[s-4],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 128:this.$=a[s-4],r.setLink(a[s-4],a[s-2],a[s]);break;case 129:this.$=a[s-6],r.setLink(a[s-6],a[s-4],a[s]),r.setTooltip(a[s-6],a[s-2]);break;case 132:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 133:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 134:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 135:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 136:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 137:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 138:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 139:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 140:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 141:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 142:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 143:case 145:this.$=[a[s]];break;case 144:case 146:a[s-2].push(a[s]),this.$=a[s-2];break;case 148:this.$=a[s-1]+a[s];break;case 196:this.$=a[s];break;case 197:this.$=a[s-1]+``+a[s];break;case 199:this.$=a[s-1]+``+a[s];break;case 200:this.$={stmt:`dir`,value:`TB`};break;case 201:this.$={stmt:`dir`,value:`BT`};break;case 202:this.$={stmt:`dir`,value:`RL`};break;case 203:this.$={stmt:`dir`,value:`LR`};break;case 204:this.$={stmt:`dir`,value:`TD`}}},`anonymous`),table:[{3:1,4:2,8:n,10:r,11:i,13:a},{1:[3]},e(o,s,{5:7}),{4:8,8:n,10:r,11:i,13:a},{4:9,8:n,10:r,11:i,13:a},{4:10,8:n,10:r,11:i,13:a},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(o,[2,10]),e(o,[2,11]),e(o,[2,12]),e(o,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:L,16:59,19:62},e(R,[2,3]),e(R,[2,4]),e(R,[2,5]),e(R,[2,6]),e(R,[2,7]),e(R,[2,8]),e(R,[2,9]),{8:z,9:B,10:V,12:H,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:z,9:B,10:V,12:H,22:75},{8:z,9:B,10:V,12:H,22:76},{8:z,9:B,10:V,12:H,22:77},{8:z,9:B,10:V,12:H,22:78},{8:z,9:B,10:V,12:H,22:79},{8:z,9:B,10:V,11:[1,80],12:H,22:81},{8:z,9:B,10:V,12:H,22:82},{11:[1,83]},e(R,[2,48]),{39:[1,84]},{41:[1,85]},e(R,[2,51]),e(re,[2,63],{19:86,34:87,11:L,43:ie}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:ae,47:oe,63:se,83:[1,96],92:ce,98:[1,93],100:[1,94],104:95,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},e(R,[2,200]),e(R,[2,201]),e(R,[2,202]),e(R,[2,203]),e(R,[2,204]),e(ge,[2,64]),e(ge,[2,67],{49:[1,109]}),e(U,[2,85],{116:122,30:[1,110],47:y,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:b,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),e(W,[2,196]),e(W,[2,157]),e(W,[2,158]),e(W,[2,159]),e(W,[2,160]),e(W,[2,161]),e(W,[2,162]),e(W,[2,163]),e(W,[2,164]),e(W,[2,165]),e(W,[2,166]),e(W,[2,167]),e(o,[2,14]),e(o,[2,20]),e(o,[2,21]),{10:[1,123]},e(o,[2,23]),e(_e,[2,31],{19:124,11:L}),e(R,[2,32]),{45:125,46:44,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(R,[2,52]),e(R,[2,53]),e(R,[2,54]),e(R,[2,55]),e(ve,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:ye,84:be,119:xe,122:Se},{78:[1,135],80:[1,136]},e(Ce,[2,96]),e(R,[2,33]),e(R,[2,34]),e(R,[2,35]),e(R,[2,36]),e(R,[2,37]),{11:we,13:Te,15:Ee,28:De,29:137,33:Oe,35:ke,36:Ae,47:je,63:Me,78:Ne,83:Pe,84:Fe,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:138,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e(Ye,s,{5:165}),e(Ye,s,{5:166}),{11:we,13:Te,15:Ee,28:De,29:167,33:Oe,35:ke,36:Ae,47:je,63:Me,78:Ne,83:Pe,84:Fe,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:138,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e(R,[2,49]),e(R,[2,50]),e(re,[2,61],{47:Xe}),e(re,[2,62],{19:169,11:L,43:Ze}),e(ge,[2,57]),{47:y,50:171,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{105:[1,172],106:173,108:[1,174]},{47:y,50:175,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{47:y,50:176,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},e(G,[2,130],{123:181,11:[1,180],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,132],{11:[1,182]}),e(K,[2,198]),e(K,[2,185]),e(K,[2,186]),e(K,[2,187]),e(K,[2,188]),e(K,[2,189]),e(K,[2,190]),e(K,[2,191]),e(K,[2,192]),e(K,[2,193]),e(K,[2,194]),e(K,[2,195]),{47:y,50:183,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{31:184,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:192,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:194,53:[1,193],70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:195,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:196,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:197,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{112:[1,198]},{31:199,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:200,68:[1,201],70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:202,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:203,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:204,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(W,[2,197]),e(o,[2,22]),e(_e,[2,30]),e(re,[2,59],{34:205,19:206,11:L,43:ie}),e(ve,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{80:[1,210],82:211,119:xe,122:Se},e(Qe,[2,92]),e(Qe,[2,94]),e(Qe,[2,95]),e(Qe,[2,183]),e(Qe,[2,184]),{79:212,82:130,83:ye,84:be,119:xe,122:Se},e(Ce,[2,97]),{8:z,9:B,10:V,11:we,12:H,13:Te,15:Ee,22:214,28:De,30:[1,213],33:Oe,34:215,35:ke,36:Ae,43:ie,47:je,63:Me,78:Ne,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:216,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e($,[2,116]),e($,[2,118]),e($,[2,119]),e($,[2,172]),e($,[2,173]),e($,[2,174]),e($,[2,175]),e($,[2,176]),e($,[2,177]),e($,[2,178]),e($,[2,179]),e($,[2,180]),e($,[2,181]),e($,[2,182]),e($,[2,103]),e($,[2,104]),e($,[2,105]),e($,[2,106]),e($,[2,107]),e($,[2,108]),e($,[2,109]),e($,[2,110]),e($,[2,111]),e($,[2,112]),e($,[2,113]),e($,[2,114]),e($,[2,115]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,217],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,218],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{8:z,9:B,10:V,11:we,12:H,13:Te,15:Ee,22:220,28:De,30:[1,219],33:Oe,34:221,35:ke,36:Ae,43:ie,47:je,63:Me,78:Ne,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:216,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},{11:L,19:222},{47:[1,223]},e(ge,[2,56]),{11:[1,224],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{11:[1,225]},{11:[1,226],109:[1,227]},e($e,[2,143]),{11:[1,228],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{11:[1,229],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{83:[1,230]},e(G,[2,124],{11:[1,231]}),e(G,[2,126],{11:[1,232]}),{83:[1,233]},e(K,[2,199]),{83:[1,234],101:[1,235]},e(ge,[2,68],{116:122,47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),{32:[1,236],70:q,85:237,119:X,120:Z,121:Q},e(et,[2,99]),e(et,[2,101]),e(et,[2,102]),e(et,[2,168]),e(et,[2,169]),e(et,[2,170]),e(et,[2,171]),{52:[1,238],70:q,85:237,119:X,120:Z,121:Q},{31:239,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{54:[1,240],70:q,85:237,119:X,120:Z,121:Q},{56:[1,241],70:q,85:237,119:X,120:Z,121:Q},{58:[1,242],70:q,85:237,119:X,120:Z,121:Q},{60:[1,243],70:q,85:237,119:X,120:Z,121:Q},{63:[1,244]},{67:[1,245],70:q,85:237,119:X,120:Z,121:Q},{69:[1,246],70:q,85:237,119:X,120:Z,121:Q},{31:247,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{32:[1,248],70:q,85:237,119:X,120:Z,121:Q},{70:q,72:[1,249],74:[1,250],85:237,119:X,120:Z,121:Q},{70:q,72:[1,252],74:[1,251],85:237,119:X,120:Z,121:Q},e(re,[2,58],{19:169,11:L,43:Ze}),e(re,[2,60],{47:Xe}),e(ve,[2,88]),e(ve,[2,87]),{65:[1,253],70:q,85:237,119:X,120:Z,121:Q},e(ve,[2,90]),e(Qe,[2,93]),{80:[1,254],82:211,119:xe,122:Se},{31:255,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(Ye,s,{5:256}),{8:z,9:B,10:V,12:H,22:257,43:Ze},e($,[2,117]),e(R,[2,42]),e(R,[2,43]),{31:258,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(R,[2,46]),{8:z,9:B,10:V,12:H,22:259,43:Ze},{46:260,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{11:L,19:261},{11:tt,63:nt,87:rt,95:262,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:273,107:[1,274],108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:275,107:[1,276],108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{108:[1,277]},{11:tt,63:nt,87:rt,95:278,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{47:y,50:279,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},e(G,[2,131]),e(G,[2,133],{11:[1,283]}),e(G,[2,134]),e(U,[2,69]),e(et,[2,100]),e(U,[2,70]),{54:[1,284],70:q,85:237,119:X,120:Z,121:Q},e(U,[2,77]),e(U,[2,72]),e(U,[2,73]),e(U,[2,74]),{112:[1,285]},e(U,[2,76]),e(U,[2,78]),{69:[1,286],70:q,85:237,119:X,120:Z,121:Q},e(U,[2,80]),e(U,[2,81]),e(U,[2,83]),e(U,[2,82]),e(U,[2,84]),e([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),e(ve,[2,91]),{32:[1,287],70:q,85:237,119:X,120:Z,121:Q},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,288],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(Ye,s,{5:289}),{32:[1,290],70:q,85:237,119:X,120:Z,121:Q},e(R,[2,47]),e(ge,[2,66]),{46:291,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,136],{109:lt}),e(ut,[2,145],{111:293,11:tt,63:nt,87:rt,108:it,112:at,113:ot,114:st,115:ct}),e(dt,[2,147]),e(dt,[2,149]),e(dt,[2,150]),e(dt,[2,151]),e(dt,[2,152]),e(dt,[2,153]),e(dt,[2,154]),e(dt,[2,155]),e(dt,[2,156]),e(G,[2,137],{109:lt}),{11:[1,294]},e(G,[2,138],{109:lt}),{11:[1,295]},e($e,[2,144]),e(G,[2,120],{109:lt}),e(G,[2,121],{116:122,47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),e(G,[2,125]),e(G,[2,127],{11:[1,296]}),e(G,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:z,9:B,10:V,12:H,22:301,34:302,43:ie},e(R,[2,40]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,303],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{8:z,9:B,10:V,12:H,22:304,34:305,43:ie},e(ge,[2,65]),{11:tt,63:nt,87:rt,108:it,110:306,111:264,112:at,113:ot,114:st,115:ct},e(dt,[2,148]),{15:ae,47:oe,63:se,92:ce,104:307,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},{15:ae,47:oe,63:se,92:ce,104:308,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},{101:[1,309]},e(G,[2,135]),e(U,[2,71]),{31:310,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(U,[2,79]),e(Ye,s,{5:311}),{8:z,9:B,10:V,12:H,22:312,43:Ze},e(R,[2,41]),e(R,[2,44]),{8:z,9:B,10:V,12:H,22:313,43:Ze},e(ut,[2,146],{111:293,11:tt,63:nt,87:rt,108:it,112:at,113:ot,114:st,115:ct}),e(G,[2,141],{123:181,11:[1,314],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,142],{123:181,11:[1,315],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,129]),{32:[1,316],70:q,85:237,119:X,120:Z,121:Q},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,317],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(Ye,s,{5:318}),e(R,[2,45]),{11:tt,63:nt,87:rt,95:319,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:320,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},e(U,[2,75]),e(R,[2,38]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,321],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(G,[2,139],{109:lt}),e(G,[2,140],{109:lt}),e(R,[2,39])],defaultActions:{},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +You have to call mermaid.initialize.`)}isLinkData(e){return typeof e==`object`&&!!e&&`id`in e&&typeof e.id==`string`}addLink(e,t,r){let i=this.isLinkData(r)?r.id.replace(`@`,``):void 0;n.info(`addLink`,e,t,i);for(let n of e)for(let a of t){let o=n===e[e.length-1],s=a===t[0];o&&s?this.addSingleLink(n,a,r,i):this.addSingleLink(n,a,r,void 0)}}updateLinkInterpolate(e,t){e.forEach(e=>{if(e==="default"){this.edges.defaultInterpolate=t;return}if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[e].interpolate=t})}updateLink(e,t){e.forEach(e=>{if(typeof e==`number`&&e>=this.edges.length)throw Error(`The index ${e} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);e==="default"?this.edges.defaultStyle=t:(this.edges[e].style=t,(this.edges[e]?.style?.length??0)>0&&!this.edges[e]?.style?.some(e=>e?.startsWith(`fill`))&&this.edges[e]?.style?.push(`fill:none`))})}addClass(e,t){let n=t.join().replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);e.split(`,`).forEach(e=>{let t=this.classes.get(e);t===void 0&&(t={id:e,styles:[],textStyles:[]},this.classes.set(e,t)),n?.forEach(e=>{if(/color/.exec(e)){let n=e.replace(`fill`,`bgFill`);t.textStyles.push(n)}t.styles.push(e)})})}setDirection(e){this.direction=e.trim(),/.*/.exec(this.direction)&&(this.direction=`LR`),/.*v/.exec(this.direction)&&(this.direction=`TB`),this.direction===`TD`&&(this.direction=`TB`)}setClass(e,t){for(let n of e.split(`,`)){let e=this.vertices.get(n);e&&e.classes.push(t);let r=this.edges.find(e=>e.id===n);r&&r.classes.push(t);let i=this.subGraphLookup.get(n);i&&i.classes.push(t)}}setTooltip(e,t){if(t!==void 0){t=this.sanitizeText(t);for(let n of e.split(`,`))this.tooltips.set(this.version===`gen-1`?this.lookUpDomId(n):n,t)}}setClickFun(e,t,n){if(m().securityLevel!==`loose`||t===void 0)return;let r=[];if(typeof n==`string`){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let e=0;e{let n=this.lookUpDomId(e),i=document.querySelector(`[id="${n}"]`);i!==null&&i.addEventListener(`click`,()=>{v.runFunc(t,...r)},!1)}))}setLink(e,t,n){e.split(`,`).forEach(e=>{let r=this.vertices.get(e);r!==void 0&&(r.link=v.formatUrl(t,this.config),r.linkTarget=n)}),this.setClass(e,`clickable`)}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,t,n){e.split(`,`).forEach(e=>{this.setClickFun(e,t,n)}),this.setClass(e,`clickable`)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(e){return oe.has(e.type)}getTools(){let e=[];for(let t of this.vertices.values())this.isToolDefinition(t)&&e.push(t);return e}getClasses(){return this.classes}setupToolTips(t){let n=T();r(t).select(`svg`).selectAll(`g.node`).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(a===null)return;let o=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.text(i.attr(`title`)).style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),n.html(e.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})}clear(e=`gen-2`){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=m(),this.diagramId=``,this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,s()}setGen(e){this.version=e||`gen-2`}defaultStyle(){return`fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;`}addSubGraph(e,r,i,a){let o=e?.text?.trim(),s=i?.text;e===i&&i?.text&&/\s/.exec(i.text)&&(o=void 0);let c=t(e=>{let t={boolean:{},number:{},string:{}},n=[],r;return{nodeList:e.filter(function(e){let i=typeof e;return e.stmt&&e.stmt===`dir`?(r=e.value,!1):e.trim()===``?!1:i in t?t[i].hasOwnProperty(e)?!1:t[i][e]=!0:!n.includes(e)&&n.push(e)}),dir:r}},`uniq`)(r.flat()),l=c.nodeList,u=c.dir,d=m().flowchart??{};if(u??=d.inheritDir?this.getDirection()??m().direction??void 0:void 0,this.version===`gen-1`)for(let e=0;ee!==o&&!this.globalNodes.has(e)),title:s.trim(),classes:[],dir:u,labelType:this.sanitizeNodeLabelType(i?.type),type:a??`flow`};n.info(`Adding`,f.id,f.nodes,f.dir),f.nodes=this.makeUniq(f,this.subGraphs).nodes;let p=this.getPosForId(o);if(p!==-1){let e=this.subGraphs[p];for(let t of f.nodes)e.nodes.includes(t)||e.nodes.push(t);f.title&&(e.title=f.title),f.dir&&(e.dir=f.dir),f.type&&(e.type=f.type),this.subGraphLookup.set(o,e)}else this.subGraphs.push(f),this.subGraphLookup.set(o,f);return o}addGlobal(e){for(let t of e.flat()){if(typeof t!=`string`)continue;let e=t.trim();e!==``&&this.globalNodes.add(e)}for(let e of this.subGraphs)e.nodes=e.nodes.filter(e=>!this.globalNodes.has(e))}getPosForId(e){for(let[t,n]of this.subGraphs.entries())if(n.id===e)return t;return-1}indexNodes2(e,t){let n=this.subGraphs[t].nodes;if(this.secCount+=1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=t,this.subGraphs[t].id===e)return{result:!0,count:0};let r=0,i=1;for(;r=0){let n=this.indexNodes2(e,t);if(n.result)return{result:!0,count:i+n.count};i+=n.count}r+=1}return{result:!1,count:i}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2(`none`,this.subGraphs.length-1)}addConnector(e,t){let n=e?.text?.trim();if(!n)return``;let r=t?.text?.trim()??``,i=r.length>0?this.sanitizeText(r):n,a=this.connectors.get(n);return a?r.length>0&&(a.text=i):(a={id:n,labelType:`text`,domId:ie+n+`-`+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:i},this.connectors.set(n,a),this.vertices.set(n,a),this.vertexCounter++),n}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}computeEdgeSemantic(e,t){if(e===`arrow_point`&&t===`normal`)return`sequence`;if(e===`arrow_cross`&&t===`normal`)return`failure`;if(e===`arrow_open`&&t===`dotted`)return`reference`}destructStartLink(e){let t=e.trim(),n=`normal`;return t.includes(`.`)&&(n=`dotted`),{type:`arrow_open`,stroke:n}}countChar(e,t){let n=t.length,r=0;for(let i=0;i`:r=`arrow_point`;break;case`-`:case`.`:r=`arrow_open`,n=t}let i=`normal`,a=n.length-1,o=this.countChar(`.`,n);return o>0&&(i=`dotted`,a=o),{type:r,stroke:i,length:a}}destructLink(e,t){let n=this.destructEndLink(e),r;return t?(r=this.destructStartLink(t),r.stroke===n.stroke?(r.type=n.type,r.length=n.length,{...r,edgeSemantic:this.computeEdgeSemantic(r.type,r.stroke)}):{type:`INVALID`,stroke:`INVALID`}):{...n,edgeSemantic:this.computeEdgeSemantic(n.type,n.stroke)}}exists(e,t){for(let n of e)if(n.nodes.includes(t))return!0;return!1}makeUniq(e,t){let n=[];return e.nodes.forEach((r,i)=>{this.exists(t,r)||n.push(e.nodes[i])}),{nodes:n}}getTypeFromVertex(e){let t=typeof e.type==`string`?I(e.type):e.type;switch(t){case`square`:case void 0:return`squareRect`;case`round`:return`roundedRect`;case`ellipse`:return`ellipse`;default:return t}}findNode(e,t){return e.find(e=>e.id===t)}destructEdgeType(e){let t=`none`,n=`arrow_point`;switch(e){case`arrow_point`:case`arrow_circle`:case`arrow_cross`:case`arrow_hierarchy`:n=e;break;case`double_arrow_point`:case`double_arrow_circle`:case`double_arrow_cross`:t=e.replace(`double_`,``),n=t}return{arrowTypeStart:t,arrowTypeEnd:n}}addNodeFromVertex(e,t,n,r,i,a){let o=n.get(e.id),s=r.get(e.id)??!1,c=this.findNode(t,e.id);if(c)c.cssStyles=e.styles,c.cssCompiledStyles=this.getCompiledStyles(e.classes),c.cssClasses=e.classes.join(` `);else{let n={id:e.id,label:e.text,labelType:e.labelType,labelStyle:``,parentId:o,padding:i.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles([`default`,`node`,...e.classes]),cssClasses:`default `+e.classes.join(` `),dir:e.dir,domId:e.domId,look:a,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),metadata:e.metadata};s?t.push({...n,isGroup:!0,shape:`rect`}):t.push({...n,isGroup:!1,shape:this.getTypeFromVertex(e),wrappingWidth:i.agentflow?.wrappingWidth,minWidth:i.agentflow?.minNodeWidth})}}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}runPostParseValidators(){this.postParseValidationRun||=!0}getData(){this.runPostParseValidators();let e=m(),n=[],r=[],i=this.getSubGraphs(),a=new Map,o=new Map,s=new Set,c=new Map,l=t((e,t,n=new Set)=>{if(n.has(e))return;n.add(e);let r=this.subGraphLookup.get(e);if(r)for(let e of r.nodes)e===t||n.has(e)||(s.add(e),c.set(e,t),l(e,t,n))},`collectDescendants`);for(let e of i)e.metadata?.view===`collapsed`&&!s.has(e.id)&&l(e.id,e.id);let u=t((e,t)=>{let n=new Set,r=t;for(;r!==void 0&&!n.has(r);){if(r===e)return!0;n.add(r),r=a.get(r)}return!1},`wouldCloseContainmentCycle`);for(let e=i.length-1;e>=0;e--){let t=i[e];if(!s.has(t.id)){t.nodes.length>0&&o.set(t.id,!0);for(let e of t.nodes){if(u(e,t.id)){this.emitWarning(M.CONTAINMENT_VIOLATION,`Container "${t.id}" cannot contain "${e}" because "${e}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:e});continue}a.set(e,t.id)}}}for(let t=i.length-1;t>=0;t--){let r=i[t];if(!s.has(r.id))if(r.metadata?.view===`collapsed`){let t={...r.metadata,containerType:r.type};n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:`collapsedGroup`,dir:r.dir,isGroup:!1,look:e.look,metadata:t})}else n.push({id:r.id,label:r.title,labelStyle:``,labelType:r.labelType,parentId:a.get(r.id),padding:8,cssCompiledStyles:this.getCompiledStyles(r.classes),cssClasses:r.classes.join(` `),shape:se[r.type??`flow`],dir:r.dir,isGroup:!0,look:e.look,metadata:r.metadata})}this.getVertices().forEach(t=>{s.has(t.id)||this.addNodeFromVertex(t,n,a,o,e,e.look||`classic`)});let d=this.getEdges();d.forEach((t,n)=>{let i=c.get(t.start)??t.start,a=c.get(t.end)??t.end;if(i===a&&t.start!==t.end)return;let{arrowTypeStart:o,arrowTypeEnd:s}=this.destructEdgeType(t.type),l=[...d.defaultStyle??[]];t.style&&l.push(...t.style);let u={id:_(i,a,{counter:n,prefix:`L`},t.id),isUserDefinedId:t.isUserDefinedId,start:i,end:a,type:t.type??`normal`,label:t.text,labelType:t.labelType,labelpos:`c`,thickness:t.stroke,minlen:t.length,classes:t?.stroke===`invisible`?``:`edge-thickness-normal edge-pattern-solid flowchart-link`,arrowTypeStart:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:o,arrowTypeEnd:t?.stroke===`invisible`||t?.type===`arrow_open`?`none`:s,arrowheadStyle:`fill: #333`,cssCompiledStyles:this.getCompiledStyles(t.classes),labelStyle:l,style:l,pattern:t.stroke,look:e.look,animate:t.animate,animation:t.animation,curve:t.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve,metadata:t.metadata};r.push(u)}),ne(n,this);let f=new Map,p=new Map;for(let e of i){let t=a.get(e.id);t!==void 0&&p.set(t,[...p.get(t)??[],e.id])}let h=0,g=t(e=>{if(!f.has(e)){f.set(e,h++);for(let t of p.get(e)??[])g(t)}},`walkContainers`);for(let e of i)a.get(e.id)===void 0&&g(e.id);let v=new Set(this.getConnectors().map(e=>e.id));return re(n,e=>{if(v.has(e))return`connector`;let t=this.vertices.get(e);return t?this.deriveVertexKind(t,I(t.type)):void 0},f),{nodes:n,edges:r,other:{},config:e,connectors:this.getConnectors()}}defaultConfig(){return c.flowchart}deriveVertexKind(e,t){return this.isToolDefinition(e)?`tool`:t===`hexagon`||t===`hex`?`action`:t===`lean-right`||t===`lean_right`?`input`:t===`lin-doc`||t===`lined-document`?`refdoc`:t===`diamond`?`decision`:`task`}getSemanticModel(){this.runPostParseValidators();let e=new Set(this.subGraphs.map(e=>e.id)),t=[],n=[];for(let[r,i]of this.vertices){if(e.has(r))continue;if(i.isConnector){let e={id:r};if(i.text!==void 0&&i.text!==r&&(e.title=i.text),i.metadata&&Object.keys(i.metadata).length>0){let t={};for(let[e,n]of Object.entries(i.metadata))ae.has(e)||(t[e]=n);Object.keys(t).length>0&&(e.metadata=t)}n.push(e);continue}let a={id:r};i.text!==void 0&&(a.label=i.text);let o=typeof i.type==`string`?I(i.type):i.type;if(o!==void 0&&(a.shape=o),a.vertexKind=this.deriveVertexKind(i,o),i.metadata&&Object.keys(i.metadata).length>0){let e={};for(let[t,n]of Object.entries(i.metadata))ae.has(t)||(e[t]=n);Object.keys(e).length>0&&(a.metadata=e)}t.push(a)}let r={vertices:t,edges:this.edges.map(e=>{let t={start:e.start,end:e.end};return e.id!==void 0&&(t.id=e.id),typeof e.text==`string`&&e.text.length>0&&(t.label=e.text),e.type!==void 0&&(t.type=e.type),e.stroke!==void 0&&(t.stroke=e.stroke),e.edgeSemantic!==void 0&&(t.edgeSemantic=e.edgeSemantic),e.length!==void 0&&(t.length=e.length),e.metadata&&Object.keys(e.metadata).length>0&&(t.metadata={...e.metadata}),t}),subGraphs:this.subGraphs.map(e=>{let t={id:e.id,nodes:[...e.nodes]};if(e.type!==void 0&&(t.type=e.type),e.title!==void 0&&(t.title=e.title),e.dir!==void 0&&(t.direction=e.dir),e.metadata&&Object.keys(e.metadata).length>0){let n={};for(let[t,r]of Object.entries(e.metadata))ae.has(t)||(n[t]=r);Object.keys(n).length>0&&(t.metadata=n)}return t}),connectors:n,diagnostics:this.diagnostics};return this.direction!==void 0&&(r.direction=this.direction),r}setFrontmatterLineOffset(e){this.frontmatterLineOffset=e??0}toElementPosition(e){let t=e?.first_line??0,n=e?.first_column??0,r=e?.last_line??t,i=e?.last_column??n,[a,o]=e?.range??[0,0];return{startLine:t+this.frontmatterLineOffset,startColumn:n,endLine:r+this.frontmatterLineOffset,endColumn:i,startIndex:a,endIndex:o}}pushMapping(e,t,n){if(!e)return;let r={id:e,type:t,position:this.toElementPosition(n)};return this.elementMappings.push(r),r}addVertexMapping(e,t,n,r){let i=this.pushMapping(e,`vertex`,r);i&&n==null&&this.bareVertexMappings.add(i)}extendVertexMapping(e,t){if(!e||!t)return;let n=this.toElementPosition(t);for(let t=this.elementMappings.length-1;t>=0;t--){let r=this.elementMappings[t];if(r.type===`vertex`&&r.id===e){this.bareVertexMappings.has(r)&&(r.type=`attachment`,this.bareVertexMappings.delete(r)),(n.endLine>r.position.endLine||n.endLine===r.position.endLine&&n.endColumn>r.position.endColumn)&&(r.position.endLine=n.endLine,r.position.endColumn=n.endColumn,r.position.endIndex=n.endIndex);return}}this.pushMapping(e,`attachment`,t)}addEdgeMapping(e,t,n,r){let i=Array.isArray(t)?t.map(e=>typeof e==`string`?e:e?.id??``).filter(Boolean):[],a=i.length>0?i.join(`>`):`edge`;this.pushMapping(a,`edge`,r)}addSubgraphMapping(e,t,n,r){let i=(typeof e==`string`?e:e?.text)??``,a=this.toElementPosition(n),o=r?this.toElementPosition(r):a;i&&this.elementMappings.push({id:i,type:`subgraph`,position:{startLine:a.startLine,startColumn:a.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:a.startIndex,endIndex:o.endIndex}})}addConnectorMapping(e,t,n,r){let i=e?.text?.trim()??``;if(!i)return;let a=this.toElementPosition(n),o=r?this.toElementPosition(r):a;this.elementMappings.push({id:i,type:`connector`,position:{startLine:a.startLine,startColumn:a.startColumn,endLine:o.endLine,endColumn:o.endColumn,startIndex:a.startIndex,endIndex:o.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(e){return this.elementMappings.find(t=>t.id===e)}getElementsOnLine(e){return this.elementMappings.filter(t=>e>=t.position.startLine&&e<=t.position.endLine)}getElementAtPosition(e,n){let r=this.elementMappings.filter(t=>{let{startLine:r,startColumn:i,endLine:a,endColumn:o}=t.position;return!(ea||e===r&&no)});if(r.length===0)return;let i=t(({position:e})=>[e.endLine-e.startLine,e.endColumn-e.startColumn],`span`);return r.reduce((e,t)=>{let[n,r]=i(e),[a,o]=i(t);return a===n?oe.id===s.id&&e.severity===s.severity&&e.message===s.message&&e.nodeId===s.nodeId&&e.edgeId===s.edgeId))return;this.diagnostics.push(s);let c=`agentflow[${e}]: ${r}`;t===`error`?n.error(c):n.warn(c)}emitWarning(e,t,n){this.emitDiagnostic(e,`warning`,t,n)}emitError(e,t,n){this.emitDiagnostic(e,`error`,t,n)}getDiagnostics(){return[...this.diagnostics]}},de={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.debug(`Drawing agentflow diagram`,t);let{securityLevel:a,agentflow:o,layout:s}=m();i.db.setDiagramId(t),n.debug(`Before getData: `);let c=i.db.getData();n.debug(`Data: `,c);let l=E(t,a),u=i.db.getDirection();c.type=i.type,c.layoutAlgorithm=k(s),c.layoutAlgorithm===`dagre`&&s===`elk`&&n.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),c.direction=u,c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=[`point`,`circle`,`cross`,`hierarchy`],c.diagramId=t,n.debug(`REF1:`,c),await O(c,l);let d=o?.diagramPadding??8;v.insertTitle(l,`agentflowTitleText`,o?.titleTopMargin??0,i.db.getDiagramTitle()),D(l,d,`agentflow`,o?.useMaxWidth??!0)},`draw`)},fe=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,5],r=[1,4],i=[1,3],a=[1,6],o=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],s=[2,2],c=[1,15],l=[1,16],u=[1,17],d=[1,18],f=[1,19],p=[1,26],m=[1,27],h=[1,28],g=[1,30],_=[1,31],v=[1,32],y=[1,55],b=[1,54],x=[1,34],S=[1,35],C=[1,36],w=[1,37],T=[1,38],E=[1,50],D=[1,52],O=[1,48],k=[1,53],A=[1,49],j=[1,56],M=[1,51],N=[1,57],P=[1,58],ee=[1,39],te=[1,40],F=[1,41],I=[1,42],ne=[1,43],L=[1,64],R=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],z=[1,70],B=[1,68],V=[1,67],H=[1,69],re=[8,9,10,12,78,80,81],ie=[1,88],ae=[1,101],oe=[1,106],se=[1,105],ce=[1,102],le=[1,98],ue=[1,104],de=[1,100],fe=[1,107],pe=[1,103],me=[1,108],he=[1,99],ge=[8,9,10,11,12,43,78,80,81],U=[8,9,10,11,12,43,49,78,80,81],W=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],_e=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],ve=[47,63,92,105,108,109,112,114,117,118,119],ye=[1,131],be=[1,132],xe=[1,134],Se=[1,133],Ce=[47,63,65,77,92,105,108,109,112,114,117,118,119],we=[1,143],Te=[1,157],Ee=[1,158],De=[1,159],Oe=[1,162],ke=[1,161],Ae=[1,160],je=[1,145],Me=[1,147],Ne=[1,151],Pe=[1,139],Fe=[1,140],Ie=[1,152],Le=[1,153],Re=[1,154],ze=[1,155],Be=[1,156],Ve=[1,163],He=[1,164],Ue=[1,141],We=[1,142],Ge=[1,149],Ke=[1,144],qe=[1,148],Je=[1,146],Ye=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],Xe=[1,168],Ze=[1,170],G=[8,9,10,12],K=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],q=[1,190],J=[1,186],Y=[1,187],X=[1,191],Z=[1,188],Q=[1,189],Qe=[80,119,122],$=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],$e=[11,109],et=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],tt=[1,269],nt=[1,267],rt=[1,271],it=[1,265],at=[1,266],ot=[1,268],st=[1,270],ct=[1,272],lt=[1,292],ut=[8,9,10,12,109],dt=[8,9,10,11,12,63,87,108,109,112,113,114,115],ft={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:`error`,8:`COMMENT`,9:`SEMI`,10:`NEWLINE`,11:`SPACE`,12:`EOF`,13:`GRAPH`,14:`NODIR`,15:`DIR`,28:`flow`,30:`SQS`,32:`SQE`,33:`end`,35:`global`,36:`connector`,38:`acc_title`,39:`acc_title_value`,40:`acc_descr`,41:`acc_descr_value`,42:`acc_descr_multiline_value`,43:`SHAPE_DATA`,47:`AMP`,49:`STYLE_SEPARATOR`,51:`DOUBLECIRCLESTART`,52:`DOUBLECIRCLEEND`,53:`PS`,54:`PE`,55:`(-`,56:`-)`,57:`STADIUMSTART`,58:`STADIUMEND`,59:`SUBROUTINESTART`,60:`SUBROUTINEEND`,61:`VERTEX_WITH_PROPS_START`,62:`NODE_STRING[field]`,63:`COLON`,64:`NODE_STRING[value]`,65:`PIPE`,66:`CYLINDERSTART`,67:`CYLINDEREND`,68:`DIAMOND_START`,69:`DIAMOND_STOP`,70:`TAGEND`,71:`TRAPSTART`,72:`TRAPEND`,73:`INVTRAPSTART`,74:`INVTRAPEND`,77:`TESTSTR`,78:`START_LINK`,80:`LINK`,81:`LINK_ID`,83:`STR`,84:`MD_STR`,87:`STYLE`,88:`LINKSTYLE`,89:`CLASSDEF`,90:`CLASS`,91:`CLICK`,92:`DOWN`,93:`UP`,96:`idString[vertex]`,97:`idString[class]`,98:`CALLBACKNAME`,99:`CALLBACKARGS`,100:`HREF`,101:`LINK_TARGET`,102:`STR[link]`,103:`STR[tooltip]`,105:`DEFAULT`,107:`INTERPOLATE`,108:`NUM`,109:`COMMA`,112:`NODE_STRING`,113:`UNIT`,114:`BRKT`,115:`PCT`,117:`MINUS`,118:`MULT`,119:`UNICODE_TEXT`,120:`TEXT`,121:`TAGSTART`,122:`EDGE_TEXT`,124:`direction_tb`,125:`direction_bt`,126:`direction_rl`,127:`direction_lr`,128:`direction_td`},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 2:this.$=[];break;case 3:(!Array.isArray(a[s])||a[s].length>0)&&a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 198:this.$=a[s];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:r.setDirection(`TB`),this.$=`TB`;break;case 14:r.setDirection(a[s-1]),this.$=a[s-1];break;case 32:this.$=a[s-1].nodes;break;case 38:this.$=r.addSubGraph(a[s-6],a[s-1],a[s-4],`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-6],a[s-4],o[s-8],o[s]);break;case 39:this.$=r.addSubGraph(a[s-7],a[s-1],a[s-5],`flow`),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-3],o[s-3]),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-7],a[s-5],o[s-9],o[s]);break;case 40:this.$=r.addSubGraph(a[s-3],a[s-1],{text:``,type:`text`},`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-3],{text:``,type:`text`},o[s-5],o[s]);break;case 41:this.$=r.addSubGraph(a[s-4],a[s-1],{text:``,type:`text`},`flow`),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-3],o[s-3]),r.addSubgraphMapping&&r.addSubgraphMapping(a[s-4],{text:``,type:`text`},o[s-6],o[s]);break;case 42:this.$=r.addSubGraph(void 0,a[s-1],void 0,`flow`),r.addSubgraphMapping&&r.addSubgraphMapping(void 0,void 0,o[s-3],o[s]);break;case 43:r.addGlobal(a[s-1]),this.$=[];break;case 44:this.$=r.addConnector(a[s-4],a[s-2]),r.addConnectorMapping&&r.addConnectorMapping(a[s-4],a[s-2],o[s-6],o[s]);break;case 45:this.$=r.addConnector(a[s-5],a[s-3]),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-1],o[s-1]),r.addConnectorMapping&&r.addConnectorMapping(a[s-5],a[s-3],o[s-7],o[s]);break;case 46:this.$=r.addConnector(a[s-1],{text:``,type:`text`}),r.addConnectorMapping&&r.addConnectorMapping(a[s-1],{text:``,type:`text`},o[s-3],o[s]);break;case 47:this.$=r.addConnector(a[s-2],{text:``,type:`text`}),r.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,a[s-1],o[s-1]),r.addConnectorMapping&&r.addConnectorMapping(a[s-2],{text:``,type:`text`},o[s-4],o[s]);break;case 49:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 50:case 51:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 56:this.$=a[s-1]+a[s];break;case 57:this.$=a[s];break;case 58:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s],o[s]),r.extendVertexMapping&&r.extendVertexMapping(a[s-1][a[s-1].length-1],o[s]),r.addLink(a[s-3].stmt,a[s-1],a[s-2]),r.addEdgeMapping&&r.addEdgeMapping(a[s-3].stmt,a[s-1],a[s-2],this._$),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 59:r.addLink(a[s-2].stmt,a[s],a[s-1]),r.addEdgeMapping&&r.addEdgeMapping(a[s-2].stmt,a[s],a[s-1],this._$),this.$={stmt:a[s],nodes:a[s].concat(a[s-2].nodes)};break;case 60:r.addLink(a[s-3].stmt,a[s-1],a[s-2]),r.addEdgeMapping&&r.addEdgeMapping(a[s-3].stmt,a[s-1],a[s-2],this._$),this.$={stmt:a[s-1],nodes:a[s-1].concat(a[s-3].nodes)};break;case 61:this.$={stmt:a[s-1],nodes:a[s-1]};break;case 62:r.addVertex(a[s-1][a[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s],o[s]),r.extendVertexMapping&&r.extendVertexMapping(a[s-1][a[s-1].length-1],o[s]),this.$={stmt:a[s-1],nodes:a[s-1],shapeData:a[s]};break;case 63:this.$={stmt:a[s],nodes:a[s]};break;case 64:this.$=[a[s]];break;case 65:r.addVertex(a[s-5][a[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,a[s-4],o[s-4]),r.extendVertexMapping&&r.extendVertexMapping(a[s-5][a[s-5].length-1],o[s-4]),this.$=a[s-5].concat(a[s]);break;case 66:this.$=a[s-4].concat(a[s]);break;case 67:this.$=a[s];break;case 68:this.$=a[s-2],r.setClass(a[s-2],a[s]);break;case 69:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`square`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`square`,this._$);break;case 70:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`doublecircle`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`doublecircle`,this._$);break;case 71:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`circle`),r.addVertexMapping&&r.addVertexMapping(a[s-5],a[s-2],`circle`,this._$);break;case 72:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`ellipse`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`ellipse`,this._$);break;case 73:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`stadium`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`stadium`,this._$);break;case 74:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`subroutine`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`subroutine`,this._$);break;case 75:this.$=a[s-7],r.addVertex(a[s-7],a[s-1],`rect`,void 0,void 0,void 0,Object.fromEntries([[a[s-5],a[s-3]]])),r.addVertexMapping&&r.addVertexMapping(a[s-7],a[s-1],`rect`,this._$);break;case 76:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`cylinder`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`cylinder`,this._$);break;case 77:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`round`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`round`,this._$);break;case 78:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`diamond`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`diamond`,this._$);break;case 79:this.$=a[s-5],r.addVertex(a[s-5],a[s-2],`hexagon`),r.addVertexMapping&&r.addVertexMapping(a[s-5],a[s-2],`hexagon`,this._$);break;case 80:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`odd`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`odd`,this._$);break;case 81:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`trapezoid`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`trapezoid`,this._$);break;case 82:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`inv_trapezoid`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`inv_trapezoid`,this._$);break;case 83:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_right`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`lean_right`,this._$);break;case 84:this.$=a[s-3],r.addVertex(a[s-3],a[s-1],`lean_left`),r.addVertexMapping&&r.addVertexMapping(a[s-3],a[s-1],`lean_left`,this._$);break;case 85:this.$=a[s],r.addVertex(a[s]),r.addVertexMapping&&r.addVertexMapping(a[s],void 0,void 0,this._$);break;case 86:a[s-1].text=a[s],this.$=a[s-1];break;case 87:case 88:a[s-2].text=a[s-1],this.$=a[s-2];break;case 89:this.$=a[s];break;case 90:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,text:a[s-1]};break;case 91:var c=r.destructLink(a[s],a[s-2]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,text:a[s-1],id:a[s-3]};break;case 92:this.$={text:a[s],type:`text`};break;case 93:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 94:this.$={text:a[s],type:`string`};break;case 95:this.$={text:a[s],type:`markdown`};break;case 96:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic};break;case 97:var c=r.destructLink(a[s]);this.$={type:c.type,stroke:c.stroke,length:c.length,edgeSemantic:c.edgeSemantic,id:a[s-1]};break;case 98:this.$=a[s-1];break;case 99:this.$={text:a[s],type:`text`};break;case 100:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 101:this.$={text:a[s],type:`string`};break;case 102:case 119:this.$={text:a[s],type:`markdown`};break;case 116:this.$={text:a[s],type:`text`};break;case 117:this.$={text:a[s-1].text+``+a[s],type:a[s-1].type};break;case 118:this.$={text:a[s],type:`text`};break;case 120:this.$=a[s-4],r.addClass(a[s-2],a[s]);break;case 121:this.$=a[s-4],r.setClass(a[s-2],a[s]);break;case 122:case 130:this.$=a[s-1],r.setClickEvent(a[s-1],a[s]);break;case 123:case 131:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 124:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 125:this.$=a[s-4],r.setClickEvent(a[s-4],a[s-3],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 126:this.$=a[s-2],r.setLink(a[s-2],a[s]);break;case 127:this.$=a[s-4],r.setLink(a[s-4],a[s-2]),r.setTooltip(a[s-4],a[s]);break;case 128:this.$=a[s-4],r.setLink(a[s-4],a[s-2],a[s]);break;case 129:this.$=a[s-6],r.setLink(a[s-6],a[s-4],a[s]),r.setTooltip(a[s-6],a[s-2]);break;case 132:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 133:this.$=a[s-3],r.setLink(a[s-3],a[s-2]),r.setTooltip(a[s-3],a[s]);break;case 134:this.$=a[s-3],r.setLink(a[s-3],a[s-2],a[s]);break;case 135:this.$=a[s-5],r.setLink(a[s-5],a[s-4],a[s]),r.setTooltip(a[s-5],a[s-2]);break;case 136:this.$=a[s-4],r.addVertex(a[s-2],void 0,void 0,a[s]);break;case 137:this.$=a[s-4],r.updateLink([a[s-2]],a[s]);break;case 138:this.$=a[s-4],r.updateLink(a[s-2],a[s]);break;case 139:this.$=a[s-8],r.updateLinkInterpolate([a[s-6]],a[s-2]),r.updateLink([a[s-6]],a[s]);break;case 140:this.$=a[s-8],r.updateLinkInterpolate(a[s-6],a[s-2]),r.updateLink(a[s-6],a[s]);break;case 141:this.$=a[s-6],r.updateLinkInterpolate([a[s-4]],a[s]);break;case 142:this.$=a[s-6],r.updateLinkInterpolate(a[s-4],a[s]);break;case 143:case 145:this.$=[a[s]];break;case 144:case 146:a[s-2].push(a[s]),this.$=a[s-2];break;case 148:this.$=a[s-1]+a[s];break;case 196:this.$=a[s];break;case 197:this.$=a[s-1]+``+a[s];break;case 199:this.$=a[s-1]+``+a[s];break;case 200:this.$={stmt:`dir`,value:`TB`};break;case 201:this.$={stmt:`dir`,value:`BT`};break;case 202:this.$={stmt:`dir`,value:`RL`};break;case 203:this.$={stmt:`dir`,value:`LR`};break;case 204:this.$={stmt:`dir`,value:`TD`}}},`anonymous`),table:[{3:1,4:2,8:n,10:r,11:i,13:a},{1:[3]},e(o,s,{5:7}),{4:8,8:n,10:r,11:i,13:a},{4:9,8:n,10:r,11:i,13:a},{4:10,8:n,10:r,11:i,13:a},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(o,[2,10]),e(o,[2,11]),e(o,[2,12]),e(o,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:L,16:59,19:62},e(R,[2,3]),e(R,[2,4]),e(R,[2,5]),e(R,[2,6]),e(R,[2,7]),e(R,[2,8]),e(R,[2,9]),{8:z,9:B,10:V,12:H,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:z,9:B,10:V,12:H,22:75},{8:z,9:B,10:V,12:H,22:76},{8:z,9:B,10:V,12:H,22:77},{8:z,9:B,10:V,12:H,22:78},{8:z,9:B,10:V,12:H,22:79},{8:z,9:B,10:V,11:[1,80],12:H,22:81},{8:z,9:B,10:V,12:H,22:82},{11:[1,83]},e(R,[2,48]),{39:[1,84]},{41:[1,85]},e(R,[2,51]),e(re,[2,63],{19:86,34:87,11:L,43:ie}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:ae,47:oe,63:se,83:[1,96],92:ce,98:[1,93],100:[1,94],104:95,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},e(R,[2,200]),e(R,[2,201]),e(R,[2,202]),e(R,[2,203]),e(R,[2,204]),e(ge,[2,64]),e(ge,[2,67],{49:[1,109]}),e(U,[2,85],{116:122,30:[1,110],47:y,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:b,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),e(W,[2,196]),e(W,[2,157]),e(W,[2,158]),e(W,[2,159]),e(W,[2,160]),e(W,[2,161]),e(W,[2,162]),e(W,[2,163]),e(W,[2,164]),e(W,[2,165]),e(W,[2,166]),e(W,[2,167]),e(o,[2,14]),e(o,[2,20]),e(o,[2,21]),{10:[1,123]},e(o,[2,23]),e(_e,[2,31],{19:124,11:L}),e(R,[2,32]),{45:125,46:44,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(R,[2,52]),e(R,[2,53]),e(R,[2,54]),e(R,[2,55]),e(ve,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:ye,84:be,119:xe,122:Se},{78:[1,135],80:[1,136]},e(Ce,[2,96]),e(R,[2,33]),e(R,[2,34]),e(R,[2,35]),e(R,[2,36]),e(R,[2,37]),{11:we,13:Te,15:Ee,28:De,29:137,33:Oe,35:ke,36:Ae,47:je,63:Me,78:Ne,83:Pe,84:Fe,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:138,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e(Ye,s,{5:165}),e(Ye,s,{5:166}),{11:we,13:Te,15:Ee,28:De,29:167,33:Oe,35:ke,36:Ae,47:je,63:Me,78:Ne,83:Pe,84:Fe,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:138,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e(R,[2,49]),e(R,[2,50]),e(re,[2,61],{47:Xe}),e(re,[2,62],{19:169,11:L,43:Ze}),e(ge,[2,57]),{47:y,50:171,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{105:[1,172],106:173,108:[1,174]},{47:y,50:175,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{47:y,50:176,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},e(G,[2,130],{123:181,11:[1,180],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,132],{11:[1,182]}),e(K,[2,198]),e(K,[2,185]),e(K,[2,186]),e(K,[2,187]),e(K,[2,188]),e(K,[2,189]),e(K,[2,190]),e(K,[2,191]),e(K,[2,192]),e(K,[2,193]),e(K,[2,194]),e(K,[2,195]),{47:y,50:183,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{31:184,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:192,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:194,53:[1,193],70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:195,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:196,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:197,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{112:[1,198]},{31:199,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:200,68:[1,201],70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:202,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:203,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{31:204,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(W,[2,197]),e(o,[2,22]),e(_e,[2,30]),e(re,[2,59],{34:205,19:206,11:L,43:ie}),e(ve,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{80:[1,210],82:211,119:xe,122:Se},e(Qe,[2,92]),e(Qe,[2,94]),e(Qe,[2,95]),e(Qe,[2,183]),e(Qe,[2,184]),{79:212,82:130,83:ye,84:be,119:xe,122:Se},e(Ce,[2,97]),{8:z,9:B,10:V,11:we,12:H,13:Te,15:Ee,22:214,28:De,30:[1,213],33:Oe,34:215,35:ke,36:Ae,43:ie,47:je,63:Me,78:Ne,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:216,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},e($,[2,116]),e($,[2,118]),e($,[2,119]),e($,[2,172]),e($,[2,173]),e($,[2,174]),e($,[2,175]),e($,[2,176]),e($,[2,177]),e($,[2,178]),e($,[2,179]),e($,[2,180]),e($,[2,181]),e($,[2,182]),e($,[2,103]),e($,[2,104]),e($,[2,105]),e($,[2,106]),e($,[2,107]),e($,[2,108]),e($,[2,109]),e($,[2,110]),e($,[2,111]),e($,[2,112]),e($,[2,113]),e($,[2,114]),e($,[2,115]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,217],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,218],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{8:z,9:B,10:V,11:we,12:H,13:Te,15:Ee,22:220,28:De,30:[1,219],33:Oe,34:221,35:ke,36:Ae,43:ie,47:je,63:Me,78:Ne,86:150,87:Ie,88:Le,89:Re,90:ze,91:Be,92:Ve,93:He,94:216,108:Ue,112:We,114:Ge,117:Ke,118:qe,119:Je},{11:L,19:222},{47:[1,223]},e(ge,[2,56]),{11:[1,224],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{11:[1,225]},{11:[1,226],109:[1,227]},e($e,[2,143]),{11:[1,228],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{11:[1,229],47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:122,117:M,118:N,119:P},{83:[1,230]},e(G,[2,124],{11:[1,231]}),e(G,[2,126],{11:[1,232]}),{83:[1,233]},e(K,[2,199]),{83:[1,234],101:[1,235]},e(ge,[2,68],{116:122,47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),{32:[1,236],70:q,85:237,119:X,120:Z,121:Q},e(et,[2,99]),e(et,[2,101]),e(et,[2,102]),e(et,[2,168]),e(et,[2,169]),e(et,[2,170]),e(et,[2,171]),{52:[1,238],70:q,85:237,119:X,120:Z,121:Q},{31:239,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{54:[1,240],70:q,85:237,119:X,120:Z,121:Q},{56:[1,241],70:q,85:237,119:X,120:Z,121:Q},{58:[1,242],70:q,85:237,119:X,120:Z,121:Q},{60:[1,243],70:q,85:237,119:X,120:Z,121:Q},{63:[1,244]},{67:[1,245],70:q,85:237,119:X,120:Z,121:Q},{69:[1,246],70:q,85:237,119:X,120:Z,121:Q},{31:247,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},{32:[1,248],70:q,85:237,119:X,120:Z,121:Q},{70:q,72:[1,249],74:[1,250],85:237,119:X,120:Z,121:Q},{70:q,72:[1,252],74:[1,251],85:237,119:X,120:Z,121:Q},e(re,[2,58],{19:169,11:L,43:Ze}),e(re,[2,60],{47:Xe}),e(ve,[2,88]),e(ve,[2,87]),{65:[1,253],70:q,85:237,119:X,120:Z,121:Q},e(ve,[2,90]),e(Qe,[2,93]),{80:[1,254],82:211,119:xe,122:Se},{31:255,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(Ye,s,{5:256}),{8:z,9:B,10:V,12:H,22:257,43:Ze},e($,[2,117]),e(R,[2,42]),e(R,[2,43]),{31:258,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(R,[2,46]),{8:z,9:B,10:V,12:H,22:259,43:Ze},{46:260,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},{11:L,19:261},{11:tt,63:nt,87:rt,95:262,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:273,107:[1,274],108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:275,107:[1,276],108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{108:[1,277]},{11:tt,63:nt,87:rt,95:278,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{47:y,50:279,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},e(G,[2,131]),e(G,[2,133],{11:[1,283]}),e(G,[2,134]),e(U,[2,69]),e(et,[2,100]),e(U,[2,70]),{54:[1,284],70:q,85:237,119:X,120:Z,121:Q},e(U,[2,77]),e(U,[2,72]),e(U,[2,73]),e(U,[2,74]),{112:[1,285]},e(U,[2,76]),e(U,[2,78]),{69:[1,286],70:q,85:237,119:X,120:Z,121:Q},e(U,[2,80]),e(U,[2,81]),e(U,[2,83]),e(U,[2,82]),e(U,[2,84]),e([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),e(ve,[2,91]),{32:[1,287],70:q,85:237,119:X,120:Z,121:Q},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,288],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(Ye,s,{5:289}),{32:[1,290],70:q,85:237,119:X,120:Z,121:Q},e(R,[2,47]),e(ge,[2,66]),{46:291,47:y,48:45,50:46,63:b,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P},e(G,[2,136],{109:lt}),e(ut,[2,145],{111:293,11:tt,63:nt,87:rt,108:it,112:at,113:ot,114:st,115:ct}),e(dt,[2,147]),e(dt,[2,149]),e(dt,[2,150]),e(dt,[2,151]),e(dt,[2,152]),e(dt,[2,153]),e(dt,[2,154]),e(dt,[2,155]),e(dt,[2,156]),e(G,[2,137],{109:lt}),{11:[1,294]},e(G,[2,138],{109:lt}),{11:[1,295]},e($e,[2,144]),e(G,[2,120],{109:lt}),e(G,[2,121],{116:122,47:y,63:b,92:E,105:D,108:O,109:k,112:A,114:j,117:M,118:N,119:P}),e(G,[2,125]),e(G,[2,127],{11:[1,296]}),e(G,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:z,9:B,10:V,12:H,22:301,34:302,43:ie},e(R,[2,40]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,303],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},{8:z,9:B,10:V,12:H,22:304,34:305,43:ie},e(ge,[2,65]),{11:tt,63:nt,87:rt,108:it,110:306,111:264,112:at,113:ot,114:st,115:ct},e(dt,[2,148]),{15:ae,47:oe,63:se,92:ce,104:307,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},{15:ae,47:oe,63:se,92:ce,104:308,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he,123:97},{101:[1,309]},e(G,[2,135]),e(U,[2,71]),{31:310,70:q,83:J,84:Y,85:185,119:X,120:Z,121:Q},e(U,[2,79]),e(Ye,s,{5:311}),{8:z,9:B,10:V,12:H,22:312,43:Ze},e(R,[2,41]),e(R,[2,44]),{8:z,9:B,10:V,12:H,22:313,43:Ze},e(ut,[2,146],{111:293,11:tt,63:nt,87:rt,108:it,112:at,113:ot,114:st,115:ct}),e(G,[2,141],{123:181,11:[1,314],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,142],{123:181,11:[1,315],15:ae,47:oe,63:se,92:ce,108:le,109:ue,112:de,114:fe,117:pe,118:me,119:he}),e(G,[2,129]),{32:[1,316],70:q,85:237,119:X,120:Z,121:Q},{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,317],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(Ye,s,{5:318}),e(R,[2,45]),{11:tt,63:nt,87:rt,95:319,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},{11:tt,63:nt,87:rt,95:320,108:it,110:263,111:264,112:at,113:ot,114:st,115:ct},e(U,[2,75]),e(R,[2,38]),{6:13,7:14,8:c,9:l,10:u,11:d,12:f,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,321],35:m,36:h,37:29,38:g,40:_,42:v,45:33,46:44,47:y,48:45,50:46,63:b,87:x,88:S,89:C,90:w,91:T,92:E,105:D,108:O,109:k,112:A,114:j,116:47,117:M,118:N,119:P,124:ee,125:te,126:F,127:I,128:ne},e(G,[2,139],{109:lt}),e(G,[2,140],{109:lt}),e(R,[2,39])],defaultActions:{},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};ft.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{},performAction:t(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),38;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),40;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return this.pushState(`shapeData`),t.yytext=``,43;case 8:return this.pushState(`shapeDataStr`),43;case 9:return this.popState(),43;case 10:return t.yytext=t.yytext.replace(/\n\s*/g,`
`),43;case 11:return 43;case 12:this.popState();break;case 13:this.begin(`callbackname`);break;case 14:this.popState();break;case 15:this.popState(),this.begin(`callbackargs`);break;case 16:return 98;case 17:this.popState();break;case 18:return 99;case 19:return`MD_STR`;case 20:this.popState();break;case 21:this.begin(`md_string`);break;case 22:return`STR`;case 23:this.popState();break;case 24:this.pushState(`string`);break;case 25:return 87;case 26:return 105;case 27:return 88;case 28:return 107;case 29:return 89;case 30:return 90;case 31:return 100;case 32:this.begin(`click`);break;case 33:this.popState();break;case 34:return 91;case 35:return e.lex.firstGraph()&&this.begin(`dir`),13;case 36:return 28;case 37:return 36;case 38:return 35;case 39:return 33;case 40:return 101;case 41:return 101;case 42:return 101;case 43:return 101;case 44:return this.popState(),14;case 45:return this.popState(),15;case 46:return this.popState(),15;case 47:return this.popState(),15;case 48:return this.popState(),15;case 49:return this.popState(),15;case 50:return this.popState(),15;case 51:return this.popState(),15;case 52:return this.popState(),15;case 53:return this.popState(),15;case 54:return this.popState(),15;case 55:return 124;case 56:return 125;case 57:return 126;case 58:return 127;case 59:return 128;case 60:return 81;case 61:return 108;case 62:return 114;case 63:return 49;case 64:return 63;case 65:return 47;case 66:return 9;case 67:return 109;case 68:return 118;case 69:return this.popState(),80;case 70:return this.pushState(`edgeText`),78;case 71:return 122;case 72:return 80;case 73:break;case 74:return this.popState(),56;case 75:return`TEXT`;case 76:return this.pushState(`ellipseText`),55;case 77:return this.popState(),58;case 78:return this.pushState(`text`),57;case 79:return this.popState(),60;case 80:return this.pushState(`text`),59;case 81:return 61;case 82:return this.pushState(`text`),70;case 83:return this.popState(),67;case 84:return this.pushState(`text`),66;case 85:return this.popState(),52;case 86:return this.pushState(`text`),51;case 87:break;case 88:return this.popState(),72;case 89:return this.popState(),74;case 90:return 120;case 91:return this.pushState(`trapText`),71;case 92:return this.pushState(`trapText`),73;case 93:return 121;case 94:return 70;case 95:return 93;case 96:return`SEP`;case 97:return 92;case 98:return 118;case 99:return 114;case 100:return 47;case 101:return 8;case 102:return 112;case 103:return 117;case 104:return 119;case 105:return this.popState(),65;case 106:return this.pushState(`text`),65;case 107:return this.popState(),54;case 108:return this.pushState(`text`),53;case 109:return this.popState(),32;case 110:return this.pushState(`text`),30;case 111:return this.popState(),69;case 112:return this.pushState(`text`),68;case 113:break;case 114:return`TEXT`;case 115:return`QUOTE`;case 116:return 10;case 117:return 11;case 118:return 12}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:agentflow-beta\b)/,/^(?:flow\b)/,/^(?:connector\b)/,/^(?:global\b[ \t]*)/,/^(?:end\b[ \t]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*--+[x>]\s*)/,/^(?:\s*--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*-\.+-\s*)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|(?:[^\\\[\]\(\)\{\}\/%]+|(?!))+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:[ \t]*%%(?!\{)[^\n]*)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\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\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\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\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-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\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-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\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\u2183\u2184]|[\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\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\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])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:(?:[^\[\]\(\)\{\}\|\"%]+|(?!))+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeData:{rules:[8,11,12,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackargs:{rules:[17,18,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackname:{rules:[14,15,16,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},href:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},click:{rules:[21,24,33,34,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},edgeText:{rules:[21,24,69,71,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},trapText:{rules:[21,24,76,78,80,84,86,87,88,89,90,91,92,106,108,110,112],inclusive:!1},ellipseText:{rules:[21,24,73,74,75,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},text:{rules:[21,24,76,77,78,79,80,83,84,85,86,91,92,105,106,107,108,109,110,111,112,113,114],inclusive:!1},vertex:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr:{rules:[3,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_title:{rules:[1,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},md_string:{rules:[19,20,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},string:{rules:[21,22,23,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,76,78,80,81,82,84,86,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,108,110,112,115,116,117,118],inclusive:!0}}}})();function pt(){this.yy={}}return t(pt,`Parser`),pt.prototype=ft,ft.Parser=pt,new pt})();fe.parser=fe;var pe=fe,me=Object.assign({},pe);me.parse=e=>{let t=e.replace(/}[^\S\n]*\n/g,`} -`);return pe.parse(t)};var he=me,ge=t(e=>{let{theme:n,bkgColorArray:r,borderColorArray:i}=e;if(!x(n,i))return``;let a=C(e.look),o=w(r),s=S(e.THEME_COLOR_LIMIT,i),c=t(e=>i[e%i.length],`border`),l=t(e=>o?`fill: ${r[e%r.length]};`:``,`fill`),u=``;for(let e of B){let t=L.get(e),n=`[data-look="${a}"].node.${z(e)}`;u+=` +`);return pe.parse(t)};var he=me,ge=t(e=>{let{theme:n,bkgColorArray:r,borderColorArray:i}=e;if(!b(n,i))return``;let a=S(e.look),o=C(r),s=x(e.THEME_COLOR_LIMIT,i),c=t(e=>i[e%i.length],`border`),l=t(e=>o?`fill: ${r[e%r.length]};`:``,`fill`),u=``;for(let e of B){let t=L.get(e),n=`[data-look="${a}"].node.${z(e)}`;u+=` ${n} rect, ${n} path, @@ -196,5 +196,5 @@ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on l } text-align: center; } - ${O()} + ${y()} `,`getStyles`),init:t(e=>{e.agentflow??={},e.layout&&i({layout:e.layout}),e.flowchart??={},e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,i({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},`init`)};export{W as diagram}; \ No newline at end of file diff --git a/web/dist/app-diagram-3UASUU5V.js b/web/dist/app-diagram-3UASUU5V.js index df1505c91..96ce28fe0 100644 --- a/web/dist/app-diagram-3UASUU5V.js +++ b/web/dist/app-diagram-3UASUU5V.js @@ -1,4 +1,4 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{D as r,H as i,U as a,a as o,b as s,c,f as l,q as u,v as d,w as f,y as p}from"./app-chunk-O7XYJQB3.js";import{t as m}from"./app-ordinal.js";import{t as h}from"./app-defaultLocale.js";import{i as g}from"./app-chunk-ZIGJFQKS.js";import{t as _}from"./app-chunk-6AEJRKK7.js";import{i as v,n as y}from"./app-chunk-7PRAP22T.js";import{t as b}from"./app-chunk-JWPE2WC7.js";import{n as x}from"./app-mermaid-parser.core.js";import{t as S}from"./app-chunk-WEXAMYUT.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function j(e){for(var t=this,n=M(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function M(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function N(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function P(){return Array.from(this)}function F(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function I(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*L(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i=0;--s)i.push(a=o[s]=new W(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(U)}function z(){return R(this).eachBefore(H)}function B(e){return e.children}function V(e){return Array.isArray(e)?e[1]:null}function H(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function U(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function W(e){this.data=e,this.depth=this.height=0,this.parent=null}W.prototype=R.prototype={constructor:W,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:j,ancestors:N,descendants:P,leaves:F,links:I,copy:z,[Symbol.iterator]:L};function G(e){if(typeof e!=`function`)throw Error();return e}function K(){return 0}function q(e){return function(){return e}}function J(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ee(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++sv&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p1?t:1)},n})(ne);function ae(){var e=ie,t=!1,n=1,r=1,i=[0],a=K,o=K,s=K,c=K,l=K;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(J),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d{y(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){o(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function X(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}e(X,`buildHierarchy`);var oe=e((t,n)=>{b(t,n);let r=[];for(let e of t.TreemapRows??[])e.$type===`ClassDefStatement`&&n.addClass(e.className??``,e.styleText??``);for(let e of t.TreemapRows??[]){let t=e.item;if(!t)continue;let i=e.indent?parseInt(e.indent):0,a=se(t),o=t.classSelector?n.getStylesForClass(t.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:t.$type,value:t.value,classSelector:t.classSelector,cssCompiledStyles:s};r.push(c)}let i=X(r),a=e((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),se=e(e=>e.name?String(e.name):``,`getItemName`),Z={parser:{yy:void 0},parse:e(async e=>{try{let n=await x(`treemap`,e);t.debug(`Treemap AST:`,n);let r=Z.parser?.yy;if(!(r instanceof Y))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);oe(n,r)}catch(e){throw t.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:e((r,i,a,o)=>{let l=o.db,u=l.getConfig(),d=u.padding??ce,f=l.getDiagramTitle(),p=l.getRoot(),{themeVariables:g}=s();if(!p)return;let y=f?30:0,b=_(i),x=u.nodeWidth?u.nodeWidth*Q:960,C=u.nodeHeight?u.nodeHeight*Q:500,w=x,T=C+y;b.attr(`viewBox`,`0 0 ${w} ${T}`),c(b,T,w,u.useMaxWidth);let E;try{let t=u.valueFormat||`,`;if(t===`$0,0`)E=e(e=>`$`+h(`,`)(e),`valueFormat`);else if(t.startsWith(`$`)&&t.includes(`,`)){let n=/\.\d+/.exec(t),r=n?n[0]:``;E=e(e=>`$`+h(`,`+r)(e),`valueFormat`)}else if(t.startsWith(`$`)){let n=t.substring(1);E=e(e=>`$`+h(n||``)(e),`valueFormat`)}else E=h(t)}catch(e){t.error(`Error creating format function:`,e),E=h(`,`)}let D=m().range([`transparent`,g.cScale0,g.cScale1,g.cScale2,g.cScale3,g.cScale4,g.cScale5,g.cScale6,g.cScale7,g.cScale8,g.cScale9,g.cScale10,g.cScale11]),O=m().range([`transparent`,g.cScalePeer0,g.cScalePeer1,g.cScalePeer2,g.cScalePeer3,g.cScalePeer4,g.cScalePeer5,g.cScalePeer6,g.cScalePeer7,g.cScalePeer8,g.cScalePeer9,g.cScalePeer10,g.cScalePeer11]),k=m().range([g.cScaleLabel0,g.cScaleLabel1,g.cScaleLabel2,g.cScaleLabel3,g.cScaleLabel4,g.cScaleLabel5,g.cScaleLabel6,g.cScaleLabel7,g.cScaleLabel8,g.cScaleLabel9,g.cScaleLabel10,g.cScaleLabel11]);f&&b.append(`text`).attr(`x`,w/2).attr(`y`,y/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let A=b.append(`g`).attr(`transform`,`translate(0, ${y})`).attr(`class`,`treemapContainer`),j=R(p).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=ae().size([x,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=v({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`clip-path`,(e,t)=>`url(#clip-section-${i}-${t})`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+v({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=n(this),r=e.data.name;t.text(r);let i=e.x1-e.x0,a;a=u.showValues!==!1&&e.value?i-10-30-10-6:i-6-6;let o=Math.max(15,a),s=t.node();if(s.getComputedTextLength()>o){let e=r;for(;e.length>0;){if(e=r.substring(0,e.length-1),e.length===0){t.text(`...`),s.getComputedTextLength()>o&&t.text(``);break}if(t.text(e+`...`),s.getComputedTextLength()<=o)break}}}),u.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+v({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=F.length>20,L=I?16:38,z=I?14:28,B=I?4:8,V=I?4:6,H=I?2:4,U=I?8:10,W=I?1:2,G=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);G.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>v({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),G.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),G.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${L}px;fill:`+k(e.data.name)+`;`+v({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=n(this),r=e.x1-e.x0,i=e.y1-e.y0,a=t.node(),o=r-2*H,s=i-2*H;if(oo&&c>B;)c--,t.style(`font-size`,`${c}px`);let u=Math.max(V,Math.min(z,Math.round(c*l))),d=c+W+u;for(;d>s&&c>B&&(c--,u=Math.max(V,Math.min(z,Math.round(c*l))),!(uo||c(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${z}px;fill:`+k(e.data.name)+`;`+v({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=n(this),r=this.parentNode;if(!r){t.style(`display`,`none`);return}let i=n(r).select(`.treemapLabel`);if(i.empty()||i.style(`display`)===`none`){t.style(`display`,`none`);return}let a=parseFloat(i.style(`font-size`)),o=Math.max(V,Math.min(z,Math.round(a*.6)));t.style(`font-size`,`${o}px`);let s=(e.y1-e.y0)/2+a/2+W;t.attr(`y`,s);let c=e.x1-e.x0,l=e.y1-e.y0-4,u=c-2*H;t.node().getComputedTextLength()>u||s+o>l||o{let t=r(),n=s(),i=g(t,n.themeVariables),a=g(ue,e),o=a.titleColor??i.titleColor,c=a.labelColor??i.textColor,l=a.valueColor??i.textColor;return` +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{D as r,H as i,U as a,a as o,b as s,c,f as l,q as u,v as d,w as f,y as p}from"./app-chunk-O7XYJQB3.js";import{t as m}from"./app-ordinal.js";import{t as h}from"./app-defaultLocale.js";import{i as g}from"./app-chunk-ZIGJFQKS.js";import{t as _}from"./app-chunk-6AEJRKK7.js";import{t as v}from"./app-chunk-JWPE2WC7.js";import{n as y}from"./app-mermaid-parser.core.js";import{i as b,n as x}from"./app-chunk-7PRAP22T.js";import{t as S}from"./app-chunk-WEXAMYUT.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function j(e){for(var t=this,n=M(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function M(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function N(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function P(){return Array.from(this)}function F(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function I(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*L(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i=0;--s)i.push(a=o[s]=new W(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(U)}function z(){return R(this).eachBefore(H)}function B(e){return e.children}function V(e){return Array.isArray(e)?e[1]:null}function H(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function U(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function W(e){this.data=e,this.depth=this.height=0,this.parent=null}W.prototype=R.prototype={constructor:W,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:j,ancestors:N,descendants:P,leaves:F,links:I,copy:z,[Symbol.iterator]:L};function G(e){if(typeof e!=`function`)throw Error();return e}function K(){return 0}function q(e){return function(){return e}}function J(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ee(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++sv&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p1?t:1)},n})(ne);function ae(){var e=ie,t=!1,n=1,r=1,i=[0],a=K,o=K,s=K,c=K,l=K;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(J),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d{x(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){o(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function X(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}e(X,`buildHierarchy`);var oe=e((t,n)=>{v(t,n);let r=[];for(let e of t.TreemapRows??[])e.$type===`ClassDefStatement`&&n.addClass(e.className??``,e.styleText??``);for(let e of t.TreemapRows??[]){let t=e.item;if(!t)continue;let i=e.indent?parseInt(e.indent):0,a=se(t),o=t.classSelector?n.getStylesForClass(t.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:t.$type,value:t.value,classSelector:t.classSelector,cssCompiledStyles:s};r.push(c)}let i=X(r),a=e((e,t)=>{for(let r of e)n.addNode(r,t),r.children&&r.children.length>0&&a(r.children,t+1)},`addNodesRecursively`);a(i,0)},`populate`),se=e(e=>e.name?String(e.name):``,`getItemName`),Z={parser:{yy:void 0},parse:e(async e=>{try{let n=await y(`treemap`,e);t.debug(`Treemap AST:`,n);let r=Z.parser?.yy;if(!(r instanceof Y))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);oe(n,r)}catch(e){throw t.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:e((r,i,a,o)=>{let l=o.db,u=l.getConfig(),d=u.padding??ce,f=l.getDiagramTitle(),p=l.getRoot(),{themeVariables:g}=s();if(!p)return;let v=f?30:0,y=_(i),x=u.nodeWidth?u.nodeWidth*Q:960,C=u.nodeHeight?u.nodeHeight*Q:500,w=x,T=C+v;y.attr(`viewBox`,`0 0 ${w} ${T}`),c(y,T,w,u.useMaxWidth);let E;try{let t=u.valueFormat||`,`;if(t===`$0,0`)E=e(e=>`$`+h(`,`)(e),`valueFormat`);else if(t.startsWith(`$`)&&t.includes(`,`)){let n=/\.\d+/.exec(t),r=n?n[0]:``;E=e(e=>`$`+h(`,`+r)(e),`valueFormat`)}else if(t.startsWith(`$`)){let n=t.substring(1);E=e(e=>`$`+h(n||``)(e),`valueFormat`)}else E=h(t)}catch(e){t.error(`Error creating format function:`,e),E=h(`,`)}let D=m().range([`transparent`,g.cScale0,g.cScale1,g.cScale2,g.cScale3,g.cScale4,g.cScale5,g.cScale6,g.cScale7,g.cScale8,g.cScale9,g.cScale10,g.cScale11]),O=m().range([`transparent`,g.cScalePeer0,g.cScalePeer1,g.cScalePeer2,g.cScalePeer3,g.cScalePeer4,g.cScalePeer5,g.cScalePeer6,g.cScalePeer7,g.cScalePeer8,g.cScalePeer9,g.cScalePeer10,g.cScalePeer11]),k=m().range([g.cScaleLabel0,g.cScaleLabel1,g.cScaleLabel2,g.cScaleLabel3,g.cScaleLabel4,g.cScaleLabel5,g.cScaleLabel6,g.cScaleLabel7,g.cScaleLabel8,g.cScaleLabel9,g.cScaleLabel10,g.cScaleLabel11]);f&&y.append(`text`).attr(`x`,w/2).attr(`y`,v/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let A=y.append(`g`).attr(`transform`,`translate(0, ${v})`).attr(`class`,`treemapContainer`),j=R(p).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=ae().size([x,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=b({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`clip-path`,(e,t)=>`url(#clip-section-${i}-${t})`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=n(this),r=e.data.name;t.text(r);let i=e.x1-e.x0,a;a=u.showValues!==!1&&e.value?i-10-30-10-6:i-6-6;let o=Math.max(15,a),s=t.node();if(s.getComputedTextLength()>o){let e=r;for(;e.length>0;){if(e=r.substring(0,e.length-1),e.length===0){t.text(`...`),s.getComputedTextLength()>o&&t.text(``);break}if(t.text(e+`...`),s.getComputedTextLength()<=o)break}}}),u.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=F.length>20,L=I?16:38,z=I?14:28,B=I?4:8,V=I?4:6,H=I?2:4,U=I?8:10,W=I?1:2,G=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);G.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>b({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),G.append(`clipPath`).attr(`id`,(e,t)=>`clip-${i}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),G.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${L}px;fill:`+k(e.data.name)+`;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.data.name).each(function(e){let t=n(this),r=e.x1-e.x0,i=e.y1-e.y0,a=t.node(),o=r-2*H,s=i-2*H;if(oo&&c>B;)c--,t.style(`font-size`,`${c}px`);let u=Math.max(V,Math.min(z,Math.round(c*l))),d=c+W+u;for(;d>s&&c>B&&(c--,u=Math.max(V,Math.min(z,Math.round(c*l))),!(uo||c(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${z}px;fill:`+k(e.data.name)+`;`+b({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${i}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=n(this),r=this.parentNode;if(!r){t.style(`display`,`none`);return}let i=n(r).select(`.treemapLabel`);if(i.empty()||i.style(`display`)===`none`){t.style(`display`,`none`);return}let a=parseFloat(i.style(`font-size`)),o=Math.max(V,Math.min(z,Math.round(a*.6)));t.style(`font-size`,`${o}px`);let s=(e.y1-e.y0)/2+a/2+W;t.attr(`y`,s);let c=e.x1-e.x0,l=e.y1-e.y0-4,u=c-2*H;t.node().getComputedTextLength()>u||s+o>l||o{let t=r(),n=s(),i=g(t,n.themeVariables),a=g(ue,e),o=a.titleColor??i.titleColor,c=a.labelColor??i.textColor,l=a.valueColor??i.textColor;return` .treemapNode.section { stroke: ${a.sectionStrokeColor}; stroke-width: ${a.sectionStrokeWidth}; diff --git a/web/dist/app-diagram-ATOU4E4O.js b/web/dist/app-diagram-ATOU4E4O.js index f42272035..7db725fd2 100644 --- a/web/dist/app-diagram-ATOU4E4O.js +++ b/web/dist/app-diagram-ATOU4E4O.js @@ -1,3 +1,3 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{H as r,U as i,X as a,a as o,b as s,f as c,q as l,v as u,w as d,x as f,y as p,z as m}from"./app-chunk-O7XYJQB3.js";import{_ as h,i as g,t as ee}from"./app-chunk-ZIGJFQKS.js";import{T as te}from"./app-chunk-FOHPRMQF.js";import{t as ne}from"./app-chunk-JWPE2WC7.js";import{n as re}from"./app-mermaid-parser.core.js";var _=`position frame`,v=`frame positioned`,y=`position relation`,b=`relation positioned`,ie=e(function(e){t.debug(`options str`,e)},`setOptions`),ae=e(function(){return{}},`getOptions`),oe=e(function(){x(),o()},`clear`);function x(){S={}}e(x,`reset`);var se=c.eventmodeling,ce=e(()=>g({...se,...s().eventmodeling}),`getConfig`),S={};function C(){let e=le,{ast:n}=S,r=E();if(!n)throw Error(`No data for EventModel`);return n.frames.forEach((i,a)=>{let o=N(i,n.dataEntities,r);e=q(e,{$kind:_,index:a,frame:i,textProps:o});let s;B(i)?(t.debug(`source frame`,i.sourceFrames),s=n.frames.filter(e=>i.sourceFrames.some(t=>t.$refText===e.name)),s.forEach(t=>{e=q(e,{$kind:y,index:a,frame:i,sourceFrame:t})})):e=q(e,{$kind:y,index:a,frame:i})}),e={...e,sortedSwimlanesArray:L(e.swimlanes)},e}e(C,`getState`);function w(e){S.ast=e}e(w,`setAst`);var T={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:`bold`,boxTextPadding:10,swimlaneTextFontWeight:`bold`,labelUiAutomation:`UI/Automation`,labelUiAutomationPrefix:`UI/A: `,labelCommandReadModel:`Command/Read Model`,labelCommandReadModelPrefix:`C/RM: `,labelEvents:`Events`,labelEventsPrefix:`Stream: `};function E(){return T}e(E,`getDiagramProps`);var le={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function D(e){let t=e.split(`.`);if(t.length===2)return t[0]}e(D,`extractNamespace`);function O(e){let t=e.split(`.`);return t.length===2?t[1]:e}e(O,`extractName`);function k(e,t){if(!(!t||t.length===0))return Object.values(e).find(e=>e.namespace===t)}e(k,`findSwimlaneByNamespace`);function A(e,t,n){return Math.max(t,...Object.keys(e).filter(e=>{let r=Number.parseInt(e);return r>t&&rNumber.parseInt(e)))+1}e(A,`findNextAvailableIndex`);function j(e,t){let n=D(e.entityIdentifier),r=k(t,n);switch(e.modelEntityType){case`ui`:case`pcr`:case`processor`:return r?{index:r.index,label:r.namespace||T.labelUiAutomation}:n?{index:A(t,0,100),label:T.labelUiAutomationPrefix+n}:{index:0,label:T.labelUiAutomation};case`rmo`:case`readmodel`:case`cmd`:case`command`:return r?{index:r.index,label:r.namespace||T.labelCommandReadModel}:n?{index:A(t,100,200),label:T.labelCommandReadModelPrefix+n}:{index:100,label:T.labelCommandReadModel};default:return r?{index:r.index,label:r.namespace||T.labelEvents}:n?{index:A(t,200,300),label:T.labelEventsPrefix+n}:{index:200,label:T.labelEvents}}}e(j,`calculateSwimlaneProps`);function M(e){let{themeVariables:t}=s();switch(e.modelEntityType){case`ui`:return{fill:t.emUiFill??`white`,stroke:t.emUiStroke??`#dbdada`};case`pcr`:case`processor`:return{fill:t.emProcessorFill??`#edb3f6`,stroke:t.emProcessorStroke??`#b88cbf`};case`rmo`:case`readmodel`:return{fill:t.emReadModelFill??`#d3f1a2`,stroke:t.emReadModelStroke??`#a3b732`};case`cmd`:case`command`:return{fill:t.emCommandFill??`#bcd6fe`,stroke:t.emCommandStroke??`#679ac3`};case`evt`:case`event`:return{fill:t.emEventFill??`#ffb778`,stroke:t.emEventStroke??`#c19a0f`};default:return{fill:`red`,stroke:`black`}}}e(M,`calculateEntityVisualProps`);function N(e,n,r){let i=s(),a=m(O(e.entityIdentifier)??``,i),o,c={fontSize:16,fontWeight:700,fontFamily:`"trebuchet ms", verdana, arial, sans-serif`,joinWith:`
`},l=`${h(a,r.textMaxWidth,c)}`;if(e.dataInlineValue&&(o=e.dataInlineValue,o=o.substring(o.indexOf(`{`)+1),o=o.substring(0,o.lastIndexOf(`}`)-1),o=m(o,i),o=h(o,r.textMaxWidth,c),o=o.replaceAll(` `,` `)),e.dataReference){let t=n.find(t=>t.name===e.dataReference?.$refText);t&&(o=t.dataBlockValue,o=o.substring(o.indexOf(`{ -`)+2),o=o.substring(0,o.lastIndexOf(`}`)-1),o=m(o,i),o=h(o,r.textMaxWidth,c),o=o.replaceAll(` `,` `),o+=`
`)}let u=o!==void 0;u&&(l+=`

${o}`);let d={fontSize:c.fontSize,fontWeight:c.fontWeight,fontFamily:c.fontFamily},f=ee(l,d),p=u?f.width/3:f.width,g={content:l,width:p,height:f.height};return t.debug(`[${e.name}] ${e.entityIdentifier} text`,g),g}e(N,`calculateTextProps`);function P(e,t){let n=t,r=M(n.frame),i={width:n.textProps.width+2*T.boxTextPadding,height:n.textProps.height+2*T.boxTextPadding};return[{$kind:v,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps}]}e(P,`decidePositionFrame`);function F(e,t,n){return t===void 0?T.contentStartX:t.index===e.index&&e.r?e.r+T.boxPadding:n===void 0?T.contentStartX:n.r-T.boxOverlap+T.boxPadding}e(F,`calculateX`);function I(e,t){let n=[...e.map(e=>e.r),t];return Math.max(...n)}e(I,`calculateMaxRight`);function L(e){return Object.values(e).sort((e,t)=>e.index-t.index)}e(L,`sortedSwimlanesArray`);function R(e,t){let n=t,r=j(n.frame,e.swimlanes),i;i=r.index in e.swimlanes?e.swimlanes[r.index]:{index:r.index,label:r.label,r:0,y:r.index*T.swimlaneMinHeight+T.swimlaneGap,height:T.swimlaneMinHeight,maxHeight:T.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=e.previousSwimlaneNumber===void 0?void 0:e.swimlanes[e.previousSwimlaneNumber],s={width:Math.max(T.boxMinWidth,Math.min(T.boxMaxWidth,n.dimension.width))+2*T.boxPadding,height:Math.max(T.boxMinHeight,Math.min(T.boxMaxHeight,n.dimension.height))+2*T.boxPadding},c=F(i,o,a),l=c+s.width+T.boxPadding,u=I(Object.values(e.swimlanes),l);i.r=c+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(T.swimlaneMinHeight,i.maxHeight)+2*T.swimlanePadding;let d={x:c,y:T.swimlanePadding+i.y,r:l,dimension:s,leftSibling:!1,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},f={...e,boxes:[...e.boxes,d],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:u},p=L(f.swimlanes);p.length>0&&(p[0].y=0);for(let e=1;e0}e(B,`hasSourceFrame`);function V(e,t){if(t!=null)return e.find(e=>e.frame.name===t.name)}e(V,`findBoxByFrame`);function H(e,t,n){if(!(n<0))for(let r=n;r>=0;r--){let n=e[r];if(n.swimlane.index!==t)return n}}e(H,`findBoxByLineIndex`);function U(e,t){let n=t;if(te(n.frame)||z(n.index,n.frame))return[];let r=V(e.boxes,n.frame);if(r===void 0)throw Error(`Target box not found for frame ${n.frame.name}`);let i;return i=n.sourceFrame?V(e.boxes,n.sourceFrame):H(e.boxes,r.swimlane.index,n.index-1),i===void 0?[]:[{$kind:b,frame:n.frame,index:n.index,sourceBox:i,targetBox:r}]}e(U,`decidePositionRelation`);function W(e,t){let n=t,r={visual:{fill:`none`,stroke:`#000`},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,r]}}e(W,`evolveRelationPositioned`);var ue={[_]:P,[y]:U},de={[v]:R,[b]:W};function G(e,n){let r=ue[n.$kind];if(r==null)return[];let i=r(e,n);return t.debug(`decided events`,i),i}e(G,`decide`);function K(e,n){let r=n.reduce((e,t)=>{let n=de[t.$kind];return n==null?e:n(e,t)},e);return t.debug(`evolve events`,{state:e,newState:r,events:n}),r}e(K,`evolve`);function q(e,t){return K(e,G(e,t))}e(q,`dispatch`);var J={getConfig:ce,setOptions:ie,getOptions:ae,clear:oe,setAccTitle:i,getAccTitle:p,getAccDescription:u,setAccDescription:r,setDiagramTitle:l,getDiagramTitle:d,setAst:w,getDiagramProps:E,getState:C},fe={parse:e(async e=>{let n=await re(`eventmodeling`,e);t.debug(n),J.setAst(n),ne(n,J)},`parse`)},Y=f()?.eventmodeling;function X(e,t){return n=>{let r=n.swimlane.y+t.swimlanePadding,i=e.append(`g`).attr(`class`,`em-box`);i.append(`rect`).attr(`x`,n.x).attr(`y`,r).attr(`rx`,`3`).attr(`width`,n.dimension.width).attr(`height`,n.dimension.height).attr(`stroke`,n.visual.stroke).attr(`fill`,n.visual.fill),i.append(`foreignObject`).attr(`x`,n.x+t.boxPadding).attr(`y`,r+10).attr(`width`,n.dimension.width-2*t.boxPadding).attr(`height`,n.dimension.height-2*t.boxPadding).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`).append(`span`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(n.text)}}e(X,`renderD3Box`);function Z(e,t){return e>t}e(Z,`dirUpwards`);function Q(e,n,r,i){return a=>{let o=a.sourceBox.swimlane.y+n.swimlanePadding,s=a.targetBox.swimlane.y+n.swimlanePadding,c=Z(o,s),l=a.sourceBox.x+a.sourceBox.dimension.width*2/3,u=a.targetBox.x+a.targetBox.dimension.width/3,d,f;t.debug(`rendering relation up=${c} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),c?(d=o,f=s+a.targetBox.dimension.height):(d=o+a.sourceBox.dimension.height,f=s);let p=i.emRelationStroke??a.visual.stroke;e.append(`path`).attr(`class`,`em-relation`).attr(`fill`,a.visual.fill).attr(`stroke`,p).attr(`stroke-width`,`1`).attr(`marker-end`,`url(#${r})`).attr(`d`,`M${l} ${d} L${u} ${f}`)}}e(Q,`renderD3Relation`);function $(e,t,n,r){return i=>{let a=e.append(`g`).attr(`class`,`em-swimlane`),o=r.emSwimlaneBackgroundOdd??`rgb(250,250,250)`,s=r.emSwimlaneBackgroundStroke??`rgb(240,240,240)`;a.append(`rect`).attr(`x`,0).attr(`y`,i.y).attr(`rx`,`3`).attr(`width`,t+n.swimlanePadding).attr(`height`,i.height).attr(`fill`,o).attr(`stroke`,s),a.append(`text`).attr(`font-weight`,n.swimlaneTextFontWeight).attr(`x`,30).attr(`y`,i.y+30).text(i.label)}}e($,`renderD3Swimlane`);var pe={parser:fe,db:J,renderer:{draw:e(function(e,r,i,o){if(t.debug(`in eventmodeling renderer`,e+` -`,`id:`,r,i),!Y)throw Error(`EventModeling config not found`);let s=o.db,{themeVariables:c,eventmodeling:l}=f(),u=n(`[id="${r}"]`),d=s.getDiagramProps(),p=s.getState(),m=`em-arrowhead-${r}`,h=c.emArrowhead??`#000000`;p.sortedSwimlanesArray.forEach($(u,p.maxR,d,c)),p.boxes.forEach(X(u,d)),p.relations.forEach(Q(u,d,m,c)),u.append(`defs`).append(`marker`).attr(`id`,m).attr(`markerWidth`,`10`).attr(`markerHeight`,`7`).attr(`refX`,`10`).attr(`refY`,`3.5`).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0 0, 10 3.5, 0 7`).attr(`fill`,h),a(void 0,u,l?.padding??30,l?.useMaxWidth)},`draw`)},styles:e(e=>``,`getStyles`)};export{pe as diagram}; \ No newline at end of file +import{T as e}from"./app-chunk-FOHPRMQF.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,U as a,X as o,a as s,b as c,f as l,q as u,v as d,w as f,x as p,y as m,z as h}from"./app-chunk-O7XYJQB3.js";import{_ as g,i as ee,t as te}from"./app-chunk-ZIGJFQKS.js";import{t as ne}from"./app-chunk-JWPE2WC7.js";import{n as re}from"./app-mermaid-parser.core.js";var _=`position frame`,v=`frame positioned`,y=`position relation`,b=`relation positioned`,ie=t(function(e){n.debug(`options str`,e)},`setOptions`),ae=t(function(){return{}},`getOptions`),oe=t(function(){x(),s()},`clear`);function x(){S={}}t(x,`reset`);var se=l.eventmodeling,ce=t(()=>ee({...se,...c().eventmodeling}),`getConfig`),S={};function C(){let e=le,{ast:t}=S,r=E();if(!t)throw Error(`No data for EventModel`);return t.frames.forEach((i,a)=>{let o=N(i,t.dataEntities,r);e=q(e,{$kind:_,index:a,frame:i,textProps:o});let s;B(i)?(n.debug(`source frame`,i.sourceFrames),s=t.frames.filter(e=>i.sourceFrames.some(t=>t.$refText===e.name)),s.forEach(t=>{e=q(e,{$kind:y,index:a,frame:i,sourceFrame:t})})):e=q(e,{$kind:y,index:a,frame:i})}),e={...e,sortedSwimlanesArray:L(e.swimlanes)},e}t(C,`getState`);function w(e){S.ast=e}t(w,`setAst`);var T={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:`bold`,boxTextPadding:10,swimlaneTextFontWeight:`bold`,labelUiAutomation:`UI/Automation`,labelUiAutomationPrefix:`UI/A: `,labelCommandReadModel:`Command/Read Model`,labelCommandReadModelPrefix:`C/RM: `,labelEvents:`Events`,labelEventsPrefix:`Stream: `};function E(){return T}t(E,`getDiagramProps`);var le={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function D(e){let t=e.split(`.`);if(t.length===2)return t[0]}t(D,`extractNamespace`);function O(e){let t=e.split(`.`);return t.length===2?t[1]:e}t(O,`extractName`);function k(e,t){if(!(!t||t.length===0))return Object.values(e).find(e=>e.namespace===t)}t(k,`findSwimlaneByNamespace`);function A(e,t,n){return Math.max(t,...Object.keys(e).filter(e=>{let r=Number.parseInt(e);return r>t&&rNumber.parseInt(e)))+1}t(A,`findNextAvailableIndex`);function j(e,t){let n=D(e.entityIdentifier),r=k(t,n);switch(e.modelEntityType){case`ui`:case`pcr`:case`processor`:return r?{index:r.index,label:r.namespace||T.labelUiAutomation}:n?{index:A(t,0,100),label:T.labelUiAutomationPrefix+n}:{index:0,label:T.labelUiAutomation};case`rmo`:case`readmodel`:case`cmd`:case`command`:return r?{index:r.index,label:r.namespace||T.labelCommandReadModel}:n?{index:A(t,100,200),label:T.labelCommandReadModelPrefix+n}:{index:100,label:T.labelCommandReadModel};default:return r?{index:r.index,label:r.namespace||T.labelEvents}:n?{index:A(t,200,300),label:T.labelEventsPrefix+n}:{index:200,label:T.labelEvents}}}t(j,`calculateSwimlaneProps`);function M(e){let{themeVariables:t}=c();switch(e.modelEntityType){case`ui`:return{fill:t.emUiFill??`white`,stroke:t.emUiStroke??`#dbdada`};case`pcr`:case`processor`:return{fill:t.emProcessorFill??`#edb3f6`,stroke:t.emProcessorStroke??`#b88cbf`};case`rmo`:case`readmodel`:return{fill:t.emReadModelFill??`#d3f1a2`,stroke:t.emReadModelStroke??`#a3b732`};case`cmd`:case`command`:return{fill:t.emCommandFill??`#bcd6fe`,stroke:t.emCommandStroke??`#679ac3`};case`evt`:case`event`:return{fill:t.emEventFill??`#ffb778`,stroke:t.emEventStroke??`#c19a0f`};default:return{fill:`red`,stroke:`black`}}}t(M,`calculateEntityVisualProps`);function N(e,t,r){let i=c(),a=h(O(e.entityIdentifier)??``,i),o,s={fontSize:16,fontWeight:700,fontFamily:`"trebuchet ms", verdana, arial, sans-serif`,joinWith:`
`},l=`${g(a,r.textMaxWidth,s)}`;if(e.dataInlineValue&&(o=e.dataInlineValue,o=o.substring(o.indexOf(`{`)+1),o=o.substring(0,o.lastIndexOf(`}`)-1),o=h(o,i),o=g(o,r.textMaxWidth,s),o=o.replaceAll(` `,` `)),e.dataReference){let n=t.find(t=>t.name===e.dataReference?.$refText);n&&(o=n.dataBlockValue,o=o.substring(o.indexOf(`{ +`)+2),o=o.substring(0,o.lastIndexOf(`}`)-1),o=h(o,i),o=g(o,r.textMaxWidth,s),o=o.replaceAll(` `,` `),o+=`
`)}let u=o!==void 0;u&&(l+=`

${o}`);let d={fontSize:s.fontSize,fontWeight:s.fontWeight,fontFamily:s.fontFamily},f=te(l,d),p=u?f.width/3:f.width,m={content:l,width:p,height:f.height};return n.debug(`[${e.name}] ${e.entityIdentifier} text`,m),m}t(N,`calculateTextProps`);function P(e,t){let n=t,r=M(n.frame),i={width:n.textProps.width+2*T.boxTextPadding,height:n.textProps.height+2*T.boxTextPadding};return[{$kind:v,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps}]}t(P,`decidePositionFrame`);function F(e,t,n){return t===void 0?T.contentStartX:t.index===e.index&&e.r?e.r+T.boxPadding:n===void 0?T.contentStartX:n.r-T.boxOverlap+T.boxPadding}t(F,`calculateX`);function I(e,t){let n=[...e.map(e=>e.r),t];return Math.max(...n)}t(I,`calculateMaxRight`);function L(e){return Object.values(e).sort((e,t)=>e.index-t.index)}t(L,`sortedSwimlanesArray`);function R(e,t){let n=t,r=j(n.frame,e.swimlanes),i;i=r.index in e.swimlanes?e.swimlanes[r.index]:{index:r.index,label:r.label,r:0,y:r.index*T.swimlaneMinHeight+T.swimlaneGap,height:T.swimlaneMinHeight,maxHeight:T.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=e.previousSwimlaneNumber===void 0?void 0:e.swimlanes[e.previousSwimlaneNumber],s={width:Math.max(T.boxMinWidth,Math.min(T.boxMaxWidth,n.dimension.width))+2*T.boxPadding,height:Math.max(T.boxMinHeight,Math.min(T.boxMaxHeight,n.dimension.height))+2*T.boxPadding},c=F(i,o,a),l=c+s.width+T.boxPadding,u=I(Object.values(e.swimlanes),l);i.r=c+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(T.swimlaneMinHeight,i.maxHeight)+2*T.swimlanePadding;let d={x:c,y:T.swimlanePadding+i.y,r:l,dimension:s,leftSibling:!1,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},f={...e,boxes:[...e.boxes,d],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:u},p=L(f.swimlanes);p.length>0&&(p[0].y=0);for(let e=1;e0}t(B,`hasSourceFrame`);function V(e,t){if(t!=null)return e.find(e=>e.frame.name===t.name)}t(V,`findBoxByFrame`);function H(e,t,n){if(!(n<0))for(let r=n;r>=0;r--){let n=e[r];if(n.swimlane.index!==t)return n}}t(H,`findBoxByLineIndex`);function U(t,n){let r=n;if(e(r.frame)||z(r.index,r.frame))return[];let i=V(t.boxes,r.frame);if(i===void 0)throw Error(`Target box not found for frame ${r.frame.name}`);let a;return a=r.sourceFrame?V(t.boxes,r.sourceFrame):H(t.boxes,i.swimlane.index,r.index-1),a===void 0?[]:[{$kind:b,frame:r.frame,index:r.index,sourceBox:a,targetBox:i}]}t(U,`decidePositionRelation`);function W(e,t){let n=t,r={visual:{fill:`none`,stroke:`#000`},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,r]}}t(W,`evolveRelationPositioned`);var ue={[_]:P,[y]:U},de={[v]:R,[b]:W};function G(e,t){let r=ue[t.$kind];if(r==null)return[];let i=r(e,t);return n.debug(`decided events`,i),i}t(G,`decide`);function K(e,t){let r=t.reduce((e,t)=>{let n=de[t.$kind];return n==null?e:n(e,t)},e);return n.debug(`evolve events`,{state:e,newState:r,events:t}),r}t(K,`evolve`);function q(e,t){return K(e,G(e,t))}t(q,`dispatch`);var J={getConfig:ce,setOptions:ie,getOptions:ae,clear:oe,setAccTitle:a,getAccTitle:m,getAccDescription:d,setAccDescription:i,setDiagramTitle:u,getDiagramTitle:f,setAst:w,getDiagramProps:E,getState:C},fe={parse:t(async e=>{let t=await re(`eventmodeling`,e);n.debug(t),J.setAst(t),ne(t,J)},`parse`)},Y=p()?.eventmodeling;function X(e,t){return n=>{let r=n.swimlane.y+t.swimlanePadding,i=e.append(`g`).attr(`class`,`em-box`);i.append(`rect`).attr(`x`,n.x).attr(`y`,r).attr(`rx`,`3`).attr(`width`,n.dimension.width).attr(`height`,n.dimension.height).attr(`stroke`,n.visual.stroke).attr(`fill`,n.visual.fill),i.append(`foreignObject`).attr(`x`,n.x+t.boxPadding).attr(`y`,r+10).attr(`width`,n.dimension.width-2*t.boxPadding).attr(`height`,n.dimension.height-2*t.boxPadding).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`).append(`span`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(n.text)}}t(X,`renderD3Box`);function Z(e,t){return e>t}t(Z,`dirUpwards`);function Q(e,t,r,i){return a=>{let o=a.sourceBox.swimlane.y+t.swimlanePadding,s=a.targetBox.swimlane.y+t.swimlanePadding,c=Z(o,s),l=a.sourceBox.x+a.sourceBox.dimension.width*2/3,u=a.targetBox.x+a.targetBox.dimension.width/3,d,f;n.debug(`rendering relation up=${c} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),c?(d=o,f=s+a.targetBox.dimension.height):(d=o+a.sourceBox.dimension.height,f=s);let p=i.emRelationStroke??a.visual.stroke;e.append(`path`).attr(`class`,`em-relation`).attr(`fill`,a.visual.fill).attr(`stroke`,p).attr(`stroke-width`,`1`).attr(`marker-end`,`url(#${r})`).attr(`d`,`M${l} ${d} L${u} ${f}`)}}t(Q,`renderD3Relation`);function $(e,t,n,r){return i=>{let a=e.append(`g`).attr(`class`,`em-swimlane`),o=r.emSwimlaneBackgroundOdd??`rgb(250,250,250)`,s=r.emSwimlaneBackgroundStroke??`rgb(240,240,240)`;a.append(`rect`).attr(`x`,0).attr(`y`,i.y).attr(`rx`,`3`).attr(`width`,t+n.swimlanePadding).attr(`height`,i.height).attr(`fill`,o).attr(`stroke`,s),a.append(`text`).attr(`font-weight`,n.swimlaneTextFontWeight).attr(`x`,30).attr(`y`,i.y+30).text(i.label)}}t($,`renderD3Swimlane`);var pe={parser:fe,db:J,renderer:{draw:t(function(e,t,i,a){if(n.debug(`in eventmodeling renderer`,e+` +`,`id:`,t,i),!Y)throw Error(`EventModeling config not found`);let s=a.db,{themeVariables:c,eventmodeling:l}=p(),u=r(`[id="${t}"]`),d=s.getDiagramProps(),f=s.getState(),m=`em-arrowhead-${t}`,h=c.emArrowhead??`#000000`;f.sortedSwimlanesArray.forEach($(u,f.maxR,d,c)),f.boxes.forEach(X(u,d)),f.relations.forEach(Q(u,d,m,c)),u.append(`defs`).append(`marker`).attr(`id`,m).attr(`markerWidth`,`10`).attr(`markerHeight`,`7`).attr(`refX`,`10`).attr(`refY`,`3.5`).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0 0, 10 3.5, 0 7`).attr(`fill`,h),o(void 0,u,l?.padding??30,l?.useMaxWidth)},`draw`)},styles:t(e=>``,`getStyles`)};export{pe as diagram}; \ No newline at end of file diff --git a/web/dist/app-diagram-CDSNMT55.js b/web/dist/app-diagram-CDSNMT55.js index 11c0962b7..6495a98eb 100644 --- a/web/dist/app-diagram-CDSNMT55.js +++ b/web/dist/app-diagram-CDSNMT55.js @@ -1,6 +1,6 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{H as n,U as r,a as i,b as a,c as o,f as s,q as c,v as l,w as u,y as d,z as f}from"./app-chunk-O7XYJQB3.js";import{i as p}from"./app-chunk-ZIGJFQKS.js";import{t as m}from"./app-chunk-6AEJRKK7.js";import{r as h,t as g}from"./app-chunk-742MDFTN.js";import{t as _}from"./app-chunk-JWPE2WC7.js";import{n as v}from"./app-mermaid-parser.core.js";import{t as y}from"./app-chunk-2Q5K7J3B.js";var b=/[─━│┃└┗├┣]/,x=/[└┗├┣]/,S=/[─━]/,C=/^[\s│┃]+$/,w=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,T=/^\s*%%/,E=` `;function D(e){return e.some(e=>b.test(e))}e(D,`isBoxDrawingFormat`);function O(e){for(let t of e){let e=x.exec(t);if(e?.index&&e.index>0)return e.index}return 4}e(O,`inferSegmentWidth`);function k(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let r=parseInt(n,10),i=t.get(r);return i?`line ${i}`:e})}e(k,`remapErrorLines`);function A(e){let t=e.split(` +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{H as n,U as r,a as i,b as a,c as o,f as s,q as c,v as l,w as u,y as d,z as f}from"./app-chunk-O7XYJQB3.js";import{i as p}from"./app-chunk-ZIGJFQKS.js";import{t as m}from"./app-chunk-6AEJRKK7.js";import{t as h}from"./app-chunk-JWPE2WC7.js";import{n as g}from"./app-mermaid-parser.core.js";import{r as _,t as v}from"./app-chunk-742MDFTN.js";import{t as y}from"./app-chunk-2Q5K7J3B.js";var b=/[─━│┃└┗├┣]/,x=/[└┗├┣]/,S=/[─━]/,C=/^[\s│┃]+$/,w=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,T=/^\s*%%/,E=` `;function D(e){return e.some(e=>b.test(e))}e(D,`isBoxDrawingFormat`);function O(e){for(let t of e){let e=x.exec(t);if(e?.index&&e.index>0)return e.index}return 4}e(O,`inferSegmentWidth`);function k(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let r=parseInt(n,10),i=t.get(r);return i?`line ${i}`:e})}e(k,`remapErrorLines`);function A(e){let t=e.split(` `),n=new Map,r=-1;for(let[e,n]of t.entries())if(n.trim()===`treeView-beta`){r=e;break}if(r===-1)return{text:e,lineMap:n};let i=[];for(let e=r+1;e({cnt:1,stack:[{id:0,level:-1,name:`/`,nodeType:`directory`,children:[]}]})),M=e(()=>{j.reset(),i()},`clear`),N=e(()=>j.records.stack[0],`getRoot`),P=e(()=>j.records.cnt,`getCount`),F=s.treeView,I={clear:M,addNode:e((e,t,n,r,i,a)=>{for(;e<=j.records.stack[j.records.stack.length-1].level;)j.records.stack.pop();let o={id:j.records.cnt++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:a,children:[]};j.records.stack[j.records.stack.length-1].children.push(o),j.records.stack.push(o)},`addNode`),getRoot:N,getCount:P,getConfig:e(()=>p(F,a().treeView),`getConfig`),getAccTitle:d,getAccDescription:l,getDiagramTitle:u,setAccDescription:n,setAccTitle:r,setDiagramTitle:c},L=e(e=>{_(e,I);for(let t of e.nodes){let e=typeof t.indent==`number`?t.indent:0,n=t.name,r=n.endsWith(`/`);r&&(n=n.slice(0,-1));let i=r?`directory`:`file`,o=t.classAnnotation||void 0,s=t.iconAnnotation,c=s===void 0?void 0:s||`none`,l=t.descAnnotation||void 0,u=l?f(l,a()):void 0;I.addNode(e,n,i,o,c,u)}},`populate`),R={parse:e(async e=>{let{text:n,lineMap:r}=A(e);try{let e=await v(`treeView`,n);t.debug(e),L(e)}catch(e){throw r.size>0&&e instanceof Error&&(e.message=k(e.message,r)),e}},`parse`)},z={prefix:`mermaid-treeview`,height:24,width:24,icons:{folder:{body:``},file:{body:``}}};function B(e,t){let n=t?.filenameIcons?.[e];if(n)return n;let r=e.lastIndexOf(`.`);if(r>0){let n=e.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[n]??i?.[n.slice(1)]}}e(B,`detectIcon`);function V(e,t){return e.includes(`:`)?e:e in z.icons||!t?`${z.prefix}:${e}`:`${t}:${e}`}e(V,`qualifyIcon`);function H(e,t){if(e.icon!==`none`){if(e.icon)return V(e.icon,t.defaultIconPack);if(t.showIcons){if(e.nodeType===`file`){let n=B(e.name,t);if(n===`none`)return;if(n)return V(n,t.defaultIconPack)}return`${z.prefix}:${e.nodeType===`directory`?`folder`:`file`}`}}}e(H,`getNodeIcon`),h([{name:z.prefix,icons:z}]);var U=14,W=4,G=16,K=e(async(t,n)=>{let r=[],i=e(e=>{let t=H(e,n);t&&r.push({icon:t,node:e}),e.children.forEach(i)},`collect`);i(t);let a=await Promise.all(r.map(async({icon:e,node:t})=>({id:t.id,svg:await g(e,{height:U,width:U})})));return new Map(a.map(({id:e,svg:t})=>[e,t]))},`resolveNodeIcons`),q=e((e,t,n,r,i,a)=>{let o=r.append(`g`),s=`treeView-node-label`;n.nodeType===`directory`&&(s+=` treeView-node-dir`),n.cssClass&&(s+=` ${n.cssClass}`);let c=U+W,l=H(n,i),u=l!==void 0;l&&o.append(`g`).attr(`class`,`treeView-node-icon`).attr(`transform`,`translate(${e+i.paddingX}, ${t+i.paddingY})`).html(a.get(n.id)??``);let d=o.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,s),{height:f,width:p}=d.node().getBBox(),m=f+i.paddingY*2,h=e+i.paddingX+(u?c:0);d.attr(`x`,h),d.attr(`y`,t+m/2);let g=h+p;return n.BBox={x:e,y:t,width:p+i.paddingX*2+(u?c:0),height:m},n.cssClass?.split(/\s+/).includes(`highlight`)&&o.insert(`rect`,`:first-child`).attr(`x`,e).attr(`y`,t+1).attr(`width`,0).attr(`height`,m-2).attr(`rx`,3).attr(`class`,`treeView-highlight-bg`),{node:n,nodeGroup:o,labelRightEdge:g,centerY:t+m/2}},`positionLabel`),J=e((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),Y=e((t,n,r,i)=>{let a=0,o=0,s=[],c=e((e,t,n,r)=>{let c=r*(n.rowIndent+n.paddingX),l=q(c,a,t,e,n,i);s.push(l);let{height:u,width:d}=t.BBox;J(e,c-n.rowIndent,a+u/2,c,a+u/2,n.lineThickness),o=Math.max(o,c+d),a+=u},`drawNode`),l=e((e,n=0)=>{c(t,e,r,n),e.children.forEach(e=>{l(e,n+1)});let{x:i,y:a,height:o}=e.BBox;if(e.children.length){let{y:n,height:s}=e.children[e.children.length-1].BBox;J(t,i+r.paddingX,a+o,i+r.paddingX,n+s/2+r.lineThickness/2,r.lineThickness)}},`processNode`);l(n);let u=s.filter(e=>e.node.description);if(u.length>0){let e=Math.max(...s.map(e=>e.labelRightEdge))+G;for(let t of u){let n=t.nodeGroup.append(`text`).text(t.node.description).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-description`).attr(`x`,e).attr(`y`,t.centerY).node().getBBox();o=Math.max(o,e+n.width+r.paddingX)}}for(let e of s)if(e.node.cssClass?.split(/\s+/).includes(`highlight`)){let t=e.nodeGroup.select(`.treeView-highlight-bg`);if(!t.empty()){let n=o-e.node.BBox.x+8;t.attr(`width`,n),o=Math.max(o,e.node.BBox.x+n+2)}}return{totalHeight:a,totalWidth:o}},`drawTree`),X={draw:e(async(e,n,r,i)=>{t.debug(`Rendering treeView diagram +`),lineMap:n}}e(A,`preprocessBoxDrawing`);var j=new y(()=>({cnt:1,stack:[{id:0,level:-1,name:`/`,nodeType:`directory`,children:[]}]})),M=e(()=>{j.reset(),i()},`clear`),N=e(()=>j.records.stack[0],`getRoot`),P=e(()=>j.records.cnt,`getCount`),F=s.treeView,I={clear:M,addNode:e((e,t,n,r,i,a)=>{for(;e<=j.records.stack[j.records.stack.length-1].level;)j.records.stack.pop();let o={id:j.records.cnt++,level:e,name:t,nodeType:n,icon:i,cssClass:r,description:a,children:[]};j.records.stack[j.records.stack.length-1].children.push(o),j.records.stack.push(o)},`addNode`),getRoot:N,getCount:P,getConfig:e(()=>p(F,a().treeView),`getConfig`),getAccTitle:d,getAccDescription:l,getDiagramTitle:u,setAccDescription:n,setAccTitle:r,setDiagramTitle:c},L=e(e=>{h(e,I);for(let t of e.nodes){let e=typeof t.indent==`number`?t.indent:0,n=t.name,r=n.endsWith(`/`);r&&(n=n.slice(0,-1));let i=r?`directory`:`file`,o=t.classAnnotation||void 0,s=t.iconAnnotation,c=s===void 0?void 0:s||`none`,l=t.descAnnotation||void 0,u=l?f(l,a()):void 0;I.addNode(e,n,i,o,c,u)}},`populate`),R={parse:e(async e=>{let{text:n,lineMap:r}=A(e);try{let e=await g(`treeView`,n);t.debug(e),L(e)}catch(e){throw r.size>0&&e instanceof Error&&(e.message=k(e.message,r)),e}},`parse`)},z={prefix:`mermaid-treeview`,height:24,width:24,icons:{folder:{body:``},file:{body:``}}};function B(e,t){let n=t?.filenameIcons?.[e];if(n)return n;let r=e.lastIndexOf(`.`);if(r>0){let n=e.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[n]??i?.[n.slice(1)]}}e(B,`detectIcon`);function V(e,t){return e.includes(`:`)?e:e in z.icons||!t?`${z.prefix}:${e}`:`${t}:${e}`}e(V,`qualifyIcon`);function H(e,t){if(e.icon!==`none`){if(e.icon)return V(e.icon,t.defaultIconPack);if(t.showIcons){if(e.nodeType===`file`){let n=B(e.name,t);if(n===`none`)return;if(n)return V(n,t.defaultIconPack)}return`${z.prefix}:${e.nodeType===`directory`?`folder`:`file`}`}}}e(H,`getNodeIcon`),_([{name:z.prefix,icons:z}]);var U=14,W=4,G=16,K=e(async(t,n)=>{let r=[],i=e(e=>{let t=H(e,n);t&&r.push({icon:t,node:e}),e.children.forEach(i)},`collect`);i(t);let a=await Promise.all(r.map(async({icon:e,node:t})=>({id:t.id,svg:await v(e,{height:U,width:U})})));return new Map(a.map(({id:e,svg:t})=>[e,t]))},`resolveNodeIcons`),q=e((e,t,n,r,i,a)=>{let o=r.append(`g`),s=`treeView-node-label`;n.nodeType===`directory`&&(s+=` treeView-node-dir`),n.cssClass&&(s+=` ${n.cssClass}`);let c=U+W,l=H(n,i),u=l!==void 0;l&&o.append(`g`).attr(`class`,`treeView-node-icon`).attr(`transform`,`translate(${e+i.paddingX}, ${t+i.paddingY})`).html(a.get(n.id)??``);let d=o.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,s),{height:f,width:p}=d.node().getBBox(),m=f+i.paddingY*2,h=e+i.paddingX+(u?c:0);d.attr(`x`,h),d.attr(`y`,t+m/2);let g=h+p;return n.BBox={x:e,y:t,width:p+i.paddingX*2+(u?c:0),height:m},n.cssClass?.split(/\s+/).includes(`highlight`)&&o.insert(`rect`,`:first-child`).attr(`x`,e).attr(`y`,t+1).attr(`width`,0).attr(`height`,m-2).attr(`rx`,3).attr(`class`,`treeView-highlight-bg`),{node:n,nodeGroup:o,labelRightEdge:g,centerY:t+m/2}},`positionLabel`),J=e((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),Y=e((t,n,r,i)=>{let a=0,o=0,s=[],c=e((e,t,n,r)=>{let c=r*(n.rowIndent+n.paddingX),l=q(c,a,t,e,n,i);s.push(l);let{height:u,width:d}=t.BBox;J(e,c-n.rowIndent,a+u/2,c,a+u/2,n.lineThickness),o=Math.max(o,c+d),a+=u},`drawNode`),l=e((e,n=0)=>{c(t,e,r,n),e.children.forEach(e=>{l(e,n+1)});let{x:i,y:a,height:o}=e.BBox;if(e.children.length){let{y:n,height:s}=e.children[e.children.length-1].BBox;J(t,i+r.paddingX,a+o,i+r.paddingX,n+s/2+r.lineThickness/2,r.lineThickness)}},`processNode`);l(n);let u=s.filter(e=>e.node.description);if(u.length>0){let e=Math.max(...s.map(e=>e.labelRightEdge))+G;for(let t of u){let n=t.nodeGroup.append(`text`).text(t.node.description).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-description`).attr(`x`,e).attr(`y`,t.centerY).node().getBBox();o=Math.max(o,e+n.width+r.paddingX)}}for(let e of s)if(e.node.cssClass?.split(/\s+/).includes(`highlight`)){let t=e.nodeGroup.select(`.treeView-highlight-bg`);if(!t.empty()){let n=o-e.node.BBox.x+8;t.attr(`width`,n),o=Math.max(o,e.node.BBox.x+n+2)}}return{totalHeight:a,totalWidth:o}},`drawTree`),X={draw:e(async(e,n,r,i)=>{t.debug(`Rendering treeView diagram `+e);let a=i.db,s=a.getRoot(),c=a.getConfig(),l=m(n),u=l.append(`g`);u.attr(`class`,`tree-view`);let{totalHeight:d,totalWidth:f}=Y(u,s,c,await K(s,c));l.attr(`viewBox`,`-${c.lineThickness/2} 0 ${f} ${d}`),o(l,d,f,c.useMaxWidth)},`draw`)},Z={labelFontSize:`16px`,labelColor:`black`,lineColor:`black`,iconColor:`#546e7a`,descriptionColor:`#6a9955`,highlightBg:`rgba(255, 193, 7, 0.15)`,highlightStroke:`#ffc107`},Q={db:I,renderer:X,parser:R,styles:e(({treeView:e})=>{let{labelFontSize:t,labelColor:n,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:o,highlightStroke:s}=p(Z,e);return` .treeView-node-label { font-size: ${t}; diff --git a/web/dist/app-ebnfDiagram-ZINNZB2B.js b/web/dist/app-ebnfDiagram-ZINNZB2B.js index 0f8c1ad18..85d12786b 100644 --- a/web/dist/app-ebnfDiagram-ZINNZB2B.js +++ b/web/dist/app-ebnfDiagram-ZINNZB2B.js @@ -1 +1 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n}from"./app-chunk-2ZTRR5NV.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=n().RailroadEbnf.parser.LangiumParser,l=e(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformChoice`),u=e(e=>{let t=e.elements.map(p);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=e(e=>{switch(e.$type){case`EbnfTerminal`:return{type:`terminal`,value:e.value};case`EbnfNonTerminal`:return{type:`nonterminal`,name:e.name};case`EbnfSpecial`:return{type:`special`,text:e.text};case`EbnfGroup`:return l(e.element);case`EbnfOptional`:return{type:`optional`,element:l(e.element)};case`EbnfRepetition`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported EBNF primary node: ${e.$type}`)}},`transformPrimary`),f=e((e,t)=>{switch(t.$type){case`EbnfOptionalPostfix`:return{type:`optional`,element:e};case`EbnfZeroOrMorePostfix`:return{type:`repetition`,element:e,min:0,max:1/0};case`EbnfOneOrMorePostfix`:return{type:`repetition`,element:e,min:1,max:1/0};case`EbnfExceptionPostfix`:return{type:`sequence`,elements:[e,{type:`terminal`,value:`-`},d(t.except)]};default:throw Error(`Unsupported EBNF postfix node: ${t.$type}`)}},`transformPostfix`),p=e(e=>e.postfixes.reduce((e,t)=>f(e,t),d(e.base)),`transformTerm`),m=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=e(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:e(e=>{a.clear(),t.debug(`[EBNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new s(n);let r=n.value;t.debug(`[EBNF Parser] Parsed rules:`,r.rules.length),h(r),t.debug(`[EBNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{g as diagram}; \ No newline at end of file +import{n as e}from"./app-chunk-2ZTRR5NV.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=e().RailroadEbnf.parser.LangiumParser,l=t(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformChoice`),u=t(e=>{let t=e.elements.map(p);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=t(e=>{switch(e.$type){case`EbnfTerminal`:return{type:`terminal`,value:e.value};case`EbnfNonTerminal`:return{type:`nonterminal`,name:e.name};case`EbnfSpecial`:return{type:`special`,text:e.text};case`EbnfGroup`:return l(e.element);case`EbnfOptional`:return{type:`optional`,element:l(e.element)};case`EbnfRepetition`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported EBNF primary node: ${e.$type}`)}},`transformPrimary`),f=t((e,t)=>{switch(t.$type){case`EbnfOptionalPostfix`:return{type:`optional`,element:e};case`EbnfZeroOrMorePostfix`:return{type:`repetition`,element:e,min:0,max:1/0};case`EbnfOneOrMorePostfix`:return{type:`repetition`,element:e,min:1,max:1/0};case`EbnfExceptionPostfix`:return{type:`sequence`,elements:[e,{type:`terminal`,value:`-`},d(t.except)]};default:throw Error(`Unsupported EBNF postfix node: ${t.$type}`)}},`transformPostfix`),p=t(e=>e.postfixes.reduce((e,t)=>f(e,t),d(e.base)),`transformTerm`),m=t(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=t(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(m(e)))},`populateDb`),g={parser:{parse:t(e=>{a.clear(),n.debug(`[EBNF Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;n.debug(`[EBNF Parser] Parsed rules:`,r.rules.length),h(r),n.debug(`[EBNF Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{g as diagram}; \ No newline at end of file diff --git a/web/dist/app-elk-276RUBZZ.js b/web/dist/app-elk-276RUBZZ.js index bd575ad2e..82a908df1 100644 --- a/web/dist/app-elk-276RUBZZ.js +++ b/web/dist/app-elk-276RUBZZ.js @@ -1,4 +1,4 @@ -import{i as e,r as t,t as n}from"./app-rolldown-runtime.js";import{n as r}from"./app-chunk-Y2CYZVJY.js";import"./app-src.js";import{G as i}from"./app-chunk-O7XYJQB3.js";import{rt as a}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import{n as o}from"./app-chunk-UA2S7LBM.js";import{o as s,s as c}from"./app-chunk-Z7XXMR3K.js";import{a as l,r as u}from"./app-chunk-3FUC2YCW.js";import{t as d}from"./app-chunk-NETBCI7D.js";var f=e(n(((e,n)=>{(function(t){if(typeof e==`object`&&n!==void 0)n.exports=t();else if(typeof define==`function`&&define.amd)define([],t);else{var r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this;r.ELK=t()}})(function(){return(function(){function e(n,r,i){function a(s,c){if(!r[s]){if(!n[s]){var l=typeof t==`function`&&t;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=r[s]={exports:{}};n[s][0].call(d.exports,function(e){var t=n[s][1][e];return a(t||e)},d,d.exports,e,n,r,i)}return r[s].exports}for(var o=typeof t==`function`&&t,s=0;s0&&arguments[0]!==void 0?arguments[0]:{},r=n.defaultLayoutOptions,o=r===void 0?{}:r,s=n.algorithms,c=s===void 0?[`layered`,`stress`,`mrtree`,`radial`,`force`,`disco`,`sporeOverlap`,`sporeCompaction`,`rectpacking`]:s,l=n.workerFactory,u=n.workerUrl;if(i(this,e),this.defaultLayoutOptions=o,this.initialized=!1,u===void 0&&l===void 0)throw Error(`Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.`);var d=l;u!==void 0&&l===void 0&&(d=function(e){return new Worker(e)});var f=d(u);if(typeof f.postMessage!=`function`)throw TypeError(`Created worker does not provide the required 'postMessage' function.`);this.worker=new a(f),this.worker.postMessage({cmd:`register`,algorithms:c}).then(function(e){return t.initialized=!0}).catch(console.err)}return r(e,[{key:`layout`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.layoutOptions,r=n===void 0?this.defaultLayoutOptions:n,i=t.logging,a=i!==void 0&&i,o=t.measureExecutionTime,s=o!==void 0&&o;return e?this.worker.postMessage({cmd:`layout`,graph:e,layoutOptions:r,options:{logging:a,measureExecutionTime:s}}):Promise.reject(Error(`Missing mandatory parameter 'graph'.`))}},{key:`knownLayoutAlgorithms`,value:function(){return this.worker.postMessage({cmd:`algorithms`})}},{key:`knownLayoutOptions`,value:function(){return this.worker.postMessage({cmd:`options`})}},{key:`knownLayoutCategories`,value:function(){return this.worker.postMessage({cmd:`categories`})}},{key:`terminateWorker`,value:function(){this.worker&&this.worker.terminate()}}]),e}();var a=function(){function e(t){var n=this;if(i(this,e),t===void 0)throw Error(`Missing mandatory parameter 'worker'.`);this.resolvers={},this.worker=t,this.worker.onmessage=function(e){setTimeout(function(){n.receive(n,e)},0)}}return r(e,[{key:`postMessage`,value:function(e){var t=this.id||0;this.id=t+1,e.id=t;var n=this;return new Promise(function(r,i){n.resolvers[t]=function(e,t){e?(n.convertGwtStyleError(e),i(e)):r(t)},n.worker.postMessage(e)})}},{key:`receive`,value:function(e,t){var n=t.data,r=e.resolvers[n.id];r&&(delete e.resolvers[n.id],n.error?r(n.error):r(null,n.data))}},{key:`terminate`,value:function(){this.worker&&this.worker.terminate()}},{key:`convertGwtStyleError`,value:function(e){if(e){var t=e.__java$exception;t&&(t.cause&&t.cause.backingJsObject&&(e.cause=t.cause.backingJsObject,this.convertGwtStyleError(e.cause)),delete e.__java$exception)}}}]),e}()},{}],2:[function(e,t,n){(function(e){(function(){var r;typeof window<`u`?r=window:e===void 0?typeof self<`u`&&(r=self):r=e;var i;function a(){}function o(){}function s(){}function c(){}function l(){}function u(){}function d(){}function f(){}function p(){}function m(){}function h(){}function g(){}function _(){}function v(){}function y(){}function b(){}function x(){}function S(){}function ee(){}function te(){}function ne(){}function C(){}function re(){}function ie(){}function ae(){}function oe(){}function se(){}function ce(){}function le(){}function ue(){}function de(){}function fe(){}function pe(){}function me(){}function he(){}function ge(){}function _e(){}function ve(){}function ye(){}function be(){}function xe(){}function Se(){}function Ce(){}function we(){}function Te(){}function Ee(){}function De(){}function Oe(){}function ke(){}function Ae(){}function je(){}function Me(){}function Ne(){}function Pe(){}function Fe(){}function Ie(){}function Le(){}function Re(){}function ze(){}function Be(){}function Ve(){}function He(){}function Ue(){}function We(){}function Ge(){}function Ke(){}function qe(){}function Je(){}function Ye(){}function Xe(){}function Ze(){}function Qe(){}function $e(){}function et(){}function tt(){}function nt(){}function rt(){}function it(){}function at(){}function ot(){}function st(){}function ct(){}function lt(){}function ut(){}function dt(){}function ft(){}function pt(){}function mt(){}function ht(){}function gt(){}function _t(){}function vt(){}function yt(){}function bt(){}function xt(){}function St(){}function Ct(){}function wt(){}function Tt(){}function Et(){}function Dt(){}function Ot(){}function kt(){}function At(){}function jt(){}function Mt(){}function Nt(){}function Pt(){}function Ft(){}function It(){}function Lt(){}function Rt(){}function zt(){}function Bt(){}function eee(){}function Vt(){}function tee(){}function nee(){}function Ht(){}function ree(){}function iee(){}function aee(){}function oee(){}function see(){}function cee(){}function lee(){}function uee(){}function dee(){}function fee(){}function pee(){}function mee(){}function hee(){}function Ut(){}function gee(){}function _ee(){}function vee(){}function yee(){}function bee(){}function xee(){}function See(){}function Cee(){}function wee(){}function Wt(){}function Gt(){}function Tee(){}function Eee(){}function Dee(){}function Oee(){}function kee(){}function Aee(){}function jee(){}function Mee(){}function Nee(){}function Pee(){}function Fee(){}function Iee(){}function Lee(){}function Ree(){}function zee(){}function Bee(){}function Vee(){}function Hee(){}function Uee(){}function Wee(){}function Gee(){}function Kee(){}function qee(){}function Jee(){}function Yee(){}function Xee(){}function Zee(){}function Qee(){}function $ee(){}function ete(){}function tte(){}function nte(){}function rte(){}function ite(){}function ate(){}function ote(){}function ste(){}function cte(){}function lte(){}function ute(){}function dte(){}function fte(){}function pte(){}function mte(){}function hte(){}function gte(){}function _te(){}function vte(){}function yte(){}function bte(){}function xte(){}function Ste(){}function Cte(){}function wte(){}function Tte(){}function Ete(){}function Dte(){}function Ote(){}function kte(){}function Ate(){}function jte(){}function Mte(){}function Nte(){}function Pte(){}function Fte(){}function Ite(){}function Lte(){}function Rte(){}function zte(){}function Bte(){}function Vte(){}function Hte(){}function Ute(){}function Wte(){}function Gte(){}function Kte(){}function qte(){}function Jte(){}function Yte(){}function Xte(){}function Zte(){}function Qte(){}function $te(){}function ene(){}function tne(){}function nne(){}function rne(){}function ine(){}function ane(){}function one(){}function sne(){}function cne(){}function lne(){}function une(){}function dne(){}function fne(){}function pne(){}function mne(){}function hne(){}function gne(){}function Kt(){}function _ne(){}function vne(){}function yne(){}function bne(){}function xne(){}function Sne(){}function Cne(){}function wne(){}function Tne(){}function Ene(){}function Dne(){}function One(){}function kne(){}function Ane(){}function jne(){}function Mne(){}function Nne(){}function Pne(){}function Fne(){}function Ine(){}function Lne(){}function Rne(){}function zne(){}function Bne(){}function Vne(){}function Hne(){}function Une(){}function Wne(){}function Gne(){}function Kne(){}function qne(){}function Jne(){}function Yne(){}function Xne(){}function Zne(){}function Qne(){}function $ne(){}function ere(){}function tre(){}function nre(){}function rre(){}function ire(){}function are(){}function ore(){}function sre(){}function cre(){}function lre(){}function ure(){}function dre(){}function fre(){}function pre(){}function mre(){}function hre(){}function gre(){}function _re(){}function vre(){}function yre(){}function bre(){}function xre(){}function Sre(){}function Cre(){}function wre(){}function Tre(){}function Ere(){}function Dre(){}function Ore(){}function kre(){}function Are(){}function jre(){}function Mre(){}function Nre(){}function Pre(){}function Fre(){}function qt(){}function Ire(){}function Lre(){}function Rre(){}function zre(){}function Bre(){}function Vre(){}function Hre(){}function Ure(){}function Wre(){}function Gre(){}function Kre(){}function qre(){}function Jre(){}function Yre(){}function Xre(){}function Zre(){}function Qre(){}function $re(){}function eie(){}function tie(){}function nie(){}function rie(){}function iie(){}function aie(){}function oie(){}function sie(){}function cie(){}function lie(){}function uie(){}function die(){}function fie(){}function pie(){}function mie(){}function hie(){}function gie(){}function _ie(){}function vie(){}function yie(){}function bie(){}function xie(){}function Sie(){}function Cie(){}function wie(){}function Tie(){}function Eie(){}function Die(){}function Oie(){}function kie(){}function Aie(){}function jie(){}function Mie(){}function Nie(){}function Pie(){}function Fie(){}function Iie(){}function Lie(){}function Rie(){}function zie(){}function Bie(){}function Vie(){}function Hie(){}function Uie(){}function Wie(){}function Gie(){}function Kie(){}function qie(){}function Jie(){}function Yie(){}function Xie(){}function Zie(){}function Qie(){}function $ie(){}function eae(){}function tae(){}function nae(){}function rae(){}function iae(){}function aae(){}function oae(){}function sae(){}function cae(){}function lae(){}function uae(){}function dae(){}function fae(){}function pae(){}function mae(){}function hae(){}function gae(){}function _ae(){}function vae(){}function yae(){}function bae(){}function xae(){}function Sae(){}function Cae(){}function wae(){}function Tae(){}function Eae(){}function Dae(){}function Oae(){}function kae(){}function Aae(){}function jae(){}function Mae(){}function Nae(){}function Pae(){}function Fae(){}function Iae(){}function Lae(){}function Rae(){}function zae(){}function Bae(){}function Vae(){}function Hae(){}function Uae(){}function Wae(){}function Gae(){}function Kae(){}function qae(){}function Jae(){}function Yae(){}function Xae(){}function Zae(){}function Qae(){}function $ae(){}function eoe(){}function toe(){}function noe(){}function roe(){}function ioe(){}function aoe(){}function ooe(){}function soe(){}function coe(){}function loe(){}function uoe(){}function doe(){}function foe(){}function poe(){}function moe(){}function hoe(){}function goe(){}function _oe(){}function voe(){}function yoe(){}function boe(){}function xoe(){}function Jt(){}function Yt(){}function Soe(){}function Xt(){}function Coe(){}function woe(){}function Toe(){}function Eoe(){}function Doe(){}function Ooe(){}function koe(){}function Aoe(){}function joe(){}function Moe(){}function Noe(){}function Poe(){}function Foe(){}function Ioe(){}function Loe(){}function Roe(){}function zoe(){}function Boe(){}function Voe(){}function Hoe(){}function Uoe(){}function Woe(){}function Zt(){}function Goe(){}function Qt(){}function Koe(){}function qoe(){}function Joe(){}function Yoe(){}function Xoe(){}function Zoe(){}function Qoe(){}function $oe(){}function ese(){}function tse(){}function nse(){}function rse(){}function ise(){}function ase(){}function ose(){}function sse(){}function cse(){}function lse(){}function use(){}function dse(){}function $t(){}function fse(){}function pse(){}function mse(){}function hse(){}function gse(){}function _se(){}function vse(){}function yse(){}function bse(){}function xse(){}function Sse(){}function Cse(){}function wse(){}function en(){}function Tse(){}function Ese(){}function Dse(){}function tn(){}function Ose(){}function nn(){}function rn(){}function kse(){}function Ase(){}function jse(){}function Mse(){}function Nse(){}function Pse(){}function Fse(){}function Ise(){}function an(){}function Lse(){}function Rse(){}function on(){}function zse(){}function sn(){}function Bse(){}function Vse(){}function Hse(){}function cn(){}function Use(){}function Wse(){}function Gse(){}function Kse(){}function qse(){}function Jse(){}function Yse(){}function Xse(){}function Zse(){}function Qse(){}function $se(){}function ece(){}function tce(){}function nce(){}function rce(){}function ice(){}function ln(){}function un(){}function ace(){}function oce(){}function sce(){}function cce(){}function lce(){}function uce(){}function dce(){}function fce(){}function pce(){}function mce(){}function hce(){}function gce(){}function _ce(){}function vce(){}function yce(){}function bce(){}function xce(){}function Sce(){}function Cce(){}function wce(){}function Tce(){}function Ece(){}function Dce(){}function Oce(){}function kce(){}function Ace(){}function jce(){}function Mce(){}function Nce(){}function Pce(){}function Fce(){}function Ice(){}function Lce(){}function Rce(){}function zce(){}function Bce(){}function Vce(){}function Hce(){}function Uce(){}function Wce(){}function Gce(){}function Kce(){}function qce(){}function Jce(){}function Yce(){}function Xce(){}function Zce(){}function Qce(){}function $ce(){}function ele(){}function tle(){}function nle(){}function rle(){}function ile(){}function ale(){}function ole(){}function sle(){}function cle(){}function lle(){}function ule(){}function dle(){}function fle(){}function ple(){}function mle(){}function hle(){}function gle(){}function _le(){}function vle(){}function yle(){}function ble(){}function xle(){}function Sle(){}function Cle(){}function wle(){}function Tle(){}function Ele(){}function Dle(){}function Ole(){}function kle(){}function Ale(){}function jle(){}function Mle(){}function Nle(){}function Ple(){}function Fle(){}function Ile(){}function Lle(){}function Rle(){}function zle(){}function Ble(){}function Vle(){}function Hle(){}function Ule(){}function Wle(){}function Gle(){}function Kle(){}function qle(){}function Jle(){}function Yle(){}function Xle(){}function Zle(){}function Qle(){}function $le(){}function eue(){}function dn(){fi()}function tue(){Fo()}function nue(){Rk()}function rue(){qw()}function iue(){bO()}function aue(){I9e()}function oue(){XM()}function sue(){e6e()}function cue(){Nk()}function lue(){Io()}function uue(){Ff()}function due(){Ibe()}function fue(){cC()}function pue(){sWe()}function mue(){mJe()}function hue(){DRe()}function gue(){gJe()}function _ue(){eGe()}function vue(){TRe()}function yue(){Fw()}function bue(){vJe()}function xue(){_Je()}function Sue(){HBe()}function Cue(){yJe()}function wue(){wA()}function Tue(){Ro()}function Eue(){bP()}function Due(){mP()}function Oue(){bJe()}function kue(){kYe()}function Aue(){ORe()}function jue(){o6e()}function Mue(){kRe()}function Nue(){Aut()}function Pue(){Hrt()}function Fue(){zx()}function Iue(){Q$e()}function Lue(){rN()}function Rue(){fze()}function zue(){Rx()}function Bue(){Ylt()}function Vue(){PA()}function Hue(){Qlt()}function Uue(){gM()}function Wue(){yA()}function Gue(){bM()}function Kue(){ek()}function fn(){rke()}function que(){gb()}function Jue(){bA()}function Yue(){vP()}function Xue(){Iw()}function Zue(){wD()}function Que(){uC()}function $ue(){_N()}function ede(){Odt()}function tde(e){Gh(e)}function nde(e){this.a=e}function pn(e){this.a=e}function rde(e){this.a=e}function ide(e){this.a=e}function ade(e){this.a=e}function ode(e){this.a=e}function sde(e){this.a=e}function cde(e){this.a=e}function mn(e){this.a=e}function hn(e){this.a=e}function lde(e){this.a=e}function ude(e){this.a=e}function gn(e){this.a=e}function dde(e){this.a=e}function fde(e){this.a=e}function _n(e){this.a=e}function vn(e){this.a=e}function pde(e){this.a=e}function yn(e){this.a=e}function mde(e){this.a=e}function hde(e){this.a=e}function gde(e){this.a=e}function bn(e){this.b=e}function _de(e){this.c=e}function vde(e){this.a=e}function yde(e){this.a=e}function bde(e){this.a=e}function xde(e){this.a=e}function Sde(e){this.a=e}function Cde(e){this.a=e}function wde(e){this.a=e}function Tde(e){this.a=e}function Ede(e){this.a=e}function Dde(e){this.a=e}function Ode(e){this.a=e}function kde(e){this.a=e}function Ade(e){this.a=e}function xn(e){this.a=e}function Sn(e){this.a=e}function Cn(e){this.a=e}function wn(e){this.a=e}function Tn(){this.a=[]}function jde(e,t){e.a=t}function Mde(e,t){e.a=t}function Nde(e,t){e.b=t}function Pde(e,t){e.b=t}function Fde(e,t){e.b=t}function Ide(e,t){e.j=t}function Lde(e,t){e.g=t}function Rde(e,t){e.i=t}function zde(e,t){e.c=t}function Bde(e,t){e.c=t}function Vde(e,t){e.d=t}function Hde(e,t){e.d=t}function En(e,t){e.k=t}function Ude(e,t){e.c=t}function Wde(e,t){e.c=t}function Gde(e,t){e.a=t}function Kde(e,t){e.a=t}function qde(e,t){e.f=t}function Jde(e,t){e.a=t}function Yde(e,t){e.b=t}function Dn(e,t){e.d=t}function On(e,t){e.i=t}function Xde(e,t){e.o=t}function Zde(e,t){e.r=t}function Qde(e,t){e.a=t}function $de(e,t){e.b=t}function efe(e,t){e.e=t}function tfe(e,t){e.f=t}function nfe(e,t){e.g=t}function rfe(e,t){e.e=t}function ife(e,t){e.f=t}function afe(e,t){e.f=t}function kn(e,t){e.a=t}function An(e,t){e.b=t}function ofe(e,t){e.n=t}function sfe(e,t){e.a=t}function cfe(e,t){e.c=t}function lfe(e,t){e.c=t}function ufe(e,t){e.c=t}function dfe(e,t){e.a=t}function ffe(e,t){e.a=t}function pfe(e,t){e.d=t}function mfe(e,t){e.d=t}function hfe(e,t){e.e=t}function gfe(e,t){e.e=t}function _fe(e,t){e.g=t}function vfe(e,t){e.f=t}function yfe(e,t){e.j=t}function bfe(e,t){e.a=t}function xfe(e,t){e.a=t}function Sfe(e,t){e.b=t}function Cfe(e){e.b=e.a}function wfe(e){e.c=e.d.d}function jn(e){this.a=e}function Mn(e){this.a=e}function Nn(e){this.a=e}function Pn(e){this.a=e}function Fn(e){this.a=e}function In(e){this.a=e}function Tfe(e){this.a=e}function Ln(e){this.a=e}function Rn(e){this.a=e}function zn(e){this.a=e}function Bn(e){this.a=e}function Vn(e){this.a=e}function Efe(e){this.a=e}function Dfe(e){this.a=e}function Hn(e){this.b=e}function Un(e){this.b=e}function Wn(e){this.b=e}function Gn(e){this.a=e}function Ofe(e){this.a=e}function Kn(e){this.c=e}function w(e){this.c=e}function kfe(e){this.c=e}function qn(e){this.d=e}function Jn(e){this.a=e}function Yn(e){this.a=e}function Afe(e){this.a=e}function Xn(e){this.a=e}function Zn(e){this.a=e}function Qn(e){this.a=e}function $n(e){this.a=e}function er(e){this.a=e}function tr(e){this.a=e}function nr(e){this.a=e}function jfe(e){this.a=e}function Mfe(e){this.a=e}function rr(e){this.a=e}function Nfe(e){this.a=e}function Pfe(e){this.a=e}function Ffe(e){this.a=e}function Ife(e){this.a=e}function Lfe(e){this.a=e}function Rfe(e){this.a=e}function zfe(e){this.a=e}function Bfe(e){this.a=e}function Vfe(e){this.a=e}function Hfe(e){this.a=e}function Ufe(e){this.a=e}function Wfe(e){this.a=e}function Gfe(e){this.a=e}function Kfe(e){this.a=e}function qfe(e){this.a=e}function ir(e){this.a=e}function Jfe(e){this.a=e}function Yfe(e){this.a=e}function Xfe(e){this.a=e}function Zfe(e){this.a=e}function ar(e){this.a=e}function Qfe(e){this.a=e}function $fe(e){this.a=e}function or(e){this.a=e}function sr(e){this.a=e}function epe(e){this.a=e}function tpe(e){this.a=e}function npe(e){this.a=e}function rpe(e){this.a=e}function ipe(e){this.a=e}function ape(e){this.a=e}function cr(e){this.a=e}function lr(e){this.a=e}function ur(e){this.a=e}function dr(e){this.a=e}function fr(e){this.e=e}function pr(e){this.a=e}function ope(e){this.a=e}function mr(e){this.a=e}function spe(e){this.a=e}function cpe(e){this.a=e}function lpe(e){this.a=e}function upe(e){this.a=e}function dpe(e){this.a=e}function fpe(e){this.a=e}function ppe(e){this.a=e}function mpe(e){this.a=e}function hpe(e){this.a=e}function gpe(e){this.a=e}function _pe(e){this.a=e}function vpe(e){this.a=e}function ype(e){this.a=e}function bpe(e){this.a=e}function xpe(e){this.a=e}function Spe(e){this.a=e}function Cpe(e){this.a=e}function wpe(e){this.a=e}function Tpe(e){this.a=e}function Epe(e){this.a=e}function Dpe(e){this.a=e}function Ope(e){this.a=e}function kpe(e){this.a=e}function Ape(e){this.a=e}function jpe(e){this.a=e}function Mpe(e){this.a=e}function Npe(e){this.a=e}function Ppe(e){this.a=e}function Fpe(e){this.a=e}function Ipe(e){this.a=e}function Lpe(e){this.a=e}function Rpe(e){this.a=e}function zpe(e){this.a=e}function Bpe(e){this.a=e}function Vpe(e){this.a=e}function Hpe(e){this.a=e}function Upe(e){this.a=e}function Wpe(e){this.a=e}function Gpe(e){this.a=e}function Kpe(e){this.a=e}function qpe(e){this.a=e}function Jpe(e){this.a=e}function Ype(e){this.a=e}function Xpe(e){this.a=e}function Zpe(e){this.a=e}function Qpe(e){this.a=e}function $pe(e){this.a=e}function eme(e){this.a=e}function tme(e){this.a=e}function nme(e){this.a=e}function rme(e){this.a=e}function ime(e){this.c=e}function ame(e){this.b=e}function ome(e){this.a=e}function sme(e){this.a=e}function cme(e){this.a=e}function lme(e){this.a=e}function ume(e){this.a=e}function dme(e){this.a=e}function fme(e){this.a=e}function pme(e){this.a=e}function mme(e){this.a=e}function hme(e){this.a=e}function gme(e){this.a=e}function _me(e){this.a=e}function vme(e){this.a=e}function yme(e){this.a=e}function bme(e){this.a=e}function xme(e){this.a=e}function Sme(e){this.a=e}function Cme(e){this.a=e}function wme(e){this.a=e}function Tme(e){this.a=e}function Eme(e){this.a=e}function Dme(e){this.a=e}function Ome(e){this.a=e}function kme(e){this.a=e}function Ame(e){this.a=e}function jme(e){this.a=e}function Mme(e){this.a=e}function hr(e){this.a=e}function gr(e){this.a=e}function Nme(e){this.a=e}function Pme(e){this.a=e}function Fme(e){this.a=e}function Ime(e){this.a=e}function Lme(e){this.a=e}function Rme(e){this.a=e}function zme(e){this.a=e}function Bme(e){this.a=e}function Vme(e){this.a=e}function Hme(e){this.a=e}function Ume(e){this.a=e}function Wme(e){this.a=e}function Gme(e){this.a=e}function Kme(e){this.a=e}function qme(e){this.a=e}function Jme(e){this.a=e}function Yme(e){this.a=e}function Xme(e){this.a=e}function Zme(e){this.a=e}function Qme(e){this.a=e}function $me(e){this.a=e}function ehe(e){this.a=e}function the(e){this.a=e}function nhe(e){this.a=e}function rhe(e){this.a=e}function ihe(e){this.a=e}function _r(e){this.a=e}function ahe(e){this.f=e}function ohe(e){this.a=e}function she(e){this.a=e}function che(e){this.a=e}function lhe(e){this.a=e}function uhe(e){this.a=e}function dhe(e){this.a=e}function fhe(e){this.a=e}function phe(e){this.a=e}function mhe(e){this.a=e}function hhe(e){this.a=e}function ghe(e){this.a=e}function _he(e){this.a=e}function vhe(e){this.a=e}function yhe(e){this.a=e}function bhe(e){this.a=e}function xhe(e){this.a=e}function She(e){this.a=e}function Che(e){this.a=e}function whe(e){this.a=e}function The(e){this.a=e}function Ehe(e){this.a=e}function Dhe(e){this.a=e}function Ohe(e){this.a=e}function khe(e){this.a=e}function Ahe(e){this.a=e}function jhe(e){this.a=e}function Mhe(e){this.a=e}function Nhe(e){this.a=e}function vr(e){this.a=e}function Phe(e){this.a=e}function yr(e){this.b=e}function Fhe(e){this.a=e}function Ihe(e){this.a=e}function Lhe(e){this.a=e}function Rhe(e){this.a=e}function zhe(e){this.a=e}function Bhe(e){this.a=e}function Vhe(e){this.a=e}function Hhe(e){this.b=e}function Uhe(e){this.a=e}function br(e){this.a=e}function Whe(e){this.a=e}function Ghe(e){this.a=e}function Khe(e){this.c=e}function xr(e){this.e=e}function Sr(e){this.a=e}function Cr(e){this.a=e}function wr(e){this.a=e}function qhe(e){this.d=e}function Jhe(e){this.a=e}function Yhe(e){this.a=e}function Xhe(e){this.a=e}function Tr(e){this.e=e}function Er(){this.a=0}function Dr(){Pm(this)}function T(){au(this)}function Or(){_Fe(this)}function Zhe(){}function kr(){this.c=nHt}function Qhe(e,t){e.b+=t}function $he(e,t){t.Wb(e)}function ege(e){return e.a}function tge(e){return e.a}function nge(e){return e.a}function rge(e){return e.a}function ige(e){return e.a}function E(e){return e.e}function age(){return null}function oge(){return null}function sge(){La(),P_t()}function cge(e){e.b.Of(e.e)}function lge(e){e.b=new la}function Ar(e,t){e.b=t-e.b}function jr(e,t){e.a=t-e.a}function Mr(e,t){e.push(t)}function uge(e,t){e.sort(t)}function dge(e,t){t.jd(e.a)}function fge(e,t){tj(t,e)}function pge(e,t,n){e.Yd(n,t)}function Nr(e,t){e.e=t,t.b=e}function mge(e){wf(),this.a=e}function hge(e){wf(),this.a=e}function gge(e){wf(),this.a=e}function Pr(e){gh(),this.a=e}function _ge(e){Xg(),lG.le(e)}function vge(){vge=C,new Dr}function Fr(){WTe.call(this)}function yge(){WTe.call(this)}function bge(){Fr.call(this)}function Ir(){Fr.call(this)}function xge(){Fr.call(this)}function Lr(){Fr.call(this)}function Rr(){Fr.call(this)}function zr(){Fr.call(this)}function Br(){Fr.call(this)}function Vr(){Fr.call(this)}function Sge(){Fr.call(this)}function Hr(){Fr.call(this)}function Cge(){Fr.call(this)}function wge(){this.a=this}function Ur(){this.Bb|=256}function Tge(){this.b=new lCe}function Wr(e,t){e.length=t}function Gr(e,t){M(e.a,t)}function Ege(e,t){tet(e.c,t)}function Dge(e,t){Lm(e.b,t)}function Oge(e,t){JO(e.a,t)}function kge(e,t){$T(e.a,t)}function Kr(e,t){AC(e.e,t)}function qr(e){_j(e.c,e.b)}function Age(e,t){e.kc().Nb(t)}function jge(e){this.a=y1e(e)}function Jr(){this.a=new Dr}function Mge(){this.a=new Dr}function Nge(){this.a=new gbe}function Yr(){this.a=new T}function Xr(){this.a=new T}function Pge(){this.a=new T}function Zr(){this.a=new Xe}function Qr(){this.a=new qUe}function Fge(){this.a=new Vt}function Ige(){this.a=new wRe}function Lge(){this.a=new eOe}function Rge(){this.a=new T}function zge(){this.a=new T}function Bge(){this.a=new T}function Vge(){this.a=new T}function Hge(){this.d=new T}function Uge(){this.a=new Qze}function Wge(){this.a=new Jr}function Gge(){this.a=new Dr}function Kge(){this.b=new Dr}function qge(){this.b=new T}function Jge(){this.e=new T}function Yge(){this.a=new wue}function Xge(){this.d=new T}function Zge(){QIe.call(this)}function Qge(){QIe.call(this)}function $ge(){T.call(this)}function e_e(){bge.call(this)}function $r(){Yr.call(this)}function t_e(){Qd.call(this)}function n_e(){Vge.call(this)}function ei(){Zhe.call(this)}function ti(){ei.call(this)}function ni(){Zhe.call(this)}function ri(){ni.call(this)}function r_e(){b_e.call(this)}function i_e(){b_e.call(this)}function a_e(){b_e.call(this)}function o_e(){C_e.call(this)}function ii(){Ose.call(this)}function s_e(){Ose.call(this)}function ai(){vo.call(this)}function c_e(){E_e.call(this)}function l_e(){E_e.call(this)}function u_e(){Dr.call(this)}function d_e(){Dr.call(this)}function f_e(){Dr.call(this)}function oi(){EJe.call(this)}function p_e(){Jr.call(this)}function m_e(){Ur.call(this)}function si(){gTe.call(this)}function ci(){Dr.call(this)}function li(){gTe.call(this)}function ui(){Dr.call(this)}function h_e(){Dr.call(this)}function g_e(){sn.call(this)}function __e(){g_e.call(this)}function v_e(){sn.call(this)}function y_e(){Qle.call(this)}function b_e(){this.a=new Jr}function x_e(){this.a=new Dr}function S_e(){this.a=new T}function C_e(){this.a=new Dr}function di(){this.a=new vo}function w_e(){this.j=new T}function T_e(){this.a=new bye}function E_e(){this.a=new zse}function D_e(){this.a=new goe}function fi(){fi=C,GW=new o}function pi(){pi=C,XW=new k_e}function mi(){mi=C,ZW=new O_e}function O_e(){_n.call(this,``)}function k_e(){_n.call(this,``)}function A_e(e){mqe.call(this,e)}function j_e(e){mqe.call(this,e)}function M_e(e){mn.call(this,e)}function N_e(e){nbe.call(this,e)}function P_e(e){nbe.call(this,e)}function F_e(e){N_e.call(this,e)}function I_e(e){N_e.call(this,e)}function L_e(e){N_e.call(this,e)}function R_e(e){ny.call(this,e)}function z_e(e){ny.call(this,e)}function B_e(e){VOe.call(this,e)}function V_e(e){obe.call(this,e)}function hi(e){lo.call(this,e)}function gi(e){lo.call(this,e)}function H_e(e){lo.call(this,e)}function _i(e){P9e.call(this,e)}function vi(e){_i.call(this,e)}function yi(e){KNe.call(this,e)}function U_e(e){yi.call(this,e)}function bi(){wn.call(this,{})}function W_e(){W_e=C,zTt=new te}function xi(){xi=C,tG=new Vwe}function G_e(){G_e=C,iG=new a}function Si(){Si=C,cG=new v}function Ci(){Ci=C,dG=new x}function wi(e){Bu(),this.a=e}function Ti(e){lC(),this.a=e}function Ei(e){em(),this.f=e}function Di(e){em(),this.f=e}function K_e(e){nke(),this.a=e}function q_e(e){e.b=null,e.c=0}function J_e(e,t){e.e=t,Sst(e,t)}function Y_e(e,t){e.a=t,ott(e)}function Oi(e,t,n){e.a[t.g]=n}function X_e(e,t,n){y8e(n,e,t)}function Z_e(e,t){HOe(t.i,e.n)}function Q_e(e,t){ZZe(e).Cd(t)}function $_e(e,t){e.a.ec().Mc(t)}function eve(e,t){return e.g-t.g}function tve(e,t){return e*e/t}function ki(e){return Gh(e),e}function D(e){return Gh(e),e}function Ai(e){return Gh(e),e}function nve(e){return new Cn(e)}function rve(e){return new mh(e)}function ive(e){return Gh(e),e}function ave(e){return Gh(e),e}function ji(e){yi.call(this,e)}function Mi(e){yi.call(this,e)}function ove(e){yi.call(this,e)}function Ni(e){KNe.call(this,e)}function Pi(e){yi.call(this,e)}function Fi(e){yi.call(this,e)}function Ii(e){yi.call(this,e)}function sve(e){yi.call(this,e)}function Li(e){yi.call(this,e)}function Ri(e){yi.call(this,e)}function zi(e){yi.call(this,e)}function Bi(e){yi.call(this,e)}function Vi(e){yi.call(this,e)}function Hi(e){yi.call(this,e)}function Ui(e){yi.call(this,e)}function Wi(e){Gh(e),this.a=e}function Gi(e){return Tw(e),e}function Ki(e){CPe(e,e.length)}function qi(e){return e.b==e.c}function Ji(e){return!!e&&e.b}function cve(e){return!!e&&e.k}function lve(e){return!!e&&e.j}function uve(e,t,n){e.c.Ef(t,n)}function dve(e,t){e.be(t),t.ae(e)}function Yi(e){wf(),this.a=ph(e)}function Xi(){this.a=kd(ph(PP))}function fve(){throw E(new Br)}function pve(){throw E(new Br)}function Zi(){throw E(new Br)}function mve(){throw E(new Br)}function hve(){throw E(new Br)}function gve(){throw E(new Br)}function Qi(){Qi=C,Xg()}function $i(){In.call(this,``)}function ea(){In.call(this,``)}function ta(){In.call(this,``)}function na(){In.call(this,``)}function ra(e){Mi.call(this,e)}function ia(e){Mi.call(this,e)}function aa(e){Fi.call(this,e)}function oa(e){Wn.call(this,e)}function _ve(e){oa.call(this,e)}function sa(e){qu.call(this,e)}function ca(e){sEe.call(this,e,0)}function la(){URe.call(this,12,3)}function O(e,t){return _Re(e,t)}function ua(e,t){return yb(e,t)}function vve(e,t){return e.a-t.a}function yve(e,t){return e.a-t.a}function bve(e,t){return e.a-t.a}function xve(e,t){return t in e.a}function Sve(e){return e.a?e.b:0}function Cve(e){return e.a?e.b:0}function wve(e,t,n){t.Cd(e.a[n])}function Tve(e,t,n){t.Pe(e.a[n])}function Eve(e,t){e.b=new Vl(t)}function Dve(e,t){return e.b=t,e}function Ove(e,t){return e.c=t,e}function kve(e,t){return e.f=t,e}function Ave(e,t){return e.g=t,e}function da(e,t){return e.a=t,e}function fa(e,t){return e.f=t,e}function jve(e,t){return e.k=t,e}function pa(e,t){return e.a=t,e}function Mve(e,t){return e.e=t,e}function ma(e,t){return e.e=t,e}function Nve(e,t){return e.f=t,e}function Pve(e,t){e.b=!0,e.d=t}function Fve(e,t){return e.b-t.b}function Ive(e,t){return e.g-t.g}function Lve(e,t){return e?0:t-1}function Rve(e,t){return e?0:t-1}function zve(e,t){return e?t-1:0}function Bve(e,t){return e.s-t.s}function Vve(e,t){return t.rg(e)}function ha(e,t){return e.b=t,e}function ga(e,t){return e.a=t,e}function _a(e,t){return e.c=t,e}function va(e,t){return e.d=t,e}function ya(e,t){return e.e=t,e}function ba(e,t){return e.f=t,e}function xa(e,t){return e.a=t,e}function Sa(e,t){return e.b=t,e}function Ca(e,t){return e.c=t,e}function wa(e,t){return e.c=t,e}function Ta(e,t){return e.b=t,e}function Ea(e,t){return e.d=t,e}function Da(e,t){return e.e=t,e}function Hve(e,t){return e.f=t,e}function Oa(e,t){return e.g=t,e}function ka(e,t){return e.a=t,e}function Aa(e,t){return e.i=t,e}function ja(e,t){return e.j=t,e}function Uve(e,t){wA(),G_(t,e)}function Wve(e,t,n){CNe(e.a,t,n)}function Ma(e){yf.call(this,e)}function Gve(e){L1e.call(this,e)}function Kve(e){uIe.call(this,e)}function Na(e){uIe.call(this,e)}function Pa(e){kx.call(this,e)}function qve(e){Ig.call(this,e)}function Jve(e){Ig.call(this,e)}function Yve(){Dwe.call(this,``)}function Fa(){this.a=0,this.b=0}function Xve(){this.b=0,this.a=0}function Zve(e,t){e.b=0,Qx(e,t)}function Qve(e,t){return e.k=t,e}function $ve(e,t){return e.j=t,e}function eye(e,t){e.c=t,e.b=!0}function tye(){tye=C,rEt=c5e()}function Ia(){Ia=C,iVt=X6e()}function nye(){nye=C,Y5=X5e()}function La(){La=C,h7=dS()}function Ra(){Ra=C,R7=Z6e()}function rye(){rye=C,wHt=Q6e()}function za(){za=C,b9=rtt()}function Ba(e){return e.e&&e.e()}function iye(e){return e.l|e.m<<22}function aye(e,t){return e.c._b(t)}function oye(e,t){return E$e(e.b,t)}function Va(e){return e?e.d:null}function sye(e){return e?e.g:null}function cye(e){return e?e.i:null}function Ha(e){return Ad(e),e.o}function Ua(e,t){return e.a+=t,e}function Wa(e,t){return e.a+=t,e}function Ga(e,t){return e.a+=t,e}function Ka(e,t){return e.a+=t,e}function lye(e,t){for(;e.Bd(t););}function qa(e){this.a=new go(e)}function uye(){throw E(new Br)}function dye(){throw E(new Br)}function fye(){throw E(new Br)}function pye(){throw E(new Br)}function mye(){throw E(new Br)}function hye(){throw E(new Br)}function Ja(e){this.a=new mm(e)}function gye(){this.a=new Yj(NFt)}function _ye(){this.b=new Yj(yPt)}function vye(){this.a=new Yj(kIt)}function yye(){this.b=new Yj(_3)}function bye(){this.b=new Yj(_3)}function Ya(e){this.a=0,this.b=e}function xye(e){Ngt(),tvt(this,e)}function Xa(e){return Hh(e),e.a}function Za(e){return e.b!=e.d.c}function Sye(e,t){return e.d[t.p]}function Cye(e,t){return bst(e,t)}function wye(e,t,n){e.splice(t,n)}function Qa(e,t){for(;e.Re(t););}function Tye(e){e.c?gct(e):_ct(e)}function Eye(){throw E(new Br)}function Dye(){throw E(new Br)}function Oye(){throw E(new Br)}function kye(){throw E(new Br)}function Aye(){throw E(new Br)}function jye(){throw E(new Br)}function Mye(){throw E(new Br)}function Nye(){throw E(new Br)}function Pye(){throw E(new Br)}function Fye(){throw E(new Br)}function Iye(){throw E(new Hr)}function Lye(){throw E(new Hr)}function $a(e){this.a=new Rye(e)}function Rye(e){IJe(this,e,B9e())}function eo(e){return!e||mFe(e)}function to(e){return A9[e]!=-1}function zye(){oG!=0&&(oG=0),sG=-1}function Bye(){xTt??=[]}function no(e,t){zu.call(this,e,t)}function ro(e,t){no.call(this,e,t)}function Vye(e,t){this.a=e,this.b=t}function Hye(e,t){this.a=e,this.b=t}function Uye(e,t){this.a=e,this.b=t}function Wye(e,t){this.a=e,this.b=t}function Gye(e,t){this.a=e,this.b=t}function Kye(e,t){this.a=e,this.b=t}function qye(e,t){this.a=e,this.b=t}function io(e,t){this.e=e,this.d=t}function Jye(e,t){this.b=e,this.c=t}function Yye(e,t){this.b=e,this.a=t}function Xye(e,t){this.b=e,this.a=t}function Zye(e,t){this.b=e,this.a=t}function Qye(e,t){this.b=e,this.a=t}function $ye(e,t){this.a=e,this.b=t}function ao(e,t){this.a=e,this.b=t}function ebe(e,t){this.a=e,this.f=t}function oo(e,t){this.g=e,this.i=t}function so(e,t){this.f=e,this.g=t}function tbe(e,t){this.b=e,this.c=t}function nbe(e){vTe(e.dc()),this.c=e}function rbe(e,t){this.a=e,this.b=t}function ibe(e,t){this.a=e,this.b=t}function abe(e){this.a=P(ph(e),15)}function obe(e){this.a=P(ph(e),15)}function sbe(e){this.a=P(ph(e),85)}function co(e){this.b=P(ph(e),85)}function lo(e){this.b=P(ph(e),51)}function uo(){this.q=new r.Date}function fo(e,t){this.a=e,this.b=t}function cbe(e,t){return km(e.b,t)}function po(e,t){return e.b.Hc(t)}function lbe(e,t){return e.b.Ic(t)}function ube(e,t){return e.b.Qc(t)}function dbe(e,t){return e.b.Hc(t)}function fbe(e,t){return e.c.uc(t)}function pbe(e,t){return NT(e.c,t)}function mo(e,t){return e.a._b(t)}function mbe(e,t){return e>t&&t0}function rs(e,t){return dT(e,t)<0}function exe(e,t){return Gp(e.a,t)}function txe(e,t){yRe.call(this,e,t)}function nxe(e){_h(),VOe.call(this,e)}function rxe(e,t){mNe(e,e.length,t)}function is(e,t){NPe(e,e.length,t)}function as(e,t){return e.a.get(t)}function ixe(e,t){return km(e.e,t)}function os(e){return Gh(e),!1}function ss(e){this.a=P(ph(e),229)}function cs(e){cv.call(this,e,21)}function ls(e,t){so.call(this,e,t)}function us(e,t){so.call(this,e,t)}function axe(e,t){this.b=e,this.a=t}function ds(e,t){this.d=e,this.e=t}function oxe(e,t){this.a=e,this.b=t}function sxe(e,t){this.a=e,this.b=t}function cxe(e,t){this.a=e,this.b=t}function lxe(e,t){this.a=e,this.b=t}function fs(e,t){this.a=e,this.b=t}function uxe(e,t){this.b=e,this.a=t}function dxe(e,t){this.b=e,this.a=t}function fxe(e,t){so.call(this,e,t)}function pxe(e,t){so.call(this,e,t)}function ps(e,t){so.call(this,e,t)}function ms(e,t){so.call(this,e,t)}function hs(e,t){so.call(this,e,t)}function gs(e,t){so.call(this,e,t)}function _s(e,t){so.call(this,e,t)}function vs(e,t){this.b=e,this.a=t}function ys(e,t){so.call(this,e,t)}function bs(e,t){this.b=e,this.a=t}function xs(e,t){so.call(this,e,t)}function mxe(e,t){this.b=e,this.a=t}function Ss(e,t){so.call(this,e,t)}function Cs(e,t){so.call(this,e,t)}function ws(e,t){so.call(this,e,t)}function Ts(e,t,n){e.splice(t,0,n)}function hxe(e,t,n){e.Mb(n)&&t.Cd(n)}function gxe(e,t,n){t.Pe(e.a.Ye(n))}function _xe(e,t,n){t.Dd(e.a.Ze(n))}function vxe(e,t,n){t.Cd(e.a.Kb(n))}function yxe(e,t){return $u(e.c,t)}function bxe(e,t){return $u(e.e,t)}function Es(e,t){so.call(this,e,t)}function Ds(e,t){so.call(this,e,t)}function Os(e,t){so.call(this,e,t)}function xxe(e,t){so.call(this,e,t)}function ks(e,t){so.call(this,e,t)}function As(e,t){so.call(this,e,t)}function Sxe(e,t){this.a=e,this.b=t}function Cxe(e,t){this.a=e,this.b=t}function wxe(e,t){this.a=e,this.b=t}function Txe(e,t){this.a=e,this.b=t}function Exe(e,t){this.a=e,this.b=t}function Dxe(e,t){this.a=e,this.b=t}function Oxe(e,t){this.b=e,this.a=t}function kxe(e,t){this.b=e,this.a=t}function Axe(e,t){this.b=e,this.a=t}function js(e,t){this.c=e,this.d=t}function jxe(e,t){this.e=e,this.d=t}function Mxe(e,t){this.a=e,this.b=t}function Nxe(e,t){this.a=e,this.b=t}function Pxe(e,t){this.a=e,this.b=t}function Fxe(e,t){this.b=e,this.a=t}function Ixe(e,t){this.b=t,this.c=e}function Ms(e,t){so.call(this,e,t)}function Ns(e,t){so.call(this,e,t)}function Ps(e,t){so.call(this,e,t)}function Lxe(e,t){so.call(this,e,t)}function Fs(e,t){so.call(this,e,t)}function Is(e,t){so.call(this,e,t)}function Ls(e,t){so.call(this,e,t)}function Rs(e,t){so.call(this,e,t)}function zs(e,t){so.call(this,e,t)}function Bs(e,t){so.call(this,e,t)}function Vs(e,t){so.call(this,e,t)}function Hs(e,t){so.call(this,e,t)}function Us(e,t){so.call(this,e,t)}function Ws(e,t){so.call(this,e,t)}function Gs(e,t){so.call(this,e,t)}function Ks(e,t){so.call(this,e,t)}function qs(e,t){so.call(this,e,t)}function Js(e,t){so.call(this,e,t)}function Ys(e,t){so.call(this,e,t)}function Xs(e,t){so.call(this,e,t)}function Zs(e,t){so.call(this,e,t)}function Qs(e,t){so.call(this,e,t)}function $s(e,t){so.call(this,e,t)}function ec(e,t){so.call(this,e,t)}function tc(e,t){so.call(this,e,t)}function nc(e,t){so.call(this,e,t)}function rc(e,t){so.call(this,e,t)}function ic(e,t){so.call(this,e,t)}function ac(e,t){so.call(this,e,t)}function oc(e,t){so.call(this,e,t)}function sc(e,t){so.call(this,e,t)}function cc(e,t){so.call(this,e,t)}function lc(e,t){so.call(this,e,t)}function Rxe(e,t){this.b=e,this.a=t}function zxe(e,t){so.call(this,e,t)}function Bxe(e,t){this.a=e,this.b=t}function Vxe(e,t){this.a=e,this.b=t}function Hxe(e,t){this.a=e,this.b=t}function Uxe(e,t){so.call(this,e,t)}function Wxe(e,t){so.call(this,e,t)}function Gxe(e,t){this.a=e,this.b=t}function Kxe(e,t){return Rf(),t!=e}function uc(e){return jd(e.a),e.b}function dc(e){return Drt(e,e.c),e}function qxe(){return tye(),new rEt}function Jxe(){If(),this.a=new Zd}function Yxe(){rM(),this.a=new Jr}function Xxe(){B_(),this.b=new Jr}function Zxe(e,t){this.b=e,this.d=t}function Qxe(e,t){this.a=e,this.b=t}function $xe(e,t){this.a=e,this.b=t}function eSe(e,t){this.a=e,this.b=t}function tSe(e,t){this.b=e,this.a=t}function nSe(e,t){so.call(this,e,t)}function rSe(e,t){so.call(this,e,t)}function fc(e,t){so.call(this,e,t)}function pc(e,t){so.call(this,e,t)}function mc(e,t){so.call(this,e,t)}function hc(e,t){so.call(this,e,t)}function iSe(e,t){so.call(this,e,t)}function aSe(e,t){so.call(this,e,t)}function gc(e,t){so.call(this,e,t)}function oSe(e,t){so.call(this,e,t)}function _c(e,t){so.call(this,e,t)}function vc(e,t){so.call(this,e,t)}function yc(e,t){so.call(this,e,t)}function bc(e,t){so.call(this,e,t)}function xc(e,t){so.call(this,e,t)}function Sc(e,t){so.call(this,e,t)}function sSe(e,t){so.call(this,e,t)}function Cc(e,t){so.call(this,e,t)}function cSe(e,t){so.call(this,e,t)}function wc(e,t){so.call(this,e,t)}function Tc(e,t){so.call(this,e,t)}function lSe(e,t){so.call(this,e,t)}function Ec(e,t){so.call(this,e,t)}function uSe(e,t){so.call(this,e,t)}function dSe(e,t){this.b=e,this.a=t}function fSe(e,t){this.b=e,this.a=t}function pSe(e,t){this.b=e,this.a=t}function mSe(e,t){this.b=e,this.a=t}function hSe(e,t){this.a=e,this.b=t}function gSe(e,t){this.a=e,this.b=t}function _Se(e,t){this.a=e,this.b=t}function k(e,t){this.a=e,this.b=t}function Dc(e,t){so.call(this,e,t)}function Oc(e,t){so.call(this,e,t)}function kc(e,t){so.call(this,e,t)}function Ac(e,t){so.call(this,e,t)}function jc(e,t){so.call(this,e,t)}function Mc(e,t){so.call(this,e,t)}function Nc(e,t){so.call(this,e,t)}function Pc(e,t){so.call(this,e,t)}function Fc(e,t){so.call(this,e,t)}function Ic(e,t){so.call(this,e,t)}function Lc(e,t){so.call(this,e,t)}function Rc(e,t){so.call(this,e,t)}function zc(e,t){so.call(this,e,t)}function Bc(e,t){so.call(this,e,t)}function Vc(e,t){so.call(this,e,t)}function Hc(e,t){so.call(this,e,t)}function Uc(e,t){so.call(this,e,t)}function Wc(e,t){so.call(this,e,t)}function vSe(e,t){so.call(this,e,t)}function Gc(e,t){so.call(this,e,t)}function ySe(e,t){this.a=e,this.b=t}function bSe(e,t){this.a=e,this.b=t}function xSe(e,t){this.a=e,this.b=t}function SSe(e,t){this.a=e,this.b=t}function CSe(e,t){this.a=e,this.b=t}function wSe(e,t){this.a=e,this.b=t}function Kc(e,t){this.a=e,this.b=t}function TSe(e,t){this.a=e,this.b=t}function ESe(e,t){this.a=e,this.b=t}function DSe(e,t){this.a=e,this.b=t}function OSe(e,t){this.a=e,this.b=t}function kSe(e,t){this.a=e,this.b=t}function ASe(e,t){this.a=e,this.b=t}function jSe(e,t){this.b=e,this.a=t}function MSe(e,t){this.b=e,this.a=t}function NSe(e,t){this.b=e,this.a=t}function PSe(e,t){this.b=e,this.a=t}function FSe(e,t){this.a=e,this.b=t}function ISe(e,t){this.a=e,this.b=t}function qc(e,t){so.call(this,e,t)}function LSe(e,t){this.a=e,this.b=t}function RSe(e,t){this.a=e,this.b=t}function Jc(e,t){so.call(this,e,t)}function zSe(e,t){this.f=e,this.c=t}function Yc(e,t){return $u(e.g,t)}function BSe(e,t){return $u(t.b,e)}function VSe(e,t){return uD(e.a,t)}function HSe(e,t){return-e.b.af(t)}function USe(e,t){e&&Qh(f7,e,t)}function Xc(e,t){e.i=null,OS(e,t)}function WSe(e,t,n){I8e(t,KA(e,n))}function GSe(e,t,n){I8e(t,KA(e,n))}function KSe(e,t){not(e.a,P(t,58))}function qSe(e,t){KGe(e.a,P(t,12))}function Zc(e,t){this.a=e,this.b=t}function JSe(e,t){this.a=e,this.b=t}function YSe(e,t){this.a=e,this.b=t}function XSe(e,t){this.a=e,this.b=t}function ZSe(e,t){this.a=e,this.b=t}function QSe(e,t){this.d=e,this.b=t}function $Se(e,t){this.e=e,this.a=t}function Qc(e,t){this.b=e,this.c=t}function $c(e,t){this.i=e,this.g=t}function el(e,t){this.d=e,this.e=t}function eCe(e,t){kKe(new Lu(e),t)}function tl(e){return lD(e.c,e.b)}function nl(e){return e?e.md():null}function A(e){return e??null}function rl(e){return typeof e===OP}function il(e){return typeof e===DP}function al(e){return typeof e===Vvt}function ol(e,t){return dT(e,t)==0}function sl(e,t){return dT(e,t)>=0}function cl(e,t){return dT(e,t)!=0}function ll(e,t){return VYe(e.Kc(),t)}function ul(e,t){return e.Rd().Xb(t)}function tCe(e){return RE(e),e.d.gc()}function dl(e){return bp(e==null),e}function fl(e,t){return e.a+=``+t,e}function pl(e,t){return e.a+=``+t,e}function ml(e,t){return e.a+=``+t,e}function hl(e,t){return e.a+=``+t,e}function gl(e,t){return e.a+=``+t,e}function _l(e,t){return e.a+=``+t,e}function nCe(e){return``+(Gh(e),e)}function rCe(e){Pm(this),mC(this,e)}function iCe(){ERe(),bNe.call(this)}function aCe(e,t){GNe.call(this,e,t)}function oCe(e,t){GNe.call(this,e,t)}function vl(e,t){GNe.call(this,e,t)}function yl(e,t){iy(e,t,e.c.b,e.c)}function bl(e,t){iy(e,t,e.a,e.a.a)}function xl(e){return ov(e,0),null}function sCe(){this.b=0,this.a=!1}function cCe(){this.b=0,this.a=!1}function lCe(){this.b=new go(xx(12))}function uCe(){uCe=C,oDt=nT(sO())}function dCe(){dCe=C,NOt=nT(wot())}function fCe(){fCe=C,NPt=nT(qYe())}function Sl(){Sl=C,vge(),uG=new Dr}function Cl(e){return e.a=0,e.b=0,e}function pCe(e,t){return e.a=t.g+1,e}function wl(e,t){lf.call(this,e,t)}function Tl(e,t){Wd.call(this,e,t)}function El(e,t){$c.call(this,e,t)}function mCe(e,t){ad.call(this,e,t)}function Dl(e,t){WC.call(this,e,t)}function Ol(e,t){Jo(),Qh(v7,e,t)}function hCe(e,t){e.q.setTime(Dv(t))}function gCe(e){r.clearTimeout(e)}function _Ce(e){return ph(e),new Hl(e)}function vCe(e,t){return A(e)===A(t)}function yCe(e,t){return e.a.a.a.cc(t)}function kl(e,t){return p_(e.a,0,t)}function Al(e){return zPe(P(e,74))}function jl(e){return C_((Gh(e),e))}function bCe(e){return C_((Gh(e),e))}function xCe(e){return vu(e.l,e.m,e.h)}function Ml(e,t){return _u(e.a,t.a)}function SCe(e,t){return DPe(e.a,t.a)}function CCe(e,t){return aE(e.a,t.a)}function Nl(e,t){return e.indexOf(t)}function wCe(e,t){return e.j[t.p]==2}function Pl(e,t){return e==t?0:e?1:-1}function Fl(e){return e<10?`0`+e:``+e}function Il(e){return typeof e===Vvt}function TCe(e){return e==kJ||e==MJ}function ECe(e){return e==kJ||e==AJ}function DCe(e,t){return _u(e.g,t.g)}function Ll(e){return Ab(e.b.b,e,0)}function OCe(){Np.call(this,0,0,0,0)}function Rl(){Xn.call(this,new ry)}function zl(e,t){bb(e,0,e.length,t)}function kCe(e,t){return M(e.a,t),t}function ACe(e,t){return Lf(),t.a+=e}function jCe(e,t){return Lf(),t.a+=e}function MCe(e,t){return Lf(),t.c+=e}function NCe(e,t){return M(e.c,t),e}function Bl(e,t){return OC(e.a,t),e}function PCe(e){this.a=qxe(),this.b=e}function FCe(e){this.a=qxe(),this.b=e}function Vl(e){this.a=e.a,this.b=e.b}function Hl(e){this.a=e,dn.call(this)}function ICe(e){this.a=e,dn.call(this)}function Ul(){wg.call(this,0,0,0,0)}function Wl(e){return OC(new Zh,e)}function LCe(e){return ag(P(e,123))}function Gl(e){return e.vh()&&e.wh()}function Kl(e){return e!=V8&&e!=H8}function ql(e){return e==t8||e==n8}function Jl(e){return e==i8||e==e8}function RCe(e){return e==L0||e==I0}function zCe(e,t){return _u(e.g,t.g)}function BCe(e,t){return new WC(t,e)}function VCe(e,t){return new WC(t,e)}function Yl(e){return wje(e.b.Kc(),e.a)}function Xl(e,t){Gw(e,t),eS(e,e.D)}function Zl(e,t,n){Xx(e,t),Vx(e,n)}function Ql(e,t,n){Wx(e,t),Ux(e,n)}function $l(e,t,n){Gx(e,t),Kx(e,n)}function eu(e,t,n){Hx(e,t),Jx(e,n)}function tu(e,t,n){qx(e,t),Yx(e,n)}function HCe(e,t,n){mDe.call(this,e,t,n)}function nu(e){zSe.call(this,e,!0)}function UCe(){ls.call(this,`Tail`,3)}function WCe(){ls.call(this,`Head`,1)}function ru(e){AM(),IYe.call(this,e)}function iu(e){Np.call(this,e,e,e,e)}function au(e){e.c=V(WW,FP,1,0,5,1)}function GCe(e){return e.b&&yN(e),e.a}function KCe(e){return e.b&&yN(e),e.c}function qCe(e,t){_K||(e.b=t)}function JCe(e,t){return e[e.length]=t}function YCe(e,t){return e[e.length]=t}function XCe(e,t){return Ex(t,E_(e))}function ZCe(e,t){return Ex(t,E_(e))}function QCe(e,t){return yS(uh(e.d),t)}function $Ce(e,t){return yS(uh(e.g),t)}function ewe(e,t){return yS(uh(e.j),t)}function ou(e,t){Wd.call(this,e.b,t)}function twe(e,t){tb(Jv(e.a),IRe(t))}function nwe(e,t){tb(Ib(e.a),LRe(t))}function rwe(e,t,n){$l(n,n.i+e,n.j+t)}function iwe(e,t,n){Sh(e.c[t.g],t.g,n)}function awe(e,t,n){P(e.c,71).Gi(t,n)}function su(e,t,n){return Sh(e,t,n),n}function owe(e){Dx(e.Sf(),new Zfe(e))}function cu(e){return e==null?0:US(e)}function swe(e){return e==null?0:US(e)}function lu(e){xP(),Tr.call(this,e)}function cwe(e){this.a=e,xje.call(this,e)}function uu(){uu=C,r.Math.log(2)}function du(){du=C,s9=(Xbe(),mVt)}function lwe(){lwe=C,D2=new NE(p8)}function fu(){fu=C,new uwe,new T}function uwe(){new Dr,new Dr,new Dr}function dwe(){throw E(new Ri(_Tt))}function fwe(){throw E(new Ri(_Tt))}function pwe(){throw E(new Ri(vTt))}function mwe(){throw E(new Ri(vTt))}function pu(e){this.a=e,co.call(this,e)}function mu(e){this.a=e,co.call(this,e)}function hwe(e,t){gh(),this.a=e,this.b=t}function gwe(e,t){ph(t),bg(e).Jc(new m)}function hu(e,t){qp(e.c,e.c.length,t)}function gu(e){return e.at)}function ywe(e,t){return dT(e,t)>0?e:t}function vu(e,t,n){return{l:e,m:t,h:n}}function bwe(e,t){e.a!=null&&qSe(t,e.a)}function xwe(e){U_(e,null),K_(e,null)}function Swe(e,t,n){return Qh(e.g,n,t)}function yu(e,t,n){return AD(t,n,e.c)}function Cwe(e,t,n){return Qh(e.k,n,t)}function wwe(e,t,n){return kht(e,t,n),n}function Twe(e,t){return z_(),t.n.b+=e}function Ewe(e){r_.call(this),this.b=e}function Dwe(e){$De.call(this),this.a=e}function Owe(){ls.call(this,`Range`,2)}function bu(e){this.b=e,this.a=new T}function kwe(e){this.b=new jt,this.a=e}function Awe(e){e.a=new me,e.c=new me}function jwe(e){e.a=new Dr,e.d=new Dr}function Mwe(e){q_(e,null),J_(e,null)}function Nwe(e,t){return Nht(e.a,t,null)}function Pwe(e,t){return Qh(e.a,t.a,t)}function xu(e){return new k(e.a,e.b)}function Fwe(e){return new k(e.c,e.d)}function Iwe(e){return new k(e.c,e.d)}function Su(e,t){return xmt(e.c,e.b,t)}function j(e,t){return e!=null&&kO(e,t)}function Cu(e,t){return XXe(e.Kc(),t)!=-1}function wu(e){return e.Ob()?e.Pb():null}function Lwe(e){this.b=(Vg(),new Kn(e))}function Rwe(e){this.a=e,Dr.call(this)}function zwe(){ad.call(this,null,null)}function Bwe(){od.call(this,null,null)}function Vwe(){so.call(this,`INSTANCE`,0)}function Hwe(){i8e(),this.a=new Yj(CJ)}function Uwe(e){return ND(e,0,e.length)}function Wwe(e,t){return new PTe(e.Kc(),t)}function Gwe(e,t){return e.a.Bc(t)!=null}function Kwe(e,t){RN(e),e.Gc(P(t,15))}function qwe(e,t,n){e.c.bd(t,P(n,136))}function Jwe(e,t,n){e.c.Ui(t,P(n,136))}function Ywe(e,t){e.c&&(pMe(t),LLe(t))}function Xwe(e,t){e.q.setHours(t),dN(e,t)}function Zwe(e,t){Sd(t,e.a.a.a,e.a.a.b)}function Qwe(e,t,n,r){Sh(e.a[t.g],n.g,r)}function Tu(e,t,n){return e.a[t.g][n.g]}function $we(e,t){return e.e[t.c.p][t.p]}function eTe(e,t){return e.c[t.c.p][t.p]}function Eu(e,t){return e.a[t.c.p][t.p]}function tTe(e,t){return e.j[t.p]=Aat(t)}function Du(e,t){return e.a.Bc(t)!=null}function nTe(e,t){return D(N(t.a))<=e}function rTe(e,t){return D(N(t.a))>=e}function iTe(e,t){return zUe(e.f,t.Pg())}function Ou(e,t){return e.a*t.a+e.b*t.b}function aTe(e,t){return e.a0?t/(e*e):t*100}function SEe(e,t){return e>0?t*t/e:t*t*100}function xd(e,t){return P(ix(e.a,t),34)}function CEe(e,t){return wA(),fj(e,t.e,t)}function wEe(e,t,n){return zo(),n.Mg(e,t)}function TEe(e){return zx(),e.e.a+e.f.a/2}function EEe(e,t,n){return zx(),n.e.a-e*t}function DEe(e){return zx(),e.e.b+e.f.b/2}function OEe(e,t,n){return zx(),n.e.b-e*t}function kEe(e){e.d=new gEe(e),e.e=new Dr}function AEe(){this.a=new g_,this.b=new g_}function jEe(e){this.c=e,this.a=1,this.b=1}function MEe(e){dP(),lge(this),this.Ff(e)}function NEe(e,t,n){gb(),e.pf(t)&&n.Cd(e)}function PEe(e,t,n){return M(t,Y1e(e,n))}function Sd(e,t,n){return e.a+=t,e.b+=n,e}function FEe(e,t,n){return e.a*=t,e.b*=n,e}function IEe(e,t){return e.a=t.a,e.b=t.b,e}function Cd(e){return e.a=-e.a,e.b=-e.b,e}function wd(e,t,n){return e.a-=t,e.b-=n,e}function LEe(e){vo.call(this),_S(this,e)}function REe(){so.call(this,`GROW_TREE`,0)}function zEe(){so.call(this,`POLYOMINO`,0)}function Td(e,t,n){lb.call(this,e,t,n,2)}function BEe(e,t,n){WT(Jv(e.a),t,IRe(n))}function VEe(e,t){Yo(),ad.call(this,e,t)}function HEe(e,t){Xo(),od.call(this,e,t)}function UEe(e,t){Xo(),HEe.call(this,e,t)}function WEe(e,t){Xo(),od.call(this,e,t)}function GEe(e,t){return e.c.Fc(P(t,136))}function KEe(e,t,n){WT(Ib(e.a),t,LRe(n))}function qEe(e){this.c=e,Gx(e,0),Kx(e,0)}function Ed(e,t){du(),Bp.call(this,e,t)}function JEe(e,t){du(),Ed.call(this,e,t)}function YEe(e,t){du(),Ed.call(this,e,t)}function XEe(e,t){du(),Bp.call(this,e,t)}function ZEe(e,t){du(),YEe.call(this,e,t)}function QEe(e,t){du(),XEe.call(this,e,t)}function $Ee(e,t){du(),Bp.call(this,e,t)}function eDe(e,t,n){return t.zl(e.e,e.c,n)}function tDe(e,t,n){return t.Al(e.e,e.c,n)}function nDe(e,t,n){return jN(Lb(e,t),n)}function Dd(e,t){return pT(e.e,P(t,54))}function rDe(e){return e==null?null:Fgt(e)}function iDe(e){return e==null?null:G9e(e)}function aDe(e){return e==null?null:PE(e)}function oDe(e){return e==null?null:PE(e)}function Od(e){return bp(e==null||il(e)),e}function N(e){return bp(e==null||al(e)),e}function kd(e){return bp(e==null||rl(e)),e}function Ad(e){e.o??zit(e)}function sDe(e){if(!e)throw E(new Lr)}function cDe(e){if(!e)throw E(new Ir)}function jd(e){if(!e)throw E(new Hr)}function Md(e){if(!e)throw E(new Rr)}function lDe(e){if(!e)throw E(new Vr)}function Nd(){Nd=C,_7=new c_e,new l_e}function Pd(){Pd=C,y4=new yr(`root`)}function uDe(){EJe.call(this),this.Bb|=pI}function dDe(e,t){this.d=e,wfe(this),this.b=t}function fDe(e,t){Qy.call(this,e),this.a=t}function pDe(e,t){Qy.call(this,e),this.a=t}function mDe(e,t,n){Ry.call(this,e,t,n,null)}function hDe(e,t,n){Ry.call(this,e,t,n,null)}function Fd(e,t){this.c=e,io.call(this,e,t)}function Id(e,t){this.a=e,Fd.call(this,e,t)}function gDe(e){this.q=new r.Date(Dv(e))}function _De(e){return e>8?0:e+1}function vDe(e,t){_K||M(e.a,t)}function yDe(e,t){return Io(),jC(t.d.i,e)}function bDe(e,t){return cC(),new Ilt(t,e)}function xDe(e,t,n){return e.Ne(t,n)<=0?n:t}function SDe(e,t,n){return e.Ne(t,n)<=0?t:n}function CDe(e,t){return P(ix(e.b,t),143)}function wDe(e,t){return P(ix(e.c,t),233)}function Ld(e){return P(Ep(e.a,e.b),294)}function TDe(e){return new k(e.c,e.d+e.a)}function EDe(e){return Gh(e),e?1231:1237}function DDe(e){return z_(),RCe(P(e,203))}function Rd(){Rd=C,lq=sE((TD(),x5))}function ODe(e,t){t.a?Irt(e,t):Du(e.a,t.b)}function zd(e,t,n){++e.j,e.tj(),Xy(e,t,n)}function kDe(e,t,n){++e.j,e.qj(t,e.Zi(t,n))}function ADe(e,t,n){e.fd(t).Rb(n)}function jDe(e,t,n){return n=qM(e,t,6,n),n}function Bd(e,t,n){return n=qM(e,t,3,n),n}function Vd(e,t,n){return n=qM(e,t,9,n),n}function Hd(e,t){return c_(t,Iyt),e.f=t,e}function MDe(e,t){return(t&AP)%e.d.length}function NDe(e,t,n){return Xft(e.c,e.b,t,n)}function PDe(e,t){this.c=e,kx.call(this,t)}function FDe(e,t){this.a=e,Hhe.call(this,t)}function Ud(e,t){this.a=e,Hhe.call(this,t)}function Wd(e,t){yr.call(this,e),this.a=t}function IDe(e,t){Khe.call(this,e),this.a=t}function Gd(e,t){Khe.call(this,e),this.a=t}function LDe(e){iD.call(this,0,0),this.f=e}function RDe(e,t,n){return e.a+=ND(t,0,n),e}function Kd(e){return!e.a&&(e.a=new ee),e.a}function zDe(e,t){var n=e.e;return e.e=t,n}function BDe(e,t){var n=t;return!!e.Fe(n)}function VDe(e,t){return rd(),e==t?0:e?1:-1}function qd(e,t){e.a.bd(e.b,t),++e.b,e.c=-1}function Jd(e){e.b?Jd(e.b):e.f.c.zc(e.e,e.d)}function HDe(e){Pm(e.e),e.d.b=e.d,e.d.a=e.d}function UDe(e,t,n){wo(),jde(e,t.Ve(e.a,n))}function WDe(e,t,n){return zm(e,P(t,22),n)}function Yd(e,t){return ua(Array(t),e)}function GDe(e){return nm(um(e,32))^nm(e)}function Xd(e){return String.fromCharCode(e)}function KDe(e){return e==null?null:e.message}function qDe(e,t,n){return e.apply(t,n)}function JDe(e,t){e[TI].call(e,t)}function YDe(e,t){e[TI].call(e,t)}function XDe(e,t){return Io(),!jC(t.d.i,e)}function ZDe(e,t,n,r){Np.call(this,e,t,n,r)}function QDe(){Qd.call(this),this.a=new Fa}function $De(){this.n=new Fa,this.o=new Fa}function eOe(){this.b=new Fa,this.c=new T}function tOe(){this.a=new T,this.b=new T}function nOe(){this.a=new Vt,this.b=new Tge}function Zd(){this.b=new ry,this.a=new ry}function rOe(){this.b=new Jr,this.a=new Jr}function iOe(){this.b=new Dr,this.a=new Dr}function aOe(){this.b=new _ye,this.a=new iae}function oOe(){this.a=new Tue,this.b=new Ure}function sOe(){this.a=new T,this.d=new T}function Qd(){this.n=new ni,this.i=new Ul}function cOe(e){this.a=(vS(e,hF),new Hy(e))}function lOe(e){this.a=(vS(e,hF),new Hy(e))}function uOe(e){return e<100?null:new Pa(e)}function dOe(e,t){return e.n.a=(Gh(t),t+10)}function fOe(e,t){return e.n.a=(Gh(t),t+10)}function pOe(e,t){return t==e||Uk(zj(t),e)}function mOe(e,t){return Qh(e.a,t,``)==null}function hOe(e,t){return t.qi(e.a)}function $d(e,t){return e.a+=t.a,e.b+=t.b,e}function ef(e,t){return e.a-=t.a,e.b-=t.b,e}function gOe(e){return Wr(e.j.c,0),e.a=-1,e}function tf(e,t,n){return n=qM(e,t,11,n),n}function _Oe(e,t,n){n!=null&&TS(t,dk(e,n))}function vOe(e,t,n){n!=null&&ES(t,dk(e,n))}function nf(e,t,n,r){F.call(this,e,t,n,r)}function rf(e,t,n,r){F.call(this,e,t,n,r)}function yOe(e,t,n,r){rf.call(this,e,t,n,r)}function bOe(e,t,n,r){wm.call(this,e,t,n,r)}function af(e,t,n,r){wm.call(this,e,t,n,r)}function of(e,t,n,r){wm.call(this,e,t,n,r)}function xOe(e,t,n,r){af.call(this,e,t,n,r)}function sf(e,t,n,r){af.call(this,e,t,n,r)}function cf(e,t,n,r){of.call(this,e,t,n,r)}function SOe(e,t,n,r){sf.call(this,e,t,n,r)}function COe(e,t,n,r){dPe.call(this,e,t,n,r)}function lf(e,t){Mi.call(this,PU+e+bU+t)}function uf(e,t){return e.jk().wi().ri(e,t)}function df(e,t){return e.jk().wi().ti(e,t)}function wOe(e,t){return Gh(e),A(e)===A(t)}function ff(e,t){return Gh(e),A(e)===A(t)}function TOe(e,t){return e.b.Bd(new sxe(e,t))}function EOe(e,t){return e.b.Bd(new cxe(e,t))}function DOe(e,t){return e.b.Bd(new lxe(e,t))}function OOe(e,t){return e.e=P(e.d.Kb(t),159)}function pf(e,t,n){return e.lastIndexOf(t,n)}function kOe(e,t,n){return aE(e[t.a],e[n.a])}function AOe(e,t){return W(t,(mP(),d1),e)}function jOe(e,t){return _u(t.a.d.p,e.a.d.p)}function MOe(e,t){return _u(e.a.d.p,t.a.d.p)}function NOe(e,t){return aE(e.c-e.s,t.c-t.s)}function POe(e,t){return aE(e.b.e.a,t.b.e.a)}function FOe(e,t){return aE(e.c.e.a,t.c.e.a)}function IOe(e){return e.c?Ab(e.c.a,e,0):-1}function mf(e){return e==L8||e==z8||e==R8}function LOe(e,t){this.c=e,Hm.call(this,e,t)}function ROe(e,t,n){this.a=e,sEe.call(this,t,n)}function zOe(e){this.c=e,vl.call(this,tF,0)}function BOe(e,t,n){this.c=t,this.b=n,this.a=e}function hf(e){Rf(),this.d=e,this.a=new Iu}function VOe(e){wf(),this.a=(Vg(),new oa(e))}function HOe(e,t){ql(e.f)?Ait(e,t):f7e(e,t)}function UOe(e,t){kje.call(this,e,e.length,t)}function WOe(e,t){_K||t&&(e.d=t)}function GOe(e,t){return j(t,15)&&Mct(e.c,t)}function KOe(e,t,n){return P(e.c,71).Wk(t,n)}function gf(e,t,n){return P(e.c,71).Xk(t,n)}function qOe(e,t,n){return eDe(e,P(t,343),n)}function JOe(e,t,n){return tDe(e,P(t,343),n)}function YOe(e,t,n){return E5e(e,P(t,343),n)}function XOe(e,t,n){return A7e(e,P(t,343),n)}function _f(e,t){return t==null?null:TT(e.b,t)}function ZOe(e){return al(e)?(Gh(e),e):e.ue()}function vf(e){return!isNaN(e)&&!isFinite(e)}function yf(e){Awe(this),Fg(this),XS(this,e)}function bf(e){au(this),Fje(this.c,0,e.Pc())}function xf(e,t,n){this.a=e,this.b=t,this.c=n}function QOe(e,t,n){this.a=e,this.b=t,this.c=n}function $Oe(e,t,n){this.d=e,this.b=n,this.a=t}function eke(e){this.a=e,yo(),LC(Date.now())}function tke(e){Fh(e.a),KWe(e.c,e.b),e.b=null}function Sf(){Sf=C,aK=new he,oEt=new ge}function nke(){nke=C,TVt=V(WW,FP,1,0,5,1)}function rke(){rke=C,QVt=V(WW,FP,1,0,5,1)}function Cf(){Cf=C,$Vt=V(WW,FP,1,0,5,1)}function wf(){wf=C,new mge((Vg(),Vg(),QG))}function ike(e){return Sb(),iS((TGe(),dEt),e)}function ake(e){return Zw(),iS((MWe(),vEt),e)}function oke(e){return fO(),iS((wHe(),DEt),e)}function ske(e){return dx(),iS((THe(),OEt),e)}function cke(e){return vM(),iS((CXe(),kEt),e)}function lke(e){return Ix(),iS((AWe(),MEt),e)}function uke(e){return Cb(),iS((kWe(),PEt),e)}function dke(e){return Xb(),iS((jWe(),LEt),e)}function fke(e){return SP(),iS((uCe(),oDt),e)}function pke(e){return KC(),iS((DGe(),cDt),e)}function mke(e){return TO(),iS((kGe(),uDt),e)}function hke(e){return wO(),iS((OGe(),mDt),e)}function gke(e){return No(),iS((VBe(),hDt),e)}function _ke(e){return fx(),iS((EHe(),NDt),e)}function vke(e){return Yb(),iS((NWe(),aOt),e)}function yke(e){return vA(),iS((PKe(),lOt),e)}function bke(e){return ow(),iS((jGe(),hOt),e)}function xke(e){return YD(),iS((AGe(),xOt),e)}function Tf(e,t){if(!e)throw E(new Fi(t))}function Ef(e){if(!e)throw E(new Ii(Wvt))}function Df(e,t){if(e!=t)throw E(new Vr)}function Ske(e,t,n){this.a=e,this.b=t,this.c=n}function Of(e,t,n){this.a=e,this.b=t,this.c=n}function Cke(e,t,n){this.a=e,this.b=t,this.c=n}function kf(e,t,n){this.b=e,this.a=t,this.c=n}function Af(e,t,n){this.b=e,this.c=t,this.a=n}function jf(e,t,n){this.a=e,this.b=t,this.c=n}function Mf(e,t,n){this.e=t,this.b=e,this.d=n}function wke(e,t,n){this.b=e,this.a=t,this.c=n}function Tke(e,t,n){return wo(),e.a.Yd(t,n),t}function Nf(e){var t=new Ze;return t.e=e,t}function Pf(e){var t=new Hge;return t.b=e,t}function Ff(){Ff=C,oY=new vte,sY=new yte}function If(){If=C,ROt=new Kte,LOt=new qte}function Lf(){Lf=C,UOt=new tre,WOt=new nre}function Eke(e){return kS(),iS((uWe(),ekt),e)}function Dke(e){return yP(),iS((dCe(),NOt),e)}function Oke(e){return iw(),iS((NGe(),IOt),e)}function kke(e){return aw(),iS((MGe(),qOt),e)}function Ake(e){return tA(),iS((FKe(),YOt),e)}function jke(e){return dM(),iS((KYe(),tkt),e)}function Mke(e){return GA(),iS((Eqe(),nkt),e)}function Nke(e){return Ky(),iS((NHe(),rkt),e)}function Pke(e){return bS(),iS((cWe(),ikt),e)}function Fke(e){return lS(),iS((lWe(),akt),e)}function Ike(e){return FD(),iS((IKe(),okt),e)}function Lke(e){return px(),iS((kHe(),skt),e)}function Rke(e){return TA(),iS((kqe(),pkt),e)}function zke(e){return uM(),iS((gZe(),mkt),e)}function Bke(e){return qC(),iS((fWe(),hkt),e)}function Vke(e){return Zb(),iS((pWe(),_kt),e)}function Hke(e){return Bv(),iS((OHe(),vkt),e)}function Uke(e){return qk(),iS((Oqe(),fkt),e)}function Wke(e){return _w(),iS((dWe(),lkt),e)}function Gke(e){return kA(),iS((Dqe(),ukt),e)}function Kke(e){return wb(),iS((AHe(),dkt),e)}function qke(e){return XE(),iS((RKe(),ykt),e)}function Jke(e){return Zj(),iS((bXe(),MMt),e)}function Yke(e){return hT(),iS((mWe(),FMt),e)}function Xke(e){return IO(),iS((PGe(),IMt),e)}function Zke(e){return CO(),iS((LKe(),zMt),e)}function Qke(e){return FM(),iS((_Ze(),GMt),e)}function $ke(e){return ID(),iS((FGe(),JMt),e)}function eAe(e){return Qb(),iS((jHe(),XMt),e)}function tAe(e){return uS(),iS((_We(),QMt),e)}function nAe(e){return CC(),iS((hWe(),nNt),e)}function rAe(e){return Nw(),iS((gWe(),iNt),e)}function iAe(e){return Xw(),iS((vWe(),sNt),e)}function aAe(e){return cS(),iS((yWe(),dNt),e)}function oAe(e){return sw(),iS((bWe(),pNt),e)}function sAe(e){return sS(),iS((OWe(),jNt),e)}function cAe(e){return Vv(),iS((MHe(),RNt),e)}function lAe(e){return O_(),iS((IHe(),qNt),e)}function uAe(e){return k_(),iS((LHe(),YNt),e)}function dAe(e){return Wy(),iS((RHe(),dPt),e)}function fAe(e){return D_(),iS((zHe(),vPt),e)}function pAe(e){return Ok(),iS((YGe(),bPt),e)}function mAe(e){return LM(),iS((fCe(),NPt),e)}function hAe(e){return Pw(),iS((xWe(),IPt),e)}function gAe(e){return Jw(),iS((JGe(),TFt),e)}function _Ae(e){return iv(),iS((PHe(),OFt),e)}function vAe(e){return AS(),iS((FHe(),PFt),e)}function yAe(e){return iA(),iS((zKe(),IFt),e)}function bAe(e){return Yw(),iS((SWe(),UFt),e)}function xAe(e){return _b(),iS((BHe(),zFt),e)}function SAe(e){return uk(),iS((qGe(),wIt),e)}function CAe(e){return SC(),iS((CWe(),OIt),e)}function wAe(e){return ED(),iS((wWe(),AIt),e)}function TAe(e){return LO(),iS((TWe(),MIt),e)}function EAe(e){return TE(),iS((EWe(),RIt),e)}function DAe(e){return my(),iS((VHe(),xLt),e)}function OAe(e){return dC(),iS((DHe(),AOt),e)}function kAe(e){return DA(),iS((Aqe(),TOt),e)}function AAe(e){return Tb(),iS((DWe(),TLt),e)}function jAe(e){return JC(),iS((HHe(),kLt),e)}function MAe(e){return Wj(),iS((BKe(),MLt),e)}function NAe(e){return Bo(),iS((sVe(),FLt),e)}function PAe(e){return KT(),iS((FWe(),NLt),e)}function FAe(e){return Vo(),iS((cVe(),LLt),e)}function IAe(e){return Gy(),iS((UHe(),zLt),e)}function LAe(e){return MA(),iS((VKe(),WLt),e)}function RAe(e){return Ho(),iS((lVe(),SRt),e)}function zAe(e){return cw(),iS((WHe(),TRt),e)}function BAe(e){return uO(),iS((UKe(),FRt),e)}function VAe(e){return VA(),iS((WYe(),RRt),e)}function HAe(e){return RO(),iS((jqe(),HRt),e)}function UAe(e){return eA(),iS((Mqe(),ezt),e)}function WAe(e){return GT(),iS((HKe(),nBt),e)}function GAe(e){return Lx(),iS((IWe(),iBt),e)}function KAe(e){return wE(),iS((XGe(),aBt),e)}function qAe(e){return hA(),iS((Nqe(),fBt),e)}function JAe(e){return _T(),iS((PWe(),bBt),e)}function YAe(e){return kk(),iS((ZGe(),SBt),e)}function XAe(e){return Ej(),iS((SXe(),CBt),e)}function ZAe(e){return pO(),iS((WKe(),EBt),e)}function QAe(e){return rA(),iS((Pqe(),OBt),e)}function $Ae(e){return rj(),iS((Fqe(),kBt),e)}function eje(e){return nP(),iS((GKe(),ABt),e)}function tje(e){return TD(),iS((QGe(),IBt),e)}function nje(e){return UM(),iS((xXe(),RBt),e)}function rje(e){return gT(),iS((LWe(),VBt),e)}function ije(e,t){return Gh(e),e+(Gh(t),t)}function aje(e){return zf(),iS((GHe(),WBt),e)}function oje(e){return ZE(),iS(($Ge(),YBt),e)}function sje(e){return Mw(),iS((eKe(),tVt),e)}function Rf(){Rf=C,PNt=(nP(),g5),v2=X8}function zf(){zf=C,HBt=new AMe,UBt=new cPe}function cje(e){return!e.e&&(e.e=new T),e.e}function Bf(e,t){this.c=e,this.a=t,this.b=t-e}function lje(e,t,n){this.a=e,this.b=t,this.c=n}function Vf(e,t,n){this.a=e,this.b=t,this.c=n}function Hf(e,t,n){this.a=e,this.b=t,this.c=n}function Uf(e,t,n){this.a=e,this.b=t,this.c=n}function uje(e,t,n){this.a=e,this.b=t,this.c=n}function dje(e,t,n){this.a=e,this.b=t,this.c=n}function Wf(e,t,n){this.e=e,this.a=t,this.c=n}function fje(e,t,n){du(),ILe.call(this,e,t,n)}function Gf(e,t,n){du(),Ph.call(this,e,t,n)}function pje(e,t,n){du(),Ph.call(this,e,t,n)}function mje(e,t,n){du(),Ph.call(this,e,t,n)}function hje(e,t,n){du(),Gf.call(this,e,t,n)}function gje(e,t,n){du(),Gf.call(this,e,t,n)}function _je(e,t,n){du(),gje.call(this,e,t,n)}function vje(e,t,n){du(),pje.call(this,e,t,n)}function yje(e,t,n){du(),mje.call(this,e,t,n)}function Kf(e){Np.call(this,e.d,e.c,e.a,e.b)}function bje(e){Np.call(this,e.d,e.c,e.a,e.b)}function xje(e){this.d=e,wfe(this),this.b=FNe(e.d)}function Sje(e){return Sj(),iS((GYe(),bVt),e)}function qf(e,t){return ph(e),ph(t),new Hye(e,t)}function Jf(e,t){return ph(e),ph(t),new oMe(e,t)}function Cje(e,t){return ph(e),ph(t),new sMe(e,t)}function wje(e,t){return ph(e),ph(t),new Qye(e,t)}function Yf(e){return jd(e.b!=0),Ox(e,e.a.a)}function Tje(e){return jd(e.b!=0),Ox(e,e.c.b)}function Eje(e){return!e.c&&(e.c=new ln),e.c}function Xf(e){var t=new T;return rx(t,e),t}function Dje(e){var t=new Jr;return rx(t,e),t}function Oje(e){var t=new Nge;return HS(t,e),t}function Zf(e){var t=new vo;return HS(t,e),t}function P(e,t){return bp(e==null||kO(e,t)),e}function kje(e,t,n){WNe.call(this,t,n),this.a=e}function Aje(e,t){this.c=e,this.b=t,this.a=!1}function jje(){this.a=`;,;`,this.b=``,this.c=``}function Mje(e,t,n){this.b=e,aCe.call(this,t,n)}function Nje(e,t,n){this.c=e,ds.call(this,t,n)}function Pje(e,t,n){js.call(this,e,t),this.b=n}function Fje(e,t,n){art(n,0,e,t,n.length,!1)}function Qf(e,t,n,r,i){e.b=t,e.c=n,e.d=r,e.a=i}function Ije(e,t,n,r,i){e.d=t,e.c=n,e.a=r,e.b=i}function Lje(e,t){t&&(e.b=t,e.a=(Hh(t),t.a))}function $f(e,t){if(!e)throw E(new Fi(t))}function ep(e,t){if(!e)throw E(new Ii(t))}function Rje(e,t){if(!e)throw E(new ove(t))}function zje(e,t){return Ro(),_u(e.d.p,t.d.p)}function Bje(e,t){return zx(),aE(e.e.b,t.e.b)}function Vje(e,t){return zx(),aE(e.e.a,t.e.a)}function Hje(e,t){return _u(bMe(e.d),bMe(t.d))}function tp(e,t){return t&&Lh(e,t.d)?t:null}function Uje(e,t){return t==(nP(),g5)?e.c:e.d}function Wje(e){return MC(gPe(Il(e)?zC(e):e))}function Gje(e){return new k(e.c+e.b,e.d+e.a)}function Kje(e){return e!=null&&!zE(e,y7,b7)}function qje(e,t){return(R$e(e)<<4|R$e(t))&OF}function Jje(e,t,n,r,i){e.c=t,e.d=n,e.b=r,e.a=i}function Yje(e){var t=e.b;e.b=e.c,e.c=t}function Xje(e){var t,n=e.d;t=e.a,e.d=t,e.a=n}function Zje(e,t){var n=e.c;return PJe(e,t),n}function Qje(e,t){return e.g=t<0?-1:t,e}function np(e,t){return bqe(e),e.a*=t,e.b*=t,e}function $je(e,t,n){pqe.call(this,t,n),this.d=e}function rp(e,t,n){el.call(this,e,t),this.c=n}function ip(e,t,n){el.call(this,e,t),this.c=n}function eMe(e){Cf(),sn.call(this),this.ci(e)}function tMe(){By(),uFe.call(this,(qo(),N7))}function nMe(e){return xP(),++W9,new zp(0,e)}function rMe(){rMe=C,f9=(Vg(),new Gn(xW))}function ap(){ap=C,new FO((mi(),ZW),(pi(),XW))}function iMe(){iMe=C,OG=V(DG,X,17,256,0,1)}function aMe(){this.b=D(N(hO((XM(),eJ))))}function op(e){this.b=e,this.a=am(this.b.a).Od()}function oMe(e,t){this.b=e,this.a=t,dn.call(this)}function sMe(e,t){this.a=e,this.b=t,dn.call(this)}function cMe(e,t,n){this.a=e,El.call(this,t,n)}function lMe(e,t,n){this.a=e,El.call(this,t,n)}function sp(e,t,n){hx(e,t,new mh(n))}function uMe(e,t,n){var r=e[t];return e[t]=n,r}function cp(e){return yb(e.slice(),e)}function lp(e){var t=e.n;return e.a.b+t.d+t.a}function dMe(e){var t=e.n;return e.e.b+t.d+t.a}function fMe(e){var t=e.n;return e.e.a+t.b+t.c}function pMe(e){e.a.b=e.b,e.b.a=e.a,e.a=e.b=null}function up(e,t){return iy(e,t,e.c.b,e.c),!0}function mMe(e){return e.a?e.a:xg(e)}function hMe(e){return Ug(),xA(e)==I_(SA(e))}function gMe(e){return Ug(),SA(e)==I_(xA(e))}function dp(e,t){return Bk(e,new js(t.a,t.b))}function _Me(e,t){return eg(),ik(e,t),new jFe(e,t)}function vMe(e,t){return e.c=t)throw E(new e_e)}function _m(e,t){return MT(e,(Gh(t),new jfe(t)))}function vm(e,t){return MT(e,(Gh(t),new Mfe(t)))}function XNe(e,t,n){return kvt(e,P(t,12),P(n,12))}function ZNe(e){return fC(),P(e,12).g.c.length!=0}function QNe(e){return fC(),P(e,12).e.c.length!=0}function $Ne(e,t){return cC(),aE(t.a.o.a,e.a.o.a)}function ePe(e,t){(t.Bb&GH)!=0&&!e.a.o&&(e.a.o=t)}function tPe(e,t){t.Ug(`General 'Rotator`,1),vgt(e)}function nPe(e,t,n){t.qf(n,D(N(xh(e.b,n)))*e.a)}function rPe(e,t,n){return fM(),_C(e,t)&&_C(e,n)}function ym(e){return rj(),!e.Hc(G8)&&!e.Hc(q8)}function iPe(e){return e.e?$Ue(e.e):null}function bm(e){return Il(e)?``+e:Ect(e)}function aPe(e){for(var t=e;t.f;)t=t.f;return t}function oPe(e,t,n){return Sh(t,0,Op(t[0],n[0])),t}function xm(e,t,n,r){var i=e.i;i.i=t,i.a=n,i.b=r}function F(e,t,n,r){ju.call(this,e,t,n),this.b=r}function Sm(e,t,n,r,i){ub.call(this,e,t,n,r,i,-1)}function Cm(e,t,n,r,i){db.call(this,e,t,n,r,i,-1)}function wm(e,t,n,r){rp.call(this,e,t,n),this.b=r}function sPe(e){zSe.call(this,e,!1),this.a=!1}function cPe(){vSe.call(this,`LOOKAHEAD_LAYOUT`,1)}function lPe(e){this.b=e,cd.call(this,e),CTe(this)}function uPe(e){this.b=e,ud.call(this,e),wTe(this)}function Tm(e,t,n){this.a=e,nf.call(this,t,n,5,6)}function dPe(e,t,n,r){this.b=e,ju.call(this,t,n,r)}function fPe(e,t){this.b=e,_de.call(this,e.b),this.a=t}function pPe(e){this.a=m4e(e.a),this.b=new bf(e.b)}function mPe(e,t){gh(),rbe.call(this,e,bT(new Wi(t)))}function Em(e,t){return xP(),++W9,new Nh(e,t,0)}function Dm(e,t){return xP(),++W9,new Nh(6,e,t)}function Om(e,t){for(Gh(t);e.Ob();)t.Cd(e.Pb())}function km(e,t){return rl(t)?e_(e,t):!!Kp(e.f,t)}function Am(e,t){return t.Vh()?pT(e.b,P(t,54)):t}function hPe(e,t){return ff(e.substr(0,t.length),t)}function jm(e){return new pm(new ATe(e.a.length,e.a))}function Mm(e){return new k(e.c+e.b/2,e.d+e.a/2)}function gPe(e){return vu(~e.l&QF,~e.m&QF,~e.h&$F)}function Nm(e){return typeof e===EP||typeof e===kP}function Pm(e){e.f=new PCe(e),e.i=new FCe(e),++e.g}function _Pe(e){if(!e)throw E(new Hr);return e.d}function Fm(e){var t=yw(e);return jd(t!=null),t}function vPe(e){var t=u1e(e);return jd(t!=null),t}function Im(e,t){var n=e.a.gc();return RUe(t,n),n-t}function Lm(e,t){return e.a.zc(t,e)==null}function Rm(e,t){return e.a.zc(t,(rd(),vG))==null}function yPe(e){return new Mp(null,OPe(e,e.length))}function bPe(e,t,n){return ypt(e,P(t,42),P(n,176))}function zm(e,t,n){return PS(e.a,t),uMe(e.b,t.g,n)}function xPe(e,t,n){gm(n,e.a.c.length),uy(e.a,n,t)}function I(e,t,n,r){TQe(t,n,e.length),SPe(e,t,n,r)}function SPe(e,t,n,r){var i;for(i=t;i0?r.Math.log(e/t):-100}function DPe(e,t){return dT(e,t)<0?-1:+(dT(e,t)>0)}function qm(e,t){Kwe(e,j(t,160)?t:P(t,2036).Rl())}function Jm(e,t){if(e==null)throw E(new Li(t))}function OPe(e,t){return gqe(t,e.length),new kMe(e,t)}function Ym(e,t){return t?XS(e,t):!1}function kPe(){return xi(),U(O(MTt,1),Z,549,0,[tG])}function Xm(e){return e.e==0?e:new Bm(-e.e,e.d,e.a)}function APe(e,t){return aE(e.c.c+e.c.b,t.c.c+t.c.b)}function Zm(e,t){iy(e.d,t,e.b.b,e.b),++e.a,e.c=null}function jPe(e,t){return e.c?jPe(e.c,t):M(e.b,t),e}function MPe(e,t,n){var r=ax(e,t);return Yv(e,t,n),r}function NPe(e,t,n){var r;for(r=0;r=e.g}function Sh(e,t,n){return cDe(n==null||mdt(e,n)),e[t]=n}function Ch(e,t){return sv(t,e.length+1),e.substr(t)}function wh(e,t){for(Gh(t);e.c=e?new _be:RJe(e-1)}function Bh(e){return!e.a&&e.c?e.c.b:e.a}function Vh(e){return j(e,616)?e:new KLe(e)}function Hh(e){e.c?Hh(e.c):(lE(e),e.d=!0)}function Uh(e){e.c?e.c.$e():(e.d=!0,bot(e))}function _Fe(e){e.b=!1,e.c=!1,e.d=!1,e.a=!1}function vFe(e){return e.c.i.c==e.d.i.c}function yFe(e,t){var n=e.Ih(t);n>=0?e.ki(n):Qtt(e,t)}function bFe(e,t){e.c<0||e.b.b0;)e=e<<1|e<0;return e}function BFe(e,t){var n=new Eh(e);return Mr(t.c,n),n}function VFe(e,t){e.u.Hc((rj(),G8))&&bnt(e,t),RWe(e,t)}function rg(e,t){return A(e)===A(t)||e!=null&&NT(e,t)}function ig(e,t){return Gp(e.a,t)?e.b[P(t,22).g]:null}function HFe(){return No(),U(O(Oq,1),Z,489,0,[Dq])}function UFe(){return Bo(),U(O(PLt,1),Z,490,0,[v3])}function WFe(){return Vo(),U(O(ILt,1),Z,558,0,[y3])}function GFe(){return Ho(),U(O(xRt,1),Z,539,0,[O3])}function ag(e){return!e.n&&(e.n=new F(Q5,e,1,7)),e.n}function og(e){return!e.c&&(e.c=new F(e7,e,9,9)),e.c}function sg(e){return!e.c&&(e.c=new cf(H5,e,5,8)),e.c}function KFe(e){return!e.b&&(e.b=new cf(H5,e,4,7)),e.b}function cg(e){return e.j.c.length=0,yg(e.c),gOe(e.a),e}function lg(e){return e.e==SW&&gfe(e,p2e(e.g,e.b)),e.e}function ug(e){return e.f==SW&&vfe(e,O6e(e.g,e.b)),e.f}function dg(e,t,n,r){return lXe(e,t,n,!1),LT(e,r),e}function qFe(e,t){this.b=e,Hm.call(this,e,t),CTe(this)}function JFe(e,t){this.b=e,LOe.call(this,e,t),wTe(this)}function fg(e){this.d=e,this.a=this.d.b,this.b=this.d.c}function pg(e,t){this.b=e,this.c=t,this.a=new _o(this.b)}function mg(e,t){return sv(t,e.length),e.charCodeAt(t)}function YFe(e,t){fE(e,D(nS(t,`x`)),D(nS(t,`y`)))}function XFe(e,t){fE(e,D(nS(t,`x`)),D(nS(t,`y`)))}function hg(e,t){return lE(e),new Mp(e,new UGe(t,e.a))}function gg(e,t){return lE(e),new Mp(e,new WUe(t,e.a))}function _g(e,t){return lE(e),new fDe(e,new HUe(t,e.a))}function vg(e,t){return lE(e),new pDe(e,new UUe(t,e.a))}function ZFe(e,t){return new VIe(P(ph(e),50),P(ph(t),50))}function QFe(e,t){return aE(e.d.c+e.d.b/2,t.d.c+t.d.b/2)}function $Fe(e,t,n){n.a?Kx(e,t.b-e.f/2):Gx(e,t.a-e.g/2)}function eIe(e,t){return aE(e.g.c+e.g.b/2,t.g.c+t.g.b/2)}function tIe(e,t){return Pbe(),aE((Gh(e),e),(Gh(t),t))}function nIe(e){return e!=null&&po(x7,e.toLowerCase())}function yg(e){var t;for(t=e.Kc();t.Ob();)t.Pb(),t.Qb()}function bg(e){var t=e.b;return!t&&(e.b=t=new lde(e)),t}function xg(e){return HJe(e)||null}function rIe(e,t){var n=e/t,r=C_(n);return n>r&&++r,r}function iIe(e,t,n){var r=P(e.d.Kb(n),159);r&&r.Nb(t)}function aIe(e,t,n){gpt(e.a,n),PXe(n),sit(e.b,n),Wpt(t,n)}function Sg(e,t,n,r){this.a=e,this.c=t,this.b=n,this.d=r}function Cg(e,t,n,r){this.c=e,this.b=t,this.a=n,this.d=r}function oIe(e,t,n,r){this.c=e,this.b=t,this.d=n,this.a=r}function wg(e,t,n,r){this.c=e,this.d=t,this.b=n,this.a=r}function sIe(e,t,n,r){this.a=e,this.d=t,this.c=n,this.b=r}function Tg(e,t,n,r){this.a=e,this.e=t,this.d=n,this.c=r}function cIe(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function Eg(e,t,n){this.a=ryt,this.d=e,this.b=t,this.c=n}function Dg(e,t,n,r){so.call(this,e,t),this.a=n,this.b=r}function lIe(e,t){this.d=(Gh(e),e),this.a=16449,this.c=t}function uIe(e){this.a=new T,this.e=V(q9,X,53,e,0,2)}function dIe(e){e.Ug(`No crossing minimization`,1),e.Vg()}function fIe(){yi.call(this,`There is no more element.`)}function pIe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function mIe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function Og(e,t,n,r){this.e=e,this.a=t,this.c=n,this.d=r}function hIe(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function gIe(e,t,n,r){du(),GUe.call(this,t,n,r),this.a=e}function _Ie(e,t,n,r){du(),GUe.call(this,t,n,r),this.a=e}function kg(e,t,n){var r=n_t(e);return t.ti(n,r)}function Ag(e){var t,n=(t=new kr,t);return Nx(n,e),n}function jg(e){var t,n=(t=new kr,t);return i9e(n,e),n}function vIe(e,t){return yC(t,xh(e.f,t)),null}function yIe(e){return!e.b&&(e.b=new F(U5,e,12,3)),e.b}function bIe(e){return bp(e==null||Nm(e)&&e.Tm!==ne),e}function Mg(e){return e.n&&(e.e!==eyt&&e.je(),e.j=null),e}function Ng(e){if(RE(e.d),e.d.d!=e.c)throw E(new Vr)}function Pg(e){return jd(e.b0&&d8e(this)}function xIe(e,t){this.a=e,dDe.call(this,e,P(e.d,15).fd(t))}function SIe(e,t){return aE(Lp(e)*Ip(e),Lp(t)*Ip(t))}function CIe(e,t){return aE(Lp(e)*Ip(e),Lp(t)*Ip(t))}function wIe(e){return uj(e)&&ki(Od(J(e,(mP(),A1))))}function TIe(e,t){return fj(e,P(K(t,(mP(),Y1)),17),t)}function EIe(e,t){return P(K(e,(Y(),PQ)),15).Fc(t),t}function Lg(e,t){return e.b=t.b,e.c=t.c,e.d=t.d,e.a=t.a,e}function DIe(e,t,n,r){this.b=e,this.c=r,vl.call(this,t,n)}function OIe(e,t,n){e.i=0,e.e=0,t!=n&&RZe(e,t,n)}function kIe(e,t,n){e.i=0,e.e=0,t!=n&&zZe(e,t,n)}function AIe(e,t,n){return Lo(),N1e(P(xh(e.e,t),529),n)}function Rg(e){var t;return t=e.f,t||(e.f=new io(e,e.c))}function jIe(e,t){return CT(e.j,t.s,t.c)+CT(t.e,e.s,e.c)}function MIe(e,t){e.e&&!e.e.a&&(Qhe(e.e,t),MIe(e.e,t))}function NIe(e,t){e.d&&!e.d.a&&(Qhe(e.d,t),NIe(e.d,t))}function PIe(e,t){return-aE(Lp(e)*Ip(e),Lp(t)*Ip(t))}function FIe(e){return P(e.ld(),149).Pg()+`:`+PE(e.md())}function IIe(){EA(this,new $ue),this.wb=(vh(),z7),Ra()}function LIe(e){this.b=new T,nw(this.b,this.b),this.a=e}function zg(e,t){new vo,this.a=new ai,this.b=e,this.c=t}function Bg(){Bg=C,nK=new ue,rK=new ue,iK=new de}function Vg(){Vg=C,QG=new ae,$G=new se,eK=new ce}function Hg(){Hg=C,wEt=new Ge,EEt=new yNe,TEt=new Ke}function Ug(){Ug=C,zq=new T,Rq=new Dr,Lq=new T}function Wg(e,t){if(e==null)throw E(new Li(t));return e}function Gg(e){return!e.a&&(e.a=new F($5,e,10,11)),e.a}function Kg(e){return!e.q&&(e.q=new F(M7,e,11,10)),e.q}function R(e){return!e.s&&(e.s=new F(w7,e,21,17)),e.s}function RIe(e){return ph(e),z4e(new pm(Vu(e.a.Kc(),new d)))}function zIe(e,t){return $w(e),$w(t),eve(P(e,22),P(t,22))}function qg(e,t,n){hx(e,t,new Cn(ZOe(n)))}function Jg(e,t,n,r,i,a){db.call(this,e,t,n,r,i,a?-2:-1)}function BIe(e,t,n,r){el.call(this,t,n),this.b=e,this.a=r}function VIe(e,t){F_e.call(this,new mm(e)),this.a=e,this.b=t}function Yg(e){this.b=e,this.c=e,e.e=null,e.c=null,this.a=1}function HIe(e){Lf();var t=P(e.g,10);t.n.a=e.d.c+t.d.b}function Xg(){Xg=C;var e,t=!L0e();e=new b,lG=t?new y:e}function Zg(e){return Vg(),j(e,59)?new sa(e):new qu(e)}function Qg(e){return j(e,16)?new jp(P(e,16)):Dje(e.Kc())}function UIe(e){return new DTe(e,e.e.Rd().gc()*e.c.Rd().gc())}function WIe(e){return new OTe(e,e.e.Rd().gc()*e.c.Rd().gc())}function $g(e){return e&&e.hashCode?e.hashCode():td(e)}function e_(e,t){return t==null?!!Kp(e.f,null):dNe(e.i,t)}function GIe(e,t){var n=Gwe(e.a,t);return n&&(t.d=null),n}function KIe(e,t,n){return e.f?e.f.ef(t,n):!1}function t_(e,t,n,r){Sh(e.c[t.g],n.g,r),Sh(e.c[n.g],t.g,r)}function n_(e,t,n,r){Sh(e.c[t.g],t.g,n),Sh(e.b[t.g],t.g,r)}function qIe(e,t,n){return D(N(n.a))<=e&&D(N(n.b))>=t}function JIe(e,t){this.g=e,this.d=U(O(UJ,1),jR,10,0,[t])}function YIe(e){this.c=e,this.b=new Ja(P(ph(new qe),50))}function XIe(e){this.c=e,this.b=new Ja(P(ph(new dee),50))}function ZIe(e){this.b=e,this.a=new Ja(P(ph(new At),50))}function QIe(){this.b=new Jr,this.d=new vo,this.e=new $r}function r_(){this.c=new Fa,this.d=new Fa,this.e=new Fa}function i_(){this.a=new ai,this.b=(vS(3,hF),new Hy(3))}function a_(e,t){this.e=e,this.a=WW,this.b=glt(t),this.c=t}function o_(e){this.c=e.c,this.d=e.d,this.b=e.b,this.a=e.a}function $Ie(e,t,n,r,i,a){this.a=e,xS.call(this,t,n,r,i,a)}function eLe(e,t,n,r,i,a){this.a=e,xS.call(this,t,n,r,i,a)}function s_(e,t,n,r,i,a,o){return new ey(e.e,t,n,r,i,a,o)}function tLe(e,t,n){return n>=0&&ff(e.substr(n,t.length),t)}function nLe(e,t){return j(t,149)&&ff(e.b,P(t,149).Pg())}function rLe(e,t){return e.a?t.Gh().Kc():P(t.Gh(),71).Ii()}function iLe(e,t){var n=e.b.Qc(t);return bHe(n,e.b.gc()),n}function c_(e,t){if(e==null)throw E(new Li(t));return e}function l_(e){return e.u||=(_y(e),new FDe(e,e)),e.u}function u_(e){this.a=(Vg(),j(e,59)?new sa(e):new qu(e))}function d_(e){return P(NC(e,16),29)||e.ii()}function f_(e,t){var n=Ha(e.Rm);return t==null?n:n+`: `+t}function p_(e,t,n){return Zy(t,n,e.length),e.substr(t,n-t)}function aLe(e,t){Qd.call(this),Px(this),this.a=e,this.c=t}function oLe(e){!e||f_(e,e.ie())}function sLe(e){Qi(),r.setTimeout(function(){throw e},0)}function cLe(){return fO(),U(O(DK,1),Z,436,0,[EK,TK])}function lLe(){return dx(),U(O(AK,1),Z,435,0,[OK,kK])}function uLe(){return fx(),U(O(Uq,1),Z,432,0,[Vq,Hq])}function dLe(){return dC(),U(O(kOt,1),Z,517,0,[aY,iY])}function fLe(){return Bv(),U(O(lQ,1),Z,429,0,[sQ,cQ])}function pLe(){return px(),U(O(hZ,1),Z,428,0,[pZ,mZ])}function mLe(){return Ky(),U(O(QX,1),Z,431,0,[XX,ZX])}function hLe(){return Qb(),U(O(YMt,1),Z,430,0,[e2,t2])}function gLe(){return Vv(),U(O(LNt,1),Z,531,0,[b2,y2])}function _Le(){return AS(),U(O(NFt,1),Z,501,0,[b4,x4])}function vLe(){return O_(),U(O(KNt,1),Z,523,0,[w2,C2])}function yLe(){return k_(),U(O(JNt,1),Z,522,0,[T2,E2])}function bLe(){return Wy(),U(O(uPt,1),Z,528,0,[A2,k2])}function xLe(){return wb(),U(O(OZ,1),Z,488,0,[DZ,EZ])}function SLe(){return my(),U(O(bLt,1),Z,491,0,[s3,yLt])}function CLe(){return JC(),U(O(OLt,1),Z,492,0,[ELt,DLt])}function wLe(){return iv(),U(O(DFt,1),Z,433,0,[v4,EFt])}function TLe(){return _b(),U(O(RFt,1),Z,434,0,[LFt,D4])}function ELe(){return D_(),U(O(_Pt,1),Z,465,0,[j2,M2])}function DLe(){return Gy(),U(O(RLt,1),Z,438,0,[x3,b3])}function OLe(){return cw(),U(O(wRt,1),Z,437,0,[k3,CRt])}function kLe(){return zf(),U(O(P5,1),Z,347,0,[HBt,UBt])}function m_(e,t,n,r){return n>=0?e.Uh(t,n,r):e.Ch(null,n,r)}function h_(e){return e.b.b==0?e.a.sf():Yf(e.b)}function ALe(e){if(e.p!=5)throw E(new Rr);return nm(e.f)}function jLe(e){if(e.p!=5)throw E(new Rr);return nm(e.k)}function MLe(e){return A(e.a)===A((uC(),r9))&&bmt(e),e.a}function NLe(e,t){e.b=t,e.c>0&&e.b>0&&(e.g=Pp(e.c,e.b,e.a))}function PLe(e,t){e.c=t,e.c>0&&e.b>0&&(e.g=Pp(e.c,e.b,e.a))}function FLe(e,t){Qde(this,new k(e.a,e.b)),$de(this,Zf(t))}function g_(){I_e.call(this,new go(xx(12))),vTe(!0),this.a=2}function __(e,t,n){xP(),Tr.call(this,e),this.b=t,this.a=n}function ILe(e,t,n){du(),xr.call(this,t),this.a=e,this.b=n}function LLe(e){var t=e.c.d.b;e.b=t,e.a=e.c.d,t.a=e.c.d.b=e}function RLe(e){return e.b==0?null:(jd(e.b!=0),Ox(e,e.a.a))}function v_(e,t){return t==null?nl(Kp(e.f,null)):as(e.i,t)}function zLe(e,t,n,r,i){return new IA(e,(Sb(),fK),t,n,r,i)}function y_(e,t){return dHe(t),eJe(e,V(q9,HF,28,t,15,1),t)}function b_(e,t){return Wg(e,`set1`),Wg(t,`set2`),new ibe(e,t)}function BLe(e,t){return aG[e.charCodeAt(0)]??e}function VLe(e,t){var n=t,r=new ve;return Aht(e,n,r),r.d}function x_(e,t,n,r){var i=new QDe;t.a[n.g]=i,zm(e.b,r,i)}function HLe(e,t){return $d(Cd(Bqe(e.f,t)),e.f.d)}function S_(e){var t;xJe(e.a),owe(e.a),t=new ar(e.a),KE(t)}function ULe(e,t){Uct(e,!0),Dx(e.e.Rf(),new Af(e,!0,t))}function WLe(e,t){return Ug(),e==I_(xA(t))||e==I_(SA(t))}function GLe(e,t){return zx(),P(K(t,(rN(),p4)),17).a==e}function C_(e){return Math.max(Math.min(e,AP),-2147483648)|0}function KLe(e){this.a=P(ph(e),277),this.b=(Vg(),new UTe(e))}function qLe(e,t,n){this.i=new T,this.b=e,this.g=t,this.a=n}function JLe(e,t,n){this.a=new T,this.e=e,this.f=t,this.c=n}function w_(e,t,n){this.c=new T,this.e=e,this.f=t,this.b=n}function YLe(e){Qd.call(this),Px(this),this.a=e,this.c=!0}function XLe(e){function t(){}return t.prototype=e||{},new t}function ZLe(e){if(e.Ae())return null;var t=e.n;return UW[t]}function T_(e){return e.Db>>16==3?P(e.Cb,27):null}function E_(e){return e.Db>>16==9?P(e.Cb,27):null}function QLe(e){return e.Db>>16==6?P(e.Cb,74):null}function D_(){D_=C,j2=new rSe(cL,0),M2=new rSe(lL,1)}function O_(){O_=C,w2=new Uxe(lL,0),C2=new Uxe(cL,1)}function k_(){k_=C,T2=new Wxe(hL,0),E2=new Wxe(`UP`,1)}function $Le(){$Le=C,NTt=nT((xi(),U(O(MTt,1),Z,549,0,[tG])))}function eRe(e){var t=new qa(xx(e.length));return wZe(t,e),t}function tRe(e,t){return e.b+=t.b,e.c+=t.c,e.d+=t.d,e.a+=t.a,e}function nRe(e,t){return IXe(e,t)?(oJe(e),!0):!1}function A_(e,t){if(t==null)throw E(new zr);return K0e(e,t)}function j_(e,t){var n=e.q.getHours();e.q.setDate(t),dN(e,n)}function rRe(e,t,n){var r=e.Ih(t);r>=0?e.bi(r,n):Pat(e,t,n)}function iRe(e,t){var n=e.Ih(t);return n>=0?e.Wh(n):cj(e,t)}function aRe(e,t){var n;for(ph(t),n=e.a;n;n=n.c)t.Yd(n.g,n.i)}function M_(e,t,n){e.b=new VS(kZe(e,t,n).c.length)}function N_(e,t,n){R_(),e&&Qh(p7,e,t),e&&Qh(f7,e,n)}function oRe(e,t){return If(),rd(),P(t.a,17).a0}function lRe(e){var t=e.d;return t=e.bj(e.f),tb(e,t),t.Ob()}function uRe(e,t){var n=new Ap(t);return L7e(n,e),new bf(n)}function dRe(e){if(e.p!=0)throw E(new Rr);return cl(e.f,0)}function fRe(e){if(e.p!=0)throw E(new Rr);return cl(e.k,0)}function pRe(e){return e.Db>>16==7?P(e.Cb,241):null}function F_(e){return e.Db>>16==6?P(e.Cb,241):null}function mRe(e){return e.Db>>16==7?P(e.Cb,167):null}function I_(e){return e.Db>>16==11?P(e.Cb,27):null}function L_(e){return e.Db>>16==17?P(e.Cb,29):null}function hRe(e){return e.Db>>16==3?P(e.Cb,155):null}function gRe(e){var t;return lE(e),t=new Jr,hg(e,new Wfe(t))}function _Re(e,t){var n=e.a=e.a||[];return n[t]||(n[t]=e.ve(t))}function vRe(e,t){var n=e.q.getHours();e.q.setMonth(t),dN(e,n)}function yRe(e,t){Fu(this),this.f=t,this.g=e,Mg(this),this.je()}function bRe(e,t){this.a=e,this.c=xu(this.a),this.b=new o_(t)}function xRe(e,t,n){this.a=t,this.c=e,this.b=(ph(n),new bf(n))}function SRe(e,t,n){this.a=t,this.c=e,this.b=(ph(n),new bf(n))}function CRe(e){this.a=e,this.b=V(MNt,X,2043,e.e.length,0,2)}function wRe(){this.a=new Rl,this.e=new Jr,this.g=0,this.i=0}function R_(){R_=C,p7=new Dr,f7=new Dr,USe(tEt,new Ise)}function TRe(){TRe=C,mNt=tm(new Zh,(vA(),SJ),(yP(),nX))}function ERe(){ERe=C,hNt=tm(new Zh,(vA(),SJ),(yP(),nX))}function DRe(){DRe=C,_Nt=tm(new Zh,(vA(),SJ),(yP(),nX))}function ORe(){ORe=C,zNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function z_(){z_=C,HNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function kRe(){kRe=C,GNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function B_(){B_=C,XNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function V_(e,t,n,r,i,a){return new Hb(e.e,t,e.Lj(),n,r,i,a)}function H_(e,t,n){return t==null?XA(e.f,null,n):uE(e.i,t,n)}function U_(e,t){e.c&&Db(e.c.g,e),e.c=t,e.c&&M(e.c.g,e)}function W_(e,t){e.c&&Db(e.c.a,e),e.c=t,e.c&&M(e.c.a,e)}function G_(e,t){e.i&&Db(e.i.j,e),e.i=t,e.i&&M(e.i.j,e)}function K_(e,t){e.d&&Db(e.d.e,e),e.d=t,e.d&&M(e.d.e,e)}function q_(e,t){e.a&&Db(e.a.k,e),e.a=t,e.a&&M(e.a.k,e)}function J_(e,t){e.b&&Db(e.b.f,e),e.b=t,e.b&&M(e.b.f,e)}function ARe(e,t){rFe(e,e.b,e.c),P(e.b.b,68),t&&P(t.b,68).b}function jRe(e,t){return aE(P(e.c,65).c.e.b,P(t.c,65).c.e.b)}function MRe(e,t){return aE(P(e.c,65).c.e.a,P(t.c,65).c.e.a)}function NRe(e){return Qw(),rd(),P(e.a,86).d.e!=0}function Y_(e,t){j(e.Cb,184)&&(P(e.Cb,184).tb=null),GS(e,t)}function X_(e,t){j(e.Cb,90)&&$A(_y(P(e.Cb,90)),4),GS(e,t)}function PRe(e,t){hE(e,t),j(e.Cb,90)&&$A(_y(P(e.Cb,90)),2)}function FRe(e,t){t.c!=null&&Dh(e,new mh(t.c))}function IRe(e){var t,n=(Ra(),t=new kr,t);return Nx(n,e),n}function LRe(e){var t,n=(Ra(),t=new kr,t);return Nx(n,e),n}function RRe(e){for(var t;;)if(t=e.Pb(),!e.Ob())return t}function zRe(e,t,n){return M(e.a,(eg(),ik(t,n),new oo(t,n))),e}function Z_(e,t){return Qo(),ex(t)?new hp(t,e):new Qc(t,e)}function Q_(e){return AM(),dT(e,0)>=0?yD(e):Xm(yD(kb(e)))}function BRe(e){var t=P(cp(e.b),9);return new xf(e.a,t,e.c)}function VRe(e,t){var n=P(TT(Rg(e.a),t),16);return n?n.gc():0}function HRe(e,t,n){var r;I$e(t,n,e.c.length),r=n-t,wye(e.c,t,r)}function $_(e,t,n){I$e(t,n,e.gc()),this.c=e,this.a=t,this.b=n-t}function ev(e){this.c=new vo,this.b=e.b,this.d=e.c,this.a=e.a}function tv(e){this.a=r.Math.cos(e),this.b=r.Math.sin(e)}function nv(e,t,n,r){this.c=e,this.d=r,q_(this,t),J_(this,n)}function URe(e,t){P_e.call(this,new go(xx(e))),vS(t,Jvt),this.a=t}function WRe(e,t,n){return new IA(e,(Sb(),dK),null,!1,t,n)}function GRe(e,t,n){return new IA(e,(Sb(),pK),t,n,null,!1)}function KRe(){return Zw(),U(O(xK,1),Z,108,0,[vK,yK,bK])}function qRe(){return Xb(),U(O(IEt,1),Z,472,0,[sq,oq,aq])}function JRe(){return Cb(),U(O(NEt,1),Z,471,0,[rq,nq,iq])}function YRe(){return Ix(),U(O($K,1),Z,237,0,[XK,ZK,QK])}function XRe(){return Yb(),U(O(_J,1),Z,391,0,[hJ,mJ,gJ])}function ZRe(){return kS(),U(O(MX,1),Z,372,0,[jX,AX,kX])}function QRe(){return bS(),U(O(nZ,1),Z,322,0,[eZ,$X,tZ])}function $Re(){return lS(),U(O(oZ,1),Z,351,0,[rZ,aZ,iZ])}function eze(){return _w(),U(O(ckt,1),Z,460,0,[_Z,gZ,vZ])}function tze(){return qC(),U(O(rQ,1),Z,299,0,[tQ,nQ,eQ])}function nze(){return Zb(),U(O(gkt,1),Z,311,0,[aQ,oQ,iQ])}function rze(){return hT(),U(O(PMt,1),Z,390,0,[P0,NMt,F0])}function ize(){return uS(),U(O(ZMt,1),Z,463,0,[i2,n2,r2])}function aze(){return CC(),U(O(tNt,1),Z,387,0,[$Mt,a2,eNt])}function oze(){return Nw(),U(O(rNt,1),Z,349,0,[c2,o2,s2])}function sze(){return Xw(),U(O(oNt,1),Z,350,0,[l2,aNt,u2])}function cze(){return cS(),U(O(uNt,1),Z,352,0,[lNt,d2,cNt])}function lze(){return sw(),U(O(fNt,1),Z,388,0,[p2,m2,f2])}function uze(){return sS(),U(O(ANt,1),Z,464,0,[h2,g2,_2])}function rv(e){return Sw(U(O(K3,1),X,8,0,[e.i.n,e.n,e.a]))}function dze(){return Pw(),U(O(FPt,1),Z,392,0,[PPt,B2,z2])}function fze(){fze=C,kFt=tm(new Zh,(Ok(),F2),(LM(),CPt))}function iv(){iv=C,v4=new iSe(`DFS`,0),EFt=new iSe(`BFS`,1)}function pze(e,t,n){var r=new zie;r.b=t,r.a=n,++t.b,M(e.d,r)}function mze(e,t,n){var r=new Vl(n.d);$d(r,e),fE(t,r.a,r.b)}function hze(e,t){cTe(e,nm(uv(lm(t,24),jI)),nm(uv(t,jI)))}function av(e,t){if(e<0||e>t)throw E(new Mi(HI+e+UI+t))}function ov(e,t){if(e<0||e>=t)throw E(new Mi(HI+e+UI+t))}function sv(e,t){if(e<0||e>=t)throw E(new ra(HI+e+UI+t))}function cv(e,t){this.b=(Gh(e),e),this.a=(t&uI)==0?t|64|ZP:t}function gze(e){var t;return lE(e),t=(Bg(),Bg(),rK),Cx(e,t)}function _ze(e,t,n){var r=vN(e,t,!1);return r.b<=t&&r.a<=n}function vze(){return Tb(),U(O(wLt,1),Z,439,0,[c3,CLt,SLt])}function yze(){return TE(),U(O(LIt,1),Z,394,0,[IIt,Q4,FIt])}function bze(){return ED(),U(O(kIt,1),Z,445,0,[L4,R4,z4])}function xze(){return LO(),U(O(jIt,1),Z,456,0,[B4,H4,V4])}function Sze(){return Yw(),U(O(HFt,1),Z,393,0,[O4,BFt,VFt])}function Cze(){return SC(),U(O(DIt,1),Z,300,0,[I4,EIt,TIt])}function wze(){return _T(),U(O(yBt,1),Z,346,0,[_8,g8,v8])}function Tze(){return KT(),U(O(_3,1),Z,444,0,[m3,h3,g3])}function Eze(){return Lx(),U(O(rBt,1),Z,278,0,[o8,s8,c8])}function Dze(){return gT(),U(O(BBt,1),Z,280,0,[zBt,M5,N5])}function lv(e){return ph(e),j(e,16)?new bf(P(e,16)):Xf(e.Kc())}function Oze(e,t){return e&&e.equals?e.equals(t):A(e)===A(t)}function uv(e,t){return MC(BNe(Il(e)?zC(e):e,Il(t)?zC(t):t))}function dv(e,t){return MC(VNe(Il(e)?zC(e):e,Il(t)?zC(t):t))}function fv(e,t){return MC(HNe(Il(e)?zC(e):e,Il(t)?zC(t):t))}function kze(e,t){var n=(Gh(e),e).g;return sDe(!!n),Gh(t),n(t)}function Aze(e,t){var n,r=Im(e,t);return n=e.a.fd(r),new tbe(e,n)}function jze(e){return e.Db>>16==6?P(xj(e),241):null}function Mze(e){if(e.p!=2)throw E(new Rr);return nm(e.f)&OF}function Nze(e){if(e.p!=2)throw E(new Rr);return nm(e.k)&OF}function z(e){return jd(e.ar)}function Yze(e,t){var n=jb(t);return P(xh(e.c,n),17).a}function gv(e,t,n){var r=e.d[t.p];e.d[t.p]=e.d[n.p],e.d[n.p]=r}function Xze(e,t,n){var r;e.n&&t&&n&&(r=new Ese,M(e.e,r))}function _v(e,t){if(Lm(e.a,t),t.d)throw E(new yi(xyt));t.d=e}function Zze(e,t){this.a=new T,this.d=new T,this.f=e,this.c=t}function Qze(){this.c=new Hwe,this.a=new JUe,this.b=new Kge,Fbe()}function $ze(){lw(),this.b=new Dr,this.a=new Dr,this.c=new T}function eBe(e,t,n){this.d=e,this.j=t,this.e=n,this.o=-1,this.p=3}function tBe(e,t,n){this.d=e,this.k=t,this.f=n,this.o=-1,this.p=5}function nBe(e,t,n,r,i,a){Gqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function rBe(e,t,n,r,i,a){Kqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function iBe(e,t,n,r,i,a){vUe.call(this,e,t,n,r,i),a&&(this.o=-2)}function aBe(e,t,n,r,i,a){Yqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function oBe(e,t,n,r,i,a){yUe.call(this,e,t,n,r,i),a&&(this.o=-2)}function sBe(e,t,n,r,i,a){qqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function cBe(e,t,n,r,i,a){Jqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function lBe(e,t,n,r,i,a){bUe.call(this,e,t,n,r,i),a&&(this.o=-2)}function uBe(e,t,n,r){xr.call(this,n),this.b=e,this.c=t,this.d=r}function dBe(e,t){this.f=e,this.a=(By(),u9),this.c=u9,this.b=t}function fBe(e,t){this.g=e,this.d=(By(),d9),this.a=d9,this.b=t}function pBe(e,t){!e.c&&(e.c=new DC(e,0)),ON(e.c,(UN(),w9),t)}function mBe(e,t){return Wit(e,t,j(t,102)&&(P(t,19).Bb&pI)!=0)}function hBe(e,t){return DPe(LC(e.q.getTime()),LC(t.q.getTime()))}function gBe(e){return yp(e.e.Rd().gc()*e.c.Rd().gc(),16,new ode(e))}function _Be(e){return!!e.u&&Jv(e.u.a).i!=0&&!(e.n&&QO(e.n))}function vBe(e){return!!e.a&&Ib(e.a.a).i!=0&&!(e.b&&$O(e.b))}function yBe(e,t){return t==0?!!e.o&&e.o.f!=0:mO(e,t)}function bBe(e,t,n){var r=P(e.Zb().xc(t),16);return!!r&&r.Hc(n)}function xBe(e,t,n){var r=P(e.Zb().xc(t),16);return!!r&&r.Mc(n)}function SBe(e,t){var n=1-t;return e.a[n]=FS(e.a[n],n),FS(e,t)}function CBe(e,t){var n,r=uv(e,_I);return n=cm(t,32),dv(n,r)}function wBe(e,t,n){Z3e(new xRe((ph(e),new bf(e)),t,n))}function vv(e,t,n){Q3e(new SRe((ph(e),new bf(e)),t,n))}function yv(e,t,n,r,i,a){return lXe(e,t,n,a),IT(e,r),zT(e,i),e}function TBe(e,t,n,r){return e.a+=``+p_(t==null?IP:PE(t),n,r),e}function bv(e,t){this.a=e,qn.call(this,e),av(t,e.gc()),this.b=t}function EBe(e){this.a=V(WW,FP,1,dZe(r.Math.max(8,e))<<1,5,1)}function xv(e){return P(rO(e,V(UJ,jR,10,e.c.length,0,1)),199)}function Sv(e){return P(rO(e,V(VJ,AR,18,e.c.length,0,1)),483)}function DBe(e){return e.a?e.e.length==0?e.a.a:e.a.a+(``+e.e):e.c}function Cv(e){for(;e.d>0&&e.a[--e.d]==0;);e.a[e.d++]==0&&(e.e=0)}function OBe(e){return jd(e.b.b!=e.d.a),e.c=e.b=e.b.b,--e.a,e.c.c}function kBe(e,t,n){e.a=t,e.c=n,e.b.a.$b(),Fg(e.d),Wr(e.e.a.c,0)}function ABe(e,t){var n;e.e=new D_e,n=sM(t),hu(n,e.c),pct(e,n,0)}function wv(e,t,n,r){var i=new Koe;i.a=t,i.b=n,i.c=r,up(e.a,i)}function B(e,t,n,r){var i=new Koe;i.a=t,i.b=n,i.c=r,up(e.b,i)}function jBe(e,t,n){if(e<0||tn)throw E(new Mi(yet(e,t,n)))}function Tv(e,t){if(e<0||e>=t)throw E(new Mi(jtt(e,t)));return e}function MBe(e){if(!(`stack`in e))try{throw e}catch{}return e}function Ev(e){return Lo(),j(e.g,10)?P(e.g,10):null}function NBe(e){return!bg(e).dc()&&(gwe(e,new h),!0)}function Dv(e){var t;return Il(e)?(t=e,t==-0?0:t):lKe(e)}function PBe(e,t){return j(t,44)?lk(e.a,P(t,44)):!1}function FBe(e,t){return j(t,44)?lk(e.a,P(t,44)):!1}function IBe(e,t){return j(t,44)?lk(e.a,P(t,44)):!1}function LBe(e){var t;return Hh(e),t=new fe,Qa(e.a,new Vfe(t)),t}function RBe(){var e,t=(n=(e=new kr,e),n),n;return M(fHt,t),t}function Ov(e){var t;return Hh(e),t=new pe,Qa(e.a,new Hfe(t)),t}function zBe(e,t){return e.a<=e.b&&(t.Dd(e.a++),!0)}function BBe(e){rC.call(this,e,(Sb(),uK),null,!1,null,!1)}function VBe(){VBe=C,hDt=nT((No(),U(O(Oq,1),Z,489,0,[Dq])))}function HBe(){HBe=C,wNt=LFe(G(1),G(4)),CNt=LFe(G(1),G(2))}function UBe(e,t){return new Vf(t,wd(xu(t.e),e,e),(rd(),!0))}function kv(e){return new Hy((vS(e,_F),bx(yE(yE(5,e),e/10|0))))}function WBe(e){return yp(e.e.Rd().gc()*e.c.Rd().gc(),273,new ade(e))}function GBe(e){return P(rO(e,V(EOt,Sbt,12,e.c.length,0,1)),2042)}function KBe(e){return z_(),!gy(e)&&!(!gy(e)&&e.c.i.c==e.d.i.c)}function qBe(e,t){return Rx(),P(K(t,(rN(),u4)),17).a>=e.gc()}function Av(e,t){L_t(t,e),Yje(e.d),Yje(P(K(e,(mP(),L1)),214))}function jv(e,t){R_t(t,e),Xje(e.d),Xje(P(K(e,(mP(),L1)),214))}function JBe(e,t,n){e.d&&Db(e.d.e,e),e.d=t,e.d&&Jp(e.d.e,n,e)}function YBe(e,t,n){return n.f.c.length>0?bPe(e.a,t,n):bPe(e.b,t,n)}function XBe(e,t,n){var r=b2e();try{return qDe(e,t,n)}finally{CHe(r)}}function Mv(e,t){var n=A_(e,t),r=null;return n&&(r=n.pe()),r}function Nv(e,t){var n=A_(e,t),r=null;return n&&(r=n.se()),r}function Pv(e,t){var n=ax(e,t),r=null;return n&&(r=n.se()),r}function Fv(e,t){var n=A_(e,t),r=null;return n&&(r=ket(n)),r}function ZBe(e,t,n){var r=RD(n);return PM(e.g,r,t),PM(e.i,t,n),t}function QBe(e,t,n){this.d=new nme(this),this.e=e,this.i=t,this.f=n}function $Be(e,t,n,r){this.e=null,this.c=e,this.d=t,this.a=n,this.b=r}function eVe(e,t,n,r){jwe(this),this.c=e,this.e=t,this.f=n,this.b=r}function tVe(e,t,n,r){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1}function nVe(e,t,n,r){return j(n,59)?new lEe(e,t,n,r):new qNe(e,t,n,r)}function Iv(e){return j(e,16)?P(e,16).dc():!e.Kc().Ob()}function rVe(e){if(e.e.g!=e.b)throw E(new Vr);return!!e.c&&e.d>0}function Lv(e){return jd(e.b!=e.d.c),e.c=e.b,e.b=e.b.a,++e.a,e.c.c}function iVe(e,t){Gh(t),Sh(e.a,e.c,t),e.c=e.c+1&e.a.length-1,L3e(e)}function Rv(e,t){Gh(t),e.b=e.b-1&e.a.length-1,Sh(e.a,e.b,t),L3e(e)}function aVe(e){var t=e.Gh();this.a=j(t,71)?P(t,71).Ii():t.Kc()}function oVe(e){return new cv(wqe(P(e.a.md(),16).gc(),e.a.ld()),16)}function sVe(){sVe=C,FLt=nT((Bo(),U(O(PLt,1),Z,490,0,[v3])))}function cVe(){cVe=C,LLt=nT((Vo(),U(O(ILt,1),Z,558,0,[y3])))}function lVe(){lVe=C,SRt=nT((Ho(),U(O(xRt,1),Z,539,0,[O3])))}function uVe(){return YD(),U(O(zJ,1),Z,389,0,[RJ,IJ,FJ,LJ])}function dVe(){return Sb(),U(O(mK,1),Z,304,0,[uK,dK,fK,pK])}function fVe(){return TO(),U(O(lDt,1),Z,332,0,[gq,hq,_q,vq])}function pVe(){return wO(),U(O(pDt,1),Z,406,0,[wq,Cq,Tq,Eq])}function mVe(){return KC(),U(O(sDt,1),Z,417,0,[mq,dq,fq,pq])}function hVe(){return ow(),U(O(mOt,1),Z,416,0,[kJ,MJ,AJ,jJ])}function gVe(){return aw(),U(O(KOt,1),Z,421,0,[bX,xX,SX,CX])}function _Ve(){return iw(),U(O(FOt,1),Z,371,0,[gX,mX,hX,pX])}function vVe(){return IO(),U(O(B0,1),Z,203,0,[R0,z0,L0,I0])}function yVe(){return ID(),U(O(qMt,1),Z,284,0,[Z0,KMt,Q0,$0])}function bVe(e){var t;return e.j==(nP(),m5)&&(t=krt(e),$u(t,X8))}function xVe(e,t){var n=t.a;U_(n,t.c.d),K_(n,t.d.d),vC(n.a,e.n)}function SVe(e,t){var n=P(ix(e.b,t),67);return!n&&(n=new vo),n}function zv(e){return Lo(),j(e.g,154)?P(e.g,154):null}function CVe(e){e.a=null,e.e=null,Wr(e.b.c,0),Wr(e.f.c,0),e.c=null}function Bv(){Bv=C,sQ=new Js(sL,0),cQ=new Js(`TOP_LEFT`,1)}function Vv(){Vv=C,b2=new zxe(`UPPER`,0),y2=new zxe(`LOWER`,1)}function wVe(e,t){return Ou(new k(t.e.a+t.f.a/2,t.e.b+t.f.b/2),e)}function TVe(e,t){return P(Ju(_m(P(Dy(e.k,t),15).Oc(),HX)),113)}function EVe(e,t){return P(Ju(vm(P(Dy(e.k,t),15).Oc(),HX)),113)}function DVe(){return Ok(),U(O(yPt,1),Z,405,0,[N2,P2,F2,I2])}function OVe(){return Jw(),U(O(wFt,1),Z,353,0,[_4,h4,g4,m4])}function kVe(){return uk(),U(O(CIt,1),Z,354,0,[F4,xIt,SIt,bIt])}function AVe(){return TD(),U(O(S5,1),Z,386,0,[b5,x5,y5,v5])}function jVe(){return kk(),U(O(xBt,1),Z,291,0,[S8,y8,b8,x8])}function MVe(){return wE(),U(O(p8,1),Z,223,0,[f8,u8,l8,d8])}function NVe(){return ZE(),U(O(JBt,1),Z,320,0,[F5,GBt,qBt,KBt])}function PVe(){return Mw(),U(O(eVt,1),Z,415,0,[I5,QBt,ZBt,$Bt])}function FVe(e){return R_(),km(p7,e)?P(xh(p7,e),341).Qg():null}function Hv(e,t,n){return t<0?cj(e,n):P(n,69).wk().Bk(e,e.hi(),t)}function IVe(e,t,n){var r=RD(n);return PM(e.j,r,t),Qh(e.k,t,n),t}function LVe(e,t,n){var r=RD(n);return PM(e.d,r,t),Qh(e.e,t,n),t}function RVe(e){var t=(Ia(),n=new nn,n),n;return e&&Hj(t,e),t}function zVe(e){var t=e.aj(e.i);return e.i>0&&tN(e.g,0,t,0,e.i),t}function BVe(e,t){var n;for(n=e.j.c.length;n>24}function WVe(e){if(e.p!=1)throw E(new Rr);return nm(e.k)<<24>>24}function GVe(e){if(e.p!=7)throw E(new Rr);return nm(e.k)<<16>>16}function KVe(e){if(e.p!=7)throw E(new Rr);return nm(e.f)<<16>>16}function Uv(e,t){return t.e==0||e.e==0?JG:(pM(),Xj(e,t))}function qVe(e,t){return A(t)===A(e)?`(this Map)`:t==null?IP:PE(t)}function JVe(e,t,n){return dm(N(nl(Kp(e.f,t))),N(nl(Kp(e.f,n))))}function YVe(e,t,n){var r=P(xh(e.g,n),60);M(e.a.c,new Kc(t,r))}function XVe(e,t,n){e.i=0,e.e=0,t!=n&&(zZe(e,t,n),RZe(e,t,n))}function ZVe(e,t,n,r,i){M(t,vtt(i,mat(i,n,r))),p9e(e,i,t)}function QVe(e,t,n,r,i){this.i=e,this.a=t,this.e=n,this.j=r,this.f=i}function $Ve(e,t){r_.call(this),this.a=e,this.b=t,M(this.a.b,this)}function eHe(e){this.b=new Dr,this.c=new Dr,this.d=new Dr,this.a=e}function tHe(e,t){var n=new na;return e.Gd(n),n.a+=`..`,t.Hd(n),n.a}function nHe(e,t){for(var n=t;n;)Sd(e,n.i,n.j),n=I_(n);return e}function rHe(e,t,n){var r=RD(n);return Qh(e.b,r,t),Qh(e.c,t,n),t}function Wv(e){for(var t=0;e.Ob();)e.Pb(),t=yE(t,1);return bx(t)}function Gv(e,t){Qo();var n=P(e,69).vk();return L9e(n,t),n.xl(t)}function iHe(e,t,n){if(n){var r=n.oe();e.a[t]=r(n)}else delete e.a[t]}function aHe(e,t){var n=e.q.getHours();e.q.setFullYear(t+VF),dN(e,n)}function oHe(e,t){return P(t==null?nl(Kp(e.f,null)):as(e.i,t),288)}function sHe(e,t){return e==(DA(),JJ)&&t==JJ?4:e==JJ||t==JJ?8:32}function Kv(e,t,n){return sN(e,t,n,j(t,102)&&(P(t,19).Bb&pI)!=0)}function cHe(e,t,n){return pN(e,t,n,j(t,102)&&(P(t,19).Bb&pI)!=0)}function lHe(e,t,n){return tat(e,t,n,j(t,102)&&(P(t,19).Bb&pI)!=0)}function uHe(e){e.b!=e.c&&(e.a=V(WW,FP,1,8,5,1),e.b=0,e.c=0)}function qv(e){return jd(e.a=0&&e.a[n]===t[n];n--);return n<0}function oy(e){var t;return e?new Ap(e):(t=new Rl,HS(t,e),t)}function SHe(e,t){var n,r=!1;do n=mZe(e,t),r|=n;while(n);return r}function CHe(e){e&&OKe((Si(),cG)),--oG,e&&sG!=-1&&(gCe(sG),sG=-1)}function sy(e){s7e(),cTe(this,nm(uv(lm(e,24),jI)),nm(uv(e,jI)))}function wHe(){wHe=C,DEt=nT((fO(),U(O(DK,1),Z,436,0,[EK,TK])))}function THe(){THe=C,OEt=nT((dx(),U(O(AK,1),Z,435,0,[OK,kK])))}function EHe(){EHe=C,NDt=nT((fx(),U(O(Uq,1),Z,432,0,[Vq,Hq])))}function DHe(){DHe=C,AOt=nT((dC(),U(O(kOt,1),Z,517,0,[aY,iY])))}function OHe(){OHe=C,vkt=nT((Bv(),U(O(lQ,1),Z,429,0,[sQ,cQ])))}function kHe(){kHe=C,skt=nT((px(),U(O(hZ,1),Z,428,0,[pZ,mZ])))}function AHe(){AHe=C,dkt=nT((wb(),U(O(OZ,1),Z,488,0,[DZ,EZ])))}function jHe(){jHe=C,XMt=nT((Qb(),U(O(YMt,1),Z,430,0,[e2,t2])))}function MHe(){MHe=C,RNt=nT((Vv(),U(O(LNt,1),Z,531,0,[b2,y2])))}function NHe(){NHe=C,rkt=nT((Ky(),U(O(QX,1),Z,431,0,[XX,ZX])))}function PHe(){PHe=C,OFt=nT((iv(),U(O(DFt,1),Z,433,0,[v4,EFt])))}function FHe(){FHe=C,PFt=nT((AS(),U(O(NFt,1),Z,501,0,[b4,x4])))}function IHe(){IHe=C,qNt=nT((O_(),U(O(KNt,1),Z,523,0,[w2,C2])))}function LHe(){LHe=C,YNt=nT((k_(),U(O(JNt,1),Z,522,0,[T2,E2])))}function RHe(){RHe=C,dPt=nT((Wy(),U(O(uPt,1),Z,528,0,[A2,k2])))}function zHe(){zHe=C,vPt=nT((D_(),U(O(_Pt,1),Z,465,0,[j2,M2])))}function BHe(){BHe=C,zFt=nT((_b(),U(O(RFt,1),Z,434,0,[LFt,D4])))}function VHe(){VHe=C,xLt=nT((my(),U(O(bLt,1),Z,491,0,[s3,yLt])))}function HHe(){HHe=C,kLt=nT((JC(),U(O(OLt,1),Z,492,0,[ELt,DLt])))}function UHe(){UHe=C,zLt=nT((Gy(),U(O(RLt,1),Z,438,0,[x3,b3])))}function WHe(){WHe=C,TRt=nT((cw(),U(O(wRt,1),Z,437,0,[k3,CRt])))}function GHe(){GHe=C,WBt=nT((zf(),U(O(P5,1),Z,347,0,[HBt,UBt])))}function KHe(){return GT(),U(O(a8,1),Z,88,0,[r8,n8,t8,e8,i8])}function qHe(){return nP(),U(O(_5,1),TR,64,0,[h5,Z8,X8,m5,g5])}function JHe(e,t,n){return P(t==null?XA(e.f,null,n):uE(e.i,t,n),288)}function YHe(e){return(e.k==(DA(),JJ)||e.k==GJ)&&yd(e,(Y(),bQ))}function cy(e){return e.c&&e.d?Gze(e.c)+`->`+Gze(e.d):`e_`+td(e)}function ly(e,t){var n,r;for(Gh(t),r=e.Kc();r.Ob();)n=r.Pb(),t.Cd(n)}function XHe(e,t){var n=new bi;qg(n,`x`,t.a),qg(n,`y`,t.b),Dh(e,n)}function ZHe(e,t){var n=new bi;qg(n,`x`,t.a),qg(n,`y`,t.b),Dh(e,n)}function QHe(e,t){for(var n=t;n;)Sd(e,-n.i,-n.j),n=I_(n);return e}function $He(e,t){for(var n=t,r=0;n>0;)r+=e.a[n],n-=n&-n;return r}function uy(e,t,n){var r=(ov(t,e.c.length),e.c[t]);return e.c[t]=n,r}function eUe(e,t,n){e.a.c.length=0,Tmt(e,t,n),e.a.c.length==0||Mut(e,t)}function dy(e){e.i=0,is(e.b,null),is(e.c,null),e.a=null,e.e=null,++e.g}function fy(){fy=C,_K=!0,mEt=!1,hEt=!1,_Et=!1,gEt=!1}function py(e){fy(),!_K&&(this.c=e,this.e=!0,this.a=new T)}function tUe(e,t){this.c=0,this.b=t,oCe.call(this,e,17493),this.a=this.c}function nUe(e){Cvt(),lge(this),this.a=new vo,tQe(this,e),up(this.a,e)}function rUe(){au(this),this.b=new k(cI,cI),this.a=new k(lI,lI)}function my(){my=C,s3=new sSe(YR,0),yLt=new sSe(`TARGET_WIDTH`,1)}function hy(e,t){return(lE(e),Xa(new Mp(e,new UGe(t,e.a)))).Bd(SK)}function iUe(){return vA(),U(O(CJ,1),Z,367,0,[vJ,yJ,bJ,xJ,SJ])}function aUe(){return tA(),U(O(JOt,1),Z,375,0,[TX,DX,OX,EX,wX])}function oUe(){return FD(),U(O(fZ,1),Z,348,0,[cZ,sZ,uZ,dZ,lZ])}function sUe(){return CO(),U(O(RMt,1),Z,323,0,[LMt,H0,U0,V0,W0])}function cUe(){return XE(),U(O(y$,1),Z,171,0,[v$,m$,h$,g$,_$])}function lUe(){return iA(),U(O(FFt,1),Z,368,0,[T4,S4,E4,C4,w4])}function uUe(){return Wj(),U(O(jLt,1),Z,373,0,[u3,l3,f3,d3,p3])}function dUe(){return MA(),U(O(ULt,1),Z,324,0,[BLt,S3,HLt,C3,VLt])}function fUe(){return uO(),U(O(L3,1),Z,170,0,[F3,P3,M3,I3,N3])}function pUe(){return pO(),U(O(I8,1),Z,256,0,[P8,F8,wBt,N8,TBt])}function mUe(e){return Qi(),function(){return XBe(e,this,arguments)}}function gy(e){return!e.c||!e.d?!1:!!e.c.i&&e.c.i==e.d.i}function hUe(e,t){return j(t,143)?ff(e.c,P(t,143).c):!1}function _y(e){return e.t||(e.t=new Bhe(e),WT(new K_e(e),0,e.t)),e.t}function gUe(e){this.b=e,Lu.call(this,e),this.a=P(NC(this.b.a,4),129)}function _Ue(e){this.b=e,ld.call(this,e),this.a=P(NC(this.b.a,4),129)}function vy(e,t,n,r,i){KUe.call(this,t,r,i),this.c=e,this.b=n}function vUe(e,t,n,r,i){eBe.call(this,t,r,i),this.c=e,this.a=n}function yUe(e,t,n,r,i){tBe.call(this,t,r,i),this.c=e,this.a=n}function bUe(e,t,n,r,i){KUe.call(this,t,r,i),this.c=e,this.a=n}function yy(e,t){return P(ix(e.d,t),23)||P(ix(e.e,t),23)}function xUe(e,t){var n=t.ld(),r=e.Fe(n);return!!r&&rg(r.e,t.md())}function SUe(e,t){var n=t.ld();return new oo(n,e.e.pc(n,P(t.md(),16)))}function CUe(e,t){return e.a.get(t)??V(WW,FP,1,0,5,1)}function wUe(e){var t=e.length;return ff(fI.substr(fI.length-t,t),e)}function by(e){if(Cj(e))return e.c=e.a,e.a.Pb();throw E(new Hr)}function TUe(e,t){return t==0||e.e==0?e:t>0?Cst(e,t):F0e(e,-t)}function xy(e,t){return t==0||e.e==0?e:t>0?F0e(e,t):Cst(e,-t)}function EUe(e){txe.call(this,e==null?IP:PE(e),j(e,82)?P(e,82):null)}function DUe(e){var t;return e.c||(t=e.r,j(t,90)&&(e.c=P(t,29))),e.c}function Sy(e){var t=new i_;return VC(t,e),W(t,(mP(),j1),null),t}function OUe(e){var t=e.c.i,n=e.d.i;return t.k==(DA(),GJ)&&n.k==GJ}function Cy(e){return vu(e&QF,e>>22&QF,e<0?$F:0)}function kUe(e){var t,n,r,i;for(n=e,r=0,i=n.length;r=0?e.Lh(r,n,!0):mj(e,t,n)}function jUe(e,t,n){return aE(Ou(cO(e),xu(t.b)),Ou(cO(e),xu(n.b)))}function MUe(e,t,n){return aE(Ou(cO(e),xu(t.e)),Ou(cO(e),xu(n.e)))}function NUe(e,t){return r.Math.min(ab(t.a,e.d.d.c),ab(t.b,e.d.d.c))}function Ty(e,t){e._i(e.i+1),Au(e,e.i,e.Zi(e.i,t)),e.Mi(e.i++,t),e.Ni()}function Ey(e){var t,n;++e.j,t=e.g,n=e.i,e.g=null,e.i=0,e.Oi(n,t),e.Ni()}function PUe(e,t,n){var r=new Rwe(e.a);mC(r,e.a.a),XA(r.f,t,n),e.a.a=r}function FUe(e,t,n,r){var i;for(i=0;it)throw E(new Mi(ptt(e,t,`index`)));return e}function Ay(e,t){var n=(ov(t,e.c.length),e.c[t]);return wye(e.c,t,1),n}function zUe(e,t){var n=(Gh(e),e),r=(Gh(t),t);return n==r?0:nt.p?-1:0}function tWe(e){var t;return e.a||(t=e.r,j(t,156)&&(e.a=P(t,156))),e.a}function nWe(e,t,n){var r;return++e.e,--e.f,r=P(e.d[t].gd(n),136),r.md()}function rWe(e){var t=e.ld();return qf(P(e.md(),16).Nc(),new cde(t))}function iWe(e,t){return km(e.a,t)?(My(e.a,t),!0):!1}function Iy(e,t,n){return Tv(t,e.e.Rd().gc()),Tv(n,e.c.Rd().gc()),e.a[t][n]}function Ly(e,t,n){this.a=e,this.b=t,this.c=n,M(e.t,this),M(t.i,this)}function Ry(e,t,n,r){this.f=e,this.e=t,this.d=n,this.b=r,this.c=r?r.d:null}function zy(){this.b=new vo,this.a=new vo,this.b=new vo,this.a=new vo}function By(){By=C;var e,t;u9=(Ra(),t=new Ur,t),d9=(e=new oi,e)}function aWe(e){var t;return lE(e),t=new Mje(e,e.a.e,e.a.d|4),new fDe(e,t)}function oWe(e){var t;for(Hh(e),t=0;e.a.Bd(new Be);)t=yE(t,1);return t}function Vy(e,t){return Gh(t),e.c=0,`Initial capacity must not be negative`)}function Uy(){Uy=C,G3=new yr(`org.eclipse.elk.labels.labelManager`)}function sWe(){sWe=C,fX=new Wd(`separateLayerConnections`,(iw(),gX))}function Wy(){Wy=C,A2=new nSe(`REGULAR`,0),k2=new nSe(`CRITICAL`,1)}function Gy(){Gy=C,x3=new lSe(`FIXED`,0),b3=new lSe(`CENTER_NODE`,1)}function Ky(){Ky=C,XX=new Lxe(`QUADRATIC`,0),ZX=new Lxe(`SCANLINE`,1)}function cWe(){cWe=C,ikt=nT((bS(),U(O(nZ,1),Z,322,0,[eZ,$X,tZ])))}function lWe(){lWe=C,akt=nT((lS(),U(O(oZ,1),Z,351,0,[rZ,aZ,iZ])))}function uWe(){uWe=C,ekt=nT((kS(),U(O(MX,1),Z,372,0,[jX,AX,kX])))}function dWe(){dWe=C,lkt=nT((_w(),U(O(ckt,1),Z,460,0,[_Z,gZ,vZ])))}function fWe(){fWe=C,hkt=nT((qC(),U(O(rQ,1),Z,299,0,[tQ,nQ,eQ])))}function pWe(){pWe=C,_kt=nT((Zb(),U(O(gkt,1),Z,311,0,[aQ,oQ,iQ])))}function mWe(){mWe=C,FMt=nT((hT(),U(O(PMt,1),Z,390,0,[P0,NMt,F0])))}function hWe(){hWe=C,nNt=nT((CC(),U(O(tNt,1),Z,387,0,[$Mt,a2,eNt])))}function gWe(){gWe=C,iNt=nT((Nw(),U(O(rNt,1),Z,349,0,[c2,o2,s2])))}function _We(){_We=C,QMt=nT((uS(),U(O(ZMt,1),Z,463,0,[i2,n2,r2])))}function vWe(){vWe=C,sNt=nT((Xw(),U(O(oNt,1),Z,350,0,[l2,aNt,u2])))}function yWe(){yWe=C,dNt=nT((cS(),U(O(uNt,1),Z,352,0,[lNt,d2,cNt])))}function bWe(){bWe=C,pNt=nT((sw(),U(O(fNt,1),Z,388,0,[p2,m2,f2])))}function xWe(){xWe=C,IPt=nT((Pw(),U(O(FPt,1),Z,392,0,[PPt,B2,z2])))}function SWe(){SWe=C,UFt=nT((Yw(),U(O(HFt,1),Z,393,0,[O4,BFt,VFt])))}function CWe(){CWe=C,OIt=nT((SC(),U(O(DIt,1),Z,300,0,[I4,EIt,TIt])))}function wWe(){wWe=C,AIt=nT((ED(),U(O(kIt,1),Z,445,0,[L4,R4,z4])))}function TWe(){TWe=C,MIt=nT((LO(),U(O(jIt,1),Z,456,0,[B4,H4,V4])))}function EWe(){EWe=C,RIt=nT((TE(),U(O(LIt,1),Z,394,0,[IIt,Q4,FIt])))}function DWe(){DWe=C,TLt=nT((Tb(),U(O(wLt,1),Z,439,0,[c3,CLt,SLt])))}function OWe(){OWe=C,jNt=nT((sS(),U(O(ANt,1),Z,464,0,[h2,g2,_2])))}function kWe(){kWe=C,PEt=nT((Cb(),U(O(NEt,1),Z,471,0,[rq,nq,iq])))}function AWe(){AWe=C,MEt=nT((Ix(),U(O($K,1),Z,237,0,[XK,ZK,QK])))}function jWe(){jWe=C,LEt=nT((Xb(),U(O(IEt,1),Z,472,0,[sq,oq,aq])))}function MWe(){MWe=C,vEt=nT((Zw(),U(O(xK,1),Z,108,0,[vK,yK,bK])))}function NWe(){NWe=C,aOt=nT((Yb(),U(O(_J,1),Z,391,0,[hJ,mJ,gJ])))}function PWe(){PWe=C,bBt=nT((_T(),U(O(yBt,1),Z,346,0,[_8,g8,v8])))}function FWe(){FWe=C,NLt=nT((KT(),U(O(_3,1),Z,444,0,[m3,h3,g3])))}function IWe(){IWe=C,iBt=nT((Lx(),U(O(rBt,1),Z,278,0,[o8,s8,c8])))}function LWe(){LWe=C,VBt=nT((gT(),U(O(BBt,1),Z,280,0,[zBt,M5,N5])))}function qy(e,t){return!e.o&&(e.o=new lb((lP(),Z5),n7,e,0)),uD(e.o,t)}function RWe(e,t){var n;e.C&&(n=P(ig(e.b,t),127).n,n.d=e.C.d,n.a=e.C.a)}function zWe(e){var t,n,r,i=e.d;t=e.a,n=e.b,r=e.c,e.d=n,e.a=r,e.b=i,e.c=t}function BWe(e){return!e.g&&(e.g=new on),!e.g.b&&(e.g.b=new Ihe(e)),e.g.b}function Jy(e){return!e.g&&(e.g=new on),!e.g.c&&(e.g.c=new zhe(e)),e.g.c}function VWe(e){return!e.g&&(e.g=new on),!e.g.d&&(e.g.d=new Lhe(e)),e.g.d}function HWe(e){return!e.g&&(e.g=new on),!e.g.a&&(e.g.a=new Rhe(e)),e.g.a}function UWe(e,t,n,r){return n&&(r=n.Rh(t,eD(n.Dh(),e.c.uk()),null,r)),r}function WWe(e,t,n,r){return n&&(r=n.Th(t,eD(n.Dh(),e.c.uk()),null,r)),r}function Yy(e,t,n,r){var i=V(q9,HF,28,t+1,15,1);return Gdt(i,e,t,n,r),i}function V(e,t,n,r,i,a){var o=b3e(i,r);return i!=10&&U(O(e,a),t,n,i,o),o}function GWe(e,t,n){var r,i=new WC(t,e);for(r=0;rn||t=0?e.Lh(n,!0,!0):mj(e,t,!0)}function gGe(e,t,n){var r=kZe(e,t,n);return e.b=new VS(r.c.length),Xst(e,r)}function _Ge(e){if(e.b<=0)throw E(new Hr);return--e.b,e.a-=e.c.c,G(e.a)}function vGe(e){var t;if(!e.a)throw E(new fIe);return t=e.a,e.a=I_(e.a),t}function yGe(e){for(;!e.a;)if(!DOe(e.c,new Ufe(e)))return!1;return!0}function hb(e){var t;return ph(e),j(e,204)?(t=P(e,204),t):new gde(e)}function bGe(e){gb(),P(e.of((vP(),z6)),181).Fc((rj(),K8)),e.qf(R6,null)}function gb(){gb=C,jRt=new Hoe,NRt=new Uoe,MRt=oQe((vP(),R6),jRt,D6,NRt)}function _b(){_b=C,LFt=new oSe(`LEAF_NUMBER`,0),D4=new oSe(`NODE_SIZE`,1)}function vb(e){e.a=V(q9,HF,28,e.b+1,15,1),e.c=V(q9,HF,28,e.b,15,1),e.d=0}function xGe(e,t){e.a.Ne(t.d,e.b)>0&&(M(e.c,new Pje(t.c,t.d,e.d)),e.b=t.d)}function SGe(e,t){if(e.g==null||t>=e.i)throw E(new wl(t,e.i));return e.g[t]}function CGe(e,t,n){if(Aw(e,n),n!=null&&!e.fk(n))throw E(new Ir);return n}function yb(e,t){return lx(t)!=10&&U($w(t),t.Sm,t.__elementTypeId$,lx(t),e),e}function bb(e,t,n,r){var i;r=(Bg(),r||nK),i=e.slice(t,n),mtt(i,e,t,n,-t,r)}function xb(e,t,n,r,i){return t<0?mj(e,n,r):P(n,69).wk().yk(e,e.hi(),t,r,i)}function wGe(e,t){return aE(D(N(K(e,(Y(),$Q)))),D(N(K(t,$Q))))}function TGe(){TGe=C,dEt=nT((Sb(),U(O(mK,1),Z,304,0,[uK,dK,fK,pK])))}function Sb(){Sb=C,uK=new ls(`All`,0),dK=new WCe,fK=new Owe,pK=new UCe}function Cb(){Cb=C,rq=new hs(cL,0),nq=new hs(sL,1),iq=new hs(lL,2)}function EGe(){EGe=C,_N(),VHt=cI,BHt=lI,UHt=new Rn(cI),HHt=new Rn(lI)}function DGe(){DGe=C,cDt=nT((KC(),U(O(sDt,1),Z,417,0,[mq,dq,fq,pq])))}function OGe(){OGe=C,mDt=nT((wO(),U(O(pDt,1),Z,406,0,[wq,Cq,Tq,Eq])))}function kGe(){kGe=C,uDt=nT((TO(),U(O(lDt,1),Z,332,0,[gq,hq,_q,vq])))}function AGe(){AGe=C,xOt=nT((YD(),U(O(zJ,1),Z,389,0,[RJ,IJ,FJ,LJ])))}function jGe(){jGe=C,hOt=nT((ow(),U(O(mOt,1),Z,416,0,[kJ,MJ,AJ,jJ])))}function MGe(){MGe=C,qOt=nT((aw(),U(O(KOt,1),Z,421,0,[bX,xX,SX,CX])))}function NGe(){NGe=C,IOt=nT((iw(),U(O(FOt,1),Z,371,0,[gX,mX,hX,pX])))}function PGe(){PGe=C,IMt=nT((IO(),U(O(B0,1),Z,203,0,[R0,z0,L0,I0])))}function FGe(){FGe=C,JMt=nT((ID(),U(O(qMt,1),Z,284,0,[Z0,KMt,Q0,$0])))}function wb(){wb=C,DZ=new Hs(wR,0),EZ=new Hs(`IMPROVE_STRAIGHTNESS`,1)}function IGe(e,t){var n,r=t/e.c.Rd().gc()|0;return n=t%e.c.Rd().gc(),Iy(e,r,n)}function LGe(e){var t;if(e.nl())for(t=e.i-1;t>=0;--t)H(e,t);return zVe(e)}function RGe(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[0];)n=t;return n}function zGe(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[1];)n=t;return n}function BGe(e){return j(e,180)?``+P(e,180).a:e==null?null:PE(e)}function VGe(e){return j(e,180)?``+P(e,180).a:e==null?null:PE(e)}function HGe(e,t){if(t.a)throw E(new yi(xyt));Lm(e.a,t),t.a=e,!e.j&&(e.j=t)}function UGe(e,t){vl.call(this,t.zd(),t.yd()&-16449),Gh(e),this.a=e,this.c=t}function WGe(e,t){return new Vf(t,Sd(xu(t.e),t.f.a+e,t.f.b+e),(rd(),!1))}function GGe(e,t){return Rf(),M(e,new Kc(t,G(t.e.c.length+t.g.c.length)))}function KGe(e,t){return Rf(),M(e,new Kc(t,G(t.e.c.length+t.g.c.length)))}function qGe(){qGe=C,wIt=nT((uk(),U(O(CIt,1),Z,354,0,[F4,xIt,SIt,bIt])))}function JGe(){JGe=C,TFt=nT((Jw(),U(O(wFt,1),Z,353,0,[_4,h4,g4,m4])))}function YGe(){YGe=C,bPt=nT((Ok(),U(O(yPt,1),Z,405,0,[N2,P2,F2,I2])))}function XGe(){XGe=C,aBt=nT((wE(),U(O(p8,1),Z,223,0,[f8,u8,l8,d8])))}function ZGe(){ZGe=C,SBt=nT((kk(),U(O(xBt,1),Z,291,0,[S8,y8,b8,x8])))}function QGe(){QGe=C,IBt=nT((TD(),U(O(S5,1),Z,386,0,[b5,x5,y5,v5])))}function $Ge(){$Ge=C,YBt=nT((ZE(),U(O(JBt,1),Z,320,0,[F5,GBt,qBt,KBt])))}function eKe(){eKe=C,tVt=nT((Mw(),U(O(eVt,1),Z,415,0,[I5,QBt,ZBt,$Bt])))}function Tb(){Tb=C,c3=new Cc(_xt,0),CLt=new Cc(vV,1),SLt=new Cc(wR,2)}function Eb(e,t,n,r,i){return Gh(e),Gh(t),Gh(n),Gh(r),Gh(i),new Vm(e,t,r)}function tKe(e,t){var n=P(My(e.e,t),400);return n?(pMe(n),n.e):null}function Db(e,t){var n=Ab(e,t,0);return n!=-1&&(Ay(e,n),!0)}function nKe(e,t,n){var r;return Hh(e),r=new Re,r.a=t,e.a.Nb(new uxe(r,n)),r.a}function rKe(e){var t;return Hh(e),t=V(Z9,hI,28,0,15,1),Qa(e.a,new Bfe(t)),t}function Ob(e){var t;if(!DS(e))throw E(new Hr);return e.e=1,t=e.d,e.d=null,t}function kb(e){var t;return Il(e)&&(t=0-e,!isNaN(t))?t:MC(mw(e))}function Ab(e,t,n){for(;n=0?jO(e,n,!0,!0):mj(e,t,!0)}function qb(e){var t=rS(NC(e,32));return t??=(WD(e),rS(NC(e,32))),t}function Jb(e){var t;return e.Oh()||(t=bh(e.Dh())-e.ji(),e.$h().Mk(t)),e.zh()}function fKe(e,t){bq=new Mt,fDt=t,yq=e,P(yq.b,68),ZWe(yq,bq,null),Jpt(yq)}function Yb(){Yb=C,hJ=new Cs(`XY`,0),mJ=new Cs(`X`,1),gJ=new Cs(`Y`,2)}function Xb(){Xb=C,sq=new gs(`TOP`,0),oq=new gs(sL,1),aq=new gs(Lyt,2)}function Zb(){Zb=C,aQ=new qs(wR,0),oQ=new qs(`TOP`,1),iQ=new qs(Lyt,2)}function Qb(){Qb=C,e2=new nc(`INPUT_ORDER`,0),t2=new nc(`PORT_DEGREE`,1)}function $b(){$b=C,hG=vu(QF,QF,524287),BTt=vu(0,0,eI),gG=Cy(1),Cy(2),_G=Cy(0)}function ex(e){var t;return e.d!=e.r&&(t=Ik(e),e.e=!!t&&t.lk()==xwt,e.d=t),e.e}function tx(e,t,n){var r=e.g[t];return Au(e,t,e.Zi(t,n)),e.Ri(t,n,r),e.Ni(),r}function nx(e,t){var n=e.dd(t);return n>=0&&(e.gd(n),!0)}function rx(e,t){var n;for(ph(e),ph(t),n=!1;t.Ob();)n|=e.Fc(t.Pb());return n}function ix(e,t){var n=P(xh(e.e,t),400);return n?(Ywe(e,n),n.e):null}function pKe(e){var t=e/60|0,n=e%60;return n==0?``+t:``+t+`:`+(``+n)}function ax(e,t){var n=e.a[t],r=(vw(),pG)[typeof n];return r?r(n):XQe(typeof n)}function ox(e,t){var n,r;return lE(e),r=new WUe(t,e.a),n=new zOe(r),new Mp(e,n)}function sx(e){var t=e.b.c.length==0?null:Ep(e.b,0);return t!=null&&LS(e,0),t}function mKe(e,t){var n,r,i=t.c.i;n=P(xh(e.f,i),60),r=n.d.c-n.e.c,eC(t.a,r,0)}function cx(e,t){var n;for(++e.d,++e.c[t],n=t+1;n{(function(t){if(typeof e==`object`&&n!==void 0)n.exports=t();else if(typeof define==`function`&&define.amd)define([],t);else{var r=typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this;r.ELK=t()}})(function(){return(function(){function e(n,r,i){function a(s,c){if(!r[s]){if(!n[s]){var l=typeof t==`function`&&t;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=r[s]={exports:{}};n[s][0].call(d.exports,function(e){var t=n[s][1][e];return a(t||e)},d,d.exports,e,n,r,i)}return r[s].exports}for(var o=typeof t==`function`&&t,s=0;s0&&arguments[0]!==void 0?arguments[0]:{},r=n.defaultLayoutOptions,o=r===void 0?{}:r,s=n.algorithms,c=s===void 0?[`layered`,`stress`,`mrtree`,`radial`,`force`,`disco`,`sporeOverlap`,`sporeCompaction`,`rectpacking`]:s,l=n.workerFactory,u=n.workerUrl;if(i(this,e),this.defaultLayoutOptions=o,this.initialized=!1,u===void 0&&l===void 0)throw Error(`Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.`);var d=l;u!==void 0&&l===void 0&&(d=function(e){return new Worker(e)});var f=d(u);if(typeof f.postMessage!=`function`)throw TypeError(`Created worker does not provide the required 'postMessage' function.`);this.worker=new a(f),this.worker.postMessage({cmd:`register`,algorithms:c}).then(function(e){return t.initialized=!0}).catch(console.err)}return r(e,[{key:`layout`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.layoutOptions,r=n===void 0?this.defaultLayoutOptions:n,i=t.logging,a=i!==void 0&&i,o=t.measureExecutionTime,s=o!==void 0&&o;return e?this.worker.postMessage({cmd:`layout`,graph:e,layoutOptions:r,options:{logging:a,measureExecutionTime:s}}):Promise.reject(Error(`Missing mandatory parameter 'graph'.`))}},{key:`knownLayoutAlgorithms`,value:function(){return this.worker.postMessage({cmd:`algorithms`})}},{key:`knownLayoutOptions`,value:function(){return this.worker.postMessage({cmd:`options`})}},{key:`knownLayoutCategories`,value:function(){return this.worker.postMessage({cmd:`categories`})}},{key:`terminateWorker`,value:function(){this.worker&&this.worker.terminate()}}]),e}();var a=function(){function e(t){var n=this;if(i(this,e),t===void 0)throw Error(`Missing mandatory parameter 'worker'.`);this.resolvers={},this.worker=t,this.worker.onmessage=function(e){setTimeout(function(){n.receive(n,e)},0)}}return r(e,[{key:`postMessage`,value:function(e){var t=this.id||0;this.id=t+1,e.id=t;var n=this;return new Promise(function(r,i){n.resolvers[t]=function(e,t){e?(n.convertGwtStyleError(e),i(e)):r(t)},n.worker.postMessage(e)})}},{key:`receive`,value:function(e,t){var n=t.data,r=e.resolvers[n.id];r&&(delete e.resolvers[n.id],n.error?r(n.error):r(null,n.data))}},{key:`terminate`,value:function(){this.worker&&this.worker.terminate()}},{key:`convertGwtStyleError`,value:function(e){if(e){var t=e.__java$exception;t&&(t.cause&&t.cause.backingJsObject&&(e.cause=t.cause.backingJsObject,this.convertGwtStyleError(e.cause)),delete e.__java$exception)}}}]),e}()},{}],2:[function(e,t,n){(function(e){(function(){var r;typeof window<`u`?r=window:e===void 0?typeof self<`u`&&(r=self):r=e;var i;function a(){}function o(){}function s(){}function c(){}function l(){}function u(){}function d(){}function f(){}function p(){}function m(){}function h(){}function g(){}function _(){}function v(){}function y(){}function b(){}function x(){}function S(){}function ee(){}function te(){}function ne(){}function C(){}function re(){}function ie(){}function ae(){}function oe(){}function se(){}function ce(){}function le(){}function ue(){}function de(){}function fe(){}function pe(){}function me(){}function he(){}function ge(){}function _e(){}function ve(){}function ye(){}function be(){}function xe(){}function Se(){}function Ce(){}function we(){}function Te(){}function Ee(){}function De(){}function Oe(){}function ke(){}function Ae(){}function je(){}function Me(){}function Ne(){}function Pe(){}function Fe(){}function Ie(){}function Le(){}function Re(){}function ze(){}function Be(){}function Ve(){}function He(){}function Ue(){}function We(){}function Ge(){}function Ke(){}function qe(){}function Je(){}function Ye(){}function Xe(){}function Ze(){}function Qe(){}function $e(){}function et(){}function tt(){}function nt(){}function rt(){}function it(){}function at(){}function ot(){}function st(){}function ct(){}function lt(){}function ut(){}function dt(){}function ft(){}function pt(){}function mt(){}function ht(){}function gt(){}function _t(){}function vt(){}function yt(){}function bt(){}function xt(){}function St(){}function Ct(){}function wt(){}function Tt(){}function Et(){}function Dt(){}function Ot(){}function kt(){}function At(){}function jt(){}function Mt(){}function Nt(){}function Pt(){}function Ft(){}function It(){}function Lt(){}function Rt(){}function zt(){}function Bt(){}function eee(){}function Vt(){}function tee(){}function nee(){}function Ht(){}function ree(){}function iee(){}function aee(){}function oee(){}function see(){}function cee(){}function lee(){}function uee(){}function dee(){}function fee(){}function pee(){}function mee(){}function hee(){}function Ut(){}function gee(){}function _ee(){}function vee(){}function yee(){}function bee(){}function xee(){}function See(){}function Cee(){}function wee(){}function Wt(){}function Gt(){}function Tee(){}function Eee(){}function Dee(){}function Oee(){}function kee(){}function Aee(){}function jee(){}function Mee(){}function Nee(){}function Pee(){}function Fee(){}function Iee(){}function Lee(){}function Ree(){}function zee(){}function Bee(){}function Vee(){}function Hee(){}function Uee(){}function Wee(){}function Gee(){}function Kee(){}function qee(){}function Jee(){}function Yee(){}function Xee(){}function Zee(){}function Qee(){}function $ee(){}function ete(){}function tte(){}function nte(){}function rte(){}function ite(){}function ate(){}function ote(){}function ste(){}function cte(){}function lte(){}function ute(){}function dte(){}function fte(){}function pte(){}function mte(){}function hte(){}function gte(){}function _te(){}function vte(){}function yte(){}function bte(){}function xte(){}function Ste(){}function Cte(){}function wte(){}function Tte(){}function Ete(){}function Dte(){}function Ote(){}function kte(){}function Ate(){}function jte(){}function Mte(){}function Nte(){}function Pte(){}function Fte(){}function Ite(){}function Lte(){}function Rte(){}function zte(){}function Bte(){}function Vte(){}function Hte(){}function Ute(){}function Wte(){}function Gte(){}function Kte(){}function qte(){}function Jte(){}function Yte(){}function Xte(){}function Zte(){}function Qte(){}function $te(){}function ene(){}function tne(){}function nne(){}function rne(){}function ine(){}function ane(){}function one(){}function sne(){}function cne(){}function lne(){}function une(){}function dne(){}function fne(){}function pne(){}function mne(){}function hne(){}function gne(){}function Kt(){}function _ne(){}function vne(){}function yne(){}function bne(){}function xne(){}function Sne(){}function Cne(){}function wne(){}function Tne(){}function Ene(){}function Dne(){}function One(){}function kne(){}function Ane(){}function jne(){}function Mne(){}function Nne(){}function Pne(){}function Fne(){}function Ine(){}function Lne(){}function Rne(){}function zne(){}function Bne(){}function Vne(){}function Hne(){}function Une(){}function Wne(){}function Gne(){}function Kne(){}function qne(){}function Jne(){}function Yne(){}function Xne(){}function Zne(){}function Qne(){}function $ne(){}function ere(){}function tre(){}function nre(){}function rre(){}function ire(){}function are(){}function ore(){}function sre(){}function cre(){}function lre(){}function ure(){}function dre(){}function fre(){}function pre(){}function mre(){}function hre(){}function gre(){}function _re(){}function vre(){}function yre(){}function bre(){}function xre(){}function Sre(){}function Cre(){}function wre(){}function Tre(){}function Ere(){}function Dre(){}function Ore(){}function kre(){}function Are(){}function jre(){}function Mre(){}function Nre(){}function Pre(){}function Fre(){}function qt(){}function Ire(){}function Lre(){}function Rre(){}function zre(){}function Bre(){}function Vre(){}function Hre(){}function Ure(){}function Wre(){}function Gre(){}function Kre(){}function qre(){}function Jre(){}function Yre(){}function Xre(){}function Zre(){}function Qre(){}function $re(){}function eie(){}function tie(){}function nie(){}function rie(){}function iie(){}function aie(){}function oie(){}function sie(){}function cie(){}function lie(){}function uie(){}function die(){}function fie(){}function pie(){}function mie(){}function hie(){}function gie(){}function _ie(){}function vie(){}function yie(){}function bie(){}function xie(){}function Sie(){}function Cie(){}function wie(){}function Tie(){}function Eie(){}function Die(){}function Oie(){}function kie(){}function Aie(){}function jie(){}function Mie(){}function Nie(){}function Pie(){}function Fie(){}function Iie(){}function Lie(){}function Rie(){}function zie(){}function Bie(){}function Vie(){}function Hie(){}function Uie(){}function Wie(){}function Gie(){}function Kie(){}function qie(){}function Jie(){}function Yie(){}function Xie(){}function Zie(){}function Qie(){}function $ie(){}function eae(){}function tae(){}function nae(){}function rae(){}function iae(){}function aae(){}function oae(){}function sae(){}function cae(){}function lae(){}function uae(){}function dae(){}function fae(){}function pae(){}function mae(){}function hae(){}function gae(){}function _ae(){}function vae(){}function yae(){}function bae(){}function xae(){}function Sae(){}function Cae(){}function wae(){}function Tae(){}function Eae(){}function Dae(){}function Oae(){}function kae(){}function Aae(){}function jae(){}function Mae(){}function Nae(){}function Pae(){}function Fae(){}function Iae(){}function Lae(){}function Rae(){}function zae(){}function Bae(){}function Vae(){}function Hae(){}function Uae(){}function Wae(){}function Gae(){}function Kae(){}function qae(){}function Jae(){}function Yae(){}function Xae(){}function Zae(){}function Qae(){}function $ae(){}function eoe(){}function toe(){}function noe(){}function roe(){}function ioe(){}function aoe(){}function ooe(){}function soe(){}function coe(){}function loe(){}function uoe(){}function doe(){}function foe(){}function poe(){}function moe(){}function hoe(){}function goe(){}function _oe(){}function voe(){}function yoe(){}function boe(){}function xoe(){}function Jt(){}function Yt(){}function Soe(){}function Xt(){}function Coe(){}function woe(){}function Toe(){}function Eoe(){}function Doe(){}function Ooe(){}function koe(){}function Aoe(){}function joe(){}function Moe(){}function Noe(){}function Poe(){}function Foe(){}function Ioe(){}function Loe(){}function Roe(){}function zoe(){}function Boe(){}function Voe(){}function Hoe(){}function Uoe(){}function Woe(){}function Zt(){}function Goe(){}function Qt(){}function Koe(){}function qoe(){}function Joe(){}function Yoe(){}function Xoe(){}function Zoe(){}function Qoe(){}function $oe(){}function ese(){}function tse(){}function nse(){}function rse(){}function ise(){}function ase(){}function ose(){}function sse(){}function cse(){}function lse(){}function use(){}function dse(){}function $t(){}function fse(){}function pse(){}function mse(){}function hse(){}function gse(){}function _se(){}function vse(){}function yse(){}function bse(){}function xse(){}function Sse(){}function Cse(){}function wse(){}function en(){}function Tse(){}function Ese(){}function Dse(){}function tn(){}function Ose(){}function nn(){}function rn(){}function kse(){}function Ase(){}function jse(){}function Mse(){}function Nse(){}function Pse(){}function Fse(){}function Ise(){}function an(){}function Lse(){}function Rse(){}function on(){}function zse(){}function sn(){}function Bse(){}function Vse(){}function Hse(){}function cn(){}function Use(){}function Wse(){}function Gse(){}function Kse(){}function qse(){}function Jse(){}function Yse(){}function Xse(){}function Zse(){}function Qse(){}function $se(){}function ece(){}function tce(){}function nce(){}function rce(){}function ice(){}function ln(){}function un(){}function ace(){}function oce(){}function sce(){}function cce(){}function lce(){}function uce(){}function dce(){}function fce(){}function pce(){}function mce(){}function hce(){}function gce(){}function _ce(){}function vce(){}function yce(){}function bce(){}function xce(){}function Sce(){}function Cce(){}function wce(){}function Tce(){}function Ece(){}function Dce(){}function Oce(){}function kce(){}function Ace(){}function jce(){}function Mce(){}function Nce(){}function Pce(){}function Fce(){}function Ice(){}function Lce(){}function Rce(){}function zce(){}function Bce(){}function Vce(){}function Hce(){}function Uce(){}function Wce(){}function Gce(){}function Kce(){}function qce(){}function Jce(){}function Yce(){}function Xce(){}function Zce(){}function Qce(){}function $ce(){}function ele(){}function tle(){}function nle(){}function rle(){}function ile(){}function ale(){}function ole(){}function sle(){}function cle(){}function lle(){}function ule(){}function dle(){}function fle(){}function ple(){}function mle(){}function hle(){}function gle(){}function _le(){}function vle(){}function yle(){}function ble(){}function xle(){}function Sle(){}function Cle(){}function wle(){}function Tle(){}function Ele(){}function Dle(){}function Ole(){}function kle(){}function Ale(){}function jle(){}function Mle(){}function Nle(){}function Ple(){}function Fle(){}function Ile(){}function Lle(){}function Rle(){}function zle(){}function Ble(){}function Vle(){}function Hle(){}function Ule(){}function Wle(){}function Gle(){}function Kle(){}function qle(){}function Jle(){}function Yle(){}function Xle(){}function Zle(){}function Qle(){}function $le(){}function eue(){}function dn(){fi()}function tue(){Fo()}function nue(){Rk()}function rue(){qw()}function iue(){bO()}function aue(){I9e()}function oue(){XM()}function sue(){e6e()}function cue(){Nk()}function lue(){Io()}function uue(){Ff()}function due(){Ibe()}function fue(){cC()}function pue(){sWe()}function mue(){mJe()}function hue(){DRe()}function gue(){gJe()}function _ue(){eGe()}function vue(){TRe()}function yue(){Fw()}function bue(){vJe()}function xue(){_Je()}function Sue(){HBe()}function Cue(){yJe()}function wue(){wA()}function Tue(){Ro()}function Eue(){bP()}function Due(){mP()}function Oue(){bJe()}function kue(){kYe()}function Aue(){ORe()}function jue(){o6e()}function Mue(){kRe()}function Nue(){Aut()}function Pue(){Hrt()}function Fue(){zx()}function Iue(){Q$e()}function Lue(){rN()}function Rue(){fze()}function zue(){Rx()}function Bue(){Ylt()}function Vue(){PA()}function Hue(){Qlt()}function Uue(){gM()}function Wue(){yA()}function Gue(){bM()}function Kue(){ek()}function fn(){rke()}function que(){gb()}function Jue(){bA()}function Yue(){vP()}function Xue(){Iw()}function Zue(){wD()}function Que(){uC()}function $ue(){_N()}function ede(){Odt()}function tde(e){Gh(e)}function nde(e){this.a=e}function pn(e){this.a=e}function rde(e){this.a=e}function ide(e){this.a=e}function ade(e){this.a=e}function ode(e){this.a=e}function sde(e){this.a=e}function cde(e){this.a=e}function mn(e){this.a=e}function hn(e){this.a=e}function lde(e){this.a=e}function ude(e){this.a=e}function gn(e){this.a=e}function dde(e){this.a=e}function fde(e){this.a=e}function _n(e){this.a=e}function vn(e){this.a=e}function pde(e){this.a=e}function yn(e){this.a=e}function mde(e){this.a=e}function hde(e){this.a=e}function gde(e){this.a=e}function bn(e){this.b=e}function _de(e){this.c=e}function vde(e){this.a=e}function yde(e){this.a=e}function bde(e){this.a=e}function xde(e){this.a=e}function Sde(e){this.a=e}function Cde(e){this.a=e}function wde(e){this.a=e}function Tde(e){this.a=e}function Ede(e){this.a=e}function Dde(e){this.a=e}function Ode(e){this.a=e}function kde(e){this.a=e}function Ade(e){this.a=e}function xn(e){this.a=e}function Sn(e){this.a=e}function Cn(e){this.a=e}function wn(e){this.a=e}function Tn(){this.a=[]}function jde(e,t){e.a=t}function Mde(e,t){e.a=t}function Nde(e,t){e.b=t}function Pde(e,t){e.b=t}function Fde(e,t){e.b=t}function Ide(e,t){e.j=t}function Lde(e,t){e.g=t}function Rde(e,t){e.i=t}function zde(e,t){e.c=t}function Bde(e,t){e.c=t}function Vde(e,t){e.d=t}function Hde(e,t){e.d=t}function En(e,t){e.k=t}function Ude(e,t){e.c=t}function Wde(e,t){e.c=t}function Gde(e,t){e.a=t}function Kde(e,t){e.a=t}function qde(e,t){e.f=t}function Jde(e,t){e.a=t}function Yde(e,t){e.b=t}function Dn(e,t){e.d=t}function On(e,t){e.i=t}function Xde(e,t){e.o=t}function Zde(e,t){e.r=t}function Qde(e,t){e.a=t}function $de(e,t){e.b=t}function efe(e,t){e.e=t}function tfe(e,t){e.f=t}function nfe(e,t){e.g=t}function rfe(e,t){e.e=t}function ife(e,t){e.f=t}function afe(e,t){e.f=t}function kn(e,t){e.a=t}function An(e,t){e.b=t}function ofe(e,t){e.n=t}function sfe(e,t){e.a=t}function cfe(e,t){e.c=t}function lfe(e,t){e.c=t}function ufe(e,t){e.c=t}function dfe(e,t){e.a=t}function ffe(e,t){e.a=t}function pfe(e,t){e.d=t}function mfe(e,t){e.d=t}function hfe(e,t){e.e=t}function gfe(e,t){e.e=t}function _fe(e,t){e.g=t}function vfe(e,t){e.f=t}function yfe(e,t){e.j=t}function bfe(e,t){e.a=t}function xfe(e,t){e.a=t}function Sfe(e,t){e.b=t}function Cfe(e){e.b=e.a}function wfe(e){e.c=e.d.d}function jn(e){this.a=e}function Mn(e){this.a=e}function Nn(e){this.a=e}function Pn(e){this.a=e}function Fn(e){this.a=e}function In(e){this.a=e}function Tfe(e){this.a=e}function Ln(e){this.a=e}function Rn(e){this.a=e}function zn(e){this.a=e}function Bn(e){this.a=e}function Vn(e){this.a=e}function Efe(e){this.a=e}function Dfe(e){this.a=e}function Hn(e){this.b=e}function Un(e){this.b=e}function Wn(e){this.b=e}function Gn(e){this.a=e}function Ofe(e){this.a=e}function Kn(e){this.c=e}function w(e){this.c=e}function kfe(e){this.c=e}function qn(e){this.d=e}function Jn(e){this.a=e}function Yn(e){this.a=e}function Afe(e){this.a=e}function Xn(e){this.a=e}function Zn(e){this.a=e}function Qn(e){this.a=e}function $n(e){this.a=e}function er(e){this.a=e}function tr(e){this.a=e}function nr(e){this.a=e}function jfe(e){this.a=e}function Mfe(e){this.a=e}function rr(e){this.a=e}function Nfe(e){this.a=e}function Pfe(e){this.a=e}function Ffe(e){this.a=e}function Ife(e){this.a=e}function Lfe(e){this.a=e}function Rfe(e){this.a=e}function zfe(e){this.a=e}function Bfe(e){this.a=e}function Vfe(e){this.a=e}function Hfe(e){this.a=e}function Ufe(e){this.a=e}function Wfe(e){this.a=e}function Gfe(e){this.a=e}function Kfe(e){this.a=e}function qfe(e){this.a=e}function ir(e){this.a=e}function Jfe(e){this.a=e}function Yfe(e){this.a=e}function Xfe(e){this.a=e}function Zfe(e){this.a=e}function ar(e){this.a=e}function Qfe(e){this.a=e}function $fe(e){this.a=e}function or(e){this.a=e}function sr(e){this.a=e}function epe(e){this.a=e}function tpe(e){this.a=e}function npe(e){this.a=e}function rpe(e){this.a=e}function ipe(e){this.a=e}function ape(e){this.a=e}function cr(e){this.a=e}function lr(e){this.a=e}function ur(e){this.a=e}function dr(e){this.a=e}function fr(e){this.e=e}function pr(e){this.a=e}function ope(e){this.a=e}function mr(e){this.a=e}function spe(e){this.a=e}function cpe(e){this.a=e}function lpe(e){this.a=e}function upe(e){this.a=e}function dpe(e){this.a=e}function fpe(e){this.a=e}function ppe(e){this.a=e}function mpe(e){this.a=e}function hpe(e){this.a=e}function gpe(e){this.a=e}function _pe(e){this.a=e}function vpe(e){this.a=e}function ype(e){this.a=e}function bpe(e){this.a=e}function xpe(e){this.a=e}function Spe(e){this.a=e}function Cpe(e){this.a=e}function wpe(e){this.a=e}function Tpe(e){this.a=e}function Epe(e){this.a=e}function Dpe(e){this.a=e}function Ope(e){this.a=e}function kpe(e){this.a=e}function Ape(e){this.a=e}function jpe(e){this.a=e}function Mpe(e){this.a=e}function Npe(e){this.a=e}function Ppe(e){this.a=e}function Fpe(e){this.a=e}function Ipe(e){this.a=e}function Lpe(e){this.a=e}function Rpe(e){this.a=e}function zpe(e){this.a=e}function Bpe(e){this.a=e}function Vpe(e){this.a=e}function Hpe(e){this.a=e}function Upe(e){this.a=e}function Wpe(e){this.a=e}function Gpe(e){this.a=e}function Kpe(e){this.a=e}function qpe(e){this.a=e}function Jpe(e){this.a=e}function Ype(e){this.a=e}function Xpe(e){this.a=e}function Zpe(e){this.a=e}function Qpe(e){this.a=e}function $pe(e){this.a=e}function eme(e){this.a=e}function tme(e){this.a=e}function nme(e){this.a=e}function rme(e){this.a=e}function ime(e){this.c=e}function ame(e){this.b=e}function ome(e){this.a=e}function sme(e){this.a=e}function cme(e){this.a=e}function lme(e){this.a=e}function ume(e){this.a=e}function dme(e){this.a=e}function fme(e){this.a=e}function pme(e){this.a=e}function mme(e){this.a=e}function hme(e){this.a=e}function gme(e){this.a=e}function _me(e){this.a=e}function vme(e){this.a=e}function yme(e){this.a=e}function bme(e){this.a=e}function xme(e){this.a=e}function Sme(e){this.a=e}function Cme(e){this.a=e}function wme(e){this.a=e}function Tme(e){this.a=e}function Eme(e){this.a=e}function Dme(e){this.a=e}function Ome(e){this.a=e}function kme(e){this.a=e}function Ame(e){this.a=e}function jme(e){this.a=e}function Mme(e){this.a=e}function hr(e){this.a=e}function gr(e){this.a=e}function Nme(e){this.a=e}function Pme(e){this.a=e}function Fme(e){this.a=e}function Ime(e){this.a=e}function Lme(e){this.a=e}function Rme(e){this.a=e}function zme(e){this.a=e}function Bme(e){this.a=e}function Vme(e){this.a=e}function Hme(e){this.a=e}function Ume(e){this.a=e}function Wme(e){this.a=e}function Gme(e){this.a=e}function Kme(e){this.a=e}function qme(e){this.a=e}function Jme(e){this.a=e}function Yme(e){this.a=e}function Xme(e){this.a=e}function Zme(e){this.a=e}function Qme(e){this.a=e}function $me(e){this.a=e}function ehe(e){this.a=e}function the(e){this.a=e}function nhe(e){this.a=e}function rhe(e){this.a=e}function ihe(e){this.a=e}function _r(e){this.a=e}function ahe(e){this.f=e}function ohe(e){this.a=e}function she(e){this.a=e}function che(e){this.a=e}function lhe(e){this.a=e}function uhe(e){this.a=e}function dhe(e){this.a=e}function fhe(e){this.a=e}function phe(e){this.a=e}function mhe(e){this.a=e}function hhe(e){this.a=e}function ghe(e){this.a=e}function _he(e){this.a=e}function vhe(e){this.a=e}function yhe(e){this.a=e}function bhe(e){this.a=e}function xhe(e){this.a=e}function She(e){this.a=e}function Che(e){this.a=e}function whe(e){this.a=e}function The(e){this.a=e}function Ehe(e){this.a=e}function Dhe(e){this.a=e}function Ohe(e){this.a=e}function khe(e){this.a=e}function Ahe(e){this.a=e}function jhe(e){this.a=e}function Mhe(e){this.a=e}function Nhe(e){this.a=e}function vr(e){this.a=e}function Phe(e){this.a=e}function yr(e){this.b=e}function Fhe(e){this.a=e}function Ihe(e){this.a=e}function Lhe(e){this.a=e}function Rhe(e){this.a=e}function zhe(e){this.a=e}function Bhe(e){this.a=e}function Vhe(e){this.a=e}function Hhe(e){this.b=e}function Uhe(e){this.a=e}function br(e){this.a=e}function Whe(e){this.a=e}function Ghe(e){this.a=e}function Khe(e){this.c=e}function xr(e){this.e=e}function Sr(e){this.a=e}function Cr(e){this.a=e}function wr(e){this.a=e}function qhe(e){this.d=e}function Jhe(e){this.a=e}function Yhe(e){this.a=e}function Xhe(e){this.a=e}function Tr(e){this.e=e}function Er(){this.a=0}function Dr(){Pm(this)}function T(){au(this)}function Or(){_Fe(this)}function Zhe(){}function kr(){this.c=nHt}function Qhe(e,t){e.b+=t}function $he(e,t){t.Wb(e)}function ege(e){return e.a}function tge(e){return e.a}function nge(e){return e.a}function rge(e){return e.a}function ige(e){return e.a}function E(e){return e.e}function age(){return null}function oge(){return null}function sge(){La(),P_t()}function cge(e){e.b.Of(e.e)}function lge(e){e.b=new la}function Ar(e,t){e.b=t-e.b}function jr(e,t){e.a=t-e.a}function Mr(e,t){e.push(t)}function uge(e,t){e.sort(t)}function dge(e,t){t.jd(e.a)}function fge(e,t){tj(t,e)}function pge(e,t,n){e.Yd(n,t)}function Nr(e,t){e.e=t,t.b=e}function mge(e){wf(),this.a=e}function hge(e){wf(),this.a=e}function gge(e){wf(),this.a=e}function Pr(e){gh(),this.a=e}function _ge(e){Xg(),lG.le(e)}function vge(){vge=C,new Dr}function Fr(){WTe.call(this)}function yge(){WTe.call(this)}function bge(){Fr.call(this)}function Ir(){Fr.call(this)}function xge(){Fr.call(this)}function Lr(){Fr.call(this)}function Rr(){Fr.call(this)}function zr(){Fr.call(this)}function Br(){Fr.call(this)}function Vr(){Fr.call(this)}function Sge(){Fr.call(this)}function Hr(){Fr.call(this)}function Cge(){Fr.call(this)}function wge(){this.a=this}function Ur(){this.Bb|=256}function Tge(){this.b=new lCe}function Wr(e,t){e.length=t}function Gr(e,t){M(e.a,t)}function Ege(e,t){tet(e.c,t)}function Dge(e,t){Lm(e.b,t)}function Oge(e,t){JO(e.a,t)}function kge(e,t){$T(e.a,t)}function Kr(e,t){AC(e.e,t)}function qr(e){_j(e.c,e.b)}function Age(e,t){e.kc().Nb(t)}function jge(e){this.a=y1e(e)}function Jr(){this.a=new Dr}function Mge(){this.a=new Dr}function Nge(){this.a=new gbe}function Yr(){this.a=new T}function Xr(){this.a=new T}function Pge(){this.a=new T}function Zr(){this.a=new Xe}function Qr(){this.a=new qUe}function Fge(){this.a=new Vt}function Ige(){this.a=new wRe}function Lge(){this.a=new eOe}function Rge(){this.a=new T}function zge(){this.a=new T}function Bge(){this.a=new T}function Vge(){this.a=new T}function Hge(){this.d=new T}function Uge(){this.a=new Qze}function Wge(){this.a=new Jr}function Gge(){this.a=new Dr}function Kge(){this.b=new Dr}function qge(){this.b=new T}function Jge(){this.e=new T}function Yge(){this.a=new wue}function Xge(){this.d=new T}function Zge(){QIe.call(this)}function Qge(){QIe.call(this)}function $ge(){T.call(this)}function e_e(){bge.call(this)}function $r(){Yr.call(this)}function t_e(){Qd.call(this)}function n_e(){Vge.call(this)}function ei(){Zhe.call(this)}function ti(){ei.call(this)}function ni(){Zhe.call(this)}function ri(){ni.call(this)}function r_e(){b_e.call(this)}function i_e(){b_e.call(this)}function a_e(){b_e.call(this)}function o_e(){C_e.call(this)}function ii(){Ose.call(this)}function s_e(){Ose.call(this)}function ai(){vo.call(this)}function c_e(){E_e.call(this)}function l_e(){E_e.call(this)}function u_e(){Dr.call(this)}function d_e(){Dr.call(this)}function f_e(){Dr.call(this)}function oi(){EJe.call(this)}function p_e(){Jr.call(this)}function m_e(){Ur.call(this)}function si(){gTe.call(this)}function ci(){Dr.call(this)}function li(){gTe.call(this)}function ui(){Dr.call(this)}function h_e(){Dr.call(this)}function g_e(){sn.call(this)}function __e(){g_e.call(this)}function v_e(){sn.call(this)}function y_e(){Qle.call(this)}function b_e(){this.a=new Jr}function x_e(){this.a=new Dr}function S_e(){this.a=new T}function C_e(){this.a=new Dr}function di(){this.a=new vo}function w_e(){this.j=new T}function T_e(){this.a=new bye}function E_e(){this.a=new zse}function D_e(){this.a=new goe}function fi(){fi=C,GW=new o}function pi(){pi=C,XW=new k_e}function mi(){mi=C,ZW=new O_e}function O_e(){_n.call(this,``)}function k_e(){_n.call(this,``)}function A_e(e){mqe.call(this,e)}function j_e(e){mqe.call(this,e)}function M_e(e){mn.call(this,e)}function N_e(e){nbe.call(this,e)}function P_e(e){nbe.call(this,e)}function F_e(e){N_e.call(this,e)}function I_e(e){N_e.call(this,e)}function L_e(e){N_e.call(this,e)}function R_e(e){ny.call(this,e)}function z_e(e){ny.call(this,e)}function B_e(e){VOe.call(this,e)}function V_e(e){obe.call(this,e)}function hi(e){lo.call(this,e)}function gi(e){lo.call(this,e)}function H_e(e){lo.call(this,e)}function _i(e){P9e.call(this,e)}function vi(e){_i.call(this,e)}function yi(e){KNe.call(this,e)}function U_e(e){yi.call(this,e)}function bi(){wn.call(this,{})}function W_e(){W_e=C,zTt=new te}function xi(){xi=C,tG=new Vwe}function G_e(){G_e=C,iG=new a}function Si(){Si=C,cG=new v}function Ci(){Ci=C,dG=new x}function wi(e){Bu(),this.a=e}function Ti(e){lC(),this.a=e}function Ei(e){em(),this.f=e}function Di(e){em(),this.f=e}function K_e(e){nke(),this.a=e}function q_e(e){e.b=null,e.c=0}function J_e(e,t){e.e=t,Sst(e,t)}function Y_e(e,t){e.a=t,ott(e)}function Oi(e,t,n){e.a[t.g]=n}function X_e(e,t,n){y8e(n,e,t)}function Z_e(e,t){HOe(t.i,e.n)}function Q_e(e,t){ZZe(e).Cd(t)}function $_e(e,t){e.a.ec().Mc(t)}function eve(e,t){return e.g-t.g}function tve(e,t){return e*e/t}function ki(e){return Gh(e),e}function D(e){return Gh(e),e}function Ai(e){return Gh(e),e}function nve(e){return new Cn(e)}function rve(e){return new mh(e)}function ive(e){return Gh(e),e}function ave(e){return Gh(e),e}function ji(e){yi.call(this,e)}function Mi(e){yi.call(this,e)}function ove(e){yi.call(this,e)}function Ni(e){KNe.call(this,e)}function Pi(e){yi.call(this,e)}function Fi(e){yi.call(this,e)}function Ii(e){yi.call(this,e)}function sve(e){yi.call(this,e)}function Li(e){yi.call(this,e)}function Ri(e){yi.call(this,e)}function zi(e){yi.call(this,e)}function Bi(e){yi.call(this,e)}function Vi(e){yi.call(this,e)}function Hi(e){yi.call(this,e)}function Ui(e){yi.call(this,e)}function Wi(e){Gh(e),this.a=e}function Gi(e){return Tw(e),e}function Ki(e){CPe(e,e.length)}function qi(e){return e.b==e.c}function Ji(e){return!!e&&e.b}function cve(e){return!!e&&e.k}function lve(e){return!!e&&e.j}function uve(e,t,n){e.c.Ef(t,n)}function dve(e,t){e.be(t),t.ae(e)}function Yi(e){wf(),this.a=ph(e)}function Xi(){this.a=kd(ph(PP))}function fve(){throw E(new Br)}function pve(){throw E(new Br)}function Zi(){throw E(new Br)}function mve(){throw E(new Br)}function hve(){throw E(new Br)}function gve(){throw E(new Br)}function Qi(){Qi=C,Xg()}function $i(){In.call(this,``)}function ea(){In.call(this,``)}function ta(){In.call(this,``)}function na(){In.call(this,``)}function ra(e){Mi.call(this,e)}function ia(e){Mi.call(this,e)}function aa(e){Fi.call(this,e)}function oa(e){Wn.call(this,e)}function _ve(e){oa.call(this,e)}function sa(e){qu.call(this,e)}function ca(e){sEe.call(this,e,0)}function la(){URe.call(this,12,3)}function O(e,t){return _Re(e,t)}function ua(e,t){return yb(e,t)}function vve(e,t){return e.a-t.a}function yve(e,t){return e.a-t.a}function bve(e,t){return e.a-t.a}function xve(e,t){return t in e.a}function Sve(e){return e.a?e.b:0}function Cve(e){return e.a?e.b:0}function wve(e,t,n){t.Cd(e.a[n])}function Tve(e,t,n){t.Pe(e.a[n])}function Eve(e,t){e.b=new Vl(t)}function Dve(e,t){return e.b=t,e}function Ove(e,t){return e.c=t,e}function kve(e,t){return e.f=t,e}function Ave(e,t){return e.g=t,e}function da(e,t){return e.a=t,e}function fa(e,t){return e.f=t,e}function jve(e,t){return e.k=t,e}function pa(e,t){return e.a=t,e}function Mve(e,t){return e.e=t,e}function ma(e,t){return e.e=t,e}function Nve(e,t){return e.f=t,e}function Pve(e,t){e.b=!0,e.d=t}function Fve(e,t){return e.b-t.b}function Ive(e,t){return e.g-t.g}function Lve(e,t){return e?0:t-1}function Rve(e,t){return e?0:t-1}function zve(e,t){return e?t-1:0}function Bve(e,t){return e.s-t.s}function Vve(e,t){return t.rg(e)}function ha(e,t){return e.b=t,e}function ga(e,t){return e.a=t,e}function _a(e,t){return e.c=t,e}function va(e,t){return e.d=t,e}function ya(e,t){return e.e=t,e}function ba(e,t){return e.f=t,e}function xa(e,t){return e.a=t,e}function Sa(e,t){return e.b=t,e}function Ca(e,t){return e.c=t,e}function wa(e,t){return e.c=t,e}function Ta(e,t){return e.b=t,e}function Ea(e,t){return e.d=t,e}function Da(e,t){return e.e=t,e}function Hve(e,t){return e.f=t,e}function Oa(e,t){return e.g=t,e}function ka(e,t){return e.a=t,e}function Aa(e,t){return e.i=t,e}function ja(e,t){return e.j=t,e}function Uve(e,t){wA(),G_(t,e)}function Wve(e,t,n){CNe(e.a,t,n)}function Ma(e){yf.call(this,e)}function Gve(e){L1e.call(this,e)}function Kve(e){uIe.call(this,e)}function Na(e){uIe.call(this,e)}function Pa(e){kx.call(this,e)}function qve(e){Ig.call(this,e)}function Jve(e){Ig.call(this,e)}function Yve(){Dwe.call(this,``)}function Fa(){this.a=0,this.b=0}function Xve(){this.b=0,this.a=0}function Zve(e,t){e.b=0,Qx(e,t)}function Qve(e,t){return e.k=t,e}function $ve(e,t){return e.j=t,e}function eye(e,t){e.c=t,e.b=!0}function tye(){tye=C,rEt=c5e()}function Ia(){Ia=C,iVt=X6e()}function nye(){nye=C,Y5=X5e()}function La(){La=C,h7=dS()}function Ra(){Ra=C,R7=Z6e()}function rye(){rye=C,wHt=Q6e()}function za(){za=C,b9=rtt()}function Ba(e){return e.e&&e.e()}function iye(e){return e.l|e.m<<22}function aye(e,t){return e.c._b(t)}function oye(e,t){return E$e(e.b,t)}function Va(e){return e?e.d:null}function sye(e){return e?e.g:null}function cye(e){return e?e.i:null}function Ha(e){return Ad(e),e.o}function Ua(e,t){return e.a+=t,e}function Wa(e,t){return e.a+=t,e}function Ga(e,t){return e.a+=t,e}function Ka(e,t){return e.a+=t,e}function lye(e,t){for(;e.Bd(t););}function qa(e){this.a=new go(e)}function uye(){throw E(new Br)}function dye(){throw E(new Br)}function fye(){throw E(new Br)}function pye(){throw E(new Br)}function mye(){throw E(new Br)}function hye(){throw E(new Br)}function Ja(e){this.a=new mm(e)}function gye(){this.a=new Yj(NFt)}function _ye(){this.b=new Yj(yPt)}function vye(){this.a=new Yj(kIt)}function yye(){this.b=new Yj(_3)}function bye(){this.b=new Yj(_3)}function Ya(e){this.a=0,this.b=e}function xye(e){Ngt(),tvt(this,e)}function Xa(e){return Hh(e),e.a}function Za(e){return e.b!=e.d.c}function Sye(e,t){return e.d[t.p]}function Cye(e,t){return bst(e,t)}function wye(e,t,n){e.splice(t,n)}function Qa(e,t){for(;e.Re(t););}function Tye(e){e.c?gct(e):_ct(e)}function Eye(){throw E(new Br)}function Dye(){throw E(new Br)}function Oye(){throw E(new Br)}function kye(){throw E(new Br)}function Aye(){throw E(new Br)}function jye(){throw E(new Br)}function Mye(){throw E(new Br)}function Nye(){throw E(new Br)}function Pye(){throw E(new Br)}function Fye(){throw E(new Br)}function Iye(){throw E(new Hr)}function Lye(){throw E(new Hr)}function $a(e){this.a=new Rye(e)}function Rye(e){IJe(this,e,B9e())}function eo(e){return!e||mFe(e)}function to(e){return A9[e]!=-1}function zye(){oG!=0&&(oG=0),sG=-1}function Bye(){xTt??=[]}function no(e,t){zu.call(this,e,t)}function ro(e,t){no.call(this,e,t)}function Vye(e,t){this.a=e,this.b=t}function Hye(e,t){this.a=e,this.b=t}function Uye(e,t){this.a=e,this.b=t}function Wye(e,t){this.a=e,this.b=t}function Gye(e,t){this.a=e,this.b=t}function Kye(e,t){this.a=e,this.b=t}function qye(e,t){this.a=e,this.b=t}function io(e,t){this.e=e,this.d=t}function Jye(e,t){this.b=e,this.c=t}function Yye(e,t){this.b=e,this.a=t}function Xye(e,t){this.b=e,this.a=t}function Zye(e,t){this.b=e,this.a=t}function Qye(e,t){this.b=e,this.a=t}function $ye(e,t){this.a=e,this.b=t}function ao(e,t){this.a=e,this.b=t}function ebe(e,t){this.a=e,this.f=t}function oo(e,t){this.g=e,this.i=t}function so(e,t){this.f=e,this.g=t}function tbe(e,t){this.b=e,this.c=t}function nbe(e){vTe(e.dc()),this.c=e}function rbe(e,t){this.a=e,this.b=t}function ibe(e,t){this.a=e,this.b=t}function abe(e){this.a=P(ph(e),15)}function obe(e){this.a=P(ph(e),15)}function sbe(e){this.a=P(ph(e),85)}function co(e){this.b=P(ph(e),85)}function lo(e){this.b=P(ph(e),51)}function uo(){this.q=new r.Date}function fo(e,t){this.a=e,this.b=t}function cbe(e,t){return km(e.b,t)}function po(e,t){return e.b.Hc(t)}function lbe(e,t){return e.b.Ic(t)}function ube(e,t){return e.b.Qc(t)}function dbe(e,t){return e.b.Hc(t)}function fbe(e,t){return e.c.uc(t)}function pbe(e,t){return NT(e.c,t)}function mo(e,t){return e.a._b(t)}function mbe(e,t){return e>t&&t0}function rs(e,t){return dT(e,t)<0}function exe(e,t){return Gp(e.a,t)}function txe(e,t){yRe.call(this,e,t)}function nxe(e){_h(),VOe.call(this,e)}function rxe(e,t){mNe(e,e.length,t)}function is(e,t){NPe(e,e.length,t)}function as(e,t){return e.a.get(t)}function ixe(e,t){return km(e.e,t)}function os(e){return Gh(e),!1}function ss(e){this.a=P(ph(e),229)}function cs(e){cv.call(this,e,21)}function ls(e,t){so.call(this,e,t)}function us(e,t){so.call(this,e,t)}function axe(e,t){this.b=e,this.a=t}function ds(e,t){this.d=e,this.e=t}function oxe(e,t){this.a=e,this.b=t}function sxe(e,t){this.a=e,this.b=t}function cxe(e,t){this.a=e,this.b=t}function lxe(e,t){this.a=e,this.b=t}function fs(e,t){this.a=e,this.b=t}function uxe(e,t){this.b=e,this.a=t}function dxe(e,t){this.b=e,this.a=t}function fxe(e,t){so.call(this,e,t)}function pxe(e,t){so.call(this,e,t)}function ps(e,t){so.call(this,e,t)}function ms(e,t){so.call(this,e,t)}function hs(e,t){so.call(this,e,t)}function gs(e,t){so.call(this,e,t)}function _s(e,t){so.call(this,e,t)}function vs(e,t){this.b=e,this.a=t}function ys(e,t){so.call(this,e,t)}function bs(e,t){this.b=e,this.a=t}function xs(e,t){so.call(this,e,t)}function mxe(e,t){this.b=e,this.a=t}function Ss(e,t){so.call(this,e,t)}function Cs(e,t){so.call(this,e,t)}function ws(e,t){so.call(this,e,t)}function Ts(e,t,n){e.splice(t,0,n)}function hxe(e,t,n){e.Mb(n)&&t.Cd(n)}function gxe(e,t,n){t.Pe(e.a.Ye(n))}function _xe(e,t,n){t.Dd(e.a.Ze(n))}function vxe(e,t,n){t.Cd(e.a.Kb(n))}function yxe(e,t){return $u(e.c,t)}function bxe(e,t){return $u(e.e,t)}function Es(e,t){so.call(this,e,t)}function Ds(e,t){so.call(this,e,t)}function Os(e,t){so.call(this,e,t)}function xxe(e,t){so.call(this,e,t)}function ks(e,t){so.call(this,e,t)}function As(e,t){so.call(this,e,t)}function Sxe(e,t){this.a=e,this.b=t}function Cxe(e,t){this.a=e,this.b=t}function wxe(e,t){this.a=e,this.b=t}function Txe(e,t){this.a=e,this.b=t}function Exe(e,t){this.a=e,this.b=t}function Dxe(e,t){this.a=e,this.b=t}function Oxe(e,t){this.b=e,this.a=t}function kxe(e,t){this.b=e,this.a=t}function Axe(e,t){this.b=e,this.a=t}function js(e,t){this.c=e,this.d=t}function jxe(e,t){this.e=e,this.d=t}function Mxe(e,t){this.a=e,this.b=t}function Nxe(e,t){this.a=e,this.b=t}function Pxe(e,t){this.a=e,this.b=t}function Fxe(e,t){this.b=e,this.a=t}function Ixe(e,t){this.b=t,this.c=e}function Ms(e,t){so.call(this,e,t)}function Ns(e,t){so.call(this,e,t)}function Ps(e,t){so.call(this,e,t)}function Lxe(e,t){so.call(this,e,t)}function Fs(e,t){so.call(this,e,t)}function Is(e,t){so.call(this,e,t)}function Ls(e,t){so.call(this,e,t)}function Rs(e,t){so.call(this,e,t)}function zs(e,t){so.call(this,e,t)}function Bs(e,t){so.call(this,e,t)}function Vs(e,t){so.call(this,e,t)}function Hs(e,t){so.call(this,e,t)}function Us(e,t){so.call(this,e,t)}function Ws(e,t){so.call(this,e,t)}function Gs(e,t){so.call(this,e,t)}function Ks(e,t){so.call(this,e,t)}function qs(e,t){so.call(this,e,t)}function Js(e,t){so.call(this,e,t)}function Ys(e,t){so.call(this,e,t)}function Xs(e,t){so.call(this,e,t)}function Zs(e,t){so.call(this,e,t)}function Qs(e,t){so.call(this,e,t)}function $s(e,t){so.call(this,e,t)}function ec(e,t){so.call(this,e,t)}function tc(e,t){so.call(this,e,t)}function nc(e,t){so.call(this,e,t)}function rc(e,t){so.call(this,e,t)}function ic(e,t){so.call(this,e,t)}function ac(e,t){so.call(this,e,t)}function oc(e,t){so.call(this,e,t)}function sc(e,t){so.call(this,e,t)}function cc(e,t){so.call(this,e,t)}function lc(e,t){so.call(this,e,t)}function Rxe(e,t){this.b=e,this.a=t}function zxe(e,t){so.call(this,e,t)}function Bxe(e,t){this.a=e,this.b=t}function Vxe(e,t){this.a=e,this.b=t}function Hxe(e,t){this.a=e,this.b=t}function Uxe(e,t){so.call(this,e,t)}function Wxe(e,t){so.call(this,e,t)}function Gxe(e,t){this.a=e,this.b=t}function Kxe(e,t){return Rf(),t!=e}function uc(e){return jd(e.a),e.b}function dc(e){return Drt(e,e.c),e}function qxe(){return tye(),new rEt}function Jxe(){If(),this.a=new Zd}function Yxe(){rM(),this.a=new Jr}function Xxe(){B_(),this.b=new Jr}function Zxe(e,t){this.b=e,this.d=t}function Qxe(e,t){this.a=e,this.b=t}function $xe(e,t){this.a=e,this.b=t}function eSe(e,t){this.a=e,this.b=t}function tSe(e,t){this.b=e,this.a=t}function nSe(e,t){so.call(this,e,t)}function rSe(e,t){so.call(this,e,t)}function fc(e,t){so.call(this,e,t)}function pc(e,t){so.call(this,e,t)}function mc(e,t){so.call(this,e,t)}function hc(e,t){so.call(this,e,t)}function iSe(e,t){so.call(this,e,t)}function aSe(e,t){so.call(this,e,t)}function gc(e,t){so.call(this,e,t)}function oSe(e,t){so.call(this,e,t)}function _c(e,t){so.call(this,e,t)}function vc(e,t){so.call(this,e,t)}function yc(e,t){so.call(this,e,t)}function bc(e,t){so.call(this,e,t)}function xc(e,t){so.call(this,e,t)}function Sc(e,t){so.call(this,e,t)}function sSe(e,t){so.call(this,e,t)}function Cc(e,t){so.call(this,e,t)}function cSe(e,t){so.call(this,e,t)}function wc(e,t){so.call(this,e,t)}function Tc(e,t){so.call(this,e,t)}function lSe(e,t){so.call(this,e,t)}function Ec(e,t){so.call(this,e,t)}function uSe(e,t){so.call(this,e,t)}function dSe(e,t){this.b=e,this.a=t}function fSe(e,t){this.b=e,this.a=t}function pSe(e,t){this.b=e,this.a=t}function mSe(e,t){this.b=e,this.a=t}function hSe(e,t){this.a=e,this.b=t}function gSe(e,t){this.a=e,this.b=t}function _Se(e,t){this.a=e,this.b=t}function k(e,t){this.a=e,this.b=t}function Dc(e,t){so.call(this,e,t)}function Oc(e,t){so.call(this,e,t)}function kc(e,t){so.call(this,e,t)}function Ac(e,t){so.call(this,e,t)}function jc(e,t){so.call(this,e,t)}function Mc(e,t){so.call(this,e,t)}function Nc(e,t){so.call(this,e,t)}function Pc(e,t){so.call(this,e,t)}function Fc(e,t){so.call(this,e,t)}function Ic(e,t){so.call(this,e,t)}function Lc(e,t){so.call(this,e,t)}function Rc(e,t){so.call(this,e,t)}function zc(e,t){so.call(this,e,t)}function Bc(e,t){so.call(this,e,t)}function Vc(e,t){so.call(this,e,t)}function Hc(e,t){so.call(this,e,t)}function Uc(e,t){so.call(this,e,t)}function Wc(e,t){so.call(this,e,t)}function vSe(e,t){so.call(this,e,t)}function Gc(e,t){so.call(this,e,t)}function ySe(e,t){this.a=e,this.b=t}function bSe(e,t){this.a=e,this.b=t}function xSe(e,t){this.a=e,this.b=t}function SSe(e,t){this.a=e,this.b=t}function CSe(e,t){this.a=e,this.b=t}function wSe(e,t){this.a=e,this.b=t}function Kc(e,t){this.a=e,this.b=t}function TSe(e,t){this.a=e,this.b=t}function ESe(e,t){this.a=e,this.b=t}function DSe(e,t){this.a=e,this.b=t}function OSe(e,t){this.a=e,this.b=t}function kSe(e,t){this.a=e,this.b=t}function ASe(e,t){this.a=e,this.b=t}function jSe(e,t){this.b=e,this.a=t}function MSe(e,t){this.b=e,this.a=t}function NSe(e,t){this.b=e,this.a=t}function PSe(e,t){this.b=e,this.a=t}function FSe(e,t){this.a=e,this.b=t}function ISe(e,t){this.a=e,this.b=t}function qc(e,t){so.call(this,e,t)}function LSe(e,t){this.a=e,this.b=t}function RSe(e,t){this.a=e,this.b=t}function Jc(e,t){so.call(this,e,t)}function zSe(e,t){this.f=e,this.c=t}function Yc(e,t){return $u(e.g,t)}function BSe(e,t){return $u(t.b,e)}function VSe(e,t){return uD(e.a,t)}function HSe(e,t){return-e.b.af(t)}function USe(e,t){e&&Qh(f7,e,t)}function Xc(e,t){e.i=null,OS(e,t)}function WSe(e,t,n){I8e(t,KA(e,n))}function GSe(e,t,n){I8e(t,KA(e,n))}function KSe(e,t){not(e.a,P(t,58))}function qSe(e,t){KGe(e.a,P(t,12))}function Zc(e,t){this.a=e,this.b=t}function JSe(e,t){this.a=e,this.b=t}function YSe(e,t){this.a=e,this.b=t}function XSe(e,t){this.a=e,this.b=t}function ZSe(e,t){this.a=e,this.b=t}function QSe(e,t){this.d=e,this.b=t}function $Se(e,t){this.e=e,this.a=t}function Qc(e,t){this.b=e,this.c=t}function $c(e,t){this.i=e,this.g=t}function el(e,t){this.d=e,this.e=t}function eCe(e,t){kKe(new Lu(e),t)}function tl(e){return lD(e.c,e.b)}function nl(e){return e?e.md():null}function A(e){return e??null}function rl(e){return typeof e===OP}function il(e){return typeof e===DP}function al(e){return typeof e===Vvt}function ol(e,t){return dT(e,t)==0}function sl(e,t){return dT(e,t)>=0}function cl(e,t){return dT(e,t)!=0}function ll(e,t){return VYe(e.Kc(),t)}function ul(e,t){return e.Rd().Xb(t)}function tCe(e){return RE(e),e.d.gc()}function dl(e){return bp(e==null),e}function fl(e,t){return e.a+=``+t,e}function pl(e,t){return e.a+=``+t,e}function ml(e,t){return e.a+=``+t,e}function hl(e,t){return e.a+=``+t,e}function gl(e,t){return e.a+=``+t,e}function _l(e,t){return e.a+=``+t,e}function nCe(e){return``+(Gh(e),e)}function rCe(e){Pm(this),mC(this,e)}function iCe(){ERe(),bNe.call(this)}function aCe(e,t){GNe.call(this,e,t)}function oCe(e,t){GNe.call(this,e,t)}function vl(e,t){GNe.call(this,e,t)}function yl(e,t){iy(e,t,e.c.b,e.c)}function bl(e,t){iy(e,t,e.a,e.a.a)}function xl(e){return ov(e,0),null}function sCe(){this.b=0,this.a=!1}function cCe(){this.b=0,this.a=!1}function lCe(){this.b=new go(xx(12))}function uCe(){uCe=C,oDt=nT(sO())}function dCe(){dCe=C,NOt=nT(wot())}function fCe(){fCe=C,NPt=nT(qYe())}function Sl(){Sl=C,vge(),uG=new Dr}function Cl(e){return e.a=0,e.b=0,e}function pCe(e,t){return e.a=t.g+1,e}function wl(e,t){lf.call(this,e,t)}function Tl(e,t){Wd.call(this,e,t)}function El(e,t){$c.call(this,e,t)}function mCe(e,t){ad.call(this,e,t)}function Dl(e,t){WC.call(this,e,t)}function Ol(e,t){Jo(),Qh(v7,e,t)}function hCe(e,t){e.q.setTime(Dv(t))}function gCe(e){r.clearTimeout(e)}function _Ce(e){return ph(e),new Hl(e)}function vCe(e,t){return A(e)===A(t)}function yCe(e,t){return e.a.a.a.cc(t)}function kl(e,t){return p_(e.a,0,t)}function Al(e){return zPe(P(e,74))}function jl(e){return C_((Gh(e),e))}function bCe(e){return C_((Gh(e),e))}function xCe(e){return vu(e.l,e.m,e.h)}function Ml(e,t){return _u(e.a,t.a)}function SCe(e,t){return DPe(e.a,t.a)}function CCe(e,t){return aE(e.a,t.a)}function Nl(e,t){return e.indexOf(t)}function wCe(e,t){return e.j[t.p]==2}function Pl(e,t){return e==t?0:e?1:-1}function Fl(e){return e<10?`0`+e:``+e}function Il(e){return typeof e===Vvt}function TCe(e){return e==kJ||e==MJ}function ECe(e){return e==kJ||e==AJ}function DCe(e,t){return _u(e.g,t.g)}function Ll(e){return Ab(e.b.b,e,0)}function OCe(){Np.call(this,0,0,0,0)}function Rl(){Xn.call(this,new ry)}function zl(e,t){bb(e,0,e.length,t)}function kCe(e,t){return M(e.a,t),t}function ACe(e,t){return Lf(),t.a+=e}function jCe(e,t){return Lf(),t.a+=e}function MCe(e,t){return Lf(),t.c+=e}function NCe(e,t){return M(e.c,t),e}function Bl(e,t){return OC(e.a,t),e}function PCe(e){this.a=qxe(),this.b=e}function FCe(e){this.a=qxe(),this.b=e}function Vl(e){this.a=e.a,this.b=e.b}function Hl(e){this.a=e,dn.call(this)}function ICe(e){this.a=e,dn.call(this)}function Ul(){wg.call(this,0,0,0,0)}function Wl(e){return OC(new Zh,e)}function LCe(e){return ag(P(e,123))}function Gl(e){return e.vh()&&e.wh()}function Kl(e){return e!=V8&&e!=H8}function ql(e){return e==t8||e==n8}function Jl(e){return e==i8||e==e8}function RCe(e){return e==L0||e==I0}function zCe(e,t){return _u(e.g,t.g)}function BCe(e,t){return new WC(t,e)}function VCe(e,t){return new WC(t,e)}function Yl(e){return wje(e.b.Kc(),e.a)}function Xl(e,t){Gw(e,t),eS(e,e.D)}function Zl(e,t,n){Xx(e,t),Vx(e,n)}function Ql(e,t,n){Wx(e,t),Ux(e,n)}function $l(e,t,n){Gx(e,t),Kx(e,n)}function eu(e,t,n){Hx(e,t),Jx(e,n)}function tu(e,t,n){qx(e,t),Yx(e,n)}function HCe(e,t,n){mDe.call(this,e,t,n)}function nu(e){zSe.call(this,e,!0)}function UCe(){ls.call(this,`Tail`,3)}function WCe(){ls.call(this,`Head`,1)}function ru(e){AM(),IYe.call(this,e)}function iu(e){Np.call(this,e,e,e,e)}function au(e){e.c=V(WW,FP,1,0,5,1)}function GCe(e){return e.b&&yN(e),e.a}function KCe(e){return e.b&&yN(e),e.c}function qCe(e,t){_K||(e.b=t)}function JCe(e,t){return e[e.length]=t}function YCe(e,t){return e[e.length]=t}function XCe(e,t){return Ex(t,E_(e))}function ZCe(e,t){return Ex(t,E_(e))}function QCe(e,t){return yS(uh(e.d),t)}function $Ce(e,t){return yS(uh(e.g),t)}function ewe(e,t){return yS(uh(e.j),t)}function ou(e,t){Wd.call(this,e.b,t)}function twe(e,t){tb(Jv(e.a),IRe(t))}function nwe(e,t){tb(Ib(e.a),LRe(t))}function rwe(e,t,n){$l(n,n.i+e,n.j+t)}function iwe(e,t,n){Sh(e.c[t.g],t.g,n)}function awe(e,t,n){P(e.c,71).Gi(t,n)}function su(e,t,n){return Sh(e,t,n),n}function owe(e){Dx(e.Sf(),new Zfe(e))}function cu(e){return e==null?0:US(e)}function swe(e){return e==null?0:US(e)}function lu(e){xP(),Tr.call(this,e)}function cwe(e){this.a=e,xje.call(this,e)}function uu(){uu=C,r.Math.log(2)}function du(){du=C,s9=(Xbe(),mVt)}function lwe(){lwe=C,D2=new NE(p8)}function fu(){fu=C,new uwe,new T}function uwe(){new Dr,new Dr,new Dr}function dwe(){throw E(new Ri(_Tt))}function fwe(){throw E(new Ri(_Tt))}function pwe(){throw E(new Ri(vTt))}function mwe(){throw E(new Ri(vTt))}function pu(e){this.a=e,co.call(this,e)}function mu(e){this.a=e,co.call(this,e)}function hwe(e,t){gh(),this.a=e,this.b=t}function gwe(e,t){ph(t),bg(e).Jc(new m)}function hu(e,t){qp(e.c,e.c.length,t)}function gu(e){return e.at)}function ywe(e,t){return dT(e,t)>0?e:t}function vu(e,t,n){return{l:e,m:t,h:n}}function bwe(e,t){e.a!=null&&qSe(t,e.a)}function xwe(e){U_(e,null),K_(e,null)}function Swe(e,t,n){return Qh(e.g,n,t)}function yu(e,t,n){return AD(t,n,e.c)}function Cwe(e,t,n){return Qh(e.k,n,t)}function wwe(e,t,n){return kht(e,t,n),n}function Twe(e,t){return z_(),t.n.b+=e}function Ewe(e){r_.call(this),this.b=e}function Dwe(e){$De.call(this),this.a=e}function Owe(){ls.call(this,`Range`,2)}function bu(e){this.b=e,this.a=new T}function kwe(e){this.b=new jt,this.a=e}function Awe(e){e.a=new me,e.c=new me}function jwe(e){e.a=new Dr,e.d=new Dr}function Mwe(e){q_(e,null),J_(e,null)}function Nwe(e,t){return Nht(e.a,t,null)}function Pwe(e,t){return Qh(e.a,t.a,t)}function xu(e){return new k(e.a,e.b)}function Fwe(e){return new k(e.c,e.d)}function Iwe(e){return new k(e.c,e.d)}function Su(e,t){return xmt(e.c,e.b,t)}function j(e,t){return e!=null&&kO(e,t)}function Cu(e,t){return XXe(e.Kc(),t)!=-1}function wu(e){return e.Ob()?e.Pb():null}function Lwe(e){this.b=(Vg(),new Kn(e))}function Rwe(e){this.a=e,Dr.call(this)}function zwe(){ad.call(this,null,null)}function Bwe(){od.call(this,null,null)}function Vwe(){so.call(this,`INSTANCE`,0)}function Hwe(){i8e(),this.a=new Yj(CJ)}function Uwe(e){return ND(e,0,e.length)}function Wwe(e,t){return new PTe(e.Kc(),t)}function Gwe(e,t){return e.a.Bc(t)!=null}function Kwe(e,t){RN(e),e.Gc(P(t,15))}function qwe(e,t,n){e.c.bd(t,P(n,136))}function Jwe(e,t,n){e.c.Ui(t,P(n,136))}function Ywe(e,t){e.c&&(pMe(t),LLe(t))}function Xwe(e,t){e.q.setHours(t),dN(e,t)}function Zwe(e,t){Sd(t,e.a.a.a,e.a.a.b)}function Qwe(e,t,n,r){Sh(e.a[t.g],n.g,r)}function Tu(e,t,n){return e.a[t.g][n.g]}function $we(e,t){return e.e[t.c.p][t.p]}function eTe(e,t){return e.c[t.c.p][t.p]}function Eu(e,t){return e.a[t.c.p][t.p]}function tTe(e,t){return e.j[t.p]=Aat(t)}function Du(e,t){return e.a.Bc(t)!=null}function nTe(e,t){return D(N(t.a))<=e}function rTe(e,t){return D(N(t.a))>=e}function iTe(e,t){return zUe(e.f,t.Pg())}function Ou(e,t){return e.a*t.a+e.b*t.b}function aTe(e,t){return e.a0?t/(e*e):t*100}function SEe(e,t){return e>0?t*t/e:t*t*100}function xd(e,t){return P(ix(e.a,t),34)}function CEe(e,t){return wA(),fj(e,t.e,t)}function wEe(e,t,n){return zo(),n.Mg(e,t)}function TEe(e){return zx(),e.e.a+e.f.a/2}function EEe(e,t,n){return zx(),n.e.a-e*t}function DEe(e){return zx(),e.e.b+e.f.b/2}function OEe(e,t,n){return zx(),n.e.b-e*t}function kEe(e){e.d=new gEe(e),e.e=new Dr}function AEe(){this.a=new g_,this.b=new g_}function jEe(e){this.c=e,this.a=1,this.b=1}function MEe(e){dP(),lge(this),this.Ff(e)}function NEe(e,t,n){gb(),e.pf(t)&&n.Cd(e)}function PEe(e,t,n){return M(t,Y1e(e,n))}function Sd(e,t,n){return e.a+=t,e.b+=n,e}function FEe(e,t,n){return e.a*=t,e.b*=n,e}function IEe(e,t){return e.a=t.a,e.b=t.b,e}function Cd(e){return e.a=-e.a,e.b=-e.b,e}function wd(e,t,n){return e.a-=t,e.b-=n,e}function LEe(e){vo.call(this),_S(this,e)}function REe(){so.call(this,`GROW_TREE`,0)}function zEe(){so.call(this,`POLYOMINO`,0)}function Td(e,t,n){lb.call(this,e,t,n,2)}function BEe(e,t,n){WT(Jv(e.a),t,IRe(n))}function VEe(e,t){Yo(),ad.call(this,e,t)}function HEe(e,t){Xo(),od.call(this,e,t)}function UEe(e,t){Xo(),HEe.call(this,e,t)}function WEe(e,t){Xo(),od.call(this,e,t)}function GEe(e,t){return e.c.Fc(P(t,136))}function KEe(e,t,n){WT(Ib(e.a),t,LRe(n))}function qEe(e){this.c=e,Gx(e,0),Kx(e,0)}function Ed(e,t){du(),Bp.call(this,e,t)}function JEe(e,t){du(),Ed.call(this,e,t)}function YEe(e,t){du(),Ed.call(this,e,t)}function XEe(e,t){du(),Bp.call(this,e,t)}function ZEe(e,t){du(),YEe.call(this,e,t)}function QEe(e,t){du(),XEe.call(this,e,t)}function $Ee(e,t){du(),Bp.call(this,e,t)}function eDe(e,t,n){return t.zl(e.e,e.c,n)}function tDe(e,t,n){return t.Al(e.e,e.c,n)}function nDe(e,t,n){return jN(Lb(e,t),n)}function Dd(e,t){return pT(e.e,P(t,54))}function rDe(e){return e==null?null:Fgt(e)}function iDe(e){return e==null?null:G9e(e)}function aDe(e){return e==null?null:PE(e)}function oDe(e){return e==null?null:PE(e)}function Od(e){return bp(e==null||il(e)),e}function N(e){return bp(e==null||al(e)),e}function kd(e){return bp(e==null||rl(e)),e}function Ad(e){e.o??zit(e)}function sDe(e){if(!e)throw E(new Lr)}function cDe(e){if(!e)throw E(new Ir)}function jd(e){if(!e)throw E(new Hr)}function Md(e){if(!e)throw E(new Rr)}function lDe(e){if(!e)throw E(new Vr)}function Nd(){Nd=C,_7=new c_e,new l_e}function Pd(){Pd=C,y4=new yr(`root`)}function uDe(){EJe.call(this),this.Bb|=pI}function dDe(e,t){this.d=e,wfe(this),this.b=t}function fDe(e,t){Qy.call(this,e),this.a=t}function pDe(e,t){Qy.call(this,e),this.a=t}function mDe(e,t,n){Ry.call(this,e,t,n,null)}function hDe(e,t,n){Ry.call(this,e,t,n,null)}function Fd(e,t){this.c=e,io.call(this,e,t)}function Id(e,t){this.a=e,Fd.call(this,e,t)}function gDe(e){this.q=new r.Date(Dv(e))}function _De(e){return e>8?0:e+1}function vDe(e,t){_K||M(e.a,t)}function yDe(e,t){return Io(),jC(t.d.i,e)}function bDe(e,t){return cC(),new Ilt(t,e)}function xDe(e,t,n){return e.Ne(t,n)<=0?n:t}function SDe(e,t,n){return e.Ne(t,n)<=0?t:n}function CDe(e,t){return P(ix(e.b,t),143)}function wDe(e,t){return P(ix(e.c,t),233)}function Ld(e){return P(Ep(e.a,e.b),294)}function TDe(e){return new k(e.c,e.d+e.a)}function EDe(e){return Gh(e),e?1231:1237}function DDe(e){return z_(),RCe(P(e,203))}function Rd(){Rd=C,lq=sE((TD(),x5))}function ODe(e,t){t.a?Irt(e,t):Du(e.a,t.b)}function zd(e,t,n){++e.j,e.tj(),Xy(e,t,n)}function kDe(e,t,n){++e.j,e.qj(t,e.Zi(t,n))}function ADe(e,t,n){e.fd(t).Rb(n)}function jDe(e,t,n){return n=qM(e,t,6,n),n}function Bd(e,t,n){return n=qM(e,t,3,n),n}function Vd(e,t,n){return n=qM(e,t,9,n),n}function Hd(e,t){return c_(t,Iyt),e.f=t,e}function MDe(e,t){return(t&AP)%e.d.length}function NDe(e,t,n){return Xft(e.c,e.b,t,n)}function PDe(e,t){this.c=e,kx.call(this,t)}function FDe(e,t){this.a=e,Hhe.call(this,t)}function Ud(e,t){this.a=e,Hhe.call(this,t)}function Wd(e,t){yr.call(this,e),this.a=t}function IDe(e,t){Khe.call(this,e),this.a=t}function Gd(e,t){Khe.call(this,e),this.a=t}function LDe(e){iD.call(this,0,0),this.f=e}function RDe(e,t,n){return e.a+=ND(t,0,n),e}function Kd(e){return!e.a&&(e.a=new ee),e.a}function zDe(e,t){var n=e.e;return e.e=t,n}function BDe(e,t){var n=t;return!!e.Fe(n)}function VDe(e,t){return rd(),e==t?0:e?1:-1}function qd(e,t){e.a.bd(e.b,t),++e.b,e.c=-1}function Jd(e){e.b?Jd(e.b):e.f.c.zc(e.e,e.d)}function HDe(e){Pm(e.e),e.d.b=e.d,e.d.a=e.d}function UDe(e,t,n){wo(),jde(e,t.Ve(e.a,n))}function WDe(e,t,n){return zm(e,P(t,22),n)}function Yd(e,t){return ua(Array(t),e)}function GDe(e){return nm(um(e,32))^nm(e)}function Xd(e){return String.fromCharCode(e)}function KDe(e){return e==null?null:e.message}function qDe(e,t,n){return e.apply(t,n)}function JDe(e,t){e[TI].call(e,t)}function YDe(e,t){e[TI].call(e,t)}function XDe(e,t){return Io(),!jC(t.d.i,e)}function ZDe(e,t,n,r){Np.call(this,e,t,n,r)}function QDe(){Qd.call(this),this.a=new Fa}function $De(){this.n=new Fa,this.o=new Fa}function eOe(){this.b=new Fa,this.c=new T}function tOe(){this.a=new T,this.b=new T}function nOe(){this.a=new Vt,this.b=new Tge}function Zd(){this.b=new ry,this.a=new ry}function rOe(){this.b=new Jr,this.a=new Jr}function iOe(){this.b=new Dr,this.a=new Dr}function aOe(){this.b=new _ye,this.a=new iae}function oOe(){this.a=new Tue,this.b=new Ure}function sOe(){this.a=new T,this.d=new T}function Qd(){this.n=new ni,this.i=new Ul}function cOe(e){this.a=(vS(e,hF),new Hy(e))}function lOe(e){this.a=(vS(e,hF),new Hy(e))}function uOe(e){return e<100?null:new Pa(e)}function dOe(e,t){return e.n.a=(Gh(t),t+10)}function fOe(e,t){return e.n.a=(Gh(t),t+10)}function pOe(e,t){return t==e||Uk(zj(t),e)}function mOe(e,t){return Qh(e.a,t,``)==null}function hOe(e,t){return t.qi(e.a)}function $d(e,t){return e.a+=t.a,e.b+=t.b,e}function ef(e,t){return e.a-=t.a,e.b-=t.b,e}function gOe(e){return Wr(e.j.c,0),e.a=-1,e}function tf(e,t,n){return n=qM(e,t,11,n),n}function _Oe(e,t,n){n!=null&&TS(t,dk(e,n))}function vOe(e,t,n){n!=null&&ES(t,dk(e,n))}function nf(e,t,n,r){F.call(this,e,t,n,r)}function rf(e,t,n,r){F.call(this,e,t,n,r)}function yOe(e,t,n,r){rf.call(this,e,t,n,r)}function bOe(e,t,n,r){wm.call(this,e,t,n,r)}function af(e,t,n,r){wm.call(this,e,t,n,r)}function of(e,t,n,r){wm.call(this,e,t,n,r)}function xOe(e,t,n,r){af.call(this,e,t,n,r)}function sf(e,t,n,r){af.call(this,e,t,n,r)}function cf(e,t,n,r){of.call(this,e,t,n,r)}function SOe(e,t,n,r){sf.call(this,e,t,n,r)}function COe(e,t,n,r){dPe.call(this,e,t,n,r)}function lf(e,t){Mi.call(this,PU+e+bU+t)}function uf(e,t){return e.jk().wi().ri(e,t)}function df(e,t){return e.jk().wi().ti(e,t)}function wOe(e,t){return Gh(e),A(e)===A(t)}function ff(e,t){return Gh(e),A(e)===A(t)}function TOe(e,t){return e.b.Bd(new sxe(e,t))}function EOe(e,t){return e.b.Bd(new cxe(e,t))}function DOe(e,t){return e.b.Bd(new lxe(e,t))}function OOe(e,t){return e.e=P(e.d.Kb(t),159)}function pf(e,t,n){return e.lastIndexOf(t,n)}function kOe(e,t,n){return aE(e[t.a],e[n.a])}function AOe(e,t){return W(t,(mP(),d1),e)}function jOe(e,t){return _u(t.a.d.p,e.a.d.p)}function MOe(e,t){return _u(e.a.d.p,t.a.d.p)}function NOe(e,t){return aE(e.c-e.s,t.c-t.s)}function POe(e,t){return aE(e.b.e.a,t.b.e.a)}function FOe(e,t){return aE(e.c.e.a,t.c.e.a)}function IOe(e){return e.c?Ab(e.c.a,e,0):-1}function mf(e){return e==L8||e==z8||e==R8}function LOe(e,t){this.c=e,Hm.call(this,e,t)}function ROe(e,t,n){this.a=e,sEe.call(this,t,n)}function zOe(e){this.c=e,vl.call(this,tF,0)}function BOe(e,t,n){this.c=t,this.b=n,this.a=e}function hf(e){Rf(),this.d=e,this.a=new Iu}function VOe(e){wf(),this.a=(Vg(),new oa(e))}function HOe(e,t){ql(e.f)?Ait(e,t):f7e(e,t)}function UOe(e,t){kje.call(this,e,e.length,t)}function WOe(e,t){_K||t&&(e.d=t)}function GOe(e,t){return j(t,15)&&Mct(e.c,t)}function KOe(e,t,n){return P(e.c,71).Wk(t,n)}function gf(e,t,n){return P(e.c,71).Xk(t,n)}function qOe(e,t,n){return eDe(e,P(t,343),n)}function JOe(e,t,n){return tDe(e,P(t,343),n)}function YOe(e,t,n){return E5e(e,P(t,343),n)}function XOe(e,t,n){return A7e(e,P(t,343),n)}function _f(e,t){return t==null?null:TT(e.b,t)}function ZOe(e){return al(e)?(Gh(e),e):e.ue()}function vf(e){return!isNaN(e)&&!isFinite(e)}function yf(e){Awe(this),Fg(this),XS(this,e)}function bf(e){au(this),Fje(this.c,0,e.Pc())}function xf(e,t,n){this.a=e,this.b=t,this.c=n}function QOe(e,t,n){this.a=e,this.b=t,this.c=n}function $Oe(e,t,n){this.d=e,this.b=n,this.a=t}function eke(e){this.a=e,yo(),LC(Date.now())}function tke(e){Fh(e.a),KWe(e.c,e.b),e.b=null}function Sf(){Sf=C,aK=new he,oEt=new ge}function nke(){nke=C,TVt=V(WW,FP,1,0,5,1)}function rke(){rke=C,QVt=V(WW,FP,1,0,5,1)}function Cf(){Cf=C,$Vt=V(WW,FP,1,0,5,1)}function wf(){wf=C,new mge((Vg(),Vg(),QG))}function ike(e){return Sb(),iS((TGe(),dEt),e)}function ake(e){return Zw(),iS((MWe(),vEt),e)}function oke(e){return fO(),iS((wHe(),DEt),e)}function ske(e){return dx(),iS((THe(),OEt),e)}function cke(e){return vM(),iS((CXe(),kEt),e)}function lke(e){return Ix(),iS((AWe(),MEt),e)}function uke(e){return Cb(),iS((kWe(),PEt),e)}function dke(e){return Xb(),iS((jWe(),LEt),e)}function fke(e){return SP(),iS((uCe(),oDt),e)}function pke(e){return KC(),iS((DGe(),cDt),e)}function mke(e){return TO(),iS((kGe(),uDt),e)}function hke(e){return wO(),iS((OGe(),mDt),e)}function gke(e){return No(),iS((VBe(),hDt),e)}function _ke(e){return fx(),iS((EHe(),NDt),e)}function vke(e){return Yb(),iS((NWe(),aOt),e)}function yke(e){return vA(),iS((PKe(),lOt),e)}function bke(e){return ow(),iS((jGe(),hOt),e)}function xke(e){return YD(),iS((AGe(),xOt),e)}function Tf(e,t){if(!e)throw E(new Fi(t))}function Ef(e){if(!e)throw E(new Ii(Wvt))}function Df(e,t){if(e!=t)throw E(new Vr)}function Ske(e,t,n){this.a=e,this.b=t,this.c=n}function Of(e,t,n){this.a=e,this.b=t,this.c=n}function Cke(e,t,n){this.a=e,this.b=t,this.c=n}function kf(e,t,n){this.b=e,this.a=t,this.c=n}function Af(e,t,n){this.b=e,this.c=t,this.a=n}function jf(e,t,n){this.a=e,this.b=t,this.c=n}function Mf(e,t,n){this.e=t,this.b=e,this.d=n}function wke(e,t,n){this.b=e,this.a=t,this.c=n}function Tke(e,t,n){return wo(),e.a.Yd(t,n),t}function Nf(e){var t=new Ze;return t.e=e,t}function Pf(e){var t=new Hge;return t.b=e,t}function Ff(){Ff=C,oY=new vte,sY=new yte}function If(){If=C,ROt=new Kte,LOt=new qte}function Lf(){Lf=C,UOt=new tre,WOt=new nre}function Eke(e){return kS(),iS((uWe(),ekt),e)}function Dke(e){return yP(),iS((dCe(),NOt),e)}function Oke(e){return iw(),iS((NGe(),IOt),e)}function kke(e){return aw(),iS((MGe(),qOt),e)}function Ake(e){return tA(),iS((FKe(),YOt),e)}function jke(e){return dM(),iS((KYe(),tkt),e)}function Mke(e){return GA(),iS((Eqe(),nkt),e)}function Nke(e){return Ky(),iS((NHe(),rkt),e)}function Pke(e){return bS(),iS((cWe(),ikt),e)}function Fke(e){return lS(),iS((lWe(),akt),e)}function Ike(e){return FD(),iS((IKe(),okt),e)}function Lke(e){return px(),iS((kHe(),skt),e)}function Rke(e){return TA(),iS((kqe(),pkt),e)}function zke(e){return uM(),iS((gZe(),mkt),e)}function Bke(e){return qC(),iS((fWe(),hkt),e)}function Vke(e){return Zb(),iS((pWe(),_kt),e)}function Hke(e){return Bv(),iS((OHe(),vkt),e)}function Uke(e){return qk(),iS((Oqe(),fkt),e)}function Wke(e){return _w(),iS((dWe(),lkt),e)}function Gke(e){return kA(),iS((Dqe(),ukt),e)}function Kke(e){return wb(),iS((AHe(),dkt),e)}function qke(e){return XE(),iS((RKe(),ykt),e)}function Jke(e){return Zj(),iS((bXe(),MMt),e)}function Yke(e){return hT(),iS((mWe(),FMt),e)}function Xke(e){return IO(),iS((PGe(),IMt),e)}function Zke(e){return CO(),iS((LKe(),zMt),e)}function Qke(e){return FM(),iS((_Ze(),GMt),e)}function $ke(e){return ID(),iS((FGe(),JMt),e)}function eAe(e){return Qb(),iS((jHe(),XMt),e)}function tAe(e){return uS(),iS((_We(),QMt),e)}function nAe(e){return CC(),iS((hWe(),nNt),e)}function rAe(e){return Nw(),iS((gWe(),iNt),e)}function iAe(e){return Xw(),iS((vWe(),sNt),e)}function aAe(e){return cS(),iS((yWe(),dNt),e)}function oAe(e){return sw(),iS((bWe(),pNt),e)}function sAe(e){return sS(),iS((OWe(),jNt),e)}function cAe(e){return Vv(),iS((MHe(),RNt),e)}function lAe(e){return O_(),iS((IHe(),qNt),e)}function uAe(e){return k_(),iS((LHe(),YNt),e)}function dAe(e){return Wy(),iS((RHe(),dPt),e)}function fAe(e){return D_(),iS((zHe(),vPt),e)}function pAe(e){return Ok(),iS((YGe(),bPt),e)}function mAe(e){return LM(),iS((fCe(),NPt),e)}function hAe(e){return Pw(),iS((xWe(),IPt),e)}function gAe(e){return Jw(),iS((JGe(),TFt),e)}function _Ae(e){return iv(),iS((PHe(),OFt),e)}function vAe(e){return AS(),iS((FHe(),PFt),e)}function yAe(e){return iA(),iS((zKe(),IFt),e)}function bAe(e){return Yw(),iS((SWe(),UFt),e)}function xAe(e){return _b(),iS((BHe(),zFt),e)}function SAe(e){return uk(),iS((qGe(),wIt),e)}function CAe(e){return SC(),iS((CWe(),OIt),e)}function wAe(e){return ED(),iS((wWe(),AIt),e)}function TAe(e){return LO(),iS((TWe(),MIt),e)}function EAe(e){return TE(),iS((EWe(),RIt),e)}function DAe(e){return my(),iS((VHe(),xLt),e)}function OAe(e){return dC(),iS((DHe(),AOt),e)}function kAe(e){return DA(),iS((Aqe(),TOt),e)}function AAe(e){return Tb(),iS((DWe(),TLt),e)}function jAe(e){return JC(),iS((HHe(),kLt),e)}function MAe(e){return Wj(),iS((BKe(),MLt),e)}function NAe(e){return Bo(),iS((sVe(),FLt),e)}function PAe(e){return KT(),iS((FWe(),NLt),e)}function FAe(e){return Vo(),iS((cVe(),LLt),e)}function IAe(e){return Gy(),iS((UHe(),zLt),e)}function LAe(e){return MA(),iS((VKe(),WLt),e)}function RAe(e){return Ho(),iS((lVe(),SRt),e)}function zAe(e){return cw(),iS((WHe(),TRt),e)}function BAe(e){return uO(),iS((UKe(),FRt),e)}function VAe(e){return VA(),iS((WYe(),RRt),e)}function HAe(e){return RO(),iS((jqe(),HRt),e)}function UAe(e){return eA(),iS((Mqe(),ezt),e)}function WAe(e){return GT(),iS((HKe(),nBt),e)}function GAe(e){return Lx(),iS((IWe(),iBt),e)}function KAe(e){return wE(),iS((XGe(),aBt),e)}function qAe(e){return hA(),iS((Nqe(),fBt),e)}function JAe(e){return _T(),iS((PWe(),bBt),e)}function YAe(e){return kk(),iS((ZGe(),SBt),e)}function XAe(e){return Ej(),iS((SXe(),CBt),e)}function ZAe(e){return pO(),iS((WKe(),EBt),e)}function QAe(e){return rA(),iS((Pqe(),OBt),e)}function $Ae(e){return rj(),iS((Fqe(),kBt),e)}function eje(e){return nP(),iS((GKe(),ABt),e)}function tje(e){return TD(),iS((QGe(),IBt),e)}function nje(e){return UM(),iS((xXe(),RBt),e)}function rje(e){return gT(),iS((LWe(),VBt),e)}function ije(e,t){return Gh(e),e+(Gh(t),t)}function aje(e){return zf(),iS((GHe(),WBt),e)}function oje(e){return ZE(),iS(($Ge(),YBt),e)}function sje(e){return Mw(),iS((eKe(),tVt),e)}function Rf(){Rf=C,PNt=(nP(),g5),v2=X8}function zf(){zf=C,HBt=new AMe,UBt=new cPe}function cje(e){return!e.e&&(e.e=new T),e.e}function Bf(e,t){this.c=e,this.a=t,this.b=t-e}function lje(e,t,n){this.a=e,this.b=t,this.c=n}function Vf(e,t,n){this.a=e,this.b=t,this.c=n}function Hf(e,t,n){this.a=e,this.b=t,this.c=n}function Uf(e,t,n){this.a=e,this.b=t,this.c=n}function uje(e,t,n){this.a=e,this.b=t,this.c=n}function dje(e,t,n){this.a=e,this.b=t,this.c=n}function Wf(e,t,n){this.e=e,this.a=t,this.c=n}function fje(e,t,n){du(),ILe.call(this,e,t,n)}function Gf(e,t,n){du(),Ph.call(this,e,t,n)}function pje(e,t,n){du(),Ph.call(this,e,t,n)}function mje(e,t,n){du(),Ph.call(this,e,t,n)}function hje(e,t,n){du(),Gf.call(this,e,t,n)}function gje(e,t,n){du(),Gf.call(this,e,t,n)}function _je(e,t,n){du(),gje.call(this,e,t,n)}function vje(e,t,n){du(),pje.call(this,e,t,n)}function yje(e,t,n){du(),mje.call(this,e,t,n)}function Kf(e){Np.call(this,e.d,e.c,e.a,e.b)}function bje(e){Np.call(this,e.d,e.c,e.a,e.b)}function xje(e){this.d=e,wfe(this),this.b=FNe(e.d)}function Sje(e){return Sj(),iS((GYe(),bVt),e)}function qf(e,t){return ph(e),ph(t),new Hye(e,t)}function Jf(e,t){return ph(e),ph(t),new oMe(e,t)}function Cje(e,t){return ph(e),ph(t),new sMe(e,t)}function wje(e,t){return ph(e),ph(t),new Qye(e,t)}function Yf(e){return jd(e.b!=0),Ox(e,e.a.a)}function Tje(e){return jd(e.b!=0),Ox(e,e.c.b)}function Eje(e){return!e.c&&(e.c=new ln),e.c}function Xf(e){var t=new T;return rx(t,e),t}function Dje(e){var t=new Jr;return rx(t,e),t}function Oje(e){var t=new Nge;return HS(t,e),t}function Zf(e){var t=new vo;return HS(t,e),t}function P(e,t){return bp(e==null||kO(e,t)),e}function kje(e,t,n){WNe.call(this,t,n),this.a=e}function Aje(e,t){this.c=e,this.b=t,this.a=!1}function jje(){this.a=`;,;`,this.b=``,this.c=``}function Mje(e,t,n){this.b=e,aCe.call(this,t,n)}function Nje(e,t,n){this.c=e,ds.call(this,t,n)}function Pje(e,t,n){js.call(this,e,t),this.b=n}function Fje(e,t,n){art(n,0,e,t,n.length,!1)}function Qf(e,t,n,r,i){e.b=t,e.c=n,e.d=r,e.a=i}function Ije(e,t,n,r,i){e.d=t,e.c=n,e.a=r,e.b=i}function Lje(e,t){t&&(e.b=t,e.a=(Hh(t),t.a))}function $f(e,t){if(!e)throw E(new Fi(t))}function ep(e,t){if(!e)throw E(new Ii(t))}function Rje(e,t){if(!e)throw E(new ove(t))}function zje(e,t){return Ro(),_u(e.d.p,t.d.p)}function Bje(e,t){return zx(),aE(e.e.b,t.e.b)}function Vje(e,t){return zx(),aE(e.e.a,t.e.a)}function Hje(e,t){return _u(bMe(e.d),bMe(t.d))}function tp(e,t){return t&&Lh(e,t.d)?t:null}function Uje(e,t){return t==(nP(),g5)?e.c:e.d}function Wje(e){return MC(gPe(Il(e)?zC(e):e))}function Gje(e){return new k(e.c+e.b,e.d+e.a)}function Kje(e){return e!=null&&!zE(e,y7,b7)}function qje(e,t){return(R$e(e)<<4|R$e(t))&OF}function Jje(e,t,n,r,i){e.c=t,e.d=n,e.b=r,e.a=i}function Yje(e){var t=e.b;e.b=e.c,e.c=t}function Xje(e){var t,n=e.d;t=e.a,e.d=t,e.a=n}function Zje(e,t){var n=e.c;return PJe(e,t),n}function Qje(e,t){return e.g=t<0?-1:t,e}function np(e,t){return bqe(e),e.a*=t,e.b*=t,e}function $je(e,t,n){pqe.call(this,t,n),this.d=e}function rp(e,t,n){el.call(this,e,t),this.c=n}function ip(e,t,n){el.call(this,e,t),this.c=n}function eMe(e){Cf(),sn.call(this),this.ci(e)}function tMe(){By(),uFe.call(this,(qo(),N7))}function nMe(e){return xP(),++W9,new zp(0,e)}function rMe(){rMe=C,f9=(Vg(),new Gn(xW))}function ap(){ap=C,new FO((mi(),ZW),(pi(),XW))}function iMe(){iMe=C,OG=V(DG,X,17,256,0,1)}function aMe(){this.b=D(N(hO((XM(),eJ))))}function op(e){this.b=e,this.a=am(this.b.a).Od()}function oMe(e,t){this.b=e,this.a=t,dn.call(this)}function sMe(e,t){this.a=e,this.b=t,dn.call(this)}function cMe(e,t,n){this.a=e,El.call(this,t,n)}function lMe(e,t,n){this.a=e,El.call(this,t,n)}function sp(e,t,n){hx(e,t,new mh(n))}function uMe(e,t,n){var r=e[t];return e[t]=n,r}function cp(e){return yb(e.slice(),e)}function lp(e){var t=e.n;return e.a.b+t.d+t.a}function dMe(e){var t=e.n;return e.e.b+t.d+t.a}function fMe(e){var t=e.n;return e.e.a+t.b+t.c}function pMe(e){e.a.b=e.b,e.b.a=e.a,e.a=e.b=null}function up(e,t){return iy(e,t,e.c.b,e.c),!0}function mMe(e){return e.a?e.a:xg(e)}function hMe(e){return Ug(),xA(e)==I_(SA(e))}function gMe(e){return Ug(),SA(e)==I_(xA(e))}function dp(e,t){return Bk(e,new js(t.a,t.b))}function _Me(e,t){return eg(),ik(e,t),new jFe(e,t)}function vMe(e,t){return e.c=t)throw E(new e_e)}function _m(e,t){return MT(e,(Gh(t),new jfe(t)))}function vm(e,t){return MT(e,(Gh(t),new Mfe(t)))}function XNe(e,t,n){return kvt(e,P(t,12),P(n,12))}function ZNe(e){return fC(),P(e,12).g.c.length!=0}function QNe(e){return fC(),P(e,12).e.c.length!=0}function $Ne(e,t){return cC(),aE(t.a.o.a,e.a.o.a)}function ePe(e,t){(t.Bb&GH)!=0&&!e.a.o&&(e.a.o=t)}function tPe(e,t){t.Ug(`General 'Rotator`,1),vgt(e)}function nPe(e,t,n){t.qf(n,D(N(xh(e.b,n)))*e.a)}function rPe(e,t,n){return fM(),_C(e,t)&&_C(e,n)}function ym(e){return rj(),!e.Hc(G8)&&!e.Hc(q8)}function iPe(e){return e.e?$Ue(e.e):null}function bm(e){return Il(e)?``+e:Ect(e)}function aPe(e){for(var t=e;t.f;)t=t.f;return t}function oPe(e,t,n){return Sh(t,0,Op(t[0],n[0])),t}function xm(e,t,n,r){var i=e.i;i.i=t,i.a=n,i.b=r}function F(e,t,n,r){ju.call(this,e,t,n),this.b=r}function Sm(e,t,n,r,i){ub.call(this,e,t,n,r,i,-1)}function Cm(e,t,n,r,i){db.call(this,e,t,n,r,i,-1)}function wm(e,t,n,r){rp.call(this,e,t,n),this.b=r}function sPe(e){zSe.call(this,e,!1),this.a=!1}function cPe(){vSe.call(this,`LOOKAHEAD_LAYOUT`,1)}function lPe(e){this.b=e,cd.call(this,e),CTe(this)}function uPe(e){this.b=e,ud.call(this,e),wTe(this)}function Tm(e,t,n){this.a=e,nf.call(this,t,n,5,6)}function dPe(e,t,n,r){this.b=e,ju.call(this,t,n,r)}function fPe(e,t){this.b=e,_de.call(this,e.b),this.a=t}function pPe(e){this.a=m4e(e.a),this.b=new bf(e.b)}function mPe(e,t){gh(),rbe.call(this,e,bT(new Wi(t)))}function Em(e,t){return xP(),++W9,new Nh(e,t,0)}function Dm(e,t){return xP(),++W9,new Nh(6,e,t)}function Om(e,t){for(Gh(t);e.Ob();)t.Cd(e.Pb())}function km(e,t){return rl(t)?e_(e,t):!!Kp(e.f,t)}function Am(e,t){return t.Vh()?pT(e.b,P(t,54)):t}function hPe(e,t){return ff(e.substr(0,t.length),t)}function jm(e){return new pm(new ATe(e.a.length,e.a))}function Mm(e){return new k(e.c+e.b/2,e.d+e.a/2)}function gPe(e){return vu(~e.l&QF,~e.m&QF,~e.h&$F)}function Nm(e){return typeof e===EP||typeof e===kP}function Pm(e){e.f=new PCe(e),e.i=new FCe(e),++e.g}function _Pe(e){if(!e)throw E(new Hr);return e.d}function Fm(e){var t=yw(e);return jd(t!=null),t}function vPe(e){var t=u1e(e);return jd(t!=null),t}function Im(e,t){var n=e.a.gc();return RUe(t,n),n-t}function Lm(e,t){return e.a.zc(t,e)==null}function Rm(e,t){return e.a.zc(t,(rd(),vG))==null}function yPe(e){return new Mp(null,OPe(e,e.length))}function bPe(e,t,n){return ypt(e,P(t,42),P(n,176))}function zm(e,t,n){return PS(e.a,t),uMe(e.b,t.g,n)}function xPe(e,t,n){gm(n,e.a.c.length),uy(e.a,n,t)}function I(e,t,n,r){TQe(t,n,e.length),SPe(e,t,n,r)}function SPe(e,t,n,r){var i;for(i=t;i0?r.Math.log(e/t):-100}function DPe(e,t){return dT(e,t)<0?-1:+(dT(e,t)>0)}function qm(e,t){Kwe(e,j(t,160)?t:P(t,2036).Rl())}function Jm(e,t){if(e==null)throw E(new Li(t))}function OPe(e,t){return gqe(t,e.length),new kMe(e,t)}function Ym(e,t){return t?XS(e,t):!1}function kPe(){return xi(),U(O(MTt,1),Z,549,0,[tG])}function Xm(e){return e.e==0?e:new Bm(-e.e,e.d,e.a)}function APe(e,t){return aE(e.c.c+e.c.b,t.c.c+t.c.b)}function Zm(e,t){iy(e.d,t,e.b.b,e.b),++e.a,e.c=null}function jPe(e,t){return e.c?jPe(e.c,t):M(e.b,t),e}function MPe(e,t,n){var r=ax(e,t);return Yv(e,t,n),r}function NPe(e,t,n){var r;for(r=0;r=e.g}function Sh(e,t,n){return cDe(n==null||mdt(e,n)),e[t]=n}function Ch(e,t){return sv(t,e.length+1),e.substr(t)}function wh(e,t){for(Gh(t);e.c=e?new _be:RJe(e-1)}function Bh(e){return!e.a&&e.c?e.c.b:e.a}function Vh(e){return j(e,616)?e:new KLe(e)}function Hh(e){e.c?Hh(e.c):(lE(e),e.d=!0)}function Uh(e){e.c?e.c.$e():(e.d=!0,bot(e))}function _Fe(e){e.b=!1,e.c=!1,e.d=!1,e.a=!1}function vFe(e){return e.c.i.c==e.d.i.c}function yFe(e,t){var n=e.Ih(t);n>=0?e.ki(n):Qtt(e,t)}function bFe(e,t){e.c<0||e.b.b0;)e=e<<1|e<0;return e}function BFe(e,t){var n=new Eh(e);return Mr(t.c,n),n}function VFe(e,t){e.u.Hc((rj(),G8))&&bnt(e,t),RWe(e,t)}function rg(e,t){return A(e)===A(t)||e!=null&&NT(e,t)}function ig(e,t){return Gp(e.a,t)?e.b[P(t,22).g]:null}function HFe(){return No(),U(O(Oq,1),Z,489,0,[Dq])}function UFe(){return Bo(),U(O(PLt,1),Z,490,0,[v3])}function WFe(){return Vo(),U(O(ILt,1),Z,558,0,[y3])}function GFe(){return Ho(),U(O(xRt,1),Z,539,0,[O3])}function ag(e){return!e.n&&(e.n=new F(Q5,e,1,7)),e.n}function og(e){return!e.c&&(e.c=new F(e7,e,9,9)),e.c}function sg(e){return!e.c&&(e.c=new cf(H5,e,5,8)),e.c}function KFe(e){return!e.b&&(e.b=new cf(H5,e,4,7)),e.b}function cg(e){return e.j.c.length=0,yg(e.c),gOe(e.a),e}function lg(e){return e.e==SW&&gfe(e,p2e(e.g,e.b)),e.e}function ug(e){return e.f==SW&&vfe(e,O6e(e.g,e.b)),e.f}function dg(e,t,n,r){return lXe(e,t,n,!1),LT(e,r),e}function qFe(e,t){this.b=e,Hm.call(this,e,t),CTe(this)}function JFe(e,t){this.b=e,LOe.call(this,e,t),wTe(this)}function fg(e){this.d=e,this.a=this.d.b,this.b=this.d.c}function pg(e,t){this.b=e,this.c=t,this.a=new _o(this.b)}function mg(e,t){return sv(t,e.length),e.charCodeAt(t)}function YFe(e,t){fE(e,D(nS(t,`x`)),D(nS(t,`y`)))}function XFe(e,t){fE(e,D(nS(t,`x`)),D(nS(t,`y`)))}function hg(e,t){return lE(e),new Mp(e,new UGe(t,e.a))}function gg(e,t){return lE(e),new Mp(e,new WUe(t,e.a))}function _g(e,t){return lE(e),new fDe(e,new HUe(t,e.a))}function vg(e,t){return lE(e),new pDe(e,new UUe(t,e.a))}function ZFe(e,t){return new VIe(P(ph(e),50),P(ph(t),50))}function QFe(e,t){return aE(e.d.c+e.d.b/2,t.d.c+t.d.b/2)}function $Fe(e,t,n){n.a?Kx(e,t.b-e.f/2):Gx(e,t.a-e.g/2)}function eIe(e,t){return aE(e.g.c+e.g.b/2,t.g.c+t.g.b/2)}function tIe(e,t){return Pbe(),aE((Gh(e),e),(Gh(t),t))}function nIe(e){return e!=null&&po(x7,e.toLowerCase())}function yg(e){var t;for(t=e.Kc();t.Ob();)t.Pb(),t.Qb()}function bg(e){var t=e.b;return!t&&(e.b=t=new lde(e)),t}function xg(e){return HJe(e)||null}function rIe(e,t){var n=e/t,r=C_(n);return n>r&&++r,r}function iIe(e,t,n){var r=P(e.d.Kb(n),159);r&&r.Nb(t)}function aIe(e,t,n){gpt(e.a,n),PXe(n),sit(e.b,n),Wpt(t,n)}function Sg(e,t,n,r){this.a=e,this.c=t,this.b=n,this.d=r}function Cg(e,t,n,r){this.c=e,this.b=t,this.a=n,this.d=r}function oIe(e,t,n,r){this.c=e,this.b=t,this.d=n,this.a=r}function wg(e,t,n,r){this.c=e,this.d=t,this.b=n,this.a=r}function sIe(e,t,n,r){this.a=e,this.d=t,this.c=n,this.b=r}function Tg(e,t,n,r){this.a=e,this.e=t,this.d=n,this.c=r}function cIe(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function Eg(e,t,n){this.a=ryt,this.d=e,this.b=t,this.c=n}function Dg(e,t,n,r){so.call(this,e,t),this.a=n,this.b=r}function lIe(e,t){this.d=(Gh(e),e),this.a=16449,this.c=t}function uIe(e){this.a=new T,this.e=V(q9,X,53,e,0,2)}function dIe(e){e.Ug(`No crossing minimization`,1),e.Vg()}function fIe(){yi.call(this,`There is no more element.`)}function pIe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function mIe(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function Og(e,t,n,r){this.e=e,this.a=t,this.c=n,this.d=r}function hIe(e,t,n,r){this.a=e,this.c=t,this.d=n,this.b=r}function gIe(e,t,n,r){du(),GUe.call(this,t,n,r),this.a=e}function _Ie(e,t,n,r){du(),GUe.call(this,t,n,r),this.a=e}function kg(e,t,n){var r=n_t(e);return t.ti(n,r)}function Ag(e){var t,n=(t=new kr,t);return Nx(n,e),n}function jg(e){var t,n=(t=new kr,t);return i9e(n,e),n}function vIe(e,t){return yC(t,xh(e.f,t)),null}function yIe(e){return!e.b&&(e.b=new F(U5,e,12,3)),e.b}function bIe(e){return bp(e==null||Nm(e)&&e.Tm!==ne),e}function Mg(e){return e.n&&(e.e!==eyt&&e.je(),e.j=null),e}function Ng(e){if(RE(e.d),e.d.d!=e.c)throw E(new Vr)}function Pg(e){return jd(e.b0&&d8e(this)}function xIe(e,t){this.a=e,dDe.call(this,e,P(e.d,15).fd(t))}function SIe(e,t){return aE(Lp(e)*Ip(e),Lp(t)*Ip(t))}function CIe(e,t){return aE(Lp(e)*Ip(e),Lp(t)*Ip(t))}function wIe(e){return uj(e)&&ki(Od(J(e,(mP(),A1))))}function TIe(e,t){return fj(e,P(K(t,(mP(),Y1)),17),t)}function EIe(e,t){return P(K(e,(Y(),PQ)),15).Fc(t),t}function Lg(e,t){return e.b=t.b,e.c=t.c,e.d=t.d,e.a=t.a,e}function DIe(e,t,n,r){this.b=e,this.c=r,vl.call(this,t,n)}function OIe(e,t,n){e.i=0,e.e=0,t!=n&&RZe(e,t,n)}function kIe(e,t,n){e.i=0,e.e=0,t!=n&&zZe(e,t,n)}function AIe(e,t,n){return Lo(),N1e(P(xh(e.e,t),529),n)}function Rg(e){var t;return t=e.f,t||(e.f=new io(e,e.c))}function jIe(e,t){return CT(e.j,t.s,t.c)+CT(t.e,e.s,e.c)}function MIe(e,t){e.e&&!e.e.a&&(Qhe(e.e,t),MIe(e.e,t))}function NIe(e,t){e.d&&!e.d.a&&(Qhe(e.d,t),NIe(e.d,t))}function PIe(e,t){return-aE(Lp(e)*Ip(e),Lp(t)*Ip(t))}function FIe(e){return P(e.ld(),149).Pg()+`:`+PE(e.md())}function IIe(){EA(this,new $ue),this.wb=(vh(),z7),Ra()}function LIe(e){this.b=new T,nw(this.b,this.b),this.a=e}function zg(e,t){new vo,this.a=new ai,this.b=e,this.c=t}function Bg(){Bg=C,nK=new ue,rK=new ue,iK=new de}function Vg(){Vg=C,QG=new ae,$G=new se,eK=new ce}function Hg(){Hg=C,wEt=new Ge,EEt=new yNe,TEt=new Ke}function Ug(){Ug=C,zq=new T,Rq=new Dr,Lq=new T}function Wg(e,t){if(e==null)throw E(new Li(t));return e}function Gg(e){return!e.a&&(e.a=new F($5,e,10,11)),e.a}function Kg(e){return!e.q&&(e.q=new F(M7,e,11,10)),e.q}function R(e){return!e.s&&(e.s=new F(w7,e,21,17)),e.s}function RIe(e){return ph(e),z4e(new pm(Vu(e.a.Kc(),new d)))}function zIe(e,t){return $w(e),$w(t),eve(P(e,22),P(t,22))}function qg(e,t,n){hx(e,t,new Cn(ZOe(n)))}function Jg(e,t,n,r,i,a){db.call(this,e,t,n,r,i,a?-2:-1)}function BIe(e,t,n,r){el.call(this,t,n),this.b=e,this.a=r}function VIe(e,t){F_e.call(this,new mm(e)),this.a=e,this.b=t}function Yg(e){this.b=e,this.c=e,e.e=null,e.c=null,this.a=1}function HIe(e){Lf();var t=P(e.g,10);t.n.a=e.d.c+t.d.b}function Xg(){Xg=C;var e,t=!L0e();e=new b,lG=t?new y:e}function Zg(e){return Vg(),j(e,59)?new sa(e):new qu(e)}function Qg(e){return j(e,16)?new jp(P(e,16)):Dje(e.Kc())}function UIe(e){return new DTe(e,e.e.Rd().gc()*e.c.Rd().gc())}function WIe(e){return new OTe(e,e.e.Rd().gc()*e.c.Rd().gc())}function $g(e){return e&&e.hashCode?e.hashCode():td(e)}function e_(e,t){return t==null?!!Kp(e.f,null):dNe(e.i,t)}function GIe(e,t){var n=Gwe(e.a,t);return n&&(t.d=null),n}function KIe(e,t,n){return e.f?e.f.ef(t,n):!1}function t_(e,t,n,r){Sh(e.c[t.g],n.g,r),Sh(e.c[n.g],t.g,r)}function n_(e,t,n,r){Sh(e.c[t.g],t.g,n),Sh(e.b[t.g],t.g,r)}function qIe(e,t,n){return D(N(n.a))<=e&&D(N(n.b))>=t}function JIe(e,t){this.g=e,this.d=U(O(UJ,1),jR,10,0,[t])}function YIe(e){this.c=e,this.b=new Ja(P(ph(new qe),50))}function XIe(e){this.c=e,this.b=new Ja(P(ph(new dee),50))}function ZIe(e){this.b=e,this.a=new Ja(P(ph(new At),50))}function QIe(){this.b=new Jr,this.d=new vo,this.e=new $r}function r_(){this.c=new Fa,this.d=new Fa,this.e=new Fa}function i_(){this.a=new ai,this.b=(vS(3,hF),new Hy(3))}function a_(e,t){this.e=e,this.a=WW,this.b=glt(t),this.c=t}function o_(e){this.c=e.c,this.d=e.d,this.b=e.b,this.a=e.a}function $Ie(e,t,n,r,i,a){this.a=e,xS.call(this,t,n,r,i,a)}function eLe(e,t,n,r,i,a){this.a=e,xS.call(this,t,n,r,i,a)}function s_(e,t,n,r,i,a,o){return new ey(e.e,t,n,r,i,a,o)}function tLe(e,t,n){return n>=0&&ff(e.substr(n,t.length),t)}function nLe(e,t){return j(t,149)&&ff(e.b,P(t,149).Pg())}function rLe(e,t){return e.a?t.Gh().Kc():P(t.Gh(),71).Ii()}function iLe(e,t){var n=e.b.Qc(t);return bHe(n,e.b.gc()),n}function c_(e,t){if(e==null)throw E(new Li(t));return e}function l_(e){return e.u||=(_y(e),new FDe(e,e)),e.u}function u_(e){this.a=(Vg(),j(e,59)?new sa(e):new qu(e))}function d_(e){return P(NC(e,16),29)||e.ii()}function f_(e,t){var n=Ha(e.Rm);return t==null?n:n+`: `+t}function p_(e,t,n){return Zy(t,n,e.length),e.substr(t,n-t)}function aLe(e,t){Qd.call(this),Px(this),this.a=e,this.c=t}function oLe(e){!e||f_(e,e.ie())}function sLe(e){Qi(),r.setTimeout(function(){throw e},0)}function cLe(){return fO(),U(O(DK,1),Z,436,0,[EK,TK])}function lLe(){return dx(),U(O(AK,1),Z,435,0,[OK,kK])}function uLe(){return fx(),U(O(Uq,1),Z,432,0,[Vq,Hq])}function dLe(){return dC(),U(O(kOt,1),Z,517,0,[aY,iY])}function fLe(){return Bv(),U(O(lQ,1),Z,429,0,[sQ,cQ])}function pLe(){return px(),U(O(hZ,1),Z,428,0,[pZ,mZ])}function mLe(){return Ky(),U(O(QX,1),Z,431,0,[XX,ZX])}function hLe(){return Qb(),U(O(YMt,1),Z,430,0,[e2,t2])}function gLe(){return Vv(),U(O(LNt,1),Z,531,0,[b2,y2])}function _Le(){return AS(),U(O(NFt,1),Z,501,0,[b4,x4])}function vLe(){return O_(),U(O(KNt,1),Z,523,0,[w2,C2])}function yLe(){return k_(),U(O(JNt,1),Z,522,0,[T2,E2])}function bLe(){return Wy(),U(O(uPt,1),Z,528,0,[A2,k2])}function xLe(){return wb(),U(O(OZ,1),Z,488,0,[DZ,EZ])}function SLe(){return my(),U(O(bLt,1),Z,491,0,[s3,yLt])}function CLe(){return JC(),U(O(OLt,1),Z,492,0,[ELt,DLt])}function wLe(){return iv(),U(O(DFt,1),Z,433,0,[v4,EFt])}function TLe(){return _b(),U(O(RFt,1),Z,434,0,[LFt,D4])}function ELe(){return D_(),U(O(_Pt,1),Z,465,0,[j2,M2])}function DLe(){return Gy(),U(O(RLt,1),Z,438,0,[x3,b3])}function OLe(){return cw(),U(O(wRt,1),Z,437,0,[k3,CRt])}function kLe(){return zf(),U(O(P5,1),Z,347,0,[HBt,UBt])}function m_(e,t,n,r){return n>=0?e.Uh(t,n,r):e.Ch(null,n,r)}function h_(e){return e.b.b==0?e.a.sf():Yf(e.b)}function ALe(e){if(e.p!=5)throw E(new Rr);return nm(e.f)}function jLe(e){if(e.p!=5)throw E(new Rr);return nm(e.k)}function MLe(e){return A(e.a)===A((uC(),r9))&&bmt(e),e.a}function NLe(e,t){e.b=t,e.c>0&&e.b>0&&(e.g=Pp(e.c,e.b,e.a))}function PLe(e,t){e.c=t,e.c>0&&e.b>0&&(e.g=Pp(e.c,e.b,e.a))}function FLe(e,t){Qde(this,new k(e.a,e.b)),$de(this,Zf(t))}function g_(){I_e.call(this,new go(xx(12))),vTe(!0),this.a=2}function __(e,t,n){xP(),Tr.call(this,e),this.b=t,this.a=n}function ILe(e,t,n){du(),xr.call(this,t),this.a=e,this.b=n}function LLe(e){var t=e.c.d.b;e.b=t,e.a=e.c.d,t.a=e.c.d.b=e}function RLe(e){return e.b==0?null:(jd(e.b!=0),Ox(e,e.a.a))}function v_(e,t){return t==null?nl(Kp(e.f,null)):as(e.i,t)}function zLe(e,t,n,r,i){return new IA(e,(Sb(),fK),t,n,r,i)}function y_(e,t){return dHe(t),eJe(e,V(q9,HF,28,t,15,1),t)}function b_(e,t){return Wg(e,`set1`),Wg(t,`set2`),new ibe(e,t)}function BLe(e,t){return aG[e.charCodeAt(0)]??e}function VLe(e,t){var n=t,r=new ve;return Aht(e,n,r),r.d}function x_(e,t,n,r){var i=new QDe;t.a[n.g]=i,zm(e.b,r,i)}function HLe(e,t){return $d(Cd(Bqe(e.f,t)),e.f.d)}function S_(e){var t;xJe(e.a),owe(e.a),t=new ar(e.a),KE(t)}function ULe(e,t){Uct(e,!0),Dx(e.e.Rf(),new Af(e,!0,t))}function WLe(e,t){return Ug(),e==I_(xA(t))||e==I_(SA(t))}function GLe(e,t){return zx(),P(K(t,(rN(),p4)),17).a==e}function C_(e){return Math.max(Math.min(e,AP),-2147483648)|0}function KLe(e){this.a=P(ph(e),277),this.b=(Vg(),new UTe(e))}function qLe(e,t,n){this.i=new T,this.b=e,this.g=t,this.a=n}function JLe(e,t,n){this.a=new T,this.e=e,this.f=t,this.c=n}function w_(e,t,n){this.c=new T,this.e=e,this.f=t,this.b=n}function YLe(e){Qd.call(this),Px(this),this.a=e,this.c=!0}function XLe(e){function t(){}return t.prototype=e||{},new t}function ZLe(e){if(e.Ae())return null;var t=e.n;return UW[t]}function T_(e){return e.Db>>16==3?P(e.Cb,27):null}function E_(e){return e.Db>>16==9?P(e.Cb,27):null}function QLe(e){return e.Db>>16==6?P(e.Cb,74):null}function D_(){D_=C,j2=new rSe(cL,0),M2=new rSe(lL,1)}function O_(){O_=C,w2=new Uxe(lL,0),C2=new Uxe(cL,1)}function k_(){k_=C,T2=new Wxe(hL,0),E2=new Wxe(`UP`,1)}function $Le(){$Le=C,NTt=nT((xi(),U(O(MTt,1),Z,549,0,[tG])))}function eRe(e){var t=new qa(xx(e.length));return wZe(t,e),t}function tRe(e,t){return e.b+=t.b,e.c+=t.c,e.d+=t.d,e.a+=t.a,e}function nRe(e,t){return IXe(e,t)?(oJe(e),!0):!1}function A_(e,t){if(t==null)throw E(new zr);return K0e(e,t)}function j_(e,t){var n=e.q.getHours();e.q.setDate(t),dN(e,n)}function rRe(e,t,n){var r=e.Ih(t);r>=0?e.bi(r,n):Pat(e,t,n)}function iRe(e,t){var n=e.Ih(t);return n>=0?e.Wh(n):cj(e,t)}function aRe(e,t){var n;for(ph(t),n=e.a;n;n=n.c)t.Yd(n.g,n.i)}function M_(e,t,n){e.b=new VS(kZe(e,t,n).c.length)}function N_(e,t,n){R_(),e&&Qh(p7,e,t),e&&Qh(f7,e,n)}function oRe(e,t){return If(),rd(),P(t.a,17).a0}function lRe(e){var t=e.d;return t=e.bj(e.f),tb(e,t),t.Ob()}function uRe(e,t){var n=new Ap(t);return L7e(n,e),new bf(n)}function dRe(e){if(e.p!=0)throw E(new Rr);return cl(e.f,0)}function fRe(e){if(e.p!=0)throw E(new Rr);return cl(e.k,0)}function pRe(e){return e.Db>>16==7?P(e.Cb,241):null}function F_(e){return e.Db>>16==6?P(e.Cb,241):null}function mRe(e){return e.Db>>16==7?P(e.Cb,167):null}function I_(e){return e.Db>>16==11?P(e.Cb,27):null}function L_(e){return e.Db>>16==17?P(e.Cb,29):null}function hRe(e){return e.Db>>16==3?P(e.Cb,155):null}function gRe(e){var t;return lE(e),t=new Jr,hg(e,new Wfe(t))}function _Re(e,t){var n=e.a=e.a||[];return n[t]||(n[t]=e.ve(t))}function vRe(e,t){var n=e.q.getHours();e.q.setMonth(t),dN(e,n)}function yRe(e,t){Fu(this),this.f=t,this.g=e,Mg(this),this.je()}function bRe(e,t){this.a=e,this.c=xu(this.a),this.b=new o_(t)}function xRe(e,t,n){this.a=t,this.c=e,this.b=(ph(n),new bf(n))}function SRe(e,t,n){this.a=t,this.c=e,this.b=(ph(n),new bf(n))}function CRe(e){this.a=e,this.b=V(MNt,X,2043,e.e.length,0,2)}function wRe(){this.a=new Rl,this.e=new Jr,this.g=0,this.i=0}function R_(){R_=C,p7=new Dr,f7=new Dr,USe(tEt,new Ise)}function TRe(){TRe=C,mNt=tm(new Zh,(vA(),SJ),(yP(),nX))}function ERe(){ERe=C,hNt=tm(new Zh,(vA(),SJ),(yP(),nX))}function DRe(){DRe=C,_Nt=tm(new Zh,(vA(),SJ),(yP(),nX))}function ORe(){ORe=C,zNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function z_(){z_=C,HNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function kRe(){kRe=C,GNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function B_(){B_=C,XNt=vp(new Zh,(vA(),SJ),(yP(),OY))}function V_(e,t,n,r,i,a){return new Hb(e.e,t,e.Lj(),n,r,i,a)}function H_(e,t,n){return t==null?XA(e.f,null,n):uE(e.i,t,n)}function U_(e,t){e.c&&Db(e.c.g,e),e.c=t,e.c&&M(e.c.g,e)}function W_(e,t){e.c&&Db(e.c.a,e),e.c=t,e.c&&M(e.c.a,e)}function G_(e,t){e.i&&Db(e.i.j,e),e.i=t,e.i&&M(e.i.j,e)}function K_(e,t){e.d&&Db(e.d.e,e),e.d=t,e.d&&M(e.d.e,e)}function q_(e,t){e.a&&Db(e.a.k,e),e.a=t,e.a&&M(e.a.k,e)}function J_(e,t){e.b&&Db(e.b.f,e),e.b=t,e.b&&M(e.b.f,e)}function ARe(e,t){rFe(e,e.b,e.c),P(e.b.b,68),t&&P(t.b,68).b}function jRe(e,t){return aE(P(e.c,65).c.e.b,P(t.c,65).c.e.b)}function MRe(e,t){return aE(P(e.c,65).c.e.a,P(t.c,65).c.e.a)}function NRe(e){return Qw(),rd(),P(e.a,86).d.e!=0}function Y_(e,t){j(e.Cb,184)&&(P(e.Cb,184).tb=null),GS(e,t)}function X_(e,t){j(e.Cb,90)&&$A(_y(P(e.Cb,90)),4),GS(e,t)}function PRe(e,t){hE(e,t),j(e.Cb,90)&&$A(_y(P(e.Cb,90)),2)}function FRe(e,t){t.c!=null&&Dh(e,new mh(t.c))}function IRe(e){var t,n=(Ra(),t=new kr,t);return Nx(n,e),n}function LRe(e){var t,n=(Ra(),t=new kr,t);return Nx(n,e),n}function RRe(e){for(var t;;)if(t=e.Pb(),!e.Ob())return t}function zRe(e,t,n){return M(e.a,(eg(),ik(t,n),new oo(t,n))),e}function Z_(e,t){return Qo(),ex(t)?new hp(t,e):new Qc(t,e)}function Q_(e){return AM(),dT(e,0)>=0?yD(e):Xm(yD(kb(e)))}function BRe(e){var t=P(cp(e.b),9);return new xf(e.a,t,e.c)}function VRe(e,t){var n=P(TT(Rg(e.a),t),16);return n?n.gc():0}function HRe(e,t,n){var r;I$e(t,n,e.c.length),r=n-t,wye(e.c,t,r)}function $_(e,t,n){I$e(t,n,e.gc()),this.c=e,this.a=t,this.b=n-t}function ev(e){this.c=new vo,this.b=e.b,this.d=e.c,this.a=e.a}function tv(e){this.a=r.Math.cos(e),this.b=r.Math.sin(e)}function nv(e,t,n,r){this.c=e,this.d=r,q_(this,t),J_(this,n)}function URe(e,t){P_e.call(this,new go(xx(e))),vS(t,Jvt),this.a=t}function WRe(e,t,n){return new IA(e,(Sb(),dK),null,!1,t,n)}function GRe(e,t,n){return new IA(e,(Sb(),pK),t,n,null,!1)}function KRe(){return Zw(),U(O(xK,1),Z,108,0,[vK,yK,bK])}function qRe(){return Xb(),U(O(IEt,1),Z,472,0,[sq,oq,aq])}function JRe(){return Cb(),U(O(NEt,1),Z,471,0,[rq,nq,iq])}function YRe(){return Ix(),U(O($K,1),Z,237,0,[XK,ZK,QK])}function XRe(){return Yb(),U(O(_J,1),Z,391,0,[hJ,mJ,gJ])}function ZRe(){return kS(),U(O(MX,1),Z,372,0,[jX,AX,kX])}function QRe(){return bS(),U(O(nZ,1),Z,322,0,[eZ,$X,tZ])}function $Re(){return lS(),U(O(oZ,1),Z,351,0,[rZ,aZ,iZ])}function eze(){return _w(),U(O(ckt,1),Z,460,0,[_Z,gZ,vZ])}function tze(){return qC(),U(O(rQ,1),Z,299,0,[tQ,nQ,eQ])}function nze(){return Zb(),U(O(gkt,1),Z,311,0,[aQ,oQ,iQ])}function rze(){return hT(),U(O(PMt,1),Z,390,0,[P0,NMt,F0])}function ize(){return uS(),U(O(ZMt,1),Z,463,0,[i2,n2,r2])}function aze(){return CC(),U(O(tNt,1),Z,387,0,[$Mt,a2,eNt])}function oze(){return Nw(),U(O(rNt,1),Z,349,0,[c2,o2,s2])}function sze(){return Xw(),U(O(oNt,1),Z,350,0,[l2,aNt,u2])}function cze(){return cS(),U(O(uNt,1),Z,352,0,[lNt,d2,cNt])}function lze(){return sw(),U(O(fNt,1),Z,388,0,[p2,m2,f2])}function uze(){return sS(),U(O(ANt,1),Z,464,0,[h2,g2,_2])}function rv(e){return Sw(U(O(K3,1),X,8,0,[e.i.n,e.n,e.a]))}function dze(){return Pw(),U(O(FPt,1),Z,392,0,[PPt,B2,z2])}function fze(){fze=C,kFt=tm(new Zh,(Ok(),F2),(LM(),CPt))}function iv(){iv=C,v4=new iSe(`DFS`,0),EFt=new iSe(`BFS`,1)}function pze(e,t,n){var r=new zie;r.b=t,r.a=n,++t.b,M(e.d,r)}function mze(e,t,n){var r=new Vl(n.d);$d(r,e),fE(t,r.a,r.b)}function hze(e,t){cTe(e,nm(uv(lm(t,24),jI)),nm(uv(t,jI)))}function av(e,t){if(e<0||e>t)throw E(new Mi(HI+e+UI+t))}function ov(e,t){if(e<0||e>=t)throw E(new Mi(HI+e+UI+t))}function sv(e,t){if(e<0||e>=t)throw E(new ra(HI+e+UI+t))}function cv(e,t){this.b=(Gh(e),e),this.a=(t&uI)==0?t|64|ZP:t}function gze(e){var t;return lE(e),t=(Bg(),Bg(),rK),Cx(e,t)}function _ze(e,t,n){var r=vN(e,t,!1);return r.b<=t&&r.a<=n}function vze(){return Tb(),U(O(wLt,1),Z,439,0,[c3,CLt,SLt])}function yze(){return TE(),U(O(LIt,1),Z,394,0,[IIt,Q4,FIt])}function bze(){return ED(),U(O(kIt,1),Z,445,0,[L4,R4,z4])}function xze(){return LO(),U(O(jIt,1),Z,456,0,[B4,H4,V4])}function Sze(){return Yw(),U(O(HFt,1),Z,393,0,[O4,BFt,VFt])}function Cze(){return SC(),U(O(DIt,1),Z,300,0,[I4,EIt,TIt])}function wze(){return _T(),U(O(yBt,1),Z,346,0,[_8,g8,v8])}function Tze(){return KT(),U(O(_3,1),Z,444,0,[m3,h3,g3])}function Eze(){return Lx(),U(O(rBt,1),Z,278,0,[o8,s8,c8])}function Dze(){return gT(),U(O(BBt,1),Z,280,0,[zBt,M5,N5])}function lv(e){return ph(e),j(e,16)?new bf(P(e,16)):Xf(e.Kc())}function Oze(e,t){return e&&e.equals?e.equals(t):A(e)===A(t)}function uv(e,t){return MC(BNe(Il(e)?zC(e):e,Il(t)?zC(t):t))}function dv(e,t){return MC(VNe(Il(e)?zC(e):e,Il(t)?zC(t):t))}function fv(e,t){return MC(HNe(Il(e)?zC(e):e,Il(t)?zC(t):t))}function kze(e,t){var n=(Gh(e),e).g;return sDe(!!n),Gh(t),n(t)}function Aze(e,t){var n,r=Im(e,t);return n=e.a.fd(r),new tbe(e,n)}function jze(e){return e.Db>>16==6?P(xj(e),241):null}function Mze(e){if(e.p!=2)throw E(new Rr);return nm(e.f)&OF}function Nze(e){if(e.p!=2)throw E(new Rr);return nm(e.k)&OF}function z(e){return jd(e.ar)}function Yze(e,t){var n=jb(t);return P(xh(e.c,n),17).a}function gv(e,t,n){var r=e.d[t.p];e.d[t.p]=e.d[n.p],e.d[n.p]=r}function Xze(e,t,n){var r;e.n&&t&&n&&(r=new Ese,M(e.e,r))}function _v(e,t){if(Lm(e.a,t),t.d)throw E(new yi(xyt));t.d=e}function Zze(e,t){this.a=new T,this.d=new T,this.f=e,this.c=t}function Qze(){this.c=new Hwe,this.a=new JUe,this.b=new Kge,Fbe()}function $ze(){lw(),this.b=new Dr,this.a=new Dr,this.c=new T}function eBe(e,t,n){this.d=e,this.j=t,this.e=n,this.o=-1,this.p=3}function tBe(e,t,n){this.d=e,this.k=t,this.f=n,this.o=-1,this.p=5}function nBe(e,t,n,r,i,a){Gqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function rBe(e,t,n,r,i,a){Kqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function iBe(e,t,n,r,i,a){vUe.call(this,e,t,n,r,i),a&&(this.o=-2)}function aBe(e,t,n,r,i,a){Yqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function oBe(e,t,n,r,i,a){yUe.call(this,e,t,n,r,i),a&&(this.o=-2)}function sBe(e,t,n,r,i,a){qqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function cBe(e,t,n,r,i,a){Jqe.call(this,e,t,n,r,i),a&&(this.o=-2)}function lBe(e,t,n,r,i,a){bUe.call(this,e,t,n,r,i),a&&(this.o=-2)}function uBe(e,t,n,r){xr.call(this,n),this.b=e,this.c=t,this.d=r}function dBe(e,t){this.f=e,this.a=(By(),u9),this.c=u9,this.b=t}function fBe(e,t){this.g=e,this.d=(By(),d9),this.a=d9,this.b=t}function pBe(e,t){!e.c&&(e.c=new DC(e,0)),ON(e.c,(UN(),w9),t)}function mBe(e,t){return Wit(e,t,j(t,102)&&(P(t,19).Bb&pI)!=0)}function hBe(e,t){return DPe(LC(e.q.getTime()),LC(t.q.getTime()))}function gBe(e){return yp(e.e.Rd().gc()*e.c.Rd().gc(),16,new ode(e))}function _Be(e){return!!e.u&&Jv(e.u.a).i!=0&&!(e.n&&QO(e.n))}function vBe(e){return!!e.a&&Ib(e.a.a).i!=0&&!(e.b&&$O(e.b))}function yBe(e,t){return t==0?!!e.o&&e.o.f!=0:mO(e,t)}function bBe(e,t,n){var r=P(e.Zb().xc(t),16);return!!r&&r.Hc(n)}function xBe(e,t,n){var r=P(e.Zb().xc(t),16);return!!r&&r.Mc(n)}function SBe(e,t){var n=1-t;return e.a[n]=FS(e.a[n],n),FS(e,t)}function CBe(e,t){var n,r=uv(e,_I);return n=cm(t,32),dv(n,r)}function wBe(e,t,n){Z3e(new xRe((ph(e),new bf(e)),t,n))}function vv(e,t,n){Q3e(new SRe((ph(e),new bf(e)),t,n))}function yv(e,t,n,r,i,a){return lXe(e,t,n,a),IT(e,r),zT(e,i),e}function TBe(e,t,n,r){return e.a+=``+p_(t==null?IP:PE(t),n,r),e}function bv(e,t){this.a=e,qn.call(this,e),av(t,e.gc()),this.b=t}function EBe(e){this.a=V(WW,FP,1,dZe(r.Math.max(8,e))<<1,5,1)}function xv(e){return P(rO(e,V(UJ,jR,10,e.c.length,0,1)),199)}function Sv(e){return P(rO(e,V(VJ,AR,18,e.c.length,0,1)),483)}function DBe(e){return e.a?e.e.length==0?e.a.a:e.a.a+(``+e.e):e.c}function Cv(e){for(;e.d>0&&e.a[--e.d]==0;);e.a[e.d++]==0&&(e.e=0)}function OBe(e){return jd(e.b.b!=e.d.a),e.c=e.b=e.b.b,--e.a,e.c.c}function kBe(e,t,n){e.a=t,e.c=n,e.b.a.$b(),Fg(e.d),Wr(e.e.a.c,0)}function ABe(e,t){var n;e.e=new D_e,n=sM(t),hu(n,e.c),pct(e,n,0)}function wv(e,t,n,r){var i=new Koe;i.a=t,i.b=n,i.c=r,up(e.a,i)}function B(e,t,n,r){var i=new Koe;i.a=t,i.b=n,i.c=r,up(e.b,i)}function jBe(e,t,n){if(e<0||tn)throw E(new Mi(yet(e,t,n)))}function Tv(e,t){if(e<0||e>=t)throw E(new Mi(jtt(e,t)));return e}function MBe(e){if(!(`stack`in e))try{throw e}catch{}return e}function Ev(e){return Lo(),j(e.g,10)?P(e.g,10):null}function NBe(e){return!bg(e).dc()&&(gwe(e,new h),!0)}function Dv(e){var t;return Il(e)?(t=e,t==-0?0:t):lKe(e)}function PBe(e,t){return j(t,44)?lk(e.a,P(t,44)):!1}function FBe(e,t){return j(t,44)?lk(e.a,P(t,44)):!1}function IBe(e,t){return j(t,44)?lk(e.a,P(t,44)):!1}function LBe(e){var t;return Hh(e),t=new fe,Qa(e.a,new Vfe(t)),t}function RBe(){var e,t=(n=(e=new kr,e),n),n;return M(fHt,t),t}function Ov(e){var t;return Hh(e),t=new pe,Qa(e.a,new Hfe(t)),t}function zBe(e,t){return e.a<=e.b&&(t.Dd(e.a++),!0)}function BBe(e){rC.call(this,e,(Sb(),uK),null,!1,null,!1)}function VBe(){VBe=C,hDt=nT((No(),U(O(Oq,1),Z,489,0,[Dq])))}function HBe(){HBe=C,wNt=LFe(G(1),G(4)),CNt=LFe(G(1),G(2))}function UBe(e,t){return new Vf(t,wd(xu(t.e),e,e),(rd(),!0))}function kv(e){return new Hy((vS(e,_F),bx(yE(yE(5,e),e/10|0))))}function WBe(e){return yp(e.e.Rd().gc()*e.c.Rd().gc(),273,new ade(e))}function GBe(e){return P(rO(e,V(EOt,Sbt,12,e.c.length,0,1)),2042)}function KBe(e){return z_(),!gy(e)&&!(!gy(e)&&e.c.i.c==e.d.i.c)}function qBe(e,t){return Rx(),P(K(t,(rN(),u4)),17).a>=e.gc()}function Av(e,t){L_t(t,e),Yje(e.d),Yje(P(K(e,(mP(),L1)),214))}function jv(e,t){R_t(t,e),Xje(e.d),Xje(P(K(e,(mP(),L1)),214))}function JBe(e,t,n){e.d&&Db(e.d.e,e),e.d=t,e.d&&Jp(e.d.e,n,e)}function YBe(e,t,n){return n.f.c.length>0?bPe(e.a,t,n):bPe(e.b,t,n)}function XBe(e,t,n){var r=b2e();try{return qDe(e,t,n)}finally{CHe(r)}}function Mv(e,t){var n=A_(e,t),r=null;return n&&(r=n.pe()),r}function Nv(e,t){var n=A_(e,t),r=null;return n&&(r=n.se()),r}function Pv(e,t){var n=ax(e,t),r=null;return n&&(r=n.se()),r}function Fv(e,t){var n=A_(e,t),r=null;return n&&(r=ket(n)),r}function ZBe(e,t,n){var r=RD(n);return PM(e.g,r,t),PM(e.i,t,n),t}function QBe(e,t,n){this.d=new nme(this),this.e=e,this.i=t,this.f=n}function $Be(e,t,n,r){this.e=null,this.c=e,this.d=t,this.a=n,this.b=r}function eVe(e,t,n,r){jwe(this),this.c=e,this.e=t,this.f=n,this.b=r}function tVe(e,t,n,r){this.d=e,this.n=t,this.g=n,this.o=r,this.p=-1}function nVe(e,t,n,r){return j(n,59)?new lEe(e,t,n,r):new qNe(e,t,n,r)}function Iv(e){return j(e,16)?P(e,16).dc():!e.Kc().Ob()}function rVe(e){if(e.e.g!=e.b)throw E(new Vr);return!!e.c&&e.d>0}function Lv(e){return jd(e.b!=e.d.c),e.c=e.b,e.b=e.b.a,++e.a,e.c.c}function iVe(e,t){Gh(t),Sh(e.a,e.c,t),e.c=e.c+1&e.a.length-1,L3e(e)}function Rv(e,t){Gh(t),e.b=e.b-1&e.a.length-1,Sh(e.a,e.b,t),L3e(e)}function aVe(e){var t=e.Gh();this.a=j(t,71)?P(t,71).Ii():t.Kc()}function oVe(e){return new cv(wqe(P(e.a.md(),16).gc(),e.a.ld()),16)}function sVe(){sVe=C,FLt=nT((Bo(),U(O(PLt,1),Z,490,0,[v3])))}function cVe(){cVe=C,LLt=nT((Vo(),U(O(ILt,1),Z,558,0,[y3])))}function lVe(){lVe=C,SRt=nT((Ho(),U(O(xRt,1),Z,539,0,[O3])))}function uVe(){return YD(),U(O(zJ,1),Z,389,0,[RJ,IJ,FJ,LJ])}function dVe(){return Sb(),U(O(mK,1),Z,304,0,[uK,dK,fK,pK])}function fVe(){return TO(),U(O(lDt,1),Z,332,0,[gq,hq,_q,vq])}function pVe(){return wO(),U(O(pDt,1),Z,406,0,[wq,Cq,Tq,Eq])}function mVe(){return KC(),U(O(sDt,1),Z,417,0,[mq,dq,fq,pq])}function hVe(){return ow(),U(O(mOt,1),Z,416,0,[kJ,MJ,AJ,jJ])}function gVe(){return aw(),U(O(KOt,1),Z,421,0,[bX,xX,SX,CX])}function _Ve(){return iw(),U(O(FOt,1),Z,371,0,[gX,mX,hX,pX])}function vVe(){return IO(),U(O(B0,1),Z,203,0,[R0,z0,L0,I0])}function yVe(){return ID(),U(O(qMt,1),Z,284,0,[Z0,KMt,Q0,$0])}function bVe(e){var t;return e.j==(nP(),m5)&&(t=krt(e),$u(t,X8))}function xVe(e,t){var n=t.a;U_(n,t.c.d),K_(n,t.d.d),vC(n.a,e.n)}function SVe(e,t){var n=P(ix(e.b,t),67);return!n&&(n=new vo),n}function zv(e){return Lo(),j(e.g,154)?P(e.g,154):null}function CVe(e){e.a=null,e.e=null,Wr(e.b.c,0),Wr(e.f.c,0),e.c=null}function Bv(){Bv=C,sQ=new Js(sL,0),cQ=new Js(`TOP_LEFT`,1)}function Vv(){Vv=C,b2=new zxe(`UPPER`,0),y2=new zxe(`LOWER`,1)}function wVe(e,t){return Ou(new k(t.e.a+t.f.a/2,t.e.b+t.f.b/2),e)}function TVe(e,t){return P(Ju(_m(P(Dy(e.k,t),15).Oc(),HX)),113)}function EVe(e,t){return P(Ju(vm(P(Dy(e.k,t),15).Oc(),HX)),113)}function DVe(){return Ok(),U(O(yPt,1),Z,405,0,[N2,P2,F2,I2])}function OVe(){return Jw(),U(O(wFt,1),Z,353,0,[_4,h4,g4,m4])}function kVe(){return uk(),U(O(CIt,1),Z,354,0,[F4,xIt,SIt,bIt])}function AVe(){return TD(),U(O(S5,1),Z,386,0,[b5,x5,y5,v5])}function jVe(){return kk(),U(O(xBt,1),Z,291,0,[S8,y8,b8,x8])}function MVe(){return wE(),U(O(p8,1),Z,223,0,[f8,u8,l8,d8])}function NVe(){return ZE(),U(O(JBt,1),Z,320,0,[F5,GBt,qBt,KBt])}function PVe(){return Mw(),U(O(eVt,1),Z,415,0,[I5,QBt,ZBt,$Bt])}function FVe(e){return R_(),km(p7,e)?P(xh(p7,e),341).Qg():null}function Hv(e,t,n){return t<0?cj(e,n):P(n,69).wk().Bk(e,e.hi(),t)}function IVe(e,t,n){var r=RD(n);return PM(e.j,r,t),Qh(e.k,t,n),t}function LVe(e,t,n){var r=RD(n);return PM(e.d,r,t),Qh(e.e,t,n),t}function RVe(e){var t=(Ia(),n=new nn,n),n;return e&&Hj(t,e),t}function zVe(e){var t=e.aj(e.i);return e.i>0&&tN(e.g,0,t,0,e.i),t}function BVe(e,t){var n;for(n=e.j.c.length;n>24}function WVe(e){if(e.p!=1)throw E(new Rr);return nm(e.k)<<24>>24}function GVe(e){if(e.p!=7)throw E(new Rr);return nm(e.k)<<16>>16}function KVe(e){if(e.p!=7)throw E(new Rr);return nm(e.f)<<16>>16}function Uv(e,t){return t.e==0||e.e==0?JG:(pM(),Xj(e,t))}function qVe(e,t){return A(t)===A(e)?`(this Map)`:t==null?IP:PE(t)}function JVe(e,t,n){return dm(N(nl(Kp(e.f,t))),N(nl(Kp(e.f,n))))}function YVe(e,t,n){var r=P(xh(e.g,n),60);M(e.a.c,new Kc(t,r))}function XVe(e,t,n){e.i=0,e.e=0,t!=n&&(zZe(e,t,n),RZe(e,t,n))}function ZVe(e,t,n,r,i){M(t,vtt(i,mat(i,n,r))),p9e(e,i,t)}function QVe(e,t,n,r,i){this.i=e,this.a=t,this.e=n,this.j=r,this.f=i}function $Ve(e,t){r_.call(this),this.a=e,this.b=t,M(this.a.b,this)}function eHe(e){this.b=new Dr,this.c=new Dr,this.d=new Dr,this.a=e}function tHe(e,t){var n=new na;return e.Gd(n),n.a+=`..`,t.Hd(n),n.a}function nHe(e,t){for(var n=t;n;)Sd(e,n.i,n.j),n=I_(n);return e}function rHe(e,t,n){var r=RD(n);return Qh(e.b,r,t),Qh(e.c,t,n),t}function Wv(e){for(var t=0;e.Ob();)e.Pb(),t=yE(t,1);return bx(t)}function Gv(e,t){Qo();var n=P(e,69).vk();return L9e(n,t),n.xl(t)}function iHe(e,t,n){if(n){var r=n.oe();e.a[t]=r(n)}else delete e.a[t]}function aHe(e,t){var n=e.q.getHours();e.q.setFullYear(t+VF),dN(e,n)}function oHe(e,t){return P(t==null?nl(Kp(e.f,null)):as(e.i,t),288)}function sHe(e,t){return e==(DA(),JJ)&&t==JJ?4:e==JJ||t==JJ?8:32}function Kv(e,t,n){return sN(e,t,n,j(t,102)&&(P(t,19).Bb&pI)!=0)}function cHe(e,t,n){return pN(e,t,n,j(t,102)&&(P(t,19).Bb&pI)!=0)}function lHe(e,t,n){return tat(e,t,n,j(t,102)&&(P(t,19).Bb&pI)!=0)}function uHe(e){e.b!=e.c&&(e.a=V(WW,FP,1,8,5,1),e.b=0,e.c=0)}function qv(e){return jd(e.a=0&&e.a[n]===t[n];n--);return n<0}function oy(e){var t;return e?new Ap(e):(t=new Rl,HS(t,e),t)}function SHe(e,t){var n,r=!1;do n=mZe(e,t),r|=n;while(n);return r}function CHe(e){e&&OKe((Si(),cG)),--oG,e&&sG!=-1&&(gCe(sG),sG=-1)}function sy(e){s7e(),cTe(this,nm(uv(lm(e,24),jI)),nm(uv(e,jI)))}function wHe(){wHe=C,DEt=nT((fO(),U(O(DK,1),Z,436,0,[EK,TK])))}function THe(){THe=C,OEt=nT((dx(),U(O(AK,1),Z,435,0,[OK,kK])))}function EHe(){EHe=C,NDt=nT((fx(),U(O(Uq,1),Z,432,0,[Vq,Hq])))}function DHe(){DHe=C,AOt=nT((dC(),U(O(kOt,1),Z,517,0,[aY,iY])))}function OHe(){OHe=C,vkt=nT((Bv(),U(O(lQ,1),Z,429,0,[sQ,cQ])))}function kHe(){kHe=C,skt=nT((px(),U(O(hZ,1),Z,428,0,[pZ,mZ])))}function AHe(){AHe=C,dkt=nT((wb(),U(O(OZ,1),Z,488,0,[DZ,EZ])))}function jHe(){jHe=C,XMt=nT((Qb(),U(O(YMt,1),Z,430,0,[e2,t2])))}function MHe(){MHe=C,RNt=nT((Vv(),U(O(LNt,1),Z,531,0,[b2,y2])))}function NHe(){NHe=C,rkt=nT((Ky(),U(O(QX,1),Z,431,0,[XX,ZX])))}function PHe(){PHe=C,OFt=nT((iv(),U(O(DFt,1),Z,433,0,[v4,EFt])))}function FHe(){FHe=C,PFt=nT((AS(),U(O(NFt,1),Z,501,0,[b4,x4])))}function IHe(){IHe=C,qNt=nT((O_(),U(O(KNt,1),Z,523,0,[w2,C2])))}function LHe(){LHe=C,YNt=nT((k_(),U(O(JNt,1),Z,522,0,[T2,E2])))}function RHe(){RHe=C,dPt=nT((Wy(),U(O(uPt,1),Z,528,0,[A2,k2])))}function zHe(){zHe=C,vPt=nT((D_(),U(O(_Pt,1),Z,465,0,[j2,M2])))}function BHe(){BHe=C,zFt=nT((_b(),U(O(RFt,1),Z,434,0,[LFt,D4])))}function VHe(){VHe=C,xLt=nT((my(),U(O(bLt,1),Z,491,0,[s3,yLt])))}function HHe(){HHe=C,kLt=nT((JC(),U(O(OLt,1),Z,492,0,[ELt,DLt])))}function UHe(){UHe=C,zLt=nT((Gy(),U(O(RLt,1),Z,438,0,[x3,b3])))}function WHe(){WHe=C,TRt=nT((cw(),U(O(wRt,1),Z,437,0,[k3,CRt])))}function GHe(){GHe=C,WBt=nT((zf(),U(O(P5,1),Z,347,0,[HBt,UBt])))}function KHe(){return GT(),U(O(a8,1),Z,88,0,[r8,n8,t8,e8,i8])}function qHe(){return nP(),U(O(_5,1),TR,64,0,[h5,Z8,X8,m5,g5])}function JHe(e,t,n){return P(t==null?XA(e.f,null,n):uE(e.i,t,n),288)}function YHe(e){return(e.k==(DA(),JJ)||e.k==GJ)&&yd(e,(Y(),bQ))}function cy(e){return e.c&&e.d?Gze(e.c)+`->`+Gze(e.d):`e_`+td(e)}function ly(e,t){var n,r;for(Gh(t),r=e.Kc();r.Ob();)n=r.Pb(),t.Cd(n)}function XHe(e,t){var n=new bi;qg(n,`x`,t.a),qg(n,`y`,t.b),Dh(e,n)}function ZHe(e,t){var n=new bi;qg(n,`x`,t.a),qg(n,`y`,t.b),Dh(e,n)}function QHe(e,t){for(var n=t;n;)Sd(e,-n.i,-n.j),n=I_(n);return e}function $He(e,t){for(var n=t,r=0;n>0;)r+=e.a[n],n-=n&-n;return r}function uy(e,t,n){var r=(ov(t,e.c.length),e.c[t]);return e.c[t]=n,r}function eUe(e,t,n){e.a.c.length=0,Tmt(e,t,n),e.a.c.length==0||Mut(e,t)}function dy(e){e.i=0,is(e.b,null),is(e.c,null),e.a=null,e.e=null,++e.g}function fy(){fy=C,_K=!0,mEt=!1,hEt=!1,_Et=!1,gEt=!1}function py(e){fy(),!_K&&(this.c=e,this.e=!0,this.a=new T)}function tUe(e,t){this.c=0,this.b=t,oCe.call(this,e,17493),this.a=this.c}function nUe(e){Cvt(),lge(this),this.a=new vo,tQe(this,e),up(this.a,e)}function rUe(){au(this),this.b=new k(cI,cI),this.a=new k(lI,lI)}function my(){my=C,s3=new sSe(YR,0),yLt=new sSe(`TARGET_WIDTH`,1)}function hy(e,t){return(lE(e),Xa(new Mp(e,new UGe(t,e.a)))).Bd(SK)}function iUe(){return vA(),U(O(CJ,1),Z,367,0,[vJ,yJ,bJ,xJ,SJ])}function aUe(){return tA(),U(O(JOt,1),Z,375,0,[TX,DX,OX,EX,wX])}function oUe(){return FD(),U(O(fZ,1),Z,348,0,[cZ,sZ,uZ,dZ,lZ])}function sUe(){return CO(),U(O(RMt,1),Z,323,0,[LMt,H0,U0,V0,W0])}function cUe(){return XE(),U(O(y$,1),Z,171,0,[v$,m$,h$,g$,_$])}function lUe(){return iA(),U(O(FFt,1),Z,368,0,[T4,S4,E4,C4,w4])}function uUe(){return Wj(),U(O(jLt,1),Z,373,0,[u3,l3,f3,d3,p3])}function dUe(){return MA(),U(O(ULt,1),Z,324,0,[BLt,S3,HLt,C3,VLt])}function fUe(){return uO(),U(O(L3,1),Z,170,0,[F3,P3,M3,I3,N3])}function pUe(){return pO(),U(O(I8,1),Z,256,0,[P8,F8,wBt,N8,TBt])}function mUe(e){return Qi(),function(){return XBe(e,this,arguments)}}function gy(e){return!e.c||!e.d?!1:!!e.c.i&&e.c.i==e.d.i}function hUe(e,t){return j(t,143)?ff(e.c,P(t,143).c):!1}function _y(e){return e.t||(e.t=new Bhe(e),WT(new K_e(e),0,e.t)),e.t}function gUe(e){this.b=e,Lu.call(this,e),this.a=P(NC(this.b.a,4),129)}function _Ue(e){this.b=e,ld.call(this,e),this.a=P(NC(this.b.a,4),129)}function vy(e,t,n,r,i){KUe.call(this,t,r,i),this.c=e,this.b=n}function vUe(e,t,n,r,i){eBe.call(this,t,r,i),this.c=e,this.a=n}function yUe(e,t,n,r,i){tBe.call(this,t,r,i),this.c=e,this.a=n}function bUe(e,t,n,r,i){KUe.call(this,t,r,i),this.c=e,this.a=n}function yy(e,t){return P(ix(e.d,t),23)||P(ix(e.e,t),23)}function xUe(e,t){var n=t.ld(),r=e.Fe(n);return!!r&&rg(r.e,t.md())}function SUe(e,t){var n=t.ld();return new oo(n,e.e.pc(n,P(t.md(),16)))}function CUe(e,t){return e.a.get(t)??V(WW,FP,1,0,5,1)}function wUe(e){var t=e.length;return ff(fI.substr(fI.length-t,t),e)}function by(e){if(Cj(e))return e.c=e.a,e.a.Pb();throw E(new Hr)}function TUe(e,t){return t==0||e.e==0?e:t>0?Cst(e,t):F0e(e,-t)}function xy(e,t){return t==0||e.e==0?e:t>0?F0e(e,t):Cst(e,-t)}function EUe(e){txe.call(this,e==null?IP:PE(e),j(e,82)?P(e,82):null)}function DUe(e){var t;return e.c||(t=e.r,j(t,90)&&(e.c=P(t,29))),e.c}function Sy(e){var t=new i_;return VC(t,e),W(t,(mP(),j1),null),t}function OUe(e){var t=e.c.i,n=e.d.i;return t.k==(DA(),GJ)&&n.k==GJ}function Cy(e){return vu(e&QF,e>>22&QF,e<0?$F:0)}function kUe(e){var t,n,r,i;for(n=e,r=0,i=n.length;r=0?e.Lh(r,n,!0):mj(e,t,n)}function jUe(e,t,n){return aE(Ou(cO(e),xu(t.b)),Ou(cO(e),xu(n.b)))}function MUe(e,t,n){return aE(Ou(cO(e),xu(t.e)),Ou(cO(e),xu(n.e)))}function NUe(e,t){return r.Math.min(ab(t.a,e.d.d.c),ab(t.b,e.d.d.c))}function Ty(e,t){e._i(e.i+1),Au(e,e.i,e.Zi(e.i,t)),e.Mi(e.i++,t),e.Ni()}function Ey(e){var t,n;++e.j,t=e.g,n=e.i,e.g=null,e.i=0,e.Oi(n,t),e.Ni()}function PUe(e,t,n){var r=new Rwe(e.a);mC(r,e.a.a),XA(r.f,t,n),e.a.a=r}function FUe(e,t,n,r){var i;for(i=0;it)throw E(new Mi(ptt(e,t,`index`)));return e}function Ay(e,t){var n=(ov(t,e.c.length),e.c[t]);return wye(e.c,t,1),n}function zUe(e,t){var n=(Gh(e),e),r=(Gh(t),t);return n==r?0:nt.p?-1:0}function tWe(e){var t;return e.a||(t=e.r,j(t,156)&&(e.a=P(t,156))),e.a}function nWe(e,t,n){var r;return++e.e,--e.f,r=P(e.d[t].gd(n),136),r.md()}function rWe(e){var t=e.ld();return qf(P(e.md(),16).Nc(),new cde(t))}function iWe(e,t){return km(e.a,t)?(My(e.a,t),!0):!1}function Iy(e,t,n){return Tv(t,e.e.Rd().gc()),Tv(n,e.c.Rd().gc()),e.a[t][n]}function Ly(e,t,n){this.a=e,this.b=t,this.c=n,M(e.t,this),M(t.i,this)}function Ry(e,t,n,r){this.f=e,this.e=t,this.d=n,this.b=r,this.c=r?r.d:null}function zy(){this.b=new vo,this.a=new vo,this.b=new vo,this.a=new vo}function By(){By=C;var e,t;u9=(Ra(),t=new Ur,t),d9=(e=new oi,e)}function aWe(e){var t;return lE(e),t=new Mje(e,e.a.e,e.a.d|4),new fDe(e,t)}function oWe(e){var t;for(Hh(e),t=0;e.a.Bd(new Be);)t=yE(t,1);return t}function Vy(e,t){return Gh(t),e.c=0,`Initial capacity must not be negative`)}function Uy(){Uy=C,G3=new yr(`org.eclipse.elk.labels.labelManager`)}function sWe(){sWe=C,fX=new Wd(`separateLayerConnections`,(iw(),gX))}function Wy(){Wy=C,A2=new nSe(`REGULAR`,0),k2=new nSe(`CRITICAL`,1)}function Gy(){Gy=C,x3=new lSe(`FIXED`,0),b3=new lSe(`CENTER_NODE`,1)}function Ky(){Ky=C,XX=new Lxe(`QUADRATIC`,0),ZX=new Lxe(`SCANLINE`,1)}function cWe(){cWe=C,ikt=nT((bS(),U(O(nZ,1),Z,322,0,[eZ,$X,tZ])))}function lWe(){lWe=C,akt=nT((lS(),U(O(oZ,1),Z,351,0,[rZ,aZ,iZ])))}function uWe(){uWe=C,ekt=nT((kS(),U(O(MX,1),Z,372,0,[jX,AX,kX])))}function dWe(){dWe=C,lkt=nT((_w(),U(O(ckt,1),Z,460,0,[_Z,gZ,vZ])))}function fWe(){fWe=C,hkt=nT((qC(),U(O(rQ,1),Z,299,0,[tQ,nQ,eQ])))}function pWe(){pWe=C,_kt=nT((Zb(),U(O(gkt,1),Z,311,0,[aQ,oQ,iQ])))}function mWe(){mWe=C,FMt=nT((hT(),U(O(PMt,1),Z,390,0,[P0,NMt,F0])))}function hWe(){hWe=C,nNt=nT((CC(),U(O(tNt,1),Z,387,0,[$Mt,a2,eNt])))}function gWe(){gWe=C,iNt=nT((Nw(),U(O(rNt,1),Z,349,0,[c2,o2,s2])))}function _We(){_We=C,QMt=nT((uS(),U(O(ZMt,1),Z,463,0,[i2,n2,r2])))}function vWe(){vWe=C,sNt=nT((Xw(),U(O(oNt,1),Z,350,0,[l2,aNt,u2])))}function yWe(){yWe=C,dNt=nT((cS(),U(O(uNt,1),Z,352,0,[lNt,d2,cNt])))}function bWe(){bWe=C,pNt=nT((sw(),U(O(fNt,1),Z,388,0,[p2,m2,f2])))}function xWe(){xWe=C,IPt=nT((Pw(),U(O(FPt,1),Z,392,0,[PPt,B2,z2])))}function SWe(){SWe=C,UFt=nT((Yw(),U(O(HFt,1),Z,393,0,[O4,BFt,VFt])))}function CWe(){CWe=C,OIt=nT((SC(),U(O(DIt,1),Z,300,0,[I4,EIt,TIt])))}function wWe(){wWe=C,AIt=nT((ED(),U(O(kIt,1),Z,445,0,[L4,R4,z4])))}function TWe(){TWe=C,MIt=nT((LO(),U(O(jIt,1),Z,456,0,[B4,H4,V4])))}function EWe(){EWe=C,RIt=nT((TE(),U(O(LIt,1),Z,394,0,[IIt,Q4,FIt])))}function DWe(){DWe=C,TLt=nT((Tb(),U(O(wLt,1),Z,439,0,[c3,CLt,SLt])))}function OWe(){OWe=C,jNt=nT((sS(),U(O(ANt,1),Z,464,0,[h2,g2,_2])))}function kWe(){kWe=C,PEt=nT((Cb(),U(O(NEt,1),Z,471,0,[rq,nq,iq])))}function AWe(){AWe=C,MEt=nT((Ix(),U(O($K,1),Z,237,0,[XK,ZK,QK])))}function jWe(){jWe=C,LEt=nT((Xb(),U(O(IEt,1),Z,472,0,[sq,oq,aq])))}function MWe(){MWe=C,vEt=nT((Zw(),U(O(xK,1),Z,108,0,[vK,yK,bK])))}function NWe(){NWe=C,aOt=nT((Yb(),U(O(_J,1),Z,391,0,[hJ,mJ,gJ])))}function PWe(){PWe=C,bBt=nT((_T(),U(O(yBt,1),Z,346,0,[_8,g8,v8])))}function FWe(){FWe=C,NLt=nT((KT(),U(O(_3,1),Z,444,0,[m3,h3,g3])))}function IWe(){IWe=C,iBt=nT((Lx(),U(O(rBt,1),Z,278,0,[o8,s8,c8])))}function LWe(){LWe=C,VBt=nT((gT(),U(O(BBt,1),Z,280,0,[zBt,M5,N5])))}function qy(e,t){return!e.o&&(e.o=new lb((lP(),Z5),n7,e,0)),uD(e.o,t)}function RWe(e,t){var n;e.C&&(n=P(ig(e.b,t),127).n,n.d=e.C.d,n.a=e.C.a)}function zWe(e){var t,n,r,i=e.d;t=e.a,n=e.b,r=e.c,e.d=n,e.a=r,e.b=i,e.c=t}function BWe(e){return!e.g&&(e.g=new on),!e.g.b&&(e.g.b=new Ihe(e)),e.g.b}function Jy(e){return!e.g&&(e.g=new on),!e.g.c&&(e.g.c=new zhe(e)),e.g.c}function VWe(e){return!e.g&&(e.g=new on),!e.g.d&&(e.g.d=new Lhe(e)),e.g.d}function HWe(e){return!e.g&&(e.g=new on),!e.g.a&&(e.g.a=new Rhe(e)),e.g.a}function UWe(e,t,n,r){return n&&(r=n.Rh(t,eD(n.Dh(),e.c.uk()),null,r)),r}function WWe(e,t,n,r){return n&&(r=n.Th(t,eD(n.Dh(),e.c.uk()),null,r)),r}function Yy(e,t,n,r){var i=V(q9,HF,28,t+1,15,1);return Gdt(i,e,t,n,r),i}function V(e,t,n,r,i,a){var o=b3e(i,r);return i!=10&&U(O(e,a),t,n,i,o),o}function GWe(e,t,n){var r,i=new WC(t,e);for(r=0;rn||t=0?e.Lh(n,!0,!0):mj(e,t,!0)}function gGe(e,t,n){var r=kZe(e,t,n);return e.b=new VS(r.c.length),Xst(e,r)}function _Ge(e){if(e.b<=0)throw E(new Hr);return--e.b,e.a-=e.c.c,G(e.a)}function vGe(e){var t;if(!e.a)throw E(new fIe);return t=e.a,e.a=I_(e.a),t}function yGe(e){for(;!e.a;)if(!DOe(e.c,new Ufe(e)))return!1;return!0}function hb(e){var t;return ph(e),j(e,204)?(t=P(e,204),t):new gde(e)}function bGe(e){gb(),P(e.of((vP(),z6)),181).Fc((rj(),K8)),e.qf(R6,null)}function gb(){gb=C,jRt=new Hoe,NRt=new Uoe,MRt=oQe((vP(),R6),jRt,D6,NRt)}function _b(){_b=C,LFt=new oSe(`LEAF_NUMBER`,0),D4=new oSe(`NODE_SIZE`,1)}function vb(e){e.a=V(q9,HF,28,e.b+1,15,1),e.c=V(q9,HF,28,e.b,15,1),e.d=0}function xGe(e,t){e.a.Ne(t.d,e.b)>0&&(M(e.c,new Pje(t.c,t.d,e.d)),e.b=t.d)}function SGe(e,t){if(e.g==null||t>=e.i)throw E(new wl(t,e.i));return e.g[t]}function CGe(e,t,n){if(Aw(e,n),n!=null&&!e.fk(n))throw E(new Ir);return n}function yb(e,t){return lx(t)!=10&&U($w(t),t.Sm,t.__elementTypeId$,lx(t),e),e}function bb(e,t,n,r){var i;r=(Bg(),r||nK),i=e.slice(t,n),mtt(i,e,t,n,-t,r)}function xb(e,t,n,r,i){return t<0?mj(e,n,r):P(n,69).wk().yk(e,e.hi(),t,r,i)}function wGe(e,t){return aE(D(N(K(e,(Y(),$Q)))),D(N(K(t,$Q))))}function TGe(){TGe=C,dEt=nT((Sb(),U(O(mK,1),Z,304,0,[uK,dK,fK,pK])))}function Sb(){Sb=C,uK=new ls(`All`,0),dK=new WCe,fK=new Owe,pK=new UCe}function Cb(){Cb=C,rq=new hs(cL,0),nq=new hs(sL,1),iq=new hs(lL,2)}function EGe(){EGe=C,_N(),VHt=cI,BHt=lI,UHt=new Rn(cI),HHt=new Rn(lI)}function DGe(){DGe=C,cDt=nT((KC(),U(O(sDt,1),Z,417,0,[mq,dq,fq,pq])))}function OGe(){OGe=C,mDt=nT((wO(),U(O(pDt,1),Z,406,0,[wq,Cq,Tq,Eq])))}function kGe(){kGe=C,uDt=nT((TO(),U(O(lDt,1),Z,332,0,[gq,hq,_q,vq])))}function AGe(){AGe=C,xOt=nT((YD(),U(O(zJ,1),Z,389,0,[RJ,IJ,FJ,LJ])))}function jGe(){jGe=C,hOt=nT((ow(),U(O(mOt,1),Z,416,0,[kJ,MJ,AJ,jJ])))}function MGe(){MGe=C,qOt=nT((aw(),U(O(KOt,1),Z,421,0,[bX,xX,SX,CX])))}function NGe(){NGe=C,IOt=nT((iw(),U(O(FOt,1),Z,371,0,[gX,mX,hX,pX])))}function PGe(){PGe=C,IMt=nT((IO(),U(O(B0,1),Z,203,0,[R0,z0,L0,I0])))}function FGe(){FGe=C,JMt=nT((ID(),U(O(qMt,1),Z,284,0,[Z0,KMt,Q0,$0])))}function wb(){wb=C,DZ=new Hs(wR,0),EZ=new Hs(`IMPROVE_STRAIGHTNESS`,1)}function IGe(e,t){var n,r=t/e.c.Rd().gc()|0;return n=t%e.c.Rd().gc(),Iy(e,r,n)}function LGe(e){var t;if(e.nl())for(t=e.i-1;t>=0;--t)H(e,t);return zVe(e)}function RGe(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[0];)n=t;return n}function zGe(e){var t,n;if(!e.b)return null;for(n=e.b;t=n.a[1];)n=t;return n}function BGe(e){return j(e,180)?``+P(e,180).a:e==null?null:PE(e)}function VGe(e){return j(e,180)?``+P(e,180).a:e==null?null:PE(e)}function HGe(e,t){if(t.a)throw E(new yi(xyt));Lm(e.a,t),t.a=e,!e.j&&(e.j=t)}function UGe(e,t){vl.call(this,t.zd(),t.yd()&-16449),Gh(e),this.a=e,this.c=t}function WGe(e,t){return new Vf(t,Sd(xu(t.e),t.f.a+e,t.f.b+e),(rd(),!1))}function GGe(e,t){return Rf(),M(e,new Kc(t,G(t.e.c.length+t.g.c.length)))}function KGe(e,t){return Rf(),M(e,new Kc(t,G(t.e.c.length+t.g.c.length)))}function qGe(){qGe=C,wIt=nT((uk(),U(O(CIt,1),Z,354,0,[F4,xIt,SIt,bIt])))}function JGe(){JGe=C,TFt=nT((Jw(),U(O(wFt,1),Z,353,0,[_4,h4,g4,m4])))}function YGe(){YGe=C,bPt=nT((Ok(),U(O(yPt,1),Z,405,0,[N2,P2,F2,I2])))}function XGe(){XGe=C,aBt=nT((wE(),U(O(p8,1),Z,223,0,[f8,u8,l8,d8])))}function ZGe(){ZGe=C,SBt=nT((kk(),U(O(xBt,1),Z,291,0,[S8,y8,b8,x8])))}function QGe(){QGe=C,IBt=nT((TD(),U(O(S5,1),Z,386,0,[b5,x5,y5,v5])))}function $Ge(){$Ge=C,YBt=nT((ZE(),U(O(JBt,1),Z,320,0,[F5,GBt,qBt,KBt])))}function eKe(){eKe=C,tVt=nT((Mw(),U(O(eVt,1),Z,415,0,[I5,QBt,ZBt,$Bt])))}function Tb(){Tb=C,c3=new Cc(_xt,0),CLt=new Cc(vV,1),SLt=new Cc(wR,2)}function Eb(e,t,n,r,i){return Gh(e),Gh(t),Gh(n),Gh(r),Gh(i),new Vm(e,t,r)}function tKe(e,t){var n=P(My(e.e,t),400);return n?(pMe(n),n.e):null}function Db(e,t){var n=Ab(e,t,0);return n!=-1&&(Ay(e,n),!0)}function nKe(e,t,n){var r;return Hh(e),r=new Re,r.a=t,e.a.Nb(new uxe(r,n)),r.a}function rKe(e){var t;return Hh(e),t=V(Z9,hI,28,0,15,1),Qa(e.a,new Bfe(t)),t}function Ob(e){var t;if(!DS(e))throw E(new Hr);return e.e=1,t=e.d,e.d=null,t}function kb(e){var t;return Il(e)&&(t=0-e,!isNaN(t))?t:MC(mw(e))}function Ab(e,t,n){for(;n=0?jO(e,n,!0,!0):mj(e,t,!0)}function qb(e){var t=rS(NC(e,32));return t??=(WD(e),rS(NC(e,32))),t}function Jb(e){var t;return e.Oh()||(t=bh(e.Dh())-e.ji(),e.$h().Mk(t)),e.zh()}function fKe(e,t){bq=new Mt,fDt=t,yq=e,P(yq.b,68),ZWe(yq,bq,null),Jpt(yq)}function Yb(){Yb=C,hJ=new Cs(`XY`,0),mJ=new Cs(`X`,1),gJ=new Cs(`Y`,2)}function Xb(){Xb=C,sq=new gs(`TOP`,0),oq=new gs(sL,1),aq=new gs(Lyt,2)}function Zb(){Zb=C,aQ=new qs(wR,0),oQ=new qs(`TOP`,1),iQ=new qs(Lyt,2)}function Qb(){Qb=C,e2=new nc(`INPUT_ORDER`,0),t2=new nc(`PORT_DEGREE`,1)}function $b(){$b=C,hG=vu(QF,QF,524287),BTt=vu(0,0,eI),gG=Cy(1),Cy(2),_G=Cy(0)}function ex(e){var t;return e.d!=e.r&&(t=Ik(e),e.e=!!t&&t.lk()==xwt,e.d=t),e.e}function tx(e,t,n){var r=e.g[t];return Au(e,t,e.Zi(t,n)),e.Ri(t,n,r),e.Ni(),r}function nx(e,t){var n=e.dd(t);return n>=0&&(e.gd(n),!0)}function rx(e,t){var n;for(ph(e),ph(t),n=!1;t.Ob();)n|=e.Fc(t.Pb());return n}function ix(e,t){var n=P(xh(e.e,t),400);return n?(Ywe(e,n),n.e):null}function pKe(e){var t=e/60|0,n=e%60;return n==0?``+t:``+t+`:`+(``+n)}function ax(e,t){var n=e.a[t],r=(vw(),pG)[typeof n];return r?r(n):XQe(typeof n)}function ox(e,t){var n,r;return lE(e),r=new WUe(t,e.a),n=new zOe(r),new Mp(e,n)}function sx(e){var t=e.b.c.length==0?null:Ep(e.b,0);return t!=null&&LS(e,0),t}function mKe(e,t){var n,r,i=t.c.i;n=P(xh(e.f,i),60),r=n.d.c-n.e.c,eC(t.a,r,0)}function cx(e,t){var n;for(++e.d,++e.c[t],n=t+1;n=0;)++t[0]}function _Ke(e,t){Gx(e,t==null||vf((Gh(t),t))||isNaN((Gh(t),t))?0:(Gh(t),t))}function vKe(e,t){Kx(e,t==null||vf((Gh(t),t))||isNaN((Gh(t),t))?0:(Gh(t),t))}function yKe(e,t){Wx(e,t==null||vf((Gh(t),t))||isNaN((Gh(t),t))?0:(Gh(t),t))}function bKe(e,t){Ux(e,t==null||vf((Gh(t),t))||isNaN((Gh(t),t))?0:(Gh(t),t))}function xKe(e,t,n){return Ou(new k(n.e.a+n.f.a/2,n.e.b+n.f.b/2),e)==(Gh(t),t)}function SKe(e,t){return j(t,102)&&(P(t,19).Bb&pI)!=0?new Dl(t,e):new WC(t,e)}function CKe(e,t){return j(t,102)&&(P(t,19).Bb&pI)!=0?new Dl(t,e):new WC(t,e)}function lx(e){return e.__elementTypeCategory$==null?10:e.__elementTypeCategory$}function wKe(e,t){return t==(Sf(),Sf(),oEt)?e.toLocaleLowerCase():e.toLowerCase()}function TKe(e){if(!e.e)throw E(new Hr);return e.c=e.a=e.e,e.e=e.e.e,--e.d,e.a.f}function ux(e){if(!e.c)throw E(new Hr);return e.e=e.a=e.c,e.c=e.c.c,++e.d,e.a.f}function EKe(e){var t;for(++e.a,t=e.c.a.length;e.ae.a[r]&&(r=n);return r}function MKe(e){var t=P(K(e,(Y(),fQ)),313);return t?t.a==e:!1}function NKe(e){var t=P(K(e,(Y(),fQ)),313);return t?t.i==e:!1}function PKe(){PKe=C,lOt=nT((vA(),U(O(CJ,1),Z,367,0,[vJ,yJ,bJ,xJ,SJ])))}function FKe(){FKe=C,YOt=nT((tA(),U(O(JOt,1),Z,375,0,[TX,DX,OX,EX,wX])))}function IKe(){IKe=C,okt=nT((FD(),U(O(fZ,1),Z,348,0,[cZ,sZ,uZ,dZ,lZ])))}function LKe(){LKe=C,zMt=nT((CO(),U(O(RMt,1),Z,323,0,[LMt,H0,U0,V0,W0])))}function RKe(){RKe=C,ykt=nT((XE(),U(O(y$,1),Z,171,0,[v$,m$,h$,g$,_$])))}function zKe(){zKe=C,IFt=nT((iA(),U(O(FFt,1),Z,368,0,[T4,S4,E4,C4,w4])))}function BKe(){BKe=C,MLt=nT((Wj(),U(O(jLt,1),Z,373,0,[u3,l3,f3,d3,p3])))}function VKe(){VKe=C,WLt=nT((MA(),U(O(ULt,1),Z,324,0,[BLt,S3,HLt,C3,VLt])))}function HKe(){HKe=C,nBt=nT((GT(),U(O(a8,1),Z,88,0,[r8,n8,t8,e8,i8])))}function UKe(){UKe=C,FRt=nT((uO(),U(O(L3,1),Z,170,0,[F3,P3,M3,I3,N3])))}function WKe(){WKe=C,EBt=nT((pO(),U(O(I8,1),Z,256,0,[P8,F8,wBt,N8,TBt])))}function GKe(){GKe=C,ABt=nT((nP(),U(O(_5,1),TR,64,0,[h5,Z8,X8,m5,g5])))}function dx(){dx=C,OK=new pxe(`BY_SIZE`,0),kK=new pxe(`BY_SIZE_AND_SHAPE`,1)}function fx(){fx=C,Vq=new Ss(`EADES`,0),Hq=new Ss(`FRUCHTERMAN_REINGOLD`,1)}function px(){px=C,pZ=new zs(`READING_DIRECTION`,0),mZ=new zs(`ROTATION`,1)}function mx(){mx=C,vOt=new mee,yOt=new _ee,gOt=new vee,_Ot=new gee,bOt=new yee}function KKe(e){this.b=new T,this.a=new T,this.c=new T,this.d=new T,this.e=e}function qKe(e){this.g=e,this.f=new T,this.a=r.Math.min(this.g.c.c,this.g.d.c)}function JKe(e,t,n){Qd.call(this),Px(this),this.a=e,this.c=n,this.b=t.d,this.f=t.e}function YKe(e,t,n){var r,i;for(i=new w(n);i.a=0&&t0?t-1:t;return Qve($ve(Uqe(Qje(new di,n),e.n),e.j),e.k)}function vx(e){var t,n=(t=new si,t);tb((!e.q&&(e.q=new F(M7,e,11,10)),e.q),n)}function yx(e){return(e.i&2?`interface `:e.i&1?``:`class `)+(Ad(e),e.o)}function bx(e){return dT(e,AP)>0?AP:dT(e,xF)<0?xF:nm(e)}function xx(e){return e<3?(vS(e,Qvt),e+1):e=-.01&&e.a<=fL&&(e.a=0),e.b>=-.01&&e.b<=fL&&(e.b=0),e}function Tx(e){fM();var t,n=zV;for(t=0;tn&&(n=e[t]);return n}function lqe(e,t){var n=Qj(e.Dh(),t);if(!n)throw E(new Fi(HH+t+WH));return n}function Ex(e,t){for(var n=e;I_(n);)if(n=I_(n),n==t)return!0;return!1}function uqe(e,t){var n,r=t.a.ld(),i;for(n=P(t.a.md(),16).gc(),i=0;ie||e>t)throw E(new ia(`fromIndex: 0, toIndex: `+e+MI+t))}function kx(e){if(e<0)throw E(new Fi(`Illegal Capacity: `+e));this.g=this.aj(e)}function Ax(e,t){return uu(),fS(bF),r.Math.abs(e-t)<=bF||e==t||isNaN(e)&&isNaN(t)}function jx(e,t){var n,r,i,a;for(r=e.d,i=0,a=r.length;i0&&(e.a/=t,e.b/=t),e}function Mx(e){var t;return e.w?e.w:(t=jze(e),t&&!t.Vh()&&(e.w=t),t)}function Nx(e,t){var n,r=e.a;n=V$e(e,t,null),r!=t&&!e.e&&(n=JN(e,t,n)),n&&n.oj()}function xqe(e,t,n){var r=t,i;do i=D(e.p[r.p])+n,e.p[r.p]=i,r=e.a[r.p];while(r!=t)}function Sqe(e,t,n){var r=function(){return e.apply(r,arguments)};return t.apply(r,n),r}function Cqe(e){var t;return e==null?null:(t=P(e,195),E7e(t,t.length))}function H(e,t){if(e.g==null||t>=e.i)throw E(new wl(t,e.i));return e.Wi(t,e.g[t])}function wqe(e,t){Vg();var n,r=new T;for(n=0;n=14&&t<=16))),e}function iS(e,t){var n;return Gh(t),n=e[`:`+t],$f(!!n,`Enum constant undefined: `+t),n}function aS(e,t,n,r,i,a){var o=fh(e,t);return Wqe(n,o),o.i=i?8:0,o.f=r,o.e=i,o.g=a,o}function Gqe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=1,this.c=e,this.a=n}function Kqe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=2,this.c=e,this.a=n}function qqe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=6,this.c=e,this.a=n}function Jqe(e,t,n,r,i){this.d=t,this.k=r,this.f=i,this.o=-1,this.p=7,this.c=e,this.a=n}function Yqe(e,t,n,r,i){this.d=t,this.j=r,this.e=i,this.o=-1,this.p=4,this.c=e,this.a=n}function Xqe(e,t){var n,r,i,a;for(r=t,i=0,a=r.length;i=0))throw E(new Fi(`tolerance (`+e+`) must be >= 0`));return e}function aJe(e,t){var n;return j(t,44)?e.c.Mc(t):(n=uD(e,t),BD(e,t),n)}function pS(e,t,n){return aT(e,t),GS(e,n),Zx(e,0),Qx(e,1),RT(e,!0),FT(e,!0),e}function mS(e,t){var n=e.gc();if(t<0||t>n)throw E(new lf(t,n));return new LOe(e,t)}function hS(e,t){e.b=r.Math.max(e.b,t.d),e.e+=t.r+(e.a.c.length==0?0:e.c),M(e.a,t)}function oJe(e){Md(e.c>=0),Q0e(e.d,e.c)<0&&(e.a=e.a-1&e.d.a.length-1,e.b=e.d.c),e.c=-1}function gS(e){var t,n;for(n=e.c.Cc().Kc();n.Ob();)t=P(n.Pb(),16),t.$b();e.c.$b(),e.d=0}function sJe(e){var t,n,r,i;for(n=e.a,r=0,i=n.length;r=0}function kJe(e,t){e.r>0&&e.c0&&e.g!=0&&kJe(e.i,t/e.r*e.i.d))}function AJe(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,1,n,e.c))}function SS(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,4,n,e.c))}function CS(e,t){var n=e.k;e.k=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,2,n,e.k))}function wS(e,t){var n=e.D;e.D=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,2,n,e.D))}function TS(e,t){var n=e.f;e.f=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,8,n,e.f))}function ES(e,t){var n=e.i;e.i=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,7,n,e.i))}function jJe(e,t){var n=e.a;e.a=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,8,n,e.a))}function MJe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,0,n,e.b))}function NJe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,0,n,e.b))}function PJe(e,t){var n=e.c;e.c=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,1,n,e.c))}function FJe(e,t){var n=e.d;e.d=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,1,n,e.d))}function IJe(e,t,n){var r;e.b=t,e.a=n,r=(e.a&512)==512?new y_e:new Qle,e.c=Ust(r,e.b,e.a)}function LJe(e,t){return aM(e.e,t)?(Qo(),ex(t)?new hp(t,e):new Qc(t,e)):new ZSe(t,e)}function RJe(e){var t,n;return 0>e?new _be:(t=e+1,n=new tUe(t,e),new pDe(null,n))}function zJe(e,t){Vg();var n=new go(1);return rl(e)?H_(n,e,t):XA(n.f,e,t),new Kn(n)}function BJe(e,t){var n=e.c,r=t.e[e.p];return r>0?P(Ep(n.a,r-1),10):null}function VJe(e,t){var n=e.o+e.p,r=t.o+t.p;return nt?(t<<=1,t>0?t:mF):t}function DS(e){switch(yTe(e.e!=3),e.e){case 2:return!1;case 0:return!0}return VUe(e)}function WJe(e,t){var n;return j(t,8)?(n=P(t,8),e.a==n.a&&e.b==n.b):!1}function GJe(e,t){var n=new Mt;P(t.b,68),P(t.b,68),P(t.b,68),Dx(t.a,new Uf(e,n,t))}function KJe(e,t){var n,r;for(r=t.vc().Kc();r.Ob();)n=P(r.Pb(),44),Hk(e,n.ld(),n.md())}function qJe(e,t){var n=e.d;e.d=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,11,n,e.d))}function OS(e,t){var n=e.j;e.j=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,13,n,e.j))}function JJe(e,t){var n=e.b;e.b=t,e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,1,21,n,e.b))}function YJe(e,t){(fy(),_K?null:t.c).length==0&&vDe(t,new xe),H_(e.a,_K?null:t.c,t)}function XJe(e,t){t.Ug(`Hierarchical port constraint processing`,1),G2e(e),pvt(e),t.Vg()}function kS(){kS=C,jX=new Ps(`START`,0),AX=new Ps(`MIDDLE`,1),kX=new Ps(`END`,2)}function AS(){AS=C,b4=new aSe(`P1_NODE_PLACEMENT`,0),x4=new aSe(`P2_EDGE_ROUTING`,1)}function jS(){jS=C,iJ=new yr(sbt),aJ=new yr(cbt),rJ=new yr(lbt),nJ=new yr(ubt)}function MS(e){var t;return Df(e.f.g,e.d),jd(e.b),e.c=e.a,t=P(e.a.Pb(),44),e.b=FXe(e),t}function NS(e){var t;return e.b==null?(Xo(),Xo(),a9):(t=e.ul()?e.tl():e.sl(),t)}function ZJe(e,t){var n=t==null?-1:Ab(e.b,t,0);return n<0?!1:(LS(e,n),!0)}function PS(e,t){var n;return Gh(t),n=t.g,!e.b[n]&&(Sh(e.b,n,t),++e.c,!0)}function FS(e,t){var n=1-t,r=e.a[n];return e.a[n]=r.a[t],r.a[t]=e,e.b=!0,r.b=!1,r}function QJe(e,t){var n,r;for(r=t.Kc();r.Ob();)n=P(r.Pb(),272),e.b=!0,Lm(e.e,n),n.b=e}function $Je(e,t){var n=P(K(e,(mP(),n0)),8),r=P(K(t,n0),8);return aE(n.b,r.b)}function IS(e,t,n){var r,i,a=t>>5;return i=t&31,r=uv(um(e.n[n][a],nm(cm(i,1))),3),r}function eYe(e,t,n){var r,i,a=e.a.length-1;for(i=e.b,r=0;r0):(!e.c&&(e.c=Q_(LC(e.f))),e.c).e}function fYe(e,t){t?e.B??(e.B=e.D,e.D=null):e.B!=null&&(e.D=e.B,e.B=null)}function pYe(e,t){return ow(),e==kJ&&t==MJ||e==MJ&&t==kJ||e==jJ&&t==AJ||e==AJ&&t==jJ}function mYe(e,t){return ow(),e==kJ&&t==AJ||e==kJ&&t==jJ||e==MJ&&t==jJ||e==MJ&&t==AJ}function hYe(e,t){return uu(),fS(fL),r.Math.abs(0-t)<=fL||t==0?0:e/t}function gYe(e,t){return D(N(Ju(MT(gg(new Mp(null,new cv(e.c.b,16)),new Zpe(e)),t))))}function $S(e,t){return D(N(Ju(MT(gg(new Mp(null,new cv(e.c.b,16)),new Xpe(e)),t))))}function _Ye(){return uM(),U(O($Z,1),Z,259,0,[WZ,KZ,qZ,JZ,YZ,XZ,QZ,UZ,GZ,ZZ])}function vYe(){return FM(),U(O(WMt,1),Z,243,0,[Y0,q0,J0,VMt,HMt,BMt,UMt,X0,G0,K0])}function yYe(e,t){var n;t.Ug(`General Compactor`,1),n=$1e(P(J(e,(PA(),A4)),393)),n.Cg(e)}function bYe(e,t){var n=P(J(e,(PA(),j4)),17),r=P(J(t,j4),17);return _u(n.a,r.a)}function eC(e,t,n){var r,i;for(i=dO(e,0);i.b!=i.d.c;)r=P(Lv(i),8),r.a+=t,r.b+=n;return e}function tC(e,t,n){var r;for(r=e.b[n&e.f];r;r=r.b)if(n==r.a&&zh(t,r.g))return r;return null}function nC(e,t,n){var r;for(r=e.c[n&e.f];r;r=r.d)if(n==r.f&&zh(t,r.i))return r;return null}function xYe(e,t,n){var r=0,i,a;for(i=0;i>>31;r!=0&&(e[n]=r)}function rC(e,t,n,r,i,a){var o;this.c=e,o=new T,t3e(e,o,t,e.b,n,r,i,a),this.a=new bv(o,0)}function SYe(){this.c=new Ya(0),this.b=new Ya(PV),this.d=new Ya(txt),this.a=new Ya(RL)}function iC(e,t,n,r,i,a,o){so.call(this,e,t),this.d=n,this.e=r,this.c=i,this.b=a,this.a=Oy(o)}function aC(e,t,n,r,i,a,o,s,c,l,u,d,f){return ftt(e,t,n,r,i,a,o,s,c,l,u,d,f),mE(e,!1),e}function CYe(e){return e.b.c.i.k==(DA(),GJ)?P(K(e.b.c.i,(Y(),WQ)),12):e.b.c}function wYe(e){return e.b.d.i.k==(DA(),GJ)?P(K(e.b.d.i,(Y(),WQ)),12):e.b.d}function TYe(e){var t=Ov(e);return ol(t.a,0)?(So(),So(),sEt):(So(),new _Ee(t.b))}function oC(e){var t=LBe(e);return ol(t.a,0)?(xo(),xo(),sK):(xo(),new gd(t.b))}function sC(e){var t=LBe(e);return ol(t.a,0)?(xo(),xo(),sK):(xo(),new gd(t.c))}function EYe(e){switch(e.g){case 2:return nP(),g5;case 4:return nP(),X8;default:return e}}function DYe(e){switch(e.g){case 1:return nP(),m5;case 3:return nP(),Z8;default:return e}}function OYe(e){switch(e.g){case 0:return new Doe;case 1:return new Ooe;default:return null}}function cC(){cC=C,dX=new Wd(`edgelabelcenterednessanalysis.includelabel`,(rd(),vG))}function lC(){lC=C,kNt=HD(pCe(vp(vp(new Zh,(vA(),bJ),(yP(),KY)),xJ,IY),SJ),GY)}function kYe(){kYe=C,NNt=HD(pCe(vp(vp(new Zh,(vA(),bJ),(yP(),KY)),xJ,IY),SJ),GY)}function uC(){uC=C,n9=new p_e,r9=U(O(w7,1),qU,179,0,[]),eHt=U(O(M7,1),Cwt,62,0,[])}function dC(){dC=C,aY=new xxe(`TO_INTERNAL_LTR`,0),iY=new xxe(`TO_INPUT_DIRECTION`,1)}function fC(){fC=C,tY=new Tee,$J=new Eee,eY=new Dee,QJ=new Oee,nY=new kee,rY=new Aee}function AYe(e,t){t.Ug(Mbt,1),KE(kbe(new ar((Po(),new Tg(e,!1,!1,new Wt))))),t.Vg()}function jYe(e,t,n){n.Ug(`DFS Treeifying phase`,1),k0e(e,t),Yot(e,t),e.a=null,e.b=null,n.Vg()}function pC(e,t){return rd(),rl(e)?zUe(e,kd(t)):al(e)?dm(e,N(t)):il(e)?UNe(e,Od(t)):e.Fd(t)}function mC(e,t){var n,r;for(Gh(t),r=t.vc().Kc();r.Ob();)n=P(r.Pb(),44),e.zc(n.ld(),n.md())}function MYe(e,t,n){var r;for(r=n.Kc();r.Ob();)if(!Kv(e,t,r.Pb()))return!1;return!0}function NYe(e,t,n,r,i){var a;return n&&(a=eD(t.Dh(),e.c),i=n.Rh(t,-1-(a==-1?r:a),null,i)),i}function PYe(e,t,n,r,i){var a;return n&&(a=eD(t.Dh(),e.c),i=n.Th(t,-1-(a==-1?r:a),null,i)),i}function FYe(e){var t;if(e.b==-2){if(e.e==0)t=-1;else for(t=0;e.a[t]==0;t++);e.b=t}return e.b}function IYe(e){if(Gh(e),e.length==0)throw E(new aa(`Zero length BigInteger`));uut(this,e)}function hC(e){this.i=e.gc(),this.i>0&&(this.g=this.aj(this.i+(this.i/8|0)+1),e.Qc(this.g))}function LYe(e,t,n){this.g=e,this.d=t,this.e=n,this.a=new T,Utt(this),Vg(),hu(this.a,null)}function gC(e,t){t.q=e,e.d=r.Math.max(e.d,t.r),e.b+=t.d+(e.a.c.length==0?0:e.c),M(e.a,t)}function _C(e,t){var n,r,i=e.c,a;return n=e.c+e.b,a=e.d,r=e.d+e.a,t.a>i&&t.aa&&t.bi?n=i:sv(t,n+1),e.a=p_(e.a,0,t)+(``+r)+Ch(e.a,n)}function QYe(e,t){e.a=yE(e.a,1),e.c=r.Math.min(e.c,t),e.b=r.Math.max(e.b,t),e.d=yE(e.d,t)}function $Ye(e,t){return t1||e.Ob())return++e.a,e.g=0,t=e.i,e.Ob(),t;throw E(new Hr)}function fXe(e){switch(e.a.g){case 1:return new Yxe;case 3:return new P3e;default:return new Nue}}function pXe(e,t){switch(t){case 1:return!!e.n&&e.n.i!=0;case 2:return e.k!=null}return yBe(e,t)}function LC(e){return iI>22),i=e.h+t.h+(r>>22);return vu(n&QF,r&QF,i&$F)}function NXe(e,t){var n=e.l-t.l,r=e.m-t.m+(n>>22),i=e.h-t.h+(r>>22);return vu(n&QF,r&QF,i&$F)}function PXe(e){var t,n;for(Wgt(e),n=new w(e.d);n.ar)throw E(new lf(t,r));return e.Si()&&(n=uRe(e,n)),e.Ei(t,n)}function pw(e,t,n,r,i){var a,o;for(o=n;o<=i;o++)for(a=t;a<=r;a++)sk(e,a,o)||EM(e,a,o,!0,!1)}function uZe(e){fM();var t,n=V(K3,X,8,2,0,1),r=0;for(t=0;t<2;t++)r+=.5,n[t]=Y4e(r,e);return n}function mw(e){var t=~e.l+1&QF,n=~e.m+ +(t==0)&QF;return vu(t,n,~e.h+ +(t==0&&n==0)&$F)}function dZe(e){var t;if(e<0)return xF;if(e==0)return 0;for(t=mF;(t&e)==0;t>>=1);return t}function hw(e,t,n){return e>=128?!1:cl(e<64?uv(cm(1,e),n):uv(cm(1,e-64),t),0)}function gw(e,t,n){return n==null?(!e.q&&(e.q=new Dr),My(e.q,t)):(!e.q&&(e.q=new Dr),Qh(e.q,t,n)),e}function W(e,t,n){return n==null?(!e.q&&(e.q=new Dr),My(e.q,t)):(!e.q&&(e.q=new Dr),Qh(e.q,t,n)),e}function fZe(e){var t,n=new Py;return VC(n,e),W(n,(jS(),iJ),e),t=new Dr,gft(e,n,t),$ht(e,n,t),n}function pZe(e){var t=e.t-e.k[e.o.p]*e.d+e.j[e.o.p]>e.f,n=e.u+e.e[e.o.p]*e.d>e.f*e.s*e.d;return t||n}function mZe(e,t){var n=!1,r=e.a[t].length,i,a;for(a=0;a=0,`Negative initial capacity`),$f(t>=0,`Non-positive load factor`),Pm(this)}function CZe(e,t,n,r,i){var a,o=e.length;if(a=n.length,t<0||r<0||i<0||t+i>o||r+i>a)throw E(new bge)}function wZe(e,t){Vg();var n,r,i,a,o=!1;for(r=t,i=0,a=r.length;i1||t>=0&&e.b<3)}function ww(e){var t=~e.l+1&QF,n=~e.m+ +(t==0)&QF,r=~e.h+ +(t==0&&n==0)&$F;e.l=t,e.m=n,e.h=r}function IZe(e){Vg();var t,n,r=1;for(n=e.Kc();n.Ob();)t=n.Pb(),r=31*r+(t==null?0:US(t)),r|=0;return r}function LZe(e,t,n,r,i){var a=$rt(e,t);return n&&ww(a),i&&(e=s3e(e,t),mG=r?mw(e):vu(e.l,e.m,e.h)),a}function RZe(e,t,n){e.g=WA(e,t,(nP(),X8),e.b),e.d=WA(e,n,X8,e.b),e.g.c!=0&&e.d.c!=0&&f9e(e)}function zZe(e,t,n){e.g=WA(e,t,(nP(),g5),e.j),e.d=WA(e,n,g5,e.j),e.g.c!=0&&e.d.c!=0&&f9e(e)}function BZe(e,t){switch(t){case 7:return!!e.e&&e.e.i!=0;case 8:return!!e.d&&e.d.i!=0}return JE(e,t)}function VZe(e,t){switch(t.g){case 0:j(e.b,641)||(e.b=new XYe);break;case 1:j(e.b,642)||(e.b=new aMe)}}function HZe(e){switch(e.g){case 0:return new Poe;default:throw E(new Fi(fH+(e.f==null?``+e.g:e.f)))}}function UZe(e){switch(e.g){case 0:return new Moe;default:throw E(new Fi(fH+(e.f==null?``+e.g:e.f)))}}function WZe(e,t,n){return!Xa(hg(new Mp(null,new cv(e.c,16)),new rr(new bSe(t,n)))).Bd((wo(),SK))}function GZe(e,t){return Ou(cO(P(K(t,(rN(),c4)),88)),new k(e.c.e.a-e.b.e.a,e.c.e.b-e.b.e.b))<=0}function KZe(e,t){for(;e.g==null&&!e.c?lRe(e):e.g==null||e.i!=0&&P(e.g[e.i-1],51).Ob();)KSe(t,Pj(e))}function Tw(e){var t,n;for(n=new w(e.a.b);n.ar)}function ZZe(e){return M(e.c,(lw(),ORt)),Ax(e.a,D(N(hO((aD(),O0)))))?new Sse:new nhe(e)}function QZe(e){for(;!e.d||!e.d.Ob();)if(e.b&&!qi(e.b))e.d=P(Fm(e.b),51);else return null;return e.d}function $Ze(e){switch(e.g){case 1:return txt;default:case 2:return 0;case 3:return RL;case 4:return PV}}function eQe(){xP();var e;return JHt||(e=uEe(oP(`M`,!0)),e=Rp(oP(`M`,!1),e),JHt=e,JHt)}function Mw(){Mw=C,I5=new qc(`ELK`,0),QBt=new qc(`JSON`,1),ZBt=new qc(`DOT`,2),$Bt=new qc(`SVG`,3)}function Nw(){Nw=C,c2=new ac(`STACKED`,0),o2=new ac(`REVERSE_STACKED`,1),s2=new ac(`SEQUENCED`,2)}function Pw(){Pw=C,PPt=new mc(wR,0),B2=new mc(`MIDDLE_TO_MIDDLE`,1),z2=new mc(`AVOID_OVERLAP`,2)}function Fw(){Fw=C,vX=new cne,yX=new lne,VOt=new one,BOt=new une,zOt=new sne,_X=(Gh(zOt),new le)}function Iw(){Iw=C,vBt=new iu(15),_Bt=new ou((vP(),A6),vBt),h8=V6,pBt=rzt,mBt=w6,gBt=E6,hBt=T6}function Lw(e,t){var n,r,i,a,o;for(r=t,i=0,a=r.length;i=e.b.c.length||(sQe(e,2*t+1),n=2*t+2,n0&&(t.Cd(n),n.i&&n1e(n))}function lQe(e,t,n){var r;for(r=n-1;r>=0&&e[r]===t[r];r--);return r<0?0:rs(uv(e[r],_I),uv(t[r],_I))?-1:1}function uQe(e,t,n){var r,i;this.g=e,this.c=t,this.a=this,this.d=this,i=UJe(n),r=V(PTt,fF,227,i,0,1),this.b=r}function Vw(e,t,n,r,i){var a,o;for(o=n;o<=i;o++)for(a=t;a<=r;a++)if(sk(e,a,o))return!0;return!1}function dQe(e,t){var n,r;for(r=e.Zb().Cc().Kc();r.Ob();)if(n=P(r.Pb(),16),n.Hc(t))return!0;return!1}function fQe(e,t,n){var r,i,a,o;for(Gh(n),o=!1,a=e.fd(t),i=n.Kc();i.Ob();)r=i.Pb(),a.Rb(r),o=!0;return o}function Hw(e,t){var n,r=P(NC(e.a,4),129);return n=V(g7,FU,424,t,0,1),r!=null&&tN(r,0,n,0,r.length),n}function pQe(e,t){var n=new yM(!!(e.f&256),e.i,e.a,e.d,!!(e.f&16),e.j,e.g,t);return e.e??(n.c=e),n}function mQe(e,t){var n;return e===t?!0:j(t,85)?(n=P(t,85),eet(am(e),n.vc())):!1}function hQe(e,t,n){var r,i;for(i=n.Kc();i.Ob();)if(r=P(i.Pb(),44),e.Be(t,r.md()))return!0;return!1}function gQe(e,t,n){return e.d[t.p][n.p]||(p4e(e,t,n),e.d[t.p][n.p]=!0,e.d[n.p][t.p]=!0),e.a[t.p][n.p]}function _Qe(e,t){var n;return!e||e==t||!yd(t,(Y(),NQ))?!1:(n=P(K(t,(Y(),NQ)),10),n!=e)}function Uw(e){switch(e.i){case 2:return!0;case 1:return!1;case-1:++e.c;default:return e.$l()}}function vQe(e){switch(e.i){case-2:return!0;case-1:return!1;case 1:--e.c;default:return e._l()}}function yQe(e){yRe.call(this,`The given string does not match the expected format for individual spacings.`,e)}function bQe(e,t){var n;t.Ug(`Min Size Preprocessing`,1),n=Zet(e),OO(e,(xM(),Y4),n.a),OO(e,K4,n.b),t.Vg()}function xQe(e){var t=0,n,r=V(K3,X,8,e.b,0,1);for(n=dO(e,0);n.b!=n.d.c;)r[t++]=P(Lv(n),8);return r}function Ww(e,t,n){var r=new vo,i,a;for(a=dO(n,0);a.b!=a.d.c;)i=P(Lv(a),8),up(r,new Vl(i));fQe(e,t,r)}function SQe(e,t){var n=yE(e,t);return rs(fv(e,t),0)|sl(fv(e,n),0)?n:yE(tF,fv(um(n,63),1))}function CQe(e,t){var n=P(e.d.Bc(t),16),r;return n?(r=e.e.hc(),r.Gc(n),e.e.d-=n.gc(),n.$b(),r):null}function wQe(e){var t=e.a.c.length;if(t>0)return gm(t-1,e.a.c.length),Ay(e.a,t-1);throw E(new Sge)}function TQe(e,t,n){if(e>t)throw E(new Fi(BI+e+vyt+t));if(e<0||t>n)throw E(new ia(BI+e+VI+t+MI+n))}function Gw(e,t){e.D==null&&e.B!=null&&(e.D=e.B,e.B=null),wS(e,t==null?null:(Gh(t),t)),e.C&&e.hl(null)}function EQe(e,t){var n=hO((aD(),O0))!=null&&t.Sg()!=null?D(N(t.Sg()))/D(N(hO(O0))):1;Qh(e.b,t,n)}function DQe(e,t){var n,r=e.c[t];if(r!=0)for(e.c[t]=0,e.d-=r,n=t+1;nNV?e-n>NV:n-e>NV}function ZQe(e,t){var n;for(n=0;ni&&(Z8e(t.q,i),r=n!=t.q.d)),r}function e$e(e,t){var n,i,a,o,s,c,l=t.i,u=t.j;return i=e.f,a=i.i,o=i.j,s=l-a,c=u-o,n=r.Math.sqrt(s*s+c*c),n}function t$e(e,t){var n,r=KD(e);return r||(!_Vt&&(_Vt=new Jse),n=(NN(),Vit(t)),r=new qhe(n),tb(r.El(),e)),r}function sT(e,t){var n=P(e.c.Bc(t),16),r;return n?(r=e.hc(),r.Gc(n),e.d-=n.gc(),n.$b(),e.mc(r)):e.jc()}function n$e(e,t){var n,r=Lj(e.d,1)!=0;for(n=!0;n;)n=!1,n=t.c.mg(t.e,r),n|=$j(e,t,r,!1),r=!r;WS(e)}function r$e(e,t,n,r){var i,a;e.a=t,a=+!r,e.f=(i=new uet(e.c,e.a,n,a),new Hct(n,e.a,i,e.e,e.b,e.c==(sS(),g2)))}function cT(e){var t;return jd(e.a!=e.b),t=e.d.a[e.a],lDe(e.b==e.d.c&&t!=null),e.c=e.a,e.a=e.a+1&e.d.a.length-1,t}function i$e(e){var t;if(e.c!=0)return e.c;for(t=0;t=e.c.b:e.a<=e.c.b))throw E(new Hr);return t=e.a,e.a+=e.c.c,++e.b,G(t)}function lT(e){var t=new Dwe(e.a);return VC(t,e),W(t,(Y(),WQ),e),t.o.a=e.g,t.o.b=e.f,t.n.a=e.i,t.n.b=e.j,t}function uT(e){return(nP(),c5).Hc(e.j)?D(N(K(e,(Y(),c$)))):Sw(U(O(K3,1),X,8,0,[e.i.n,e.n,e.a])).b}function o$e(e){var t=Wl(ONt);return P(K(e,(Y(),OQ)),21).Hc((uM(),YZ))&&vp(t,(vA(),bJ),(yP(),eX)),t}function s$e(e){var t,n,r,i=new Jr;for(r=new w(e);r.a=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,--r);return t<0?1/i:i}function f$e(e,t){var n,r,i=1;for(n=e,r=t>=0?t:-t;r>0;)r%2==0?(n*=n,r=r/2|0):(i*=n,--r);return t<0?1/i:i}function pT(e,t){var n,r,i,a=(i=e?KD(e):null,btt((r=t,i&&i.Gl(),r)));return a==t&&(n=KD(e),n&&n.Gl()),a}function p$e(e,t,n){var r,i=e.f;return e.f=t,e.Db&4&&!(e.Db&1)&&(r=new Sm(e,1,0,i,t),n?n.nj(r):n=r),n}function m$e(e,t,n){var r,i=e.b;return e.b=t,e.Db&4&&!(e.Db&1)&&(r=new Sm(e,1,3,i,t),n?n.nj(r):n=r),n}function mT(e,t,n){var r,i=e.a;return e.a=t,e.Db&4&&!(e.Db&1)&&(r=new Sm(e,1,1,i,t),n?n.nj(r):n=r),n}function h$e(e){var t,n,r,i;if(e!=null){for(n=0;n=r||t-129&&e<128?(iMe(),t=e+128,n=OG[t],!n&&(n=OG[t]=new jn(e)),n):new jn(e)}function xT(e){var t,n;return e>-129&&e<128?(GMe(),t=e+128,n=FG[t],!n&&(n=FG[t]=new Nn(e)),n):new Nn(e)}function C$e(e,t){var n;e.a.c.length>0&&(n=P(Ep(e.a,e.a.c.length-1),579),tQe(n,t))||M(e.a,new nUe(t))}function w$e(e){Lf();var t=e.d.c-e.e.c,n=P(e.g,154);Dx(n.b,new Rpe(t)),Dx(n.c,new zpe(t)),ly(n.i,new Bpe(t))}function T$e(e){var t=new ta;return t.a+=`VerticalSegment `,hl(t,e.e),t.a+=` `,gl(t,_Te(new Xi,new w(e.k))),t.a}function ST(e,t){var n=0,r,i;for(i=SE(e,t).Kc();i.Ob();)r=P(i.Pb(),12),n+=K(r,(Y(),QQ))==null?0:1;return n}function CT(e,t,n){var r=0,i,a;for(a=dO(e,0);a.b!=a.d.c&&(i=D(N(Lv(a))),!(i>n));)i>=t&&++r;return r}function E$e(e,t){ph(e);try{return e._b(t)}catch(e){if(e=ew(e),j(e,212)||j(e,169))return!1;throw E(e)}}function wT(e,t){ph(e);try{return e.Hc(t)}catch(e){if(e=ew(e),j(e,212)||j(e,169))return!1;throw E(e)}}function D$e(e,t){ph(e);try{return e.Mc(t)}catch(e){if(e=ew(e),j(e,212)||j(e,169))return!1;throw E(e)}}function TT(e,t){ph(e);try{return e.xc(t)}catch(e){if(e=ew(e),j(e,212)||j(e,169))return null;throw E(e)}}function O$e(e,t){ph(e);try{return e.Bc(t)}catch(e){if(e=ew(e),j(e,212)||j(e,169))return null;throw E(e)}}function ET(e,t){switch(t.g){case 2:case 1:return SE(e,t);case 3:case 4:return UE(SE(e,t))}return Vg(),Vg(),QG}function DT(e){var t;return e.Db&64?Aj(e):(t=new Wu(Aj(e)),t.a+=` (name: `,pl(t,e.zb),t.a+=`)`,t.a)}function k$e(e){var t=P(ix(e.c.c,``),233);return t||(t=new ev(Ca(Sa(new Qt,``),`Other`)),oO(e.c.c,``,t)),t}function OT(e,t,n){var r,i=e.sb;return e.sb=t,e.Db&4&&!(e.Db&1)&&(r=new Sm(e,1,4,i,t),n?n.nj(r):n=r),n}function kT(e,t,n){var r,i=e.r;return e.r=t,e.Db&4&&!(e.Db&1)&&(r=new Sm(e,1,8,i,e.r),n?n.nj(r):n=r),n}function A$e(e,t,n){var r=new Hb(e.e,4,13,(i=t.c,i||(CP(),q7)),null,NO(e,t),!1),i;return n?n.nj(r):n=r,n}function j$e(e,t,n){var r=new Hb(e.e,3,13,null,(i=t.c,i||(CP(),q7)),NO(e,t),!1),i;return n?n.nj(r):n=r,n}function AT(e,t){var n=P(t,691),r=n.el();return!r&&n.fl(r=j(t,90)?new QSe(e,P(t,29)):new dBe(e,P(t,156))),r}function jT(e,t,n){var r;e._i(e.i+1),r=e.Zi(t,n),t!=e.i&&tN(e.g,t,e.g,t+1,e.i-t),Sh(e.g,t,r),++e.i,e.Mi(t,n),e.Ni()}function M$e(e,t){var n;return t.a&&(n=t.a.a.length,e.a?gl(e.a,e.b):e.a=new Gu(e.d),TBe(e.a,t.a,t.d.length,n)),e}function N$e(e,t){var n;e.c=t,e.a=a0e(t),e.a<54&&(e.f=(n=t.d>1?CBe(t.a[0],t.a[1]):CBe(t.a[0],0),Dv(t.e>0?n:kb(n))))}function MT(e,t){var n=new Re;return e.a.Bd(n)?(Bu(),new wi(Gh(nKe(e,n.a,t)))):(Hh(e),Bu(),Bu(),oK)}function P$e(e,t){var n;e.c.length!=0&&(n=P(rO(e,V(UJ,jR,10,e.c.length,0,1)),199),zl(n,new mte),Unt(n,t))}function F$e(e,t){var n;e.c.length!=0&&(n=P(rO(e,V(UJ,jR,10,e.c.length,0,1)),199),zl(n,new hte),Unt(n,t))}function NT(e,t){return rl(e)?ff(e,t):al(e)?wOe(e,t):il(e)?(Gh(e),A(e)===A(t)):RNe(e)?e.Fb(t):Wp(e)?vCe(e,t):Oze(e,t)}function PT(e,t,n){if(t<0)Qtt(e,n);else{if(!n.rk())throw E(new Fi(HH+n.xe()+UH));P(n,69).wk().Ek(e,e.hi(),t)}}function I$e(e,t,n){if(e<0||t>n)throw E(new Mi(BI+e+VI+t+`, size: `+n));if(e>t)throw E(new Fi(BI+e+vyt+t))}function L$e(e){var t;return e.Db&64?Aj(e):(t=new Wu(Aj(e)),t.a+=` (source: `,pl(t,e.d),t.a+=`)`,t.a)}function R$e(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e>=48&&e<=57?e-48:0}function z$e(e){SP();var t,n,r,i;for(n=sO(),r=0,i=n.length;r=0?yD(e):Xm(yD(kb(e))))}function W$e(e,t,n,r,i,a){this.e=new T,this.f=(uS(),i2),M(this.e,e),this.d=t,this.a=n,this.b=r,this.f=i,this.c=a}function G$e(e,t,n){e.n=Dp(Y9,[X,dI],[376,28],14,[n,C_(r.Math.ceil(t/32))],2),e.o=t,e.p=n,e.j=t-1>>1,e.k=n-1>>1}function K$e(e){return e-=e>>1&1431655765,e=(e>>2&858993459)+(e&858993459),e=(e>>4)+e&252645135,e+=e>>8,e+=e>>16,e&63}function q$e(e,t){var n,r;for(r=new Lu(e);r.e!=r.i.gc();)if(n=P(gO(r),142),A(t)===A(n))return!0;return!1}function J$e(e,t,n){var r,i,a=(i=Mj(e.b,t),i);return a&&(r=P(jN(Lb(e,a),``),29),r)?Hit(e,r,t,n):null}function UT(e,t,n){var r,i,a=(i=Mj(e.b,t),i);return a&&(r=P(jN(Lb(e,a),``),29),r)?Uit(e,r,t,n):null}function Y$e(e,t){var n=Bx(e.i,t);if(n==null)throw E(new Vi(`Node did not exist in input.`));return yC(t,n),null}function X$e(e,t){var n=Qj(e,t);if(j(n,331))return P(n,35);throw E(new Fi(HH+t+`' is not a valid attribute`))}function WT(e,t,n){var r=e.gc();if(t>r)throw E(new lf(t,r));if(e.Si()&&e.Hc(n))throw E(new Fi(vU));e.Gi(t,n)}function Z$e(e,t){t.Ug(`Sort end labels`,1),To(hg(ox(new Mp(null,new cv(e.b,16)),new Qee),new $ee),new ete),t.Vg()}function GT(){GT=C,r8=new jc(dL,0),n8=new jc(lL,1),t8=new jc(cL,2),e8=new jc(hL,3),i8=new jc(`UP`,4)}function KT(){KT=C,m3=new Tc(`P1_STRUCTURE`,0),h3=new Tc(`P2_PROCESSING_ORDER`,1),g3=new Tc(`P3_EXECUTION`,2)}function Q$e(){Q$e=C,jFt=HD(HD(Go(HD(HD(Go(vp(new Zh,(Ok(),P2),(LM(),R2)),F2),OPt),APt),I2),wPt),jPt)}function $$e(e){switch(P(K(e,(Y(),MQ)),311).g){case 1:W(e,MQ,(Zb(),iQ));break;case 2:W(e,MQ,(Zb(),oQ))}}function e1e(e){switch(e){case 0:return new a_e;case 1:return new r_e;case 2:return new i_e;default:throw E(new Lr)}}function t1e(e){switch(e.g){case 2:return n8;case 1:return t8;case 4:return e8;case 3:return i8;default:return r8}}function qT(e,t){switch(e.b.g){case 0:case 1:return t;case 2:case 3:return new wg(t.d,0,t.a,t.b);default:return null}}function JT(e){switch(e.g){case 1:return g5;case 2:return Z8;case 3:return X8;case 4:return m5;default:return h5}}function YT(e){switch(e.g){case 1:return m5;case 2:return g5;case 3:return Z8;case 4:return X8;default:return h5}}function XT(e){switch(e.g){case 1:return X8;case 2:return m5;case 3:return g5;case 4:return Z8;default:return h5}}function ZT(e,t,n,r){switch(t){case 1:return!e.n&&(e.n=new F(Q5,e,1,7)),e.n;case 2:return e.k}return W3e(e,t,n,r)}function QT(e,t,n){var r,i;return e.Pj()?(i=e.Qj(),r=dj(e,t,n),e.Jj(e.Ij(7,G(n),r,t,i)),r):dj(e,t,n)}function $T(e,t){var n,r,i;e.d==null?(++e.e,--e.f):(i=t.ld(),n=t.Bi(),r=(n&AP)%e.d.length,nWe(e,r,Zit(e,r,n,i)))}function eE(e,t){var n=(e.Bb&pF)!=0;t?e.Bb|=pF:e.Bb&=-1025,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,10,n,t))}function tE(e,t){var n=(e.Bb&uI)!=0;t?e.Bb|=uI:e.Bb&=-4097,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,12,n,t))}function nE(e,t){var n=(e.Bb&RU)!=0;t?e.Bb|=RU:e.Bb&=-8193,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,15,n,t))}function rE(e,t){var n=(e.Bb&zU)!=0;t?e.Bb|=zU:e.Bb&=-2049,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,11,n,t))}function n1e(e){var t;e.g&&(t=e.c.kg()?e.f:e.a,Ost(t.a,e.o,!0),Ost(t.a,e.o,!1),W(e.o,(mP(),Q1),(rA(),L8)))}function r1e(e){var t;if(!e.a)throw E(new Ii(`Cannot offset an unassigned cut.`));t=e.c-e.b,e.b+=t,NIe(e,t),MIe(e,t)}function i1e(e,t){var n=xh(e.k,t);if(n==null)throw E(new Vi(`Port did not exist in input.`));return yC(t,n),null}function a1e(e){var t,n;for(n=Git(Mx(e)).Kc();n.Ob();)if(t=kd(n.Pb()),JM(e,t))return _He((Zbe(),VVt),t);return null}function o1e(e){var t,n;for(n=e.p.a.ec().Kc();n.Ob();)if(t=P(n.Pb(),218),t.f&&e.b[t.c]<-1e-10)return t;return null}function s1e(e){var t,n=jh(new ta,91);for(t=!0;e.Ob();)t||(n.a+=PP),t=!1,hl(n,e.Pb());return(n.a+=`]`,n).a}function c1e(e){var t=new T,n,r;for(r=new w(e.b);r.at?1:e==t?e==0?aE(1/e,1/t):0:isNaN(e)?+!isNaN(t):-1}function u1e(e){var t=e.a[e.c-1&e.a.length-1];return t==null?null:(e.c=e.c-1&e.a.length-1,Sh(e.a,e.c,null),t)}function d1e(e){var t,n,r=0;for(n=e.length,t=0;t=1?n8:e8):n}function g1e(e){switch(P(K(e,(mP(),S1)),223).g){case 1:return new zre;case 3:return new Wre;default:return new Rre}}function lE(e){if(e.c)lE(e.c);else if(e.d)throw E(new Ii(`Stream already terminated, can't be modified or used`))}function uE(e,t,n){var r=e.a.get(t);return e.a.set(t,n===void 0?null:n),r===void 0?(++e.c,++e.b.g):++e.d,r}function _1e(e,t,n){var r,i;for(i=e.a.ec().Kc();i.Ob();)if(r=P(i.Pb(),10),$C(n,P(Ep(t,r.p),16)))return r;return null}function dE(e,t,n){var r=0;return t&&(Jl(e.a)?r+=t.f.a/2:r+=t.f.b/2),n&&(Jl(e.a)?r+=n.f.a/2:r+=n.f.b/2),r}function v1e(e,t,n){var r=n;!r&&(r=Qje(new di,0)),r.Ug(_bt,2),v4e(e.b,t,r.eh(1)),fmt(e,t,r.eh(1)),u_t(t,r.eh(1)),r.Vg()}function fE(e,t,n){var r=(Ia(),i=new tn,i),i;return Xx(r,t),Vx(r,n),e&&tb((!e.a&&(e.a=new ju(z5,e,5)),e.a),r),r}function pE(e){var t;return e.Db&64?Aj(e):(t=new Wu(Aj(e)),t.a+=` (identifier: `,pl(t,e.k),t.a+=`)`,t.a)}function mE(e,t){var n=(e.Bb&GH)!=0;t?e.Bb|=GH:e.Bb&=-32769,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,18,n,t))}function hE(e,t){var n=(e.Bb&GH)!=0;t?e.Bb|=GH:e.Bb&=-32769,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,18,n,t))}function gE(e,t){var n=(e.Bb&ZP)!=0;t?e.Bb|=ZP:e.Bb&=-16385,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,16,n,t))}function _E(e,t){var n=(e.Bb&pI)!=0;t?e.Bb|=pI:e.Bb&=-65537,e.Db&4&&!(e.Db&1)&&AC(e,new vy(e,1,20,n,t))}function vE(e){var t=V(K9,EF,28,2,15,1);return e-=pI,t[0]=(e>>10)+mI&OF,t[1]=(e&1023)+56320&OF,ND(t,0,t.length)}function y1e(e){var t=OA(e);return t>34028234663852886e22?cI:t<-34028234663852886e22?lI:t}function yE(e,t){var n;return Il(e)&&Il(t)&&(n=e+t,iI`+hv(t.c):`e_`+US(t),e.b&&e.c?hv(e.b)+`->`+hv(e.c):`e_`+US(e))}function S1e(e,t){return ff(t.b&&t.c?hv(t.b)+`->`+hv(t.c):`e_`+US(t),e.b&&e.c?hv(e.b)+`->`+hv(e.c):`e_`+US(e))}function CE(e,t){return uu(),fS(bF),r.Math.abs(e-t)<=bF||e==t||isNaN(e)&&isNaN(t)?0:et?1:Pl(isNaN(e),isNaN(t))}function wE(){wE=C,f8=new Nc(dL,0),u8=new Nc(`POLYLINE`,1),l8=new Nc(`ORTHOGONAL`,2),d8=new Nc(`SPLINES`,3)}function TE(){TE=C,IIt=new Sc(`ASPECT_RATIO_DRIVEN`,0),Q4=new Sc(`MAX_SCALE_DRIVEN`,1),FIt=new Sc(`AREA_DRIVEN`,2)}function C1e(e,t,n){var r;try{MZe(e,t,n)}catch(e){throw e=ew(e),j(e,606)?(r=e,E(new EUe(r))):E(e)}return t}function w1e(e){var t,n,r;for(n=0,r=e.length;nt&&r.Ne(e[a-1],e[a])>0;--a)o=e[a],Sh(e,a,e[a-1]),Sh(e,a-1,o)}function jE(e,t){var n=t.f,r,i,a,o;if(oO(e.c.d,n,t),t.g!=null)for(i=t.g,a=0,o=i.length;at){OBe(n);break}}Zm(n,t)}function A1e(e,t){var n,i=D(N(gD(Ev(t),(mP(),c0))));n=r.Math.max(0,i/2-.5),zk(t,n,1),M(e,new Oxe(t,n))}function j1e(e,t,n){var r;n.Ug(`Straight Line Edge Routing`,1),n.dh(t,mxt),r=P(J(t,(Pd(),y4)),27),ppt(e,r),n.dh(t,YV)}function ME(e,t){e.n.c.length==0&&M(e.n,new w_(e.s,e.t,e.i)),M(e.b,t),q4e(P(Ep(e.n,e.n.c.length-1),209),t),tft(e,t)}function NE(e){var t;this.a=(t=P(e.e&&e.e(),9),new xf(t,P(Yd(t,t.length),9),0)),this.b=V(WW,FP,1,this.a.a.length,5,1)}function PE(e){var t;return Array.isArray(e)&&e.Tm===ne?Ha($w(e))+`@`+(t=US(e)>>>0,t.toString(16)):e.toString()}function M1e(e,t){return e.h==eI&&e.m==0&&e.l==0?(t&&(mG=vu(0,0,0)),xCe(($b(),gG))):(t&&(mG=vu(e.l,e.m,e.h)),vu(0,0,0))}function N1e(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function P1e(e,t){switch(t.g){case 2:return e.b;case 1:return e.c;case 4:return e.d;case 3:return e.a;default:return!1}}function FE(e,t,n,r){switch(t){case 3:return e.f;case 4:return e.g;case 5:return e.i;case 6:return e.j}return ZT(e,t,n,r)}function IE(e,t){if(t==e.d)return e.e;if(t==e.e)return e.d;throw E(new Fi(`Node `+t+` not part of edge `+e))}function F1e(e,t){var n=Qj(e.Dh(),t);if(j(n,102))return P(n,19);throw E(new Fi(HH+t+`' is not a valid reference`))}function LE(e,t,n,r){if(t<0)Pat(e,n,r);else{if(!n.rk())throw E(new Fi(HH+n.xe()+UH));P(n,69).wk().Ck(e,e.hi(),t,r)}}function RE(e){var t;if(e.b){if(RE(e.b),e.b.d!=e.c)throw E(new Vr)}else e.d.dc()&&(t=P(e.f.c.xc(e.e),16),t&&(e.d=t))}function I1e(e){Rd();var t=e.o.b,n,r,i;for(r=P(P(Dy(e.r,(nP(),m5)),21),87).Kc();r.Ob();)n=P(r.Pb(),117),i=n.e,i.b+=t}function L1e(e){var t,n,r;for(this.a=new Rl,r=new w(e);r.a=i)return t.c+n;return t.c+t.b.gc()}function z1e(e,t){Nd();var n,r=LGe(e),i=t,a;for(bb(r,0,r.length,i),n=0;n0&&(r+=i,++n);return n>1&&(r+=e.d*(n-1)),r}function V1e(e){var t,n,r,i,a=m7e(e);return n=eo(e.c),r=!n,r&&(i=new Tn,hx(a,`knownLayouters`,i),t=new Mhe(i),ly(e.c,t)),a}function HE(e){var t,n,r=new $i;for(r.a+=`[`,t=0,n=e.gc();t0&&(sv(t-1,e.length),e.charCodeAt(t-1)==58)&&!zE(e,y7,b7))}function WE(e,t){var n;return A(e)===A(t)?!0:j(t,92)?(n=P(t,92),e.e==n.e&&e.d==n.d&&xHe(e,n.a)):!1}function GE(e){switch(nP(),e.g){case 4:return Z8;case 1:return X8;case 3:return m5;case 2:return g5;default:return h5}}function G1e(e){var t,n;if(e.b)return e.b;for(n=_K?null:e.d;n;){if(t=_K?null:n.b,t)return t;n=_K?null:n.d}return Co(),hK}function KE(e){var t,n,r=D(N(e.a.of((vP(),q6))));for(n=new w(e.a.Sf());n.a>5,t=e&31,r=V(q9,HF,28,n+1,15,1),r[n]=1<3;)i*=10,--a;e=(e+(i>>1))/i|0}return r.i=e,!0}function eD(e,t){var n=(e.i??aN(e),e.i),r=t.Lj(),i;if(r!=-1){for(i=n.length;r=0;--r)for(t=n[r],i=0;i>1,this.k=t-1>>1}function f0e(e){gb(),P(e.of((vP(),D6)),181).Hc((UM(),A5))&&(P(e.of(z6),181).Fc((rj(),J8)),P(e.of(D6),181).Mc(A5))}function p0e(e){var t=e.d==(GA(),WX),n=x5e(e);t&&!n||!t&&n?W(e.a,(mP(),J$),(RO(),Z3)):W(e.a,(mP(),J$),(RO(),X3))}function aD(){aD=C,zo(),O0=(mP(),v0),EMt=Oy(U(O(j3,1),_V,149,0,[s0,c0,u0,d0,m0,h0,g0,_0,b0,S0,l0,f0,y0]))}function m0e(e,t){var n=P(ay(e,cb(new Te,new we,new Ne,U(O(xK,1),Z,108,0,[(Zw(),yK)]))),15);return n.Qc(MMe(n.gc()))}function h0e(e,t){var n,r=new nr(e.a.ad(t,!0));if(r.a.gc()<=1)throw E(new zr);return n=r.a.ec().Kc(),n.Pb(),P(n.Pb(),40)}function g0e(e,t,n){var r=D(e.p[t.i.p])+D(e.d[t.i.p])+t.n.b+t.a.b;return D(e.p[n.i.p])+D(e.d[n.i.p])+n.n.b+n.a.b-r}function oD(e,t){var n;return e.i>0&&(t.lengthe.i&&Sh(t,e.i,null),t}function sD(e){var t;return e.Db&64?DT(e):(t=new Wu(DT(e)),t.a+=` (instanceClassName: `,pl(t,e.D),t.a+=`)`,t.a)}function cD(e){var t,n,r,i=0;for(n=0,r=e.length;n0&&(e._j(),r=t==null?0:US(t),i=(r&AP)%e.d.length,n=Zit(e,i,r,t),n!=-1)}function v0e(e,t){var n,i;e.a=yE(e.a,1),e.c=r.Math.min(e.c,t),e.b=r.Math.max(e.b,t),e.d+=t,n=t-e.f,i=e.e+n,e.f=i-e.e-n,e.e=i}function dD(e,t){switch(t){case 3:Ux(e,0);return;case 4:Wx(e,0);return;case 5:Gx(e,0);return;case 6:Kx(e,0);return}vT(e,t)}function fD(e,t){switch(t.g){case 1:return Jf(e.j,(fC(),$J));case 2:return Jf(e.j,(fC(),tY));default:return Vg(),Vg(),QG}}function pD(e){gh();var t=e.Pc();switch(t.length){case 0:return QW;case 1:return new wp(ph(t[0]));default:return new u_(w1e(t))}}function y0e(e,t){e.Xj();try{e.d.bd(e.e++,t),e.f=e.d.j,e.g=-1}catch(e){throw e=ew(e),j(e,77)?E(new Vr):E(e)}}function mD(){mD=C,c9=new Xse,iHt=new Zse,aHt=new Qse,oHt=new $se,sHt=new ece,cHt=new tce,lHt=new nce,uHt=new rce,dHt=new ice}function hD(e,t){Sl();var n=Kd((Ci(),Ci(),dG)),r=null;return t==n&&(r=P(v_(uG,e),624)),r||(r=new ZPe(e),t==n&&H_(uG,e,r)),r}function b0e(e){return IO(),(e.q?e.q:(Vg(),Vg(),$G))._b((mP(),V1))?P(K(e,V1),203):P(K(Bh(e),H1),203)}function gD(e,t){var n,r=null;return yd(e,(mP(),p0))&&(n=P(K(e,p0),96),n.pf(t)&&(r=n.of(t))),r??=K(Bh(e),t),r}function x0e(e,t){var n,r,i;return j(t,44)?(n=P(t,44),r=n.ld(),i=TT(e.Rc(),r),zh(i,n.md())&&(i!=null||e.Rc()._b(r))):!1}function _D(e,t){var n,r,i;return e.f>0&&(e._j(),r=t==null?0:US(t),i=(r&AP)%e.d.length,n=Knt(e,i,r,t),n)?n.md():null}function vD(e,t,n){var r,i,a;return e.Pj()?(r=e.i,a=e.Qj(),jT(e,r,t),i=e.Ij(3,null,t,r,a),n?n.nj(i):n=i):jT(e,e.i,t),n}function S0e(e,t,n){var r=new Hb(e.e,4,10,(i=t.c,j(i,90)?P(i,29):(CP(),J7)),null,NO(e,t),!1),i;return n?n.nj(r):n=r,n}function C0e(e,t,n){var r=new Hb(e.e,3,10,null,(i=t.c,j(i,90)?P(i,29):(CP(),J7)),NO(e,t),!1),i;return n?n.nj(r):n=r,n}function w0e(e){Rd();var t=new Vl(P(e.e.of((vP(),E6)),8));return e.B.Hc((UM(),T5))&&(t.a<=0&&(t.a=20),t.b<=0&&(t.b=20)),t}function yD(e){AM();var t,n=nm(e);return t=nm(um(e,32)),t==0?n>10||n<0?new Xv(1,n):YTt[n]:new Ize(n,t)}function bD(e,t){var n;return Il(e)&&Il(t)&&(n=e%t,iI=0?a=a.a[1]:(i=a,a=a.a[0])}return i}function OD(e,t,n){for(var r,i=null,a=e.b;a;){if(r=e.a.Ne(t,a.d),n&&r==0)return a;r<=0?a=a.a[0]:(i=a,a=a.a[1])}return i}function N0e(e,t,n,r){var i=!1,a,o;return mht(e.f,n,r)&&(_2e(e.f,e.a[t][n],e.a[t][r]),a=e.a[t],o=a[r],a[r]=a[n],a[n]=o,i=!0),i}function P0e(e,t,n){var r,i=P(xh(e.b,n),183),a,o;for(r=0,o=new w(t.j);o.a>5,r,i,a;return t&=31,i=e.d+n+(t==0?0:1),r=V(q9,HF,28,i,15,1),v7e(r,e.a,n,t),a=new Bm(e.e,i,r),Cv(a),a}function I0e(e,t){var n,r,i;for(r=new pm(Vu(OE(e).a.Kc(),new d));Cj(r);)if(n=P(by(r),18),i=n.d.i,i.c==t)return!1;return!0}function AD(e,t,n){var i,a,o,s=e.k,c=t.k;return i=n[s.g][c.g],a=N(gD(e,i)),o=N(gD(t,i)),r.Math.max((Gh(a),a),(Gh(o),o))}function L0e(){return Error.stackTraceLimit>0?(r.Error.stackTraceLimit=Error.stackTraceLimit=64,!0):`stack`in Error()}function R0e(e,t){return uu(),uu(),fS(bF),(r.Math.abs(e-t)<=bF||e==t||isNaN(e)&&isNaN(t)?0:et?1:Pl(isNaN(e),isNaN(t)))>0}function jD(e,t){return uu(),uu(),fS(bF),(r.Math.abs(e-t)<=bF||e==t||isNaN(e)&&isNaN(t)?0:et?1:Pl(isNaN(e),isNaN(t)))<0}function z0e(e,t){return uu(),uu(),fS(bF),(r.Math.abs(e-t)<=bF||e==t||isNaN(e)&&isNaN(t)?0:et?1:Pl(isNaN(e),isNaN(t)))<=0}function MD(e,t){for(var n=0;!t[n]||t[n]==``;)n++;for(var r=t[n++];n0&&this.b>0&&(this.g=Pp(this.c,this.b,this.a))}function K0e(e,t){var n=e.a,r;t=String(t),n.hasOwnProperty(t)&&(r=n[t]);var i=(vw(),pG)[typeof r];return i?i(r):XQe(typeof r)}function RD(e){var t,n,r=null;if(t=dU in e.a,n=!t,n)throw E(new Vi(`Every element must have an id.`));return r=ij(A_(e,dU)),r}function zD(e){var t,n=vet(e);for(t=null;e.c==2;)hP(e),t||(t=(xP(),xP(),++W9,new lu(2)),LN(t,n),n=t),n.Jm(vet(e));return n}function BD(e,t){var n,r,i;return e._j(),r=t==null?0:US(t),i=(r&AP)%e.d.length,n=Knt(e,i,r,t),n?(aJe(e,n),n.md()):null}function q0e(e,t){return e.e>t.e?1:e.et.d?e.e:e.d=48&&e<48+r.Math.min(10,10)?e-48:e>=97&&e<97?e-97+10:e>=65&&e<65?e-65+10:-1}function Y0e(e,t){if(t.c==e)return t.d;if(t.d==e)return t.c;throw E(new Fi(`Input edge is not connected to the input port.`))}function X0e(e){if(qD(DH,e))return rd(),yG;if(qD(OH,e))return rd(),vG;throw E(new Fi(`Expecting true or false`))}function VD(e){switch(typeof e){case OP:return jw(e);case Vvt:return jl(e);case DP:return EDe(e);default:return e==null?0:td(e)}}function HD(e,t){if(e.a<0)throw E(new Ii(`Did not call before(...) or after(...) before calling add(...).`));return mEe(e,e.a,t),e}function UD(e){return R_(),j(e,162)?P(xh(f7,tEt),295).Rg(e):km(f7,$w(e))?P(xh(f7,$w(e)),295).Rg(e):null}function WD(e){var t,n;return e.Db&32||(n=(t=P(NC(e,16),29),bh(t||e.ii())-bh(e.ii())),n!=0&&GD(e,32,V(WW,FP,1,n,5,1))),e}function GD(e,t,n){var r;(e.Db&t)==0?n!=null&&pst(e,t,n):n==null?jrt(e,t):(r=pk(e,t),r==-1?e.Eb=n:Sh(rS(e.Eb),r,n))}function Z0e(e,t,n,r){var i,a;t.c.length!=0&&(i=Lat(n,r),a=ent(t),To(Cx(new Mp(null,new cv(a,1)),new Yie),new sIe(e,n,i,r)))}function Q0e(e,t){var n,r=e.a.length-1,i,a;return n=t-e.b&r,a=e.c-t&r,i=e.c-e.b&r,lDe(n=a?(PQe(e,t),-1):(NQe(e,t),1)}function KD(e){var t,n,r=e.Jh();if(!r)for(t=0,n=e.Ph();n;n=n.Ph()){if(++t>gI)return n.Qh();if(r=n.Jh(),r||n==e)break}return r}function $0e(e,t){var n;return A(t)===A(e)?!0:!j(t,21)||(n=P(t,21),n.gc()!=e.gc())?!1:e.Ic(n)}function e2e(e,t){return e.et.e?1:e.ft.f?1:US(e)-US(t)}function qD(e,t){return Gh(e),t==null?!1:ff(e,t)?!0:e.length==t.length&&ff(e.toLowerCase(),t.toLowerCase())}function JD(e){var t,n;return dT(e,-129)>0&&dT(e,128)<0?(WMe(),t=nm(e)+128,n=AG[t],!n&&(n=AG[t]=new Mn(e)),n):new Mn(e)}function YD(){YD=C,RJ=new Ds(wR,0),IJ=new Ds(`INSIDE_PORT_SIDE_GROUPS`,1),FJ=new Ds(`GROUP_MODEL_ORDER`,2),LJ=new Ds(vbt,3)}function t2e(e){var t;return e.b||eye(e,(t=hOe(e.e,e.a),!t||!ff(OH,_D((!t.b&&(t.b=new Td((CP(),$7),o9,t)),t.b),`qualified`)))),e.c}function n2e(e,t){for(var n=(sv(t,e.length),e.charCodeAt(t)),r=t+1;r2e3&&(ITt=e,sG=r.setTimeout(zye,10))),oG++==0&&(DKe((Si(),cG)),!0)}function x2e(e,t,n){var r;(mEt?(G1e(e),!0):hEt||_Et?(Co(),!0):gEt&&(Co(),!1))&&(r=new eke(t),r.b=n,w9e(e,r))}function eO(e,t){var n=!e.A.Hc((TD(),x5))||e.q==(rA(),R8);e.u.Hc((rj(),G8))?n?Qgt(e,t):Dgt(e,t):e.u.Hc(q8)&&(n?igt(e,t):x_t(e,t))}function S2e(e){var t;A(J(e,(vP(),g6)))===A((_T(),_8))&&(I_(e)?(t=P(J(I_(e),g6),346),OO(e,g6,t)):OO(e,g6,v8))}function C2e(e){var t,n;return yd(e.d.i,(mP(),Y1))?(t=P(K(e.c.i,Y1),17),n=P(K(e.d.i,Y1),17),_u(t.a,n.a)>0):!1}function w2e(e,t,n){return new wg(r.Math.min(e.a,t.a)-n/2,r.Math.min(e.b,t.b)-n/2,r.Math.abs(e.a-t.a)+n,r.Math.abs(e.b-t.b)+n)}function T2e(e){var t;this.d=new T,this.j=new Fa,this.g=new Fa,t=e.g.b,this.f=P(K(Bh(t),(mP(),_1)),88),this.e=D(N(yO(t,m0)))}function E2e(e){this.d=new T,this.e=new ry,this.c=V(q9,HF,28,(nP(),U(O(_5,1),TR,64,0,[h5,Z8,X8,m5,g5])).length,15,1),this.b=e}function tO(e,t,n){var r=n[e.g][t];switch(e.g){case 1:case 3:return new k(0,r);case 2:case 4:return new k(r,0);default:return null}}function D2e(e,t,n){var r,i=P(h_(t.f),205);try{i.rf(e,n),bFe(t.f,i)}catch(e){throw e=ew(e),j(e,103)?(r=e,E(r)):E(e)}}function O2e(e,t,n){var r=null,i,a,o,s=Ymt(dS(),t),c;return a=null,s&&(i=null,c=Pmt(s,n),o=null,c!=null&&(o=e.qf(s,c)),i=o,a=i),r=a,r}function nO(e,t,n,r){var i=e.length;if(t>=i)return i;for(t=t>0?t:0;tr&&Sh(t,r,null),t}function k2e(e,t){var n,r=e.a.length;for(t.lengthr&&Sh(t,r,null),t}function iO(e,t){var n,r;if(++e.j,t!=null&&(n=(r=e.a.Cb,j(r,99)?P(r,99).th():null),Jnt(t,n))){GD(e.a,4,n);return}GD(e.a,4,P(t,129))}function A2e(e){var t;if(e==null)return null;if(t=Qit(EN(e,!0)),t==null)throw E(new Hi(`Invalid hexBinary value: '`+e+`'`));return t}function aO(e,t,n){var r;t.a.length>0&&(M(e.b,new Aje(t.a,n)),r=t.a.length,0r&&(t.a+=Uwe(V(K9,EF,28,-r,15,1))))}function j2e(e,t,n){var r,i,a;if(!n[t.d])for(n[t.d]=!0,i=new w(eT(t));i.a=e.b>>1)for(r=e.c,n=e.b;n>t;--n)r=r.b;else for(r=e.a.a,n=0;n=0?e.Wh(i):cj(e,r)):n<0?cj(e,r):P(r,69).wk().Bk(e,e.hi(),n)}function H2e(e){var t,n,r=(!e.o&&(e.o=new lb((lP(),Z5),n7,e,0)),e.o);for(n=r.c.Kc();n.e!=n.i.gc();)t=P(n.Yj(),44),t.md();return Jy(r)}function hO(e){var t;if(j(e.a,4)){if(t=UD(e.a),t==null)throw E(new Ii(lSt+e.b+`'. `+sSt+(Ad(m7),m7.k)+cSt));return t}return e.a}function U2e(e,t){var n,r;if(e.j.length!=t.j.length)return!1;for(n=0,r=e.j.length;n=64&&t<128&&(i=dv(i,cm(1,t-64)));return i}function yO(e,t){var n,r=null;return yd(e,(vP(),K6))&&(n=P(K(e,K6),96),n.pf(t)&&(r=n.of(t))),r==null&&Bh(e)&&(r=K(Bh(e),t)),r}function W2e(e,t){var n=P(K(e,(mP(),j1)),75);return Cu(t,SOt)?n?Fg(n):(n=new ai,W(e,j1,n)):n&&W(e,j1,null),n}function bO(){bO=C,Iq=(vP(),Bzt),Pq=fzt,yDt=c6,Fq=A6,CDt=(Rk(),FK),SDt=NK,wDt=LK,xDt=MK,bDt=(qw(),kq),jq=gDt,Mq=_Dt,Nq=vDt}function xO(e){switch(Pbe(),this.c=new T,this.d=e,e.g){case 0:case 2:this.a=$h(NJ),this.b=cI;break;case 3:case 1:this.a=NJ,this.b=lI}}function G2e(e){var t;mf(P(K(e,(mP(),Q1)),101))&&(t=e.b,Znt((ov(0,t.c.length),P(t.c[0],30))),Znt(P(Ep(t,t.c.length-1),30)))}function K2e(e,t){t.Ug(`Self-Loop post-processing`,1),To(hg(hg(ox(new Mp(null,new cv(e.b,16)),new vne),new yne),new bne),new xne),t.Vg()}function q2e(e,t,n){var r,i;if(e.c)Gx(e.c,e.c.i+t),Kx(e.c,e.c.j+n);else for(i=new w(e.b);i.a=0&&(n.d=e.t);break;case 3:e.t>=0&&(n.a=e.t)}e.C&&(n.b=e.C.b,n.c=e.C.c)}function CO(){CO=C,LMt=new $s(vV,0),H0=new $s(JR,1),U0=new $s(`LINEAR_SEGMENTS`,2),V0=new $s(`BRANDES_KOEPF`,3),W0=new $s(Qbt,4)}function wO(){wO=C,wq=new xs(_L,0),Cq=new xs(vL,1),Tq=new xs(yL,2),Eq=new xs(bL,3),wq.a=!1,Cq.a=!0,Tq.a=!1,Eq.a=!0}function TO(){TO=C,gq=new ys(_L,0),hq=new ys(vL,1),_q=new ys(yL,2),vq=new ys(bL,3),gq.a=!1,hq.a=!0,_q.a=!1,vq.a=!0}function EO(e,t,n,r){var i;return n>=0?e.Sh(t,n,r):(e.Ph()&&(r=(i=e.Fh(),i>=0?e.Ah(r):e.Ph().Th(e,-1-i,null,r))),e.Ch(t,n,r))}function DO(e,t){switch(t){case 7:!e.e&&(e.e=new cf(U5,e,7,4)),RN(e.e);return;case 8:!e.d&&(e.d=new cf(U5,e,8,5)),RN(e.d);return}dD(e,t)}function OO(e,t,n){return n==null?(!e.o&&(e.o=new lb((lP(),Z5),n7,e,0)),BD(e.o,t)):(!e.o&&(e.o=new lb((lP(),Z5),n7,e,0)),Hk(e.o,t,n)),e}function t4e(e,t){Vg();var n=e,r,i,a=t;for(j(e,21)&&!j(t,21)&&(n=t,a=e),i=n.Kc();i.Ob();)if(r=i.Pb(),a.Hc(r))return!1;return!0}function n4e(e,t,n,r){return t.an.b)}function kO(e,t){return rl(e)?!!TTt[t]:e.Sm?!!e.Sm[t]:al(e)?!!wTt[t]:il(e)?!!CTt[t]:!1}function r4e(e){var t=e.a;do t=P(by(new pm(Vu(DE(t).a.Kc(),new d))),18).c.i,t.k==(DA(),qJ)&&e.b.Fc(t);while(t.k==(DA(),qJ));e.b=UE(e.b)}function i4e(e,t){var n,i,a=e;for(i=new pm(Vu(DE(t).a.Kc(),new d));Cj(i);)n=P(by(i),18),n.c.i.c&&(a=r.Math.max(a,n.c.i.c.p));return a}function a4e(e,t){var n,r,i=0;for(r=P(P(Dy(e.r,t),21),87).Kc();r.Ob();)n=P(r.Pb(),117),i+=n.d.d+n.b.Mf().b+n.d.a,r.Ob()&&(i+=e.w);return i}function o4e(e,t){var n,r,i=0;for(r=P(P(Dy(e.r,t),21),87).Kc();r.Ob();)n=P(r.Pb(),117),i+=n.d.b+n.b.Mf().a+n.d.c,r.Ob()&&(i+=e.w);return i}function s4e(e){var t,n,r=0,i=sM(e);if(i.c.length==0)return 1;for(n=new w(i);n.a=0?e.Lh(o,n,!0):mj(e,a,n)):P(a,69).wk().yk(e,e.hi(),i,n,r)}function d4e(e,t,n,r){var i=z$e(t.pf((vP(),C6))?P(t.of(C6),21):e.j);i!=(SP(),cq)&&(n&&!PD(i)||tet($it(e,i,r),t))}function f4e(e){switch(e.g){case 1:return KC(),mq;case 3:return KC(),dq;case 2:return KC(),pq;case 4:return KC(),fq;default:return null}}function p4e(e,t,n){if(e.e)switch(e.b){case 1:OIe(e.c,t,n);break;case 0:kIe(e.c,t,n)}else XVe(e.c,t,n);e.a[t.p][n.p]=e.c.i,e.a[n.p][t.p]=e.c.e}function m4e(e){var t,n;if(e==null)return null;for(n=V(UJ,X,199,e.length,0,2),t=0;t=0)return i;if(e.ol()){for(r=0;r=i)throw E(new lf(t,i));if(e.Si()&&(r=e.dd(n),r>=0&&r!=t))throw E(new Fi(vU));return e.Xi(t,n)}function FO(e,t){if(this.a=P(ph(e),253),this.b=P(ph(t),253),e.Ed(t)>0||e==(pi(),XW)||t==(mi(),ZW))throw E(new Fi(`Invalid range: `+tHe(e,t)))}function g4e(e){var t,n;for(this.b=new T,this.c=e,this.a=!1,n=new w(e.a);n.a0),(t&-t)==t)return C_(t*Lj(e,31)*4656612873077393e-25);do n=Lj(e,31),r=n%t;while(n-r+(t-1)<0);return C_(r)}function C4e(e,t,n){switch(n.g){case 1:e.a=t.a/2,e.b=0;break;case 2:e.a=t.a,e.b=t.b/2;break;case 3:e.a=t.a/2,e.b=t.b;break;case 4:e.a=0,e.b=t.b/2}}function HO(e,t,n,r){var i,a;for(i=t;i1&&(a=_4e(e,t)),a}function T4e(e){var t=D(N(J(e,(vP(),X6))))*r.Math.sqrt((!e.a&&(e.a=new F($5,e,10,11)),e.a).i);return new k(t,t/D(N(J(e,Y6))))}function GO(e){var t;return e.f&&e.f.Vh()&&(t=P(e.f,54),e.f=P(pT(e,t),84),e.f!=t&&e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,9,8,t,e.f))),e.f}function KO(e){var t;return e.i&&e.i.Vh()&&(t=P(e.i,54),e.i=P(pT(e,t),84),e.i!=t&&e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,9,7,t,e.i))),e.i}function qO(e){var t;return e.b&&e.b.Db&64&&(t=e.b,e.b=P(pT(e,t),19),e.b!=t&&e.Db&4&&!(e.Db&1)&&AC(e,new Sm(e,9,21,t,e.b))),e.b}function JO(e,t){var n,r,i;e.d==null?(++e.e,++e.f):(r=t.Bi(),hot(e,e.f+1),i=(r&AP)%e.d.length,n=e.d[i],!n&&(n=e.d[i]=e.dk()),n.Fc(t),++e.f)}function YO(e,t,n){var r;return t.tk()?!1:t.Ik()==-2?t.qk()==e.e.Dh()&&n==null:(r=t.ik(),r==null?n==null:NT(r,n))}function XO(){var e;vS(16,Qvt),e=UJe(16),this.b=V($W,fF,303,e,0,1),this.c=V($W,fF,303,e,0,1),this.a=null,this.e=null,this.i=0,this.f=e-1,this.g=0}function ZO(e){$De.call(this),this.k=(DA(),JJ),this.j=(vS(6,hF),new Hy(6)),this.b=(vS(2,hF),new Hy(2)),this.d=new ti,this.f=new ri,this.a=e}function E4e(e){var t,n;e.c.length<=1||(t=oct(e,(nP(),m5)),Tet(e,P(t.a,17).a,P(t.b,17).a),n=oct(e,g5),Tet(e,P(n.a,17).a,P(n.b,17).a))}function D4e(e,t,n){var r,i=e.a.b;for(r=i.c.length;r102?-1:e<=57?e-48:e<65?-1:e<=70?e-65+10:e<97?-1:e-97+10}function ik(e,t){if(e==null)throw E(new Li(`null key in entry: null=`+t));if(t==null)throw E(new Li(`null value in entry: `+e+`=null`))}function M4e(e,t){for(var n,r;e.Ob();)if(!t.Ob()||(n=e.Pb(),r=t.Pb(),!(A(n)===A(r)||n!=null&&NT(n,r))))return!1;return!t.Ob()}function N4e(e,t){var n=U(O(Z9,1),hI,28,15,[rT(e.a[0],t),rT(e.a[1],t),rT(e.a[2],t)]);return e.d&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function P4e(e,t){var n=U(O(Z9,1),hI,28,15,[iT(e.a[0],t),iT(e.a[1],t),iT(e.a[2],t)]);return e.d&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function ak(e,t,n){mf(P(K(t,(mP(),Q1)),101))||(eUe(e,t,NA(t,n)),eUe(e,t,NA(t,(nP(),m5))),eUe(e,t,NA(t,Z8)),Vg(),hu(t.j,new tme(e)))}function F4e(e){var t,n;for(e.c||wmt(e),n=new ai,t=new w(e.a),z(t);t.a0&&(sv(0,t.length),t.charCodeAt(0)==43)?(sv(1,t.length+1),t.substr(1)):t))}function e3e(e){var t;return e==null?null:new ru((t=EN(e,!0),t.length>0&&(sv(0,t.length),t.charCodeAt(0)==43)?(sv(1,t.length+1),t.substr(1)):t))}function t3e(e,t,n,r,i,a,o,s){var c,l;r&&(c=r.a[0],c&&t3e(e,t,n,c,i,a,o,s),Tk(e,n,r.d,i,a,o,s)&&t.Fc(r),l=r.a[1],l&&t3e(e,t,n,l,i,a,o,s))}function sk(e,t,n){try{return ol(IS(e,t,n),1)}catch(r){throw r=ew(r),j(r,333)?E(new Mi(SL+e.o+`*`+e.p+CL+t+PP+n+wL)):E(r)}}function n3e(e,t,n){try{return ol(IS(e,t,n),0)}catch(r){throw r=ew(r),j(r,333)?E(new Mi(SL+e.o+`*`+e.p+CL+t+PP+n+wL)):E(r)}}function r3e(e,t,n){try{return ol(IS(e,t,n),2)}catch(r){throw r=ew(r),j(r,333)?E(new Mi(SL+e.o+`*`+e.p+CL+t+PP+n+wL)):E(r)}}function i3e(e,t){if(e.g==-1)throw E(new Rr);e.Xj();try{e.d.hd(e.g,t),e.f=e.d.j}catch(e){throw e=ew(e),j(e,77)?E(new Vr):E(e)}}function a3e(e){var t,n,r,i,a;for(r=new w(e.b);r.aa&&Sh(t,a,null),t}function o3e(e,t){var n,r=e.gc();if(t==null){for(n=0;n0&&(c+=i),l[u]=o,o+=s*(c+r)}function _3e(e){var t,n,r=e.f;for(e.n=V(Z9,hI,28,r,15,1),e.d=V(Z9,hI,28,r,15,1),t=0;t0?e.c:0),++a;e.b=i,e.d=o}function S3e(e,t){var n=U(O(Z9,1),hI,28,15,[BO(e,(Ix(),XK),t),BO(e,ZK,t),BO(e,QK,t)]);return e.f&&(n[0]=r.Math.max(n[0],n[2]),n[2]=n[0]),n}function C3e(e,t,n){var r;try{EM(e,t+e.j,n+e.k,!1,!0)}catch(e){throw e=ew(e),j(e,77)?(r=e,E(new Mi(r.g+TL+t+PP+n+`).`))):E(e)}}function w3e(e,t,n){var r;try{EM(e,t+e.j,n+e.k,!0,!1)}catch(e){throw e=ew(e),j(e,77)?(r=e,E(new Mi(r.g+TL+t+PP+n+`).`))):E(e)}}function T3e(e){var t;yd(e,(mP(),R1))&&(t=P(K(e,R1),21),t.Hc((Ej(),w8))?(t.Mc(w8),t.Fc(E8)):t.Hc(E8)&&(t.Mc(E8),t.Fc(w8)))}function E3e(e){var t;yd(e,(mP(),R1))&&(t=P(K(e,R1),21),t.Hc((Ej(),j8))?(t.Mc(j8),t.Fc(k8)):t.Hc(k8)&&(t.Mc(k8),t.Fc(j8)))}function gk(e,t,n,r){var i,a,o,s;return e.a??j9e(e,t),o=t.b.j.c.length,a=n.d.p,s=r.d.p,i=s-1,i<0&&(i=o-1),a<=i?e.a[i]-e.a[a]:e.a[o-1]-e.a[a]+e.a[i]}function D3e(e){var t,n;if(!e.b)for(e.b=kv(P(e.f,27).kh().i),n=new Lu(P(e.f,27).kh());n.e!=n.i.gc();)t=P(gO(n),135),M(e.b,new Di(t));return e.b}function O3e(e){var t,n;if(!e.e)for(e.e=kv(og(P(e.f,27)).i),n=new Lu(og(P(e.f,27)));n.e!=n.i.gc();)t=P(gO(n),123),M(e.e,new ahe(t));return e.e}function k3e(e){var t,n;if(!e.a)for(e.a=kv(Gg(P(e.f,27)).i),n=new Lu(Gg(P(e.f,27)));n.e!=n.i.gc();)t=P(gO(n),27),M(e.a,new sd(e,t));return e.a}function _k(e){var t;if(!e.C&&(e.D!=null||e.B!=null))if(t=qht(e),t)e.hl(t);else try{e.hl(null)}catch(e){if(e=ew(e),!j(e,63))throw E(e)}return e.C}function A3e(e){switch(e.q.g){case 5:h8e(e,(nP(),Z8)),h8e(e,m5);break;case 4:Lmt(e,(nP(),Z8)),Lmt(e,m5);break;default:Het(e,(nP(),Z8)),Het(e,m5)}}function j3e(e){switch(e.q.g){case 5:g8e(e,(nP(),X8)),g8e(e,g5);break;case 4:Rmt(e,(nP(),X8)),Rmt(e,g5);break;default:Uet(e,(nP(),X8)),Uet(e,g5)}}function vk(e,t){var n,i,a=new Fa;for(i=e.Kc();i.Ob();)n=P(i.Pb(),36),kM(n,a.a,0),a.a+=n.f.a+t,a.b=r.Math.max(a.b,n.f.b);return a.b>0&&(a.b+=t),a}function yk(e,t){var n,i,a=new Fa;for(i=e.Kc();i.Ob();)n=P(i.Pb(),36),kM(n,0,a.b),a.b+=n.f.b+t,a.a=r.Math.max(a.a,n.f.a);return a.a>0&&(a.a+=t),a}function M3e(e){var t,n,i=AP;for(n=new w(e.a);n.a>16==6?e.Cb.Th(e,5,J5,t):(r=qO(P(_x((n=P(NC(e,16),29),n||e.ii()),e.Db>>16),19)),e.Cb.Th(e,r.n,r.f,t))}function F3e(e){Xg();var t=e.e;if(t&&t.stack){var n=t.stack,r=t+` `;return n.substring(0,r.length)==r&&(n=n.substring(r.length)),n.split(` @@ -23,5 +23,5 @@ import{i as e,r as t,t as n}from"./app-rolldown-runtime.js";import{n as r}from". `),i.length!=2)throw E(new Fi(`Exactly two numbers are expected, `+i.length+` were found.`));try{this.a=OA(qA(i[0])),this.b=OA(qA(i[1]))}catch(e){throw e=ew(e),j(e,130)?(n=e,E(new Fi(Tbt+n))):E(e)}},Q.Ib=function(){return`(`+this.a+`,`+this.b+`)`},Q.a=0,Q.b=0;var K3=L(MR,`KVector`,8);q(75,67,{3:1,4:1,20:1,31:1,56:1,16:1,67:1,15:1,75:1,423:1},ai,Ma,LEe),Q.Pc=function(){return xQe(this)},Q.cg=function(e){var t,n,r=nN(e,`,|;|\\(|\\)|\\[|\\]|\\{|\\}| | | `),i,a,o;Fg(this);try{for(n=0,a=0,i=0,o=0;n0&&(a%2==0?i=OA(r[n]):o=OA(r[n]),a>0&&a%2!=0&&up(this,new k(i,o)),++a),++n}catch(e){throw e=ew(e),j(e,130)?(t=e,E(new Fi(`The given string does not match the expected format for vectors.`+t))):E(e)}},Q.Ib=function(){for(var e=new Gu(`(`),t=dO(this,0),n;t.b!=t.d.c;)n=P(Lv(t),8),gl(e,n.a+`,`+n.b),t.b!=t.d.c&&(e.a+=`; `);return(e.a+=`)`,e).a};var BRt=L(MR,`KVectorChain`,75);q(255,22,{3:1,34:1,22:1,255:1},Dc);var q3,J3,Y3,X3,Z3,Q3,VRt=aS(AH,`Alignment`,255,eG,lGe,HAe),HRt;q(991,1,nL,Jue),Q.hf=function(e){cdt(e)};var URt,$3,WRt,GRt,KRt,qRt,JRt,YRt,XRt,ZRt,QRt,$Rt;L(AH,`BoxLayouterOptions`,991),q(992,1,{},fse),Q.sf=function(){var e;return e=new hse,e},Q.tf=function(e){},L(AH,`BoxLayouterOptions/BoxFactory`,992),q(298,22,{3:1,34:1,22:1,298:1},Ac);var e6,t6,n6,r6,i6,a6,o6=aS(AH,`ContentAlignment`,298,eG,uGe,UAe),ezt;q(699,1,nL,Yue),Q.hf=function(e){jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,pSt),``),`Layout Algorithm`),`Select a specific layout algorithm.`),(VA(),W3)),LG),sE((uO(),F3))))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,mSt),``),`Resolved Layout Algorithm`),`Meta data associated with the selected algorithm.`),U3),PRt),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,GB),``),`Alignment`),`Alignment of the selected node relative to other nodes; the exact meaning depends on the used algorithm.`),nzt),B3),VRt),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,FL),``),`Aspect Ratio`),`The desired aspect ratio of the drawing, that is the quotient of width by height.`),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,hSt),``),`Bend Points`),`A fixed list of bend points for the edge. This is used by the 'Fixed Layout' algorithm to specify a pre-defined routing for an edge. The vector chain must include the source point, any bend points, and the target point, so it must have at least two points.`),U3),BRt),sE(M3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,rV),``),`Content Alignment`),`Specifies how the content of a node are aligned. Each node can individually control the alignment of its contents. I.e. if a node should be aligned top left in its parent node, the parent node should specify that option.`),szt),V3),o6),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,WB),``),`Debug Mode`),`Whether additional debug information shall be generated.`),(rd(),!1)),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,JB),``),Vyt),`Overall direction of edges: horizontal (right / left) or vertical (down / up).`),czt),B3),a8),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,xB),``),`Edge Routing`),`What kind of edge routing style should be applied for the content of a parent node. Algorithms may also set this option to single edges in order to mark them as splines. The bend point list of edges with this option set to SPLINES must be interpreted as control points for a piecewise cubic spline.`),dzt),B3),p8),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,dSt),``),`Expand Nodes`),`If active, nodes are expanded to fill the area of their parent.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,bB),``),`Hierarchy Handling`),"Determines whether separate layout runs are triggered for different compound nodes in a hierarchical graph. Setting a node's hierarchy handling to `INCLUDE_CHILDREN` will lay out that node and all of its descendants in a single layout run, until a descendant is encountered which has its hierarchy handling set to `SEPARATE_CHILDREN`. In general, `SEPARATE_CHILDREN` will ensure that a new layout run is triggered for a node with that setting. Including multiple levels of hierarchy in a single layout run may allow cross-hierarchical edges to be laid out properly. If the root node is set to `INHERIT` (or not set at all), the default behavior is `SEPARATE_CHILDREN`."),hzt),B3),yBt),Zp(F3,U(O(L3,1),Z,170,0,[P3]))))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,IL),``),`Padding`),`The padding to be left to a parent element's border when placing child elements. This can also serve as an output option of a layout algorithm if node size calculation is setup appropriately.`),Tzt),U3),ZJ),Zp(F3,U(O(L3,1),Z,170,0,[P3]))))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,tR),``),`Interactive`),`Whether the algorithm should be run in interactive mode for the content of a parent node. What this means exactly depends on how the specific algorithm interprets this option. Usually in the interactive mode algorithms try to modify the current layout as little as possible.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,hV),``),`interactive Layout`),`Whether the graph should be changeable interactively and by setting constraints`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,iR),``),`Omit Node Micro Layout`),`Node micro layout comprises the computation of node dimensions (if requested), the placement of ports and their labels, and the placement of node labels. The functionality is implemented independent of any specific layout algorithm and shouldn't have any negative impact on the layout algorithm's performance itself. Yet, if any unforeseen behavior occurs, this option allows to deactivate the micro layout.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,nR),``),`Port Constraints`),`Defines constraints of the position of the ports of a node.`),Nzt),B3),DBt),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,fV),``),`Position`),`The position of a node, port, or label. This is used by the 'Fixed Layout' algorithm to specify a pre-defined position.`),U3),K3),Zp(P3,U(O(L3,1),Z,170,0,[I3,N3]))))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,XL),``),`Priority`),`Defines the priority of an object; its meaning depends on the specific layout algorithm and the context where it is used.`),H3),DG),Zp(P3,U(O(L3,1),Z,170,0,[M3]))))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,$L),``),`Randomization Seed`),`Seed used for pseudo-random number generators to control the layout algorithm. If the value is 0, the seed shall be determined pseudo-randomly (e.g. from the system time).`),H3),DG),sE(F3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,eR),``),`Separate Connected Components`),`Whether each connected component should be processed separately.`),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,iV),``),`Junction Points`),`This option is not used as option, but as output of the layout algorithms. It is attached to edges and determines the points where junction symbols should be drawn in order to represent hyperedges with orthogonal routing. Whether such points are computed depends on the chosen layout algorithm and edge routing style. The points are put into the vector chain with no specific order.`),_zt),U3),BRt),sE(M3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,sV),``),`Comment Box`),`Whether the node should be regarded as a comment box instead of a regular node. In that case its placement should be similar to how labels are handled. Any edges incident to a comment box specify to which graph elements the comment is related.`),!1),R3),bG),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,cV),``),`Hypernode`),`Whether the node should be handled as a hypernode.`),!1),R3),bG),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,gSt),``),`Label Manager`),`Label managers can shorten labels upon a layout algorithm's request.`),U3),uUt),Zp(F3,U(O(L3,1),Z,170,0,[N3]))))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,pV),``),`Margins`),`Margins define additional space around the actual bounds of a graph element. For instance, ports or labels being placed on the outside of a node's border might introduce such a margin. The margin is used to guarantee non-overlap of other graph elements with those ports or labels.`),vzt),U3),HJ),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,HB),``),`No Layout`),`No layout is done for the associated element. This is used to mark parts of a diagram to avoid their inclusion in the layout graph, or to mark parts of the layout graph to prevent layout engines from processing them. If you wish to exclude the contents of a compound node from automatic layout, while the node itself is still considered on its own layer, use the 'Fixed Layout' algorithm for that node.`),!1),R3),bG),Zp(P3,U(O(L3,1),Z,170,0,[M3,I3,N3]))))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,_St),``),`Scale Factor`),`The scaling factor to be applied to the corresponding node in recursive layout. It causes the corresponding node's size to be adjusted, and its ports and labels to be sized and placed accordingly after the layout of that node has been determined (and before the node itself and its siblings are arranged). The scaling is not reverted afterwards, so the resulting layout graph contains the adjusted size and position data. This option is currently not supported if 'Layout Hierarchy' is set.`),1),z3),TG),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,vSt),``),`Child Area Width`),`The width of the area occupied by the laid out children of a node.`),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,ySt),``),`Child Area Height`),`The height of the area occupied by the laid out children of a node.`),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,uR),``),aSt),`Turns topdown layout on and off. If this option is enabled, hierarchical layout will be computed first for the root node and then for its children recursively. Layouts are then scaled down to fit the area provided by their parents. Graphs must follow a certain structure for topdown layout to work properly. {@link TopdownNodeTypes.PARALLEL_NODE} nodes must have children of type {@link TopdownNodeTypes.HIERARCHICAL_NODE} and must define {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} for their children. Furthermore they need to be laid out using an algorithm that is a {@link TopdownLayoutProvider}. Hierarchical nodes can also be parents of other hierarchical nodes and can optionally use a {@link TopdownSizeApproximator} to dynamically set sizes during topdown layout. In this case {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} should be set on the node itself rather than the parent. The values are then used by the size approximator as base values. Hierarchical nodes require the layout option {@link nodeSize.fixedGraphSize} to be true to prevent the algorithm used there from resizing the hierarchical node. This option is not supported if 'Hierarchy Handling' is set to 'INCLUDE_CHILDREN'`),!1),R3),bG),sE(F3)))),wv(e,uR,mR,null),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,bSt),``),`Animate`),`Whether the shift from the old layout to the new computed layout shall be animated.`),!0),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,xSt),``),`Animation Time Factor`),`Factor for computation of animation time. The higher the value, the longer the animation time. If the value is 0, the resulting time is always equal to the minimum defined by 'Minimal Animation Time'.`),G(100)),H3),DG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,SSt),``),`Layout Ancestors`),`Whether the hierarchy levels on the path from the selected element to the root of the diagram shall be included in the layout process.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,CSt),``),`Maximal Animation Time`),`The maximal time for animations, in milliseconds.`),G(4e3)),H3),DG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,wSt),``),`Minimal Animation Time`),`The minimal time for animations, in milliseconds.`),G(400)),H3),DG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,TSt),``),`Progress Bar`),`Whether a progress bar shall be displayed during layout computations.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,ESt),``),`Validate Graph`),`Whether the graph shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,DSt),``),`Validate Options`),`Whether layout options shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user.`),!0),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,OSt),``),`Zoom to Fit`),`Whether the zoom level shall be set to view the whole diagram after layout.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,fSt),`box`),`Box Layout Mode`),`Configures the packing mode used by the {@link BoxLayoutProvider}. If SIMPLE is not required (neither priorities are used nor the interactive mode), GROUP_DEC can improve the packing and decrease the area. GROUP_MIXED and GROUP_INC may, in very specific scenarios, work better.`),azt),B3),JBt),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,AB),SB),`Comment Comment Spacing`),`Spacing to be preserved between a comment box and other comment boxes connected to the same node. The space left between comment boxes of different nodes is controlled by the node-node spacing.`),10),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,jB),SB),`Comment Node Spacing`),`Spacing to be preserved between a node and its connected comment boxes. The space left between a node and the comments of another node is controlled by the node-node spacing.`),10),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,NL),SB),`Components Spacing`),`Spacing to be preserved between pairs of connected components. This option is only relevant if 'separateConnectedComponents' is activated.`),20),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,MB),SB),`Edge Spacing`),`Spacing to be preserved between any two edges. Note that while this can somewhat easily be satisfied for the segments of orthogonally drawn edges, it is harder for general polylines or splines.`),10),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,QL),SB),`Edge Label Spacing`),`The minimal distance to be preserved between a label and the edge it is associated with. Note that the placement of a label is influenced by the 'edgelabels.placement' option.`),2),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,NB),SB),`Edge Node Spacing`),`Spacing to be preserved between nodes and edges.`),10),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,PB),SB),`Label Spacing`),`Determines the amount of space to be left between two labels of the same graph element.`),0),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,LB),SB),`Label Node Spacing`),`Spacing to be preserved between labels and the border of node they are associated with. Note that the placement of a label is influenced by the 'nodelabels.placement' option.`),5),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,FB),SB),`Horizontal spacing between Label and Port`),`Horizontal spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option.`),1),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,IB),SB),`Vertical spacing between Label and Port`),`Vertical spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option.`),1),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,ZL),SB),`Node Spacing`),`The minimal distance to be preserved between each two nodes.`),20),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,RB),SB),`Node Self Loop Spacing`),`Spacing to be preserved between a node and its self loops.`),10),z3),TG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,zB),SB),`Port Spacing`),`Spacing between pairs of ports of the same node.`),10),z3),TG),Zp(F3,U(O(L3,1),Z,170,0,[P3]))))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,BB),SB),`Individual Spacing`),`Allows to specify individual spacing values for graph elements that shall be different from the value specified for the element's parent.`),U3),XBt),Zp(P3,U(O(L3,1),Z,170,0,[M3,I3,N3]))))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,mV),SB),`Additional Port Space`),`Additional space around the sets of ports on each node side. For each side of a node, this option can reserve additional space before and after the ports on each side. For example, a top spacing of 20 makes sure that the first port on the western and eastern side is 20 units away from the northern border.`),Yzt),U3),HJ),sE(F3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,dV),PSt),`Layout Partition`),`Partition to which the node belongs. This requires Layout Partitioning to be active. Nodes with lower partition IDs will appear to the left of nodes with higher partition IDs (assuming a left-to-right layout direction).`),H3),DG),Zp(F3,U(O(L3,1),Z,170,0,[P3]))))),wv(e,dV,uV,kzt),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,uV),PSt),`Layout Partitioning`),`Whether to activate partitioned layout. This will allow to group nodes through the Layout Partition option. a pair of nodes with different partition indices is then placed such that the node with lower index is placed to the left of the other node (with left-to-right layout direction). Depending on the layout algorithm, this may only be guaranteed to work if all nodes have a layout partition configured, or at least if edges that cross partitions are not part of a partition-crossing cycle.`),Dzt),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,YB),FSt),`Node Label Padding`),`Define padding for node labels that are placed inside of a node.`),bzt),U3),ZJ),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,cR),FSt),`Node Label Placement`),`Hints for where node labels are to be placed; if empty, the node label's position is not modified.`),xzt),V3),M8),Zp(P3,U(O(L3,1),Z,170,0,[N3]))))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,QB),MH),`Port Alignment`),`Defines the default port distribution for a node. May be overridden for each side individually.`),jzt),B3),I8),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,$B),MH),`Port Alignment (North)`),`Defines how ports on the northern side are placed, overriding the node's general port alignment.`),B3),I8),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,eV),MH),`Port Alignment (South)`),`Defines how ports on the southern side are placed, overriding the node's general port alignment.`),B3),I8),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,tV),MH),`Port Alignment (West)`),`Defines how ports on the western side are placed, overriding the node's general port alignment.`),B3),I8),sE(P3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,nV),MH),`Port Alignment (East)`),`Defines how ports on the eastern side are placed, overriding the node's general port alignment.`),B3),I8),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,sR),NH),`Node Size Constraints`),`What should be taken into account when calculating a node's size. Empty size constraints specify that a node's size is already fixed and should not be changed.`),Szt),V3),S5),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,oR),NH),`Node Size Options`),`Options modifying the behavior of the size constraints set on a node. Each member of the set specifies something that should be taken into account when calculating node sizes. The empty set corresponds to no further modifications.`),wzt),V3),LBt),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,gR),NH),`Node Size Minimum`),`The minimal size to which a node can be reduced.`),Czt),U3),K3),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,aR),NH),`Fixed Graph Size`),`By default, the fixed layout provider will enlarge a graph until it is large enough to contain its children. If this option is set, it won't do so.`),!1),R3),bG),sE(F3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,aV),OB),`Edge Label Placement`),`Gives a hint on where to put edge labels.`),lzt),B3),rBt),sE(N3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,rR),OB),`Inline Edge Labels`),`If true, an edge label is placed directly on its edge. May only apply to center edge labels. This kind of label placement is only advisable if the label's rendering is such that it is not crossed by its edge and thus stays legible.`),!1),R3),bG),sE(N3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,kSt),`font`),`Font Name`),`Font name used for a label.`),W3),LG),sE(N3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,ASt),`font`),`Font Size`),`Font size used for a label.`),H3),DG),sE(N3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,lV),PH),`Port Anchor Offset`),`The offset to the port position where connections shall be attached.`),U3),K3),sE(I3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,oV),PH),`Port Index`),`The index of a port in the fixed order around a node. The order is assumed as clockwise, starting with the leftmost port on the top side. This option must be set if 'Port Constraints' is set to FIXED_ORDER and no specific positions are given for the ports. Additionally, the option 'Port Side' must be defined in this case.`),H3),DG),sE(I3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,UB),PH),`Port Side`),`The side of a node on which a port is situated. This option must be set if 'Port Constraints' is set to FIXED_SIDE or FIXED_ORDER and no specific positions are given for the ports.`),Izt),B3),_5),sE(I3)))),jE(e,new zA(Aa(ka(ja(wa(Oa(Ea(Da(new $t,VB),PH),`Port Border Offset`),`The offset of ports on the node border. With a positive offset the port is moved outside of the node, while with a negative offset the port is moved towards the inside. An offset of 0 means that the port is placed directly on the node border, i.e. if the port side is north, the port's south border touches the nodes's north border; if the port side is east, the port's west border touches the nodes's east border; if the port side is south, the port's north border touches the node's south border; if the port side is west, the port's east border touches the node's west border.`),z3),TG),sE(I3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,lR),ISt),`Port Label Placement`),`Decides on a placement method for port labels; if empty, the node label's position is not modified.`),Pzt),V3),Y8),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,XB),ISt),`Port Labels Next to Port`),`Use 'portLabels.placement': NEXT_TO_PORT_OF_POSSIBLE.`),!1),R3),bG),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,ZB),ISt),`Treat Port Labels as Group`),`If this option is true (default), the labels of a port will be treated as a group when it comes to centering them next to their port. If this option is false, only the first label will be centered next to the port, with the others being placed below. This only applies to labels of eastern and western ports and will have no effect if labels are not placed next to their port.`),!0),R3),bG),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,dR),FH),`Topdown Scale Factor`),`The scaling factor to be applied to the nodes laid out within the node in recursive topdown layout. The difference to 'Scale Factor' is that the node itself is not scaled. This value has to be set on hierarchical nodes.`),1),z3),TG),sE(F3)))),wv(e,dR,mR,$zt),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,jSt),FH),`Topdown Size Approximator`),`The size approximator to be used to set sizes of hierarchical nodes during topdown layout. The default value is null, which results in nodes keeping whatever size is defined for them e.g. through parent parallel node or by manually setting the size.`),null),B3),P5),sE(P3)))),wv(e,jSt,mR,tBt),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,fR),FH),`Topdown Hierarchical Node Width`),`The fixed size of a hierarchical node when using topdown layout. If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself.`),150),z3),TG),Zp(F3,U(O(L3,1),Z,170,0,[P3]))))),wv(e,fR,mR,null),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,pR),FH),`Topdown Hierarchical Node Aspect Ratio`),`The fixed aspect ratio of a hierarchical node when using topdown layout. Default is 1/sqrt(2). If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself.`),1.414),z3),TG),Zp(F3,U(O(L3,1),Z,170,0,[P3]))))),wv(e,pR,mR,null),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,mR),FH),`Topdown Node Type`),`The different node types used for topdown layout. If the node type is set to {@link TopdownNodeTypes.PARALLEL_NODE} the algorithm must be set to a {@link TopdownLayoutProvider} such as {@link TopdownPacking}. The {@link nodeSize.fixedGraphSize} option is technically only required for hierarchical nodes.`),null),B3),BBt),sE(P3)))),wv(e,mR,aR,null),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,MSt),FH),`Topdown Scale Cap`),`Determines the upper limit for the topdown scale factor. The default value is 1.0 which ensures that nested children never end up appearing larger than their parents in terms of unit sizes such as the font size. If the limit is larger, nodes will fully utilize the available space, but it is counteriniuitive for inner nodes to have a larger scale than outer nodes.`),1),z3),TG),sE(F3)))),wv(e,MSt,mR,Qzt),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,KB),LSt),`Activate Inside Self Loops`),`Whether this node allows to route self loops inside of it instead of around it. If set to true, this will make the node a compound node if it isn't already, and will require the layout algorithm to support compound nodes with hierarchical ports.`),!1),R3),bG),sE(P3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,qB),LSt),`Inside Self Loop`),`Whether a self loop should be routed inside a node instead of around that node.`),!1),R3),bG),sE(M3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,PL),`edge`),`Edge Thickness`),`The thickness of an edge. This is a hint on the line width used to draw an edge, possibly requiring more space to be reserved for it.`),1),z3),TG),sE(M3)))),jE(e,new zA(Aa(ka(ja(Ta(wa(Oa(Ea(Da(new $t,NSt),`edge`),`Edge Type`),`The type of an edge. This is usually used for UML class diagrams, where associations must be handled differently from generalizations.`),pzt),B3),dBt),sE(M3)))),Uo(e,new ev(xa(Ca(Sa(new Qt,fI),`Layered`),`The layer-based method was introduced by Sugiyama, Tagawa and Toda in 1981. It emphasizes the direction of edges by pointing as many edges as possible into the same direction. The nodes are arranged in layers, which are sometimes called "hierarchies", and then reordered such that the number of edge crossings is minimized. Afterwards, concrete coordinates are computed for the nodes and edge bend points.`))),Uo(e,new ev(xa(Ca(Sa(new Qt,`org.eclipse.elk.orthogonal`),`Orthogonal`),`Orthogonal methods that follow the "topology-shape-metrics" approach by Batini, Nardelli and Tamassia '86. The first phase determines the topology of the drawing by applying a planarization technique, which results in a planar representation of the graph. The orthogonal shape is computed in the second phase, which aims at minimizing the number of edge bends, and is called orthogonalization. The third phase leads to concrete coordinates for nodes and edge bend points by applying a compaction method, thus defining the metrics.`))),Uo(e,new ev(xa(Ca(Sa(new Qt,YL),`Force`),`Layout algorithms that follow physical analogies by simulating a system of attractive and repulsive forces. The first successful method of this kind was proposed by Eades in 1984.`))),Uo(e,new ev(xa(Ca(Sa(new Qt,`org.eclipse.elk.circle`),`Circle`),`Circular layout algorithms emphasize cycles or biconnected components of a graph by arranging them in circles. This is useful if a drawing is desired where such components are clearly grouped, or where cycles are shown as prominent OPTIONS of the graph.`))),Uo(e,new ev(xa(Ca(Sa(new Qt,dxt),`Tree`),`Specialized layout methods for trees, i.e. acyclic graphs. The regular structure of graphs that have no undirected cycles can be emphasized using an algorithm of this type.`))),Uo(e,new ev(xa(Ca(Sa(new Qt,`org.eclipse.elk.planar`),`Planar`),`Algorithms that require a planar or upward planar graph. Most of these algorithms are theoretically interesting, but not practically usable.`))),Uo(e,new ev(xa(Ca(Sa(new Qt,iH),`Radial`),`Radial layout algorithms usually position the nodes of the graph on concentric circles.`))),Klt((new Xue,e)),cdt((new Jue,e)),bct((new Zue,e))};var s6,tzt,nzt,c6,rzt,izt,azt,l6,u6,ozt,d6,szt,f6,p6,czt,m6,h6,lzt,uzt,dzt,fzt,pzt,mzt,g6,hzt,gzt,_6,v6,y6,b6,x6,_zt,S6,vzt,yzt,bzt,C6,xzt,w6,Szt,T6,E6,Czt,D6,wzt,O6,k6,A6,Tzt,Ezt,Dzt,Ozt,kzt,Azt,jzt,j6,M6,N6,P6,Mzt,F6,I6,Nzt,L6,R6,z6,Pzt,Fzt,B6,Izt,V6,H6,U6,W6,Lzt,G6,Rzt,zzt,Bzt,Vzt,Hzt,Uzt,K6,Wzt,q6,Gzt,Kzt,J6,qzt,Jzt,Yzt,Xzt,Y6,X6,Z6,Q6,Zzt,Qzt,$6,$zt,eBt,tBt;L(AH,`CoreOptions`,699),q(88,22,{3:1,34:1,22:1,88:1},jc);var e8,t8,n8,r8,i8,a8=aS(AH,Vyt,88,eG,KHe,WAe),nBt;q(278,22,{3:1,34:1,22:1,278:1},Mc);var o8,s8,c8,rBt=aS(AH,`EdgeLabelPlacement`,278,eG,Eze,GAe),iBt;q(223,22,{3:1,34:1,22:1,223:1},Nc);var l8,u8,d8,f8,p8=aS(AH,`EdgeRouting`,223,eG,MVe,KAe),aBt;q(321,22,{3:1,34:1,22:1,321:1},Pc);var oBt,sBt,cBt,lBt,m8,uBt,dBt=aS(AH,`EdgeType`,321,eG,cGe,qAe),fBt;q(989,1,nL,Xue),Q.hf=function(e){Klt(e)};var pBt,mBt,hBt,gBt,_Bt,vBt,h8;L(AH,`FixedLayouterOptions`,989),q(990,1,{},pse),Q.sf=function(){var e;return e=new wse,e},Q.tf=function(e){},L(AH,`FixedLayouterOptions/FixedFactory`,990),q(346,22,{3:1,34:1,22:1,346:1},Fc);var g8,_8,v8,yBt=aS(AH,`HierarchyHandling`,346,eG,wze,JAe),bBt;q(291,22,{3:1,34:1,22:1,291:1},Ic);var y8,b8,x8,S8,xBt=aS(AH,`LabelSide`,291,eG,jVe,YAe),SBt;q(95,22,{3:1,34:1,22:1,95:1},Lc);var C8,w8,T8,E8,D8,O8,k8,A8,j8,M8=aS(AH,`NodeLabelPlacement`,95,eG,Lqe,XAe),CBt;q(256,22,{3:1,34:1,22:1,256:1},Rc);var wBt,N8,P8,TBt,F8,I8=aS(AH,`PortAlignment`,256,eG,pUe,ZAe),EBt;q(101,22,{3:1,34:1,22:1,101:1},zc);var L8,R8,z8,B8,V8,H8,DBt=aS(AH,`PortConstraints`,101,eG,sGe,QAe),OBt;q(279,22,{3:1,34:1,22:1,279:1},Bc);var U8,W8,G8,K8,q8,J8,Y8=aS(AH,`PortLabelPlacement`,279,eG,oGe,$Ae),kBt;q(64,22,{3:1,34:1,22:1,64:1},Vc);var X8,Z8,Q8,$8,e5,t5,n5,r5,i5,a5,o5,s5,c5,l5,u5,d5,f5,p5,m5,h5,g5,_5=aS(AH,`PortSide`,64,eG,qHe,eje),ABt;q(993,1,nL,Zue),Q.hf=function(e){bct(e)};var jBt,MBt,NBt,PBt,FBt;L(AH,`RandomLayouterOptions`,993),q(994,1,{},mse),Q.sf=function(){var e;return e=new xse,e},Q.tf=function(e){},L(AH,`RandomLayouterOptions/RandomFactory`,994),q(386,22,{3:1,34:1,22:1,386:1},Hc);var v5,y5,b5,x5,S5=aS(AH,`SizeConstraint`,386,eG,AVe,tje),IBt;q(264,22,{3:1,34:1,22:1,264:1},Uc);var C5,w5,T5,E5,D5,O5,k5,A5,j5,LBt=aS(AH,`SizeOptions`,264,eG,fJe,nje),RBt;q(280,22,{3:1,34:1,22:1,280:1},Wc);var M5,zBt,N5,BBt=aS(AH,`TopdownNodeTypes`,280,eG,Dze,rje),VBt;q(347,22,RSt);var HBt,UBt,P5=aS(AH,`TopdownSizeApproximator`,347,eG,kLe,aje);q(987,347,RSt,AMe),Q.Tg=function(e){return T4e(e)},aS(AH,`TopdownSizeApproximator/1`,987,P5,null,null),q(988,347,RSt,cPe),Q.Tg=function(e){var t=P(J(e,(vP(),W6)),143),n,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,ee=(Ia(),m=new ii,m),te,ne,C;for(qj(ee,e),te=new Dr,o=new Lu((!e.a&&(e.a=new F($5,e,10,11)),e.a));o.e!=o.i.gc();)i=P(gO(o),27),y=(p=new ii,p),Gj(y,ee),qj(y,i),C=T4e(i),Ql(y,r.Math.max(i.g,C.a),r.Math.max(i.f,C.b)),XA(te.f,i,y);for(a=new Lu((!e.a&&(e.a=new F($5,e,10,11)),e.a));a.e!=a.i.gc();)for(i=P(gO(a),27),d=new Lu((!i.e&&(i.e=new cf(U5,i,7,4)),i.e));d.e!=d.i.gc();)u=P(gO(d),74),x=P(nl(Kp(te.f,i)),27),S=P(xh(te,H((!u.c&&(u.c=new cf(H5,u,5,8)),u.c),0)),27),b=(f=new nn,f),tb((!b.b&&(b.b=new cf(H5,b,4,7)),b.b),x),tb((!b.c&&(b.c=new cf(H5,b,5,8)),b.c),S),Hj(b,I_(x)),qj(b,u);g=P(h_(t.f),205);try{g.rf(ee,new Dse),bFe(t.f,g)}catch(e){throw e=ew(e),j(e,103)?(h=e,E(h)):E(e)}return qy(ee,u6)||qy(ee,l6)||G_t(ee),l=D(N(J(ee,u6))),c=D(N(J(ee,l6))),s=l/c,n=D(N(J(ee,X6)))*r.Math.sqrt((!ee.a&&(ee.a=new F($5,ee,10,11)),ee.a).i),ne=P(J(ee,A6),107),v=ne.b+ne.c+1,_=ne.d+ne.a+1,new k(r.Math.max(v,n),r.Math.max(_,n/s))},aS(AH,`TopdownSizeApproximator/2`,988,P5,null,null);var WBt;q(344,1,{871:1},di),Q.Ug=function(e,t){return p7e(this,e,t)},Q.Vg=function(){Q9e(this)},Q.Wg=function(){return this.q},Q.Xg=function(){return this.f?Zg(this.f):null},Q.Yg=function(){return Zg(this.a)},Q.Zg=function(){return this.p},Q.$g=function(){return!1},Q._g=function(){return this.n},Q.ah=function(){return this.p!=null&&!this.b},Q.bh=function(e){var t;this.n&&(t=e,M(this.f,t))},Q.dh=function(e,t){var n,r;this.n&&e&&Xze(this,(n=new GPe,r=WM(n,e),Yht(n),r),(Mw(),I5))},Q.eh=function(e){var t;return this.b?null:(t=XKe(this,this.g),up(this.a,t),t.i=this,this.d=e,t)},Q.fh=function(e){e>0&&!this.b&&kJe(this,e)},Q.b=!1,Q.c=0,Q.d=-1,Q.e=null,Q.f=null,Q.g=-1,Q.j=!1,Q.k=!1,Q.n=!1,Q.o=0,Q.q=0,Q.r=0,L(gV,`BasicProgressMonitor`,344),q(717,205,OL,hse),Q.rf=function(e,t){Xdt(e,t)},L(gV,`BoxLayoutProvider`,717),q(983,1,GI,ehe),Q.Ne=function(e,t){return mot(this,P(e,27),P(t,27))},Q.Fb=function(e){return this===e},Q.Oe=function(){return new Yn(this)},Q.a=!1,L(gV,`BoxLayoutProvider/1`,983),q(163,1,{163:1},Fx,qEe),Q.Ib=function(){return this.c?Elt(this.c):CA(this.b)},L(gV,`BoxLayoutProvider/Group`,163),q(320,22,{3:1,34:1,22:1,320:1},Gc);var GBt,KBt,qBt,F5,JBt=aS(gV,`BoxLayoutProvider/PackingMode`,320,eG,NVe,oje),YBt;q(984,1,GI,gse),Q.Ne=function(e,t){return PIe(P(e,163),P(t,163))},Q.Fb=function(e){return this===e},Q.Oe=function(){return new Yn(this)},L(gV,`BoxLayoutProvider/lambda$0$Type`,984),q(985,1,GI,_se),Q.Ne=function(e,t){return SIe(P(e,163),P(t,163))},Q.Fb=function(e){return this===e},Q.Oe=function(){return new Yn(this)},L(gV,`BoxLayoutProvider/lambda$1$Type`,985),q(986,1,GI,vse),Q.Ne=function(e,t){return CIe(P(e,163),P(t,163))},Q.Fb=function(e){return this===e},Q.Oe=function(){return new Yn(this)},L(gV,`BoxLayoutProvider/lambda$2$Type`,986),q(1384,1,{845:1},yse),Q.Mg=function(e,t){return zo(),!j(t,167)||Cye((lw(),P(e,167)),t)},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$0$Type`,1384),q(1385,1,$P,the),Q.Cd=function(e){EQe(this.a,P(e,149))},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$1$Type`,1385),q(1386,1,$P,Sse),Q.Cd=function(e){P(e,96),zo()},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$2$Type`,1386),q(1390,1,$P,nhe),Q.Cd=function(e){sYe(this.a,P(e,96))},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$3$Type`,1390),q(1388,1,vF,ySe),Q.Mb=function(e){return WZe(this.a,this.b,P(e,149))},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$4$Type`,1388),q(1387,1,vF,bSe),Q.Mb=function(e){return wEe(this.a,this.b,P(e,845))},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$5$Type`,1387),q(1389,1,$P,xSe),Q.Cd=function(e){nPe(this.a,this.b,P(e,149))},L(gV,`ElkSpacings/AbstractSpacingsBuilder/lambda$6$Type`,1389),q(947,1,{},Cse),Q.Kb=function(e){return LCe(e)},Q.Fb=function(e){return this===e},L(gV,`ElkUtil/lambda$0$Type`,947),q(948,1,$P,SSe),Q.Cd=function(e){Gnt(this.a,this.b,P(e,74))},Q.a=0,Q.b=0,L(gV,`ElkUtil/lambda$1$Type`,948),q(949,1,$P,CSe),Q.Cd=function(e){X_e(this.a,this.b,P(e,166))},Q.a=0,Q.b=0,L(gV,`ElkUtil/lambda$2$Type`,949),q(950,1,$P,wSe),Q.Cd=function(e){rwe(this.a,this.b,P(e,135))},Q.a=0,Q.b=0,L(gV,`ElkUtil/lambda$3$Type`,950),q(951,1,$P,rhe),Q.Cd=function(e){jMe(this.a,P(e,377))},L(gV,`ElkUtil/lambda$4$Type`,951),q(325,1,{34:1,325:1},Er),Q.Fd=function(e){return aTe(this,P(e,242))},Q.Fb=function(e){var t;return j(e,325)?(t=P(e,325),this.a==t.a):!1},Q.Hb=function(){return C_(this.a)},Q.Ib=function(){return this.a+` (exclusive)`},Q.a=0,L(gV,`ExclusiveBounds/ExclusiveLowerBound`,325),q(1119,205,OL,wse),Q.rf=function(e,t){var n,i,a,o,s,c,l,u,f,p,m,h,g,_,v,y,b,x,S,ee,te,ne,C;for(t.Ug(`Fixed Layout`,1),o=P(J(e,(vP(),uzt)),223),p=0,m=0,b=new Lu((!e.a&&(e.a=new F($5,e,10,11)),e.a));b.e!=b.i.gc();){for(v=P(gO(b),27),C=P(J(v,(Iw(),h8)),8),C&&($l(v,C.a,C.b),P(J(v,mBt),181).Hc((TD(),v5))&&(h=P(J(v,gBt),8),h.a>0&&h.b>0&&iP(v,h.a,h.b,!0,!0))),p=r.Math.max(p,v.i+v.g),m=r.Math.max(m,v.j+v.f),u=new Lu((!v.n&&(v.n=new F(Q5,v,1,7)),v.n));u.e!=u.i.gc();)c=P(gO(u),135),C=P(J(c,h8),8),C&&$l(c,C.a,C.b),p=r.Math.max(p,v.i+c.i+c.g),m=r.Math.max(m,v.j+c.j+c.f);for(ee=new Lu((!v.c&&(v.c=new F(e7,v,9,9)),v.c));ee.e!=ee.i.gc();)for(S=P(gO(ee),123),C=P(J(S,h8),8),C&&$l(S,C.a,C.b),te=v.i+S.i,ne=v.j+S.j,p=r.Math.max(p,te+S.g),m=r.Math.max(m,ne+S.f),l=new Lu((!S.n&&(S.n=new F(Q5,S,1,7)),S.n));l.e!=l.i.gc();)c=P(gO(l),135),C=P(J(c,h8),8),C&&$l(c,C.a,C.b),p=r.Math.max(p,te+c.i+c.g),m=r.Math.max(m,ne+c.j+c.f);for(a=new pm(Vu(Ij(v).a.Kc(),new d));Cj(a);)n=P(by(a),74),f=r_t(n),p=r.Math.max(p,f.a),m=r.Math.max(m,f.b);for(i=new pm(Vu(Fj(v).a.Kc(),new d));Cj(i);)n=P(by(i),74),I_(xA(n))!=e&&(f=r_t(n),p=r.Math.max(p,f.a),m=r.Math.max(m,f.b))}if(o==(wE(),l8))for(y=new Lu((!e.a&&(e.a=new F($5,e,10,11)),e.a));y.e!=y.i.gc();)for(v=P(gO(y),27),i=new pm(Vu(Ij(v).a.Kc(),new d));Cj(i);)n=P(by(i),74),s=Sdt(n),s.b==0?OO(n,x6,null):OO(n,x6,s);ki(Od(J(e,(Iw(),hBt))))||(x=P(J(e,_Bt),107),_=p+x.b+x.c,g=m+x.d+x.a,iP(e,_,g,!0,!0)),t.Vg()},L(gV,`FixedLayoutProvider`,1119),q(385,137,{3:1,423:1,385:1,96:1,137:1},en,uKe),Q.cg=function(e){var t,n,r,i,a,o,s,c,l;if(e)try{for(c=nN(e,`;,;`),a=c,o=0,s=a.length;o>16&OF|t^r<<16},Q.Kc=function(){return new ihe(this)},Q.Ib=function(){return this.a==null&&this.b==null?`pair(null,null)`:this.a==null?`pair(null,`+PE(this.b)+`)`:this.b==null?`pair(`+PE(this.a)+`,null)`:`pair(`+PE(this.a)+`,`+PE(this.b)+`)`},L(gV,`Pair`,42),q(995,1,VP,ihe),Q.Nb=function(e){Om(this,e)},Q.Ob=function(){return!this.c&&(!this.b&&this.a.a!=null||this.a.b!=null)},Q.Pb=function(){if(!this.c&&!this.b&&this.a.a!=null)return this.b=!0,this.a.a;if(!this.c&&this.a.b!=null)return this.c=!0,this.a.b;throw E(new Hr)},Q.Qb=function(){throw this.c&&this.a.b!=null?this.a.b=null:this.b&&this.a.a!=null&&(this.a.a=null),E(new Rr)},Q.b=!1,Q.c=!1,L(gV,`Pair/1`,995),q(455,1,{455:1},cIe),Q.Fb=function(e){return rg(this.a,P(e,455).a)&&rg(this.c,P(e,455).c)&&rg(this.d,P(e,455).d)&&rg(this.b,P(e,455).b)},Q.Hb=function(){return tT(U(O(WW,1),FP,1,5,[this.a,this.c,this.d,this.b]))},Q.Ib=function(){return`(`+this.a+PP+this.c+PP+this.d+PP+this.b+`)`},L(gV,`Quadruple`,455),q(1108,205,OL,xse),Q.rf=function(e,t){var n,r,i,a,o;if(t.Ug(`Random Layout`,1),(!e.a&&(e.a=new F($5,e,10,11)),e.a).i==0){t.Vg();return}a=P(J(e,(wD(),PBt)),17),i=a&&a.a!=0?new sy(a.a):new YE,n=Ai(N(J(e,jBt))),o=Ai(N(J(e,FBt))),r=P(J(e,MBt),107),wgt(e,i,n,o,r),t.Vg()},L(gV,`RandomLayoutProvider`,1108),q(240,1,{240:1},Vf),Q.Fb=function(e){return rg(this.a,P(e,240).a)&&rg(this.b,P(e,240).b)&&rg(this.c,P(e,240).c)},Q.Hb=function(){return tT(U(O(WW,1),FP,1,5,[this.a,this.b,this.c]))},Q.Ib=function(){return`(`+this.a+PP+this.b+PP+this.c+`)`},L(gV,`Triple`,240);var nVt;q(562,1,{}),Q.Lf=function(){return new k(this.f.i,this.f.j)},Q.of=function(e){return nLe(e,(vP(),F6))?J(this.f,rVt):J(this.f,e)},Q.Mf=function(){return new k(this.f.g,this.f.f)},Q.Nf=function(){return this.g},Q.pf=function(e){return qy(this.f,e)},Q.Of=function(e){Gx(this.f,e.a),Kx(this.f,e.b)},Q.Pf=function(e){Wx(this.f,e.a),Ux(this.f,e.b)},Q.Qf=function(e){this.g=e},Q.g=0;var rVt;L(RH,`ElkGraphAdapters/AbstractElkGraphElementAdapter`,562),q(563,1,{853:1},_r),Q.Rf=function(){var e,t;if(!this.b)for(this.b=kv(ag(this.a).i),t=new Lu(ag(this.a));t.e!=t.i.gc();)e=P(gO(t),135),M(this.b,new Di(e));return this.b},Q.b=null,L(RH,`ElkGraphAdapters/ElkEdgeAdapter`,563),q(289,562,{},Ei),Q.Sf=function(){return k3e(this)},Q.a=null,L(RH,`ElkGraphAdapters/ElkGraphAdapter`,289),q(640,562,{187:1},Di),L(RH,`ElkGraphAdapters/ElkLabelAdapter`,640),q(639,562,{695:1},sd),Q.Rf=function(){return D3e(this)},Q.Vf=function(){var e;return e=P(J(this.f,(vP(),S6)),140),!e&&(e=new ei),e},Q.Xf=function(){return O3e(this)},Q.Zf=function(e){var t=new Kf(e);OO(this.f,(vP(),S6),t)},Q.$f=function(e){OO(this.f,(vP(),A6),new bje(e))},Q.Tf=function(){return this.d},Q.Uf=function(){var e,t;if(!this.a)for(this.a=new T,t=new pm(Vu(Fj(P(this.f,27)).a.Kc(),new d));Cj(t);)e=P(by(t),74),M(this.a,new _r(e));return this.a},Q.Wf=function(){var e,t;if(!this.c)for(this.c=new T,t=new pm(Vu(Ij(P(this.f,27)).a.Kc(),new d));Cj(t);)e=P(by(t),74),M(this.c,new _r(e));return this.c},Q.Yf=function(){return Gg(P(this.f,27)).i!=0||ki(Od(P(this.f,27).of((vP(),_6))))},Q._f=function(){dKe(this,(Ko(),nVt))},Q.a=null,Q.b=null,Q.c=null,Q.d=null,Q.e=null,L(RH,`ElkGraphAdapters/ElkNodeAdapter`,639),q(1284,562,{852:1},ahe),Q.Rf=function(){return H3e(this)},Q.Uf=function(){var e,t;if(!this.a)for(this.a=dd(P(this.f,123).hh().i),t=new Lu(P(this.f,123).hh());t.e!=t.i.gc();)e=P(gO(t),74),M(this.a,new _r(e));return this.a},Q.Wf=function(){var e,t;if(!this.c)for(this.c=dd(P(this.f,123).ih().i),t=new Lu(P(this.f,123).ih());t.e!=t.i.gc();)e=P(gO(t),74),M(this.c,new _r(e));return this.c},Q.ag=function(){return P(P(this.f,123).of((vP(),B6)),64)},Q.bg=function(){var e,t,n,r=E_(P(this.f,123)),i,a,o,s;for(n=new Lu(P(this.f,123).ih());n.e!=n.i.gc();)for(e=P(gO(n),74),s=new Lu((!e.c&&(e.c=new cf(H5,e,5,8)),e.c));s.e!=s.i.gc();)if(o=P(gO(s),84),Ex(cA(o),r)||cA(o)==r&&ki(Od(J(e,(vP(),v6)))))return!0;for(t=new Lu(P(this.f,123).hh());t.e!=t.i.gc();)for(e=P(gO(t),74),a=new Lu((!e.b&&(e.b=new cf(H5,e,4,7)),e.b));a.e!=a.i.gc();)if(i=P(gO(a),84),Ex(cA(i),r))return!0;return!1},Q.a=null,Q.b=null,Q.c=null,L(RH,`ElkGraphAdapters/ElkPortAdapter`,1284),q(1285,1,GI,bse),Q.Ne=function(e,t){return Tlt(P(e,123),P(t,123))},Q.Fb=function(e){return this===e},Q.Oe=function(){return new Yn(this)},L(RH,`ElkGraphAdapters/PortComparator`,1285);var L5=gp(zH,`EObject`),R5=gp(BH,VSt),z5=gp(BH,HSt),B5=gp(BH,USt),V5=gp(BH,`ElkShape`),H5=gp(BH,WSt),U5=gp(BH,GSt),W5=gp(BH,KSt),G5=gp(zH,qSt),K5=gp(zH,`EFactory`),iVt,q5=gp(zH,JSt),J5=gp(zH,`EPackage`),Y5,aVt,oVt,sVt,X5,cVt,lVt,uVt,dVt,Z5,fVt,pVt,Q5=gp(BH,YSt),$5=gp(BH,XSt),e7=gp(BH,ZSt);q(93,1,QSt),Q.th=function(){return this.uh(),null},Q.uh=function(){return null},Q.vh=function(){return this.uh(),!1},Q.wh=function(){return!1},Q.xh=function(e){AC(this,e)},L(VH,`BasicNotifierImpl`,93),q(99,93,nCt),Q.Yh=function(){return Gl(this)},Q.yh=function(e,t){return e},Q.zh=function(){throw E(new Br)},Q.Ah=function(e){var t;return t=qO(P(_x(this.Dh(),this.Fh()),19)),this.Ph().Th(this,t.n,t.f,e)},Q.Bh=function(e,t){throw E(new Br)},Q.Ch=function(e,t,n){return qM(this,e,t,n)},Q.Dh=function(){var e;return this.zh()&&(e=this.zh().Nk(),e)?e:this.ii()},Q.Eh=function(){return xj(this)},Q.Fh=function(){throw E(new Br)},Q.Gh=function(){var e,t=this.$h().Ok();return!t&&this.zh().Tk(t=(Yo(),e=MLe(aN(this.Dh())),e==null?i9:new ad(this,e))),t},Q.Hh=function(e,t){return e},Q.Ih=function(e){return e.pk()?e.Lj():eD(this.Dh(),e)},Q.Jh=function(){var e=this.zh();return e?e.Qk():null},Q.Kh=function(){return this.zh()?this.zh().Nk():null},Q.Lh=function(e,t,n){return jO(this,e,t,n)},Q.Mh=function(e){return mb(this,e)},Q.Nh=function(e,t){return wy(this,e,t)},Q.Oh=function(){var e=this.zh();return!!e&&e.Rk()},Q.Ph=function(){throw E(new Br)},Q.Qh=function(){return KD(this)},Q.Rh=function(e,t,n,r){return EO(this,e,t,r)},Q.Sh=function(e,t,n){var r;return r=P(_x(this.Dh(),t),69),r.wk().zk(this,this.hi(),t-this.ji(),e,n)},Q.Th=function(e,t,n,r){return m_(this,e,t,r)},Q.Uh=function(e,t,n){var r;return r=P(_x(this.Dh(),t),69),r.wk().Ak(this,this.hi(),t-this.ji(),e,n)},Q.Vh=function(){return!!this.zh()&&!!this.zh().Pk()},Q.Wh=function(e){return mO(this,e)},Q.Xh=function(e){return iRe(this,e)},Q.Zh=function(e){return Iht(this,e)},Q.$h=function(){throw E(new Br)},Q._h=function(){return this.zh()?this.zh().Pk():null},Q.ai=function(){return KD(this)},Q.bi=function(e,t){QA(this,e,t)},Q.ci=function(e){this.$h().Sk(e)},Q.di=function(e){this.$h().Vk(e)},Q.ei=function(e){this.$h().Uk(e)},Q.fi=function(e,t){var n,r,i,a=this.Jh();return a&&e&&(t=AO(a.El(),this,t),a.Il(this)),r=this.Ph(),r&&((IM(this,this.Ph(),this.Fh()).Bb&pI)==0?(t=(n=this.Fh(),n>=0?this.Ah(t):this.Ph().Th(this,-1-n,null,t)),t=this.Ch(null,-1,t)):(i=r.Qh(),i&&(e?!a&&i.Il(this):i.Hl(this)))),this.di(e),t},Q.gi=function(e){var t,n=this.Dh(),r,i,a=eD(n,e),o,s,c;if(t=this.ji(),a>=t)return P(e,69).wk().Dk(this,this.hi(),a-t);if(a<=-1)if(o=HN((UA(),l9),n,e),o){if(Qo(),P(o,69).xk()||(o=mv(Rb(l9,o))),i=(r=this.Ih(o),P(r>=0?this.Lh(r,!0,!0):mj(this,o,!0),160)),c=o.Ik(),c>1||c==-1)return P(P(i,220).Sl(e,!1),79)}else throw E(new Fi(HH+e.xe()+WH));else if(e.Jk())return r=this.Ih(e),P(r>=0?this.Lh(r,!1,!0):mj(this,e,!1),79);return s=new JSe(this,e),s},Q.hi=function(){return Jb(this)},Q.ii=function(){return(vh(),z7).S},Q.ji=function(){return bh(this.ii())},Q.ki=function(e){BA(this,e)},Q.Ib=function(){return Aj(this)},L(KH,`BasicEObjectImpl`,99);var mVt;q(119,99,{110:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1}),Q.li=function(e){return qb(this)[e]},Q.mi=function(e,t){Sh(qb(this),e,t)},Q.ni=function(e){Sh(qb(this),e,null)},Q.th=function(){return P(NC(this,4),129)},Q.uh=function(){throw E(new Br)},Q.vh=function(){return!!(this.Db&4)},Q.zh=function(){throw E(new Br)},Q.oi=function(e){GD(this,2,e)},Q.Bh=function(e,t){this.Db=t<<16|this.Db&255,this.oi(e)},Q.Dh=function(){return d_(this)},Q.Fh=function(){return this.Db>>16},Q.Gh=function(){var e,t;return Yo(),t=MLe(aN((e=P(NC(this,16),29),e||this.ii()))),t==null?i9:new ad(this,t)},Q.wh=function(){return!(this.Db&1)},Q.Jh=function(){return P(NC(this,128),2034)},Q.Kh=function(){return P(NC(this,16),29)},Q.Oh=function(){return!!(this.Db&32)},Q.Ph=function(){return P(NC(this,2),54)},Q.Vh=function(){return!!(this.Db&64)},Q.$h=function(){throw E(new Br)},Q._h=function(){return P(NC(this,64),288)},Q.ci=function(e){GD(this,16,e)},Q.di=function(e){GD(this,128,e)},Q.ei=function(e){GD(this,64,e)},Q.hi=function(){return WD(this)},Q.Db=0,L(KH,`MinimalEObjectImpl`,119),q(120,119,{110:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1}),Q.oi=function(e){this.Cb=e},Q.Ph=function(){return this.Cb},L(KH,`MinimalEObjectImpl/Container`,120),q(2083,120,{110:1,342:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1}),Q.Lh=function(e,t,n){return W3e(this,e,t,n)},Q.Uh=function(e,t,n){return x9e(this,e,t,n)},Q.Wh=function(e){return yBe(this,e)},Q.bi=function(e,t){qZe(this,e,t)},Q.ii=function(){return lP(),pVt},Q.ki=function(e){sZe(this,e)},Q.nf=function(){return H2e(this)},Q.gh=function(){return!this.o&&(this.o=new lb((lP(),Z5),n7,this,0)),this.o},Q.of=function(e){return J(this,e)},Q.pf=function(e){return qy(this,e)},Q.qf=function(e,t){return OO(this,e,t)},L(qH,`EMapPropertyHolderImpl`,2083),q(572,120,{110:1,377:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1},tn),Q.Lh=function(e,t,n){switch(e){case 0:return this.a;case 1:return this.b}return jO(this,e,t,n)},Q.Wh=function(e){switch(e){case 0:return this.a!=0;case 1:return this.b!=0}return mO(this,e)},Q.bi=function(e,t){switch(e){case 0:Xx(this,D(N(t)));return;case 1:Vx(this,D(N(t)));return}QA(this,e,t)},Q.ii=function(){return lP(),aVt},Q.ki=function(e){switch(e){case 0:Xx(this,0);return;case 1:Vx(this,0);return}BA(this,e)},Q.Ib=function(){var e;return this.Db&64?Aj(this):(e=new Wu(Aj(this)),e.a+=` (x: `,Ua(e,this.a),e.a+=`, y: `,Ua(e,this.b),e.a+=`)`,e.a)},Q.a=0,Q.b=0,L(qH,`ElkBendPointImpl`,572),q(739,2083,{110:1,342:1,167:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1}),Q.Lh=function(e,t,n){return ZT(this,e,t,n)},Q.Sh=function(e,t,n){return uA(this,e,t,n)},Q.Uh=function(e,t,n){return XC(this,e,t,n)},Q.Wh=function(e){return pXe(this,e)},Q.bi=function(e,t){V8e(this,e,t)},Q.ii=function(){return lP(),cVt},Q.ki=function(e){vT(this,e)},Q.jh=function(){return this.k},Q.kh=function(){return ag(this)},Q.Ib=function(){return pE(this)},Q.k=null,L(qH,`ElkGraphElementImpl`,739),q(740,739,{110:1,342:1,167:1,422:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1}),Q.Lh=function(e,t,n){return FE(this,e,t,n)},Q.Wh=function(e){return JE(this,e)},Q.bi=function(e,t){H8e(this,e,t)},Q.ii=function(){return lP(),fVt},Q.ki=function(e){dD(this,e)},Q.lh=function(){return this.f},Q.mh=function(){return this.g},Q.nh=function(){return this.i},Q.oh=function(){return this.j},Q.ph=function(e,t){Ql(this,e,t)},Q.qh=function(e,t){$l(this,e,t)},Q.rh=function(e){Gx(this,e)},Q.sh=function(e){Kx(this,e)},Q.Ib=function(){return AA(this)},Q.f=0,Q.g=0,Q.i=0,Q.j=0,L(qH,`ElkShapeImpl`,740),q(741,740,{110:1,342:1,84:1,167:1,422:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1}),Q.Lh=function(e,t,n){return tk(this,e,t,n)},Q.Sh=function(e,t,n){return b8e(this,e,t,n)},Q.Uh=function(e,t,n){return x8e(this,e,t,n)},Q.Wh=function(e){return BZe(this,e)},Q.bi=function(e,t){cit(this,e,t)},Q.ii=function(){return lP(),oVt},Q.ki=function(e){DO(this,e)},Q.hh=function(){return!this.d&&(this.d=new cf(U5,this,8,5)),this.d},Q.ih=function(){return!this.e&&(this.e=new cf(U5,this,7,4)),this.e},L(qH,`ElkConnectableShapeImpl`,741),q(326,739,{110:1,342:1,74:1,167:1,326:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1},nn),Q.Ah=function(e){return P6e(this,e)},Q.Lh=function(e,t,n){switch(e){case 3:return T_(this);case 4:return!this.b&&(this.b=new cf(H5,this,4,7)),this.b;case 5:return!this.c&&(this.c=new cf(H5,this,5,8)),this.c;case 6:return!this.a&&(this.a=new F(W5,this,6,6)),this.a;case 7:return rd(),!this.b&&(this.b=new cf(H5,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new cf(H5,this,5,8)),this.c.i<=1));case 8:return rd(),!!yj(this);case 9:return rd(),!!uj(this);case 10:return rd(),!this.b&&(this.b=new cf(H5,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new cf(H5,this,5,8)),this.c.i!=0)}return ZT(this,e,t,n)},Q.Sh=function(e,t,n){var r;switch(t){case 3:return this.Cb&&(n=(r=this.Db>>16,r>=0?P6e(this,n):this.Cb.Th(this,-1-r,null,n))),Bd(this,P(e,27),n);case 4:return!this.b&&(this.b=new cf(H5,this,4,7)),vD(this.b,e,n);case 5:return!this.c&&(this.c=new cf(H5,this,5,8)),vD(this.c,e,n);case 6:return!this.a&&(this.a=new F(W5,this,6,6)),vD(this.a,e,n)}return uA(this,e,t,n)},Q.Uh=function(e,t,n){switch(t){case 3:return Bd(this,null,n);case 4:return!this.b&&(this.b=new cf(H5,this,4,7)),AO(this.b,e,n);case 5:return!this.c&&(this.c=new cf(H5,this,5,8)),AO(this.c,e,n);case 6:return!this.a&&(this.a=new F(W5,this,6,6)),AO(this.a,e,n)}return XC(this,e,t,n)},Q.Wh=function(e){switch(e){case 3:return!!T_(this);case 4:return!!this.b&&this.b.i!=0;case 5:return!!this.c&&this.c.i!=0;case 6:return!!this.a&&this.a.i!=0;case 7:return!this.b&&(this.b=new cf(H5,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new cf(H5,this,5,8)),this.c.i<=1));case 8:return yj(this);case 9:return uj(this);case 10:return!this.b&&(this.b=new cf(H5,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new cf(H5,this,5,8)),this.c.i!=0)}return pXe(this,e)},Q.bi=function(e,t){switch(e){case 3:Hj(this,P(t,27));return;case 4:!this.b&&(this.b=new cf(H5,this,4,7)),RN(this.b),!this.b&&(this.b=new cf(H5,this,4,7)),th(this.b,P(t,16));return;case 5:!this.c&&(this.c=new cf(H5,this,5,8)),RN(this.c),!this.c&&(this.c=new cf(H5,this,5,8)),th(this.c,P(t,16));return;case 6:!this.a&&(this.a=new F(W5,this,6,6)),RN(this.a),!this.a&&(this.a=new F(W5,this,6,6)),th(this.a,P(t,16));return}V8e(this,e,t)},Q.ii=function(){return lP(),sVt},Q.ki=function(e){switch(e){case 3:Hj(this,null);return;case 4:!this.b&&(this.b=new cf(H5,this,4,7)),RN(this.b);return;case 5:!this.c&&(this.c=new cf(H5,this,5,8)),RN(this.c);return;case 6:!this.a&&(this.a=new F(W5,this,6,6)),RN(this.a);return}vT(this,e)},Q.Ib=function(){return ipt(this)},L(qH,`ElkEdgeImpl`,326),q(452,2083,{110:1,342:1,166:1,452:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1},rn),Q.Ah=function(e){return b6e(this,e)},Q.Lh=function(e,t,n){switch(e){case 1:return this.j;case 2:return this.k;case 3:return this.b;case 4:return this.c;case 5:return!this.a&&(this.a=new ju(z5,this,5)),this.a;case 6:return QLe(this);case 7:return t?KO(this):this.i;case 8:return t?GO(this):this.f;case 9:return!this.g&&(this.g=new cf(W5,this,9,10)),this.g;case 10:return!this.e&&(this.e=new cf(W5,this,10,9)),this.e;case 11:return this.d}return W3e(this,e,t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 6:return this.Cb&&(n=(i=this.Db>>16,i>=0?b6e(this,n):this.Cb.Th(this,-1-i,null,n))),jDe(this,P(e,74),n);case 9:return!this.g&&(this.g=new cf(W5,this,9,10)),vD(this.g,e,n);case 10:return!this.e&&(this.e=new cf(W5,this,10,9)),vD(this.e,e,n)}return a=P(_x((r=P(NC(this,16),29),r||(lP(),X5)),t),69),a.wk().zk(this,WD(this),t-bh((lP(),X5)),e,n)},Q.Uh=function(e,t,n){switch(t){case 5:return!this.a&&(this.a=new ju(z5,this,5)),AO(this.a,e,n);case 6:return jDe(this,null,n);case 9:return!this.g&&(this.g=new cf(W5,this,9,10)),AO(this.g,e,n);case 10:return!this.e&&(this.e=new cf(W5,this,10,9)),AO(this.e,e,n)}return x9e(this,e,t,n)},Q.Wh=function(e){switch(e){case 1:return this.j!=0;case 2:return this.k!=0;case 3:return this.b!=0;case 4:return this.c!=0;case 5:return!!this.a&&this.a.i!=0;case 6:return!!QLe(this);case 7:return!!this.i;case 8:return!!this.f;case 9:return!!this.g&&this.g.i!=0;case 10:return!!this.e&&this.e.i!=0;case 11:return this.d!=null}return yBe(this,e)},Q.bi=function(e,t){switch(e){case 1:qx(this,D(N(t)));return;case 2:Yx(this,D(N(t)));return;case 3:Hx(this,D(N(t)));return;case 4:Jx(this,D(N(t)));return;case 5:!this.a&&(this.a=new ju(z5,this,5)),RN(this.a),!this.a&&(this.a=new ju(z5,this,5)),th(this.a,P(t,16));return;case 6:Jat(this,P(t,74));return;case 7:ES(this,P(t,84));return;case 8:TS(this,P(t,84));return;case 9:!this.g&&(this.g=new cf(W5,this,9,10)),RN(this.g),!this.g&&(this.g=new cf(W5,this,9,10)),th(this.g,P(t,16));return;case 10:!this.e&&(this.e=new cf(W5,this,10,9)),RN(this.e),!this.e&&(this.e=new cf(W5,this,10,9)),th(this.e,P(t,16));return;case 11:qJe(this,kd(t));return}qZe(this,e,t)},Q.ii=function(){return lP(),X5},Q.ki=function(e){switch(e){case 1:qx(this,0);return;case 2:Yx(this,0);return;case 3:Hx(this,0);return;case 4:Jx(this,0);return;case 5:!this.a&&(this.a=new ju(z5,this,5)),RN(this.a);return;case 6:Jat(this,null);return;case 7:ES(this,null);return;case 8:TS(this,null);return;case 9:!this.g&&(this.g=new cf(W5,this,9,10)),RN(this.g);return;case 10:!this.e&&(this.e=new cf(W5,this,10,9)),RN(this.e);return;case 11:qJe(this,null);return}sZe(this,e)},Q.Ib=function(){return xrt(this)},Q.b=0,Q.c=0,Q.d=null,Q.j=0,Q.k=0,L(qH,`ElkEdgeSectionImpl`,452),q(158,120,{110:1,94:1,93:1,155:1,58:1,114:1,54:1,99:1,158:1,119:1,120:1}),Q.Lh=function(e,t,n){var r;return e==0?(!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab):xb(this,e-bh(this.ii()),_x((r=P(NC(this,16),29),r||this.ii()),e),t,n)},Q.Sh=function(e,t,n){var r,i;return t==0?(!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n)):(i=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),i.wk().zk(this,WD(this),t-bh(this.ii()),e,n))},Q.Uh=function(e,t,n){var r,i;return t==0?(!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n)):(i=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),i.wk().Ak(this,WD(this),t-bh(this.ii()),e,n))},Q.Wh=function(e){var t;return e==0?!!this.Ab&&this.Ab.i!=0:Hv(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.Zh=function(e){return rP(this,e)},Q.bi=function(e,t){var n;if(e===0){!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return}LE(this,e-bh(this.ii()),_x((n=P(NC(this,16),29),n||this.ii()),e),t)},Q.di=function(e){GD(this,128,e)},Q.ii=function(){return CP(),qVt},Q.ki=function(e){var t;if(e===0){!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return}PT(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.pi=function(){this.Bb|=1},Q.qi=function(e){return JM(this,e)},Q.Bb=0,L(KH,`EModelElementImpl`,158),q(720,158,{110:1,94:1,93:1,480:1,155:1,58:1,114:1,54:1,99:1,158:1,119:1,120:1},$ue),Q.ri=function(e,t){return yht(this,e,t)},Q.si=function(e){var t,n,r,i,a;if(this.a!=Mx(e)||e.Bb&256)throw E(new Fi($H+e.zb+XH));for(r=l_(e);Jv(r.a).i!=0;){if(n=P(GN(r,0,(t=P(H(Jv(r.a),0),89),a=t.c,j(a,90)?P(a,29):(CP(),J7))),29),_k(n))return i=Mx(n).wi().si(n),P(i,54).ci(e),i;r=l_(n)}return(e.D==null?e.B:e.D)==`java.util.Map$Entry`?new OMe(e):new eMe(e)},Q.ti=function(e,t){return uP(this,e,t)},Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.a}return xb(this,e-bh((CP(),G7)),_x((r=P(NC(this,16),29),r||G7),e),t,n)},Q.Sh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 1:return this.a&&(n=P(this.a,54).Th(this,4,J5,n)),mT(this,P(e,241),n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),G7)),t),69),i.wk().zk(this,WD(this),t-bh((CP(),G7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 1:return mT(this,null,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),G7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),G7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return!!this.a}return Hv(this,e-bh((CP(),G7)),_x((t=P(NC(this,16),29),t||G7),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:r9e(this,P(t,241));return}LE(this,e-bh((CP(),G7)),_x((n=P(NC(this,16),29),n||G7),e),t)},Q.ii=function(){return CP(),G7},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:r9e(this,null);return}PT(this,e-bh((CP(),G7)),_x((t=P(NC(this,16),29),t||G7),e))};var t7,hVt,gVt;L(KH,`EFactoryImpl`,720),q(1037,720,{110:1,2113:1,94:1,93:1,480:1,155:1,58:1,114:1,54:1,99:1,158:1,119:1,120:1},kse),Q.ri=function(e,t){switch(e.hk()){case 12:return P(t,149).Pg();case 13:return PE(t);default:throw E(new Fi(YH+e.xe()+XH))}},Q.si=function(e){var t,n,r,i,a,o,s,c;switch(e.G==-1&&(e.G=(t=Mx(e),t?NO(t.vi(),e):-1)),e.G){case 4:return a=new Ase,a;case 6:return o=new ii,o;case 7:return s=new s_e,s;case 8:return r=new nn,r;case 9:return n=new tn,n;case 10:return i=new rn,i;case 11:return c=new jse,c;default:throw E(new Fi($H+e.zb+XH))}},Q.ti=function(e,t){switch(e.hk()){case 13:case 12:return null;default:throw E(new Fi(YH+e.xe()+XH))}},L(qH,`ElkGraphFactoryImpl`,1037),q(448,158,{110:1,94:1,93:1,155:1,197:1,58:1,114:1,54:1,99:1,158:1,119:1,120:1}),Q.Gh=function(){var e,t=(e=P(NC(this,16),29),MLe(aN(e||this.ii())));return t==null?(Yo(),Yo(),i9):new VEe(this,t)},Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.xe()}return xb(this,e-bh(this.ii()),_x((r=P(NC(this,16),29),r||this.ii()),e),t,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null}return Hv(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:this.ui(kd(t));return}LE(this,e-bh(this.ii()),_x((n=P(NC(this,16),29),n||this.ii()),e),t)},Q.ii=function(){return CP(),JVt},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:this.ui(null);return}PT(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.xe=function(){return this.zb},Q.ui=function(e){GS(this,e)},Q.Ib=function(){return DT(this)},Q.zb=null,L(KH,`ENamedElementImpl`,448),q(184,448,{110:1,94:1,93:1,155:1,197:1,58:1,241:1,114:1,54:1,99:1,158:1,184:1,119:1,120:1,690:1},IIe),Q.Ah=function(e){return w6e(this,e)},Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.yb;case 3:return this.xb;case 4:return this.sb;case 5:return!this.rb&&(this.rb=new Tm(this,E7,this)),this.rb;case 6:return!this.vb&&(this.vb=new nf(J5,this,6,7)),this.vb;case 7:return t?this.Db>>16==7?P(this.Cb,241):null:pRe(this)}return xb(this,e-bh((CP(),X7)),_x((r=P(NC(this,16),29),r||X7),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 4:return this.sb&&(n=P(this.sb,54).Th(this,1,K5,n)),OT(this,P(e,480),n);case 5:return!this.rb&&(this.rb=new Tm(this,E7,this)),vD(this.rb,e,n);case 6:return!this.vb&&(this.vb=new nf(J5,this,6,7)),vD(this.vb,e,n);case 7:return this.Cb&&(n=(i=this.Db>>16,i>=0?w6e(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,7,n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),X7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),X7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 4:return OT(this,null,n);case 5:return!this.rb&&(this.rb=new Tm(this,E7,this)),AO(this.rb,e,n);case 6:return!this.vb&&(this.vb=new nf(J5,this,6,7)),AO(this.vb,e,n);case 7:return qM(this,null,7,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),X7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),X7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.yb!=null;case 3:return this.xb!=null;case 4:return!!this.sb;case 5:return!!this.rb&&this.rb.i!=0;case 6:return!!this.vb&&this.vb.i!=0;case 7:return!!pRe(this)}return Hv(this,e-bh((CP(),X7)),_x((t=P(NC(this,16),29),t||X7),e))},Q.Zh=function(e){return Mot(this,e)||rP(this,e)},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:GS(this,kd(t));return;case 2:qS(this,kd(t));return;case 3:KS(this,kd(t));return;case 4:EA(this,P(t,480));return;case 5:!this.rb&&(this.rb=new Tm(this,E7,this)),RN(this.rb),!this.rb&&(this.rb=new Tm(this,E7,this)),th(this.rb,P(t,16));return;case 6:!this.vb&&(this.vb=new nf(J5,this,6,7)),RN(this.vb),!this.vb&&(this.vb=new nf(J5,this,6,7)),th(this.vb,P(t,16));return}LE(this,e-bh((CP(),X7)),_x((n=P(NC(this,16),29),n||X7),e),t)},Q.ei=function(e){var t,n;if(e&&this.rb)for(n=new Lu(this.rb);n.e!=n.i.gc();)t=gO(n),j(t,364)&&(P(t,364).w=null);GD(this,64,e)},Q.ii=function(){return CP(),X7},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:GS(this,null);return;case 2:qS(this,null);return;case 3:KS(this,null);return;case 4:EA(this,null);return;case 5:!this.rb&&(this.rb=new Tm(this,E7,this)),RN(this.rb);return;case 6:!this.vb&&(this.vb=new nf(J5,this,6,7)),RN(this.vb);return}PT(this,e-bh((CP(),X7)),_x((t=P(NC(this,16),29),t||X7),e))},Q.pi=function(){Ck(this)},Q.vi=function(){return!this.rb&&(this.rb=new Tm(this,E7,this)),this.rb},Q.wi=function(){return this.sb},Q.xi=function(){return this.ub},Q.yi=function(){return this.xb},Q.zi=function(){return this.yb},Q.Ai=function(e){this.ub=e},Q.Ib=function(){var e;return this.Db&64?DT(this):(e=new Wu(DT(this)),e.a+=` (nsURI: `,pl(e,this.yb),e.a+=`, nsPrefix: `,pl(e,this.xb),e.a+=`)`,e.a)},Q.xb=null,Q.yb=null;var _Vt;L(KH,`EPackageImpl`,184),q(569,184,{110:1,2115:1,569:1,94:1,93:1,155:1,197:1,58:1,241:1,114:1,54:1,99:1,158:1,184:1,119:1,120:1,690:1},Urt),Q.q=!1,Q.r=!1;var vVt=!1;L(qH,`ElkGraphPackageImpl`,569),q(366,740,{110:1,342:1,167:1,135:1,422:1,366:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1},Ase),Q.Ah=function(e){return x6e(this,e)},Q.Lh=function(e,t,n){switch(e){case 7:return mRe(this);case 8:return this.a}return FE(this,e,t,n)},Q.Sh=function(e,t,n){var r;return t===7?(this.Cb&&(n=(r=this.Db>>16,r>=0?x6e(this,n):this.Cb.Th(this,-1-r,null,n))),jNe(this,P(e,167),n)):uA(this,e,t,n)},Q.Uh=function(e,t,n){return t==7?jNe(this,null,n):XC(this,e,t,n)},Q.Wh=function(e){switch(e){case 7:return!!mRe(this);case 8:return!ff(``,this.a)}return JE(this,e)},Q.bi=function(e,t){switch(e){case 7:kot(this,P(t,167));return;case 8:jJe(this,kd(t));return}H8e(this,e,t)},Q.ii=function(){return lP(),lVt},Q.ki=function(e){switch(e){case 7:kot(this,null);return;case 8:jJe(this,``);return}dD(this,e)},Q.Ib=function(){return get(this)},Q.a=``,L(qH,`ElkLabelImpl`,366),q(207,741,{110:1,342:1,84:1,167:1,27:1,422:1,207:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1},ii),Q.Ah=function(e){return F6e(this,e)},Q.Lh=function(e,t,n){switch(e){case 9:return!this.c&&(this.c=new F(e7,this,9,9)),this.c;case 10:return!this.a&&(this.a=new F($5,this,10,11)),this.a;case 11:return I_(this);case 12:return!this.b&&(this.b=new F(U5,this,12,3)),this.b;case 13:return rd(),!this.a&&(this.a=new F($5,this,10,11)),this.a.i>0}return tk(this,e,t,n)},Q.Sh=function(e,t,n){var r;switch(t){case 9:return!this.c&&(this.c=new F(e7,this,9,9)),vD(this.c,e,n);case 10:return!this.a&&(this.a=new F($5,this,10,11)),vD(this.a,e,n);case 11:return this.Cb&&(n=(r=this.Db>>16,r>=0?F6e(this,n):this.Cb.Th(this,-1-r,null,n))),tf(this,P(e,27),n);case 12:return!this.b&&(this.b=new F(U5,this,12,3)),vD(this.b,e,n)}return b8e(this,e,t,n)},Q.Uh=function(e,t,n){switch(t){case 9:return!this.c&&(this.c=new F(e7,this,9,9)),AO(this.c,e,n);case 10:return!this.a&&(this.a=new F($5,this,10,11)),AO(this.a,e,n);case 11:return tf(this,null,n);case 12:return!this.b&&(this.b=new F(U5,this,12,3)),AO(this.b,e,n)}return x8e(this,e,t,n)},Q.Wh=function(e){switch(e){case 9:return!!this.c&&this.c.i!=0;case 10:return!!this.a&&this.a.i!=0;case 11:return!!I_(this);case 12:return!!this.b&&this.b.i!=0;case 13:return!this.a&&(this.a=new F($5,this,10,11)),this.a.i>0}return BZe(this,e)},Q.bi=function(e,t){switch(e){case 9:!this.c&&(this.c=new F(e7,this,9,9)),RN(this.c),!this.c&&(this.c=new F(e7,this,9,9)),th(this.c,P(t,16));return;case 10:!this.a&&(this.a=new F($5,this,10,11)),RN(this.a),!this.a&&(this.a=new F($5,this,10,11)),th(this.a,P(t,16));return;case 11:Gj(this,P(t,27));return;case 12:!this.b&&(this.b=new F(U5,this,12,3)),RN(this.b),!this.b&&(this.b=new F(U5,this,12,3)),th(this.b,P(t,16));return}cit(this,e,t)},Q.ii=function(){return lP(),uVt},Q.ki=function(e){switch(e){case 9:!this.c&&(this.c=new F(e7,this,9,9)),RN(this.c);return;case 10:!this.a&&(this.a=new F($5,this,10,11)),RN(this.a);return;case 11:Gj(this,null);return;case 12:!this.b&&(this.b=new F(U5,this,12,3)),RN(this.b);return}DO(this,e)},Q.Ib=function(){return Elt(this)},L(qH,`ElkNodeImpl`,207),q(193,741,{110:1,342:1,84:1,167:1,123:1,422:1,193:1,96:1,94:1,93:1,58:1,114:1,54:1,99:1,119:1,120:1},s_e),Q.Ah=function(e){return S6e(this,e)},Q.Lh=function(e,t,n){return e==9?E_(this):tk(this,e,t,n)},Q.Sh=function(e,t,n){var r;return t===9?(this.Cb&&(n=(r=this.Db>>16,r>=0?S6e(this,n):this.Cb.Th(this,-1-r,null,n))),Vd(this,P(e,27),n)):b8e(this,e,t,n)},Q.Uh=function(e,t,n){return t==9?Vd(this,null,n):x8e(this,e,t,n)},Q.Wh=function(e){return e==9?!!E_(this):BZe(this,e)},Q.bi=function(e,t){if(e===9){Yat(this,P(t,27));return}cit(this,e,t)},Q.ii=function(){return lP(),dVt},Q.ki=function(e){if(e===9){Yat(this,null);return}DO(this,e)},Q.Ib=function(){return Dlt(this)},L(qH,`ElkPortImpl`,193);var yVt=gp(uU,`BasicEMap/Entry`);q(1122,120,{110:1,44:1,94:1,93:1,136:1,58:1,114:1,54:1,99:1,119:1,120:1},jse),Q.Fb=function(e){return this===e},Q.ld=function(){return this.b},Q.Hb=function(){return td(this)},Q.Di=function(e){MJe(this,P(e,149))},Q.Lh=function(e,t,n){switch(e){case 0:return this.b;case 1:return this.c}return jO(this,e,t,n)},Q.Wh=function(e){switch(e){case 0:return!!this.b;case 1:return this.c!=null}return mO(this,e)},Q.bi=function(e,t){switch(e){case 0:MJe(this,P(t,149));return;case 1:AJe(this,t);return}QA(this,e,t)},Q.ii=function(){return lP(),Z5},Q.ki=function(e){switch(e){case 0:MJe(this,null);return;case 1:AJe(this,null);return}BA(this,e)},Q.Bi=function(){var e;return this.a==-1&&(e=this.b,this.a=e?US(e):0),this.a},Q.md=function(){return this.c},Q.Ci=function(e){this.a=e},Q.nd=function(e){var t=this.c;return AJe(this,e),t},Q.Ib=function(){var e;return this.Db&64?Aj(this):(e=new ta,gl(gl(gl(e,this.b?this.b.Pg():IP),kR),Uu(this.c)),e.a)},Q.a=-1,Q.c=null;var n7=L(qH,`ElkPropertyToValueMapEntryImpl`,1122);q(996,1,{},Pse),L(fU,`JsonAdapter`,996),q(216,63,SF,Vi),L(fU,`JsonImportException`,216),q(868,1,{},E6e),L(fU,`JsonImporter`,868),q(903,1,{},TSe),L(fU,`JsonImporter/lambda$0$Type`,903),q(904,1,{},ESe),L(fU,`JsonImporter/lambda$1$Type`,904),q(912,1,{},ohe),L(fU,`JsonImporter/lambda$10$Type`,912),q(914,1,{},DSe),L(fU,`JsonImporter/lambda$11$Type`,914),q(915,1,{},OSe),L(fU,`JsonImporter/lambda$12$Type`,915),q(921,1,{},pIe),L(fU,`JsonImporter/lambda$13$Type`,921),q(920,1,{},mIe),L(fU,`JsonImporter/lambda$14$Type`,920),q(916,1,{},kSe),L(fU,`JsonImporter/lambda$15$Type`,916),q(917,1,{},ASe),L(fU,`JsonImporter/lambda$16$Type`,917),q(918,1,{},jSe),L(fU,`JsonImporter/lambda$17$Type`,918),q(919,1,{},MSe),L(fU,`JsonImporter/lambda$18$Type`,919),q(924,1,{},she),L(fU,`JsonImporter/lambda$19$Type`,924),q(905,1,{},che),L(fU,`JsonImporter/lambda$2$Type`,905),q(922,1,{},lhe),L(fU,`JsonImporter/lambda$20$Type`,922),q(923,1,{},uhe),L(fU,`JsonImporter/lambda$21$Type`,923),q(927,1,{},dhe),L(fU,`JsonImporter/lambda$22$Type`,927),q(925,1,{},fhe),L(fU,`JsonImporter/lambda$23$Type`,925),q(926,1,{},phe),L(fU,`JsonImporter/lambda$24$Type`,926),q(929,1,{},mhe),L(fU,`JsonImporter/lambda$25$Type`,929),q(928,1,{},hhe),L(fU,`JsonImporter/lambda$26$Type`,928),q(930,1,$P,NSe),Q.Cd=function(e){mGe(this.b,this.a,kd(e))},L(fU,`JsonImporter/lambda$27$Type`,930),q(931,1,$P,PSe),Q.Cd=function(e){hGe(this.b,this.a,kd(e))},L(fU,`JsonImporter/lambda$28$Type`,931),q(932,1,{},FSe),L(fU,`JsonImporter/lambda$29$Type`,932),q(908,1,{},ghe),L(fU,`JsonImporter/lambda$3$Type`,908),q(933,1,{},ISe),L(fU,`JsonImporter/lambda$30$Type`,933),q(934,1,{},_he),L(fU,`JsonImporter/lambda$31$Type`,934),q(935,1,{},vhe),L(fU,`JsonImporter/lambda$32$Type`,935),q(936,1,{},yhe),L(fU,`JsonImporter/lambda$33$Type`,936),q(937,1,{},bhe),L(fU,`JsonImporter/lambda$34$Type`,937),q(870,1,{},xhe),L(fU,`JsonImporter/lambda$35$Type`,870),q(941,1,{},uje),L(fU,`JsonImporter/lambda$36$Type`,941),q(938,1,$P,She),Q.Cd=function(e){XHe(this.a,P(e,377))},L(fU,`JsonImporter/lambda$37$Type`,938),q(939,1,$P,LSe),Q.Cd=function(e){WSe(this.a,this.b,P(e,166))},L(fU,`JsonImporter/lambda$38$Type`,939),q(940,1,$P,RSe),Q.Cd=function(e){GSe(this.a,this.b,P(e,166))},L(fU,`JsonImporter/lambda$39$Type`,940),q(906,1,{},Che),L(fU,`JsonImporter/lambda$4$Type`,906),q(942,1,$P,whe),Q.Cd=function(e){ZHe(this.a,P(e,8))},L(fU,`JsonImporter/lambda$40$Type`,942),q(907,1,{},The),L(fU,`JsonImporter/lambda$5$Type`,907),q(911,1,{},Ehe),L(fU,`JsonImporter/lambda$6$Type`,911),q(909,1,{},Dhe),L(fU,`JsonImporter/lambda$7$Type`,909),q(910,1,{},Ohe),L(fU,`JsonImporter/lambda$8$Type`,910),q(913,1,{},khe),L(fU,`JsonImporter/lambda$9$Type`,913),q(961,1,$P,Ahe),Q.Cd=function(e){Dh(this.a,new mh(kd(e)))},L(fU,`JsonMetaDataConverter/lambda$0$Type`,961),q(962,1,$P,jhe),Q.Cd=function(e){VPe(this.a,P(e,245))},L(fU,`JsonMetaDataConverter/lambda$1$Type`,962),q(963,1,$P,Mhe),Q.Cd=function(e){FRe(this.a,P(e,143))},L(fU,`JsonMetaDataConverter/lambda$2$Type`,963),q(964,1,$P,Nhe),Q.Cd=function(e){HPe(this.a,P(e,170))},L(fU,`JsonMetaDataConverter/lambda$3$Type`,964),q(245,22,{3:1,34:1,22:1,245:1},Jc);var r7,i7,a7,o7,s7,c7,l7,u7,d7=aS(EL,`GraphFeature`,245,eG,nqe,Sje),bVt;q(11,1,{34:1,149:1},yr,Wd,Tl,ou),Q.Fd=function(e){return oTe(this,P(e,149))},Q.Fb=function(e){return nLe(this,e)},Q.Sg=function(){return hO(this)},Q.Pg=function(){return this.b},Q.Hb=function(){return jw(this.b)},Q.Ib=function(){return this.b},L(EL,`Property`,11),q(671,1,GI,vr),Q.Ne=function(e,t){return h1e(this,P(e,96),P(t,96))},Q.Fb=function(e){return this===e},Q.Oe=function(){return new Yn(this)},L(EL,`PropertyHolderComparator`,671),q(709,1,VP,Phe),Q.Nb=function(e){Om(this,e)},Q.Pb=function(){return vGe(this)},Q.Qb=function(){uye()},Q.Ob=function(){return!!this.a},L(_U,`ElkGraphUtil/AncestorIterator`,709);var xVt=gp(uU,`EList`);q(70,56,{20:1,31:1,56:1,16:1,15:1,70:1,61:1}),Q.bd=function(e,t){WT(this,e,t)},Q.Fc=function(e){return tb(this,e)},Q.cd=function(e,t){return lZe(this,e,t)},Q.Gc=function(e){return th(this,e)},Q.Ii=function(){return new ld(this)},Q.Ji=function(){return new ud(this)},Q.Ki=function(e){return mS(this,e)},Q.Li=function(){return!0},Q.Mi=function(e,t){},Q.Ni=function(){},Q.Oi=function(e,t){Xy(this,e,t)},Q.Pi=function(e,t,n){},Q.Qi=function(e,t){},Q.Ri=function(e,t,n){},Q.Fb=function(e){return Mct(this,e)},Q.Hb=function(){return qXe(this)},Q.Si=function(){return!1},Q.Kc=function(){return new Lu(this)},Q.ed=function(){return new cd(this)},Q.fd=function(e){var t=this.gc();if(e<0||e>t)throw E(new lf(e,t));return new Hm(this,e)},Q.Ui=function(e,t){this.Ti(e,this.dd(t))},Q.Mc=function(e){return nx(this,e)},Q.Wi=function(e,t){return t},Q.hd=function(e,t){return PO(this,e,t)},Q.Ib=function(){return HE(this)},Q.Yi=function(){return!0},Q.Zi=function(e,t){return Aw(this,t)},L(uU,`AbstractEList`,70),q(66,70,SU,an,kx,hC),Q.Ei=function(e,t){return dA(this,e,t)},Q.Fi=function(e){return X4e(this,e)},Q.Gi=function(e,t){jT(this,e,t)},Q.Hi=function(e){Ty(this,e)},Q.$i=function(e){return SGe(this,e)},Q.$b=function(){Ey(this)},Q.Hc=function(e){return Uk(this,e)},Q.Xb=function(e){return H(this,e)},Q._i=function(e){var t,n,r;++this.j,n=this.g==null?0:this.g.length,e>n&&(r=this.g,t=n+(n/2|0)+4,t=0&&(this.gd(t),!0)},Q.Xi=function(e,t){return this.Dj(e,this.Zi(e,t))},Q.gc=function(){return this.Ej()},Q.Pc=function(){return this.Fj()},Q.Qc=function(e){return this.Gj(e)},Q.Ib=function(){return this.Hj()},L(uU,`DelegatingEList`,2093),q(2094,2093,rwt),Q.Ei=function(e,t){return wdt(this,e,t)},Q.Fi=function(e){return this.Ei(this.Ej(),e)},Q.Gi=function(e,t){Wrt(this,e,t)},Q.Hi=function(e){_rt(this,e)},Q.Li=function(){return!this.Mj()},Q.$b=function(){zN(this)},Q.Ij=function(e,t,n,r,i){return new eLe(this,e,t,n,r,i)},Q.Jj=function(e){AC(this.jj(),e)},Q.Kj=function(){return null},Q.Lj=function(){return-1},Q.jj=function(){return null},Q.Mj=function(){return!1},Q.Nj=function(e,t){return t},Q.Oj=function(e,t){return t},Q.Pj=function(){return!1},Q.Qj=function(){return!this.Aj()},Q.Ti=function(e,t){var n,r;return this.Pj()?(r=this.Qj(),n=e9e(this,e,t),this.Jj(this.Ij(7,G(t),n,e,r)),n):e9e(this,e,t)},Q.gd=function(e){var t,n,r,i;return this.Pj()?(n=null,r=this.Qj(),t=this.Ij(4,i=_p(this,e),null,e,r),this.Mj()&&i&&(n=this.Oj(i,n)),n?(n.nj(t),n.oj()):this.Jj(t),i):(i=_p(this,e),this.Mj()&&i&&(n=this.Oj(i,null),n&&n.oj()),i)},Q.Xi=function(e,t){return Tdt(this,e,t)},L(VH,`DelegatingNotifyingListImpl`,2094),q(152,1,NU),Q.nj=function(e){return T5e(this,e)},Q.oj=function(){Pb(this)},Q.gj=function(){return this.d},Q.Kj=function(){return null},Q.Rj=function(){return null},Q.hj=function(e){return-1},Q.ij=function(){return Ast(this)},Q.jj=function(){return null},Q.kj=function(){return jst(this)},Q.lj=function(){return this.o<0?this.o<-2?-2-this.o-1:-1:this.o},Q.Sj=function(){return!1},Q.mj=function(e){var t,n,r,i,a,o,s,c,l,u,d;switch(this.d){case 1:case 2:switch(i=e.gj(),i){case 1:case 2:if(a=e.jj(),A(a)===A(this.jj())&&this.hj(null)==e.hj(null))return this.g=e.ij(),e.gj()==1&&(this.d=1),!0}case 4:if(i=e.gj(),i===4&&(a=e.jj(),A(a)===A(this.jj())&&this.hj(null)==e.hj(null)))return l=Fmt(this),c=this.o<0?this.o<-2?-2-this.o-1:-1:this.o,o=e.lj(),this.d=6,d=new kx(2),c<=o?(tb(d,this.n),tb(d,e.kj()),this.g=U(O(q9,1),HF,28,15,[this.o=c,o+1])):(tb(d,e.kj()),tb(d,this.n),this.g=U(O(q9,1),HF,28,15,[this.o=o,c])),this.n=d,l||(this.o=-2-this.o-1),!0;break;case 6:if(i=e.gj(),i===4&&(a=e.jj(),A(a)===A(this.jj())&&this.hj(null)==e.hj(null))){for(l=Fmt(this),o=e.lj(),u=P(this.g,53),r=V(q9,HF,28,u.length+1,15,1),t=0;t>>0,t.toString(16)));switch(r.a+=` (eventType: `,this.d){case 1:r.a+=`SET`;break;case 2:r.a+=`UNSET`;break;case 3:r.a+=`ADD`;break;case 5:r.a+=`ADD_MANY`;break;case 4:r.a+=`REMOVE`;break;case 6:r.a+=`REMOVE_MANY`;break;case 7:r.a+=`MOVE`;break;case 8:r.a+=`REMOVING_ADAPTER`;break;case 9:r.a+=`RESOLVE`;break;default:Wa(r,this.d)}if(Ult(this)&&(r.a+=`, touch: true`),r.a+=`, position: `,Wa(r,this.o<0?this.o<-2?-2-this.o-1:-1:this.o),r.a+=`, notifier: `,fl(r,this.jj()),r.a+=`, feature: `,fl(r,this.Kj()),r.a+=`, oldValue: `,fl(r,jst(this)),r.a+=`, newValue: `,this.d==6&&j(this.g,53)){for(n=P(this.g,53),r.a+=`[`,e=0;e10?((!this.b||this.c.j!=this.a)&&(this.b=new jp(this),this.a=this.j),mo(this.b,e)):Uk(this,e)},Q.Yi=function(){return!0},Q.a=0,L(uU,`AbstractEList/1`,966),q(302,77,oI,lf),L(uU,`AbstractEList/BasicIndexOutOfBoundsException`,302),q(37,1,VP,Lu),Q.Nb=function(e){Om(this,e)},Q.Xj=function(){if(this.i.j!=this.f)throw E(new Vr)},Q.Yj=function(){return gO(this)},Q.Ob=function(){return this.e!=this.i.gc()},Q.Pb=function(){return this.Yj()},Q.Qb=function(){Yk(this)},Q.e=0,Q.f=0,Q.g=-1,L(uU,`AbstractEList/EIterator`,37),q(286,37,YP,cd,Hm),Q.Qb=function(){Yk(this)},Q.Rb=function(e){y0e(this,e)},Q.Zj=function(){var e;try{return e=this.d.Xb(--this.e),this.Xj(),this.g=this.e,e}catch(e){throw e=ew(e),j(e,77)?(this.Xj(),E(new Hr)):E(e)}},Q.$j=function(e){i3e(this,e)},Q.Sb=function(){return this.e!=0},Q.Tb=function(){return this.e},Q.Ub=function(){return this.Zj()},Q.Vb=function(){return this.e-1},Q.Wb=function(e){this.$j(e)},L(uU,`AbstractEList/EListIterator`,286),q(355,37,VP,ld),Q.Yj=function(){return _O(this)},Q.Qb=function(){throw E(new Br)},L(uU,`AbstractEList/NonResolvingEIterator`,355),q(398,286,YP,ud,LOe),Q.Rb=function(e){throw E(new Br)},Q.Yj=function(){var e;try{return e=this.c.Vi(this.e),this.Xj(),this.g=this.e++,e}catch(e){throw e=ew(e),j(e,77)?(this.Xj(),E(new Hr)):E(e)}},Q.Zj=function(){var e;try{return e=this.c.Vi(--this.e),this.Xj(),this.g=this.e,e}catch(e){throw e=ew(e),j(e,77)?(this.Xj(),E(new Hr)):E(e)}},Q.Qb=function(){throw E(new Br)},Q.Wb=function(e){throw E(new Br)},L(uU,`AbstractEList/NonResolvingEListIterator`,398),q(2080,70,iwt),Q.Ei=function(e,t){var n,r,i=t.gc(),a,o,s,c,l,u,d,f;if(i!=0){for(l=P(NC(this.a,4),129),u=l==null?0:l.length,f=u+i,r=Hw(this,f),d=u-e,d>0&&tN(l,e,r,e+i,d),c=t.Kc(),o=0;on)throw E(new lf(e,n));return new JFe(this,e)},Q.$b=function(){var e,t;++this.j,e=P(NC(this.a,4),129),t=e==null?0:e.length,iO(this,null),Xy(this,t,e)},Q.Hc=function(e){var t=P(NC(this.a,4),129),n,r,i,a;if(t!=null){if(e!=null){for(r=t,i=0,a=r.length;i=n)throw E(new lf(e,n));return t[e]},Q.dd=function(e){var t=P(NC(this.a,4),129),n,r;if(t!=null){if(e!=null){for(n=0,r=t.length;nn)throw E(new lf(e,n));return new qFe(this,e)},Q.Ti=function(e,t){var n=B0e(this),r,i=n==null?0:n.length;if(e>=i)throw E(new Mi(yU+e+bU+i));if(t>=i)throw E(new Mi(xU+t+bU+i));return r=n[t],e!=t&&(e0&&tN(e,0,t,0,n),t},Q.Qc=function(e){var t=P(NC(this.a,4),129),n,r=t==null?0:t.length;return r>0&&(e.lengthr&&Sh(e,r,null),e};var TVt;L(uU,`ArrayDelegatingEList`,2080),q(1051,37,VP,gUe),Q.Xj=function(){if(this.b.j!=this.f||A(P(NC(this.b.a,4),129))!==A(this.a))throw E(new Vr)},Q.Qb=function(){Yk(this),this.a=P(NC(this.b.a,4),129)},L(uU,`ArrayDelegatingEList/EIterator`,1051),q(722,286,YP,lPe,qFe),Q.Xj=function(){if(this.b.j!=this.f||A(P(NC(this.b.a,4),129))!==A(this.a))throw E(new Vr)},Q.$j=function(e){i3e(this,e),this.a=P(NC(this.b.a,4),129)},Q.Qb=function(){Yk(this),this.a=P(NC(this.b.a,4),129)},L(uU,`ArrayDelegatingEList/EListIterator`,722),q(1052,355,VP,_Ue),Q.Xj=function(){if(this.b.j!=this.f||A(P(NC(this.b.a,4),129))!==A(this.a))throw E(new Vr)},L(uU,`ArrayDelegatingEList/NonResolvingEIterator`,1052),q(723,398,YP,uPe,JFe),Q.Xj=function(){if(this.b.j!=this.f||A(P(NC(this.b.a,4),129))!==A(this.a))throw E(new Vr)},L(uU,`ArrayDelegatingEList/NonResolvingEListIterator`,723),q(615,302,oI,wl),L(uU,`BasicEList/BasicIndexOutOfBoundsException`,615),q(710,66,SU,$c),Q.bd=function(e,t){throw E(new Br)},Q.Fc=function(e){throw E(new Br)},Q.cd=function(e,t){throw E(new Br)},Q.Gc=function(e){throw E(new Br)},Q.$b=function(){throw E(new Br)},Q._i=function(e){throw E(new Br)},Q.Kc=function(){return this.Ii()},Q.ed=function(){return this.Ji()},Q.fd=function(e){return this.Ki(e)},Q.Ti=function(e,t){throw E(new Br)},Q.Ui=function(e,t){throw E(new Br)},Q.gd=function(e){throw E(new Br)},Q.Mc=function(e){throw E(new Br)},Q.hd=function(e,t){throw E(new Br)},L(uU,`BasicEList/UnmodifiableEList`,710),q(721,1,{3:1,20:1,16:1,15:1,61:1,597:1}),Q.bd=function(e,t){qwe(this,e,P(t,44))},Q.Fc=function(e){return GEe(this,P(e,44))},Q.Jc=function(e){ly(this,e)},Q.Xb=function(e){return P(H(this.c,e),136)},Q.Ti=function(e,t){return P(this.c.Ti(e,t),44)},Q.Ui=function(e,t){Jwe(this,e,P(t,44))},Q.Lc=function(){return new Mp(null,new cv(this,16))},Q.gd=function(e){return P(this.c.gd(e),44)},Q.hd=function(e,t){return BPe(this,e,P(t,44))},Q.jd=function(e){zS(this,e)},Q.Nc=function(){return new cv(this,16)},Q.Oc=function(){return new Mp(null,new cv(this,16))},Q.cd=function(e,t){return this.c.cd(e,t)},Q.Gc=function(e){return this.c.Gc(e)},Q.$b=function(){this.c.$b()},Q.Hc=function(e){return this.c.Hc(e)},Q.Ic=function(e){return $C(this.c,e)},Q._j=function(){var e,t,n;if(this.d==null){for(this.d=V(SVt,awt,66,2*this.f+1,0,1),n=this.e,this.f=0,t=this.c.Kc();t.e!=t.i.gc();)e=P(t.Yj(),136),JO(this,e);this.e=n}},Q.Fb=function(e){return GOe(this,e)},Q.Hb=function(){return qXe(this.c)},Q.dd=function(e){return this.c.dd(e)},Q.ak=function(){this.c=new Fhe(this)},Q.dc=function(){return this.f==0},Q.Kc=function(){return this.c.Kc()},Q.ed=function(){return this.c.ed()},Q.fd=function(e){return this.c.fd(e)},Q.bk=function(){return Jy(this)},Q.ck=function(e,t,n){return new dje(e,t,n)},Q.dk=function(){return new Rse},Q.Mc=function(e){return aJe(this,e)},Q.gc=function(){return this.f},Q.kd=function(e,t){return new $_(this.c,e,t)},Q.Pc=function(){return this.c.Pc()},Q.Qc=function(e){return this.c.Qc(e)},Q.Ib=function(){return HE(this.c)},Q.e=0,Q.f=0,L(uU,`BasicEMap`,721),q(1046,66,SU,Fhe),Q.Mi=function(e,t){Oge(this,P(t,136))},Q.Pi=function(e,t,n){var r;++(r=this,P(t,136),r).a.e},Q.Qi=function(e,t){kge(this,P(t,136))},Q.Ri=function(e,t,n){hEe(this,P(t,136),P(n,136))},Q.Oi=function(e,t){sXe(this.a)},L(uU,`BasicEMap/1`,1046),q(1047,66,SU,Rse),Q.aj=function(e){return V(EVt,owt,621,e,0,1)},L(uU,`BasicEMap/2`,1047),q(1048,GP,KP,Ihe),Q.$b=function(){this.a.c.$b()},Q.Hc=function(e){return uD(this.a,e)},Q.Kc=function(){return this.a.f==0?(Nd(),_7.a):new qve(this.a)},Q.Mc=function(e){var t=this.a.f;return BD(this.a,e),this.a.f!=t},Q.gc=function(){return this.a.f},L(uU,`BasicEMap/3`,1048),q(1049,31,WP,Lhe),Q.$b=function(){this.a.c.$b()},Q.Hc=function(e){return Nct(this.a,e)},Q.Kc=function(){return this.a.f==0?(Nd(),_7.a):new Jve(this.a)},Q.gc=function(){return this.a.f},L(uU,`BasicEMap/4`,1049),q(1050,GP,KP,Rhe),Q.$b=function(){this.a.c.$b()},Q.Hc=function(e){var t,n,r,i,a,o,s,c,l;if(this.a.f>0&&j(e,44)&&(this.a._j(),c=P(e,44),s=c.ld(),i=s==null?0:US(s),a=MDe(this.a,i),t=this.a.d[a],t)){for(n=P(t.g,379),l=t.i,o=0;o`+this.c},Q.a=0;var EVt=L(uU,`BasicEMap/EntryImpl`,621);q(546,1,{},on),L(uU,`BasicEMap/View`,546);var _7;q(783,1,{}),Q.Fb=function(e){return lit((Vg(),QG),e)},Q.Hb=function(){return IZe((Vg(),QG))},Q.Ib=function(){return CA((Vg(),QG))},L(uU,`ECollections/BasicEmptyUnmodifiableEList`,783),q(1348,1,YP,zse),Q.Nb=function(e){Om(this,e)},Q.Rb=function(e){throw E(new Br)},Q.Ob=function(){return!1},Q.Sb=function(){return!1},Q.Pb=function(){throw E(new Hr)},Q.Tb=function(){return 0},Q.Ub=function(){throw E(new Hr)},Q.Vb=function(){return-1},Q.Qb=function(){throw E(new Br)},Q.Wb=function(e){throw E(new Br)},L(uU,`ECollections/BasicEmptyUnmodifiableEList/1`,1348),q(1346,783,{20:1,16:1,15:1,61:1},c_e),Q.bd=function(e,t){Eye()},Q.Fc=function(e){return Dye()},Q.cd=function(e,t){return Oye()},Q.Gc=function(e){return kye()},Q.$b=function(){Aye()},Q.Hc=function(e){return!1},Q.Ic=function(e){return!1},Q.Jc=function(e){ly(this,e)},Q.Xb=function(e){return xl((Vg(),e)),null},Q.dd=function(e){return-1},Q.dc=function(){return!0},Q.Kc=function(){return this.a},Q.ed=function(){return this.a},Q.fd=function(e){return this.a},Q.Ti=function(e,t){return jye()},Q.Ui=function(e,t){Mye()},Q.Lc=function(){return new Mp(null,new cv(this,16))},Q.gd=function(e){return Nye()},Q.Mc=function(e){return Pye()},Q.hd=function(e,t){return Fye()},Q.gc=function(){return 0},Q.jd=function(e){zS(this,e)},Q.Nc=function(){return new cv(this,16)},Q.Oc=function(){return new Mp(null,new cv(this,16))},Q.kd=function(e,t){return Vg(),new $_(QG,e,t)},Q.Pc=function(){return INe((Vg(),QG))},Q.Qc=function(e){return Vg(),ck(QG,e)},L(uU,`ECollections/EmptyUnmodifiableEList`,1346),q(1347,783,{20:1,16:1,15:1,61:1,597:1},l_e),Q.bd=function(e,t){Eye()},Q.Fc=function(e){return Dye()},Q.cd=function(e,t){return Oye()},Q.Gc=function(e){return kye()},Q.$b=function(){Aye()},Q.Hc=function(e){return!1},Q.Ic=function(e){return!1},Q.Jc=function(e){ly(this,e)},Q.Xb=function(e){return xl((Vg(),e)),null},Q.dd=function(e){return-1},Q.dc=function(){return!0},Q.Kc=function(){return this.a},Q.ed=function(){return this.a},Q.fd=function(e){return this.a},Q.Ti=function(e,t){return jye()},Q.Ui=function(e,t){Mye()},Q.Lc=function(){return new Mp(null,new cv(this,16))},Q.gd=function(e){return Nye()},Q.Mc=function(e){return Pye()},Q.hd=function(e,t){return Fye()},Q.gc=function(){return 0},Q.jd=function(e){zS(this,e)},Q.Nc=function(){return new cv(this,16)},Q.Oc=function(){return new Mp(null,new cv(this,16))},Q.kd=function(e,t){return Vg(),new $_(QG,e,t)},Q.Pc=function(){return INe((Vg(),QG))},Q.Qc=function(e){return Vg(),ck(QG,e)},Q.bk=function(){return Vg(),Vg(),$G},L(uU,`ECollections/EmptyUnmodifiableEMap`,1347);var DVt=gp(uU,`Enumerator`),v7;q(288,1,{288:1},yM),Q.Fb=function(e){var t;return this===e?!0:j(e,288)?(t=P(e,288),this.f==t.f&&rNe(this.i,t.i)&&Fp(this.a,this.f&256?t.f&256?t.a:null:t.f&256?null:t.a)&&Fp(this.d,t.d)&&Fp(this.g,t.g)&&Fp(this.e,t.e)&&U2e(this,t)):!1},Q.Hb=function(){return this.f},Q.Ib=function(){return qut(this)},Q.f=0;var OVt=0,kVt=0,AVt=0,jVt=0,MVt=0,NVt=0,PVt=0,FVt=0,IVt=0,LVt,y7=0,b7=0,RVt=0,zVt=0,x7,BVt;L(uU,`URI`,288),q(1121,45,CI,u_e),Q.zc=function(e,t){return P(H_(this,kd(e),P(t,288)),288)},L(uU,`URI/URICache`,1121),q(506,66,SU,Nse,Hp),Q.Si=function(){return!0},L(uU,`UniqueEList`,506),q(590,63,SF,Nb),L(uU,`WrappedException`,590);var S7=gp(zH,lwt),C7=gp(zH,uwt),w7=gp(zH,dwt),T7=gp(zH,fwt),E7=gp(zH,pwt),D7=gp(zH,`EClass`),O7=gp(zH,`EDataType`),VVt;q(1233,45,CI,d_e),Q.xc=function(e){return rl(e)?v_(this,e):nl(Kp(this.f,e))},L(zH,`EDataType/Internal/ConversionDelegate/Factory/Registry/Impl`,1233);var k7=gp(zH,`EEnum`),A7=gp(zH,mwt),j7=gp(zH,hwt),M7=gp(zH,gwt),N7,P7=gp(zH,_wt),F7=gp(zH,vwt);q(1042,1,{},Mse),Q.Ib=function(){return`NIL`},L(zH,`EStructuralFeature/Internal/DynamicValueHolder/1`,1042);var HVt;q(1041,45,CI,f_e),Q.xc=function(e){return rl(e)?v_(this,e):nl(Kp(this.f,e))},L(zH,`EStructuralFeature/Internal/SettingDelegate/Factory/Registry/Impl`,1041);var I7=gp(zH,ywt),L7=gp(zH,`EValidator/PatternMatcher`),UVt,R7,z7,B7,V7,H7,WVt,GVt,KVt,U7,W7,G7,K7,q7,qVt,JVt,J7,Y7,YVt,X7,Z7,Q7,$7,XVt,ZVt,e9,t9=gp(IU,`FeatureMap/Entry`);q(545,1,{76:1},Zc),Q.Lk=function(){return this.a},Q.md=function(){return this.b},L(KH,`BasicEObjectImpl/1`,545),q(1040,1,LU,JSe),Q.Fk=function(e){return wy(this.a,this.b,e)},Q.Qj=function(){return iRe(this.a,this.b)},Q.Wb=function(e){rRe(this.a,this.b,e)},Q.Gk=function(){yFe(this.a,this.b)},L(KH,`BasicEObjectImpl/4`,1040),q(2081,1,{114:1}),Q.Mk=function(e){this.e=e==0?QVt:V(WW,FP,1,e,5,1)},Q.li=function(e){return this.e[e]},Q.mi=function(e,t){this.e[e]=t},Q.ni=function(e){this.e[e]=null},Q.Nk=function(){return this.c},Q.Ok=function(){throw E(new Br)},Q.Pk=function(){throw E(new Br)},Q.Qk=function(){return this.d},Q.Rk=function(){return this.e!=null},Q.Sk=function(e){this.c=e},Q.Tk=function(e){throw E(new Br)},Q.Uk=function(e){throw E(new Br)},Q.Vk=function(e){this.d=e};var QVt;L(KH,`BasicEObjectImpl/EPropertiesHolderBaseImpl`,2081),q(192,2081,{114:1},fn),Q.Ok=function(){return this.a},Q.Pk=function(){return this.b},Q.Tk=function(e){this.a=e},Q.Uk=function(e){this.b=e},L(KH,`BasicEObjectImpl/EPropertiesHolderImpl`,192),q(516,99,nCt,sn),Q.uh=function(){return this.f},Q.zh=function(){return this.k},Q.Bh=function(e,t){this.g=e,this.i=t},Q.Dh=function(){return this.j&2?this.$h().Nk():this.ii()},Q.Fh=function(){return this.i},Q.wh=function(){return!!(this.j&1)},Q.Ph=function(){return this.g},Q.Vh=function(){return!!(this.j&4)},Q.$h=function(){return!this.k&&(this.k=new fn),this.k},Q.ci=function(e){this.$h().Sk(e),e?this.j|=2:this.j&=-3},Q.ei=function(e){this.$h().Uk(e),e?this.j|=4:this.j&=-5},Q.ii=function(){return(vh(),z7).S},Q.i=0,Q.j=1,L(KH,`EObjectImpl`,516),q(798,516,{110:1,94:1,93:1,58:1,114:1,54:1,99:1},eMe),Q.li=function(e){return this.e[e]},Q.mi=function(e,t){this.e[e]=t},Q.ni=function(e){this.e[e]=null},Q.Dh=function(){return this.d},Q.Ih=function(e){return eD(this.d,e)},Q.Kh=function(){return this.d},Q.Oh=function(){return this.e!=null},Q.$h=function(){return!this.k&&(this.k=new Bse),this.k},Q.ci=function(e){this.d=e},Q.hi=function(){var e;return this.e??=(e=bh(this.d),e==0?$Vt:V(WW,FP,1,e,5,1)),this},Q.ji=function(){return 0};var $Vt;L(KH,`DynamicEObjectImpl`,798),q(1522,798,{110:1,44:1,94:1,93:1,136:1,58:1,114:1,54:1,99:1},OMe),Q.Fb=function(e){return this===e},Q.Hb=function(){return td(this)},Q.ci=function(e){this.d=e,this.b=Qj(e,`key`),this.c=Qj(e,tU)},Q.Bi=function(){var e;return this.a==-1&&(e=Kb(this,this.b),this.a=e==null?0:US(e)),this.a},Q.ld=function(){return Kb(this,this.b)},Q.md=function(){return Kb(this,this.c)},Q.Ci=function(e){this.a=e},Q.Di=function(e){rRe(this,this.b,e)},Q.nd=function(e){var t=Kb(this,this.c);return rRe(this,this.c,e),t},Q.a=0,L(KH,`DynamicEObjectImpl/BasicEMapEntry`,1522),q(1523,1,{114:1},Bse),Q.Mk=function(e){throw E(new Br)},Q.li=function(e){throw E(new Br)},Q.mi=function(e,t){throw E(new Br)},Q.ni=function(e){throw E(new Br)},Q.Nk=function(){throw E(new Br)},Q.Ok=function(){return this.a},Q.Pk=function(){return this.b},Q.Qk=function(){return this.c},Q.Rk=function(){throw E(new Br)},Q.Sk=function(e){throw E(new Br)},Q.Tk=function(e){this.a=e},Q.Uk=function(e){this.b=e},Q.Vk=function(e){this.c=e},L(KH,`DynamicEObjectImpl/DynamicEPropertiesHolderImpl`,1523),q(519,158,{110:1,94:1,93:1,598:1,155:1,58:1,114:1,54:1,99:1,519:1,158:1,119:1,120:1},Vse),Q.Ah=function(e){return T6e(this,e)},Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.d;case 2:return n?(!this.b&&(this.b=new Td((CP(),$7),o9,this)),this.b):(!this.b&&(this.b=new Td((CP(),$7),o9,this)),Jy(this.b));case 3:return hRe(this);case 4:return!this.a&&(this.a=new ju(L5,this,4)),this.a;case 5:return!this.c&&(this.c=new Pu(L5,this,5)),this.c}return xb(this,e-bh((CP(),B7)),_x((r=P(NC(this,16),29),r||B7),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 3:return this.Cb&&(n=(i=this.Db>>16,i>=0?T6e(this,n):this.Cb.Th(this,-1-i,null,n))),MNe(this,P(e,155),n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),B7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),B7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 2:return!this.b&&(this.b=new Td((CP(),$7),o9,this)),gf(this.b,e,n);case 3:return MNe(this,null,n);case 4:return!this.a&&(this.a=new ju(L5,this,4)),AO(this.a,e,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),B7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),B7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.d!=null;case 2:return!!this.b&&this.b.f!=0;case 3:return!!hRe(this);case 4:return!!this.a&&this.a.i!=0;case 5:return!!this.c&&this.c.i!=0}return Hv(this,e-bh((CP(),B7)),_x((t=P(NC(this,16),29),t||B7),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:PMe(this,kd(t));return;case 2:!this.b&&(this.b=new Td((CP(),$7),o9,this)),bC(this.b,t);return;case 3:Aot(this,P(t,155));return;case 4:!this.a&&(this.a=new ju(L5,this,4)),RN(this.a),!this.a&&(this.a=new ju(L5,this,4)),th(this.a,P(t,16));return;case 5:!this.c&&(this.c=new Pu(L5,this,5)),RN(this.c),!this.c&&(this.c=new Pu(L5,this,5)),th(this.c,P(t,16));return}LE(this,e-bh((CP(),B7)),_x((n=P(NC(this,16),29),n||B7),e),t)},Q.ii=function(){return CP(),B7},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:FJe(this,null);return;case 2:!this.b&&(this.b=new Td((CP(),$7),o9,this)),this.b.c.$b();return;case 3:Aot(this,null);return;case 4:!this.a&&(this.a=new ju(L5,this,4)),RN(this.a);return;case 5:!this.c&&(this.c=new Pu(L5,this,5)),RN(this.c);return}PT(this,e-bh((CP(),B7)),_x((t=P(NC(this,16),29),t||B7),e))},Q.Ib=function(){return L$e(this)},Q.d=null,L(KH,`EAnnotationImpl`,519),q(141,721,bwt,lb),Q.Gi=function(e,t){awe(this,e,P(t,44))},Q.Wk=function(e,t){return KOe(this,P(e,44),t)},Q.$i=function(e){return P(P(this.c,71).$i(e),136)},Q.Ii=function(){return P(this.c,71).Ii()},Q.Ji=function(){return P(this.c,71).Ji()},Q.Ki=function(e){return P(this.c,71).Ki(e)},Q.Xk=function(e,t){return gf(this,e,t)},Q.Fk=function(e){return P(this.c,79).Fk(e)},Q.ak=function(){},Q.Qj=function(){return P(this.c,79).Qj()},Q.ck=function(e,t,n){var r=P(Mx(this.b).wi().si(this.b),136);return r.Ci(e),r.Di(t),r.nd(n),r},Q.dk=function(){return new Yhe(this)},Q.Wb=function(e){bC(this,e)},Q.Gk=function(){P(this.c,79).Gk()},L(IU,`EcoreEMap`,141),q(165,141,bwt,Td),Q._j=function(){var e,t,n,r,i,a;if(this.d==null){for(a=V(SVt,awt,66,2*this.f+1,0,1),n=this.c.Kc();n.e!=n.i.gc();)t=P(n.Yj(),136),r=t.Bi(),i=(r&AP)%a.length,e=a[i],!e&&(e=a[i]=new Yhe(this)),e.Fc(t);this.d=a}},L(KH,`EAnnotationImpl/1`,165),q(292,448,{110:1,94:1,93:1,155:1,197:1,58:1,114:1,481:1,54:1,99:1,158:1,292:1,119:1,120:1}),Q.Lh=function(e,t,n){var r,i;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return rd(),!!(this.Bb&256);case 3:return rd(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return rd(),!!this.Jk();case 7:return rd(),i=this.s,i>=1;case 8:return t?Ik(this):this.r;case 9:return this.q}return xb(this,e-bh(this.ii()),_x((r=P(NC(this,16),29),r||this.ii()),e),t,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 9:return nh(this,n)}return i=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),i.wk().Ak(this,WD(this),t-bh(this.ii()),e,n)},Q.Wh=function(e){var t,n;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return this.Jk();case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&kh(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&kh(this.q).i==0)}return Hv(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.bi=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:this.ui(kd(t));return;case 2:FT(this,ki(Od(t)));return;case 3:RT(this,ki(Od(t)));return;case 4:Zx(this,P(t,17).a);return;case 5:this.Zk(P(t,17).a);return;case 8:aT(this,P(t,142));return;case 9:r=fA(this,P(t,89),null),r&&r.oj();return}LE(this,e-bh(this.ii()),_x((n=P(NC(this,16),29),n||this.ii()),e),t)},Q.ii=function(){return CP(),ZVt},Q.ki=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:this.ui(null);return;case 2:FT(this,!0);return;case 3:RT(this,!0);return;case 4:Zx(this,0);return;case 5:this.Zk(1);return;case 8:aT(this,null);return;case 9:n=fA(this,null,null),n&&n.oj();return}PT(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.pi=function(){Ik(this),this.Bb|=1},Q.Hk=function(){return Ik(this)},Q.Ik=function(){return this.t},Q.Jk=function(){var e;return e=this.t,e>1||e==-1},Q.Si=function(){return!!(this.Bb&512)},Q.Yk=function(e,t){return kT(this,e,t)},Q.Zk=function(e){Qx(this,e)},Q.Ib=function(){return Srt(this)},Q.s=0,Q.t=1,L(KH,`ETypedElementImpl`,292),q(462,292,{110:1,94:1,93:1,155:1,197:1,58:1,179:1,69:1,114:1,481:1,54:1,99:1,158:1,462:1,292:1,119:1,120:1,692:1}),Q.Ah=function(e){return X3e(this,e)},Q.Lh=function(e,t,n){var r,i;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return rd(),!!(this.Bb&256);case 3:return rd(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return rd(),!!this.Jk();case 7:return rd(),i=this.s,i>=1;case 8:return t?Ik(this):this.r;case 9:return this.q;case 10:return rd(),(this.Bb&pF)!=0;case 11:return rd(),(this.Bb&zU)!=0;case 12:return rd(),(this.Bb&uI)!=0;case 13:return this.j;case 14:return Uj(this);case 15:return rd(),(this.Bb&RU)!=0;case 16:return rd(),(this.Bb&ZP)!=0;case 17:return L_(this)}return xb(this,e-bh(this.ii()),_x((r=P(NC(this,16),29),r||this.ii()),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 17:return this.Cb&&(n=(i=this.Db>>16,i>=0?X3e(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,17,n)}return a=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),a.wk().zk(this,WD(this),t-bh(this.ii()),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 9:return nh(this,n);case 17:return qM(this,null,17,n)}return i=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),i.wk().Ak(this,WD(this),t-bh(this.ii()),e,n)},Q.Wh=function(e){var t,n;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return this.Jk();case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&kh(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&kh(this.q).i==0);case 10:return(this.Bb&pF)==0;case 11:return(this.Bb&zU)!=0;case 12:return(this.Bb&uI)!=0;case 13:return this.j!=null;case 14:return Uj(this)!=null;case 15:return(this.Bb&RU)!=0;case 16:return(this.Bb&ZP)!=0;case 17:return!!L_(this)}return Hv(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.bi=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:X_(this,kd(t));return;case 2:FT(this,ki(Od(t)));return;case 3:RT(this,ki(Od(t)));return;case 4:Zx(this,P(t,17).a);return;case 5:this.Zk(P(t,17).a);return;case 8:aT(this,P(t,142));return;case 9:r=fA(this,P(t,89),null),r&&r.oj();return;case 10:eE(this,ki(Od(t)));return;case 11:rE(this,ki(Od(t)));return;case 12:tE(this,ki(Od(t)));return;case 13:Xc(this,kd(t));return;case 15:nE(this,ki(Od(t)));return;case 16:gE(this,ki(Od(t)));return}LE(this,e-bh(this.ii()),_x((n=P(NC(this,16),29),n||this.ii()),e),t)},Q.ii=function(){return CP(),XVt},Q.ki=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:j(this.Cb,90)&&$A(_y(P(this.Cb,90)),4),GS(this,null);return;case 2:FT(this,!0);return;case 3:RT(this,!0);return;case 4:Zx(this,0);return;case 5:this.Zk(1);return;case 8:aT(this,null);return;case 9:n=fA(this,null,null),n&&n.oj();return;case 10:eE(this,!0);return;case 11:rE(this,!1);return;case 12:tE(this,!1);return;case 13:this.i=null,OS(this,null);return;case 15:nE(this,!1);return;case 16:gE(this,!1);return}PT(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.pi=function(){lg(Rb((UA(),l9),this)),Ik(this),this.Bb|=1},Q.pk=function(){return this.f},Q.ik=function(){return Uj(this)},Q.qk=function(){return L_(this)},Q.uk=function(){return null},Q.$k=function(){return this.k},Q.Lj=function(){return this.n},Q.vk=function(){return $k(this)},Q.wk=function(){var e,t,n,r,i,a,o,s,c;return this.p||(n=L_(this),(n.i??aN(n),n.i).length,r=this.uk(),r&&bh(L_(r)),i=Ik(this),o=i.kk(),e=o?o.i&1?o==J9?bG:o==q9?DG:o==Q9?EG:o==Z9?TG:o==Y9?kG:o==$9?PG:o==X9?xG:CG:o:null,t=Uj(this),s=i.ik(),E1e(this),(this.Bb&ZP)!=0&&((a=C8e((UA(),l9),n))&&a!=this||(a=mv(Rb(l9,this))))?this.p=new XSe(this,a):this.Jk()?this.al()?this.p=r?(this.Bb&RU)==0?e?this.bl()?new Og(49,e,this,r):new Og(7,e,this,r):this.bl()?new ty(48,this,r):new ty(6,this,r):e?this.bl()?new Og(47,e,this,r):new Og(5,e,this,r):this.bl()?new ty(46,this,r):new ty(4,this,r):(this.Bb&RU)==0?e?e==YW?new Wf(41,yVt,this):this.bl()?new Wf(45,e,this):new Wf(3,e,this):this.bl()?new a_(44,this):new a_(2,this):e?e==YW?new Wf(50,yVt,this):this.bl()?new Wf(43,e,this):new Wf(1,e,this):this.bl()?new a_(42,this):new a_(0,this):j(i,156)?this.p=e==t9?new a_(40,this):this.Bb&512?(this.Bb&RU)==0?e?new Wf(11,e,this):new a_(10,this):e?new Wf(9,e,this):new a_(8,this):(this.Bb&RU)==0?e?new Wf(15,e,this):new a_(14,this):e?new Wf(13,e,this):new a_(12,this):r?(c=r.t,this.p=c>1||c==-1?this.bl()?(this.Bb&RU)==0?e?new Og(27,e,this,r):new ty(26,this,r):e?new Og(25,e,this,r):new ty(24,this,r):(this.Bb&RU)==0?e?new Og(31,e,this,r):new ty(30,this,r):e?new Og(29,e,this,r):new ty(28,this,r):this.bl()?(this.Bb&RU)==0?e?new Og(35,e,this,r):new ty(34,this,r):e?new Og(33,e,this,r):new ty(32,this,r):(this.Bb&RU)==0?e?new Og(39,e,this,r):new ty(38,this,r):e?new Og(37,e,this,r):new ty(36,this,r)):this.p=this.bl()?(this.Bb&RU)==0?e?new Wf(19,e,this):new a_(18,this):e?new Wf(17,e,this):new a_(16,this):(this.Bb&RU)==0?e?new Wf(23,e,this):new a_(22,this):e?new Wf(21,e,this):new a_(20,this):this.p=this._k()?this.bl()?new fje(P(i,29),this,r):new ILe(P(i,29),this,r):j(i,156)?e==t9?new a_(40,this):(this.Bb&RU)==0?e?new kNe(t,s,this,(mD(),o==q9?lHt:o==J9?iHt:o==Y9?uHt:o==Q9?cHt:o==Z9?sHt:o==$9?dHt:o==X9?aHt:o==K9?oHt:c9)):new gIe(P(i,156),t,s,this):e?new ANe(t,s,this,(mD(),o==q9?lHt:o==J9?iHt:o==Y9?uHt:o==Q9?cHt:o==Z9?sHt:o==$9?dHt:o==X9?aHt:o==K9?oHt:c9)):new _Ie(P(i,156),t,s,this):this.al()?r?(this.Bb&RU)==0?this.bl()?new hje(P(i,29),this,r):new Gf(P(i,29),this,r):this.bl()?new _je(P(i,29),this,r):new gje(P(i,29),this,r):(this.Bb&RU)==0?this.bl()?new JEe(P(i,29),this):new Ed(P(i,29),this):this.bl()?new ZEe(P(i,29),this):new YEe(P(i,29),this):this.bl()?r?(this.Bb&RU)==0?new pje(P(i,29),this,r):new vje(P(i,29),this,r):(this.Bb&RU)==0?new XEe(P(i,29),this):new QEe(P(i,29),this):r?(this.Bb&RU)==0?new mje(P(i,29),this,r):new yje(P(i,29),this,r):(this.Bb&RU)==0?new Bp(P(i,29),this):new $Ee(P(i,29),this)),this.p},Q.rk=function(){return(this.Bb&pF)!=0},Q._k=function(){return!1},Q.al=function(){return!1},Q.sk=function(){return(this.Bb&ZP)!=0},Q.xk=function(){return ex(this)},Q.bl=function(){return!1},Q.tk=function(){return(this.Bb&RU)!=0},Q.cl=function(e){this.k=e},Q.ui=function(e){X_(this,e)},Q.Ib=function(){return SM(this)},Q.e=!1,Q.n=0,L(KH,`EStructuralFeatureImpl`,462),q(331,462,{110:1,94:1,93:1,35:1,155:1,197:1,58:1,179:1,69:1,114:1,481:1,54:1,99:1,331:1,158:1,462:1,292:1,119:1,120:1,692:1},oi),Q.Lh=function(e,t,n){var r,i;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return rd(),!!(this.Bb&256);case 3:return rd(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return rd(),!!Dnt(this);case 7:return rd(),i=this.s,i>=1;case 8:return t?Ik(this):this.r;case 9:return this.q;case 10:return rd(),(this.Bb&pF)!=0;case 11:return rd(),(this.Bb&zU)!=0;case 12:return rd(),(this.Bb&uI)!=0;case 13:return this.j;case 14:return Uj(this);case 15:return rd(),(this.Bb&RU)!=0;case 16:return rd(),(this.Bb&ZP)!=0;case 17:return L_(this);case 18:return rd(),(this.Bb&GH)!=0;case 19:return t?QC(this):tWe(this)}return xb(this,e-bh((CP(),V7)),_x((r=P(NC(this,16),29),r||V7),e),t,n)},Q.Wh=function(e){var t,n;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return Dnt(this);case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&kh(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&kh(this.q).i==0);case 10:return(this.Bb&pF)==0;case 11:return(this.Bb&zU)!=0;case 12:return(this.Bb&uI)!=0;case 13:return this.j!=null;case 14:return Uj(this)!=null;case 15:return(this.Bb&RU)!=0;case 16:return(this.Bb&ZP)!=0;case 17:return!!L_(this);case 18:return(this.Bb&GH)!=0;case 19:return!!tWe(this)}return Hv(this,e-bh((CP(),V7)),_x((t=P(NC(this,16),29),t||V7),e))},Q.bi=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:X_(this,kd(t));return;case 2:FT(this,ki(Od(t)));return;case 3:RT(this,ki(Od(t)));return;case 4:Zx(this,P(t,17).a);return;case 5:Zve(this,P(t,17).a);return;case 8:aT(this,P(t,142));return;case 9:r=fA(this,P(t,89),null),r&&r.oj();return;case 10:eE(this,ki(Od(t)));return;case 11:rE(this,ki(Od(t)));return;case 12:tE(this,ki(Od(t)));return;case 13:Xc(this,kd(t));return;case 15:nE(this,ki(Od(t)));return;case 16:gE(this,ki(Od(t)));return;case 18:mE(this,ki(Od(t)));return}LE(this,e-bh((CP(),V7)),_x((n=P(NC(this,16),29),n||V7),e),t)},Q.ii=function(){return CP(),V7},Q.ki=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:j(this.Cb,90)&&$A(_y(P(this.Cb,90)),4),GS(this,null);return;case 2:FT(this,!0);return;case 3:RT(this,!0);return;case 4:Zx(this,0);return;case 5:this.b=0,Qx(this,1);return;case 8:aT(this,null);return;case 9:n=fA(this,null,null),n&&n.oj();return;case 10:eE(this,!0);return;case 11:rE(this,!1);return;case 12:tE(this,!1);return;case 13:this.i=null,OS(this,null);return;case 15:nE(this,!1);return;case 16:gE(this,!1);return;case 18:mE(this,!1);return}PT(this,e-bh((CP(),V7)),_x((t=P(NC(this,16),29),t||V7),e))},Q.pi=function(){QC(this),lg(Rb((UA(),l9),this)),Ik(this),this.Bb|=1},Q.Jk=function(){return Dnt(this)},Q.Yk=function(e,t){return this.b=0,this.a=null,kT(this,e,t)},Q.Zk=function(e){Zve(this,e)},Q.Ib=function(){var e;return this.Db&64?SM(this):(e=new Wu(SM(this)),e.a+=` (iD: `,Ga(e,(this.Bb&GH)!=0),e.a+=`)`,e.a)},Q.b=0,L(KH,`EAttributeImpl`,331),q(364,448,{110:1,94:1,93:1,142:1,155:1,197:1,58:1,114:1,54:1,99:1,364:1,158:1,119:1,120:1,691:1}),Q.dl=function(e){return e.Dh()==this},Q.Ah=function(e){return bk(this,e)},Q.Bh=function(e,t){this.w=null,this.Db=t<<16|this.Db&255,this.Cb=e},Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D==null?this.B:this.D;case 3:return _k(this);case 4:return this.ik();case 5:return this.F;case 6:return t?Mx(this):F_(this);case 7:return!this.A&&(this.A=new Nu(I7,this,7)),this.A}return xb(this,e-bh(this.ii()),_x((r=P(NC(this,16),29),r||this.ii()),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 6:return this.Cb&&(n=(i=this.Db>>16,i>=0?bk(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,6,n)}return a=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),a.wk().zk(this,WD(this),t-bh(this.ii()),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 6:return qM(this,null,6,n);case 7:return!this.A&&(this.A=new Nu(I7,this,7)),AO(this.A,e,n)}return i=P(_x((r=P(NC(this,16),29),r||this.ii()),t),69),i.wk().Ak(this,WD(this),t-bh(this.ii()),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!_k(this);case 4:return this.ik()!=null;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!F_(this);case 7:return!!this.A&&this.A.i!=0}return Hv(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:Y_(this,kd(t));return;case 2:Xl(this,kd(t));return;case 5:qN(this,kd(t));return;case 7:!this.A&&(this.A=new Nu(I7,this,7)),RN(this.A),!this.A&&(this.A=new Nu(I7,this,7)),th(this.A,P(t,16));return}LE(this,e-bh(this.ii()),_x((n=P(NC(this,16),29),n||this.ii()),e),t)},Q.ii=function(){return CP(),WVt},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:j(this.Cb,184)&&(P(this.Cb,184).tb=null),GS(this,null);return;case 2:Gw(this,null),eS(this,this.D);return;case 5:qN(this,null);return;case 7:!this.A&&(this.A=new Nu(I7,this,7)),RN(this.A);return}PT(this,e-bh(this.ii()),_x((t=P(NC(this,16),29),t||this.ii()),e))},Q.hk=function(){var e;return this.G==-1&&(this.G=(e=Mx(this),e?NO(e.vi(),this):-1)),this.G},Q.ik=function(){return null},Q.jk=function(){return Mx(this)},Q.el=function(){return this.v},Q.kk=function(){return _k(this)},Q.lk=function(){return this.D==null?this.B:this.D},Q.mk=function(){return this.F},Q.fk=function(e){return QM(this,e)},Q.fl=function(e){this.v=e},Q.gl=function(e){fYe(this,e)},Q.hl=function(e){this.C=e},Q.ui=function(e){Y_(this,e)},Q.Ib=function(){return sD(this)},Q.C=null,Q.D=null,Q.G=-1,L(KH,`EClassifierImpl`,364),q(90,364,{110:1,94:1,93:1,29:1,142:1,155:1,197:1,58:1,114:1,54:1,99:1,90:1,364:1,158:1,482:1,119:1,120:1,691:1},Que),Q.dl=function(e){return pOe(this,e.Dh())},Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D==null?this.B:this.D;case 3:return _k(this);case 4:return null;case 5:return this.F;case 6:return t?Mx(this):F_(this);case 7:return!this.A&&(this.A=new Nu(I7,this,7)),this.A;case 8:return rd(),!!(this.Bb&256);case 9:return rd(),!!(this.Bb&512);case 10:return l_(this);case 11:return!this.q&&(this.q=new F(M7,this,11,10)),this.q;case 12:return bN(this);case 13:return gN(this);case 14:return gN(this),this.r;case 15:return bN(this),this.k;case 16:return Qet(this);case 17:return fN(this);case 18:return aN(this);case 19:return zj(this);case 20:return bN(this),this.o;case 21:return!this.s&&(this.s=new F(w7,this,21,17)),this.s;case 22:return Jv(this);case 23:return _M(this)}return xb(this,e-bh((CP(),H7)),_x((r=P(NC(this,16),29),r||H7),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 6:return this.Cb&&(n=(i=this.Db>>16,i>=0?bk(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,6,n);case 11:return!this.q&&(this.q=new F(M7,this,11,10)),vD(this.q,e,n);case 21:return!this.s&&(this.s=new F(w7,this,21,17)),vD(this.s,e,n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),H7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),H7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 6:return qM(this,null,6,n);case 7:return!this.A&&(this.A=new Nu(I7,this,7)),AO(this.A,e,n);case 11:return!this.q&&(this.q=new F(M7,this,11,10)),AO(this.q,e,n);case 21:return!this.s&&(this.s=new F(w7,this,21,17)),AO(this.s,e,n);case 22:return AO(Jv(this),e,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),H7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),H7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!_k(this);case 4:return!1;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!F_(this);case 7:return!!this.A&&this.A.i!=0;case 8:return!!(this.Bb&256);case 9:return!!(this.Bb&512);case 10:return!!this.u&&Jv(this.u.a).i!=0&&!(this.n&&QO(this.n));case 11:return!!this.q&&this.q.i!=0;case 12:return bN(this).i!=0;case 13:return gN(this).i!=0;case 14:return gN(this),this.r.i!=0;case 15:return bN(this),this.k.i!=0;case 16:return Qet(this).i!=0;case 17:return fN(this).i!=0;case 18:return aN(this).i!=0;case 19:return zj(this).i!=0;case 20:return bN(this),!!this.o;case 21:return!!this.s&&this.s.i!=0;case 22:return!!this.n&&QO(this.n);case 23:return _M(this).i!=0}return Hv(this,e-bh((CP(),H7)),_x((t=P(NC(this,16),29),t||H7),e))},Q.Zh=function(e){return(this.i==null||this.q&&this.q.i!=0?null:Qj(this,e))||rP(this,e)},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:Y_(this,kd(t));return;case 2:Xl(this,kd(t));return;case 5:qN(this,kd(t));return;case 7:!this.A&&(this.A=new Nu(I7,this,7)),RN(this.A),!this.A&&(this.A=new Nu(I7,this,7)),th(this.A,P(t,16));return;case 8:IT(this,ki(Od(t)));return;case 9:zT(this,ki(Od(t)));return;case 10:zN(l_(this)),th(l_(this),P(t,16));return;case 11:!this.q&&(this.q=new F(M7,this,11,10)),RN(this.q),!this.q&&(this.q=new F(M7,this,11,10)),th(this.q,P(t,16));return;case 21:!this.s&&(this.s=new F(w7,this,21,17)),RN(this.s),!this.s&&(this.s=new F(w7,this,21,17)),th(this.s,P(t,16));return;case 22:RN(Jv(this)),th(Jv(this),P(t,16));return}LE(this,e-bh((CP(),H7)),_x((n=P(NC(this,16),29),n||H7),e),t)},Q.ii=function(){return CP(),H7},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:j(this.Cb,184)&&(P(this.Cb,184).tb=null),GS(this,null);return;case 2:Gw(this,null),eS(this,this.D);return;case 5:qN(this,null);return;case 7:!this.A&&(this.A=new Nu(I7,this,7)),RN(this.A);return;case 8:IT(this,!1);return;case 9:zT(this,!1);return;case 10:this.u&&zN(this.u);return;case 11:!this.q&&(this.q=new F(M7,this,11,10)),RN(this.q);return;case 21:!this.s&&(this.s=new F(w7,this,21,17)),RN(this.s);return;case 22:this.n&&RN(this.n);return}PT(this,e-bh((CP(),H7)),_x((t=P(NC(this,16),29),t||H7),e))},Q.pi=function(){var e,t;if(bN(this),gN(this),Qet(this),fN(this),aN(this),zj(this),_M(this),Ey(Eje(_y(this))),this.s)for(e=0,t=this.s.i;e=0;--t)H(this,t);return oD(this,e)},Q.Gk=function(){RN(this)},Q.Zi=function(e,t){return Hqe(this,e,t)},L(IU,`EcoreEList`,632),q(505,632,JU,rp),Q.Li=function(){return!1},Q.Lj=function(){return this.c},Q.Mj=function(){return!1},Q.ol=function(){return!0},Q.Si=function(){return!0},Q.Wi=function(e,t){return t},Q.Yi=function(){return!1},Q.c=0,L(IU,`EObjectEList`,505),q(83,505,JU,ju),Q.Mj=function(){return!0},Q.ml=function(){return!1},Q.al=function(){return!0},L(IU,`EObjectContainmentEList`,83),q(555,83,JU,Mu),Q.Ni=function(){this.b=!0},Q.Qj=function(){return this.b},Q.Gk=function(){var e;RN(this),Gl(this.e)?(e=this.b,this.b=!1,AC(this.e,new vy(this.e,2,this.c,e,!1))):this.b=!1},Q.b=!1,L(IU,`EObjectContainmentEList/Unsettable`,555),q(1161,555,JU,DNe),Q.Ti=function(e,t){var n,r;return n=P(QT(this,e,t),89),Gl(this.e)&&Kr(this,new db(this.a,7,(CP(),GVt),G(t),(r=n.c,j(r,90)?P(r,29):J7),e)),n},Q.Uj=function(e,t){return C0e(this,P(e,89),t)},Q.Vj=function(e,t){return S0e(this,P(e,89),t)},Q.Wj=function(e,t,n){return L8e(this,P(e,89),P(t,89),n)},Q.Ij=function(e,t,n,r,i){switch(e){case 3:return V_(this,e,t,n,r,this.i>1);case 5:return V_(this,e,t,n,r,this.i-P(n,15).gc()>0);default:return new Hb(this.e,e,this.c,t,n,r,!0)}},Q.Tj=function(){return!0},Q.Qj=function(){return QO(this)},Q.Gk=function(){RN(this)},L(KH,`EClassImpl/1`,1161),q(1175,1174,nwt),Q.dj=function(e){var t,n=e.gj(),r,i,a,o,s;if(n!=8){if(r=N2e(e),r==0)switch(n){case 1:case 9:s=e.kj(),s!=null&&(t=_y(P(s,482)),!t.c&&(t.c=new ln),nx(t.c,e.jj())),o=e.ij(),o!=null&&(i=P(o,482),i.Bb&1||(t=_y(i),!t.c&&(t.c=new ln),tb(t.c,P(e.jj(),29))));break;case 3:o=e.ij(),o!=null&&(i=P(o,482),i.Bb&1||(t=_y(i),!t.c&&(t.c=new ln),tb(t.c,P(e.jj(),29))));break;case 5:if(o=e.ij(),o!=null)for(a=P(o,16).Kc();a.Ob();)i=P(a.Pb(),482),i.Bb&1||(t=_y(i),!t.c&&(t.c=new ln),tb(t.c,P(e.jj(),29)));break;case 4:s=e.kj(),s!=null&&(i=P(s,482),i.Bb&1||(t=_y(i),!t.c&&(t.c=new ln),nx(t.c,e.jj())));break;case 6:if(s=e.kj(),s!=null)for(a=P(s,16).Kc();a.Ob();)i=P(a.Pb(),482),i.Bb&1||(t=_y(i),!t.c&&(t.c=new ln),nx(t.c,e.jj()))}this.ql(r)}},Q.ql=function(e){Zct(this,e)},Q.b=63,L(KH,`ESuperAdapter`,1175),q(1176,1175,nwt,Bhe),Q.ql=function(e){$A(this,e)},L(KH,`EClassImpl/10`,1176),q(1165,710,JU),Q.Ei=function(e,t){return dA(this,e,t)},Q.Fi=function(e){return X4e(this,e)},Q.Gi=function(e,t){jT(this,e,t)},Q.Hi=function(e){Ty(this,e)},Q.$i=function(e){return SGe(this,e)},Q.Xi=function(e,t){return tx(this,e,t)},Q.Wk=function(e,t){throw E(new Br)},Q.Ii=function(){return new ld(this)},Q.Ji=function(){return new ud(this)},Q.Ki=function(e){return mS(this,e)},Q.Xk=function(e,t){throw E(new Br)},Q.Fk=function(e){return this},Q.Qj=function(){return this.i!=0},Q.Wb=function(e){throw E(new Br)},Q.Gk=function(){throw E(new Br)},L(IU,`EcoreEList/UnmodifiableEList`,1165),q(328,1165,JU,El),Q.Yi=function(){return!1},L(IU,`EcoreEList/UnmodifiableEList/FastCompare`,328),q(1168,328,JU,bZe),Q.dd=function(e){var t,n,r;if(j(e,179)&&(t=P(e,179),n=t.Lj(),n!=-1)){for(r=this.i;n4)if(this.fk(e)){if(this.al()){if(r=P(e,54),n=r.Eh(),s=n==this.b&&(this.ml()?r.yh(r.Fh(),P(_x(d_(this.b),this.Lj()).Hk(),29).kk())==qO(P(_x(d_(this.b),this.Lj()),19)).n:-1-r.Fh()==this.Lj()),this.nl()&&!s&&!n&&r.Jh()){for(i=0;i1||r==-1)):!1},Q.ml=function(){var e,t=_x(d_(this.b),this.Lj()),n;return j(t,102)?(e=P(t,19),n=qO(e),!!n):!1},Q.nl=function(){var e,t=_x(d_(this.b),this.Lj());return j(t,102)?(e=P(t,19),(e.Bb&pI)!=0):!1},Q.dd=function(e){var t,n,r=this.zj(e),i;if(r>=0)return r;if(this.ol()){for(n=0,i=this.Ej();n=0;--e)GN(this,e,this.xj(e));return this.Fj()},Q.Qc=function(e){var t;if(this.nl())for(t=this.Ej()-1;t>=0;--t)GN(this,t,this.xj(t));return this.Gj(e)},Q.Gk=function(){zN(this)},Q.Zi=function(e,t){return CGe(this,e,t)},L(IU,`DelegatingEcoreEList`,756),q(1171,756,Ewt,FDe),Q.qj=function(e,t){BEe(this,e,P(t,29))},Q.rj=function(e){twe(this,P(e,29))},Q.xj=function(e){var t,n;return t=P(H(Jv(this.a),e),89),n=t.c,j(n,90)?P(n,29):(CP(),J7)},Q.Cj=function(e){var t,n;return t=P(lM(Jv(this.a),e),89),n=t.c,j(n,90)?P(n,29):(CP(),J7)},Q.Dj=function(e,t){return Q4e(this,e,P(t,29))},Q.Li=function(){return!1},Q.Ij=function(e,t,n,r,i){return null},Q.sj=function(){return new Uhe(this)},Q.tj=function(){RN(Jv(this.a))},Q.uj=function(e){return H$e(this,e)},Q.vj=function(e){var t,n;for(n=e.Kc();n.Ob();)if(t=n.Pb(),!H$e(this,t))return!1;return!0},Q.wj=function(e){var t,n,r;if(j(e,15)&&(r=P(e,15),r.gc()==Jv(this.a).i)){for(t=r.Kc(),n=new Lu(this);t.Ob();)if(A(t.Pb())!==A(gO(n)))return!1;return!0}return!1},Q.yj=function(){var e,t,n=1,r,i;for(t=new Lu(Jv(this.a));t.e!=t.i.gc();)e=P(gO(t),89),r=(i=e.c,j(i,90)?P(i,29):(CP(),J7)),n=31*n+(r?td(r):0);return n},Q.zj=function(e){var t,n,r=0,i;for(n=new Lu(Jv(this.a));n.e!=n.i.gc();){if(t=P(gO(n),89),A(e)===A((i=t.c,j(i,90)?P(i,29):(CP(),J7))))return r;++r}return-1},Q.Aj=function(){return Jv(this.a).i==0},Q.Bj=function(){return null},Q.Ej=function(){return Jv(this.a).i},Q.Fj=function(){var e,t,n,r,i,a=Jv(this.a).i;for(i=V(WW,FP,1,a,5,1),n=0,t=new Lu(Jv(this.a));t.e!=t.i.gc();)e=P(gO(t),89),i[n++]=(r=e.c,j(r,90)?P(r,29):(CP(),J7));return i},Q.Gj=function(e){var t,n,r,i,a,o,s=Jv(this.a).i;for(e.lengths&&Sh(e,s,null),r=0,n=new Lu(Jv(this.a));n.e!=n.i.gc();)t=P(gO(n),89),a=(o=t.c,j(o,90)?P(o,29):(CP(),J7)),Sh(e,r++,a);return e},Q.Hj=function(){var e,t,n,r,i=new $i;for(i.a+=`[`,e=Jv(this.a),t=0,r=Jv(this.a).i;t>16,i>=0?bk(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,6,n);case 9:return!this.a&&(this.a=new F(A7,this,9,5)),vD(this.a,e,n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),U7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),U7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 6:return qM(this,null,6,n);case 7:return!this.A&&(this.A=new Nu(I7,this,7)),AO(this.A,e,n);case 9:return!this.a&&(this.a=new F(A7,this,9,5)),AO(this.a,e,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),U7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),U7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!_k(this);case 4:return!!AQe(this);case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!F_(this);case 7:return!!this.A&&this.A.i!=0;case 8:return!(this.Bb&256);case 9:return!!this.a&&this.a.i!=0}return Hv(this,e-bh((CP(),U7)),_x((t=P(NC(this,16),29),t||U7),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:Y_(this,kd(t));return;case 2:Xl(this,kd(t));return;case 5:qN(this,kd(t));return;case 7:!this.A&&(this.A=new Nu(I7,this,7)),RN(this.A),!this.A&&(this.A=new Nu(I7,this,7)),th(this.A,P(t,16));return;case 8:LT(this,ki(Od(t)));return;case 9:!this.a&&(this.a=new F(A7,this,9,5)),RN(this.a),!this.a&&(this.a=new F(A7,this,9,5)),th(this.a,P(t,16));return}LE(this,e-bh((CP(),U7)),_x((n=P(NC(this,16),29),n||U7),e),t)},Q.ii=function(){return CP(),U7},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:j(this.Cb,184)&&(P(this.Cb,184).tb=null),GS(this,null);return;case 2:Gw(this,null),eS(this,this.D);return;case 5:qN(this,null);return;case 7:!this.A&&(this.A=new Nu(I7,this,7)),RN(this.A);return;case 8:LT(this,!0);return;case 9:!this.a&&(this.a=new F(A7,this,9,5)),RN(this.a);return}PT(this,e-bh((CP(),U7)),_x((t=P(NC(this,16),29),t||U7),e))},Q.pi=function(){var e,t;if(this.a)for(e=0,t=this.a.i;e>16==5?P(this.Cb,685):null}return xb(this,e-bh((CP(),W7)),_x((r=P(NC(this,16),29),r||W7),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 5:return this.Cb&&(n=(i=this.Db>>16,i>=0?C6e(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,5,n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),W7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),W7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 5:return qM(this,null,5,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),W7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),W7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.d!=0;case 3:return!!this.b;case 4:return this.c!=null;case 5:return!!(this.Db>>16==5&&P(this.Cb,685))}return Hv(this,e-bh((CP(),W7)),_x((t=P(NC(this,16),29),t||W7),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:GS(this,kd(t));return;case 2:$x(this,P(t,17).a);return;case 3:nrt(this,P(t,2039));return;case 4:SS(this,kd(t));return}LE(this,e-bh((CP(),W7)),_x((n=P(NC(this,16),29),n||W7),e),t)},Q.ii=function(){return CP(),W7},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:GS(this,null);return;case 2:$x(this,0);return;case 3:nrt(this,null);return;case 4:SS(this,null);return}PT(this,e-bh((CP(),W7)),_x((t=P(NC(this,16),29),t||W7),e))},Q.Ib=function(){var e;return e=this.c,e??this.zb},Q.b=null,Q.c=null,Q.d=0,L(KH,`EEnumLiteralImpl`,582);var tHt=gp(KH,`EFactoryImpl/InternalEDateTimeFormat`);q(499,1,{2114:1},br),L(KH,`EFactoryImpl/1ClientInternalEDateTimeFormat`,499),q(248,120,{110:1,94:1,93:1,89:1,58:1,114:1,54:1,99:1,248:1,119:1,120:1},kr),Q.Ch=function(e,t,n){var r;return n=qM(this,e,t,n),this.e&&j(e,179)&&(r=Rj(this,this.e),r!=this.c&&(n=JN(this,r,n))),n},Q.Lh=function(e,t,n){var r;switch(e){case 0:return this.f;case 1:return!this.d&&(this.d=new ju(j7,this,1)),this.d;case 2:return t?ZM(this):this.c;case 3:return this.b;case 4:return this.e;case 5:return t?nk(this):this.a}return xb(this,e-bh((CP(),K7)),_x((r=P(NC(this,16),29),r||K7),e),t,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return p$e(this,null,n);case 1:return!this.d&&(this.d=new ju(j7,this,1)),AO(this.d,e,n);case 3:return m$e(this,null,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),K7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),K7)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.f;case 1:return!!this.d&&this.d.i!=0;case 2:return!!this.c;case 3:return!!this.b;case 4:return!!this.e;case 5:return!!this.a}return Hv(this,e-bh((CP(),K7)),_x((t=P(NC(this,16),29),t||K7),e))},Q.bi=function(e,t){var n;switch(e){case 0:d5e(this,P(t,89));return;case 1:!this.d&&(this.d=new ju(j7,this,1)),RN(this.d),!this.d&&(this.d=new ju(j7,this,1)),th(this.d,P(t,16));return;case 3:u5e(this,P(t,89));return;case 4:i9e(this,P(t,850));return;case 5:Nx(this,P(t,142));return}LE(this,e-bh((CP(),K7)),_x((n=P(NC(this,16),29),n||K7),e),t)},Q.ii=function(){return CP(),K7},Q.ki=function(e){var t;switch(e){case 0:d5e(this,null);return;case 1:!this.d&&(this.d=new ju(j7,this,1)),RN(this.d);return;case 3:u5e(this,null);return;case 4:i9e(this,null);return;case 5:Nx(this,null);return}PT(this,e-bh((CP(),K7)),_x((t=P(NC(this,16),29),t||K7),e))},Q.Ib=function(){var e=new Gu(Aj(this));return e.a+=` (expression: `,kN(this,e),e.a+=`)`,e.a};var nHt;L(KH,`EGenericTypeImpl`,248),q(2067,2062,QU),Q.Gi=function(e,t){ADe(this,e,t)},Q.Wk=function(e,t){return ADe(this,this.gc(),e),t},Q.$i=function(e){return SO(this.pj(),e)},Q.Ii=function(){return this.Ji()},Q.pj=function(){return new Jhe(this)},Q.Ji=function(){return this.Ki(0)},Q.Ki=function(e){return this.pj().fd(e)},Q.Xk=function(e,t){return QE(this,e,!0),t},Q.Ti=function(e,t){var n,r=Mk(this,t);return n=this.fd(e),n.Rb(r),r},Q.Ui=function(e,t){var n;QE(this,t,!0),n=this.fd(e),n.Rb(t)},L(IU,`AbstractSequentialInternalEList`,2067),q(496,2067,QU,ad),Q.$i=function(e){return SO(this.pj(),e)},Q.Ii=function(){return this.b==null?(Xo(),Xo(),a9):this.sl()},Q.pj=function(){return new mCe(this.a,this.b)},Q.Ji=function(){return this.b==null?(Xo(),Xo(),a9):this.sl()},Q.Ki=function(e){var t,n;if(this.b==null){if(e<0||e>1)throw E(new Mi(PU+e+`, size=0`));return Xo(),Xo(),a9}for(n=this.sl(),t=0;t0;)if(t=this.c[--this.d],(!this.e||t.pk()!=R5||t.Lj()!=0)&&(!this.vl()||this.b.Xh(t))){if(a=this.b.Nh(t,this.ul()),this.f=(Qo(),P(t,69).xk()),this.f||t.Jk()){if(this.ul()?(r=P(a,15),this.k=r):(r=P(a,71),this.k=this.j=r),j(this.k,59)?(this.o=this.k.gc(),this.n=this.o):this.p=this.j?this.j.Ki(this.k.gc()):this.k.fd(this.k.gc()),this.p?Pet(this,this.p):ytt(this))return i=this.p?this.p.Ub():this.j?this.j.$i(--this.n):this.k.Xb(--this.n),this.f?(e=P(i,76),e.Lk(),n=e.md(),this.i=n):(n=i,this.i=n),this.g=-3,!0}else if(a!=null)return this.k=null,this.p=null,n=a,this.i=n,this.g=-2,!0}return this.k=null,this.p=null,this.g=-1,!1}return i=this.p?this.p.Ub():this.j?this.j.$i(--this.n):this.k.Xb(--this.n),this.f?(e=P(i,76),e.Lk(),n=e.md(),this.i=n):(n=i,this.i=n),this.g=-3,!0}},Q.Pb=function(){return IC(this)},Q.Tb=function(){return this.a},Q.Ub=function(){var e;if(this.g<-1||this.Sb())return--this.a,this.g=0,e=this.i,this.Sb(),e;throw E(new Hr)},Q.Vb=function(){return this.a-1},Q.Qb=function(){throw E(new Br)},Q.ul=function(){return!1},Q.Wb=function(e){throw E(new Br)},Q.vl=function(){return!0},Q.a=0,Q.d=0,Q.f=!1,Q.g=0,Q.n=0,Q.o=0;var a9;L(IU,`EContentsEList/FeatureIteratorImpl`,287),q(711,287,$U,HEe),Q.ul=function(){return!0},L(IU,`EContentsEList/ResolvingFeatureIteratorImpl`,711),q(1178,711,$U,UEe),Q.vl=function(){return!1},L(KH,`ENamedElementImpl/1/1`,1178),q(1179,287,$U,WEe),Q.vl=function(){return!1},L(KH,`ENamedElementImpl/1/2`,1179),q(39,152,NU,Qv,$v,Sm,ub,Hb,vy,Gqe,nBe,Kqe,rBe,vUe,iBe,Yqe,aBe,yUe,oBe,qqe,sBe,Cm,db,Jg,Jqe,cBe,bUe,lBe),Q.Kj=function(){return eb(this)},Q.Rj=function(){var e=eb(this);return e?e.ik():null},Q.hj=function(e){return this.b==-1&&this.a&&(this.b=this.c.Hh(this.a.Lj(),this.a.pk())),this.c.yh(this.b,e)},Q.jj=function(){return this.c},Q.Sj=function(){var e=eb(this);return e?e.tk():!1},Q.b=-1,L(KH,`ENotificationImpl`,39),q(411,292,{110:1,94:1,93:1,155:1,197:1,58:1,62:1,114:1,481:1,54:1,99:1,158:1,411:1,292:1,119:1,120:1},si),Q.Ah=function(e){return I6e(this,e)},Q.Lh=function(e,t,n){var r,i,a;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return rd(),!!(this.Bb&256);case 3:return rd(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return rd(),a=this.t,a>1||a==-1;case 7:return rd(),i=this.s,i>=1;case 8:return t?Ik(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?P(this.Cb,29):null;case 11:return!this.d&&(this.d=new Nu(I7,this,11)),this.d;case 12:return!this.c&&(this.c=new F(P7,this,12,10)),this.c;case 13:return!this.a&&(this.a=new Ud(this,this)),this.a;case 14:return Ib(this)}return xb(this,e-bh((CP(),Y7)),_x((r=P(NC(this,16),29),r||Y7),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 10:return this.Cb&&(n=(i=this.Db>>16,i>=0?I6e(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,10,n);case 12:return!this.c&&(this.c=new F(P7,this,12,10)),vD(this.c,e,n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),Y7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),Y7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 9:return nh(this,n);case 10:return qM(this,null,10,n);case 11:return!this.d&&(this.d=new Nu(I7,this,11)),AO(this.d,e,n);case 12:return!this.c&&(this.c=new F(P7,this,12,10)),AO(this.c,e,n);case 14:return AO(Ib(this),e,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),Y7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),Y7)),e,n)},Q.Wh=function(e){var t,n,r;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return r=this.t,r>1||r==-1;case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&kh(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&kh(this.q).i==0);case 10:return!!(this.Db>>16==10&&P(this.Cb,29));case 11:return!!this.d&&this.d.i!=0;case 12:return!!this.c&&this.c.i!=0;case 13:return!!this.a&&Ib(this.a.a).i!=0&&!(this.b&&$O(this.b));case 14:return!!this.b&&$O(this.b)}return Hv(this,e-bh((CP(),Y7)),_x((t=P(NC(this,16),29),t||Y7),e))},Q.bi=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:GS(this,kd(t));return;case 2:FT(this,ki(Od(t)));return;case 3:RT(this,ki(Od(t)));return;case 4:Zx(this,P(t,17).a);return;case 5:Qx(this,P(t,17).a);return;case 8:aT(this,P(t,142));return;case 9:r=fA(this,P(t,89),null),r&&r.oj();return;case 11:!this.d&&(this.d=new Nu(I7,this,11)),RN(this.d),!this.d&&(this.d=new Nu(I7,this,11)),th(this.d,P(t,16));return;case 12:!this.c&&(this.c=new F(P7,this,12,10)),RN(this.c),!this.c&&(this.c=new F(P7,this,12,10)),th(this.c,P(t,16));return;case 13:!this.a&&(this.a=new Ud(this,this)),zN(this.a),!this.a&&(this.a=new Ud(this,this)),th(this.a,P(t,16));return;case 14:RN(Ib(this)),th(Ib(this),P(t,16));return}LE(this,e-bh((CP(),Y7)),_x((n=P(NC(this,16),29),n||Y7),e),t)},Q.ii=function(){return CP(),Y7},Q.ki=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:GS(this,null);return;case 2:FT(this,!0);return;case 3:RT(this,!0);return;case 4:Zx(this,0);return;case 5:Qx(this,1);return;case 8:aT(this,null);return;case 9:n=fA(this,null,null),n&&n.oj();return;case 11:!this.d&&(this.d=new Nu(I7,this,11)),RN(this.d);return;case 12:!this.c&&(this.c=new F(P7,this,12,10)),RN(this.c);return;case 13:this.a&&zN(this.a);return;case 14:this.b&&RN(this.b);return}PT(this,e-bh((CP(),Y7)),_x((t=P(NC(this,16),29),t||Y7),e))},Q.pi=function(){var e,t;if(this.c)for(e=0,t=this.c.i;es&&Sh(e,s,null),r=0,n=new Lu(Ib(this.a));n.e!=n.i.gc();)t=P(gO(n),89),a=(o=t.c,o||(CP(),q7)),Sh(e,r++,a);return e},Q.Hj=function(){var e,t,n,r,i=new $i;for(i.a+=`[`,e=Ib(this.a),t=0,r=Ib(this.a).i;t1);case 5:return V_(this,e,t,n,r,this.i-P(n,15).gc()>0);default:return new Hb(this.e,e,this.c,t,n,r,!0)}},Q.Tj=function(){return!0},Q.Qj=function(){return $O(this)},Q.Gk=function(){RN(this)},L(KH,`EOperationImpl/2`,1377),q(507,1,{2037:1,507:1},YSe),L(KH,`EPackageImpl/1`,507),q(14,83,JU,F),Q.il=function(){return this.d},Q.jl=function(){return this.b},Q.ml=function(){return!0},Q.b=0,L(IU,`EObjectContainmentWithInverseEList`,14),q(365,14,JU,nf),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectContainmentWithInverseEList/Resolving`,365),q(308,365,JU,Tm),Q.Ni=function(){this.a.tb=null},L(KH,`EPackageImpl/2`,308),q(1278,1,{},Jse),L(KH,`EPackageImpl/3`,1278),q(733,45,CI,ci),Q._b=function(e){return rl(e)?e_(this,e):!!Kp(this.f,e)},L(KH,`EPackageRegistryImpl`,733),q(518,292,{110:1,94:1,93:1,155:1,197:1,58:1,2116:1,114:1,481:1,54:1,99:1,158:1,518:1,292:1,119:1,120:1},li),Q.Ah=function(e){return L6e(this,e)},Q.Lh=function(e,t,n){var r,i,a;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return rd(),!!(this.Bb&256);case 3:return rd(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return rd(),a=this.t,a>1||a==-1;case 7:return rd(),i=this.s,i>=1;case 8:return t?Ik(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?P(this.Cb,62):null}return xb(this,e-bh((CP(),Z7)),_x((r=P(NC(this,16),29),r||Z7),e),t,n)},Q.Sh=function(e,t,n){var r,i,a;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),vD(this.Ab,e,n);case 10:return this.Cb&&(n=(i=this.Db>>16,i>=0?L6e(this,n):this.Cb.Th(this,-1-i,null,n))),qM(this,e,10,n)}return a=P(_x((r=P(NC(this,16),29),r||(CP(),Z7)),t),69),a.wk().zk(this,WD(this),t-bh((CP(),Z7)),e,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 9:return nh(this,n);case 10:return qM(this,null,10,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),Z7)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),Z7)),e,n)},Q.Wh=function(e){var t,n,r;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return r=this.t,r>1||r==-1;case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&kh(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&kh(this.q).i==0);case 10:return!!(this.Db>>16==10&&P(this.Cb,62))}return Hv(this,e-bh((CP(),Z7)),_x((t=P(NC(this,16),29),t||Z7),e))},Q.ii=function(){return CP(),Z7},L(KH,`EParameterImpl`,518),q(102,462,{110:1,94:1,93:1,155:1,197:1,58:1,19:1,179:1,69:1,114:1,481:1,54:1,99:1,158:1,102:1,462:1,292:1,119:1,120:1,692:1},uDe),Q.Lh=function(e,t,n){var r,i,a,o;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return rd(),!!(this.Bb&256);case 3:return rd(),!!(this.Bb&512);case 4:return G(this.s);case 5:return G(this.t);case 6:return rd(),o=this.t,o>1||o==-1;case 7:return rd(),i=this.s,i>=1;case 8:return t?Ik(this):this.r;case 9:return this.q;case 10:return rd(),(this.Bb&pF)!=0;case 11:return rd(),(this.Bb&zU)!=0;case 12:return rd(),(this.Bb&uI)!=0;case 13:return this.j;case 14:return Uj(this);case 15:return rd(),(this.Bb&RU)!=0;case 16:return rd(),(this.Bb&ZP)!=0;case 17:return L_(this);case 18:return rd(),(this.Bb&GH)!=0;case 19:return rd(),a=qO(this),!!(a&&(a.Bb&GH)!=0);case 20:return rd(),(this.Bb&pI)!=0;case 21:return t?qO(this):this.b;case 22:return t?DZe(this):DUe(this);case 23:return!this.a&&(this.a=new Pu(T7,this,23)),this.a}return xb(this,e-bh((CP(),Q7)),_x((r=P(NC(this,16),29),r||Q7),e),t,n)},Q.Wh=function(e){var t,n,r,i;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!(this.Bb&256);case 3:return!(this.Bb&512);case 4:return this.s!=0;case 5:return this.t!=1;case 6:return i=this.t,i>1||i==-1;case 7:return n=this.s,n>=1;case 8:return!!this.r&&!this.q.e&&kh(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&kh(this.q).i==0);case 10:return(this.Bb&pF)==0;case 11:return(this.Bb&zU)!=0;case 12:return(this.Bb&uI)!=0;case 13:return this.j!=null;case 14:return Uj(this)!=null;case 15:return(this.Bb&RU)!=0;case 16:return(this.Bb&ZP)!=0;case 17:return!!L_(this);case 18:return(this.Bb&GH)!=0;case 19:return r=qO(this),!!r&&(r.Bb&GH)!=0;case 20:return(this.Bb&pI)==0;case 21:return!!this.b;case 22:return!!DUe(this);case 23:return!!this.a&&this.a.i!=0}return Hv(this,e-bh((CP(),Q7)),_x((t=P(NC(this,16),29),t||Q7),e))},Q.bi=function(e,t){var n,r;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:X_(this,kd(t));return;case 2:FT(this,ki(Od(t)));return;case 3:RT(this,ki(Od(t)));return;case 4:Zx(this,P(t,17).a);return;case 5:Qx(this,P(t,17).a);return;case 8:aT(this,P(t,142));return;case 9:r=fA(this,P(t,89),null),r&&r.oj();return;case 10:eE(this,ki(Od(t)));return;case 11:rE(this,ki(Od(t)));return;case 12:tE(this,ki(Od(t)));return;case 13:Xc(this,kd(t));return;case 15:nE(this,ki(Od(t)));return;case 16:gE(this,ki(Od(t)));return;case 18:PRe(this,ki(Od(t)));return;case 20:_E(this,ki(Od(t)));return;case 21:JJe(this,P(t,19));return;case 23:!this.a&&(this.a=new Pu(T7,this,23)),RN(this.a),!this.a&&(this.a=new Pu(T7,this,23)),th(this.a,P(t,16));return}LE(this,e-bh((CP(),Q7)),_x((n=P(NC(this,16),29),n||Q7),e),t)},Q.ii=function(){return CP(),Q7},Q.ki=function(e){var t,n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:j(this.Cb,90)&&$A(_y(P(this.Cb,90)),4),GS(this,null);return;case 2:FT(this,!0);return;case 3:RT(this,!0);return;case 4:Zx(this,0);return;case 5:Qx(this,1);return;case 8:aT(this,null);return;case 9:n=fA(this,null,null),n&&n.oj();return;case 10:eE(this,!0);return;case 11:rE(this,!1);return;case 12:tE(this,!1);return;case 13:this.i=null,OS(this,null);return;case 15:nE(this,!1);return;case 16:gE(this,!1);return;case 18:hE(this,!1),j(this.Cb,90)&&$A(_y(P(this.Cb,90)),2);return;case 20:_E(this,!0);return;case 21:JJe(this,null);return;case 23:!this.a&&(this.a=new Pu(T7,this,23)),RN(this.a);return}PT(this,e-bh((CP(),Q7)),_x((t=P(NC(this,16),29),t||Q7),e))},Q.pi=function(){DZe(this),lg(Rb((UA(),l9),this)),Ik(this),this.Bb|=1},Q.uk=function(){return qO(this)},Q._k=function(){var e;return e=qO(this),!!e&&(e.Bb&GH)!=0},Q.al=function(){return(this.Bb&GH)!=0},Q.bl=function(){return(this.Bb&pI)!=0},Q.Yk=function(e,t){return this.c=null,kT(this,e,t)},Q.Ib=function(){var e;return this.Db&64?SM(this):(e=new Wu(SM(this)),e.a+=` (containment: `,Ga(e,(this.Bb&GH)!=0),e.a+=`, resolveProxies: `,Ga(e,(this.Bb&pI)!=0),e.a+=`)`,e.a)},L(KH,`EReferenceImpl`,102),q(561,120,{110:1,44:1,94:1,93:1,136:1,58:1,114:1,54:1,99:1,561:1,119:1,120:1},Yse),Q.Fb=function(e){return this===e},Q.ld=function(){return this.b},Q.md=function(){return this.c},Q.Hb=function(){return td(this)},Q.Di=function(e){FMe(this,kd(e))},Q.nd=function(e){return Zje(this,kd(e))},Q.Lh=function(e,t,n){var r;switch(e){case 0:return this.b;case 1:return this.c}return xb(this,e-bh((CP(),$7)),_x((r=P(NC(this,16),29),r||$7),e),t,n)},Q.Wh=function(e){var t;switch(e){case 0:return this.b!=null;case 1:return this.c!=null}return Hv(this,e-bh((CP(),$7)),_x((t=P(NC(this,16),29),t||$7),e))},Q.bi=function(e,t){var n;switch(e){case 0:IMe(this,kd(t));return;case 1:PJe(this,kd(t));return}LE(this,e-bh((CP(),$7)),_x((n=P(NC(this,16),29),n||$7),e),t)},Q.ii=function(){return CP(),$7},Q.ki=function(e){var t;switch(e){case 0:NJe(this,null);return;case 1:PJe(this,null);return}PT(this,e-bh((CP(),$7)),_x((t=P(NC(this,16),29),t||$7),e))},Q.Bi=function(){var e;return this.a==-1&&(e=this.b,this.a=e==null?0:jw(e)),this.a},Q.Ci=function(e){this.a=e},Q.Ib=function(){var e;return this.Db&64?Aj(this):(e=new Wu(Aj(this)),e.a+=` (key: `,pl(e,this.b),e.a+=`, value: `,pl(e,this.c),e.a+=`)`,e.a)},Q.a=-1,Q.b=null,Q.c=null;var o9=L(KH,`EStringToStringMapEntryImpl`,561),rHt=gp(IU,`FeatureMap/Entry/Internal`);q(576,1,eW),Q.xl=function(e){return this.yl(P(e,54))},Q.yl=function(e){return this.xl(e)},Q.Fb=function(e){var t,n;return this===e?!0:j(e,76)?(t=P(e,76),t.Lk()==this.c&&(n=this.md(),n==null?t.md()==null:NT(n,t.md()))):!1},Q.Lk=function(){return this.c},Q.Hb=function(){var e=this.md();return US(this.c)^(e==null?0:US(e))},Q.Ib=function(){var e=this.c,t=Mx(e.qk()).yi();return e.xe(),(t!=null&&t.length!=0?t+`:`+e.xe():e.xe())+`=`+this.md()},L(KH,`EStructuralFeatureImpl/BasicFeatureMapEntry`,576),q(791,576,eW,IDe),Q.yl=function(e){return new IDe(this.c,e)},Q.md=function(){return this.a},Q.zl=function(e,t,n){return NYe(this,e,this.a,t,n)},Q.Al=function(e,t,n){return PYe(this,e,this.a,t,n)},L(KH,`EStructuralFeatureImpl/ContainmentUpdatingFeatureMapEntry`,791),q(1350,1,{},XSe),Q.yk=function(e,t,n,r,i){return P(mb(e,this.b),220).Yl(this.a).Fk(r)},Q.zk=function(e,t,n,r,i){return P(mb(e,this.b),220).Pl(this.a,r,i)},Q.Ak=function(e,t,n,r,i){return P(mb(e,this.b),220).Ql(this.a,r,i)},Q.Bk=function(e,t,n){return P(mb(e,this.b),220).Yl(this.a).Qj()},Q.Ck=function(e,t,n,r){P(mb(e,this.b),220).Yl(this.a).Wb(r)},Q.Dk=function(e,t,n){return P(mb(e,this.b),220).Yl(this.a)},Q.Ek=function(e,t,n){P(mb(e,this.b),220).Yl(this.a).Gk()},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateFeatureMapDelegator`,1350),q(91,1,{},Wf,Og,a_,ty),Q.yk=function(e,t,n,r,i){var a=t.li(n);if(a??t.mi(n,a=gP(this,e)),!i)switch(this.e){case 50:case 41:return P(a,597).bk();case 40:return P(a,220).Vl()}return a},Q.zk=function(e,t,n,r,i){var a,o=t.li(n);return o??t.mi(n,o=gP(this,e)),a=P(o,71).Wk(r,i),a},Q.Ak=function(e,t,n,r,i){var a=t.li(n);return a!=null&&(i=P(a,71).Xk(r,i)),i},Q.Bk=function(e,t,n){var r=t.li(n);return r!=null&&P(r,79).Qj()},Q.Ck=function(e,t,n,r){var i=P(t.li(n),79);!i&&t.mi(n,i=gP(this,e)),i.Wb(r)},Q.Dk=function(e,t,n){var r,i=t.li(n);return i??t.mi(n,i=gP(this,e)),j(i,79)?P(i,79):(r=P(t.li(n),15),new Ghe(r))},Q.Ek=function(e,t,n){var r=P(t.li(n),79);!r&&t.mi(n,r=gP(this,e)),r.Gk()},Q.b=0,Q.e=0,L(KH,`EStructuralFeatureImpl/InternalSettingDelegateMany`,91),q(512,1,{}),Q.zk=function(e,t,n,r,i){throw E(new Br)},Q.Ak=function(e,t,n,r,i){throw E(new Br)},Q.Dk=function(e,t,n){return new hIe(this,e,t,n)};var s9;L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingle`,512),q(1367,1,LU,hIe),Q.Fk=function(e){return this.a.yk(this.c,this.d,this.b,e,!0)},Q.Qj=function(){return this.a.Bk(this.c,this.d,this.b)},Q.Wb=function(e){this.a.Ck(this.c,this.d,this.b,e)},Q.Gk=function(){this.a.Ek(this.c,this.d,this.b)},Q.b=0,L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingle/1`,1367),q(784,512,{},ILe),Q.yk=function(e,t,n,r,i){return IM(e,e.Ph(),e.Fh())==this.b?this.bl()&&r?xj(e):e.Ph():null},Q.zk=function(e,t,n,r,i){var a,o;return e.Ph()&&(i=(a=e.Fh(),a>=0?e.Ah(i):e.Ph().Th(e,-1-a,null,i))),o=eD(e.Dh(),this.e),e.Ch(r,o,i)},Q.Ak=function(e,t,n,r,i){var a=eD(e.Dh(),this.e);return e.Ch(null,a,i)},Q.Bk=function(e,t,n){var r=eD(e.Dh(),this.e);return!!e.Ph()&&e.Fh()==r},Q.Ck=function(e,t,n,r){var i,a,o,s,c;if(r!=null&&!QM(this.a,r))throw E(new Pi(tW+(j(r,58)?o5e(P(r,58).Dh()):yx($w(r)))+nW+this.a+`'`));if(i=e.Ph(),o=eD(e.Dh(),this.e),A(r)!==A(i)||e.Fh()!=o&&r!=null){if(Pk(e,P(r,58)))throw E(new Fi(JH+e.Ib()));c=null,i&&(c=(a=e.Fh(),a>=0?e.Ah(c):e.Ph().Th(e,-1-a,null,c))),s=P(r,54),s&&(c=s.Rh(e,eD(s.Dh(),this.b),null,c)),c=e.Ch(s,o,c),c&&c.oj()}else e.vh()&&e.wh()&&AC(e,new Sm(e,1,o,r,r))},Q.Ek=function(e,t,n){var r=e.Ph(),i,a,o;r?(o=(i=e.Fh(),i>=0?e.Ah(null):e.Ph().Th(e,-1-i,null,null)),a=eD(e.Dh(),this.e),o=e.Ch(null,a,o),o&&o.oj()):e.vh()&&e.wh()&&AC(e,new Cm(e,1,this.e,null,null))},Q.bl=function(){return!1},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleContainer`,784),q(1351,784,{},fje),Q.bl=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleContainerResolving`,1351),q(574,512,{}),Q.yk=function(e,t,n,r,i){var a;return a=t.li(n),a==null?this.b:A(a)===A(s9)?null:a},Q.Bk=function(e,t,n){var r=t.li(n);return r!=null&&(A(r)===A(s9)||!NT(r,this.b))},Q.Ck=function(e,t,n,r){var i,a;e.vh()&&e.wh()?(i=(a=t.li(n),a==null?this.b:A(a)===A(s9)?null:a),r==null?this.c==null?this.b==null?t.mi(n,null):t.mi(n,s9):(t.mi(n,null),r=this.b):(this.Bl(r),t.mi(n,r)),AC(e,this.d.Cl(e,1,this.e,i,r))):r==null?this.c==null?this.b==null?t.mi(n,null):t.mi(n,s9):t.mi(n,null):(this.Bl(r),t.mi(n,r))},Q.Ek=function(e,t,n){var r,i;e.vh()&&e.wh()?(r=(i=t.li(n),i==null?this.b:A(i)===A(s9)?null:i),t.ni(n),AC(e,this.d.Cl(e,1,this.e,r,this.b))):t.ni(n)},Q.Bl=function(e){throw E(new xge)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData`,574),q(rW,1,{},Xse),Q.Cl=function(e,t,n,r,i){return new Cm(e,t,n,r,i)},Q.Dl=function(e,t,n,r,i,a){return new Jg(e,t,n,r,i,a)};var iHt,aHt,oHt,sHt,cHt,lHt,uHt,c9,dHt;L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator`,rW),q(1368,rW,{},Zse),Q.Cl=function(e,t,n,r,i){return new bUe(e,t,n,ki(Od(r)),ki(Od(i)))},Q.Dl=function(e,t,n,r,i,a){return new lBe(e,t,n,ki(Od(r)),ki(Od(i)),a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/1`,1368),q(1369,rW,{},Qse),Q.Cl=function(e,t,n,r,i){return new Gqe(e,t,n,P(r,222).a,P(i,222).a)},Q.Dl=function(e,t,n,r,i,a){return new nBe(e,t,n,P(r,222).a,P(i,222).a,a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/2`,1369),q(1370,rW,{},$se),Q.Cl=function(e,t,n,r,i){return new Kqe(e,t,n,P(r,180).a,P(i,180).a)},Q.Dl=function(e,t,n,r,i,a){return new rBe(e,t,n,P(r,180).a,P(i,180).a,a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/3`,1370),q(1371,rW,{},ece),Q.Cl=function(e,t,n,r,i){return new vUe(e,t,n,D(N(r)),D(N(i)))},Q.Dl=function(e,t,n,r,i,a){return new iBe(e,t,n,D(N(r)),D(N(i)),a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/4`,1371),q(1372,rW,{},tce),Q.Cl=function(e,t,n,r,i){return new Yqe(e,t,n,P(r,161).a,P(i,161).a)},Q.Dl=function(e,t,n,r,i,a){return new aBe(e,t,n,P(r,161).a,P(i,161).a,a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/5`,1372),q(1373,rW,{},nce),Q.Cl=function(e,t,n,r,i){return new yUe(e,t,n,P(r,17).a,P(i,17).a)},Q.Dl=function(e,t,n,r,i,a){return new oBe(e,t,n,P(r,17).a,P(i,17).a,a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/6`,1373),q(1374,rW,{},rce),Q.Cl=function(e,t,n,r,i){return new qqe(e,t,n,P(r,168).a,P(i,168).a)},Q.Dl=function(e,t,n,r,i,a){return new sBe(e,t,n,P(r,168).a,P(i,168).a,a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/7`,1374),q(1375,rW,{},ice),Q.Cl=function(e,t,n,r,i){return new Jqe(e,t,n,P(r,191).a,P(i,191).a)},Q.Dl=function(e,t,n,r,i,a){return new cBe(e,t,n,P(r,191).a,P(i,191).a,a)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/8`,1375),q(1353,574,{},gIe),Q.Bl=function(e){if(!this.a.fk(e))throw E(new Pi(tW+$w(e)+nW+this.a+`'`))},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataDynamic`,1353),q(1354,574,{},kNe),Q.Bl=function(e){},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataStatic`,1354),q(785,574,{}),Q.Bk=function(e,t,n){return t.li(n)!=null},Q.Ck=function(e,t,n,r){var i,a;e.vh()&&e.wh()?(i=!0,a=t.li(n),a==null?(i=!1,a=this.b):A(a)===A(s9)&&(a=null),r==null?this.c==null?t.mi(n,s9):(t.mi(n,null),r=this.b):(this.Bl(r),t.mi(n,r)),AC(e,this.d.Dl(e,1,this.e,a,r,!i))):r==null?this.c==null?t.mi(n,s9):t.mi(n,null):(this.Bl(r),t.mi(n,r))},Q.Ek=function(e,t,n){var r,i;e.vh()&&e.wh()?(r=!0,i=t.li(n),i==null?(r=!1,i=this.b):A(i)===A(s9)&&(i=null),t.ni(n),AC(e,this.d.Dl(e,2,this.e,i,this.b,r))):t.ni(n)},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettable`,785),q(1355,785,{},_Ie),Q.Bl=function(e){if(!this.a.fk(e))throw E(new Pi(tW+$w(e)+nW+this.a+`'`))},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableDynamic`,1355),q(1356,785,{},ANe),Q.Bl=function(e){},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableStatic`,1356),q(410,512,{},Bp),Q.yk=function(e,t,n,r,i){var a,o,s,c,l=t.li(n);if(this.tk()&&A(l)===A(s9))return null;if(this.bl()&&r&&l!=null){if(s=P(l,54),s.Vh()&&(c=pT(e,s),s!=c)){if(!QM(this.a,c))throw E(new Pi(tW+$w(c)+nW+this.a+`'`));t.mi(n,l=c),this.al()&&(a=P(c,54),o=s.Th(e,this.b?eD(s.Dh(),this.b):-1-eD(e.Dh(),this.e),null,null),!a.Ph()&&(o=a.Rh(e,this.b?eD(a.Dh(),this.b):-1-eD(e.Dh(),this.e),null,o)),o&&o.oj()),e.vh()&&e.wh()&&AC(e,new Cm(e,9,this.e,s,c))}return l}return l},Q.zk=function(e,t,n,r,i){var a,o=t.li(n);return A(o)===A(s9)&&(o=null),t.mi(n,r),this.Mj()?A(o)!==A(r)&&o!=null&&(a=P(o,54),i=a.Th(e,eD(a.Dh(),this.b),null,i)):this.al()&&o!=null&&(i=P(o,54).Th(e,-1-eD(e.Dh(),this.e),null,i)),e.vh()&&e.wh()&&(!i&&(i=new Pa(4)),i.nj(new Cm(e,1,this.e,o,r))),i},Q.Ak=function(e,t,n,r,i){var a=t.li(n);return A(a)===A(s9)&&(a=null),t.ni(n),e.vh()&&e.wh()&&(!i&&(i=new Pa(4)),this.tk()?i.nj(new Cm(e,2,this.e,a,null)):i.nj(new Cm(e,1,this.e,a,null))),i},Q.Bk=function(e,t,n){return t.li(n)!=null},Q.Ck=function(e,t,n,r){var i,a,o,s,c;if(r!=null&&!QM(this.a,r))throw E(new Pi(tW+(j(r,58)?o5e(P(r,58).Dh()):yx($w(r)))+nW+this.a+`'`));c=t.li(n),s=c!=null,this.tk()&&A(c)===A(s9)&&(c=null),o=null,this.Mj()?A(c)!==A(r)&&(c!=null&&(i=P(c,54),o=i.Th(e,eD(i.Dh(),this.b),null,o)),r!=null&&(i=P(r,54),o=i.Rh(e,eD(i.Dh(),this.b),null,o))):this.al()&&A(c)!==A(r)&&(c!=null&&(o=P(c,54).Th(e,-1-eD(e.Dh(),this.e),null,o)),r!=null&&(o=P(r,54).Rh(e,-1-eD(e.Dh(),this.e),null,o))),r==null&&this.tk()?t.mi(n,s9):t.mi(n,r),e.vh()&&e.wh()?(a=new Jg(e,1,this.e,c,r,this.tk()&&!s),o?(o.nj(a),o.oj()):AC(e,a)):o&&o.oj()},Q.Ek=function(e,t,n){var r,i,a,o,s=t.li(n);o=s!=null,this.tk()&&A(s)===A(s9)&&(s=null),a=null,s!=null&&(this.Mj()?(r=P(s,54),a=r.Th(e,eD(r.Dh(),this.b),null,a)):this.al()&&(a=P(s,54).Th(e,-1-eD(e.Dh(),this.e),null,a))),t.ni(n),e.vh()&&e.wh()?(i=new Jg(e,this.tk()?2:1,this.e,s,null,o),a?(a.nj(i),a.oj()):AC(e,i)):a&&a.oj()},Q.Mj=function(){return!1},Q.al=function(){return!1},Q.bl=function(){return!1},Q.tk=function(){return!1},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObject`,410),q(575,410,{},Ed),Q.al=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainment`,575),q(1359,575,{},JEe),Q.bl=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentResolving`,1359),q(787,575,{},YEe),Q.tk=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettable`,787),q(1361,787,{},ZEe),Q.bl=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettableResolving`,1361),q(650,575,{},Gf),Q.Mj=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverse`,650),q(1360,650,{},hje),Q.bl=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseResolving`,1360),q(788,650,{},gje),Q.tk=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettable`,788),q(1362,788,{},_je),Q.bl=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettableResolving`,1362),q(651,410,{},XEe),Q.bl=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolving`,651),q(1363,651,{},QEe),Q.tk=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingUnsettable`,1363),q(789,651,{},pje),Q.Mj=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverse`,789),q(1364,789,{},vje),Q.tk=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverseUnsettable`,1364),q(1357,410,{},$Ee),Q.tk=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectUnsettable`,1357),q(786,410,{},mje),Q.Mj=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverse`,786),q(1358,786,{},yje),Q.tk=function(){return!0},L(KH,`EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverseUnsettable`,1358),q(790,576,eW,Mh),Q.yl=function(e){return new Mh(this.a,this.c,e)},Q.md=function(){return this.b},Q.zl=function(e,t,n){return UWe(this,e,this.b,n)},Q.Al=function(e,t,n){return WWe(this,e,this.b,n)},L(KH,`EStructuralFeatureImpl/InverseUpdatingFeatureMapEntry`,790),q(1365,1,LU,Ghe),Q.Fk=function(e){return this.a},Q.Qj=function(){return j(this.a,97)?P(this.a,97).Qj():!this.a.dc()},Q.Wb=function(e){this.a.$b(),this.a.Gc(P(e,15))},Q.Gk=function(){j(this.a,97)?P(this.a,97).Gk():this.a.$b()},L(KH,`EStructuralFeatureImpl/SettingMany`,1365),q(1366,576,eW,gHe),Q.xl=function(e){return new Gd((UN(),k9),this.b.ri(this.a,e))},Q.md=function(){return null},Q.zl=function(e,t,n){return n},Q.Al=function(e,t,n){return n},L(KH,`EStructuralFeatureImpl/SimpleContentFeatureMapEntry`,1366),q(652,576,eW,Gd),Q.xl=function(e){return new Gd(this.c,e)},Q.md=function(){return this.a},Q.zl=function(e,t,n){return n},Q.Al=function(e,t,n){return n},L(KH,`EStructuralFeatureImpl/SimpleFeatureMapEntry`,652),q(403,506,SU,ln),Q.aj=function(e){return V(D7,FP,29,e,0,1)},Q.Yi=function(){return!1},L(KH,`ESuperAdapter/1`,403),q(457,448,{110:1,94:1,93:1,155:1,197:1,58:1,114:1,850:1,54:1,99:1,158:1,457:1,119:1,120:1},un),Q.Lh=function(e,t,n){var r;switch(e){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),this.Ab;case 1:return this.zb;case 2:return!this.a&&(this.a=new Vp(this,j7,this)),this.a}return xb(this,e-bh((CP(),e9)),_x((r=P(NC(this,16),29),r||e9),e),t,n)},Q.Uh=function(e,t,n){var r,i;switch(t){case 0:return!this.Ab&&(this.Ab=new F(S7,this,0,3)),AO(this.Ab,e,n);case 2:return!this.a&&(this.a=new Vp(this,j7,this)),AO(this.a,e,n)}return i=P(_x((r=P(NC(this,16),29),r||(CP(),e9)),t),69),i.wk().Ak(this,WD(this),t-bh((CP(),e9)),e,n)},Q.Wh=function(e){var t;switch(e){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!!this.a&&this.a.i!=0}return Hv(this,e-bh((CP(),e9)),_x((t=P(NC(this,16),29),t||e9),e))},Q.bi=function(e,t){var n;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab),!this.Ab&&(this.Ab=new F(S7,this,0,3)),th(this.Ab,P(t,16));return;case 1:GS(this,kd(t));return;case 2:!this.a&&(this.a=new Vp(this,j7,this)),RN(this.a),!this.a&&(this.a=new Vp(this,j7,this)),th(this.a,P(t,16));return}LE(this,e-bh((CP(),e9)),_x((n=P(NC(this,16),29),n||e9),e),t)},Q.ii=function(){return CP(),e9},Q.ki=function(e){var t;switch(e){case 0:!this.Ab&&(this.Ab=new F(S7,this,0,3)),RN(this.Ab);return;case 1:GS(this,null);return;case 2:!this.a&&(this.a=new Vp(this,j7,this)),RN(this.a);return}PT(this,e-bh((CP(),e9)),_x((t=P(NC(this,16),29),t||e9),e))},L(KH,`ETypeParameterImpl`,457),q(458,83,JU,Vp),Q.Nj=function(e,t){return g7e(this,P(e,89),t)},Q.Oj=function(e,t){return _7e(this,P(e,89),t)},L(KH,`ETypeParameterImpl/1`,458),q(647,45,CI,ui),Q.ec=function(){return new Sr(this)},L(KH,`ETypeParameterImpl/2`,647),q(570,GP,KP,Sr),Q.Fc=function(e){return mOe(this,P(e,89))},Q.Gc=function(e){var t,n,r=!1;for(n=e.Kc();n.Ob();)t=P(n.Pb(),89),Qh(this.a,t,``)??(r=!0);return r},Q.$b=function(){Pm(this.a)},Q.Hc=function(e){return km(this.a,e)},Q.Kc=function(){var e;return e=new EC(new Fn(this.a).a),new Cr(e)},Q.Mc=function(e){return iWe(this,e)},Q.gc=function(){return ho(this.a)},L(KH,`ETypeParameterImpl/2/1`,570),q(571,1,VP,Cr),Q.Nb=function(e){Om(this,e)},Q.Pb=function(){return P(MS(this.a).ld(),89)},Q.Ob=function(){return this.a.b},Q.Qb=function(){aKe(this.a)},L(KH,`ETypeParameterImpl/2/1/1`,571),q(1329,45,CI,h_e),Q._b=function(e){return rl(e)?e_(this,e):!!Kp(this.f,e)},Q.xc=function(e){var t=rl(e)?v_(this,e):nl(Kp(this.f,e)),n;return j(t,851)?(n=P(t,851),t=n.Kk(),Qh(this,P(e,241),t),t):t??(e==null?(Zo(),yHt):null)},L(KH,`EValidatorRegistryImpl`,1329),q(1349,720,{110:1,94:1,93:1,480:1,155:1,58:1,114:1,2040:1,54:1,99:1,158:1,119:1,120:1},ace),Q.ri=function(e,t){switch(e.hk()){case 21:case 22:case 23:case 24:case 26:case 31:case 32:case 37:case 38:case 39:case 40:case 43:case 44:case 48:case 49:case 20:return t==null?null:PE(t);case 25:return Cqe(t);case 27:return BGe(t);case 28:return VGe(t);case 29:return t==null?null:Nwe(t7[0],P(t,206));case 41:return t==null?``:Ha(P(t,297));case 42:return PE(t);case 50:return kd(t);default:throw E(new Fi(YH+e.xe()+XH))}},Q.si=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;switch(e.G==-1&&(e.G=(f=Mx(e),f?NO(f.vi(),e):-1)),e.G){case 0:return n=new oi,n;case 1:return t=new Vse,t;case 2:return r=new Que,r;case 4:return i=new Ur,i;case 5:return a=new m_e,a;case 6:return o=new wge,o;case 7:return s=new $ue,s;case 10:return l=new sn,l;case 11:return u=new si,u;case 12:return d=new IIe,d;case 13:return p=new li,p;case 14:return m=new uDe,m;case 17:return h=new Yse,h;case 18:return c=new kr,c;case 19:return g=new un,g;default:throw E(new Fi($H+e.zb+XH))}},Q.ti=function(e,t){switch(e.hk()){case 20:return t==null?null:new xye(t);case 21:return t==null?null:new ru(t);case 23:case 22:return t==null?null:X0e(t);case 26:case 24:return t==null?null:Gb(GM(t,-128,127)<<24>>24);case 25:return Rit(t);case 27:return G3e(t);case 28:return K3e(t);case 29:return q7e(t);case 32:case 31:return t==null?null:OA(t);case 38:case 37:return t==null?null:new jge(t);case 40:case 39:return t==null?null:G(GM(t,xF,AP));case 41:return null;case 42:return null;case 44:case 43:return t==null?null:JD(aP(t));case 49:case 48:return t==null?null:xT(GM(t,aW,32767)<<16>>16);case 50:return t;default:throw E(new Fi(YH+e.xe()+XH))}},L(KH,`EcoreFactoryImpl`,1349),q(560,184,{110:1,94:1,93:1,155:1,197:1,58:1,241:1,114:1,2038:1,54:1,99:1,158:1,184:1,560:1,119:1,120:1,690:1},MFe),Q.gb=!1,Q.hb=!1;var fHt,pHt=!1;L(KH,`EcorePackageImpl`,560),q(1234,1,{851:1},oce),Q.Kk=function(){return xTe(),bHt},L(KH,`EcorePackageImpl/1`,1234),q(1243,1,lW,sce),Q.fk=function(e){return j(e,155)},Q.gk=function(e){return V(G5,FP,155,e,0,1)},L(KH,`EcorePackageImpl/10`,1243),q(1244,1,lW,cce),Q.fk=function(e){return j(e,197)},Q.gk=function(e){return V(q5,FP,197,e,0,1)},L(KH,`EcorePackageImpl/11`,1244),q(1245,1,lW,lce),Q.fk=function(e){return j(e,58)},Q.gk=function(e){return V(L5,FP,58,e,0,1)},L(KH,`EcorePackageImpl/12`,1245),q(1246,1,lW,uce),Q.fk=function(e){return j(e,411)},Q.gk=function(e){return V(M7,Cwt,62,e,0,1)},L(KH,`EcorePackageImpl/13`,1246),q(1247,1,lW,dce),Q.fk=function(e){return j(e,241)},Q.gk=function(e){return V(J5,FP,241,e,0,1)},L(KH,`EcorePackageImpl/14`,1247),q(1248,1,lW,fce),Q.fk=function(e){return j(e,518)},Q.gk=function(e){return V(P7,FP,2116,e,0,1)},L(KH,`EcorePackageImpl/15`,1248),q(1249,1,lW,pce),Q.fk=function(e){return j(e,102)},Q.gk=function(e){return V(F7,qU,19,e,0,1)},L(KH,`EcorePackageImpl/16`,1249),q(1250,1,lW,mce),Q.fk=function(e){return j(e,179)},Q.gk=function(e){return V(w7,qU,179,e,0,1)},L(KH,`EcorePackageImpl/17`,1250),q(1251,1,lW,hce),Q.fk=function(e){return j(e,481)},Q.gk=function(e){return V(C7,FP,481,e,0,1)},L(KH,`EcorePackageImpl/18`,1251),q(1252,1,lW,gce),Q.fk=function(e){return j(e,561)},Q.gk=function(e){return V(o9,owt,561,e,0,1)},L(KH,`EcorePackageImpl/19`,1252),q(1235,1,lW,_ce),Q.fk=function(e){return j(e,331)},Q.gk=function(e){return V(T7,qU,35,e,0,1)},L(KH,`EcorePackageImpl/2`,1235),q(1253,1,lW,vce),Q.fk=function(e){return j(e,248)},Q.gk=function(e){return V(j7,Twt,89,e,0,1)},L(KH,`EcorePackageImpl/20`,1253),q(1254,1,lW,yce),Q.fk=function(e){return j(e,457)},Q.gk=function(e){return V(I7,FP,850,e,0,1)},L(KH,`EcorePackageImpl/21`,1254),q(1255,1,lW,bce),Q.fk=function(e){return il(e)},Q.gk=function(e){return V(bG,X,485,e,8,1)},L(KH,`EcorePackageImpl/22`,1255),q(1256,1,lW,xce),Q.fk=function(e){return j(e,195)},Q.gk=function(e){return V(X9,X,195,e,0,2)},L(KH,`EcorePackageImpl/23`,1256),q(1257,1,lW,Sce),Q.fk=function(e){return j(e,222)},Q.gk=function(e){return V(xG,X,222,e,0,1)},L(KH,`EcorePackageImpl/24`,1257),q(1258,1,lW,Cce),Q.fk=function(e){return j(e,180)},Q.gk=function(e){return V(CG,X,180,e,0,1)},L(KH,`EcorePackageImpl/25`,1258),q(1259,1,lW,wce),Q.fk=function(e){return j(e,206)},Q.gk=function(e){return V(fG,X,206,e,0,1)},L(KH,`EcorePackageImpl/26`,1259),q(1260,1,lW,Tce),Q.fk=function(e){return!1},Q.gk=function(e){return V(dUt,FP,2215,e,0,1)},L(KH,`EcorePackageImpl/27`,1260),q(1261,1,lW,Ece),Q.fk=function(e){return al(e)},Q.gk=function(e){return V(TG,X,345,e,7,1)},L(KH,`EcorePackageImpl/28`,1261),q(1262,1,lW,Dce),Q.fk=function(e){return j(e,61)},Q.gk=function(e){return V(xVt,BL,61,e,0,1)},L(KH,`EcorePackageImpl/29`,1262),q(1236,1,lW,Oce),Q.fk=function(e){return j(e,519)},Q.gk=function(e){return V(S7,{3:1,4:1,5:1,2033:1},598,e,0,1)},L(KH,`EcorePackageImpl/3`,1236),q(1263,1,lW,kce),Q.fk=function(e){return j(e,582)},Q.gk=function(e){return V(DVt,FP,2039,e,0,1)},L(KH,`EcorePackageImpl/30`,1263),q(1264,1,lW,Ace),Q.fk=function(e){return j(e,160)},Q.gk=function(e){return V(vHt,BL,160,e,0,1)},L(KH,`EcorePackageImpl/31`,1264),q(1265,1,lW,jce),Q.fk=function(e){return j(e,76)},Q.gk=function(e){return V(t9,Iwt,76,e,0,1)},L(KH,`EcorePackageImpl/32`,1265),q(1266,1,lW,Mce),Q.fk=function(e){return j(e,161)},Q.gk=function(e){return V(EG,X,161,e,0,1)},L(KH,`EcorePackageImpl/33`,1266),q(1267,1,lW,Nce),Q.fk=function(e){return j(e,17)},Q.gk=function(e){return V(DG,X,17,e,0,1)},L(KH,`EcorePackageImpl/34`,1267),q(1268,1,lW,Pce),Q.fk=function(e){return j(e,297)},Q.gk=function(e){return V(DTt,FP,297,e,0,1)},L(KH,`EcorePackageImpl/35`,1268),q(1269,1,lW,Fce),Q.fk=function(e){return j(e,168)},Q.gk=function(e){return V(kG,X,168,e,0,1)},L(KH,`EcorePackageImpl/36`,1269),q(1270,1,lW,Ice),Q.fk=function(e){return j(e,85)},Q.gk=function(e){return V(kTt,FP,85,e,0,1)},L(KH,`EcorePackageImpl/37`,1270),q(1271,1,lW,Lce),Q.fk=function(e){return j(e,599)},Q.gk=function(e){return V(mHt,FP,599,e,0,1)},L(KH,`EcorePackageImpl/38`,1271),q(1272,1,lW,Rce),Q.fk=function(e){return!1},Q.gk=function(e){return V(fUt,FP,2216,e,0,1)},L(KH,`EcorePackageImpl/39`,1272),q(1237,1,lW,zce),Q.fk=function(e){return j(e,90)},Q.gk=function(e){return V(D7,FP,29,e,0,1)},L(KH,`EcorePackageImpl/4`,1237),q(1273,1,lW,Bce),Q.fk=function(e){return j(e,191)},Q.gk=function(e){return V(PG,X,191,e,0,1)},L(KH,`EcorePackageImpl/40`,1273),q(1274,1,lW,Vce),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(KH,`EcorePackageImpl/41`,1274),q(1275,1,lW,Hce),Q.fk=function(e){return j(e,596)},Q.gk=function(e){return V(CVt,FP,596,e,0,1)},L(KH,`EcorePackageImpl/42`,1275),q(1276,1,lW,Uce),Q.fk=function(e){return!1},Q.gk=function(e){return V(pUt,X,2217,e,0,1)},L(KH,`EcorePackageImpl/43`,1276),q(1277,1,lW,Wce),Q.fk=function(e){return j(e,44)},Q.gk=function(e){return V(YW,oF,44,e,0,1)},L(KH,`EcorePackageImpl/44`,1277),q(1238,1,lW,Gce),Q.fk=function(e){return j(e,142)},Q.gk=function(e){return V(E7,FP,142,e,0,1)},L(KH,`EcorePackageImpl/5`,1238),q(1239,1,lW,Kce),Q.fk=function(e){return j(e,156)},Q.gk=function(e){return V(O7,FP,156,e,0,1)},L(KH,`EcorePackageImpl/6`,1239),q(1240,1,lW,qce),Q.fk=function(e){return j(e,469)},Q.gk=function(e){return V(k7,FP,685,e,0,1)},L(KH,`EcorePackageImpl/7`,1240),q(1241,1,lW,Jce),Q.fk=function(e){return j(e,582)},Q.gk=function(e){return V(A7,FP,694,e,0,1)},L(KH,`EcorePackageImpl/8`,1241),q(1242,1,lW,Yce),Q.fk=function(e){return j(e,480)},Q.gk=function(e){return V(K5,FP,480,e,0,1)},L(KH,`EcorePackageImpl/9`,1242),q(1038,2080,iwt,K_e),Q.Mi=function(e,t){B$e(this,P(t,424))},Q.Qi=function(e,t){ntt(this,e,P(t,424))},L(KH,`MinimalEObjectImpl/1ArrayDelegatingAdapterList`,1038),q(1039,152,NU,cFe),Q.jj=function(){return this.a.a},L(KH,`MinimalEObjectImpl/1ArrayDelegatingAdapterList/1`,1039),q(1067,1066,{},uwe),L(`org.eclipse.emf.ecore.plugin`,`EcorePlugin`,1067);var mHt=gp(Lwt,`Resource`);q(799,1524,Rwt),Q.Hl=function(e){},Q.Il=function(e){},Q.El=function(){return!this.a&&(this.a=new wr(this)),this.a},Q.Fl=function(e){var t,n,r=e.length,i,a;if(r>0){if(sv(0,e.length),e.charCodeAt(0)==47){for(a=new Hy(4),i=1,t=1;t0&&(e=(Zy(0,n,e.length),e.substr(0,n))))}return hnt(this,e)},Q.Gl=function(){return this.c},Q.Ib=function(){var e;return Ha(this.Rm)+`@`+(e=US(this)>>>0,e.toString(16))+` uri='`+this.d+`'`},Q.b=!1,L(uW,`ResourceImpl`,799),q(1525,799,Rwt,qhe),L(uW,`BinaryResourceImpl`,1525),q(1190,708,CU),Q.bj=function(e){return j(e,58)?rLe(this,P(e,58)):j(e,599)?new Lu(P(e,599).El()):A(e)===A(this.f)?P(e,16).Kc():(Nd(),_7.a)},Q.Ob=function(){return ert(this)},Q.a=!1,L(IU,`EcoreUtil/ContentTreeIterator`,1190),q(1526,1190,CU,sPe),Q.bj=function(e){return A(e)===A(this.f)?P(e,15).Kc():new aVe(P(e,58))},L(uW,`ResourceImpl/5`,1526),q(658,2092,wwt,wr),Q.Hc=function(e){return this.i<=4?Uk(this,e):j(e,54)&&P(e,54).Jh()==this.a},Q.Mi=function(e,t){e==this.i-1&&(this.a.b||(this.a.b=!0))},Q.Oi=function(e,t){e==0?this.a.b||(this.a.b=!0):Xy(this,e,t)},Q.Qi=function(e,t){},Q.Ri=function(e,t,n){},Q.Lj=function(){return 2},Q.jj=function(){return this.a},Q.Mj=function(){return!0},Q.Nj=function(e,t){return t=P(e,54).fi(this.a,t),t},Q.Oj=function(e,t){return P(e,54).fi(null,t)},Q.Pj=function(){return!1},Q.Si=function(){return!0},Q.aj=function(e){return V(L5,FP,58,e,0,1)},Q.Yi=function(){return!1},L(uW,`ResourceImpl/ContentsEList`,658),q(970,2062,gF,Jhe),Q.fd=function(e){return this.a.Ki(e)},Q.gc=function(){return this.a.gc()},L(IU,`AbstractSequentialInternalEList/1`,970);var hHt,gHt,l9,_Ht;q(634,1,{},tMe);var u9,d9;L(IU,`BasicExtendedMetaData`,634),q(1181,1,{},QSe),Q.Jl=function(){return null},Q.Kl=function(){return this.a==-2&&sfe(this,F7e(this.d,this.b)),this.a},Q.Ll=function(){return null},Q.Ml=function(){return Vg(),Vg(),QG},Q.xe=function(){return this.c==SW&&cfe(this,f2e(this.d,this.b)),this.c},Q.Nl=function(){return 0},Q.a=-2,Q.c=SW,L(IU,`BasicExtendedMetaData/EClassExtendedMetaDataImpl`,1181),q(1182,1,{},dBe),Q.Jl=function(){return this.a==(By(),u9)&&dfe(this,olt(this.f,this.b)),this.a},Q.Kl=function(){return 0},Q.Ll=function(){return this.c==(By(),u9)&&lfe(this,slt(this.f,this.b)),this.c},Q.Ml=function(){return!this.d&&pfe(this,rft(this.f,this.b)),this.d},Q.xe=function(){return this.e==SW&&hfe(this,f2e(this.f,this.b)),this.e},Q.Nl=function(){return this.g==-2&&_fe(this,R5e(this.f,this.b)),this.g},Q.e=SW,Q.g=-2,L(IU,`BasicExtendedMetaData/EDataTypeExtendedMetaDataImpl`,1182),q(1180,1,{},$Se),Q.b=!1,Q.c=!1,L(IU,`BasicExtendedMetaData/EPackageExtendedMetaDataImpl`,1180),q(1183,1,{},fBe),Q.c=-2,Q.e=SW,Q.f=SW,L(IU,`BasicExtendedMetaData/EStructuralFeatureExtendedMetaDataImpl`,1183),q(593,632,JU,ip),Q.Lj=function(){return this.c},Q.ol=function(){return!1},Q.Wi=function(e,t){return t},Q.c=0,L(IU,`EDataTypeEList`,593);var vHt=gp(IU,`FeatureMap`);q(78,593,{3:1,4:1,20:1,31:1,56:1,16:1,15:1,59:1,70:1,66:1,61:1,79:1,160:1,220:1,2036:1,71:1,97:1},DC),Q.bd=function(e,t){got(this,e,P(t,76))},Q.Fc=function(e){return xat(this,P(e,76))},Q.Hi=function(e){UPe(this,P(e,76))},Q.Nj=function(e,t){return qOe(this,P(e,76),t)},Q.Oj=function(e,t){return JOe(this,P(e,76),t)},Q.Ti=function(e,t){return Dut(this,e,t)},Q.Wi=function(e,t){return Umt(this,e,P(t,76))},Q.hd=function(e,t){return xst(this,e,P(t,76))},Q.Uj=function(e,t){return YOe(this,P(e,76),t)},Q.Vj=function(e,t){return XOe(this,P(e,76),t)},Q.Wj=function(e,t,n){return f5e(this,P(e,76),P(t,76),n)},Q.Zi=function(e,t){return aA(this,e,P(t,76))},Q.Ol=function(e,t){return cut(this,e,t)},Q.cd=function(e,t){var n,r,i,a,o,s,c,l=new kx(t.gc()),u;for(i=t.Kc();i.Ob();)if(r=P(i.Pb(),76),a=r.Lk(),aM(this.e,a))(!a.Si()||!Kv(this,a,r.md())&&!Uk(l,r))&&tb(l,r);else{for(u=nM(this.e.Dh(),a),n=P(this.g,124),o=!0,s=0;s=0;)if(t=e[this.c],this.k.am(t.Lk()))return this.j=this.f?t:t.md(),this.i=-2,!0;return this.i=-1,this.g=-1,!1},L(IU,`BasicFeatureMap/FeatureEIterator`,420),q(676,420,YP,Dl),Q.ul=function(){return!0},L(IU,`BasicFeatureMap/ResolvingFeatureEIterator`,676),q(968,496,QU,zwe),Q.pj=function(){return this},L(IU,`EContentsEList/1`,968),q(969,496,QU,mCe),Q.ul=function(){return!1},L(IU,`EContentsEList/2`,969),q(967,287,$U,Bwe),Q.wl=function(e){},Q.Ob=function(){return!1},Q.Sb=function(){return!1},L(IU,`EContentsEList/FeatureIteratorImpl/1`,967),q(840,593,JU,uTe),Q.Ni=function(){this.a=!0},Q.Qj=function(){return this.a},Q.Gk=function(){var e;RN(this),Gl(this.e)?(e=this.a,this.a=!1,AC(this.e,new vy(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(IU,`EDataTypeEList/Unsettable`,840),q(1958,593,JU,dTe),Q.Si=function(){return!0},L(IU,`EDataTypeUniqueEList`,1958),q(1959,840,JU,fTe),Q.Si=function(){return!0},L(IU,`EDataTypeUniqueEList/Unsettable`,1959),q(147,83,JU,Nu),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectContainmentEList/Resolving`,147),q(1184,555,JU,pTe),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectContainmentEList/Unsettable/Resolving`,1184),q(766,14,JU,rf),Q.Ni=function(){this.a=!0},Q.Qj=function(){return this.a},Q.Gk=function(){var e;RN(this),Gl(this.e)?(e=this.a,this.a=!1,AC(this.e,new vy(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(IU,`EObjectContainmentWithInverseEList/Unsettable`,766),q(1222,766,JU,yOe),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectContainmentWithInverseEList/Unsettable/Resolving`,1222),q(757,505,JU,mTe),Q.Ni=function(){this.a=!0},Q.Qj=function(){return this.a},Q.Gk=function(){var e;RN(this),Gl(this.e)?(e=this.a,this.a=!1,AC(this.e,new vy(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(IU,`EObjectEList/Unsettable`,757),q(338,505,JU,Pu),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectResolvingEList`,338),q(1844,757,JU,hTe),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectResolvingEList/Unsettable`,1844),q(1527,1,{},Xce);var yHt;L(IU,`EObjectValidator`,1527),q(559,505,JU,wm),Q.il=function(){return this.d},Q.jl=function(){return this.b},Q.Mj=function(){return!0},Q.ml=function(){return!0},Q.b=0,L(IU,`EObjectWithInverseEList`,559),q(1225,559,JU,bOe),Q.ll=function(){return!0},L(IU,`EObjectWithInverseEList/ManyInverse`,1225),q(635,559,JU,af),Q.Ni=function(){this.a=!0},Q.Qj=function(){return this.a},Q.Gk=function(){var e;RN(this),Gl(this.e)?(e=this.a,this.a=!1,AC(this.e,new vy(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(IU,`EObjectWithInverseEList/Unsettable`,635),q(1224,635,JU,xOe),Q.ll=function(){return!0},L(IU,`EObjectWithInverseEList/Unsettable/ManyInverse`,1224),q(767,559,JU,of),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectWithInverseResolvingEList`,767),q(32,767,JU,cf),Q.ll=function(){return!0},L(IU,`EObjectWithInverseResolvingEList/ManyInverse`,32),q(768,635,JU,sf),Q.nl=function(){return!0},Q.Wi=function(e,t){return vj(this,e,P(t,58))},L(IU,`EObjectWithInverseResolvingEList/Unsettable`,768),q(1223,768,JU,SOe),Q.ll=function(){return!0},L(IU,`EObjectWithInverseResolvingEList/Unsettable/ManyInverse`,1223),q(1185,632,JU),Q.Li=function(){return!(this.b&1792)},Q.Ni=function(){this.b|=1},Q.kl=function(){return!!(this.b&4)},Q.Mj=function(){return!!(this.b&40)},Q.ll=function(){return!!(this.b&16)},Q.ml=function(){return!!(this.b&8)},Q.nl=function(){return(this.b&zU)!=0},Q.al=function(){return!!(this.b&32)},Q.ol=function(){return(this.b&pF)!=0},Q.fk=function(e){return this.d?HVe(this.d,e):this.Lk().Hk().fk(e)},Q.Qj=function(){return this.b&2?!!(this.b&1):this.i!=0},Q.Si=function(){return!!(this.b&128)},Q.Gk=function(){var e;RN(this),this.b&2&&(Gl(this.e)?(e=!!(this.b&1),this.b&=-2,Kr(this,new vy(this.e,2,eD(this.e.Dh(),this.Lk()),e,!1))):this.b&=-2)},Q.Yi=function(){return!(this.b&1536)},Q.b=0,L(IU,`EcoreEList/Generic`,1185),q(1186,1185,JU,BIe),Q.Lk=function(){return this.a},L(IU,`EcoreEList/Dynamic`,1186),q(765,66,SU,Yhe),Q.aj=function(e){return tS(this.a.a,e)},L(IU,`EcoreEMap/1`,765),q(764,83,JU,dPe),Q.Mi=function(e,t){JO(this.b,P(t,136))},Q.Oi=function(e,t){sXe(this.b)},Q.Pi=function(e,t,n){var r;++(r=this.b,P(t,136),r).e},Q.Qi=function(e,t){$T(this.b,P(t,136))},Q.Ri=function(e,t,n){$T(this.b,P(n,136)),A(n)===A(t)&&P(n,136).Ci(swe(P(t,136).ld())),JO(this.b,P(t,136))},L(IU,`EcoreEMap/DelegateEObjectContainmentEList`,764),q(1220,141,bwt,TJe),L(IU,`EcoreEMap/Unsettable`,1220),q(1221,764,JU,COe),Q.Ni=function(){this.a=!0},Q.Qj=function(){return this.a},Q.Gk=function(){var e;RN(this),Gl(this.e)?(e=this.a,this.a=!1,AC(this.e,new vy(this.e,2,this.c,e,!1))):this.a=!1},Q.a=!1,L(IU,`EcoreEMap/Unsettable/UnsettableDelegateEObjectContainmentEList`,1221),q(1189,215,CI,GPe),Q.a=!1,Q.b=!1,L(IU,`EcoreUtil/Copier`,1189),q(759,1,VP,aVe),Q.Nb=function(e){Om(this,e)},Q.Ob=function(){return M0e(this)},Q.Pb=function(){var e;return M0e(this),e=this.b,this.b=null,e},Q.Qb=function(){this.a.Qb()},L(IU,`EcoreUtil/ProperContentIterator`,759),q(1528,1527,{},ede);var bHt;L(IU,`EcoreValidator`,1528);var xHt;gp(IU,`FeatureMapUtil/Validator`),q(1295,1,{2041:1},Zce),Q.am=function(e){return!0},L(IU,`FeatureMapUtil/1`,1295),q(773,1,{2041:1},Egt),Q.am=function(e){var t;return this.c==e||(t=Od(xh(this.a,e)),t==null?_lt(this,e)?(PUe(this.a,e,(rd(),yG)),!0):(PUe(this.a,e,(rd(),vG)),!1):t==(rd(),yG))},Q.e=!1;var f9;L(IU,`FeatureMapUtil/BasicValidator`,773),q(774,45,CI,Rwe),L(IU,`FeatureMapUtil/BasicValidator/Cache`,774),q(509,56,{20:1,31:1,56:1,16:1,15:1,61:1,79:1,71:1,97:1},Qc),Q.bd=function(e,t){Mst(this.c,this.b,e,t)},Q.Fc=function(e){return cut(this.c,this.b,e)},Q.cd=function(e,t){return vpt(this.c,this.b,e,t)},Q.Gc=function(e){return Su(this,e)},Q.Gi=function(e,t){$Ke(this.c,this.b,e,t)},Q.Wk=function(e,t){return plt(this.c,this.b,e,t)},Q.$i=function(e){return CN(this.c,this.b,e,!1)},Q.Ii=function(){return BCe(this.c,this.b)},Q.Ji=function(){return VCe(this.c,this.b)},Q.Ki=function(e){return GWe(this.c,this.b,e)},Q.Xk=function(e,t){return NDe(this,e,t)},Q.$b=function(){qr(this)},Q.Hc=function(e){return Kv(this.c,this.b,e)},Q.Ic=function(e){return MYe(this.c,this.b,e)},Q.Xb=function(e){return CN(this.c,this.b,e,!0)},Q.Fk=function(e){return this},Q.dd=function(e){return cHe(this.c,this.b,e)},Q.dc=function(){return tl(this)},Q.Qj=function(){return!lD(this.c,this.b)},Q.Kc=function(){return SKe(this.c,this.b)},Q.ed=function(){return CKe(this.c,this.b)},Q.fd=function(e){return p1e(this.c,this.b,e)},Q.Ti=function(e,t){return Ndt(this.c,this.b,e,t)},Q.Ui=function(e,t){XWe(this.c,this.b,e,t)},Q.gd=function(e){return _et(this.c,this.b,e)},Q.Mc=function(e){return eut(this.c,this.b,e)},Q.hd=function(e,t){return sft(this.c,this.b,e,t)},Q.Wb=function(e){_j(this.c,this.b),Su(this,P(e,15))},Q.gc=function(){return f1e(this.c,this.b)},Q.Pc=function(){return mBe(this.c,this.b)},Q.Qc=function(e){return lHe(this.c,this.b,e)},Q.Ib=function(){var e,t=new $i;for(t.a+=`[`,e=BCe(this.c,this.b);Uw(e);)pl(t,Uu(MO(e))),Uw(e)&&(t.a+=PP);return t.a+=`]`,t.a},Q.Gk=function(){_j(this.c,this.b)},L(IU,`FeatureMapUtil/FeatureEList`,509),q(644,39,NU,ey),Q.hj=function(e){return BT(this,e)},Q.mj=function(e){var t,n,r,i,a,o,s;switch(this.d){case 1:case 2:if(a=e.jj(),A(a)===A(this.c)&&BT(this,null)==e.hj(null))return this.g=e.ij(),e.gj()==1&&(this.d=1),!0;break;case 3:if(i=e.gj(),i===3&&(a=e.jj(),A(a)===A(this.c)&&BT(this,null)==e.hj(null)))return this.d=5,t=new kx(2),tb(t,this.g),tb(t,e.ij()),this.g=t,!0;break;case 5:if(i=e.gj(),i===3&&(a=e.jj(),A(a)===A(this.c)&&BT(this,null)==e.hj(null)))return n=P(this.g,16),n.Fc(e.ij()),!0;break;case 4:switch(i=e.gj(),i){case 3:if(a=e.jj(),A(a)===A(this.c)&&BT(this,null)==e.hj(null))return this.d=1,this.g=e.ij(),!0;break;case 4:if(a=e.jj(),A(a)===A(this.c)&&BT(this,null)==e.hj(null))return this.d=6,s=new kx(2),tb(s,this.n),tb(s,e.kj()),this.n=s,o=U(O(q9,1),HF,28,15,[this.o,e.lj()]),this.g=o,!0}break;case 6:if(i=e.gj(),i===4&&(a=e.jj(),A(a)===A(this.c)&&BT(this,null)==e.hj(null)))return n=P(this.n,16),n.Fc(e.kj()),o=P(this.g,53),r=V(q9,HF,28,o.length+1,15,1),tN(o,0,r,0,o.length),r[o.length]=e.lj(),this.g=r,!0}return!1},L(IU,`FeatureMapUtil/FeatureENotificationImpl`,644),q(564,509,{20:1,31:1,56:1,16:1,15:1,61:1,79:1,160:1,220:1,2036:1,71:1,97:1},hp),Q.Ol=function(e,t){return cut(this.c,e,t)},Q.Pl=function(e,t,n){return plt(this.c,e,t,n)},Q.Ql=function(e,t,n){return Xft(this.c,e,t,n)},Q.Rl=function(){return this},Q.Sl=function(e,t){return SN(this.c,e,t)},Q.Tl=function(e){return P(CN(this.c,this.b,e,!1),76).Lk()},Q.Ul=function(e){return P(CN(this.c,this.b,e,!1),76).md()},Q.Vl=function(){return this.a},Q.Wl=function(e){return!lD(this.c,e)},Q.Xl=function(e,t){ON(this.c,e,t)},Q.Yl=function(e){return LJe(this.c,e)},Q.Zl=function(e){v3e(this.c,e)},L(IU,`FeatureMapUtil/FeatureFeatureMap`,564),q(1294,1,LU,ZSe),Q.Fk=function(e){return CN(this.b,this.a,-1,e)},Q.Qj=function(){return!lD(this.b,this.a)},Q.Wb=function(e){ON(this.b,this.a,e)},Q.Gk=function(){_j(this.b,this.a)},L(IU,`FeatureMapUtil/FeatureValue`,1294);var p9,m9,h9,g9,SHt,_9=gp(wW,`AnyType`);q(680,63,SF,Hi),L(wW,`InvalidDatatypeValueException`,680);var v9=gp(wW,Hwt),y9=gp(wW,Uwt),CHt=gp(wW,Wwt),wHt,b9,THt,x9,EHt,DHt,OHt,kHt,AHt,jHt,MHt,NHt,PHt,FHt,IHt,S9,LHt,C9,w9,RHt,T9,E9,D9,zHt,O9,k9;q(844,516,{110:1,94:1,93:1,58:1,54:1,99:1,857:1},g_e),Q.Lh=function(e,t,n){switch(e){case 0:return n?(!this.c&&(this.c=new DC(this,0)),this.c):(!this.c&&(this.c=new DC(this,0)),this.c.b);case 1:return n?(!this.c&&(this.c=new DC(this,0)),P(Z_(this.c,(UN(),x9)),160)):(!this.c&&(this.c=new DC(this,0)),P(P(Z_(this.c,(UN(),x9)),160),220)).Vl();case 2:return n?(!this.b&&(this.b=new DC(this,2)),this.b):(!this.b&&(this.b=new DC(this,2)),this.b.b)}return xb(this,e-bh(this.ii()),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():this.ii(),e),t,n)},Q.Uh=function(e,t,n){var r;switch(t){case 0:return!this.c&&(this.c=new DC(this,0)),zM(this.c,e,n);case 1:return(!this.c&&(this.c=new DC(this,0)),P(P(Z_(this.c,(UN(),x9)),160),71)).Xk(e,n);case 2:return!this.b&&(this.b=new DC(this,2)),zM(this.b,e,n)}return r=P(_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():this.ii(),t),69),r.wk().Ak(this,Jb(this),t-bh(this.ii()),e,n)},Q.Wh=function(e){switch(e){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new DC(this,0)),P(Z_(this.c,(UN(),x9)),160)).dc();case 2:return!!this.b&&this.b.i!=0}return Hv(this,e-bh(this.ii()),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():this.ii(),e))},Q.bi=function(e,t){switch(e){case 0:!this.c&&(this.c=new DC(this,0)),qm(this.c,t);return;case 1:(!this.c&&(this.c=new DC(this,0)),P(P(Z_(this.c,(UN(),x9)),160),220)).Wb(t);return;case 2:!this.b&&(this.b=new DC(this,2)),qm(this.b,t);return}LE(this,e-bh(this.ii()),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():this.ii(),e),t)},Q.ii=function(){return UN(),THt},Q.ki=function(e){switch(e){case 0:!this.c&&(this.c=new DC(this,0)),RN(this.c);return;case 1:(!this.c&&(this.c=new DC(this,0)),P(Z_(this.c,(UN(),x9)),160)).$b();return;case 2:!this.b&&(this.b=new DC(this,2)),RN(this.b);return}PT(this,e-bh(this.ii()),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():this.ii(),e))},Q.Ib=function(){var e;return this.j&4?Aj(this):(e=new Wu(Aj(this)),e.a+=` (mixed: `,fl(e,this.c),e.a+=`, anyAttribute: `,fl(e,this.b),e.a+=`)`,e.a)},L(TW,`AnyTypeImpl`,844),q(681,516,{110:1,94:1,93:1,58:1,54:1,99:1,2119:1,681:1},cle),Q.Lh=function(e,t,n){switch(e){case 0:return this.a;case 1:return this.b}return xb(this,e-bh((UN(),S9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():S9,e),t,n)},Q.Wh=function(e){switch(e){case 0:return this.a!=null;case 1:return this.b!=null}return Hv(this,e-bh((UN(),S9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():S9,e))},Q.bi=function(e,t){switch(e){case 0:bfe(this,kd(t));return;case 1:Sfe(this,kd(t));return}LE(this,e-bh((UN(),S9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():S9,e),t)},Q.ii=function(){return UN(),S9},Q.ki=function(e){switch(e){case 0:this.a=null;return;case 1:this.b=null;return}PT(this,e-bh((UN(),S9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():S9,e))},Q.Ib=function(){var e;return this.j&4?Aj(this):(e=new Wu(Aj(this)),e.a+=` (data: `,pl(e,this.a),e.a+=`, target: `,pl(e,this.b),e.a+=`)`,e.a)},Q.a=null,Q.b=null,L(TW,`ProcessingInstructionImpl`,681),q(682,844,{110:1,94:1,93:1,58:1,54:1,99:1,857:1,2120:1,682:1},__e),Q.Lh=function(e,t,n){switch(e){case 0:return n?(!this.c&&(this.c=new DC(this,0)),this.c):(!this.c&&(this.c=new DC(this,0)),this.c.b);case 1:return n?(!this.c&&(this.c=new DC(this,0)),P(Z_(this.c,(UN(),x9)),160)):(!this.c&&(this.c=new DC(this,0)),P(P(Z_(this.c,(UN(),x9)),160),220)).Vl();case 2:return n?(!this.b&&(this.b=new DC(this,2)),this.b):(!this.b&&(this.b=new DC(this,2)),this.b.b);case 3:return!this.c&&(this.c=new DC(this,0)),kd(SN(this.c,(UN(),w9),!0));case 4:return df(this.a,(!this.c&&(this.c=new DC(this,0)),kd(SN(this.c,(UN(),w9),!0))));case 5:return this.a}return xb(this,e-bh((UN(),C9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():C9,e),t,n)},Q.Wh=function(e){switch(e){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new DC(this,0)),P(Z_(this.c,(UN(),x9)),160)).dc();case 2:return!!this.b&&this.b.i!=0;case 3:return!this.c&&(this.c=new DC(this,0)),kd(SN(this.c,(UN(),w9),!0))!=null;case 4:return df(this.a,(!this.c&&(this.c=new DC(this,0)),kd(SN(this.c,(UN(),w9),!0))))!=null;case 5:return!!this.a}return Hv(this,e-bh((UN(),C9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():C9,e))},Q.bi=function(e,t){switch(e){case 0:!this.c&&(this.c=new DC(this,0)),qm(this.c,t);return;case 1:(!this.c&&(this.c=new DC(this,0)),P(P(Z_(this.c,(UN(),x9)),160),220)).Wb(t);return;case 2:!this.b&&(this.b=new DC(this,2)),qm(this.b,t);return;case 3:pBe(this,kd(t));return;case 4:pBe(this,uf(this.a,t));return;case 5:xfe(this,P(t,156));return}LE(this,e-bh((UN(),C9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():C9,e),t)},Q.ii=function(){return UN(),C9},Q.ki=function(e){switch(e){case 0:!this.c&&(this.c=new DC(this,0)),RN(this.c);return;case 1:(!this.c&&(this.c=new DC(this,0)),P(Z_(this.c,(UN(),x9)),160)).$b();return;case 2:!this.b&&(this.b=new DC(this,2)),RN(this.b);return;case 3:!this.c&&(this.c=new DC(this,0)),ON(this.c,(UN(),w9),null);return;case 4:pBe(this,uf(this.a,null));return;case 5:this.a=null;return}PT(this,e-bh((UN(),C9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():C9,e))},L(TW,`SimpleAnyTypeImpl`,682),q(683,516,{110:1,94:1,93:1,58:1,54:1,99:1,2121:1,683:1},v_e),Q.Lh=function(e,t,n){switch(e){case 0:return n?(!this.a&&(this.a=new DC(this,0)),this.a):(!this.a&&(this.a=new DC(this,0)),this.a.b);case 1:return n?(!this.b&&(this.b=new lb((CP(),$7),o9,this,1)),this.b):(!this.b&&(this.b=new lb((CP(),$7),o9,this,1)),Jy(this.b));case 2:return n?(!this.c&&(this.c=new lb((CP(),$7),o9,this,2)),this.c):(!this.c&&(this.c=new lb((CP(),$7),o9,this,2)),Jy(this.c));case 3:return!this.a&&(this.a=new DC(this,0)),Z_(this.a,(UN(),E9));case 4:return!this.a&&(this.a=new DC(this,0)),Z_(this.a,(UN(),D9));case 5:return!this.a&&(this.a=new DC(this,0)),Z_(this.a,(UN(),O9));case 6:return!this.a&&(this.a=new DC(this,0)),Z_(this.a,(UN(),k9))}return xb(this,e-bh((UN(),T9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():T9,e),t,n)},Q.Uh=function(e,t,n){var r;switch(t){case 0:return!this.a&&(this.a=new DC(this,0)),zM(this.a,e,n);case 1:return!this.b&&(this.b=new lb((CP(),$7),o9,this,1)),gf(this.b,e,n);case 2:return!this.c&&(this.c=new lb((CP(),$7),o9,this,2)),gf(this.c,e,n);case 5:return!this.a&&(this.a=new DC(this,0)),NDe(Z_(this.a,(UN(),O9)),e,n)}return r=P(_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():(UN(),T9),t),69),r.wk().Ak(this,Jb(this),t-bh((UN(),T9)),e,n)},Q.Wh=function(e){switch(e){case 0:return!!this.a&&this.a.i!=0;case 1:return!!this.b&&this.b.f!=0;case 2:return!!this.c&&this.c.f!=0;case 3:return!this.a&&(this.a=new DC(this,0)),!tl(Z_(this.a,(UN(),E9)));case 4:return!this.a&&(this.a=new DC(this,0)),!tl(Z_(this.a,(UN(),D9)));case 5:return!this.a&&(this.a=new DC(this,0)),!tl(Z_(this.a,(UN(),O9)));case 6:return!this.a&&(this.a=new DC(this,0)),!tl(Z_(this.a,(UN(),k9)))}return Hv(this,e-bh((UN(),T9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():T9,e))},Q.bi=function(e,t){switch(e){case 0:!this.a&&(this.a=new DC(this,0)),qm(this.a,t);return;case 1:!this.b&&(this.b=new lb((CP(),$7),o9,this,1)),bC(this.b,t);return;case 2:!this.c&&(this.c=new lb((CP(),$7),o9,this,2)),bC(this.c,t);return;case 3:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),E9))),!this.a&&(this.a=new DC(this,0)),Su(Z_(this.a,E9),P(t,16));return;case 4:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),D9))),!this.a&&(this.a=new DC(this,0)),Su(Z_(this.a,D9),P(t,16));return;case 5:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),O9))),!this.a&&(this.a=new DC(this,0)),Su(Z_(this.a,O9),P(t,16));return;case 6:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),k9))),!this.a&&(this.a=new DC(this,0)),Su(Z_(this.a,k9),P(t,16));return}LE(this,e-bh((UN(),T9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():T9,e),t)},Q.ii=function(){return UN(),T9},Q.ki=function(e){switch(e){case 0:!this.a&&(this.a=new DC(this,0)),RN(this.a);return;case 1:!this.b&&(this.b=new lb((CP(),$7),o9,this,1)),this.b.c.$b();return;case 2:!this.c&&(this.c=new lb((CP(),$7),o9,this,2)),this.c.c.$b();return;case 3:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),E9)));return;case 4:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),D9)));return;case 5:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),O9)));return;case 6:!this.a&&(this.a=new DC(this,0)),qr(Z_(this.a,(UN(),k9)));return}PT(this,e-bh((UN(),T9)),_x(this.j&2?(!this.k&&(this.k=new fn),this.k).Nk():T9,e))},Q.Ib=function(){var e;return this.j&4?Aj(this):(e=new Wu(Aj(this)),e.a+=` (mixed: `,fl(e,this.a),e.a+=`)`,e.a)},L(TW,`XMLTypeDocumentRootImpl`,683),q(2028,720,{110:1,94:1,93:1,480:1,155:1,58:1,114:1,54:1,99:1,158:1,119:1,120:1,2122:1},Qce),Q.ri=function(e,t){switch(e.hk()){case 7:case 8:case 9:case 10:case 16:case 22:case 23:case 24:case 25:case 26:case 32:case 33:case 34:case 36:case 37:case 44:case 45:case 50:case 51:case 53:case 55:case 56:case 57:case 58:case 60:case 61:case 4:return t==null?null:PE(t);case 19:case 28:case 29:case 35:case 38:case 39:case 41:case 46:case 52:case 54:case 5:return kd(t);case 6:return rDe(P(t,195));case 12:case 47:case 49:case 11:return yht(this,e,t);case 13:return t==null?null:Cpt(P(t,247));case 15:case 14:return t==null?null:LPe(D(N(t)));case 17:return p5e((UN(),t));case 18:return p5e(t);case 21:case 20:return t==null?null:RPe(P(t,161).a);case 27:return iDe(P(t,195));case 30:return y3e((UN(),P(t,15)));case 31:return y3e(P(t,15));case 40:return oDe((UN(),t));case 42:return m5e((UN(),t));case 43:return m5e(t);case 59:case 48:return aDe((UN(),t));default:throw E(new Fi(YH+e.xe()+XH))}},Q.si=function(e){var t,n,r,i,a;switch(e.G==-1&&(e.G=(n=Mx(e),n?NO(n.vi(),e):-1)),e.G){case 0:return t=new g_e,t;case 1:return r=new cle,r;case 2:return i=new __e,i;case 3:return a=new v_e,a;default:throw E(new Fi($H+e.zb+XH))}},Q.ti=function(e,t){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_;switch(e.hk()){case 5:case 52:case 4:return t;case 6:return J2e(t);case 8:case 7:return t==null?null:D5e(t);case 9:return t==null?null:Gb(GM((r=EN(t,!0),r.length>0&&(sv(0,r.length),r.charCodeAt(0)==43)?(sv(1,r.length+1),r.substr(1)):r),-128,127)<<24>>24);case 10:return t==null?null:Gb(GM((i=EN(t,!0),i.length>0&&(sv(0,i.length),i.charCodeAt(0)==43)?(sv(1,i.length+1),i.substr(1)):i),-128,127)<<24>>24);case 11:return kd(uP(this,(UN(),OHt),t));case 12:return kd(uP(this,(UN(),kHt),t));case 13:return t==null?null:new xye(EN(t,!0));case 15:case 14:return Eat(t);case 16:return kd(uP(this,(UN(),AHt),t));case 17:return V0e((UN(),t));case 18:return V0e(t);case 28:case 29:case 35:case 38:case 39:case 41:case 54:case 19:return EN(t,!0);case 21:case 20:return zat(t);case 22:return kd(uP(this,(UN(),jHt),t));case 23:return kd(uP(this,(UN(),MHt),t));case 24:return kd(uP(this,(UN(),NHt),t));case 25:return kd(uP(this,(UN(),PHt),t));case 26:return kd(uP(this,(UN(),FHt),t));case 27:return A2e(t);case 30:return H0e((UN(),t));case 31:return H0e(t);case 32:return t==null?null:G(GM((u=EN(t,!0),u.length>0&&(sv(0,u.length),u.charCodeAt(0)==43)?(sv(1,u.length+1),u.substr(1)):u),xF,AP));case 33:return t==null?null:new ru((d=EN(t,!0),d.length>0&&(sv(0,d.length),d.charCodeAt(0)==43)?(sv(1,d.length+1),d.substr(1)):d));case 34:return t==null?null:G(GM((f=EN(t,!0),f.length>0&&(sv(0,f.length),f.charCodeAt(0)==43)?(sv(1,f.length+1),f.substr(1)):f),xF,AP));case 36:return t==null?null:JD(aP((p=EN(t,!0),p.length>0&&(sv(0,p.length),p.charCodeAt(0)==43)?(sv(1,p.length+1),p.substr(1)):p)));case 37:return t==null?null:JD(aP((m=EN(t,!0),m.length>0&&(sv(0,m.length),m.charCodeAt(0)==43)?(sv(1,m.length+1),m.substr(1)):m)));case 40:return e3e((UN(),t));case 42:return U0e((UN(),t));case 43:return U0e(t);case 44:return t==null?null:new ru((h=EN(t,!0),h.length>0&&(sv(0,h.length),h.charCodeAt(0)==43)?(sv(1,h.length+1),h.substr(1)):h));case 45:return t==null?null:new ru((g=EN(t,!0),g.length>0&&(sv(0,g.length),g.charCodeAt(0)==43)?(sv(1,g.length+1),g.substr(1)):g));case 46:return EN(t,!1);case 47:return kd(uP(this,(UN(),IHt),t));case 59:case 48:return $4e((UN(),t));case 49:return kd(uP(this,(UN(),LHt),t));case 50:return t==null?null:xT(GM((_=EN(t,!0),_.length>0&&(sv(0,_.length),_.charCodeAt(0)==43)?(sv(1,_.length+1),_.substr(1)):_),aW,32767)<<16>>16);case 51:return t==null?null:xT(GM((a=EN(t,!0),a.length>0&&(sv(0,a.length),a.charCodeAt(0)==43)?(sv(1,a.length+1),a.substr(1)):a),aW,32767)<<16>>16);case 53:return kd(uP(this,(UN(),RHt),t));case 55:return t==null?null:xT(GM((o=EN(t,!0),o.length>0&&(sv(0,o.length),o.charCodeAt(0)==43)?(sv(1,o.length+1),o.substr(1)):o),aW,32767)<<16>>16);case 56:return t==null?null:xT(GM((s=EN(t,!0),s.length>0&&(sv(0,s.length),s.charCodeAt(0)==43)?(sv(1,s.length+1),s.substr(1)):s),aW,32767)<<16>>16);case 57:return t==null?null:JD(aP((c=EN(t,!0),c.length>0&&(sv(0,c.length),c.charCodeAt(0)==43)?(sv(1,c.length+1),c.substr(1)):c)));case 58:return t==null?null:JD(aP((l=EN(t,!0),l.length>0&&(sv(0,l.length),l.charCodeAt(0)==43)?(sv(1,l.length+1),l.substr(1)):l)));case 60:return t==null?null:G(GM((n=EN(t,!0),n.length>0&&(sv(0,n.length),n.charCodeAt(0)==43)?(sv(1,n.length+1),n.substr(1)):n),xF,AP));case 61:return t==null?null:G(GM(EN(t,!0),xF,AP));default:throw E(new Fi(YH+e.xe()+XH))}};var BHt,VHt,HHt,UHt;L(TW,`XMLTypeFactoryImpl`,2028),q(594,184,{110:1,94:1,93:1,155:1,197:1,58:1,241:1,114:1,54:1,99:1,158:1,184:1,119:1,120:1,690:1,2044:1,594:1},NFe),Q.N=!1,Q.O=!1;var WHt=!1;L(TW,`XMLTypePackageImpl`,594),q(1961,1,{851:1},$ce),Q.Kk=function(){return Odt(),lUt},L(TW,`XMLTypePackageImpl/1`,1961),q(1970,1,lW,ele),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/10`,1970),q(1971,1,lW,tle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/11`,1971),q(1972,1,lW,nle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/12`,1972),q(1973,1,lW,rle),Q.fk=function(e){return al(e)},Q.gk=function(e){return V(TG,X,345,e,7,1)},L(TW,`XMLTypePackageImpl/13`,1973),q(1974,1,lW,ile),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/14`,1974),q(1975,1,lW,ale),Q.fk=function(e){return j(e,15)},Q.gk=function(e){return V(JW,BL,15,e,0,1)},L(TW,`XMLTypePackageImpl/15`,1975),q(1976,1,lW,ole),Q.fk=function(e){return j(e,15)},Q.gk=function(e){return V(JW,BL,15,e,0,1)},L(TW,`XMLTypePackageImpl/16`,1976),q(1977,1,lW,sle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/17`,1977),q(1978,1,lW,lle),Q.fk=function(e){return j(e,161)},Q.gk=function(e){return V(EG,X,161,e,0,1)},L(TW,`XMLTypePackageImpl/18`,1978),q(1979,1,lW,ule),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/19`,1979),q(1962,1,lW,dle),Q.fk=function(e){return j(e,857)},Q.gk=function(e){return V(_9,FP,857,e,0,1)},L(TW,`XMLTypePackageImpl/2`,1962),q(1980,1,lW,fle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/20`,1980),q(1981,1,lW,ple),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/21`,1981),q(1982,1,lW,mle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/22`,1982),q(1983,1,lW,hle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/23`,1983),q(1984,1,lW,gle),Q.fk=function(e){return j(e,195)},Q.gk=function(e){return V(X9,X,195,e,0,2)},L(TW,`XMLTypePackageImpl/24`,1984),q(1985,1,lW,_le),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/25`,1985),q(1986,1,lW,vle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/26`,1986),q(1987,1,lW,yle),Q.fk=function(e){return j(e,15)},Q.gk=function(e){return V(JW,BL,15,e,0,1)},L(TW,`XMLTypePackageImpl/27`,1987),q(1988,1,lW,ble),Q.fk=function(e){return j(e,15)},Q.gk=function(e){return V(JW,BL,15,e,0,1)},L(TW,`XMLTypePackageImpl/28`,1988),q(1989,1,lW,xle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/29`,1989),q(1963,1,lW,Sle),Q.fk=function(e){return j(e,681)},Q.gk=function(e){return V(v9,FP,2119,e,0,1)},L(TW,`XMLTypePackageImpl/3`,1963),q(1990,1,lW,Cle),Q.fk=function(e){return j(e,17)},Q.gk=function(e){return V(DG,X,17,e,0,1)},L(TW,`XMLTypePackageImpl/30`,1990),q(1991,1,lW,wle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/31`,1991),q(1992,1,lW,Tle),Q.fk=function(e){return j(e,168)},Q.gk=function(e){return V(kG,X,168,e,0,1)},L(TW,`XMLTypePackageImpl/32`,1992),q(1993,1,lW,Ele),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/33`,1993),q(1994,1,lW,Dle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/34`,1994),q(1995,1,lW,Ole),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/35`,1995),q(1996,1,lW,kle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/36`,1996),q(1997,1,lW,Ale),Q.fk=function(e){return j(e,15)},Q.gk=function(e){return V(JW,BL,15,e,0,1)},L(TW,`XMLTypePackageImpl/37`,1997),q(1998,1,lW,jle),Q.fk=function(e){return j(e,15)},Q.gk=function(e){return V(JW,BL,15,e,0,1)},L(TW,`XMLTypePackageImpl/38`,1998),q(1999,1,lW,Mle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/39`,1999),q(1964,1,lW,Nle),Q.fk=function(e){return j(e,682)},Q.gk=function(e){return V(y9,FP,2120,e,0,1)},L(TW,`XMLTypePackageImpl/4`,1964),q(2e3,1,lW,Ple),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/40`,2e3),q(2001,1,lW,Fle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/41`,2001),q(2002,1,lW,Ile),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/42`,2002),q(2003,1,lW,Lle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/43`,2003),q(2004,1,lW,Rle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/44`,2004),q(2005,1,lW,zle),Q.fk=function(e){return j(e,191)},Q.gk=function(e){return V(PG,X,191,e,0,1)},L(TW,`XMLTypePackageImpl/45`,2005),q(2006,1,lW,Ble),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/46`,2006),q(2007,1,lW,Vle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/47`,2007),q(2008,1,lW,Hle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/48`,2008),q(2009,1,lW,Ule),Q.fk=function(e){return j(e,191)},Q.gk=function(e){return V(PG,X,191,e,0,1)},L(TW,`XMLTypePackageImpl/49`,2009),q(1965,1,lW,Wle),Q.fk=function(e){return j(e,683)},Q.gk=function(e){return V(CHt,FP,2121,e,0,1)},L(TW,`XMLTypePackageImpl/5`,1965),q(2010,1,lW,Gle),Q.fk=function(e){return j(e,168)},Q.gk=function(e){return V(kG,X,168,e,0,1)},L(TW,`XMLTypePackageImpl/50`,2010),q(2011,1,lW,Kle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/51`,2011),q(2012,1,lW,qle),Q.fk=function(e){return j(e,17)},Q.gk=function(e){return V(DG,X,17,e,0,1)},L(TW,`XMLTypePackageImpl/52`,2012),q(1966,1,lW,Jle),Q.fk=function(e){return rl(e)},Q.gk=function(e){return V(LG,X,2,e,6,1)},L(TW,`XMLTypePackageImpl/6`,1966),q(1967,1,lW,Yle),Q.fk=function(e){return j(e,195)},Q.gk=function(e){return V(X9,X,195,e,0,2)},L(TW,`XMLTypePackageImpl/7`,1967),q(1968,1,lW,Xle),Q.fk=function(e){return il(e)},Q.gk=function(e){return V(bG,X,485,e,8,1)},L(TW,`XMLTypePackageImpl/8`,1968),q(1969,1,lW,Zle),Q.fk=function(e){return j(e,222)},Q.gk=function(e){return V(xG,X,222,e,0,1)},L(TW,`XMLTypePackageImpl/9`,1969);var A9,j9,M9,N9,$;q(55,63,SF,Ui),L(MW,`RegEx/ParseException`,55),q(836,1,{},Qle),Q.bm=function(e){return en*16)throw E(new Ui(TP((fu(),KCt))));n=n*16+i}while(!0);if(this.a!=125)throw E(new Ui(TP((fu(),qCt))));if(n>NW)throw E(new Ui(TP((fu(),JCt))));e=n}else{if(i=0,this.c!=0||(i=rk(this.a))<0||(n=i,hP(this),this.c!=0||(i=rk(this.a))<0))throw E(new Ui(TP((fu(),jU))));n=n*16+i,e=n}break;case 117:if(r=0,hP(this),this.c!=0||(r=rk(this.a))<0||(t=r,hP(this),this.c!=0||(r=rk(this.a))<0)||(t=t*16+r,hP(this),this.c!=0||(r=rk(this.a))<0)||(t=t*16+r,hP(this),this.c!=0||(r=rk(this.a))<0))throw E(new Ui(TP((fu(),jU))));t=t*16+r,e=t;break;case 118:if(hP(this),this.c!=0||(r=rk(this.a))<0||(t=r,hP(this),this.c!=0||(r=rk(this.a))<0)||(t=t*16+r,hP(this),this.c!=0||(r=rk(this.a))<0)||(t=t*16+r,hP(this),this.c!=0||(r=rk(this.a))<0)||(t=t*16+r,hP(this),this.c!=0||(r=rk(this.a))<0)||(t=t*16+r,hP(this),this.c!=0||(r=rk(this.a))<0))throw E(new Ui(TP((fu(),jU))));if(t=t*16+r,t>NW)throw E(new Ui(TP((fu(),`parser.descappe.4`))));e=t;break;case 65:case 90:case 122:throw E(new Ui(TP((fu(),YCt))))}return e},Q.dm=function(e){var t,n;switch(e){case 100:n=(this.e&32)==32?oP(`Nd`,!0):(xP(),z9);break;case 68:n=(this.e&32)==32?oP(`Nd`,!1):(xP(),QHt);break;case 119:n=(this.e&32)==32?oP(`IsWord`,!0):(xP(),U9);break;case 87:n=(this.e&32)==32?oP(`IsWord`,!1):(xP(),eUt);break;case 115:n=(this.e&32)==32?oP(`IsSpace`,!0):(xP(),H9);break;case 83:n=(this.e&32)==32?oP(`IsSpace`,!1):(xP(),$Ht);break;default:throw E(new yi((t=e,uTt+t.toString(16))))}return n},Q.em=function(e){var t,n,r,i,a,o,s,c,l,u,d,f;for(this.b=1,hP(this),t=null,this.c==0&&this.a==94?(hP(this),e?u=(xP(),xP(),++W9,new pv(5)):(t=(xP(),xP(),++W9,new pv(4)),oM(t,0,NW),u=(++W9,new pv(4)))):u=(xP(),xP(),++W9,new pv(4)),i=!0;(f=this.c)!=1&&!(f==0&&this.a==93&&!i);){if(i=!1,n=this.a,r=!1,f==10)switch(n){case 100:case 68:case 119:case 87:case 115:case 83:DN(u,this.dm(n)),r=!0;break;case 105:case 73:case 99:case 67:n=this.um(u,n),n<0&&(r=!0);break;case 112:case 80:if(d=Ont(this,n),!d)throw E(new Ui(TP((fu(),OU))));DN(u,d),r=!0;break;default:n=this.cm()}else if(f==20){if(o=fd(this.i,58,this.d),o<0)throw E(new Ui(TP((fu(),RCt))));if(s=!0,mg(this.i,this.d)==94&&(++this.d,s=!1),a=p_(this.i,this.d,o),c=dGe(a,s,(this.e&512)==512),!c)throw E(new Ui(TP((fu(),zCt))));if(DN(u,c),r=!0,o+1>=this.j||mg(this.i,o+1)!=93)throw E(new Ui(TP((fu(),RCt))));this.d=o+2}if(hP(this),!r)if(this.c!=0||this.a!=45)oM(u,n,n);else{if(hP(this),(f=this.c)==1)throw E(new Ui(TP((fu(),kU))));f==0&&this.a==93?(oM(u,n,n),oM(u,45,45)):(l=this.a,f==10&&(l=this.cm()),hP(this),oM(u,n,l))}(this.e&pF)==pF&&this.c==0&&this.a==44&&hP(this)}if(this.c==1)throw E(new Ui(TP((fu(),kU))));return t&&(KN(t,u),u=t),kj(u),FN(u),this.b=0,hP(this),u},Q.fm=function(){for(var e,t,n=this.em(!1),r;(r=this.c)!=7;)if(e=this.a,r==0&&(e==45||e==38)||r==4){if(hP(this),this.c!=9)throw E(new Ui(TP((fu(),UCt))));if(t=this.em(!1),r==4)DN(n,t);else if(e==45)KN(n,t);else if(e==38)iht(n,t);else throw E(new yi(`ASSERT`))}else throw E(new Ui(TP((fu(),WCt))));return hP(this),n},Q.gm=function(){var e=this.a-48,t=(xP(),xP(),++W9,new __(12,null,e));return!this.g&&(this.g=new Yr),Gr(this.g,new Xhe(e)),hP(this),t},Q.hm=function(){return hP(this),xP(),nUt},Q.im=function(){return hP(this),xP(),tUt},Q.jm=function(){throw E(new Ui(TP((fu(),MU))))},Q.km=function(){throw E(new Ui(TP((fu(),MU))))},Q.lm=function(){return hP(this),eQe()},Q.mm=function(){return hP(this),xP(),iUt},Q.nm=function(){return hP(this),xP(),oUt},Q.om=function(){var e;if(this.d>=this.j||((e=mg(this.i,this.d++))&65504)!=64)throw E(new Ui(TP((fu(),PCt))));return hP(this),xP(),xP(),++W9,new zp(0,e-64)},Q.pm=function(){return hP(this),Qdt()},Q.qm=function(){return hP(this),xP(),sUt},Q.rm=function(){var e=(xP(),xP(),++W9,new zp(0,105));return hP(this),e},Q.sm=function(){return hP(this),xP(),aUt},Q.tm=function(){return hP(this),xP(),rUt},Q.um=function(e,t){return this.cm()},Q.vm=function(){return hP(this),xP(),XHt},Q.wm=function(){var e,t,n,r,i;if(this.d+1>=this.j)throw E(new Ui(TP((fu(),jCt))));if(r=-1,t=null,e=mg(this.i,this.d),49<=e&&e<=57){if(r=e-48,!this.g&&(this.g=new Yr),Gr(this.g,new Xhe(r)),++this.d,mg(this.i,this.d)!=41)throw E(new Ui(TP((fu(),DU))));++this.d}else switch(e==63&&--this.d,hP(this),t=Q_t(this),t.e){case 20:case 21:case 22:case 23:break;case 8:if(this.c!=7)throw E(new Ui(TP((fu(),DU))));break;default:throw E(new Ui(TP((fu(),MCt))))}if(hP(this),i=zD(this),n=null,i.e==2){if(i.Pm()!=2)throw E(new Ui(TP((fu(),NCt))));n=i.Lm(1),i=i.Lm(0)}if(this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),xP(),xP(),++W9,new hKe(r,t,i,n)},Q.xm=function(){return hP(this),xP(),ZHt},Q.ym=function(){var e;if(hP(this),e=Em(24,zD(this)),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.zm=function(){var e;if(hP(this),e=Em(20,zD(this)),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.Am=function(){var e;if(hP(this),e=Em(22,zD(this)),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.Bm=function(){var e=0,t,n=0,r,i;for(t=-1;this.d=this.j)throw E(new Ui(TP((fu(),kCt))));if(t==45){for(++this.d;this.d=this.j)throw E(new Ui(TP((fu(),kCt))))}if(t==58){if(++this.d,hP(this),r=YPe(zD(this),e,n),this.c!=7)throw E(new Ui(TP((fu(),DU))));hP(this)}else if(t==41)++this.d,hP(this),r=YPe(zD(this),e,n);else throw E(new Ui(TP((fu(),ACt))));return r},Q.Cm=function(){var e;if(hP(this),e=Em(21,zD(this)),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.Dm=function(){var e;if(hP(this),e=Em(23,zD(this)),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.Em=function(){var e,t;if(hP(this),e=this.f++,t=Dm(zD(this),e),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),t},Q.Fm=function(){var e;if(hP(this),e=Dm(zD(this),0),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.Gm=function(e){return hP(this),this.c==5?(hP(this),Rp(e,(xP(),xP(),++W9,new Zv(9,e)))):Rp(e,(xP(),xP(),++W9,new Zv(3,e)))},Q.Hm=function(e){var t;return hP(this),t=(xP(),xP(),++W9,new lu(2)),this.c==5?(hP(this),LN(t,B9),LN(t,e)):(LN(t,e),LN(t,B9)),t},Q.Im=function(e){return hP(this),this.c==5?(hP(this),xP(),xP(),++W9,new Zv(9,e)):(xP(),xP(),++W9,new Zv(3,e))},Q.a=0,Q.b=0,Q.c=0,Q.d=0,Q.e=0,Q.f=1,Q.g=null,Q.j=0,L(MW,`RegEx/RegexParser`,836),q(1947,836,{},y_e),Q.bm=function(e){return!1},Q.cm=function(){return Tct(this)},Q.dm=function(e){return KM(e)},Q.em=function(e){return _vt(this)},Q.fm=function(){throw E(new Ui(TP((fu(),MU))))},Q.gm=function(){throw E(new Ui(TP((fu(),MU))))},Q.hm=function(){throw E(new Ui(TP((fu(),MU))))},Q.im=function(){throw E(new Ui(TP((fu(),MU))))},Q.jm=function(){return hP(this),KM(67)},Q.km=function(){return hP(this),KM(73)},Q.lm=function(){throw E(new Ui(TP((fu(),MU))))},Q.mm=function(){throw E(new Ui(TP((fu(),MU))))},Q.nm=function(){throw E(new Ui(TP((fu(),MU))))},Q.om=function(){return hP(this),KM(99)},Q.pm=function(){throw E(new Ui(TP((fu(),MU))))},Q.qm=function(){throw E(new Ui(TP((fu(),MU))))},Q.rm=function(){return hP(this),KM(105)},Q.sm=function(){throw E(new Ui(TP((fu(),MU))))},Q.tm=function(){throw E(new Ui(TP((fu(),MU))))},Q.um=function(e,t){return DN(e,KM(t)),-1},Q.vm=function(){return hP(this),xP(),xP(),++W9,new zp(0,94)},Q.wm=function(){throw E(new Ui(TP((fu(),MU))))},Q.xm=function(){return hP(this),xP(),xP(),++W9,new zp(0,36)},Q.ym=function(){throw E(new Ui(TP((fu(),MU))))},Q.zm=function(){throw E(new Ui(TP((fu(),MU))))},Q.Am=function(){throw E(new Ui(TP((fu(),MU))))},Q.Bm=function(){throw E(new Ui(TP((fu(),MU))))},Q.Cm=function(){throw E(new Ui(TP((fu(),MU))))},Q.Dm=function(){throw E(new Ui(TP((fu(),MU))))},Q.Em=function(){var e;if(hP(this),e=Dm(zD(this),0),this.c!=7)throw E(new Ui(TP((fu(),DU))));return hP(this),e},Q.Fm=function(){throw E(new Ui(TP((fu(),MU))))},Q.Gm=function(e){return hP(this),Rp(e,(xP(),xP(),++W9,new Zv(3,e)))},Q.Hm=function(e){var t;return hP(this),t=(xP(),xP(),++W9,new lu(2)),LN(t,e),LN(t,B9),t},Q.Im=function(e){return hP(this),xP(),xP(),++W9,new Zv(3,e)};var P9=null,F9=null;L(MW,`RegEx/ParserForXMLSchema`,1947),q(122,1,VW,Tr),Q.Jm=function(e){throw E(new yi(`Not supported.`))},Q.Km=function(){return-1},Q.Lm=function(e){return null},Q.Mm=function(){return null},Q.Nm=function(e){},Q.Om=function(e){},Q.Pm=function(){return 0},Q.Ib=function(){return this.Qm(0)},Q.Qm=function(e){return this.e==11?`.`:``},Q.e=0;var GHt,I9,L9,KHt,qHt,R9=null,z9,JHt=null,YHt,B9,V9=null,XHt,ZHt,QHt,$Ht,eUt,tUt,H9,nUt,rUt,iUt,aUt,U9,oUt,sUt,W9=0,cUt=L(MW,`RegEx/Token`,122);q(138,122,{3:1,138:1,122:1},pv),Q.Qm=function(e){var t,n,r;if(this.e==4)if(this==YHt)n=`.`;else if(this==z9)n=`\\d`;else if(this==U9)n=`\\w`;else if(this==H9)n=`\\s`;else{for(r=new $i,r.a+=`[`,t=0;t0&&(r.a+=`,`),this.b[t]===this.b[t+1]?pl(r,uN(this.b[t])):(pl(r,uN(this.b[t])),r.a+=`-`,pl(r,uN(this.b[t+1])));r.a+=`]`,n=r.a}else if(this==QHt)n=`\\D`;else if(this==eUt)n=`\\W`;else if(this==$Ht)n=`\\S`;else{for(r=new $i,r.a+=`[^`,t=0;t0&&(r.a+=`,`),this.b[t]===this.b[t+1]?pl(r,uN(this.b[t])):(pl(r,uN(this.b[t])),r.a+=`-`,pl(r,uN(this.b[t+1])));r.a+=`]`,n=r.a}return n},Q.a=!1,Q.c=!1,L(MW,`RegEx/RangeToken`,138),q(592,1,{592:1},Xhe),Q.a=0,L(MW,`RegEx/RegexParser/ReferencePosition`,592),q(591,1,{3:1,591:1},Rye),Q.Fb=function(e){var t;return e==null||!j(e,591)?!1:(t=P(e,591),ff(this.b,t.b)&&this.a==t.a)},Q.Hb=function(){return jw(this.b+`/`+Xot(this.a))},Q.Ib=function(){return this.c.Qm(this.a)},Q.a=0,L(MW,`RegEx/RegularExpression`,591),q(228,122,VW,zp),Q.Km=function(){return this.a},Q.Qm=function(e){var t,n,r;switch(this.e){case 0:switch(this.a){case 124:case 42:case 43:case 63:case 40:case 41:case 46:case 91:case 123:case 92:r=`\\`+Xd(this.a&OF);break;case 12:r=`\\f`;break;case 10:r=`\\n`;break;case 13:r=`\\r`;break;case 9:r=`\\t`;break;case 27:r=`\\e`;break;default:this.a>=pI?(n=(t=this.a>>>0,`0`+t.toString(16)),r=`\\v`+p_(n,n.length-6,n.length)):r=``+Xd(this.a&OF)}break;case 8:r=this==XHt||this==ZHt?``+Xd(this.a&OF):`\\`+Xd(this.a&OF);break;default:r=null}return r},Q.a=0,L(MW,`RegEx/Token/CharToken`,228),q(318,122,VW,Zv),Q.Lm=function(e){return this.a},Q.Nm=function(e){this.b=e},Q.Om=function(e){this.c=e},Q.Pm=function(){return 1},Q.Qm=function(e){var t;if(this.e==3)if(this.c<0&&this.b<0)t=this.a.Qm(e)+`*`;else if(this.c==this.b)t=this.a.Qm(e)+`{`+this.c+`}`;else if(this.c>=0&&this.b>=0)t=this.a.Qm(e)+`{`+this.c+`,`+this.b+`}`;else if(this.c>=0&&this.b<0)t=this.a.Qm(e)+`{`+this.c+`,}`;else throw E(new yi(`Token#toString(): CLOSURE `+this.c+PP+this.b));else if(this.c<0&&this.b<0)t=this.a.Qm(e)+`*?`;else if(this.c==this.b)t=this.a.Qm(e)+`{`+this.c+`}?`;else if(this.c>=0&&this.b>=0)t=this.a.Qm(e)+`{`+this.c+`,`+this.b+`}?`;else if(this.c>=0&&this.b<0)t=this.a.Qm(e)+`{`+this.c+`,}?`;else throw E(new yi(`Token#toString(): NONGREEDYCLOSURE `+this.c+PP+this.b));return t},Q.b=0,Q.c=0,L(MW,`RegEx/Token/ClosureToken`,318),q(837,122,VW,Km),Q.Lm=function(e){return e==0?this.a:this.b},Q.Pm=function(){return 2},Q.Qm=function(e){return this.b.e==3&&this.b.Lm(0)==this.a?this.a.Qm(e)+`+`:this.b.e==9&&this.b.Lm(0)==this.a?this.a.Qm(e)+`+?`:this.a.Qm(e)+(``+this.b.Qm(e))},L(MW,`RegEx/Token/ConcatToken`,837),q(1945,122,VW,hKe),Q.Lm=function(e){if(e==0)return this.d;if(e==1)return this.b;throw E(new yi(`Internal Error: `+e))},Q.Pm=function(){return this.b?2:1},Q.Qm=function(e){var t=this.c>0?`(?(`+this.c+`)`:this.a.e==8?`(?(`+this.a+`)`:`(?`+this.a;return this.b?t+=this.d+`|`+this.b+`)`:t+=this.d+`)`,t},Q.c=0,L(MW,`RegEx/Token/ConditionToken`,1945),q(1946,122,VW,Lze),Q.Lm=function(e){return this.b},Q.Pm=function(){return 1},Q.Qm=function(e){return`(?`+(this.a==0?``:Xot(this.a))+(this.c==0?``:Xot(this.c))+`:`+this.b.Qm(e)+`)`},Q.a=0,Q.c=0,L(MW,`RegEx/Token/ModifierToken`,1946),q(838,122,VW,Nh),Q.Lm=function(e){return this.a},Q.Pm=function(){return 1},Q.Qm=function(e){var t=null;switch(this.e){case 6:t=this.b==0?`(?:`+this.a.Qm(e)+`)`:`(`+this.a.Qm(e)+`)`;break;case 20:t=`(?=`+this.a.Qm(e)+`)`;break;case 21:t=`(?!`+this.a.Qm(e)+`)`;break;case 22:t=`(?<=`+this.a.Qm(e)+`)`;break;case 23:t=`(?`+this.a.Qm(e)+`)`}return t},Q.b=0,L(MW,`RegEx/Token/ParenToken`,838),q(530,122,{3:1,122:1,530:1},__),Q.Mm=function(){return this.b},Q.Qm=function(e){return this.e==12?`\\`+this.a:oat(this.b)},Q.a=0,L(MW,`RegEx/Token/StringToken`,530),q(477,122,VW,lu),Q.Jm=function(e){LN(this,e)},Q.Lm=function(e){return P(Rh(this.a,e),122)},Q.Pm=function(){return this.a?this.a.a.c.length:0},Q.Qm=function(e){var t,n,r,i,a;if(this.e==1){if(this.a.a.c.length==2)t=P(Rh(this.a,0),122),n=P(Rh(this.a,1),122),i=n.e==3&&n.Lm(0)==t?t.Qm(e)+`+`:n.e==9&&n.Lm(0)==t?t.Qm(e)+`+?`:t.Qm(e)+(``+n.Qm(e));else{for(a=new $i,r=0;r=this.c.b:this.a<=this.c.b},Q.Sb=function(){return this.b>0},Q.Tb=function(){return this.b},Q.Vb=function(){return this.b-1},Q.Qb=function(){throw E(new Ri(yTt))},Q.a=0,Q.b=0,L(gTt,`ExclusiveRange/RangeIterator`,258);var K9=Jh(VU,`C`),q9=Jh(WU,`I`),J9=Jh(DP,`Z`),Y9=Jh(GU,`J`),X9=Jh(BU,`B`),Z9=Jh(HU,`D`),Q9=Jh(UU,`F`),$9=Jh(KU,`S`),uUt=gp(`org.eclipse.elk.core.labels`,`ILabelManager`),dUt=gp(uU,`DiagnosticChain`),fUt=gp(Lwt,`ResourceSet`),pUt=L(uU,`InvocationTargetException`,null),mUt=(Qi(),mUe),hUt=hUt=e5e;SJe(sge),uJe(`permProps`,[[[`locale`,`default`],[bTt,`gecko1_8`]],[[`locale`,`default`],[bTt,`safari`]]]),hUt(null,`elk`,null)}).call(this)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}],3:[function(e,t,n){function r(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function i(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function a(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var o=function(t){a(n,t);function n(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r(this,n);var a=Object.assign({},t),o=!1;try{e.resolve(`web-worker`),o=!0}catch{}if(t.workerUrl)if(o){var s=e("web-worker");a.workerFactory=function(e){return new s(e)}}else console.warn(`Web worker requested but 'web-worker' package not installed. Consider installing the package or pass your own 'workerFactory' to ELK's constructor. -... Falling back to non-web worker version.`);if(!a.workerFactory){var c=e("./elk-worker.min.js").Worker;a.workerFactory=function(e){return new c(e)}}return i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,a))}return n}(e("./elk-api.js").default);Object.defineProperty(t.exports,"__esModule",{value:!0}),t.exports=o,o.default=o},{"./elk-api.js":1,"./elk-worker.min.js":2,"web-worker":4}],4:[function(e,t,n){t.exports=Worker},{}]},{},[3])(3)})}))(),1),p=r((e,t,{parentById:n})=>{let r=new Set,i=e;if(e===t)return n[e]||`root`;for(;i;){if(r.add(i),i===t)return i;i=n[i]}for(i=t;i;){if(r.has(i))return i;i=n[i]}return`root`},`findCommonAncestor`),m=6;function h(e,{measure:t}){let n=e.config?.elk?.lineHops;if(n===!1)return;let r=e.edges.filter(e=>Array.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));d(t.groups.edgePaths,r,{enabled:!0,jumpRadius:m,jumpStyle:n===`gap`?`gap`:`arc`})}r(h,`applyElkLineJumps`);var g={},_={},v={},y={},b=1,x=10,S=r((e,t,n=.5)=>{let r=e.width/2,i=e.height/2,a=e.x-r,o=e.x+r,s=e.y-i,c=e.y+i,l=Math.abs(t.x-a)<=n&&t.y>=s-n&&t.y<=c+n,u=Math.abs(t.x-o)<=n&&t.y>=s-n&&t.y<=c+n,d=Math.abs(t.y-s)<=n&&t.x>=a-n&&t.x<=o+n,f=Math.abs(t.y-c)<=n&&t.x>=a-n&&t.x<=o+n;return l||u||d||f},`onBorder`),ee=r((e,t,n)=>{let r=e.x,i=e.y,a=Math.abs(r-n.x),o=e.width/2,s=n.xMath.abs(r-t.x)*c){let e=n.y{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),ne=r((e,t,n=x)=>{let r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y),a=e.width/2,o=e.height/2;if(Math.abs(r-a)0)return{x:e.x+r/a*(a+n),y:e.y+i/a*(a+n)}}return t},`ensureTrulyOutside`),C=r((e,t,n)=>{let r=Math.abs(t.x-e.x){if(!e?.intersect)return null;let r=e.intersect(n);return!r||n.xt.x||n.x>t.x&&r.xee(e,t,C(e,t,n)),`fallbackIntersection`),ae=20,oe=1e-6,se=r((e,t,n)=>{let r=e.intersect?.(n);return r?Math.hypot(n.x-t.x,n.y-t.y)<=Math.hypot(r.x-t.x,r.y-t.y)+1e-9:!1},`insideOutline`),ce=r((e,t,n,i)=>{if(!e?.intersect)return null;let a=i.x-n.x,o=i.y-n.y;if(a===0&&o===0||Math.abs(a)>oe&&Math.abs(o)>oe)return null;let s={x:t.x,y:t.y},c=Math.abs(a)>Math.abs(o),l=r(e=>c?{x:e,y:n.y}:{x:n.x,y:e},`along`),u=c?s.x:s.y,d=c?n.x:n.y;if(!se(e,s,l(u)))return null;if(se(e,s,l(d)))return{...n};for(let t=0;t{let i=ne(t,n);return re(e,t,i)??ie(t,i,r)},`computeNodeIntersection`),ue=r((e,t,n,r=.1)=>{if(!(!n||e.length===0))if(t===`start`)e.length>0&&Math.abs(e[0].x-n.x)0&&Math.abs(e[t].x-n.x)typeof e==`string`?Math.max(s[e]??0,c[e]??0):0,`markerPathOffset`),pe={arrow_open:[`none`,`none`],arrow_cross:[`none`,`arrow_cross`],double_arrow_cross:[`arrow_cross`,`arrow_cross`],arrow_point:[`none`,`arrow_point`],double_arrow_point:[`arrow_point`,`arrow_point`],arrow_circle:[`none`,`arrow_circle`],double_arrow_circle:[`arrow_circle`,`arrow_circle`]},me=12,he=`[top=${me},left=${me},bottom=${me},right=${me}]`,ge=24,_e=24,ve=50,ye=15,be=10,xe={"spacing.baseValue":15,"spacing.nodeNode":15,"elk.aspectRatio":`1.6`,"elk.expandNodes":`true`,"elk.rectpacking.trybox":`true`,"elk.rectpacking.packing.compaction.rowHeightReevaluation":`true`,"elk.rectpacking.packing.compaction.iterations":10,"elk.rectpacking.whiteSpaceElimination.strategy":`EQUAL_BETWEEN_STRUCTURES`,"elk.rectpacking.widthApproximation.strategy":`SCANLINE`},Se=[`nodeSize.constraints`,`nodeSize.minimum`,`elk.algorithm`,`elk.aspectRatio`,`elk.contentAlignment`,`elk.expandNodes`,`elk.padding`,...Object.keys(xe)];function Ce(e){for(let t of Se)delete e[t];e[`spacing.baseValue`]=_e,e[`spacing.nodeNode`]=ve}r(Ce,`clearContainerAlgorithmOptions`);var we=new Set([`elk.layered`,`elk.box`,`elk.rectpacking`,`elk.stress`,`elk.force`,`elk.mrtree`,`elk.radial`,`elk.sporeOverlap`]);function Te(e,t){if(typeof e==`string`){if(!we.has(e)){t?.warn(`Unknown container layout algorithm "${e}". Supported values: ${[...we].join(`, `)}. Falling back to the diagram's layout algorithm.`);return}return e}}r(Te,`resolveContainerAlgorithm`);function Ee(e){switch(e){case`LR`:return`RIGHT`;case`RL`:return`LEFT`;case`TB`:case`TD`:return`DOWN`;case`BT`:return`UP`;default:return`DOWN`}}r(Ee,`dir2ElkDirection`);function De(e){return o(e.shape)?(e.labelData?.width??e.labels?.[0]?.width??0)+(e.padding??0):0}r(De,`groupTitleWidth`);function Oe(e){return o(e.shape)?{"nodeSize.constraints":`[MINIMUM_SIZE, NODE_LABELS]`,"nodeSize.minimum":`(${De(e)}, 0)`}:{}}r(Oe,`groupTitleSizeOptions`);function ke(e,t,n,r){let i=(e.labelData?.width??0)+2*(e.padding??0),a=e.labelData?.height??0,o=Ve(t?.preset),s={...Oe(e),"spacing.baseValue":_e,"elk.layered.spacing.edgeNodeBetweenLayers":30,"elk.spacing.edgeEdge":20,"spacing.nodeNode":ve,"elk.padding":`[top=${ge},left=${ge},bottom=${ge},right=${ge}]`,"nodeLabels.placement":`[H_CENTER V_TOP, INSIDE]`,"elk.layered.mergeEdges":t?.mergeEdges,"elk.layered.nodePlacement.bk.fixedAlignment":t?.nodePlacementAlignment??o.alignment,"elk.layered.nodePlacement.strategy":t?.nodePlacementStrategy??o.containerPlacement,"elk.layered.cycleBreaking.strategy":t?.cycleBreakingStrategy??o.cycleBreaking,"elk.layered.nodePlacement.networkSimplex.nodeFlexibility":`PORT_POSITION`,"elk.spacing.portsSurrounding":he},c=Te(e.metadata?.algorithm,r);if(c){let e=a+ye;if(s[`nodeSize.constraints`]=`[MINIMUM_SIZE, NODE_LABELS]`,s[`nodeSize.minimum`]=`(${i}, ${e+ye})`,s[`elk.algorithm`]=c,s[`elk.hierarchyHandling`]=`SEPARATE_CHILDREN`,s[`elk.aspectRatio`]=`2.0`,s[`elk.contentAlignment`]=`H_CENTER V_TOP`,s[`elk.expandNodes`]=`true`,s[`elk.padding`]=`[top=${e},left=${ye},bottom=${ye},right=${ye}]`,c===`elk.rectpacking`){let e=a+be;Object.assign(s,xe,{"elk.padding":`[top=${e},left=${be},bottom=${be},right=${be}]`,"nodeSize.minimum":`(${i}, ${e+be})`})}}else e.dir&&(s[`elk.algorithm`]=n,s[`elk.direction`]=Ee(e.dir),s[`elk.hierarchyHandling`]=`SEPARATE_CHILDREN`);return Object.assign(s,y),s}r(ke,`buildSubgraphLayoutOptions`);function Ae(e,t){let n=new Set,i=new Map;for(let{id:t,parentId:n}of e){let e=i.get(n);e?e.push(t):i.set(n,[t])}for(let e of i.values()){let i=new Set(e),a=new Map(e.map(e=>[e,0])),o=new Map(e.map(e=>[e,[]])),s=[];for(let e of t){let t=e.source==null?void 0:String(e.source),n=e.target==null?void 0:String(e.target);!t||!n||t===n||!i.has(t)||!i.has(n)||(a.set(n,(a.get(n)??0)+1),o.get(t).push(n),o.get(n).push(t),s.push([t,n]))}let c=new Map,l=0;for(let t of e){if(c.has(t))continue;let e=[t];for(c.set(t,l);e.length>0;){let t=e.pop();for(let n of o.get(t))c.has(n)||(c.set(n,l),e.push(n))}l++}let u=Array(l).fill(!1);for(let t of e)(a.get(t)??0)===0&&(u[c.get(t)]=!0);if(!u.includes(!1))continue;let d=new Map(e.map(e=>[e,[]])),f=new Map(e.map(e=>[e,0])),p=r((e,t)=>{let n=new Set([e]),r=[e];for(;r.length>0;){let e=r.pop();if(e===t)return!0;for(let t of d.get(e))n.has(t)||(n.add(t),r.push(t))}return!1},`reaches`);for(let[e,t]of s)p(t,e)||(d.get(e).push(t),f.set(t,(f.get(t)??0)+1));let m=Array(l).fill(!1);for(let t of e){let e=c.get(t);!u[e]&&!m[e]&&f.get(t)===0&&(n.add(t),m[e]=!0)}}return n}r(Ae,`findCyclicEntryNodes`);function je(e,t){if(!e.config.elk?.keepEntryNodeOnTop)return;let n=Ae(e.nodes,e.edges.map(e=>({source:e.start,target:e.end})));for(let e of n){let n=t[e];n&&(n.layoutOptions={...n.layoutOptions,"elk.layered.layering.layerConstraint":`FIRST`})}}r(je,`applyCyclicEntryConstraint`);function Me(e,t){let n=ze(t);return Ie(n),Tt(e,n),{algorithm:n.algorithm}}r(Me,`prepareLayoutForElk`);async function Ne(e,t){let n=ze(t),r=Pe(e,n),i=new f.default;n.log.info(`Drawing flowchart using v4 renderer`,i);let a=await $e(i,r.elkGraph,n.log);return et(e,a,r,n.log),Le(e.nodes),a}r(Ne,`runElkLayoutCore`);function Pe(e,t){let n={},r=He(e,t.algorithm,t.rootLayoutOptions),i=e.direction??`DOWN`;r.layoutOptions[`elk.direction`]=Ee(i);let a=Ue(e.nodes,t.log);return We(e.nodes,r,n,t),Je(e,r,n,t),Xe(e,n,a,t),Ze(r,n,a,t.log),je(e,n),{elkGraph:r,nodeDb:n,parentLookupDb:a}}r(Pe,`buildElkGraphFromLayoutData`);var Fe=u({afterPaint:h,prepareLayout:Me,measureLayout:r((e,t)=>l(e,t,{unwrapGroupLabels:!0}),`measureLayout`),runLayoutCore:Ne,paintOptions:{skipIntersect:!0}});function Ie(e){i(e.getConfig())}r(Ie,`syncHostConfig`);function Le(e){let t=new Map(e.map(e=>[e.id,e]));e.sort((e,n)=>e.isGroup===n.isGroup?e.isGroup&&n.isGroup?Re(e,t)-Re(n,t):0:e.isGroup?-1:1)}r(Le,`orderNodesForElkPaint`);function Re(e,t){let n=0,r=new Set,i=e.parentId;for(;i&&!r.has(i);){r.add(i);let e=t.get(i);if(!e?.isGroup)break;n++,i=e.parentId}return n}r(Re,`getGroupDepth`);function ze(e){let t=e.helpers;if(!t)throw Error(`ELK layout requires Mermaid internal helpers`);return{algorithm:e.preparedLayout?.algorithm??e.options?.algorithm,rootLayoutOptions:e.options?.rootLayoutOptions,common:t.common,getConfig:t.getConfig,interpolateToCurve:t.interpolateToCurve,log:t.log}}r(ze,`getElkLayoutContext`);var Be={default:{layering:`NETWORK_SIMPLEX`,placement:`BRANDES_KOEPF`,containerPlacement:`BRANDES_KOEPF`,alignment:`BALANCED`,cycleBreaking:`DEPTH_FIRST`},legacy:{layering:`NETWORK_SIMPLEX`,placement:`BRANDES_KOEPF`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`GREEDY`},modelOrder:{layering:`NETWORK_SIMPLEX`,placement:`NETWORK_SIMPLEX`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`GREEDY_MODEL_ORDER`},depthFirst:{layering:`NETWORK_SIMPLEX`,placement:`NETWORK_SIMPLEX`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`DEPTH_FIRST`}};function Ve(e){return e!==void 0&&Object.hasOwn(Be,e)?Be[e]:Be.default}r(Ve,`resolveElkPreset`);function He(e,t,n){let r=Ve(e.config.elk?.preset),i={id:`root`,layoutOptions:{"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.algorithm":t,"elk.layered.nodePlacement.strategy":e.config.elk?.nodePlacementStrategy??r.placement,"elk.layered.nodePlacement.bk.fixedAlignment":e.config.elk?.nodePlacementAlignment??r.alignment,"elk.layered.mergeEdges":e.config.elk?.mergeEdges,"elk.direction":`DOWN`,"spacing.baseValue":40,"elk.layered.crossingMinimization.forceNodeModelOrder":e.config.elk?.forceNodeModelOrder,"elk.layered.considerModelOrder.strategy":e.config.elk?.considerModelOrder,"elk.layered.unnecessaryBendpoints":!0,"elk.layered.cycleBreaking.strategy":e.config.elk?.cycleBreakingStrategy??r.cycleBreaking,"elk.layered.layering.strategy":e.config.elk?.layeringStrategy??r.layering,"elk.layered.layering.coffmanGraham.layerBound":e.config.elk?.layeringLayerBound,"elk.layered.wrapping.multiEdge.improveCuts":!0,"elk.layered.wrapping.multiEdge.improveWrappedEdges":!0,"elk.layered.edgeRouting.selfLoopDistribution":`EQUALLY`,"elk.layered.mergeHierarchyEdges":!0,"elk.spacing.portsSurrounding":he},children:[],edges:[]};return t===`elk.rectpacking`&&Object.assign(i.layoutOptions,xe,{"elk.contentAlignment":`H_CENTER V_TOP`,"elk.padding":`[top=15,left=15,bottom=15,right=15]`}),n&&Object.assign(i.layoutOptions,n),Object.assign(i.layoutOptions,g,_,v),i}r(He,`createRootElkGraph`);function Ue(e,t){let n={parentById:{},childrenById:{}},r=e.filter(e=>e.isGroup);return t.info(`Subgraphs - `,r),r.forEach(t=>{e.filter(e=>e.parentId===t.id).forEach(e=>{n.parentById[e.id]=t.id,n.childrenById[t.id]??=[],n.childrenById[t.id].push(e.id)})}),n}r(Ue,`addSubGraphs`);function We(e,t,n,r,i){let a=e.filter(e=>e?.parentId===i);return r.log.info(`addVertices APA12`,a,i),a.forEach(i=>{Ge(t,e,i,n,r)}),t}r(We,`addVertices`);function Ge(e,t,n,r,i){let a=Ke(n);e.children.push(a),r[n.id]=a,n.isGroup&&(a.children=[],We(t,a,r,i,n.id),a.labelData=qe(n,i.getConfig()))}r(Ge,`addVertex`);function Ke(e){let t={...e};return delete t.domId,e.isGroup?t.children=[]:(t.width=e.width??0,t.height=e.height??0,e.spreadPorts&&(t.layoutOptions={...t.layoutOptions,"elk.portAlignment.default":`CENTER`})),t}r(Ke,`createElkNode`);function qe(e,t){return e.labelData||(e.labelBBox?{width:e.labelBBox.width,height:Math.max(0,e.labelBBox.height-2),wrappingWidth:e.wrappingWidth??t.flowchart?.wrappingWidth}:{width:0,height:0,wrappingWidth:e.wrappingWidth??t.flowchart?.wrappingWidth})}r(qe,`getMeasuredLabelData`);function Je(e,t,n,r){r.log.info(`abc78 DAGA edges = `,e);let i={};return e.edges.forEach(e=>{let a=e.id;i[a]=(i[a]??-1)+1;let o=a;e.id=o,r.log.info(`abc78 new link id to be used is`,a,o,i[a]);let{source:s,target:c,sourceId:l,targetId:u}=Ye(e,n);r.log.debug(`abc78 source and target`,s,c),t.edges.push({...e,sources:[s],targets:[c],sourceId:l,targetId:u,labels:[{width:e.width??0,height:e.height??0,orgWidth:e.width??0,orgHeight:e.height??0,text:e.label??``,layoutOptions:{"edgeLabels.inline":`true`,"edgeLabels.placement":`CENTER`}}]})}),t}r(Je,`addEdgesToElkGraph`);function Ye(e,t){let n=e.start,r=e.end,i=n,a=r,o=n?t[n]:void 0,s=r?t[r]:void 0;return!o||!s?{source:i,target:a}:{source:i,target:a,sourceId:n,targetId:r}}r(Ye,`getEdgeStartEndPoint`);function Xe(e,t,n,r){e.nodes.forEach(i=>{let a=t[i.id];!a||n.childrenById[a.id]===void 0||(a.labels=[{text:a.label,width:a?.labelData?.width??50,height:a?.labelData?.height??50}],r.log.debug(`UIO node label`,a?.labelData?.width,a.padding),a.layoutOptions=ke(a,e.config.elk,r.algorithm,r.log),delete a.x,delete a.y,delete a.width,delete a.height)})}r(Xe,`configureSubgraphNodes`);function Ze(e,t,n,r){r.debug(`APA01 processing edges, count:`,e.edges.length),e.edges.forEach((e,i)=>{r.debug(`APA01 processing edge`,i,`:`,e);let a=e.sources[0],o=e.targets[0];if(r.debug(`APA01 source:`,a,`target:`,o),r.debug(`APA01 nodeDb[source]:`,t[a]),r.debug(`APA01 nodeDb[target]:`,t[o]),t[a]&&t[o]&&t[a].parentId!==t[o].parentId){let e=p(a,o,n);Qe(t,a,e,r),Qe(t,o,e,r)}})}r(Ze,`configureCrossHierarchyEdges`);function Qe(e,t,n,r){let i=e[t];i&&(i.layoutOptions??={},i.layoutOptions[`elk.hierarchyHandling`]===`SEPARATE_CHILDREN`&&Te(i.metadata?.algorithm)&&(r.debug(`Dropping explicit algorithm for node`,i.id,`due to cross-boundary edges`),Ce(i.layoutOptions),Object.assign(i.layoutOptions,Oe(i))),i.layoutOptions[`elk.hierarchyHandling`]=`INCLUDE_CHILDREN`,i.id!==n&&i.parentId&&Qe(e,i.parentId,n,r))}r(Qe,`setIncludeChildrenPolicy`);async function $e(e,t,n){let r=globalThis.__mermaidProfiler;try{r?.begin(`layoutCore`);let i;try{i=await e.layout(t)}finally{r?.end()}return n.debug(`APA01 after - success`),n.debug(`APA01 layout result:`,i),i}catch(e){throw n.error(`ELK layout error:`,e),e}}r($e,`runElkLayout`);function et(e,t,n,r){let i=new Map(e.nodes.map(e=>[e.id,e]));it(t.children??[],n,i,0,0,0,r),rt(t.children??[],n,i,t),mt(e,t,n,r)}r(et,`applyElkLayoutResult`);function tt(e,t=new Set){for(let n of e.children??[])t.add(n.id),tt(n,t);return t}r(tt,`collectDescendantIds`);function nt(e,t,n,r){let i=[];for(let a of e.edges??[]){let e=a.sources?.[0]??a.start,o=a.targets?.[0]??a.end,s=t.has(e)&&t.has(o),c=e===r,l=o===r;if(!s&&!c&&!l)continue;let u=_t(e,o,n.parentLookupDb,n.nodeDb);for(let e of a.sections??[]){let t=s?[e.startPoint,...e.bendPoints??[],e.endPoint]:[c?e.startPoint:null,l?e.endPoint:null];for(let e of t)e&&i.push({x:e.x+u.x,y:e.y+u.y})}}return i}r(nt,`internalEdgePoints`);function rt(e,t,n,r={}){for(let i of e){if(!i?.isGroup)continue;let e=i.children??[];rt(e,t,n,r);let a=t.nodeDb[i.id],o=e.map(e=>t.nodeDb[e.id]).filter(e=>e?.offset&&e.width&&e.height);if(!a?.offset||o.length===0)continue;let s=nt(r,tt(i),t,i.id),c=[...o.map(e=>e.offset.posX),...o.map(e=>e.offset.posX+e.width),...s.map(e=>e.x)],l=[...o.map(e=>e.offset.posY),...o.map(e=>e.offset.posY+e.height),...s.map(e=>e.y)],u=a.offset,d=Math.max(u.posX,Math.min(...c)-ge),f=Math.min(u.posX+a.width,Math.max(...c)+ge),p=Math.min(u.posY+a.height,Math.max(...l)+ge),m=u.posY,h=De(i),g=d,_=f-d;if(_{if(!e)return;let s=t.nodeDb[e.id]??e,c=Math.max(e.width,e.labels&&e.labels[0]?.width||0),l={posX:e.x+r,posY:e.y+i,x:r,y:i,depth:a,width:c,height:e.height};s.offset=l,s.x=l.posX+e.width/2,s.y=l.posY+e.height/2,s.width=e.width,s.height=e.height;let u=n.get(e.id);if(u){u.x=s.x,u.y=s.y,u.width=e.isGroup?Math.max(e.width,e.labelData?.width??0):e.width,u.height=e.height;let t=u;t.labelData=e.labelData,t.labels=e.labels}e.isGroup?(o.debug(`Id abc88 subgraph = `,e.id,e.x,e.y,e.labelData),it(e.children??[],t,n,l.posX,l.posY,a+1,o)):o.info(`Id NODE = `,e.id,e.x,e.y,r,i,`translate(${s.x}, ${s.y})`)})}r(it,`applyElkNodePositions`);var at=16,ot=30,st=.01;function ct(e,t){let n=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y);if(n>st&&r<=st)return`h`;if(r>st&&n<=st)return`v`}r(ct,`axisOf`);function lt(e){let t=ut(e)??e,n=ut([...t].reverse());return n&&(t=n.reverse()),t}r(lt,`straightenTerminalJogs`);function ut(e){if(e.length<5)return null;let[t,n,r,i]=e,a=ct(t,n);if(!a||ct(r,i)!==a||ct(n,r)!==(a===`h`?`v`:`h`)||Math.hypot(n.x-t.x,n.y-t.y)>ot)return null;let o=Math.abs(a===`h`?r.y-n.y:r.x-n.x);if(oat||!(a===`h`?Math.sign(n.x-t.x)===Math.sign(i.x-r.x):Math.sign(n.y-t.y)===Math.sign(i.y-r.y)))return null;let s=3;for(;s+1(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),`side`),o=a(n,i,e),s=a(n,i,t),c=a(e,t,n),l=a(e,t,i);return(o>0&&s<0||o<0&&s>0)&&(c>0&&l<0||c<0&&l>0)}r(dt,`segmentsCrossStrict`);function ft(e,t){let n=0;for(let r=0;re.points??[]);for(let[n,r]of e.entries()){let e=t[n];if(e.length<5)continue;let i=lt(e);if(i===e)continue;let a=0,o=0;for(let[r,s]of t.entries())r===n||s.length<2||(a+=ft(e,s),o+=ft(i,s));o>a||(r.points=i,t[n]=i)}}r(pt,`straightenEdgeTerminals`);function mt(e,t,n,i){let a=new Map(e.edges.map(e=>[e.id,e])),o=e.config.elk?.straightenEdges!==!1,s=new Map(e.nodes.map(e=>[e.id,e])),c=new Set;t.edges?.forEach(e=>{if(!e.sections?.length)return;let t=n.nodeDb[e.sources?.[0]??e.start],r=n.nodeDb[e.targets?.[0]??e.end];if(!t||!r)return;let i=_t(e.start??e.sourceId??e.sources?.[0],e.end??e.targetId??e.targets?.[0],n.parentLookupDb,n.nodeDb),a=e.sections[0];t.shape!==`rect33`&&ht(t,{x:a.startPoint.x+i.x,y:a.startPoint.y+i.y},s,c),r.shape!==`rect33`&&ht(r,{x:a.endPoint.x+i.x,y:a.endPoint.y+i.y},s,c)}),t.edges?.forEach(e=>{let t=a.get(e.id);if(!t)return;let o=e.sources?.[0]??e.start,s=e.targets?.[0]??e.end,c=n.nodeDb[o],l=n.nodeDb[s];if(!c||!l)return;if(!e.sections?.length){let n=r(e=>({x:(e.offset?.posX??e.x??0)+(e.width??0)/2,y:(e.offset?.posY??e.y??0)+(e.height??0)/2}),`centre`),a=n(c),o=n(l);c.x=a.x,c.y=a.y,l.x=o.x,l.y=o.y;let s=vt([a,o],c,l,i);t.points=s,t.curve=`linear`;let u=s[0],d=s[s.length-1];t.x=(u.x+d.x)/2,t.y=(u.y+d.y)/2,i.debug(`APA18 no edge sections, using a straight line`,e.id,t.points);return}let u=e.start??e.sourceId??o,d=e.end??e.targetId??s,f=_t(u,d,n.parentLookupDb,n.nodeDb);i.debug(`APA18 offset`,f,u,` ==> `,d,`edge:`,e,c);let p=e.sections[0],m=gt(p,f);c.x=c.offset.posX+c.width/2,c.y=c.offset.posY+c.height/2,l.x=l.offset.posX+l.width/2,l.y=l.offset.posY+l.height/2,c.shape!==`rect33`&&m.unshift({x:c.x,y:c.y}),l.shape!==`rect33`&&m.push({x:l.x,y:l.y}),t.points=Ct(wt(vt(m,c,l,i),jt(l),xt(t),i),jt(c),St(t),i),t.curve=`rounded`;let h=e.labels?.[0];h&&(t.x=h.x+f.x+h.width/2,t.y=h.y+f.y+h.height/2)}),o&&pt(e.edges)}r(mt,`applyElkEdgeLayout`);function ht(e,t,n,r){let i=e.width??0,a=e.height??0,o=e.offset.posY,s=o+a,c=.5,l=Math.abs(t.y-o)<=c||Math.abs(t.y-s)<=c;if((l?i:a)>=2*me||r.has(e.id))return;r.add(e.id);let u=l?t.x-(e.offset.posX+i/2):t.y-(e.offset.posY+a/2);if(Math.abs(u)<.01)return;l?(e.offset.posX+=u,e.x=e.offset.posX+i/2):(e.offset.posY+=u,e.y=e.offset.posY+a/2);let d=n.get(e.id);d&&(d.x=e.offset.posX+i/2,d.y=e.offset.posY+a/2)}r(ht,`alignDegenerateNodeToAnchor`);function gt(e,t){let n=e.startPoint,r=e.endPoint,i=(e.bendPoints?e.bendPoints:[]).map(e=>({x:e.x+t.x,y:e.y+t.y}));return[{x:n.x+t.x,y:n.y+t.y},...i,{x:r.x+t.x,y:r.y+t.y}]}r(gt,`createEdgePointsFromSection`);function _t(e,t,n,r){let i=p(e,t,n);if(i===void 0||i===`root`)return{x:0,y:0};let a=r[i],o=a?.elkOrigin??a?.offset;return{x:o?.posX??0,y:o?.posY??0}}r(_t,`calcOffset`);function vt(e,t,n,r){let i=Array.isArray(e)?[...e]:[],a=jt(n);r.debug(`PPP cutter2: Points before cutter2:`,JSON.stringify(e),`endBounds:`,a,S(a,e[e.length-1]));let o;{let e=jt(t),a=jt(n),s=!!t?.isGroup,c=!!n?.isGroup,{candidate:l,centerApprox:u}=Pt(i,t,`start`),{candidate:d,centerApprox:f}=Pt(i,n,`end`),p=s&&S(e,l),m=c&&S(a,d);Ft(i,`start`,p&&u),Ft(i,`end`,m&&f),s&&!p&&(p=It(i,e,`start`)),c&&!m&&(m=It(i,a,`end`)),p||m?(p||Lt(i,t,e,r),m||Rt(i,n,a,r),r.debug(`PPP cutter2: skipping cutter2 due to on-border group endpoint(s)`,{skipStart:p,skipEnd:m,startCenterApprox:u,endCenterApprox:f,startCandidate:l,endCandidate:d}),o=i):o=Bt(t,n,i,r)}if(r.debug(`PPP cutter2: Points after cutter2:`,JSON.stringify(o)),!Array.isArray(o)||o.length<2||yt(o)){r.warn(`POI cutter2: Invalid points from cutter2, falling back to prevPoints`,o);let e=i.filter(e=>Number.isFinite(e?.x)&&Number.isFinite(e?.y));o=e.length>=2?e:i}return r.debug(`UIO cutter2: Points after cutter2 (sanitized):`,o),bt(o,r)}r(vt,`sanitizeElkEdgePoints`);function yt(e){return e?.some(e=>!Number.isFinite(e?.x)||!Number.isFinite(e?.y))}r(yt,`hasInvalidPoint`);function bt(e,t){let n=e.filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return Math.abs(e.x-r.x)>1e-6||Math.abs(e.y-r.y)>1e-6});return n.length!==e.length&&t.debug(`UIO cutter2: removed consecutive duplicate points`,{before:e,after:n}),n}r(bt,`dedupeConsecutivePoints`);function xt(e){return fe(e.arrowTypeEnd)}r(xt,`getEndMarkerPathOffset`);function St(e){return fe(e.arrowTypeStart)}r(St,`getStartMarkerPathOffset`);function Ct(e,t,n,r){if(n<=0||e.length<3)return e;let i=e[0],a=e[1],o=Math.hypot(a.x-i.x,a.y-i.y);if(o>=Math.max(de,n*2)||!S(t,a,1))return e;let s=[i,...e.slice(2)];return r.debug(`UIO cutter2: removed short start marker segment`,{before:e,after:s,markerOffset:n,segmentLength:o}),s}r(Ct,`ensureStartMarkerSegmentLength`);function wt(e,t,n,r){if(n<=0||e.length<3)return e;let i=e[e.length-1],a=e[e.length-2],o=Math.hypot(i.x-a.x,i.y-a.y);if(o>=Math.max(de,n*2)||!S(t,a,1))return e;let s=[...e.slice(0,-2),i];return r.debug(`UIO cutter2: removed short end marker segment`,{before:e,after:s,markerOffset:n,segmentLength:o}),s}r(wt,`ensureEndMarkerSegmentLength`);function Tt(e,t){let n=e.edges.defaultInterpolate,r=e.edges.defaultStyle,i=t.getConfig();e.edges.forEach(e=>{let a=kt(e,{defaultStyle:r,defaultInterpolate:n,confCurve:i.curve},t);Object.assign(e,a)})}r(Tt,`applyElkEdgeRenderData`);function Et(e){if(e.classes!==void 0)return e.classes;if(e.start&&e.end)return`flowchart-link LS_${e.start} LE_${e.end}`}r(Et,`buildFallbackEdgeClasses`);function Dt(e,t,n){let r=`normal`,i=`solid`,a=[],o=[];return e===`dotted`?(i=`dotted`,a=[`fill:none`,`stroke-width:2px`,`stroke-dasharray:3`]):e===`thick`?(r=`thick`,a=[`stroke-width: 3.5px`,`fill:none`]):(a=t??[`fill:none`],n!==void 0&&(o=n)),{thickness:r,pattern:i,style:a,labelStyle:o}}r(Dt,`computeStroke`);function Ot(e,t,n){return e===void 0?t===void 0?n:t:e}r(Ot,`getCurve`);function kt(e,t,n){let r={};r.minlen=e.minlen??e.length??1,r.text=e.text??e.label,r.arrowhead=e.arrowhead??(e.type===`arrow_open`?`none`:`normal`);let i=pe[e.type??`arrow_open`]??pe.arrow_open;r.arrowTypeStart=e.arrowTypeStart??i[0],r.arrowTypeEnd=e.arrowTypeEnd??i[1],r.startLabelRight=e.startLabelRight,r.endLabelLeft=e.endLabelLeft;let o=Dt(e.stroke,t.defaultStyle,t.defaultLabelStyle);r.thickness=e.thickness??o.thickness,r.pattern=e.pattern??o.pattern,r.style=e.style??o.style,r.labelStyle=e.labelStyle??o.labelStyle,r.classes=Et(e),r.curve=n.interpolateToCurve(Ot(e.curve??e.interpolate,t.defaultInterpolate,t.confCurve),a);let s=(r.text??``)!==``;return e.arrowheadStyle===void 0?(s||e.style!==void 0)&&(r.arrowheadStyle=`fill: #333`):r.arrowheadStyle=e.arrowheadStyle,r.labelpos=e.labelpos??(s?`c`:void 0),r.labelType=e.labelType,r.label=(e.label??r.text??``).replace(n.common.lineBreakRegex,` +... Falling back to non-web worker version.`);if(!a.workerFactory){var c=e("./elk-worker.min.js").Worker;a.workerFactory=function(e){return new c(e)}}return i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,a))}return n}(e("./elk-api.js").default);Object.defineProperty(t.exports,"__esModule",{value:!0}),t.exports=o,o.default=o},{"./elk-api.js":1,"./elk-worker.min.js":2,"web-worker":4}],4:[function(e,t,n){t.exports=Worker},{}]},{},[3])(3)})}))(),1),p=r((e,t,{parentById:n})=>{let r=new Set,i=e;if(e===t)return n[e]||`root`;for(;i;){if(r.add(i),i===t)return i;i=n[i]}for(i=t;i;){if(r.has(i))return i;i=n[i]}return`root`},`findCommonAncestor`),m=6;function h(e,{measure:t}){let n=e.config?.elk?.lineHops;if(n===!1)return;let r=e.edges.filter(e=>Array.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));d(t.groups.edgePaths,r,{enabled:!0,jumpRadius:m,jumpStyle:n===`gap`?`gap`:`arc`})}r(h,`applyElkLineJumps`);var g={},_={},v={},y={},b=1,x=10,S=r((e,t,n=.5)=>{let r=e.width/2,i=e.height/2,a=e.x-r,o=e.x+r,s=e.y-i,c=e.y+i,l=Math.abs(t.x-a)<=n&&t.y>=s-n&&t.y<=c+n,u=Math.abs(t.x-o)<=n&&t.y>=s-n&&t.y<=c+n,d=Math.abs(t.y-s)<=n&&t.x>=a-n&&t.x<=o+n,f=Math.abs(t.y-c)<=n&&t.x>=a-n&&t.x<=o+n;return l||u||d||f},`onBorder`),ee=r((e,t,n)=>{let r=e.x,i=e.y,a=Math.abs(r-n.x),o=e.width/2,s=n.xMath.abs(r-t.x)*c){let e=n.y{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),ne=r((e,t,n=x)=>{let r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y),a=e.width/2,o=e.height/2;if(Math.abs(r-a)0)return{x:e.x+r/a*(a+n),y:e.y+i/a*(a+n)}}return t},`ensureTrulyOutside`),C=r((e,t,n)=>{let r=Math.abs(t.x-e.x){if(!e?.intersect)return null;let r=e.intersect(n);return!r||n.xt.x||n.x>t.x&&r.xee(e,t,C(e,t,n)),`fallbackIntersection`),ae=20,oe=1e-6,se=r((e,t,n)=>{let r=e.intersect?.(n);return r?Math.hypot(n.x-t.x,n.y-t.y)<=Math.hypot(r.x-t.x,r.y-t.y)+1e-9:!1},`insideOutline`),ce=r((e,t,n,i)=>{if(!e?.intersect)return null;let a=i.x-n.x,o=i.y-n.y;if(a===0&&o===0||Math.abs(a)>oe&&Math.abs(o)>oe)return null;let s={x:t.x,y:t.y},c=Math.abs(a)>Math.abs(o),l=r(e=>c?{x:e,y:n.y}:{x:n.x,y:e},`along`),u=c?s.x:s.y,d=c?n.x:n.y;if(!se(e,s,l(u)))return null;if(se(e,s,l(d)))return{...n};for(let t=0;t{let i=ne(t,n);return re(e,t,i)??ie(t,i,r)},`computeNodeIntersection`),ue=r((e,t,n,r=.1)=>{if(!(!n||e.length===0))if(t===`start`)e.length>0&&Math.abs(e[0].x-n.x)0&&Math.abs(e[t].x-n.x)typeof e==`string`?Math.max(o[e]??0,s[e]??0):0,`markerPathOffset`),pe={arrow_open:[`none`,`none`],arrow_cross:[`none`,`arrow_cross`],double_arrow_cross:[`arrow_cross`,`arrow_cross`],arrow_point:[`none`,`arrow_point`],double_arrow_point:[`arrow_point`,`arrow_point`],arrow_circle:[`none`,`arrow_circle`],double_arrow_circle:[`arrow_circle`,`arrow_circle`]},me=12,he=`[top=${me},left=${me},bottom=${me},right=${me}]`,ge=24,_e=24,ve=50,ye=15,be=10,xe={"spacing.baseValue":15,"spacing.nodeNode":15,"elk.aspectRatio":`1.6`,"elk.expandNodes":`true`,"elk.rectpacking.trybox":`true`,"elk.rectpacking.packing.compaction.rowHeightReevaluation":`true`,"elk.rectpacking.packing.compaction.iterations":10,"elk.rectpacking.whiteSpaceElimination.strategy":`EQUAL_BETWEEN_STRUCTURES`,"elk.rectpacking.widthApproximation.strategy":`SCANLINE`},Se=[`nodeSize.constraints`,`nodeSize.minimum`,`elk.algorithm`,`elk.aspectRatio`,`elk.contentAlignment`,`elk.expandNodes`,`elk.padding`,...Object.keys(xe)];function Ce(e){for(let t of Se)delete e[t];e[`spacing.baseValue`]=_e,e[`spacing.nodeNode`]=ve}r(Ce,`clearContainerAlgorithmOptions`);var we=new Set([`elk.layered`,`elk.box`,`elk.rectpacking`,`elk.stress`,`elk.force`,`elk.mrtree`,`elk.radial`,`elk.sporeOverlap`]);function Te(e,t){if(typeof e==`string`){if(!we.has(e)){t?.warn(`Unknown container layout algorithm "${e}". Supported values: ${[...we].join(`, `)}. Falling back to the diagram's layout algorithm.`);return}return e}}r(Te,`resolveContainerAlgorithm`);function Ee(e){switch(e){case`LR`:return`RIGHT`;case`RL`:return`LEFT`;case`TB`:case`TD`:return`DOWN`;case`BT`:return`UP`;default:return`DOWN`}}r(Ee,`dir2ElkDirection`);function De(e){return c(e.shape)?(e.labelData?.width??e.labels?.[0]?.width??0)+(e.padding??0):0}r(De,`groupTitleWidth`);function Oe(e){return c(e.shape)?{"nodeSize.constraints":`[MINIMUM_SIZE, NODE_LABELS]`,"nodeSize.minimum":`(${De(e)}, 0)`}:{}}r(Oe,`groupTitleSizeOptions`);function ke(e,t,n,r){let i=(e.labelData?.width??0)+2*(e.padding??0),a=e.labelData?.height??0,o=Ve(t?.preset),s={...Oe(e),"spacing.baseValue":_e,"elk.layered.spacing.edgeNodeBetweenLayers":30,"elk.spacing.edgeEdge":20,"spacing.nodeNode":ve,"elk.padding":`[top=${ge},left=${ge},bottom=${ge},right=${ge}]`,"nodeLabels.placement":`[H_CENTER V_TOP, INSIDE]`,"elk.layered.mergeEdges":t?.mergeEdges,"elk.layered.nodePlacement.bk.fixedAlignment":t?.nodePlacementAlignment??o.alignment,"elk.layered.nodePlacement.strategy":t?.nodePlacementStrategy??o.containerPlacement,"elk.layered.cycleBreaking.strategy":t?.cycleBreakingStrategy??o.cycleBreaking,"elk.layered.nodePlacement.networkSimplex.nodeFlexibility":`PORT_POSITION`,"elk.spacing.portsSurrounding":he},c=Te(e.metadata?.algorithm,r);if(c){let e=a+ye;if(s[`nodeSize.constraints`]=`[MINIMUM_SIZE, NODE_LABELS]`,s[`nodeSize.minimum`]=`(${i}, ${e+ye})`,s[`elk.algorithm`]=c,s[`elk.hierarchyHandling`]=`SEPARATE_CHILDREN`,s[`elk.aspectRatio`]=`2.0`,s[`elk.contentAlignment`]=`H_CENTER V_TOP`,s[`elk.expandNodes`]=`true`,s[`elk.padding`]=`[top=${e},left=${ye},bottom=${ye},right=${ye}]`,c===`elk.rectpacking`){let e=a+be;Object.assign(s,xe,{"elk.padding":`[top=${e},left=${be},bottom=${be},right=${be}]`,"nodeSize.minimum":`(${i}, ${e+be})`})}}else e.dir&&(s[`elk.algorithm`]=n,s[`elk.direction`]=Ee(e.dir),s[`elk.hierarchyHandling`]=`SEPARATE_CHILDREN`);return Object.assign(s,y),s}r(ke,`buildSubgraphLayoutOptions`);function Ae(e,t){let n=new Set,i=new Map;for(let{id:t,parentId:n}of e){let e=i.get(n);e?e.push(t):i.set(n,[t])}for(let e of i.values()){let i=new Set(e),a=new Map(e.map(e=>[e,0])),o=new Map(e.map(e=>[e,[]])),s=[];for(let e of t){let t=e.source==null?void 0:String(e.source),n=e.target==null?void 0:String(e.target);!t||!n||t===n||!i.has(t)||!i.has(n)||(a.set(n,(a.get(n)??0)+1),o.get(t).push(n),o.get(n).push(t),s.push([t,n]))}let c=new Map,l=0;for(let t of e){if(c.has(t))continue;let e=[t];for(c.set(t,l);e.length>0;){let t=e.pop();for(let n of o.get(t))c.has(n)||(c.set(n,l),e.push(n))}l++}let u=Array(l).fill(!1);for(let t of e)(a.get(t)??0)===0&&(u[c.get(t)]=!0);if(!u.includes(!1))continue;let d=new Map(e.map(e=>[e,[]])),f=new Map(e.map(e=>[e,0])),p=r((e,t)=>{let n=new Set([e]),r=[e];for(;r.length>0;){let e=r.pop();if(e===t)return!0;for(let t of d.get(e))n.has(t)||(n.add(t),r.push(t))}return!1},`reaches`);for(let[e,t]of s)p(t,e)||(d.get(e).push(t),f.set(t,(f.get(t)??0)+1));let m=Array(l).fill(!1);for(let t of e){let e=c.get(t);!u[e]&&!m[e]&&f.get(t)===0&&(n.add(t),m[e]=!0)}}return n}r(Ae,`findCyclicEntryNodes`);function je(e,t){if(!e.config.elk?.keepEntryNodeOnTop)return;let n=Ae(e.nodes,e.edges.map(e=>({source:e.start,target:e.end})));for(let e of n){let n=t[e];n&&(n.layoutOptions={...n.layoutOptions,"elk.layered.layering.layerConstraint":`FIRST`})}}r(je,`applyCyclicEntryConstraint`);function Me(e,t){let n=ze(t);return Ie(n),Tt(e,n),{algorithm:n.algorithm}}r(Me,`prepareLayoutForElk`);async function Ne(e,t){let n=ze(t),r=Pe(e,n),i=new f.default;n.log.info(`Drawing flowchart using v4 renderer`,i);let a=await $e(i,r.elkGraph,n.log);return et(e,a,r,n.log),Le(e.nodes),a}r(Ne,`runElkLayoutCore`);function Pe(e,t){let n={},r=He(e,t.algorithm,t.rootLayoutOptions),i=e.direction??`DOWN`;r.layoutOptions[`elk.direction`]=Ee(i);let a=Ue(e.nodes,t.log);return We(e.nodes,r,n,t),Je(e,r,n,t),Xe(e,n,a,t),Ze(r,n,a,t.log),je(e,n),{elkGraph:r,nodeDb:n,parentLookupDb:a}}r(Pe,`buildElkGraphFromLayoutData`);var Fe=u({afterPaint:h,prepareLayout:Me,measureLayout:r((e,t)=>l(e,t,{unwrapGroupLabels:!0}),`measureLayout`),runLayoutCore:Ne,paintOptions:{skipIntersect:!0}});function Ie(e){i(e.getConfig())}r(Ie,`syncHostConfig`);function Le(e){let t=new Map(e.map(e=>[e.id,e]));e.sort((e,n)=>e.isGroup===n.isGroup?e.isGroup&&n.isGroup?Re(e,t)-Re(n,t):0:e.isGroup?-1:1)}r(Le,`orderNodesForElkPaint`);function Re(e,t){let n=0,r=new Set,i=e.parentId;for(;i&&!r.has(i);){r.add(i);let e=t.get(i);if(!e?.isGroup)break;n++,i=e.parentId}return n}r(Re,`getGroupDepth`);function ze(e){let t=e.helpers;if(!t)throw Error(`ELK layout requires Mermaid internal helpers`);return{algorithm:e.preparedLayout?.algorithm??e.options?.algorithm,rootLayoutOptions:e.options?.rootLayoutOptions,common:t.common,getConfig:t.getConfig,interpolateToCurve:t.interpolateToCurve,log:t.log}}r(ze,`getElkLayoutContext`);var Be={default:{layering:`NETWORK_SIMPLEX`,placement:`BRANDES_KOEPF`,containerPlacement:`BRANDES_KOEPF`,alignment:`BALANCED`,cycleBreaking:`DEPTH_FIRST`},legacy:{layering:`NETWORK_SIMPLEX`,placement:`BRANDES_KOEPF`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`GREEDY`},modelOrder:{layering:`NETWORK_SIMPLEX`,placement:`NETWORK_SIMPLEX`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`GREEDY_MODEL_ORDER`},depthFirst:{layering:`NETWORK_SIMPLEX`,placement:`NETWORK_SIMPLEX`,containerPlacement:`BRANDES_KOEPF`,alignment:`NONE`,cycleBreaking:`DEPTH_FIRST`}};function Ve(e){return e!==void 0&&Object.hasOwn(Be,e)?Be[e]:Be.default}r(Ve,`resolveElkPreset`);function He(e,t,n){let r=Ve(e.config.elk?.preset),i={id:`root`,layoutOptions:{"elk.hierarchyHandling":`INCLUDE_CHILDREN`,"elk.algorithm":t,"elk.layered.nodePlacement.strategy":e.config.elk?.nodePlacementStrategy??r.placement,"elk.layered.nodePlacement.bk.fixedAlignment":e.config.elk?.nodePlacementAlignment??r.alignment,"elk.layered.mergeEdges":e.config.elk?.mergeEdges,"elk.direction":`DOWN`,"spacing.baseValue":40,"elk.layered.crossingMinimization.forceNodeModelOrder":e.config.elk?.forceNodeModelOrder,"elk.layered.considerModelOrder.strategy":e.config.elk?.considerModelOrder,"elk.layered.unnecessaryBendpoints":!0,"elk.layered.cycleBreaking.strategy":e.config.elk?.cycleBreakingStrategy??r.cycleBreaking,"elk.layered.layering.strategy":e.config.elk?.layeringStrategy??r.layering,"elk.layered.layering.coffmanGraham.layerBound":e.config.elk?.layeringLayerBound,"elk.layered.wrapping.multiEdge.improveCuts":!0,"elk.layered.wrapping.multiEdge.improveWrappedEdges":!0,"elk.layered.edgeRouting.selfLoopDistribution":`EQUALLY`,"elk.layered.mergeHierarchyEdges":!0,"elk.spacing.portsSurrounding":he},children:[],edges:[]};return t===`elk.rectpacking`&&Object.assign(i.layoutOptions,xe,{"elk.contentAlignment":`H_CENTER V_TOP`,"elk.padding":`[top=15,left=15,bottom=15,right=15]`}),n&&Object.assign(i.layoutOptions,n),Object.assign(i.layoutOptions,g,_,v),i}r(He,`createRootElkGraph`);function Ue(e,t){let n={parentById:{},childrenById:{}},r=e.filter(e=>e.isGroup);return t.info(`Subgraphs - `,r),r.forEach(t=>{e.filter(e=>e.parentId===t.id).forEach(e=>{n.parentById[e.id]=t.id,n.childrenById[t.id]??=[],n.childrenById[t.id].push(e.id)})}),n}r(Ue,`addSubGraphs`);function We(e,t,n,r,i){let a=e.filter(e=>e?.parentId===i);return r.log.info(`addVertices APA12`,a,i),a.forEach(i=>{Ge(t,e,i,n,r)}),t}r(We,`addVertices`);function Ge(e,t,n,r,i){let a=Ke(n);e.children.push(a),r[n.id]=a,n.isGroup&&(a.children=[],We(t,a,r,i,n.id),a.labelData=qe(n,i.getConfig()))}r(Ge,`addVertex`);function Ke(e){let t={...e};return delete t.domId,e.isGroup?t.children=[]:(t.width=e.width??0,t.height=e.height??0,e.spreadPorts&&(t.layoutOptions={...t.layoutOptions,"elk.portAlignment.default":`CENTER`})),t}r(Ke,`createElkNode`);function qe(e,t){return e.labelData||(e.labelBBox?{width:e.labelBBox.width,height:Math.max(0,e.labelBBox.height-2),wrappingWidth:e.wrappingWidth??t.flowchart?.wrappingWidth}:{width:0,height:0,wrappingWidth:e.wrappingWidth??t.flowchart?.wrappingWidth})}r(qe,`getMeasuredLabelData`);function Je(e,t,n,r){r.log.info(`abc78 DAGA edges = `,e);let i={};return e.edges.forEach(e=>{let a=e.id;i[a]=(i[a]??-1)+1;let o=a;e.id=o,r.log.info(`abc78 new link id to be used is`,a,o,i[a]);let{source:s,target:c,sourceId:l,targetId:u}=Ye(e,n);r.log.debug(`abc78 source and target`,s,c),t.edges.push({...e,sources:[s],targets:[c],sourceId:l,targetId:u,labels:[{width:e.width??0,height:e.height??0,orgWidth:e.width??0,orgHeight:e.height??0,text:e.label??``,layoutOptions:{"edgeLabels.inline":`true`,"edgeLabels.placement":`CENTER`}}]})}),t}r(Je,`addEdgesToElkGraph`);function Ye(e,t){let n=e.start,r=e.end,i=n,a=r,o=n?t[n]:void 0,s=r?t[r]:void 0;return!o||!s?{source:i,target:a}:{source:i,target:a,sourceId:n,targetId:r}}r(Ye,`getEdgeStartEndPoint`);function Xe(e,t,n,r){e.nodes.forEach(i=>{let a=t[i.id];!a||n.childrenById[a.id]===void 0||(a.labels=[{text:a.label,width:a?.labelData?.width??50,height:a?.labelData?.height??50}],r.log.debug(`UIO node label`,a?.labelData?.width,a.padding),a.layoutOptions=ke(a,e.config.elk,r.algorithm,r.log),delete a.x,delete a.y,delete a.width,delete a.height)})}r(Xe,`configureSubgraphNodes`);function Ze(e,t,n,r){r.debug(`APA01 processing edges, count:`,e.edges.length),e.edges.forEach((e,i)=>{r.debug(`APA01 processing edge`,i,`:`,e);let a=e.sources[0],o=e.targets[0];if(r.debug(`APA01 source:`,a,`target:`,o),r.debug(`APA01 nodeDb[source]:`,t[a]),r.debug(`APA01 nodeDb[target]:`,t[o]),t[a]&&t[o]&&t[a].parentId!==t[o].parentId){let e=p(a,o,n);Qe(t,a,e,r),Qe(t,o,e,r)}})}r(Ze,`configureCrossHierarchyEdges`);function Qe(e,t,n,r){let i=e[t];i&&(i.layoutOptions??={},i.layoutOptions[`elk.hierarchyHandling`]===`SEPARATE_CHILDREN`&&Te(i.metadata?.algorithm)&&(r.debug(`Dropping explicit algorithm for node`,i.id,`due to cross-boundary edges`),Ce(i.layoutOptions),Object.assign(i.layoutOptions,Oe(i))),i.layoutOptions[`elk.hierarchyHandling`]=`INCLUDE_CHILDREN`,i.id!==n&&i.parentId&&Qe(e,i.parentId,n,r))}r(Qe,`setIncludeChildrenPolicy`);async function $e(e,t,n){let r=globalThis.__mermaidProfiler;try{r?.begin(`layoutCore`);let i;try{i=await e.layout(t)}finally{r?.end()}return n.debug(`APA01 after - success`),n.debug(`APA01 layout result:`,i),i}catch(e){throw n.error(`ELK layout error:`,e),e}}r($e,`runElkLayout`);function et(e,t,n,r){let i=new Map(e.nodes.map(e=>[e.id,e]));it(t.children??[],n,i,0,0,0,r),rt(t.children??[],n,i,t),mt(e,t,n,r)}r(et,`applyElkLayoutResult`);function tt(e,t=new Set){for(let n of e.children??[])t.add(n.id),tt(n,t);return t}r(tt,`collectDescendantIds`);function nt(e,t,n,r){let i=[];for(let a of e.edges??[]){let e=a.sources?.[0]??a.start,o=a.targets?.[0]??a.end,s=t.has(e)&&t.has(o),c=e===r,l=o===r;if(!s&&!c&&!l)continue;let u=_t(e,o,n.parentLookupDb,n.nodeDb);for(let e of a.sections??[]){let t=s?[e.startPoint,...e.bendPoints??[],e.endPoint]:[c?e.startPoint:null,l?e.endPoint:null];for(let e of t)e&&i.push({x:e.x+u.x,y:e.y+u.y})}}return i}r(nt,`internalEdgePoints`);function rt(e,t,n,r={}){for(let i of e){if(!i?.isGroup)continue;let e=i.children??[];rt(e,t,n,r);let a=t.nodeDb[i.id],o=e.map(e=>t.nodeDb[e.id]).filter(e=>e?.offset&&e.width&&e.height);if(!a?.offset||o.length===0)continue;let s=nt(r,tt(i),t,i.id),c=[...o.map(e=>e.offset.posX),...o.map(e=>e.offset.posX+e.width),...s.map(e=>e.x)],l=[...o.map(e=>e.offset.posY),...o.map(e=>e.offset.posY+e.height),...s.map(e=>e.y)],u=a.offset,d=Math.max(u.posX,Math.min(...c)-ge),f=Math.min(u.posX+a.width,Math.max(...c)+ge),p=Math.min(u.posY+a.height,Math.max(...l)+ge),m=u.posY,h=De(i),g=d,_=f-d;if(_{if(!e)return;let s=t.nodeDb[e.id]??e,c=Math.max(e.width,e.labels&&e.labels[0]?.width||0),l={posX:e.x+r,posY:e.y+i,x:r,y:i,depth:a,width:c,height:e.height};s.offset=l,s.x=l.posX+e.width/2,s.y=l.posY+e.height/2,s.width=e.width,s.height=e.height;let u=n.get(e.id);if(u){u.x=s.x,u.y=s.y,u.width=e.isGroup?Math.max(e.width,e.labelData?.width??0):e.width,u.height=e.height;let t=u;t.labelData=e.labelData,t.labels=e.labels}e.isGroup?(o.debug(`Id abc88 subgraph = `,e.id,e.x,e.y,e.labelData),it(e.children??[],t,n,l.posX,l.posY,a+1,o)):o.info(`Id NODE = `,e.id,e.x,e.y,r,i,`translate(${s.x}, ${s.y})`)})}r(it,`applyElkNodePositions`);var at=16,ot=30,st=.01;function ct(e,t){let n=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y);if(n>st&&r<=st)return`h`;if(r>st&&n<=st)return`v`}r(ct,`axisOf`);function lt(e){let t=ut(e)??e,n=ut([...t].reverse());return n&&(t=n.reverse()),t}r(lt,`straightenTerminalJogs`);function ut(e){if(e.length<5)return null;let[t,n,r,i]=e,a=ct(t,n);if(!a||ct(r,i)!==a||ct(n,r)!==(a===`h`?`v`:`h`)||Math.hypot(n.x-t.x,n.y-t.y)>ot)return null;let o=Math.abs(a===`h`?r.y-n.y:r.x-n.x);if(oat||!(a===`h`?Math.sign(n.x-t.x)===Math.sign(i.x-r.x):Math.sign(n.y-t.y)===Math.sign(i.y-r.y)))return null;let s=3;for(;s+1(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),`side`),o=a(n,i,e),s=a(n,i,t),c=a(e,t,n),l=a(e,t,i);return(o>0&&s<0||o<0&&s>0)&&(c>0&&l<0||c<0&&l>0)}r(dt,`segmentsCrossStrict`);function ft(e,t){let n=0;for(let r=0;re.points??[]);for(let[n,r]of e.entries()){let e=t[n];if(e.length<5)continue;let i=lt(e);if(i===e)continue;let a=0,o=0;for(let[r,s]of t.entries())r===n||s.length<2||(a+=ft(e,s),o+=ft(i,s));o>a||(r.points=i,t[n]=i)}}r(pt,`straightenEdgeTerminals`);function mt(e,t,n,i){let a=new Map(e.edges.map(e=>[e.id,e])),o=e.config.elk?.straightenEdges!==!1,s=new Map(e.nodes.map(e=>[e.id,e])),c=new Set;t.edges?.forEach(e=>{if(!e.sections?.length)return;let t=n.nodeDb[e.sources?.[0]??e.start],r=n.nodeDb[e.targets?.[0]??e.end];if(!t||!r)return;let i=_t(e.start??e.sourceId??e.sources?.[0],e.end??e.targetId??e.targets?.[0],n.parentLookupDb,n.nodeDb),a=e.sections[0];t.shape!==`rect33`&&ht(t,{x:a.startPoint.x+i.x,y:a.startPoint.y+i.y},s,c),r.shape!==`rect33`&&ht(r,{x:a.endPoint.x+i.x,y:a.endPoint.y+i.y},s,c)}),t.edges?.forEach(e=>{let t=a.get(e.id);if(!t)return;let o=e.sources?.[0]??e.start,s=e.targets?.[0]??e.end,c=n.nodeDb[o],l=n.nodeDb[s];if(!c||!l)return;if(!e.sections?.length){let n=r(e=>({x:(e.offset?.posX??e.x??0)+(e.width??0)/2,y:(e.offset?.posY??e.y??0)+(e.height??0)/2}),`centre`),a=n(c),o=n(l);c.x=a.x,c.y=a.y,l.x=o.x,l.y=o.y;let s=vt([a,o],c,l,i);t.points=s,t.curve=`linear`;let u=s[0],d=s[s.length-1];t.x=(u.x+d.x)/2,t.y=(u.y+d.y)/2,i.debug(`APA18 no edge sections, using a straight line`,e.id,t.points);return}let u=e.start??e.sourceId??o,d=e.end??e.targetId??s,f=_t(u,d,n.parentLookupDb,n.nodeDb);i.debug(`APA18 offset`,f,u,` ==> `,d,`edge:`,e,c);let p=e.sections[0],m=gt(p,f);c.x=c.offset.posX+c.width/2,c.y=c.offset.posY+c.height/2,l.x=l.offset.posX+l.width/2,l.y=l.offset.posY+l.height/2,c.shape!==`rect33`&&m.unshift({x:c.x,y:c.y}),l.shape!==`rect33`&&m.push({x:l.x,y:l.y}),t.points=Ct(wt(vt(m,c,l,i),jt(l),xt(t),i),jt(c),St(t),i),t.curve=`rounded`;let h=e.labels?.[0];h&&(t.x=h.x+f.x+h.width/2,t.y=h.y+f.y+h.height/2)}),o&&pt(e.edges)}r(mt,`applyElkEdgeLayout`);function ht(e,t,n,r){let i=e.width??0,a=e.height??0,o=e.offset.posY,s=o+a,c=.5,l=Math.abs(t.y-o)<=c||Math.abs(t.y-s)<=c;if((l?i:a)>=2*me||r.has(e.id))return;r.add(e.id);let u=l?t.x-(e.offset.posX+i/2):t.y-(e.offset.posY+a/2);if(Math.abs(u)<.01)return;l?(e.offset.posX+=u,e.x=e.offset.posX+i/2):(e.offset.posY+=u,e.y=e.offset.posY+a/2);let d=n.get(e.id);d&&(d.x=e.offset.posX+i/2,d.y=e.offset.posY+a/2)}r(ht,`alignDegenerateNodeToAnchor`);function gt(e,t){let n=e.startPoint,r=e.endPoint,i=(e.bendPoints?e.bendPoints:[]).map(e=>({x:e.x+t.x,y:e.y+t.y}));return[{x:n.x+t.x,y:n.y+t.y},...i,{x:r.x+t.x,y:r.y+t.y}]}r(gt,`createEdgePointsFromSection`);function _t(e,t,n,r){let i=p(e,t,n);if(i===void 0||i===`root`)return{x:0,y:0};let a=r[i],o=a?.elkOrigin??a?.offset;return{x:o?.posX??0,y:o?.posY??0}}r(_t,`calcOffset`);function vt(e,t,n,r){let i=Array.isArray(e)?[...e]:[],a=jt(n);r.debug(`PPP cutter2: Points before cutter2:`,JSON.stringify(e),`endBounds:`,a,S(a,e[e.length-1]));let o;{let e=jt(t),a=jt(n),s=!!t?.isGroup,c=!!n?.isGroup,{candidate:l,centerApprox:u}=Pt(i,t,`start`),{candidate:d,centerApprox:f}=Pt(i,n,`end`),p=s&&S(e,l),m=c&&S(a,d);Ft(i,`start`,p&&u),Ft(i,`end`,m&&f),s&&!p&&(p=It(i,e,`start`)),c&&!m&&(m=It(i,a,`end`)),p||m?(p||Lt(i,t,e,r),m||Rt(i,n,a,r),r.debug(`PPP cutter2: skipping cutter2 due to on-border group endpoint(s)`,{skipStart:p,skipEnd:m,startCenterApprox:u,endCenterApprox:f,startCandidate:l,endCandidate:d}),o=i):o=Bt(t,n,i,r)}if(r.debug(`PPP cutter2: Points after cutter2:`,JSON.stringify(o)),!Array.isArray(o)||o.length<2||yt(o)){r.warn(`POI cutter2: Invalid points from cutter2, falling back to prevPoints`,o);let e=i.filter(e=>Number.isFinite(e?.x)&&Number.isFinite(e?.y));o=e.length>=2?e:i}return r.debug(`UIO cutter2: Points after cutter2 (sanitized):`,o),bt(o,r)}r(vt,`sanitizeElkEdgePoints`);function yt(e){return e?.some(e=>!Number.isFinite(e?.x)||!Number.isFinite(e?.y))}r(yt,`hasInvalidPoint`);function bt(e,t){let n=e.filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return Math.abs(e.x-r.x)>1e-6||Math.abs(e.y-r.y)>1e-6});return n.length!==e.length&&t.debug(`UIO cutter2: removed consecutive duplicate points`,{before:e,after:n}),n}r(bt,`dedupeConsecutivePoints`);function xt(e){return fe(e.arrowTypeEnd)}r(xt,`getEndMarkerPathOffset`);function St(e){return fe(e.arrowTypeStart)}r(St,`getStartMarkerPathOffset`);function Ct(e,t,n,r){if(n<=0||e.length<3)return e;let i=e[0],a=e[1],o=Math.hypot(a.x-i.x,a.y-i.y);if(o>=Math.max(de,n*2)||!S(t,a,1))return e;let s=[i,...e.slice(2)];return r.debug(`UIO cutter2: removed short start marker segment`,{before:e,after:s,markerOffset:n,segmentLength:o}),s}r(Ct,`ensureStartMarkerSegmentLength`);function wt(e,t,n,r){if(n<=0||e.length<3)return e;let i=e[e.length-1],a=e[e.length-2],o=Math.hypot(i.x-a.x,i.y-a.y);if(o>=Math.max(de,n*2)||!S(t,a,1))return e;let s=[...e.slice(0,-2),i];return r.debug(`UIO cutter2: removed short end marker segment`,{before:e,after:s,markerOffset:n,segmentLength:o}),s}r(wt,`ensureEndMarkerSegmentLength`);function Tt(e,t){let n=e.edges.defaultInterpolate,r=e.edges.defaultStyle,i=t.getConfig();e.edges.forEach(e=>{let a=kt(e,{defaultStyle:r,defaultInterpolate:n,confCurve:i.curve},t);Object.assign(e,a)})}r(Tt,`applyElkEdgeRenderData`);function Et(e){if(e.classes!==void 0)return e.classes;if(e.start&&e.end)return`flowchart-link LS_${e.start} LE_${e.end}`}r(Et,`buildFallbackEdgeClasses`);function Dt(e,t,n){let r=`normal`,i=`solid`,a=[],o=[];return e===`dotted`?(i=`dotted`,a=[`fill:none`,`stroke-width:2px`,`stroke-dasharray:3`]):e===`thick`?(r=`thick`,a=[`stroke-width: 3.5px`,`fill:none`]):(a=t??[`fill:none`],n!==void 0&&(o=n)),{thickness:r,pattern:i,style:a,labelStyle:o}}r(Dt,`computeStroke`);function Ot(e,t,n){return e===void 0?t===void 0?n:t:e}r(Ot,`getCurve`);function kt(e,t,n){let r={};r.minlen=e.minlen??e.length??1,r.text=e.text??e.label,r.arrowhead=e.arrowhead??(e.type===`arrow_open`?`none`:`normal`);let i=pe[e.type??`arrow_open`]??pe.arrow_open;r.arrowTypeStart=e.arrowTypeStart??i[0],r.arrowTypeEnd=e.arrowTypeEnd??i[1],r.startLabelRight=e.startLabelRight,r.endLabelLeft=e.endLabelLeft;let o=Dt(e.stroke,t.defaultStyle,t.defaultLabelStyle);r.thickness=e.thickness??o.thickness,r.pattern=e.pattern??o.pattern,r.style=e.style??o.style,r.labelStyle=e.labelStyle??o.labelStyle,r.classes=Et(e),r.curve=n.interpolateToCurve(Ot(e.curve??e.interpolate,t.defaultInterpolate,t.confCurve),a);let s=(r.text??``)!==``;return e.arrowheadStyle===void 0?(s||e.style!==void 0)&&(r.arrowheadStyle=`fill: #333`):r.arrowheadStyle=e.arrowheadStyle,r.labelpos=e.labelpos??(s?`c`:void 0),r.labelType=e.labelType,r.label=(e.label??r.text??``).replace(n.common.lineBreakRegex,` `),r}r(kt,`buildEdgeData`);function At(e){return Math.max(e.width??0,De(e))}r(At,`getEffectiveGroupWidth`);function jt(e){let t=e?.isGroup?At(e):e.width;return{x:e.offset.posX+e.width/2,y:e.offset.posY+e.height/2,width:t??0,height:e.height??0,padding:e.padding}}r(jt,`boundsFor`);function Mt(e,t,n=1e-6){return Math.abs(e-t)1?e[1]:n,centerApprox:r}}{let n=e[e.length-1],r=Nt(n,t);return{candidate:r&&e.length>1?e[e.length-2]:n,centerApprox:r}}}r(Pt,`getCandidateBorderPoint`);function Ft(e,t,n){n&&(t===`start`?e.length>0&&e.shift():e.length>0&&e.pop())}r(Ft,`dropAutoCenterPoint`);function It(e,t,n){let r=n===`start`?1:-1,i=n===`start`?0:e.length-1,a=i;for(;i>=0&&i=e.length)return!1;let o=e[i],s=e[i-r],c=o.x-s.x,l=o.y-s.y,u=c===0?1/0:(t.x+Math.sign(c)*t.width/2-s.x)/c,d=l===0?1/0:(t.y+Math.sign(l)*t.height/2-s.y)/l,f=Math.min(u,d),p={x:s.x+f*c,y:s.y+f*l};return n===`start`?e.splice(0,i,p):e.splice(i+1,e.length-i-1,p),!0}r(It,`clipGroupEndpoint`);function Lt(e,t,n,r){let i=-1;for(let[t,r]of e.entries())if(te(n,r)){i=t;break}if(i!==-1){let a=e[i],o=e[0],s=le(t,n,a,o);ue(e,`start`,s),r.debug(`UIO cutter2: start-only intersection applied`,{startIntersection:s})}}r(Lt,`applyStartIntersectionIfNeeded`);function Rt(e,t,n,r){let i=-1;for(let t=e.length-1;t>=0;t--)if(te(n,e[t])){i=t;break}if(i!==-1){let a=e[i],o=e[e.length-1],s=le(t,n,a,o);ue(e,`end`,s),r.debug(`UIO cutter2: end-only intersection applied`,{endIntersection:s})}}r(Rt,`applyEndIntersectionIfNeeded`);function zt(e,t,n,r,i){if(e?.isGroup)return null;let a=n[r],o=n[r+i];return!a||!o?null:ce(e,t,a,o)}r(zt,`attachAlongDepartureAxis`);function Bt(e,t,n,r){let i=jt(e),a=jt(t);if(n.length===0)return[];let o=[...n],s=o[0],c=o[o.length-1];r.debug(`PPP cutter2: bounds`,{startBounds:i,endBounds:a}),r.debug(`PPP cutter2: original points`,n);let l=-1;for(let[e,t]of o.entries())l===-1&&te(i,t)&&(l=e);if(l!==-1){let t=o[l],n=zt(e,i,o,l,1)??le(e,i,t,s);r.debug(`UIO cutter2: start intersection`,n),ue(o,`start`,n)}let u=null,d=-1;for(let e=o.length-1;e>=0;e--)if(te(a,o[e])){u=o[e],d=e;break}if(!u&&o.length>1&&(u=o[o.length-2],d=o.length-2),u){let e=zt(t,a,o,d,-1)??le(t,a,u,c);r.debug(`UIO cutter2: end intersection`,{endIntersection:e,outsideIndexForEnd:d}),ue(o,`end`,e)}if(o.length>1){let e=o[o.length-1],t=o[o.length-2],n=Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2);n<2&&(r.debug(`UIO cutter2: trimming tail point (too close)`,{distance:n,lastPoint:e,secondLastPoint:t}),o.pop())}return r.debug(`UIO cutter2: final points`,o),o}r(Bt,`cutter2`);export{Fe as render}; \ No newline at end of file diff --git a/web/dist/app-erDiagram-OPXOYQCR.js b/web/dist/app-erDiagram-OPXOYQCR.js index cdeb480fb..f7ca1557f 100644 --- a/web/dist/app-erDiagram-OPXOYQCR.js +++ b/web/dist/app-erDiagram-OPXOYQCR.js @@ -1,9 +1,9 @@ -import{n as e,t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,U as a,a as o,it as s,q as c,s as l,v as u,w as d,x as f,y as p}from"./app-chunk-O7XYJQB3.js";import{t as m}from"./app-channel.js";import{c as h,g}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{a as _,i as v,o as y,r as b,t as x}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as S,t as C}from"./app-chunk-GNY47TPC.js";import{t as w}from"./app-chunk-XXDRQBXY.js";import{t as T}from"./app-chunk-WEXAMYUT.js";var E=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],r=[2,2],i=[1,7],a=[1,9],o=[1,10],s=[1,11],c=[1,12],l=[1,30],u=[1,23],d=[1,24],f=[1,25],p=[1,26],m=[1,27],h=[1,19],g=[1,28],_=[1,29],v=[1,20],y=[1,18],b=[1,21],x=[1,22],S=[2,6],C=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],w=[1,36],T=[1,37],E=[1,38],D=[1,39],O=[1,40],k=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],A=[1,46],j=[1,47],M=[1,57],N=[43,51,53,54,55,74,75],P=[1,70],F=[1,68],I=[1,65],L=[1,69],R=[1,71],z=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],B=[1,78],V=[1,77],H=[1,76],U=[69,70,71,72,73],W=[1,91],G=[6,9,45,50],K=[6,9,12,44,45,50,51,52],q=[1,101],J=[1,100],Y=[1,99],X=[18,61],ee=[1,110],te=[1,109],ne=[20,43,51,53,54,55],Z=[18,61,64,66],Q={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:`error`,4:`ER_DIAGRAM`,6:`EOF`,9:`NEWLINE`,12:`COLON`,14:`STYLE_SEPARATOR`,16:`BLOCK_START`,18:`BLOCK_STOP`,19:`SQS`,20:`SQE`,21:`title`,22:`title_value`,23:`acc_title`,24:`acc_title_value`,25:`acc_descr`,26:`acc_descr_value`,27:`acc_descr_multiline_value`,33:`END`,34:`SUBGRAPH`,37:`direction_tb`,38:`direction_bt`,39:`direction_rl`,40:`direction_lr`,41:`CLASSDEF`,43:`UNICODE_TEXT`,44:`STYLE_TEXT`,45:`COMMA`,46:`CLASS`,47:`STYLE`,50:`SEMI`,51:`NUM`,52:`BRKT`,53:`ENTITY_NAME`,54:`DECIMAL_NUM`,55:`ENTITY_ONE`,61:`ATTRIBUTE_WORD`,62:`?`,64:`,`,65:`ATTRIBUTE_KEY`,66:`COMMENT`,69:`ZERO_OR_ONE`,70:`ZERO_OR_MORE`,71:`ONE_OR_MORE`,72:`ONLY_ONE`,73:`MD_PARENT`,74:`NON_IDENTIFYING`,75:`IDENTIFYING`,76:`WORD`},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:this.$=[];break;case 3:this.$=a[s-1].concat(a[s]);break;case 4:this.$=a[s];break;case 5:case 6:this.$=[];break;case 7:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]),this.$=[a[s-4],a[s-2]];break;case 8:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-8],a[s-4]];break;case 9:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]),this.$=[a[s-6],a[s-2]];break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-6],a[s-4]];break;case 11:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]),this.$=[a[s-3]];break;case 12:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]),this.$=[a[s-5]];break;case 13:r.addEntity(a[s-2]),this.$=[a[s-2]];break;case 14:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-4]];break;case 15:r.addEntity(a[s]),this.$=[a[s]];break;case 16:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]),this.$=[a[s-2]];break;case 17:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]),this.$=[a[s-6]];break;case 18:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]),this.$=[a[s-8]];break;case 19:r.addEntity(a[s-5],a[s-3]),this.$=[a[s-5]];break;case 20:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]),this.$=[a[s-7]];break;case 21:r.addEntity(a[s-3],a[s-1]);break;case 22:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 23:case 24:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 25:case 26:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 27:r.subgraphDepth?this.$=a[s]:(r.setDirection(a[s].value),this.$=[]);break;case 31:r.subgraphDepth=(r.subgraphDepth||1)-1,this.$=r.addSubGraph({text:a[s-2].id},a[s-1],{text:a[s-2].text});break;case 32:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-1],text:a[s-1]};break;case 33:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-4],text:a[s-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=a[s];break;case 35:this.$=a[s-1]+` `+a[s];break;case 36:this.$={stmt:`dir`,value:`TB`};break;case 37:this.$={stmt:`dir`,value:`BT`};break;case 38:this.$={stmt:`dir`,value:`RL`};break;case 39:this.$={stmt:`dir`,value:`LR`};break;case 40:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 41:case 42:case 63:case 72:this.$=[a[s]];break;case 43:case 44:this.$=a[s-2].concat([a[s]]);break;case 45:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 46:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 47:this.$=[a[s]];break;case 48:a[s-2].push(a[s]),this.$=a[s-2];break;case 50:this.$=a[s-1]+a[s];break;case 58:case 84:case 85:this.$=a[s].replace(/"/g,``);break;case 64:a[s].push(a[s-1]),this.$=a[s];break;case 65:this.$={type:a[s-1],name:a[s]};break;case 66:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 67:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 68:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 69:case 71:case 74:this.$=a[s];break;case 70:this.$=a[s-1]+a[s];break;case 73:a[s-2].push(a[s]),this.$=a[s-2];break;case 75:this.$=a[s].replace(/"/g,``);break;case 76:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 77:this.$=r.Cardinality.ZERO_OR_ONE;break;case 78:this.$=r.Cardinality.ZERO_OR_MORE;break;case 79:this.$=r.Cardinality.ONE_OR_MORE;break;case 80:this.$=r.Cardinality.ONLY_ONE;break;case 81:this.$=r.Cardinality.MD_PARENT;break;case 82:this.$=r.Identification.NON_IDENTIFYING;break;case 83:this.$=r.Identification.IDENTIFYING}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,r,{5:3}),{6:[1,4],7:5,8:6,9:i,10:8,21:a,23:o,25:s,27:c,28:13,29:14,30:15,31:16,32:17,34:l,37:u,38:d,39:f,40:p,41:m,43:h,46:g,47:_,51:v,53:y,54:b,55:x},t(n,S,{1:[2,1]}),t(C,[2,3]),t(C,[2,4]),t(C,[2,5]),t(C,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:w,70:T,71:E,72:D,73:O}),{22:[1,41]},{24:[1,42]},{26:[1,43]},t(C,[2,26]),t(C,[2,27]),t(C,[2,28]),t(C,[2,29]),t(C,[2,30]),t(C,r,{5:44}),t(k,[2,58]),t(k,[2,59]),t(k,[2,60]),t(k,[2,61]),t(k,[2,62]),t(C,[2,36]),t(C,[2,37]),t(C,[2,38]),t(C,[2,39]),{15:45,43:A,44:j},{15:48,43:A,44:j},{15:49,43:A,44:j},{10:50,43:h,51:v,53:y,54:b,55:x},{10:51,43:h,51:v,53:y,54:b,55:x},{15:52,43:A,44:j},{17:53,18:[1,54],56:55,57:56,61:M},{10:58,43:h,51:v,53:y,54:b,55:x},{68:59,74:[1,60],75:[1,61]},t(N,[2,77]),t(N,[2,78]),t(N,[2,79]),t(N,[2,80]),t(N,[2,81]),t(C,[2,23]),t(C,[2,24]),t(C,[2,25]),{6:[1,63],7:5,8:6,9:i,10:8,21:a,23:o,25:s,27:c,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:l,37:u,38:d,39:f,40:p,41:m,43:h,46:g,47:_,51:v,53:y,54:b,55:x},{12:P,42:64,44:F,45:I,48:66,49:67,51:L,52:R},t(z,[2,41]),t(z,[2,42]),{15:72,43:A,44:j,45:I},{12:P,42:73,44:F,45:I,48:66,49:67,51:L,52:R},{6:B,9:V,19:[1,75],35:74,50:H},{12:[1,79],14:[1,80]},t(C,[2,16],{67:35,11:81,16:[1,82],45:I,69:w,70:T,71:E,72:D,73:O}),{18:[1,83]},t(C,[2,13]),{17:84,18:[2,63],56:55,57:56,61:M},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:w,70:T,71:E,72:D,73:O},t(U,[2,82]),t(U,[2,83]),t(C,[2,31]),t(C,S),{6:B,9:V,35:90,45:W,50:H},{43:[1,92],44:[1,93]},t(G,[2,47],{49:94,12:P,44:F,51:L,52:R}),t(K,[2,49]),t(K,[2,54]),t(K,[2,55]),t(K,[2,56]),t(K,[2,57]),t(C,[2,45],{45:I}),{6:B,9:V,35:95,45:W,50:H},t(C,[2,32]),{10:97,36:96,43:h,51:v,53:y,54:b,55:x},t(C,[2,51]),t(C,[2,52]),t(C,[2,53]),{13:98,43:q,53:J,76:Y},{15:102,43:A,44:j},{10:103,43:h,51:v,53:y,54:b,55:x},{17:104,18:[1,105],56:55,57:56,61:M},t(C,[2,11]),{18:[2,64]},t(X,[2,65],{59:106,60:107,63:108,65:ee,66:te}),t([18,61,65,66],[2,71]),{61:[2,70]},t(C,[2,21],{14:[1,112],16:[1,111]}),t([43,51,53,54,55],[2,76]),t(C,[2,40]),{12:P,44:F,48:113,49:67,51:L,52:R},t(z,[2,43]),t(z,[2,44]),t(K,[2,50]),t(C,[2,46]),{10:115,20:[1,114],43:h,51:v,53:y,54:b,55:x},t(ne,[2,34]),t(C,[2,7]),t(C,[2,84]),t(C,[2,85]),t(C,[2,86]),{12:[1,116],45:I},{12:[1,118],14:[1,117]},{18:[1,119]},t(C,[2,14]),t(X,[2,66],{60:120,64:[1,121],66:te}),t(X,[2,67]),t(Z,[2,72]),t(X,[2,75]),t(Z,[2,74]),{17:122,18:[1,123],56:55,57:56,61:M},{15:124,43:A,44:j},t(G,[2,48],{49:94,12:P,44:F,51:L,52:R}),{6:B,9:V,35:125,50:H},t(ne,[2,35]),{13:126,43:q,53:J,76:Y},{15:127,43:A,44:j},{13:128,43:q,53:J,76:Y},t(C,[2,12]),t(X,[2,68]),{63:129,65:ee},{18:[1,130]},t(C,[2,19]),t(C,[2,22],{16:[1,131],45:I}),t(C,[2,33]),t(C,[2,10]),{12:[1,132],45:I},t(C,[2,9]),t(Z,[2,73]),t(C,[2,17]),{17:133,18:[1,134],56:55,57:56,61:M},{13:135,43:q,53:J,76:Y},{18:[1,136]},t(C,[2,20]),t(C,[2,8]),t(C,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{n as e,t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,U as a,a as o,it as s,q as c,s as l,v as u,w as d,x as f,y as p}from"./app-chunk-O7XYJQB3.js";import{t as m}from"./app-channel.js";import{c as h,g}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import{a as _,i as v,o as y,r as b,t as x}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import{t as S}from"./app-chunk-XXDRQBXY.js";import{t as C}from"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import{r as w,t as T}from"./app-chunk-GNY47TPC.js";var E=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],r=[2,2],i=[1,7],a=[1,9],o=[1,10],s=[1,11],c=[1,12],l=[1,30],u=[1,23],d=[1,24],f=[1,25],p=[1,26],m=[1,27],h=[1,19],g=[1,28],_=[1,29],v=[1,20],y=[1,18],b=[1,21],x=[1,22],S=[2,6],C=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],w=[1,36],T=[1,37],E=[1,38],D=[1,39],O=[1,40],k=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],A=[1,46],j=[1,47],M=[1,57],N=[43,51,53,54,55,74,75],P=[1,70],F=[1,68],I=[1,65],L=[1,69],R=[1,71],z=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],B=[1,78],V=[1,77],H=[1,76],U=[69,70,71,72,73],W=[1,91],G=[6,9,45,50],K=[6,9,12,44,45,50,51,52],q=[1,101],J=[1,100],Y=[1,99],X=[18,61],ee=[1,110],te=[1,109],ne=[20,43,51,53,54,55],Z=[18,61,64,66],Q={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:`error`,4:`ER_DIAGRAM`,6:`EOF`,9:`NEWLINE`,12:`COLON`,14:`STYLE_SEPARATOR`,16:`BLOCK_START`,18:`BLOCK_STOP`,19:`SQS`,20:`SQE`,21:`title`,22:`title_value`,23:`acc_title`,24:`acc_title_value`,25:`acc_descr`,26:`acc_descr_value`,27:`acc_descr_multiline_value`,33:`END`,34:`SUBGRAPH`,37:`direction_tb`,38:`direction_bt`,39:`direction_rl`,40:`direction_lr`,41:`CLASSDEF`,43:`UNICODE_TEXT`,44:`STYLE_TEXT`,45:`COMMA`,46:`CLASS`,47:`STYLE`,50:`SEMI`,51:`NUM`,52:`BRKT`,53:`ENTITY_NAME`,54:`DECIMAL_NUM`,55:`ENTITY_ONE`,61:`ATTRIBUTE_WORD`,62:`?`,64:`,`,65:`ATTRIBUTE_KEY`,66:`COMMENT`,69:`ZERO_OR_ONE`,70:`ZERO_OR_MORE`,71:`ONE_OR_MORE`,72:`ONLY_ONE`,73:`MD_PARENT`,74:`NON_IDENTIFYING`,75:`IDENTIFYING`,76:`WORD`},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:break;case 2:this.$=[];break;case 3:this.$=a[s-1].concat(a[s]);break;case 4:this.$=a[s];break;case 5:case 6:this.$=[];break;case 7:r.addEntity(a[s-4]),r.addEntity(a[s-2]),r.addRelationship(a[s-4],a[s],a[s-2],a[s-3]),this.$=[a[s-4],a[s-2]];break;case 8:r.addEntity(a[s-8]),r.addEntity(a[s-4]),r.addRelationship(a[s-8],a[s],a[s-4],a[s-5]),r.setClass([a[s-8]],a[s-6]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-8],a[s-4]];break;case 9:r.addEntity(a[s-6]),r.addEntity(a[s-2]),r.addRelationship(a[s-6],a[s],a[s-2],a[s-3]),r.setClass([a[s-6]],a[s-4]),this.$=[a[s-6],a[s-2]];break;case 10:r.addEntity(a[s-6]),r.addEntity(a[s-4]),r.addRelationship(a[s-6],a[s],a[s-4],a[s-5]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-6],a[s-4]];break;case 11:r.addEntity(a[s-3]),r.addAttributes(a[s-3],a[s-1]),this.$=[a[s-3]];break;case 12:r.addEntity(a[s-5]),r.addAttributes(a[s-5],a[s-1]),r.setClass([a[s-5]],a[s-3]),this.$=[a[s-5]];break;case 13:r.addEntity(a[s-2]),this.$=[a[s-2]];break;case 14:r.addEntity(a[s-4]),r.setClass([a[s-4]],a[s-2]),this.$=[a[s-4]];break;case 15:r.addEntity(a[s]),this.$=[a[s]];break;case 16:r.addEntity(a[s-2]),r.setClass([a[s-2]],a[s]),this.$=[a[s-2]];break;case 17:r.addEntity(a[s-6],a[s-4]),r.addAttributes(a[s-6],a[s-1]),this.$=[a[s-6]];break;case 18:r.addEntity(a[s-8],a[s-6]),r.addAttributes(a[s-8],a[s-1]),r.setClass([a[s-8]],a[s-3]),this.$=[a[s-8]];break;case 19:r.addEntity(a[s-5],a[s-3]),this.$=[a[s-5]];break;case 20:r.addEntity(a[s-7],a[s-5]),r.setClass([a[s-7]],a[s-2]),this.$=[a[s-7]];break;case 21:r.addEntity(a[s-3],a[s-1]);break;case 22:r.addEntity(a[s-5],a[s-3]),r.setClass([a[s-5]],a[s]);break;case 23:case 24:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 25:case 26:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 27:r.subgraphDepth?this.$=a[s]:(r.setDirection(a[s].value),this.$=[]);break;case 31:r.subgraphDepth=(r.subgraphDepth||1)-1,this.$=r.addSubGraph({text:a[s-2].id},a[s-1],{text:a[s-2].text});break;case 32:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-1],text:a[s-1]};break;case 33:r.subgraphDepth=(r.subgraphDepth||0)+1,this.$={id:a[s-4],text:a[s-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=a[s];break;case 35:this.$=a[s-1]+` `+a[s];break;case 36:this.$={stmt:`dir`,value:`TB`};break;case 37:this.$={stmt:`dir`,value:`BT`};break;case 38:this.$={stmt:`dir`,value:`RL`};break;case 39:this.$={stmt:`dir`,value:`LR`};break;case 40:this.$=a[s-3],r.addClass(a[s-2],a[s-1]);break;case 41:case 42:case 63:case 72:this.$=[a[s]];break;case 43:case 44:this.$=a[s-2].concat([a[s]]);break;case 45:this.$=a[s-2],r.setClass(a[s-1],a[s]);break;case 46:this.$=a[s-3],r.addCssStyles(a[s-2],a[s-1]);break;case 47:this.$=[a[s]];break;case 48:a[s-2].push(a[s]),this.$=a[s-2];break;case 50:this.$=a[s-1]+a[s];break;case 58:case 84:case 85:this.$=a[s].replace(/"/g,``);break;case 64:a[s].push(a[s-1]),this.$=a[s];break;case 65:this.$={type:a[s-1],name:a[s]};break;case 66:this.$={type:a[s-2],name:a[s-1],keys:a[s]};break;case 67:this.$={type:a[s-2],name:a[s-1],comment:a[s]};break;case 68:this.$={type:a[s-3],name:a[s-2],keys:a[s-1],comment:a[s]};break;case 69:case 71:case 74:this.$=a[s];break;case 70:this.$=a[s-1]+a[s];break;case 73:a[s-2].push(a[s]),this.$=a[s-2];break;case 75:this.$=a[s].replace(/"/g,``);break;case 76:this.$={cardA:a[s],relType:a[s-1],cardB:a[s-2]};break;case 77:this.$=r.Cardinality.ZERO_OR_ONE;break;case 78:this.$=r.Cardinality.ZERO_OR_MORE;break;case 79:this.$=r.Cardinality.ONE_OR_MORE;break;case 80:this.$=r.Cardinality.ONLY_ONE;break;case 81:this.$=r.Cardinality.MD_PARENT;break;case 82:this.$=r.Identification.NON_IDENTIFYING;break;case 83:this.$=r.Identification.IDENTIFYING}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},t(n,r,{5:3}),{6:[1,4],7:5,8:6,9:i,10:8,21:a,23:o,25:s,27:c,28:13,29:14,30:15,31:16,32:17,34:l,37:u,38:d,39:f,40:p,41:m,43:h,46:g,47:_,51:v,53:y,54:b,55:x},t(n,S,{1:[2,1]}),t(C,[2,3]),t(C,[2,4]),t(C,[2,5]),t(C,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:w,70:T,71:E,72:D,73:O}),{22:[1,41]},{24:[1,42]},{26:[1,43]},t(C,[2,26]),t(C,[2,27]),t(C,[2,28]),t(C,[2,29]),t(C,[2,30]),t(C,r,{5:44}),t(k,[2,58]),t(k,[2,59]),t(k,[2,60]),t(k,[2,61]),t(k,[2,62]),t(C,[2,36]),t(C,[2,37]),t(C,[2,38]),t(C,[2,39]),{15:45,43:A,44:j},{15:48,43:A,44:j},{15:49,43:A,44:j},{10:50,43:h,51:v,53:y,54:b,55:x},{10:51,43:h,51:v,53:y,54:b,55:x},{15:52,43:A,44:j},{17:53,18:[1,54],56:55,57:56,61:M},{10:58,43:h,51:v,53:y,54:b,55:x},{68:59,74:[1,60],75:[1,61]},t(N,[2,77]),t(N,[2,78]),t(N,[2,79]),t(N,[2,80]),t(N,[2,81]),t(C,[2,23]),t(C,[2,24]),t(C,[2,25]),{6:[1,63],7:5,8:6,9:i,10:8,21:a,23:o,25:s,27:c,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:l,37:u,38:d,39:f,40:p,41:m,43:h,46:g,47:_,51:v,53:y,54:b,55:x},{12:P,42:64,44:F,45:I,48:66,49:67,51:L,52:R},t(z,[2,41]),t(z,[2,42]),{15:72,43:A,44:j,45:I},{12:P,42:73,44:F,45:I,48:66,49:67,51:L,52:R},{6:B,9:V,19:[1,75],35:74,50:H},{12:[1,79],14:[1,80]},t(C,[2,16],{67:35,11:81,16:[1,82],45:I,69:w,70:T,71:E,72:D,73:O}),{18:[1,83]},t(C,[2,13]),{17:84,18:[2,63],56:55,57:56,61:M},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:w,70:T,71:E,72:D,73:O},t(U,[2,82]),t(U,[2,83]),t(C,[2,31]),t(C,S),{6:B,9:V,35:90,45:W,50:H},{43:[1,92],44:[1,93]},t(G,[2,47],{49:94,12:P,44:F,51:L,52:R}),t(K,[2,49]),t(K,[2,54]),t(K,[2,55]),t(K,[2,56]),t(K,[2,57]),t(C,[2,45],{45:I}),{6:B,9:V,35:95,45:W,50:H},t(C,[2,32]),{10:97,36:96,43:h,51:v,53:y,54:b,55:x},t(C,[2,51]),t(C,[2,52]),t(C,[2,53]),{13:98,43:q,53:J,76:Y},{15:102,43:A,44:j},{10:103,43:h,51:v,53:y,54:b,55:x},{17:104,18:[1,105],56:55,57:56,61:M},t(C,[2,11]),{18:[2,64]},t(X,[2,65],{59:106,60:107,63:108,65:ee,66:te}),t([18,61,65,66],[2,71]),{61:[2,70]},t(C,[2,21],{14:[1,112],16:[1,111]}),t([43,51,53,54,55],[2,76]),t(C,[2,40]),{12:P,44:F,48:113,49:67,51:L,52:R},t(z,[2,43]),t(z,[2,44]),t(K,[2,50]),t(C,[2,46]),{10:115,20:[1,114],43:h,51:v,53:y,54:b,55:x},t(ne,[2,34]),t(C,[2,7]),t(C,[2,84]),t(C,[2,85]),t(C,[2,86]),{12:[1,116],45:I},{12:[1,118],14:[1,117]},{18:[1,119]},t(C,[2,14]),t(X,[2,66],{60:120,64:[1,121],66:te}),t(X,[2,67]),t(Z,[2,72]),t(X,[2,75]),t(Z,[2,74]),{17:122,18:[1,123],56:55,57:56,61:M},{15:124,43:A,44:j},t(G,[2,48],{49:94,12:P,44:F,51:L,52:R}),{6:B,9:V,35:125,50:H},t(ne,[2,35]),{13:126,43:q,53:J,76:Y},{15:127,43:A,44:j},{13:128,43:q,53:J,76:Y},t(C,[2,12]),t(X,[2,68]),{63:129,65:ee},{18:[1,130]},t(C,[2,19]),t(C,[2,22],{16:[1,131],45:I}),t(C,[2,33]),t(C,[2,10]),{12:[1,132],45:I},t(C,[2,9]),t(Z,[2,73]),t(C,[2,17]),{17:133,18:[1,134],56:55,57:56,61:M},{13:135,43:q,53:J,76:Y},{18:[1,136]},t(C,[2,20]),t(C,[2,8]),t(C,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};Q.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),23;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),25;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin(`block`),16;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin(`block_bq`);break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;case 32:return t.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin(`style`),47;case 36:return this.popState(),9;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin(`style`),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return t.yytext[0];case 82:return 6}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}}})();function $(){this.yy={}}return e($,`Parser`),$.prototype=Q,Q.Parser=$,new $})();E.parser=E;var D=E,O=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction=`TB`,this.Cardinality={ZERO_OR_ONE:`ZERO_OR_ONE`,ZERO_OR_MORE:`ZERO_OR_MORE`,ONE_OR_MORE:`ONE_OR_MORE`,ONLY_ONE:`ONLY_ONE`,MD_PARENT:`MD_PARENT`},this.Identification={NON_IDENTIFYING:`NON_IDENTIFYING`,IDENTIFYING:`IDENTIFYING`},this.setAccTitle=a,this.getAccTitle=p,this.setAccDescription=i,this.getAccDescription=u,this.setDiagramTitle=c,this.getDiagramTitle=d,this.getConfig=e(()=>f().er,`getConfig`),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{e(this,`ErDB`)}addEntity(e,t=``){return this.entities.has(e)?!this.entities.get(e)?.alias&&t&&(this.entities.get(e).alias=t,n.info(`Add alias '${t}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:t,shape:`erBox`,look:f().look??`default`,cssClasses:`default`,cssStyles:[],labelType:`markdown`}),n.info(`Added new entity :`,e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,t){let r=this.addEntity(e),i;for(i=t.length-1;i>=0;i--)t[i].keys||(t[i].keys=[]),t[i].comment||(t[i].comment=``),r.attributes.push(t[i]),n.debug(`Added attribute `,t[i].name)}addRelationship(e,t,r,i){let a;if(this.subGraphLookup.has(e))a=e;else{let t=this.addEntity(e);if(!t)return;a=t.id}let o;if(this.subGraphLookup.has(r))o=r;else{let e=this.addEntity(r);if(!e)return;o=e.id}let s={entityA:a,roleA:t,entityB:o,relSpec:i};this.relationships.push(s),n.debug(`Added new relationship :`,s)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}addCssStyles(e,t){for(let n of e){let e=this.entities.get(n),r=this.subGraphLookup.get(n);if(t){if(e)for(let n of t)e.cssStyles.push(n);if(r){r.cssStyles||=[];for(let e of t)r.cssStyles.push(e)}}}}addClass(e,t){e.forEach(e=>{let n=this.classes.get(e);n===void 0&&(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n)),t&&t.forEach(function(e){if(/color/.exec(e)){let t=e.replace(`fill`,`bgFill`);n.textStyles.push(t)}n.styles.push(e)})})}addSubGraph(t,r,i){let a=t.text.trim(),o=i.text,s=e(e=>{let t=new Set,n;return{nodeList:e.filter(e=>{if(e?.stmt)return e.stmt===`dir`&&(n=e.value),!1;if(typeof e!=`string`)return!1;let r=e.trim();return!r||t.has(r)?!1:(t.add(r),!0)}),dir:n}},`uniq`)(r.flat()),c=s.nodeList,l=s.dir;a??=`subGraph`+this.subCount,o||=``,o=this.sanitizeText(o),this.subCount+=1;let u={id:a,nodes:c,title:o.trim(),classes:[],cssStyles:[],dir:l,labelType:this.sanitizeNodeLabelType(i?.type)};return n.info(`Adding`,u.id,u.nodes,u.dir),u.nodes=this.makeUniq(u,this.subGraphs).nodes,this.subGraphs.push(u),this.subGraphLookup.set(a,u),a}getSubGraphs(){return this.subGraphs}setClass(e,t){for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssClasses+=` `+n;let r=this.subGraphLookup.get(n);if(r)for(let e of t)r.classes.push(e)}}subgraphNodeCache(e){let t=new Set;for(let n of e)for(let e of n.nodes)t.add(e);return t}makeUniq(e,t){let r=this.subgraphNodeCache(t),i=[];return e.nodes.forEach((t,a)=>{r.has(t)?n.warn(`Entity '${t}' already belongs to another subgraph and will be ignored`):i.push(e.nodes[a])}),{nodes:i}}sanitizeText(e){return l.sanitizeText(e,f())}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,o()}getData(){let e=[],t=[],n=f(),r=this.getSubGraphs(),i=new Map,a=new Map;for(let e=r.length-1;e>=0;e--){let t=r[e];t.nodes.length>0&&a.set(t.id,!0);for(let e of t.nodes)i.set(e,t.id)}for(let t=r.length-1;t>=0;t--){let a=r[t];e.push({id:a.id,label:a.title,labelStyle:``,labelType:a.labelType,parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssStyles:a.cssStyles,cssClasses:a.classes.join(` `),shape:`rect`,dir:a.dir,isGroup:!0,look:n.look})}let o=new Set(r.map(e=>e.id)),s=0;for(let t of this.entities.keys()){if(o.has(t))continue;let n=this.entities.get(t);n&&(n.cssCompiledStyles=this.getCompiledStyles(n.cssClasses.split(` `)),n.colorIndex=s++,e.push({...n,parentId:i.get(t),isGroup:!1}))}let c=0;for(let e of this.relationships){let r={id:h(e.entityA,e.entityB,{prefix:`id`,counter:c++}),type:`normal`,curve:`basis`,start:e.entityA,end:e.entityB,label:e.roleA,labelpos:`c`,thickness:`normal`,classes:`relationshipLine`,arrowTypeStart:e.relSpec.cardB.toLowerCase(),arrowTypeEnd:e.relSpec.cardA.toLowerCase(),pattern:e.relSpec.relType==`IDENTIFYING`?`solid`:`dashed`,look:n.look,labelType:`markdown`};t.push(r)}return{nodes:e,edges:t,other:{},config:n,direction:this.direction}}},k={};t(k,{draw:()=>A});var A=e(async function(e,t,i,a){n.info(`REF0:`),n.info(`Drawing er diagram (unified)`,t);let{securityLevel:o,er:s,layout:c}=f(),l=a.db.getData(),u=w(t,o);l.type=a.type,l.layoutAlgorithm=C(c),l.config.flowchart.nodeSpacing=s?.nodeSpacing||140,l.config.flowchart.rankSpacing=s?.rankSpacing||80,l.direction=a.db.getDirection();let{config:d}=l,{look:p}=d;l.markers=p===`neo`?[`only_one_neo`,`zero_or_one_neo`,`one_or_more_neo`,`zero_or_more_neo`]:[`only_one`,`zero_or_one`,`one_or_more`,`zero_or_more`],l.diagramId=t,await S(l,u);let m=u.selectAll(`[id*="-background"]`);Array.from(m).length>0&&m.each(function(){let e=r(this),t=e.attr(`id`).replace(`-background`,``),n=u.select(`#${CSS.escape(t)}`);if(!n.empty()){let t=n.attr(`transform`);e.attr(`transform`,t)}}),g.insertTitle(u,`erDiagramTitleText`,s?.titleTopMargin??25,a.db.getDiagramTitle()),T(u,8,`erDiagram`,s?.useMaxWidth??!0)},`draw`),j=e((e,t)=>{let n=m,r=n(e,`r`),i=n(e,`g`),a=n(e,`b`);return s(r,i,a,t)},`fade`),M=e(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!v(t,r))return``;let i=y(e.look),a=b(n),o=``;for(let e=0;e<_(r);e++){let t=r[e],s=a?`fill: ${n[e%n.length]};`:``;o+=` +`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return this.begin(`acc_title`),23;case 1:return this.popState(),`acc_title_value`;case 2:return this.begin(`acc_descr`),25;case 3:return this.popState(),`acc_descr_value`;case 4:this.begin(`acc_descr_multiline`);break;case 5:this.popState();break;case 6:return`acc_descr_multiline_value`;case 7:return 37;case 8:return 38;case 9:return 39;case 10:return 40;case 11:break;case 12:return 9;case 13:return 53;case 14:return 76;case 15:return 4;case 16:return this.begin(`block`),16;case 17:return 52;case 18:return 52;case 19:return 45;case 20:return 14;case 21:return 12;case 22:break;case 23:return 65;case 24:return 61;case 25:return 61;case 26:this.begin(`block_bq`);break;case 27:return 61;case 28:this.popState();break;case 29:return 66;case 30:break;case 31:return this.popState(),18;case 32:return t.yytext[0];case 33:return 19;case 34:return 20;case 35:return this.begin(`style`),47;case 36:return this.popState(),9;case 37:break;case 38:return 12;case 39:return 45;case 40:return 52;case 41:return this.begin(`style`),41;case 42:return 46;case 43:return 34;case 44:return 33;case 45:return 69;case 46:return 71;case 47:return 71;case 48:return 71;case 49:return 69;case 50:return 69;case 51:return 70;case 52:return 70;case 53:return 70;case 54:return 70;case 55:return 70;case 56:return 71;case 57:return 70;case 58:return 71;case 59:return 72;case 60:return 72;case 61:return 54;case 62:return 72;case 63:return 72;case 64:return 72;case 65:return 55;case 66:return 51;case 67:return 72;case 68:return 69;case 69:return 70;case 70:return 71;case 71:return 73;case 72:return 74;case 73:return 75;case 74:return 75;case 75:return 74;case 76:return 74;case 77:return 74;case 78:return 44;case 79:return 50;case 80:return 43;case 81:return t.yytext[0];case 82:return 6}},`anonymous`),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[ \t\r]+)/i,/^(?:[\n]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\.,\u00C0-\uFFFF\*]*))/i,/^(?:[`])/i,/^(?:[^`]+)/i,/^(?:[`])/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:subgraph\b)/i,/^(?:end\b\s*)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[36,37,38,39,40,78,79],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block_bq:{rules:[27,28],inclusive:!1},block:{rules:[22,23,24,25,26,29,30,31,32],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,33,34,35,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,80,81,82],inclusive:!0}}}})();function $(){this.yy={}}return e($,`Parser`),$.prototype=Q,Q.Parser=$,new $})();E.parser=E;var D=E,O=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.subgraphDepth=0,this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.direction=`TB`,this.Cardinality={ZERO_OR_ONE:`ZERO_OR_ONE`,ZERO_OR_MORE:`ZERO_OR_MORE`,ONE_OR_MORE:`ONE_OR_MORE`,ONLY_ONE:`ONLY_ONE`,MD_PARENT:`MD_PARENT`},this.Identification={NON_IDENTIFYING:`NON_IDENTIFYING`,IDENTIFYING:`IDENTIFYING`},this.setAccTitle=a,this.getAccTitle=p,this.setAccDescription=i,this.getAccDescription=u,this.setDiagramTitle=c,this.getDiagramTitle=d,this.getConfig=e(()=>f().er,`getConfig`),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this),this.addSubGraph=this.addSubGraph.bind(this)}static{e(this,`ErDB`)}addEntity(e,t=``){return this.entities.has(e)?!this.entities.get(e)?.alias&&t&&(this.entities.get(e).alias=t,n.info(`Add alias '${t}' to entity '${e}'`)):(this.entities.set(e,{id:`entity-${e}-${this.entities.size}`,label:e,attributes:[],alias:t,shape:`erBox`,look:f().look??`default`,cssClasses:`default`,cssStyles:[],labelType:`markdown`}),n.info(`Added new entity :`,e)),this.entities.get(e)}getEntity(e){return this.entities.get(e)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(e,t){let r=this.addEntity(e),i;for(i=t.length-1;i>=0;i--)t[i].keys||(t[i].keys=[]),t[i].comment||(t[i].comment=``),r.attributes.push(t[i]),n.debug(`Added attribute `,t[i].name)}addRelationship(e,t,r,i){let a;if(this.subGraphLookup.has(e))a=e;else{let t=this.addEntity(e);if(!t)return;a=t.id}let o;if(this.subGraphLookup.has(r))o=r;else{let e=this.addEntity(r);if(!e)return;o=e.id}let s={entityA:a,roleA:t,entityB:o,relSpec:i};this.relationships.push(s),n.debug(`Added new relationship :`,s)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(e){this.direction=e}getCompiledStyles(e){let t=[];for(let n of e){let e=this.classes.get(n);e?.styles&&(t=[...t,...e.styles??[]].map(e=>e.trim())),e?.textStyles&&(t=[...t,...e.textStyles??[]].map(e=>e.trim()))}return t}addCssStyles(e,t){for(let n of e){let e=this.entities.get(n),r=this.subGraphLookup.get(n);if(t){if(e)for(let n of t)e.cssStyles.push(n);if(r){r.cssStyles||=[];for(let e of t)r.cssStyles.push(e)}}}}addClass(e,t){e.forEach(e=>{let n=this.classes.get(e);n===void 0&&(n={id:e,styles:[],textStyles:[]},this.classes.set(e,n)),t&&t.forEach(function(e){if(/color/.exec(e)){let t=e.replace(`fill`,`bgFill`);n.textStyles.push(t)}n.styles.push(e)})})}addSubGraph(t,r,i){let a=t.text.trim(),o=i.text,s=e(e=>{let t=new Set,n;return{nodeList:e.filter(e=>{if(e?.stmt)return e.stmt===`dir`&&(n=e.value),!1;if(typeof e!=`string`)return!1;let r=e.trim();return!r||t.has(r)?!1:(t.add(r),!0)}),dir:n}},`uniq`)(r.flat()),c=s.nodeList,l=s.dir;a??=`subGraph`+this.subCount,o||=``,o=this.sanitizeText(o),this.subCount+=1;let u={id:a,nodes:c,title:o.trim(),classes:[],cssStyles:[],dir:l,labelType:this.sanitizeNodeLabelType(i?.type)};return n.info(`Adding`,u.id,u.nodes,u.dir),u.nodes=this.makeUniq(u,this.subGraphs).nodes,this.subGraphs.push(u),this.subGraphLookup.set(a,u),a}getSubGraphs(){return this.subGraphs}setClass(e,t){for(let n of e){let e=this.entities.get(n);if(e)for(let n of t)e.cssClasses+=` `+n;let r=this.subGraphLookup.get(n);if(r)for(let e of t)r.classes.push(e)}}subgraphNodeCache(e){let t=new Set;for(let n of e)for(let e of n.nodes)t.add(e);return t}makeUniq(e,t){let r=this.subgraphNodeCache(t),i=[];return e.nodes.forEach((t,a)=>{r.has(t)?n.warn(`Entity '${t}' already belongs to another subgraph and will be ignored`):i.push(e.nodes[a])}),{nodes:i}}sanitizeText(e){return l.sanitizeText(e,f())}sanitizeNodeLabelType(e){switch(e){case`markdown`:case`string`:case`text`:return e;default:return`markdown`}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.subgraphDepth=0,o()}getData(){let e=[],t=[],n=f(),r=this.getSubGraphs(),i=new Map,a=new Map;for(let e=r.length-1;e>=0;e--){let t=r[e];t.nodes.length>0&&a.set(t.id,!0);for(let e of t.nodes)i.set(e,t.id)}for(let t=r.length-1;t>=0;t--){let a=r[t];e.push({id:a.id,label:a.title,labelStyle:``,labelType:a.labelType,parentId:i.get(a.id),padding:8,cssCompiledStyles:this.getCompiledStyles(a.classes),cssStyles:a.cssStyles,cssClasses:a.classes.join(` `),shape:`rect`,dir:a.dir,isGroup:!0,look:n.look})}let o=new Set(r.map(e=>e.id)),s=0;for(let t of this.entities.keys()){if(o.has(t))continue;let n=this.entities.get(t);n&&(n.cssCompiledStyles=this.getCompiledStyles(n.cssClasses.split(` `)),n.colorIndex=s++,e.push({...n,parentId:i.get(t),isGroup:!1}))}let c=0;for(let e of this.relationships){let r={id:h(e.entityA,e.entityB,{prefix:`id`,counter:c++}),type:`normal`,curve:`basis`,start:e.entityA,end:e.entityB,label:e.roleA,labelpos:`c`,thickness:`normal`,classes:`relationshipLine`,arrowTypeStart:e.relSpec.cardB.toLowerCase(),arrowTypeEnd:e.relSpec.cardA.toLowerCase(),pattern:e.relSpec.relType==`IDENTIFYING`?`solid`:`dashed`,look:n.look,labelType:`markdown`};t.push(r)}return{nodes:e,edges:t,other:{},config:n,direction:this.direction}}},k={};t(k,{draw:()=>A});var A=e(async function(e,t,i,a){n.info(`REF0:`),n.info(`Drawing er diagram (unified)`,t);let{securityLevel:o,er:s,layout:c}=f(),l=a.db.getData(),u=S(t,o);l.type=a.type,l.layoutAlgorithm=T(c),l.config.flowchart.nodeSpacing=s?.nodeSpacing||140,l.config.flowchart.rankSpacing=s?.rankSpacing||80,l.direction=a.db.getDirection();let{config:d}=l,{look:p}=d;l.markers=p===`neo`?[`only_one_neo`,`zero_or_one_neo`,`one_or_more_neo`,`zero_or_more_neo`]:[`only_one`,`zero_or_one`,`one_or_more`,`zero_or_more`],l.diagramId=t,await w(l,u);let m=u.selectAll(`[id*="-background"]`);Array.from(m).length>0&&m.each(function(){let e=r(this),t=e.attr(`id`).replace(`-background`,``),n=u.select(`#${CSS.escape(t)}`);if(!n.empty()){let t=n.attr(`transform`);e.attr(`transform`,t)}}),g.insertTitle(u,`erDiagramTitleText`,s?.titleTopMargin??25,a.db.getDiagramTitle()),C(u,8,`erDiagram`,s?.useMaxWidth??!0)},`draw`),j=e((e,t)=>{let n=m,r=n(e,`r`),i=n(e,`g`),a=n(e,`b`);return s(r,i,a,t)},`fade`),M=e(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!v(t,r))return``;let i=y(e.look),a=b(n),o=``;for(let e=0;e<_(r);e++){let t=r[e],s=a?`fill: ${n[e%n.length]};`:``;o+=` [data-look="${i}"][data-color-id="color-${e}"].node path { stroke: ${t}; diff --git a/web/dist/app-flowDiagram-KWPJA3E3.js b/web/dist/app-flowDiagram-KWPJA3E3.js index ae835a6e3..084282984 100644 --- a/web/dist/app-flowDiagram-KWPJA3E3.js +++ b/web/dist/app-flowDiagram-KWPJA3E3.js @@ -1 +1 @@ -import"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-LNGE3PJU.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import"./app-chunk-GNY47TPC.js";import"./app-chunk-GWA4HPMP.js";import"./app-chunk-XXDRQBXY.js";import"./app-chunk-WEXAMYUT.js";import{n as e}from"./app-chunk-7M6MHVWA.js";export{e as diagram}; \ No newline at end of file +import"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import"./app-chunk-GWA4HPMP.js";import"./app-chunk-XXDRQBXY.js";import"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-GNY47TPC.js";import"./app-chunk-LNGE3PJU.js";import{n as e}from"./app-chunk-7M6MHVWA.js";export{e as diagram}; \ No newline at end of file diff --git a/web/dist/app-kanban-definition-PNTS6WVX.js b/web/dist/app-kanban-definition-PNTS6WVX.js index e0283a7fe..8c1bf55ea 100644 --- a/web/dist/app-kanban-definition-PNTS6WVX.js +++ b/web/dist/app-kanban-definition-PNTS6WVX.js @@ -1,14 +1,14 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{Y as n,et as r,f as i,rt as a,tt as o,x as s,z as c}from"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import{t as l}from"./app-chunk-6AEJRKK7.js";import{n as u,t as d}from"./app-chunk-LNGE3PJU.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7INBJB4K.js";import{i as f,r as p}from"./app-chunk-5DYCD2WN.js";import{r as m}from"./app-chunk-UA2S7LBM.js";import{t as h}from"./app-chunk-5VM5RSS4.js";var g=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,13],i=[1,12],a=[1,15],o=[1,16],s=[1,20],c=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],p=[6,7,11],m=[1,31],h=[6,7,11,24],g=[1,6,13,16,17,20,23],_=[1,35],v=[1,36],y=[1,6,7,11,13,16,17,20,23],b=[1,38],x={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`KANBAN`,11:`EOF`,13:`SPACELIST`,16:`ICON`,17:`CLASS`,20:`NODE_DSTART`,21:`NODE_DESCR`,22:`NODE_DEND`,23:`NODE_ID`,24:`SHAPE_DATA`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s-1].id),r.addNode(a[s-2].length,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 16:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 17:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 18:case 23:r.decorateNode({class:a[s]});break;case 19:r.getLogger().trace(`SPACELIST`);break;case 20:r.getLogger().trace(`Node: `,a[s-1].id),r.addNode(0,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 21:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 22:r.decorateNode({icon:a[s]});break;case 27:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 28:this.$={id:a[s],descr:a[s],type:0};break;case 29:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 30:this.$=a[s-1]+a[s];break;case 31:this.$=a[s]}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},{6:r,9:22,12:11,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},{6:u,7:d,10:23,11:f},t(p,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:c}),t(p,[2,19]),t(p,[2,21],{15:30,24:m}),t(p,[2,22]),t(p,[2,23]),t(h,[2,25]),t(h,[2,26]),t(h,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:d,10:34,11:f},{1:[2,7],6:r,12:21,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},t(g,[2,14],{7:_,11:v}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(p,[2,16],{15:37,24:m}),t(p,[2,17]),t(p,[2,18]),t(p,[2,20],{24:b}),t(h,[2,31]),{21:[1,39]},{22:[1,40]},t(g,[2,13],{7:_,11:v}),t(y,[2,11]),t(y,[2,12]),t(p,[2,15],{24:b}),t(h,[2,30]),{22:[1,41]},t(h,[2,27]),t(h,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{Y as n,et as r,f as i,rt as a,tt as o,x as s,z as c}from"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import{t as l}from"./app-chunk-6AEJRKK7.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{t as u}from"./app-chunk-5VM5RSS4.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-7INBJB4K.js";import{i as d,r as f}from"./app-chunk-5DYCD2WN.js";import{r as p}from"./app-chunk-UA2S7LBM.js";import{n as m,t as h}from"./app-chunk-LNGE3PJU.js";var g=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,13],i=[1,12],a=[1,15],o=[1,16],s=[1,20],c=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],p=[6,7,11],m=[1,31],h=[6,7,11,24],g=[1,6,13,16,17,20,23],_=[1,35],v=[1,36],y=[1,6,7,11,13,16,17,20,23],b=[1,38],x={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`KANBAN`,11:`EOF`,13:`SPACELIST`,16:`ICON`,17:`CLASS`,20:`NODE_DSTART`,21:`NODE_DESCR`,22:`NODE_DEND`,23:`NODE_ID`,24:`SHAPE_DATA`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s-1].id),r.addNode(a[s-2].length,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 16:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 17:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 18:case 23:r.decorateNode({class:a[s]});break;case 19:r.getLogger().trace(`SPACELIST`);break;case 20:r.getLogger().trace(`Node: `,a[s-1].id),r.addNode(0,a[s-1].id,a[s-1].descr,a[s-1].type,a[s]);break;case 21:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 22:r.decorateNode({icon:a[s]});break;case 27:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 28:this.$={id:a[s],descr:a[s],type:0};break;case 29:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 30:this.$=a[s-1]+a[s];break;case 31:this.$=a[s]}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},{6:r,9:22,12:11,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},{6:u,7:d,10:23,11:f},t(p,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:s,23:c}),t(p,[2,19]),t(p,[2,21],{15:30,24:m}),t(p,[2,22]),t(p,[2,23]),t(h,[2,25]),t(h,[2,26]),t(h,[2,28],{20:[1,32]}),{21:[1,33]},{6:u,7:d,10:34,11:f},{1:[2,7],6:r,12:21,13:i,14:14,16:a,17:o,18:17,19:18,20:s,23:c},t(g,[2,14],{7:_,11:v}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(p,[2,16],{15:37,24:m}),t(p,[2,17]),t(p,[2,18]),t(p,[2,20],{24:b}),t(h,[2,31]),{21:[1,39]},{22:[1,40]},t(g,[2,13],{7:_,11:v}),t(y,[2,11]),t(y,[2,12]),t(p,[2,15],{24:b}),t(h,[2,30]),{22:[1,41]},t(h,[2,27]),t(h,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};x.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return this.pushState(`shapeData`),t.yytext=``,24;case 1:return this.pushState(`shapeDataStr`),24;case 2:return this.popState(),24;case 3:return t.yytext=t.yytext.replace(/\n\s*/g,`
`),24;case 4:return 24;case 5:this.popState();break;case 6:return e.getLogger().trace(`Found comment`,t.yytext),6;case 7:return 8;case 8:this.begin(`CLASS`);break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:e.getLogger().trace(`Begin icon`),this.begin(`ICON`);break;case 12:return e.getLogger().trace(`SPACELINE`),6;case 13:return 7;case 14:return 16;case 15:e.getLogger().trace(`end icon`),this.popState();break;case 16:return e.getLogger().trace(`Exploding node`),this.begin(`NODE`),20;case 17:return e.getLogger().trace(`Cloud`),this.begin(`NODE`),20;case 18:return e.getLogger().trace(`Explosion Bang`),this.begin(`NODE`),20;case 19:return e.getLogger().trace(`Cloud Bang`),this.begin(`NODE`),20;case 20:return this.begin(`NODE`),20;case 21:return this.begin(`NODE`),20;case 22:return this.begin(`NODE`),20;case 23:return this.begin(`NODE`),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin(`NSTR2`);break;case 28:return`NODE_DESCR`;case 29:this.popState();break;case 30:e.getLogger().trace(`Starting NSTR`),this.begin(`NSTR`);break;case 31:return e.getLogger().trace(`description:`,t.yytext),`NODE_DESCR`;case 32:this.popState();break;case 33:return this.popState(),e.getLogger().trace(`node end ))`),`NODE_DEND`;case 34:return this.popState(),e.getLogger().trace(`node end )`),`NODE_DEND`;case 35:return this.popState(),e.getLogger().trace(`node end ...`,t.yytext),`NODE_DEND`;case 36:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 37:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 38:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 39:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 40:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 41:return e.getLogger().trace(`Long description:`,t.yytext),21;case 42:return e.getLogger().trace(`Long description:`,t.yytext),21}},`anonymous`),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}})();function S(){this.yy={}}return e(S,`Parser`),S.prototype=x,x.Parser=S,new S})();g.parser=g;var _=g,v=[],y=[],b=0,x={},S=e(()=>{v=[],y=[],b=0,x={}},`clear`),C=e(e=>{if(v.length===0)return null;let t=v[0].level,n=null;for(let e=v.length-1;e>=0;e--)if(v[e].level===t&&!n&&(n=v[e]),v[e].levelt.parentId===e.id);for(let n of i){let i={id:n.id,parentId:e.id,label:c(n.label??``,r),labelType:`markdown`,isGroup:!1,ticket:n?.ticket,priority:n?.priority,assigned:n?.assigned,icon:n?.icon,shape:`kanbanItem`,level:n.level,rx:5,ry:5,cssStyles:[`text-align: left`]};t.push(i)}}return{nodes:t,edges:e,other:{},config:s()}},`getData`),E=e((e,t,n,r,a)=>{let o=s(),l=o.mindmap?.padding??i.mindmap.padding;switch(r){case D.ROUNDED_RECT:case D.RECT:case D.HEXAGON:l*=2}let f={id:c(t,o)||`kbn`+b++,level:e,label:c(n,o),width:o.mindmap?.maxNodeWidth??i.mindmap.maxNodeWidth,padding:l,isGroup:!1};if(a!==void 0){let e;e=a.includes(` +`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return this.pushState(`shapeData`),t.yytext=``,24;case 1:return this.pushState(`shapeDataStr`),24;case 2:return this.popState(),24;case 3:return t.yytext=t.yytext.replace(/\n\s*/g,`
`),24;case 4:return 24;case 5:this.popState();break;case 6:return e.getLogger().trace(`Found comment`,t.yytext),6;case 7:return 8;case 8:this.begin(`CLASS`);break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:e.getLogger().trace(`Begin icon`),this.begin(`ICON`);break;case 12:return e.getLogger().trace(`SPACELINE`),6;case 13:return 7;case 14:return 16;case 15:e.getLogger().trace(`end icon`),this.popState();break;case 16:return e.getLogger().trace(`Exploding node`),this.begin(`NODE`),20;case 17:return e.getLogger().trace(`Cloud`),this.begin(`NODE`),20;case 18:return e.getLogger().trace(`Explosion Bang`),this.begin(`NODE`),20;case 19:return e.getLogger().trace(`Cloud Bang`),this.begin(`NODE`),20;case 20:return this.begin(`NODE`),20;case 21:return this.begin(`NODE`),20;case 22:return this.begin(`NODE`),20;case 23:return this.begin(`NODE`),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin(`NSTR2`);break;case 28:return`NODE_DESCR`;case 29:this.popState();break;case 30:e.getLogger().trace(`Starting NSTR`),this.begin(`NSTR`);break;case 31:return e.getLogger().trace(`description:`,t.yytext),`NODE_DESCR`;case 32:this.popState();break;case 33:return this.popState(),e.getLogger().trace(`node end ))`),`NODE_DEND`;case 34:return this.popState(),e.getLogger().trace(`node end )`),`NODE_DEND`;case 35:return this.popState(),e.getLogger().trace(`node end ...`,t.yytext),`NODE_DEND`;case 36:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 37:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 38:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 39:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 40:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 41:return e.getLogger().trace(`Long description:`,t.yytext),21;case 42:return e.getLogger().trace(`Long description:`,t.yytext),21}},`anonymous`),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}}})();function S(){this.yy={}}return e(S,`Parser`),S.prototype=x,x.Parser=S,new S})();g.parser=g;var _=g,v=[],y=[],b=0,x={},S=e(()=>{v=[],y=[],b=0,x={}},`clear`),C=e(e=>{if(v.length===0)return null;let t=v[0].level,n=null;for(let e=v.length-1;e>=0;e--)if(v[e].level===t&&!n&&(n=v[e]),v[e].levelt.parentId===e.id);for(let n of i){let i={id:n.id,parentId:e.id,label:c(n.label??``,r),labelType:`markdown`,isGroup:!1,ticket:n?.ticket,priority:n?.priority,assigned:n?.assigned,icon:n?.icon,shape:`kanbanItem`,level:n.level,rx:5,ry:5,cssStyles:[`text-align: left`]};t.push(i)}}return{nodes:t,edges:e,other:{},config:s()}},`getData`),E=e((e,t,n,r,a)=>{let o=s(),l=o.mindmap?.padding??i.mindmap.padding;switch(r){case D.ROUNDED_RECT:case D.RECT:case D.HEXAGON:l*=2}let u={id:c(t,o)||`kbn`+b++,level:e,label:c(n,o),width:o.mindmap?.maxNodeWidth??i.mindmap.maxNodeWidth,padding:l,isGroup:!1};if(a!==void 0){let e;e=a.includes(` `)?a+` `:`{ `+a+` -}`;let t=u(e,{schema:d});if(t.shape&&(t.shape!==t.shape.toLowerCase()||t.shape.includes(`_`)))throw Error(`No such shape: ${t.shape}. Shape names should be lowercase.`);t?.shape&&t.shape===`kanbanItem`&&(f.shape=t?.shape),t?.label&&(f.label=t?.label),t?.icon&&(f.icon=t?.icon.toString()),t?.assigned&&(f.assigned=t?.assigned.toString()),t?.ticket&&(f.ticket=t?.ticket.toString()),t?.priority&&(f.priority=t?.priority)}let p=C(e);p?f.parentId=p.id||`kbn`+b++:y.push(f),v.push(f)},`addNode`),D={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},O={clear:S,addNode:E,getSections:w,getData:T,nodeType:D,getType:e((e,n)=>{switch(t.debug(`In get type`,e,n),e){case`[`:return D.RECT;case`(`:return n===`)`?D.ROUNDED_RECT:D.CLOUD;case`((`:return D.CIRCLE;case`)`:return D.CLOUD;case`))`:return D.BANG;case`{{`:return D.HEXAGON;default:return D.DEFAULT}},`getType`),setElementForId:e((e,t)=>{x[e]=t},`setElementForId`),decorateNode:e(e=>{if(!e)return;let t=s(),n=v[v.length-1];e.icon&&(n.icon=c(e.icon,t)),e.class&&(n.cssClasses=c(e.class,t))},`decorateNode`),type2Str:e(e=>{switch(e){case D.DEFAULT:return`no-border`;case D.RECT:return`rect`;case D.ROUNDED_RECT:return`rounded-rect`;case D.CIRCLE:return`circle`;case D.CLOUD:return`cloud`;case D.BANG:return`bang`;case D.HEXAGON:return`hexgon`;default:return`no-border`}},`type2Str`),getLogger:e(()=>t,`getLogger`),getElementById:e(e=>x[e],`getElementById`)},k={draw:e(async(e,r,a,o)=>{t.debug(`Rendering kanban diagram -`+e);let c=o.db.getData(),u=s();u.htmlLabels=!1;let d=l(r);for(let e of c.nodes)e.domId=`${r}-${e.id}`;let h=d.append(`g`);h.attr(`class`,`sections`);let g=d.append(`g`);g.attr(`class`,`items`);let _=c.nodes.filter(e=>e.isGroup),v=0,y=[],b=25;for(let e of _){let t=u?.kanban?.sectionWidth||200;v+=1,e.x=t*v+(v-1)*10/2,e.width=t,e.y=0,e.height=t*3,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+` section-`+v;let n=await m(h,e);b=Math.max(b,n?.labelBBox?.height),y.push(n)}let x=0;for(let e of _){let t=y[x];x+=1;let n=u?.kanban?.sectionWidth||200,r=-n*3/2+b,i=r,a=c.nodes.filter(t=>t.parentId===e.id);for(let t of a){if(t.isGroup)throw Error(`Groups within groups are not allowed in Kanban diagrams`);t.x=e.x,t.width=n-15;let r=(await p(g,t,{config:u})).node().getBBox();t.y=i+r.height/2,await f(t),i=t.y+r.height/2+10/2}let o=t.cluster.select(`rect`),s=Math.max(i-r+30,50)+(b-25);o.attr(`height`,s)}n(void 0,d,u.mindmap?.padding??i.kanban.padding,u.mindmap?.useMaxWidth??i.kanban.useMaxWidth)},`draw`)},A=e(t=>{let n=``;for(let e=0;et.darkMode?r(e,n):o(e,n),`adjuster`);for(let e=0;e{switch(t.debug(`In get type`,e,n),e){case`[`:return D.RECT;case`(`:return n===`)`?D.ROUNDED_RECT:D.CLOUD;case`((`:return D.CIRCLE;case`)`:return D.CLOUD;case`))`:return D.BANG;case`{{`:return D.HEXAGON;default:return D.DEFAULT}},`getType`),setElementForId:e((e,t)=>{x[e]=t},`setElementForId`),decorateNode:e(e=>{if(!e)return;let t=s(),n=v[v.length-1];e.icon&&(n.icon=c(e.icon,t)),e.class&&(n.cssClasses=c(e.class,t))},`decorateNode`),type2Str:e(e=>{switch(e){case D.DEFAULT:return`no-border`;case D.RECT:return`rect`;case D.ROUNDED_RECT:return`rounded-rect`;case D.CIRCLE:return`circle`;case D.CLOUD:return`cloud`;case D.BANG:return`bang`;case D.HEXAGON:return`hexgon`;default:return`no-border`}},`type2Str`),getLogger:e(()=>t,`getLogger`),getElementById:e(e=>x[e],`getElementById`)},k={draw:e(async(e,r,a,o)=>{t.debug(`Rendering kanban diagram +`+e);let c=o.db.getData(),u=s();u.htmlLabels=!1;let m=l(r);for(let e of c.nodes)e.domId=`${r}-${e.id}`;let h=m.append(`g`);h.attr(`class`,`sections`);let g=m.append(`g`);g.attr(`class`,`items`);let _=c.nodes.filter(e=>e.isGroup),v=0,y=[],b=25;for(let e of _){let t=u?.kanban?.sectionWidth||200;v+=1,e.x=t*v+(v-1)*10/2,e.width=t,e.y=0,e.height=t*3,e.rx=5,e.ry=5,e.cssClasses=e.cssClasses+` section-`+v;let n=await p(h,e);b=Math.max(b,n?.labelBBox?.height),y.push(n)}let x=0;for(let e of _){let t=y[x];x+=1;let n=u?.kanban?.sectionWidth||200,r=-n*3/2+b,i=r,a=c.nodes.filter(t=>t.parentId===e.id);for(let t of a){if(t.isGroup)throw Error(`Groups within groups are not allowed in Kanban diagrams`);t.x=e.x,t.width=n-15;let r=(await f(g,t,{config:u})).node().getBBox();t.y=i+r.height/2,await d(t),i=t.y+r.height/2+10/2}let o=t.cluster.select(`rect`),s=Math.max(i-r+30,50)+(b-25);o.attr(`height`,s)}n(void 0,m,u.mindmap?.padding??i.kanban.padding,u.mindmap?.useMaxWidth??i.kanban.useMaxWidth)},`draw`)},A=e(t=>{let n=``;for(let e=0;et.darkMode?r(e,n):o(e,n),`adjuster`);for(let e=0;e= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return h(r)}var b=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,13],i=[1,12],a=[1,15],o=[1,16],s=[1,20],c=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],p=[6,7,11],m=[1,6,13,15,16,19,22],h=[1,33],g=[1,34],_=[1,6,7,11,13,15,16,19,22],v={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`MINDMAP`,11:`EOF`,13:`SPACELIST`,15:`ICON`,16:`CLASS`,19:`NODE_DSTART`,20:`NODE_DESCR`,21:`NODE_DEND`,22:`NODE_ID`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 16:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 17:case 21:r.decorateNode({class:a[s]});break;case 18:r.getLogger().trace(`SPACELIST`);break;case 19:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 20:r.decorateNode({icon:a[s]});break;case 25:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 26:this.$={id:a[s],descr:a[s],type:r.nodeType.DEFAULT};break;case 27:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])}}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},{6:r,9:22,12:11,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},{6:u,7:d,10:23,11:f},t(p,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:c}),t(p,[2,18]),t(p,[2,19]),t(p,[2,20]),t(p,[2,21]),t(p,[2,23]),t(p,[2,24]),t(p,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:d,10:32,11:f},{1:[2,7],6:r,12:21,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},t(m,[2,14],{7:h,11:g}),t(_,[2,8]),t(_,[2,9]),t(_,[2,10]),t(p,[2,15]),t(p,[2,16]),t(p,[2,17]),{20:[1,35]},{21:[1,36]},t(m,[2,13],{7:h,11:g}),t(_,[2,11]),t(_,[2,12]),{21:[1,37]},t(p,[2,25]),t(p,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import{b as n,et as r,f as i,k as a,rt as o,tt as s,x as c,z as l}from"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import{t as u}from"./app-chunk-XXDRQBXY.js";import{t as d}from"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import{r as f,t as p}from"./app-chunk-GNY47TPC.js";var m=[];for(let e=0;e<256;++e)m.push((e+256).toString(16).slice(1));function h(e,t=0){return(m[e[t+0]]+m[e[t+1]]+m[e[t+2]]+m[e[t+3]]+`-`+m[e[t+4]]+m[e[t+5]]+`-`+m[e[t+6]]+m[e[t+7]]+`-`+m[e[t+8]]+m[e[t+9]]+`-`+m[e[t+10]]+m[e[t+11]]+m[e[t+12]]+m[e[t+13]]+m[e[t+14]]+m[e[t+15]]).toLowerCase()}var g=new Uint8Array(16);function _(){return crypto.getRandomValues(g)}function v(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():y(e,t,n)}function y(e,t,n){e||={};let r=e.random??e.rng?.()??_();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return h(r)}var b=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,13],i=[1,12],a=[1,15],o=[1,16],s=[1,20],c=[1,19],l=[6,7,8],u=[1,26],d=[1,24],f=[1,25],p=[6,7,11],m=[1,6,13,15,16,19,22],h=[1,33],g=[1,34],_=[1,6,7,11,13,15,16,19,22],v={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`MINDMAP`,11:`EOF`,13:`SPACELIST`,15:`ICON`,16:`CLASS`,19:`NODE_DSTART`,20:`NODE_DESCR`,21:`NODE_DEND`,22:`NODE_ID`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 8:r.getLogger().trace(`Stop NL `);break;case 9:r.getLogger().trace(`Stop EOF `);break;case 11:r.getLogger().trace(`Stop NL2 `);break;case 12:r.getLogger().trace(`Stop EOF2 `);break;case 15:r.getLogger().info(`Node: `,a[s].id),r.addNode(a[s-1].length,a[s].id,a[s].descr,a[s].type);break;case 16:r.getLogger().trace(`Icon: `,a[s]),r.decorateNode({icon:a[s]});break;case 17:case 21:r.decorateNode({class:a[s]});break;case 18:r.getLogger().trace(`SPACELIST`);break;case 19:r.getLogger().trace(`Node: `,a[s].id),r.addNode(0,a[s].id,a[s].descr,a[s].type);break;case 20:r.decorateNode({icon:a[s]});break;case 25:r.getLogger().trace(`node found ..`,a[s-2]),this.$={id:a[s-1],descr:a[s-1],type:r.getType(a[s-2],a[s])};break;case 26:this.$={id:a[s],descr:a[s],type:r.nodeType.DEFAULT};break;case 27:r.getLogger().trace(`node found ..`,a[s-3]),this.$={id:a[s-3],descr:a[s-1],type:r.getType(a[s-2],a[s])}}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},{6:r,9:22,12:11,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},{6:u,7:d,10:23,11:f},t(p,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:c}),t(p,[2,18]),t(p,[2,19]),t(p,[2,20]),t(p,[2,21]),t(p,[2,23]),t(p,[2,24]),t(p,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:d,10:32,11:f},{1:[2,7],6:r,12:21,13:i,14:14,15:a,16:o,17:17,18:18,19:s,22:c},t(m,[2,14],{7:h,11:g}),t(_,[2,8]),t(_,[2,9]),t(_,[2,10]),t(p,[2,15]),t(p,[2,16]),t(p,[2,17]),{20:[1,35]},{21:[1,36]},t(m,[2,13],{7:h,11:g}),t(_,[2,11]),t(_,[2,12]),{21:[1,37]},t(p,[2,25]),t(p,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};v.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:e(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:e(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:e(function(){return this.next()||this.lex()},`lex`),begin:e(function(e){this.conditionStack.push(e)},`begin`),popState:e(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:e(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:e(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:e(function(e){this.begin(e)},`pushState`),stateStackSize:e(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:e(function(e,t,n,r){switch(n){case 0:return e.getLogger().trace(`Found comment`,t.yytext),6;case 1:return 8;case 2:this.begin(`CLASS`);break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:e.getLogger().trace(`Begin icon`),this.begin(`ICON`);break;case 6:return e.getLogger().trace(`SPACELINE`),6;case 7:return 7;case 8:return 15;case 9:e.getLogger().trace(`end icon`),this.popState();break;case 10:return e.getLogger().trace(`Exploding node`),this.begin(`NODE`),19;case 11:return e.getLogger().trace(`Cloud`),this.begin(`NODE`),19;case 12:return e.getLogger().trace(`Explosion Bang`),this.begin(`NODE`),19;case 13:return e.getLogger().trace(`Cloud Bang`),this.begin(`NODE`),19;case 14:return this.begin(`NODE`),19;case 15:return this.begin(`NODE`),19;case 16:return this.begin(`NODE`),19;case 17:return this.begin(`NODE`),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin(`NSTR2`);break;case 22:return`NODE_DESCR`;case 23:this.popState();break;case 24:e.getLogger().trace(`Starting NSTR`),this.begin(`NSTR`);break;case 25:return e.getLogger().trace(`description:`,t.yytext),`NODE_DESCR`;case 26:this.popState();break;case 27:return this.popState(),e.getLogger().trace(`node end ))`),`NODE_DEND`;case 28:return this.popState(),e.getLogger().trace(`node end )`),`NODE_DEND`;case 29:return this.popState(),e.getLogger().trace(`node end ...`,t.yytext),`NODE_DEND`;case 30:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 31:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 32:return this.popState(),e.getLogger().trace(`node end (-`),`NODE_DEND`;case 33:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 34:return this.popState(),e.getLogger().trace(`node end ((`),`NODE_DEND`;case 35:return e.getLogger().trace(`Long description:`,t.yytext),20;case 36:return e.getLogger().trace(`Long description:`,t.yytext),20}},`anonymous`),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}}})();function y(){this.yy={}}return e(y,`Parser`),y.prototype=v,v.Parser=y,new y})();b.parser=b;var x=b,S=12,C={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},w=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=C,this.clear(),this.getType=this.getType.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}static{e(this,`MindmapDB`)}clear(){this.nodes=[],this.count=0,this.elements={},this.baseLevel=void 0}getParent(e){for(let t=this.nodes.length-1;t>=0;t--)if(this.nodes[t].level0?this.nodes[0]:null}addNode(e,n,r,a){t.info(`addNode`,e,n,r,a);let o=!1;this.nodes.length===0?(this.baseLevel=e,e=0,o=!0):this.baseLevel!==void 0&&(e-=this.baseLevel,o=!1);let s=c(),u=s.mindmap?.padding??i.mindmap.padding;switch(a){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:u*=2}let d={id:this.count++,nodeId:l(n,s),level:e,descr:l(r,s),type:a,children:[],width:s.mindmap?.maxNodeWidth??i.mindmap.maxNodeWidth,padding:u,isRoot:o},f=this.getParent(e);if(f)f.children.push(d),this.nodes.push(d);else if(o)this.nodes.push(d);else throw Error(`There can be only one root. No parent could be found for ("${d.descr}")`)}getType(e,n){switch(t.debug(`In get type`,e,n),e){case`[`:return this.nodeType.RECT;case`(`:return n===`)`?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case`((`:return this.nodeType.CIRCLE;case`)`:return this.nodeType.CLOUD;case`))`:return this.nodeType.BANG;case`{{`:return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(e,t){this.elements[e]=t}getElementById(e){return this.elements[e]}decorateNode(e){if(!e)return;let t=c(),n=this.nodes[this.nodes.length-1];e.icon&&(n.icon=l(e.icon,t)),e.class&&(n.class=l(e.class,t))}type2Str(e){switch(e){case this.nodeType.DEFAULT:return`no-border`;case this.nodeType.RECT:return`rect`;case this.nodeType.ROUNDED_RECT:return`rounded-rect`;case this.nodeType.CIRCLE:return`circle`;case this.nodeType.CLOUD:return`cloud`;case this.nodeType.BANG:return`bang`;case this.nodeType.HEXAGON:return`hexgon`;default:return`no-border`}}assignSections(e,t){if(e.section=e.level===0?void 0:t,e.children)for(let[n,r]of e.children.entries()){let i=e.level===0?n%(S-1):t;this.assignSections(r,i)}}flattenNodes(t,n){let r=c(),i=[`mindmap-node`];t.isRoot===!0?i.push(`section-root`,`section--1`):t.section!==void 0&&i.push(`section-${t.section}`),t.class&&i.push(t.class);let a=i.join(` `),o=e(e=>{let t=(r.theme?.toLowerCase()??``).includes(`redux`);switch(e){case C.CIRCLE:return`mindmapCircle`;case C.RECT:return`rect`;case C.ROUNDED_RECT:return`rounded`;case C.CLOUD:return`cloud`;case C.BANG:return`bang`;case C.HEXAGON:return`hexagon`;case C.DEFAULT:return t?`rounded`:`defaultMindmapNode`;case C.NO_BORDER:default:return`rect`}},`getShapeFromType`),s={id:t.id.toString(),domId:`node_`+t.id.toString(),label:t.descr,labelType:`markdown`,isGroup:!1,shape:o(t.type),width:t.width,height:t.height??0,padding:t.padding,cssClasses:a,cssStyles:[],look:r.look,icon:t.icon,x:t.x,y:t.y,level:t.level,nodeId:t.nodeId,type:t.type,section:t.section};if(n.push(s),t.children)for(let e of t.children)this.flattenNodes(e,n)}generateEdges(e,t){if(!e.children)return;let n=c();for(let r of e.children){let i=`edge`;r.section!==void 0&&(i+=` section-edge-${r.section}`);let a=e.level+1;i+=` edge-depth-${a}`;let o={id:`edge_${e.id}_${r.id}`,start:e.id.toString(),end:r.id.toString(),type:`normal`,curve:`basis`,thickness:`normal`,look:n.look,classes:i,depth:e.level,section:r.section};t.push(o),this.generateEdges(r,t)}}getData(){let e=this.getMindmap(),n=c(),r=a().layout!==void 0,i=n;if(r||(i.layout=`cose-bilkent`),!e)return{nodes:[],edges:[],config:i};t.debug(`getData: mindmapRoot`,e,n),this.assignSections(e);let o=[],s=[];this.flattenNodes(e,o),this.generateEdges(e,s),t.debug(`getData: processed ${o.length} nodes and ${s.length} edges`);let l=new Map;for(let e of o)l.set(e.id,{shape:e.shape,width:e.width,height:e.height,padding:e.padding});return{nodes:o,edges:s,config:i,rootNode:e,markers:[`point`],direction:`TB`,nodeSpacing:50,rankSpacing:50,shapes:Object.fromEntries(l),type:`mindmap`,diagramId:`mindmap-`+v()}}getLogger(){return t}},T={draw:e(async(e,r,a,o)=>{t.debug(`Rendering mindmap diagram -`+e);let s=o.db,c=s.getData(),l=f(r,c.config.securityLevel);if(c.type=o.type,c.layoutAlgorithm=d(c.config.layout,{fallback:`cose-bilkent`}),c.diagramId=r,!s.getMindmap())return;c.nodes.forEach(e=>{e.shape===`rounded`?(e.radius=15,e.taper=15,e.stroke=`none`,e.width=0,e.padding=15):e.shape===`circle`?e.padding=10:e.shape===`rect`?(e.width=0,e.padding=10):e.shape===`hexagon`&&(e.width=0,e.height=0)}),await u(c,l);let{themeVariables:m}=n(),{useGradient:h,gradientStart:g,gradientStop:_}=m;if(h&&g&&_){let e=l.attr(`id`),t=l.append(`defs`).append(`linearGradient`).attr(`id`,`${e}-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,g).attr(`stop-opacity`,1),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,_).attr(`stop-opacity`,1)}p(l,c.config.mindmap?.padding??i.mindmap.padding,`mindmapDiagram`,c.config.mindmap?.useMaxWidth??i.mindmap.useMaxWidth)},`draw`)},E=e(e=>{let{theme:t,look:n}=e,i=``;for(let t=0;t{e.shape===`rounded`?(e.radius=15,e.taper=15,e.stroke=`none`,e.width=0,e.padding=15):e.shape===`circle`?e.padding=10:e.shape===`rect`?(e.width=0,e.padding=10):e.shape===`hexagon`&&(e.width=0,e.height=0)}),await f(c,l);let{themeVariables:m}=n(),{useGradient:h,gradientStart:g,gradientStop:_}=m;if(h&&g&&_){let e=l.attr(`id`),t=l.append(`defs`).append(`linearGradient`).attr(`id`,`${e}-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,g).attr(`stop-opacity`,1),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,_).attr(`stop-opacity`,1)}d(l,c.config.mindmap?.padding??i.mindmap.padding,`mindmapDiagram`,c.config.mindmap?.useMaxWidth??i.mindmap.useMaxWidth)},`draw`)},E=e(e=>{let{theme:t,look:n}=e,i=``;for(let t=0;t{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformOrderedChoice`),u=e(e=>{let t=e.elements.map(d);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=e(e=>{let t=p(e.suffix);return e.operator?{type:`special`,text:e.operator===`&`?`&${f(t)}`:`!${f(t)}`}:t},`transformPrefix`),f=e(e=>{switch(e.type){case`terminal`:return`"${e.value}"`;case`nonterminal`:return e.name;case`special`:return e.text;default:return`(...)`}},`nodeToLabel`),p=e(e=>{let t=m(e.primary);if(!e.operator)return t;switch(e.operator){case`?`:return{type:`optional`,element:t};case`*`:return{type:`repetition`,element:t,min:0,max:1/0};case`+`:return{type:`repetition`,element:t,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${e.operator}`)}},`transformSuffix`),m=e(e=>{switch(e.$type){case`PegLiteral`:return{type:`terminal`,value:e.value};case`PegIdentifier`:return{type:`nonterminal`,name:e.name};case`PegGroup`:return l(e.element);case`PegAny`:return{type:`special`,text:e.dot};default:throw Error(`Unsupported PEG primary node: ${e.$type}`)}},`transformPrimary`),h=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),g=e(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(h(e)))},`populateDb`),_={parser:{parse:e(e=>{a.clear(),t.debug(`[PEG Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new s(n);let r=n.value;t.debug(`[PEG Parser] Parsed rules:`,r.rules.length),g(r),t.debug(`[PEG Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{_ as diagram}; \ No newline at end of file +import{n as e}from"./app-chunk-747NJXEK.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=e().RailroadPeg.parser.LangiumParser,l=t(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformOrderedChoice`),u=t(e=>{let t=e.elements.map(d);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformSequence`),d=t(e=>{let t=p(e.suffix);return e.operator?{type:`special`,text:e.operator===`&`?`&${f(t)}`:`!${f(t)}`}:t},`transformPrefix`),f=t(e=>{switch(e.type){case`terminal`:return`"${e.value}"`;case`nonterminal`:return e.name;case`special`:return e.text;default:return`(...)`}},`nodeToLabel`),p=t(e=>{let t=m(e.primary);if(!e.operator)return t;switch(e.operator){case`?`:return{type:`optional`,element:t};case`*`:return{type:`repetition`,element:t,min:0,max:1/0};case`+`:return{type:`repetition`,element:t,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${e.operator}`)}},`transformSuffix`),m=t(e=>{switch(e.$type){case`PegLiteral`:return{type:`terminal`,value:e.value};case`PegIdentifier`:return{type:`nonterminal`,name:e.name};case`PegGroup`:return l(e.element);case`PegAny`:return{type:`special`,text:e.dot};default:throw Error(`Unsupported PEG primary node: ${e.$type}`)}},`transformPrimary`),h=t(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),g=t(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(h(e)))},`populateDb`),_={parser:{parse:t(e=>{a.clear(),n.debug(`[PEG Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;n.debug(`[PEG Parser] Parsed rules:`,r.rules.length),g(r),n.debug(`[PEG Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{_ as diagram}; \ No newline at end of file diff --git a/web/dist/app-railroadDiagram-XR7U4H2S.js b/web/dist/app-railroadDiagram-XR7U4H2S.js index 1c28847b3..f243f535a 100644 --- a/web/dist/app-railroadDiagram-XR7U4H2S.js +++ b/web/dist/app-railroadDiagram-XR7U4H2S.js @@ -1 +1 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n}from"./app-chunk-OUJLGHUK.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=n().Railroad.parser.LangiumParser,l=e(e=>{switch(e.$type){case`RailroadTerminalExpr`:return{type:`terminal`,value:e.value};case`RailroadNonTerminalExpr`:return{type:`nonterminal`,name:e.name};case`RailroadSpecialExpr`:return{type:`special`,text:e.text};case`RailroadSequenceExpr`:{let t=e.elements.map(l);return t.length===1?t[0]:{type:`sequence`,elements:t}}case`RailroadChoiceExpr`:{let t=e.alternatives.map(l);return t.length===1?t[0]:{type:`choice`,alternatives:t}}case`RailroadOptionalExpr`:return{type:`optional`,element:l(e.element)};case`RailroadOneOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:1,max:1/0};case`RailroadZeroOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported railroad expression: ${e.$type}`)}},`transformExpression`),u=e(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),d=e(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(u(e)))},`populateDb`),f={parser:{parse:e(e=>{a.clear(),t.debug(`[Railroad Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new s(n);let r=n.value;t.debug(`[Railroad Parser] Parsed rules:`,r.rules.length),d(r),t.debug(`[Railroad Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{f as diagram}; \ No newline at end of file +import{n as e}from"./app-chunk-OUJLGHUK.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-6AEJRKK7.js";import{n as r,r as i,t as a}from"./app-chunk-GTNCS2PH.js";import{t as o}from"./app-chunk-JWPE2WC7.js";import{t as s}from"./app-mermaid-parser.core.js";var c=e().Railroad.parser.LangiumParser,l=t(e=>{switch(e.$type){case`RailroadTerminalExpr`:return{type:`terminal`,value:e.value};case`RailroadNonTerminalExpr`:return{type:`nonterminal`,name:e.name};case`RailroadSpecialExpr`:return{type:`special`,text:e.text};case`RailroadSequenceExpr`:{let t=e.elements.map(l);return t.length===1?t[0]:{type:`sequence`,elements:t}}case`RailroadChoiceExpr`:{let t=e.alternatives.map(l);return t.length===1?t[0]:{type:`choice`,alternatives:t}}case`RailroadOptionalExpr`:return{type:`optional`,element:l(e.element)};case`RailroadOneOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:1,max:1/0};case`RailroadZeroOrMoreExpr`:return{type:`repetition`,element:l(e.element),min:0,max:1/0};default:throw Error(`Unsupported railroad expression: ${e.$type}`)}},`transformExpression`),u=t(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),d=t(e=>{o(e,a),e.title&&a.setTitle(e.title),e.rules.map(e=>a.addRule(u(e)))},`populateDb`),f={parser:{parse:t(e=>{a.clear(),n.debug(`[Railroad Parser] Starting Langium parse`);let t=c.parse(e);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new s(t);let r=t.value;n.debug(`[Railroad Parser] Parsed rules:`,r.rules.length),d(r),n.debug(`[Railroad Parser] Parse complete`)},`parse`),parser:{yy:a}},db:a,renderer:i,styles:r};export{f as diagram}; \ No newline at end of file diff --git a/web/dist/app-requirementDiagram-PLB6GJNP.js b/web/dist/app-requirementDiagram-PLB6GJNP.js index 94e28e2a7..2bde92b74 100644 --- a/web/dist/app-requirementDiagram-PLB6GJNP.js +++ b/web/dist/app-requirementDiagram-PLB6GJNP.js @@ -1,4 +1,4 @@ -import{n as e,t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import{H as r,U as i,a,b as o,q as s,v as c,w as l,x as u,y as d}from"./app-chunk-O7XYJQB3.js";import{g as f}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{a as p,i as m,o as h,r as g}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as _,t as v}from"./app-chunk-GNY47TPC.js";import{t as y}from"./app-chunk-XXDRQBXY.js";import{t as b}from"./app-chunk-WEXAMYUT.js";var x=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],c=[2,7],l=[1,26],u=[1,27],d=[1,28],f=[1,29],p=[1,33],m=[1,34],h=[1,35],g=[1,36],_=[1,37],v=[1,38],y=[1,24],b=[1,31],x=[1,32],S=[1,30],C=[1,39],w=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,61],D=[89,90],O=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],k=[27,29],ee=[1,70],A=[1,71],te=[1,72],ne=[1,73],re=[1,74],ie=[1,75],ae=[1,76],j=[1,83],M=[1,80],N=[1,84],P=[1,85],F=[1,86],I=[1,87],L=[1,88],R=[1,89],z=[1,90],B=[1,91],V=[1,92],oe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],H=[63,64],se=[1,101],ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],U=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],W=[1,110],G=[1,106],K=[1,107],q=[1,108],J=[1,109],Y=[1,111],X=[1,116],Z=[1,117],Q=[1,114],$=[1,115],le={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:`error`,5:`NEWLINE`,6:`RD`,8:`EOF`,9:`acc_title`,10:`acc_title_value`,11:`acc_descr`,12:`acc_descr_value`,13:`acc_descr_multiline_value`,21:`direction_tb`,22:`direction_bt`,23:`direction_rl`,24:`direction_lr`,27:`STRUCT_START`,29:`STYLE_SEPARATOR`,31:`ID`,32:`COLONSEP`,34:`TEXT`,36:`RISK`,38:`VERIFYMTHD`,40:`STRUCT_STOP`,41:`REQUIREMENT`,42:`FUNCTIONAL_REQUIREMENT`,43:`INTERFACE_REQUIREMENT`,44:`PERFORMANCE_REQUIREMENT`,45:`PHYSICAL_REQUIREMENT`,46:`DESIGN_CONSTRAINT`,47:`LOW_RISK`,48:`MED_RISK`,49:`HIGH_RISK`,50:`VERIFY_ANALYSIS`,51:`VERIFY_DEMONSTRATION`,52:`VERIFY_INSPECTION`,53:`VERIFY_TEST`,54:`ELEMENT`,57:`TYPE`,59:`DOCREF`,61:`END_ARROW_L`,63:`LINE`,64:`END_ARROW_R`,65:`CONTAINS`,66:`COPIES`,67:`DERIVES`,68:`SATISFIES`,69:`VERIFIES`,70:`REFINES`,71:`TRACES`,72:`CLASSDEF`,74:`CLASS`,75:`ALPHA`,76:`COMMA`,77:`STYLE`,80:`NUM`,81:`COLON`,82:`UNIT`,83:`SPACE`,84:`BRKT`,85:`PCT`,86:`MINUS`,87:`LABEL`,88:`SEMICOLON`,89:`unqString`,90:`qString`},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection(`TB`);break;case 18:r.setDirection(`BT`);break;case 19:r.setDirection(`RL`);break;case 20:r.setDirection(`LR`);break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 65:this.$=[a[s]];break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s]}},`anonymous`),table:[{3:1,4:2,6:n,9:r,11:i,13:a},{1:[3]},{3:8,4:2,5:[1,7],6:n,9:r,11:i,13:a},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(o,[2,6]),{3:12,4:2,6:n,9:r,11:i,13:a},{1:[2,2]},{4:17,5:s,7:13,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},t(o,[2,4]),t(o,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:43,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:44,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:45,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:46,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:47,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:48,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:49,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:50,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(T,[2,17]),t(T,[2,18]),t(T,[2,19]),t(T,[2,20]),{30:60,33:62,75:E,89:C,90:w},{30:63,33:62,75:E,89:C,90:w},{30:64,33:62,75:E,89:C,90:w},t(D,[2,29]),t(D,[2,30]),t(D,[2,31]),t(D,[2,32]),t(D,[2,33]),t(D,[2,34]),t(O,[2,81]),t(O,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(k,[2,79]),t(k,[2,80]),{27:[1,67],29:[1,68]},t(k,[2,85]),t(k,[2,86]),{62:69,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{62:77,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{30:78,33:62,75:E,89:C,90:w},{73:79,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,60]),t(oe,[2,62]),{73:93,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},{30:94,33:62,75:E,76:M,89:C,90:w},{5:[1,95]},{30:96,33:62,75:E,89:C,90:w},{5:[1,97]},{30:98,33:62,75:E,89:C,90:w},{63:[1,99]},t(H,[2,50]),t(H,[2,51]),t(H,[2,52]),t(H,[2,53]),t(H,[2,54]),t(H,[2,55]),t(H,[2,56]),{64:[1,100]},t(T,[2,59],{76:M}),t(T,[2,64],{76:se}),{33:103,75:[1,102],89:C,90:w},t(ce,[2,65],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),t(U,[2,67]),t(U,[2,69]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(U,[2,74]),t(U,[2,75]),t(U,[2,76]),t(U,[2,77]),t(U,[2,78]),t(T,[2,57],{76:se}),t(T,[2,58],{76:M}),{5:W,28:105,31:G,34:K,36:q,38:J,40:Y},{27:[1,112],76:M},{5:X,40:Z,56:113,57:Q,59:$},{27:[1,118],76:M},{33:119,89:C,90:w},{33:120,89:C,90:w},{75:j,78:121,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,61]),t(oe,[2,63]),t(U,[2,68]),t(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:W,28:126,31:G,34:K,36:q,38:J,40:Y},t(T,[2,28]),{5:[1,127]},t(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:X,40:Z,56:130,57:Q,59:$},t(T,[2,47]),{5:[1,131]},t(T,[2,48]),t(T,[2,49]),t(ce,[2,66],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),{33:132,89:C,90:w},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(T,[2,27]),{5:W,28:145,31:G,34:K,36:q,38:J,40:Y},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(T,[2,46]),{5:X,40:Z,56:152,57:Q,59:$},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(T,[2,43]),{5:W,28:159,31:G,34:K,36:q,38:J,40:Y},{5:W,28:160,31:G,34:K,36:q,38:J,40:Y},{5:W,28:161,31:G,34:K,36:q,38:J,40:Y},{5:W,28:162,31:G,34:K,36:q,38:J,40:Y},{5:X,40:Z,56:163,57:Q,59:$},{5:X,40:Z,56:164,57:Q,59:$},t(T,[2,23]),t(T,[2,24]),t(T,[2,25]),t(T,[2,26]),t(T,[2,44]),t(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,ee,A;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var te=``;for(O in A=[],s[w])this.terminals_[O]&&O>f&&A.push(`'`+this.terminals_[O]+`'`);te=h.showPosition?`Parse error on line `+(l+1)+`: +import{n as e,t}from"./app-chunk-Y2CYZVJY.js";import{m as n}from"./app-src.js";import{H as r,U as i,a,b as o,q as s,v as c,w as l,x as u,y as d}from"./app-chunk-O7XYJQB3.js";import{g as f}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import{a as p,i as m,o as h,r as g}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import{t as _}from"./app-chunk-XXDRQBXY.js";import{t as v}from"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import{r as y,t as b}from"./app-chunk-GNY47TPC.js";var x=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,3],r=[1,4],i=[1,5],a=[1,6],o=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],s=[1,22],c=[2,7],l=[1,26],u=[1,27],d=[1,28],f=[1,29],p=[1,33],m=[1,34],h=[1,35],g=[1,36],_=[1,37],v=[1,38],y=[1,24],b=[1,31],x=[1,32],S=[1,30],C=[1,39],w=[1,40],T=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,61],D=[89,90],O=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],k=[27,29],ee=[1,70],A=[1,71],te=[1,72],ne=[1,73],re=[1,74],ie=[1,75],ae=[1,76],j=[1,83],M=[1,80],N=[1,84],P=[1,85],F=[1,86],I=[1,87],L=[1,88],R=[1,89],z=[1,90],B=[1,91],V=[1,92],oe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],H=[63,64],se=[1,101],ce=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],U=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],W=[1,110],G=[1,106],K=[1,107],q=[1,108],J=[1,109],Y=[1,111],X=[1,116],Z=[1,117],Q=[1,114],$=[1,115],le={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:`error`,5:`NEWLINE`,6:`RD`,8:`EOF`,9:`acc_title`,10:`acc_title_value`,11:`acc_descr`,12:`acc_descr_value`,13:`acc_descr_multiline_value`,21:`direction_tb`,22:`direction_bt`,23:`direction_rl`,24:`direction_lr`,27:`STRUCT_START`,29:`STYLE_SEPARATOR`,31:`ID`,32:`COLONSEP`,34:`TEXT`,36:`RISK`,38:`VERIFYMTHD`,40:`STRUCT_STOP`,41:`REQUIREMENT`,42:`FUNCTIONAL_REQUIREMENT`,43:`INTERFACE_REQUIREMENT`,44:`PERFORMANCE_REQUIREMENT`,45:`PHYSICAL_REQUIREMENT`,46:`DESIGN_CONSTRAINT`,47:`LOW_RISK`,48:`MED_RISK`,49:`HIGH_RISK`,50:`VERIFY_ANALYSIS`,51:`VERIFY_DEMONSTRATION`,52:`VERIFY_INSPECTION`,53:`VERIFY_TEST`,54:`ELEMENT`,57:`TYPE`,59:`DOCREF`,61:`END_ARROW_L`,63:`LINE`,64:`END_ARROW_R`,65:`CONTAINS`,66:`COPIES`,67:`DERIVES`,68:`SATISFIES`,69:`VERIFIES`,70:`REFINES`,71:`TRACES`,72:`CLASSDEF`,74:`CLASS`,75:`ALPHA`,76:`COMMA`,77:`STYLE`,80:`NUM`,81:`COLON`,82:`UNIT`,83:`SPACE`,84:`BRKT`,85:`PCT`,86:`MINUS`,87:`LABEL`,88:`SEMICOLON`,89:`unqString`,90:`qString`},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 4:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 5:case 6:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:r.setDirection(`TB`);break;case 18:r.setDirection(`BT`);break;case 19:r.setDirection(`RL`);break;case 20:r.setDirection(`LR`);break;case 21:r.addRequirement(a[s-3],a[s-4]);break;case 22:r.addRequirement(a[s-5],a[s-6]),r.setClass([a[s-5]],a[s-3]);break;case 23:r.setNewReqId(a[s-2]);break;case 24:r.setNewReqText(a[s-2]);break;case 25:r.setNewReqRisk(a[s-2]);break;case 26:r.setNewReqVerifyMethod(a[s-2]);break;case 29:this.$=r.RequirementType.REQUIREMENT;break;case 30:this.$=r.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=r.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=r.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=r.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=r.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=r.RiskLevel.LOW_RISK;break;case 36:this.$=r.RiskLevel.MED_RISK;break;case 37:this.$=r.RiskLevel.HIGH_RISK;break;case 38:this.$=r.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=r.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=r.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=r.VerifyType.VERIFY_TEST;break;case 42:r.addElement(a[s-3]);break;case 43:r.addElement(a[s-5]),r.setClass([a[s-5]],a[s-3]);break;case 44:r.setNewElementType(a[s-2]);break;case 45:r.setNewElementDocRef(a[s-2]);break;case 48:r.addRelationship(a[s-2],a[s],a[s-4]);break;case 49:r.addRelationship(a[s-2],a[s-4],a[s]);break;case 50:this.$=r.Relationships.CONTAINS;break;case 51:this.$=r.Relationships.COPIES;break;case 52:this.$=r.Relationships.DERIVES;break;case 53:this.$=r.Relationships.SATISFIES;break;case 54:this.$=r.Relationships.VERIFIES;break;case 55:this.$=r.Relationships.REFINES;break;case 56:this.$=r.Relationships.TRACES;break;case 57:this.$=a[s-2],r.defineClass(a[s-1],a[s]);break;case 58:r.setClass(a[s-1],a[s]);break;case 59:r.setClass([a[s-2]],a[s]);break;case 60:case 62:this.$=[a[s]];break;case 61:case 63:this.$=a[s-2].concat([a[s]]);break;case 64:this.$=a[s-2],r.setCssStyle(a[s-1],a[s]);break;case 65:this.$=[a[s]];break;case 66:a[s-2].push(a[s]),this.$=a[s-2];break;case 68:this.$=a[s-1]+a[s]}},`anonymous`),table:[{3:1,4:2,6:n,9:r,11:i,13:a},{1:[3]},{3:8,4:2,5:[1,7],6:n,9:r,11:i,13:a},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(o,[2,6]),{3:12,4:2,6:n,9:r,11:i,13:a},{1:[2,2]},{4:17,5:s,7:13,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},t(o,[2,4]),t(o,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:s,7:42,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:43,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:44,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:45,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:46,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:47,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:48,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:49,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{4:17,5:s,7:50,8:c,9:r,11:i,13:a,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:l,22:u,23:d,24:f,25:23,33:25,41:p,42:m,43:h,44:g,45:_,46:v,54:y,72:b,74:x,77:S,89:C,90:w},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(T,[2,17]),t(T,[2,18]),t(T,[2,19]),t(T,[2,20]),{30:60,33:62,75:E,89:C,90:w},{30:63,33:62,75:E,89:C,90:w},{30:64,33:62,75:E,89:C,90:w},t(D,[2,29]),t(D,[2,30]),t(D,[2,31]),t(D,[2,32]),t(D,[2,33]),t(D,[2,34]),t(O,[2,81]),t(O,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(k,[2,79]),t(k,[2,80]),{27:[1,67],29:[1,68]},t(k,[2,85]),t(k,[2,86]),{62:69,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{62:77,65:ee,66:A,67:te,68:ne,69:re,70:ie,71:ae},{30:78,33:62,75:E,89:C,90:w},{73:79,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,60]),t(oe,[2,62]),{73:93,75:j,76:M,78:81,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},{30:94,33:62,75:E,76:M,89:C,90:w},{5:[1,95]},{30:96,33:62,75:E,89:C,90:w},{5:[1,97]},{30:98,33:62,75:E,89:C,90:w},{63:[1,99]},t(H,[2,50]),t(H,[2,51]),t(H,[2,52]),t(H,[2,53]),t(H,[2,54]),t(H,[2,55]),t(H,[2,56]),{64:[1,100]},t(T,[2,59],{76:M}),t(T,[2,64],{76:se}),{33:103,75:[1,102],89:C,90:w},t(ce,[2,65],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),t(U,[2,67]),t(U,[2,69]),t(U,[2,70]),t(U,[2,71]),t(U,[2,72]),t(U,[2,73]),t(U,[2,74]),t(U,[2,75]),t(U,[2,76]),t(U,[2,77]),t(U,[2,78]),t(T,[2,57],{76:se}),t(T,[2,58],{76:M}),{5:W,28:105,31:G,34:K,36:q,38:J,40:Y},{27:[1,112],76:M},{5:X,40:Z,56:113,57:Q,59:$},{27:[1,118],76:M},{33:119,89:C,90:w},{33:120,89:C,90:w},{75:j,78:121,79:82,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V},t(oe,[2,61]),t(oe,[2,63]),t(U,[2,68]),t(T,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:W,28:126,31:G,34:K,36:q,38:J,40:Y},t(T,[2,28]),{5:[1,127]},t(T,[2,42]),{32:[1,128]},{32:[1,129]},{5:X,40:Z,56:130,57:Q,59:$},t(T,[2,47]),{5:[1,131]},t(T,[2,48]),t(T,[2,49]),t(ce,[2,66],{79:104,75:j,80:N,81:P,82:F,83:I,84:L,85:R,86:z,87:B,88:V}),{33:132,89:C,90:w},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(T,[2,27]),{5:W,28:145,31:G,34:K,36:q,38:J,40:Y},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(T,[2,46]),{5:X,40:Z,56:152,57:Q,59:$},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(T,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(T,[2,43]),{5:W,28:159,31:G,34:K,36:q,38:J,40:Y},{5:W,28:160,31:G,34:K,36:q,38:J,40:Y},{5:W,28:161,31:G,34:K,36:q,38:J,40:Y},{5:W,28:162,31:G,34:K,36:q,38:J,40:Y},{5:X,40:Z,56:163,57:Q,59:$},{5:X,40:Z,56:164,57:Q,59:$},t(T,[2,23]),t(T,[2,24]),t(T,[2,25]),t(T,[2,26]),t(T,[2,44]),t(T,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,ee,A;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var te=``;for(O in A=[],s[w])this.terminals_[O]&&O>f&&A.push(`'`+this.terminals_[O]+`'`);te=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+A.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(te,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:A})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),ee=s[r[r.length-2]][r[r.length-1]],r.push(ee);break;case 3:return!0}}return!0},`parse`)};le.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` @@ -81,4 +81,4 @@ Expecting `+A.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on l background-color: ${r??e.edgeLabelBackground}; } -`},`getStyles`),E={};t(E,{draw:()=>D});var D=e(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing requirement diagram (unified)`,t);let{securityLevel:a,state:o,layout:s,look:c}=u(),l=i.db.getData(),d=y(t,a);l.type=i.type,l.layoutAlgorithm=v(s),l.nodeSpacing=o?.nodeSpacing??50,l.rankSpacing=o?.rankSpacing??50,l.markers=c===`neo`?[`requirement_contains_neo`,`requirement_arrow_neo`]:[`requirement_contains`,`requirement_arrow`],l.diagramId=t,await _(l,d),f.insertTitle(d,`requirementDiagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),b(d,8,`requirementDiagram`,o?.useMaxWidth??!0)},`draw`),O={parser:S,get db(){return new C},renderer:E,styles:T};export{O as diagram}; \ No newline at end of file +`},`getStyles`),E={};t(E,{draw:()=>D});var D=e(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing requirement diagram (unified)`,t);let{securityLevel:a,state:o,layout:s,look:c}=u(),l=i.db.getData(),d=_(t,a);l.type=i.type,l.layoutAlgorithm=b(s),l.nodeSpacing=o?.nodeSpacing??50,l.rankSpacing=o?.rankSpacing??50,l.markers=c===`neo`?[`requirement_contains_neo`,`requirement_arrow_neo`]:[`requirement_contains`,`requirement_arrow`],l.diagramId=t,await y(l,d),f.insertTitle(d,`requirementDiagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),v(d,8,`requirementDiagram`,o?.useMaxWidth??!0)},`draw`),O={parser:S,get db(){return new C},renderer:E,styles:T};export{O as diagram}; \ No newline at end of file diff --git a/web/dist/app-sequenceDiagram-PO4LG4MO.js b/web/dist/app-sequenceDiagram-PO4LG4MO.js index 5602e44c0..e606b65ef 100644 --- a/web/dist/app-sequenceDiagram-PO4LG4MO.js +++ b/web/dist/app-sequenceDiagram-PO4LG4MO.js @@ -1,4 +1,4 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{A as r,F as i,G as a,H as o,O as s,U as c,a as l,b as u,c as d,i as f,q as p,r as m,s as h,v as g,w as _,x as v,y,z as b}from"./app-chunk-O7XYJQB3.js";import{t as x}from"./app-dist.js";import{g as S,p as C}from"./app-chunk-ZIGJFQKS.js";import{n as w,t as T}from"./app-chunk-LNGE3PJU.js";import{a as E,c as D,i as O,n as k,r as A,s as j}from"./app-chunk-GWA4HPMP.js";import{t as M}from"./app-chunk-2Q5K7J3B.js";var N=x(),P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ee=[1,74],te=[1,80],L=[1,81],ne=[1,82],re=[1,83],ie=[1,84],ae=[1,85],oe=[1,86],se=[1,87],ce=[1,88],le=[1,89],ue=[1,90],R=[1,91],de=[1,92],fe=[1,93],pe=[1,94],me=[1,95],z=[1,96],B=[1,97],he=[1,98],V=[1,99],H=[1,100],U=[1,101],ge=[1,102],_e=[1,103],ve=[1,104],ye=[1,105],W=[2,78],be=[4,5,17,51,53,54],G=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],we=[5,52],K=[70,71,72,73],q=[1,151],Te={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1))}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},t(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(I,[2,30]),t(I,[2,31]),{33:[1,62]},{35:[1,63]},t(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ee},{23:75,55:76,73:ee},{23:77,73:F},{69:78,72:[1,79],78:te,79:L,80:ne,81:re,82:ie,83:ae,84:oe,85:se,86:ce,87:le,88:ue,89:R,90:de,91:fe,92:pe,93:me,94:z,95:B,96:he,97:V,98:H,99:U,100:ge,101:_e,102:ve,103:ye},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],W),t(I,[2,6]),t(I,[2,16]),t(be,[2,10],{11:114}),t(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(I,[2,22]),{5:[1,118]},{5:[1,119]},t(I,[2,25]),t(I,[2,26]),t(I,[2,27]),t(I,[2,28]),t(I,[2,29]),t(I,[2,32]),t(I,[2,33]),t(G,a,{7:120}),t(G,a,{7:121}),t(G,a,{7:122}),t(xe,a,{41:123,7:124}),t(Se,a,{43:125,7:126}),t(Se,a,{7:126,43:127}),t(Ce,a,{46:128,7:129}),t(G,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(we,W,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:te,79:L,80:ne,81:re,82:ie,83:ae,84:oe,85:se,86:ce,87:le,88:ue,89:R,90:de,91:fe,92:pe,93:me,94:z,95:B,96:he,97:V,98:H,99:U,100:ge,101:_e,102:ve,103:ye},t(K,[2,79]),t(K,[2,80]),t(K,[2,81]),t(K,[2,82]),t(K,[2,83]),t(K,[2,84]),t(K,[2,85]),t(K,[2,86]),t(K,[2,87]),t(K,[2,88]),t(K,[2,89]),t(K,[2,90]),t(K,[2,91]),t(K,[2,92]),t(K,[2,93]),t(K,[2,94]),t(K,[2,95]),t(K,[2,96]),t(K,[2,97]),t(K,[2,98]),t(K,[2,99]),t(K,[2,100]),t(K,[2,101]),t(K,[2,102]),t(K,[2,103]),t(K,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:q},{58:152,104:q},{58:153,104:q},{58:154,104:q},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},t(I,[2,20]),t(I,[2,21]),t(I,[2,23]),t(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},t(I,[2,50]),{16:[1,173]},t(I,[2,55]),t(we,[2,76]),{76:[1,174]},{16:[1,175]},t(I,[2,52]),{16:[1,176]},t(I,[2,57]),t(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:q},{23:181,72:[1,182],73:F},{58:183,104:q},{58:184,104:q},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(I,[2,17]),t(be,[2,11]),{13:186,51:D,53:O,54:k},t(be,[2,13]),t(be,[2,14]),t(I,[2,19]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t(I,[2,38]),{16:[1,187]},t(I,[2,39]),{16:[1,188]},t(I,[2,40]),t(I,[2,41]),{16:[1,189]},t(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:q},{58:196,104:q},{58:197,104:q},{5:[2,75]},{58:198,104:q},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},t(be,[2,12]),t(xe,a,{7:124,41:201}),t(Se,a,{7:126,43:202}),t(Ce,a,{7:129,46:203}),t(I,[2,49]),t(I,[2,54]),t(we,[2,77]),t(I,[2,51]),t(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:q},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{A as r,F as i,G as a,H as o,O as s,U as c,a as l,b as u,c as d,i as f,q as p,r as m,s as h,v as g,w as _,x as v,y,z as b}from"./app-chunk-O7XYJQB3.js";import{t as x}from"./app-dist.js";import{g as S,p as C}from"./app-chunk-ZIGJFQKS.js";import{a as w,c as T,i as E,n as D,r as O,s as k}from"./app-chunk-GWA4HPMP.js";import{n as A,t as j}from"./app-chunk-LNGE3PJU.js";import{t as M}from"./app-chunk-2Q5K7J3B.js";var N=x(),P=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ee=[1,74],te=[1,80],L=[1,81],ne=[1,82],re=[1,83],ie=[1,84],ae=[1,85],oe=[1,86],se=[1,87],ce=[1,88],le=[1,89],ue=[1,90],R=[1,91],de=[1,92],fe=[1,93],pe=[1,94],me=[1,95],z=[1,96],B=[1,97],he=[1,98],V=[1,99],H=[1,100],U=[1,101],ge=[1,102],_e=[1,103],ve=[1,104],ye=[1,105],W=[2,78],be=[4,5,17,51,53,54],G=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],we=[5,52],K=[70,71,72,73],q=[1,151],Te={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1))}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},t(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(I,[2,30]),t(I,[2,31]),{33:[1,62]},{35:[1,63]},t(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ee},{23:75,55:76,73:ee},{23:77,73:F},{69:78,72:[1,79],78:te,79:L,80:ne,81:re,82:ie,83:ae,84:oe,85:se,86:ce,87:le,88:ue,89:R,90:de,91:fe,92:pe,93:me,94:z,95:B,96:he,97:V,98:H,99:U,100:ge,101:_e,102:ve,103:ye},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],W),t(I,[2,6]),t(I,[2,16]),t(be,[2,10],{11:114}),t(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(I,[2,22]),{5:[1,118]},{5:[1,119]},t(I,[2,25]),t(I,[2,26]),t(I,[2,27]),t(I,[2,28]),t(I,[2,29]),t(I,[2,32]),t(I,[2,33]),t(G,a,{7:120}),t(G,a,{7:121}),t(G,a,{7:122}),t(xe,a,{41:123,7:124}),t(Se,a,{43:125,7:126}),t(Se,a,{7:126,43:127}),t(Ce,a,{46:128,7:129}),t(G,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(we,W,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:te,79:L,80:ne,81:re,82:ie,83:ae,84:oe,85:se,86:ce,87:le,88:ue,89:R,90:de,91:fe,92:pe,93:me,94:z,95:B,96:he,97:V,98:H,99:U,100:ge,101:_e,102:ve,103:ye},t(K,[2,79]),t(K,[2,80]),t(K,[2,81]),t(K,[2,82]),t(K,[2,83]),t(K,[2,84]),t(K,[2,85]),t(K,[2,86]),t(K,[2,87]),t(K,[2,88]),t(K,[2,89]),t(K,[2,90]),t(K,[2,91]),t(K,[2,92]),t(K,[2,93]),t(K,[2,94]),t(K,[2,95]),t(K,[2,96]),t(K,[2,97]),t(K,[2,98]),t(K,[2,99]),t(K,[2,100]),t(K,[2,101]),t(K,[2,102]),t(K,[2,103]),t(K,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:q},{58:152,104:q},{58:153,104:q},{58:154,104:q},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},t(I,[2,20]),t(I,[2,21]),t(I,[2,23]),t(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},t(I,[2,50]),{16:[1,173]},t(I,[2,55]),t(we,[2,76]),{76:[1,174]},{16:[1,175]},t(I,[2,52]),{16:[1,176]},t(I,[2,57]),t(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:q},{23:181,72:[1,182],73:F},{58:183,104:q},{58:184,104:q},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(I,[2,17]),t(be,[2,11]),{13:186,51:D,53:O,54:k},t(be,[2,13]),t(be,[2,14]),t(I,[2,19]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t(I,[2,38]),{16:[1,187]},t(I,[2,39]),{16:[1,188]},t(I,[2,40]),t(I,[2,41]),{16:[1,189]},t(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:q},{58:196,104:q},{58:197,104:q},{5:[2,75]},{58:198,104:q},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},t(be,[2,12]),t(xe,a,{7:124,41:201}),t(Se,a,{7:126,43:202}),t(Ce,a,{7:129,46:203}),t(I,[2,49]),t(I,[2,54]),t(we,[2,77]),t(I,[2,51]),t(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:q},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};Te.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` @@ -7,7 +7,7 @@ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on l `)?i+` `:`{ `+i+` -}`,o=w(e,{schema:T})}r=o?.type??r,o?.alias&&(!n||n.text===t)&&(n={text:o.alias,wrap:n?.wrap,type:r});let s=this.state.records.actors.get(e);if(s){if(this.state.records.currentBox&&s.box&&this.state.records.currentBox!==s.box)throw Error(`A same participant should only be defined in one Box: ${s.name} can't be in '${s.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(a=s.box?s.box:this.state.records.currentBox,s.box=a,s&&t===s.name&&n==null)return}if(n?.text??(n={text:t,type:r}),(r==null||n.text==null)&&(n={text:t,type:r}),this.state.records.actors.set(e,{box:a,name:t,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??`participant`}),this.state.records.prevActor){let t=this.state.records.actors.get(this.state.records.prevActor);t&&(t.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,n=0;if(!e)return 0;for(t=0;t>-`,token:`->>-`,line:`1`,loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:[`'ACTIVE_PARTICIPANT'`]},t}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n?.text??``,wrap:n?.wrap??this.autoWrap(),type:r,activate:i,centralConnection:a??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();let t=/^:?wrap:/.exec(e)!==null||/^:?nowrap:/.exec(e)===null&&void 0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,``)).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled===void 0?v().sequence?.wrap??!1:this.state.records.wrapEnabled}clear(){this.state.reset(),l()}parseMessage(e){let n=e.trim(),{wrap:r,cleanedText:i}=this.extractWrap(n),a={text:i,wrap:r};return t.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){let t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e),n=t?.[1]?t[1].trim():`transparent`,r=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports(`color`,n)||(n=`transparent`,r=e.trim());else{let t=new Option().style;t.color=n,t.color!==n&&(n=`transparent`,r=e.trim())}let{wrap:i,cleanedText:a}=this.extractWrap(r);return{text:a?b(a,v()):void 0,color:n,wrap:i}}addNote(e,t,n){let r={actor:e,placement:t,message:n.text,wrap:n.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,n){let r=this.getActor(e);try{let e=b(n.text,v());e=e.replace(/=/g,`=`),e=e.replace(/&/g,`&`);let t=JSON.parse(e);this.insertLinks(r,t)}catch(e){t.error(`error while parsing actor link text`,e)}}addALink(e,n){let r=this.getActor(e);try{let e={},t=b(n.text,v()),i=t.indexOf(`@`);t=t.replace(/=/g,`=`),t=t.replace(/&/g,`&`);let a=t.slice(0,i-1).trim();e[a]=t.slice(i+1).trim(),this.insertLinks(r,e)}catch(e){t.error(`error while parsing actor link text`,e)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(let n in t)e.links[n]=t[n]}addProperties(e,n){let r=this.getActor(e);try{let e=b(n.text,v()),t=JSON.parse(e);this.insertProperties(r,t)}catch(e){t.error(`error while parsing actor properties text`,e)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(let n in t)e.properties[n]=t[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,n){let r=this.getActor(e),i=document.getElementById(n.text);try{let e=i.innerHTML,t=JSON.parse(e);t.properties&&this.insertProperties(r,t.properties),t.links&&this.insertLinks(r,t.links)}catch(e){t.error(`error while parsing actor details text`,e)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(e=>{this.apply(e)});else switch(e.type){case`sequenceIndex`:this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case`addParticipant`:this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case`createParticipant`:if(this.state.records.actors.has(e.actor))throw Error(`It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior`);this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case`destroyParticipant`:this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case`activeStart`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnection`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnectionReverse`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`activeEnd`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`addNote`:this.addNote(e.actor,e.placement,e.text);break;case`addLinks`:this.addLinks(e.actor,e.text);break;case`addALink`:this.addALink(e.actor,e.text);break;case`addProperties`:this.addProperties(e.actor,e.text);break;case`addDetails`:this.addDetails(e.actor,e.text);break;case`addMessage`:if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw Error(`The created participant `+this.state.records.lastCreated.name+` does not have an associated creating message after its declaration. Please check the sequence diagram.`);this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw Error(`The destroyed participant `+this.state.records.lastDestroyed.name+` does not have an associated destroying message after its declaration. Please check the sequence diagram.`);this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case`boxStart`:this.addBox(e.boxData);break;case`boxEnd`:this.boxEnd();break;case`loopStart`:this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case`loopEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`rectStart`:this.addSignal(void 0,void 0,e.color,e.signalType);break;case`rectEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`optStart`:this.addSignal(void 0,void 0,e.optText,e.signalType);break;case`optEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`altStart`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`else`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`altEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`setAccTitle`:c(e.text);break;case`parStart`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`and`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`parEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`criticalStart`:this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case`option`:this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case`criticalEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`breakStart`:this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case`breakEnd`:this.addSignal(void 0,void 0,void 0,e.signalType)}}getConfig(){return v().sequence}},re=e(e=>{let t=e.dropShadow??`none`,{look:n}=v();return`.actor { +}`,o=A(e,{schema:j})}r=o?.type??r,o?.alias&&(!n||n.text===t)&&(n={text:o.alias,wrap:n?.wrap,type:r});let s=this.state.records.actors.get(e);if(s){if(this.state.records.currentBox&&s.box&&this.state.records.currentBox!==s.box)throw Error(`A same participant should only be defined in one Box: ${s.name} can't be in '${s.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(a=s.box?s.box:this.state.records.currentBox,s.box=a,s&&t===s.name&&n==null)return}if(n?.text??(n={text:t,type:r}),(r==null||n.text==null)&&(n={text:t,type:r}),this.state.records.actors.set(e,{box:a,name:t,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??`participant`}),this.state.records.prevActor){let t=this.state.records.actors.get(this.state.records.prevActor);t&&(t.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,n=0;if(!e)return 0;for(t=0;t>-`,token:`->>-`,line:`1`,loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:[`'ACTIVE_PARTICIPANT'`]},t}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n?.text??``,wrap:n?.wrap??this.autoWrap(),type:r,activate:i,centralConnection:a??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();let t=/^:?wrap:/.exec(e)!==null||/^:?nowrap:/.exec(e)===null&&void 0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,``)).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled===void 0?v().sequence?.wrap??!1:this.state.records.wrapEnabled}clear(){this.state.reset(),l()}parseMessage(e){let n=e.trim(),{wrap:r,cleanedText:i}=this.extractWrap(n),a={text:i,wrap:r};return t.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){let t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e),n=t?.[1]?t[1].trim():`transparent`,r=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports(`color`,n)||(n=`transparent`,r=e.trim());else{let t=new Option().style;t.color=n,t.color!==n&&(n=`transparent`,r=e.trim())}let{wrap:i,cleanedText:a}=this.extractWrap(r);return{text:a?b(a,v()):void 0,color:n,wrap:i}}addNote(e,t,n){let r={actor:e,placement:t,message:n.text,wrap:n.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,n){let r=this.getActor(e);try{let e=b(n.text,v());e=e.replace(/=/g,`=`),e=e.replace(/&/g,`&`);let t=JSON.parse(e);this.insertLinks(r,t)}catch(e){t.error(`error while parsing actor link text`,e)}}addALink(e,n){let r=this.getActor(e);try{let e={},t=b(n.text,v()),i=t.indexOf(`@`);t=t.replace(/=/g,`=`),t=t.replace(/&/g,`&`);let a=t.slice(0,i-1).trim();e[a]=t.slice(i+1).trim(),this.insertLinks(r,e)}catch(e){t.error(`error while parsing actor link text`,e)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(let n in t)e.links[n]=t[n]}addProperties(e,n){let r=this.getActor(e);try{let e=b(n.text,v()),t=JSON.parse(e);this.insertProperties(r,t)}catch(e){t.error(`error while parsing actor properties text`,e)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(let n in t)e.properties[n]=t[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,n){let r=this.getActor(e),i=document.getElementById(n.text);try{let e=i.innerHTML,t=JSON.parse(e);t.properties&&this.insertProperties(r,t.properties),t.links&&this.insertLinks(r,t.links)}catch(e){t.error(`error while parsing actor details text`,e)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(e=>{this.apply(e)});else switch(e.type){case`sequenceIndex`:this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case`addParticipant`:this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case`createParticipant`:if(this.state.records.actors.has(e.actor))throw Error(`It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior`);this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case`destroyParticipant`:this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case`activeStart`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnection`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnectionReverse`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`activeEnd`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`addNote`:this.addNote(e.actor,e.placement,e.text);break;case`addLinks`:this.addLinks(e.actor,e.text);break;case`addALink`:this.addALink(e.actor,e.text);break;case`addProperties`:this.addProperties(e.actor,e.text);break;case`addDetails`:this.addDetails(e.actor,e.text);break;case`addMessage`:if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw Error(`The created participant `+this.state.records.lastCreated.name+` does not have an associated creating message after its declaration. Please check the sequence diagram.`);this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw Error(`The destroyed participant `+this.state.records.lastDestroyed.name+` does not have an associated destroying message after its declaration. Please check the sequence diagram.`);this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case`boxStart`:this.addBox(e.boxData);break;case`boxEnd`:this.boxEnd();break;case`loopStart`:this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case`loopEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`rectStart`:this.addSignal(void 0,void 0,e.color,e.signalType);break;case`rectEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`optStart`:this.addSignal(void 0,void 0,e.optText,e.signalType);break;case`optEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`altStart`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`else`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`altEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`setAccTitle`:c(e.text);break;case`parStart`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`and`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`parEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`criticalStart`:this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case`option`:this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case`criticalEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`breakStart`:this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case`breakEnd`:this.addSignal(void 0,void 0,void 0,e.signalType)}}getConfig(){return v().sequence}},re=e(e=>{let t=e.dropShadow??`none`,{look:n}=v();return`.actor { stroke: ${e.actorBorder}; fill: ${e.actorBkg}; stroke-width: ${e.strokeWidth??1}; @@ -153,17 +153,17 @@ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on l filter: ${t}; stroke: ${e.nodeBorder}; } -`},`getStyles`),ie=44,ae=6,oe=6,se=e((e,t)=>e.actorTextHeight??S.calculateTextDimensions(e.description??``,{fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}).height,`actorLabelHeight`),ce=e(e=>ie+ae+e+oe,`actorStackHeight`),le=e((e,t,n)=>{let r=e+t,i=r-oe-n/2;return{lifelineStartY:r,glyphBottomY:r-oe-n-ae,labelCenterY:i}},`headerBands`),ue=e((e,t)=>{let n=e+oe,r=n+ie;return{glyphTopY:n,glyphBottomY:r,labelCenterY:r+ae+t/2,stackHeight:ce(t)}},`footerBands`),R=36,de=-5,fe=60,pe=fe-de,me=e((e,t,n,r)=>{if(t.look!==`neo`)return null;let i=se(e,t);return n?ue(r,i):le(r,e.height,i)},`neoBands`),z=`actor-top`,B=`actor-bottom`,he=`actor-box`,V=`actor-man`,H=new Set([`redux-color`,`redux-dark-color`]),U=e((e,t)=>e?.length?e[t%e.length]:void 0,`paletteColor`),ge=e(function(e,t){let n=E(e,t);return u().look===`neo`&&n.attr(`data-look`,`neo`),n},`drawRect`),_e=e(function(e,t,n,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let a=t.links,o=t.actorCnt,s=t.rectData;var c=`none`;i&&(c=`block !important`);let l=e.append(`g`);l.attr(`id`,`actor`+o+`_popup`),l.attr(`class`,`actorPopupMenu`),l.attr(`display`,c);var u=``;s.class!==void 0&&(u=` `+s.class);let d=s.width>n?s.width:n,f=l.append(`rect`);if(f.attr(`class`,`actorPopupMenuPanel`+u),f.attr(`x`,s.x),f.attr(`y`,s.height),f.attr(`fill`,s.fill),f.attr(`stroke`,s.stroke),f.attr(`width`,d),f.attr(`height`,s.height),f.attr(`rx`,s.rx),f.attr(`ry`,s.ry),a!=null){var p=20;for(let e in a){var m=l.append(`a`),h=(0,N.sanitizeUrl)(a[e]);m.attr(`xlink:href`,h),m.attr(`target`,`_blank`),We(r)(e,m,s.x+10,s.height+p,d,20,{class:`actor`},r),p+=30}}return f.attr(`height`,p),{height:s.height+p,width:d}},`drawPopup`),ve=e(function(e){return`var pu = document.getElementById('`+e+`'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }`},`popupMenuToggle`),ye=e(async function(e,t,n=null){let r=e.append(`foreignObject`),a=await i(t.text,u()),o=r.append(`xhtml:div`).attr(`style`,`width: fit-content;`).attr(`xmlns`,`http://www.w3.org/1999/xhtml`).html(a).node().getBoundingClientRect();if(r.attr(`height`,Math.round(o.height)).attr(`width`,Math.round(o.width)),t.class===`noteText`){let n=e.node().firstChild;n.setAttribute(`height`,o.height+2*t.textMargin);let i=n.getBBox();r.attr(`x`,Math.round(i.x+i.width/2-o.width/2)).attr(`y`,Math.round(i.y+i.height/2-o.height/2))}else if(n){let{startx:e,stopx:i,starty:a}=n;if(e>i){let t=e;e=i,i=t}r.attr(`x`,Math.round(e+Math.abs(e-i)/2-o.width/2)),t.class===`loopText`?r.attr(`y`,Math.round(a)):r.attr(`y`,Math.round(a-o.height))}return[r]},`drawKatex`),W=e(function(t,n){let r=0,i=0,a=n.text.split(h.lineBreakRegex),[o,s]=C(n.fontSize),c=[],l=0,u=e(()=>n.y,`yfunc`);if(n.valign!==void 0&&n.textMargin!==void 0&&n.textMargin>0)switch(n.valign){case`top`:case`start`:u=e(()=>Math.round(n.y+n.textMargin),`yfunc`);break;case`middle`:case`center`:u=e(()=>Math.round(n.y+(r+i+n.textMargin)/2),`yfunc`);break;case`bottom`:case`end`:u=e(()=>Math.round(n.y+(r+i+2*n.textMargin)-n.textMargin),`yfunc`)}if(n.anchor!==void 0&&n.textMargin!==void 0&&n.width!==void 0)switch(n.anchor){case`left`:case`start`:n.x=Math.round(n.x+n.textMargin),n.anchor=`start`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`;break;case`middle`:case`center`:n.x=Math.round(n.x+n.width/2),n.anchor=`middle`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`;break;case`right`:case`end`:n.x=Math.round(n.x+n.width-n.textMargin),n.anchor=`end`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`}for(let[e,d]of a.entries()){n.textMargin!==void 0&&n.textMargin===0&&o!==void 0&&(l=e*o);let a=t.append(`text`);a.attr(`x`,n.x),a.attr(`y`,u()),n.anchor!==void 0&&a.attr(`text-anchor`,n.anchor).attr(`dominant-baseline`,n.dominantBaseline).attr(`alignment-baseline`,n.alignmentBaseline),n.fontFamily!==void 0&&a.style(`font-family`,n.fontFamily),s!==void 0&&a.style(`font-size`,s),n.fontWeight!==void 0&&a.style(`font-weight`,n.fontWeight),n.fill!==void 0&&a.attr(`fill`,n.fill),n.class!==void 0&&a.attr(`class`,n.class),n.dy===void 0?l!==0&&a.attr(`dy`,l):a.attr(`dy`,n.dy);let f=d||`​`;if(n.tspan){let e=a.append(`tspan`);e.attr(`x`,n.x),n.fill!==void 0&&e.attr(`fill`,n.fill),e.text(f)}else a.text(f);n.valign!==void 0&&n.textMargin!==void 0&&n.textMargin>0&&(i+=(a._groups||a)[0][0].getBBox().height,r=i),c.push(a)}return c},`drawText`),be=e(function(t,n){function r(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}e(r,`genPoints`);let i=t.append(`polygon`);return i.attr(`points`,r(n.x,n.y,n.width,n.height,7)),i.attr(`class`,`labelBox`),n.y+=n.height/2,W(t,n),i},`drawLabel`),G=-1,xe=e((e,t,n,r)=>{e.select&&n.forEach(n=>{let i=t.get(n),a=e.select(`#actor`+i.actorCnt);!r.mirrorActors&&i.stopy?a.attr(`y2`,i.stopy+i.height/2):r.mirrorActors&&a.attr(`y2`,i.stopy)})},`fixLifeLineHeights`),Se=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=s+t.height,{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m}=f,h=e.append(`g`).lower();var g=h;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,l).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=G,t.links!=null&&g.attr(`id`,`root-`+G),u===`neo`&&g.attr(`data-look`,`neo`));let _=j();var v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,v+=i?` ${B}`:` ${z}`,_.x=t.x,_.y=s,_.width=t.width,_.height=t.height,_.class=v,_.rx=3,_.ry=3,_.name=t.name,u===`neo`&&(_.rx=6,_.ry=6);let y=ge(g,_),b=o.get(t.name)??0;if(H.has(d)&&(y.style(`stroke`,U(m,b)),y.style(`fill`,U(p,b))),u===`neo`&&y.attr(`filter`,`url(#${J(a)})`),t.rectData=_,t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?A(g,_.x+_.width-20,_.y+10,e.substr(1)):O(g,_.x+_.width-20,_.y+10,e)}i||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`participant`),g.attr(`data-id`,t.name)),Y(n,r(t.description))(t.description,g,_.x,_.y,_.width,_.height,{class:`actor ${he}`},n);let x=t.height;if(y.node){let e=y.node().getBBox();n.look!==`neo`&&(t.height=e.height,x=e.height)}return x},`drawActorTypeParticipant`),Ce=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=s+t.height,{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m}=f,h=e.append(`g`).lower();var g=h;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,l).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=G,t.links!=null&&g.attr(`id`,`root-`+G),u===`neo`&&g.attr(`data-look`,`neo`));let _=j();var v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,v+=i?` ${B}`:` ${z}`,_.x=t.x,_.y=s,_.width=t.width,_.height=t.height,_.class=v,_.name=t.name,n.look===`neo`&&(_.height=t.height-6);let y={..._,x:_.x+-6,y:_.y+6,class:`actor`},b=ge(g,_),x=ge(g,y);t.rectData=_,u===`neo`&&g.attr(`filter`,`url(#${J(a)})`);let S=o.get(t.name)??0;if(H.has(d)&&(b.style(`stroke`,U(m,S)),b.style(`fill`,U(p,S)),x.style(`stroke`,U(m,S)),x.style(`fill`,U(p,S))),t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?A(g,_.x+_.width-20,_.y+10,e.substr(1)):O(g,_.x+_.width-20,_.y+10,e)}Y(n,r(t.description))(t.description,g,_.x-6,_.y+6,_.width,_.height,{class:`actor ${he}`},n);let C=t.height;if(b.node){let e=b.node().getBBox();n.look!==`neo`&&(t.height=e.height,C=e.height)}return i||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`collections`),g.attr(`data-id`,t.name)),C},`drawActorTypeCollections`),we=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=s+t.height,{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m}=f,h=e.append(`g`).lower(),g=h;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,l).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=G,t.links!=null&&g.attr(`id`,`root-`+G),u===`neo`&&g.attr(`data-look`,`neo`));let _=j(),v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,v+=i?` ${B}`:` ${z}`,g.attr(`class`,v),_.x=t.x,_.y=s,_.width=t.width,_.height=t.height,_.name=t.name;let y=_.height/2,b=y/(2.5+_.height/50),x=g.append(`g`),S=g.append(`g`),C=`M ${_.x},${_.y+y} +`},`getStyles`),ie=44,ae=6,oe=6,se=e((e,t)=>e.actorTextHeight??S.calculateTextDimensions(e.description??``,{fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}).height,`actorLabelHeight`),ce=e(e=>ie+ae+e+oe,`actorStackHeight`),le=e((e,t,n)=>{let r=e+t,i=r-oe-n/2;return{lifelineStartY:r,glyphBottomY:r-oe-n-ae,labelCenterY:i}},`headerBands`),ue=e((e,t)=>{let n=e+oe,r=n+ie;return{glyphTopY:n,glyphBottomY:r,labelCenterY:r+ae+t/2,stackHeight:ce(t)}},`footerBands`),R=36,de=-5,fe=60,pe=fe-de,me=e((e,t,n,r)=>{if(t.look!==`neo`)return null;let i=se(e,t);return n?ue(r,i):le(r,e.height,i)},`neoBands`),z=`actor-top`,B=`actor-bottom`,he=`actor-box`,V=`actor-man`,H=new Set([`redux-color`,`redux-dark-color`]),U=e((e,t)=>e?.length?e[t%e.length]:void 0,`paletteColor`),ge=e(function(e,t){let n=w(e,t);return u().look===`neo`&&n.attr(`data-look`,`neo`),n},`drawRect`),_e=e(function(e,t,n,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let a=t.links,o=t.actorCnt,s=t.rectData;var c=`none`;i&&(c=`block !important`);let l=e.append(`g`);l.attr(`id`,`actor`+o+`_popup`),l.attr(`class`,`actorPopupMenu`),l.attr(`display`,c);var u=``;s.class!==void 0&&(u=` `+s.class);let d=s.width>n?s.width:n,f=l.append(`rect`);if(f.attr(`class`,`actorPopupMenuPanel`+u),f.attr(`x`,s.x),f.attr(`y`,s.height),f.attr(`fill`,s.fill),f.attr(`stroke`,s.stroke),f.attr(`width`,d),f.attr(`height`,s.height),f.attr(`rx`,s.rx),f.attr(`ry`,s.ry),a!=null){var p=20;for(let e in a){var m=l.append(`a`),h=(0,N.sanitizeUrl)(a[e]);m.attr(`xlink:href`,h),m.attr(`target`,`_blank`),We(r)(e,m,s.x+10,s.height+p,d,20,{class:`actor`},r),p+=30}}return f.attr(`height`,p),{height:s.height+p,width:d}},`drawPopup`),ve=e(function(e){return`var pu = document.getElementById('`+e+`'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }`},`popupMenuToggle`),ye=e(async function(e,t,n=null){let r=e.append(`foreignObject`),a=await i(t.text,u()),o=r.append(`xhtml:div`).attr(`style`,`width: fit-content;`).attr(`xmlns`,`http://www.w3.org/1999/xhtml`).html(a).node().getBoundingClientRect();if(r.attr(`height`,Math.round(o.height)).attr(`width`,Math.round(o.width)),t.class===`noteText`){let n=e.node().firstChild;n.setAttribute(`height`,o.height+2*t.textMargin);let i=n.getBBox();r.attr(`x`,Math.round(i.x+i.width/2-o.width/2)).attr(`y`,Math.round(i.y+i.height/2-o.height/2))}else if(n){let{startx:e,stopx:i,starty:a}=n;if(e>i){let t=e;e=i,i=t}r.attr(`x`,Math.round(e+Math.abs(e-i)/2-o.width/2)),t.class===`loopText`?r.attr(`y`,Math.round(a)):r.attr(`y`,Math.round(a-o.height))}return[r]},`drawKatex`),W=e(function(t,n){let r=0,i=0,a=n.text.split(h.lineBreakRegex),[o,s]=C(n.fontSize),c=[],l=0,u=e(()=>n.y,`yfunc`);if(n.valign!==void 0&&n.textMargin!==void 0&&n.textMargin>0)switch(n.valign){case`top`:case`start`:u=e(()=>Math.round(n.y+n.textMargin),`yfunc`);break;case`middle`:case`center`:u=e(()=>Math.round(n.y+(r+i+n.textMargin)/2),`yfunc`);break;case`bottom`:case`end`:u=e(()=>Math.round(n.y+(r+i+2*n.textMargin)-n.textMargin),`yfunc`)}if(n.anchor!==void 0&&n.textMargin!==void 0&&n.width!==void 0)switch(n.anchor){case`left`:case`start`:n.x=Math.round(n.x+n.textMargin),n.anchor=`start`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`;break;case`middle`:case`center`:n.x=Math.round(n.x+n.width/2),n.anchor=`middle`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`;break;case`right`:case`end`:n.x=Math.round(n.x+n.width-n.textMargin),n.anchor=`end`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`}for(let[e,d]of a.entries()){n.textMargin!==void 0&&n.textMargin===0&&o!==void 0&&(l=e*o);let a=t.append(`text`);a.attr(`x`,n.x),a.attr(`y`,u()),n.anchor!==void 0&&a.attr(`text-anchor`,n.anchor).attr(`dominant-baseline`,n.dominantBaseline).attr(`alignment-baseline`,n.alignmentBaseline),n.fontFamily!==void 0&&a.style(`font-family`,n.fontFamily),s!==void 0&&a.style(`font-size`,s),n.fontWeight!==void 0&&a.style(`font-weight`,n.fontWeight),n.fill!==void 0&&a.attr(`fill`,n.fill),n.class!==void 0&&a.attr(`class`,n.class),n.dy===void 0?l!==0&&a.attr(`dy`,l):a.attr(`dy`,n.dy);let f=d||`​`;if(n.tspan){let e=a.append(`tspan`);e.attr(`x`,n.x),n.fill!==void 0&&e.attr(`fill`,n.fill),e.text(f)}else a.text(f);n.valign!==void 0&&n.textMargin!==void 0&&n.textMargin>0&&(i+=(a._groups||a)[0][0].getBBox().height,r=i),c.push(a)}return c},`drawText`),be=e(function(t,n){function r(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}e(r,`genPoints`);let i=t.append(`polygon`);return i.attr(`points`,r(n.x,n.y,n.width,n.height,7)),i.attr(`class`,`labelBox`),n.y+=n.height/2,W(t,n),i},`drawLabel`),G=-1,xe=e((e,t,n,r)=>{e.select&&n.forEach(n=>{let i=t.get(n),a=e.select(`#actor`+i.actorCnt);!r.mirrorActors&&i.stopy?a.attr(`y2`,i.stopy+i.height/2):r.mirrorActors&&a.attr(`y2`,i.stopy)})},`fixLifeLineHeights`),Se=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=s+t.height,{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m}=f,h=e.append(`g`).lower();var g=h;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,l).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=G,t.links!=null&&g.attr(`id`,`root-`+G),u===`neo`&&g.attr(`data-look`,`neo`));let _=k();var v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,v+=i?` ${B}`:` ${z}`,_.x=t.x,_.y=s,_.width=t.width,_.height=t.height,_.class=v,_.rx=3,_.ry=3,_.name=t.name,u===`neo`&&(_.rx=6,_.ry=6);let y=ge(g,_),b=o.get(t.name)??0;if(H.has(d)&&(y.style(`stroke`,U(m,b)),y.style(`fill`,U(p,b))),u===`neo`&&y.attr(`filter`,`url(#${J(a)})`),t.rectData=_,t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?O(g,_.x+_.width-20,_.y+10,e.substr(1)):E(g,_.x+_.width-20,_.y+10,e)}i||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`participant`),g.attr(`data-id`,t.name)),Y(n,r(t.description))(t.description,g,_.x,_.y,_.width,_.height,{class:`actor ${he}`},n);let x=t.height;if(y.node){let e=y.node().getBBox();n.look!==`neo`&&(t.height=e.height,x=e.height)}return x},`drawActorTypeParticipant`),Ce=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=s+t.height,{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m}=f,h=e.append(`g`).lower();var g=h;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,l).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=G,t.links!=null&&g.attr(`id`,`root-`+G),u===`neo`&&g.attr(`data-look`,`neo`));let _=k();var v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,v+=i?` ${B}`:` ${z}`,_.x=t.x,_.y=s,_.width=t.width,_.height=t.height,_.class=v,_.name=t.name,n.look===`neo`&&(_.height=t.height-6);let y={..._,x:_.x+-6,y:_.y+6,class:`actor`},b=ge(g,_),x=ge(g,y);t.rectData=_,u===`neo`&&g.attr(`filter`,`url(#${J(a)})`);let S=o.get(t.name)??0;if(H.has(d)&&(b.style(`stroke`,U(m,S)),b.style(`fill`,U(p,S)),x.style(`stroke`,U(m,S)),x.style(`fill`,U(p,S))),t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?O(g,_.x+_.width-20,_.y+10,e.substr(1)):E(g,_.x+_.width-20,_.y+10,e)}Y(n,r(t.description))(t.description,g,_.x-6,_.y+6,_.width,_.height,{class:`actor ${he}`},n);let C=t.height;if(b.node){let e=b.node().getBBox();n.look!==`neo`&&(t.height=e.height,C=e.height)}return i||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`collections`),g.attr(`data-id`,t.name)),C},`drawActorTypeCollections`),we=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=s+t.height,{look:u,theme:d,themeVariables:f}=n,{bkgColorArray:p,borderColorArray:m}=f,h=e.append(`g`).lower(),g=h;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&g.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,l).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),g=h.append(`g`),t.actorCnt=G,t.links!=null&&g.attr(`id`,`root-`+G),u===`neo`&&g.attr(`data-look`,`neo`));let _=k(),v=`actor`;t.properties?.class?v=t.properties.class:_.fill=`#eaeaea`,v+=i?` ${B}`:` ${z}`,g.attr(`class`,v),_.x=t.x,_.y=s,_.width=t.width,_.height=t.height,_.name=t.name;let y=_.height/2,b=y/(2.5+_.height/50),x=g.append(`g`),S=g.append(`g`),C=`M ${_.x},${_.y+y} a ${b},${y} 0 0 0 0,${_.height} h ${_.width-2*b} a ${b},${y} 0 0 0 0,-${_.height} Z `;x.append(`path`).attr(`d`,C),S.append(`path`).attr(`d`,`M ${_.x},${_.y+y} - a ${b},${y} 0 0 0 0,${_.height}`),x.attr(`transform`,`translate(${b}, ${-(_.height/2)})`),S.attr(`transform`,`translate(${_.width-b}, ${-_.height/2})`),t.rectData=_,u===`neo`&&x.attr(`filter`,`url(#${J(a)})`);let w=o.get(t.name)??0;if(H.has(d)&&(x.style(`stroke`,U(m,w)),x.style(`fill`,U(p,w)),S.style(`stroke`,U(m,w)),S.style(`fill`,U(p,w))),t.properties?.icon){let e=t.properties.icon.trim(),n=_.x+_.width-20,r=_.y+10;e.charAt(0)===`@`?A(g,n,r,e.substr(1)):O(g,n,r,e)}Y(n,r(t.description))(t.description,g,_.x,_.y,_.width,_.height,{class:`actor ${he}`},n);let T=t.height,E=x.select(`path:last-child`);if(E.node()){let e=E.node().getBBox();n.look!==`neo`&&(t.height=e.height,T=e.height)}return i||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`queue`),g.attr(`data-id`,t.name)),T},`drawActorTypeQueue`),K=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+75,{look:d,theme:f,themeVariables:p}=n,{bkgColorArray:m,borderColorArray:h,actorBorder:g,actorBkg:_}=p,v=e.append(`g`).lower();i||(G++,v.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=G);let y=e.append(`g`),b=V;b+=i?` ${B}`:` ${z}`,y.attr(`class`,b),y.attr(`name`,t.name);let x=j();x.x=t.x,x.y=s,x.fill=`#eaeaea`,x.width=t.width,x.height=t.height,x.class=`actor`;let S=t.x+t.width/2,C=l?l.glyphBottomY-22:s+32;y.append(`defs`).append(`marker`).attr(`id`,a+`-filled-head-control`).attr(`refX`,11).attr(`refY`,5.8).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`172.5`).attr(`stroke-width`,1.2).append(`path`).attr(`d`,`M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z`),y.append(`circle`).attr(`cx`,S).attr(`cy`,C).attr(`r`,22).attr(`filter`,`${d===`neo`?`url(#${J(a)})`:``}`),y.append(`line`).attr(`marker-end`,`url(#`+a+`-filled-head-control)`).attr(`transform`,`translate(${S}, ${C-22})`);let w=o.get(t.name)??0;return H.has(f)?(y.style(`stroke`,U(h,w)),y.style(`fill`,U(m,w))):(y.style(`stroke`,g),y.style(`fill`,_)),l||(t.height=y.node().getBBox().height+2*(n?.sequence?.labelBoxHeight??0)),Y(n,r(t.description))(t.description,y,x.x,l?l.labelCenterY-x.height/2:x.y+22+(i?5:12),x.width,x.height,{class:`actor ${V}`},n),i||(y.attr(`data-et`,`participant`),y.attr(`data-type`,`control`),y.attr(`data-id`,t.name)),t.height},`drawActorTypeControl`),q=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+75,{look:d,theme:f,themeVariables:p}=n,{bkgColorArray:m,borderColorArray:h}=p,g=e.append(`g`).lower(),_=e.append(`g`),v=`actor`;v+=i?` ${B}`:` ${z}`,_.attr(`class`,v),_.attr(`name`,t.name);let y=j();y.x=t.x,y.y=s,y.fill=`#eaeaea`,y.width=t.width,y.height=t.height,y.class=`actor`;let b=t.x+t.width/2,x=l?l.glyphBottomY-22:s+(i?10:25);_.append(`circle`).attr(`cx`,b).attr(`cy`,x).attr(`r`,22).attr(`width`,t.width).attr(`height`,t.height),_.append(`line`).attr(`x1`,b-22).attr(`x2`,b+22).attr(`y1`,x+22).attr(`y2`,x+22).attr(`stroke-width`,2),d===`neo`&&_.attr(`filter`,`url(#${J(a)})`);let S=o.get(t.name)??0;return H.has(f)&&(_.style(`stroke`,U(h,S)),_.style(`fill`,U(m,S))),l||(t.height=_.node().getBBox().height+(n?.sequence?.labelBoxHeight??0)),i||(G++,g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=G),Y(n,r(t.description))(t.description,_,y.x,l?l.labelCenterY-y.height/2:y.y+(i?15:30),y.width,y.height,{class:`actor ${V}`},n),l||_.attr(`transform`,`translate(0, ${i?22:22/2-5})`),i||(_.attr(`data-et`,`participant`),_.attr(`data-type`,`entity`),_.attr(`data-id`,t.name)),t.height},`drawActorTypeEntity`),Te=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+t.height+2*n.boxTextMargin,{theme:d,themeVariables:f,look:p}=n,{bkgColorArray:m,borderColorArray:h,actorBorder:g}=f,_=e.append(`g`).lower(),v=_;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&v.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),v.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),v=_.append(`g`),t.actorCnt=G,t.links!=null&&v.attr(`id`,`root-`+G),p===`neo`&&v.attr(`data-look`,`neo`));let y=j(),b=`actor`;t.properties?.class?b=t.properties.class:y.fill=`#eaeaea`,b+=i?` ${B}`:` ${z}`,y.x=t.x,y.y=s,y.width=t.width,y.height=t.height,y.class=b,y.name=t.name,y.x=t.x,y.y=s;let x=y.width/3,S=x/2,C=S/(2.5+x/50),w=l?ie:y.width/3,T=l?l.glyphBottomY-w-C:y.y,E=v.append(`g`);E.attr(`class`,b);let D=` + a ${b},${y} 0 0 0 0,${_.height}`),x.attr(`transform`,`translate(${b}, ${-(_.height/2)})`),S.attr(`transform`,`translate(${_.width-b}, ${-_.height/2})`),t.rectData=_,u===`neo`&&x.attr(`filter`,`url(#${J(a)})`);let w=o.get(t.name)??0;if(H.has(d)&&(x.style(`stroke`,U(m,w)),x.style(`fill`,U(p,w)),S.style(`stroke`,U(m,w)),S.style(`fill`,U(p,w))),t.properties?.icon){let e=t.properties.icon.trim(),n=_.x+_.width-20,r=_.y+10;e.charAt(0)===`@`?O(g,n,r,e.substr(1)):E(g,n,r,e)}Y(n,r(t.description))(t.description,g,_.x,_.y,_.width,_.height,{class:`actor ${he}`},n);let T=t.height,D=x.select(`path:last-child`);if(D.node()){let e=D.node().getBBox();n.look!==`neo`&&(t.height=e.height,T=e.height)}return i||(g.attr(`data-et`,`participant`),g.attr(`data-type`,`queue`),g.attr(`data-id`,t.name)),T},`drawActorTypeQueue`),K=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+75,{look:d,theme:f,themeVariables:p}=n,{bkgColorArray:m,borderColorArray:h,actorBorder:g,actorBkg:_}=p,v=e.append(`g`).lower();i||(G++,v.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=G);let y=e.append(`g`),b=V;b+=i?` ${B}`:` ${z}`,y.attr(`class`,b),y.attr(`name`,t.name);let x=k();x.x=t.x,x.y=s,x.fill=`#eaeaea`,x.width=t.width,x.height=t.height,x.class=`actor`;let S=t.x+t.width/2,C=l?l.glyphBottomY-22:s+32;y.append(`defs`).append(`marker`).attr(`id`,a+`-filled-head-control`).attr(`refX`,11).attr(`refY`,5.8).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`172.5`).attr(`stroke-width`,1.2).append(`path`).attr(`d`,`M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z`),y.append(`circle`).attr(`cx`,S).attr(`cy`,C).attr(`r`,22).attr(`filter`,`${d===`neo`?`url(#${J(a)})`:``}`),y.append(`line`).attr(`marker-end`,`url(#`+a+`-filled-head-control)`).attr(`transform`,`translate(${S}, ${C-22})`);let w=o.get(t.name)??0;return H.has(f)?(y.style(`stroke`,U(h,w)),y.style(`fill`,U(m,w))):(y.style(`stroke`,g),y.style(`fill`,_)),l||(t.height=y.node().getBBox().height+2*(n?.sequence?.labelBoxHeight??0)),Y(n,r(t.description))(t.description,y,x.x,l?l.labelCenterY-x.height/2:x.y+22+(i?5:12),x.width,x.height,{class:`actor ${V}`},n),i||(y.attr(`data-et`,`participant`),y.attr(`data-type`,`control`),y.attr(`data-id`,t.name)),t.height},`drawActorTypeControl`),q=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+75,{look:d,theme:f,themeVariables:p}=n,{bkgColorArray:m,borderColorArray:h}=p,g=e.append(`g`).lower(),_=e.append(`g`),v=`actor`;v+=i?` ${B}`:` ${z}`,_.attr(`class`,v),_.attr(`name`,t.name);let y=k();y.x=t.x,y.y=s,y.fill=`#eaeaea`,y.width=t.width,y.height=t.height,y.class=`actor`;let b=t.x+t.width/2,x=l?l.glyphBottomY-22:s+(i?10:25);_.append(`circle`).attr(`cx`,b).attr(`cy`,x).attr(`r`,22).attr(`width`,t.width).attr(`height`,t.height),_.append(`line`).attr(`x1`,b-22).attr(`x2`,b+22).attr(`y1`,x+22).attr(`y2`,x+22).attr(`stroke-width`,2),d===`neo`&&_.attr(`filter`,`url(#${J(a)})`);let S=o.get(t.name)??0;return H.has(f)&&(_.style(`stroke`,U(h,S)),_.style(`fill`,U(m,S))),l||(t.height=_.node().getBBox().height+(n?.sequence?.labelBoxHeight??0)),i||(G++,g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=G),Y(n,r(t.description))(t.description,_,y.x,l?l.labelCenterY-y.height/2:y.y+(i?15:30),y.width,y.height,{class:`actor ${V}`},n),l||_.attr(`transform`,`translate(0, ${i?22:22/2-5})`),i||(_.attr(`data-et`,`participant`),_.attr(`data-type`,`entity`),_.attr(`data-id`,t.name)),t.height},`drawActorTypeEntity`),Te=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+t.height+2*n.boxTextMargin,{theme:d,themeVariables:f,look:p}=n,{bkgColorArray:m,borderColorArray:h,actorBorder:g}=f,_=e.append(`g`).lower(),v=_;i||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&v.attr(`onclick`,ve(`actor${G}_popup`)).attr(`cursor`,`pointer`),v.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),v=_.append(`g`),t.actorCnt=G,t.links!=null&&v.attr(`id`,`root-`+G),p===`neo`&&v.attr(`data-look`,`neo`));let y=k(),b=`actor`;t.properties?.class?b=t.properties.class:y.fill=`#eaeaea`,b+=i?` ${B}`:` ${z}`,y.x=t.x,y.y=s,y.width=t.width,y.height=t.height,y.class=b,y.name=t.name,y.x=t.x,y.y=s;let x=y.width/3,S=x/2,C=S/(2.5+x/50),w=l?ie:y.width/3,T=l?l.glyphBottomY-w-C:y.y,E=v.append(`g`);E.attr(`class`,b);let D=` M ${y.x},${T+C} a ${S},${C} 0 0 0 ${x},0 a ${S},${C} 0 0 0 -${x},0 l 0,${w-2*C} a ${S},${C} 0 0 0 ${x},0 l 0,-${w-2*C} -`;E.append(`path`).attr(`d`,D),p===`neo`&&E.attr(`filter`,`url(#${J(a)})`);let O=o.get(t.name)??0;if(H.has(d)?(E.style(`stroke`,U(h,O)),E.style(`fill`,U(m,O))):E.style(`stroke`,g),E.attr(`transform`,`translate(${x}, ${C})`),t.rectData=y,Y(n,r(t.description))(t.description,v,y.x,l?l.labelCenterY-y.height/2:y.y+35,y.width,y.height,{class:`actor ${he}`},n),!l){let e=E.select(`path:last-child`);e.node()&&(t.height=e.node().getBBox().height+(n.sequence.labelBoxHeight??0))}return i||(v.attr(`data-et`,`participant`),v.attr(`data-type`,`database`),v.attr(`data-id`,t.name)),t.height},`drawActorTypeDatabase`),Ee=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+80,d=l?l.glyphBottomY-22:s+12,f=e.append(`g`).lower(),{look:p,theme:m,themeVariables:h}=n,{bkgColorArray:g,borderColorArray:_,actorBorder:v}=h;i||(G++,f.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=G);let y=e.append(`g`),b=V;b+=i?` ${B}`:` ${z}`,y.attr(`class`,b),y.attr(`name`,t.name);let x=j();x.x=t.x,x.y=s,x.fill=`#eaeaea`,x.width=t.width,x.height=t.height,x.class=`actor`,y.append(`line`).attr(`id`,`actor-man-torso`+G).attr(`x1`,t.x+t.width/2-55).attr(`y1`,d).attr(`x2`,t.x+t.width/2-15).attr(`y2`,d),y.append(`line`).attr(`id`,`actor-man-arms`+G).attr(`x1`,t.x+t.width/2-55).attr(`y1`,d-10).attr(`x2`,t.x+t.width/2-55).attr(`y2`,d+10),y.append(`circle`).attr(`cx`,t.x+t.width/2).attr(`cy`,d).attr(`r`,22),p===`neo`&&y.attr(`filter`,`url(#${J(a)})`);let S=o.get(t.name)??0;return H.has(m)?(y.style(`stroke`,U(_,S)),y.style(`fill`,U(g,S))):y.style(`stroke`,v),l||(t.height=y.node().getBBox().height+(n.sequence.labelBoxHeight??0)),Y(n,r(t.description))(t.description,y,x.x,l?l.labelCenterY-x.height/2:x.y+15,x.width,x.height,{class:`actor ${V}`},n),l||y.attr(`transform`,`translate(0,21)`),i||(y.attr(`data-et`,`participant`),y.attr(`data-type`,`boundary`),y.attr(`data-id`,t.name)),t.height},`drawActorTypeBoundary`),De=e(function(t,n,i,a,o){let s=a?n.stopy:n.starty,c=n.x+n.width/2,l=me(n,i,a,s),u=l?l.lifelineStartY:s+80,{theme:d,themeVariables:f}=i,{bkgColorArray:p,borderColorArray:m,actorBorder:h}=f,g=t.append(`g`).lower();a||(G++,g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,n.name).attr(`data-et`,`life-line`).attr(`data-id`,n.name),n.actorCnt=G);let _=t.append(`g`),v=V;v+=a?` ${B}`:` ${z}`,_.attr(`class`,v),_.attr(`name`,n.name),a||_.attr(`data-et`,`participant`).attr(`data-type`,`actor`).attr(`data-id`,n.name);let y=l?ie/pe:1,b=e(e=>l?l.glyphBottomY-(fe-e)*y:s+e,`gy`),x=e(e=>c+e*y,`gx`);_.append(`line`).attr(`id`,`actor-man-torso`+G).attr(`x1`,c).attr(`y1`,b(25)).attr(`x2`,c).attr(`y2`,b(45)),_.append(`line`).attr(`id`,`actor-man-arms`+G).attr(`x1`,x(-R/2)).attr(`y1`,b(33)).attr(`x2`,x(R/2)).attr(`y2`,b(33)),_.append(`line`).attr(`x1`,x(-R/2)).attr(`y1`,b(60)).attr(`x2`,c).attr(`y2`,b(45)),_.append(`line`).attr(`x1`,c).attr(`y1`,b(45)).attr(`x2`,x(R/2-2)).attr(`y2`,b(60));let S=_.append(`circle`);S.attr(`cx`,n.x+n.width/2),S.attr(`cy`,b(10)),S.attr(`r`,15*y),S.attr(`width`,n.width),S.attr(`height`,n.height),l||(n.height=pe);let C=j();C.x=n.x,C.y=s,C.fill=`#eaeaea`,C.width=n.width,C.height=n.height,C.class=`actor`,C.rx=3,C.ry=3;let w=o.get(n.name)??0;return H.has(d)?(_.style(`stroke`,U(m,w)),_.style(`fill`,U(p,w))):_.style(`stroke`,h),Y(i,r(n.description))(n.description,_,C.x,l?l.labelCenterY-C.height/2:s+35,C.width,C.height,{class:`actor ${V}`},i),n.height},`drawActorTypeActor`),Oe=e(async function(e,t,n,r,i,a,o){let s=o??new Map([...a.db.getActors().values()].map((e,t)=>[e.name,t]));switch(t.type){case`actor`:return await De(e,t,n,r,s);case`participant`:return await Se(e,t,n,r,i,s);case`boundary`:return await Ee(e,t,n,r,i,s);case`control`:return await K(e,t,n,r,i,s);case`entity`:return await q(e,t,n,r,i,s);case`database`:return await Te(e,t,n,r,i,s);case`collections`:return await Ce(e,t,n,r,i,s);case`queue`:return await we(e,t,n,r,i,s)}},`drawActor`),ke=e(function(e,t,n){let r=e.append(`g`);Ne(r,t),t.name&&Y(n)(t.name,r,t.x,t.y+n.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:`text`},n),r.lower()},`drawBox`),Ae=e(function(e){return e.append(`g`)},`anchorElement`),je=e(function(e,t,n,r,i,a,o){let{theme:s,themeVariables:c}=r,{bkgColorArray:l,borderColorArray:u,mainBkg:d}=c,f=j(),p=t.anchored,m=t.actor;f.x=t.startx,f.y=t.starty,f.class=`activation`+i%3,f.width=t.stopx-t.startx,f.height=n-t.starty;let h=ge(p,f),g=(o??new Map([...a.db.getActors().values()].map((e,t)=>[e.name,t]))).get(m)??0;H.has(s)&&(h.style(`stroke`,U(u,g)),h.style(`fill`,U(l,g)??d))},`drawActivation`),Me=e(async function(t,n,i,a,o){let{boxMargin:s,boxTextMargin:c,labelBoxHeight:l,labelBoxWidth:u,messageFontFamily:d,messageFontSize:f,messageFontWeight:p}=a,m=t.append(`g`).attr(`data-et`,`control-structure`).attr(`data-id`,`i`+o.id),h=e(function(e,t,n,r){return m.append(`line`).attr(`x1`,e).attr(`y1`,t).attr(`x2`,n).attr(`y2`,r).attr(`class`,`loopLine`)},`drawLoopLine`);h(n.startx,n.starty,n.stopx,n.starty),h(n.stopx,n.starty,n.stopx,n.stopy),h(n.startx,n.stopy,n.stopx,n.stopy),h(n.startx,n.starty,n.startx,n.stopy),n.sections!==void 0&&n.sections.forEach(function(e){h(n.startx,e.y,n.stopx,e.y).style(`stroke-dasharray`,`3, 3`)});let g=D();g.text=i,g.x=n.startx,g.y=n.starty,g.fontFamily=d,g.fontSize=f,g.fontWeight=p,g.anchor=`middle`,g.valign=`middle`,g.tspan=!1,g.width=Math.max(u??0,50),g.height=l+(a.look===`neo`?15:0)||20,g.textMargin=c,g.class=`labelText`,be(m,g),g=He(),g.text=n.title,g.x=n.startx+u/2+(n.stopx-n.startx)/2,g.y=n.starty+s+c,g.anchor=`middle`,g.valign=`middle`,g.textMargin=c,g.class=`loopText`,g.fontFamily=d,g.fontSize=f,g.fontWeight=p,g.wrap=!0;let _=r(g.text)?await ye(m,g,n):W(m,g);if(n.sectionTitles!==void 0){for(let[e,t]of Object.entries(n.sectionTitles))if(t.message){g.text=t.message,g.x=n.startx+(n.stopx-n.startx)/2,g.y=n.sections[e].y+s+c,g.class=`sectionTitle`,g.anchor=`middle`,g.valign=`middle`,g.tspan=!1,g.fontFamily=d,g.fontSize=f,g.fontWeight=p,g.wrap=n.wrap,r(g.text)?(n.starty=n.sections[e].y,await ye(m,g,n)):W(m,g);let i=Math.round(_.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));n.sections[e].height+=i-(s+c)}}return n.height=Math.round(n.stopy-n.starty),m},`drawLoop`),Ne=e(function(e,t){k(e,t)},`drawBackgroundRect`),Pe=e(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-database`).attr(`fill-rule`,`evenodd`).attr(`clip-rule`,`evenodd`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z`)},`insertDatabaseIcon`),Fe=e(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-computer`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z`)},`insertComputerIcon`),Ie=e(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-clock`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z`)},`insertClockIcon`),Le=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,7.9).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M -1 0 L 10 5 L 0 10 z`)},`insertArrowHead`),Re=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-filled-head`).attr(`refX`,15.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`insertArrowFilledHead`),ze=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-sequencenumber`).attr(`refX`,15).attr(`refY`,15).attr(`markerWidth`,60).attr(`markerHeight`,40).attr(`orient`,`auto`).append(`circle`).attr(`cx`,15).attr(`cy`,15).attr(`r`,6)},`insertSequenceNumber`),Be=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-crosshead`).attr(`markerWidth`,15).attr(`markerHeight`,8).attr(`orient`,`auto`).attr(`refX`,4).attr(`refY`,4.5).append(`path`).attr(`fill`,`none`).attr(`stroke`,`#000000`).style(`stroke-dasharray`,`0, 0`).attr(`stroke-width`,`1pt`).attr(`d`,`M 1,2 L 6,7 M 6,2 L 1,7`)},`insertArrowCrossHead`),J=e(e=>e?`${e}-drop-shadow`:`drop-shadow`,`dropShadowId`),Ve=e(function(e,t,n){let{theme:r}=t;e.append(`defs`).append(`filter`).attr(`id`,J(n)).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${r===`redux`||r===`redux-color`?`#000000`:`#FFFFFF`}`)},`insertDropShadow`),He=e(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:`#666`,width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},`getTextObj`),Ue=e(function(){return{x:0,y:0,fill:`#EDF2AE`,stroke:`#666`,width:100,anchor:`start`,height:100,rx:0,ry:0}},`getNoteRect`),Y=(function(){function t(e,t,n,r,i,a,s){o(t.append(`text`).attr(`x`,n+i/2).attr(`y`,r+a/2+5).style(`text-anchor`,`middle`).text(e),s)}e(t,`byText`);function n(e,t,n,r,i,a,s,c){let{actorFontSize:l,actorFontFamily:u,actorFontWeight:d}=c,[f,p]=C(l),m=e.split(h.lineBreakRegex);for(let e=0;ee.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},`getHeight`),clear:e(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},`clear`),addBox:e(function(e){this.boxes.push(e)},`addBox`),addActor:e(function(e){this.actors.push(e)},`addActor`),addLoop:e(function(e){this.loops.push(e)},`addLoop`),addMessage:e(function(e){this.messages.push(e)},`addMessage`),addNote:e(function(e){this.notes.push(e)},`addNote`),lastActor:e(function(){return this.actors[this.actors.length-1]},`lastActor`),lastLoop:e(function(){return this.loops[this.loops.length-1]},`lastLoop`),lastMessage:e(function(){return this.messages[this.messages.length-1]},`lastMessage`),lastNote:e(function(){return this.notes[this.notes.length-1]},`lastNote`),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:e(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,tt(v())},`init`),updateVal:e(function(e,t,n,r){e[t]=e[t]===void 0?n:r(n,e[t])},`updateVal`),updateBounds:e(function(t,n,r,i){let a=this,o=0;function s(s){return e(function(e){o++;let c=a.sequenceItems.length-o+1;a.updateVal(e,`starty`,n-c*Z.boxMargin,Math.min),a.updateVal(e,`stopy`,i+c*Z.boxMargin,Math.max),a.updateVal(Q.data,`startx`,t-c*Z.boxMargin,Math.min),a.updateVal(Q.data,`stopx`,r+c*Z.boxMargin,Math.max),s!==`activation`&&(a.updateVal(e,`startx`,t-c*Z.boxMargin,Math.min),a.updateVal(e,`stopx`,r+c*Z.boxMargin,Math.max),a.updateVal(Q.data,`starty`,n-c*Z.boxMargin,Math.min),a.updateVal(Q.data,`stopy`,i+c*Z.boxMargin,Math.max))},`updateItemBounds`)}e(s,`updateFn`),this.sequenceItems.forEach(s()),this.activations.forEach(s(`activation`))},`updateBounds`),insert:e(function(e,t,n,r){let i=h.getMin(e,n),a=h.getMax(e,n),o=h.getMin(t,r),s=h.getMax(t,r);this.updateVal(Q.data,`startx`,i,Math.min),this.updateVal(Q.data,`starty`,o,Math.min),this.updateVal(Q.data,`stopx`,a,Math.max),this.updateVal(Q.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),newActivation:e(function(e,t,n){let r=n.get(e.from),i=nt(e.from).length||0,a=r.x+r.width/2+(i-1)*Z.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Z.activationWidth,stopy:void 0,actor:e.from,anchored:X.anchorElement(t)})},`newActivation`),endActivation:e(function(e){let t=this.activations.map(function(e){return e.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},`endActivation`),createLoop:e(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},`createLoop`),newLoop:e(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},`newLoop`),endLoop:e(function(){return this.sequenceItems.pop()},`endLoop`),isLoopOverlap:e(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},`isLoopOverlap`),addSectionToLoop:e(function(e){let t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:Q.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},`addSectionToLoop`),saveVerticalPos:e(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},`saveVerticalPos`),resetVerticalPos:e(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},`resetVerticalPos`),bumpVerticalPos:e(function(e){this.verticalPos+=e,this.data.stopy=h.getMax(this.data.stopy,this.verticalPos)},`bumpVerticalPos`),getVerticalPos:e(function(){return this.verticalPos},`getVerticalPos`),getBounds:e(function(){return{bounds:this.data,models:this.models}},`getBounds`)},Ge=e(async function(e,t,n){Q.bumpVerticalPos(Z.boxMargin),t.height=Z.boxMargin,t.starty=Q.getVerticalPos();let i=j();i.x=t.startx,i.y=t.starty,i.width=t.width||Z.width,i.class=`note`;let a=e.append(`g`);a.attr(`data-et`,`note`),a.attr(`data-id`,`i`+n);let o=X.drawRect(a,i),s=D();s.x=t.startx,s.y=t.starty,s.width=i.width,s.dy=`1em`,s.text=t.message,s.class=`noteText`,s.fontFamily=Z.noteFontFamily,s.fontSize=Z.noteFontSize,s.fontWeight=Z.noteFontWeight,s.anchor=Z.noteAlign,s.textMargin=Z.noteMargin,s.valign=`center`;let c=r(s.text)?await ye(a,s):W(a,s),l=Math.round(c.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));o.attr(`height`,l+2*Z.noteMargin),t.height+=l+2*Z.noteMargin,Q.bumpVerticalPos(l+2*Z.noteMargin),t.stopy=t.starty+l+2*Z.noteMargin,t.stopx=t.startx+i.width,Q.insert(t.startx,t.starty,t.stopx,t.stopy),Q.models.addNote(t)},`drawNote`),Ke=e(function(t,n,r,i,a,o,s){let c=i.db.getActors(),l=c.get(n.from),u=c.get(n.to),d=r.sequenceVisible,f=l.x+l.width/2,p=u.x+u.width/2,m=f<=p,h=mt(n,i),g=t.append(`g`),_=e((e,t)=>{let n=e?16.5:-16.5;return t?-n:n},`getCircleOffset`),v=e(e=>{g.append(`circle`).attr(`cx`,e).attr(`cy`,s).attr(`r`,5).attr(`width`,10).attr(`height`,10)},`drawCircle`),{CENTRAL_CONNECTION:y,CENTRAL_CONNECTION_REVERSE:b,CENTRAL_CONNECTION_DUAL:x}=i.db.LINETYPE;if(d)switch(n.centralConnection){case y:h&&(p+=_(m,!0));break;case b:h||(f+=_(m,!1));break;case x:h?p+=_(m,!0):f+=_(m,!1)}switch(n.centralConnection){case y:v(p);break;case b:v(f);break;case x:v(f),v(p)}},`drawCentralConnection`),qe=e(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),`messageFont`),Je=e(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),`noteFont`),Ye=e(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),`actorFont`);async function Xe(e,t){Q.bumpVerticalPos(10);let{startx:n,stopx:i,message:a}=t,o=h.splitBreaks(a).length,s=r(a),c=s?await f(a,v()):S.calculateTextDimensions(a,qe(Z));if(!s){let e=c.height/o;t.height+=e,Q.bumpVerticalPos(e)}let l,u=c.height-10,d=c.width;if(n===i){l=Q.getVerticalPos()+u,Z.rightAngles||(u+=Z.boxMargin,l=Q.getVerticalPos()+u),u+=30;let e=h.getMax(d/2,Z.width/2);Q.insert(n-e,Q.getVerticalPos()-10+u,i+e,Q.getVerticalPos()+30+u)}else u+=Z.boxMargin,l=Q.getVerticalPos()+u,Q.insert(n,l-10,i,l);return Q.bumpVerticalPos(u),t.height+=u,t.stopy=t.starty+t.height,Q.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),l}e(Xe,`boundMessage`);var Ze=e(async function(e,t,n,i,a,o){let{startx:c,stopx:l,starty:u,message:d,type:f,sequenceIndex:p,sequenceVisible:m}=t,g=S.calculateTextDimensions(d,qe(Z)),_=D();_.x=Math.min(c,l),_.y=u+10,_.width=Math.abs(l-c),_.class=`messageText`,_.dy=`1em`,_.text=d,_.fontFamily=Z.messageFontFamily,_.fontSize=Z.messageFontSize,_.fontWeight=Z.messageFontWeight,_.anchor=Z.messageAlign,_.valign=`center`,_.textMargin=Z.wrapPadding,_.tspan=!1,r(_.text)?await ye(e,_,{startx:c,stopx:l,starty:n}):W(e,_);let v=g.width,y;if(c===l){let r=m||Z.showSequenceNumbers,o=mt(a,i),s=ht(a,i),u=c+(r&&(o||s)?10:0);y=Z.rightAngles?e.append(`path`).attr(`d`,`M ${u},${n} H ${c+h.getMax(Z.width/2,v/2)} V ${n+25} H ${c}`):e.append(`path`).attr(`d`,`M `+u+`,`+n+` C `+(u+60)+`,`+(n-10)+` `+(c+60)+`,`+(n+30)+` `+c+`,`+(n+20)),ft(a,i)&&Ke(e,a,t,i,c,l,n)}else y=e.append(`line`),y.attr(`x1`,c),y.attr(`y1`,n),y.attr(`x2`,l),y.attr(`y2`,n),ft(a,i)&&Ke(e,a,t,i,c,l,n);f===i.db.LINETYPE.DOTTED||f===i.db.LINETYPE.DOTTED_CROSS||f===i.db.LINETYPE.DOTTED_POINT||f===i.db.LINETYPE.DOTTED_OPEN||f===i.db.LINETYPE.BIDIRECTIONAL_DOTTED||f===i.db.LINETYPE.SOLID_TOP_DOTTED||f===i.db.LINETYPE.SOLID_BOTTOM_DOTTED||f===i.db.LINETYPE.STICK_TOP_DOTTED||f===i.db.LINETYPE.STICK_BOTTOM_DOTTED||f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style(`stroke-dasharray`,`3, 3`),y.attr(`class`,`messageLine1`)):y.attr(`class`,`messageLine0`),y.attr(`data-et`,`message`),y.attr(`data-id`,`i`+t.id),y.attr(`data-from`,t.from),y.attr(`data-to`,t.to);let b=``;if(Z.arrowMarkerAbsolute&&(b=s(!0)),y.attr(`stroke-width`,2),y.attr(`stroke`,`none`),y.style(`fill`,`none`),(f===i.db.LINETYPE.SOLID_TOP||f===i.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-solidTopArrowHead)`),(f===i.db.LINETYPE.SOLID_BOTTOM||f===i.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-solidBottomArrowHead)`),(f===i.db.LINETYPE.STICK_TOP||f===i.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-stickTopArrowHead)`),(f===i.db.LINETYPE.STICK_BOTTOM||f===i.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-stickBottomArrowHead)`),(f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-solidBottomArrowHead)`),(f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-solidTopArrowHead)`),(f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-stickBottomArrowHead)`),(f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-stickTopArrowHead)`),(f===i.db.LINETYPE.SOLID||f===i.db.LINETYPE.DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-arrowhead)`),(f===i.db.LINETYPE.BIDIRECTIONAL_SOLID||f===i.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr(`marker-start`,`url(`+b+`#`+o+`-arrowhead)`),y.attr(`marker-end`,`url(`+b+`#`+o+`-arrowhead)`)),(f===i.db.LINETYPE.SOLID_POINT||f===i.db.LINETYPE.DOTTED_POINT)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-filled-head)`),(f===i.db.LINETYPE.SOLID_CROSS||f===i.db.LINETYPE.DOTTED_CROSS)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-crosshead)`),m||Z.showSequenceNumbers){let r=f===i.db.LINETYPE.BIDIRECTIONAL_SOLID||f===i.db.LINETYPE.BIDIRECTIONAL_DOTTED,s=f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,u=ft(a,i),d=c,m=l;r?(cc?m=l-12:(m=l-6,d+=a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_DUAL||a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),m+=u?15:0,y.attr(`x2`,m),y.attr(`x1`,d)):y.attr(`x1`,c+6);let h=0,g=c===l,_=c<=l;h=g?t.fromBounds+1:s?_?t.toBounds-1:t.fromBounds+1:_?t.fromBounds+1:t.toBounds-1;let v=`12px`,x=p.toString().length;x>5?v=`7px`:x>3&&(v=`9px`),e.append(`line`).attr(`x1`,h).attr(`y1`,n).attr(`x2`,h).attr(`y2`,n).attr(`stroke-width`,0).attr(`marker-start`,`url(`+b+`#`+o+`-sequencenumber)`),e.append(`text`).attr(`x`,h).attr(`y`,n+4).attr(`font-family`,`sans-serif`).attr(`font-size`,v).attr(`text-anchor`,`middle`).attr(`class`,`sequenceNumber`).text(p)}},`drawMessage`),Qe=e(function(e,t,n,r,i,a,o){let s=0,c=0,l,u=0;for(let e of r){let r=t.get(e),a=r.box;l&&l!=a&&(o||Q.models.addBox(l),c+=Z.boxMargin+l.margin),a&&a!=l&&(o||(a.x=s+c,a.y=i),c+=a.margin),r.width=h.getMax(r.width||Z.width,Z.width),r.height=h.getMax(r.height||Z.height,Z.height),r.margin=r.margin||Z.actorMargin,u=h.getMax(u,r.height),n.get(r.name)&&(c+=r.width/2),r.x=s+c,r.starty=Q.getVerticalPos(),Q.insert(r.x,i,r.x+r.width,r.height),s+=r.width+c,r.box&&(r.box.width=s+a.margin-r.box.x),c=r.margin,l=r.box,Q.models.addActor(r)}l&&!o&&Q.models.addBox(l),Q.bumpVerticalPos(u)},`addActorRenderingData`),$e=e(async function(e,t,n,r,i,a,o){if(r){let r=0;Q.bumpVerticalPos(Z.boxMargin*2);for(let s of n){let n=t.get(s);n.stopy||=Q.getVerticalPos();let c=await X.drawActor(e,n,Z,!0,i,a,o);r=h.getMax(r,c)}Q.bumpVerticalPos(r+Z.boxMargin)}else for(let r of n){let n=t.get(r);await X.drawActor(e,n,Z,!1,i,a,o)}},`drawActors`),et=e(function(e,t,n,r){let i=0,a=0;for(let o of n){let n=t.get(o),s=st(n),c=X.drawPopup(e,n,s,Z,Z.forceMenus,r);c.height>i&&(i=c.height),c.width+n.x>a&&(a=c.width+n.x)}return{maxHeight:i,maxWidth:a}},`drawActorsPopup`),tt=e(function(e){m(Z,e),e.fontFamily&&(Z.actorFontFamily=Z.noteFontFamily=Z.messageFontFamily=e.fontFamily),e.fontSize&&(Z.actorFontSize=Z.noteFontSize=Z.messageFontSize=e.fontSize),e.fontWeight&&(Z.actorFontWeight=Z.noteFontWeight=Z.messageFontWeight=e.fontWeight)},`setConf`),nt=e(function(e){return Q.activations.filter(function(t){return t.actor===e})},`actorActivations`),rt=e(function(e,t){let n=t.get(e),r=nt(e);return[r.reduce(function(e,t){return h.getMin(e,t.startx)},n.x+n.width/2-1),r.reduce(function(e,t){return h.getMax(e,t.stopx)},n.x+n.width/2+1)]},`activationBounds`);function $(e,n,r,i,a){Q.bumpVerticalPos(r);let o=i;if(n.id&&n.message&&e[n.id]){let r=e[n.id].width,a=qe(Z);n.message=S.wrapLabel(`[${n.message}]`,r-2*Z.wrapPadding,a),n.width=r,n.wrap=!0;let s=S.calculateTextDimensions(n.message,a),c=h.getMax(s.height,Z.labelBoxHeight);o=i+c,t.debug(`${c} - ${n.message}`)}a(n),Q.bumpVerticalPos(o)}e($,`adjustLoopHeightForWrap`);function it(t,n,r,i,a,o,s){function c(e,r){e.x{e.add(t.from),e.add(t.to)}),x=x.filter(t=>e.has(t))}let D=new Map(x.map((e,t)=>[g.get(e)?.name??e,t]));Qe(h,g,_,x,0,S,!1);let O=await _t(S,g,E,o);X.insertArrowHead(h,i),X.insertArrowCrossHead(h,i),X.insertArrowFilledHead(h,i),X.insertSequenceNumber(h,i),X.insertSolidTopArrowHead(h,i),X.insertSolidBottomArrowHead(h,i),X.insertStickTopArrowHead(h,i),X.insertStickBottomArrowHead(h,i),l===`neo`&&X.insertDropShadow(h,Z,i);function k(e,t){let n=Q.endActivation(e);n.starty+18>t&&(n.starty=t-6,t+=12),X.drawActivation(h,n,t,Z,nt(e.from).length,o,D),Q.insert(n.startx,t-10,n.stopx,t)}e(k,`activeEnd`);let A=1,j=1,M=[],N=[],P=0;for(let e of S){let n,r,i;switch(e.type){case o.db.LINETYPE.NOTE:Q.resetVerticalPos(),r=e.noteModel,await Ge(h,r,e.id);break;case o.db.LINETYPE.ACTIVE_START:Q.newActivation(e,h,g);break;case o.db.LINETYPE.CENTRAL_CONNECTION:Q.newActivation(e,h,g);break;case o.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Q.newActivation(e,h,g);break;case o.db.LINETYPE.ACTIVE_END:k(e,Q.getVerticalPos());break;case o.db.LINETYPE.LOOP_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.LOOP_END:n=Q.endLoop(),await X.drawLoop(h,n,`loop`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.RECT_START:$(O,e,Z.boxMargin,Z.boxMargin,e=>{let t=e.message;t||=u?.rectBkgColor||u?.actorBkg||`rgba(128, 128, 128, 0.5)`,Q.newLoop(void 0,t)});break;case o.db.LINETYPE.RECT_END:n=Q.endLoop(),N.push(n),Q.models.addLoop(n),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos());break;case o.db.LINETYPE.OPT_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.OPT_END:n=Q.endLoop(),await X.drawLoop(h,n,`opt`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.ALT_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.ALT_ELSE:$(O,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case o.db.LINETYPE.ALT_END:n=Q.endLoop(),await X.drawLoop(h,n,`alt`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.PAR_START:case o.db.LINETYPE.PAR_OVER_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e)),Q.saveVerticalPos();break;case o.db.LINETYPE.PAR_AND:$(O,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case o.db.LINETYPE.PAR_END:n=Q.endLoop(),await X.drawLoop(h,n,`par`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.AUTONUMBER:A=e.message.start||A,j=e.message.step||j,e.message.visible?o.db.enableSequenceNumbers():o.db.disableSequenceNumbers();break;case o.db.LINETYPE.CRITICAL_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.CRITICAL_OPTION:$(O,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case o.db.LINETYPE.CRITICAL_END:n=Q.endLoop(),await X.drawLoop(h,n,`critical`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.BREAK_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.BREAK_END:n=Q.endLoop(),await X.drawLoop(h,n,`break`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;default:try{i=e.msgModel,i.starty=Q.getVerticalPos(),i.sequenceIndex=A,i.sequenceVisible=o.db.showSequenceNumbers(),i.id=e.id,i.from=e.from,i.to=e.to;let t=await Xe(h,i);it(e,i,t,P,g,_,y),M.push({messageModel:i,lineStartY:t,msg:e}),Q.models.addMessage(i)}catch(e){t.error(`error while drawing message`,e)}}[o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN,o.db.LINETYPE.SOLID,o.db.LINETYPE.SOLID_TOP,o.db.LINETYPE.SOLID_BOTTOM,o.db.LINETYPE.STICK_TOP,o.db.LINETYPE.STICK_BOTTOM,o.db.LINETYPE.SOLID_TOP_DOTTED,o.db.LINETYPE.SOLID_BOTTOM_DOTTED,o.db.LINETYPE.STICK_TOP_DOTTED,o.db.LINETYPE.STICK_BOTTOM_DOTTED,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.DOTTED,o.db.LINETYPE.SOLID_CROSS,o.db.LINETYPE.DOTTED_CROSS,o.db.LINETYPE.SOLID_POINT,o.db.LINETYPE.DOTTED_POINT,o.db.LINETYPE.BIDIRECTIONAL_SOLID,o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(A=Math.round((A+j)*100)/100),P++}t.debug(`createdActors`,_),t.debug(`destroyedActors`,y),await $e(h,g,x,!1,i,o,D);for(let e of M)await Ze(h,e.messageModel,e.lineStartY,o,e.msg,i);Z.mirrorActors&&await $e(h,g,x,!0,i,o,D),N.forEach(e=>X.drawBackgroundRect(h,e)),xe(h,g,x,Z);for(let e of Q.models.boxes){e.height=Q.getVerticalPos()-e.y,Q.insert(e.x,e.y,e.x+e.width,e.height);let t=Z.boxMargin*2;e.startx=e.x-t,e.starty=e.y-t*.25,e.stopx=e.startx+e.width+2*t,e.stopy=e.starty+e.height+t*.75,e.stroke=`rgb(0,0,0, 0.5)`,X.drawBox(h,e,Z)}w&&Q.bumpVerticalPos(Z.boxMargin);let F=et(h,g,x,m),{bounds:I}=Q.getBounds();I.startx===void 0&&(I.startx=0),I.starty===void 0&&(I.starty=0),I.stopx===void 0&&(I.stopx=0),I.stopy===void 0&&(I.stopy=0);let ee=I.stopy-I.starty;ee{let n=qe(Z),r=t.actorKeys.reduce((t,n)=>t+=e.get(n).width+(e.get(n).margin||0),0),i=Z.boxMargin*8;r+=i,r-=2*Z.boxTextMargin,t.wrap&&(t.name=S.wrapLabel(t.name,r-2*Z.wrapPadding,n));let o=S.calculateTextDimensions(t.name,n);a=h.getMax(o.height,a);let s=h.getMax(r,o.width+2*Z.wrapPadding);if(t.margin=Z.boxTextMargin,re.textMaxHeight=a),h.getMax(i,Z.height)}e(ct,`calculateActorMargins`);var lt=e(async function(e,n,i){let a=n.get(e.from),o=n.get(e.to),s=a.x,c=o.x,l=e.wrap&&e.message,u=r(e.message)?await f(e.message,v()):S.calculateTextDimensions(l?S.wrapLabel(e.message,Z.width,Je(Z)):e.message,Je(Z)),d={width:l?Z.width:h.getMax(Z.width,u.width+2*Z.noteMargin),height:0,startx:a.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===i.db.PLACEMENT.RIGHTOF?(d.width=l?h.getMax(Z.width,u.width):h.getMax(a.width/2+o.width/2,u.width+2*Z.noteMargin),d.startx=s+(a.width+Z.actorMargin)/2):e.placement===i.db.PLACEMENT.LEFTOF?(d.width=l?h.getMax(Z.width,u.width+2*Z.noteMargin):h.getMax(a.width/2+o.width/2,u.width+2*Z.noteMargin),d.startx=s-d.width+(a.width-Z.actorMargin)/2):e.to===e.from?(u=S.calculateTextDimensions(l?S.wrapLabel(e.message,h.getMax(Z.width,a.width),Je(Z)):e.message,Je(Z)),d.width=l?h.getMax(Z.width,a.width):h.getMax(a.width,Z.width,u.width+2*Z.noteMargin),d.startx=s+(a.width-d.width)/2):(d.width=Math.abs(s+a.width/2-(c+o.width/2))+Z.actorMargin,d.startx=s2,p=e(e=>l?-e:e,`adjustValue`);t.from===t.to?d=u:(t.activate&&!f&&(d+=p(Z.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(d+=p(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=p(3)));let m=[a,o,s,c],g=Math.abs(u-d);t.wrap&&t.message&&(t.message=S.wrapLabel(t.message,h.getMax(g+2*Z.wrapPadding,Z.width),qe(Z)));let _=S.calculateTextDimensions(t.message,qe(Z));return{width:h.getMax(t.wrap?0:_.width+2*Z.wrapPadding,g+2*Z.wrapPadding,Z.width),height:0,startx:u,stopx:d,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,m),toBounds:Math.max.apply(null,m)}},`buildMessageModel`),_t=e(async function(e,n,r,i){let a={},o=[],s,c,l;for(let t of e){switch(t.type){case i.db.LINETYPE.LOOP_START:case i.db.LINETYPE.ALT_START:case i.db.LINETYPE.OPT_START:case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:case i.db.LINETYPE.CRITICAL_START:case i.db.LINETYPE.BREAK_START:o.push({id:t.id,msg:t.message,from:2**53-1,to:-(2**53-1),width:0});break;case i.db.LINETYPE.ALT_ELSE:case i.db.LINETYPE.PAR_AND:case i.db.LINETYPE.CRITICAL_OPTION:t.message&&(s=o.pop(),a[s.id]=s,a[t.id]=s,o.push(s));break;case i.db.LINETYPE.LOOP_END:case i.db.LINETYPE.ALT_END:case i.db.LINETYPE.OPT_END:case i.db.LINETYPE.PAR_END:case i.db.LINETYPE.CRITICAL_END:case i.db.LINETYPE.BREAK_END:s=o.pop(),a[s.id]=s;break;case i.db.LINETYPE.ACTIVE_START:{let e=n.get(t.from?t.from:t.to.actor),r=nt(t.from?t.from:t.to.actor).length,i=e.x+e.width/2+(r-1)*Z.activationWidth/2,a={startx:i,stopx:i+Z.activationWidth,actor:t.from,enabled:!0};Q.activations.push(a)}break;case i.db.LINETYPE.ACTIVE_END:{let e=Q.activations.map(e=>e.actor).lastIndexOf(t.from);Q.activations.splice(e,1).splice(0,1)}}t.placement===void 0?(l=gt(t,n,i),t.msgModel=l,l.startx&&l.stopx&&o.length>0&&o.forEach(e=>{if(s=e,l.startx===l.stopx){let e=n.get(t.from),r=n.get(t.to);s.from=h.getMin(e.x-l.width/2,e.x-e.width/2,s.from),s.to=h.getMax(r.x+l.width/2,r.x+e.width/2,s.to),s.width=h.getMax(s.width,Math.abs(s.to-s.from))-Z.labelBoxWidth}else s.from=h.getMin(l.startx,s.from),s.to=h.getMax(l.stopx,s.to),s.width=h.getMax(s.width,l.width)-Z.labelBoxWidth})):(c=await lt(t,n,i),t.noteModel=c,o.forEach(e=>{s=e,s.from=h.getMin(s.from,c.startx),s.to=h.getMax(s.to,c.startx+c.width),s.width=h.getMax(s.width,Math.abs(s.from-s.to))-Z.labelBoxWidth}))}return Q.activations=[],t.debug(`Loop type widths:`,a),a},`calculateLoopBounds`),vt={parser:F,get db(){return new ne},renderer:{bounds:Q,drawActors:$e,drawActorsPopup:et,setConf:tt,draw:at},styles:re,init:e(e=>{e.sequence||={},e.wrap&&(e.sequence.wrap=e.wrap,a({sequence:{wrap:e.wrap}}))},`init`)};export{vt as diagram}; \ No newline at end of file +`;E.append(`path`).attr(`d`,D),p===`neo`&&E.attr(`filter`,`url(#${J(a)})`);let O=o.get(t.name)??0;if(H.has(d)?(E.style(`stroke`,U(h,O)),E.style(`fill`,U(m,O))):E.style(`stroke`,g),E.attr(`transform`,`translate(${x}, ${C})`),t.rectData=y,Y(n,r(t.description))(t.description,v,y.x,l?l.labelCenterY-y.height/2:y.y+35,y.width,y.height,{class:`actor ${he}`},n),!l){let e=E.select(`path:last-child`);e.node()&&(t.height=e.node().getBBox().height+(n.sequence.labelBoxHeight??0))}return i||(v.attr(`data-et`,`participant`),v.attr(`data-type`,`database`),v.attr(`data-id`,t.name)),t.height},`drawActorTypeDatabase`),Ee=e(function(e,t,n,i,a,o){let s=i?t.stopy:t.starty,c=t.x+t.width/2,l=me(t,n,i,s),u=l?l.lifelineStartY:s+80,d=l?l.glyphBottomY-22:s+12,f=e.append(`g`).lower(),{look:p,theme:m,themeVariables:h}=n,{bkgColorArray:g,borderColorArray:_,actorBorder:v}=h;i||(G++,f.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name).attr(`data-et`,`life-line`).attr(`data-id`,t.name),t.actorCnt=G);let y=e.append(`g`),b=V;b+=i?` ${B}`:` ${z}`,y.attr(`class`,b),y.attr(`name`,t.name);let x=k();x.x=t.x,x.y=s,x.fill=`#eaeaea`,x.width=t.width,x.height=t.height,x.class=`actor`,y.append(`line`).attr(`id`,`actor-man-torso`+G).attr(`x1`,t.x+t.width/2-55).attr(`y1`,d).attr(`x2`,t.x+t.width/2-15).attr(`y2`,d),y.append(`line`).attr(`id`,`actor-man-arms`+G).attr(`x1`,t.x+t.width/2-55).attr(`y1`,d-10).attr(`x2`,t.x+t.width/2-55).attr(`y2`,d+10),y.append(`circle`).attr(`cx`,t.x+t.width/2).attr(`cy`,d).attr(`r`,22),p===`neo`&&y.attr(`filter`,`url(#${J(a)})`);let S=o.get(t.name)??0;return H.has(m)?(y.style(`stroke`,U(_,S)),y.style(`fill`,U(g,S))):y.style(`stroke`,v),l||(t.height=y.node().getBBox().height+(n.sequence.labelBoxHeight??0)),Y(n,r(t.description))(t.description,y,x.x,l?l.labelCenterY-x.height/2:x.y+15,x.width,x.height,{class:`actor ${V}`},n),l||y.attr(`transform`,`translate(0,21)`),i||(y.attr(`data-et`,`participant`),y.attr(`data-type`,`boundary`),y.attr(`data-id`,t.name)),t.height},`drawActorTypeBoundary`),De=e(function(t,n,i,a,o){let s=a?n.stopy:n.starty,c=n.x+n.width/2,l=me(n,i,a,s),u=l?l.lifelineStartY:s+80,{theme:d,themeVariables:f}=i,{bkgColorArray:p,borderColorArray:m,actorBorder:h}=f,g=t.append(`g`).lower();a||(G++,g.append(`line`).attr(`id`,`actor`+G).attr(`x1`,c).attr(`y1`,u).attr(`x2`,c).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,n.name).attr(`data-et`,`life-line`).attr(`data-id`,n.name),n.actorCnt=G);let _=t.append(`g`),v=V;v+=a?` ${B}`:` ${z}`,_.attr(`class`,v),_.attr(`name`,n.name),a||_.attr(`data-et`,`participant`).attr(`data-type`,`actor`).attr(`data-id`,n.name);let y=l?ie/pe:1,b=e(e=>l?l.glyphBottomY-(fe-e)*y:s+e,`gy`),x=e(e=>c+e*y,`gx`);_.append(`line`).attr(`id`,`actor-man-torso`+G).attr(`x1`,c).attr(`y1`,b(25)).attr(`x2`,c).attr(`y2`,b(45)),_.append(`line`).attr(`id`,`actor-man-arms`+G).attr(`x1`,x(-R/2)).attr(`y1`,b(33)).attr(`x2`,x(R/2)).attr(`y2`,b(33)),_.append(`line`).attr(`x1`,x(-R/2)).attr(`y1`,b(60)).attr(`x2`,c).attr(`y2`,b(45)),_.append(`line`).attr(`x1`,c).attr(`y1`,b(45)).attr(`x2`,x(R/2-2)).attr(`y2`,b(60));let S=_.append(`circle`);S.attr(`cx`,n.x+n.width/2),S.attr(`cy`,b(10)),S.attr(`r`,15*y),S.attr(`width`,n.width),S.attr(`height`,n.height),l||(n.height=pe);let C=k();C.x=n.x,C.y=s,C.fill=`#eaeaea`,C.width=n.width,C.height=n.height,C.class=`actor`,C.rx=3,C.ry=3;let w=o.get(n.name)??0;return H.has(d)?(_.style(`stroke`,U(m,w)),_.style(`fill`,U(p,w))):_.style(`stroke`,h),Y(i,r(n.description))(n.description,_,C.x,l?l.labelCenterY-C.height/2:s+35,C.width,C.height,{class:`actor ${V}`},i),n.height},`drawActorTypeActor`),Oe=e(async function(e,t,n,r,i,a,o){let s=o??new Map([...a.db.getActors().values()].map((e,t)=>[e.name,t]));switch(t.type){case`actor`:return await De(e,t,n,r,s);case`participant`:return await Se(e,t,n,r,i,s);case`boundary`:return await Ee(e,t,n,r,i,s);case`control`:return await K(e,t,n,r,i,s);case`entity`:return await q(e,t,n,r,i,s);case`database`:return await Te(e,t,n,r,i,s);case`collections`:return await Ce(e,t,n,r,i,s);case`queue`:return await we(e,t,n,r,i,s)}},`drawActor`),ke=e(function(e,t,n){let r=e.append(`g`);Ne(r,t),t.name&&Y(n)(t.name,r,t.x,t.y+n.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:`text`},n),r.lower()},`drawBox`),Ae=e(function(e){return e.append(`g`)},`anchorElement`),je=e(function(e,t,n,r,i,a,o){let{theme:s,themeVariables:c}=r,{bkgColorArray:l,borderColorArray:u,mainBkg:d}=c,f=k(),p=t.anchored,m=t.actor;f.x=t.startx,f.y=t.starty,f.class=`activation`+i%3,f.width=t.stopx-t.startx,f.height=n-t.starty;let h=ge(p,f),g=(o??new Map([...a.db.getActors().values()].map((e,t)=>[e.name,t]))).get(m)??0;H.has(s)&&(h.style(`stroke`,U(u,g)),h.style(`fill`,U(l,g)??d))},`drawActivation`),Me=e(async function(t,n,i,a,o){let{boxMargin:s,boxTextMargin:c,labelBoxHeight:l,labelBoxWidth:u,messageFontFamily:d,messageFontSize:f,messageFontWeight:p}=a,m=t.append(`g`).attr(`data-et`,`control-structure`).attr(`data-id`,`i`+o.id),h=e(function(e,t,n,r){return m.append(`line`).attr(`x1`,e).attr(`y1`,t).attr(`x2`,n).attr(`y2`,r).attr(`class`,`loopLine`)},`drawLoopLine`);h(n.startx,n.starty,n.stopx,n.starty),h(n.stopx,n.starty,n.stopx,n.stopy),h(n.startx,n.stopy,n.stopx,n.stopy),h(n.startx,n.starty,n.startx,n.stopy),n.sections!==void 0&&n.sections.forEach(function(e){h(n.startx,e.y,n.stopx,e.y).style(`stroke-dasharray`,`3, 3`)});let g=T();g.text=i,g.x=n.startx,g.y=n.starty,g.fontFamily=d,g.fontSize=f,g.fontWeight=p,g.anchor=`middle`,g.valign=`middle`,g.tspan=!1,g.width=Math.max(u??0,50),g.height=l+(a.look===`neo`?15:0)||20,g.textMargin=c,g.class=`labelText`,be(m,g),g=He(),g.text=n.title,g.x=n.startx+u/2+(n.stopx-n.startx)/2,g.y=n.starty+s+c,g.anchor=`middle`,g.valign=`middle`,g.textMargin=c,g.class=`loopText`,g.fontFamily=d,g.fontSize=f,g.fontWeight=p,g.wrap=!0;let _=r(g.text)?await ye(m,g,n):W(m,g);if(n.sectionTitles!==void 0){for(let[e,t]of Object.entries(n.sectionTitles))if(t.message){g.text=t.message,g.x=n.startx+(n.stopx-n.startx)/2,g.y=n.sections[e].y+s+c,g.class=`sectionTitle`,g.anchor=`middle`,g.valign=`middle`,g.tspan=!1,g.fontFamily=d,g.fontSize=f,g.fontWeight=p,g.wrap=n.wrap,r(g.text)?(n.starty=n.sections[e].y,await ye(m,g,n)):W(m,g);let i=Math.round(_.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));n.sections[e].height+=i-(s+c)}}return n.height=Math.round(n.stopy-n.starty),m},`drawLoop`),Ne=e(function(e,t){D(e,t)},`drawBackgroundRect`),Pe=e(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-database`).attr(`fill-rule`,`evenodd`).attr(`clip-rule`,`evenodd`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z`)},`insertDatabaseIcon`),Fe=e(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-computer`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z`)},`insertComputerIcon`),Ie=e(function(e,t){e.append(`defs`).append(`symbol`).attr(`id`,t+`-clock`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z`)},`insertClockIcon`),Le=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,7.9).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M -1 0 L 10 5 L 0 10 z`)},`insertArrowHead`),Re=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-filled-head`).attr(`refX`,15.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`insertArrowFilledHead`),ze=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-sequencenumber`).attr(`refX`,15).attr(`refY`,15).attr(`markerWidth`,60).attr(`markerHeight`,40).attr(`orient`,`auto`).append(`circle`).attr(`cx`,15).attr(`cy`,15).attr(`r`,6)},`insertSequenceNumber`),Be=e(function(e,t){e.append(`defs`).append(`marker`).attr(`id`,t+`-crosshead`).attr(`markerWidth`,15).attr(`markerHeight`,8).attr(`orient`,`auto`).attr(`refX`,4).attr(`refY`,4.5).append(`path`).attr(`fill`,`none`).attr(`stroke`,`#000000`).style(`stroke-dasharray`,`0, 0`).attr(`stroke-width`,`1pt`).attr(`d`,`M 1,2 L 6,7 M 6,2 L 1,7`)},`insertArrowCrossHead`),J=e(e=>e?`${e}-drop-shadow`:`drop-shadow`,`dropShadowId`),Ve=e(function(e,t,n){let{theme:r}=t;e.append(`defs`).append(`filter`).attr(`id`,J(n)).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${r===`redux`||r===`redux-color`?`#000000`:`#FFFFFF`}`)},`insertDropShadow`),He=e(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:`#666`,width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},`getTextObj`),Ue=e(function(){return{x:0,y:0,fill:`#EDF2AE`,stroke:`#666`,width:100,anchor:`start`,height:100,rx:0,ry:0}},`getNoteRect`),Y=(function(){function t(e,t,n,r,i,a,s){o(t.append(`text`).attr(`x`,n+i/2).attr(`y`,r+a/2+5).style(`text-anchor`,`middle`).text(e),s)}e(t,`byText`);function n(e,t,n,r,i,a,s,c){let{actorFontSize:l,actorFontFamily:u,actorFontWeight:d}=c,[f,p]=C(l),m=e.split(h.lineBreakRegex);for(let e=0;ee.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},`getHeight`),clear:e(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},`clear`),addBox:e(function(e){this.boxes.push(e)},`addBox`),addActor:e(function(e){this.actors.push(e)},`addActor`),addLoop:e(function(e){this.loops.push(e)},`addLoop`),addMessage:e(function(e){this.messages.push(e)},`addMessage`),addNote:e(function(e){this.notes.push(e)},`addNote`),lastActor:e(function(){return this.actors[this.actors.length-1]},`lastActor`),lastLoop:e(function(){return this.loops[this.loops.length-1]},`lastLoop`),lastMessage:e(function(){return this.messages[this.messages.length-1]},`lastMessage`),lastNote:e(function(){return this.notes[this.notes.length-1]},`lastNote`),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:e(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,tt(v())},`init`),updateVal:e(function(e,t,n,r){e[t]=e[t]===void 0?n:r(n,e[t])},`updateVal`),updateBounds:e(function(t,n,r,i){let a=this,o=0;function s(s){return e(function(e){o++;let c=a.sequenceItems.length-o+1;a.updateVal(e,`starty`,n-c*Z.boxMargin,Math.min),a.updateVal(e,`stopy`,i+c*Z.boxMargin,Math.max),a.updateVal(Q.data,`startx`,t-c*Z.boxMargin,Math.min),a.updateVal(Q.data,`stopx`,r+c*Z.boxMargin,Math.max),s!==`activation`&&(a.updateVal(e,`startx`,t-c*Z.boxMargin,Math.min),a.updateVal(e,`stopx`,r+c*Z.boxMargin,Math.max),a.updateVal(Q.data,`starty`,n-c*Z.boxMargin,Math.min),a.updateVal(Q.data,`stopy`,i+c*Z.boxMargin,Math.max))},`updateItemBounds`)}e(s,`updateFn`),this.sequenceItems.forEach(s()),this.activations.forEach(s(`activation`))},`updateBounds`),insert:e(function(e,t,n,r){let i=h.getMin(e,n),a=h.getMax(e,n),o=h.getMin(t,r),s=h.getMax(t,r);this.updateVal(Q.data,`startx`,i,Math.min),this.updateVal(Q.data,`starty`,o,Math.min),this.updateVal(Q.data,`stopx`,a,Math.max),this.updateVal(Q.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),newActivation:e(function(e,t,n){let r=n.get(e.from),i=nt(e.from).length||0,a=r.x+r.width/2+(i-1)*Z.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+Z.activationWidth,stopy:void 0,actor:e.from,anchored:X.anchorElement(t)})},`newActivation`),endActivation:e(function(e){let t=this.activations.map(function(e){return e.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},`endActivation`),createLoop:e(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},`createLoop`),newLoop:e(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},`newLoop`),endLoop:e(function(){return this.sequenceItems.pop()},`endLoop`),isLoopOverlap:e(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},`isLoopOverlap`),addSectionToLoop:e(function(e){let t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:Q.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},`addSectionToLoop`),saveVerticalPos:e(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},`saveVerticalPos`),resetVerticalPos:e(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},`resetVerticalPos`),bumpVerticalPos:e(function(e){this.verticalPos+=e,this.data.stopy=h.getMax(this.data.stopy,this.verticalPos)},`bumpVerticalPos`),getVerticalPos:e(function(){return this.verticalPos},`getVerticalPos`),getBounds:e(function(){return{bounds:this.data,models:this.models}},`getBounds`)},Ge=e(async function(e,t,n){Q.bumpVerticalPos(Z.boxMargin),t.height=Z.boxMargin,t.starty=Q.getVerticalPos();let i=k();i.x=t.startx,i.y=t.starty,i.width=t.width||Z.width,i.class=`note`;let a=e.append(`g`);a.attr(`data-et`,`note`),a.attr(`data-id`,`i`+n);let o=X.drawRect(a,i),s=T();s.x=t.startx,s.y=t.starty,s.width=i.width,s.dy=`1em`,s.text=t.message,s.class=`noteText`,s.fontFamily=Z.noteFontFamily,s.fontSize=Z.noteFontSize,s.fontWeight=Z.noteFontWeight,s.anchor=Z.noteAlign,s.textMargin=Z.noteMargin,s.valign=`center`;let c=r(s.text)?await ye(a,s):W(a,s),l=Math.round(c.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));o.attr(`height`,l+2*Z.noteMargin),t.height+=l+2*Z.noteMargin,Q.bumpVerticalPos(l+2*Z.noteMargin),t.stopy=t.starty+l+2*Z.noteMargin,t.stopx=t.startx+i.width,Q.insert(t.startx,t.starty,t.stopx,t.stopy),Q.models.addNote(t)},`drawNote`),Ke=e(function(t,n,r,i,a,o,s){let c=i.db.getActors(),l=c.get(n.from),u=c.get(n.to),d=r.sequenceVisible,f=l.x+l.width/2,p=u.x+u.width/2,m=f<=p,h=mt(n,i),g=t.append(`g`),_=e((e,t)=>{let n=e?16.5:-16.5;return t?-n:n},`getCircleOffset`),v=e(e=>{g.append(`circle`).attr(`cx`,e).attr(`cy`,s).attr(`r`,5).attr(`width`,10).attr(`height`,10)},`drawCircle`),{CENTRAL_CONNECTION:y,CENTRAL_CONNECTION_REVERSE:b,CENTRAL_CONNECTION_DUAL:x}=i.db.LINETYPE;if(d)switch(n.centralConnection){case y:h&&(p+=_(m,!0));break;case b:h||(f+=_(m,!1));break;case x:h?p+=_(m,!0):f+=_(m,!1)}switch(n.centralConnection){case y:v(p);break;case b:v(f);break;case x:v(f),v(p)}},`drawCentralConnection`),qe=e(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),`messageFont`),Je=e(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),`noteFont`),Ye=e(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),`actorFont`);async function Xe(e,t){Q.bumpVerticalPos(10);let{startx:n,stopx:i,message:a}=t,o=h.splitBreaks(a).length,s=r(a),c=s?await f(a,v()):S.calculateTextDimensions(a,qe(Z));if(!s){let e=c.height/o;t.height+=e,Q.bumpVerticalPos(e)}let l,u=c.height-10,d=c.width;if(n===i){l=Q.getVerticalPos()+u,Z.rightAngles||(u+=Z.boxMargin,l=Q.getVerticalPos()+u),u+=30;let e=h.getMax(d/2,Z.width/2);Q.insert(n-e,Q.getVerticalPos()-10+u,i+e,Q.getVerticalPos()+30+u)}else u+=Z.boxMargin,l=Q.getVerticalPos()+u,Q.insert(n,l-10,i,l);return Q.bumpVerticalPos(u),t.height+=u,t.stopy=t.starty+t.height,Q.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),l}e(Xe,`boundMessage`);var Ze=e(async function(e,t,n,i,a,o){let{startx:c,stopx:l,starty:u,message:d,type:f,sequenceIndex:p,sequenceVisible:m}=t,g=S.calculateTextDimensions(d,qe(Z)),_=T();_.x=Math.min(c,l),_.y=u+10,_.width=Math.abs(l-c),_.class=`messageText`,_.dy=`1em`,_.text=d,_.fontFamily=Z.messageFontFamily,_.fontSize=Z.messageFontSize,_.fontWeight=Z.messageFontWeight,_.anchor=Z.messageAlign,_.valign=`center`,_.textMargin=Z.wrapPadding,_.tspan=!1,r(_.text)?await ye(e,_,{startx:c,stopx:l,starty:n}):W(e,_);let v=g.width,y;if(c===l){let r=m||Z.showSequenceNumbers,o=mt(a,i),s=ht(a,i),u=c+(r&&(o||s)?10:0);y=Z.rightAngles?e.append(`path`).attr(`d`,`M ${u},${n} H ${c+h.getMax(Z.width/2,v/2)} V ${n+25} H ${c}`):e.append(`path`).attr(`d`,`M `+u+`,`+n+` C `+(u+60)+`,`+(n-10)+` `+(c+60)+`,`+(n+30)+` `+c+`,`+(n+20)),ft(a,i)&&Ke(e,a,t,i,c,l,n)}else y=e.append(`line`),y.attr(`x1`,c),y.attr(`y1`,n),y.attr(`x2`,l),y.attr(`y2`,n),ft(a,i)&&Ke(e,a,t,i,c,l,n);f===i.db.LINETYPE.DOTTED||f===i.db.LINETYPE.DOTTED_CROSS||f===i.db.LINETYPE.DOTTED_POINT||f===i.db.LINETYPE.DOTTED_OPEN||f===i.db.LINETYPE.BIDIRECTIONAL_DOTTED||f===i.db.LINETYPE.SOLID_TOP_DOTTED||f===i.db.LINETYPE.SOLID_BOTTOM_DOTTED||f===i.db.LINETYPE.STICK_TOP_DOTTED||f===i.db.LINETYPE.STICK_BOTTOM_DOTTED||f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style(`stroke-dasharray`,`3, 3`),y.attr(`class`,`messageLine1`)):y.attr(`class`,`messageLine0`),y.attr(`data-et`,`message`),y.attr(`data-id`,`i`+t.id),y.attr(`data-from`,t.from),y.attr(`data-to`,t.to);let b=``;if(Z.arrowMarkerAbsolute&&(b=s(!0)),y.attr(`stroke-width`,2),y.attr(`stroke`,`none`),y.style(`fill`,`none`),(f===i.db.LINETYPE.SOLID_TOP||f===i.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-solidTopArrowHead)`),(f===i.db.LINETYPE.SOLID_BOTTOM||f===i.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-solidBottomArrowHead)`),(f===i.db.LINETYPE.STICK_TOP||f===i.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-stickTopArrowHead)`),(f===i.db.LINETYPE.STICK_BOTTOM||f===i.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-stickBottomArrowHead)`),(f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-solidBottomArrowHead)`),(f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-solidTopArrowHead)`),(f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-stickBottomArrowHead)`),(f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr(`marker-start`,`url(`+b+`#`+o+`-stickTopArrowHead)`),(f===i.db.LINETYPE.SOLID||f===i.db.LINETYPE.DOTTED)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-arrowhead)`),(f===i.db.LINETYPE.BIDIRECTIONAL_SOLID||f===i.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr(`marker-start`,`url(`+b+`#`+o+`-arrowhead)`),y.attr(`marker-end`,`url(`+b+`#`+o+`-arrowhead)`)),(f===i.db.LINETYPE.SOLID_POINT||f===i.db.LINETYPE.DOTTED_POINT)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-filled-head)`),(f===i.db.LINETYPE.SOLID_CROSS||f===i.db.LINETYPE.DOTTED_CROSS)&&y.attr(`marker-end`,`url(`+b+`#`+o+`-crosshead)`),m||Z.showSequenceNumbers){let r=f===i.db.LINETYPE.BIDIRECTIONAL_SOLID||f===i.db.LINETYPE.BIDIRECTIONAL_DOTTED,s=f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE||f===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||f===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,u=ft(a,i),d=c,m=l;r?(cc?m=l-12:(m=l-6,d+=a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_DUAL||a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),m+=u?15:0,y.attr(`x2`,m),y.attr(`x1`,d)):y.attr(`x1`,c+6);let h=0,g=c===l,_=c<=l;h=g?t.fromBounds+1:s?_?t.toBounds-1:t.fromBounds+1:_?t.fromBounds+1:t.toBounds-1;let v=`12px`,x=p.toString().length;x>5?v=`7px`:x>3&&(v=`9px`),e.append(`line`).attr(`x1`,h).attr(`y1`,n).attr(`x2`,h).attr(`y2`,n).attr(`stroke-width`,0).attr(`marker-start`,`url(`+b+`#`+o+`-sequencenumber)`),e.append(`text`).attr(`x`,h).attr(`y`,n+4).attr(`font-family`,`sans-serif`).attr(`font-size`,v).attr(`text-anchor`,`middle`).attr(`class`,`sequenceNumber`).text(p)}},`drawMessage`),Qe=e(function(e,t,n,r,i,a,o){let s=0,c=0,l,u=0;for(let e of r){let r=t.get(e),a=r.box;l&&l!=a&&(o||Q.models.addBox(l),c+=Z.boxMargin+l.margin),a&&a!=l&&(o||(a.x=s+c,a.y=i),c+=a.margin),r.width=h.getMax(r.width||Z.width,Z.width),r.height=h.getMax(r.height||Z.height,Z.height),r.margin=r.margin||Z.actorMargin,u=h.getMax(u,r.height),n.get(r.name)&&(c+=r.width/2),r.x=s+c,r.starty=Q.getVerticalPos(),Q.insert(r.x,i,r.x+r.width,r.height),s+=r.width+c,r.box&&(r.box.width=s+a.margin-r.box.x),c=r.margin,l=r.box,Q.models.addActor(r)}l&&!o&&Q.models.addBox(l),Q.bumpVerticalPos(u)},`addActorRenderingData`),$e=e(async function(e,t,n,r,i,a,o){if(r){let r=0;Q.bumpVerticalPos(Z.boxMargin*2);for(let s of n){let n=t.get(s);n.stopy||=Q.getVerticalPos();let c=await X.drawActor(e,n,Z,!0,i,a,o);r=h.getMax(r,c)}Q.bumpVerticalPos(r+Z.boxMargin)}else for(let r of n){let n=t.get(r);await X.drawActor(e,n,Z,!1,i,a,o)}},`drawActors`),et=e(function(e,t,n,r){let i=0,a=0;for(let o of n){let n=t.get(o),s=st(n),c=X.drawPopup(e,n,s,Z,Z.forceMenus,r);c.height>i&&(i=c.height),c.width+n.x>a&&(a=c.width+n.x)}return{maxHeight:i,maxWidth:a}},`drawActorsPopup`),tt=e(function(e){m(Z,e),e.fontFamily&&(Z.actorFontFamily=Z.noteFontFamily=Z.messageFontFamily=e.fontFamily),e.fontSize&&(Z.actorFontSize=Z.noteFontSize=Z.messageFontSize=e.fontSize),e.fontWeight&&(Z.actorFontWeight=Z.noteFontWeight=Z.messageFontWeight=e.fontWeight)},`setConf`),nt=e(function(e){return Q.activations.filter(function(t){return t.actor===e})},`actorActivations`),rt=e(function(e,t){let n=t.get(e),r=nt(e);return[r.reduce(function(e,t){return h.getMin(e,t.startx)},n.x+n.width/2-1),r.reduce(function(e,t){return h.getMax(e,t.stopx)},n.x+n.width/2+1)]},`activationBounds`);function $(e,n,r,i,a){Q.bumpVerticalPos(r);let o=i;if(n.id&&n.message&&e[n.id]){let r=e[n.id].width,a=qe(Z);n.message=S.wrapLabel(`[${n.message}]`,r-2*Z.wrapPadding,a),n.width=r,n.wrap=!0;let s=S.calculateTextDimensions(n.message,a),c=h.getMax(s.height,Z.labelBoxHeight);o=i+c,t.debug(`${c} - ${n.message}`)}a(n),Q.bumpVerticalPos(o)}e($,`adjustLoopHeightForWrap`);function it(t,n,r,i,a,o,s){function c(e,r){e.x{e.add(t.from),e.add(t.to)}),x=x.filter(t=>e.has(t))}let D=new Map(x.map((e,t)=>[g.get(e)?.name??e,t]));Qe(h,g,_,x,0,S,!1);let O=await _t(S,g,E,o);X.insertArrowHead(h,i),X.insertArrowCrossHead(h,i),X.insertArrowFilledHead(h,i),X.insertSequenceNumber(h,i),X.insertSolidTopArrowHead(h,i),X.insertSolidBottomArrowHead(h,i),X.insertStickTopArrowHead(h,i),X.insertStickBottomArrowHead(h,i),l===`neo`&&X.insertDropShadow(h,Z,i);function k(e,t){let n=Q.endActivation(e);n.starty+18>t&&(n.starty=t-6,t+=12),X.drawActivation(h,n,t,Z,nt(e.from).length,o,D),Q.insert(n.startx,t-10,n.stopx,t)}e(k,`activeEnd`);let A=1,j=1,M=[],N=[],P=0;for(let e of S){let n,r,i;switch(e.type){case o.db.LINETYPE.NOTE:Q.resetVerticalPos(),r=e.noteModel,await Ge(h,r,e.id);break;case o.db.LINETYPE.ACTIVE_START:Q.newActivation(e,h,g);break;case o.db.LINETYPE.CENTRAL_CONNECTION:Q.newActivation(e,h,g);break;case o.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Q.newActivation(e,h,g);break;case o.db.LINETYPE.ACTIVE_END:k(e,Q.getVerticalPos());break;case o.db.LINETYPE.LOOP_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.LOOP_END:n=Q.endLoop(),await X.drawLoop(h,n,`loop`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.RECT_START:$(O,e,Z.boxMargin,Z.boxMargin,e=>{let t=e.message;t||=u?.rectBkgColor||u?.actorBkg||`rgba(128, 128, 128, 0.5)`,Q.newLoop(void 0,t)});break;case o.db.LINETYPE.RECT_END:n=Q.endLoop(),N.push(n),Q.models.addLoop(n),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos());break;case o.db.LINETYPE.OPT_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.OPT_END:n=Q.endLoop(),await X.drawLoop(h,n,`opt`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.ALT_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.ALT_ELSE:$(O,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case o.db.LINETYPE.ALT_END:n=Q.endLoop(),await X.drawLoop(h,n,`alt`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.PAR_START:case o.db.LINETYPE.PAR_OVER_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e)),Q.saveVerticalPos();break;case o.db.LINETYPE.PAR_AND:$(O,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case o.db.LINETYPE.PAR_END:n=Q.endLoop(),await X.drawLoop(h,n,`par`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.AUTONUMBER:A=e.message.start||A,j=e.message.step||j,e.message.visible?o.db.enableSequenceNumbers():o.db.disableSequenceNumbers();break;case o.db.LINETYPE.CRITICAL_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.CRITICAL_OPTION:$(O,e,Z.boxMargin+Z.boxTextMargin,Z.boxMargin,e=>Q.addSectionToLoop(e));break;case o.db.LINETYPE.CRITICAL_END:n=Q.endLoop(),await X.drawLoop(h,n,`critical`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;case o.db.LINETYPE.BREAK_START:$(O,e,Z.boxMargin,Z.boxMargin+Z.boxTextMargin,e=>Q.newLoop(e));break;case o.db.LINETYPE.BREAK_END:n=Q.endLoop(),await X.drawLoop(h,n,`break`,Z,e),Q.bumpVerticalPos(n.stopy-Q.getVerticalPos()),Q.models.addLoop(n);break;default:try{i=e.msgModel,i.starty=Q.getVerticalPos(),i.sequenceIndex=A,i.sequenceVisible=o.db.showSequenceNumbers(),i.id=e.id,i.from=e.from,i.to=e.to;let t=await Xe(h,i);it(e,i,t,P,g,_,y),M.push({messageModel:i,lineStartY:t,msg:e}),Q.models.addMessage(i)}catch(e){t.error(`error while drawing message`,e)}}[o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN,o.db.LINETYPE.SOLID,o.db.LINETYPE.SOLID_TOP,o.db.LINETYPE.SOLID_BOTTOM,o.db.LINETYPE.STICK_TOP,o.db.LINETYPE.STICK_BOTTOM,o.db.LINETYPE.SOLID_TOP_DOTTED,o.db.LINETYPE.SOLID_BOTTOM_DOTTED,o.db.LINETYPE.STICK_TOP_DOTTED,o.db.LINETYPE.STICK_BOTTOM_DOTTED,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.DOTTED,o.db.LINETYPE.SOLID_CROSS,o.db.LINETYPE.DOTTED_CROSS,o.db.LINETYPE.SOLID_POINT,o.db.LINETYPE.DOTTED_POINT,o.db.LINETYPE.BIDIRECTIONAL_SOLID,o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(A=Math.round((A+j)*100)/100),P++}t.debug(`createdActors`,_),t.debug(`destroyedActors`,y),await $e(h,g,x,!1,i,o,D);for(let e of M)await Ze(h,e.messageModel,e.lineStartY,o,e.msg,i);Z.mirrorActors&&await $e(h,g,x,!0,i,o,D),N.forEach(e=>X.drawBackgroundRect(h,e)),xe(h,g,x,Z);for(let e of Q.models.boxes){e.height=Q.getVerticalPos()-e.y,Q.insert(e.x,e.y,e.x+e.width,e.height);let t=Z.boxMargin*2;e.startx=e.x-t,e.starty=e.y-t*.25,e.stopx=e.startx+e.width+2*t,e.stopy=e.starty+e.height+t*.75,e.stroke=`rgb(0,0,0, 0.5)`,X.drawBox(h,e,Z)}w&&Q.bumpVerticalPos(Z.boxMargin);let F=et(h,g,x,m),{bounds:I}=Q.getBounds();I.startx===void 0&&(I.startx=0),I.starty===void 0&&(I.starty=0),I.stopx===void 0&&(I.stopx=0),I.stopy===void 0&&(I.stopy=0);let ee=I.stopy-I.starty;ee{let n=qe(Z),r=t.actorKeys.reduce((t,n)=>t+=e.get(n).width+(e.get(n).margin||0),0),i=Z.boxMargin*8;r+=i,r-=2*Z.boxTextMargin,t.wrap&&(t.name=S.wrapLabel(t.name,r-2*Z.wrapPadding,n));let o=S.calculateTextDimensions(t.name,n);a=h.getMax(o.height,a);let s=h.getMax(r,o.width+2*Z.wrapPadding);if(t.margin=Z.boxTextMargin,re.textMaxHeight=a),h.getMax(i,Z.height)}e(ct,`calculateActorMargins`);var lt=e(async function(e,n,i){let a=n.get(e.from),o=n.get(e.to),s=a.x,c=o.x,l=e.wrap&&e.message,u=r(e.message)?await f(e.message,v()):S.calculateTextDimensions(l?S.wrapLabel(e.message,Z.width,Je(Z)):e.message,Je(Z)),d={width:l?Z.width:h.getMax(Z.width,u.width+2*Z.noteMargin),height:0,startx:a.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===i.db.PLACEMENT.RIGHTOF?(d.width=l?h.getMax(Z.width,u.width):h.getMax(a.width/2+o.width/2,u.width+2*Z.noteMargin),d.startx=s+(a.width+Z.actorMargin)/2):e.placement===i.db.PLACEMENT.LEFTOF?(d.width=l?h.getMax(Z.width,u.width+2*Z.noteMargin):h.getMax(a.width/2+o.width/2,u.width+2*Z.noteMargin),d.startx=s-d.width+(a.width-Z.actorMargin)/2):e.to===e.from?(u=S.calculateTextDimensions(l?S.wrapLabel(e.message,h.getMax(Z.width,a.width),Je(Z)):e.message,Je(Z)),d.width=l?h.getMax(Z.width,a.width):h.getMax(a.width,Z.width,u.width+2*Z.noteMargin),d.startx=s+(a.width-d.width)/2):(d.width=Math.abs(s+a.width/2-(c+o.width/2))+Z.actorMargin,d.startx=s2,p=e(e=>l?-e:e,`adjustValue`);t.from===t.to?d=u:(t.activate&&!f&&(d+=p(Z.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(d+=p(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(u-=p(3)));let m=[a,o,s,c],g=Math.abs(u-d);t.wrap&&t.message&&(t.message=S.wrapLabel(t.message,h.getMax(g+2*Z.wrapPadding,Z.width),qe(Z)));let _=S.calculateTextDimensions(t.message,qe(Z));return{width:h.getMax(t.wrap?0:_.width+2*Z.wrapPadding,g+2*Z.wrapPadding,Z.width),height:0,startx:u,stopx:d,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,m),toBounds:Math.max.apply(null,m)}},`buildMessageModel`),_t=e(async function(e,n,r,i){let a={},o=[],s,c,l;for(let t of e){switch(t.type){case i.db.LINETYPE.LOOP_START:case i.db.LINETYPE.ALT_START:case i.db.LINETYPE.OPT_START:case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:case i.db.LINETYPE.CRITICAL_START:case i.db.LINETYPE.BREAK_START:o.push({id:t.id,msg:t.message,from:2**53-1,to:-(2**53-1),width:0});break;case i.db.LINETYPE.ALT_ELSE:case i.db.LINETYPE.PAR_AND:case i.db.LINETYPE.CRITICAL_OPTION:t.message&&(s=o.pop(),a[s.id]=s,a[t.id]=s,o.push(s));break;case i.db.LINETYPE.LOOP_END:case i.db.LINETYPE.ALT_END:case i.db.LINETYPE.OPT_END:case i.db.LINETYPE.PAR_END:case i.db.LINETYPE.CRITICAL_END:case i.db.LINETYPE.BREAK_END:s=o.pop(),a[s.id]=s;break;case i.db.LINETYPE.ACTIVE_START:{let e=n.get(t.from?t.from:t.to.actor),r=nt(t.from?t.from:t.to.actor).length,i=e.x+e.width/2+(r-1)*Z.activationWidth/2,a={startx:i,stopx:i+Z.activationWidth,actor:t.from,enabled:!0};Q.activations.push(a)}break;case i.db.LINETYPE.ACTIVE_END:{let e=Q.activations.map(e=>e.actor).lastIndexOf(t.from);Q.activations.splice(e,1).splice(0,1)}}t.placement===void 0?(l=gt(t,n,i),t.msgModel=l,l.startx&&l.stopx&&o.length>0&&o.forEach(e=>{if(s=e,l.startx===l.stopx){let e=n.get(t.from),r=n.get(t.to);s.from=h.getMin(e.x-l.width/2,e.x-e.width/2,s.from),s.to=h.getMax(r.x+l.width/2,r.x+e.width/2,s.to),s.width=h.getMax(s.width,Math.abs(s.to-s.from))-Z.labelBoxWidth}else s.from=h.getMin(l.startx,s.from),s.to=h.getMax(l.stopx,s.to),s.width=h.getMax(s.width,l.width)-Z.labelBoxWidth})):(c=await lt(t,n,i),t.noteModel=c,o.forEach(e=>{s=e,s.from=h.getMin(s.from,c.startx),s.to=h.getMax(s.to,c.startx+c.width),s.width=h.getMax(s.width,Math.abs(s.from-s.to))-Z.labelBoxWidth}))}return Q.activations=[],t.debug(`Loop type widths:`,a),a},`calculateLoopBounds`),vt={parser:F,get db(){return new ne},renderer:{bounds:Q,drawActors:$e,drawActorsPopup:et,setConf:tt,draw:at},styles:re,init:e(e=>{e.sequence||={},e.wrap&&(e.sequence.wrap=e.wrap,a({sequence:{wrap:e.wrap}}))},`init`)};export{vt as diagram}; \ No newline at end of file diff --git a/web/dist/app-stateDiagram-v2-GCMORJYK.js b/web/dist/app-stateDiagram-v2-GCMORJYK.js index 002315249..3ea3ee37c 100644 --- a/web/dist/app-stateDiagram-v2-GCMORJYK.js +++ b/web/dist/app-stateDiagram-v2-GCMORJYK.js @@ -1,9 +1,9 @@ -import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,U as a,a as o,q as s,s as c,v as l,w as u,x as d,y as f}from"./app-chunk-O7XYJQB3.js";import{g as p,s as m}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import{a as h,i as g,o as _,r as v}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as y,t as b}from"./app-chunk-GNY47TPC.js";import{t as x}from"./app-chunk-GWA4HPMP.js";import{t as S}from"./app-chunk-XXDRQBXY.js";import{t as C}from"./app-chunk-WEXAMYUT.js";var w=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,16],l=[1,17],u=[1,18],d=[1,19],f=[1,33],p=[1,20],m=[1,21],h=[1,22],g=[1,23],_=[1,24],v=[1,26],y=[1,27],b=[1,28],x=[1,29],S=[1,30],C=[1,31],w=[1,32],T=[1,35],E=[1,36],D=[1,37],O=[1,38],k=[1,34],A=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],j=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],M=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NL`,6:`SD`,14:`DESCR`,15:`-->`,16:`HIDE_EMPTY`,17:`scale`,18:`WIDTH`,19:`COMPOSIT_STATE`,20:`STRUCT_START`,21:`STRUCT_STOP`,22:`STATE_DESCR`,23:`AS`,24:`ID`,25:`FORK`,26:`JOIN`,27:`CHOICE`,28:`CONCURRENT`,29:`note`,31:`NOTE_TEXT`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,38:`CLICK`,39:`STRING`,40:`HREF`,41:`classDef`,42:`CLASSDEF_ID`,43:`CLASSDEF_STYLEOPTS`,44:`DEFAULT`,45:`style`,46:`STYLE_IDS`,47:`STYLEDEF_STYLEOPTS`,48:`class`,49:`CLASSENTITY_IDS`,50:`STYLECLASS`,51:`direction_tb`,52:`direction_bt`,53:`direction_rl`,54:`direction_lr`,56:`;`,57:`EDGE_STATE`,58:`STYLE_SEPARATOR`,59:`left_of`,60:`right_of`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.setRootDoc(a[s]),a[s];case 4:this.$=[];break;case 5:a[s]!=`nl`&&(a[s-1].push(a[s]),this.$=a[s-1]);break;case 6:case 7:this.$=a[s];break;case 8:this.$=`nl`;break;case 12:this.$=a[s];break;case 13:let e=a[s-1];e.description=r.trimColon(a[s]),this.$=e;break;case 14:this.$={stmt:`relation`,state1:a[s-2],state2:a[s]};break;case 15:let t=r.trimColon(a[s]);this.$={stmt:`relation`,state1:a[s-3],state2:a[s-1],description:t};break;case 19:this.$={stmt:`state`,id:a[s-3],type:`default`,description:``,doc:a[s-1]};break;case 20:var c=a[s],l=a[s-2].trim();if(a[s].match(`:`)){var u=a[s].split(`:`);c=u[0],l=[l,u[1]]}this.$={stmt:`state`,id:c,type:`default`,description:l};break;case 21:this.$={stmt:`state`,id:a[s-3],type:`default`,description:a[s-5],doc:a[s-1]};break;case 22:this.$={stmt:`state`,id:a[s],type:`fork`};break;case 23:this.$={stmt:`state`,id:a[s],type:`join`};break;case 24:this.$={stmt:`state`,id:a[s],type:`choice`};break;case 25:this.$={stmt:`state`,id:r.getDividerId(),type:`divider`};break;case 26:this.$={stmt:`state`,id:a[s-1].trim(),note:{position:a[s-2].trim(),text:a[s].trim()}};break;case 29:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:this.$={stmt:`click`,id:a[s-3],url:a[s-2],tooltip:a[s-1]};break;case 33:this.$={stmt:`click`,id:a[s-3],url:a[s-1],tooltip:``};break;case 34:case 35:this.$={stmt:`classDef`,id:a[s-1].trim(),classes:a[s].trim()};break;case 36:this.$={stmt:`style`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 37:this.$={stmt:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:r.setDirection(`TB`),this.$={stmt:`dir`,value:`TB`};break;case 39:r.setDirection(`BT`),this.$={stmt:`dir`,value:`BT`};break;case 40:r.setDirection(`RL`),this.$={stmt:`dir`,value:`RL`};break;case 41:r.setDirection(`LR`),this.$={stmt:`dir`,value:`LR`};break;case 44:case 45:this.$={stmt:`state`,id:a[s].trim(),type:`default`,description:``};break;case 46:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``};break;case 47:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``}}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},e([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,7]),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(A,[2,11]),e(A,[2,12],{14:[1,40],15:[1,41]}),e(A,[2,16]),{18:[1,42]},e(A,[2,18],{20:[1,43]}),{23:[1,44]},e(A,[2,22]),e(A,[2,23]),e(A,[2,24]),e(A,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},e(A,[2,28]),{34:[1,49]},{36:[1,50]},e(A,[2,31]),{13:51,24:f,57:k},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},e(j,[2,44],{58:[1,56]}),e(j,[2,45],{58:[1,57]}),e(A,[2,38]),e(A,[2,39]),e(A,[2,40]),e(A,[2,41]),e(A,[2,6]),e(A,[2,13]),{13:58,24:f,57:k},e(A,[2,17]),e(M,a,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},e(A,[2,29]),e(A,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},e(A,[2,14],{14:[1,71]}),{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,72],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},e(A,[2,34]),e(A,[2,35]),e(A,[2,36]),e(A,[2,37]),e(j,[2,46]),e(j,[2,47]),e(A,[2,15]),e(A,[2,19]),e(M,a,{7:78}),e(A,[2,26]),e(A,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,81],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,32]),e(A,[2,33]),e(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: +import{t as e}from"./app-purify.es.js";import{n as t}from"./app-chunk-Y2CYZVJY.js";import{m as n,p as r}from"./app-src.js";import{H as i,U as a,a as o,q as s,s as c,v as l,w as u,x as d,y as f}from"./app-chunk-O7XYJQB3.js";import{g as p,s as m}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import{a as h,i as g,o as _,r as v}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import{t as y}from"./app-chunk-GWA4HPMP.js";import{t as b}from"./app-chunk-XXDRQBXY.js";import{t as x}from"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import{r as S,t as C}from"./app-chunk-GNY47TPC.js";var w=(function(){var e=t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,2],r=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,16],l=[1,17],u=[1,18],d=[1,19],f=[1,33],p=[1,20],m=[1,21],h=[1,22],g=[1,23],_=[1,24],v=[1,26],y=[1,27],b=[1,28],x=[1,29],S=[1,30],C=[1,31],w=[1,32],T=[1,35],E=[1,36],D=[1,37],O=[1,38],k=[1,34],A=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],j=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],M=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],N={trace:t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NL`,6:`SD`,14:`DESCR`,15:`-->`,16:`HIDE_EMPTY`,17:`scale`,18:`WIDTH`,19:`COMPOSIT_STATE`,20:`STRUCT_START`,21:`STRUCT_STOP`,22:`STATE_DESCR`,23:`AS`,24:`ID`,25:`FORK`,26:`JOIN`,27:`CHOICE`,28:`CONCURRENT`,29:`note`,31:`NOTE_TEXT`,33:`acc_title`,34:`acc_title_value`,35:`acc_descr`,36:`acc_descr_value`,37:`acc_descr_multiline_value`,38:`CLICK`,39:`STRING`,40:`HREF`,41:`classDef`,42:`CLASSDEF_ID`,43:`CLASSDEF_STYLEOPTS`,44:`DEFAULT`,45:`style`,46:`STYLE_IDS`,47:`STYLEDEF_STYLEOPTS`,48:`class`,49:`CLASSENTITY_IDS`,50:`STYLECLASS`,51:`direction_tb`,52:`direction_bt`,53:`direction_rl`,54:`direction_lr`,56:`;`,57:`EDGE_STATE`,58:`STYLE_SEPARATOR`,59:`left_of`,60:`right_of`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.setRootDoc(a[s]),a[s];case 4:this.$=[];break;case 5:a[s]!=`nl`&&(a[s-1].push(a[s]),this.$=a[s-1]);break;case 6:case 7:this.$=a[s];break;case 8:this.$=`nl`;break;case 12:this.$=a[s];break;case 13:let e=a[s-1];e.description=r.trimColon(a[s]),this.$=e;break;case 14:this.$={stmt:`relation`,state1:a[s-2],state2:a[s]};break;case 15:let t=r.trimColon(a[s]);this.$={stmt:`relation`,state1:a[s-3],state2:a[s-1],description:t};break;case 19:this.$={stmt:`state`,id:a[s-3],type:`default`,description:``,doc:a[s-1]};break;case 20:var c=a[s],l=a[s-2].trim();if(a[s].match(`:`)){var u=a[s].split(`:`);c=u[0],l=[l,u[1]]}this.$={stmt:`state`,id:c,type:`default`,description:l};break;case 21:this.$={stmt:`state`,id:a[s-3],type:`default`,description:a[s-5],doc:a[s-1]};break;case 22:this.$={stmt:`state`,id:a[s],type:`fork`};break;case 23:this.$={stmt:`state`,id:a[s],type:`join`};break;case 24:this.$={stmt:`state`,id:a[s],type:`choice`};break;case 25:this.$={stmt:`state`,id:r.getDividerId(),type:`divider`};break;case 26:this.$={stmt:`state`,id:a[s-1].trim(),note:{position:a[s-2].trim(),text:a[s].trim()}};break;case 29:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 30:case 31:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 32:this.$={stmt:`click`,id:a[s-3],url:a[s-2],tooltip:a[s-1]};break;case 33:this.$={stmt:`click`,id:a[s-3],url:a[s-1],tooltip:``};break;case 34:case 35:this.$={stmt:`classDef`,id:a[s-1].trim(),classes:a[s].trim()};break;case 36:this.$={stmt:`style`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 37:this.$={stmt:`applyClass`,id:a[s-1].trim(),styleClass:a[s].trim()};break;case 38:r.setDirection(`TB`),this.$={stmt:`dir`,value:`TB`};break;case 39:r.setDirection(`BT`),this.$={stmt:`dir`,value:`BT`};break;case 40:r.setDirection(`RL`),this.$={stmt:`dir`,value:`RL`};break;case 41:r.setDirection(`LR`),this.$={stmt:`dir`,value:`LR`};break;case 44:case 45:this.$={stmt:`state`,id:a[s].trim(),type:`default`,description:``};break;case 46:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``};break;case 47:this.$={stmt:`state`,id:a[s-2].trim(),classes:[a[s].trim()],type:`default`,description:``}}},`anonymous`),table:[{3:1,4:n,5:r,6:i},{1:[3]},{3:5,4:n,5:r,6:i},{3:6,4:n,5:r,6:i},e([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:c,17:l,19:u,22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,7]),e(A,[2,8]),e(A,[2,9]),e(A,[2,10]),e(A,[2,11]),e(A,[2,12],{14:[1,40],15:[1,41]}),e(A,[2,16]),{18:[1,42]},e(A,[2,18],{20:[1,43]}),{23:[1,44]},e(A,[2,22]),e(A,[2,23]),e(A,[2,24]),e(A,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},e(A,[2,28]),{34:[1,49]},{36:[1,50]},e(A,[2,31]),{13:51,24:f,57:k},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},e(j,[2,44],{58:[1,56]}),e(j,[2,45],{58:[1,57]}),e(A,[2,38]),e(A,[2,39]),e(A,[2,40]),e(A,[2,41]),e(A,[2,6]),e(A,[2,13]),{13:58,24:f,57:k},e(A,[2,17]),e(M,a,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},e(A,[2,29]),e(A,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},e(A,[2,14],{14:[1,71]}),{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,72],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},e(A,[2,34]),e(A,[2,35]),e(A,[2,36]),e(A,[2,37]),e(j,[2,46]),e(j,[2,47]),e(A,[2,15]),e(A,[2,19]),e(M,a,{7:78}),e(A,[2,26]),e(A,[2,27]),{5:[1,79]},{5:[1,80]},{4:o,5:s,8:8,9:10,10:12,11:13,12:14,13:15,16:c,17:l,19:u,21:[1,81],22:d,24:f,25:p,26:m,27:h,28:g,29:_,32:25,33:v,35:y,37:b,38:x,41:S,45:C,48:w,51:T,52:E,53:D,54:O,57:k},e(A,[2,32]),e(A,[2,33]),e(A,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`: `+h.showPosition()+` Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};N.lexer=(function(){return{EOF:1,parseError:t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:t(function(){return this._more=!0,this},`more`),reject:t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+` `+t+`^`},`showPosition`),test_match:t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;at[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:t(function(){return this.next()||this.lex()},`lex`),begin:t(function(e){this.conditionStack.push(e)},`begin`),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:t(function(e,n,r,i){function a(){let t=n.yytext.indexOf(`%%`);if(t===0)return!1;if(t>0){let r=n.yytext.slice(0,t),i=n.yytext.slice(t);i&&e.lexer.unput(i),n.yytext=r}return!0}switch(t(a,`processId`),r){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState(`SCALE`),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin(`acc_title`),33;case 17:return this.popState(),`acc_title_value`;case 18:return this.begin(`acc_descr`),35;case 19:return this.popState(),`acc_descr_value`;case 20:this.begin(`acc_descr_multiline`);break;case 21:this.popState();break;case 22:return`acc_descr_multiline_value`;case 23:return this.pushState(`CLASSDEF`),41;case 24:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 25:return this.popState(),this.pushState(`CLASSDEFID`),42;case 26:return this.popState(),43;case 27:return this.pushState(`CLASS`),48;case 28:return this.popState(),this.pushState(`CLASS_STYLE`),49;case 29:return this.popState(),50;case 30:return this.pushState(`STYLE`),45;case 31:return this.popState(),this.pushState(`STYLEDEF_STYLES`),46;case 32:return this.popState(),47;case 33:return this.pushState(`SCALE`),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState(`STATE`);break;case 37:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState(`STATE_STRING`);break;case 48:return this.pushState(`STATE_ID`),`AS`;case 49:return a()?(this.popState(),`ID`):void 0;case 50:this.popState();break;case 51:return`STATE_DESCR`;case 52:throw Error(`Error: State name must be a single word. Found: "`+n.yytext.trim()+`"`);case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState(`struct`),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin(`NOTE`),29;case 59:return this.popState(),this.pushState(`NOTE_ID`),59;case 60:return this.popState(),this.pushState(`NOTE_ID`),60;case 61:this.popState(),this.pushState(`FLOATING_NOTE`);break;case 62:return this.popState(),this.pushState(`FLOATING_NOTE_ID`),`AS`;case 63:break;case 64:return`NOTE_TEXT`;case 65:return a()?(this.popState(),`ID`):void 0;case 66:return a()?(this.popState(),this.pushState(`NOTE_TEXT`),24):void 0;case 67:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;case 68:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return a()?24:void 0;case 74:return n.yytext=n.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return`INVALID`}},`anonymous`),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}})();function P(){this.yy={}}return t(P,`Parser`),P.prototype=N,N.Parser=P,new P})();w.parser=w;var T=w,E=`TB`,D=`TB`,O=`dir`,k=`state`,A=`root`,j=`relation`,M=`classDef`,N=`style`,P=`applyClass`,F=`default`,ee=`divider`,te=`fill:none`,ne=`fill: #333`,re=`c`,ie=`markdown`,ae=`normal`,I=`rect`,L=`rectWithTitle`,oe=`stateStart`,se=`stateEnd`,R=`divider`,ce=`roundedWithTitle`,le=`note`,ue=`noteGroup`,z=`statediagram`,de=`${z}-state`,B=`transition`,fe=`note`,pe=`${B} note-edge`,me=`${z}-${fe}`,he=`${z}-cluster`,ge=`${z}-cluster-alt`,V=`parent`,H=`note`,_e=`state`,U=`----`,ve=`${U}${H}`,ye=`${U}${V}`,W=new Map,G=0,be=0,K=new Map,xe=t((e,t,n,r)=>{if(e===R&&n?.id!==void 0&&K.has(n.id)){let e=K.get(n.id);return K.set(t,e),e}let i=be++,a=r?void 0:i;return K.set(t,a),a},`colorSlotFor`);function q(e=``,t=0,n=``,r=U){return`${_e}-${e}${n!==null&&n.length>0?`${r}${n}`:``}-${t}`}t(q,`stateDomId`);var Se=t((e,t,r,i,a,o,s,l)=>{n.trace(`items`,t),t.forEach(t=>{switch(t.stmt){case k:X(e,t,r,i,a,o,s,l);break;case F:X(e,t,r,i,a,o,s,l);break;case j:{X(e,t.state1,r,i,a,o,s,l),X(e,t.state2,r,i,a,o,s,l);let n=s===`neo`,u={id:`edge`+G,start:t.state1.id,end:t.state2.id,arrowhead:`normal`,arrowTypeEnd:n?`arrow_barb_neo`:`arrow_barb`,style:te,labelStyle:``,label:c.sanitizeText(t.description??``,d()),arrowheadStyle:ne,labelpos:re,labelType:ie,thickness:ae,classes:B,look:s};a.push(u),G++}}})},`setupDoc`),Ce=t((e,t=D)=>{let n=t;if(e.doc)for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`);function J(e,t,n){if(!t.id||t.id===``||t.id===``)return;t.cssClasses&&(Array.isArray(t.cssCompiledStyles)||(t.cssCompiledStyles=[]),t.cssClasses.split(` `).forEach(e=>{let r=n.get(e);r&&(t.cssCompiledStyles=[...t.cssCompiledStyles??[],...r.styles])}));let r=e.find(e=>e.id===t.id);r?Object.assign(r,t):e.push(t)}t(J,`insertOrUpdateNode`);function we(e){return e?.classes?.join(` `)??``}t(we,`getClassesFromDbInfo`);function Y(e){return e?.styles??[]}t(Y,`getStylesFromDbInfo`);var X=t((e,t,r,i,a,o,s,l)=>{let u=t.id,f=r.get(u),p=we(f),m=Y(f),h=d(),g=p.trim()!==``||m.length>0;if(n.info(`dataFetcher parsedItem`,t,f,m),u!==`root`){let r=I;t.start===!0?r=oe:t.start===!1&&(r=se),t.type!==F&&(r=t.type),W.get(u)||W.set(u,{id:u,shape:r,description:c.sanitizeText(u,h),cssClasses:`${p} ${de}`,cssStyles:m});let d=W.get(u);t.description&&(Array.isArray(d.description)?(d.shape=L,d.description.push(t.description)):d.description?.length&&d.description.length>0?(d.shape=L,d.description=d.description===u?[t.description]:[d.description,t.description]):(d.shape=I,d.description=t.description),d.description=c.sanitizeTextOrArray(d.description,h)),d.description?.length===1&&d.shape===L&&(d.shape=d.type===`group`?ce:I),!d.type&&t.doc&&(n.info(`Setting cluster for XCX`,u,Ce(t)),d.type=`group`,d.isGroup=!0,d.dir=Ce(t),d.shape=t.type===ee?R:ce,d.colorIndex=xe(d.shape,u,e,g),d.cssClasses=`${d.cssClasses} ${he} ${o?ge:``}`);let f={labelStyle:``,shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:u,dir:d.dir,domId:q(u,G),type:d.type,isGroup:d.type===`group`,colorIndex:d.colorIndex,padding:8,rx:10,ry:10,look:s,labelType:`markdown`};if(f.shape===R&&(f.label=``),e&&e.id!==`root`&&(n.trace(`Setting node `,u,` to be child of its parent `,e.id),f.parentId=e.id),f.centerLabel=!0,t.note){let e={labelStyle:``,shape:le,label:t.note.text,labelType:`markdown`,cssClasses:me,cssStyles:[],cssCompiledStyles:[],id:u+ve+`-`+G,domId:q(u,G,H),type:`node`,isGroup:!1,padding:h.flowchart?.padding,look:s,position:t.note.position},n=u+ye,r={labelStyle:``,shape:ue,label:t.note.text,cssClasses:d.cssClasses,cssStyles:[],id:u+ye,domId:q(u,G,V),type:`group`,isGroup:!0,padding:16,look:s,position:t.note.position};G++,r.id=n,e.parentId=n,J(i,r,l),J(i,e,l),J(i,f,l);let o=u,c=e.id;t.note.position===`left of`&&(o=e.id,c=u),a.push({id:o+`-`+c,start:o,end:c,arrowhead:`none`,arrowTypeEnd:``,style:te,labelStyle:``,classes:pe,pattern:`dashed`,arrowheadStyle:ne,labelpos:re,labelType:ie,thickness:ae,look:s})}else J(i,f,l)}t.doc&&(n.trace(`Adding nodes children `),Se(t,t.doc,r,i,a,!o,s,l))},`dataFetcher`),Te=t(()=>{W.clear(),G=0,be=0,K.clear()},`reset`),Ee=t((e,t=D)=>{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`),De={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing state diagram (v2)`,t);let{securityLevel:a,state:o,layout:s}=d();i.db.extract(i.db.getRootDocV2());let c=i.db.getData(),l=S(t,a);c.type=i.type,c.layoutAlgorithm=b(s),c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=d().look===`neo`?[`barbNeo`]:[`barb`],c.diagramId=t,await y(c,l);try{(typeof i.db.getLinks==`function`?i.db.getLinks():new Map).forEach((e,t)=>{let r=typeof t==`string`?t:typeof t?.id==`string`?t.id:``,i=c.nodes.find(e=>e.id===r);if(!r){n.warn(`⚠️ Invalid or missing stateId from key:`,JSON.stringify(t));return}let a=l.node()?.querySelectorAll(`g.node, g.rough-node`),o;if(a?.forEach(e=>{let t=e.textContent?.trim();(e.id===i?.domId||t===r)&&(o=e)}),!o){n.warn(`⚠️ Could not find node matching text:`,r);return}let s=o.parentNode;if(!s){n.warn(`⚠️ Node has no parent, cannot wrap:`,r);return}let u=document.createElementNS(`http://www.w3.org/2000/svg`,`a`),d=e.url.replace(/^"+|"+$/g,``);if(u.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,d),u.setAttribute(`target`,`_blank`),e.tooltip){let t=e.tooltip.replace(/^"+|"+$/g,``);u.setAttribute(`title`,t),o.setAttribute(`title`,t)}s.replaceChild(u,o),u.appendChild(o),n.info(`🔗 Wrapped node in
tag for:`,r,e.url)})}catch(e){n.error(`❌ Error injecting clickable links:`,e)}p.insertTitle(l,`statediagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),C(l,8,z,o?.useMaxWidth??!0)},`draw`),getDir:Ee},Z={START_NODE:`[*]`,START_TYPE:`start`,END_NODE:`[*]`,END_TYPE:`end`,COLOR_KEYWORD:`color`,FILL_KEYWORD:`fill`,BG_FILL:`bgFill`,STYLECLASS_SEP:`,`},Oe=t(()=>new Map,`newClassesList`),Q=t(()=>({relations:[],states:new Map,documents:{}}),`newDoc`),$=t(e=>JSON.parse(JSON.stringify(e)),`clone`),ke=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Oe(),this.documents={root:Q()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=f,this.setAccTitle=a,this.getAccDescription=l,this.setAccDescription=i,this.setDiagramTitle=s,this.getDiagramTitle=u,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{t(this,`StateDB`)}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(e){this.clear(!0);for(let t of Array.isArray(e)?e:e.doc)switch(t.stmt){case k:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note);break;case j:this.addRelation(t.state1,t.state2,t.description);break;case M:this.addStyleClass(t.id.trim(),t.classes);break;case N:this.handleStyleDef(t);break;case P:this.setCssClass(t.id.trim(),t.styleClass);break;case`click`:this.addLink(t.id,t.url,t.tooltip)}let t=this.getStates(),n=d();Te(),X(void 0,this.getRootDocV2(),t,this.nodes,this.edges,!0,n.look,this.classes);for(let e of this.nodes)if(Array.isArray(e.label)){if(e.description=e.label.slice(1),e.isGroup&&e.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${e.id}]`);e.label=e.label[0]}}handleStyleDef(e){let t=e.id.trim().split(`,`),n=e.styleClass.split(`,`);for(let e of t){let t=this.getState(e);if(!t){let n=e.trim();this.addState(n),t=this.getState(n)}t&&(t.styles=n.map(e=>e.replace(/;/g,``)?.trim()))}}setRootDoc(e){n.info(`Setting root doc`,e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,t,n){if(t.stmt===j){this.docTranslator(e,t.state1,!0),this.docTranslator(e,t.state2,!1);return}if(t.stmt===k&&(t.id===Z.START_NODE?(t.id=e.id+(n?`_start`:`_end`),t.start=n):t.id=t.id.trim()),t.stmt!==A&&t.stmt!==k||!t.doc)return;let r=[],i=[];for(let e of t.doc)if(e.type===ee){let t=$(e);t.doc=$(i),r.push(t),i=[]}else i.push(e);if(r.length>0&&i.length>0){let e={stmt:k,id:m(),type:`divider`,doc:$(i)};r.push($(e)),t.doc=r}t.doc.forEach(e=>this.docTranslator(t,e,!0))}getRootDocV2(){return this.docTranslator({id:A,stmt:A},{id:A,stmt:A,doc:this.rootDoc},!0),{id:A,doc:this.rootDoc}}addState(e,t=F,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0){let u=e?.trim();if(!this.currentDocument.states.has(u))n.info(`Adding state `,u,i),this.currentDocument.states.set(u,{stmt:k,id:u,descriptions:[],type:t,doc:r,note:a,classes:[],styles:[],textStyles:[]});else{let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.doc||=r,e.type||=t}if(i&&(n.info(`Setting state description`,u,i),(Array.isArray(i)?i:[i]).forEach(e=>this.addDescription(u,e.trim()))),a){let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.note=a,e.note.text=c.sanitizeText(e.note.text,d())}o&&(n.info(`Setting state classes`,u,o),(Array.isArray(o)?o:[o]).forEach(e=>this.setCssClass(u,e.trim()))),s&&(n.info(`Setting state styles`,u,s),(Array.isArray(s)?s:[s]).forEach(e=>this.setStyle(u,e.trim()))),l&&(n.info(`Setting state styles`,u,s),(Array.isArray(l)?l:[l]).forEach(e=>this.setTextStyle(u,e.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Q()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Oe(),e||(this.links=new Map,o())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){n.info(`Documents = `,this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,t,r){this.links.set(e,{url:t,tooltip:r}),n.warn(`Adding link`,e,t,r)}getLinks(){return this.links}startIdIfNeeded(e=``){return e===Z.START_NODE?(this.startEndCount++,`${Z.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e=``,t=F){return e===Z.START_NODE?Z.START_TYPE:t}endIdIfNeeded(e=``){return e===Z.END_NODE?(this.startEndCount++,`${Z.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e=``,t=F){return e===Z.END_NODE?Z.END_TYPE:t}addRelationObjs(e,t,n=``){let r=this.startIdIfNeeded(e.id.trim()),i=this.startTypeIfNeeded(e.id.trim(),e.type),a=this.startIdIfNeeded(t.id.trim()),o=this.startTypeIfNeeded(t.id.trim(),t.type);this.addState(r,i,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(a,o,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:c.sanitizeText(n,d())})}addRelation(e,t,n){if(typeof e==`object`&&typeof t==`object`)this.addRelationObjs(e,t,n);else if(typeof e==`string`&&typeof t==`string`){let r=this.startIdIfNeeded(e.trim()),i=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(t.trim()),o=this.endTypeIfNeeded(t);this.addState(r,i),this.addState(a,o),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:n?c.sanitizeText(n,d()):void 0})}}addDescription(e,t){let n=this.currentDocument.states.get(e),r=t.startsWith(`:`)?t.replace(`:`,``).trim():t;n?.descriptions?.push(c.sanitizeText(r,d()))}cleanupLabel(e){return e.startsWith(`:`)?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,t=``){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});let n=this.classes.get(e);t&&n&&t.split(Z.STYLECLASS_SEP).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(Z.COLOR_KEYWORD).exec(e)){let e=t.replace(Z.FILL_KEYWORD,Z.BG_FILL).replace(Z.COLOR_KEYWORD,Z.FILL_KEYWORD);n.textStyles.push(e)}n.styles.push(t)})}getClasses(){return this.classes}setupToolTips(t){let n=x();r(t).select(`svg`).selectAll(`g.node, g.rough-node`).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(a===null)return;let o=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),n.html(e.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=this.getState(e);if(!n){let t=e.trim();this.addState(t),n=this.getState(t)}n?.classes?.push(t)})}setStyle(e,t){this.getState(e)?.styles?.push(t)}setTextStyle(e,t){this.getState(e)?.textStyles?.push(t)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===O)}getDirection(){return this.getDirectionStatement()?.value??E}setDirection(e){let t=this.getDirectionStatement();t?t.value=e:this.rootDoc.unshift({stmt:O,value:e})}trimColon(e){return e.startsWith(`:`)?e.slice(1).trim():e.trim()}getData(){let e=d();for(let t of this.nodes)t.wrappingWidth??=e.state?.wrappingWidth,t.isGroup||(t.minWidth??=e.state?.minNodeWidth);return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Ee(this.getRootDocV2())}}getConfig(){return d().state}},Ae=t(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!g(t,r))return``;let i=_(e.look),a=v(n),o=``;for(let e=0;e0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:t(function(e){this.begin(e)},`pushState`),stateStackSize:t(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:t(function(e,n,r,i){function a(){let t=n.yytext.indexOf(`%%`);if(t===0)return!1;if(t>0){let r=n.yytext.slice(0,t),i=n.yytext.slice(t);i&&e.lexer.unput(i),n.yytext=r}return!0}switch(t(a,`processId`),r){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:return 5;case 9:break;case 10:break;case 11:break;case 12:break;case 13:return this.pushState(`SCALE`),17;case 14:return 18;case 15:this.popState();break;case 16:return this.begin(`acc_title`),33;case 17:return this.popState(),`acc_title_value`;case 18:return this.begin(`acc_descr`),35;case 19:return this.popState(),`acc_descr_value`;case 20:this.begin(`acc_descr_multiline`);break;case 21:this.popState();break;case 22:return`acc_descr_multiline_value`;case 23:return this.pushState(`CLASSDEF`),41;case 24:return this.popState(),this.pushState(`CLASSDEFID`),`DEFAULT_CLASSDEF_ID`;case 25:return this.popState(),this.pushState(`CLASSDEFID`),42;case 26:return this.popState(),43;case 27:return this.pushState(`CLASS`),48;case 28:return this.popState(),this.pushState(`CLASS_STYLE`),49;case 29:return this.popState(),50;case 30:return this.pushState(`STYLE`),45;case 31:return this.popState(),this.pushState(`STYLEDEF_STYLES`),46;case 32:return this.popState(),47;case 33:return this.pushState(`SCALE`),17;case 34:return 18;case 35:this.popState();break;case 36:this.pushState(`STATE`);break;case 37:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 39:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 40:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),25;case 41:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),26;case 42:return this.popState(),n.yytext=n.yytext.slice(0,-10).trim(),27;case 43:return 51;case 44:return 52;case 45:return 53;case 46:return 54;case 47:this.pushState(`STATE_STRING`);break;case 48:return this.pushState(`STATE_ID`),`AS`;case 49:return a()?(this.popState(),`ID`):void 0;case 50:this.popState();break;case 51:return`STATE_DESCR`;case 52:throw Error(`Error: State name must be a single word. Found: "`+n.yytext.trim()+`"`);case 53:return 19;case 54:this.popState();break;case 55:return this.popState(),this.pushState(`struct`),20;case 56:return this.popState(),21;case 57:break;case 58:return this.begin(`NOTE`),29;case 59:return this.popState(),this.pushState(`NOTE_ID`),59;case 60:return this.popState(),this.pushState(`NOTE_ID`),60;case 61:this.popState(),this.pushState(`FLOATING_NOTE`);break;case 62:return this.popState(),this.pushState(`FLOATING_NOTE_ID`),`AS`;case 63:break;case 64:return`NOTE_TEXT`;case 65:return a()?(this.popState(),`ID`):void 0;case 66:return a()?(this.popState(),this.pushState(`NOTE_TEXT`),24):void 0;case 67:return this.popState(),n.yytext=n.yytext.substr(2).trim(),31;case 68:return this.popState(),n.yytext=n.yytext.slice(0,-8).trim(),31;case 69:return 6;case 70:return 6;case 71:return 16;case 72:return 57;case 73:return a()?24:void 0;case 74:return n.yytext=n.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 78:return 5;case 79:return`INVALID`}},`anonymous`),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}})();function P(){this.yy={}}return t(P,`Parser`),P.prototype=N,N.Parser=P,new P})();w.parser=w;var T=w,E=`TB`,D=`TB`,O=`dir`,k=`state`,A=`root`,j=`relation`,M=`classDef`,N=`style`,P=`applyClass`,F=`default`,ee=`divider`,te=`fill:none`,ne=`fill: #333`,re=`c`,ie=`markdown`,ae=`normal`,I=`rect`,L=`rectWithTitle`,oe=`stateStart`,se=`stateEnd`,R=`divider`,ce=`roundedWithTitle`,le=`note`,ue=`noteGroup`,z=`statediagram`,de=`${z}-state`,B=`transition`,fe=`note`,pe=`${B} note-edge`,me=`${z}-${fe}`,he=`${z}-cluster`,ge=`${z}-cluster-alt`,V=`parent`,H=`note`,_e=`state`,U=`----`,ve=`${U}${H}`,ye=`${U}${V}`,W=new Map,G=0,be=0,K=new Map,xe=t((e,t,n,r)=>{if(e===R&&n?.id!==void 0&&K.has(n.id)){let e=K.get(n.id);return K.set(t,e),e}let i=be++,a=r?void 0:i;return K.set(t,a),a},`colorSlotFor`);function q(e=``,t=0,n=``,r=U){return`${_e}-${e}${n!==null&&n.length>0?`${r}${n}`:``}-${t}`}t(q,`stateDomId`);var Se=t((e,t,r,i,a,o,s,l)=>{n.trace(`items`,t),t.forEach(t=>{switch(t.stmt){case k:X(e,t,r,i,a,o,s,l);break;case F:X(e,t,r,i,a,o,s,l);break;case j:{X(e,t.state1,r,i,a,o,s,l),X(e,t.state2,r,i,a,o,s,l);let n=s===`neo`,u={id:`edge`+G,start:t.state1.id,end:t.state2.id,arrowhead:`normal`,arrowTypeEnd:n?`arrow_barb_neo`:`arrow_barb`,style:te,labelStyle:``,label:c.sanitizeText(t.description??``,d()),arrowheadStyle:ne,labelpos:re,labelType:ie,thickness:ae,classes:B,look:s};a.push(u),G++}}})},`setupDoc`),Ce=t((e,t=D)=>{let n=t;if(e.doc)for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`);function J(e,t,n){if(!t.id||t.id===``||t.id===``)return;t.cssClasses&&(Array.isArray(t.cssCompiledStyles)||(t.cssCompiledStyles=[]),t.cssClasses.split(` `).forEach(e=>{let r=n.get(e);r&&(t.cssCompiledStyles=[...t.cssCompiledStyles??[],...r.styles])}));let r=e.find(e=>e.id===t.id);r?Object.assign(r,t):e.push(t)}t(J,`insertOrUpdateNode`);function we(e){return e?.classes?.join(` `)??``}t(we,`getClassesFromDbInfo`);function Y(e){return e?.styles??[]}t(Y,`getStylesFromDbInfo`);var X=t((e,t,r,i,a,o,s,l)=>{let u=t.id,f=r.get(u),p=we(f),m=Y(f),h=d(),g=p.trim()!==``||m.length>0;if(n.info(`dataFetcher parsedItem`,t,f,m),u!==`root`){let r=I;t.start===!0?r=oe:t.start===!1&&(r=se),t.type!==F&&(r=t.type),W.get(u)||W.set(u,{id:u,shape:r,description:c.sanitizeText(u,h),cssClasses:`${p} ${de}`,cssStyles:m});let d=W.get(u);t.description&&(Array.isArray(d.description)?(d.shape=L,d.description.push(t.description)):d.description?.length&&d.description.length>0?(d.shape=L,d.description=d.description===u?[t.description]:[d.description,t.description]):(d.shape=I,d.description=t.description),d.description=c.sanitizeTextOrArray(d.description,h)),d.description?.length===1&&d.shape===L&&(d.shape=d.type===`group`?ce:I),!d.type&&t.doc&&(n.info(`Setting cluster for XCX`,u,Ce(t)),d.type=`group`,d.isGroup=!0,d.dir=Ce(t),d.shape=t.type===ee?R:ce,d.colorIndex=xe(d.shape,u,e,g),d.cssClasses=`${d.cssClasses} ${he} ${o?ge:``}`);let f={labelStyle:``,shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:u,dir:d.dir,domId:q(u,G),type:d.type,isGroup:d.type===`group`,colorIndex:d.colorIndex,padding:8,rx:10,ry:10,look:s,labelType:`markdown`};if(f.shape===R&&(f.label=``),e&&e.id!==`root`&&(n.trace(`Setting node `,u,` to be child of its parent `,e.id),f.parentId=e.id),f.centerLabel=!0,t.note){let e={labelStyle:``,shape:le,label:t.note.text,labelType:`markdown`,cssClasses:me,cssStyles:[],cssCompiledStyles:[],id:u+ve+`-`+G,domId:q(u,G,H),type:`node`,isGroup:!1,padding:h.flowchart?.padding,look:s,position:t.note.position},n=u+ye,r={labelStyle:``,shape:ue,label:t.note.text,cssClasses:d.cssClasses,cssStyles:[],id:u+ye,domId:q(u,G,V),type:`group`,isGroup:!0,padding:16,look:s,position:t.note.position};G++,r.id=n,e.parentId=n,J(i,r,l),J(i,e,l),J(i,f,l);let o=u,c=e.id;t.note.position===`left of`&&(o=e.id,c=u),a.push({id:o+`-`+c,start:o,end:c,arrowhead:`none`,arrowTypeEnd:``,style:te,labelStyle:``,classes:pe,pattern:`dashed`,arrowheadStyle:ne,labelpos:re,labelType:ie,thickness:ae,look:s})}else J(i,f,l)}t.doc&&(n.trace(`Adding nodes children `),Se(t,t.doc,r,i,a,!o,s,l))},`dataFetcher`),Te=t(()=>{W.clear(),G=0,be=0,K.clear()},`reset`),Ee=t((e,t=D)=>{if(!e.doc)return t;let n=t;for(let t of e.doc)t.stmt===`dir`&&(n=t.value);return n},`getDir`),De={getClasses:t(function(e,t){return t.db.getClasses()},`getClasses`),draw:t(async function(e,t,r,i){n.info(`REF0:`),n.info(`Drawing state diagram (v2)`,t);let{securityLevel:a,state:o,layout:s}=d();i.db.extract(i.db.getRootDocV2());let c=i.db.getData(),l=b(t,a);c.type=i.type,c.layoutAlgorithm=C(s),c.nodeSpacing=o?.nodeSpacing||50,c.rankSpacing=o?.rankSpacing||50,c.markers=d().look===`neo`?[`barbNeo`]:[`barb`],c.diagramId=t,await S(c,l);try{(typeof i.db.getLinks==`function`?i.db.getLinks():new Map).forEach((e,t)=>{let r=typeof t==`string`?t:typeof t?.id==`string`?t.id:``,i=c.nodes.find(e=>e.id===r);if(!r){n.warn(`⚠️ Invalid or missing stateId from key:`,JSON.stringify(t));return}let a=l.node()?.querySelectorAll(`g.node, g.rough-node`),o;if(a?.forEach(e=>{let t=e.textContent?.trim();(e.id===i?.domId||t===r)&&(o=e)}),!o){n.warn(`⚠️ Could not find node matching text:`,r);return}let s=o.parentNode;if(!s){n.warn(`⚠️ Node has no parent, cannot wrap:`,r);return}let u=document.createElementNS(`http://www.w3.org/2000/svg`,`a`),d=e.url.replace(/^"+|"+$/g,``);if(u.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,d),u.setAttribute(`target`,`_blank`),e.tooltip){let t=e.tooltip.replace(/^"+|"+$/g,``);u.setAttribute(`title`,t),o.setAttribute(`title`,t)}s.replaceChild(u,o),u.appendChild(o),n.info(`🔗 Wrapped node in tag for:`,r,e.url)})}catch(e){n.error(`❌ Error injecting clickable links:`,e)}p.insertTitle(l,`statediagramTitleText`,o?.titleTopMargin??25,i.db.getDiagramTitle()),x(l,8,z,o?.useMaxWidth??!0)},`draw`),getDir:Ee},Z={START_NODE:`[*]`,START_TYPE:`start`,END_NODE:`[*]`,END_TYPE:`end`,COLOR_KEYWORD:`color`,FILL_KEYWORD:`fill`,BG_FILL:`bgFill`,STYLECLASS_SEP:`,`},Oe=t(()=>new Map,`newClassesList`),Q=t(()=>({relations:[],states:new Map,documents:{}}),`newDoc`),$=t(e=>JSON.parse(JSON.stringify(e)),`clone`),ke=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Oe(),this.documents={root:Q()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=f,this.setAccTitle=a,this.getAccDescription=l,this.setAccDescription=i,this.setDiagramTitle=s,this.getDiagramTitle=u,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{t(this,`StateDB`)}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(e){this.clear(!0);for(let t of Array.isArray(e)?e:e.doc)switch(t.stmt){case k:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note);break;case j:this.addRelation(t.state1,t.state2,t.description);break;case M:this.addStyleClass(t.id.trim(),t.classes);break;case N:this.handleStyleDef(t);break;case P:this.setCssClass(t.id.trim(),t.styleClass);break;case`click`:this.addLink(t.id,t.url,t.tooltip)}let t=this.getStates(),n=d();Te(),X(void 0,this.getRootDocV2(),t,this.nodes,this.edges,!0,n.look,this.classes);for(let e of this.nodes)if(Array.isArray(e.label)){if(e.description=e.label.slice(1),e.isGroup&&e.description.length>0)throw Error(`Group nodes can only have label. Remove the additional description for node [${e.id}]`);e.label=e.label[0]}}handleStyleDef(e){let t=e.id.trim().split(`,`),n=e.styleClass.split(`,`);for(let e of t){let t=this.getState(e);if(!t){let n=e.trim();this.addState(n),t=this.getState(n)}t&&(t.styles=n.map(e=>e.replace(/;/g,``)?.trim()))}}setRootDoc(e){n.info(`Setting root doc`,e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,t,n){if(t.stmt===j){this.docTranslator(e,t.state1,!0),this.docTranslator(e,t.state2,!1);return}if(t.stmt===k&&(t.id===Z.START_NODE?(t.id=e.id+(n?`_start`:`_end`),t.start=n):t.id=t.id.trim()),t.stmt!==A&&t.stmt!==k||!t.doc)return;let r=[],i=[];for(let e of t.doc)if(e.type===ee){let t=$(e);t.doc=$(i),r.push(t),i=[]}else i.push(e);if(r.length>0&&i.length>0){let e={stmt:k,id:m(),type:`divider`,doc:$(i)};r.push($(e)),t.doc=r}t.doc.forEach(e=>this.docTranslator(t,e,!0))}getRootDocV2(){return this.docTranslator({id:A,stmt:A},{id:A,stmt:A,doc:this.rootDoc},!0),{id:A,doc:this.rootDoc}}addState(e,t=F,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,l=void 0){let u=e?.trim();if(!this.currentDocument.states.has(u))n.info(`Adding state `,u,i),this.currentDocument.states.set(u,{stmt:k,id:u,descriptions:[],type:t,doc:r,note:a,classes:[],styles:[],textStyles:[]});else{let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.doc||=r,e.type||=t}if(i&&(n.info(`Setting state description`,u,i),(Array.isArray(i)?i:[i]).forEach(e=>this.addDescription(u,e.trim()))),a){let e=this.currentDocument.states.get(u);if(!e)throw Error(`State not found: ${u}`);e.note=a,e.note.text=c.sanitizeText(e.note.text,d())}o&&(n.info(`Setting state classes`,u,o),(Array.isArray(o)?o:[o]).forEach(e=>this.setCssClass(u,e.trim()))),s&&(n.info(`Setting state styles`,u,s),(Array.isArray(s)?s:[s]).forEach(e=>this.setStyle(u,e.trim()))),l&&(n.info(`Setting state styles`,u,s),(Array.isArray(l)?l:[l]).forEach(e=>this.setTextStyle(u,e.trim())))}clear(e){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:Q()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Oe(),e||(this.links=new Map,o())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){n.info(`Documents = `,this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,t,r){this.links.set(e,{url:t,tooltip:r}),n.warn(`Adding link`,e,t,r)}getLinks(){return this.links}startIdIfNeeded(e=``){return e===Z.START_NODE?(this.startEndCount++,`${Z.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e=``,t=F){return e===Z.START_NODE?Z.START_TYPE:t}endIdIfNeeded(e=``){return e===Z.END_NODE?(this.startEndCount++,`${Z.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e=``,t=F){return e===Z.END_NODE?Z.END_TYPE:t}addRelationObjs(e,t,n=``){let r=this.startIdIfNeeded(e.id.trim()),i=this.startTypeIfNeeded(e.id.trim(),e.type),a=this.startIdIfNeeded(t.id.trim()),o=this.startTypeIfNeeded(t.id.trim(),t.type);this.addState(r,i,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(a,o,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:c.sanitizeText(n,d())})}addRelation(e,t,n){if(typeof e==`object`&&typeof t==`object`)this.addRelationObjs(e,t,n);else if(typeof e==`string`&&typeof t==`string`){let r=this.startIdIfNeeded(e.trim()),i=this.startTypeIfNeeded(e),a=this.endIdIfNeeded(t.trim()),o=this.endTypeIfNeeded(t);this.addState(r,i),this.addState(a,o),this.currentDocument.relations.push({id1:r,id2:a,relationTitle:n?c.sanitizeText(n,d()):void 0})}}addDescription(e,t){let n=this.currentDocument.states.get(e),r=t.startsWith(`:`)?t.replace(`:`,``).trim():t;n?.descriptions?.push(c.sanitizeText(r,d()))}cleanupLabel(e){return e.startsWith(`:`)?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,t=``){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});let n=this.classes.get(e);t&&n&&t.split(Z.STYLECLASS_SEP).forEach(e=>{let t=e.replace(/([^;]*);/,`$1`).trim();if(RegExp(Z.COLOR_KEYWORD).exec(e)){let e=t.replace(Z.FILL_KEYWORD,Z.BG_FILL).replace(Z.COLOR_KEYWORD,Z.FILL_KEYWORD);n.textStyles.push(e)}n.styles.push(t)})}getClasses(){return this.classes}setupToolTips(t){let n=y();r(t).select(`svg`).selectAll(`g.node, g.rough-node`).on(`mouseover`,t=>{let i=r(t.currentTarget),a=i.attr(`title`);if(a===null)return;let o=t.currentTarget?.getBoundingClientRect();n.transition().duration(200).style(`opacity`,`.9`),n.style(`left`,window.scrollX+o.left+(o.right-o.left)/2+`px`).style(`top`,window.scrollY+o.bottom+`px`),n.html(e.sanitize(a)),i.classed(`hover`,!0)}).on(`mouseout`,e=>{n.transition().duration(500).style(`opacity`,0),r(e.currentTarget).classed(`hover`,!1)})}setCssClass(e,t){e.split(`,`).forEach(e=>{let n=this.getState(e);if(!n){let t=e.trim();this.addState(t),n=this.getState(t)}n?.classes?.push(t)})}setStyle(e,t){this.getState(e)?.styles?.push(t)}setTextStyle(e,t){this.getState(e)?.textStyles?.push(t)}bindFunctions(e){this.funs.forEach(t=>{t(e)})}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt===O)}getDirection(){return this.getDirectionStatement()?.value??E}setDirection(e){let t=this.getDirectionStatement();t?t.value=e:this.rootDoc.unshift({stmt:O,value:e})}trimColon(e){return e.startsWith(`:`)?e.slice(1).trim():e.trim()}getData(){let e=d();for(let t of this.nodes)t.wrappingWidth??=e.state?.wrappingWidth,t.isGroup||(t.minWidth??=e.state?.minNodeWidth);return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Ee(this.getRootDocV2())}}getConfig(){return d().state}},Ae=t(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!g(t,r))return``;let i=_(e.look),a=v(n),o=``;for(let e=0;eArray.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));r(t.groups.edgePaths,a,{enabled:!0,jumpRadius:6,jumpStyle:i})}e(i,`applySwimlaneLineJumps`);var a=`__swimlane_default__`,o=21,s=20;function c(e){return Math.max(e.padding??s,s)}e(c,`topLaneHorizontalPadding`);function l(e){let{x:t,y:n,width:r,height:i}=e,a=e.swimlaneContentTop;if(typeof t!=`number`||typeof n!=`number`||typeof r!=`number`||typeof i!=`number`||typeof a!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a)||r<=0||i<=0){delete e.groupTitleRect;return}let s=n-i/2,c=Math.min(a,n+i/2),l=s+Math.min(o,Math.max(0,c-s));if(l<=s){delete e.groupTitleRect;return}e.groupTitleRect={left:t-r/2,right:t+r/2,top:s,bottom:l}}e(l,`assignTopLaneTitleRect`);function u(e){let t=e.direction,n=e.nodes??=[];for(let n of e.nodes??[])n.isGroup&&!n.parentId&&(n.shape=`swimlane`,t&&(n.direction=t));let r=n.filter(e=>!e.isGroup&&!e.parentId);if(r.length===0)return;let i=n.find(e=>e.id===a);i?i.isGroup&&(i.shape=`swimlane`,t&&(i.direction=t)):(i={id:a,label:``,isGroup:!0,shape:`swimlane`,padding:20,look:e.config?.look,colorIndex:n.reduce((e,t)=>Math.max(e,t.colorIndex??-1),-1)+1,...t?{direction:t}:{}},n.push(i));for(let e of r)e.parentId=a}e(u,`prepareLayoutForSwimlanes`);function d(e){let t=new Map;for(let n of e.nodes??[])t.set(n.id,n);let n=[];for(let t of e.edges??[]){let e=typeof t.start==`string`?t.start:void 0,r=typeof t.end==`string`?t.end:void 0;!e||!r||t.labelNodeId||n.push({id:t.id,src:e,dst:r,ref:t})}let r=e.nodes??[],i=r.filter(e=>e.isGroup),a=r.filter(e=>!e.isGroup);return{nodes:[...[...i].reverse(),...a].map(e=>e.id),edges:n,layout:e,nodeById:t}}e(d,`toGraphView`);function f(e,t,n,r){let{layout:i}=e,a=e.nodeById,o=r?.layerGap??100,s=r?.nodeGap??40,u=0;for(let e of t.layers){let t=0;for(let r of e){let e=a.get(r);if(!e){t++;continue}e.layer=u,e.order=t;let i=n.x[r]??t*s,c=n.y[r]??u*o;e.x=i,e.y=c,t++}u++}let d=i.nodes??[],f=new Map,p=[];for(let e of d){if(!e?.isGroup)continue;e.parentId||p.push(e);let t=d.filter(t=>t.parentId===e.id),r=1/0,i=-1/0,a=1/0,o=-1/0;for(let e of t){let t=e.x??n.x[e.id],s=e.y??n.y[e.id],c=e.width??0,l=e.height??0;t!=null&&s!=null&&(r=Math.min(r,t-c/2),i=Math.max(i,t+c/2),a=Math.min(a,s-l/2),o=Math.max(o,s+l/2))}if(r===1/0||a===1/0)e.x=e.x??0,e.y=e.y??0,e.width=e.width??0,e.height=e.height??0;else{let t=e.padding??20,n=e.parentId?t:2*c(e),s=t,l=Math.max(0,i-r)+n,u=Math.max(0,o-a)+s,d=(r+i)/2,p=(a+o)/2;e.x=d,e.y=p,e.width=l,e.height=u,f.set(e.id,{minX:r,maxX:i,minY:a,maxY:o})}}if(p.length>0&&f.size>0){let e=1/0,t=-1/0,n=0;for(let r of p){let i=r.padding??20;i>n&&(n=i);let a=f.get(r.id);a&&(e=Math.min(e,a.minY),t=Math.max(t,a.maxY))}if(e!==1/0&&t!==-1/0){let r=Math.max(0,t-e)+2*Math.max(n,36),i=(e+t)/2;for(let t of p)t.y=i,t.height=r,t.swimlaneContentTop=e;let a=[...p].sort((e,t)=>(e.x??0)-(t.x??0)),o=[],s=[],u=[];for(let e of a){let t=f.get(e.id);if(!t)continue;let n=Math.max(0,t.maxX-t.minX)+2*c(e),r=(t.minX+t.maxX)/2;o.push(e.id),s.push(r),u.push(n)}let d=o.length;if(d>0){let e=new Map;if(d===1)e.set(o[0],u[0]);else{let t=[];for(let e=0;e0&&i>0?{cx:t,cy:n,rect:P(t,n,r,i)}:void 0}e(g,`measuredNodeRect`);function _(e){if(e.isGroup)return;let t=g(e);if(t)return{id:String(e.id??``),cx:t.cx,cy:t.cy,rect:t.rect}}e(_,`nodeBoundsInfoFor`);function v(e,t,n=h){return Math.abs(e.x-t.x)n}e(x,`isHorizontalSegment`);function S(e,t,n=h){return y(e,t,n)&&Math.abs(e.y-t.y)>n}e(S,`isVerticalSegment`);function C(e,t,n,r){return Math.max(0,Math.min(Math.max(e,t),Math.max(n,r))-Math.max(Math.min(e,t),Math.min(n,r)))}e(C,`overlapLength`);function w(e,t,n=h){return e.horizontal&&t.horizontal&&b(e.a,t.a,n)?C(e.a.x,e.b.x,t.a.x,t.b.x):e.vertical&&t.vertical&&y(e.a,t.a,n)?C(e.a.y,e.b.y,t.a.y,t.b.y):0}e(w,`sameAxisSegmentOverlapLength`);function T(e,t=h){let n=[];for(let r=0;r0?n[n.length-1]:void 0;(!e||!v(e,r,t))&&n.push({x:r.x,y:r.y})}return n}e(D,`dedupeConsecutivePoints`);function O(e,t=h){if(!e||e.length!==4)return;let[n,r,i,a]=e;return x(n,r,t)&&S(r,i,t)&&x(i,a,t)?{kind:`HVH`,p0:n,p1:r,p2:i,p3:a}:S(n,r,t)&&x(r,i,t)&&S(i,a,t)?{kind:`VHV`,p0:n,p1:r,p2:i,p3:a}:void 0}e(O,`classifyThreeSegmentRoute`);function k(e,t,n,r=0){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return a>n.left-r&&in.top-r&&ot.left+n&&e.xt.top+n&&e.y=t.right&&e.top<=t.top&&e.bottom>=t.bottom}e(j,`rectContainsRect`);function M(e,t){return e.leftt.left&&e.topt.top}e(M,`rectsOverlap`);function N(e,t){return{left:e.left-t,right:e.right+t,top:e.top-t,bottom:e.bottom+t}}e(N,`inflateRect`);function P(e,t,n,r){return{left:e-n/2,right:e+n/2,top:t-r/2,bottom:t+r/2}}e(P,`rectFromCenterSize`);function F(e){return g(e)?.rect}e(F,`rectOfNodeBounds`);function I(e,t){switch(t){case`top`:return{x:e.cx,y:e.rect.top};case`bottom`:return{x:e.cx,y:e.rect.bottom};case`left`:return{x:e.rect.left,y:e.cy};case`right`:return{x:e.rect.right,y:e.cy}}}e(I,`portForRectSide`);function ee(e,t,n,r,i,a=h){let o=t===`left`||t===`right`,s=r===`left`||r===`right`;if(o&&s){if(t===`right`&&r===`left`&&e.xn.x){if(b(e,n,a))return[e,n];let t=(e.x+n.x)/2;return[e,{x:t,y:e.y},{x:t,y:n.y},n]}if(t===r){if(b(e,n,a))return;let r=t===`left`?Math.min(e.x,n.x)-i:Math.max(e.x,n.x)+i;return[e,{x:r,y:e.y},{x:r,y:n.y},n]}return}if(!o&&!s){if(t===r){if(y(e,n,a))return;let r=t===`top`?Math.min(e.y,n.y)-i:Math.max(e.y,n.y)+i;return[e,{x:e.x,y:r},{x:n.x,y:r},n]}if(!(t===`bottom`&&r===`top`&&e.yn.y))return;if(y(e,n,a))return[e,n];let o=(e.y+n.y)/2;return[e,{x:e.x,y:o},{x:n.x,y:o},n]}if(o&&!s){let i=t===`right`&&n.x>e.x||t===`left`&&n.xn.y;return i&&a?[e,{x:n.x,y:e.y},n]:void 0}let c=t===`bottom`&&n.y>e.y||t===`top`&&n.yn.x;return c&&l?[e,{x:e.x,y:n.y},n]:void 0}e(ee,`buildOrthogonalPortPath`);function L(e,t,n,r){return t===`left`||t===`right`?[e,{x:r,y:e.y},{x:r,y:n.y},n]:[e,{x:e.x,y:r},{x:n.x,y:r},n]}e(L,`buildSameSideTrackPath`);function R(e){let t=new Map,n=[];for(let r of e){if(r.isEdgeLabel)continue;let e=_(r);e&&(t.set(e.id,e),n.push({id:e.id,rect:e.rect}))}return{nodeInfoById:t,realNodeRects:n}}e(R,`collectRealNodeBounds`);function z(e){let t=[],n=[];for(let r of e){let e=_(r);if(!e)continue;let i={id:e.id,rect:e.rect};r.isEdgeLabel?n.push(i):t.push(i)}return{realNodeRects:t,labelNodeRects:n}}e(z,`collectNodeRectEntries`);function te(e,{includeEdgeLabels:t=!0}={}){let n=[];for(let r of e){if(r.isGroup||!t&&r.isEdgeLabel)continue;let e=r.x??0,i=r.y??0,a=r.width??0,o=r.height??0;n.push({nodeId:r.id,...P(e,i,a,o)})}return n}e(te,`collectLayoutNodeRects`);function ne(e,t,n=h){let r=e.start,i=e.end;if(!r||!i)return;let a=t.get(r),o=t.get(i);if(!(!a||!o))return{srcId:r,dstId:i,srcInfo:a,dstInfo:o,collinearX:Math.abs(a.cx-o.cx)m||f<_||f>v)return!1;let x=Math.abs(g-u.a.x)i:a&&s&&b(e,n,i)?C(e.x,t.x,n.x,r.x)>i:!1}e(ie,`sameAxisSegmentsOverlap`);function ae(e,t,n,r,{epsilon:i=h,skipDegenerateOther:a=!1}={}){for(let o of n){if(o===r||o.isLayoutOnly)continue;let n=o.points;if(!(!n||n.length<2))for(let r=0;rf+i&&mg+i&&d<_-i}e(V,`orthogonalSegmentsStrictlyCross`);function oe(e,t,n){let r=Math.min(t,n),i=Math.max(t,n);return e>r+h&&e=2?t[t.length-2]:void 0,n=e&&y(e,r)?{x:r.x,y:i.y}:{x:i.x,y:r.y};t.push(n)}t.push(i)}let n=[];for(let e of t){let t=n[n.length-1];(!t||!v(t,e))&&n.push(e)}return n}e(W,`orthogonalizePolyline`);function G(e){if(e.length<3)return e;let t=[...e];for(let e=0;e<32;e++){let e=U(t);if(t=e.points,!e.changed)break}return t}e(G,`simplifyPolyline`);var K=.001,se=.5,ce=4;function le(e,t,n){let r=e;if(r.isLayoutOnly||!r.points||r.points.length=0&&i=e.length)return e;let a=i-r;if(a<0||a>=e.length)return e;let o=ue(e[i],e[a],t);return n?[o,...e.slice(i)]:[...e.slice(0,i+1),o]}e(de,`clipEndpoint`);function q(e,t){for(let n of e){let e=le(n,t,2);if(!e)continue;let r=[...e.points];e.srcRect&&(r=de(r,e.srcRect,!0)),e.dstRect&&(r=de(r,e.dstRect,!1)),r=G(W(r)),r=xe(r,e.srcRect,e.dstRect),e.edge.points=G(W(r))}}e(q,`clipEdgeEndpointsToNodeBoundaries`);function J(e,t,n,r=!1){if(b(e,t,K)){if(t.yn.bottom+K)return t;if(r){if(e.xn.right+K)return{x:n.right,y:e.y}}return{x:Math.abs(t.x-n.left)<=Math.abs(t.x-n.right)?n.left:n.right,y:e.y}}if(y(e,t,K)){if(t.xn.right+K)return t;if(r){if(e.yn.bottom+K)return{x:e.x,y:n.bottom}}let i=Math.abs(t.y-n.top)<=Math.abs(t.y-n.bottom);return{x:e.x,y:i?n.top:n.bottom}}return t}e(J,`snapEndpointToBoundary`);function fe(e,t,n){let r=e[t];for(let i=t+n;i>=0&&ie.lo)),n=Math.min(...e.map(e=>e.hi));if(!(t>n))return{lo:t,hi:n}}e(he,`intersectRanges`);function ge(e,t){return t===`left`||t===`right`?pe(e.top,e.bottom):pe(e.left,e.right)}e(ge,`clearanceRangeForSide`);function _e(e,t,n){let r=e.y>=n.top-K&&e.y<=n.bottom+K,i=e.x>=n.left-K&&e.x<=n.right+K;if(b(e,t,K)&&r){if(Math.abs(e.x-n.left)0?he(a):void 0}e(ye,`straightClearanceRange`);function be(e,t,n,r,i){let a=ye(e,t,n,r,i);if(!a)return;let o=i?e.y:e.x,s=Math.min(a.hi,Math.max(a.lo,o));if(!(Math.abs(s-o)({...e}));for(let s=t;s>=0&&s=n.left-K&&Math.max(e.x,t.x)<=n.right+K,i=Math.min(e.y,t.y)>=n.top-K&&Math.max(e.y,t.y)<=n.bottom+K;if(Math.abs(e.y-n.top)r.bottom+K;case`left`:return b(t,n,K)&&n.xr.right+K}}e(Ee,`leavesOutward`);function De(e,t,n){if(e.length<3)return e;if(n){let n=Te(e[0],e[1],t);return n&&Ee(n,e[1],e[2],t)?e.slice(1):e}let r=e.length-1,i=Te(e[r-1],e[r],t);return i&&Ee(i,e[r-1],e[r-2],t)?e.slice(0,r):e}e(De,`collapseOwnBorderStub`);function Oe(e,t,n){let r=e;if(t){let e=fe(r,0,1);if(e){let n=J(e,r[0],t);n!==r[0]&&(r=[n,...r.slice(1)])}r=De(r,t,!0)}if(n){let e=r.length-1,t=fe(r,e,-1);if(t){let i=J(t,r[e],n,!0);i!==r[e]&&(r=[...r.slice(0,e),i])}r=De(r,n,!1)}let i=xe(r,t,n);return i!==r||r.length===2?i:(t&&(r=we(r,t,!0)),n&&(r=we(r,n,!1)),r)}e(Oe,`snapAndCollapseEndpoints`);function ke(e,t){for(let n of e){let e=le(n,t,2);if(!e)continue;let r=Oe(D(e.points,K),e.srcRect,e.dstRect);if(r.length<3){e.edge.points=r;continue}let i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];e.edge.points=i}}e(ke,`prepareEdgeEndpointsForRenderer`);function Ae(e){return new Map(e.map(e=>[e.id,e]))}e(Ae,`buildNodeMap`);function je(e,t){let n=e.parentId,r=null;for(;n;){let e=t.get(n);if(!e?.isGroup)break;r=e.id,n=e.parentId}return r}e(je,`resolveTopLevelGroupId`);function Me(e,t){let n=0,r=e.parentId;for(;r;){let e=t.get(r);if(!e?.isGroup)break;n++,r=e.parentId}return n}e(Me,`groupDepth`);function Ne(e){let t=1/0,n=-1/0,r=1/0,i=-1/0;for(let a of e){let e=a.x,o=a.y;if(typeof e!=`number`||typeof o!=`number`)continue;let s=a.width??0,c=a.height??0;t=Math.min(t,e-s/2),n=Math.max(n,e+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}return t===1/0||r===1/0?null:{minX:t,maxX:n,minY:r,maxY:i}}e(Ne,`boundsForChildren`);function Pe(e,t){let n=e.padding??20;e.x=(t.minX+t.maxX)/2,e.y=(t.minY+t.maxY)/2,e.width=Math.max(0,t.maxX-t.minX)+n,e.height=Math.max(0,t.maxY-t.minY)+n}e(Pe,`applyGroupBounds`);function Fe(e){let t=Ae(e),n=e.filter(e=>e.isGroup&&e.parentId).sort((e,n)=>Me(n,t)-Me(e,t));for(let t of n){let n=Ne(e.filter(e=>e.parentId===t.id));n&&Pe(t,n)}}e(Fe,`recomputeNestedGroupBounds`);function Ie(t,n){let r=t.nodes??[],i=t.edges??[],a=r.filter(e=>!e.isGroup),o=1/0,s=-1/0;for(let e of a){let t=e[n];typeof t==`number`&&(o=Math.min(o,t),s=Math.max(s,t))}if(!Number.isFinite(o)||!Number.isFinite(s))return!1;let c=e(e=>o+s-e,`mirror`);for(let e of r){let t=e[n];typeof t==`number`&&(e[n]=c(t));let r=e.groupTitleRect;r&&(e.groupTitleRect=n===`x`?{...r,left:c(r.right),right:c(r.left)}:{...r,top:c(r.bottom),bottom:c(r.top)})}for(let e of i)for(let t of e.points??[])t[n]=c(t[n]);return!0}e(Ie,`mirrorAxis`);function Le(e){return!(e.nodes??[]).some(e=>!e.isGroup)||Ie(e,`y`)}e(Le,`applyBtDirectionTransform`);function Re(e,t=`LR`){let n=e.nodes??[],r=e.edges??[],i=n.filter(e=>!e.isGroup),a=1/0,o=1/0;for(let e of i){let t=e.x??0,n=e.y??0;t0?Math.max(1,l/u):1;for(let e of i){let t=e.x??0,n=((e.y??0)-o)*d+36,r=t-a;e.x=n,e.y=r}for(let e of r)if(e.points)for(let t of e.points){let e=t.x,n=(t.y-o)*d+36,r=e-a;t.x=n,t.y=r}Fe(n);let f=n.filter(e=>e.isGroup&&!e.parentId);if(f.length===0)return t===`RL`&&Ie(e,`x`),!0;let p=Ae(n),m=new Map;for(let e of n){if(e.isGroup)continue;let t=je(e,p);if(!t)continue;let n=m.get(t)??[];n.push(e),m.set(t,n)}let h=0;for(let e of f){let t=e.padding??0;t>h&&(h=t)}let g=[],_=1/0,v=-1/0;for(let e of f){let t=Ne(m.get(e.id)??[]);t&&(_=Math.min(_,t.minX),v=Math.max(v,t.maxX),g.push({lane:e,contentTop:t.minY,contentBottom:t.maxY,centerY:(t.minY+t.maxY)/2}))}if(_===1/0||v===-1/0)return!0;let y=Math.max(0,v-_)+2*Math.max(h,10),b=36+y,x=(_+v)/2-y/2-36,S=x+b/2,C=Math.max(h,36);g.sort((e,t)=>e.centerY-t.centerY);for(let e=0;ed.cy?g.bottom:g.top,t=d.cx+n;if(t<=g.left+ze||t>=g.right-ze)continue;i={x:t,y:e},a={x:t,y:o.y},c={x:o.x,y:o.y}}else{let e=f.cx>d.cx?g.right:g.left,t=d.cy+n;if(t<=g.top+ze||t>=g.bottom-ze)continue;i={x:e,y:t},a={x:o.x,y:t},c={x:o.x,y:o.y}}let p=v(i,a,ze),m=v(a,c,ze);if(p&&m||!p&&B(i,a,r,[l],1)||!m&&B(a,c,r,[u],1))continue;let _=!p&&ae(i,a,e,t,{epsilon:ze,skipDegenerateOther:!0}),y=!m&&ae(a,c,e,t,{epsilon:ze,skipDegenerateOther:!0});if(!(_||y)){h=p?[a,c]:m?[i,a]:[i,a,c];break}}h&&(t.points=h)}}e(He,`portSwapToLShape`);function Ue(t,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=z(n.values());for(let o of t){if(o.isLayoutOnly)continue;let s=o.points;if(!s||s.length<4)continue;let c=D(s,r);if(c.length<4)continue;let l=c.length-1,u=c[l],d=c[l-1],f=c[l-2],p=u.x-d.x,m=u.y-d.y,h=Math.hypot(p,m);if(h>=10||h0;P={x:f.x,y:M},I={x:e?N.right:N.left,y:M}}if(B(P,I,i,E?[E]:[],-2)||B(P,I,a,[],-2))continue;if(O){let e=n.get(O),t=e?F(e):void 0;if(t&&A(P,t,2))continue}let ee=e((e,t)=>`${e.x.toFixed(3)},${e.y.toFixed(3)}|${t.x.toFixed(3)},${t.y.toFixed(3)}`,`ownSegmentKey`),L=new Set;for(let e=0;e{for(let i of t){if(i===o||i.isLayoutOnly)continue;let t=i.points;if(!(!t||t.length<2))for(let i=0;i=0){let e=c[l-3],t=[O,E].filter(e=>!!e);if(B(e,P,i,t,-2)||R(e,P))continue}let z=[...c.slice(0,l-2),P,I];o.points=z;let te=o.labelNodeId;if(te){let e=n.get(te);if(e){let t=e.width??0,n=e.height??0;if(t>0&&n>0){let i,a,o=-1;for(let e=0;e=t+2||d&&l>=n+2)&&l>o&&(o=l,i=(s.x+c.x)/2,a=(s.y+c.y)/2)}i!==void 0&&a!==void 0&&(e.x=i,e.y=a)}}}}}e(Ue,`collapseShortTerminalStub`);var Y=.001,X=8,Z=T,We=e((e,t)=>y(e,t,Y)||b(e,t,Y),`orthogonallyAligned`);function Ge(t,n){let r=e((e,t)=>{let n=e.x??0,r=e.y??0,i=t.x-n,a=t.y-r,o=(e.width??0)/2,s=(e.height??0)/2;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),{x:n+(a===0?0:s*i/a),y:r+s}):(i<0&&(o=-o),{x:n+o,y:r+(i===0?0:o*a/i)})},`rectIntersect`),i=e((e,t)=>{let i=D(e.points??[]);if(i.length<2)return;let a=t?e.start:e.end,o=a?n.get(a):void 0,s=o?F(o):void 0;if(!o||!a||!s)return;let c=t?i[0]:i[i.length-1],l=t?i[1]:i[i.length-2],u=r(o,c),d=c;if(We(l,u)&&(d=l),y(u,d,Y))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`V`,coord:u.x,min:Math.min(u.y,d.y),max:Math.max(u.y,d.y),boundary:u,railEnd:d,rect:s};if(b(u,d,Y))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`H`,coord:u.y,min:Math.min(u.x,d.x),max:Math.max(u.x,d.x),boundary:u,railEnd:d,rect:s}},`terminalLaneFor`),a=e((e,t)=>Math.max(0,Math.min(e.max,t.max)-Math.max(e.min,t.min)),`projectedOverlapLength`),o=e((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:e.orientation===`H`?(Math.abs(e.boundary.x-e.rect.left)<1||Math.abs(e.boundary.x-e.rect.right)<1)&&y(e.boundary,t.boundary,1):(Math.abs(e.boundary.y-e.rect.top)<1||Math.abs(e.boundary.y-e.rect.bottom)<1)&&b(e.boundary,t.boundary,1),`sameTerminalFace`),s=e((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:a(e,t)>=X&&Math.abs(e.coord-t.coord)<.5,`exactTerminalLaneConflict`),c=e((e,t)=>{if(e.nodeId!==t.nodeId||e.orientation!==t.orientation||e.orientation!==`H`||e.atStart===t.atStart)return!1;let n=a(e,t);if(n2*r?!1:o(e,t)&&Math.abs(e.coord-t.coord)<16},`nearTerminalLaneConflict`),l=e((t,n)=>{let r=D(t.edge.points??[]);if(r.length<2)return;let i=t.orientation===`V`?{x:t.boundary.x+n,y:t.boundary.y}:{x:t.boundary.x,y:t.boundary.y+n},a=t.orientation===`V`?{x:t.railEnd.x+n,y:t.railEnd.y}:{x:t.railEnd.x,y:t.railEnd.y+n};if(!e(()=>Math.abs(t.boundary.y-t.rect.top)<1||Math.abs(t.boundary.y-t.rect.bottom)<1?b(i,t.boundary,Y)&&i.x>=t.rect.left+1&&i.x<=t.rect.right-1:Math.abs(t.boundary.x-t.rect.left)<1||Math.abs(t.boundary.x-t.rect.right)<1?y(i,t.boundary,Y)&&i.y>=t.rect.top+1&&i.y<=t.rect.bottom-1:!1,`boundaryStaysOnSameFace`)())return;if(t.atStart){let e=r.length>1&&v(r[1],t.railEnd,Y),n=r.slice(e?2:1),o=n[0];return o&&!We(o,a)?void 0:[i,a,...n]}let o=r.length>1&&v(r[r.length-2],t.railEnd,Y),s=r.slice(0,o?-2:-1),c=s[s.length-1];if(!(c&&!We(c,a)))return[...s,a,i]},`shiftedCandidate`),u=e(e=>{let t=e.edge,r=D(t.points??[]);if(r.length!==2)return!1;let i=t.start,a=t.end,o=i?n.get(i):void 0,s=a?n.get(a):void 0;if(!o||!s)return!1;let c=o.x??0,l=o.y??0,u=s.x??0,d=s.y??0,[f,p]=r;return b(f,p,Y)&&Math.abs(l-d)<1&&Math.abs(c-u)>1||y(f,p,Y)&&Math.abs(c-u)<1&&Math.abs(l-d)>1},`laneIsStraightCollinearConnector`),d=[-7,7,-14,14,-21,21];for(let e=0;e<8;e++){let e=t.filter(e=>!e.isLayoutOnly).flatMap(e=>[i(e,!0),i(e,!1)]).filter(e=>!!e),n=!1;for(let t=0;t{let n=u(e),r=u(t);return n===r?Number(!t.atStart)-Number(!e.atStart):Number(n)-Number(r)});for(let t of p){for(let r of d){let a=l(t,r);if(!a)continue;let o=i({...t.edge,points:a},t.atStart);if(!(!o||e.some(e=>e.edge!==t.edge&&(s(o,e)||f&&c(o,e))))){t.edge.points=a,n=!0;break}}if(n)break}}if(!n)return}}e(Ge,`separateSharedRenderedTerminalLanes`);function Ke(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=e((e,n)=>{let a=e.start,o=e.end,s=Z(n);if(s.length!==n.length-1)return!1;let c=[a,o].filter(e=>!!e);for(let e of s)if(B(e.a,e.b,r,c,-2)||B(e.a,e.b,i,[],-2))return!1;for(let n of t){if(n===e||n.isLayoutOnly)continue;let t=n.points;if(!(!t||t.length<2)){for(let e of s)for(let n of Z(D(t)))if(w(e,n,.5)>=X||V(e.a,e.b,n.a,n.b,Y))return!1}}return!0},`candidateIsSafe`),o=e((e,t)=>{if(t+4>=e.length)return;let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=e[t+4],s=x(n,r)&&S(r,i)&&x(i,a)&&S(a,o)&&y(n,a,Y)&&y(n,o,Y)&&y(r,i,Y)&&(r.x-n.x)*(a.x-i.x)<0,c=S(n,r)&&x(r,i)&&S(i,a)&&x(a,o)&&b(n,a,Y)&&b(n,o,Y)&&b(r,i,Y)&&(r.y-n.y)*(a.y-i.y)<0;if(s||c)return D([...e.slice(0,t+1),o,...e.slice(t+5)]);if(t+5>=e.length)return;let l=e[t+5],u=S(n,r)&&x(r,i)&&S(i,a)&&x(a,o)&&S(o,l)&&y(n,o,Y)&&y(n,l,Y)&&y(i,a,Y)&&(i.x-r.x)*(o.x-a.x)<0,d=x(n,r)&&S(r,i)&&x(i,a)&&S(a,o)&&x(o,l)&&b(n,o,Y)&&b(n,l,Y)&&b(i,a,Y)&&(i.y-r.y)*(o.y-a.y)<0;if(!(!u&&!d))return D([...e.slice(0,t+1),l,...e.slice(t+6)])},`withoutDogleg`);for(let e=0;e<8;e++){let e=!1;for(let n of t){if(n.isLayoutOnly)continue;let t=D(n.points??[]);for(let r=0;r<=t.length-5;r++){let i=o(t,r);if(!(!i||!a(n,i))){n.points=i,e=!0;break}}if(e)break}if(!e)return}}e(Ke,`collapseRedundantRectangularDoglegs`);function qe(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t,n)=>D(e===t?n??[]:e.points??[]),`pointsFor`),s=e((e,t)=>{let n=0;for(let r=0;r{let t=Z(e);if(t.length!==3)return;let n=t[1];if(t[0].horizontal!==n.horizontal&&t[2].horizontal!==n.horizontal)return{index:n.index,horizontal:n.horizontal,vertical:n.vertical,segment:n}},`middleRail`),l=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);return r.filter(e=>{if(n.includes(e.id))return!1;let r=e.rect;return t.horizontal?C(t.a.x,t.b.x,r.left,r.right)>=X&&t.a.y>=r.top-2&&t.a.y<=r.bottom+2:C(t.a.y,t.b.y,r.top,r.bottom)>=X&&t.a.x>=r.left-2&&t.a.x<=r.right+2})},`blockingRectsFor`),u=e((e,t,n)=>{let r=e.map(e=>({...e}));if(t.horizontal)r[t.index].y=n,r[t.index+1].y=n;else if(t.vertical)r[t.index].x=n,r[t.index+1].x=n;else return;let i=G(D(r));return Z(i).length===i.length-1?i:void 0},`candidateByMovingRail`),d=e((e,t,n)=>{let c=[e.start,e.end].filter(e=>!!e),l=Z(t);if(l.length!==t.length-1)return!1;for(let e of l)if(B(e.a,e.b,r,c,-2)||B(e.a,e.b,i,[],-2))return!1;for(let t of a)if(t!==e){for(let e of l)for(let n of Z(o(t)))if(w(e,n,.5)>=X)return!1}return s(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=s(),t=!1;for(let n of a){let r=o(n),i=c(r);if(!i)continue;let a=l(n,i.segment);if(a.length===0)continue;let s=i.horizontal?[Math.min(...a.map(e=>e.rect.top))-20,Math.max(...a.map(e=>e.rect.bottom))+20]:[Math.min(...a.map(e=>e.rect.left))-20,Math.max(...a.map(e=>e.rect.right))+20];for(let a of s){let o=u(r,i.segment,a);if(!(!o||!d(n,o,e))){n.points=o,t=!0;break}}if(t)break}if(!t)return}}e(qe,`liftObstacleHuggingSameSideRails`);function Je(t,n){let r=e(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),i=e(e=>{if(!e.isGroup||e.parentId)return;let t=e.direction,n=typeof t==`string`?t.toUpperCase():``;if(n===`LR`||n===`RL`||n===`BT`)return;let i=r(e),a=e.y,o=e.height;if(!i||typeof a!=`number`||typeof o!=`number`||!Number.isFinite(a)||!Number.isFinite(o)||o<=0)return;let s=i.right-i.left,c=i.bottom-i.top;if(!(c<=0||s{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+Y||n>=t.bottom-Y?!1:C(e.a.x,e.b.x,t.left,t.right)>=X},`horizontalSegmentIntersectsTitle`),o=[...n.values()].map(i).filter(e=>!!e);if(o.length===0)return;let s=0;for(let e of t){if(e.isLayoutOnly)continue;let t=D(e.points??[]);for(let e of Z(t))for(let t of o)a(e,t.rect)&&(s=Math.max(s,t.rect.bottom-e.a.y+4))}if(!(s<=Y))for(let e of o){let t=e.node.y,n=e.node.height;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.y=t-s/2,e.node.height=n+s,e.node.groupTitleRect={...e.rect,top:e.rect.top-s,bottom:e.rect.bottom-s})}}e(Je,`liftTopLaneTitleBandsAboveRails`);function Ye(t,n){let r=e(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),i=e(e=>{if(!e.isGroup||e.parentId||e.direction!==`LR`)return;let t=r(e),n=e.x,i=e.width;if(!t||typeof n!=`number`||typeof i!=`number`||!Number.isFinite(n)||!Number.isFinite(i)||i<=0)return;let a=t.right-t.left,o=t.bottom-t.top;if(!(a<=0||o{if(!e.vertical)return!1;let n=e.a.x;return n<=t.left+Y||n>=t.right-Y?!1:C(e.a.y,e.b.y,t.top,t.bottom)>=X},`verticalSegmentIntersectsTitle`),o=e((e,t)=>{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+Y||n>=t.bottom-Y?!1:C(e.a.x,e.b.x,t.left,t.right)>=X},`horizontalSegmentIntersectsTitle`),s=[...n.values()].map(i).filter(e=>!!e);if(s.length===0)return;let c=0;for(let e of t){if(e.isLayoutOnly)continue;let t=D(e.points??[]);for(let e of Z(t))for(let t of s)if(a(e,t.rect))c=Math.max(c,t.rect.right-e.a.x+4);else if(o(e,t.rect)){let n=Math.min(e.a.x,e.b.x);c=Math.max(c,t.rect.right-n+4)}}if(!(c<=Y))for(let e of s){let t=e.node.x,n=e.node.width;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.x=t-c/2,e.node.width=n+c,e.node.groupTitleRect={...e.rect,left:e.rect.left-c,right:e.rect.right-c})}}e(Ye,`shiftLeftLaneTitleBandsLeftOfRails`);function Xe(t,n){let{realNodeRects:r}=z(n.values()),i=t.filter(e=>!e.isLayoutOnly),a=e((e,t=new Map)=>D(t.get(e)??e.points??[]),`replacementPointsFor`),o=e((e=new Map)=>{let t=0;for(let n=0;ni.reduce((t,n)=>t+E(a(n,e)),0),`totalBends`),c=e(e=>{let t=a(e);if(t.length<4)return;let n=t[t.length-2],r=t[t.length-1];if(!(!x(n,r,Y)&&!S(n,r,Y)))return{tailStart:n,terminal:r}},`terminalTailFor`),l=e((e,t)=>{let n=a(e);if(n.length<3)return;let r=n[0],i=n[1],o;if(x(r,i,Y))o={x:i.x,y:t.tailStart.y};else if(S(r,i,Y))o={x:t.tailStart.x,y:i.y};else return;let s=G(D([r,i,o,t.tailStart,t.terminal]));return Z(s).length===s.length-1?s:void 0},`candidateWithDestinationTail`),u=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Z(t))if(B(e.a,e.b,r,n,-2))return!0;return!1},`pathHasNodeHit`),d=e((e,t,n)=>{for(let r of i)if(r!==e){for(let e of Z(t))for(let t of Z(a(r,n)))if(w(e,t,.5)>=X)return!0}return!1},`pathHasSharedTrack`),f=e((e,t,n)=>!u(e,t)&&!d(e,t,n),`candidateIsSafe`),p=e(()=>{let e=new Map;for(let t of i){let r=t.end;if(!r||!n.has(r)||a(t).length<4)continue;let i=e.get(r)??[];i.push(t),e.set(r,i)}return e},`edgesByDestination`);for(let e=0;e<4;e++){let e=o();if(e===0)return;let t=s(),n,r=e,i=t;for(let t of p().values())for(let a=0;a=e||y>r||y===r&&b>=i||(n=v,r=y,i=b)}if(!n)return;for(let[e,t]of n)e.points=t}}e(Xe,`swapDestinationTerminalTailsToReduceCrossings`);function Ze(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t=new Map)=>D(t.get(e)??e.points??[]),`replacementPointsFor`),s=e((e=new Map)=>{let t=0;for(let n=0;na.reduce((t,n)=>t+E(o(n,e)),0),`totalBends`),l=e(e=>{let t=e.start,r=e.end,i=t?n.get(t):void 0,a=r?n.get(r):void 0,o=i?F(i):void 0,s=a?F(a):void 0;return o&&s?{src:o,dst:s}:void 0},`endpointRectsFor`),u=e((e,t,n)=>{if(n.index<=0||n.index+1>=t.length-1)return;let r=l(e);if(r){if(n.vertical){let i=n.a.x,a=Math.min(r.src.left,r.dst.left),o=Math.max(r.src.right,r.dst.right),s=io+Y?`right`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`vertical`,side:s,coord:i,min:Math.min(n.a.y,n.b.y),max:Math.max(n.a.y,n.b.y)}:void 0}if(n.horizontal){let i=n.a.y,a=Math.min(r.src.top,r.dst.top),o=Math.max(r.src.bottom,r.dst.bottom),s=io+Y?`bottom`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`horizontal`,side:s,coord:i,min:Math.min(n.a.x,n.b.x),max:Math.max(n.a.x,n.b.x)}:void 0}}},`externalRailForSegment`),d=e(()=>{let e=[];for(let t of a){let n=o(t);for(let r of Z(n)){let i=u(t,n,r);i&&e.push(i)}}return e},`collectExternalRails`),f=e((e,t)=>e.edge!==t.edge&&e.axis===t.axis&&e.side===t.side&&C(e.min,e.max,t.min,t.max)>=X,`railsInteract`),p=e(e=>{let t=[],n=new Set;for(let r of e){if(n.has(r))continue;let i=[r],a=[];for(n.add(r);i.length>0;){let t=i.pop();a.push(t);for(let r of e)!n.has(r)&&f(t,r)&&(n.add(r),i.push(r))}a.length>1&&t.push(a)}return t},`connectedComponents`),m=e(e=>{let t=[];for(let n of e)t.some(e=>Math.abs(e-n.coord){let n=t.map(e=>e.coord),r=m(t),i=[];if(t.length<=6){let a=Array(r.length).fill(!1),o=[],s=e(()=>{if(o.length===t.length){o.some((e,t)=>Math.abs(e-n[t])>=Y)&&i.push([...o]);return}for(let[e,t]of r.entries())a[e]||(a[e]=!0,o.push(t),s(),o.pop(),a[e]=!1)},`visit`);return s(),i}for(let e=0;e{let n=new Map;for(let[r,i]of e.entries()){let e=t[r],a=n.get(i.edge)??i.points.map(e=>({x:e.x,y:e.y}));i.axis===`vertical`?(a[i.segmentIndex].x=e,a[i.segmentIndex+1].x=e):(a[i.segmentIndex].y=e,a[i.segmentIndex+1].y=e),n.set(i.edge,a)}let r=new Map;for(let[e,t]of n){let n=G(D(t));if(Z(n).length!==n.length-1)return;r.set(e,n)}return r},`replacementsForAssignment`),_=e(e=>{for(let[t,n]of e){let e=[t.start,t.end].filter(e=>!!e);for(let t of Z(n))if(B(t.a,t.b,r,e,-2)||B(t.a,t.b,i,[],-2))return!1}for(let t=0;t=X)return!1}}return!0},`candidateIsSafe`);for(let e=0;e<4;e++){let e=s();if(e===0)return;let t,n=e,r=c(),i=1/0;for(let a of p(d()))for(let o of h(a)){let l=g(a,o);if(!l||!_(l))continue;let u=s(l);if(u>=e)continue;let d=c(l),f=a.reduce((e,t,n)=>e+Math.abs(o[n]-t.coord),0);u>n||u===n&&(d>r||d===r&&f>=i)||(t=l,n=u,r=d,i=f)}if(!t)return;for(let[e,n]of t)e.points=n}}e(Ze,`reassignCrossingExternalRailChannels`);function Qe(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t,n)=>D(e===t?n??[]:e.points??[]),`pointsFor`),s=e(e=>Z(e).reduce((e,t)=>{let n=t.a.x-t.b.x,r=t.a.y-t.b.y;return e+Math.hypot(n,r)},0),`pathLength`),c=e((e,t)=>{let n=0;for(let r=0;r{if(e.horizontal){let n=e.a.y;return(Math.abs(n-t.top)<1||Math.abs(n-t.bottom)<1)&&C(e.a.x,e.b.x,t.left,t.right)>=X}if(e.vertical){let n=e.a.x;return(Math.abs(n-t.left)<1||Math.abs(n-t.right)<1)&&C(e.a.y,e.b.y,t.top,t.bottom)>=X}return!1},`segmentRunsAlongRectBorder`),u=e(e=>{let t=[e.start,e.end].filter(e=>!!e),r=[];for(let e of t){let t=n.get(e),i=t?F(t):void 0;i&&r.push(i)}return r},`endpointRectsFor`),d=e((e,t)=>{if(t+3>=e.length)return[];let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=x(n,r,Y)&&S(r,i,Y)&&x(i,a,Y),s=S(n,r,Y)&&x(r,i,Y)&&S(i,a,Y);if(!o&&!s||!(o?Math.sign(r.x-n.x)!==Math.sign(a.x-i.x):Math.sign(r.y-n.y)!==Math.sign(a.y-i.y)))return[];let c=y(n,a,Y)||b(n,a,Y)?[]:[{x:n.x,y:a.y},{x:a.x,y:n.y}],l=c.length===0?[[...e.slice(0,t+1),...e.slice(t+3)]]:c.map(n=>[...e.slice(0,t+1),n,...e.slice(t+3)]),u=new Set;return l.map(e=>G(D(e))).filter(e=>{if(Z(e).length!==e.length-1||!e.some(e=>v(e,a,Y)))return!1;let t=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return!u.has(t)&&(u.add(t),!0)})},`shortcutCandidatesAt`),f=e((e,t,n)=>{let s=[e.start,e.end].filter(e=>!!e),d=u(e);for(let e of Z(t))if(B(e.a,e.b,r,s,-2)||B(e.a,e.b,i,[],-2)||d.some(t=>l(e,t)))return!1;for(let n of a)if(n!==e){for(let e of Z(t))for(let t of Z(o(n)))if(w(e,t,.5)>=X)return!1}return c(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=c(),t,n,r=e,i=1/0,l=1/0;for(let u of a){let a=o(u),p=E(a,Y),m=s(a);for(let o=0;o<=a.length-4;o++)for(let h of d(a,o)){let a=E(h,Y),o=s(h);if(!(ar||d===r&&(a>i||a===i&&o>=l)||(t=u,n=h,r=d,i=a,l=o)}}if(!t||!n)return;t.points=n}}e(Qe,`shortcutRedundantOrthogonalJogs`);function $e(t,n){let r=[];for(let e of n.values()){if(e.isGroup||e.isEdgeLabel)continue;let t=e.x??0,n=e.y??0,i=F(e);i&&r.push({id:String(e.id??``),cx:t,cy:n,rect:i})}if(r.length===0)return;let i=new Map(r.map(e=>[e.id,e])),a=r.map(e=>({id:e.id,rect:e.rect})),o=[`top`,`bottom`,`left`,`right`],s={top:Math.min(...r.map(e=>e.rect.top))-20,bottom:Math.max(...r.map(e=>e.rect.bottom))+20,left:Math.min(...r.map(e=>e.rect.left))-20,right:Math.max(...r.map(e=>e.rect.right))+20},c=t.filter(e=>!e.isLayoutOnly),l=new Map(c.map((e,t)=>[e,t])),u=e(e=>{let t=e===`left`||e===`top`?-1:1,n=[];for(let r=0;r<=2;r++)n.push(s[e]+t*20*r);return n},`outwardTracksForSide`),d=e((e,t=new Map)=>D(t.get(e)??e.points??[]),`replacementPointsFor`),f=e((e,t)=>{let n=0;for(let r of e)for(let e of t)V(r.a,r.b,e.a,e.b,Y)&&n++;return n},`crossingCountBetweenSegments`),p=e((e,t)=>f(Z(e),Z(t)),`crossingCountBetweenPaths`),m=e((t=new Map)=>{let n=0,r=[],i=new Set,a=[],o=e(e=>{i.has(e)||(i.add(e),a.push(e))},`addEdge`);for(let e=0;e0&&(n+=l,r.push({first:i,second:e,count:l}),o(i),o(e))}}return a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),{count:n,pairs:r,edgeSet:i,edges:a}},`crossingSnapshot`),h=e((e,t)=>{let n=new Set(t.keys());if(n.size===0)return e.count;let r=0;for(let t of e.pairs)(n.has(t.first)||n.has(t.second))&&(r+=t.count);let i=0;for(let e=0;e{let t=new Map;for(let n of e.pairs){let e=t.get(n.first)??new Set;e.add(n.second),t.set(n.first,e);let r=t.get(n.second)??new Set;r.add(n.first),t.set(n.second,r)}let n=[],r=new Set;for(let i of e.edges){if(r.has(i))continue;let e=[i],a=[];for(r.add(i);e.length>0;){let n=e.pop();a.push(n);for(let i of t.get(n)??[])r.has(i)||(r.add(i),e.push(i))}a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),a.length>1&&n.push(a)}return n},`crossingComponents`),_=e(e=>[e.start,e.end].filter(e=>!!e),`endpointIdsFor`),v=e(e=>{let t=[];for(let n of g(e)){let e=new Set(n),r=new Set(n.flatMap(e=>_(e))),i=[...n];for(let t of c)e.has(t)||_(t).some(e=>r.has(e))&&i.push(t);i.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),t.push(i)}return t},`pairSearchGroups`),y=e((e,t,n)=>h(e,new Map([[t,n]])),`crossingCountWithSingleReplacement`),b=e(e=>{let t=new Map;for(let n of e.pairs)t.set(n.first,(t.get(n.first)??0)+n.count),t.set(n.second,(t.get(n.second)??0)+n.count);return t},`currentCrossingsByEdge`),C=e(e=>e.slice(1).reduce((t,n,r)=>{let i=e[r];return t+Math.abs(n.x-i.x)+Math.abs(n.y-i.y)},0),`pathLength`),T=e((e=new Map)=>c.reduce((t,n)=>t+E(d(n,e)),0),`totalBends`),O=e((e=new Map)=>c.reduce((t,n)=>t+C(d(n,e)),0),`totalLength`),k=e((e,t,n=new Map)=>{let r=Z(t);for(let t of c)if(t!==e){for(let e of r)for(let r of Z(d(t,n)))if(w(e,r,.5)>=X)return!0}return!1},`pathHasSegmentConflict`),A=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Z(t))if(B(e.a,e.b,a,n,-2))return!0;return!1},`pathHitsNode`),j=e((e,t)=>{let n=G(D(t));Z(n).length===n.length-1&&e.push(n)},`pushOrthogonalCandidate`),M=e(e=>e===`left`||e===`right`,`sideIsHorizontal`),N=e((e,t,n)=>{switch(t){case`left`:return Math.min(e.x,n.x)-20;case`right`:return Math.max(e.x,n.x)+20;case`top`:return Math.min(e.y,n.y)-20;case`bottom`:return Math.max(e.y,n.y)+20}},`localTrackForSameSide`),P=e((e,t,n,r)=>{let i=n===`left`||n===`top`?-1:1,a=[N(t,n,r),s[n]];for(let o of a)for(let a=0;a<=2;a++)j(e,L(t,n,r,o+i*20*a))},`addSameSideCandidates`),R=e((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))j(e,[t,{x:a,y:t.y},{x:a,y:n},{x:r.x,y:n},r])},`addHorizontalToVerticalCandidates`),z=e((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))j(e,[t,{x:t.x,y:a},{x:n,y:a},{x:n,y:r.y},r])},`addVerticalToHorizontalCandidates`),te=e((e,t,n,r,i)=>{let a=[...u(`top`),...u(`bottom`)];for(let o of u(n))for(let n of u(i))for(let i of a)j(e,[t,{x:o,y:t.y},{x:o,y:i},{x:n,y:i},{x:n,y:r.y},r])},`addHorizontalPairCandidates`),ne=e((e,t,n,r,i)=>{let a=[...u(`left`),...u(`right`)];for(let o of u(n))for(let n of u(i))for(let i of a)j(e,[t,{x:t.x,y:o},{x:i,y:o},{x:i,y:n},{x:r.x,y:n},r])},`addVerticalPairCandidates`),re=e(e=>{let t=new Set;return e.map(e=>D(e)).filter(e=>{let n=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return t.has(n)||e.length<2?!1:(t.add(n),!0)})},`dedupeCandidatePaths`),ie=e((e,t,n,r)=>{let i=[],a=ee(e,t,n,r,20,Y);a&&j(i,a),t===r&&P(i,e,t,n);let o=M(t),s=M(r);return o&&!s?R(i,e,t,n,r):!o&&s?z(i,e,t,n,r):o?te(i,e,t,n,r):ne(i,e,t,n,r),re(i)},`buildCandidatesForSides`),ae=e((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=I(r,s),c=s===`top`||s===`bottom`?u(s):a;for(let r of i){j(e,[t,n,{x:r,y:n.y},{x:r,y:o.y},o]);for(let i of c)j(e,[t,n,{x:r,y:n.y},{x:r,y:i},{x:o.x,y:i},o])}}},`addVerticalDepartureOuterTrackCandidates`),oe=e((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=I(r,s),c=s===`left`||s===`right`?u(s):i;for(let r of a){j(e,[t,n,{x:n.x,y:r},{x:o.x,y:r},o]);for(let i of c)j(e,[t,n,{x:n.x,y:r},{x:i,y:r},{x:i,y:o.y},o])}}},`addHorizontalDepartureOuterTrackCandidates`),H=e(e=>{let t=e.start,n=e.end,r=n?i.get(n):void 0;if(!t||!r)return[];let a=D(e.points??[]);if(a.length<4)return[];let o=a[0],s=a[1],c=[];return S(o,s,Y)?ae(c,o,s,r):x(o,s,Y)&&oe(c,o,s,r),c},`terminalPreservingOuterTrackCandidates`),U=e(e=>{let t=e.start,n=e.end,r=t?i.get(t):void 0,a=n?i.get(n):void 0;if(!r||!a)return[];let s=[];for(let e of o){let t=I(r,e);for(let n of o)s.push(...ie(t,e,I(a,n),n))}return s.push(...H(e)),s},`candidatePathsFor`),W=e(()=>new Map(c.map(e=>[e,Z(d(e))])),`currentSegmentsByEdge`),K=e((e,t,n)=>{let r=new Set;for(let i of c){if(i===e)continue;let a=n.get(i)??Z(d(i));t.some(e=>a.some(t=>w(e,t,.5)>=X))&&r.add(i)}return r},`sharedTrackConflictsFor`),se=e((e,t,n,r)=>{let i=new Set;return U(e).map(e=>G(D(e))).filter(t=>{if(A(e,t))return!1;let n=t.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return i.has(n)||t.length<2?!1:(i.add(n),!0)}).map(i=>{let a=Z(i),o=0;for(let t of c)t!==e&&(o+=f(a,n.get(t)??Z(d(t))));return{candidate:i,candidateSegments:a,crossings:t.count-(r.get(e)??0)+o,bends:E(i,Y),totalBends:E(i),length:C(i)}}).filter(({crossings:e})=>e<=t.count).sort((e,t)=>e.crossings-t.crossings||e.bends-t.bends||e.length-t.length).slice(0,48).map(t=>({path:t.candidate,segments:t.candidateSegments,sharedTrackConflicts:K(e,t.candidateSegments,n),totalBends:t.totalBends,length:t.length}))},`pairCandidatesFor`),ce=e((e,t,n,r,i,a)=>{let o=0;for(let n of e.pairs)(n.first===t||n.second===t||n.first===r||n.second===r)&&(o+=n.count);let s=f(n.segments,i.segments);for(let e of c){if(e===t||e===r)continue;let o=a.get(e)??Z(d(e));s+=f(n.segments,o)+f(i.segments,o)}return e.count-o+s},`pairCrossingCount`),le=e((e,t)=>{for(let n of e.sharedTrackConflicts)if(n!==t)return!1;return!0},`conflictsOnlyWith`),ue=e((e,t)=>e.segments.some(e=>t.segments.some(t=>w(e,t,.5)>=X)),`candidatesShareTrack`),de=e((e,t,n,r)=>le(t,n.edge)&&le(r,e.edge)&&!ue(t,r),`pairCandidatesAreCompatible`),q=e((e,t,n,r,i)=>{let a=ce(e.current,t.edge,n,r.edge,i,e.baseSegments);if(!(a>=e.current.count))return{replacements:new Map([[t.edge,n.path],[r.edge,i.path]]),crossings:a,bends:e.currentBends-(e.baseBendsByEdge.get(t.edge)??0)-(e.baseBendsByEdge.get(r.edge)??0)+n.totalBends+i.totalBends,length:e.currentLength-(e.baseLengthByEdge.get(t.edge)??0)-(e.baseLengthByEdge.get(r.edge)??0)+n.length+i.length}},`scorePairReplacement`),J=e((e,t)=>e.crossings{let i=r;for(let r of t.candidates)for(let a of n.candidates){if(!de(t,r,n,a))continue;let o=q(e,t,r,n,a);o&&J(o,i)&&(i=o)}return i},`bestScoreForOptionPair`),pe=e(e=>{let t=T(),n=O(),r=W(),i=b(e),a=new Map(c.map(e=>[e,E(d(e))])),o=new Map(c.map(e=>[e,C(d(e))])),s=new Map,l=v(e);for(let t of l)for(let n of t){if(s.has(n))continue;let t=se(n,e,r,i);t.length>0&&s.set(n,{edge:n,candidates:t})}let u={replacements:new Map,crossings:e.count,bends:t,length:n},f={current:e,currentBends:t,currentLength:n,baseBendsByEdge:a,baseLengthByEdge:o,baseSegments:r};for(let t of l){let n=new Set(t.filter(t=>e.edgeSet.has(t))),r=t.map(e=>s.get(e)).filter(e=>!!e);for(let e=0;e0?u.replacements:void 0},`bestPairedReplacement`);for(let e=0;e<4;e++){let e=m(),t=e.count;if(t===0)return;let n,r,i=t,a=1/0;for(let o of e.edges){let s=E(d(o),Y);for(let c of U(o)){let l=A(o,c),u=!l&&k(o,c),d=y(e,o,c),f=E(c,Y);l||u||(di||d===i&&f>=a||(n=o,r=c,i=d,a=f))}}if(n&&r){n.points=r;continue}let o=pe(e);if(!o)return;for(let[e,t]of o)e.points=t}}e($e,`resolveRenderedOrthogonalCrossings`);var et=.001,tt=8;function nt(t,n){let{nodeInfoById:r,realNodeRects:i}=R(n),a=[`top`,`bottom`,`left`,`right`],o={top:Math.min(...i.map(e=>e.rect.top))-20,bottom:Math.max(...i.map(e=>e.rect.bottom))+20,left:Math.min(...i.map(e=>e.rect.left))-20,right:Math.max(...i.map(e=>e.rect.right))+20},s=e((e,t,n,r)=>{let i=[],a=ee(e,t,n,r,20,et);return a&&i.push(a),t===r&&i.push(L(e,t,n,o[t])),i},`buildOrthogonalPathCandidates`),c=e((e,t)=>{for(let n=0;n{let i=0,a=T(e,et),o=n.start,s=n.end;for(let e of t){if(e===n||e.isLayoutOnly)continue;let t=e.start,c=e.end;if(!r&&o&&s&&(t===o||t===s||c===o||c===s))continue;let l=e.points;if(!(!l||l.length<2))for(let e of a)for(let t of T(l,et)){if(re(e.a,e.b,t.a,t.b,et,et)){i++;continue}w(e,t,et)>=tt&&i++}}return i},`pathConflictCount`),u=e((e,t)=>{let n=Math.abs(e.y-t.rect.top),r=Math.abs(e.y-t.rect.bottom),i=Math.abs(e.x-t.rect.left),a=Math.abs(e.x-t.rect.right),o=`top`,s=n;return r{let r=d.get(e)??[];r.push({side:t,edgeId:n}),d.set(e,r)},`addFaceClaim`);for(let e of t){if(e.isLayoutOnly)continue;let t=e.points??[];if(t.length<1)continue;let n=e.id??``,i=e.start,a=e.end;if(i){let e=r.get(i);e&&f(i,u(t[0],e),n)}if(a){let e=r.get(a);e&&f(a,u(t[t.length-1],e),n)}}let p=e((e,t,n)=>d.get(e)?.some(e=>e.edgeId!==n&&e.side===t)??!1,`faceIsClaimed`);for(let e of t){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=E(t,et);if(n<4)continue;let i=e.start,o=e.end;if(!i||!o)continue;let m=r.get(i),h=r.get(o);if(!m||!h)continue;let g=e.id??``,_=l(t,e,!0),v=l(t,e),y,b=_,x=n;for(let t of a){if(p(i,t,g))continue;let n=I(m,t);for(let r of a){if(p(o,r,g))continue;let a=I(h,r);for(let u of s(n,t,a,r)){if(c(u,[i,o]))continue;let t=E(u,et);if(_>0){let n=l(u,e,!0);if(n>b||n===b&&t>=x)continue;b=n,x=t,y=u;continue}l(u,e)>v||te.edgeId!==g));let n=d.get(o);n&&d.set(o,n.filter(e=>e.edgeId!==g)),f(i,u(y[0],m),g),f(o,u(y[y.length-1],h),g)}}}e(nt,`simplifyDetouredEdges`);var Q=.001,rt=10,it=7;function at(e,t){let n=t?0:e.length-1,r=t?1:-1,i=e[n],a=e[n+r];if(!i||!a)return;let o=a.x-i.x,s=a.y-i.y;if(!(Math.abs(o)+Math.abs(s)t&&M(e,ot(t)))}e(st,`labelOverlapsOwnMarker`);function ct(t,n){let r=[];for(let e of t){if(e.isLayoutOnly)continue;let t=e.points;if(!(!t||t.length<2))for(let n=0;n{let n=N(t,3);for(let{nodeId:t,rect:r}of i)if(t!==e&&M(n,r))return!0;return!1},`labelOverlapsForeignNode`),s=e((e,t)=>{let n=N(t,3);for(let t of r)if(t.edgeId!==e&&k(t.p1,t.p2,n))return!0;return!1},`labelOverlapsForeignEdge`),c=e((e,t,n)=>o(e,n)||s(t,n),`labelOverlapsAnything`),l=[],u=e(e=>{for(let{id:t,rect:n}of a)if(j(n,e))return t},`findContainingLane`),d=e((e,t)=>l.some(n=>n.labelId!==e&&M(t,n.rect)),`overlapsPlacedLabel`);for(let r of t){if(r.isLayoutOnly)continue;let t=r.labelNodeId;if(!t)continue;let i=n.get(t);if(!i)continue;let f=r.points;if(!f||f.length<2)continue;let p=i.width??0,m=i.height??0;if(p<=0||m<=0)continue;let h=[];for(let e=0;e=Q&&i>=Q||h.push({idx:e,length:r+i,orientation:r>=Q?`horizontal`:`vertical`,midX:(t.x+n.x)/2,midY:(t.y+n.y)/2})}if(h.length===0)continue;let g=h.length>=3?h.filter(e=>e.idx>0&&e.idx0?g:h,v=p>=m?`horizontal`:`vertical`,y=e(e=>[...e].sort((e,t)=>{let n=e.orientation===v;if(n!==(t.orientation===v))return n?-1:1;let r=e.length>=(e.orientation===`horizontal`?p:m)+2;return r===t.length>=(t.orientation===`horizontal`?p:m)+2?t.length-e.length:r?-1:1}),`rankSegments`),b=h[0],x=h[h.length-1],S=[.5,.25,.75,.05,.95,.15,.85,.1,.9],C=e((e,t)=>{let n=f[e.idx],r=f[e.idx+1];return{midX:n.x+(r.x-n.x)*t,midY:n.y+(r.y-n.y)*t}},`anchorAtT`),w=e((e,t,n)=>Math.min(n,Math.max(t,e)),`clamp`),T=e((e,t)=>e.midX>=t.left-Q&&e.midX<=t.right+Q&&e.midY>=t.top-Q&&e.midY<=t.bottom+Q,`pointInsideRectInclusive`),E=e(e=>{let t=P(e.midX,e.midY,p,m),n=u(t);if(n)return{laneId:n,anchor:e,rect:t};let r=a.find(({rect:t})=>T(e,t));if(!r)return;let i=r.rect.left+p/2+1,o=r.rect.right-p/2-1,s=r.rect.top+m/2+1,c=r.rect.bottom-m/2-1;if(i>o||s>c)return;let l={midX:w(e.midX,i,o),midY:w(e.midY,s,c)},d=P(l.midX,l.midY,p,m);return T(e,d)?{laneId:r.id,anchor:l,rect:d}:void 0},`placementForAnchor`),D=e((e,t,n)=>e.orientation===`horizontal`?Math.abs(t.midX-n.x):Math.abs(t.midY-n.y),`distanceAlongSegment`),O=e((e,t)=>{let n=(e.orientation===`horizontal`?p/2:m/2)+12;if(e===b){let r=f[e.idx];if(D(e,t,r)+Q{let n=y(e);for(let e of n)for(let n of S){let i=C(e,n);if(!O(e,i))continue;let a=E(i);if(a&&!st(a.rect,f)&&!d(t,a.rect)&&!c(t,r.id,a.rect))return{laneId:a.laneId,anchor:a.anchor}}},`tryPool`),A=e((e,n,i=!1)=>{let a=y(e);for(let e of a){let a={midX:e.midX,midY:e.midY};if(n&&!O(e,a))continue;let c=E(a);if(c&&!st(c.rect,f)&&!d(t,c.rect)&&!o(t,c.rect)&&(i||!s(r.id,c.rect)))return{laneId:c.laneId,anchor:c.anchor}}},`findLaneContainingFallback`),j=k(_)??(_.lengthe.labelId===t);n>=0?l[n]={labelId:t,rect:e}:l.push({labelId:t,rect:e})}}}e(ct,`anchorLabelsToPolyline`);var lt=1e-6,ut=8/2,dt=3;function ft(e,t){return e{let s=ft(r,i),c=0,l=e(e=>{if(!e)return;let t=a.get(e);if(!t)return;let n=o===`x`?t.w/2:t.h/2;n>c&&(c=n)},`consider`);l(n.labelNodeId);for(let e of t){if(e===n||e.isLayoutOnly)continue;let t=e.start,r=e.end;!t||!r||ft(t,r)===s&&l(e.labelNodeId)}return c>0?c+dt:0},`labelClearanceFor`);for(let e of t){if(e.isLayoutOnly)continue;let n=e.points;if(!O(n,lt))continue;let a=ne(e,r,lt);if(!a)continue;let{srcId:s,dstId:c,srcInfo:l,dstInfo:u,collinearX:d,collinearY:f}=a;if(d===f)continue;let p,m;if(d){let e=u.cy>l.cy;p={x:l.cx,y:e?l.rect.bottom:l.rect.top},m={x:u.cx,y:e?u.rect.top:u.rect.bottom}}else{let e=u.cx>l.cx;p={x:e?l.rect.right:l.rect.left,y:l.cy},m={x:e?u.rect.left:u.rect.right,y:u.cy}}if(B(p,m,i,[s,c],1))continue;let h=o(e,s,c,d?`x`:`y`),g=h>ut?h:ut,_=[0,g,-g];for(let n of _){let r={...p},a={...m};if(d){if(r.x+=n,a.x+=n,r.x<=l.rect.left||r.x>=l.rect.right||a.x<=u.rect.left||a.x>=u.rect.right)continue}else if(r.y+=n,a.y+=n,r.y<=l.rect.top||r.y>=l.rect.bottom||a.y<=u.rect.top||a.y>=u.rect.bottom)continue;if(!B(r,a,i,[s,c],1)&&!ae(r,a,t,e,{epsilon:lt})){e.points=[r,a];break}}}}e(pt,`straightenCollinearSiblingDetours`);function mt(t,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=z(n.values()),o=e((e,t)=>T(t,r).map(n=>({...n,edge:e,interior:n.index>=1&&n.index<=t.length-3})),`segmentsFor`),s=e(()=>{let e=[];for(let n of t){if(n.isLayoutOnly)continue;let t=n.points;!t||t.length<2||e.push(...o(n,D(t)))}return e},`allSegments`),c=e((e,t)=>e.horizontal&&t.horizontal?C(e.a.x,e.b.x,t.a.x,t.b.x)>=8&&Math.abs(e.a.y-t.a.y)<7:e.vertical&&t.vertical?C(e.a.y,e.b.y,t.a.y,t.b.y)>=8&&Math.abs(e.a.x-t.a.x)<7:!1,`hasCrowdedParallelTrack`),l=e((e,n)=>{let s=e.start,l=e.end,u=o(e,n);if(u.length!==n.length-1)return!1;let d=[s,l].filter(e=>!!e),f=e.labelNodeId?[e.labelNodeId]:[];for(let e of u)if(B(e.a,e.b,i,d,-2)||B(e.a,e.b,a,f,-2))return!1;for(let n of t){if(n===e||n.isLayoutOnly)continue;let t=n.points;if(!(!t||t.length<2)){for(let e of u)for(let i of o(n,D(t)))if(c(e,i)||V(e.a,e.b,i.a,i.b,r))return!1}}return!0},`candidateIsSafe`),u=e((e,t)=>{let n=D(e.edge.points??[]);if(n.length<4||e.index>=n.length-1)return;let r=n.map(e=>({...e}));if(e.horizontal)r[e.index].y+=t,r[e.index+1].y+=t;else if(e.vertical)r[e.index].x+=t,r[e.index+1].x+=t;else return;return o(e.edge,r).length===r.length-1?r:void 0},`shiftedCandidate`),d=e((e,t)=>({x:e.x??(t.left+t.right)/2,y:e.y??(t.top+t.bottom)/2}),`nodeCenter`),f=e(e=>{let t=e.edge,r=D(t.points??[]);if(r.length!==4||e.index!==1)return;let i=t.start?n.get(t.start):void 0,a=t.end?n.get(t.end):void 0,o=i?F(i):void 0,s=a?F(a):void 0,c=r.slice(e.index+2);if(!(!i||!a||!o||!s||c.length===0))return{sourceCenter:d(i,o),targetCenter:d(a,s),sourceRect:o,tail:c}},`sourceDetourContextFor`),p=e((e,t,n,i,a,o)=>{let s=i.y>=n.y,c=s?a.bottom:a.top,l=c+(s?20:-20);if(s&&e.b.y<=l+r||!s&&e.b.y>=l-r)return;let u=e.a.x+t;return D([{x:n.x,y:c},{x:n.x,y:l},{x:u,y:l},{x:u,y:e.b.y},...o],r)},`verticalSourceDetour`),m=e((e,t,n,i,a,o)=>{let s=i.x>=n.x,c=s?a.right:a.left,l=c+(s?20:-20);if(s&&e.b.x<=l+r||!s&&e.b.x>=l-r)return;let u=e.a.y+t;return D([{x:c,y:n.y},{x:l,y:n.y},{x:l,y:u},{x:e.b.x,y:u},...o],r)},`horizontalSourceDetour`),h=e((e,t)=>{let n=f(e);if(n){if(e.vertical)return p(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail);if(e.horizontal)return m(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail)}},`sourceDetourCandidate`),g=[-7,7,-14,14,-21,21];for(let e=0;e<12;e++){let e=s(),t=!1;for(let n=0;ne.interior);for(let e of o){for(let n of g){let r=u(e,n);if(r&&l(e.edge,r)){e.edge.points=r,t=!0;break}let i=h(e,n);if(i&&l(e.edge,i)){e.edge.points=i,t=!0;break}}if(t)break}}if(!t)return}}e(mt,`nudgeSharedInteriorSubpaths`);function ht(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=r.x-n.x,s=r.y-n.y,c=i*s-a*o;if(Math.abs(c)<1e-10)return!1;let l=n.x-e.x,u=n.y-e.y,d=(l*s-u*o)/c,f=(l*a-u*i)/c,p=.01;return d>p&&d<.99&&f>p&&f<.99}e(ht,`segmentsIntersect`);function gt(e){let n=e.nodes??[],r=e.edges??[],i=[];if(!r.length||!n.length)return i;let a=te(n),o=[];for(let e of r){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=e.start,r=e.end,s=e.labelNodeId,c=e.id??`${n}->${r}`;for(let e of a)if(e.nodeId!==n&&e.nodeId!==r&&!(s&&e.nodeId===s)){for(let n=0;n0){let e=i.filter(e=>e.type===`edge-node-overlap`).length,n=i.filter(e=>e.type===`edge-edge-crossing`).length;t.warn(`[SWIMLANE_VALIDATE] ${i.length} issue(s) detected: ${e} edge-node overlap(s), ${n} edge crossing(s)`);for(let e of i)t.warn(`[SWIMLANE_VALIDATE] ${e.type}: ${e.detail}`)}return i}e(gt,`validateSwimlanesLayout`);function _t(t,n){let r=t.nodes??[],i=t.edges??[],a=r.filter(e=>!e.isGroup);if((n===`LR`||n===`RL`)&&a.length>0&&!Re(t,n)||n===`BT`&&a.length>0&&!Le(t))return;for(let e of i){if(e.isLayoutOnly)continue;let t=e.points;!t||t.length<2||(e.points=G(W(t)))}nt(i,r),pt(i,r),He(i,r);let o=new Map;for(let e of r)o.set(String(e.id),e);ct(i,o),q(i,o),Ue(i,o),mt(i,o),Ge(i,o),Ke(i,o),qe(i,o),Xe(i,o);let s=e(()=>{$e(i,o),Ze(i,o),Qe(i,o),ct(i,o),ke(i,o),qe(i,o),ct(i,o),ke(i,o)},`finalizeRenderedEdges`);s(),mt(i,o),s(),Je(i,o),Ye(i,o),Je(i,o),Ye(i,o)}e(_t,`postProcessSwimlaneLayout`);function vt(e){let t=new Map(e.nodeById),n=new Set,r=[];for(let i of e.edges){if(!t.has(i.src)||!t.has(i.dst))continue;let e=`${i.id}:${i.src}->${i.dst}`;n.has(e)||(n.add(e),r.push(i))}return{nodes:[...t.keys()],edges:r,layout:e.layout,nodeById:t}}e(vt,`normalizeGraph`);function yt(e,t){return e.edges.filter(e=>e.dst===t)}e(yt,`incoming`);function bt(e){let t=new Map;for(let n of e.nodes)t.set(n,[]);for(let n of e.edges)t.get(n.src).push(n.dst);return t}e(bt,`buildSuccessorMap`);function xt(e){let t=bt(e);for(let e of t.values())e.sort((e,t)=>e.localeCompare(t));return t}e(xt,`buildSortedSuccessorMap`);function St(e){let t=new Map;for(let n of e.nodes)t.set(n,0);for(let n of e.edges)t.set(n.dst,(t.get(n.dst)??0)+1);return t}e(St,`buildInDegreeMap`);function Ct(e){return[...e.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}e(Ct,`sortedZeroInDegreeNodes`);function wt(e,t=()=>!0){let n=new Map,r=new Map;for(let t of e.nodes)n.set(t,[]),r.set(t,[]);for(let i of e.edges)t(i)&&(r.get(i.src).push(i.dst),n.get(i.dst).push(i.src));return{preds:n,succs:r}}e(wt,`buildPredecessorSuccessorMaps`);function Tt(e,t,n,r){let i=0;for(let t of e.nodes)r?.skipGroups&&e.nodeById.get(t)?.isGroup||(i=Math.max(i,n[t]??0));let a=Array.from({length:i+1},()=>[]);for(let i of t)r?.skipGroups&&e.nodeById.get(i)?.isGroup||a[Math.max(0,n[i]??0)].push(i);return a}e(Tt,`buildLayersFromRanks`);function Et(e){let t=St(e),n=Ct(t),r=[],i=xt(e);for(;n.length;){let e=n.shift();r.push(e);for(let r of i.get(e)??[])if(t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0){let e=0;for(;e{if(i-e<=1)return 0;let a=e+i>>1,o=r(e,a)+r(a,i),s=e,c=a,l=e;for(;s=i||se.dst===t.dst?e.id.localeCompare(t.id):e.dst.localeCompare(t.dst));let i=Object.create(null);for(let e of n.nodes)i[e]=0;let a=[],o=e(e=>{i[e]=1;for(let t of r.get(e)??[]){let e=t.dst;i[e]===0?o(e):i[e]===1&&a.push(t)}i[e]=2},`dfs`),s=St(n),c=[...n.nodes.filter(e=>(s.get(e)??0)===0),...n.nodes.filter(e=>(s.get(e)??0)!==0)];for(let e of c)i[e]===0&&o(e);let l=new Set(a.map(e=>`${e.id}:${e.src}->${e.dst}`)),u=n.edges.map(e=>l.has(`${e.id}:${e.src}->${e.dst}`)?{id:e.id,src:e.dst,dst:e.src,weight:e.weight,ref:e.ref}:e);return{acyclic:{nodes:[...n.nodes],edges:u,layout:n.layout,nodeById:new Map(n.nodeById)},reversed:a}}e(kt,`removeCycles_DFS`);function At(t){let n=new Map,r=e(e=>{if(n.has(e))return n.get(e);let i=t.nodeById.get(e);if(!i)return n.set(e,null),null;let a=i.parentId;if(!a)return n.set(e,null),null;let o=r(a)??a;return n.set(e,o),o},`resolve`);for(let e of t.nodes)r(e);return n}e(At,`buildTopLaneMap`);function jt(e){let t=At(e);return e=>t.get(e)??null}e(jt,`createTopLaneResolver`);function Mt(e){let t=[];for(let n of e.layout.nodes??[])n.isGroup&&!n.parentId&&t.push(n.id);return[...new Set(t)].reverse()}e(Mt,`buildTopLaneOrder`);function Nt(e,t){let n=Mt(e);if(!t||t.length===0)return n;let r=new Set(n),i=new Set,a=[];for(let e of t)!r.has(e)||i.has(e)||(i.add(e),a.push(e));for(let e of n)i.has(e)||a.push(e);return a}e(Nt,`resolveTopLaneOrder`);var Pt={EPSILON:1e-6},Ft={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},It={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Lt(t,n){let r=vt(t),i=n?.laneOf??(()=>null),a=n?.rankHint,{preds:o}=wt(r);for(let e of o.values())e.sort((e,t)=>e.localeCompare(t));let s=Et(r)??[...r.nodes].sort((e,t)=>e.localeCompare(t)),c=new Map;for(let[e,t]of s.entries())c.set(t,e);let l=new Map,u=new Map;for(let e of r.nodes)u.set(e,[]);for(let e of s){let t=(o.get(e)??[]).filter(e=>l.has(e));if(t.length>0){let n=Rt(e,t,{laneOf:i,rankHint:a,topoIndex:c});l.set(e,n),u.get(n).push(e)}else l.has(e)||l.set(e,null)}for(let e of r.nodes)l.has(e)||l.set(e,null);let d=new Set;for(let e of r.nodes)(l.get(e)??null)===null&&d.add(e);let f=[...d].sort((e,t)=>{let n=c.get(e)??0,r=c.get(t)??0;return n===r?e.localeCompare(t):n-r}),p=zt(r),m=new Map;for(let[e,t]of p.entries())m.set(e,[...t].sort((e,t)=>e.localeCompare(t)));let h=Bt(m),g=Vt(m),_=new Map;for(let e of r.nodes)_.set(e,[]);for(let e of g)for(let t of e.nodes){let n=_.get(t);n?n.push(e.id):_.set(t,[e.id])}let v=[],y=[],b=new Set,x=e(e=>{if(!b.has(e)){b.add(e),v.push(e);for(let t of u.get(e)??[])x(t);y.push(e)}},`walk`);for(let e of f)x(e);for(let e of s)x(e);return{parent:l,children:u,roots:f,componentOf:h,blocks:g,nodeBlocks:_,adjacency:m,preorder:v,postorder:y,topologicalOrder:s}}e(Lt,`buildDrivingTree`);function Rt(e,t,n){let r=n.laneOf(e);return[...t].sort((e,t)=>{let i=n.laneOf(e),a=n.laneOf(t),o=i!=null&&i===r;if(o!==(a!=null&&a===r))return o?-1:1;let s=n.rankHint?.[e],c=n.rankHint?.[t];if(s!=null&&c!=null&&s!==c)return c-s;let l=n.topoIndex.get(e)??0,u=n.topoIndex.get(t)??0;return l===u?e.localeCompare(t):l-u})[0]}e(Rt,`chooseParent`);function zt(e){let t=new Map;for(let n of e.nodes)t.set(n,new Set);for(let n of e.edges)t.get(n.src).add(n.dst),t.get(n.dst).add(n.src);return t}e(zt,`buildAdjacency`);function Bt(e){let t=new Map,n=0;for(let r of e.keys()){if(t.has(r))continue;let i=[r];for(;i.length>0;){let r=i.pop();if(!t.has(r)){t.set(r,n);for(let n of e.get(r)??[])t.has(n)||i.push(n)}}n++}return t}e(Bt,`assignComponents`);function Vt(t){let n=new Map,r=new Map,i=[],a=[],o=0,s=e((e,c)=>{n.set(e,++o),r.set(e,o);for(let l of t.get(e)??[])l!==c&&(n.has(l)?(n.get(l)??0)<(n.get(e)??0)&&(i.push([e,l]),r.set(e,Math.min(r.get(e)??o,n.get(l)??o))):(i.push([e,l]),s(l,e),r.set(e,Math.min(r.get(e)??o,r.get(l)??o)),(r.get(l)??0)>=(n.get(e)??0)&&a.push(Ht(e,l,i,a.length))))},`visit`);for(let e of t.keys())n.has(e)||s(e,null);return a}e(Vt,`computeBlocks`);function Ht(e,t,n,r){let i=[],a=new Set;for(;n.length>0;){let r=n.pop();if(i.push(r),a.add(r[0]),a.add(r[1]),r[0]===e&&r[1]===t||r[0]===t&&r[1]===e)break}return{id:r,edges:i,nodes:[...a]}}e(Ht,`popBlock`);function Ut(t,n,r){let i=[...t.nodes],a=new Map;for(let[e,t]of i.entries())a.set(t,e);let o=i.length,s=Array(o).fill(-1),c=Array(o).fill(0),l=[],u=new Set;for(let e of i){let t=r.parent.get(e)??null,n=a.get(e);n!=null&&(t??(s[n]=-1,c[n]=0,u.has(e)||(u.add(e),l.push(e))))}for(;l.length>0;){let e=l.shift(),t=a.get(e);if(t==null)continue;let n=r.children.get(e)??[];for(let e of n){if(u.has(e))continue;let n=a.get(e);n!=null&&(s[n]=t,c[n]=c[t]+1,u.add(e),l.push(e))}}for(let e of i){if(u.has(e))continue;let t=a.get(e);t!=null&&(s[t]=-1,c[t]=0,u.add(e))}let d=Math.max(1,Math.ceil(Math.log2(Math.max(1,o)))+1),f=Array.from({length:d},()=>Array(o).fill(-1));for(let e=0;e{if(e===-1||t===-1)return-1;c[e]>t&1&&(e=f[t][e],e===-1))return-1;if(e===t)return e;for(let n=d-1;n>=0;n--){let r=f[n][e],i=f[n][t];r!==-1&&i!==-1&&r!==i&&(e=r,t=i)}return f[0][e]},`lcaIndex`),m=Array.from({length:o},()=>new Map);for(let e of t.edges){let t=e.src,r=e.dst,i=n[t],o=n[r];if(i==null||o==null||(i>o&&([t,r]=[r,t],[i,o]=[o,i]),i==null||o==null||i===o))continue;let s=a.get(t),c=a.get(r);if(s==null||c==null)continue;let l=p(s,c);if(l===-1)continue;let u=m[l];for(let e=i;e{if(t.size!==0)for(let[n,r]of t)e.set(n,(e.get(n)??0)+r)},`mergeInto`),_=new Set,v=e(e=>{let t=a.get(e);_.add(e);let i=t==null?void 0:m[t],o=i?new Map(i):new Map,s=r.children.get(e)??[];for(let t of s){let r=v(t),i=n[e];if(i!=null){let a=h.get(e);a||(a=new Map,h.set(e,a));let o=r.get(i)??0,s=n[t];s!=null&&s>i&&(o+=1),a.set(t,o)}g(o,r)}return o},`dfs`);for(let e of r.roots)_.has(e)||v(e);for(let e of i)_.has(e)||v(e);return h}e(Ut,`computeSubtreeCrossCounts`);function Wt(t,n,r){let i=new Map,a=e(e=>{let t=r[e]??0,o=[...n.get(e)??[]];o.sort(Gt(r));for(let e of o){a(e);let n=i.get(e);n!=null&&(t=Math.min(t,n))}i.set(e,t)},`annotate`);for(let e of t)a(e);return i}e(Wt,`annotateMinimumLayers`);function Gt(e){return(t,n)=>{let r=e[t]??0,i=e[n]??0;return r===i?t.localeCompare(n):r-i}}e(Gt,`compareByRankThenId`);function Kt(t,n,r,i){let a=0;for(let e of n){let t=r[e]??0;t>a&&(a=t)}let o=Array.from({length:a+1},()=>[]),s=new Set,c=e(e=>{if(s.has(e))return;s.add(e);let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e);for(let t of i(e))c(t)},`emit`);for(let e of t)c(e);for(let e of n)if(!s.has(e)){let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e),s.add(e)}return o}e(Kt,`emitNodesInTreeOrder`);function qt(e){let t=[];for(let n of e){let e=new Set,r=[];for(let t of n)e.has(t)||(e.add(t),r.push(t));t.push(r)}return t}e(qt,`deduplicateLayers`);function Jt(e,t,n,r){return i=>{let a=e.get(i)??[];if(a.length===0)return[];let o=t[i]??0,s=[],c=[],l=n.get(i);for(let e of a){let t=r.get(e)??o;t>o?s.push({child:e,min:t}):c.push(e)}return s.sort((e,t)=>e.min===t.min?e.child.localeCompare(t.child):e.min-t.min),c.sort((e,t)=>{let n=l?.get(e)??0,i=l?.get(t)??0;if(n!==i)return n-i;let a=r.get(e)??o,s=r.get(t)??o;return a===s?e.localeCompare(t):a-s}),[...s.map(e=>e.child),...c]}}e(Jt,`createChildOrderer`);function Yt(e,t,n){let r=Lt(e,{rankHint:t,laneOf:n}),{children:i,roots:a}=r;for(let t of e.nodes)i.has(t)||i.set(t,[]);let o=Ut(e,t,r),s=[...a].sort(Gt(t)),c=Jt(i,t,o,Wt(s,i,t)),l=Kt(s,e.nodes,t,c);return l=qt(l),l}e(Yt,`buildMultitreeLayerOrder`);function Xt(e,t,n){let r=new Set(e),i=new Set(t),a=Dt(t),o=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&o.push(a.get(e.dst));return Ot(o)}e(Xt,`countCrossingsBetweenAdjacent`);function Zt(e,t,n){let r=[];for(let e of t){let t=n[e.src],i=n[e.dst];if(t==null||i==null||t===i)continue;let a=e.src,o=e.dst,s=t,c=i;t>i&&(a=e.dst,o=e.src,s=i,c=t);for(let t=s;t(n[t]??0)-(n[e]??0));for(let s of o){let o=n[s]??0;if(o===0)continue;let c=0;for(let e of r.get(s)??[])c=Math.max(c,(n[e]??0)+1);if(c>=o)continue;let l=o;n[s]=c;let u=Zt(Yt(e,n,i),e.edges,n);u(t[e]??0)-(t[n]??0)||e.localeCompare(n));for(let i of r){let r=n(i);if(!r)continue;let a=e.edges.filter(e=>e.src===i);if(a.length===0)continue;let o=!1,s=0;for(let e of a){let t=n(e.dst);t==null||t===r?o=!0:s++}if(s===0||o)continue;let c=0,l=!1;for(let t of e.edges){if(t.dst!==i)continue;let e=n(t.src);e&&(e===r?l=!0:c++)}if(c>0||!l)continue;let u=t[i]??0,d=u+s,f=0;for(let n of e.edges)n.dst===i&&(f=Math.max(f,(t[n.src]??0)+1));let p=Math.max(u,f,d);p!==u&&(t[i]=p)}}e($t,`adjustCrossLaneSources`);function en(e,t){let n=vt(e),r=Et(n)??[...n.nodes].sort(),i=t?.compactSingleInput??!1,a=jt(n),o=Object.create(null);for(let e of r){let r=yt(n,e),s=t?.ignoreCrossLaneEdges?r.filter(t=>{let n=a(t.src),r=a(e);return!n||!r||n===r}):r;if(s.length===0)o[e]=0;else if(i&&s.length===1){let t=s[0].src;a(t)===a(e)?o[e]=(o[t]??0)+1:o[e]=o[t]??0}else{let t=-1/0;for(let e of s)t=Math.max(t,(o[e.src]??0)+1);o[e]=t===-1/0?0:t}}return(t?.optimizeRanksByCrossings??!1)&&(o=Qt(n,o)),t?.ignoreCrossLaneEdges&&$t(n,o),{layers:Yt(n,o,a),rankOf:o,dummy:new Set}}e(en,`assignLayers_LongestPath`);function tn(t,n){let r=vt(t),i={...en(r,{compactSingleInput:n?.compactSingleInput,ignoreCrossLaneEdges:n?.ignoreCrossLaneEdges,optimizeRanksByCrossings:n?.optimizeRanksByCrossings}).rankOf},a=jt(r),{preds:o,succs:s}=wt(r,e=>{if(n?.ignoreCrossLaneEdges){let t=a(e.src),n=a(e.dst);if(t&&n&&t!==n)return!1}return!0}),c=Et(r)??[...r.nodes],l=[...c].reverse(),u=e((e,t)=>{let n=0;for(let t of o.get(e)??[])n=Math.max(n,(i[t]??0)+1);let r=1/0,a=s.get(e)??[];return a.length>0&&(r=Math.min(...a.map(e=>(i[e]??0)-1))),Number.isFinite(r)||(r=Math.max(n,t)),Math.min(Math.max(t,n),r)},`clampFeasible`),d=Ft.GRAVITY_ITERATIONS,f=e(e=>{let t=!1;for(let n of e){let e=o.get(n)??[],r=s.get(n)??[];if(e.length===0&&r.length===0)continue;let a=e.length>0?e.reduce((e,t)=>e+(i[t]??0)+1,0)/e.length:i[n]??0,c=r.length>0?r.reduce((e,t)=>e+(i[t]??0)-1,0)/r.length:i[n]??0,l=Math.round((a+c)/2),d=u(n,l);d!==i[n]&&(i[n]=d,t=!0)}return t},`relaxOrder`);for(let e=0;e0){let n=Math.min(...t.map(e=>(i[e]??0)-1));(i[e]??0)>n&&(i[e]=n)}}return{layers:Tt(r,c,i),rankOf:i,dummy:new Set}}e(tn,`assignLayers_Gravity`);function nn(e){let t=St(e),n=xt(e),r=Ct(t),i=[];for(;r.length>0;){let e=[];for(let a of r){i.push(a);for(let r of n.get(a)??[])t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0&&e.push(r)}r=e.sort((e,t)=>e.localeCompare(t))}return i.length===e.nodes.length?i:null}e(nn,`topoSortByGenerationIfAcyclic`);function rn(t,n){let r=vt(t),i=n?.direction===`LR`?nn(r)??[...r.nodes].sort():Et(r)??[...r.nodes].sort(),a=jt(r),o=e(e=>a(e)??e,`laneOf`),s=Object.create(null),c=new Map,l=e((e,t)=>n?.ignoreCrossLaneEdges??!0?+(o(e)===o(t)):1,`edgeWeight`);for(let e of i){if(r.nodeById.get(e)?.isGroup)continue;let t=yt(r,e),n=0;if(t.length>0)for(let r of t){let t=r.src,i=s[t]??0;n=Math.max(n,i+l(t,e))}let i=o(e),a=c.get(i)??0,u=Math.max(n,a);s[e]=u,c.set(i,u+1)}return{layers:Tt(r,i,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}e(rn,`assignLayers_LaneAwareCompact`);function an(t,n){let r=vt(n),{rankOf:i}=t,a=t.layers.map(e=>[...e]),o=new Set(t.dummy?[...t.dummy]:[]),s=0,c=new Map(r.nodeById),l=e(e=>{let t=`placeholder-${s++}`,n={id:t,isGroup:!1,isDummy:!0,width:0,height:0};for(c.set(t,n),o.add(t);a.length<=e;)a.push([]);return a[e].push(t),i[t]=e,t},`addDummyAt`),u=[...r.edges].sort((e,t)=>e.id===t.id?e.src===t.src?e.dst.localeCompare(t.dst):e.src.localeCompare(t.src):e.id.localeCompare(t.id)),d=[];for(let e of u){let t=i[e.src]??0,n=i[e.dst]??0;if(n-t<=1){d.push(e);continue}let r=e.src;for(let i=t+1,a=0;i!r.nodes.includes(e))],edges:d,layout:r.layout,nodeById:c};return{layering:{layers:a,rankOf:i,dummy:o},graphWithDummies:f}}e(an,`makeProperLayering`);function on(e){let t=e.length;if(t===0)return 1/0;let n=[...e].sort((e,t)=>e-t);return t%2==1?n[(t-1)/2]:.5*(n[t/2-1]+n[t/2])}e(on,`median`);function sn(e){return e.length===0?1/0:e.reduce((e,t)=>e+t,0)/e.length}e(sn,`barycenter`);function cn(e,t,n,r){let i=new Map;for(let t of e)i.set(t,[]);for(let e of n)r===`down`?t.has(e.src)&&i.has(e.dst)&&i.get(e.dst).push(t.get(e.src)):t.has(e.dst)&&i.has(e.src)&&i.get(e.src).push(t.get(e.dst));return i}e(cn,`neighborPositionsFor`);function ln(e,t,n){let r=n.get(e)??0,i=n.get(t)??0;return r===i?e.localeCompare(t):r-i}e(ln,`currentOrderTieBreak`);function un(e,t,n){let r=new Set(e),i=new Set(t),a=Dt(e),o=Dt(t),s=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&s.push({u:a.get(e.src),v:o.get(e.dst)});return s.sort((e,t)=>e.u===t.u?e.v-t.v:e.u-t.u),Ot(s.map(e=>e.v))}e(un,`countCrossingsBetweenAdjacent`);function dn(e,t,n){return[...e].sort((e,r)=>{let i=on(t.get(e)??[]),a=on(t.get(r)??[]);return i===a?ln(e,r,n):isFinite(i)?isFinite(a)?i-a:-1:1})}e(dn,`sortByHeuristic`);function fn(e,t,n,r,i,a){let o=Dt(e),s=Dt(t),c=cn(t,o,n,r);if(!i||!a||a.length===0)return dn(t,c,s);let l=new Map;for(let e of t){let t=i(e),n=l.get(t)??[];n.push(e),l.set(t,n)}let u=[];for(let e of a){let t=l.get(e);if(!t||t.length===0)continue;let n=dn(t,c,s);u.push(...n)}let d=l.get(null);if(d&&d.length>0){let e=dn(d,c,s);for(let t of e){let e=sn(c.get(t)??[]),n=u.length;if(isFinite(e)){for(let[t,r]of u.entries())if(es.has(e.src)&&c.has(e.dst)),d=l?r.filter(e=>c.has(e.src)&&l.has(e.dst)):void 0,f=e(e=>{let n=un(t,e,u);return d&&i&&(n+=un(e,i,d)),n},`crossingScore`),p=a?new Map:null;if(a&&p)for(let e of n)p.set(e,a(e));let m=!0,h=f(o);for(;m;){m=!1;for(let e=0;e+1[...e]),i=t.edges,a=jt(t),o=Nt(t,n?.laneOrder);for(let e=0;e<3;e++){for(let e=1;e=0;e--)r[e]=fn(r[e+1],r[e],i,`up`,a,o),r[e]=pn(r[e+1],r[e],i,r[e-1],a)}return{layers:r}}e(mn,`orderLayers`);function hn(t,n,r){let i=r?.layerGap??It.DEFAULT_LAYER_GAP,a=r?.nodeGap??It.DEFAULT_NODE_GAP,o=r?.laneGap??a*2,s=r?.direction??`TB`,c=s===`LR`||s===`RL`,l=t.layers,u=Object.create(null),d=Object.create(null),f=e(e=>n.nodeById.get(e),`getNode`),p=e(e=>f(e)?.width??0,`getWidth`),m=e(e=>f(e)?.height??0,`getHeight`),h=jt(n),g=Nt(n,r?.laneOrder),_=l.map(e=>e.reduce((e,t)=>Math.max(e,m(t)),0)),v=[];if(c)for(let e=0;e+1Math.max(e,p(t)),0),n=l[e+1].reduce((e,t)=>Math.max(e,p(t)),0),r=_[e],a=_[e+1],o=r/2+a/2,s=(t+n)/2,c=Math.max(0,s-o-i);v.push(c)}let y=new Set;for(let e of l)for(let t of e)y.add(h(t));let b=y.has(null),x=g.filter(e=>y.has(e)),S=[...b?[null]:[],...x],C=Object.create(null);for(let e of x)C[e]=0;b&&(C.null=0);for(let e of l){let t=Object.create(null),n=[];for(let r of e){let e=h(r);e===null?n.push(r):(t[e]||=[]).push(r)}for(let[e,n]of Object.entries(t)){let t=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);C[e]=Math.max(C[e]??0,t)}if(b&&n.length){let e=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);C.null=Math.max(C.null??0,e)}}let w=new Map;{let e=S.map(e=>(e===null?C.null:C[e])??0),t=-(e.reduce((e,t)=>e+t,0)+o*Math.max(0,S.length-1))/2;for(let n=0;np(e)),r=i-(e.reduce((e,t)=>e+t,0)+a*(t.length-1))/2;for(let[i,o]of t.entries()){let t=e[i];u[o]=r+t/2,d[o]=T+n/2,r+=t+a}}}let o=v[e]??0;T+=n+i+o}let E=new Map;for(let e of n.edges){let t=e.ref.id;E.has(t)||E.set(t,[]),E.get(t).push(e)}for(let[,e]of E){if(e.length===0)continue;let t=e[0].ref,r=t.start,i=t.end;if(r==null||i==null)continue;let a=Math.round(((u[r]??0)+(u[i]??0))/2),o=new Set;for(let t of e)o.add(t.src),o.add(t.dst);for(let e of o)e!==r&&e!==i&&n.nodeById.get(e)?.isDummy&&(u[e]=a)}return{x:u,y:d}}e(hn,`assignCoordinates`);var gn=8;function _n(e){let t=2166136261;for(let n=0;n>>0}e(_n,`hashString`);function vn(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}e(vn,`mulberry32`);function yn(e,t){let n=[...e],r=vn(t);for(let e=n.length-1;e>0;e--){let t=Math.floor(r()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n}e(yn,`deterministicShuffle`);function bn(e,t){let n=0;for(let[r,i]of e.entries())n+=Math.abs(r-(t.get(i)??r));return n}e(bn,`sourceDistance`);function xn(e,t){let n=new Map;for(let[t,r]of e.entries())n.set(r,t);let r=0;for(let{a:e,b:i,weight:a}of t){let t=n.get(e),o=n.get(i);t!=null&&o!=null&&(r+=a*Math.abs(t-o))}return r}e(xn,`laneArrangementCost`);function Sn(e){let t=Mt(e);if(t.length<2)return[];let n=new Map(t.map((e,t)=>[e,t])),r=jt(e),i=new Map;for(let t of e.layout.edges??[]){if(t.isLayoutOnly)continue;let a=typeof t.start==`string`?t.start:void 0,o=typeof t.end==`string`?t.end:void 0;if(!a||!o||!e.nodeById.has(a)||!e.nodeById.has(o))continue;let s=r(a),c=r(o);if(!s||!c||s===c)continue;let l=n.get(s),u=n.get(c);if(l==null||u==null)continue;let[d,f]=l<=u?[s,c]:[c,s],p=`${d}\0${f}`,m=i.get(p);m?m.weight++:i.set(p,{a:d,b:f,weight:1})}return[...i.values()]}e(Sn,`buildWeightedLaneEdges`);function Cn(e,t,n){let r=[...e],i=xn(r,t),a=!0,o=0,s=Math.max(1,r.length);for(;a&&oe.a===t.a?e.b.localeCompare(t.b):e.a.localeCompare(t.a)).map(({a:e,b:t,weight:n})=>`${e}:${t}:${n}`).join(`|`);return _n(`${e.join(`|`)}#${r}#${n}`)}e(Tn,`seedForRestart`);function En(e,t={}){let n=Mt(e);if(n.length<2)return n;let r=Sn(e);if(r.length===0)return n;let i=new Map(n.map((e,t)=>[e,t])),a=Cn(n,r,i),o=Math.max(0,t.restarts??gn);for(let e=0;e$&&c*3>=s?o>0?`bottom`:`top`:s>$?a>0?`right`:`left`:n}e(Pn,`chooseOrthogonalSide`);function Fn(e,t){return Math.abs(e.to-t.from)<$||Math.abs(e.to-t.to)<$?e.to:e.from}e(Fn,`sharedLineEndpointCoord`);function In(e,t){return e.orient===`vertical`?{x:e.coord,y:t}:{x:t,y:e.coord}}e(In,`pointOnLine`);function Ln(t,n){let r=t.nodes??[],i=t.edges??[],a=[];for(let e of i)e.isLayoutOnly||a.push({...e,__originalEdge:e});let o=new Map,s=new Map,c=[],l=n===`LR`;for(let e of r)o.set(e.id,e);let u=r.filter(e=>e.isGroup&&!e.parentId);for(let t of u){let n={id:t.id},i=e(e=>{s.set(e.id,n),r.filter(t=>t.parentId===e.id).forEach(i)},`assignLane`);i(t)}let d=r.filter(e=>!e.isGroup&&!e.isEdgeLabel).map(e=>{let t=e.width??10,n=e.height??10,r=e.x??0,i=e.y??0,a=On;return{nodeId:e.id,minX:r-t/2-a,maxX:r+t/2+a,minY:i-n/2-a,maxY:i+n/2+a,visualXHalfExtent:l?n/2+a:t/2+a}}),f=e((e,t,n,r)=>{let i=c.find(n=>n.orientation===e&&Math.abs(n.coord-t)<1);return i||(i={id:`pipe-${e}-${t.toFixed(0)}`,orientation:e,coord:t,spanMin:n,spanMax:r,tracks:[]},c.push(i)),i.spanMin=Math.min(i.spanMin,n),i.spanMax=Math.max(i.spanMax,r),i},`getOrAddPipe`),p=e((e,t)=>{let n=e.width??10,r=e.height??10,i=e.x??0,a=e.y??0;switch(t){case`top`:return{x:i,y:a-r/2};case`bottom`:return{x:i,y:a+r/2};case`left`:return{x:i-n/2,y:a};case`right`:return{x:i+n/2,y:a}}},`portForSide`),m=e((e,t,n)=>p(e,Pn(e,t,n?`bottom`:`top`)),`getOrthogonalPort`),h=[],g=[],_=new Set,v=1e3,y=e((e,t,n)=>{if(h.length===0)return 0;let r=Math.abs(t.y-n.y)<$,i=Math.abs(t.x-n.x)<$;if(!r&&!i)return 0;let a=0;if(r){let r=t.y,i=Math.min(t.x,n.x)-$,o=Math.max(t.x,n.x)+$;if(o<=i)return 0;for(let t of h)t.edgeIndex!==e&&t.orientation===`vertical`&&(t.pipe.coordo||t.from-$<=r&&t.to+$>=r&&(a+=v))}else if(i){let r=t.x,i=Math.min(t.y,n.y)-$,o=Math.max(t.y,n.y)+$;if(o<=i)return 0;for(let t of h)t.edgeIndex!==e&&t.orientation===`horizontal`&&(t.pipe.coordo||t.from-$<=r&&t.to+$>=r&&(a+=v))}return a},`crossingPenalty`),b=a.map((e,t)=>{if(!e.start||!e.end)return{idx:t,crossLane:0,dx:0,dy:0};let n=o.get(e.start),r=o.get(e.end),i=s.get(e.start),a=s.get(e.end);return{idx:t,crossLane:i&&a&&i.id!==a.id?1:0,dx:n&&r?Math.abs((r.x??0)-(n.x??0)):0,dy:n&&r?Math.abs((r.y??0)-(n.y??0)):0}}).sort((e,t)=>{if(e.crossLane!==t.crossLane)return t.crossLane-e.crossLane;let n=e.dx+e.dy,r=t.dx+t.dy;return Math.abs(n-r)>1?n-r:e.idx-t.idx}).map(e=>e.idx),x=e((e,t,n,r)=>{let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return!!d.find(c=>n&&c.nodeId===n||r&&c.nodeId===r?!1:Math.abs(e.x-t.x)>$?c.minYe.y&&c.maxX>i&&c.minXe.x&&c.maxY>o&&c.minYPn(e,t,`bottom`),`determineSide`),T=new Map;for(let[e,t]of a.entries()){if(!t.start||!t.end||t.start===t.end||t.points&&t.points.length>0)continue;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)continue;let i=(r.x??0)-(n.x??0),a=(r.y??0)-(n.y??0);T.set(e,{edgeIdx:e,srcId:t.start,dstId:t.end,srcSide:w(n,{x:r.x??0,y:r.y??0}),dstSide:w(r,{x:n.x??0,y:n.y??0}),absDx:Math.abs(i),absDy:Math.abs(a),dxSign:Math.sign(i),dySign:Math.sign(a)})}let E=e(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.absDx===0?1/0:e.absDy/e.absDx:e.absDy===0?1/0:e.absDx/e.absDy,`preferenceStrength`),D=e(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.dxSign>=0?`right`:`left`:e.dySign>=0?`bottom`:`top`,`secondarySide`),O=new Map;for(let e of T.values()){let t=`${e.srcId}:${e.srcSide}`;O.has(t)||O.set(t,[]),O.get(t).push(e)}let k=new Map,A=e((e,t)=>`${e}:${t}`,`loadKey`);for(let e of T.values())k.set(A(e.srcId,e.srcSide),(k.get(A(e.srcId,e.srcSide))??0)+1),k.set(A(e.dstId,e.dstSide),(k.get(A(e.dstId,e.dstSide))??0)+1);for(let e of O.values())if(!(e.length<2)){e.sort((e,t)=>{let n=E(e),r=E(t);return Math.abs(n-r)>1e-9?r-n:e.edgeIdx-t.edgeIdx});for(let t=1;t=i||(k.set(A(n.srcId,n.srcSide),i-1),k.set(A(n.srcId,r),a+1),n.srcSide=r)}}let j=e(e=>{let t=e?.shape;return t===`question`||t===`diamond`},`isDiamondNode`),M=new Map;for(let e of T.values())M.has(e.dstId)||M.set(e.dstId,new Set),M.get(e.dstId).add(e.dstSide);for(let e of T.values()){if(!j(o.get(e.srcId)))continue;let t=M.get(e.srcId);if(!t?.has(e.srcSide))continue;let n=D(e);if(t.has(n)||(k.get(A(e.srcId,n))??0)>0)continue;let r=k.get(A(e.srcId,e.srcSide))??0;k.set(A(e.srcId,e.srcSide),Math.max(0,r-1)),k.set(A(e.srcId,n),1),e.srcSide=n}for(let e of T.values()){let{edgeIdx:t,srcId:n,dstId:r,srcSide:i,dstSide:a}=e,s=o.get(n),c=o.get(r),l=`${n}:${i}:src`,u=i===`top`||i===`bottom`?c.x??0:c.y??0;S.has(l)||S.set(l,[]),S.get(l).push({edgeIdx:t,oppositeCoord:u});let d=`${r}:${a}:dst`,f=a===`top`||a===`bottom`?s.x??0:s.y??0;S.has(d)||S.set(d,[]),S.get(d).push({edgeIdx:t,oppositeCoord:f})}let N=new Map;for(let[e,t]of S){if(t.length<2)continue;t.sort((e,t)=>e.oppositeCoord-t.oppositeCoord);let n=e.split(`:`),r=n.slice(0,-2).join(`:`),i=n[n.length-2],a=n[n.length-1],s=o.get(r);if(!s)continue;let c=i===`left`||i===`right`?s.height??10:s.width??10,l=s.shape,u=l===`question`||l===`diamond`?c*.3:c,d=Math.min(20,Math.max(8,u/(t.length+1))),f=-(d*(t.length-1))/2;for(let[e,n]of t.entries()){let t=f+e*d,r=`${n.edgeIdx}:${a}`;N.set(r,t)}}let P=e(e=>!!a[e]?.labelNodeId,`edgeHasLabelNode`),F=e((e,t)=>e?(S.get(`${e}:${t}:src`)??[]).some(({edgeIdx:e})=>P(e))||(S.get(`${e}:${t}:dst`)??[]).some(({edgeIdx:e})=>P(e)):!1,`faceHasLabelNode`),I=e((e,t,n)=>t===`top`||t===`bottom`?{x:e.x+n,y:e.y}:{x:e.x,y:e.y+n},`applyPortOffset`),ee=e((e,t,n)=>{let r=T.get(e),i={x:n.x??0,y:n.y??0},a={x:t.x??0,y:t.y??0},o=r?.srcSide??w(t,i),s=r?.dstSide??w(n,a),c=r?p(t,r.srcSide):m(t,i,!0),l=r?p(n,r.dstSide):m(n,a,!1),u=N.get(`${e}:src`),d=N.get(`${e}:dst`);return u!==void 0&&(c=I(c,o,u)),d!==void 0&&(l=I(l,s,d)),{pSrcPort:c,pDstPort:l,srcSide:o,dstSide:s}},`portsForEdge`);for(let t of b){let n=a[t];if(g[t]=[],!n.start||!n.end||n.points&&n.points.length>0||n.start===n.end)continue;let r=o.get(n.start),i=o.get(n.end);if(!r||!i)continue;let{pSrcPort:s,pDstPort:u,srcSide:p,dstSide:m}=ee(t,r,i),v={...s},b={...u},w=p===`top`||p===`bottom`,T=m===`top`||m===`bottom`;w?v.y=s.y>(r.y??0)?s.y+Mn:s.y-Mn:v.x=s.x>(r.x??0)?s.x+Mn:s.x-Mn,T?b.y=u.y>(i.y??0)?u.y+Mn:u.y-Mn:b.x=u.x>(i.x??0)?u.x+Mn:u.x-Mn;let E=e((e,t)=>{for(let n of d)if(!t.includes(n.nodeId)&&e.x>n.minX&&e.xn.minY&&e.y{if(i){let i=e.y>(t.y??0);return{x:(n.x??0)>=e.x?r.maxX+kn:r.minX-kn,y:i?r.maxY+An:r.minY-An,leavesPositiveSide:i}}let a=e.x>(t.x??0),o=(n.y??0)>=e.y;return{x:a?r.maxX+kn:r.minX-kn,y:o?r.maxY+An:r.minY-An,leavesPositiveSide:a}},`obstacleDetour`),O=[],k=[n.start,n.end],A=E(v,k);if(A.inside&&A.obstacle){let e=A.obstacle;if(w){let t=D(s,r,i,e,!0);v.x=t.x,v.y=t.y;let n=t.leavesPositiveSide?Math.min(e.minY-2,s.y+Mn):Math.max(e.maxY+2,s.y-Mn);O=[{x:s.x,y:n},{x:t.x,y:n},{x:t.x,y:t.y}]}else{let t=D(s,r,i,e,!1),n=t.leavesPositiveSide?Math.min(e.minX-2,s.x+Mn):Math.max(e.maxX+2,s.x-Mn);v.x=t.x,v.y=t.y,O=[{x:n,y:s.y},{x:n,y:t.y},{x:t.x,y:t.y}]}}let j=[],M=E(b,k);if(M.inside&&M.obstacle){let e=M.obstacle;if(T){let t=D(u,i,r,e,!0);b.x=t.x,b.y=t.y,j=[{x:t.x,y:t.y},{x:u.x,y:t.y}]}else{let t=D(u,i,r,e,!1);b.x=t.x,b.y=t.y,j=[{x:t.x,y:t.y},{x:t.x,y:u.y}]}}if(O.length===0&&j.length===0){let e=kn,r=Math.abs(v.x-b.x)1||c>1,d=C.get(n.start??``)??0,f=C.get(n.end??``)??0,g=o>1&&F(n.start,p)||c>1&&F(n.end,m);if((r||i)&&!a&&(!l||l&&!g&&(o<=1||d<=2)&&(c<=1||f<=2))&&!x(s,u,n.start,n.end)){n.points=[{...s},{...v},{...b},{...u}],_.add(t);let e=i?`horizontal`:`vertical`,r=i?s.y:s.x,a=i?Math.min(s.x,u.x):Math.min(s.y,u.y),o=i?Math.max(s.x,u.x):Math.max(s.y,u.y),c={id:`fast-path-${e}-${r.toFixed(0)}-${t}`,orientation:e,coord:r,spanMin:a,spanMax:o,tracks:[]};h.push({edgeIndex:t,segmentIndex:0,orientation:e,pipe:c,trackIndex:0,from:a,to:o});continue}}v.x=f(`vertical`,v.x,v.y,v.y).coord,b.x=f(`vertical`,b.x,b.y,b.y).coord;let P=Math.min(v.x,b.x)-50,I=Math.max(v.x,b.x)+50,L=Math.min(v.y,b.y)-50,R=Math.max(v.y,b.y)+50;for(let e of d){let t=Math.min(v.x,b.x),n=Math.max(v.x,b.x),r=Math.min(v.y,b.y),i=Math.max(v.y,b.y);e.minXt&&e.minYr&&(P=Math.min(P,e.minX-jn),I=Math.max(I,e.maxX+jn),L=Math.min(L,e.minY-jn),R=Math.max(R,e.maxY+jn))}for(let e of d){if(e.maxXI||e.maxYR)continue;let t=kn;f(`horizontal`,e.minY-t,P,I),f(`horizontal`,e.maxY+t,P,I);let n=An;f(`vertical`,e.minX-n,L,R),f(`vertical`,e.maxX+n,L,R)}f(`horizontal`,v.y,P,I),f(`horizontal`,b.y,P,I);let z=c.filter(e=>e.orientation===`horizontal`&&e.coord>=L&&e.coord<=R),te=c.filter(e=>e.orientation===`vertical`&&e.coord>=P&&e.coord<=I),ne=e((e,t)=>`${e.toFixed(1)},${t.toFixed(1)}`,`getKey`),B=ne(v.x,v.y),re=ne(b.x,b.y),ie=new Map,ae=new Map,V=new Map,oe=new Set,H=[];ie.set(B,0),V.set(B,`n`),H.push({key:B,f:Math.hypot(b.x-v.x,b.y-v.y),pt:v}),oe.add(B);let U=[],W=e((e,t)=>x(e,t,n.start,n.end),`checkSegmentBlocked`),G={x:b.x,y:v.y},K=W(v,G),se=W(G,b),ce=K||se,le={x:v.x,y:b.y},ue=W(v,le),de=W(le,b);if(ce?ue||de||(U=Math.abs(v.x-b.x)<$?[v,b]:[v,le,b]):U=Math.abs(v.y-b.y)<$||Math.abs(v.x-b.x)<$?[v,b]:[v,G,b],U.length===0)for(;H.length>0;){H.sort((e,t)=>e.f-t.f);let e=H.shift();if(oe.delete(e.key),e.key===re){let e=re,t=b;for(U=[t];ae.has(e);){let n=ae.get(e);U.unshift(n),t=n,e=ne(n.x,n.y)}break}let r=e.pt.x,i=e.pt.y,a=te.sort((e,t)=>e.coord-t.coord),o=a.findIndex(e=>Math.abs(e.coord-r)<1),s=z.sort((e,t)=>e.coord-t.coord),c=s.findIndex(e=>Math.abs(e.coord-i)<1),l=[];o>0&&l.push({x:a[o-1].coord,y:i}),o>=0&&o0&&l.push({x:r,y:s[c-1].coord}),c>=0&&ce.nodeId===n.start||e.nodeId===n.end?!1:o===s?e.minXr&&e.maxY>c&&e.minYi&&e.maxX>o&&e.minX10&&x<-5||g<-10&&x>5)&&(m=Math.abs(x)*100),(h>10&&_<-5||h<-10&&_>5)&&(m+=Math.abs(_)*50);let S=0,C=V.get(e.key)??`n`,w=Math.abs(_)>$?`h`:`v`;C!==`n`&&C!==w&&(S=50);let T=f+p+m+S,E=(ie.get(e.key)??1/0)+T,D=Math.abs(b.x-a.x)+Math.abs(b.y-a.y);if(E<(ie.get(u)??1/0))if(ae.set(u,e.pt),ie.set(u,E),V.set(u,w),!oe.has(u))H.push({key:u,f:E+D,pt:a}),oe.add(u);else{let e=H.findIndex(e=>e.key===u);e!==-1&&(H[e].f=E+D)}}}if(U.length===0&&(U=[v,{x:v.x,y:b.y},b]),U.length>4){let t=U[0],n=U[U.length-1],r=Math.min(t.x,n.x),i=Math.max(t.x,n.x),a=Math.min(t.y,n.y),o=Math.max(t.y,n.y);for(let e of U)r=Math.min(r,e.x),i=Math.max(i,e.x),a=Math.min(a,e.y),o=Math.max(o,e.y);let s=i>Math.max(t.x,n.x),c=re.minXr&&e.minYa);if(s.length>0){let r=Math.max(t.x,n.x);for(let t of s){let n=(t.minX+t.maxX)/2;if(t.visualXHalfExtent===void 0||isNaN(t.visualXHalfExtent))continue;let i=n+t.visualXHalfExtent+e;r=Math.max(r,i)}isNaN(r)||(i=r)}}if(c){let i=d.filter(r=>r.minXMath.min(t.y,n.y));if(i.length>0){let a=Math.min(t.x,n.x);for(let t of i){let n=(t.minX+t.maxX)/2-t.visualXHalfExtent-e;a=Math.min(a,n)}r=a}}}let u=e(e=>{let r=n.y>t.y,i=d.filter(e=>{let r=Math.min(t.x,n.x)e.minX,i=Math.min(t.y,n.y)e.minY;return r&&i}),a=i;if(l&&i.length>0){let t=i.filter(t=>t.minXe);t.length>0&&(a=t)}if(a.length===0)return n.y;let o=kn;if(r){let e=Math.max(...a.map(e=>e.maxY))+o;if(ee.minY))-o;if(e>n.y+$)return e}return n.y},`findBestReturnY`),f=e(e=>{let r=u(e),i={x:e,y:t.y},a={x:e,y:r},o={x:n.x,y:r},s=W(t,i),c=W(i,a),l=W(a,o),d=r!==n.y&&W(o,n);return!s&&!c&&!l&&!d?Math.abs(r-n.y)<$?[t,i,a,n]:[t,i,a,o,n]:null},`trySimplifyWithDetourX`),p=s&&!c?f(i):c&&!s?f(r):null;p&&(U=p)}let q=[s,...O,...U,...j.reverse(),u];if(q.length>=3){let e=q[q.length-1],t=q[q.length-2],n=q[q.length-3],r=Math.abs(n.y-t.y)<$&&Math.abs(t.y-e.y)<$,i=Math.abs(n.x-t.x)<$&&Math.abs(t.x-e.x)<$;if(r){let r=Math.sign(t.x-n.x),i=Math.sign(e.x-n.x);r!==0&&r===i&&Math.abs(t.x-n.x)>Math.abs(e.x-n.x)&&q.splice(-2,1)}else if(i){let r=Math.sign(t.y-n.y),i=Math.sign(e.y-n.y);r!==0&&r===i&&Math.abs(t.y-n.y)>Math.abs(e.y-n.y)&&q.splice(-2,1)}}let J=[q[0]];for(let e=1;et.x!=r.x>n.x){J.push(n);continue}continue}if(Math.abs(t.x-n.x)<$&&Math.abs(n.x-r.x)<$){if(n.y>t.y!=r.y>n.y){J.push(n);continue}continue}J.push(n)}J.push(q[q.length-1]);for(let e=0;ee.from{let i=!r.segments.some(n=>(n.edgeIndex!==t.edgeIndex||n.segmentIndex!==t.segmentIndex)&&L(n,e)),a=!n.segments.some(n=>(n.edgeIndex!==e.edgeIndex||n.segmentIndex!==e.segmentIndex)&&L(n,t));return i&&a?(e.trackIndex=r.index,t.trackIndex=n.index,n.segments=[...n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),{edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,from:t.from,to:t.to}],r.segments=[...r.segments.filter(e=>e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex),{edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to}],!0):!1},`trySwapSegmentsAcrossTracks`),z=e(e=>{let t=e.tracks.length;return e.tracks[t]={index:t,coord:e.coord,segments:[]},t},`createNewTrack`),te=e((e,t)=>{let n=e.pipe.tracks[e.trackIndex];n.segments=n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),e.trackIndex=t,e.pipe.tracks[t].segments.push({edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to})},`moveSegmentToTrack`),ne=e((e,t)=>{let n=g[e.edgeIndex];for(let r of n){let n=h[r];n.pipe===e.pipe&&te(n,t)}},`moveSegmentChainToTrack`),B=e(e=>{let t=g[e.edgeIndex],n=t.indexOf(h.indexOf(e)),r=[];return n>0&&r.push(h[t[n-1]]),n{if(e.orientation===t.orientation)return!1;let n=e.orientation===`horizontal`?e:t,r=e.orientation===`horizontal`?t:e;return r.pipe.coord>n.from&&r.pipe.coordr.from&&n.pipe.coord{for(let n of e.tracks)if(!n.segments.some(e=>(e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex)&&L(e,t)))return n.index;return-1},`findAvailableTrack`),ae=e((e,t)=>{if(e.trackIndex===t.trackIndex)return L(e,t);let n=B(e),r=B(t);return n.some(e=>r.some(t=>re(e,t)))},`segmentsConflict`),V=e((e,t,n)=>{if(R(e,t,e.pipe.tracks[e.trackIndex],t.pipe.tracks[t.trackIndex]))return;let r=ie(e.pipe,t);n(t,r===-1?z(e.pipe):r)},`resolveTrackConflict`),oe=e(e=>{let t=0;for(let n=0;n{if(H.has(e))return H.get(e);let t=g[e];if(t.length===0){let t={dest:0,deviation:0,base:0,delta:0};return H.set(e,t),t}let n=h[t[0]].pipe.coord,r=n;for(let e=1;eMath.abs(t-n)?e:t;break}}let i=Math.abs(r-n),a={dest:r,deviation:i,base:n,delta:r-n};return H.set(e,a),a},`getDestInfo`),W=e(()=>{let t=0,n=new Map;for(let[e,t]of a.entries())g[e].length!==0&&t.start&&(n.has(t.start)||n.set(t.start,[]),n.get(t.start).push(e));let r=e(e=>{let t=a[e];if(!t.start||!t.end)return 0;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)return 0;let i=(r.x??0)-(n.x??0),s=(r.y??0)-(n.y??0);return Math.abs(i)+Math.abs(s)},`getEdgeDistance`);for(let e of n.values()){e.sort((e,t)=>{let n=U(e),i=U(t);if(Math.abs(n.deviation-i.deviation)>1)return n.deviation-i.deviation;if(Math.abs(n.dest-i.dest)>1)return n.dest-i.dest;let a=r(e),o=r(t);if(Math.abs(a-o)>1)return o-a;let s=g[e].length,c=g[t].length;if(s!==c)return s-c;if(s===1){let n=g[e][0],r=g[t][0];if(h[n]&&h[r]){let e=h[n],t=h[r],i=Math.abs(e.to-e.from),a=Math.abs(t.to-t.from);if(Math.abs(i-a)>1)return i-a}}return 0});let n=e.map(e=>h[g[e][0]]);t+=oe(n)}return t},`fixSourceHandleCrossings`),G=e(()=>{let t=0,n=new Map;for(let[e,t]of a.entries())g[e].length!==0&&t.end&&(n.has(t.end)||n.set(t.end,[]),n.get(t.end).push(e));for(let r of n.values()){r.sort((t,n)=>{let r=e(e=>{let t=g[e];if(t.length<2)return 0;let n=h[t[t.length-2]];return Math.abs(n.to-n.from)},`getDist`),i=r(t),a=r(n);return Math.abs(i-a)>.1?i-a:t-n});let n=r.map(e=>h[g[e][g[e].length-1]]);t+=oe(n)}return t},`fixTargetHandleCrossings`),K=e(()=>{let e=0;for(let t of c){let n=[];for(let e of t.tracks)for(let t of e.segments){let e=g[t.edgeIndex].find(e=>h[e].segmentIndex===t.segmentIndex);e!==void 0&&n.push(h[e])}n.sort((e,t)=>e.edgeIndex-t.edgeIndex||e.segmentIndex-t.segmentIndex);for(let t=0;t{e.segments.forEach(t=>{n.push({edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,trackIndex:e.index,from:t.from,to:t.to})})}),n.sort((e,t)=>e.from-t.from);let r=[];if(n.length>0){let e=[n[0]],t=n[0].to;for(let i=1;ir.add(e.trackIndex));let i=new Map;n.forEach(e=>{let t=U(e.edgeIndex);i.set(e.trackIndex,(i.get(e.trackIndex)??0)+t.delta)});let a=[...r].filter(e=>(i.get(e)??0)<-1),o=[...r].filter(e=>(i.get(e)??0)>1),s=[...r].filter(e=>Math.abs(i.get(e)??0)<=1);a.sort((e,t)=>(i.get(t)??0)-(i.get(e)??0)),o.sort((e,t)=>(i.get(e)??0)-(i.get(t)??0));let c=e((e,r)=>{n.filter(t=>t.trackIndex===e).forEach(e=>{let n=_.has(e.edgeIndex)?t.coord:r;ce.set(`${e.edgeIndex}-${e.segmentIndex}`,n)})},`assignCoord`),l=0;for(let e of a)l++,c(e,t.coord-l*Nn);if(s.length===0&&r.size>0){let e=[...r].sort((e,t)=>Math.abs(i.get(e)??0)-Math.abs(i.get(t)??0))[0],t=a.indexOf(e);t!==-1&&a.splice(t,1);let n=o.indexOf(e);n!==-1&&o.splice(n,1),s.push(e)}let u=0;for(let e of s){if(u===0)c(e,t.coord);else{let n=u%2==1?1:-1,r=Math.ceil(u/2);c(e,t.coord+n*r*Nn*.5)}u++}let d=0;for(let e of o)d++,c(e,t.coord+d*Nn)}}for(let[e,t]of a.entries()){let n=g[e]??[];if(n.length===0)continue;let r=[],{pSrcPort:i,pDstPort:a}=ee(e,o.get(t.start),o.get(t.end)),s=n.map(e=>{let t=h[e],n=ce.get(`${t.edgeIndex}-${t.segmentIndex}`)??t.pipe.coord;return{orient:t.orientation,coord:n,from:t.from,to:t.to}});r.push(i);for(let e=0;e$&&r.push(In(t,i)),c&&o.orient===t.orient)if(Math.abs(t.coord-o.coord)>$){let e=t.orient===`vertical`?(i+o.from)/2:Fn(t,o);r.push(In(t,e),In(o,e))}else(e===0||e===s.length-2)&&r.push(In(t,Fn(t,o)));else if(c)r.push(In(t,o.coord));else{let e=Math.abs(t.from-i)$||Math.abs(c.y-a.y)>$)&&r.push(a);let l=[];r.length>0&&l.push(r[0]);for(let e=1;e$||Math.abs(t.y-n.y)>$)&&l.push(t)}t.points=l}for(let e of a){let t=e.__originalEdge;t&&e.points&&(t.points=e.points)}t.edges=(t.edges??[]).filter(e=>!e.isLayoutOnly);let le=e((e,t)=>{let n=t.x??0,r=t.y??0,i=t.width??0,a=t.height??0;if(i<=0||a<=0)return e;let o=n-i/2,s=n+i/2,c=r-a/2,l=r+a/2;if(e.xs||e.yl)return e;let u=e.x-o,d=s-e.x,f=e.y-c,p=l-e.y,m=Math.min(u,d,f,p);return m===u?{x:o,y:e.y}:m===d?{x:s,y:e.y}:m===f?{x:e.x,y:c}:{x:e.x,y:l}},`nodeBoundaryClamp`);for(let e of t.edges){let t=e.points;if(!t||t.length<2)continue;let n=e.start,r=e.end,i=n?o.get(n):void 0,a=r?o.get(r):void 0;i&&(t[0]=le(t[0],i)),a&&(t[t.length-1]=le(t[t.length-1],a))}return t}e(Ln,`routeEdgesOrthogonal`);function Rn(e){return e.direction??`TB`}e(Rn,`getSwimlaneDirection`);function zn(e){let t=d(e),n=e.config.flowchart?.nodeSpacing??40,r=e.config.flowchart?.rankSpacing??100,i=e.config.swimlane?.ignoreCrossLaneEdges??!0,a=e.config.swimlane?.optimizeRanksByCrossings??!0,o=e.config.swimlane?.automaticLaneOrdering??!1,s=Rn(e),{ordered:c,coordinates:l}=Dn(t,{nodeGap:n,layerGap:r,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:s});f(t,c,l,{nodeGap:n,layerGap:r});for(let t of e.edges??[])delete t.points;Ln(e,s);for(let t of e.edges??[])(!t.curve||t.curve===`basis`)&&(t.curve=`rounded`);return _t(e,s),gt(e),s}e(zn,`runSwimlaneLayoutCore`);function Bn(e){u(e);let t=m(e);e.nodes=t.nodes,e.edges=t.edges}e(Bn,`prepareSwimlaneLayout`);var Vn=n({prepareLayout:Bn,runLayoutCore:zn,afterPaint:i});export{Vn as render}; \ No newline at end of file +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t}from"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import"./app-chunk-UA2S7LBM.js";import{r as n}from"./app-chunk-3FUC2YCW.js";import{t as r}from"./app-chunk-NETBCI7D.js";function i(e,{measure:t}){let n=e.config?.swimlane?.lineHops;if(n===!1)return;let i=n===`gap`?`gap`:`arc`,a=e.edges.filter(e=>Array.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));r(t.groups.edgePaths,a,{enabled:!0,jumpRadius:6,jumpStyle:i})}e(i,`applySwimlaneLineJumps`);var a=`__swimlane_default__`,o=21,s=20;function c(e){return Math.max(e.padding??s,s)}e(c,`topLaneHorizontalPadding`);function l(e){let{x:t,y:n,width:r,height:i}=e,a=e.swimlaneContentTop;if(typeof t!=`number`||typeof n!=`number`||typeof r!=`number`||typeof i!=`number`||typeof a!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a)||r<=0||i<=0){delete e.groupTitleRect;return}let s=n-i/2,c=Math.min(a,n+i/2),l=s+Math.min(o,Math.max(0,c-s));if(l<=s){delete e.groupTitleRect;return}e.groupTitleRect={left:t-r/2,right:t+r/2,top:s,bottom:l}}e(l,`assignTopLaneTitleRect`);function u(e){let t=e.direction,n=e.nodes??=[];for(let n of e.nodes??[])n.isGroup&&!n.parentId&&(n.shape=`swimlane`,t&&(n.direction=t));let r=n.filter(e=>!e.isGroup&&!e.parentId);if(r.length===0)return;let i=n.find(e=>e.id===a);i?i.isGroup&&(i.shape=`swimlane`,t&&(i.direction=t)):(i={id:a,label:``,isGroup:!0,shape:`swimlane`,padding:20,look:e.config?.look,colorIndex:n.reduce((e,t)=>Math.max(e,t.colorIndex??-1),-1)+1,...t?{direction:t}:{}},n.push(i));for(let e of r)e.parentId=a}e(u,`prepareLayoutForSwimlanes`);function d(e){let t=new Map;for(let n of e.nodes??[])t.set(n.id,n);let n=[];for(let t of e.edges??[]){let e=typeof t.start==`string`?t.start:void 0,r=typeof t.end==`string`?t.end:void 0;!e||!r||t.labelNodeId||n.push({id:t.id,src:e,dst:r,ref:t})}let r=e.nodes??[],i=r.filter(e=>e.isGroup),a=r.filter(e=>!e.isGroup);return{nodes:[...[...i].reverse(),...a].map(e=>e.id),edges:n,layout:e,nodeById:t}}e(d,`toGraphView`);function f(e,t,n,r){let{layout:i}=e,a=e.nodeById,o=r?.layerGap??100,s=r?.nodeGap??40,u=0;for(let e of t.layers){let t=0;for(let r of e){let e=a.get(r);if(!e){t++;continue}e.layer=u,e.order=t;let i=n.x[r]??t*s,c=n.y[r]??u*o;e.x=i,e.y=c,t++}u++}let d=i.nodes??[],f=new Map,p=[];for(let e of d){if(!e?.isGroup)continue;e.parentId||p.push(e);let t=d.filter(t=>t.parentId===e.id),r=1/0,i=-1/0,a=1/0,o=-1/0;for(let e of t){let t=e.x??n.x[e.id],s=e.y??n.y[e.id],c=e.width??0,l=e.height??0;t!=null&&s!=null&&(r=Math.min(r,t-c/2),i=Math.max(i,t+c/2),a=Math.min(a,s-l/2),o=Math.max(o,s+l/2))}if(r===1/0||a===1/0)e.x=e.x??0,e.y=e.y??0,e.width=e.width??0,e.height=e.height??0;else{let t=e.padding??20,n=e.parentId?t:2*c(e),s=t,l=Math.max(0,i-r)+n,u=Math.max(0,o-a)+s,d=(r+i)/2,p=(a+o)/2;e.x=d,e.y=p,e.width=l,e.height=u,f.set(e.id,{minX:r,maxX:i,minY:a,maxY:o})}}if(p.length>0&&f.size>0){let e=1/0,t=-1/0,n=0;for(let r of p){let i=r.padding??20;i>n&&(n=i);let a=f.get(r.id);a&&(e=Math.min(e,a.minY),t=Math.max(t,a.maxY))}if(e!==1/0&&t!==-1/0){let r=Math.max(0,t-e)+2*Math.max(n,36),i=(e+t)/2;for(let t of p)t.y=i,t.height=r,t.swimlaneContentTop=e;let a=[...p].sort((e,t)=>(e.x??0)-(t.x??0)),o=[],s=[],u=[];for(let e of a){let t=f.get(e.id);if(!t)continue;let n=Math.max(0,t.maxX-t.minX)+2*c(e),r=(t.minX+t.maxX)/2;o.push(e.id),s.push(r),u.push(n)}let d=o.length;if(d>0){let e=new Map;if(d===1)e.set(o[0],u[0]);else{let t=[];for(let e=0;e0&&i>0?{cx:t,cy:n,rect:P(t,n,r,i)}:void 0}e(g,`measuredNodeRect`);function _(e){if(e.isGroup)return;let t=g(e);if(t)return{id:String(e.id??``),cx:t.cx,cy:t.cy,rect:t.rect}}e(_,`nodeBoundsInfoFor`);function v(e,t,n=h){return Math.abs(e.x-t.x)n}e(x,`isHorizontalSegment`);function S(e,t,n=h){return y(e,t,n)&&Math.abs(e.y-t.y)>n}e(S,`isVerticalSegment`);function C(e,t,n,r){return Math.max(0,Math.min(Math.max(e,t),Math.max(n,r))-Math.max(Math.min(e,t),Math.min(n,r)))}e(C,`overlapLength`);function w(e,t,n=h){return e.horizontal&&t.horizontal&&b(e.a,t.a,n)?C(e.a.x,e.b.x,t.a.x,t.b.x):e.vertical&&t.vertical&&y(e.a,t.a,n)?C(e.a.y,e.b.y,t.a.y,t.b.y):0}e(w,`sameAxisSegmentOverlapLength`);function T(e,t=h){let n=[];for(let r=0;r0?n[n.length-1]:void 0;(!e||!v(e,r,t))&&n.push({x:r.x,y:r.y})}return n}e(D,`dedupeConsecutivePoints`);function O(e,t=h){if(!e||e.length!==4)return;let[n,r,i,a]=e;return x(n,r,t)&&S(r,i,t)&&x(i,a,t)?{kind:`HVH`,p0:n,p1:r,p2:i,p3:a}:S(n,r,t)&&x(r,i,t)&&S(i,a,t)?{kind:`VHV`,p0:n,p1:r,p2:i,p3:a}:void 0}e(O,`classifyThreeSegmentRoute`);function k(e,t,n,r=0){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return a>n.left-r&&in.top-r&&ot.left+n&&e.xt.top+n&&e.y=t.right&&e.top<=t.top&&e.bottom>=t.bottom}e(j,`rectContainsRect`);function M(e,t){return e.leftt.left&&e.topt.top}e(M,`rectsOverlap`);function N(e,t){return{left:e.left-t,right:e.right+t,top:e.top-t,bottom:e.bottom+t}}e(N,`inflateRect`);function P(e,t,n,r){return{left:e-n/2,right:e+n/2,top:t-r/2,bottom:t+r/2}}e(P,`rectFromCenterSize`);function F(e){return g(e)?.rect}e(F,`rectOfNodeBounds`);function I(e,t){switch(t){case`top`:return{x:e.cx,y:e.rect.top};case`bottom`:return{x:e.cx,y:e.rect.bottom};case`left`:return{x:e.rect.left,y:e.cy};case`right`:return{x:e.rect.right,y:e.cy}}}e(I,`portForRectSide`);function ee(e,t,n,r,i,a=h){let o=t===`left`||t===`right`,s=r===`left`||r===`right`;if(o&&s){if(t===`right`&&r===`left`&&e.xn.x){if(b(e,n,a))return[e,n];let t=(e.x+n.x)/2;return[e,{x:t,y:e.y},{x:t,y:n.y},n]}if(t===r){if(b(e,n,a))return;let r=t===`left`?Math.min(e.x,n.x)-i:Math.max(e.x,n.x)+i;return[e,{x:r,y:e.y},{x:r,y:n.y},n]}return}if(!o&&!s){if(t===r){if(y(e,n,a))return;let r=t===`top`?Math.min(e.y,n.y)-i:Math.max(e.y,n.y)+i;return[e,{x:e.x,y:r},{x:n.x,y:r},n]}if(!(t===`bottom`&&r===`top`&&e.yn.y))return;if(y(e,n,a))return[e,n];let o=(e.y+n.y)/2;return[e,{x:e.x,y:o},{x:n.x,y:o},n]}if(o&&!s){let i=t===`right`&&n.x>e.x||t===`left`&&n.xn.y;return i&&a?[e,{x:n.x,y:e.y},n]:void 0}let c=t===`bottom`&&n.y>e.y||t===`top`&&n.yn.x;return c&&l?[e,{x:e.x,y:n.y},n]:void 0}e(ee,`buildOrthogonalPortPath`);function L(e,t,n,r){return t===`left`||t===`right`?[e,{x:r,y:e.y},{x:r,y:n.y},n]:[e,{x:e.x,y:r},{x:n.x,y:r},n]}e(L,`buildSameSideTrackPath`);function R(e){let t=new Map,n=[];for(let r of e){if(r.isEdgeLabel)continue;let e=_(r);e&&(t.set(e.id,e),n.push({id:e.id,rect:e.rect}))}return{nodeInfoById:t,realNodeRects:n}}e(R,`collectRealNodeBounds`);function z(e){let t=[],n=[];for(let r of e){let e=_(r);if(!e)continue;let i={id:e.id,rect:e.rect};r.isEdgeLabel?n.push(i):t.push(i)}return{realNodeRects:t,labelNodeRects:n}}e(z,`collectNodeRectEntries`);function te(e,{includeEdgeLabels:t=!0}={}){let n=[];for(let r of e){if(r.isGroup||!t&&r.isEdgeLabel)continue;let e=r.x??0,i=r.y??0,a=r.width??0,o=r.height??0;n.push({nodeId:r.id,...P(e,i,a,o)})}return n}e(te,`collectLayoutNodeRects`);function ne(e,t,n=h){let r=e.start,i=e.end;if(!r||!i)return;let a=t.get(r),o=t.get(i);if(!(!a||!o))return{srcId:r,dstId:i,srcInfo:a,dstInfo:o,collinearX:Math.abs(a.cx-o.cx)m||f<_||f>v)return!1;let x=Math.abs(g-u.a.x)i:a&&s&&b(e,n,i)?C(e.x,t.x,n.x,r.x)>i:!1}e(ie,`sameAxisSegmentsOverlap`);function ae(e,t,n,r,{epsilon:i=h,skipDegenerateOther:a=!1}={}){for(let o of n){if(o===r||o.isLayoutOnly)continue;let n=o.points;if(!(!n||n.length<2))for(let r=0;rf+i&&mg+i&&d<_-i}e(V,`orthogonalSegmentsStrictlyCross`);function oe(e,t,n){let r=Math.min(t,n),i=Math.max(t,n);return e>r+h&&e=2?t[t.length-2]:void 0,n=e&&y(e,r)?{x:r.x,y:i.y}:{x:i.x,y:r.y};t.push(n)}t.push(i)}let n=[];for(let e of t){let t=n[n.length-1];(!t||!v(t,e))&&n.push(e)}return n}e(W,`orthogonalizePolyline`);function G(e){if(e.length<3)return e;let t=[...e];for(let e=0;e<32;e++){let e=U(t);if(t=e.points,!e.changed)break}return t}e(G,`simplifyPolyline`);var K=.001,se=.5,ce=4;function le(e,t,n){let r=e;if(r.isLayoutOnly||!r.points||r.points.length=0&&i=e.length)return e;let a=i-r;if(a<0||a>=e.length)return e;let o=ue(e[i],e[a],t);return n?[o,...e.slice(i)]:[...e.slice(0,i+1),o]}e(de,`clipEndpoint`);function q(e,t){for(let n of e){let e=le(n,t,2);if(!e)continue;let r=[...e.points];e.srcRect&&(r=de(r,e.srcRect,!0)),e.dstRect&&(r=de(r,e.dstRect,!1)),r=G(W(r)),r=xe(r,e.srcRect,e.dstRect),e.edge.points=G(W(r))}}e(q,`clipEdgeEndpointsToNodeBoundaries`);function J(e,t,n,r=!1){if(b(e,t,K)){if(t.yn.bottom+K)return t;if(r){if(e.xn.right+K)return{x:n.right,y:e.y}}return{x:Math.abs(t.x-n.left)<=Math.abs(t.x-n.right)?n.left:n.right,y:e.y}}if(y(e,t,K)){if(t.xn.right+K)return t;if(r){if(e.yn.bottom+K)return{x:e.x,y:n.bottom}}let i=Math.abs(t.y-n.top)<=Math.abs(t.y-n.bottom);return{x:e.x,y:i?n.top:n.bottom}}return t}e(J,`snapEndpointToBoundary`);function fe(e,t,n){let r=e[t];for(let i=t+n;i>=0&&ie.lo)),n=Math.min(...e.map(e=>e.hi));if(!(t>n))return{lo:t,hi:n}}e(he,`intersectRanges`);function ge(e,t){return t===`left`||t===`right`?pe(e.top,e.bottom):pe(e.left,e.right)}e(ge,`clearanceRangeForSide`);function _e(e,t,n){let r=e.y>=n.top-K&&e.y<=n.bottom+K,i=e.x>=n.left-K&&e.x<=n.right+K;if(b(e,t,K)&&r){if(Math.abs(e.x-n.left)0?he(a):void 0}e(ye,`straightClearanceRange`);function be(e,t,n,r,i){let a=ye(e,t,n,r,i);if(!a)return;let o=i?e.y:e.x,s=Math.min(a.hi,Math.max(a.lo,o));if(!(Math.abs(s-o)({...e}));for(let s=t;s>=0&&s=n.left-K&&Math.max(e.x,t.x)<=n.right+K,i=Math.min(e.y,t.y)>=n.top-K&&Math.max(e.y,t.y)<=n.bottom+K;if(Math.abs(e.y-n.top)r.bottom+K;case`left`:return b(t,n,K)&&n.xr.right+K}}e(Ee,`leavesOutward`);function De(e,t,n){if(e.length<3)return e;if(n){let n=Te(e[0],e[1],t);return n&&Ee(n,e[1],e[2],t)?e.slice(1):e}let r=e.length-1,i=Te(e[r-1],e[r],t);return i&&Ee(i,e[r-1],e[r-2],t)?e.slice(0,r):e}e(De,`collapseOwnBorderStub`);function Oe(e,t,n){let r=e;if(t){let e=fe(r,0,1);if(e){let n=J(e,r[0],t);n!==r[0]&&(r=[n,...r.slice(1)])}r=De(r,t,!0)}if(n){let e=r.length-1,t=fe(r,e,-1);if(t){let i=J(t,r[e],n,!0);i!==r[e]&&(r=[...r.slice(0,e),i])}r=De(r,n,!1)}let i=xe(r,t,n);return i!==r||r.length===2?i:(t&&(r=we(r,t,!0)),n&&(r=we(r,n,!1)),r)}e(Oe,`snapAndCollapseEndpoints`);function ke(e,t){for(let n of e){let e=le(n,t,2);if(!e)continue;let r=Oe(D(e.points,K),e.srcRect,e.dstRect);if(r.length<3){e.edge.points=r;continue}let i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];e.edge.points=i}}e(ke,`prepareEdgeEndpointsForRenderer`);function Ae(e){return new Map(e.map(e=>[e.id,e]))}e(Ae,`buildNodeMap`);function je(e,t){let n=e.parentId,r=null;for(;n;){let e=t.get(n);if(!e?.isGroup)break;r=e.id,n=e.parentId}return r}e(je,`resolveTopLevelGroupId`);function Me(e,t){let n=0,r=e.parentId;for(;r;){let e=t.get(r);if(!e?.isGroup)break;n++,r=e.parentId}return n}e(Me,`groupDepth`);function Ne(e){let t=1/0,n=-1/0,r=1/0,i=-1/0;for(let a of e){let e=a.x,o=a.y;if(typeof e!=`number`||typeof o!=`number`)continue;let s=a.width??0,c=a.height??0;t=Math.min(t,e-s/2),n=Math.max(n,e+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}return t===1/0||r===1/0?null:{minX:t,maxX:n,minY:r,maxY:i}}e(Ne,`boundsForChildren`);function Pe(e,t){let n=e.padding??20;e.x=(t.minX+t.maxX)/2,e.y=(t.minY+t.maxY)/2,e.width=Math.max(0,t.maxX-t.minX)+n,e.height=Math.max(0,t.maxY-t.minY)+n}e(Pe,`applyGroupBounds`);function Fe(e){let t=Ae(e),n=e.filter(e=>e.isGroup&&e.parentId).sort((e,n)=>Me(n,t)-Me(e,t));for(let t of n){let n=Ne(e.filter(e=>e.parentId===t.id));n&&Pe(t,n)}}e(Fe,`recomputeNestedGroupBounds`);function Ie(t,n){let r=t.nodes??[],i=t.edges??[],a=r.filter(e=>!e.isGroup),o=1/0,s=-1/0;for(let e of a){let t=e[n];typeof t==`number`&&(o=Math.min(o,t),s=Math.max(s,t))}if(!Number.isFinite(o)||!Number.isFinite(s))return!1;let c=e(e=>o+s-e,`mirror`);for(let e of r){let t=e[n];typeof t==`number`&&(e[n]=c(t));let r=e.groupTitleRect;r&&(e.groupTitleRect=n===`x`?{...r,left:c(r.right),right:c(r.left)}:{...r,top:c(r.bottom),bottom:c(r.top)})}for(let e of i)for(let t of e.points??[])t[n]=c(t[n]);return!0}e(Ie,`mirrorAxis`);function Le(e){return!(e.nodes??[]).some(e=>!e.isGroup)||Ie(e,`y`)}e(Le,`applyBtDirectionTransform`);function Re(e,t=`LR`){let n=e.nodes??[],r=e.edges??[],i=n.filter(e=>!e.isGroup),a=1/0,o=1/0;for(let e of i){let t=e.x??0,n=e.y??0;t0?Math.max(1,l/u):1;for(let e of i){let t=e.x??0,n=((e.y??0)-o)*d+36,r=t-a;e.x=n,e.y=r}for(let e of r)if(e.points)for(let t of e.points){let e=t.x,n=(t.y-o)*d+36,r=e-a;t.x=n,t.y=r}Fe(n);let f=n.filter(e=>e.isGroup&&!e.parentId);if(f.length===0)return t===`RL`&&Ie(e,`x`),!0;let p=Ae(n),m=new Map;for(let e of n){if(e.isGroup)continue;let t=je(e,p);if(!t)continue;let n=m.get(t)??[];n.push(e),m.set(t,n)}let h=0;for(let e of f){let t=e.padding??0;t>h&&(h=t)}let g=[],_=1/0,v=-1/0;for(let e of f){let t=Ne(m.get(e.id)??[]);t&&(_=Math.min(_,t.minX),v=Math.max(v,t.maxX),g.push({lane:e,contentTop:t.minY,contentBottom:t.maxY,centerY:(t.minY+t.maxY)/2}))}if(_===1/0||v===-1/0)return!0;let y=Math.max(0,v-_)+2*Math.max(h,10),b=36+y,x=(_+v)/2-y/2-36,S=x+b/2,C=Math.max(h,36);g.sort((e,t)=>e.centerY-t.centerY);for(let e=0;ed.cy?g.bottom:g.top,t=d.cx+n;if(t<=g.left+ze||t>=g.right-ze)continue;i={x:t,y:e},a={x:t,y:o.y},c={x:o.x,y:o.y}}else{let e=f.cx>d.cx?g.right:g.left,t=d.cy+n;if(t<=g.top+ze||t>=g.bottom-ze)continue;i={x:e,y:t},a={x:o.x,y:t},c={x:o.x,y:o.y}}let p=v(i,a,ze),m=v(a,c,ze);if(p&&m||!p&&B(i,a,r,[l],1)||!m&&B(a,c,r,[u],1))continue;let _=!p&&ae(i,a,e,t,{epsilon:ze,skipDegenerateOther:!0}),y=!m&&ae(a,c,e,t,{epsilon:ze,skipDegenerateOther:!0});if(!(_||y)){h=p?[a,c]:m?[i,a]:[i,a,c];break}}h&&(t.points=h)}}e(He,`portSwapToLShape`);function Ue(t,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=z(n.values());for(let o of t){if(o.isLayoutOnly)continue;let s=o.points;if(!s||s.length<4)continue;let c=D(s,r);if(c.length<4)continue;let l=c.length-1,u=c[l],d=c[l-1],f=c[l-2],p=u.x-d.x,m=u.y-d.y,h=Math.hypot(p,m);if(h>=10||h0;P={x:f.x,y:M},I={x:e?N.right:N.left,y:M}}if(B(P,I,i,E?[E]:[],-2)||B(P,I,a,[],-2))continue;if(O){let e=n.get(O),t=e?F(e):void 0;if(t&&A(P,t,2))continue}let ee=e((e,t)=>`${e.x.toFixed(3)},${e.y.toFixed(3)}|${t.x.toFixed(3)},${t.y.toFixed(3)}`,`ownSegmentKey`),L=new Set;for(let e=0;e{for(let i of t){if(i===o||i.isLayoutOnly)continue;let t=i.points;if(!(!t||t.length<2))for(let i=0;i=0){let e=c[l-3],t=[O,E].filter(e=>!!e);if(B(e,P,i,t,-2)||R(e,P))continue}let z=[...c.slice(0,l-2),P,I];o.points=z;let te=o.labelNodeId;if(te){let e=n.get(te);if(e){let t=e.width??0,n=e.height??0;if(t>0&&n>0){let i,a,o=-1;for(let e=0;e=t+2||d&&l>=n+2)&&l>o&&(o=l,i=(s.x+c.x)/2,a=(s.y+c.y)/2)}i!==void 0&&a!==void 0&&(e.x=i,e.y=a)}}}}}e(Ue,`collapseShortTerminalStub`);var Y=.001,X=8,Z=T,We=e((e,t)=>y(e,t,Y)||b(e,t,Y),`orthogonallyAligned`);function Ge(t,n){let r=e((e,t)=>{let n=e.x??0,r=e.y??0,i=t.x-n,a=t.y-r,o=(e.width??0)/2,s=(e.height??0)/2;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),{x:n+(a===0?0:s*i/a),y:r+s}):(i<0&&(o=-o),{x:n+o,y:r+(i===0?0:o*a/i)})},`rectIntersect`),i=e((e,t)=>{let i=D(e.points??[]);if(i.length<2)return;let a=t?e.start:e.end,o=a?n.get(a):void 0,s=o?F(o):void 0;if(!o||!a||!s)return;let c=t?i[0]:i[i.length-1],l=t?i[1]:i[i.length-2],u=r(o,c),d=c;if(We(l,u)&&(d=l),y(u,d,Y))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`V`,coord:u.x,min:Math.min(u.y,d.y),max:Math.max(u.y,d.y),boundary:u,railEnd:d,rect:s};if(b(u,d,Y))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`H`,coord:u.y,min:Math.min(u.x,d.x),max:Math.max(u.x,d.x),boundary:u,railEnd:d,rect:s}},`terminalLaneFor`),a=e((e,t)=>Math.max(0,Math.min(e.max,t.max)-Math.max(e.min,t.min)),`projectedOverlapLength`),o=e((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:e.orientation===`H`?(Math.abs(e.boundary.x-e.rect.left)<1||Math.abs(e.boundary.x-e.rect.right)<1)&&y(e.boundary,t.boundary,1):(Math.abs(e.boundary.y-e.rect.top)<1||Math.abs(e.boundary.y-e.rect.bottom)<1)&&b(e.boundary,t.boundary,1),`sameTerminalFace`),s=e((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:a(e,t)>=X&&Math.abs(e.coord-t.coord)<.5,`exactTerminalLaneConflict`),c=e((e,t)=>{if(e.nodeId!==t.nodeId||e.orientation!==t.orientation||e.orientation!==`H`||e.atStart===t.atStart)return!1;let n=a(e,t);if(n2*r?!1:o(e,t)&&Math.abs(e.coord-t.coord)<16},`nearTerminalLaneConflict`),l=e((t,n)=>{let r=D(t.edge.points??[]);if(r.length<2)return;let i=t.orientation===`V`?{x:t.boundary.x+n,y:t.boundary.y}:{x:t.boundary.x,y:t.boundary.y+n},a=t.orientation===`V`?{x:t.railEnd.x+n,y:t.railEnd.y}:{x:t.railEnd.x,y:t.railEnd.y+n};if(!e(()=>Math.abs(t.boundary.y-t.rect.top)<1||Math.abs(t.boundary.y-t.rect.bottom)<1?b(i,t.boundary,Y)&&i.x>=t.rect.left+1&&i.x<=t.rect.right-1:Math.abs(t.boundary.x-t.rect.left)<1||Math.abs(t.boundary.x-t.rect.right)<1?y(i,t.boundary,Y)&&i.y>=t.rect.top+1&&i.y<=t.rect.bottom-1:!1,`boundaryStaysOnSameFace`)())return;if(t.atStart){let e=r.length>1&&v(r[1],t.railEnd,Y),n=r.slice(e?2:1),o=n[0];return o&&!We(o,a)?void 0:[i,a,...n]}let o=r.length>1&&v(r[r.length-2],t.railEnd,Y),s=r.slice(0,o?-2:-1),c=s[s.length-1];if(!(c&&!We(c,a)))return[...s,a,i]},`shiftedCandidate`),u=e(e=>{let t=e.edge,r=D(t.points??[]);if(r.length!==2)return!1;let i=t.start,a=t.end,o=i?n.get(i):void 0,s=a?n.get(a):void 0;if(!o||!s)return!1;let c=o.x??0,l=o.y??0,u=s.x??0,d=s.y??0,[f,p]=r;return b(f,p,Y)&&Math.abs(l-d)<1&&Math.abs(c-u)>1||y(f,p,Y)&&Math.abs(c-u)<1&&Math.abs(l-d)>1},`laneIsStraightCollinearConnector`),d=[-7,7,-14,14,-21,21];for(let e=0;e<8;e++){let e=t.filter(e=>!e.isLayoutOnly).flatMap(e=>[i(e,!0),i(e,!1)]).filter(e=>!!e),n=!1;for(let t=0;t{let n=u(e),r=u(t);return n===r?Number(!t.atStart)-Number(!e.atStart):Number(n)-Number(r)});for(let t of p){for(let r of d){let a=l(t,r);if(!a)continue;let o=i({...t.edge,points:a},t.atStart);if(!(!o||e.some(e=>e.edge!==t.edge&&(s(o,e)||f&&c(o,e))))){t.edge.points=a,n=!0;break}}if(n)break}}if(!n)return}}e(Ge,`separateSharedRenderedTerminalLanes`);function Ke(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=e((e,n)=>{let a=e.start,o=e.end,s=Z(n);if(s.length!==n.length-1)return!1;let c=[a,o].filter(e=>!!e);for(let e of s)if(B(e.a,e.b,r,c,-2)||B(e.a,e.b,i,[],-2))return!1;for(let n of t){if(n===e||n.isLayoutOnly)continue;let t=n.points;if(!(!t||t.length<2)){for(let e of s)for(let n of Z(D(t)))if(w(e,n,.5)>=X||V(e.a,e.b,n.a,n.b,Y))return!1}}return!0},`candidateIsSafe`),o=e((e,t)=>{if(t+4>=e.length)return;let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=e[t+4],s=x(n,r)&&S(r,i)&&x(i,a)&&S(a,o)&&y(n,a,Y)&&y(n,o,Y)&&y(r,i,Y)&&(r.x-n.x)*(a.x-i.x)<0,c=S(n,r)&&x(r,i)&&S(i,a)&&x(a,o)&&b(n,a,Y)&&b(n,o,Y)&&b(r,i,Y)&&(r.y-n.y)*(a.y-i.y)<0;if(s||c)return D([...e.slice(0,t+1),o,...e.slice(t+5)]);if(t+5>=e.length)return;let l=e[t+5],u=S(n,r)&&x(r,i)&&S(i,a)&&x(a,o)&&S(o,l)&&y(n,o,Y)&&y(n,l,Y)&&y(i,a,Y)&&(i.x-r.x)*(o.x-a.x)<0,d=x(n,r)&&S(r,i)&&x(i,a)&&S(a,o)&&x(o,l)&&b(n,o,Y)&&b(n,l,Y)&&b(i,a,Y)&&(i.y-r.y)*(o.y-a.y)<0;if(!(!u&&!d))return D([...e.slice(0,t+1),l,...e.slice(t+6)])},`withoutDogleg`);for(let e=0;e<8;e++){let e=!1;for(let n of t){if(n.isLayoutOnly)continue;let t=D(n.points??[]);for(let r=0;r<=t.length-5;r++){let i=o(t,r);if(!(!i||!a(n,i))){n.points=i,e=!0;break}}if(e)break}if(!e)return}}e(Ke,`collapseRedundantRectangularDoglegs`);function qe(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t,n)=>D(e===t?n??[]:e.points??[]),`pointsFor`),s=e((e,t)=>{let n=0;for(let r=0;r{let t=Z(e);if(t.length!==3)return;let n=t[1];if(t[0].horizontal!==n.horizontal&&t[2].horizontal!==n.horizontal)return{index:n.index,horizontal:n.horizontal,vertical:n.vertical,segment:n}},`middleRail`),l=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);return r.filter(e=>{if(n.includes(e.id))return!1;let r=e.rect;return t.horizontal?C(t.a.x,t.b.x,r.left,r.right)>=X&&t.a.y>=r.top-2&&t.a.y<=r.bottom+2:C(t.a.y,t.b.y,r.top,r.bottom)>=X&&t.a.x>=r.left-2&&t.a.x<=r.right+2})},`blockingRectsFor`),u=e((e,t,n)=>{let r=e.map(e=>({...e}));if(t.horizontal)r[t.index].y=n,r[t.index+1].y=n;else if(t.vertical)r[t.index].x=n,r[t.index+1].x=n;else return;let i=G(D(r));return Z(i).length===i.length-1?i:void 0},`candidateByMovingRail`),d=e((e,t,n)=>{let c=[e.start,e.end].filter(e=>!!e),l=Z(t);if(l.length!==t.length-1)return!1;for(let e of l)if(B(e.a,e.b,r,c,-2)||B(e.a,e.b,i,[],-2))return!1;for(let t of a)if(t!==e){for(let e of l)for(let n of Z(o(t)))if(w(e,n,.5)>=X)return!1}return s(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=s(),t=!1;for(let n of a){let r=o(n),i=c(r);if(!i)continue;let a=l(n,i.segment);if(a.length===0)continue;let s=i.horizontal?[Math.min(...a.map(e=>e.rect.top))-20,Math.max(...a.map(e=>e.rect.bottom))+20]:[Math.min(...a.map(e=>e.rect.left))-20,Math.max(...a.map(e=>e.rect.right))+20];for(let a of s){let o=u(r,i.segment,a);if(!(!o||!d(n,o,e))){n.points=o,t=!0;break}}if(t)break}if(!t)return}}e(qe,`liftObstacleHuggingSameSideRails`);function Je(t,n){let r=e(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),i=e(e=>{if(!e.isGroup||e.parentId)return;let t=e.direction,n=typeof t==`string`?t.toUpperCase():``;if(n===`LR`||n===`RL`||n===`BT`)return;let i=r(e),a=e.y,o=e.height;if(!i||typeof a!=`number`||typeof o!=`number`||!Number.isFinite(a)||!Number.isFinite(o)||o<=0)return;let s=i.right-i.left,c=i.bottom-i.top;if(!(c<=0||s{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+Y||n>=t.bottom-Y?!1:C(e.a.x,e.b.x,t.left,t.right)>=X},`horizontalSegmentIntersectsTitle`),o=[...n.values()].map(i).filter(e=>!!e);if(o.length===0)return;let s=0;for(let e of t){if(e.isLayoutOnly)continue;let t=D(e.points??[]);for(let e of Z(t))for(let t of o)a(e,t.rect)&&(s=Math.max(s,t.rect.bottom-e.a.y+4))}if(!(s<=Y))for(let e of o){let t=e.node.y,n=e.node.height;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.y=t-s/2,e.node.height=n+s,e.node.groupTitleRect={...e.rect,top:e.rect.top-s,bottom:e.rect.bottom-s})}}e(Je,`liftTopLaneTitleBandsAboveRails`);function Ye(t,n){let r=e(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),i=e(e=>{if(!e.isGroup||e.parentId||e.direction!==`LR`)return;let t=r(e),n=e.x,i=e.width;if(!t||typeof n!=`number`||typeof i!=`number`||!Number.isFinite(n)||!Number.isFinite(i)||i<=0)return;let a=t.right-t.left,o=t.bottom-t.top;if(!(a<=0||o{if(!e.vertical)return!1;let n=e.a.x;return n<=t.left+Y||n>=t.right-Y?!1:C(e.a.y,e.b.y,t.top,t.bottom)>=X},`verticalSegmentIntersectsTitle`),o=e((e,t)=>{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+Y||n>=t.bottom-Y?!1:C(e.a.x,e.b.x,t.left,t.right)>=X},`horizontalSegmentIntersectsTitle`),s=[...n.values()].map(i).filter(e=>!!e);if(s.length===0)return;let c=0;for(let e of t){if(e.isLayoutOnly)continue;let t=D(e.points??[]);for(let e of Z(t))for(let t of s)if(a(e,t.rect))c=Math.max(c,t.rect.right-e.a.x+4);else if(o(e,t.rect)){let n=Math.min(e.a.x,e.b.x);c=Math.max(c,t.rect.right-n+4)}}if(!(c<=Y))for(let e of s){let t=e.node.x,n=e.node.width;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.x=t-c/2,e.node.width=n+c,e.node.groupTitleRect={...e.rect,left:e.rect.left-c,right:e.rect.right-c})}}e(Ye,`shiftLeftLaneTitleBandsLeftOfRails`);function Xe(t,n){let{realNodeRects:r}=z(n.values()),i=t.filter(e=>!e.isLayoutOnly),a=e((e,t=new Map)=>D(t.get(e)??e.points??[]),`replacementPointsFor`),o=e((e=new Map)=>{let t=0;for(let n=0;ni.reduce((t,n)=>t+E(a(n,e)),0),`totalBends`),c=e(e=>{let t=a(e);if(t.length<4)return;let n=t[t.length-2],r=t[t.length-1];if(!(!x(n,r,Y)&&!S(n,r,Y)))return{tailStart:n,terminal:r}},`terminalTailFor`),l=e((e,t)=>{let n=a(e);if(n.length<3)return;let r=n[0],i=n[1],o;if(x(r,i,Y))o={x:i.x,y:t.tailStart.y};else if(S(r,i,Y))o={x:t.tailStart.x,y:i.y};else return;let s=G(D([r,i,o,t.tailStart,t.terminal]));return Z(s).length===s.length-1?s:void 0},`candidateWithDestinationTail`),u=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Z(t))if(B(e.a,e.b,r,n,-2))return!0;return!1},`pathHasNodeHit`),d=e((e,t,n)=>{for(let r of i)if(r!==e){for(let e of Z(t))for(let t of Z(a(r,n)))if(w(e,t,.5)>=X)return!0}return!1},`pathHasSharedTrack`),f=e((e,t,n)=>!u(e,t)&&!d(e,t,n),`candidateIsSafe`),p=e(()=>{let e=new Map;for(let t of i){let r=t.end;if(!r||!n.has(r)||a(t).length<4)continue;let i=e.get(r)??[];i.push(t),e.set(r,i)}return e},`edgesByDestination`);for(let e=0;e<4;e++){let e=o();if(e===0)return;let t=s(),n,r=e,i=t;for(let t of p().values())for(let a=0;a=e||y>r||y===r&&b>=i||(n=v,r=y,i=b)}if(!n)return;for(let[e,t]of n)e.points=t}}e(Xe,`swapDestinationTerminalTailsToReduceCrossings`);function Ze(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t=new Map)=>D(t.get(e)??e.points??[]),`replacementPointsFor`),s=e((e=new Map)=>{let t=0;for(let n=0;na.reduce((t,n)=>t+E(o(n,e)),0),`totalBends`),l=e(e=>{let t=e.start,r=e.end,i=t?n.get(t):void 0,a=r?n.get(r):void 0,o=i?F(i):void 0,s=a?F(a):void 0;return o&&s?{src:o,dst:s}:void 0},`endpointRectsFor`),u=e((e,t,n)=>{if(n.index<=0||n.index+1>=t.length-1)return;let r=l(e);if(r){if(n.vertical){let i=n.a.x,a=Math.min(r.src.left,r.dst.left),o=Math.max(r.src.right,r.dst.right),s=io+Y?`right`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`vertical`,side:s,coord:i,min:Math.min(n.a.y,n.b.y),max:Math.max(n.a.y,n.b.y)}:void 0}if(n.horizontal){let i=n.a.y,a=Math.min(r.src.top,r.dst.top),o=Math.max(r.src.bottom,r.dst.bottom),s=io+Y?`bottom`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`horizontal`,side:s,coord:i,min:Math.min(n.a.x,n.b.x),max:Math.max(n.a.x,n.b.x)}:void 0}}},`externalRailForSegment`),d=e(()=>{let e=[];for(let t of a){let n=o(t);for(let r of Z(n)){let i=u(t,n,r);i&&e.push(i)}}return e},`collectExternalRails`),f=e((e,t)=>e.edge!==t.edge&&e.axis===t.axis&&e.side===t.side&&C(e.min,e.max,t.min,t.max)>=X,`railsInteract`),p=e(e=>{let t=[],n=new Set;for(let r of e){if(n.has(r))continue;let i=[r],a=[];for(n.add(r);i.length>0;){let t=i.pop();a.push(t);for(let r of e)!n.has(r)&&f(t,r)&&(n.add(r),i.push(r))}a.length>1&&t.push(a)}return t},`connectedComponents`),m=e(e=>{let t=[];for(let n of e)t.some(e=>Math.abs(e-n.coord){let n=t.map(e=>e.coord),r=m(t),i=[];if(t.length<=6){let a=Array(r.length).fill(!1),o=[],s=e(()=>{if(o.length===t.length){o.some((e,t)=>Math.abs(e-n[t])>=Y)&&i.push([...o]);return}for(let[e,t]of r.entries())a[e]||(a[e]=!0,o.push(t),s(),o.pop(),a[e]=!1)},`visit`);return s(),i}for(let e=0;e{let n=new Map;for(let[r,i]of e.entries()){let e=t[r],a=n.get(i.edge)??i.points.map(e=>({x:e.x,y:e.y}));i.axis===`vertical`?(a[i.segmentIndex].x=e,a[i.segmentIndex+1].x=e):(a[i.segmentIndex].y=e,a[i.segmentIndex+1].y=e),n.set(i.edge,a)}let r=new Map;for(let[e,t]of n){let n=G(D(t));if(Z(n).length!==n.length-1)return;r.set(e,n)}return r},`replacementsForAssignment`),_=e(e=>{for(let[t,n]of e){let e=[t.start,t.end].filter(e=>!!e);for(let t of Z(n))if(B(t.a,t.b,r,e,-2)||B(t.a,t.b,i,[],-2))return!1}for(let t=0;t=X)return!1}}return!0},`candidateIsSafe`);for(let e=0;e<4;e++){let e=s();if(e===0)return;let t,n=e,r=c(),i=1/0;for(let a of p(d()))for(let o of h(a)){let l=g(a,o);if(!l||!_(l))continue;let u=s(l);if(u>=e)continue;let d=c(l),f=a.reduce((e,t,n)=>e+Math.abs(o[n]-t.coord),0);u>n||u===n&&(d>r||d===r&&f>=i)||(t=l,n=u,r=d,i=f)}if(!t)return;for(let[e,n]of t)e.points=n}}e(Ze,`reassignCrossingExternalRailChannels`);function Qe(t,n){let{realNodeRects:r,labelNodeRects:i}=z(n.values()),a=t.filter(e=>!e.isLayoutOnly),o=e((e,t,n)=>D(e===t?n??[]:e.points??[]),`pointsFor`),s=e(e=>Z(e).reduce((e,t)=>{let n=t.a.x-t.b.x,r=t.a.y-t.b.y;return e+Math.hypot(n,r)},0),`pathLength`),c=e((e,t)=>{let n=0;for(let r=0;r{if(e.horizontal){let n=e.a.y;return(Math.abs(n-t.top)<1||Math.abs(n-t.bottom)<1)&&C(e.a.x,e.b.x,t.left,t.right)>=X}if(e.vertical){let n=e.a.x;return(Math.abs(n-t.left)<1||Math.abs(n-t.right)<1)&&C(e.a.y,e.b.y,t.top,t.bottom)>=X}return!1},`segmentRunsAlongRectBorder`),u=e(e=>{let t=[e.start,e.end].filter(e=>!!e),r=[];for(let e of t){let t=n.get(e),i=t?F(t):void 0;i&&r.push(i)}return r},`endpointRectsFor`),d=e((e,t)=>{if(t+3>=e.length)return[];let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=x(n,r,Y)&&S(r,i,Y)&&x(i,a,Y),s=S(n,r,Y)&&x(r,i,Y)&&S(i,a,Y);if(!o&&!s||!(o?Math.sign(r.x-n.x)!==Math.sign(a.x-i.x):Math.sign(r.y-n.y)!==Math.sign(a.y-i.y)))return[];let c=y(n,a,Y)||b(n,a,Y)?[]:[{x:n.x,y:a.y},{x:a.x,y:n.y}],l=c.length===0?[[...e.slice(0,t+1),...e.slice(t+3)]]:c.map(n=>[...e.slice(0,t+1),n,...e.slice(t+3)]),u=new Set;return l.map(e=>G(D(e))).filter(e=>{if(Z(e).length!==e.length-1||!e.some(e=>v(e,a,Y)))return!1;let t=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return!u.has(t)&&(u.add(t),!0)})},`shortcutCandidatesAt`),f=e((e,t,n)=>{let s=[e.start,e.end].filter(e=>!!e),d=u(e);for(let e of Z(t))if(B(e.a,e.b,r,s,-2)||B(e.a,e.b,i,[],-2)||d.some(t=>l(e,t)))return!1;for(let n of a)if(n!==e){for(let e of Z(t))for(let t of Z(o(n)))if(w(e,t,.5)>=X)return!1}return c(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=c(),t,n,r=e,i=1/0,l=1/0;for(let u of a){let a=o(u),p=E(a,Y),m=s(a);for(let o=0;o<=a.length-4;o++)for(let h of d(a,o)){let a=E(h,Y),o=s(h);if(!(ar||d===r&&(a>i||a===i&&o>=l)||(t=u,n=h,r=d,i=a,l=o)}}if(!t||!n)return;t.points=n}}e(Qe,`shortcutRedundantOrthogonalJogs`);function $e(t,n){let r=[];for(let e of n.values()){if(e.isGroup||e.isEdgeLabel)continue;let t=e.x??0,n=e.y??0,i=F(e);i&&r.push({id:String(e.id??``),cx:t,cy:n,rect:i})}if(r.length===0)return;let i=new Map(r.map(e=>[e.id,e])),a=r.map(e=>({id:e.id,rect:e.rect})),o=[`top`,`bottom`,`left`,`right`],s={top:Math.min(...r.map(e=>e.rect.top))-20,bottom:Math.max(...r.map(e=>e.rect.bottom))+20,left:Math.min(...r.map(e=>e.rect.left))-20,right:Math.max(...r.map(e=>e.rect.right))+20},c=t.filter(e=>!e.isLayoutOnly),l=new Map(c.map((e,t)=>[e,t])),u=e(e=>{let t=e===`left`||e===`top`?-1:1,n=[];for(let r=0;r<=2;r++)n.push(s[e]+t*20*r);return n},`outwardTracksForSide`),d=e((e,t=new Map)=>D(t.get(e)??e.points??[]),`replacementPointsFor`),f=e((e,t)=>{let n=0;for(let r of e)for(let e of t)V(r.a,r.b,e.a,e.b,Y)&&n++;return n},`crossingCountBetweenSegments`),p=e((e,t)=>f(Z(e),Z(t)),`crossingCountBetweenPaths`),m=e((t=new Map)=>{let n=0,r=[],i=new Set,a=[],o=e(e=>{i.has(e)||(i.add(e),a.push(e))},`addEdge`);for(let e=0;e0&&(n+=l,r.push({first:i,second:e,count:l}),o(i),o(e))}}return a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),{count:n,pairs:r,edgeSet:i,edges:a}},`crossingSnapshot`),h=e((e,t)=>{let n=new Set(t.keys());if(n.size===0)return e.count;let r=0;for(let t of e.pairs)(n.has(t.first)||n.has(t.second))&&(r+=t.count);let i=0;for(let e=0;e{let t=new Map;for(let n of e.pairs){let e=t.get(n.first)??new Set;e.add(n.second),t.set(n.first,e);let r=t.get(n.second)??new Set;r.add(n.first),t.set(n.second,r)}let n=[],r=new Set;for(let i of e.edges){if(r.has(i))continue;let e=[i],a=[];for(r.add(i);e.length>0;){let n=e.pop();a.push(n);for(let i of t.get(n)??[])r.has(i)||(r.add(i),e.push(i))}a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),a.length>1&&n.push(a)}return n},`crossingComponents`),_=e(e=>[e.start,e.end].filter(e=>!!e),`endpointIdsFor`),v=e(e=>{let t=[];for(let n of g(e)){let e=new Set(n),r=new Set(n.flatMap(e=>_(e))),i=[...n];for(let t of c)e.has(t)||_(t).some(e=>r.has(e))&&i.push(t);i.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),t.push(i)}return t},`pairSearchGroups`),y=e((e,t,n)=>h(e,new Map([[t,n]])),`crossingCountWithSingleReplacement`),b=e(e=>{let t=new Map;for(let n of e.pairs)t.set(n.first,(t.get(n.first)??0)+n.count),t.set(n.second,(t.get(n.second)??0)+n.count);return t},`currentCrossingsByEdge`),C=e(e=>e.slice(1).reduce((t,n,r)=>{let i=e[r];return t+Math.abs(n.x-i.x)+Math.abs(n.y-i.y)},0),`pathLength`),T=e((e=new Map)=>c.reduce((t,n)=>t+E(d(n,e)),0),`totalBends`),O=e((e=new Map)=>c.reduce((t,n)=>t+C(d(n,e)),0),`totalLength`),k=e((e,t,n=new Map)=>{let r=Z(t);for(let t of c)if(t!==e){for(let e of r)for(let r of Z(d(t,n)))if(w(e,r,.5)>=X)return!0}return!1},`pathHasSegmentConflict`),A=e((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Z(t))if(B(e.a,e.b,a,n,-2))return!0;return!1},`pathHitsNode`),j=e((e,t)=>{let n=G(D(t));Z(n).length===n.length-1&&e.push(n)},`pushOrthogonalCandidate`),M=e(e=>e===`left`||e===`right`,`sideIsHorizontal`),N=e((e,t,n)=>{switch(t){case`left`:return Math.min(e.x,n.x)-20;case`right`:return Math.max(e.x,n.x)+20;case`top`:return Math.min(e.y,n.y)-20;case`bottom`:return Math.max(e.y,n.y)+20}},`localTrackForSameSide`),P=e((e,t,n,r)=>{let i=n===`left`||n===`top`?-1:1,a=[N(t,n,r),s[n]];for(let o of a)for(let a=0;a<=2;a++)j(e,L(t,n,r,o+i*20*a))},`addSameSideCandidates`),R=e((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))j(e,[t,{x:a,y:t.y},{x:a,y:n},{x:r.x,y:n},r])},`addHorizontalToVerticalCandidates`),z=e((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))j(e,[t,{x:t.x,y:a},{x:n,y:a},{x:n,y:r.y},r])},`addVerticalToHorizontalCandidates`),te=e((e,t,n,r,i)=>{let a=[...u(`top`),...u(`bottom`)];for(let o of u(n))for(let n of u(i))for(let i of a)j(e,[t,{x:o,y:t.y},{x:o,y:i},{x:n,y:i},{x:n,y:r.y},r])},`addHorizontalPairCandidates`),ne=e((e,t,n,r,i)=>{let a=[...u(`left`),...u(`right`)];for(let o of u(n))for(let n of u(i))for(let i of a)j(e,[t,{x:t.x,y:o},{x:i,y:o},{x:i,y:n},{x:r.x,y:n},r])},`addVerticalPairCandidates`),re=e(e=>{let t=new Set;return e.map(e=>D(e)).filter(e=>{let n=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return t.has(n)||e.length<2?!1:(t.add(n),!0)})},`dedupeCandidatePaths`),ie=e((e,t,n,r)=>{let i=[],a=ee(e,t,n,r,20,Y);a&&j(i,a),t===r&&P(i,e,t,n);let o=M(t),s=M(r);return o&&!s?R(i,e,t,n,r):!o&&s?z(i,e,t,n,r):o?te(i,e,t,n,r):ne(i,e,t,n,r),re(i)},`buildCandidatesForSides`),ae=e((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=I(r,s),c=s===`top`||s===`bottom`?u(s):a;for(let r of i){j(e,[t,n,{x:r,y:n.y},{x:r,y:o.y},o]);for(let i of c)j(e,[t,n,{x:r,y:n.y},{x:r,y:i},{x:o.x,y:i},o])}}},`addVerticalDepartureOuterTrackCandidates`),oe=e((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=I(r,s),c=s===`left`||s===`right`?u(s):i;for(let r of a){j(e,[t,n,{x:n.x,y:r},{x:o.x,y:r},o]);for(let i of c)j(e,[t,n,{x:n.x,y:r},{x:i,y:r},{x:i,y:o.y},o])}}},`addHorizontalDepartureOuterTrackCandidates`),H=e(e=>{let t=e.start,n=e.end,r=n?i.get(n):void 0;if(!t||!r)return[];let a=D(e.points??[]);if(a.length<4)return[];let o=a[0],s=a[1],c=[];return S(o,s,Y)?ae(c,o,s,r):x(o,s,Y)&&oe(c,o,s,r),c},`terminalPreservingOuterTrackCandidates`),U=e(e=>{let t=e.start,n=e.end,r=t?i.get(t):void 0,a=n?i.get(n):void 0;if(!r||!a)return[];let s=[];for(let e of o){let t=I(r,e);for(let n of o)s.push(...ie(t,e,I(a,n),n))}return s.push(...H(e)),s},`candidatePathsFor`),W=e(()=>new Map(c.map(e=>[e,Z(d(e))])),`currentSegmentsByEdge`),K=e((e,t,n)=>{let r=new Set;for(let i of c){if(i===e)continue;let a=n.get(i)??Z(d(i));t.some(e=>a.some(t=>w(e,t,.5)>=X))&&r.add(i)}return r},`sharedTrackConflictsFor`),se=e((e,t,n,r)=>{let i=new Set;return U(e).map(e=>G(D(e))).filter(t=>{if(A(e,t))return!1;let n=t.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return i.has(n)||t.length<2?!1:(i.add(n),!0)}).map(i=>{let a=Z(i),o=0;for(let t of c)t!==e&&(o+=f(a,n.get(t)??Z(d(t))));return{candidate:i,candidateSegments:a,crossings:t.count-(r.get(e)??0)+o,bends:E(i,Y),totalBends:E(i),length:C(i)}}).filter(({crossings:e})=>e<=t.count).sort((e,t)=>e.crossings-t.crossings||e.bends-t.bends||e.length-t.length).slice(0,48).map(t=>({path:t.candidate,segments:t.candidateSegments,sharedTrackConflicts:K(e,t.candidateSegments,n),totalBends:t.totalBends,length:t.length}))},`pairCandidatesFor`),ce=e((e,t,n,r,i,a)=>{let o=0;for(let n of e.pairs)(n.first===t||n.second===t||n.first===r||n.second===r)&&(o+=n.count);let s=f(n.segments,i.segments);for(let e of c){if(e===t||e===r)continue;let o=a.get(e)??Z(d(e));s+=f(n.segments,o)+f(i.segments,o)}return e.count-o+s},`pairCrossingCount`),le=e((e,t)=>{for(let n of e.sharedTrackConflicts)if(n!==t)return!1;return!0},`conflictsOnlyWith`),ue=e((e,t)=>e.segments.some(e=>t.segments.some(t=>w(e,t,.5)>=X)),`candidatesShareTrack`),de=e((e,t,n,r)=>le(t,n.edge)&&le(r,e.edge)&&!ue(t,r),`pairCandidatesAreCompatible`),q=e((e,t,n,r,i)=>{let a=ce(e.current,t.edge,n,r.edge,i,e.baseSegments);if(!(a>=e.current.count))return{replacements:new Map([[t.edge,n.path],[r.edge,i.path]]),crossings:a,bends:e.currentBends-(e.baseBendsByEdge.get(t.edge)??0)-(e.baseBendsByEdge.get(r.edge)??0)+n.totalBends+i.totalBends,length:e.currentLength-(e.baseLengthByEdge.get(t.edge)??0)-(e.baseLengthByEdge.get(r.edge)??0)+n.length+i.length}},`scorePairReplacement`),J=e((e,t)=>e.crossings{let i=r;for(let r of t.candidates)for(let a of n.candidates){if(!de(t,r,n,a))continue;let o=q(e,t,r,n,a);o&&J(o,i)&&(i=o)}return i},`bestScoreForOptionPair`),pe=e(e=>{let t=T(),n=O(),r=W(),i=b(e),a=new Map(c.map(e=>[e,E(d(e))])),o=new Map(c.map(e=>[e,C(d(e))])),s=new Map,l=v(e);for(let t of l)for(let n of t){if(s.has(n))continue;let t=se(n,e,r,i);t.length>0&&s.set(n,{edge:n,candidates:t})}let u={replacements:new Map,crossings:e.count,bends:t,length:n},f={current:e,currentBends:t,currentLength:n,baseBendsByEdge:a,baseLengthByEdge:o,baseSegments:r};for(let t of l){let n=new Set(t.filter(t=>e.edgeSet.has(t))),r=t.map(e=>s.get(e)).filter(e=>!!e);for(let e=0;e0?u.replacements:void 0},`bestPairedReplacement`);for(let e=0;e<4;e++){let e=m(),t=e.count;if(t===0)return;let n,r,i=t,a=1/0;for(let o of e.edges){let s=E(d(o),Y);for(let c of U(o)){let l=A(o,c),u=!l&&k(o,c),d=y(e,o,c),f=E(c,Y);l||u||(di||d===i&&f>=a||(n=o,r=c,i=d,a=f))}}if(n&&r){n.points=r;continue}let o=pe(e);if(!o)return;for(let[e,t]of o)e.points=t}}e($e,`resolveRenderedOrthogonalCrossings`);var et=.001,tt=8;function nt(t,n){let{nodeInfoById:r,realNodeRects:i}=R(n),a=[`top`,`bottom`,`left`,`right`],o={top:Math.min(...i.map(e=>e.rect.top))-20,bottom:Math.max(...i.map(e=>e.rect.bottom))+20,left:Math.min(...i.map(e=>e.rect.left))-20,right:Math.max(...i.map(e=>e.rect.right))+20},s=e((e,t,n,r)=>{let i=[],a=ee(e,t,n,r,20,et);return a&&i.push(a),t===r&&i.push(L(e,t,n,o[t])),i},`buildOrthogonalPathCandidates`),c=e((e,t)=>{for(let n=0;n{let i=0,a=T(e,et),o=n.start,s=n.end;for(let e of t){if(e===n||e.isLayoutOnly)continue;let t=e.start,c=e.end;if(!r&&o&&s&&(t===o||t===s||c===o||c===s))continue;let l=e.points;if(!(!l||l.length<2))for(let e of a)for(let t of T(l,et)){if(re(e.a,e.b,t.a,t.b,et,et)){i++;continue}w(e,t,et)>=tt&&i++}}return i},`pathConflictCount`),u=e((e,t)=>{let n=Math.abs(e.y-t.rect.top),r=Math.abs(e.y-t.rect.bottom),i=Math.abs(e.x-t.rect.left),a=Math.abs(e.x-t.rect.right),o=`top`,s=n;return r{let r=d.get(e)??[];r.push({side:t,edgeId:n}),d.set(e,r)},`addFaceClaim`);for(let e of t){if(e.isLayoutOnly)continue;let t=e.points??[];if(t.length<1)continue;let n=e.id??``,i=e.start,a=e.end;if(i){let e=r.get(i);e&&f(i,u(t[0],e),n)}if(a){let e=r.get(a);e&&f(a,u(t[t.length-1],e),n)}}let p=e((e,t,n)=>d.get(e)?.some(e=>e.edgeId!==n&&e.side===t)??!1,`faceIsClaimed`);for(let e of t){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=E(t,et);if(n<4)continue;let i=e.start,o=e.end;if(!i||!o)continue;let m=r.get(i),h=r.get(o);if(!m||!h)continue;let g=e.id??``,_=l(t,e,!0),v=l(t,e),y,b=_,x=n;for(let t of a){if(p(i,t,g))continue;let n=I(m,t);for(let r of a){if(p(o,r,g))continue;let a=I(h,r);for(let u of s(n,t,a,r)){if(c(u,[i,o]))continue;let t=E(u,et);if(_>0){let n=l(u,e,!0);if(n>b||n===b&&t>=x)continue;b=n,x=t,y=u;continue}l(u,e)>v||te.edgeId!==g));let n=d.get(o);n&&d.set(o,n.filter(e=>e.edgeId!==g)),f(i,u(y[0],m),g),f(o,u(y[y.length-1],h),g)}}}e(nt,`simplifyDetouredEdges`);var Q=.001,rt=10,it=7;function at(e,t){let n=t?0:e.length-1,r=t?1:-1,i=e[n],a=e[n+r];if(!i||!a)return;let o=a.x-i.x,s=a.y-i.y;if(!(Math.abs(o)+Math.abs(s)t&&M(e,ot(t)))}e(st,`labelOverlapsOwnMarker`);function ct(t,n){let r=[];for(let e of t){if(e.isLayoutOnly)continue;let t=e.points;if(!(!t||t.length<2))for(let n=0;n{let n=N(t,3);for(let{nodeId:t,rect:r}of i)if(t!==e&&M(n,r))return!0;return!1},`labelOverlapsForeignNode`),s=e((e,t)=>{let n=N(t,3);for(let t of r)if(t.edgeId!==e&&k(t.p1,t.p2,n))return!0;return!1},`labelOverlapsForeignEdge`),c=e((e,t,n)=>o(e,n)||s(t,n),`labelOverlapsAnything`),l=[],u=e(e=>{for(let{id:t,rect:n}of a)if(j(n,e))return t},`findContainingLane`),d=e((e,t)=>l.some(n=>n.labelId!==e&&M(t,n.rect)),`overlapsPlacedLabel`);for(let r of t){if(r.isLayoutOnly)continue;let t=r.labelNodeId;if(!t)continue;let i=n.get(t);if(!i)continue;let f=r.points;if(!f||f.length<2)continue;let p=i.width??0,m=i.height??0;if(p<=0||m<=0)continue;let h=[];for(let e=0;e=Q&&i>=Q||h.push({idx:e,length:r+i,orientation:r>=Q?`horizontal`:`vertical`,midX:(t.x+n.x)/2,midY:(t.y+n.y)/2})}if(h.length===0)continue;let g=h.length>=3?h.filter(e=>e.idx>0&&e.idx0?g:h,v=p>=m?`horizontal`:`vertical`,y=e(e=>[...e].sort((e,t)=>{let n=e.orientation===v;if(n!==(t.orientation===v))return n?-1:1;let r=e.length>=(e.orientation===`horizontal`?p:m)+2;return r===t.length>=(t.orientation===`horizontal`?p:m)+2?t.length-e.length:r?-1:1}),`rankSegments`),b=h[0],x=h[h.length-1],S=[.5,.25,.75,.05,.95,.15,.85,.1,.9],C=e((e,t)=>{let n=f[e.idx],r=f[e.idx+1];return{midX:n.x+(r.x-n.x)*t,midY:n.y+(r.y-n.y)*t}},`anchorAtT`),w=e((e,t,n)=>Math.min(n,Math.max(t,e)),`clamp`),T=e((e,t)=>e.midX>=t.left-Q&&e.midX<=t.right+Q&&e.midY>=t.top-Q&&e.midY<=t.bottom+Q,`pointInsideRectInclusive`),E=e(e=>{let t=P(e.midX,e.midY,p,m),n=u(t);if(n)return{laneId:n,anchor:e,rect:t};let r=a.find(({rect:t})=>T(e,t));if(!r)return;let i=r.rect.left+p/2+1,o=r.rect.right-p/2-1,s=r.rect.top+m/2+1,c=r.rect.bottom-m/2-1;if(i>o||s>c)return;let l={midX:w(e.midX,i,o),midY:w(e.midY,s,c)},d=P(l.midX,l.midY,p,m);return T(e,d)?{laneId:r.id,anchor:l,rect:d}:void 0},`placementForAnchor`),D=e((e,t,n)=>e.orientation===`horizontal`?Math.abs(t.midX-n.x):Math.abs(t.midY-n.y),`distanceAlongSegment`),O=e((e,t)=>{let n=(e.orientation===`horizontal`?p/2:m/2)+12;if(e===b){let r=f[e.idx];if(D(e,t,r)+Q{let n=y(e);for(let e of n)for(let n of S){let i=C(e,n);if(!O(e,i))continue;let a=E(i);if(a&&!st(a.rect,f)&&!d(t,a.rect)&&!c(t,r.id,a.rect))return{laneId:a.laneId,anchor:a.anchor}}},`tryPool`),A=e((e,n,i=!1)=>{let a=y(e);for(let e of a){let a={midX:e.midX,midY:e.midY};if(n&&!O(e,a))continue;let c=E(a);if(c&&!st(c.rect,f)&&!d(t,c.rect)&&!o(t,c.rect)&&(i||!s(r.id,c.rect)))return{laneId:c.laneId,anchor:c.anchor}}},`findLaneContainingFallback`),j=k(_)??(_.lengthe.labelId===t);n>=0?l[n]={labelId:t,rect:e}:l.push({labelId:t,rect:e})}}}e(ct,`anchorLabelsToPolyline`);var lt=1e-6,ut=8/2,dt=3;function ft(e,t){return e{let s=ft(r,i),c=0,l=e(e=>{if(!e)return;let t=a.get(e);if(!t)return;let n=o===`x`?t.w/2:t.h/2;n>c&&(c=n)},`consider`);l(n.labelNodeId);for(let e of t){if(e===n||e.isLayoutOnly)continue;let t=e.start,r=e.end;!t||!r||ft(t,r)===s&&l(e.labelNodeId)}return c>0?c+dt:0},`labelClearanceFor`);for(let e of t){if(e.isLayoutOnly)continue;let n=e.points;if(!O(n,lt))continue;let a=ne(e,r,lt);if(!a)continue;let{srcId:s,dstId:c,srcInfo:l,dstInfo:u,collinearX:d,collinearY:f}=a;if(d===f)continue;let p,m;if(d){let e=u.cy>l.cy;p={x:l.cx,y:e?l.rect.bottom:l.rect.top},m={x:u.cx,y:e?u.rect.top:u.rect.bottom}}else{let e=u.cx>l.cx;p={x:e?l.rect.right:l.rect.left,y:l.cy},m={x:e?u.rect.left:u.rect.right,y:u.cy}}if(B(p,m,i,[s,c],1))continue;let h=o(e,s,c,d?`x`:`y`),g=h>ut?h:ut,_=[0,g,-g];for(let n of _){let r={...p},a={...m};if(d){if(r.x+=n,a.x+=n,r.x<=l.rect.left||r.x>=l.rect.right||a.x<=u.rect.left||a.x>=u.rect.right)continue}else if(r.y+=n,a.y+=n,r.y<=l.rect.top||r.y>=l.rect.bottom||a.y<=u.rect.top||a.y>=u.rect.bottom)continue;if(!B(r,a,i,[s,c],1)&&!ae(r,a,t,e,{epsilon:lt})){e.points=[r,a];break}}}}e(pt,`straightenCollinearSiblingDetours`);function mt(t,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=z(n.values()),o=e((e,t)=>T(t,r).map(n=>({...n,edge:e,interior:n.index>=1&&n.index<=t.length-3})),`segmentsFor`),s=e(()=>{let e=[];for(let n of t){if(n.isLayoutOnly)continue;let t=n.points;!t||t.length<2||e.push(...o(n,D(t)))}return e},`allSegments`),c=e((e,t)=>e.horizontal&&t.horizontal?C(e.a.x,e.b.x,t.a.x,t.b.x)>=8&&Math.abs(e.a.y-t.a.y)<7:e.vertical&&t.vertical?C(e.a.y,e.b.y,t.a.y,t.b.y)>=8&&Math.abs(e.a.x-t.a.x)<7:!1,`hasCrowdedParallelTrack`),l=e((e,n)=>{let s=e.start,l=e.end,u=o(e,n);if(u.length!==n.length-1)return!1;let d=[s,l].filter(e=>!!e),f=e.labelNodeId?[e.labelNodeId]:[];for(let e of u)if(B(e.a,e.b,i,d,-2)||B(e.a,e.b,a,f,-2))return!1;for(let n of t){if(n===e||n.isLayoutOnly)continue;let t=n.points;if(!(!t||t.length<2)){for(let e of u)for(let i of o(n,D(t)))if(c(e,i)||V(e.a,e.b,i.a,i.b,r))return!1}}return!0},`candidateIsSafe`),u=e((e,t)=>{let n=D(e.edge.points??[]);if(n.length<4||e.index>=n.length-1)return;let r=n.map(e=>({...e}));if(e.horizontal)r[e.index].y+=t,r[e.index+1].y+=t;else if(e.vertical)r[e.index].x+=t,r[e.index+1].x+=t;else return;return o(e.edge,r).length===r.length-1?r:void 0},`shiftedCandidate`),d=e((e,t)=>({x:e.x??(t.left+t.right)/2,y:e.y??(t.top+t.bottom)/2}),`nodeCenter`),f=e(e=>{let t=e.edge,r=D(t.points??[]);if(r.length!==4||e.index!==1)return;let i=t.start?n.get(t.start):void 0,a=t.end?n.get(t.end):void 0,o=i?F(i):void 0,s=a?F(a):void 0,c=r.slice(e.index+2);if(!(!i||!a||!o||!s||c.length===0))return{sourceCenter:d(i,o),targetCenter:d(a,s),sourceRect:o,tail:c}},`sourceDetourContextFor`),p=e((e,t,n,i,a,o)=>{let s=i.y>=n.y,c=s?a.bottom:a.top,l=c+(s?20:-20);if(s&&e.b.y<=l+r||!s&&e.b.y>=l-r)return;let u=e.a.x+t;return D([{x:n.x,y:c},{x:n.x,y:l},{x:u,y:l},{x:u,y:e.b.y},...o],r)},`verticalSourceDetour`),m=e((e,t,n,i,a,o)=>{let s=i.x>=n.x,c=s?a.right:a.left,l=c+(s?20:-20);if(s&&e.b.x<=l+r||!s&&e.b.x>=l-r)return;let u=e.a.y+t;return D([{x:c,y:n.y},{x:l,y:n.y},{x:l,y:u},{x:e.b.x,y:u},...o],r)},`horizontalSourceDetour`),h=e((e,t)=>{let n=f(e);if(n){if(e.vertical)return p(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail);if(e.horizontal)return m(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail)}},`sourceDetourCandidate`),g=[-7,7,-14,14,-21,21];for(let e=0;e<12;e++){let e=s(),t=!1;for(let n=0;ne.interior);for(let e of o){for(let n of g){let r=u(e,n);if(r&&l(e.edge,r)){e.edge.points=r,t=!0;break}let i=h(e,n);if(i&&l(e.edge,i)){e.edge.points=i,t=!0;break}}if(t)break}}if(!t)return}}e(mt,`nudgeSharedInteriorSubpaths`);function ht(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=r.x-n.x,s=r.y-n.y,c=i*s-a*o;if(Math.abs(c)<1e-10)return!1;let l=n.x-e.x,u=n.y-e.y,d=(l*s-u*o)/c,f=(l*a-u*i)/c,p=.01;return d>p&&d<.99&&f>p&&f<.99}e(ht,`segmentsIntersect`);function gt(e){let n=e.nodes??[],r=e.edges??[],i=[];if(!r.length||!n.length)return i;let a=te(n),o=[];for(let e of r){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=e.start,r=e.end,s=e.labelNodeId,c=e.id??`${n}->${r}`;for(let e of a)if(e.nodeId!==n&&e.nodeId!==r&&!(s&&e.nodeId===s)){for(let n=0;n0){let e=i.filter(e=>e.type===`edge-node-overlap`).length,n=i.filter(e=>e.type===`edge-edge-crossing`).length;t.warn(`[SWIMLANE_VALIDATE] ${i.length} issue(s) detected: ${e} edge-node overlap(s), ${n} edge crossing(s)`);for(let e of i)t.warn(`[SWIMLANE_VALIDATE] ${e.type}: ${e.detail}`)}return i}e(gt,`validateSwimlanesLayout`);function _t(t,n){let r=t.nodes??[],i=t.edges??[],a=r.filter(e=>!e.isGroup);if((n===`LR`||n===`RL`)&&a.length>0&&!Re(t,n)||n===`BT`&&a.length>0&&!Le(t))return;for(let e of i){if(e.isLayoutOnly)continue;let t=e.points;!t||t.length<2||(e.points=G(W(t)))}nt(i,r),pt(i,r),He(i,r);let o=new Map;for(let e of r)o.set(String(e.id),e);ct(i,o),q(i,o),Ue(i,o),mt(i,o),Ge(i,o),Ke(i,o),qe(i,o),Xe(i,o);let s=e(()=>{$e(i,o),Ze(i,o),Qe(i,o),ct(i,o),ke(i,o),qe(i,o),ct(i,o),ke(i,o)},`finalizeRenderedEdges`);s(),mt(i,o),s(),Je(i,o),Ye(i,o),Je(i,o),Ye(i,o)}e(_t,`postProcessSwimlaneLayout`);function vt(e){let t=new Map(e.nodeById),n=new Set,r=[];for(let i of e.edges){if(!t.has(i.src)||!t.has(i.dst))continue;let e=`${i.id}:${i.src}->${i.dst}`;n.has(e)||(n.add(e),r.push(i))}return{nodes:[...t.keys()],edges:r,layout:e.layout,nodeById:t}}e(vt,`normalizeGraph`);function yt(e,t){return e.edges.filter(e=>e.dst===t)}e(yt,`incoming`);function bt(e){let t=new Map;for(let n of e.nodes)t.set(n,[]);for(let n of e.edges)t.get(n.src).push(n.dst);return t}e(bt,`buildSuccessorMap`);function xt(e){let t=bt(e);for(let e of t.values())e.sort((e,t)=>e.localeCompare(t));return t}e(xt,`buildSortedSuccessorMap`);function St(e){let t=new Map;for(let n of e.nodes)t.set(n,0);for(let n of e.edges)t.set(n.dst,(t.get(n.dst)??0)+1);return t}e(St,`buildInDegreeMap`);function Ct(e){return[...e.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}e(Ct,`sortedZeroInDegreeNodes`);function wt(e,t=()=>!0){let n=new Map,r=new Map;for(let t of e.nodes)n.set(t,[]),r.set(t,[]);for(let i of e.edges)t(i)&&(r.get(i.src).push(i.dst),n.get(i.dst).push(i.src));return{preds:n,succs:r}}e(wt,`buildPredecessorSuccessorMaps`);function Tt(e,t,n,r){let i=0;for(let t of e.nodes)r?.skipGroups&&e.nodeById.get(t)?.isGroup||(i=Math.max(i,n[t]??0));let a=Array.from({length:i+1},()=>[]);for(let i of t)r?.skipGroups&&e.nodeById.get(i)?.isGroup||a[Math.max(0,n[i]??0)].push(i);return a}e(Tt,`buildLayersFromRanks`);function Et(e){let t=St(e),n=Ct(t),r=[],i=xt(e);for(;n.length;){let e=n.shift();r.push(e);for(let r of i.get(e)??[])if(t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0){let e=0;for(;e{if(i-e<=1)return 0;let a=e+i>>1,o=r(e,a)+r(a,i),s=e,c=a,l=e;for(;s=i||se.dst===t.dst?e.id.localeCompare(t.id):e.dst.localeCompare(t.dst));let i=Object.create(null);for(let e of n.nodes)i[e]=0;let a=[],o=e(e=>{i[e]=1;for(let t of r.get(e)??[]){let e=t.dst;i[e]===0?o(e):i[e]===1&&a.push(t)}i[e]=2},`dfs`),s=St(n),c=[...n.nodes.filter(e=>(s.get(e)??0)===0),...n.nodes.filter(e=>(s.get(e)??0)!==0)];for(let e of c)i[e]===0&&o(e);let l=new Set(a.map(e=>`${e.id}:${e.src}->${e.dst}`)),u=n.edges.map(e=>l.has(`${e.id}:${e.src}->${e.dst}`)?{id:e.id,src:e.dst,dst:e.src,weight:e.weight,ref:e.ref}:e);return{acyclic:{nodes:[...n.nodes],edges:u,layout:n.layout,nodeById:new Map(n.nodeById)},reversed:a}}e(kt,`removeCycles_DFS`);function At(t){let n=new Map,r=e(e=>{if(n.has(e))return n.get(e);let i=t.nodeById.get(e);if(!i)return n.set(e,null),null;let a=i.parentId;if(!a)return n.set(e,null),null;let o=r(a)??a;return n.set(e,o),o},`resolve`);for(let e of t.nodes)r(e);return n}e(At,`buildTopLaneMap`);function jt(e){let t=At(e);return e=>t.get(e)??null}e(jt,`createTopLaneResolver`);function Mt(e){let t=[];for(let n of e.layout.nodes??[])n.isGroup&&!n.parentId&&t.push(n.id);return[...new Set(t)].reverse()}e(Mt,`buildTopLaneOrder`);function Nt(e,t){let n=Mt(e);if(!t||t.length===0)return n;let r=new Set(n),i=new Set,a=[];for(let e of t)!r.has(e)||i.has(e)||(i.add(e),a.push(e));for(let e of n)i.has(e)||a.push(e);return a}e(Nt,`resolveTopLaneOrder`);var Pt={EPSILON:1e-6},Ft={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},It={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40};function Lt(t,n){let r=vt(t),i=n?.laneOf??(()=>null),a=n?.rankHint,{preds:o}=wt(r);for(let e of o.values())e.sort((e,t)=>e.localeCompare(t));let s=Et(r)??[...r.nodes].sort((e,t)=>e.localeCompare(t)),c=new Map;for(let[e,t]of s.entries())c.set(t,e);let l=new Map,u=new Map;for(let e of r.nodes)u.set(e,[]);for(let e of s){let t=(o.get(e)??[]).filter(e=>l.has(e));if(t.length>0){let n=Rt(e,t,{laneOf:i,rankHint:a,topoIndex:c});l.set(e,n),u.get(n).push(e)}else l.has(e)||l.set(e,null)}for(let e of r.nodes)l.has(e)||l.set(e,null);let d=new Set;for(let e of r.nodes)(l.get(e)??null)===null&&d.add(e);let f=[...d].sort((e,t)=>{let n=c.get(e)??0,r=c.get(t)??0;return n===r?e.localeCompare(t):n-r}),p=zt(r),m=new Map;for(let[e,t]of p.entries())m.set(e,[...t].sort((e,t)=>e.localeCompare(t)));let h=Bt(m),g=Vt(m),_=new Map;for(let e of r.nodes)_.set(e,[]);for(let e of g)for(let t of e.nodes){let n=_.get(t);n?n.push(e.id):_.set(t,[e.id])}let v=[],y=[],b=new Set,x=e(e=>{if(!b.has(e)){b.add(e),v.push(e);for(let t of u.get(e)??[])x(t);y.push(e)}},`walk`);for(let e of f)x(e);for(let e of s)x(e);return{parent:l,children:u,roots:f,componentOf:h,blocks:g,nodeBlocks:_,adjacency:m,preorder:v,postorder:y,topologicalOrder:s}}e(Lt,`buildDrivingTree`);function Rt(e,t,n){let r=n.laneOf(e);return[...t].sort((e,t)=>{let i=n.laneOf(e),a=n.laneOf(t),o=i!=null&&i===r;if(o!==(a!=null&&a===r))return o?-1:1;let s=n.rankHint?.[e],c=n.rankHint?.[t];if(s!=null&&c!=null&&s!==c)return c-s;let l=n.topoIndex.get(e)??0,u=n.topoIndex.get(t)??0;return l===u?e.localeCompare(t):l-u})[0]}e(Rt,`chooseParent`);function zt(e){let t=new Map;for(let n of e.nodes)t.set(n,new Set);for(let n of e.edges)t.get(n.src).add(n.dst),t.get(n.dst).add(n.src);return t}e(zt,`buildAdjacency`);function Bt(e){let t=new Map,n=0;for(let r of e.keys()){if(t.has(r))continue;let i=[r];for(;i.length>0;){let r=i.pop();if(!t.has(r)){t.set(r,n);for(let n of e.get(r)??[])t.has(n)||i.push(n)}}n++}return t}e(Bt,`assignComponents`);function Vt(t){let n=new Map,r=new Map,i=[],a=[],o=0,s=e((e,c)=>{n.set(e,++o),r.set(e,o);for(let l of t.get(e)??[])l!==c&&(n.has(l)?(n.get(l)??0)<(n.get(e)??0)&&(i.push([e,l]),r.set(e,Math.min(r.get(e)??o,n.get(l)??o))):(i.push([e,l]),s(l,e),r.set(e,Math.min(r.get(e)??o,r.get(l)??o)),(r.get(l)??0)>=(n.get(e)??0)&&a.push(Ht(e,l,i,a.length))))},`visit`);for(let e of t.keys())n.has(e)||s(e,null);return a}e(Vt,`computeBlocks`);function Ht(e,t,n,r){let i=[],a=new Set;for(;n.length>0;){let r=n.pop();if(i.push(r),a.add(r[0]),a.add(r[1]),r[0]===e&&r[1]===t||r[0]===t&&r[1]===e)break}return{id:r,edges:i,nodes:[...a]}}e(Ht,`popBlock`);function Ut(t,n,r){let i=[...t.nodes],a=new Map;for(let[e,t]of i.entries())a.set(t,e);let o=i.length,s=Array(o).fill(-1),c=Array(o).fill(0),l=[],u=new Set;for(let e of i){let t=r.parent.get(e)??null,n=a.get(e);n!=null&&(t??(s[n]=-1,c[n]=0,u.has(e)||(u.add(e),l.push(e))))}for(;l.length>0;){let e=l.shift(),t=a.get(e);if(t==null)continue;let n=r.children.get(e)??[];for(let e of n){if(u.has(e))continue;let n=a.get(e);n!=null&&(s[n]=t,c[n]=c[t]+1,u.add(e),l.push(e))}}for(let e of i){if(u.has(e))continue;let t=a.get(e);t!=null&&(s[t]=-1,c[t]=0,u.add(e))}let d=Math.max(1,Math.ceil(Math.log2(Math.max(1,o)))+1),f=Array.from({length:d},()=>Array(o).fill(-1));for(let e=0;e{if(e===-1||t===-1)return-1;c[e]>t&1&&(e=f[t][e],e===-1))return-1;if(e===t)return e;for(let n=d-1;n>=0;n--){let r=f[n][e],i=f[n][t];r!==-1&&i!==-1&&r!==i&&(e=r,t=i)}return f[0][e]},`lcaIndex`),m=Array.from({length:o},()=>new Map);for(let e of t.edges){let t=e.src,r=e.dst,i=n[t],o=n[r];if(i==null||o==null||(i>o&&([t,r]=[r,t],[i,o]=[o,i]),i==null||o==null||i===o))continue;let s=a.get(t),c=a.get(r);if(s==null||c==null)continue;let l=p(s,c);if(l===-1)continue;let u=m[l];for(let e=i;e{if(t.size!==0)for(let[n,r]of t)e.set(n,(e.get(n)??0)+r)},`mergeInto`),_=new Set,v=e(e=>{let t=a.get(e);_.add(e);let i=t==null?void 0:m[t],o=i?new Map(i):new Map,s=r.children.get(e)??[];for(let t of s){let r=v(t),i=n[e];if(i!=null){let a=h.get(e);a||(a=new Map,h.set(e,a));let o=r.get(i)??0,s=n[t];s!=null&&s>i&&(o+=1),a.set(t,o)}g(o,r)}return o},`dfs`);for(let e of r.roots)_.has(e)||v(e);for(let e of i)_.has(e)||v(e);return h}e(Ut,`computeSubtreeCrossCounts`);function Wt(t,n,r){let i=new Map,a=e(e=>{let t=r[e]??0,o=[...n.get(e)??[]];o.sort(Gt(r));for(let e of o){a(e);let n=i.get(e);n!=null&&(t=Math.min(t,n))}i.set(e,t)},`annotate`);for(let e of t)a(e);return i}e(Wt,`annotateMinimumLayers`);function Gt(e){return(t,n)=>{let r=e[t]??0,i=e[n]??0;return r===i?t.localeCompare(n):r-i}}e(Gt,`compareByRankThenId`);function Kt(t,n,r,i){let a=0;for(let e of n){let t=r[e]??0;t>a&&(a=t)}let o=Array.from({length:a+1},()=>[]),s=new Set,c=e(e=>{if(s.has(e))return;s.add(e);let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e);for(let t of i(e))c(t)},`emit`);for(let e of t)c(e);for(let e of n)if(!s.has(e)){let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e),s.add(e)}return o}e(Kt,`emitNodesInTreeOrder`);function qt(e){let t=[];for(let n of e){let e=new Set,r=[];for(let t of n)e.has(t)||(e.add(t),r.push(t));t.push(r)}return t}e(qt,`deduplicateLayers`);function Jt(e,t,n,r){return i=>{let a=e.get(i)??[];if(a.length===0)return[];let o=t[i]??0,s=[],c=[],l=n.get(i);for(let e of a){let t=r.get(e)??o;t>o?s.push({child:e,min:t}):c.push(e)}return s.sort((e,t)=>e.min===t.min?e.child.localeCompare(t.child):e.min-t.min),c.sort((e,t)=>{let n=l?.get(e)??0,i=l?.get(t)??0;if(n!==i)return n-i;let a=r.get(e)??o,s=r.get(t)??o;return a===s?e.localeCompare(t):a-s}),[...s.map(e=>e.child),...c]}}e(Jt,`createChildOrderer`);function Yt(e,t,n){let r=Lt(e,{rankHint:t,laneOf:n}),{children:i,roots:a}=r;for(let t of e.nodes)i.has(t)||i.set(t,[]);let o=Ut(e,t,r),s=[...a].sort(Gt(t)),c=Jt(i,t,o,Wt(s,i,t)),l=Kt(s,e.nodes,t,c);return l=qt(l),l}e(Yt,`buildMultitreeLayerOrder`);function Xt(e,t,n){let r=new Set(e),i=new Set(t),a=Dt(t),o=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&o.push(a.get(e.dst));return Ot(o)}e(Xt,`countCrossingsBetweenAdjacent`);function Zt(e,t,n){let r=[];for(let e of t){let t=n[e.src],i=n[e.dst];if(t==null||i==null||t===i)continue;let a=e.src,o=e.dst,s=t,c=i;t>i&&(a=e.dst,o=e.src,s=i,c=t);for(let t=s;t(n[t]??0)-(n[e]??0));for(let s of o){let o=n[s]??0;if(o===0)continue;let c=0;for(let e of r.get(s)??[])c=Math.max(c,(n[e]??0)+1);if(c>=o)continue;let l=o;n[s]=c;let u=Zt(Yt(e,n,i),e.edges,n);u(t[e]??0)-(t[n]??0)||e.localeCompare(n));for(let i of r){let r=n(i);if(!r)continue;let a=e.edges.filter(e=>e.src===i);if(a.length===0)continue;let o=!1,s=0;for(let e of a){let t=n(e.dst);t==null||t===r?o=!0:s++}if(s===0||o)continue;let c=0,l=!1;for(let t of e.edges){if(t.dst!==i)continue;let e=n(t.src);e&&(e===r?l=!0:c++)}if(c>0||!l)continue;let u=t[i]??0,d=u+s,f=0;for(let n of e.edges)n.dst===i&&(f=Math.max(f,(t[n.src]??0)+1));let p=Math.max(u,f,d);p!==u&&(t[i]=p)}}e($t,`adjustCrossLaneSources`);function en(e,t){let n=vt(e),r=Et(n)??[...n.nodes].sort(),i=t?.compactSingleInput??!1,a=jt(n),o=Object.create(null);for(let e of r){let r=yt(n,e),s=t?.ignoreCrossLaneEdges?r.filter(t=>{let n=a(t.src),r=a(e);return!n||!r||n===r}):r;if(s.length===0)o[e]=0;else if(i&&s.length===1){let t=s[0].src;a(t)===a(e)?o[e]=(o[t]??0)+1:o[e]=o[t]??0}else{let t=-1/0;for(let e of s)t=Math.max(t,(o[e.src]??0)+1);o[e]=t===-1/0?0:t}}return(t?.optimizeRanksByCrossings??!1)&&(o=Qt(n,o)),t?.ignoreCrossLaneEdges&&$t(n,o),{layers:Yt(n,o,a),rankOf:o,dummy:new Set}}e(en,`assignLayers_LongestPath`);function tn(t,n){let r=vt(t),i={...en(r,{compactSingleInput:n?.compactSingleInput,ignoreCrossLaneEdges:n?.ignoreCrossLaneEdges,optimizeRanksByCrossings:n?.optimizeRanksByCrossings}).rankOf},a=jt(r),{preds:o,succs:s}=wt(r,e=>{if(n?.ignoreCrossLaneEdges){let t=a(e.src),n=a(e.dst);if(t&&n&&t!==n)return!1}return!0}),c=Et(r)??[...r.nodes],l=[...c].reverse(),u=e((e,t)=>{let n=0;for(let t of o.get(e)??[])n=Math.max(n,(i[t]??0)+1);let r=1/0,a=s.get(e)??[];return a.length>0&&(r=Math.min(...a.map(e=>(i[e]??0)-1))),Number.isFinite(r)||(r=Math.max(n,t)),Math.min(Math.max(t,n),r)},`clampFeasible`),d=Ft.GRAVITY_ITERATIONS,f=e(e=>{let t=!1;for(let n of e){let e=o.get(n)??[],r=s.get(n)??[];if(e.length===0&&r.length===0)continue;let a=e.length>0?e.reduce((e,t)=>e+(i[t]??0)+1,0)/e.length:i[n]??0,c=r.length>0?r.reduce((e,t)=>e+(i[t]??0)-1,0)/r.length:i[n]??0,l=Math.round((a+c)/2),d=u(n,l);d!==i[n]&&(i[n]=d,t=!0)}return t},`relaxOrder`);for(let e=0;e0){let n=Math.min(...t.map(e=>(i[e]??0)-1));(i[e]??0)>n&&(i[e]=n)}}return{layers:Tt(r,c,i),rankOf:i,dummy:new Set}}e(tn,`assignLayers_Gravity`);function nn(e){let t=St(e),n=xt(e),r=Ct(t),i=[];for(;r.length>0;){let e=[];for(let a of r){i.push(a);for(let r of n.get(a)??[])t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0&&e.push(r)}r=e.sort((e,t)=>e.localeCompare(t))}return i.length===e.nodes.length?i:null}e(nn,`topoSortByGenerationIfAcyclic`);function rn(t,n){let r=vt(t),i=n?.direction===`LR`?nn(r)??[...r.nodes].sort():Et(r)??[...r.nodes].sort(),a=jt(r),o=e(e=>a(e)??e,`laneOf`),s=Object.create(null),c=new Map,l=e((e,t)=>n?.ignoreCrossLaneEdges??!0?+(o(e)===o(t)):1,`edgeWeight`);for(let e of i){if(r.nodeById.get(e)?.isGroup)continue;let t=yt(r,e),n=0;if(t.length>0)for(let r of t){let t=r.src,i=s[t]??0;n=Math.max(n,i+l(t,e))}let i=o(e),a=c.get(i)??0,u=Math.max(n,a);s[e]=u,c.set(i,u+1)}return{layers:Tt(r,i,s,{skipGroups:!0}),rankOf:s,dummy:new Set}}e(rn,`assignLayers_LaneAwareCompact`);function an(t,n){let r=vt(n),{rankOf:i}=t,a=t.layers.map(e=>[...e]),o=new Set(t.dummy?[...t.dummy]:[]),s=0,c=new Map(r.nodeById),l=e(e=>{let t=`placeholder-${s++}`,n={id:t,isGroup:!1,isDummy:!0,width:0,height:0};for(c.set(t,n),o.add(t);a.length<=e;)a.push([]);return a[e].push(t),i[t]=e,t},`addDummyAt`),u=[...r.edges].sort((e,t)=>e.id===t.id?e.src===t.src?e.dst.localeCompare(t.dst):e.src.localeCompare(t.src):e.id.localeCompare(t.id)),d=[];for(let e of u){let t=i[e.src]??0,n=i[e.dst]??0;if(n-t<=1){d.push(e);continue}let r=e.src;for(let i=t+1,a=0;i!r.nodes.includes(e))],edges:d,layout:r.layout,nodeById:c};return{layering:{layers:a,rankOf:i,dummy:o},graphWithDummies:f}}e(an,`makeProperLayering`);function on(e){let t=e.length;if(t===0)return 1/0;let n=[...e].sort((e,t)=>e-t);return t%2==1?n[(t-1)/2]:.5*(n[t/2-1]+n[t/2])}e(on,`median`);function sn(e){return e.length===0?1/0:e.reduce((e,t)=>e+t,0)/e.length}e(sn,`barycenter`);function cn(e,t,n,r){let i=new Map;for(let t of e)i.set(t,[]);for(let e of n)r===`down`?t.has(e.src)&&i.has(e.dst)&&i.get(e.dst).push(t.get(e.src)):t.has(e.dst)&&i.has(e.src)&&i.get(e.src).push(t.get(e.dst));return i}e(cn,`neighborPositionsFor`);function ln(e,t,n){let r=n.get(e)??0,i=n.get(t)??0;return r===i?e.localeCompare(t):r-i}e(ln,`currentOrderTieBreak`);function un(e,t,n){let r=new Set(e),i=new Set(t),a=Dt(e),o=Dt(t),s=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&s.push({u:a.get(e.src),v:o.get(e.dst)});return s.sort((e,t)=>e.u===t.u?e.v-t.v:e.u-t.u),Ot(s.map(e=>e.v))}e(un,`countCrossingsBetweenAdjacent`);function dn(e,t,n){return[...e].sort((e,r)=>{let i=on(t.get(e)??[]),a=on(t.get(r)??[]);return i===a?ln(e,r,n):isFinite(i)?isFinite(a)?i-a:-1:1})}e(dn,`sortByHeuristic`);function fn(e,t,n,r,i,a){let o=Dt(e),s=Dt(t),c=cn(t,o,n,r);if(!i||!a||a.length===0)return dn(t,c,s);let l=new Map;for(let e of t){let t=i(e),n=l.get(t)??[];n.push(e),l.set(t,n)}let u=[];for(let e of a){let t=l.get(e);if(!t||t.length===0)continue;let n=dn(t,c,s);u.push(...n)}let d=l.get(null);if(d&&d.length>0){let e=dn(d,c,s);for(let t of e){let e=sn(c.get(t)??[]),n=u.length;if(isFinite(e)){for(let[t,r]of u.entries())if(es.has(e.src)&&c.has(e.dst)),d=l?r.filter(e=>c.has(e.src)&&l.has(e.dst)):void 0,f=e(e=>{let n=un(t,e,u);return d&&i&&(n+=un(e,i,d)),n},`crossingScore`),p=a?new Map:null;if(a&&p)for(let e of n)p.set(e,a(e));let m=!0,h=f(o);for(;m;){m=!1;for(let e=0;e+1[...e]),i=t.edges,a=jt(t),o=Nt(t,n?.laneOrder);for(let e=0;e<3;e++){for(let e=1;e=0;e--)r[e]=fn(r[e+1],r[e],i,`up`,a,o),r[e]=pn(r[e+1],r[e],i,r[e-1],a)}return{layers:r}}e(mn,`orderLayers`);function hn(t,n,r){let i=r?.layerGap??It.DEFAULT_LAYER_GAP,a=r?.nodeGap??It.DEFAULT_NODE_GAP,o=r?.laneGap??a*2,s=r?.direction??`TB`,c=s===`LR`||s===`RL`,l=t.layers,u=Object.create(null),d=Object.create(null),f=e(e=>n.nodeById.get(e),`getNode`),p=e(e=>f(e)?.width??0,`getWidth`),m=e(e=>f(e)?.height??0,`getHeight`),h=jt(n),g=Nt(n,r?.laneOrder),_=l.map(e=>e.reduce((e,t)=>Math.max(e,m(t)),0)),v=[];if(c)for(let e=0;e+1Math.max(e,p(t)),0),n=l[e+1].reduce((e,t)=>Math.max(e,p(t)),0),r=_[e],a=_[e+1],o=r/2+a/2,s=(t+n)/2,c=Math.max(0,s-o-i);v.push(c)}let y=new Set;for(let e of l)for(let t of e)y.add(h(t));let b=y.has(null),x=g.filter(e=>y.has(e)),S=[...b?[null]:[],...x],C=Object.create(null);for(let e of x)C[e]=0;b&&(C.null=0);for(let e of l){let t=Object.create(null),n=[];for(let r of e){let e=h(r);e===null?n.push(r):(t[e]||=[]).push(r)}for(let[e,n]of Object.entries(t)){let t=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);C[e]=Math.max(C[e]??0,t)}if(b&&n.length){let e=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);C.null=Math.max(C.null??0,e)}}let w=new Map;{let e=S.map(e=>(e===null?C.null:C[e])??0),t=-(e.reduce((e,t)=>e+t,0)+o*Math.max(0,S.length-1))/2;for(let n=0;np(e)),r=i-(e.reduce((e,t)=>e+t,0)+a*(t.length-1))/2;for(let[i,o]of t.entries()){let t=e[i];u[o]=r+t/2,d[o]=T+n/2,r+=t+a}}}let o=v[e]??0;T+=n+i+o}let E=new Map;for(let e of n.edges){let t=e.ref.id;E.has(t)||E.set(t,[]),E.get(t).push(e)}for(let[,e]of E){if(e.length===0)continue;let t=e[0].ref,r=t.start,i=t.end;if(r==null||i==null)continue;let a=Math.round(((u[r]??0)+(u[i]??0))/2),o=new Set;for(let t of e)o.add(t.src),o.add(t.dst);for(let e of o)e!==r&&e!==i&&n.nodeById.get(e)?.isDummy&&(u[e]=a)}return{x:u,y:d}}e(hn,`assignCoordinates`);var gn=8;function _n(e){let t=2166136261;for(let n=0;n>>0}e(_n,`hashString`);function vn(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}e(vn,`mulberry32`);function yn(e,t){let n=[...e],r=vn(t);for(let e=n.length-1;e>0;e--){let t=Math.floor(r()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n}e(yn,`deterministicShuffle`);function bn(e,t){let n=0;for(let[r,i]of e.entries())n+=Math.abs(r-(t.get(i)??r));return n}e(bn,`sourceDistance`);function xn(e,t){let n=new Map;for(let[t,r]of e.entries())n.set(r,t);let r=0;for(let{a:e,b:i,weight:a}of t){let t=n.get(e),o=n.get(i);t!=null&&o!=null&&(r+=a*Math.abs(t-o))}return r}e(xn,`laneArrangementCost`);function Sn(e){let t=Mt(e);if(t.length<2)return[];let n=new Map(t.map((e,t)=>[e,t])),r=jt(e),i=new Map;for(let t of e.layout.edges??[]){if(t.isLayoutOnly)continue;let a=typeof t.start==`string`?t.start:void 0,o=typeof t.end==`string`?t.end:void 0;if(!a||!o||!e.nodeById.has(a)||!e.nodeById.has(o))continue;let s=r(a),c=r(o);if(!s||!c||s===c)continue;let l=n.get(s),u=n.get(c);if(l==null||u==null)continue;let[d,f]=l<=u?[s,c]:[c,s],p=`${d}\0${f}`,m=i.get(p);m?m.weight++:i.set(p,{a:d,b:f,weight:1})}return[...i.values()]}e(Sn,`buildWeightedLaneEdges`);function Cn(e,t,n){let r=[...e],i=xn(r,t),a=!0,o=0,s=Math.max(1,r.length);for(;a&&oe.a===t.a?e.b.localeCompare(t.b):e.a.localeCompare(t.a)).map(({a:e,b:t,weight:n})=>`${e}:${t}:${n}`).join(`|`);return _n(`${e.join(`|`)}#${r}#${n}`)}e(Tn,`seedForRestart`);function En(e,t={}){let n=Mt(e);if(n.length<2)return n;let r=Sn(e);if(r.length===0)return n;let i=new Map(n.map((e,t)=>[e,t])),a=Cn(n,r,i),o=Math.max(0,t.restarts??gn);for(let e=0;e$&&c*3>=s?o>0?`bottom`:`top`:s>$?a>0?`right`:`left`:n}e(Pn,`chooseOrthogonalSide`);function Fn(e,t){return Math.abs(e.to-t.from)<$||Math.abs(e.to-t.to)<$?e.to:e.from}e(Fn,`sharedLineEndpointCoord`);function In(e,t){return e.orient===`vertical`?{x:e.coord,y:t}:{x:t,y:e.coord}}e(In,`pointOnLine`);function Ln(t,n){let r=t.nodes??[],i=t.edges??[],a=[];for(let e of i)e.isLayoutOnly||a.push({...e,__originalEdge:e});let o=new Map,s=new Map,c=[],l=n===`LR`;for(let e of r)o.set(e.id,e);let u=r.filter(e=>e.isGroup&&!e.parentId);for(let t of u){let n={id:t.id},i=e(e=>{s.set(e.id,n),r.filter(t=>t.parentId===e.id).forEach(i)},`assignLane`);i(t)}let d=r.filter(e=>!e.isGroup&&!e.isEdgeLabel).map(e=>{let t=e.width??10,n=e.height??10,r=e.x??0,i=e.y??0,a=On;return{nodeId:e.id,minX:r-t/2-a,maxX:r+t/2+a,minY:i-n/2-a,maxY:i+n/2+a,visualXHalfExtent:l?n/2+a:t/2+a}}),f=e((e,t,n,r)=>{let i=c.find(n=>n.orientation===e&&Math.abs(n.coord-t)<1);return i||(i={id:`pipe-${e}-${t.toFixed(0)}`,orientation:e,coord:t,spanMin:n,spanMax:r,tracks:[]},c.push(i)),i.spanMin=Math.min(i.spanMin,n),i.spanMax=Math.max(i.spanMax,r),i},`getOrAddPipe`),p=e((e,t)=>{let n=e.width??10,r=e.height??10,i=e.x??0,a=e.y??0;switch(t){case`top`:return{x:i,y:a-r/2};case`bottom`:return{x:i,y:a+r/2};case`left`:return{x:i-n/2,y:a};case`right`:return{x:i+n/2,y:a}}},`portForSide`),m=e((e,t,n)=>p(e,Pn(e,t,n?`bottom`:`top`)),`getOrthogonalPort`),h=[],g=[],_=new Set,v=1e3,y=e((e,t,n)=>{if(h.length===0)return 0;let r=Math.abs(t.y-n.y)<$,i=Math.abs(t.x-n.x)<$;if(!r&&!i)return 0;let a=0;if(r){let r=t.y,i=Math.min(t.x,n.x)-$,o=Math.max(t.x,n.x)+$;if(o<=i)return 0;for(let t of h)t.edgeIndex!==e&&t.orientation===`vertical`&&(t.pipe.coordo||t.from-$<=r&&t.to+$>=r&&(a+=v))}else if(i){let r=t.x,i=Math.min(t.y,n.y)-$,o=Math.max(t.y,n.y)+$;if(o<=i)return 0;for(let t of h)t.edgeIndex!==e&&t.orientation===`horizontal`&&(t.pipe.coordo||t.from-$<=r&&t.to+$>=r&&(a+=v))}return a},`crossingPenalty`),b=a.map((e,t)=>{if(!e.start||!e.end)return{idx:t,crossLane:0,dx:0,dy:0};let n=o.get(e.start),r=o.get(e.end),i=s.get(e.start),a=s.get(e.end);return{idx:t,crossLane:i&&a&&i.id!==a.id?1:0,dx:n&&r?Math.abs((r.x??0)-(n.x??0)):0,dy:n&&r?Math.abs((r.y??0)-(n.y??0)):0}}).sort((e,t)=>{if(e.crossLane!==t.crossLane)return t.crossLane-e.crossLane;let n=e.dx+e.dy,r=t.dx+t.dy;return Math.abs(n-r)>1?n-r:e.idx-t.idx}).map(e=>e.idx),x=e((e,t,n,r)=>{let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return!!d.find(c=>n&&c.nodeId===n||r&&c.nodeId===r?!1:Math.abs(e.x-t.x)>$?c.minYe.y&&c.maxX>i&&c.minXe.x&&c.maxY>o&&c.minYPn(e,t,`bottom`),`determineSide`),T=new Map;for(let[e,t]of a.entries()){if(!t.start||!t.end||t.start===t.end||t.points&&t.points.length>0)continue;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)continue;let i=(r.x??0)-(n.x??0),a=(r.y??0)-(n.y??0);T.set(e,{edgeIdx:e,srcId:t.start,dstId:t.end,srcSide:w(n,{x:r.x??0,y:r.y??0}),dstSide:w(r,{x:n.x??0,y:n.y??0}),absDx:Math.abs(i),absDy:Math.abs(a),dxSign:Math.sign(i),dySign:Math.sign(a)})}let E=e(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.absDx===0?1/0:e.absDy/e.absDx:e.absDy===0?1/0:e.absDx/e.absDy,`preferenceStrength`),D=e(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.dxSign>=0?`right`:`left`:e.dySign>=0?`bottom`:`top`,`secondarySide`),O=new Map;for(let e of T.values()){let t=`${e.srcId}:${e.srcSide}`;O.has(t)||O.set(t,[]),O.get(t).push(e)}let k=new Map,A=e((e,t)=>`${e}:${t}`,`loadKey`);for(let e of T.values())k.set(A(e.srcId,e.srcSide),(k.get(A(e.srcId,e.srcSide))??0)+1),k.set(A(e.dstId,e.dstSide),(k.get(A(e.dstId,e.dstSide))??0)+1);for(let e of O.values())if(!(e.length<2)){e.sort((e,t)=>{let n=E(e),r=E(t);return Math.abs(n-r)>1e-9?r-n:e.edgeIdx-t.edgeIdx});for(let t=1;t=i||(k.set(A(n.srcId,n.srcSide),i-1),k.set(A(n.srcId,r),a+1),n.srcSide=r)}}let j=e(e=>{let t=e?.shape;return t===`question`||t===`diamond`},`isDiamondNode`),M=new Map;for(let e of T.values())M.has(e.dstId)||M.set(e.dstId,new Set),M.get(e.dstId).add(e.dstSide);for(let e of T.values()){if(!j(o.get(e.srcId)))continue;let t=M.get(e.srcId);if(!t?.has(e.srcSide))continue;let n=D(e);if(t.has(n)||(k.get(A(e.srcId,n))??0)>0)continue;let r=k.get(A(e.srcId,e.srcSide))??0;k.set(A(e.srcId,e.srcSide),Math.max(0,r-1)),k.set(A(e.srcId,n),1),e.srcSide=n}for(let e of T.values()){let{edgeIdx:t,srcId:n,dstId:r,srcSide:i,dstSide:a}=e,s=o.get(n),c=o.get(r),l=`${n}:${i}:src`,u=i===`top`||i===`bottom`?c.x??0:c.y??0;S.has(l)||S.set(l,[]),S.get(l).push({edgeIdx:t,oppositeCoord:u});let d=`${r}:${a}:dst`,f=a===`top`||a===`bottom`?s.x??0:s.y??0;S.has(d)||S.set(d,[]),S.get(d).push({edgeIdx:t,oppositeCoord:f})}let N=new Map;for(let[e,t]of S){if(t.length<2)continue;t.sort((e,t)=>e.oppositeCoord-t.oppositeCoord);let n=e.split(`:`),r=n.slice(0,-2).join(`:`),i=n[n.length-2],a=n[n.length-1],s=o.get(r);if(!s)continue;let c=i===`left`||i===`right`?s.height??10:s.width??10,l=s.shape,u=l===`question`||l===`diamond`?c*.3:c,d=Math.min(20,Math.max(8,u/(t.length+1))),f=-(d*(t.length-1))/2;for(let[e,n]of t.entries()){let t=f+e*d,r=`${n.edgeIdx}:${a}`;N.set(r,t)}}let P=e(e=>!!a[e]?.labelNodeId,`edgeHasLabelNode`),F=e((e,t)=>e?(S.get(`${e}:${t}:src`)??[]).some(({edgeIdx:e})=>P(e))||(S.get(`${e}:${t}:dst`)??[]).some(({edgeIdx:e})=>P(e)):!1,`faceHasLabelNode`),I=e((e,t,n)=>t===`top`||t===`bottom`?{x:e.x+n,y:e.y}:{x:e.x,y:e.y+n},`applyPortOffset`),ee=e((e,t,n)=>{let r=T.get(e),i={x:n.x??0,y:n.y??0},a={x:t.x??0,y:t.y??0},o=r?.srcSide??w(t,i),s=r?.dstSide??w(n,a),c=r?p(t,r.srcSide):m(t,i,!0),l=r?p(n,r.dstSide):m(n,a,!1),u=N.get(`${e}:src`),d=N.get(`${e}:dst`);return u!==void 0&&(c=I(c,o,u)),d!==void 0&&(l=I(l,s,d)),{pSrcPort:c,pDstPort:l,srcSide:o,dstSide:s}},`portsForEdge`);for(let t of b){let n=a[t];if(g[t]=[],!n.start||!n.end||n.points&&n.points.length>0||n.start===n.end)continue;let r=o.get(n.start),i=o.get(n.end);if(!r||!i)continue;let{pSrcPort:s,pDstPort:u,srcSide:p,dstSide:m}=ee(t,r,i),v={...s},b={...u},w=p===`top`||p===`bottom`,T=m===`top`||m===`bottom`;w?v.y=s.y>(r.y??0)?s.y+Mn:s.y-Mn:v.x=s.x>(r.x??0)?s.x+Mn:s.x-Mn,T?b.y=u.y>(i.y??0)?u.y+Mn:u.y-Mn:b.x=u.x>(i.x??0)?u.x+Mn:u.x-Mn;let E=e((e,t)=>{for(let n of d)if(!t.includes(n.nodeId)&&e.x>n.minX&&e.xn.minY&&e.y{if(i){let i=e.y>(t.y??0);return{x:(n.x??0)>=e.x?r.maxX+kn:r.minX-kn,y:i?r.maxY+An:r.minY-An,leavesPositiveSide:i}}let a=e.x>(t.x??0),o=(n.y??0)>=e.y;return{x:a?r.maxX+kn:r.minX-kn,y:o?r.maxY+An:r.minY-An,leavesPositiveSide:a}},`obstacleDetour`),O=[],k=[n.start,n.end],A=E(v,k);if(A.inside&&A.obstacle){let e=A.obstacle;if(w){let t=D(s,r,i,e,!0);v.x=t.x,v.y=t.y;let n=t.leavesPositiveSide?Math.min(e.minY-2,s.y+Mn):Math.max(e.maxY+2,s.y-Mn);O=[{x:s.x,y:n},{x:t.x,y:n},{x:t.x,y:t.y}]}else{let t=D(s,r,i,e,!1),n=t.leavesPositiveSide?Math.min(e.minX-2,s.x+Mn):Math.max(e.maxX+2,s.x-Mn);v.x=t.x,v.y=t.y,O=[{x:n,y:s.y},{x:n,y:t.y},{x:t.x,y:t.y}]}}let j=[],M=E(b,k);if(M.inside&&M.obstacle){let e=M.obstacle;if(T){let t=D(u,i,r,e,!0);b.x=t.x,b.y=t.y,j=[{x:t.x,y:t.y},{x:u.x,y:t.y}]}else{let t=D(u,i,r,e,!1);b.x=t.x,b.y=t.y,j=[{x:t.x,y:t.y},{x:t.x,y:u.y}]}}if(O.length===0&&j.length===0){let e=kn,r=Math.abs(v.x-b.x)1||c>1,d=C.get(n.start??``)??0,f=C.get(n.end??``)??0,g=o>1&&F(n.start,p)||c>1&&F(n.end,m);if((r||i)&&!a&&(!l||l&&!g&&(o<=1||d<=2)&&(c<=1||f<=2))&&!x(s,u,n.start,n.end)){n.points=[{...s},{...v},{...b},{...u}],_.add(t);let e=i?`horizontal`:`vertical`,r=i?s.y:s.x,a=i?Math.min(s.x,u.x):Math.min(s.y,u.y),o=i?Math.max(s.x,u.x):Math.max(s.y,u.y),c={id:`fast-path-${e}-${r.toFixed(0)}-${t}`,orientation:e,coord:r,spanMin:a,spanMax:o,tracks:[]};h.push({edgeIndex:t,segmentIndex:0,orientation:e,pipe:c,trackIndex:0,from:a,to:o});continue}}v.x=f(`vertical`,v.x,v.y,v.y).coord,b.x=f(`vertical`,b.x,b.y,b.y).coord;let P=Math.min(v.x,b.x)-50,I=Math.max(v.x,b.x)+50,L=Math.min(v.y,b.y)-50,R=Math.max(v.y,b.y)+50;for(let e of d){let t=Math.min(v.x,b.x),n=Math.max(v.x,b.x),r=Math.min(v.y,b.y),i=Math.max(v.y,b.y);e.minXt&&e.minYr&&(P=Math.min(P,e.minX-jn),I=Math.max(I,e.maxX+jn),L=Math.min(L,e.minY-jn),R=Math.max(R,e.maxY+jn))}for(let e of d){if(e.maxXI||e.maxYR)continue;let t=kn;f(`horizontal`,e.minY-t,P,I),f(`horizontal`,e.maxY+t,P,I);let n=An;f(`vertical`,e.minX-n,L,R),f(`vertical`,e.maxX+n,L,R)}f(`horizontal`,v.y,P,I),f(`horizontal`,b.y,P,I);let z=c.filter(e=>e.orientation===`horizontal`&&e.coord>=L&&e.coord<=R),te=c.filter(e=>e.orientation===`vertical`&&e.coord>=P&&e.coord<=I),ne=e((e,t)=>`${e.toFixed(1)},${t.toFixed(1)}`,`getKey`),B=ne(v.x,v.y),re=ne(b.x,b.y),ie=new Map,ae=new Map,V=new Map,oe=new Set,H=[];ie.set(B,0),V.set(B,`n`),H.push({key:B,f:Math.hypot(b.x-v.x,b.y-v.y),pt:v}),oe.add(B);let U=[],W=e((e,t)=>x(e,t,n.start,n.end),`checkSegmentBlocked`),G={x:b.x,y:v.y},K=W(v,G),se=W(G,b),ce=K||se,le={x:v.x,y:b.y},ue=W(v,le),de=W(le,b);if(ce?ue||de||(U=Math.abs(v.x-b.x)<$?[v,b]:[v,le,b]):U=Math.abs(v.y-b.y)<$||Math.abs(v.x-b.x)<$?[v,b]:[v,G,b],U.length===0)for(;H.length>0;){H.sort((e,t)=>e.f-t.f);let e=H.shift();if(oe.delete(e.key),e.key===re){let e=re,t=b;for(U=[t];ae.has(e);){let n=ae.get(e);U.unshift(n),t=n,e=ne(n.x,n.y)}break}let r=e.pt.x,i=e.pt.y,a=te.sort((e,t)=>e.coord-t.coord),o=a.findIndex(e=>Math.abs(e.coord-r)<1),s=z.sort((e,t)=>e.coord-t.coord),c=s.findIndex(e=>Math.abs(e.coord-i)<1),l=[];o>0&&l.push({x:a[o-1].coord,y:i}),o>=0&&o0&&l.push({x:r,y:s[c-1].coord}),c>=0&&ce.nodeId===n.start||e.nodeId===n.end?!1:o===s?e.minXr&&e.maxY>c&&e.minYi&&e.maxX>o&&e.minX10&&x<-5||g<-10&&x>5)&&(m=Math.abs(x)*100),(h>10&&_<-5||h<-10&&_>5)&&(m+=Math.abs(_)*50);let S=0,C=V.get(e.key)??`n`,w=Math.abs(_)>$?`h`:`v`;C!==`n`&&C!==w&&(S=50);let T=f+p+m+S,E=(ie.get(e.key)??1/0)+T,D=Math.abs(b.x-a.x)+Math.abs(b.y-a.y);if(E<(ie.get(u)??1/0))if(ae.set(u,e.pt),ie.set(u,E),V.set(u,w),!oe.has(u))H.push({key:u,f:E+D,pt:a}),oe.add(u);else{let e=H.findIndex(e=>e.key===u);e!==-1&&(H[e].f=E+D)}}}if(U.length===0&&(U=[v,{x:v.x,y:b.y},b]),U.length>4){let t=U[0],n=U[U.length-1],r=Math.min(t.x,n.x),i=Math.max(t.x,n.x),a=Math.min(t.y,n.y),o=Math.max(t.y,n.y);for(let e of U)r=Math.min(r,e.x),i=Math.max(i,e.x),a=Math.min(a,e.y),o=Math.max(o,e.y);let s=i>Math.max(t.x,n.x),c=re.minXr&&e.minYa);if(s.length>0){let r=Math.max(t.x,n.x);for(let t of s){let n=(t.minX+t.maxX)/2;if(t.visualXHalfExtent===void 0||isNaN(t.visualXHalfExtent))continue;let i=n+t.visualXHalfExtent+e;r=Math.max(r,i)}isNaN(r)||(i=r)}}if(c){let i=d.filter(r=>r.minXMath.min(t.y,n.y));if(i.length>0){let a=Math.min(t.x,n.x);for(let t of i){let n=(t.minX+t.maxX)/2-t.visualXHalfExtent-e;a=Math.min(a,n)}r=a}}}let u=e(e=>{let r=n.y>t.y,i=d.filter(e=>{let r=Math.min(t.x,n.x)e.minX,i=Math.min(t.y,n.y)e.minY;return r&&i}),a=i;if(l&&i.length>0){let t=i.filter(t=>t.minXe);t.length>0&&(a=t)}if(a.length===0)return n.y;let o=kn;if(r){let e=Math.max(...a.map(e=>e.maxY))+o;if(ee.minY))-o;if(e>n.y+$)return e}return n.y},`findBestReturnY`),f=e(e=>{let r=u(e),i={x:e,y:t.y},a={x:e,y:r},o={x:n.x,y:r},s=W(t,i),c=W(i,a),l=W(a,o),d=r!==n.y&&W(o,n);return!s&&!c&&!l&&!d?Math.abs(r-n.y)<$?[t,i,a,n]:[t,i,a,o,n]:null},`trySimplifyWithDetourX`),p=s&&!c?f(i):c&&!s?f(r):null;p&&(U=p)}let q=[s,...O,...U,...j.reverse(),u];if(q.length>=3){let e=q[q.length-1],t=q[q.length-2],n=q[q.length-3],r=Math.abs(n.y-t.y)<$&&Math.abs(t.y-e.y)<$,i=Math.abs(n.x-t.x)<$&&Math.abs(t.x-e.x)<$;if(r){let r=Math.sign(t.x-n.x),i=Math.sign(e.x-n.x);r!==0&&r===i&&Math.abs(t.x-n.x)>Math.abs(e.x-n.x)&&q.splice(-2,1)}else if(i){let r=Math.sign(t.y-n.y),i=Math.sign(e.y-n.y);r!==0&&r===i&&Math.abs(t.y-n.y)>Math.abs(e.y-n.y)&&q.splice(-2,1)}}let J=[q[0]];for(let e=1;et.x!=r.x>n.x){J.push(n);continue}continue}if(Math.abs(t.x-n.x)<$&&Math.abs(n.x-r.x)<$){if(n.y>t.y!=r.y>n.y){J.push(n);continue}continue}J.push(n)}J.push(q[q.length-1]);for(let e=0;ee.from{let i=!r.segments.some(n=>(n.edgeIndex!==t.edgeIndex||n.segmentIndex!==t.segmentIndex)&&L(n,e)),a=!n.segments.some(n=>(n.edgeIndex!==e.edgeIndex||n.segmentIndex!==e.segmentIndex)&&L(n,t));return i&&a?(e.trackIndex=r.index,t.trackIndex=n.index,n.segments=[...n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),{edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,from:t.from,to:t.to}],r.segments=[...r.segments.filter(e=>e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex),{edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to}],!0):!1},`trySwapSegmentsAcrossTracks`),z=e(e=>{let t=e.tracks.length;return e.tracks[t]={index:t,coord:e.coord,segments:[]},t},`createNewTrack`),te=e((e,t)=>{let n=e.pipe.tracks[e.trackIndex];n.segments=n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),e.trackIndex=t,e.pipe.tracks[t].segments.push({edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to})},`moveSegmentToTrack`),ne=e((e,t)=>{let n=g[e.edgeIndex];for(let r of n){let n=h[r];n.pipe===e.pipe&&te(n,t)}},`moveSegmentChainToTrack`),B=e(e=>{let t=g[e.edgeIndex],n=t.indexOf(h.indexOf(e)),r=[];return n>0&&r.push(h[t[n-1]]),n{if(e.orientation===t.orientation)return!1;let n=e.orientation===`horizontal`?e:t,r=e.orientation===`horizontal`?t:e;return r.pipe.coord>n.from&&r.pipe.coordr.from&&n.pipe.coord{for(let n of e.tracks)if(!n.segments.some(e=>(e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex)&&L(e,t)))return n.index;return-1},`findAvailableTrack`),ae=e((e,t)=>{if(e.trackIndex===t.trackIndex)return L(e,t);let n=B(e),r=B(t);return n.some(e=>r.some(t=>re(e,t)))},`segmentsConflict`),V=e((e,t,n)=>{if(R(e,t,e.pipe.tracks[e.trackIndex],t.pipe.tracks[t.trackIndex]))return;let r=ie(e.pipe,t);n(t,r===-1?z(e.pipe):r)},`resolveTrackConflict`),oe=e(e=>{let t=0;for(let n=0;n{if(H.has(e))return H.get(e);let t=g[e];if(t.length===0){let t={dest:0,deviation:0,base:0,delta:0};return H.set(e,t),t}let n=h[t[0]].pipe.coord,r=n;for(let e=1;eMath.abs(t-n)?e:t;break}}let i=Math.abs(r-n),a={dest:r,deviation:i,base:n,delta:r-n};return H.set(e,a),a},`getDestInfo`),W=e(()=>{let t=0,n=new Map;for(let[e,t]of a.entries())g[e].length!==0&&t.start&&(n.has(t.start)||n.set(t.start,[]),n.get(t.start).push(e));let r=e(e=>{let t=a[e];if(!t.start||!t.end)return 0;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)return 0;let i=(r.x??0)-(n.x??0),s=(r.y??0)-(n.y??0);return Math.abs(i)+Math.abs(s)},`getEdgeDistance`);for(let e of n.values()){e.sort((e,t)=>{let n=U(e),i=U(t);if(Math.abs(n.deviation-i.deviation)>1)return n.deviation-i.deviation;if(Math.abs(n.dest-i.dest)>1)return n.dest-i.dest;let a=r(e),o=r(t);if(Math.abs(a-o)>1)return o-a;let s=g[e].length,c=g[t].length;if(s!==c)return s-c;if(s===1){let n=g[e][0],r=g[t][0];if(h[n]&&h[r]){let e=h[n],t=h[r],i=Math.abs(e.to-e.from),a=Math.abs(t.to-t.from);if(Math.abs(i-a)>1)return i-a}}return 0});let n=e.map(e=>h[g[e][0]]);t+=oe(n)}return t},`fixSourceHandleCrossings`),G=e(()=>{let t=0,n=new Map;for(let[e,t]of a.entries())g[e].length!==0&&t.end&&(n.has(t.end)||n.set(t.end,[]),n.get(t.end).push(e));for(let r of n.values()){r.sort((t,n)=>{let r=e(e=>{let t=g[e];if(t.length<2)return 0;let n=h[t[t.length-2]];return Math.abs(n.to-n.from)},`getDist`),i=r(t),a=r(n);return Math.abs(i-a)>.1?i-a:t-n});let n=r.map(e=>h[g[e][g[e].length-1]]);t+=oe(n)}return t},`fixTargetHandleCrossings`),K=e(()=>{let e=0;for(let t of c){let n=[];for(let e of t.tracks)for(let t of e.segments){let e=g[t.edgeIndex].find(e=>h[e].segmentIndex===t.segmentIndex);e!==void 0&&n.push(h[e])}n.sort((e,t)=>e.edgeIndex-t.edgeIndex||e.segmentIndex-t.segmentIndex);for(let t=0;t{e.segments.forEach(t=>{n.push({edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,trackIndex:e.index,from:t.from,to:t.to})})}),n.sort((e,t)=>e.from-t.from);let r=[];if(n.length>0){let e=[n[0]],t=n[0].to;for(let i=1;ir.add(e.trackIndex));let i=new Map;n.forEach(e=>{let t=U(e.edgeIndex);i.set(e.trackIndex,(i.get(e.trackIndex)??0)+t.delta)});let a=[...r].filter(e=>(i.get(e)??0)<-1),o=[...r].filter(e=>(i.get(e)??0)>1),s=[...r].filter(e=>Math.abs(i.get(e)??0)<=1);a.sort((e,t)=>(i.get(t)??0)-(i.get(e)??0)),o.sort((e,t)=>(i.get(e)??0)-(i.get(t)??0));let c=e((e,r)=>{n.filter(t=>t.trackIndex===e).forEach(e=>{let n=_.has(e.edgeIndex)?t.coord:r;ce.set(`${e.edgeIndex}-${e.segmentIndex}`,n)})},`assignCoord`),l=0;for(let e of a)l++,c(e,t.coord-l*Nn);if(s.length===0&&r.size>0){let e=[...r].sort((e,t)=>Math.abs(i.get(e)??0)-Math.abs(i.get(t)??0))[0],t=a.indexOf(e);t!==-1&&a.splice(t,1);let n=o.indexOf(e);n!==-1&&o.splice(n,1),s.push(e)}let u=0;for(let e of s){if(u===0)c(e,t.coord);else{let n=u%2==1?1:-1,r=Math.ceil(u/2);c(e,t.coord+n*r*Nn*.5)}u++}let d=0;for(let e of o)d++,c(e,t.coord+d*Nn)}}for(let[e,t]of a.entries()){let n=g[e]??[];if(n.length===0)continue;let r=[],{pSrcPort:i,pDstPort:a}=ee(e,o.get(t.start),o.get(t.end)),s=n.map(e=>{let t=h[e],n=ce.get(`${t.edgeIndex}-${t.segmentIndex}`)??t.pipe.coord;return{orient:t.orientation,coord:n,from:t.from,to:t.to}});r.push(i);for(let e=0;e$&&r.push(In(t,i)),c&&o.orient===t.orient)if(Math.abs(t.coord-o.coord)>$){let e=t.orient===`vertical`?(i+o.from)/2:Fn(t,o);r.push(In(t,e),In(o,e))}else(e===0||e===s.length-2)&&r.push(In(t,Fn(t,o)));else if(c)r.push(In(t,o.coord));else{let e=Math.abs(t.from-i)$||Math.abs(c.y-a.y)>$)&&r.push(a);let l=[];r.length>0&&l.push(r[0]);for(let e=1;e$||Math.abs(t.y-n.y)>$)&&l.push(t)}t.points=l}for(let e of a){let t=e.__originalEdge;t&&e.points&&(t.points=e.points)}t.edges=(t.edges??[]).filter(e=>!e.isLayoutOnly);let le=e((e,t)=>{let n=t.x??0,r=t.y??0,i=t.width??0,a=t.height??0;if(i<=0||a<=0)return e;let o=n-i/2,s=n+i/2,c=r-a/2,l=r+a/2;if(e.xs||e.yl)return e;let u=e.x-o,d=s-e.x,f=e.y-c,p=l-e.y,m=Math.min(u,d,f,p);return m===u?{x:o,y:e.y}:m===d?{x:s,y:e.y}:m===f?{x:e.x,y:c}:{x:e.x,y:l}},`nodeBoundaryClamp`);for(let e of t.edges){let t=e.points;if(!t||t.length<2)continue;let n=e.start,r=e.end,i=n?o.get(n):void 0,a=r?o.get(r):void 0;i&&(t[0]=le(t[0],i)),a&&(t[t.length-1]=le(t[t.length-1],a))}return t}e(Ln,`routeEdgesOrthogonal`);function Rn(e){return e.direction??`TB`}e(Rn,`getSwimlaneDirection`);function zn(e){let t=d(e),n=e.config.flowchart?.nodeSpacing??40,r=e.config.flowchart?.rankSpacing??100,i=e.config.swimlane?.ignoreCrossLaneEdges??!0,a=e.config.swimlane?.optimizeRanksByCrossings??!0,o=e.config.swimlane?.automaticLaneOrdering??!1,s=Rn(e),{ordered:c,coordinates:l}=Dn(t,{nodeGap:n,layerGap:r,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:s});f(t,c,l,{nodeGap:n,layerGap:r});for(let t of e.edges??[])delete t.points;Ln(e,s);for(let t of e.edges??[])(!t.curve||t.curve===`basis`)&&(t.curve=`rounded`);return _t(e,s),gt(e),s}e(zn,`runSwimlaneLayoutCore`);function Bn(e){u(e);let t=m(e);e.nodes=t.nodes,e.edges=t.edges}e(Bn,`prepareSwimlaneLayout`);var Vn=n({prepareLayout:Bn,runLayoutCore:zn,afterPaint:i});export{Vn as render}; \ No newline at end of file diff --git a/web/dist/app-swimlanesDiagram-TC7HE7FX.js b/web/dist/app-swimlanesDiagram-TC7HE7FX.js index 8c32c5dbc..d6bc0af9c 100644 --- a/web/dist/app-swimlanesDiagram-TC7HE7FX.js +++ b/web/dist/app-swimlanesDiagram-TC7HE7FX.js @@ -1,4 +1,4 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-LNGE3PJU.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import"./app-chunk-GNY47TPC.js";import"./app-chunk-GWA4HPMP.js";import"./app-chunk-XXDRQBXY.js";import"./app-chunk-WEXAMYUT.js";import{r as t,t as n}from"./app-chunk-7M6MHVWA.js";var r=n({styles:e(e=>`${t(e)} +import{n as e}from"./app-chunk-Y2CYZVJY.js";import"./app-src.js";import"./app-chunk-O7XYJQB3.js";import"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import"./app-chunk-GWA4HPMP.js";import"./app-chunk-XXDRQBXY.js";import"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-GNY47TPC.js";import"./app-chunk-LNGE3PJU.js";import{r as t,t as n}from"./app-chunk-7M6MHVWA.js";var r=n({styles:e(e=>`${t(e)} .swimlane.cluster:not([data-color-id]) rect { stroke: ${e.clusterBorder} !important; } diff --git a/web/dist/app-usecaseDiagram-POWQR4AR.js b/web/dist/app-usecaseDiagram-POWQR4AR.js index 1c6798fe0..1c5e4e6d4 100644 --- a/web/dist/app-usecaseDiagram-POWQR4AR.js +++ b/web/dist/app-usecaseDiagram-POWQR4AR.js @@ -1,4 +1,4 @@ -import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{H as r,U as i,a,b as o,f as s,q as c,v as l,w as u,x as d,y as f,z as p}from"./app-chunk-O7XYJQB3.js";import{g as m}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-7PRAP22T.js";import"./app-chunk-742MDFTN.js";import{i as h}from"./app-chunk-MBY4JIJT.js";import{a as g,i as ee,o as te,r as _}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-UA2S7LBM.js";import"./app-chunk-Z7XXMR3K.js";import{r as ne,t as re}from"./app-chunk-GNY47TPC.js";import{t as ie}from"./app-chunk-XXDRQBXY.js";import{t as ae}from"./app-chunk-WEXAMYUT.js";var oe=typeof global==`object`&&global&&global.Object===Object&&global,se=typeof self==`object`&&self&&self.Object===Object&&self,v=oe||se||Function(`return this`)(),y=v.Symbol,ce=Object.prototype,le=ce.hasOwnProperty,ue=ce.toString,de=y?y.toStringTag:void 0;function fe(e){var t=le.call(e,de),n=e[de];try{e[de]=void 0;var r=!0}catch{}var i=ue.call(e);return r&&(t?e[de]=n:delete e[de]),i}var pe=Object.prototype.toString;function me(e){return pe.call(e)}var he=`[object Null]`,ge=`[object Undefined]`,_e=y?y.toStringTag:void 0;function ve(e){return e==null?e===void 0?ge:he:_e&&_e in Object(e)?fe(e):me(e)}function ye(e){return typeof e==`object`&&!!e}var be=`[object Symbol]`;function xe(e){return typeof e==`symbol`||ye(e)&&ve(e)==be}function Se(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n0){if(++t>=mt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function vt(e){return function(){return e}}var yt=function(){try{var e=ct(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),bt=_t(yt?function(e,t){return yt(e,`toString`,{configurable:!0,enumerable:!1,value:vt(t),writable:!0})}:He);function xt(e,t){for(var n=-1,r=e==null?0:e.length;++n-1}var Dt=9007199254740991,Ot=/^(?:0|[1-9]\d*)$/;function kt(e,t){var n=typeof e;return t??=Dt,!!t&&(n==`number`||n!=`symbol`&&Ot.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=Rt}function Bt(e){return e!=null&&zt(e.length)&&!qe(e)}function Vt(e,t,n){if(!je(n))return!1;var r=typeof t;return(r==`number`?Bt(n)&&kt(t,n.length):r==`string`&&t in n)?jt(n[t],e):!1}function Ht(e){return Lt(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&Vt(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r-1}function pr(e,t){var n=this.__data__,r=cr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function mr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t0&&n(s)?t>1?Br(s,t-1,n,r,i):Lr(i,s):r||(i[i.length]=s)}return i}function Vr(e){return e!=null&&e.length?Br(e,1):[]}var Hr=Rn(Object.getPrototypeOf,Object);function Ur(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++rs))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&ro?new $a:void 0;for(a.set(e,t),a.set(t,e);++d2?t[2]:void 0;for(i&&Vt(t[0],t[1],i)&&(r=1);++n=us&&(a=to,o=!1,t=new $a(t));outer:for(;++i-1?i[a?t[o]:o]:void 0}}var Ss=Math.max;function Cs(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Ve(n);return i<0&&(i=Ss(r+i,0)),St(e,Xo(t,3),i)}var ws=xs(Cs);function Ts(e){return e&&e.length?e[0]:void 0}function Es(e,t){var n=-1,r=Bt(e)?Array(e.length):[];return ns(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function k(e,t){return(b(e)?Se:Es)(e,Xo(t,3))}function Ds(e,t){return Br(k(e,t),1)}var Os=Object.prototype.hasOwnProperty,ks=is(function(e,t,n){Os.call(e,n)?e[n].push(t):At(e,n,[t])}),As=Object.prototype.hasOwnProperty;function js(e,t){return e!=null&&As.call(e,t)}function A(e,t){return e!=null&&Ho(e,t,js)}var Ms=`[object String]`;function j(e){return typeof e==`string`||!b(e)&&ye(e)&&ve(e)==Ms}function Ns(e,t){return Se(t,function(t){return e[t]})}function M(e){return e==null?[]:Ns(e,C(e))}var Ps=Math.max;function N(e,t,n,r){e=Bt(e)?e:M(e),n=n&&!r?Ve(n):0;var i=e.length;return n<0&&(n=Ps(i+n,0)),j(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Tt(e,t,n)>-1}var Fs=Math.max;function Is(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Ve(n);return i<0&&(i=Fs(r+i,0)),Tt(e,t,i)}var Ls=`[object Map]`,Rs=`[object Set]`,zs=Object.prototype.hasOwnProperty;function P(e){if(e==null)return!0;if(Bt(e)&&(b(e)||typeof e==`string`||typeof e.splice==`function`||nn(e)||Fn(e)||Zt(e)))return!e.length;var t=ji(e);if(t==Ls||t==Rs)return!e.size;if(Wt(e))return!Vn(e).length;for(var n in e)if(zs.call(e,n))return!1;return!0}var Bs=`[object RegExp]`;function Vs(e){return ye(e)&&ve(e)==Bs}var Hs=Nn&&Nn.isRegExp,Us=Hs?kn(Hs):Vs;function Ws(e){return e===void 0}var Gs=`Expected a function`;function Ks(e){if(typeof e!=`function`)throw TypeError(Gs);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function qs(e,t,n,r){if(!je(e))return e;t=Mr(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i=tc){var l=t?null:ec(e);if(l)return oo(l);o=!1,i=to,c=new $a}else c=t?[]:s;outer:for(;++r{t.accept(e)})}},I=class extends uc{constructor(e){super([]),this.idx=1,w(this,Ys(e,e=>e!==void 0))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},dc=class extends uc{constructor(e){super(e.definition),this.orgText=``,w(this,Ys(e,e=>e!==void 0))}},L=class extends uc{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,w(this,Ys(e,e=>e!==void 0))}},R=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},fc=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},pc=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},z=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},mc=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},hc=class extends uc{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,w(this,Ys(e,e=>e!==void 0))}},B=class{constructor(e){this.idx=1,w(this,Ys(e,e=>e!==void 0))}accept(e){e.visit(this)}};function gc(e){return k(e,_c)}function _c(e){function t(e){return k(e,_c)}if(e instanceof I){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return j(e.label)&&(t.label=e.label),t}if(e instanceof L)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof R)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof fc)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof pc)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:_c(new B({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof mc)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:_c(new B({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof z)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof hc)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof B){let t={type:`Terminal`,name:e.terminalType.name,label:cc(e.terminalType),idx:e.idx};j(e.label)&&(t.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=Us(n)?n.source:n),t}if(e instanceof dc)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`)}var vc=class{visit(e){let t=e;switch(t.constructor){case I:return this.visitNonTerminal(t);case L:return this.visitAlternative(t);case R:return this.visitOption(t);case fc:return this.visitRepetitionMandatory(t);case pc:return this.visitRepetitionMandatoryWithSeparator(t);case mc:return this.visitRepetitionWithSeparator(t);case z:return this.visitRepetition(t);case hc:return this.visitAlternation(t);case B:return this.visitTerminal(t);case dc:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function yc(e){return e instanceof L||e instanceof R||e instanceof z||e instanceof fc||e instanceof pc||e instanceof mc||e instanceof B||e instanceof dc}function bc(e,t=[]){return e instanceof R||e instanceof z||e instanceof mc?!0:e instanceof hc?$s(e.definition,e=>bc(e,t)):e instanceof I&&N(t,e)?!1:e instanceof uc&&(e instanceof I&&t.push(e),vs(e.definition,e=>bc(e,t)))}function xc(e){return e instanceof hc}function Sc(e){if(e instanceof I)return`SUBRULE`;if(e instanceof R)return`OPTION`;if(e instanceof hc)return`OR`;if(e instanceof fc)return`AT_LEAST_ONE`;if(e instanceof pc)return`AT_LEAST_ONE_SEP`;if(e instanceof mc)return`MANY_SEP`;if(e instanceof z)return`MANY`;if(e instanceof B)return`CONSUME`;throw Error(`non exhaustive match`)}var Cc=class{walk(e,t=[]){O(e.definition,(n,r)=>{let i=D(e.definition,r+1);if(n instanceof I)this.walkProdRef(n,i,t);else if(n instanceof B)this.walkTerminal(n,i,t);else if(n instanceof L)this.walkFlat(n,i,t);else if(n instanceof R)this.walkOption(n,i,t);else if(n instanceof fc)this.walkAtLeastOne(n,i,t);else if(n instanceof pc)this.walkAtLeastOneSep(n,i,t);else if(n instanceof mc)this.walkManySep(n,i,t);else if(n instanceof z)this.walkMany(n,i,t);else if(n instanceof hc)this.walkOr(n,i,t);else throw Error(`non exhaustive match`)})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){let r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){let r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){let r=[new R({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=wc(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new R({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=wc(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);O(e.definition,e=>{let t=new L({definition:[e]});this.walk(t,r)})}};function wc(e,t,n){return[new R({definition:[new B({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Tc(e){if(e instanceof I)return Tc(e.referencedRule);if(e instanceof B)return Oc(e);if(yc(e))return Ec(e);if(xc(e))return Dc(e);throw Error(`non exhaustive match`)}function Ec(e){let t=[],n=e.definition,r=0,i=n.length>r,a,o=!0;for(;i&&o;)a=n[r],o=bc(a),t=t.concat(Tc(a)),r+=1,i=n.length>r;return rc(t)}function Dc(e){return rc(Vr(k(e.definition,e=>Tc(e))))}function Oc(e){return[e.terminalType]}var kc=`_~IN~_`,Ac=class extends Cc{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){let r=Mc(e.referencedRule,e.idx)+this.topProd.name,i=Tc(new L({definition:t.concat(n)}));this.follows[r]=i}};function jc(e){let t={};return O(e,e=>{let n=new Ac(e).startWalking();w(t,n)}),t}function Mc(e,t){return e.name+t+kc}function V(e){return e.charCodeAt(0)}function Nc(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Pc(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t],e[t]=!0}function Fc(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`);return!0}function Ic(){throw Error(`Internal Error - Should never get here!`)}function Lc(e){return e.type===`Character`}var Rc=[];for(let e=V(`0`);e<=V(`9`);e++)Rc.push(e);var zc=[V(`_`)].concat(Rc);for(let e=V(`a`);e<=V(`z`);e++)zc.push(e);for(let e=V(`A`);e<=V(`Z`);e++)zc.push(e);var Bc=[V(` `),V(`\f`),V(` +import{n as e}from"./app-chunk-Y2CYZVJY.js";import{m as t,p as n}from"./app-src.js";import{H as r,U as i,a,b as o,f as s,q as c,v as l,w as u,x as d,y as f,z as p}from"./app-chunk-O7XYJQB3.js";import{g as m}from"./app-chunk-ZIGJFQKS.js";import"./app-chunk-742MDFTN.js";import{i as h}from"./app-chunk-MBY4JIJT.js";import"./app-chunk-7PRAP22T.js";import{a as g,i as ee,o as te,r as _}from"./app-chunk-J5ZVWO5B.js";import"./app-chunk-7INBJB4K.js";import"./app-chunk-5DYCD2WN.js";import"./app-chunk-Z7XXMR3K.js";import{t as ne}from"./app-chunk-XXDRQBXY.js";import{t as re}from"./app-chunk-WEXAMYUT.js";import"./app-chunk-UA2S7LBM.js";import{r as ie,t as ae}from"./app-chunk-GNY47TPC.js";var oe=typeof global==`object`&&global&&global.Object===Object&&global,se=typeof self==`object`&&self&&self.Object===Object&&self,v=oe||se||Function(`return this`)(),y=v.Symbol,ce=Object.prototype,le=ce.hasOwnProperty,ue=ce.toString,de=y?y.toStringTag:void 0;function fe(e){var t=le.call(e,de),n=e[de];try{e[de]=void 0;var r=!0}catch{}var i=ue.call(e);return r&&(t?e[de]=n:delete e[de]),i}var pe=Object.prototype.toString;function me(e){return pe.call(e)}var he=`[object Null]`,ge=`[object Undefined]`,_e=y?y.toStringTag:void 0;function ve(e){return e==null?e===void 0?ge:he:_e&&_e in Object(e)?fe(e):me(e)}function ye(e){return typeof e==`object`&&!!e}var be=`[object Symbol]`;function xe(e){return typeof e==`symbol`||ye(e)&&ve(e)==be}function Se(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n0){if(++t>=mt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function vt(e){return function(){return e}}var yt=function(){try{var e=ct(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),bt=_t(yt?function(e,t){return yt(e,`toString`,{configurable:!0,enumerable:!1,value:vt(t),writable:!0})}:He);function xt(e,t){for(var n=-1,r=e==null?0:e.length;++n-1}var Dt=9007199254740991,Ot=/^(?:0|[1-9]\d*)$/;function kt(e,t){var n=typeof e;return t??=Dt,!!t&&(n==`number`||n!=`symbol`&&Ot.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=Rt}function Bt(e){return e!=null&&zt(e.length)&&!qe(e)}function Vt(e,t,n){if(!je(n))return!1;var r=typeof t;return(r==`number`?Bt(n)&&kt(t,n.length):r==`string`&&t in n)?jt(n[t],e):!1}function Ht(e){return Lt(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&Vt(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r-1}function pr(e,t){var n=this.__data__,r=cr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function mr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t0&&n(s)?t>1?Br(s,t-1,n,r,i):Lr(i,s):r||(i[i.length]=s)}return i}function Vr(e){return e!=null&&e.length?Br(e,1):[]}var Hr=Rn(Object.getPrototypeOf,Object);function Ur(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++rs))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&ro?new $a:void 0;for(a.set(e,t),a.set(t,e);++d2?t[2]:void 0;for(i&&Vt(t[0],t[1],i)&&(r=1);++n=us&&(a=to,o=!1,t=new $a(t));outer:for(;++i-1?i[a?t[o]:o]:void 0}}var Ss=Math.max;function Cs(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Ve(n);return i<0&&(i=Ss(r+i,0)),St(e,Xo(t,3),i)}var ws=xs(Cs);function Ts(e){return e&&e.length?e[0]:void 0}function Es(e,t){var n=-1,r=Bt(e)?Array(e.length):[];return ns(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function k(e,t){return(b(e)?Se:Es)(e,Xo(t,3))}function Ds(e,t){return Br(k(e,t),1)}var Os=Object.prototype.hasOwnProperty,ks=is(function(e,t,n){Os.call(e,n)?e[n].push(t):At(e,n,[t])}),As=Object.prototype.hasOwnProperty;function js(e,t){return e!=null&&As.call(e,t)}function A(e,t){return e!=null&&Ho(e,t,js)}var Ms=`[object String]`;function j(e){return typeof e==`string`||!b(e)&&ye(e)&&ve(e)==Ms}function Ns(e,t){return Se(t,function(t){return e[t]})}function M(e){return e==null?[]:Ns(e,C(e))}var Ps=Math.max;function N(e,t,n,r){e=Bt(e)?e:M(e),n=n&&!r?Ve(n):0;var i=e.length;return n<0&&(n=Ps(i+n,0)),j(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Tt(e,t,n)>-1}var Fs=Math.max;function Is(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Ve(n);return i<0&&(i=Fs(r+i,0)),Tt(e,t,i)}var Ls=`[object Map]`,Rs=`[object Set]`,zs=Object.prototype.hasOwnProperty;function P(e){if(e==null)return!0;if(Bt(e)&&(b(e)||typeof e==`string`||typeof e.splice==`function`||nn(e)||Fn(e)||Zt(e)))return!e.length;var t=ji(e);if(t==Ls||t==Rs)return!e.size;if(Wt(e))return!Vn(e).length;for(var n in e)if(zs.call(e,n))return!1;return!0}var Bs=`[object RegExp]`;function Vs(e){return ye(e)&&ve(e)==Bs}var Hs=Nn&&Nn.isRegExp,Us=Hs?kn(Hs):Vs;function Ws(e){return e===void 0}var Gs=`Expected a function`;function Ks(e){if(typeof e!=`function`)throw TypeError(Gs);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function qs(e,t,n,r){if(!je(e))return e;t=Mr(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i=tc){var l=t?null:ec(e);if(l)return oo(l);o=!1,i=to,c=new $a}else c=t?[]:s;outer:for(;++r{t.accept(e)})}},I=class extends uc{constructor(e){super([]),this.idx=1,w(this,Ys(e,e=>e!==void 0))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},dc=class extends uc{constructor(e){super(e.definition),this.orgText=``,w(this,Ys(e,e=>e!==void 0))}},L=class extends uc{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,w(this,Ys(e,e=>e!==void 0))}},R=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},fc=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},pc=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},z=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},mc=class extends uc{constructor(e){super(e.definition),this.idx=1,w(this,Ys(e,e=>e!==void 0))}},hc=class extends uc{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,w(this,Ys(e,e=>e!==void 0))}},B=class{constructor(e){this.idx=1,w(this,Ys(e,e=>e!==void 0))}accept(e){e.visit(this)}};function gc(e){return k(e,_c)}function _c(e){function t(e){return k(e,_c)}if(e instanceof I){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return j(e.label)&&(t.label=e.label),t}if(e instanceof L)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof R)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof fc)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof pc)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:_c(new B({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof mc)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:_c(new B({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof z)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof hc)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof B){let t={type:`Terminal`,name:e.terminalType.name,label:cc(e.terminalType),idx:e.idx};j(e.label)&&(t.terminalLabel=e.label);let n=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=Us(n)?n.source:n),t}if(e instanceof dc)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`)}var vc=class{visit(e){let t=e;switch(t.constructor){case I:return this.visitNonTerminal(t);case L:return this.visitAlternative(t);case R:return this.visitOption(t);case fc:return this.visitRepetitionMandatory(t);case pc:return this.visitRepetitionMandatoryWithSeparator(t);case mc:return this.visitRepetitionWithSeparator(t);case z:return this.visitRepetition(t);case hc:return this.visitAlternation(t);case B:return this.visitTerminal(t);case dc:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function yc(e){return e instanceof L||e instanceof R||e instanceof z||e instanceof fc||e instanceof pc||e instanceof mc||e instanceof B||e instanceof dc}function bc(e,t=[]){return e instanceof R||e instanceof z||e instanceof mc?!0:e instanceof hc?$s(e.definition,e=>bc(e,t)):e instanceof I&&N(t,e)?!1:e instanceof uc&&(e instanceof I&&t.push(e),vs(e.definition,e=>bc(e,t)))}function xc(e){return e instanceof hc}function Sc(e){if(e instanceof I)return`SUBRULE`;if(e instanceof R)return`OPTION`;if(e instanceof hc)return`OR`;if(e instanceof fc)return`AT_LEAST_ONE`;if(e instanceof pc)return`AT_LEAST_ONE_SEP`;if(e instanceof mc)return`MANY_SEP`;if(e instanceof z)return`MANY`;if(e instanceof B)return`CONSUME`;throw Error(`non exhaustive match`)}var Cc=class{walk(e,t=[]){O(e.definition,(n,r)=>{let i=D(e.definition,r+1);if(n instanceof I)this.walkProdRef(n,i,t);else if(n instanceof B)this.walkTerminal(n,i,t);else if(n instanceof L)this.walkFlat(n,i,t);else if(n instanceof R)this.walkOption(n,i,t);else if(n instanceof fc)this.walkAtLeastOne(n,i,t);else if(n instanceof pc)this.walkAtLeastOneSep(n,i,t);else if(n instanceof mc)this.walkManySep(n,i,t);else if(n instanceof z)this.walkMany(n,i,t);else if(n instanceof hc)this.walkOr(n,i,t);else throw Error(`non exhaustive match`)})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){let r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){let r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){let r=[new R({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=wc(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new R({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=wc(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);O(e.definition,e=>{let t=new L({definition:[e]});this.walk(t,r)})}};function wc(e,t,n){return[new R({definition:[new B({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function Tc(e){if(e instanceof I)return Tc(e.referencedRule);if(e instanceof B)return Oc(e);if(yc(e))return Ec(e);if(xc(e))return Dc(e);throw Error(`non exhaustive match`)}function Ec(e){let t=[],n=e.definition,r=0,i=n.length>r,a,o=!0;for(;i&&o;)a=n[r],o=bc(a),t=t.concat(Tc(a)),r+=1,i=n.length>r;return rc(t)}function Dc(e){return rc(Vr(k(e.definition,e=>Tc(e))))}function Oc(e){return[e.terminalType]}var kc=`_~IN~_`,Ac=class extends Cc{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){let r=Mc(e.referencedRule,e.idx)+this.topProd.name,i=Tc(new L({definition:t.concat(n)}));this.follows[r]=i}};function jc(e){let t={};return O(e,e=>{let n=new Ac(e).startWalking();w(t,n)}),t}function Mc(e,t){return e.name+t+kc}function V(e){return e.charCodeAt(0)}function Nc(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function Pc(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t],e[t]=!0}function Fc(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`);return!0}function Ic(){throw Error(`Internal Error - Should never get here!`)}function Lc(e){return e.type===`Character`}var Rc=[];for(let e=V(`0`);e<=V(`9`);e++)Rc.push(e);var zc=[V(`_`)].concat(Rc);for(let e=V(`a`);e<=V(`z`);e++)zc.push(e);for(let e=V(`A`);e<=V(`Z`);e++)zc.push(e);var Bc=[V(` `),V(`\f`),V(` `),V(`\r`),V(` `),V(`\v`),V(` `),V(`\xA0`),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(` `),V(`\u2028`),V(`\u2029`),V(` `),V(` `),V(` `),V(``)],Vc=/[0-9a-fA-F]/,Hc=/[0-9]/,Uc=/[1-9]/,Wc=class{constructor(){this.idx=0,this.input=``,this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar(`/`);let t=this.disjunction();this.consumeChar(`/`);let n={type:`Flags`,loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case`g`:Pc(n,`global`);break;case`i`:Pc(n,`ignoreCase`);break;case`m`:Pc(n,`multiLine`);break;case`u`:Pc(n,`unicode`);break;case`y`:Pc(n,`sticky`)}if(this.idx!==this.input.length)throw Error(`Redundant input: `+this.input.substring(this.idx));return{type:`Pattern`,flags:n,value:t,loc:this.loc(0)}}disjunction(){let e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()===`|`;)this.consumeChar(`|`),e.push(this.alternative());return{type:`Disjunction`,value:e,loc:this.loc(t)}}alternative(){let e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:`Alternative`,value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case`^`:return{type:`StartAnchor`,loc:this.loc(e)};case`$`:return{type:`EndAnchor`,loc:this.loc(e)};case`\\`:switch(this.popChar()){case`b`:return{type:`WordBoundary`,loc:this.loc(e)};case`B`:return{type:`NonWordBoundary`,loc:this.loc(e)}}throw Error(`Invalid Assertion Escape`);case`(`:this.consumeChar(`?`);let t;switch(this.popChar()){case`=`:t=`Lookahead`;break;case`!`:t=`NegativeLookahead`;break;case`<`:switch(this.popChar()){case`=`:t=`Lookbehind`;break;case`!`:t=`NegativeLookbehind`}}Fc(t);let n=this.disjunction();return this.consumeChar(`)`),{type:t,value:n,loc:this.loc(e)}}return Ic()}quantifier(e=!1){let t,n=this.idx;switch(this.popChar()){case`*`:t={atLeast:0,atMost:1/0};break;case`+`:t={atLeast:1,atMost:1/0};break;case`?`:t={atLeast:0,atMost:1};break;case`{`:let n=this.integerIncludingZero();switch(this.popChar()){case`}`:t={atLeast:n,atMost:n};break;case`,`:let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar(`}`)}if(e===!0&&t===void 0)return;Fc(t)}if((e!==!0||t!==void 0)&&Fc(t))return this.peekChar(0)===`?`?(this.consumeChar(`?`),t.greedy=!1):t.greedy=!0,t.type=`Quantifier`,t.loc=this.loc(n),t}atom(){let e,t=this.idx;switch(this.peekChar()){case`.`:e=this.dotAll();break;case`\\`:e=this.atomEscape();break;case`[`:e=this.characterClass();break;case`(`:e=this.group()}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Fc(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Ic()}dotAll(){return this.consumeChar(`.`),{type:`Set`,complement:!0,value:[V(` `),V(`\r`),V(`\u2028`),V(`\u2029`)]}}atomEscape(){switch(this.consumeChar(`\\`),this.peekChar()){case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:return this.decimalEscapeAtom();case`d`:case`D`:case`s`:case`S`:case`w`:case`W`:return this.characterClassEscape();case`f`:case`n`:case`r`:case`t`:case`v`:return this.controlEscapeAtom();case`c`:return this.controlLetterEscapeAtom();case`0`:return this.nulCharacterAtom();case`x`:return this.hexEscapeSequenceAtom();case`u`:return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:`GroupBackReference`,value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case`d`:e=Rc;break;case`D`:e=Rc,t=!0;break;case`s`:e=Bc;break;case`S`:e=Bc,t=!0;break;case`w`:e=zc;break;case`W`:e=zc,t=!0}return Fc(e)?{type:`Set`,value:e,complement:t}:Ic()}controlEscapeAtom(){let e;switch(this.popChar()){case`f`:e=V(`\f`);break;case`n`:e=V(` `);break;case`r`:e=V(`\r`);break;case`t`:e=V(` `);break;case`v`:e=V(`\v`)}return Fc(e)?{type:`Character`,value:e}:Ic()}controlLetterEscapeAtom(){this.consumeChar(`c`);let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error(`Invalid `);return{type:`Character`,value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar(`0`),{type:`Character`,value:V(`\0`)}}hexEscapeSequenceAtom(){return this.consumeChar(`x`),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar(`u`),this.parseHexDigits(4)}identityEscapeAtom(){return{type:`Character`,value:V(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case` @@ -73,7 +73,7 @@ For Further details.`,r},buildEmptyRepetitionError(e){let t=Sc(e.repetition);ret `);break;case`r`:e&&(t+=`\r`);break;case`t`:e&&(t+=` `);break;case`u`:{let n=this.text.slice(this.offset,this.offset+4);if(!/^[\dA-Fa-f]{4}$/u.test(n))throw new Q(this.offset);e&&(t+=String.fromCharCode(Number.parseInt(n,16))),this.offset+=4;break}default:throw new Q(i)}}throw new Q(this.offset)}consumeLiteral(e){let t=0;for(let n of e){if(this.text[this.offset+t]!==n)throw new Q(this.offset+t);t++}this.offset+=e.length}consumeNumber(){if(this.text[this.offset]===`-`&&this.offset++,this.text[this.offset]===`0`)this.offset++;else if(this.text[this.offset]>=`1`&&this.text[this.offset]<=`9`)for(;this.text[this.offset]>=`0`&&this.text[this.offset]<=`9`;)this.offset++;else throw new Q(this.offset);if(this.text[this.offset]===`.`){if(this.offset++,this.text[this.offset]<`0`||this.text[this.offset]>`9`)throw new Q(this.offset);for(;this.text[this.offset]>=`0`&&this.text[this.offset]<=`9`;)this.offset++}if(this.text[this.offset]===`e`||this.text[this.offset]===`E`){if(this.offset++,(this.text[this.offset]===`+`||this.text[this.offset]===`-`)&&this.offset++,this.text[this.offset]<`0`||this.text[this.offset]>`9`)throw new Q(this.offset);for(;this.text[this.offset]>=`0`&&this.text[this.offset]<=`9`;)this.offset++}}skipWhitespace(){for(;this.offset({shape:e.type===`normal`?`actor`:e.type===`hollow`?`actor-hollow`:e.type===`awesome`?`actor-awesome`:`actor-icon`,...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`actor`,actorType:e.type,business:e.business,labelType:e.labelType,...e.icon?{icon:e.icon}:{},...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),`actorNode`),Lm=e(e=>({shape:e.shape,...e.label===e.id?{}:{label:e.label},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`usecase`,useCaseShape:e.shape,business:e.business,labelType:e.labelType,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{}}}),`useCaseNode`),Rm=e(e=>({label:e.label,shape:`note`,attrs:{kind:`note`,target:e.target,labelType:e.labelType}}),`noteNode`),zm=e(e=>({label:e.id,shape:`json-table`,...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{kind:`json`,value:e.value,propertyOrder:e.propertyOrder,labelType:`text`}}),`jsonNode`),Bm=e(e=>({id:e.id,source:e.source,target:e.target,...e.label?{label:e.label}:{},...e.classes.length?{classes:[...e.classes]}:{},...e.styles.length?{styles:[...e.styles]}:{},attrs:{relationshipType:e.type,arrowType:e.arrowType,minlen:e.minlen,explicitId:e.explicitId,animate:e.animate,...e.animation?{animation:e.animation}:{},...e.labelType?{labelType:e.labelType}:{}}}),`relationshipEdge`),Vm=e(e=>({id:`${e.id}-edge`,source:e.id,target:e.target,attrs:{relationshipType:`note`,arrowType:q.LINE_SOLID,pattern:`dotted`,minlen:1,explicitId:!1,animate:!1,internal:!0}}),`noteEdge`),Hm=e((e,t,n,r)=>{let i={};for(let t of e.getActors().values())i[t.id]=Im(t);for(let t of e.getUseCases().values())i[t.id]=Lm(t);for(let t of e.getNotes().values())i[t.id]=Rm(t);for(let t of e.getJsonNodes().values())i[t.id]=zm(t);let a={};for(let t of e.getSystemBoundaries().values())a[t.id]={...t.label===t.id?{}:{title:t.label},nodes:[...t.members],...t.classes.length?{classes:[...t.classes]}:{},...t.styles.length?{styles:[...t.styles]}:{},attrs:{kind:`systemBoundary`,boundaryType:t.type,labelType:t.labelType}};let o={};for(let t of e.getClassDefs().values())o[t.id]={styles:[...t.styles]};let s=e.getDirection();return{version:1,diagramType:`usecase`,source:t,header:{keyword:`usecase`,direction:s===`TD`?`TB`:s,span:n},...e.getAccTitle()?{accTitle:e.getAccTitle()}:{},...e.getAccDescription()?{accDescr:e.getAccDescription()}:{},nodes:i,edges:[...e.getRelationships().map(Bm),...[...e.getNotes().values()].map(Vm)],groups:a,classDefs:o,statements:r}},`buildUsecaseGraphAST`),$=e(e=>`line ${e.line}, column ${e.column} [${e.span[0]},${e.span[1]})`,`locationText`),Um=e(e=>e===void 0?``:` (label "${e}")`,`labelSuffix`),Wm=e(e=>e.generated?e.label:void 0,`generatedFrom`),Gm=e((e,t)=>{for(let n of t)e.includes(n)||e.push(n)},`pushUnique`),Km=class{constructor(e){this.db=e,this.source=``,this.statements=[],this.elements=[],this.boundaries=[],this.jsonDrafts=[],this.relationshipDrafts=[],this.noteDrafts=[],this.metadataAssignments=[],this.classAssignments=[],this.styleAssignments=[],this.classDefinitions=[],this.directions=[],this.model=e.createModel()}static{e(this,`UsecaseModelBuilder`)}reset(e){this.model=this.db.createModel(),this.source=e,this.statements=[],this.elements.length=0,this.boundaries.length=0,this.jsonDrafts.length=0,this.relationshipDrafts.length=0,this.noteDrafts.length=0,this.metadataAssignments.length=0,this.classAssignments.length=0,this.styleAssignments.length=0,this.classDefinitions.length=0,this.directions.length=0}addElement(e){this.elements.push(e)}addBoundary(e){this.boundaries.push(e)}addJson(e){this.jsonDrafts.push(e)}addRelationship(e){this.relationshipDrafts.push(e)}addNote(e){this.noteDrafts.push(e)}addMetadataAssignment(e,t,n,r){this.metadataAssignments.push({target:e,targetLocation:t,metadata:n,statement:r})}addClassDef(e,t){this.classDefinitions.push({ids:e,styles:t})}addClassAssignment(e,t){this.classAssignments.push({targets:e,classes:t})}addStyleAssignment(e,t,n){this.styleAssignments.push({target:e,location:t,styles:n})}setDirection(e){this.directions.push(e===`TD`?`TB`:e)}setAccTitle(e){this.model.accTitle=e}setAccDescription(e){this.model.accDescription=e}setStatements(e){this.statements=e}getActors(){return this.model.actors}getUseCases(){return this.model.useCases}getSystemBoundaries(){return this.model.systemBoundaries}getRelationships(){return this.model.relationships}getNotes(){return this.model.notes}getJsonNodes(){return this.model.jsonNodes}getClassDefs(){return this.model.classDefs}getDirection(){return this.model.direction}getAccTitle(){return this.model.accTitle}getAccDescription(){return this.model.accDescription}finalize(e){let t=new Map,n=new Map,r=new Map,i=new Map;for(let e of this.relationshipDrafts)this.recordFirst(i,e.source.id,e.source.location.span[0]),this.recordFirst(i,e.target.id,e.target.location.span[0]);for(let e of this.elements)this.recordFirst(i,e.id,e.location.span[0]);for(let e of this.boundaries)this.recordFirst(i,e.id,e.location.span[0]);for(let e of this.jsonDrafts)this.recordFirst(i,e.id,e.location.span[0]);let a=[...this.elements.map(e=>({offset:e.location.span[0],type:`element`,value:e})),...this.boundaries.map(e=>({offset:e.location.span[0],type:`boundary`,value:e})),...this.jsonDrafts.map(e=>({offset:e.location.span[0],type:`json`,value:e})),...this.relationshipDrafts.filter(e=>e.explicitId).map(e=>({offset:e.explicitIdLocation.span[0],type:`edge`,value:e}))].sort((e,t)=>e.offset-t.offset);for(let e of a)e.type===`element`?this.collectElement(e.value,t,n):e.type===`boundary`?this.collectBoundary(e.value,t,r):e.type===`json`?this.registerUnique(t,e.value.id,`json`,e.value.location,!1):this.registerUnique(t,e.value.explicitId,`edge`,e.value.explicitIdLocation,!1);this.materializeElements(n,i),this.materializeBoundaries(r,i),this.materializeJson(i);let o=this.materializeRelationships(t,n,i);this.reorderElements(n,i),this.applyMetadataAssignments(t,n,r,o),this.validateAndRefreshElements(n),this.refreshBoundaries(r,n),this.materializeNotes(t),this.applyClassDefinitions(),this.applyClassesAndStyles(t,o),this.model.direction=this.directions.at(-1)??this.model.direction,this.model.symbols=new Map([...t].map(([e,t])=>[e,t.kind]));let s=Hm(this,this.source,e,this.statements);return this.model.ast=s,this.db.commit(this.model),s}collectElement(e,t,n){let r=t.get(e.id),i=Wm({generated:e.generated,label:e.label.text});r&&r.kind!==e.kind&&this.conflict(`ID '${e.id}' is declared as both ${r.kind} and ${e.kind}`,e.location,r.location,i,Wm(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,Wm(r));let a=n.get(e.id);if(!a){let r={kind:e.kind,id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],...e.parentId?{parentId:e.parentId,parentLocation:e.parentLocation}:{},...e.shape?{shape:e.shape}:{},...e.stereotype?{stereotype:e.stereotype,stereotypeLocation:e.location}:{}};this.applyDeclarationMetadata(r,e.metadata),n.set(e.id,r),t.set(e.id,{kind:e.kind,location:e.location,generated:e.generated,label:e.label.text});return}(a.label.text!==e.label.text||a.label.type!==e.label.type)&&this.conflict(`ID '${e.id}' has conflicting labels`,e.location,a.location),e.shape&&a.shape&&e.shape!==a.shape&&this.conflict(`Use case '${e.id}' has conflicting shapes`,e.location,a.location),e.parentId&&a.parentId&&e.parentId!==a.parentId&&this.conflict(`Element '${e.id}' belongs to more than one system boundary`,e.parentLocation??e.location,a.parentLocation??a.location),e.stereotype&&a.stereotype&&e.stereotype!==a.stereotype&&this.conflict(`Element '${e.id}' has conflicting stereotypes`,e.location,a.stereotypeLocation??a.location),a.shape??=e.shape,a.parentId??=e.parentId,a.parentLocation??=e.parentLocation,a.stereotype??=e.stereotype,a.stereotypeLocation??=e.stereotype?e.location:void 0,Gm(a.classes,e.classes),this.applyDeclarationMetadata(a,e.metadata)}collectBoundary(e,t,n){let r=t.get(e.id),i=Wm({generated:e.generated,label:e.label.text});r&&r.kind!==`boundary`&&this.conflict(`ID '${e.id}' is declared as both ${r.kind} and boundary`,e.location,r.location,i,Wm(r)),r&&(r.generated||e.generated)&&this.conflict(`Generated ID '${e.id}' collides with another declaration`,e.location,r.location,i,Wm(r));let a=n.get(e.id);if(a){(a.label.text!==e.label.text||a.label.type!==e.label.type)&&this.conflict(`Boundary '${e.id}' has conflicting titles`,e.location,a.location),Gm(a.classes,e.classes);return}n.set(e.id,{id:e.id,label:e.label,location:e.location,generated:e.generated,classes:[...e.classes],styles:[],members:[]}),t.set(e.id,{kind:`boundary`,location:e.location,generated:e.generated,label:e.label.text})}materializeElements(e,t){for(let n of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)))this.setElementModel(n)}materializeBoundaries(e,t){for(let n of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)))this.model.systemBoundaries.set(n.id,{id:n.id,label:n.label.text,labelType:n.label.type,type:n.type??`rect`,members:[],classes:[...n.classes],styles:[...n.styles]})}materializeJson(e){for(let t of[...this.jsonDrafts].sort((t,n)=>(e.get(t.id)??0)-(e.get(n.id)??0)))this.model.jsonNodes.set(t.id,{id:t.id,value:t.value,propertyOrder:t.propertyOrder,classes:[...t.classes],styles:[]})}materializeRelationships(e,t,n){let r=new Map,i=0;for(let a of this.relationshipDrafts){let o=this.resolveEndpoint(a.source,e,t,n),s=this.resolveEndpoint(a.target,e,t,n);this.validateRelationship(a,o,s,e);let c=a.explicitId??`edge-${i++}`,l={id:c,explicitId:!!a.explicitId,source:a.source.id,target:a.target.id,type:a.type,arrowType:a.arrowType,...a.label?{label:a.label.text,labelType:a.label.type}:{},minlen:a.minlen,classes:[],styles:[],animate:!1};this.model.relationships.push(l),r.set(c,{draft:a,relationship:l})}return this.model.relationshipCounter=i,r}resolveEndpoint(e,t,n,r){if(e.classesOnReference&&!e.declaration)throw Error(`Relationship endpoint '${e.id}' uses ::: without declaring the node at ${$(e.location)}`);let i=t.get(e.id);return i?i.kind:(n.set(e.id,{kind:`usecase`,id:e.id,label:e.label,location:e.location,generated:e.generated,shape:`ellipse`,classes:[]}),t.set(e.id,{kind:`usecase`,location:e.location,generated:e.generated,label:e.label.text}),this.recordFirst(r,e.id,e.location.span[0]),`usecase`)}reorderElements(e,t){let n=new Map(this.model.actors),r=new Map(this.model.useCases);this.model.actors.clear(),this.model.useCases.clear();for(let i of[...e.values()].sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0))){!n.has(i.id)&&!r.has(i.id)&&this.setElementModel(i);let e=n.get(i.id)??this.model.actors.get(i.id),t=r.get(i.id)??this.model.useCases.get(i.id);e?this.model.actors.set(i.id,e):t&&this.model.useCases.set(i.id,t)}}applyMetadataAssignments(e,t,n,r){for(let i of this.metadataAssignments){let a=e.get(i.target);if(!a){let e=this.inferMetadataKind(i.metadata);throw Error(`Metadata target '${i.target}' is unresolved${e?` (metadata implies ${e})`:``} at ${$(i.targetLocation)}`)}if(a.kind===`actor`||a.kind===`usecase`)this.applyStandaloneElementMetadata(t.get(i.target),i.metadata);else if(a.kind===`boundary`){let e=n.get(i.target);for(let t of i.metadata.properties)(t.key!==`type`||t.value!==`rect`&&t.value!==`package`)&&this.invalidMetadata(i.target,a.kind,t),e.type=t.value}else if(a.kind===`edge`){let e=r.get(i.target);if(!e)throw Error(`Metadata target '${i.target}' is not an explicit edge at ${$(i.targetLocation)}`);i.statement.kind=`edgeMetadata`,i.statement.edges=[{id:i.target,span:i.statement.span,idSpan:i.targetLocation.span,...i.statement.metadata?{metadata:i.statement.metadata}:{}}],delete i.statement.nodes;for(let t of i.metadata.properties)t.key===`animate`&&typeof t.value==`boolean`?e.relationship.animate=t.value:t.key===`animation`&&(t.value===`fast`||t.value===`slow`)?(e.relationship.animation=t.value,e.relationship.animate=!0):this.invalidMetadata(i.target,a.kind,t)}else for(let e of i.metadata.properties)this.invalidMetadata(i.target,a.kind,e)}for(let{relationship:e}of r.values())e.animation&&(e.animate=!0)}applyStandaloneElementMetadata(e,t){for(let n of t.properties)e.kind===`actor`?this.applyActorProperty(e,n,!0):n.key===`business`&&typeof n.value==`boolean`?e.business=n.value:this.invalidMetadata(e.id,e.kind,n)}applyDeclarationMetadata(e,t){if(t)for(let n of t.properties)e.kind===`actor`?this.applyActorProperty(e,n,!1):n.key===`business`&&typeof n.value==`boolean`?(e.business!==void 0&&e.business!==n.value&&this.conflict(`Use case '${e.id}' has conflicting business metadata`,n.location,e.location),e.business=n.value):this.invalidMetadata(e.id,e.kind,n)}applyActorProperty(e,t,n){t.key===`type`&&(t.value===`normal`||t.value===`hollow`||t.value===`awesome`)?(!n&&e.actorType!==void 0&&e.actorType!==t.value&&this.conflict(`Actor '${e.id}' has conflicting type metadata`,t.location,e.location),e.actorType=t.value):t.key===`icon`&&typeof t.value==`string`?(!n&&e.icon!==void 0&&e.icon!==t.value&&this.conflict(`Actor '${e.id}' has conflicting icon metadata`,t.location,e.location),e.icon=t.value):t.key===`business`&&typeof t.value==`boolean`?(!n&&e.business!==void 0&&e.business!==t.value&&this.conflict(`Actor '${e.id}' has conflicting business metadata`,t.location,e.location),e.business=t.value):this.invalidMetadata(e.id,e.kind,t)}validateAndRefreshElements(e){for(let t of e.values()){let e=t.icon?`icon`:t.actorType??`normal`;if(t.kind===`actor`){if(t.icon&&t.actorType&&t.actorType!==`normal`)throw Error(`Actor '${t.id}' cannot combine icon with type '${t.actorType}' at ${$(t.location)}`);if(t.business&&(e===`icon`||e===`awesome`))throw Error(`Business actor '${t.id}' must use normal or hollow geometry at ${$(t.location)}`)}else if((t.shape??`ellipse`)===`rect`&&t.business)throw Error(`Rectangular use case '${t.id}' cannot be a business use case at ${$(t.location)}`);this.setElementModel(t)}}refreshBoundaries(e,t){for(let t of e.values())t.members.length=0;for(let t of[...this.elements].sort((e,t)=>e.location.span[0]-t.location.span[0])){if(!t.parentId)continue;let n=e.get(t.parentId);if(!n)throw Error(`Parent boundary '${t.parentId}' for '${t.id}' is unresolved at ${$(t.parentLocation??t.location)}`);n.members.includes(t.id)||n.members.push(t.id)}for(let n of t.values())if(n.parentId&&!e.has(n.parentId))throw Error(`Parent boundary '${n.parentId}' for '${n.id}' is unresolved at ${$(n.parentLocation??n.location)}`);for(let t of e.values()){let e=this.model.systemBoundaries.get(t.id);e.type=t.type??`rect`,e.members=[...t.members],e.classes=[...t.classes],e.styles=[...t.styles]}}materializeNotes(e){let t=0;for(let n of this.noteDrafts){let r=e.get(n.target);if(!r)throw Error(`Note target '${n.target}' is unresolved at ${$(n.targetLocation)}`);r.kind!==`actor`&&r.kind!==`usecase`&&this.conflict(`Note target '${n.target}' must be an actor or use case, not ${r.kind}`,n.targetLocation,r.location);let i=`note-${t++}`;this.model.notes.set(i,{id:i,target:n.target,label:n.label.text,labelType:n.label.type})}this.model.noteCounter=t}applyClassDefinitions(){for(let e of this.classDefinitions)for(let t of e.ids)this.model.classDefs.set(t,{id:t,styles:[...e.styles]})}applyClassesAndStyles(e,t){for(let n of this.classAssignments)for(let r of n.targets)Gm(this.getStylable(r.id,e,t,r.location).classes,n.classes);for(let n of this.styleAssignments)this.getStylable(n.target,e,t,n.location).styles.push(...n.styles)}getStylable(e,t,n,r){let i=t.get(e)?.kind,a=i===`actor`?this.model.actors.get(e):i===`usecase`?this.model.useCases.get(e):i===`boundary`?this.model.systemBoundaries.get(e):i===`json`?this.model.jsonNodes.get(e):i===`edge`?n.get(e)?.relationship:void 0;if(!a)throw Error(`Class/style target '${e}' is unresolved or anonymous at ${$(r)}`);return a}validateRelationship(t,n,r,i){let a=e(e=>e===`actor`||e===`usecase`||e===`json`,`allowed`);if(a(n)||this.conflict(`Relationship source '${t.source.id}' cannot be ${n}`,t.source.location,i.get(t.source.id).location),a(r)||this.conflict(`Relationship target '${t.target.id}' cannot be ${r}`,t.target.location,i.get(t.target.id).location),(t.type===`include`||t.type===`extend`)&&(n!==`usecase`||r!==`usecase`))throw Error(`${t.type} relationship requires use-case endpoints at ${$(t.location)}`);if(t.type===`generalization`&&(n!==`actor`&&n!==`usecase`||n!==r))throw Error(`Generalization requires actor-to-actor or use-case-to-use-case endpoints at ${$(t.location)}`);if(t.type===`association`&&(n===`json`||r===`json`)&&![0,1,2].includes(t.arrowType))throw Error(`JSON relationship '${t.source.id}' to '${t.target.id}' permits only point, reversed-point, or markerless solid association at ${$(t.location)}`)}setElementModel(e){if(e.kind===`actor`){let t=e.icon?`icon`:e.actorType??`normal`;this.model.useCases.delete(e.id),this.model.actors.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,type:t,...e.icon?{icon:e.icon}:{},business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.actors.get(e.id)?.styles??[]})}else this.model.actors.delete(e.id),this.model.useCases.set(e.id,{id:e.id,label:e.label.text,labelType:e.label.type,shape:e.shape??`ellipse`,business:e.business??!1,...e.stereotype?{stereotype:e.stereotype}:{},...e.parentId?{parentId:e.parentId}:{},classes:[...e.classes],styles:this.model.useCases.get(e.id)?.styles??[]})}inferMetadataKind(e){let t=new Set([`actor`,`usecase`,`boundary`,`edge`]);for(let n of e.properties)if(n.key===`icon`)t.clear(),t.add(`actor`);else if(n.key===`animate`||n.key===`animation`)t.clear(),t.add(`edge`);else if(n.key===`type`)t.clear(),n.value===`rect`||n.value===`package`?t.add(`boundary`):(n.value===`normal`||n.value===`hollow`||n.value===`awesome`)&&t.add(`actor`);else if(n.key===`business`)t.delete(`boundary`),t.delete(`edge`);else return;return t.size===1?[...t][0]:void 0}invalidMetadata(e,t,n){throw Error(`Metadata property '${n.key}' is invalid for ${t} '${e}' at ${$(n.location)}`)}registerUnique(e,t,n,r,i){let a=e.get(t);a&&this.conflict(`ID '${t}' is declared more than once (${a.kind} and ${n})`,r,a.location,void 0,Wm(a)),e.set(t,{kind:n,location:r,generated:i})}recordFirst(e,t,n){let r=e.get(t);(r===void 0||nthis.visit(e)),r=this.nodes(e,`relationTail`)[0],i=n.map((e,n)=>this.actorOccurrence(t[n],e,!0));for(let e of n)this.builder.addElement(this.actorDraft(e));if(!r)return{kind:`node`,span:[0,0],nodes:i};let a=this.visit(r);a.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(a.target));let o=this.relationshipDraft(n[0],a,this.nodeLocation(r));this.builder.addRelationship(o);let s=o.explicitId??`edge-${this.anonymousEdge++}`;return i.push(this.entityOccurrence(this.nodes(r.children,`entityName`)[0],a.target,a.target.explicitDeclaration)),{kind:`edge`,span:[0,0],nodes:i,edges:[{id:s,span:[0,0],...o.explicitIdLocation?{idSpan:o.explicitIdLocation.span}:{},...o.label?{labelSpan:o.label.span}:{}}]}}actorItem(e){let t=this.visit(this.nodes(e,`actorName`)[0]),n=this.nodes(e,`metadata`)[0],r=this.nodes(e,`stereotype`)[0],i=this.nodes(e,`classSuffix`)[0],a=i?this.visit(i):{classes:[],spans:[]};return{...t,...n?{metadata:this.visit(n)}:{},...r?{stereotype:this.visit(r)}:{},classes:a.classes,classSpans:a.spans}}actorName(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0];if(t){let n=this.nodes(e,`nodeLabel`)[0],r=n?this.visit(n):this.tokenLabel(t);return{id:t.image,label:r,location:this.tokenLocation(t),generated:!1,classes:[],classSpans:[]}}let r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[],classSpans:[]}}actorDeclarationOnly(e){let t=this.nodes(e,`actorItem`),n=t.map(e=>this.visit(e));for(let e of n)this.builder.addElement(this.actorDraft(e));return{kind:`node`,span:[0,0],nodes:n.map((e,n)=>this.actorOccurrence(t[n],e,!0))}}entityStatement(e){let t=this.nodes(e,`entityName`),n=this.visit(t[0]),r=this.nodes(e,`relationTail`)[0];if(!r)return n.explicitDeclaration=!0,n.shape??=`ellipse`,this.builder.addElement(this.entityDraft(n)),{kind:`node`,span:[0,0],nodes:[this.entityOccurrence(t[0],n,!0)]};n.explicitDeclaration&&this.builder.addElement(this.entityDraft(n));let i=this.visit(r);i.target.explicitDeclaration&&this.builder.addElement(this.entityDraft(i.target));let a={source:this.endpoint(n),target:this.endpoint(i.target),location:this.nodeLocation(r),...i.explicitId?{explicitId:i.explicitId,explicitIdLocation:i.explicitIdLocation}:{},...i.arrow};this.builder.addRelationship(a);let o=a.explicitId??`edge-${this.anonymousEdge++}`;return{kind:`edge`,span:[0,0],nodes:[this.entityOccurrence(t[0],n,n.explicitDeclaration),this.entityOccurrence(this.nodes(r.children,`entityName`)[0],i.target,i.target.explicitDeclaration)],edges:[{id:o,span:[0,0],...a.explicitIdLocation?{idSpan:a.explicitIdLocation.span}:{},...a.label?{labelSpan:a.label.span}:{}}]}}entityName(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0],r=this.nodes(e,`nodeLabel`)[0],i=this.nodes(e,`useCaseMetadata`)[0],a=this.nodes(e,`stereotype`)[0],o=this.nodes(e,`classSuffix`)[0],s=o?this.visit(o):{classes:[],spans:[]};if(t){let n=r?this.visit(r):this.tokenLabel(t),o=r?this.tokens(e,`LBRACKET`).length?`rect`:`ellipse`:void 0;return{id:t.image,label:n,location:this.tokenLocation(t),generated:!1,...o?{shape:o}:{},...i?{metadata:this.visit(i)}:{},...a?{stereotype:this.visit(a)}:{},classes:s.classes,classSpans:s.spans,explicitDeclaration:!!(o||i||a)}}let c=this.tokenLabel(n);return{id:this.generateId(c.text),label:c,location:this.tokenLocation(n),generated:!0,...i?{metadata:this.visit(i)}:{},...a?{stereotype:this.visit(a)}:{},classes:s.classes,classSpans:s.spans,explicitDeclaration:!!(i||a)}}nodeLabel(e){let t=this.allTokens(e);if(t.length===1&&(t[0].tokenType.name===`PLAIN_STRING`||t[0].tokenType.name===`MARKDOWN_STRING`))return this.tokenLabel(t[0]);let n=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return{text:this.source.slice(n[0],n[1]),type:`text`,span:n}}useCaseMetadata(e){return this.visit(this.nodes(e,`metadata`)[0])}relationTail(e){let t=this.tokens(e,`IDENTIFIER`)[0];return{...t?{explicitId:t.image,explicitIdLocation:this.tokenLocation(t)}:{},arrow:this.visit(this.nodes(e,`arrow`)[0]),target:this.visit(this.nodes(e,`entityName`)[0])}}arrow(e){return this.visit(this.firstNode(e,`semanticRelation`,`forwardSolidOperator`,`backwardSolidOperator`,`markerlessSolidOperator`,`forwardCircleOperator`,`backwardCircleOperator`,`forwardCrossOperator`,`backwardCrossOperator`))}edgeLabel(e){return this.nodeLabel(e)}semanticRelation(e){if(this.tokens(e,`GENERALIZATION`).length)return{type:`generalization`,arrowType:q.SOLID_ARROW,minlen:1};let t=this.tokens(e,`INCLUDE`).length?`include`:`extend`,n=this.tokens(e,t===`include`?`INCLUDE`:`EXTEND`)[0];return{type:t,arrowType:q.SOLID_ARROW,label:{text:t,type:`text`,span:this.tokenSpan(n)},minlen:1}}metadata(e){return{properties:this.nodes(e,`metadataProperty`).map(e=>this.visit(e)),location:this.ctxLocation(e)}}metadataProperty(e){let t=this.allTokens(e).filter(e=>e.tokenType.name!==`COLON`),n=t[0],r=t[1],i=r.tokenType.name===`TRUE`||r.tokenType.name!==`FALSE`&&this.decodePlain(r),a=[n.startOffset,(r.endOffset??r.startOffset)+1];return{key:this.decodePlain(n),value:i,span:a,keySpan:this.contentSpan(n),valueSpan:this.contentSpan(r),location:this.tokenLocation(n)}}metadataSeparator(e){}systemBoundaryStatement(e){let t=this.visit(this.nodes(e,`systemBoundaryName`)[0]),n=this.nodes(e,`classSuffix`)[0],r=n?this.visit(n):{classes:[],spans:[]};t.classes=r.classes,this.builder.addBoundary(t);let i=this.parentBoundary;this.parentBoundary={id:t.id,location:t.location};let a=this.nodes(e,`systemBoundaryContent`)[0],o=a?this.visit(a):[];this.parentBoundary=i;let s=this.tokens(e,`END`)[0],c=this.nodes(e,`metadata`)[0],l=c?this.visit(c):void 0,u={kind:`group`,span:[0,0],group:t.id,idSpan:t.location.span,titleSpan:t.label.span,endSpan:this.tokenSpan(s),classSpans:r.spans,...l?{metadata:l.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))}:{},...o.length?{children:o}:{}};return l&&this.builder.addMetadataAssignment(t.id,t.location,l,u),u}systemBoundaryName(e){let t=this.tokens(e,`IDENTIFIER`)[0];if(t){let n=this.nodes(e,`nodeLabel`)[0];return{id:t.image,label:n?this.visit(n):this.tokenLabel(t),location:this.tokenLocation(t),generated:!1,classes:[]}}let n=this.tokens(e,`PLAIN_STRING`)[0]??this.tokens(e,`MARKDOWN_STRING`)[0],r=this.tokenLabel(n);return{id:this.generateId(r.text),label:r,location:this.tokenLocation(n),generated:!0,classes:[]}}systemBoundaryContent(e){return[...this.nodes(e,`blankLine`),...this.nodes(e,`commentLine`),...this.nodes(e,`boundaryElement`)].sort((e,t)=>(e.location?.startOffset??0)-(t.location?.startOffset??0)).map(e=>this.wrap(e,this.visit(e)))}boundaryElement(e){let t=this.nodes(e,`actorDeclarationOnly`)[0];if(t)return this.visit(t);let n=this.nodes(e,`entityName`)[0],r=this.visit(n);return r.explicitDeclaration=!0,r.shape??=`ellipse`,this.builder.addElement(this.entityDraft(r)),{kind:`node`,span:[0,0],nodes:[this.entityOccurrence(n,r,!0)]}}metadataAssignmentStatement(e){let t=this.visit(this.nodes(e,`metadataAssignmentTarget`)[0]),n=this.visit(this.nodes(e,`metadata`)[0]),r={kind:`metadata`,span:[0,0],nodes:[{id:t.id,span:t.location.span,idSpan:t.location.span}],metadata:n.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))};return this.builder.addMetadataAssignment(t.id,t.location,n,r),r}metadataAssignmentTarget(e){let t=this.allTokens(e)[0],n=this.tokenLabel(t);return{id:t.tokenType.name===`IDENTIFIER`?t.image:this.generateId(n.text),location:this.tokenLocation(t)}}noteStatement(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.visit(this.nodes(e,`nodeLabel`)[0]);return this.builder.addNote({target:t.image,targetLocation:this.tokenLocation(t),label:n,location:this.ctxLocation(e)}),{kind:`note`,span:[0,0],ref:`note-${this.anonymousNote++}`,refSpan:n.span,nodes:[{id:t.image,span:this.tokenSpan(t),idSpan:this.tokenSpan(t)}]}}stereotype(e){let t=this.tokens(e,`STEREOTYPE_TEXT`)[0];return{value:t.image.trim(),span:this.tokenSpan(t)}}classSuffix(e){let t=this.tokens(e,`IDENTIFIER`);return{classes:t.map(e=>e.image),spans:t.map(e=>this.tokenSpan(e))}}jsonStatement(e){let t=this.tokens(e,`JSON_DECLARATION_START`)[0],n=this.tokens(e,`JSON_OBJECT_LITERAL`)[0],r=/^json[\t ]+(\w+)/.exec(t.image),i=r[1],a=r[0].length-i.length,o={span:[t.startOffset+a,t.startOffset+a+i.length],line:t.startLine??1,column:(t.startColumn??1)+a},s=Fm(n.image,n.startLine??1,n.startColumn??1),c=this.nodes(e,`classSuffix`)[0],l=c?this.visit(c):{classes:[],spans:[]},u={id:i,value:s.value,propertyOrder:s.propertyOrder,location:o,classes:l.classes};return this.builder.addJson(u),{kind:`json`,span:[0,0],nodes:[{id:i,span:o.span,idSpan:o.span,defines:!0,classSpans:l.spans}],classSpans:l.spans}}directionStatement(e){let t=this.allTokens(e).find(e=>[`TD`,`TB`,`BT`,`RL`,`LR`].includes(e.tokenType.name));return this.builder.setDirection(t.image),{kind:`direction`,span:[0,0]}}classDefStatement(e){let t=this.tokens(e,`IDENTIFIER`),n=this.visit(this.nodes(e,`styles`)[0]);return this.builder.addClassDef(t.map(e=>e.image),n),{kind:`classDef`,span:[0,0],ref:t[0].image,refSpan:this.tokenSpan(t[0])}}classStatement(e){let t=this.tokens(e,`IDENTIFIER`),n=1;for(;n({id:e.image,location:this.tokenLocation(e)})),i=t.slice(n).map(e=>e.image);return this.builder.addClassAssignment(r,i),{kind:`classAssign`,span:[0,0],ref:i[0],refSpan:this.tokenSpan(t[n]),nodes:r.map(({id:e,location:t})=>({id:e,span:t.span,idSpan:t.span}))}}styleStatement(e){let t=this.tokens(e,`IDENTIFIER`)[0],n=this.visit(this.nodes(e,`styles`)[0]);return this.builder.addStyleAssignment(t.image,this.tokenLocation(t),n),{kind:`style`,span:[0,0],nodes:[{id:t.image,span:this.tokenSpan(t),idSpan:this.tokenSpan(t)}]}}styles(e){return this.nodes(e,`styleValue`).map(e=>this.visit(e))}styleValue(e){let t=this.allTokens(e),n=[t[0].startOffset,(t.at(-1).endOffset??t.at(-1).startOffset)+1];return this.source.slice(n[0],n[1]).replaceAll(`\\,`,`,`)}styleComponent(e){return this.allTokens(e).map(e=>e.image).join(``)}forwardSolidOperator(e){let t=this.tokens(e,`FORWARD_SOLID`)[0];return{type:`association`,arrowType:q.SOLID_ARROW,minlen:this.solidMinlen(t)}}backwardSolidOperator(e){let t=this.tokens(e,`BACKWARD_SOLID`)[0],n=this.nodes(e,`edgeLabel`)[0],r=n?this.tokens(e,`MARKERLESS_SOLID`).at(-1):t;return{type:`association`,arrowType:q.BACK_ARROW,minlen:this.solidMinlen(r),...n?{label:this.visit(n)}:{}}}markerlessSolidOperator(e){let t=this.nodes(e,`edgeLabel`)[0],n=this.allTokens(e);if(!t)return{type:`association`,arrowType:q.LINE_SOLID,minlen:this.solidMinlen(this.tokens(e,`MARKERLESS_SOLID`)[0])};let r=n.at(-1),i=r.tokenType.name===`FORWARD_SOLID`?q.SOLID_ARROW:r.tokenType.name===`FORWARD_CIRCLE`?q.CIRCLE_ARROW:r.tokenType.name===`FORWARD_CROSS`?q.CROSS_ARROW:q.LINE_SOLID;return{type:`association`,arrowType:i,label:this.visit(t),minlen:i===q.SOLID_ARROW||i===q.LINE_SOLID?this.solidMinlen(r):1}}forwardCircleOperator(e){return{type:`association`,arrowType:q.CIRCLE_ARROW,minlen:1}}backwardCircleOperator(e){let t=this.nodes(e,`edgeLabel`)[0];return{type:`association`,arrowType:q.CIRCLE_ARROW_REVERSED,minlen:1,...t?{label:this.visit(t)}:{}}}forwardCrossOperator(e){return{type:`association`,arrowType:q.CROSS_ARROW,minlen:1}}backwardCrossOperator(e){let t=this.nodes(e,`edgeLabel`)[0];return{type:`association`,arrowType:q.CROSS_ARROW_REVERSED,minlen:1,...t?{label:this.visit(t)}:{}}}actorDraft(e){return{id:e.id,kind:`actor`,label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}entityDraft(e){return{id:e.id,kind:`usecase`,label:e.label,location:e.location,generated:e.generated,...this.parentBoundary?{parentId:this.parentBoundary.id,parentLocation:this.parentBoundary.location}:{},...e.shape?{shape:e.shape}:{},...e.metadata?{metadata:e.metadata}:{},...e.stereotype?{stereotype:e.stereotype.value,stereotypeSpan:e.stereotype.span}:{},classes:e.classes}}endpoint(e,t=e.explicitDeclaration??!0){return{id:e.id,label:e.label,location:e.location,generated:e.generated,declaration:t,classesOnReference:e.classes.length>0}}relationshipDraft(e,t,n){return{source:this.endpoint(e,!0),target:this.endpoint(t.target),location:n,...t.explicitId?{explicitId:t.explicitId,explicitIdLocation:t.explicitIdLocation}:{},...t.arrow}}actorOccurrence(e,t,n){return{id:t.id,span:this.nodeSpan(e),idSpan:t.location.span,labelSpan:t.label.span,...n?{defines:!0}:{},...t.stereotype?{stereotypeSpan:t.stereotype.span}:{},...t.metadata?{metadata:t.metadata.properties.map(({key:e,span:t,keySpan:n,valueSpan:r})=>({key:e,span:t,keySpan:n,valueSpan:r}))}:{},...t.classSpans.length?{classSpans:t.classSpans}:{}}}entityOccurrence(e,t,n){return this.actorOccurrence(e,t,n)}wrap(e,t){if(t.kind===`blank`||t.kind===`comment`)return t;t.span=this.nodeSpan(e);for(let e of t.edges??[])e.span=t.span;return t}tokenLabel(e){let t=e.tokenType.name===`MARKDOWN_STRING`?`markdown`:`text`,n=t===`markdown`?2:+(e.tokenType.name===`PLAIN_STRING`),r=this.tokenSpan(e,n);return{text:this.source.slice(r[0],r[1]),type:t,span:r}}decodePlain(e){return e.tokenType.name===`PLAIN_STRING`?e.image.slice(1,-1):e.image}contentSpan(e){return this.tokenSpan(e,e.tokenType.name===`PLAIN_STRING`?1:e.tokenType.name===`MARKDOWN_STRING`?2:0)}generateId(e){return e.replace(/\W/g,`_`)}solidMinlen(e){return Math.max(1,(e.image.match(/-/g)?.length??2)-1)}nodeLocation(e){let t=this.allTokens(e.children)[0];return{span:this.nodeSpan(e),line:t.startLine??1,column:t.startColumn??1}}ctxLocation(e){let t=this.allTokens(e).filter(e=>e.tokenType.name!==`NEWLINE`&&e.tokenType.name!==`EOF`),n=t[0],r=t.at(-1);return{span:[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)],line:n.startLine??1,column:n.startColumn??1}}tokenLocation(e){let t=e.tokenType.name===`PLAIN_STRING`?1:e.tokenType.name===`MARKDOWN_STRING`?2:0;return{span:this.tokenSpan(e,t),line:e.startLine??1,column:(e.startColumn??1)+t}}nodeSpan(e){let t=this.allTokens(e.children).filter(e=>e.tokenType.name!==`NEWLINE`&&e.tokenType.name!==`EOF`),n=t[0],r=t.at(-1);if(!n||!r)throw Error(`Usecase CST node has no source token`);return[n.startOffset,Math.min(this.source.length,(r.endOffset??r.startOffset+r.image.length-1)+1)]}tokenSpan(e,t=0){return[e.startOffset+t,Math.min(this.source.length,(e.endOffset??e.startOffset+e.image.length-1)+1-t)]}nodes(e,t){return(e[t]??[]).filter(e=>`children`in e)}tokens(e,t){return(e[t]??[]).filter(e=>`tokenTypeIdx`in e)}firstNode(e,...t){for(let n of t){let t=this.nodes(e,n)[0];if(t)return t}throw Error(`Usecase CST is missing one of: ${t.join(`, `)}`)}allTokens(e){let t=[];for(let n of Object.values(e))for(let e of n)`tokenTypeIdx`in e?t.push(e):t.push(...this.allTokens(e.children));return t.sort((e,t)=>e.startOffset-t.startOffset)}},Ym={parse:e(async t=>{np.clear(),Am.input=[];try{Cf({diagramType:`usecase`,lexer:Dm,parser:Am,entry:e(()=>Am.start(),`entry`),visit:e(e=>Jm.build(e,t),`visit`)},t)}catch(e){np.clear();let n=Am.errors[0];if(n){let{token:r}=n,i=Number.isFinite(r.startOffset)?r.startOffset:t.length,a=typeof r.endOffset==`number`&&Number.isFinite(r.endOffset)?r.endOffset+1:i,o=r.startLine??t.slice(0,i).split(/\r\n|\r|\n/).length,s=Math.max(t.lastIndexOf(` `,i-1),t.lastIndexOf(`\r`,i-1)),c=r.startColumn??i-s,l=e instanceof Error?e.message:String(e);throw Error(`${l} at line ${o}, column ${c} [${i},${a})`)}throw e}},`parse`)},Xm=[`point`,`circle`,`cross`,`extension`],Zm={usecaseActor:!0,usecaseActorHollow:!0,usecaseActorAwesome:!0,usecaseActorIcon:!0},Qm=e((e,t)=>{let[n,r]=[e,t].map(e=>e.replace(/[^\w-]+/g,`_`).replace(/^_+|_+$/g,``)||`element`);return`usecase-${n}-${r}`},`usecaseDomId`),$m=e(e=>`usecase-${e.replace(/[^\w-]+/g,`_`).replace(/^_+|_+$/g,``)||`element`}`,`usecaseNodeDomId`),eh=e((e,t)=>t===`markdown`?h(e).map(e=>e.map(e=>e.content).join(` `)).join(` -`):e,`getAccessibleLabel`),th=e(e=>{let t=eh(e.label??e.id,e.labelType);if(Zm[e.shape]){let n=e.actorType&&e.actorType!==`normal`?`${e.actorType} `:``;return`${e.business?`business `:``}${n}actor ${t}${e.stereotype?`, stereotype ${e.stereotype}`:``}`}if(e.shape===`note`)return`Note for ${e.noteTargetLabel??e.noteTarget??``}: ${t}`;if(e.shape===`usecaseJsonTable`){let n=(e.jsonRows??[]).map(e=>`${e.accessibleKey}: ${e.value}`).join(`; `);return n?`${t}: ${n}`:t}let n=e.stereotype?`, stereotype ${e.stereotype}`:``;return`${e.business?`business `:``}use case ${t}${n}`},`getUsecaseNodeAccessibleName`),nh=e(e=>`${e.boundaryType} system boundary ${eh(e.label??e.id,e.labelType)}`,`getUsecaseBoundaryAccessibleName`),rh=e(e=>e.relationshipType===`note`?``:`${e.relationshipType===`association`&&e.label?`association ${eh(e.label,e.labelType)}`:e.relationshipType} from ${e.sourceLabel} to ${e.targetLabel}`,`getUsecaseEdgeAccessibleName`),ih=e(e=>e.replace(/&/g,`&`).replace(//g,`>`),`escapePlainLabel`),ah=e(e=>e.replace(/([*[\\\]_`])/g,`\\$1`),`escapeMarkdownMarkers`),oh=e((e,t)=>{e.diagramId=t,e.markers=[...Xm];for(let t of e.nodes){let e=t;if(e.domId=$m(t.id),t.label!==void 0&&t.labelType===`text`&&(t.label=ih(t.label)),t.stereotype&&=ih(t.stereotype),!t.isGroup&&t.shape===`usecaseJsonTable`&&(t.jsonRows=t.jsonRows?.map(e=>({...e,key:ih(e.key),value:ih(e.value)}))),!t.isGroup&&(t.shape===`usecaseEllipse`||t.shape===`rect`)&&t.stereotype){let n=t.label??ih(t.id);t.label=`\xAB${ah(t.stereotype)}\xBB
${t.labelType===`text`?ah(n):n}`,t.labelType=`markdown`,e.hasFoldedStereotype=!0,delete t.stereotype}}for(let t of e.edges)t.label!==void 0&&t.labelType===`text`&&(t.label=ih(t.label));return e},`prepareUsecaseLayoutData`),sh=e((e,t,r)=>{for(let n of t.nodes){let i=typeof n.domId==`string`?n.domId:Qm(t.diagramId,n.id),a=e.select(`#${i}`),o=n.isGroup?`boundary`:Zm[n.shape]?`actor`:n.shape===`note`?`note`:n.shape===`usecaseJsonTable`?`json`:`usecase`,s=r.nodes.get(n.id)??n.id;if(a.attr(`data-usecase-id`,n.id).attr(`data-usecase-kind`,o).attr(`role`,`img`).attr(`aria-label`,s),!n.isGroup&&(n.shape===`usecaseEllipse`||n.shape===`rect`)&&`hasFoldedStereotype`in n&&n.hasFoldedStereotype===!0){let e=a.node(),t=e?.querySelector(`.nodeLabel`),n=t?.querySelector(`p`)??t,r=n?.firstChild;if(n&&r?.nodeType===3){let e=n.ownerDocument.createElement(`span`);e.className=`usecase-stereotype`,n.insertBefore(e,r),e.appendChild(r)}else e?.querySelector(`.label tspan tspan, .label tspan`)?.classList.add(`usecase-stereotype`)}}let i=new Map(t.edges.map(e=>[e.id,e]));e.selectAll(`path[data-et="edge"]`).each(function(){let e=i.get(this.getAttribute(`data-id`)??``);if(!e)return;let a=n(this);a.attr(`id`,Qm(t.diagramId,e.id)).attr(`data-usecase-id`,e.id).attr(`data-usecase-kind`,e.internal?`note-connector`:`relationship`),e.internal?a.attr(`aria-hidden`,`true`):a.attr(`role`,`img`).attr(`aria-label`,r.edges.get(e.id)??e.id)})},`annotateUsecaseElements`),ch=e((e,t)=>{e.style(`--mermaid-usecase-actor-font-size`,`${t.actorFontSize}px`).style(`--mermaid-usecase-actor-font-family`,t.actorFontFamily).style(`--mermaid-usecase-actor-font-weight`,t.actorFontWeight).style(`--mermaid-usecase-font-size`,`${t.usecaseFontSize}px`).style(`--mermaid-usecase-font-family`,t.usecaseFontFamily).style(`--mermaid-usecase-font-weight`,t.usecaseFontWeight)},`applyUsecaseFonts`),lh={draw:e(async(e,n,r,i)=>{t.info(`Drawing usecase diagram (unified)`,n);let{layout:a}=d(),o=i.db,s=o.getData(),c=new Map(s.nodes.map(e=>[e.id,eh(e.label??e.id,e.labelType)])),l={nodes:new Map(s.nodes.map(e=>[e.id,e.isGroup?nh(e):th(e.shape===`note`?{...e,noteTargetLabel:c.get(e.noteTarget??``)}:e)])),edges:new Map(s.edges.map(e=>[e.id,rh({...e,sourceLabel:c.get(e.source)??e.sourceLabel,targetLabel:c.get(e.target)??e.targetLabel})]))},u=ie(n,s.config.securityLevel);s.layoutAlgorithm=re(a),oh(s,n),ch(u,s),await ne(s,u),sh(u,s,l);let f=s.diagramPadding;m.insertTitle(u,`usecaseDiagramTitleText`,0,o.getDiagramTitle?.()??``),ae(u,f,`usecaseDiagram`,s.useMaxWidth),ch(u,s)},`draw`)},uh=e(e=>({actorBkg:e.usecaseActorBkg??e.actorBkg??e.mainBkg,actorBorder:e.usecaseActorBorder??e.actorBorder??e.primaryColor,bkg:e.usecaseBkg??e.mainBkg,border:e.usecaseBorder??e.nodeBorder??e.primaryColor,boundaryBkg:e.usecaseBoundaryBkg??e.clusterBkg,boundaryBorder:e.usecaseBoundaryBorder??e.clusterBorder,includeLine:e.usecaseIncludeLine??e.lineColor,extendLine:e.usecaseExtendLine??e.lineColor}),`roleColors`),dh=e(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!ee(t,r))return``;let i=o().usecase?.colorScheme===`rotate`,a=te(e.look),s=a===`handDrawn`,c=_(n),l=``;for(let e=0;e{let t=eh(e.label??e.id,e.labelType);if(Zm[e.shape]){let n=e.actorType&&e.actorType!==`normal`?`${e.actorType} `:``;return`${e.business?`business `:``}${n}actor ${t}${e.stereotype?`, stereotype ${e.stereotype}`:``}`}if(e.shape===`note`)return`Note for ${e.noteTargetLabel??e.noteTarget??``}: ${t}`;if(e.shape===`usecaseJsonTable`){let n=(e.jsonRows??[]).map(e=>`${e.accessibleKey}: ${e.value}`).join(`; `);return n?`${t}: ${n}`:t}let n=e.stereotype?`, stereotype ${e.stereotype}`:``;return`${e.business?`business `:``}use case ${t}${n}`},`getUsecaseNodeAccessibleName`),nh=e(e=>`${e.boundaryType} system boundary ${eh(e.label??e.id,e.labelType)}`,`getUsecaseBoundaryAccessibleName`),rh=e(e=>e.relationshipType===`note`?``:`${e.relationshipType===`association`&&e.label?`association ${eh(e.label,e.labelType)}`:e.relationshipType} from ${e.sourceLabel} to ${e.targetLabel}`,`getUsecaseEdgeAccessibleName`),ih=e(e=>e.replace(/&/g,`&`).replace(//g,`>`),`escapePlainLabel`),ah=e(e=>e.replace(/([*[\\\]_`])/g,`\\$1`),`escapeMarkdownMarkers`),oh=e((e,t)=>{e.diagramId=t,e.markers=[...Xm];for(let t of e.nodes){let e=t;if(e.domId=$m(t.id),t.label!==void 0&&t.labelType===`text`&&(t.label=ih(t.label)),t.stereotype&&=ih(t.stereotype),!t.isGroup&&t.shape===`usecaseJsonTable`&&(t.jsonRows=t.jsonRows?.map(e=>({...e,key:ih(e.key),value:ih(e.value)}))),!t.isGroup&&(t.shape===`usecaseEllipse`||t.shape===`rect`)&&t.stereotype){let n=t.label??ih(t.id);t.label=`\xAB${ah(t.stereotype)}\xBB
${t.labelType===`text`?ah(n):n}`,t.labelType=`markdown`,e.hasFoldedStereotype=!0,delete t.stereotype}}for(let t of e.edges)t.label!==void 0&&t.labelType===`text`&&(t.label=ih(t.label));return e},`prepareUsecaseLayoutData`),sh=e((e,t,r)=>{for(let n of t.nodes){let i=typeof n.domId==`string`?n.domId:Qm(t.diagramId,n.id),a=e.select(`#${i}`),o=n.isGroup?`boundary`:Zm[n.shape]?`actor`:n.shape===`note`?`note`:n.shape===`usecaseJsonTable`?`json`:`usecase`,s=r.nodes.get(n.id)??n.id;if(a.attr(`data-usecase-id`,n.id).attr(`data-usecase-kind`,o).attr(`role`,`img`).attr(`aria-label`,s),!n.isGroup&&(n.shape===`usecaseEllipse`||n.shape===`rect`)&&`hasFoldedStereotype`in n&&n.hasFoldedStereotype===!0){let e=a.node(),t=e?.querySelector(`.nodeLabel`),n=t?.querySelector(`p`)??t,r=n?.firstChild;if(n&&r?.nodeType===3){let e=n.ownerDocument.createElement(`span`);e.className=`usecase-stereotype`,n.insertBefore(e,r),e.appendChild(r)}else e?.querySelector(`.label tspan tspan, .label tspan`)?.classList.add(`usecase-stereotype`)}}let i=new Map(t.edges.map(e=>[e.id,e]));e.selectAll(`path[data-et="edge"]`).each(function(){let e=i.get(this.getAttribute(`data-id`)??``);if(!e)return;let a=n(this);a.attr(`id`,Qm(t.diagramId,e.id)).attr(`data-usecase-id`,e.id).attr(`data-usecase-kind`,e.internal?`note-connector`:`relationship`),e.internal?a.attr(`aria-hidden`,`true`):a.attr(`role`,`img`).attr(`aria-label`,r.edges.get(e.id)??e.id)})},`annotateUsecaseElements`),ch=e((e,t)=>{e.style(`--mermaid-usecase-actor-font-size`,`${t.actorFontSize}px`).style(`--mermaid-usecase-actor-font-family`,t.actorFontFamily).style(`--mermaid-usecase-actor-font-weight`,t.actorFontWeight).style(`--mermaid-usecase-font-size`,`${t.usecaseFontSize}px`).style(`--mermaid-usecase-font-family`,t.usecaseFontFamily).style(`--mermaid-usecase-font-weight`,t.usecaseFontWeight)},`applyUsecaseFonts`),lh={draw:e(async(e,n,r,i)=>{t.info(`Drawing usecase diagram (unified)`,n);let{layout:a}=d(),o=i.db,s=o.getData(),c=new Map(s.nodes.map(e=>[e.id,eh(e.label??e.id,e.labelType)])),l={nodes:new Map(s.nodes.map(e=>[e.id,e.isGroup?nh(e):th(e.shape===`note`?{...e,noteTargetLabel:c.get(e.noteTarget??``)}:e)])),edges:new Map(s.edges.map(e=>[e.id,rh({...e,sourceLabel:c.get(e.source)??e.sourceLabel,targetLabel:c.get(e.target)??e.targetLabel})]))},u=ne(n,s.config.securityLevel);s.layoutAlgorithm=ae(a),oh(s,n),ch(u,s),await ie(s,u),sh(u,s,l);let f=s.diagramPadding;m.insertTitle(u,`usecaseDiagramTitleText`,0,o.getDiagramTitle?.()??``),re(u,f,`usecaseDiagram`,s.useMaxWidth),ch(u,s)},`draw`)},uh=e(e=>({actorBkg:e.usecaseActorBkg??e.actorBkg??e.mainBkg,actorBorder:e.usecaseActorBorder??e.actorBorder??e.primaryColor,bkg:e.usecaseBkg??e.mainBkg,border:e.usecaseBorder??e.nodeBorder??e.primaryColor,boundaryBkg:e.usecaseBoundaryBkg??e.clusterBkg,boundaryBorder:e.usecaseBoundaryBorder??e.clusterBorder,includeLine:e.usecaseIncludeLine??e.lineColor,extendLine:e.usecaseExtendLine??e.lineColor}),`roleColors`),dh=e(e=>{let{theme:t,bkgColorArray:n,borderColorArray:r}=e;if(!ee(t,r))return``;let i=o().usecase?.colorScheme===`rotate`,a=te(e.look),s=a===`handDrawn`,c=_(n),l=``;for(let e=0;ei.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["app-Tooltip.js","app-rolldown-runtime.js","app-jsx-runtime.js","app-common.js","app-MermaidPreview.js","app-preload-helper.js","app-useTranslation.js","app-x.js","app-purify.es.js","app-chunk-Y2CYZVJY.js","app-src.js","app-chunk-O7XYJQB3.js","app-chunk-ZIGJFQKS.js","app-dist.js","app-chunk-6AEJRKK7.js","app-chunk-742MDFTN.js","app-chunk-MBY4JIJT.js","app-chunk-7PRAP22T.js","app-chunk-7INBJB4K.js","app-chunk-J5ZVWO5B.js","app-rough.esm.js","app-chunk-5DYCD2WN.js","app-chunk-Z7XXMR3K.js","app-line.js","app-path.js","app-array.js","app-chunk-UA2S7LBM.js","app-chunk-GNY47TPC.js","app-chunk-DUW6YSOI.js","app-chunk-LNGE3PJU.js","app-pdf.js","app-InteractiveTerminal.js","app-Dialog.js"])))=>i.map(i=>d[i]); import{i as e,n as t,t as n}from"./app-rolldown-runtime.js";import{n as r,t as i}from"./app-jsx-runtime.js";import{A as a,C as o,D as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,N as h,O as g,P as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as D,a as O,b as k,c as A,d as j,f as M,g as N,h as P,i as F,j as I,k as ee,l as L,m as R,o as te,p as z,q as B,r as ne,s as re,t as V,u as ie,v as ae,w as oe,x as se,y as ce,z as le}from"./app-Tooltip.js";import{C as H,_ as ue,a as de,b as fe,d as pe,g as me,h as he,i as ge,m as _e,n as ve,o as ye,r as be,s as xe,t as Se,u as Ce,v as we,y as Te}from"./app-Dialog.js";import{t as Ee}from"./app-preload-helper.js";import{a as U,i as De,n as Oe,r as ke,t as W}from"./app-useTranslation.js";import{n as Ae,r as G,t as je}from"./app-x.js";import{t as Me}from"./app-purify.es.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Ne=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Pe=n(((e,t)=>{t.exports=Ne()})),Fe=n((e=>{var t=Pe(),n=r(),i=E();function a(e){var t=`https://react.dev/errors/`+e;if(1R||(e.current=L[R],L[R]=null,R--)}function B(e,t){R++,L[R]=e.current,e.current=t}var ne=te(null),re=te(null),V=te(null),ie=te(null);function ae(e,t){switch(B(V,t),B(re,e),B(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}z(ne),B(ne,e)}function oe(){z(ne),z(re),z(V)}function se(e){e.memoizedState!==null&&B(ie,e);var t=ne.current,n=Jd(t,e.type);t!==n&&(B(re,e),B(ne,n))}function ce(e){re.current===e&&(z(ne),z(re)),ie.current===e&&(z(ie),ip._currentValue=ee)}var le,H;function ue(e){if(le===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);le=t&&t[1]||``,H=-1)`:-112e3){re(t(`fileAttachmentPromptTooLong`));return}l.content=m}if(u=h?await n(m,s.images,i,a,h):a?await n(m,s.images,i,a):i?await n(m,s.images.length>0||r?s.images:void 0,i):r||s.images.length>0?await n(m,s.images):await n(m),u){we(null),i===Oe.current&&(Oe.current=null);let e=o.clear(l.owner.key,l.revision);e&&c.current.key===l.owner.key&&(f.current=e,d(e),re(null))}}catch(e){c.current.key===l.owner.key&&re(e instanceof Error?e.message:t(`fileAttachmentReadFailed`))}finally{p&&c.current.key===l.owner.key&&!G.current&&B(!1),l.pending=!1;let e=o.read(l.owner.key);(u||!e.prompt&&e.images.length===0&&!e.files?.length)&&b.current.get(l.owner.key)===l&&b.current.delete(l.owner.key)}},at=async(n,r=!1)=>{if(n?.preventDefault(),!ze||e.sessionSwitching||e.modelSelectionPending||e.planSelectionPending||e.thinkingPendingLevel!==null||e.promptAdmissionPending||e.promptAdmissionRecovery||e.promptAdmissionResolution||v||!p.trim()&&m.length===0&&h.length===0||G.current)return;let i=We&&(r?!Ke:Ke);if(i&&Oe.current){ae(t(`steerStaleTurn`));return}let a=/^\/([^\s/]+)/u.exec(p.trim())?.[1],o=Je.commands.find(e=>e.name===a);if(o?.availability===`unsupported`){ae(`/${o.name}: ${t(`commandUnavailable_${o.unavailableReason??`not_integrated`}`)}`);return}if(o?.action){if(p.trim()!==`/${o.name}`||m.length>0||h.length>0){ae(t(`commandPanelArguments`));return}if(e.onCommandAction?.(o.action)!==!0){ae(t(`commandPanelUnavailable`));return}Fe({prompt:``,caret:0}),ae(null);return}ae(null),await it(e.actions.sendPrompt,!1,Oe.current??void 0,i&&Ue?{streamingBehavior:`steer`,expectedTurnCommandId:Ue.commandId}:void 0)},ot=()=>{if(!(!Ie||e.sessionSwitching||e.modelSelectionPending||e.thinkingPendingLevel!==null||v))return it(e.actions.sendPromptAsNew,!0)},st=e=>{if(e.availability!==`available`)return;let t=`/${e.name} `;Fe({prompt:t,caret:t.length})&&(ae(null),D(!0),queueMicrotask(()=>{c.current.key===y&&(Te.current?.focus(),Te.current?.setSelectionRange(t.length,t.length))}))},ct=e=>{if(!$e.length)return;let t=O;for(let n=0;n<$e.length;n++)if(t=(t+e+$e.length)%$e.length,$e[t]?.availability===`available`){k(t);return}},lt=e=>{let n=Me.current,r=f.current;if(!n||n.ownerKey!==y||n.ownerKey!==c.current.key||n.revision!==r.revision)return t(`fileReferenceDraftChanged`);let i=r.prompt.slice(0,n.start),a=r.prompt.slice(n.end),o=nk(e),s=i&&!/\s$/u.test(i)?` `:``,l=`${i}${s}${o}${a&&!/^\s/u.test(a)?` `:``}${a}`,u=i.length+s.length+o.length;if(!Fe({prompt:l,caret:u}))return t(`draftLimit`);je.current=!0},ut=()=>{let e=f.current,t=Te.current,n=Math.min(Math.max(t?.selectionStart??e.caret,0),e.prompt.length);Me.current={ownerKey:y,revision:e.revision,start:n,end:Math.min(Math.max(t?.selectionEnd??n,n),e.prompt.length)},j(!0)},dt=[...(e.snapshot?.workspaces??[]).map(t=>({id:t.path,label:t.name,icon:(0,q.jsx)(Vs,{}),endContent:t.path===e.selectedWorkspace?(0,q.jsx)(rs,{}):void 0,onClick:()=>e.actions.setWorkspace(t.path)})),{type:`divider`},{id:`add`,label:t(`addWorkspaceMenu`),icon:(0,q.jsx)(Ae,{}),onClick:()=>void e.actions.chooseWorkspace()}],ft=e.draftModel??e.snapshot?.models.find(e=>e.current),pt=e.snapshot?.workspaces.find(t=>t.path===e.selectedWorkspace)?.name??(e.selectedWorkspace?LD(e.selectedWorkspace):t(`selectWorkspace`)),mt=e.snapshot?.sessions.find(e=>e.path===i),ht=Ie?ID(mt??{},n?.id??t(`untitledSession`)):Le?t(`newSession`):n?ID(mt??{},n.id):t(`newSession`),gt=e.sessionSwitching?e.workspaceDraft?t(`promptTask`):t(`switchingSession`):e.selectedWorkspace?Ie&&e.snapshot?.runtime.planHasPrompt&&[`planning`,`ready`].includes(e.snapshot.runtime.plan??``)?t(`promptPlanMessage`):e.landing?t(`promptTask`):t(Re?`promptMessage`:`promptReadonly`):t(`promptStart`),_t=e.snapshot?.thinking,vt=_t?.level??null,yt=e.thinkingPendingLevel??null,bt=_t?.supported??!1,xt=!!e.selectedWorkspace&&!Ie&&(Le||!n),St=_t?!_t.available.includes(vt??``):!1,Ct=_t?!bt&&!xt?`thinkingUnsupportedHint`:!Ie&&!xt?`thinkingInactiveHint`:Ve?`thinkingLockedRunning`:e.modelSelectionPending?`thinkingModelPendingHint`:null:null,wt=e.snapshot?.selectedExecution,Tt=n&&wt&&wt.sessionId===n.id&&wt.sessionPath===n.path?wt.pendingFollowUps:void 0,Et=Tt??(Ie?e.pendingFollowUpsReceipt:null),Dt=n&&wt?.sessionId===n.id&&wt.sessionPath===n.path?wt.pendingSteering:void 0,Ot=Dt??(Ie?e.pendingSteeringReceipt:null),kt=Dt===void 0?[]:wt?.steeringMessages??[],At=!e.workspaceDraft&&!e.sessionSwitching&&kt.length>0,jt=Tt===void 0?[]:wt?.queuedMessages??[],Mt=new Map,Nt=jt.map(e=>{let t=Mt.get(e)??0;return Mt.set(e,t+1),{message:e,key:`${e}:${t}`}}),Pt=!e.workspaceDraft&&!e.sessionSwitching&&Tt!==void 0&&jt.length>0,Ft=Be?t(`compactionDraftHelp`):e.promptAdmissionPending&&!He?t(`promptPending`):e.modelSelectionPending?t(`thinkingModelPendingHint`):e.thinkingPendingLevel===null?e.workspaceDraft?t(`enterHint`):e.turnCancellationPending?t(`stoppingTurn`):e.turnTerminalStatus===`cancelled`?t(`stoppedTurn`):!At&&(Ot??0)>0?t(`pendingSteeringHint`,{count:Ot}):!Pt&&(Ie&&e.pendingFollowUpsReceipt!==null||(Et??0)>0)?(Et??0)>0?t(`pendingFollowUpsHint`,{count:Et??0}):t(`acceptedHint`):t(ze?Ve?Ke?`steeringHint`:`queuedHint`:`enterHint`:`activeOnlyHint`):t(`thinkingPendingHint`),It=ze&&(Be||e.promptAdmissionPending&&!He||e.modelSelectionPending||e.thinkingPendingLevel!==null||e.turnCancellationPending||e.turnTerminalStatus===`cancelled`||!Pt&&Ie&&e.pendingFollowUpsReceipt!==null||!Pt&&(Et??0)>0||!At&&(Ot??0)>0||Ve&&!!(p.trim()||m.length||h.length)),Lt=P===y,Rt=(e=!1)=>{N(null),e&&R.current?.focus()},zt=e=>()=>{N(null),e()},Bt=async r=>{if(!(!Ie||!n||Lt||e.sessionSwitching)){F(y),ae(null);try{if(r===`compact`)await L.compactSession(n.id,n.path);else if((await L.updatePromptQueue(n.id,n.path,r)).sessionId!==n.id)throw Error(t(`queueUpdateFailed`));!await e.actions.refreshSnapshot()&&r!==`compact`&&c.current.key===y&&ae(t(`queueStatusUnconfirmed`))}catch(e){c.current.key===y&&ae(r===`compact`?e instanceof Error?e.message:t(`commandPanelUnavailable`):t(`queueUpdateFailed`))}finally{F(e=>e===y?null:e)}}},Vt=M===`files`?[{id:`back`,section:t(`composerAdd`),label:t(`composerBack`),icon:(0,q.jsx)(Cs,{}),onClick:()=>N(`main`)},{id:`file-upload`,section:t(`composerAdd`),label:t(`addFiles`),description:t(`fileAttachmentDescription`),icon:(0,q.jsx)(Fs,{}),disabled:z||m.length+h.length>=8,onClick:zt(()=>{ke.current&&(ke.current.accept=``,ke.current.click())})},{id:`image`,section:t(`composerAdd`),label:t(`addImages`),description:t(`imageAttachmentDescription`),icon:(0,q.jsx)(Ks,{}),disabled:z||m.length>=8,onClick:zt(()=>{ke.current&&(ke.current.accept=`image/png,image/jpeg,image/gif,image/webp`,ke.current.click())})},{id:`workspace-file`,section:t(`composerAdd`),label:t(`fileReference`),icon:(0,q.jsx)(Fs,{}),onClick:zt(ut)}]:[{id:`file`,section:t(`composerAdd`),label:t(`composerFile`),alias:`file`,icon:(0,q.jsx)(Fs,{}),onClick:()=>N(`files`)},{id:`plan`,section:t(`composerAdd`),label:t(`composerPlan`),alias:`plan`,description:t(`composerPlanDescription`),icon:(0,q.jsx)($s,{}),disabled:!Ie||Ve||e.planSelectionPending||e.promptAdmissionPending,onClick:zt(()=>void e.actions.selectPlanMode(e.snapshot?.runtime.plan===`inactive`))},{id:`compact`,section:t(`composerCommands`),label:t(`composerCompact`),alias:`compact`,description:t(`composerCompactDescription`),icon:(0,q.jsx)(fc,{}),disabled:!Ie||Ve||Lt||e.promptAdmissionPending||(Et??0)>0,onClick:zt(()=>void Bt(`compact`))},{id:`model`,section:t(`composerCommands`),label:t(`composerModel`),alias:`model`,description:t(`composerModelDescription`),icon:(0,q.jsx)(ws,{}),disabled:!Ie&&!Le||Ve||e.modelSelectionPending,onClick:zt(()=>ee(e=>e+1))}];return(0,q.jsxs)(`div`,{className:`composer-dock`,children:[Ie&&e.snapshot?.runtime.plan===`ready`&&!e.sessionSwitching&&(0,q.jsx)(`div`,{className:`plan-mode-bar`,children:(0,q.jsx)(`button`,{type:`button`,disabled:Ve||z||!!G.current||e.planSelectionPending||e.promptAdmissionPending||!!e.promptAdmissionRecovery,onClick:()=>{if((p.trim()||m.length>0||h.length>0)&&!window.confirm(t(`planImplementationReplaceDraft`)))return;let n=f.current.revision,r=c.current.key;e.actions.preparePlanImplementation().then(e=>{!e||f.current.revision!==n||c.current.key!==r||Fe({prompt:e.prompt,images:[],caret:e.prompt.length},r)&&(Oe.current={sessionId:e.sessionId,sessionPath:e.sessionPath,planRevision:e.planRevision},re(null),Te.current?.focus())})},children:t(`planModeImplement`)})}),!Ie&&!e.workspaceDraft&&!e.sessionSwitching&&n&&r===n.path&&(0,q.jsxs)(`div`,{className:`composer-session-notice`,children:[(0,q.jsx)(`span`,{children:t(`activateViewedSessionHint`)}),(0,q.jsx)(`button`,{type:`button`,className:`secondary`,onClick:()=>void e.actions.selectSession(n.path),children:t(`activateViewedSession`)})]}),e.accessory,e.promptAdmissionRecovery&&(0,q.jsxs)(`section`,{className:`prompt-recovery`,role:`alert`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:t(`promptAdmissionUnknown`)}),(0,q.jsx)(`span`,{children:e.promptAdmissionRecovery.phase===`checking`?t(`promptAdmissionCheckingDetail`):e.promptAdmissionRecovery.phase===`verification-failed`?t(`promptAdmissionVerificationFailedDetail`):t(`promptAdmissionUnknownDetail`)})]}),(0,q.jsxs)(`div`,{className:`prompt-recovery-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:e.promptAdmissionRecovery.phase===`submitting`,onClick:e.actions.abandonPromptAdmission,children:t(`abandonAdmission`)}),e.promptAdmissionRecovery.phase===`verification-failed`&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>void e.actions.checkPromptAdmissionRecovery(),children:t(`retryAdmissionCheck`)}),e.promptAdmissionRecovery.retryable&&(0,q.jsx)(`button`,{type:`button`,disabled:!Ie||e.sessionSwitching||e.modelSelectionPending||e.thinkingPendingLevel!==null||e.promptAdmissionRecovery.phase!==`ready`,onClick:()=>void e.actions.retryPromptAdmission(),children:t(`retryOriginalAdmission`)}),(0,q.jsx)(`button`,{type:`button`,className:`primary`,disabled:z||!Ie||e.sessionSwitching||e.modelSelectionPending||e.thinkingPendingLevel!==null||v||e.promptAdmissionRecovery.phase!==`ready`||!p.trim()&&m.length===0&&h.length===0,onClick:()=>void ot(),children:e.promptAdmissionRecovery.phase===`submitting`?t(`sendingAsNew`):t(`sendAsNew`)})]})]}),(0,q.jsxs)(`div`,{className:`composer-status-strip`,children:[Ie&&(0,q.jsx)(YD,{snapshot:e.snapshot,observed:e.activityObserved,onInspectSubagent:e.onInspectSubagent,expanded:fe===`activity`,onExpandedChange:e=>ue(t=>e?{owner:y,panel:`activity`}:t?.panel===`activity`?null:t)}),(Pt||At)&&(0,q.jsxs)(`section`,{className:`composer-queue`,"data-state":wt?.promptQueueBlocked?`blocked`:`waiting`,"aria-label":Pt?t(`pendingFollowUpsHint`,{count:Tt}):t(`steeringMessagesTitle`),"aria-busy":Lt,children:[(0,q.jsxs)(`div`,{className:`composer-queue-status`,role:`status`,children:[(0,q.jsx)(vs,{"aria-hidden":`true`}),(0,q.jsxs)(`button`,{type:`button`,className:`composer-queue-toggle`,"aria-expanded":pe,"aria-controls":ye,"aria-label":Pt?t(`pendingFollowUpsHint`,{count:Tt}):t(`pendingSteeringHint`,{count:Ot}),onClick:()=>me(`queue`),children:[[Pt?t(`composerQueuedCount`,{count:Tt}):``,At?t(`composerSteeringCount`,{count:Ot}):``].filter(Boolean).join(` · `),(0,q.jsx)(is,{"aria-hidden":`true`})]}),Ie&&(0,q.jsxs)(`span`,{children:[wt?.promptQueueBlocked&&(0,q.jsx)(`button`,{type:`button`,disabled:Lt||Be,onClick:()=>void Bt(`retry`),children:t(`retryPrompt`)}),(0,q.jsx)(`button`,{type:`button`,disabled:Lt,onClick:()=>void Bt(`clear`),children:t(`clearPromptQueue`)})]})]}),(0,q.jsxs)(`div`,{id:ye,className:`composer-queue-details composer-status-details`,hidden:!pe,children:[(wt?.promptQueueBlocked||Be)&&(0,q.jsx)(`p`,{className:`composer-queue-help`,children:t(wt?.promptQueueBlocked?`compactionQueueBlocked`:`compactionQueueWaiting`)}),Pt&&(0,q.jsx)(`ul`,{children:Nt.map(({message:e,key:r})=>{let i=`${n?.id}\0${n?.path}\0${r}`,a=ce===i,o=e||t(`queuedImage`),s=t(a?`queuedMessageCollapse`:`queuedMessageExpand`);return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,className:`composer-queue-row ${a?`expanded`:``}`,"aria-expanded":a,"aria-label":`${s}: ${a?o:zD(o,80)}`,title:s,onClick:()=>le(a?null:i),children:[(0,q.jsx)(Cs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o})]})},r)})}),Tt!==void 0&&Tt>jt.length&&(0,q.jsx)(`small`,{children:t(`queuedMore`,{count:Tt-jt.length})}),At&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`composer-queue-help`,children:t(`pendingSteeringHint`,{count:Ot})}),(0,q.jsx)(`ul`,{children:kt.map((e,r)=>{let i=`${n?.id}\0${n?.path}\0steer:${r}:${e}`,a=ce===i,o=e||t(`queuedImage`),s=t(a?`queuedMessageCollapse`:`queuedMessageExpand`);return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,className:`composer-queue-row ${a?`expanded`:``}`,"aria-expanded":a,"aria-label":`${s}: ${a?o:zD(o,80)}`,title:s,onClick:()=>le(a?null:i),children:[(0,q.jsx)(Cs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o})]})},i)})}),(Ot??0)>kt.length&&(0,q.jsx)(`small`,{children:t(`queuedMore`,{count:(Ot??0)-kt.length})})]})]}),wt?.promptQueueBlocked&&!pe&&(0,q.jsx)(`p`,{className:`composer-queue-blocked`,role:`status`,children:t(`compactionQueueBlocked`)})]})]}),(0,q.jsxs)(`form`,{"data-editor-expanded":_e||void 0,className:`composer composer-m02 ${e.selectedWorkspace?``:`dormant`} ${oe?`is-dragging`:``}`,onSubmit:e=>void at(e),onDragEnter:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),tt&&se(!0))},onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),tt&&(e.dataTransfer.dropEffect=`copy`,se(!0)))},onDragLeave:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||se(!1)},onDrop:e=>{se(!1),e.dataTransfer.files.length!==0&&(e.preventDefault(),tt&&rt(e.dataTransfer.files))},children:[(0,q.jsx)(ik,{open:!!M,viewKey:M??void 0,items:Vt,onClose:Rt},`actions:${y}`),!e.selectedWorkspace&&(0,q.jsxs)(`div`,{className:`composer-dormant-cta`,"aria-hidden":`true`,children:[(0,q.jsx)(Vs,{}),(0,q.jsx)(`span`,{children:gt})]}),!e.selectedWorkspace&&!e.landing&&(0,q.jsx)(`button`,{className:`dormant-overlay`,type:`button`,"aria-label":t(`selectWorkspace`),onClick:()=>void e.actions.chooseWorkspace()}),(0,q.jsx)(`input`,{ref:ke,className:`sr-only`,type:`file`,multiple:!0,tabIndex:-1,"aria-hidden":`true`,onChange:e=>{e.currentTarget.files&&rt(e.currentTarget.files)}}),(0,q.jsxs)(`div`,{className:`composer-attachments`,ref:Ee,children:[(0,q.jsx)(dO,{ownerKey:y,images:m,onRemove:e=>{Fe({images:f.current.images.filter(t=>t.id!==e)})&&re(null)}}),(0,q.jsx)(fO,{ownerKey:y,files:h,onRemove:e=>{Fe({files:(f.current.files??[]).filter(t=>t.id!==e)})&&re(null)}})]}),ne&&(0,q.jsx)(`p`,{className:`composer-attachment-error`,role:`alert`,children:ne}),s.status===`failed`&&(0,q.jsxs)(`p`,{className:`composer-attachment-error`,role:`status`,children:[t(`draftStorageUnavailable`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:()=>{o.retryStorage().then(()=>{let e=o.read(c.current.key);f.current=e,S.current=!0,d(e)})},children:t(`draftStorageRetry`)})]}),s.invalid&&(0,q.jsx)(`p`,{className:`composer-attachment-error`,role:`status`,children:t(`draftStorageInvalid`)}),z&&(0,q.jsx)(`p`,{role:`status`,children:t(`imageAttachmentsLoading`)}),ie&&(0,q.jsx)(`p`,{className:`composer-attachment-error`,role:`alert`,children:ie}),v&&(0,q.jsx)(`p`,{id:`composer-prompt-length-error`,className:`composer-attachment-error`,role:`alert`,children:t(`promptTooLong`,{count:_,limit:12e3})}),oe&&(0,q.jsxs)(`div`,{className:`composer-drop-overlay`,"aria-hidden":`true`,children:[(0,q.jsx)(Ks,{}),(0,q.jsx)(`span`,{children:t(`dropImagesHere`)})]}),(0,q.jsxs)(`div`,{className:`composer-editor`,children:[(0,q.jsx)(`textarea`,{id:ve,ref:Te,value:p,rows:1,disabled:qe,readOnly:!e.selectedWorkspace,"aria-label":t(`describeTask`),"aria-invalid":v||void 0,"aria-describedby":v?`composer-prompt-length-error`:void 0,"aria-autocomplete":`list`,"aria-controls":et?$k:void 0,"aria-activedescendant":et&&$e[O]?eA(O):void 0,placeholder:gt,onChange:e=>{Fe({prompt:e.target.value,caret:e.target.selectionStart})&&(ae(null),D(!1))},onClick:e=>Fe({caret:e.currentTarget.selectionStart}),onSelect:e=>Fe({caret:e.currentTarget.selectionStart}),onFocus:()=>{T(!0),D(!1)},onBlur:()=>T(!1),onPaste:e=>{if(!tt)return;let t=Array.from(e.clipboardData.files);if(t.length===0)for(let n of Array.from(e.clipboardData.items??[])){let e=n.kind===`file`?n.getAsFile():null;e&&t.push(e)}t.length!==0&&(e.clipboardData.getData(`text/plain`)||e.preventDefault(),rt(t))},onKeyDown:e=>{if(!(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)){if(Xe){if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),ct(e.key===`ArrowDown`?1:-1);return}if(e.key===`Escape`){e.preventDefault(),D(!0);return}if(e.key===`Tab`){let t=$e[O];!e.shiftKey&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&t?.availability===`available`&&(e.preventDefault(),st(t));return}if(e.key===`Enter`&&!e.shiftKey){let t=$e[O];if(t){e.preventDefault(),st(t);return}if($e.length>0){e.preventDefault();return}}}e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),at(void 0,e.metaKey||e.ctrlKey))}}}),e.selectedWorkspace&&(0,q.jsx)(V,{content:t(_e?`collapseInput`:`expandInput`),placement:`above`,children:(0,q.jsx)(`button`,{type:`button`,className:`composer-expand-button icon-button`,"aria-label":t(_e?`collapseInput`:`expandInput`),"aria-expanded":_e,"aria-controls":ve,disabled:qe,onPointerDown:e=>e.preventDefault(),onClick:()=>{let e=Te.current;if(e){be.current?.owner!==y&&(be.current={owner:y});let t=be.current;t[_e?`expanded`:`compact`]=e.scrollTop,xe.current={start:e.selectionStart,end:e.selectionEnd,direction:e.selectionDirection,scrollTop:t[_e?`compact`:`expanded`]??e.scrollTop}}ge(_e?null:y)},children:_e?(0,q.jsx)(fc,{"aria-hidden":`true`}):(0,q.jsx)(ac,{"aria-hidden":`true`})})})]}),(0,q.jsx)(rA,{open:Xe,activeIndex:O,commandDiscovery:Je,commands:$e,draft:!!e.workspaceDraft,preferBelow:e.landing,onComplete:st,onSelect:k},`commands:${y}`),(0,q.jsxs)(`div`,{className:`composer-toolbar`,children:[(0,q.jsxs)(`div`,{className:`composer-toolbar-context`,children:[tt&&(0,q.jsx)(V,{content:t(`addContext`),placement:`above`,children:(0,q.jsx)(`button`,{ref:R,type:`button`,className:`composer-context-trigger icon-button`,"aria-label":t(`addContext`),"aria-haspopup":`menu`,"aria-expanded":M!==null,"aria-controls":M?`composer-action-menu`:void 0,onClick:()=>{D(!0),N(M?null:`main`)},children:(0,q.jsx)(Ae,{})})}),e.landing?(0,q.jsx)(yo,{className:`workspace-picker-menu`,button:{label:e.selectedWorkspace?LD(e.selectedWorkspace):t(`selectWorkspace`),icon:(0,q.jsx)(Vs,{}),size:`sm`,variant:`ghost`,className:`workspace-picker`},items:dt,menuWidth:240,placement:`above`,alignment:`start`,hasChevron:!0}):(0,q.jsxs)(`span`,{className:`composer-workspace-label`,title:`${pt} / ${ht}`,children:[(0,q.jsx)(Vs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:pt})]}),Ie&&e.snapshot?.runtime.plan&&e.snapshot.runtime.plan!==`inactive`&&(0,q.jsx)(`span`,{className:`composer-plan-chip`,children:t(`planMode_${e.snapshot.runtime.plan}`)})]}),(0,q.jsxs)(`div`,{className:`composer-toolbar-controls`,children:[We&&(0,q.jsx)(yo,{button:{className:`composer-delivery-trigger`,label:t(Ke?`steerCurrentTurn`:`sendNextTurn`),children:(0,q.jsx)(`span`,{className:`composer-delivery-label`,children:t(Ke?`steerCurrentTurn`:`sendNextTurn`)}),"aria-label":t(Ke?`steerCurrentTurn`:`sendNextTurn`),tooltip:t(Ke?`steerCurrentTurn`:`sendNextTurn`),icon:Ke?(0,q.jsx)(Bc,{"aria-hidden":`true`}):(0,q.jsx)(Cs,{"aria-hidden":`true`}),variant:`ghost`,size:`sm`,isDisabled:e.promptAdmissionPending||!!e.promptAdmissionRecovery},items:[{id:`followUp`,label:t(`sendNextTurn`),onClick:()=>{Ue&&(we({ownerKey:y,expectedTurnCommandId:Ue.commandId,mode:`followUp`}),ae(null))}},{id:`steer`,label:t(`steerCurrentTurn`),isDisabled:!We,onClick:()=>{!We||!Ue||(we({ownerKey:y,expectedTurnCommandId:Ue.commandId,mode:`steer`}),ae(null))}}],placement:`above`,alignment:`end`,hasChevron:!0}),(0,q.jsx)(`div`,{className:`model-picker-wrap`,hidden:!!(n&&!Ie&&!e.workspaceDraft),title:Ct?t(Ct):void 0,"data-level":vt??`none`,"data-pending":yt!==null,"data-warning":St,children:(0,q.jsx)(Qk,{snapshot:e.snapshot,openRequest:I,currentModel:ft,draftModel:e.draftModel,modelSearch:C,modelSelectionPending:!!e.modelSelectionPending,promptAdmissionPending:e.promptAdmissionPending,sessionSwitching:e.sessionSwitching,liveRunning:Ve,workspaceDraft:!!e.workspaceDraft,thinkingPendingLevel:yt,thinkingNeedsSession:xt,thinkingDisabledReason:Ct,onOpenProviders:e.onOpenProviders,actions:e.actions})}),He&&(0,q.jsx)(V,{content:t(`stopTurn`),placement:`above`,children:(0,q.jsx)(`button`,{className:`send-button stop-button`,type:`button`,"aria-label":t(`stopTurn`),disabled:e.turnCancellationPending||e.sessionSwitching,onClick:()=>void e.actions.cancelActiveTurn(),children:(0,q.jsx)(Rc,{"aria-hidden":`true`})})}),(!He||!!(p.trim()||m.length||h.length))&&(0,q.jsx)(V,{content:t(Be?`compactionDraftHelp`:`send`),placement:`above`,children:(0,q.jsx)(`button`,{className:`send-button`,type:`submit`,"aria-label":t(`send`),disabled:z||e.sessionSwitching||e.modelSelectionPending||e.thinkingPendingLevel!==null||!ze||!e.selectedWorkspace||e.promptAdmissionPending||v||e.planSelectionPending||!!e.promptAdmissionRecovery||!!e.promptAdmissionResolution||!p.trim()&&m.length===0&&h.length===0,children:e.sessionSwitching&&e.workspaceDraft?(0,q.jsx)(rc,{className:`send-spinner`}):(0,q.jsx)(Xo,{})})})]})]}),(0,q.jsx)(`div`,{className:`composer-hint`,"data-visible":It,"aria-live":`polite`,children:ze?Ft:null})]}),(0,q.jsx)(tk,{open:A,sessionId:Ie?n?.id:void 0,onClose:()=>j(!1),onInsert:lt})]})}function sA({target:e,onClose:t,onOpenProviders:n}){let{t:r}=W(),i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(0),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)(null),p=e=>{f(null),td(e).then(e=>f(e?`copied`:`failed`))};(0,K.useEffect)(()=>{let t=new AbortController;return c(null),u(null),f(null),(async()=>{let n={errors:[]},[a,o]=await Promise.allSettled([i.thinking(e.sessionId,t.signal),i.trust(e.sessionId,t.signal)]);a.status===`fulfilled`&&a.value.sessionId===e.sessionId?n.thinking=a.value:n.errors.push(r(`thinkingUnavailable`)),o.status===`fulfilled`&&(o.value.workspace===void 0||o.value.workspace===e.cwd)?n.trust=o.value:n.errors.push(r(`trustUnavailable`)),!t.signal.aborted&&(c(n),u(new Date().toLocaleTimeString()))})(),()=>t.abort()},[i,e,a,r]);let m=r(`runtimeStatus`);return(0,q.jsx)(Se,{isOpen:!0,onOpenChange:e=>!e&&t(),width:640,"aria-label":m,children:(0,q.jsxs)(`section`,{className:`inspection-panel`,children:[(0,q.jsxs)(`header`,{className:`inspection-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:m}),(0,q.jsx)(`p`,{className:`inspection-subtitle`,children:e.cwd})]}),(0,q.jsxs)(`div`,{className:`inspection-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":r(`refreshStatus`),disabled:!s,onClick:()=>o(e=>e+1),children:(0,q.jsx)(me,{})}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":r(`close`),onClick:t,children:(0,q.jsx)(je,{})})]})]}),d&&(0,q.jsx)(`p`,{role:`status`,children:r(d===`copied`?`copiedMessage`:`copyFailed`)}),s?(0,q.jsxs)(q.Fragment,{children:[s.errors.map(e=>(0,q.jsx)(`p`,{className:`inspection-warning`,role:`alert`,children:e},e)),(0,q.jsxs)(`section`,{className:`inspection-section`,children:[(0,q.jsx)(`h3`,{children:r(`modelAndThinking`)}),(0,q.jsxs)(`dl`,{children:[(0,q.jsx)(`dt`,{children:r(`selectedModel`)}),(0,q.jsx)(`dd`,{children:e.model||r(`noModels`)}),(0,q.jsx)(`dt`,{children:r(`thinkingLevel`)}),(0,q.jsx)(`dd`,{children:s.thinking?.supported===!1?r(`thinkingUnsupported`):s.thinking?.level??r(`unknownState`)}),!!s.thinking?.available.length&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`dt`,{children:r(`availableThinking`)}),(0,q.jsx)(`dd`,{children:s.thinking?.available.join(` · `)})]})]}),s.thinking?.supported===!1&&(0,q.jsx)(`p`,{className:`inspection-note`,children:r(`thinkingUnsupportedHint`)}),s.thinking&&s.thinking.supported!==!1&&!s.thinking.available.includes(s.thinking.level)&&(0,q.jsx)(`p`,{className:`inspection-warning`,role:`status`,children:r(`thinkingLevelMismatch`)})]}),(0,q.jsxs)(`section`,{className:`inspection-section`,children:[(0,q.jsx)(`h3`,{children:r(`projectTrust`)}),(0,q.jsx)(`p`,{children:r(`trust_${s.trust?.state??`unknown`}`)}),(0,q.jsxs)(`dl`,{children:[(0,q.jsx)(`dt`,{children:r(`savedTrustDecision`)}),(0,q.jsx)(`dd`,{children:r(`trustDecision_${s.trust?.decision??`unknown`}`)}),(0,q.jsx)(`dt`,{children:r(`activeSessionTrust`)}),(0,q.jsx)(`dd`,{children:s.trust?.sessionTrusted===!0?r(`trustActiveYes`):s.trust?.sessionTrusted===!1?r(`trustActiveNo`):r(`unknownState`)})]}),s.trust?.refreshRequired===!0&&(0,q.jsx)(`p`,{className:`inspection-warning`,children:r(`trustRefreshNeeded`)})]}),n&&(0,q.jsxs)(`button`,{type:`button`,className:`inspection-provider-link`,"aria-label":r(`openProviderSettings`),onClick:n,children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:r(`providerAvailability`)}),(0,q.jsx)(`small`,{children:r(`authNotVerified`)})]}),r(`openProviderSettings`)]}),(0,q.jsxs)(`div`,{className:`inspection-setup`,children:[(0,q.jsx)(`p`,{className:`inspection-note`,children:r(`configurationViaPi`)}),(0,q.jsx)(`code`,{children:`/openpi-setup`}),(0,q.jsx)(`button`,{type:`button`,className:`inspection-copy`,"aria-label":r(`copySetupCommand`),title:r(`copySetupCommand`),onClick:()=>p(`/openpi-setup`),children:(0,q.jsx)(_s,{"aria-hidden":`true`})})]}),(0,q.jsx)(`p`,{className:`inspection-updated`,children:r(`statusCaptured`,{time:l})})]}):(0,q.jsx)(`p`,{role:`status`,children:r(`inspectionLoading`)})]})})}var cA=32,lA=1048576;function uA(e){return e.drafts.reduce((e,t)=>e+sd(t.custom)+Object.values(t.notes).reduce((e,t)=>e+sd(t),0),0)}function dA(e,t,n){if(!(n.submission||n.drafts.some(e=>e.choice!==null||e.custom||Object.values(e.notes).some(Boolean))))return e.delete(t),!0;let r=e.get(t);if(!r&&e.size>=cA)return!1;let i=r?uA(r):0,a=uA(n),o=Array.from(e.values()).reduce((e,t)=>e+uA(t),0);return a>i&&o-i+a>lA?!1:(e.set(t,n),!0)}function fA(e,t,n,r){for(let[i,a]of e)a.sessionId===t&&a.sessionPath===n&&a.requestId!==r&&e.delete(i)}function pA({request:e,answer:t,onSettled:n,connected:r=!0,sessionPath:i=``,workingCache:a}){let{t:o}=W(),s=(0,K.useId)(),c=(0,K.useMemo)(()=>new Map,[]),l=a??c,u=JSON.stringify([e.sessionId,i,e.requestId]),[d,f]=(0,K.useState)(()=>l.get(u)??{sessionId:e.sessionId,sessionPath:i,requestId:e.requestId,drafts:e.questions.map(()=>({choice:null,custom:``,notes:{}})),index:0,review:!1,submission:null}),p=(0,K.useRef)(d),{drafts:m,index:h,review:g,submission:_}=d,[v,y]=(0,K.useState)(!!d.submission),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(!1),w=(0,K.useRef)(!1),T=!!_,E=(0,K.useRef)(null),D=(0,K.useRef)(null),O=e.questions[h],k=m[h],A=S||T||!r,j=m.some(e=>e.choice===`custom`?!cd(e.custom):typeof e.choice==`number`&&!cd(e.notes[e.choice]??``)),M=m.every(e=>e.choice!==null)&&!j,N=(t,n)=>e.handoff?o(n===0?`handoffDone`:`handoffUnable`):t;(0,K.useEffect)(()=>()=>E.current?.abort(),[]);let P=e=>dA(l,u,e)?(p.current=e,f(e),x(!1),!0):(x(!0),!1),F=(e,t=!1)=>{P({...p.current,index:e,review:t}),requestAnimationFrame(()=>D.current?.focus())},I=e=>{let t=p.current;P({...t,drafts:t.drafts.map((n,r)=>r===t.index?{...n,...e}:n)})},ee=()=>e.questions.map((e,t)=>{let n=m[t];if(n.choice===`custom`)return n.custom.trim()?{id:e.id,custom:n.custom}:{id:e.id,rephrase:!0};let r=typeof n.choice==`number`?e.options[n.choice]?.label:void 0;return{id:e.id,selected:r,...typeof n.choice==`number`&&n.notes[n.choice]?.trim()?{note:n.notes[n.choice]}:{}}}),L=async(i=!1)=>{if(w.current||!r||!i&&!T&&!M)return;let a=p.current.submission??{answers:i?null:ee()};if(!P({...p.current,submission:a}))return;w.current=!0,C(!0),y(!1);let o=new AbortController;E.current=o;try{let r=await t(e,a.answers,o.signal);o.signal.aborted||(l.delete(u),n(r))}catch{o.signal.aborted||y(!0)}finally{o.signal.aborted||(w.current=!1,C(!1))}};return(0,q.jsxs)(`section`,{className:`question-card`,"aria-labelledby":`${s}-title`,"aria-busy":S,children:[(0,q.jsxs)(`header`,{className:`question-card-header`,children:[(0,q.jsxs)(`span`,{className:`question-status`,children:[(0,q.jsx)(lc,{"aria-hidden":`true`}),o(e.handoff?`handoffWaiting`:`questionWaiting`)]}),(0,q.jsx)(`span`,{className:`question-count`,children:g?o(e.handoff?`handoffReview`:`questionReview`):o(`questionProgress`,{current:h+1,total:e.questions.length})}),(0,q.jsx)(`button`,{type:`button`,className:`question-icon`,"aria-label":o(`questionDismiss`),title:o(`questionDismiss`),disabled:A,onClick:()=>void L(!0),children:(0,q.jsx)(je,{})})]}),(0,q.jsxs)(`div`,{className:`question-card-body`,children:[(0,q.jsx)(`h2`,{id:`${s}-title`,ref:D,tabIndex:-1,children:g?o(`questionReviewTitle`):O.question}),e.handoff&&(0,q.jsxs)(`div`,{className:`handoff-instructions`,children:[(0,q.jsx)(`p`,{children:e.handoff.instructions}),(0,q.jsxs)(`p`,{className:`question-help`,children:[o(`handoffSignal`),` `,e.handoff.completionSignal]}),(0,q.jsx)(`p`,{className:`question-help`,children:o(`handoffVerify`)})]}),g?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`question-help`,children:o(`questionReviewHelp`)}),(0,q.jsx)(`ol`,{className:`question-review-list`,children:e.questions.map((e,t)=>{let n=m[t];return(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`question-review-label`,children:e.header}),(0,q.jsx)(`p`,{children:typeof n.choice==`number`?N(e.options[n.choice]?.label,n.choice):n.custom.trim()||o(`questionRephrase`)}),typeof n.choice==`number`&&n.notes[n.choice]?.trim()&&(0,q.jsx)(`p`,{className:`question-help`,children:n.notes[n.choice]})]}),(0,q.jsx)(`button`,{type:`button`,className:`question-icon`,"aria-label":o(`questionEdit`,{question:e.header}),disabled:A,onClick:()=>F(t),children:(0,q.jsx)(yc,{})})]},e.id)})})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`fieldset`,{disabled:A,className:`question-choices`,children:[(0,q.jsx)(`legend`,{className:`sr-only`,children:O.header}),O.options.map((t,n)=>(0,q.jsxs)(`label`,{className:`question-choice ${k.choice===n?`is-selected`:``}`,children:[(0,q.jsx)(`input`,{className:`question-radio`,type:`radio`,name:`${s}-${O.id}`,checked:k.choice===n,onChange:()=>I({choice:n})}),(0,q.jsx)(`span`,{className:`question-choice-number`,"aria-hidden":`true`,children:k.choice===n?(0,q.jsx)(rs,{"aria-hidden":`true`}):n+1}),(0,q.jsxs)(`span`,{className:`question-choice-copy`,children:[(0,q.jsx)(`strong`,{children:N(t.label,n)}),(0,q.jsx)(`span`,{children:e.handoff?o(n===0?`handoffDoneHelp`:`handoffUnableHelp`):t.description})]})]},t.label))]}),typeof k.choice==`number`&&(0,q.jsxs)(`div`,{className:`question-extras`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`question-note-toggle`,disabled:A,"aria-expanded":!!k.notesExpanded,"aria-controls":k.notesExpanded?`${s}-notes`:void 0,onClick:()=>I({notesExpanded:!k.notesExpanded}),children:[(0,q.jsx)(yc,{"aria-hidden":`true`}),o(`questionNotes`)]}),typeof k.choice==`number`&&O.options[k.choice]?.preview&&(0,q.jsxs)(`details`,{className:`question-preview-disclosure`,children:[(0,q.jsx)(`summary`,{children:o(`questionPreview`)}),(0,q.jsx)(`pre`,{className:`question-preview`,children:O.options[k.choice].preview})]},`${O.id}-${k.choice}`)]}),(k.choice===`custom`||typeof k.choice==`number`&&k.notesExpanded)&&(0,q.jsxs)(`label`,{className:`question-notes`,id:`${s}-notes`,children:[(0,q.jsx)(`span`,{className:`sr-only`,id:`${s}-answer-label`,children:k.choice===`custom`?o(`questionYourAnswer`):o(`questionNotes`)}),(0,q.jsx)(`textarea`,{rows:1,disabled:A,value:k.choice===`custom`?k.custom:k.notes[k.choice]??``,onChange:e=>k.choice===`custom`?I({custom:e.target.value}):typeof k.choice==`number`&&I({notes:{...k.notes,[k.choice]:e.target.value}}),"aria-invalid":j,"aria-labelledby":`${s}-answer-label`,"aria-describedby":[j?`${s}-limit`:``,k.choice===`custom`?`${s}-custom-help`:``].filter(Boolean).join(` `)||void 0,placeholder:k.choice===`custom`?o(`questionCustomPlaceholder`):o(`questionNotesPlaceholder`)}),k.choice===`custom`&&(0,q.jsx)(`span`,{className:`question-help`,id:`${s}-custom-help`,children:o(`questionCustomHelp`)})]})]}),j&&(0,q.jsx)(`p`,{className:`question-error`,id:`${s}-limit`,role:`alert`,children:o(`questionLimit`,{count:8e3})}),b&&(0,q.jsx)(`p`,{className:`question-error`,role:`alert`,children:o(`questionDraftLimit`)}),!r&&(0,q.jsx)(`p`,{className:`question-help`,role:`status`,children:o(`questionDisconnected`)}),v&&(0,q.jsx)(`p`,{className:`question-error`,role:`alert`,children:o(`questionUncertain`)})]},`${h}:${g}`),(0,q.jsxs)(`footer`,{className:`question-card-footer`,children:[!g&&!e.handoff&&(0,q.jsxs)(`label`,{className:`question-custom ${k.choice===`custom`?`is-selected`:``} ${A?`is-disabled`:``}`,children:[(0,q.jsx)(`input`,{className:`question-radio`,type:`radio`,name:`${s}-${O.id}`,checked:k.choice===`custom`,disabled:A,onChange:()=>I({choice:`custom`})}),(0,q.jsx)(`span`,{className:`question-choice-number`,"aria-hidden":`true`,children:(0,q.jsx)(yc,{})}),(0,q.jsx)(`span`,{children:o(`questionCustom`)})]}),(0,q.jsxs)(`div`,{className:`question-actions`,children:[(g||h>0)&&(0,q.jsxs)(`button`,{type:`button`,className:`question-secondary`,disabled:A||!g&&h===0,onClick:()=>F(g?e.questions.length-1:h-1),children:[(0,q.jsx)(Ko,{}),o(`questionBack`)]}),!T&&(0,q.jsx)(`button`,{type:`button`,className:`question-secondary question-skip`,disabled:A,title:o(`questionDismiss`),onClick:()=>void L(!0),children:o(`questionSkip`)}),T?(0,q.jsxs)(`button`,{type:`button`,className:`question-primary`,disabled:S||!r,onClick:()=>void L(),children:[(0,q.jsx)(he,{}),o(S?`questionSubmitting`:`questionRetry`)]}):g?(0,q.jsxs)(`button`,{type:`button`,className:`question-primary`,disabled:A||!M,onClick:()=>void L(),children:[(0,q.jsx)(rs,{}),o(e.handoff?`handoffSubmit`:`questionSubmit`)]}):(0,q.jsxs)(`button`,{type:`button`,className:`question-primary`,disabled:A||k.choice===null||j,onClick:()=>F(hnew de,[]),s=(0,K.useMemo)(()=>new Map,[]),c=i??s,[l,u]=(0,K.useState)(null),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(0),_=(0,K.useRef)(null),v=(0,K.useRef)(null);return(0,K.useEffect)(()=>{let t=new AbortController;return o.pendingQuestions(e,t.signal).then(({pending:n})=>{if(t.signal.aborted)return;let i=n?.requestId===_.current?null:n;v.current=i?.requestId??null,m(!1),fA(c,e,r,n?.requestId),u(i),n&&n.requestId!==_.current&&f(null)},()=>{t.signal.aborted||m(!0)}),()=>t.abort()},[o,e,r,c,t,h]),!l&&!d&&!p?null:(0,q.jsx)(`div`,{className:`question-panel`,children:l?(0,q.jsx)(pA,{request:l,connected:n,sessionPath:r,workingCache:c,answer:(e,t,n)=>o.answerQuestions(e,t,n),onSettled:e=>{v.current===l.requestId&&(v.current=null,_.current=l.requestId,u(null),f(e.state===`answered`?null:e),g(e=>e+1))}},l.requestId):d?(0,q.jsxs)(`div`,{className:`question-receipt`,role:`status`,children:[(0,q.jsx)(rs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:a(`questionState_${d.state}`)}),(0,q.jsx)(`button`,{type:`button`,className:`question-icon`,"aria-label":a(`questionCloseReceipt`),onClick:()=>f(null),children:(0,q.jsx)(je,{})})]}):(0,q.jsxs)(`div`,{className:`question-receipt`,role:`alert`,children:[(0,q.jsx)(`span`,{children:a(`questionLoadFailed`)}),(0,q.jsx)(`button`,{type:`button`,className:`question-secondary`,onClick:()=>g(e=>e+1),children:a(`questionRetryLoad`)})]})})}function hA(e,t,{active:n=!0,running:r=!1,initialSource:i=`unstaged`,initialBaseRef:a}={}){let{t:o}=W(),s=(0,K.useMemo)(()=>new de,[]),c=(0,K.useRef)(null),l=(0,K.useRef)(null),u=(0,K.useRef)(!1),d=(0,K.useRef)({active:n,running:r});d.current={active:n,running:r};let[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)(null),v=e?.id,y=e?.path,[b,x]=(0,K.useState)({sessionId:v,sessionPath:y,source:i,baseRef:a}),S=b.sessionId===v&&b.sessionPath===y?b.source:i,C=b.sessionId===v&&b.sessionPath===y?b.baseRef:a,w=(0,K.useCallback)(e=>{x({sessionId:v,sessionPath:y,source:e,baseRef:C})},[v,y,C]),T=(0,K.useCallback)(e=>{x({sessionId:v,sessionPath:y,source:`branch`,baseRef:e})},[v,y]);(0,K.useLayoutEffect)(()=>{p(null),_(null),h(!!v)},[v,y,S,C]);let E=(0,K.useCallback)((e,t)=>{if(!(e.signal.aborted||c.current!==e)&&(c.current=null,h(!1),u.current)){u.current=!1;let e=d.current;(e.active||!e.running)&&l.current===null&&(l.current=window.setTimeout(()=>{l.current=null,t()},e.active?200:2e3))}},[]),D=(0,K.useCallback)(async()=>{if(!v||!y||document.visibilityState===`hidden`)return;if(c.current){u.current=!0;return}let e=new AbortController;c.current=e,h(!0),_(null);try{let t=await s.gitReview(v,y,e.signal,{source:S,offset:`0`,...S===`branch`&&C?{baseRef:C}:{}});e.signal.aborted||(t.ok||_(o(t.reason===`not_git_repository`?`gitReviewNotRepository`:t.reason===`baseline_unavailable`?`gitReviewBaselineUnavailable`:t.reason===`base_branch_unavailable`?`gitReviewBaseUnavailable`:t.reason===`invalid_base_branch`?`gitReviewBaseInvalid`:`gitReviewFailed`)),p(e=>!t.ok&&e?.ok?t.branches?{...e,branches:t.branches}:e:t.ok&&e?.ok&&t.snapshot.revision===e.snapshot.revision?JSON.stringify(t.branches)===JSON.stringify(e.branches)?e:{...e,branches:t.branches}:t))}catch(t){e.signal.aborted||_(t instanceof Error?t.message:`Git review unavailable`)}finally{E(e,D)}},[s,v,y,S,C,o,E]),O=(0,K.useCallback)(async()=>{if(!v||!y||!f?.ok||f.snapshot.nextOffset===void 0||c.current)return;let e=f.snapshot,t=new AbortController;c.current=t,h(!0),_(null);try{let n=await s.gitReview(v,y,t.signal,{source:S,offset:String(e.nextOffset),revision:e.revision,...S===`branch`&&C?{baseRef:C}:{}});if(t.signal.aborted)return;if(!n.ok||n.snapshot.revision!==e.revision)throw Error(o(!n.ok&&n.reason===`revision_changed`?`gitReviewChanged`:`gitReviewFailed`));p({...n,snapshot:{...n.snapshot,files:[...e.files,...n.snapshot.files],additions:e.additions+n.snapshot.additions,deletions:e.deletions+n.snapshot.deletions}})}catch(e){t.signal.aborted||_(e instanceof Error?e.message:o(`gitReviewFailed`))}finally{E(t,D)}},[s,v,y,S,C,f,o,E,D]),k=(0,K.useCallback)(async(e,t,n)=>{if(!v||!y)return;let r=await s.gitReview(v,y,t,{source:S,file:e,revision:n,...S===`branch`&&C?{baseRef:C}:{}});if(!r.ok||r.summaryRevision!==n)throw(r.ok||r.reason===`revision_changed`)&&!t.aborted&&D(),Error(o(!r.ok&&r.reason!==`revision_changed`?`gitReviewFailed`:`gitReviewChanged`));return r.snapshot.files.find(t=>t.path===e)},[s,v,y,S,C,D,o]);return(0,K.useEffect)(()=>{if(v)return l.current=window.setTimeout(()=>{l.current=null,D()},200),()=>{l.current!==null&&window.clearTimeout(l.current),l.current=null,u.current=!1,c.current?.abort(),c.current=null}},[D,v]),(0,K.useEffect)(()=>{n&&l.current!==null&&(window.clearTimeout(l.current),l.current=null)},[n]),(0,K.useEffect)(()=>{if(!n&&r){l.current!==null&&window.clearTimeout(l.current),l.current=null,u.current=!1;return}!v||l.current!==null||(l.current=window.setTimeout(()=>{l.current=null,D()},n?200:2e3))},[D,t,n,r,v]),(0,K.useEffect)(()=>{if(!v)return;let e=()=>{let e=d.current;(e.active||!e.running)&&D()};return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,e)}},[D,v]),(0,K.useMemo)(()=>({result:f,loading:m,error:g,refresh:D,source:S,setSource:w,baseRef:C,setBaseRef:T,readFile:k,loadMore:O}),[f,m,g,D,S,w,C,T,k,O])}function gA({notice:e,actions:t}){let{t:n}=W(),r=(0,K.useRef)(!1),[i,a]=(0,K.useState)(null),[o,s]=(0,K.useState)(!1),c=()=>t.dismissArchiveNotice(e.key),l=async n=>{if(!r.current){r.current=!0,a(n),s(!1);try{(n===`undo`?await t.unarchiveSession(e.path):await t.selectSession(e.path,e.sessionId))===!1?s(!0):c()}catch{s(!0)}finally{r.current=!1,a(null)}}};return(0,q.jsx)(`div`,{className:`archive-notification`,"data-session-path":e.path,children:(0,q.jsx)(Gu,{type:`info`,body:n(`archiveNoticeTitle`),isAutoHide:!i&&!o,autoHideDuration:8e3,onDismiss:c,renderContent:()=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Go,{className:`archive-notification-icon`,"aria-hidden":`true`}),(0,q.jsxs)(`div`,{className:`archive-notification-copy`,children:[(0,q.jsx)(`strong`,{children:n(`archiveNoticeTitle`)}),(0,q.jsx)(`span`,{title:e.title,children:e.title}),o&&(0,q.jsx)(`span`,{className:`archive-notification-error`,role:`alert`,children:n(`archiveNoticeFailed`)})]}),(0,q.jsx)(`button`,{type:`button`,disabled:i!==null,onClick:()=>void l(`view`),children:n(`archiveNoticeView`)}),(0,q.jsxs)(`button`,{type:`button`,className:`archive-notification-undo`,disabled:i!==null,onClick:()=>void l(`undo`),children:[i===`undo`&&(0,q.jsx)(rc,{className:`archive-notification-spinner`,"aria-hidden":`true`}),n(`archiveNoticeUndo`)]}),(0,q.jsx)(`button`,{type:`button`,className:`archive-notification-close`,"aria-label":n(`close`),onClick:c,children:(0,q.jsx)(je,{"aria-hidden":`true`})})]})})})}function _A({notices:e,actions:t}){return e.length?(0,q.jsx)(`div`,{className:`archive-notifications`,children:e.map(e=>(0,q.jsx)(gA,{notice:e,actions:t},e.key))}):null}function vA(e){let t=e?.closest(`.session-row, .workspace-group`),n=e?.closest(`.session-sidebar`),r=t?.dataset.sessionKey,i=Array.from(n?.querySelectorAll(`.session, .workspace-label, .workspace-heading-label`)??[]),a=i.findIndex(e=>t?.contains(e)),o=a<0?i:[...i.slice(a+1),...i.slice(0,a).reverse()];return()=>requestAnimationFrame(()=>{!n?.isConnected||document.querySelector(`dialog[open]`)||[e,r==null?null:Array.from(n.querySelectorAll(`.session-row`)).find(e=>e.dataset.sessionKey===r)?.querySelector(`.menu-action-button`),...o,n.querySelector(`.new-session-button`)].find(e=>e?.isConnected&&!e.closest(`[hidden], [inert]`)&&e.checkVisibility?.()!==!1)?.focus({preventScroll:!0})})}function yA({session:e,archived:t,connected:n,pinSaving:r,restoring:i,movementItems:a,client:o,actions:s,onRename:c,onPin:l,onRead:u,onArchive:d,onNotice:f}){let{t:p}=W(),m=(0,K.useRef)(null),h=(0,K.useRef)(!0),g=(0,K.useRef)(0),_=(0,K.useRef)(!1),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(null),[S,C]=(0,K.useState)(!1),[w,T]=(0,K.useState)(!1),[E,D]=(0,K.useState)(null),[O,k]=(0,K.useState)(!1),[A,j]=(0,K.useState)(null),[M,N]=(0,K.useState)(!1),[P,F]=(0,K.useState)(!1),I=e.execution?.status===`running`||e.execution?.waitingForInput,ee=(e.execution?.pendingFollowUps??0)+(e.execution?.pendingSteering??0)>0,L=n?I||ee?p(`sidebarActionRunning`):void 0:p(`sidebarActionDisconnected`),R=t?p(`sidebarForkArchived`):n?E?.local===!1?p(`sidebarForkUnavailable`):void 0:p(`sidebarActionDisconnected`),te=A!==null&&(A.path!==e.path||A.id!==e.id),z=e.pinOrder!==void 0,B=()=>vA(m.current?.querySelector(`button`)??null),ne=()=>{let t=new URL(`/`,window.location.origin);return t.searchParams.set(`sessionPath`,e.path),t.searchParams.set(`sessionId`,e.id),t.href};(0,K.useEffect)(()=>(h.current=!0,()=>{h.current=!1,g.current++}),[]);let re=(0,K.useRef)({id:e.id,path:e.path});(0,K.useEffect)(()=>{(re.current.id!==e.id||re.current.path!==e.path)&&(re.current={id:e.id,path:e.path},y(!1),x(null),D(null))},[e.id,e.path]),(0,K.useEffect)(()=>{if(!v||!e.cwd||!n)return;let t=++g.current;return x(null),C(!1),o.sessionOpenTargets(e.path,e.id).then(e=>{h.current&&g.current===t&&x(e.targets)}).catch(()=>{h.current&&g.current===t&&C(!0)}),()=>{g.current++}},[o,n,v,e.cwd,e.id,e.path]),(0,K.useEffect)(()=>{if(!v||t||!n)return;let r=!1;return D(null),k(!1),Promise.resolve().then(()=>o.sessionForkOptions(e.path,e.id)).then(e=>{r||D(e)}).catch(()=>{r||k(!0)}),()=>{r=!0}},[t,o,n,v,e.id,e.path]);let V=()=>{y(!1),queueMicrotask(c)},ie=()=>{let e=B();l().then(e,e)},ae=()=>{let e=B();d().then(e,e)},oe=async t=>{try{let n=await td(t===`link`?ne():t===`cwd`?e.cwd:(await o.sessionMarkdown(e.path,e.id)).markdown);f(p(n?`sidebarCopied`:`sidebarCopyFailed`),!n)}catch{f(p(`sidebarCopyFailed`),!0)}},se=async(t=`local`)=>{if(!(w||R)&&!(t===`worktree`&&!E?.worktree)){T(!0);try{t===`worktree`?await s.forkConversation(e.path,e.id,t):await s.forkConversation(e.path,e.id)}catch{f(p(`sidebarForkFailed`),!0)}finally{h.current&&T(!1)}}},ce=()=>{if(_.current)return;let e=A?.restoreFocus;j(null),e?.()},le=async()=>{if(!(!A||_.current||L||te)){_.current=!0,N(!0),F(!1);try{await s.deleteSession(A.path,A.id,A.commandId)?(h.current&&j(null),A.restoreFocus()):h.current&&F(!0)}catch{h.current&&F(!0)}finally{_.current=!1,h.current&&N(!1)}}},H=[{id:`rename`,label:p(`sidebarRename`),icon:(0,q.jsx)(yc,{}),isDisabled:!n,onClick:V},...t?[]:[{id:`pin`,label:p(z?`sidebarUnpin`:`sidebarPin`),icon:z?(0,q.jsx)(bc,{}):(0,q.jsx)(xc,{}),isDisabled:r||!n,onClick:ie},{id:`read`,label:p(e.unread?`markConversationRead`:`markConversationUnread`),icon:(0,q.jsx)(As,{}),isDisabled:!e.readRevision||!n,onClick:()=>void u()}],...a.length?[{type:`divider`},...a]:[],...t?[]:[{type:`divider`},{id:`fork`,label:R?(0,q.jsxs)(`span`,{className:`sidebar-menu-unavailable`,children:[(0,q.jsx)(`span`,{children:p(`sidebarFork`)}),(0,q.jsx)(`small`,{children:R})]}):p(`sidebarFork`),icon:(0,q.jsx)(Ws,{}),isDisabled:!!R||w,items:[{id:`fork-local`,label:p(w?`forkSessionPending`:e.worktree?`sidebarForkSameWorktree`:`sidebarForkLocal`),icon:(0,q.jsx)(pc,{}),onClick:()=>void se()},...E?.worktree?[{id:`fork-worktree`,label:p(`sidebarForkWorktree`),icon:(0,q.jsx)(Gc,{className:`sidebar-worktree-icon`}),onClick:()=>void se(`worktree`)}]:E===null?[{id:`fork-worktree-loading`,label:p(O?`sidebarForkOptionsFailed`:`sidebarForkOptionsLoading`),isDisabled:!0}]:[]]}],{type:`divider`},{id:`copy`,label:p(`sidebarCopy`),icon:(0,q.jsx)(Ss,{}),items:[{id:`copy-link`,label:p(`sidebarCopyLink`),onClick:()=>void oe(`link`)},{id:`copy-markdown`,label:p(`sidebarCopyMarkdown`),isDisabled:!n,onClick:()=>void oe(`markdown`)},{id:`copy-cwd`,label:p(`sidebarCopyCwd`),isDisabled:!e.cwd,onClick:()=>void oe(`cwd`)}]},{type:`divider`},{id:`new-window`,label:p(`sidebarNewWindow`),icon:(0,q.jsx)(Fc,{}),onClick:()=>{window.open(ne(),`_blank`,`noopener,noreferrer`)}},...e.cwd&&n&&(b==null||b.length>0)?[{id:`open-in`,label:p(`sidebarOpenIn`),icon:(0,q.jsx)(Yo,{}),items:b?.map(t=>({id:t.id,label:t.label,onClick:()=>{o.openSessionIn(e.path,e.id,t.id).catch(()=>f(p(`sidebarOpenFailed`),!0))}}))??[{id:`open-in-loading`,label:p(S?`sidebarAppsFailed`:`sidebarAppsLoading`),isDisabled:!0}]}]:[],{type:`divider`},{id:t?`restore`:`archive`,label:p(i?`restoringConversation`:t?`sidebarRestore`:`sidebarArchive`),icon:t?(0,q.jsx)(Wo,{}):(0,q.jsx)(Go,{}),isDisabled:i||!!L,description:L,onClick:ae},{id:`delete`,label:p(`sidebarDelete`),icon:(0,q.jsx)(Uc,{}),isDisabled:!!L,description:L,onClick:()=>{let t=B();queueMicrotask(()=>{h.current&&(F(!1),j({commandId:crypto.randomUUID(),path:e.path,id:e.id,name:ID(e,p(`untitledSession`)),restoreFocus:t}))})}}];return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`astryx-menu-trigger`,ref:m,children:(0,q.jsx)(yo,{className:`sidebar-action-menu sidebar-conversation-menu`,button:{label:p(`conversationOptions`),icon:(0,q.jsx)(Ds,{}),isIconOnly:!0,size:`sm`,variant:`ghost`,className:`menu-action-button`},items:v?H:[],menuWidth:248,placement:`below`,alignment:`start`,hasChevron:!1,isMenuOpen:v,onOpenChange:y})}),A&&(0,q.jsx)(Se,{isOpen:A!==null,onOpenChange:e=>{e||ce()},purpose:`form`,width:420,"aria-label":p(`sidebarDeleteTitle`),children:(0,q.jsxs)(`form`,{className:`openpi-dialog sidebar-delete-dialog`,onSubmit:e=>{e.preventDefault(),le()},children:[(0,q.jsx)(`strong`,{children:p(`sidebarDeleteTitle`)}),(0,q.jsx)(`p`,{children:p(`sidebarDeleteDescription`,{name:A?.name})}),(P||te)&&(0,q.jsx)(`p`,{className:`sidebar-dialog-error`,role:`alert`,children:p(te?`sessionLinkUnavailable`:`sidebarDeleteFailed`)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,disabled:M,onClick:ce,children:p(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,className:`danger`,disabled:M||!!L||te,children:p(M?`sidebarDeleting`:`sidebarDeleteConfirm`)})]})]})})]})}var bA=e=>JSON.stringify([`session`,e.id,e.path]),xA=e=>JSON.stringify([`message`,e.sessionId,e.sessionPath,e.messageId,e.source,e.lineOffset]);function SA({open:e,initialQuery:t,initialIncludeArchived:n,sessions:r,workspaces:i,onClose:a,onCreateSession:o,onOpenSession:s,onOpenMessage:c}){let{t:l}=W(),u=(0,K.useMemo)(()=>new de,[]),[d,f]=(0,K.useState)(t),p=n,[m,h]=(0,K.useState)(null),[g,_]=(0,K.useState)(!1),[v,y]=(0,K.useState)(0),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(null),[w,T]=(0,K.useState)(null),[E,D]=(0,K.useState)(null),O=(0,K.useRef)(null),k=(0,K.useId)(),A=(0,K.useRef)(null);(0,K.useEffect)(()=>(e&&(f(t),h(null),x(!1),C(null),T(null)),()=>{A.current?.abort(),A.current=null}),[e,t]);let j=d.trim(),M=(0,K.useMemo)(()=>new Map(i?.map(e=>[e.path,e.name])),[i]),N=(0,K.useMemo)(()=>{if(!e||!s)return[];let t=j.toLocaleLowerCase();return(r??[]).filter(e=>e.archived&&!p?!1:!t||`${ID(e,l(`untitledSession`))} ${e.cwd} ${M.get(e.cwd)??``}`.toLocaleLowerCase().includes(t)).sort((e,t)=>t.modified.localeCompare(e.modified)||e.path.localeCompare(t.path))},[e,r,M,j,p,s,l]),P=j?[{name:`transcriptSearchSessions`,sessions:N.slice(0,9)}]:[{name:`pinnedConversations`,sessions:N.filter(e=>e.pinOrder!==void 0).sort((e,t)=>(e.pinOrder??0)-(t.pinOrder??0))},{name:`transcriptSearchRecent`,sessions:N.filter(e=>e.pinOrder===void 0).slice(0,10)}];(0,K.useLayoutEffect)(()=>{A.current?.abort(),A.current=null,T(null),C(null),D(null)},[e,j,p,v]),(0,K.useEffect)(()=>{if(!e||!j){_(!1),x(!1);return}let t=new AbortController;_(!0),x(!1);let n=window.setTimeout(()=>{u.searchTranscripts(j,{includeArchived:p,signal:t.signal}).then(e=>{t.signal.aborted||h({query:j,revision:v,includeArchived:p,response:e})}).catch(()=>{t.signal.aborted||x(!0)}).finally(()=>{t.signal.aborted||_(!1)})},250);return()=>{window.clearTimeout(n),t.abort()}},[u,e,j,p,v]);let F=m?.query===j&&m.revision===v&&m.includeArchived===p?m.response:null,I=[...P.flatMap(e=>e.sessions.map(bA)),...j?F?.matches.map(xA)??[]:[]],ee=E!==null&&I.includes(E)?E:I[0],L=e=>`${k}-${encodeURIComponent(e)}`,R=ee?L(ee):void 0;(0,K.useLayoutEffect)(()=>{e&&R&&document.getElementById(R)?.scrollIntoView?.({block:`nearest`})},[e,R]);let te=async(e,t,n)=>{if(A.current)return;D(e),O.current?.focus({preventScroll:!0});let r=new AbortController;A.current=r,T(e),C(null);try{let e=await t(r.signal);if(r.signal.aborted)return;e===!1?C(n):a()}catch{r.signal.aborted||C(n)}finally{A.current===r&&(A.current=null,T(null))}};return(0,q.jsx)(Se,{isOpen:e,onOpenChange:e=>!e&&a(),purpose:`info`,width:`min(700px, 92vw)`,maxHeight:`calc(var(--transcript-search-list-height) + 64px)`,padding:0,className:`transcript-search-modal`,"aria-label":l(`transcriptSearch`),children:e&&(0,q.jsxs)(`div`,{className:`transcript-search-dialog`,children:[(0,q.jsx)(`h2`,{className:`transcript-search-sr-only`,children:l(`transcriptSearch`)}),(0,q.jsx)(`input`,{ref:O,className:`transcript-search-input`,"data-autofocus":!0,type:`search`,maxLength:200,value:d,"aria-label":l(`transcriptSearch`),"aria-autocomplete":`list`,"aria-controls":k,"aria-activedescendant":R,placeholder:l(`transcriptSearchPlaceholder`),autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,onChange:e=>f(e.target.value),onKeyDown:e=>{if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229||![`ArrowDown`,`ArrowUp`,`Home`,`End`,`Enter`].includes(e.key)||w!==null)return;if(!ee||!R){e.key===`Enter`&&!j&&o&&(e.preventDefault(),a(),o());return}e.preventDefault();let t=I.indexOf(ee);if(e.key===`Enter`){document.getElementById(R)?.click();return}let n=e.key===`Home`?0:e.key===`End`?I.length-1:e.key===`ArrowDown`?Math.min(t+1,I.length-1):Math.max(t-1,0);D(I[n]??null)}}),(0,q.jsx)(`span`,{className:`transcript-search-sr-only`,role:`status`,children:g?l(`transcriptSearching`):null}),(0,q.jsxs)(`div`,{className:`transcript-search-groups`,children:[(0,q.jsx)(`div`,{id:k,role:`listbox`,"aria-label":l(`transcriptSearch`),children:P.filter(e=>e.sessions.length>0||j&&F?.matches.length).map(e=>(0,q.jsxs)(`fieldset`,{"aria-label":l(e.name),children:[(0,q.jsxs)(`h3`,{children:[l(e.name),g&&(0,q.jsx)(rc,{className:`is-spinning`,"aria-hidden":`true`})]}),(0,q.jsxs)(`ul`,{className:`transcript-search-results`,role:`presentation`,children:[s&&e.sessions.map(e=>{let t=ID(e,l(`untitledSession`)),n=bA(e),r=e.ungrouped?l(`ungrouped`):M.get(e.cwd)||LD(e.cwd);return(0,q.jsx)(`li`,{role:`presentation`,children:(0,q.jsxs)(`button`,{id:L(n),role:`option`,"aria-selected":n===ee,tabIndex:-1,type:`button`,disabled:w!==null,"aria-label":l(`transcriptSearchSessionResult`,{session:t}),onPointerMove:()=>D(n),onMouseDown:e=>e.preventDefault(),onClick:()=>void te(n,t=>s(e.path,t),`transcriptSearchSessionOpenFailed`),children:[(0,q.jsx)(`span`,{className:`transcript-search-accessory`,"aria-hidden":`true`,children:w===n?(0,q.jsx)(rc,{className:`is-spinning`}):e.unread?(0,q.jsx)(hs,{className:`transcript-search-unread`}):null}),(0,q.jsx)(`span`,{className:`transcript-search-result-body`,children:(0,q.jsxs)(`span`,{className:`transcript-search-result-line`,children:[(0,q.jsx)(`span`,{className:`transcript-search-title`,title:t,children:t}),(0,q.jsx)(`span`,{className:`transcript-search-project`,title:e.cwd,children:r})]})})]})},n)}),j&&F?.matches.map(e=>{let t=e.sessionName||l(`untitledSession`),n=l(`transcriptSearchSource_${e.source}`),r=xA(e);return(0,q.jsx)(`li`,{role:`presentation`,children:(0,q.jsxs)(`button`,{id:L(r),role:`option`,"aria-selected":r===ee,tabIndex:-1,type:`button`,disabled:w!==null,"aria-label":l(`transcriptSearchResult`,{session:t,source:n}),onPointerMove:()=>D(r),onMouseDown:e=>e.preventDefault(),onClick:()=>void te(r,t=>c({sessionId:e.sessionId,sessionPath:e.sessionPath,entryId:e.messageId},t),`transcriptSearchOpenFailed`),children:[(0,q.jsx)(`span`,{className:`transcript-search-accessory`,"aria-hidden":`true`,children:w===r&&(0,q.jsx)(rc,{className:`is-spinning`})}),(0,q.jsxs)(`span`,{className:`transcript-search-result-body`,children:[(0,q.jsxs)(`span`,{className:`transcript-search-result-line`,children:[(0,q.jsx)(`span`,{className:`transcript-search-title`,title:t,children:t}),(0,q.jsx)(`span`,{className:`transcript-search-project`,title:e.workspace??n,children:e.workspace?M.get(e.workspace)||LD(e.workspace):n})]}),(0,q.jsx)(`span`,{className:`transcript-search-snippet`,children:e.snippet})]})]})},r)})]})]},e.name))}),!j&&!N.length&&(0,q.jsxs)(`div`,{className:`transcript-search-empty-history`,children:[(0,q.jsx)(`p`,{children:l(`noConversations`)}),o&&(0,q.jsx)(`button`,{className:`transcript-search-create`,type:`button`,onClick:()=>{a(),o()},children:l(`newSession`)})]}),j&&!N.length&&!F?.matches.length&&(g?(0,q.jsx)(`div`,{className:`transcript-search-feedback`,"aria-hidden":`true`,children:(0,q.jsx)(rc,{className:`is-spinning`})}):F&&!b?(0,q.jsx)(`div`,{className:`transcript-search-feedback`,role:`status`,children:l(`transcriptSearchEmpty`)}):null),b&&(0,q.jsxs)(`p`,{className:`transcript-search-error`,role:`alert`,children:[l(`transcriptSearchFailed`),(0,q.jsx)(`button`,{type:`button`,onClick:()=>y(e=>e+1),children:l(`transcriptSearchRetry`)})]}),S&&(0,q.jsx)(`p`,{className:`transcript-search-error`,role:`alert`,children:l(S)}),F?.partial&&(0,q.jsx)(`p`,{className:`transcript-search-partial`,children:l(`transcriptSearchPartial`)})]})]})})}function CA({workspace:e,client:t,actions:n,connected:r,onClose:i}){let{t:a}=W(),[o,s]=(0,K.useState)([]),[c,l]=(0,K.useState)(),[u,d]=(0,K.useState)(!1),[f,p]=(0,K.useState)(null),[m,h]=(0,K.useState)(0),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(null),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(!1),w=(0,K.useRef)(0),T=(0,K.useRef)(null),E=(0,K.useRef)(!1),D=(0,K.useRef)(!0),O=(0,K.useCallback)(async n=>{let r=++w.current;d(!0),p(null);try{let i=await t.workspaceWorktrees(e,n);if(!D.current||r!==w.current)return;if(i.truncated&&!i.nextCursor)throw Error(`Missing worktree continuation`);s(e=>{let t=n?[...e]:[];for(let e of i.worktrees)t.some(t=>t.worktreePath===e.worktreePath&&t.sessionId===e.sessionId&&t.sessionPath===e.sessionPath)||t.push(e);return t}),l(i.nextCursor),h(e=>(n?e:0)+i.unavailable)}catch(e){D.current&&r===w.current&&p(e instanceof ge&&e.code===`WORKTREE_LIST_CHANGED`?`changed`:`failed`)}finally{D.current&&r===w.current&&d(!1)}},[t,e]);(0,K.useEffect)(()=>(D.current=!0,O(),()=>{D.current=!1,w.current++}),[O]);let k=async()=>{if(!(!g||E.current||!r)){E.current=!0,C(!0);try{let e=await n.releaseSessionWorktree(g);if(!D.current)return;y(e),x(!1),e.state===`removed`&&s(e=>e.filter(e=>e.worktreePath!==g.worktreePath||e.sessionId!==g.sessionId||e.sessionPath!==g.sessionPath))}catch{D.current&&(x(!0),y(null))}finally{E.current=!1,D.current&&C(!1)}}};(0,K.useEffect)(()=>{g&&!S&&T.current?.focus()},[g,S]);let A=()=>{E.current||i()};return(0,q.jsx)(Se,{isOpen:!0,onOpenChange:e=>{e||A()},purpose:`form`,width:560,"aria-label":a(`managedWorktrees`),children:(0,q.jsxs)(`div`,{className:`openpi-dialog`,children:[(0,q.jsx)(`strong`,{children:a(`managedWorktrees`)}),(0,q.jsx)(`p`,{className:`sidebar-dialog-path`,children:e}),(0,q.jsx)(`p`,{children:a(`managedWorktreesDescription`)}),g?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`sidebar-dialog-path`,children:g.worktreePath}),(0,q.jsx)(`p`,{children:a(`managedWorktreeConfirm`)}),(v||b)&&(0,q.jsxs)(`p`,{role:`status`,className:v?.state===`removed`?void 0:`sidebar-dialog-error`,children:[a(v?.state===`removed`?`managedWorktreeRemoved`:v?.state===`preserved`?`managedWorktreePreserved`:v?.state===`uncertain`?`managedWorktreeUncertainTerminal`:`managedWorktreeUncertain`),v?.reason&&(0,q.jsxs)(q.Fragment,{children:[` `,v.reason]})]}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,ref:T,disabled:S,onClick:()=>{_(null),y(null),x(!1)},children:a(`managedWorktreesBack`)}),v?.state!==`removed`&&v?.state!==`uncertain`&&(0,q.jsx)(`button`,{type:`button`,className:`danger`,disabled:S||!r,onClick:()=>void k(),children:a(S?`managedWorktreeRemoving`:v||b?`managedWorktreesRetry`:`managedWorktreeRemove`)})]})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`managed-worktrees-list`,children:o.map(e=>(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`p`,{className:`sidebar-dialog-path`,children:e.worktreePath}),(0,q.jsx)(`button`,{type:`button`,disabled:!r||u||!!f,onClick:()=>{_(e),y(null),x(!1)},children:a(`managedWorktreeReview`)})]},JSON.stringify([e.worktreePath,e.sessionId,e.sessionPath])))}),!u&&!f&&!o.length&&(0,q.jsx)(`p`,{children:a(`managedWorktreesEmpty`)}),m>0&&(0,q.jsx)(`p`,{children:a(`managedWorktreesUnavailable`,{count:m})}),f&&(0,q.jsx)(`p`,{role:`alert`,children:a(f===`changed`?`managedWorktreesChanged`:`managedWorktreesLoadFailed`)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,onClick:A,children:a(`close`)}),f&&(0,q.jsx)(`button`,{type:`button`,disabled:u||!r,onClick:()=>void O(f===`changed`?void 0:c),children:a(f===`changed`?`managedWorktreesRefresh`:`managedWorktreesRetry`)}),c&&!f&&(0,q.jsx)(`button`,{type:`button`,disabled:u||!r,onClick:()=>void O(c),children:a(`managedWorktreesMore`)}),u&&(0,q.jsx)(`span`,{role:`status`,children:a(`loading`)})]})]})]})})}function wA(e){return e.workspacePath??e.cwd}function TA(e,t,n){return e[t+(n?2:-1)]??null}function EA(e,t,n){return e[t+ +!!n]??null}function DA(e,t){return e>t.top+t.height/2}function OA(e){let t=e.execution?.lastTurn;return JSON.stringify(t?[e.path,e.id,t.commandId,t.finishedAt]:[e.path,e.id])}function kA(e){return e.firstUnread?.type===`turn`?e.firstUnread.finishedAt:e.execution?.lastTurn?.finishedAt??Date.parse(e.modified)}function AA(e){return JSON.stringify([e.path,e.id])}function jA(e,t=!0){return t&&e.execution?.waitingForInput?0:e.unread?1:t&&e.execution?.status===`running`?2:3}function MA({items:e,label:t,alignment:n=`start`}){return(0,q.jsx)(`span`,{className:`astryx-menu-trigger`,children:(0,q.jsx)(yo,{className:`sidebar-action-menu`,button:{label:t,icon:(0,q.jsx)(Ds,{}),isIconOnly:!0,size:`sm`,variant:`ghost`,className:`menu-action-button`},items:e,menuWidth:240,placement:`below`,alignment:n,hasChevron:!1})})}function NA(e){let{t,i18n:n}=W(),[r,i]=(0,K.useState)(null),a=(0,K.useRef)(null),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(!1),[f,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(10),[g,_]=(0,K.useState)(!0),[v,y]=(0,K.useState)(new Set),b=(0,K.useRef)(null),[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(new Set),[k,A]=(0,K.useState)(10),[j,M]=(0,K.useState)(!1),[N,P]=(0,K.useState)(null),[F,I]=(0,K.useState)(!1),ee=(0,K.useRef)(new Set),L=(0,K.useRef)(null),R=(0,K.useRef)(null),te=(0,K.useRef)(e.connected),[z,B]=(0,K.useState)(null),[ne,re]=(0,K.useState)(``),[ie,ae]=(0,K.useState)(!1),oe=(0,K.useRef)(null),se=(0,K.useRef)(null),ce=(0,K.useRef)(null),le=(0,K.useRef)(null),H=(0,K.useRef)(null),fe=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!N)return;let e=window.setTimeout(()=>P(null),5e3);return()=>window.clearTimeout(e)},[N]);let pe=e.snapshot,he=pe?.selectedSession?.path===e.selectedPath?e.selectedPath:null,_e=pe?.sessions.find(e=>e.path===pe.selectedSession?.path&&e.id===pe.selectedSession?.id),ve=OA(_e??{id:``,path:``});(0,K.useLayoutEffect)(()=>{e.selectedPath,L.current=null,R.current=null,M(!1)},[ve,e.selectedPath]),(0,K.useEffect)(()=>{let t=te.current===!1&&e.connected!==!1;if(te.current=e.connected,R.current&&_e?.readRevision&&R.current.revision!==_e.readRevision&&(R.current=null,L.current=ve,M(!1)),!e.sessionViewVisible||!_e||e.selectedPath!==_e.path||L.current===ve||e.connected===!1)return;let n=(t=!1)=>{if(document.visibilityState!==`visible`||!document.hasFocus()||document.querySelector(`dialog[open]`)||L.current===ve)return;if(!_e.unread||!_e.readRevision){L.current=ve,R.current=null;return}if(R.current?.state===`pending`||R.current?.state===`failed`&&!t)return;let n={state:`pending`,revision:_e.readRevision};R.current=n,M(!1),e.actions.setSessionRead(_e.path,_e.id,!0,_e.readRevision).then(()=>{!$e.current||R.current!==n||(R.current=null,L.current=ve)}).catch(()=>{!$e.current||R.current!==n||(n.state=`failed`,M(!0))})},r=()=>n(!0);return n(t),document.addEventListener(`visibilitychange`,r),window.addEventListener(`focus`,r),document.addEventListener(`close`,r,!0),()=>{document.removeEventListener(`visibilitychange`,r),window.removeEventListener(`focus`,r),document.removeEventListener(`close`,r,!0)}},[ve,_e,e.sessionViewVisible,e.selectedPath,e.connected,e.actions]);let ye=(0,K.useMemo)(()=>new de,[]),[be,xe]=(0,K.useState)(!1),[Ce,we]=(0,K.useState)(!1),[Te,Ee]=(0,K.useState)(!1),U=(0,K.useRef)(!1),De=(0,K.useRef)(null),Oe=(0,K.useRef)(!1),[ke,G]=(0,K.useState)(!1),Me=(0,K.useRef)(null),[Ne,Pe]=(0,K.useState)(null),[Fe,Ie]=(0,K.useState)(null),[Le,Re]=(0,K.useState)(!1),[ze,Be]=(0,K.useState)(!1),Ve=pe?.preferences.pinnedSort??`manual`,He=pe?.preferences.sidebarGrouping??`project`,Ue=pe?.preferences.chatsSort??`updated`,We=(pe?.sessions??[]).filter(e=>e.pinOrder!==void 0&&!e.archived).sort((e,t)=>(Ve===`updated`?t.modified.localeCompare(e.modified):0)||e.pinOrder-t.pinOrder).filter(n=>{let r=pe?.workspaces.find(e=>e.path===wA(n));return`${ID(n,t(`untitledSession`))} ${n.cwd} ${r?.name??``}`.toLowerCase().includes(e.query.trim().toLowerCase())}),Ge=async e=>{if(!U.current){U.current=!0,Ee(!0),Be(!1);try{await e()}catch{Be(!0)}finally{U.current=!1,Ee(!1)}}},Ke=(t,n,r)=>Ge(()=>e.actions.setSessionPin(t.path,t.id,n,r)),qe=(t,n,r)=>Ge(()=>e.actions.setSidebarPin(t,n,r)),Je=t=>Ge(async()=>{await ye.savePreferences(t),await e.actions.refreshSnapshot()}),Ye=async(t,n)=>{if(!t.readRevision)return;let r=OA(t);if(!ee.current.has(r)){t.path===e.selectedPath&&(R.current=null,L.current=r),ee.current.add(r),M(!1);try{await e.actions.setSessionRead(t.path,t.id,n,t.readRevision)}catch{M(!0)}finally{ee.current.delete(r)}}},Xe=e.query.trim(),Ze=JSON.stringify([be,Xe]),Qe=(0,K.useRef)({key:Ze});Qe.current.key!==Ze&&(Qe.current={key:Ze});let $e=(0,K.useRef)(!1),[et,tt]=(0,K.useState)(null),[nt,rt]=(0,K.useState)(!1),[it,at]=(0,K.useState)(null),ot=(0,K.useRef)(null),st=et?.query===Xe?et:null,ct=it?.query===Xe?it:null,lt=(0,K.useCallback)(async(e,t)=>{if(!be)return;ot.current?.abort();let n=new AbortController;ot.current=n,rt(!0),at(null);try{let r=await ye.listArchivedSessions({query:Xe,...e?{cursor:e}:{},limit:25},n.signal);if(n.signal.aborted||ot.current!==n)return;let i=[...r.sessions];for(;!e&&t!==void 0&&i.length!i.some(t=>t.path===e.path));if(i.push(...e),!e.length)break}tt(t=>({...r,query:Xe,sessions:e&&t?.query===Xe?[...t.sessions,...i.filter(e=>!t.sessions.some(t=>t.path===e.path))]:i}))}catch(r){!n.signal.aborted&&ot.current===n&&at({query:Xe,kind:r instanceof ge&&r.code===`ARCHIVED_SESSION_CURSOR_STALE`?`stale`:`failed`,...e?{cursor:e}:{},...t===void 0?{}:{retainedCount:t}})}finally{ot.current===n&&(ot.current=null,rt(!1))}},[Xe,be,ye]),[ut,dt]=(0,K.useState)(new Set),[ft,pt]=(0,K.useState)(new Set),mt=(0,K.useRef)(new Set),[ht,gt]=(0,K.useState)(!1),[_t,vt]=(0,K.useState)(!1),yt=(0,K.useRef)(!1),[bt,xt]=(0,K.useState)(!1),St=(0,K.useRef)(!1),[Ct,wt]=(0,K.useState)(!1),[Tt,Et]=(0,K.useState)(!1),Dt=(0,K.useRef)(!1),Ot=async t=>{if(mt.current.has(t))return;mt.current.add(t),pt(new Set(mt.current)),gt(!1);let n=Qe.current;try{let r=await e.actions.unarchiveSession(t);if(!$e.current||Qe.current!==n)return;r?(tt(e=>e?{...e,sessions:e.sessions.filter(e=>e.path!==t)}:null),await lt()):gt(!0)}finally{mt.current.delete(t),$e.current&&pt(new Set(mt.current))}};(0,K.useEffect)(()=>($e.current=!0,()=>{$e.current=!1}),[]),(0,K.useEffect)(()=>(gt(!1),at(null),be&&(tt(e=>e?.query===Xe?e:null),lt()),()=>{ot.current?.abort(),ot.current=null}),[Xe,be,lt]),(0,K.useEffect)(()=>{if(e.searchOpen)return oe.current?.focus(),()=>se.current?.focus()},[e.searchOpen]),(0,K.useEffect)(()=>{if(e.mobileOpen)return H.current?.focus(),()=>{let t=e.returnFocusRef?.current;t?.checkVisibility()&&t.focus()}},[e.mobileOpen,e.returnFocusRef]),(0,K.useEffect)(()=>{e.mobileOpen&&document.activeElement===document.body&&!document.querySelector(`dialog:modal`)&&H.current?.focus()}),(0,K.useEffect)(()=>{c&&(ce.current?.focus(),ce.current?.select())},[c]);let kt=(0,K.useMemo)(()=>{let n=e.query.trim().toLowerCase(),r=be?st?.sessions??[]:pe?.sessions??[],i=(e,i)=>r.filter(r=>!!r.archived===be&&(be||r.pinOrder===void 0)&&(e===`__ungrouped__`?r.ungrouped:wA(r)===e&&!r.ungrouped)&&(!n||be||i||`${ID(r,t(`untitledSession`))} ${r.cwd}`.toLowerCase().includes(n))),a=[...pe?.workspaces??[]];for(let e of r)!e.ungrouped&&!a.some(t=>t.path===wA(e))&&a.push({path:wA(e),name:wA(e),current:!1});return[...a.map(e=>{let t=!!n&&`${e.name} ${e.path}`.toLowerCase().includes(n);return{...e,showPath:a.some(t=>t.path!==e.path&&t.name===e.name),sessions:i(e.path,t),ungrouped:!1,matches:t}}),{path:`__ungrouped__`,name:t(`ungrouped`),current:!1,sessions:i(`__ungrouped__`,!1),ungrouped:!0,pinOrder:void 0,showPath:!1,matches:!1}].filter(e=>e.sessions.length>0||!be&&!e.ungrouped&&(!n||e.matches))},[be,e.query,st,pe,t]),At=e=>[...e].sort((e,t)=>(Ue===`manual`?(e.order??2**53-1)-(t.order??2**53-1):0)||t.modified.localeCompare(e.modified)||e.path.localeCompare(t.path)),jt=(e,t)=>{if(e.length<=t+1)return e;let n=e.slice(0,t),r=e.find(e=>e.path===he&&e.id===pe?.selectedSession?.id);return r&&!n.includes(r)&&n.push(r),n},Mt=kt.filter(e=>!e.ungrouped),Nt=Mt.filter(e=>e.pinOrder!==void 0),Pt=[...We.map(e=>({kind:`session`,session:e,pinOrder:e.pinOrder})),...Nt.map(e=>({kind:`workspace`,project:e,pinOrder:e.pinOrder}))].sort((e,t)=>{let n=e=>e.kind===`session`?e.session.modified:e.project.sessions.reduce((e,t)=>t.modified>e?t.modified:e,``);return(Ve===`updated`?n(t).localeCompare(n(e)):0)||e.pinOrder-t.pinOrder}),Ft=e=>e.kind===`session`?{kind:`session`,path:e.session.path,id:e.session.id}:{kind:`workspace`,path:e.project.path},It=Mt.filter(e=>e.pinOrder===void 0),Lt=x||e.query.trim()||be||It.length<=6?It:It.slice(0,5),Rt=It.find(e=>_e?.path===he&&e.path===(_e?wA(_e):void 0));Rt&&!Lt.includes(Rt)&&Lt.push(Rt);let zt=At((pe?.sessions??[]).filter(n=>!n.archived&&n.pinOrder===void 0&&!pe?.workspaces.some(e=>e.pinOrder!==void 0&&e.path===wA(n))&&(He===`list`||pe?.preferences.projectsInRecents!==!1||n.ungrouped||!Mt.some(e=>e.path===wA(n)))&&(!e.query.trim()||`${ID(n,t(`untitledSession`))} ${n.cwd} ${pe?.workspaces.find(e=>e.path===wA(n))?.name??``}`.toLowerCase().includes(e.query.trim().toLowerCase())))),Bt=e.query.trim()?zt:jt(zt,k),Vt=t=>jA(t,e.connected)<3,Ht=new Date;Ht.setHours(0,0,0,0),Ht.setDate(Ht.getDate()-6);let Ut=(pe?.sessions??[]).filter(e=>!e.archived&&(Vt(e)||v.has(AA(e))||[`completed`,`failed`].includes(e.execution?.lastTurn?.outcome??``)&&(e.execution?.lastTurn?.finishedAt??0)>=Ht.getTime())),Wt=new Map([...v].map((e,t)=>[e,t])),Gt=Ut.filter(e=>Vt(e)||v.has(AA(e))).sort((t,n)=>(Wt.get(AA(t))??1/0)-(Wt.get(AA(n))??1/0)||jA(t,e.connected)-jA(n,e.connected)||n.modified.localeCompare(t.modified)),Kt=new Set(Gt.map(e=>e.path)),qt=Ut.filter(e=>!g||!Kt.has(e.path)).sort((e,t)=>kA(t)-kA(e)),Jt=g?Gt.slice(0,m):[],Yt=qt.slice(0,Math.max(0,m-Jt.length)),Xt=Ut.length>Jt.length+Yt.length;(0,K.useEffect)(()=>{let e=fe.current;if(!f||!Xt||!e||typeof IntersectionObserver>`u`)return;let t=new IntersectionObserver(([e])=>{e?.isIntersecting&&(t.disconnect(),h(m+10))},{root:e.closest(`.sidebar-navigation`)});return t.observe(e),()=>t.disconnect()},[f,Xt,m]),(0,K.useEffect)(()=>{if(!f){b.current=null,y(e=>e.size?new Set:e),h(10);return}let t=b.current??{openedAt:Date.now(),sessions:new Set((pe?.sessions??[]).map(AA))},n=(pe?.sessions??[]).filter(t=>!t.archived&&jA(t,e.connected)<3).sort((t,n)=>jA(t,e.connected)-jA(n,e.connected)||n.modified.localeCompare(t.modified)),r=n.filter(e=>!t.sessions.has(AA(e))&&Date.parse(e.created)>=t.openedAt);for(let e of pe?.sessions??[])t.sessions.add(AA(e));b.current=t,y(e=>{let t=new Set([...r.map(AA),...e,...n.map(AA)]);return t.size===e.size?e:t})},[f,pe?.sessions,e.connected]);let Zt=(pe?.sessions??[]).filter(e=>!e.archived&&e.unread),Qt=Zt.filter(e=>e.readRevision),$t=g?Gt.filter(e=>e.unread&&e.readRevision):[],en=async e=>{if(!F){I(!0);try{await Promise.all(e.map(e=>Ye(e,!0)))}finally{I(!1)}}},tn=he?_e?wA(_e):pe?.selectedSession?.cwd:null,nn=!!(pe?.truncation.sessionsOmitted||pe?.truncation.workspacesOmitted),rn=e=>{yt.current||(re(e.name),ae(!1),l(e))},an=async()=>{let t=ne.trim();if(!c||!t||t===c.name||yt.current)return;let n=c,r=Qe.current,i=st?.sessions.length??25;yt.current=!0,vt(!0),ae(!1);try{if(n.kind===`workspace`?await e.actions.renameWorkspace(n.path,t):await e.actions.renameSession(n.path,t),!$e.current)return;l(null),n.kind===`session`&&be&&Qe.current===r&<(void 0,i)}catch{$e.current&&ae(!0)}finally{yt.current=!1,$e.current&&vt(!1)}},on=async()=>{if(!z||St.current)return;let t=z;St.current=!0,xt(!0),wt(!1);try{let n=await e.actions.removeWorkspace(t.path);if(!$e.current)return;n?B(null):wt(!0)}catch{$e.current&&wt(!0)}finally{St.current=!1,$e.current&&xt(!1)}},sn=async t=>{if(Dt.current)return;let n=Qe.current;Dt.current=!0,Et(!0);try{if(!t){await e.actions.chooseWorkspace();return}let r=await e.actions.createSession(t);if(!$e.current||Qe.current!==n||!r?.sessionId||!r.sessionPath||r.workspacePath!==t)return;xe(!1),p(!1),e.actions.setQuery(``)}catch{}finally{Dt.current=!1,$e.current&&Et(!1)}},cn=(0,K.useCallback)(()=>{(De.current||Me.current)&&(Oe.current=!0),De.current=null,Me.current=null,G(!1),Ie(null),Pe(null)},[]);(0,K.useEffect)(()=>{let e=e=>{e.key!==`Escape`||!De.current&&!Me.current||(e.preventDefault(),cn())},t=()=>{(De.current||Me.current)&&cn()};return window.addEventListener(`keydown`,e,!0),window.addEventListener(`blur`,t),()=>{window.removeEventListener(`keydown`,e,!0),window.removeEventListener(`blur`,t)}},[cn]);let ln=(e,t)=>{let n=Pt[e];if(!n)return;let r=TA(Pt,e,t);qe(Ft(n),!0,r?Ft(r):null)},un=e=>Ve===`manual`?[{id:`move-up`,label:t(`movePinUp`),icon:(0,q.jsx)(Xo,{}),isDisabled:Te||e<=0,onClick:()=>ln(e,!1)},{id:`move-down`,label:t(`movePinDown`),icon:(0,q.jsx)(ue,{}),isDisabled:Te||e===Pt.length-1,onClick:()=>ln(e,!0)}]:[],dn=[{id:`updated`,label:t(`pinnedRecentlyUpdated`),endContent:Ue===`updated`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({chatsSort:`updated`})},{id:`manual`,label:t(`pinnedManualOrder`),endContent:Ue===`manual`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({chatsSort:`manual`})}],fn=[{id:`updated`,label:t(`pinnedRecentlyUpdated`),endContent:Ve===`updated`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({pinnedSort:`updated`})},{id:`manual`,label:t(`pinnedManualOrder`),endContent:Ve===`manual`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({pinnedSort:`manual`})}],pn=[{label:t(`sidebarGroupBy`),items:[{label:t(`sidebarByProject`),endContent:He===`project`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({sidebarGrouping:`project`})},{label:t(`sidebarFlatList`),endContent:He===`list`?(0,q.jsx)(rs,{size:16}):void 0,isDisabled:Te,onClick:()=>void Je({sidebarGrouping:`list`})}]},{label:t(`sidebarChatSort`),items:dn}],mn=[...pn,...He===`project`?[{label:t(`sidebarShow`),items:[{label:t(`sidebarProjectsInRecents`),endContent:pe?.preferences.projectsInRecents===!1?void 0:(0,q.jsx)(rs,{size:16}),isDisabled:Te,onClick:()=>void Je({projectsInRecents:pe?.preferences.projectsInRecents===!1})}]}]:[]],hn=(0,q.jsxs)(`div`,{className:`sidebar-section-actions is-always-visible`,children:[(0,q.jsx)(MA,{label:t(`sidebarActivityOptions`),items:[{type:`section`,title:t(`sidebarShow`),items:[{label:t(`sidebarPriority`),endContent:g?(0,q.jsx)(rs,{size:16}):void 0,onClick:()=>_(e=>!e)}]},{type:`divider`},{label:t(`sidebarMarkAllRead`),icon:(0,q.jsx)(ic,{}),isDisabled:F||!$t.length,onClick:()=>void en($t)}]}),g&&Gt.some(e=>!Vt(e))&&(0,q.jsx)(V,{content:t(`sidebarClearRead`),children:(0,q.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":t(`sidebarClearRead`),onClick:()=>y(new Set(Gt.filter(Vt).map(AA))),children:(0,q.jsx)(es,{"aria-hidden":`true`})})})]}),gn=(a,o=!1,s)=>{let c=JSON.stringify([a.path,a.id,o,s?.key]),l=Pt.findIndex(e=>e.kind===`session`&&e.session.path===a.path&&e.session.id===a.id),u={kind:`session`,path:a.path,id:a.id},d=a.pinOrder!==void 0,p=e.connected!==!1&&a.execution?.status===`running`,m=e.connected!==!1&&a.execution?.waitingForInput,h=a.firstUnread?.type===`turn`?a.firstUnread.outcome:a.execution?.lastTurn?.outcome,g=m?`attention`:p?`running`:a.unread?h===`failed`?`attention`:h===`completed`?`completed`:`unread`:void 0,_=g===`running`?rc:g===`attention`?ls:hs,v=e.connected===!1?0:a.execution?.pendingFollowUps??0,y=a.path===he&&a.id===pe?.selectedSession?.id,b=g===`attention`?m?`waiting`:`failed`:g===`running`&&a.execution?.compacting?`compacting`:g,x=[...b?[t(`sidebarState_`+b)]:[],...v>0?[t(`pendingFollowUpsHint`,{count:v})]:[]].join(` · `),S=s?.sessions.findIndex(e=>e.path===a.path&&e.id===a.id)??-1,C=!be&&!o&&Ue===`manual`&&!!s,w=t=>Ge(()=>e.actions.setSessionOrder(a.path,a.id,t?{path:t.path,id:t.id}:null)),T=o?un(l):C&&s?[{id:`move-up`,label:t(`movePinUp`),icon:(0,q.jsx)(Xo,{}),isDisabled:Te||S<=0,onClick:()=>void w(TA(s.sessions,S,!1))},{id:`move-down`,label:t(`movePinDown`),icon:(0,q.jsx)(ue,{}),isDisabled:Te||S===s.sessions.length-1,onClick:()=>void w(TA(s.sessions,S,!0))}]:[];return(0,q.jsxs)(`li`,{className:`session-row `+(a.unread?`is-unread `:``)+(Fe===a.path?Le?`is-pin-drop-after`:`is-pin-drop-target`:``),"aria-label":ID(a,t(`untitledSession`)),"data-session-key":JSON.stringify([a.path,a.id]),"data-dragging":ke&&(De.current?.kind===`session`&&De.current.path===a.path&&De.current.id===a.id||Me.current?.path===a.path&&Me.current.id===a.id)||void 0,draggable:!Te&&!e.query.trim()&&(o?Ve===`manual`:C),onDragStart:e=>{if(e.stopPropagation(),o&&Ve===`manual`)De.current=u;else if(C&&s)Me.current={path:a.path,id:a.id,scope:s.key};else{e.preventDefault();return}G(!0),Oe.current=!0,e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,a.id)},onDragOver:e=>{if(!(o&&Ve===`manual`&&De.current)&&!(C&&Me.current?.scope===s?.key))return;e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`move`,Ie(a.path),Pe(null);let t=e.currentTarget.getBoundingClientRect();Re(DA(e.clientY,t))},onDragEnd:cn,onDrop:t=>{let n=t.currentTarget.getBoundingClientRect(),r=DA(t.clientY,n);if(o&&Ve===`manual`&&De.current){t.preventDefault(),t.stopPropagation();let e=Pt[l+1];qe(De.current,!0,r?e?Ft(e):null:u)}else if(C&&s&&Me.current?.scope===s.key){t.preventDefault(),t.stopPropagation();let n=Me.current,i=EA(s.sessions,S,r);Ge(()=>e.actions.setSessionOrder(n.path,n.id,i?{path:i.path,id:i.id}:null))}else return;cn()},children:[(0,q.jsx)(V,{placement:`end`,delay:450,onOpenChange:e=>i(t=>e?c:t===c?null:t),content:r===c?(0,q.jsxs)(`span`,{className:`session-hover-preview`,children:[(0,q.jsx)(`strong`,{children:ID(a,t(`untitledSession`))}),a.name&&a.firstMessage&&a.firstMessage!==`(no messages)`&&a.firstMessage!==a.name&&(0,q.jsx)(`span`,{children:a.firstMessage}),(0,q.jsx)(`time`,{dateTime:a.modified,children:new Date(a.modified).toLocaleString(n.resolvedLanguage,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})})]}):null,children:(0,q.jsxs)(`button`,{className:`session `+(y?`active`:``),type:`button`,"aria-current":y?`page`:void 0,"aria-label":[ID(a,t(`untitledSession`)),a.path,x].filter(Boolean).join(` · `),onClick:()=>{y&&a.unread&&e.sessionViewVisible&&e.connected!==!1&&Ye(a,!0),e.actions.selectSession(a.path)},onDoubleClick:n=>{y&&e.connected!==!1&&n.target instanceof Element&&n.target.closest(`.session-title`)&&rn({kind:`session`,path:a.path,name:ID(a,t(`untitledSession`))})},children:[(0,q.jsxs)(`span`,{className:`session-copy`,children:[(0,q.jsx)(`span`,{className:`session-title`,children:ID(a,t(`untitledSession`))}),f&&(0,q.jsxs)(`span`,{className:`session-project`,children:[(0,q.jsx)(Vs,{"aria-hidden":`true`}),pe?.workspaces.find(e=>e.path===wA(a))?.name??RD(wA(a))]})]}),x&&(0,q.jsx)(V,{content:x,children:(0,q.jsxs)(`span`,{className:`session-status`,"aria-hidden":`true`,children:[g&&(0,q.jsx)(_,{className:`session-state session-state-`+g}),v>0&&(0,q.jsxs)(`span`,{className:`session-queue`,children:[(0,q.jsx)(ec,{}),(0,q.jsx)(`span`,{children:v>99?`99+`:v})]})]})})]})}),!be&&(0,q.jsx)(V,{content:t(d?`unpinConversation`:`pinConversation`),children:(0,q.jsx)(`button`,{type:`button`,className:`session-pin-button`,"aria-label":t(d?`unpinConversation`:`pinConversation`),disabled:Te,onClick:e=>{let t=vA(e.currentTarget);Ke(a,!d).finally(t)},children:(0,q.jsx)(xc,{"aria-hidden":`true`,fill:d?`currentColor`:`none`})})}),(0,q.jsx)(yA,{session:a,archived:be,connected:e.connected!==!1,pinSaving:Te,restoring:ft.has(a.path),movementItems:T,client:ye,actions:e.actions,onRename:()=>rn({kind:`session`,path:a.path,name:ID(a,t(`untitledSession`))}),onPin:()=>Ke(a,!d),onRead:()=>Ye(a,!!a.unread),onArchive:()=>be?Ot(a.path):e.actions.archiveSession(a.path),onNotice:(e,t=!1)=>P({message:e,error:t})})]},a.path)},_n=(n,r=!1)=>{let i=(be?ut:e.collapsed).has(n.path)&&!e.query.trim(),o=!n.ungrouped&&tn===n.path,c=Pt.findIndex(e=>e.kind===`workspace`&&e.project.path===n.path),l=It.findIndex(e=>e.path===n.path),u=!be&&!n.ungrouped&&!Te&&!e.query.trim(),d=t=>Ge(()=>e.actions.setWorkspaceOrder(n.path,TA(It,l,t)?.path??null)),f={kind:`workspace`,path:n.path},p=At(n.sessions),m=Qt.filter(e=>!e.ungrouped&&wA(e)===n.path),h=be||!!e.query.trim()||D.has(n.path)||p.length<=6,g=[...be?[]:[{id:`pin`,label:t(r?`unpinWorkspace`:`pinWorkspace`),icon:(0,q.jsx)(xc,{}),isDisabled:Te,onClick:()=>void qe(f,!r)},{id:`mark-read`,label:t(`sidebarMarkAllRead`),icon:(0,q.jsx)(ic,{}),isDisabled:F||!m.length,onClick:()=>void en(m)}],...r?un(c):be?[]:[{id:`move-up`,label:t(`movePinUp`),icon:(0,q.jsx)(Xo,{}),isDisabled:!u||l<=0,onClick:()=>void d(!1)},{id:`move-down`,label:t(`movePinDown`),icon:(0,q.jsx)(ue,{}),isDisabled:!u||l===It.length-1,onClick:()=>void d(!0)}],...n.ungrouped?[]:[{id:`managed-worktrees`,label:t(`managedWorktrees`),icon:(0,q.jsx)(Vs,{}),isDisabled:e.connected===!1,onClick:()=>{let e=Array.from(le.current?.querySelectorAll(`.workspace-group`)??[]).find(e=>e.dataset.workspaceKey===n.path);a.current=vA(e?.querySelector(`.workspace-row-actions .menu-action-button`)??null),queueMicrotask(()=>s(n.path))}}],{id:`rename`,label:t(`renameWorkspace`),icon:(0,q.jsx)(Ic,{}),onClick:()=>rn({kind:`workspace`,path:n.path,name:n.name})},{id:`remove`,label:t(`removeWorkspace`),icon:(0,q.jsx)(Uc,{}),variant:`destructive`,onClick:()=>{wt(!1),B({path:n.path,name:n.name})}}];return(0,q.jsxs)(`section`,{className:`workspace-group `+(i?`collapsed `:``)+(o?`is-active-workspace `:``)+(Ne===n.path?Le?`is-pin-drop-after`:`is-pin-drop-target`:``),"data-workspace-key":n.path,"aria-label":n.name,onDragOver:e=>{if(!u||!De.current||(r?Ve!==`manual`:De.current.kind!==`workspace`))return;e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`move`,Pe(n.path),Ie(null);let t=e.currentTarget.getBoundingClientRect();Re(DA(e.clientY,t))},onDragEnd:cn,onDragLeave:e=>{(!(e.relatedTarget instanceof Node)||!e.currentTarget.contains(e.relatedTarget))&&Pe(null)},onDrop:t=>{if(!u||!De.current||(r?Ve!==`manual`:De.current.kind!==`workspace`))return;t.preventDefault(),t.stopPropagation();let i=t.currentTarget.getBoundingClientRect(),a=DA(t.clientY,i),o=De.current;if(o.kind!==`workspace`||o.path!==n.path)if(r){let e=Pt[c+1];qe(o,!0,a?e?Ft(e):null:f)}else Ge(()=>e.actions.setWorkspaceOrder(o.path,a?It[l+1]?.path??null:n.path));cn()},children:[(0,q.jsxs)(`div`,{className:`workspace-button`,draggable:u&&(!r||Ve===`manual`),onDragStart:e=>{if(!u||r&&Ve!==`manual`||e.target instanceof Element&&e.target.closest(`.workspace-row-actions`)){e.preventDefault();return}De.current=f,requestAnimationFrame(()=>{$e.current&&De.current===f&&G(!0)}),Oe.current=!0,e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,n.path)},children:[(0,q.jsxs)(`button`,{className:`workspace-label`,type:`button`,"aria-expanded":!i,"aria-current":o?`location`:void 0,disabled:!!e.query.trim(),title:n.ungrouped?void 0:n.path,onClick:()=>{be?dt(e=>{let t=new Set(e);return t.has(n.path)?t.delete(n.path):t.add(n.path),t}):e.actions.toggleWorkspace(n.path)},children:[(0,q.jsx)(`span`,{className:`workspace-toggle`,"aria-hidden":`true`,children:i?(0,q.jsx)(Vs,{className:`workspace-folder`}):(0,q.jsx)(zs,{className:`workspace-folder`})}),(0,q.jsxs)(`span`,{className:`workspace-identity`,children:[(0,q.jsx)(`strong`,{children:n.name}),n.showPath&&(0,q.jsx)(`small`,{children:RD(n.path)})]})]}),!n.ungrouped&&(0,q.jsxs)(`span`,{className:`workspace-row-actions`,children:[(0,q.jsx)(MA,{label:t(`workspaceOptions`),items:g}),(0,q.jsx)(V,{content:t(`newSession`),children:(0,q.jsx)(`button`,{className:`workspace-action`,type:`button`,"aria-label":t(`newSession`)+` `+n.name,disabled:Tt,"aria-busy":Tt||void 0,onClick:()=>void sn(n.path),children:(0,q.jsx)(Ic,{})})})]})]}),!i&&!p.length&&!be&&!e.query.trim()&&!nn&&(0,q.jsx)(`p`,{className:`workspace-empty`,children:t(`noConversations`)}),!i&&p.length>0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`ul`,{className:`workspace-sessions`,children:(h?p:jt(p,5)).map(e=>gn(e,!1,{key:n.path,sessions:p}))}),!be&&!e.query.trim()&&p.length>6&&(0,q.jsx)(`button`,{className:`sidebar-show-more is-indented`,type:`button`,"aria-expanded":D.has(n.path),onClick:()=>O(e=>{let t=new Set(e);return t.has(n.path)?t.delete(n.path):t.add(n.path),t}),children:t(D.has(n.path)?`sidebarShowLess`:`sidebarShowMore`)})]})]},n.path)},vn=new Map,yn=new Date,bn=new Date(yn);bn.setDate(yn.getDate()-1);for(let e of Yt){let n=new Date(kA(e)),r=n.toDateString()===yn.toDateString()?t(`sidebarToday`):n.toDateString()===bn.toDateString()?t(`sidebarYesterday`):Number.isFinite(n.getTime())?n.toLocaleDateString(void 0,{weekday:`long`}):t(`sidebarEarlier`);vn.set(r,[...vn.get(r)??[],e])}return(0,q.jsxs)(`div`,{ref:le,id:`session-sidebar`,className:`session-sidebar`,role:e.mobileOpen?`dialog`:`complementary`,"aria-modal":e.mobileOpen||void 0,"aria-label":`Session navigation`,tabIndex:e.mobileOpen?-1:void 0,onPointerDownCapture:()=>{!De.current&&!Me.current&&(Oe.current=!1)},onClickCapture:e=>{e.detail!==0&&Oe.current&&(e.preventDefault(),e.stopPropagation(),Oe.current=!1)},onKeyDown:t=>{if(!e.mobileOpen||t.defaultPrevented||t.target instanceof Element&&(t.target.closest(`dialog`)||t.key!==`Tab`&&t.target.closest(`[role="menu"]`))||t.key===`Escape`&&le.current?.querySelector(`[aria-haspopup="menu"][aria-expanded="true"]`)||(t.key===`Escape`&&!t.nativeEvent.isComposing&&(t.preventDefault(),e.actions.closeMobileSidebar()),t.key!==`Tab`))return;let n=Array.from(le.current?.querySelectorAll(`button, input, select, textarea, a[href], [tabindex]`)??[]).filter(e=>e.tabIndex>=0&&!e.matches(`:disabled`)&&e.checkVisibility({visibilityProperty:!0})),r=t.shiftKey?n.at(-1):n[0],i=t.shiftKey?n[0]:n.at(-1);(document.activeElement===le.current||document.activeElement===i)&&(t.preventDefault(),r?.focus())},children:[(0,q.jsxs)(`div`,{className:`sidebar-brand`,children:[(0,q.jsx)(`span`,{className:`sidebar-brand-title`,children:`OpenPI`}),(0,q.jsxs)(`div`,{className:`sidebar-header-actions`,children:[(0,q.jsx)(V,{content:t(f?`sidebarViewChats`:`sidebarViewActivity`),children:(0,q.jsxs)(`button`,{className:`icon-button sidebar-activity-toggle`,type:`button`,"aria-label":t(f?`sidebarViewChats`:`sidebarViewActivity`),"aria-pressed":f,onClick:()=>{xe(!1),p(e=>!e)},children:[(0,q.jsx)(Zo,{"aria-hidden":`true`}),Zt.length>0&&(0,q.jsx)(`span`,{className:`sidebar-unread-dot`})]})}),(0,q.jsx)(V,{content:t(`searchConversations`),children:(0,q.jsx)(`button`,{ref:se,className:`icon-button`,type:`button`,"aria-label":t(`searchConversations`),onClick:()=>d(!0),children:(0,q.jsx)(Dc,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:t(`collapseSidebar`),placement:`end`,children:(0,q.jsx)(`button`,{ref:H,className:`collapse-button sidebar-mobile-close`,type:`button`,"aria-label":t(`collapseSidebar`),onClick:()=>e.mobileOpen?e.actions.closeMobileSidebar():e.actions.toggleSidebar(!1),children:(0,q.jsx)(hc,{})})})]})]}),(0,q.jsx)(V,{content:t(`newSession`),placement:`end`,children:(0,q.jsxs)(`button`,{className:`new-session-button`,type:`button`,"aria-label":t(`newSession`),disabled:Tt,"aria-busy":Tt||void 0,onClick:()=>void sn(e.selectedWorkspace),children:[Tt?(0,q.jsx)(rc,{className:`new-session-spinner`}):(0,q.jsx)(Ae,{}),(0,q.jsx)(`span`,{children:t(`newSession`)})]})}),(0,q.jsx)(SA,{open:u,initialQuery:e.query,initialIncludeArchived:be,sessions:pe?.sessions??[],workspaces:pe?.workspaces??[],onClose:()=>d(!1),onOpenMessage:e.actions.navigateToMessage,onOpenSession:t=>e.actions.selectSession(t),onCreateSession:()=>void sn(e.selectedWorkspace)}),(0,q.jsxs)(`div`,{className:`sidebar-navigation`,children:[N&&(0,q.jsx)(`p`,{className:`sidebar-scope-note sidebar-action-feedback`,role:N.error?`alert`:`status`,children:N.message}),ze&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,role:`alert`,children:t(`sidebarSaveFailed`)}),j&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,role:`alert`,children:t(`sidebarReadFailed`)}),f?(0,q.jsxs)(`section`,{className:`sidebar-activity`,"aria-label":t(`sidebarActivity`),children:[g&&(0,q.jsxs)(`section`,{"aria-label":t(`sidebarPriority`),children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsx)(`h2`,{className:`sidebar-section-label`,children:t(`sidebarPriority`)}),hn]}),(0,q.jsx)(`ul`,{className:`sidebar-activity-sessions`,children:Jt.map(e=>gn(e))}),!Jt.length&&(0,q.jsx)(`p`,{className:`sidebar-activity-empty`,children:t(`sidebarActivityEmpty`)})]}),[...vn].map(([e,t],n)=>(0,q.jsxs)(`section`,{"aria-label":e,children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsx)(`h2`,{className:`sidebar-section-label`,children:e}),!g&&n===0&&hn]}),(0,q.jsx)(`ul`,{className:`sidebar-activity-sessions`,children:t.map(e=>gn(e))})]},e)),!g&&!vn.size&&(0,q.jsxs)(`section`,{"aria-label":t(`sidebarToday`),children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsx)(`h2`,{className:`sidebar-section-label`,children:t(`sidebarToday`)}),hn]}),(0,q.jsx)(`p`,{className:`sidebar-activity-empty`,children:t(`sidebarActivityEmpty`)})]}),Xt&&(0,q.jsx)(`div`,{ref:fe,className:`sidebar-activity-tail`,role:`status`,"aria-label":t(`loading`),children:(0,q.jsx)(rc,{"aria-hidden":`true`})})]}):(0,q.jsxs)(q.Fragment,{children:[!be&&(Pt.length>0||ke&&De.current&&Ve===`manual`)&&(0,q.jsxs)(`section`,{className:`pinned-section `+(Ne===`pinned-tail`?`is-pin-drop-after`:``),"aria-label":t(`pinnedConversations`),onDragOver:t=>{Te||Ve!==`manual`||!De.current||e.query.trim()||(t.preventDefault(),t.dataTransfer.dropEffect=`move`,Pe(`pinned-tail`),Ie(null))},onDragLeave:e=>{(!(e.relatedTarget instanceof Node)||!e.currentTarget.contains(e.relatedTarget))&&Pe(null)},onDrop:t=>{Te||Ve!==`manual`||!De.current||e.query.trim()||(t.preventDefault(),t.stopPropagation(),qe(De.current,!0,null),cn())},children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`workspace-heading-label`,"aria-expanded":!Ce||!!e.query.trim(),onClick:()=>we(e=>!e),children:[t(`pinnedConversations`),(0,q.jsx)(is,{className:Ce&&!e.query.trim()?`is-collapsed`:``,"aria-hidden":`true`})]}),(0,q.jsx)(`div`,{className:`sidebar-section-actions`,children:(0,q.jsx)(MA,{label:t(`pinnedOptions`),items:fn,alignment:`end`})})]}),ke&&Ve===`manual`&&(Pt.length===0||Ce)&&(0,q.jsx)(`p`,{className:`sidebar-drop-hint`,children:t(`sidebarDropPin`)}),(!Ce||!!e.query.trim())&&(0,q.jsx)(`ul`,{className:`pinned-sessions`,children:Pt.map(e=>e.kind===`session`?gn(e.session,!0):(0,q.jsx)(`li`,{className:`pinned-workspace`,children:_n(e.project,!0)},e.project.path))})]}),(be||He===`project`||e.searchOpen)&&(0,q.jsxs)(`div`,{className:`workspace-heading sidebar-section-heading `+(e.searchOpen?`is-searching`:``),children:[(0,q.jsxs)(`button`,{type:`button`,className:`workspace-heading-label`,"aria-label":t(be?`currentConversations`:`sidebarProjects`),"aria-expanded":be?void 0:!C||!!e.query.trim(),onClick:()=>be?xe(!1):w(e=>!e),children:[be&&(0,q.jsx)(Ko,{"aria-hidden":`true`}),t(be?`archivedConversations`:`sidebarProjects`),!be&&(0,q.jsx)(is,{className:C&&!e.query.trim()?`is-collapsed`:``,"aria-hidden":`true`})]}),(0,q.jsxs)(`div`,{className:`session-search`,children:[(0,q.jsx)(Dc,{}),(0,q.jsx)(`input`,{ref:oe,type:`search`,value:e.query,placeholder:t(`searchPlaceholder`),maxLength:be?160:void 0,"aria-label":t(`searchConversations`),onChange:t=>e.actions.setQuery(t.target.value)}),(0,q.jsx)(`button`,{type:`button`,"aria-label":t(`closeSearch`),onClick:()=>e.actions.setSearchOpen(!1),children:(0,q.jsx)(je,{})})]}),(0,q.jsxs)(`div`,{className:`workspace-actions sidebar-section-actions`,children:[!be&&(0,q.jsx)(MA,{label:t(`sidebarProjectOptions`),items:pn}),be&&(0,q.jsx)(V,{content:t(`sidebarFilterList`),children:(0,q.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":t(`sidebarFilterList`),onClick:()=>e.actions.setSearchOpen(!0),children:(0,q.jsx)(Dc,{})})}),!be&&(0,q.jsx)(V,{content:t(`addWorkspace`),children:(0,q.jsx)(`button`,{className:`icon-button`,type:`button`,"aria-label":t(`addWorkspace`),onClick:()=>void e.actions.chooseWorkspace(),children:(0,q.jsx)(Ae,{})})})]})]}),e.searchOpen&&(0,q.jsxs)(`button`,{type:`button`,className:`sidebar-content-search`,onClick:()=>d(!0),children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),t(`transcriptSearch`)]}),be&&(0,q.jsxs)(`div`,{className:`sidebar-archive-actions`,children:[(0,q.jsx)(V,{content:t(`refreshArchives`),placement:`end`,children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":t(`refreshArchives`),disabled:nt,onClick:()=>void lt(),children:(0,q.jsx)(me,{"aria-hidden":`true`})})}),nt&&(0,q.jsx)(`span`,{role:`status`,children:t(`loadingArchives`)})]}),be&&ct&&(0,q.jsxs)(`div`,{className:`sidebar-scope-note`,role:`alert`,children:[(0,q.jsx)(`p`,{children:t(ct.kind===`stale`?`archiveCursorStale`:`archiveLoadFailed`)}),(0,q.jsx)(`button`,{type:`button`,disabled:nt,onClick:()=>void lt(ct.kind===`stale`?void 0:ct.cursor,ct.retainedCount),children:t(ct.kind===`stale`?`refreshArchives`:`retryArchives`)})]}),be&&!!st?.truncation.recordsUnscanned&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,children:t(`archiveScanBounded`,{count:st?.truncation.recordsUnscanned})}),!be&&nn&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,children:t(`loadedHistoryBounded`,{sessions:pe?.truncation.sessionsOmitted,workspaces:pe?.truncation.workspacesOmitted})}),be&&ht&&(0,q.jsx)(`p`,{className:`sidebar-scope-note`,role:`alert`,children:t(`restoreFailed`)}),(0,q.jsxs)(`div`,{className:`workspace-tree`,children:[(be?kt:He===`project`&&(!C||e.query.trim())?Lt:[]).map(e=>_n(e)),!be&&He===`project`&&ke&&De.current?.kind===`workspace`&&!e.query.trim()&&(0,q.jsx)(`section`,{className:`sidebar-project-tail `+(Ne===`project-tail`?`is-pin-drop-target`:``),"aria-label":t(`sidebarDropProjectLast`),onDragOver:e=>{Te||De.current?.kind!==`workspace`||(e.preventDefault(),e.dataTransfer.dropEffect=`move`,Pe(`project-tail`),Ie(null))},onDragLeave:e=>{(!(e.relatedTarget instanceof Node)||!e.currentTarget.contains(e.relatedTarget))&&Pe(null)},onDrop:t=>{if(Te||De.current?.kind!==`workspace`)return;t.preventDefault();let n=De.current;Ge(()=>e.actions.setWorkspaceOrder(n.path,null)),cn()},children:t(`sidebarDropProjectLast`)}),!be&&He===`project`&&!C&&!e.query.trim()&&It.length>6&&(0,q.jsx)(`button`,{className:`sidebar-show-more`,type:`button`,"aria-expanded":x,onClick:()=>S(e=>!e),children:t(x?`sidebarShowLess`:`sidebarShowMore`)}),!be&&(0,q.jsxs)(`section`,{className:`sidebar-recents`,"aria-label":t(`sidebarRecent`),children:[(0,q.jsxs)(`div`,{className:`sidebar-section-heading`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`workspace-heading-label`,"aria-expanded":!T||!!e.query.trim(),onClick:()=>E(e=>!e),children:[t(`sidebarRecent`),(0,q.jsx)(is,{className:T&&!e.query.trim()?`is-collapsed`:``,"aria-hidden":`true`})]}),(0,q.jsx)(`div`,{className:`sidebar-section-actions`,children:(0,q.jsx)(MA,{label:t(`sidebarRecentOptions`),items:mn})})]}),(!T||!!e.query.trim())&&(0,q.jsx)(`ul`,{className:`recent-sessions`,children:Bt.map(e=>gn(e,!1,{key:`recent`,sessions:zt}))}),!T&&Bt.lengthA(e=>e+10),children:t(`sidebarShowMore`)})]}),(be?!kt.length:!Pt.length&&!zt.length&&(He===`list`||!It.length))&&(0,q.jsx)(`div`,{className:`empty`,hidden:be&&(nt||!!ct),children:e.query.trim()?t(be&&st?.truncation.recordsUnscanned?`noMatchingScannedArchives`:!be&&nn?`noMatchingLoaded`:`noMatching`):t(be?st?.truncation.recordsUnscanned?`noScannedArchives`:`noArchivedSessions`:`noSessions`)}),be&&st?.nextCursor&&ct?.kind!==`stale`&&(0,q.jsx)(`button`,{type:`button`,className:`sidebar-archive-more`,disabled:nt,onClick:()=>void lt(st.nextCursor),children:t(`moreArchives`)})]})]})]}),(0,q.jsx)(`div`,{className:`sidebar-footer`,children:(0,q.jsx)(V,{content:t(`settings`),placement:`above`,children:(0,q.jsxs)(`button`,{className:`sidebar-settings-button`,type:`button`,"aria-label":t(`settings`),"data-provider-settings-trigger":!0,disabled:e.settingsDisabled,onClick:e.onOpenSettings,children:[(0,q.jsx)(Ac,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:t(`settings`)})]})})}),(0,q.jsx)(Se,{isOpen:!!c,onOpenChange:e=>!e&&!yt.current&&l(null),purpose:`form`,width:400,"aria-label":c?.kind===`workspace`?t(`renameWorkspace`):t(`renameConversation`),children:(0,q.jsxs)(`form`,{className:`openpi-dialog`,onSubmit:e=>{e.preventDefault(),an()},children:[(0,q.jsx)(`strong`,{children:c?.kind===`workspace`?t(`renameWorkspace`):t(`renameConversation`)}),(0,q.jsx)(`input`,{ref:ce,value:ne,maxLength:80,disabled:_t,"aria-label":c?.kind===`workspace`?t(`workspaceName`):t(`conversationName`),onChange:e=>re(e.target.value)}),ie&&(0,q.jsx)(`p`,{className:`sidebar-dialog-error`,role:`alert`,children:t(`renameFailed`)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:_t,onClick:()=>{yt.current||l(null)},children:t(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,className:`primary`,disabled:_t||!ne.trim()||ne.trim()===c?.name,children:t(_t?`savingName`:`save`)})]})]})}),o&&(0,q.jsx)(CA,{workspace:o,client:ye,actions:e.actions,connected:e.connected!==!1,onClose:()=>{s(null),a.current?.()}},o),(0,q.jsx)(Se,{isOpen:!!z,onOpenChange:e=>!e&&!St.current&&B(null),purpose:`form`,width:440,"aria-label":t(`removeWorkspace`),children:(0,q.jsxs)(`div`,{className:`openpi-dialog`,children:[(0,q.jsx)(`strong`,{children:t(`removeWorkspace`)}),(0,q.jsx)(`p`,{className:`sidebar-dialog-path`,children:z?.path}),(0,q.jsxs)(`p`,{children:[z?.name,`:`,t(`workspaceDeleteConfirm`)]}),Ct&&(0,q.jsx)(`p`,{className:`sidebar-dialog-error`,role:`alert`,children:t(`workspaceRemoveFailed`)}),(0,q.jsxs)(`div`,{className:`dialog-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:bt,onClick:()=>{St.current||B(null)},children:t(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`danger`,disabled:bt,onClick:()=>void on(),children:t(bt?`removingWorkspace`:`removeWorkspace`)})]})]})})]})}var PA=(0,K.createContext)(null);PA.displayName=`LayoutAreaContext`;var FA=(0,K.createContext)({hasHeader:!1,hasFooter:!1,hasStart:!1,hasEnd:!1});FA.displayName=`LayoutSlotsContext`;var IA={center:{kGNEyG:`x6s0dn4`,$$css:!0},end:{kGNEyG:`xuk3077`,$$css:!0},start:{kGNEyG:`x1cy8zhl`,$$css:!0},stretch:{kGNEyG:`x1qjc9v5`,$$css:!0}},LA={start:{kjj79g:`x1nhvcw1`,$$css:!0},center:{kjj79g:`xl56j7k`,$$css:!0},end:{kjj79g:`x13a6bvl`,$$css:!0},between:{kjj79g:`x1qughib`,$$css:!0},around:{kjj79g:`x1l1ennw`,$$css:!0},evenly:{kjj79g:`xaw8158`,$$css:!0}},RA={horizontal:{kXwgrk:`x1q0g3np`,$$css:!0},vertical:{kXwgrk:`xdt5ytf`,$$css:!0}},zA={nowrap:{kwnvtZ:`xozqiw3`,$$css:!0},wrap:{kwnvtZ:`x1a02dak`,$$css:!0},"wrap-reverse":{kwnvtZ:`x8hhl5t`,$$css:!0}},BA={stack:{k1xSpc:`x78zum5`,$$css:!0}},VA={0:{k1C7PZ:`x1o57wo1`,khm7nJ:`x6yxi7o`,$$css:!0},1:{k1C7PZ:`x1lfs0n9`,khm7nJ:`x1ngg2t4`,$$css:!0},2:{k1C7PZ:`xak3so`,khm7nJ:`x1x7z4sm`,$$css:!0},3:{k1C7PZ:`xewh9hi`,khm7nJ:`x4olc9o`,$$css:!0},4:{k1C7PZ:`xty4p9g`,khm7nJ:`xtx9w7w`,$$css:!0},5:{k1C7PZ:`x1eqhezk`,khm7nJ:`x1iu6piu`,$$css:!0},6:{k1C7PZ:`x3qlgwd`,khm7nJ:`xczp1bk`,$$css:!0},8:{k1C7PZ:`xicv188`,khm7nJ:`xgx0vcf`,$$css:!0},10:{k1C7PZ:`x1p37tyl`,khm7nJ:`x1xpicb7`,$$css:!0},"0.5":{k1C7PZ:`x1kihgfc`,khm7nJ:`x1tw44j4`,$$css:!0},"1.5":{k1C7PZ:`x1thn6ci`,khm7nJ:`xhq53yo`,$$css:!0}};function HA({crossAlign:e,direction:t,gap:n,mainAlign:r,wrap:i}){return[BA.stack,RA[t],n!=null&&VA[n],e!=null&&IA[e],r!=null&&LA[r],i!=null&&zA[i]]}var UA={reset:{kAzted:`x2lwn1j`,k7Eaqz:`xeuugli`,$$css:!0}},WA={center:{kSGwAc:`xamitd3`,$$css:!0},end:{kSGwAc:`xpvyfi4`,$$css:!0},start:{kSGwAc:`xqcrz7y`,$$css:!0},stretch:{kSGwAc:`xkh2ocl`,$$css:!0}},GA={fill:{kzQI83:`x1iyjqo2`,$$css:!0},static:{kzQI83:`x1c4vz4f`,kmuXW:`x2lah0s`,$$css:!0}};function KA({crossAlignSelf:e,size:t}={}){return[UA.reset,GA[t??`static`],e!=null&&WA[e]]}var qA={layoutOuter:{keTefX:`xojxgvx`,k71WvV:`x1fcf3bl`,keoZOQ:`x1sa9bsh`,k1K539:`x6h7pi7`,$$css:!0},layoutInner:{"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0},fill:{kZKoxP:`x12qplqi`,kskxy:`xenllk4`,$$css:!0},auto:{kAzted:`x1us19tq`,$$css:!0},middle:{kUk6DE:`x98rzlu`,kAzted:`x2lwn1j`,$$css:!0},fullBleed:{"--layout-padding-outer-x":`x1wbjvqu`,"--layout-padding-outer-y":`xzxxx64`,$$css:!0}},JA={kzqmXN:`xh8yej3`,kUOVxO:`xvueqy4`,$$css:!0},YA={contentWidthVar:e=>[{"--layout-content-width":(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`x4906uf`,$$css:!0},{"--x---layout-content-width":(typeof e==`number`?`${e}px`:e)==null?void 0:typeof e==`number`?`${e}px`:e}],contentWidth:e=>[JA,{ks0D6T:(typeof e==`number`?`${e}px`:e)==null?typeof e==`number`?`${e}px`:e:`xf68679`,$$css:!0},{"--x-maxWidth":(e=>typeof e==`number`?e+`px`:e??void 0)(typeof e==`number`?`${e}px`:e)}]};function XA({area:e,children:t}){return t==null?null:(0,q.jsx)(PA,{value:e,children:t})}var ZA={"x-default-marker":`x-default-marker`,$$css:!0};function QA({children:e,content:t,contentWidth:n,defaultHasDividers:r,end:i,footer:a,header:o,height:s=`fill`,padding:c,ref:l,start:u,xstyle:d,className:f,style:p}){let m=s===`fill`,h=t??e,g=(0,K.useMemo)(()=>r==null?null:{defaultHasDividers:r},[r]),_=o!=null,v=a!=null,y=u!=null,x=i!=null,S=(0,K.useMemo)(()=>({hasHeader:_,hasFooter:v,hasStart:y,hasEnd:x}),[_,v,y,x]),C=(0,q.jsx)(FA,{value:S,children:(0,q.jsx)(`div`,{ref:l,...H(O(`layout`,{height:s}),w(qA.layoutOuter,m?qA.fill:qA.auto,d),f,p),children:(0,q.jsxs)(`div`,{...w(ZA,qA.layoutInner,...HA({direction:`vertical`}),m?qA.fill:qA.auto,c===0&&qA.fullBleed,c!=null&&oe[c],c!=null&&b[c],n!=null&&YA.contentWidthVar(n)),children:[(0,q.jsx)(XA,{area:`header`,children:o}),(0,q.jsxs)(`div`,{...w(...HA({direction:`horizontal`}),qA.middle,n!=null&&YA.contentWidth(n)),children:[(0,q.jsx)(XA,{area:`start`,children:u}),(0,q.jsx)(`div`,{...w(...KA({size:`fill`})),children:(0,q.jsx)(XA,{area:`content`,children:h})}),(0,q.jsx)(XA,{area:`end`,children:i})]}),(0,q.jsx)(XA,{area:`footer`,children:a})]})})});return g==null?C:(0,q.jsx)(iO,{value:g,children:C})}QA.displayName=`Layout`;var $A={content:{kB7OPa:`x9f619`,kZKoxP:`x5yr21d`,kUk6DE:`x98rzlu`,kAzted:`x2lwn1j`,kVQacm:`x7giv3`,kZCmMZ:`xwjyata`,kwRFfy:`x1peupej`,kLKAdn:`xqty4a x1ioh5az`,kGO01o:`xg476vw xsg11nj`,"--container-padding-inline-start":`x408pgh`,"--container-padding-inline-end":`xikqloz`,"--container-padding-block-start":`xjmgx01`,"--container-padding-block-end":`xi9ns85`,$$css:!0},noStart:{kZCmMZ:`x139j0dd`,"--container-padding-inline-start":`xdvaxxn`,"--container-padding-inline-end":`xqpvj4r`,$$css:!0},noEnd:{kwRFfy:`xpc6k2p`,$$css:!0},noHeader:{kLKAdn:`x81pis9`,"--container-padding-block-start":`xzz8v79`,$$css:!0},noFooter:{kGO01o:`xon7vh3`,"--container-padding-block-end":`x1xjq73n`,$$css:!0},scrollable:{kVQacm:`xysyzu8`,$$css:!0},fullBleed:{kZCmMZ:`x1c1uobl`,kwRFfy:`xyri2b`,kLKAdn:`xexx8yu`,kGO01o:`x18d9i69`,"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0}};function ej({children:e,isScrollable:t=!0,padding:n,label:r,role:i,xstyle:a,className:s,style:c,ref:l,...u}){let{hasHeader:d,hasFooter:f,hasStart:p,hasEnd:m}=(0,K.use)(FA),h=n===0;return(0,q.jsx)(`div`,{ref:l,role:i,"aria-label":r,...H(O(`layout-content`),w($A.content,!p&&!h&&n==null&&$A.noStart,!m&&!h&&n==null&&$A.noEnd,!d&&!h&&n==null&&$A.noHeader,!f&&!h&&n==null&&$A.noFooter,t&&$A.scrollable,h&&$A.fullBleed,n!=null&&I[n],n!=null&&o[n],n!=null&&y[n],n!=null&&se[n],a),s,c),...u,children:e})}ej.displayName=`LayoutContent`;var tj={footer:{kmuXW:`x2lah0s`,$$css:!0},inner:{kB7OPa:`x9f619`,ks0D6T:`xjl2t3p`,kUOVxO:`xvueqy4`,kZCmMZ:`x139j0dd`,kwRFfy:`xpc6k2p`,kLKAdn:`xqty4a`,kGO01o:`xon7vh3`,"--container-padding-inline-start":`xdvaxxn`,"--container-padding-inline-end":`xqpvj4r`,"--container-padding-block-start":`xjmgx01`,"--container-padding-block-end":`x1xjq73n`,$$css:!0},fullBleed:{kZCmMZ:`x1c1uobl`,kwRFfy:`xyri2b`,kLKAdn:`xexx8yu`,kGO01o:`x18d9i69`,"--container-padding-inline-start":`xrhngw9`,"--container-padding-inline-end":`xjsfl84`,"--container-padding-block-start":`x1047aw6`,"--container-padding-block-end":`xax9j7h`,$$css:!0},divider:{kEafiO:`x178xt8z`,kPef9Z:`x13fuv20`,kLZC3w:`x1pc3f07`,$$css:!0}},nj={sizing:e=>[{kZKoxP:e==null?e:`x16ye13r`,$$css:!0},{"--x-height":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]};function rj({children:e,hasDivider:t,height:n,label:r,padding:i,role:a,xstyle:s,className:c,style:l,ref:u,...d}){let f=(0,K.use)(iO),p=t??f?.defaultHasDividers??!1,m=i===0;return(0,q.jsx)(`div`,{ref:u,role:a,"aria-label":r,"data-divider":p||void 0,...H(O(`layout-footer`),w(tj.footer,nj.sizing(n??null),p&&tj.divider,s),c,l),...d,children:(0,q.jsx)(`div`,{...w(tj.inner,m&&tj.fullBleed,i!=null&&I[i],i!=null&&o[i],i!=null&&y[i],i!=null&&se[i]),children:e})})}rj.displayName=`LayoutFooter`;var ij={scrollable:{kVQacm:`xysyzu8`,$$css:!0}};function aj({direction:e=`vertical`,hAlign:t,vAlign:n,justify:r,align:i,gap:o,padding:c,paddingInline:l,paddingInlineStart:u,paddingInlineEnd:d,paddingBlock:f,paddingBlockStart:p,paddingBlockEnd:m,isScrollable:h,width:_,height:v,maxWidth:y,minHeight:b,wrap:x,as:S=`div`,xstyle:C,className:T,style:E,children:D,ref:k,...A}){let j=t??(e===`horizontal`?r:i),M=n??(e===`horizontal`?i:r),N=e===`horizontal`?j:M,P=e===`horizontal`?M:j,F=u??l??c,I=d??l??c,L=p??f??c,R=m??f??c,te=w(...HA({direction:e,crossAlign:P,mainAlign:N,gap:o,wrap:x}),F!=null&&a[F],I!=null&&ee[I],L!=null&&g[L],R!=null&&s[R],h&&ij.scrollable,C),z={..._!=null&&{width:typeof _==`number`?`${_}px`:_},...v!=null&&{height:typeof v==`number`?`${v}px`:v},...y!=null&&{maxWidth:typeof y==`number`?`${y}px`:y},...b!=null&&{minHeight:typeof b==`number`?`${b}px`:b}};return(0,K.createElement)(S,{ref:k,...H(O(`stack`,{direction:e,gap:o,wrap:x}),te,T,{...E,...z}),...A},D)}aj.displayName=`Stack`;function oj({ref:e,justify:t,align:n,hAlign:r,vAlign:i,...a}){return(0,q.jsx)(aj,{...a,direction:`horizontal`,hAlign:r??t,vAlign:i??n,ref:e})}oj.displayName=`HStack`;function sj({ref:e,justify:t,align:n,hAlign:r,vAlign:i,...a}){return(0,q.jsx)(aj,{...a,direction:`vertical`,hAlign:r??n,vAlign:i??t,ref:e})}sj.displayName=`VStack`;var cj=`(max-width: 640px)`,lj={action:{ks0D6T:`x193iq5w`,k7Eaqz:`xeuugli`,$$css:!0},stackedAction:{kzqmXN:`xh8yej3`,$$css:!0}};function uj({ref:e,isOpen:t,isInline:n,onOpenChange:r,title:i,description:a,cancelLabel:o,actionLabel:s,actionVariant:c=`destructive`,isActionLoading:l,onAction:u,width:d=400,xstyle:f,className:p,style:m,"data-testid":h,...g}){let _=jr(),v=o??_(`@astryx.alertDialog.cancel`),y=(0,K.useId)(),b=(0,K.useId)(),x=Hi(cj),S=(0,K.useCallback)(()=>{r(!1)},[r]),C=[lj.action,x&&lj.stackedAction],w=(0,q.jsx)(Br,{variant:`ghost`,label:v,onClick:S,xstyle:C,"data-autofocus":!0},`cancel`),T=(0,q.jsx)(Br,{variant:c,label:s,onClick:u,isLoading:l,xstyle:C},`action`);return(0,q.jsx)(Se,{...g,ref:e,isOpen:t,isInline:n,onOpenChange:r,width:d,purpose:`form`,role:n?`group`:`alertdialog`,"aria-labelledby":y,"aria-describedby":b,...H(O(`alert-dialog`),{className:p,style:m}),xstyle:f,"data-testid":h,children:(0,q.jsx)(QA,{content:(0,q.jsxs)(ej,{children:[(0,q.jsx)(sO,{level:2,id:y,children:i}),(0,q.jsx)(jt,{type:`body`,color:`secondary`,id:b,children:a})]}),footer:(0,q.jsx)(rj,{children:(0,q.jsx)(aj,{direction:x?`vertical`:`horizontal`,gap:2,hAlign:x?`stretch`:`end`,wrap:x?`nowrap`:`wrap`,children:x?[T,w]:[w,T]})})})})}uj.displayName=`AlertDialog`;var dj={x1iwu4tg:`x1iwu4tg`,$$css:!0},fj={sm:{kzqmXN:`x1td3qas`,kZKoxP:`x1qx5ct2`,$$css:!0},md:{kzqmXN:`x100vrsf`,kZKoxP:`xxk0z11`,$$css:!0}},pj={sm:{kzqmXN:`x1td3qas`,kZKoxP:`x1qx5ct2`,$$css:!0},md:{kzqmXN:`x100vrsf`,kZKoxP:`xxk0z11`,$$css:!0}},mj={sm:{kzqmXN:`x1td3qas`,kZKoxP:`x1qx5ct2`,kmVPX3:`x1i3ajwb`,$$css:!0},md:{kzqmXN:`x100vrsf`,kZKoxP:`xxk0z11`,kmVPX3:`xfawy5m`,$$css:!0}},hj={sm:{kzqmXN:`x6jxa94`,kZKoxP:`x1v9usgg`,k3aq6I:`xbryuvx`,$$css:!0},md:{kzqmXN:`x1kky2od`,kZKoxP:`xlup9mm`,k3aq6I:`xbryuvx`,$$css:!0}},gj={sm:{kzqmXN:`x1kky2od`,kZKoxP:`xlup9mm`,k3aq6I:`xv5t66b xi9aj42`,$$css:!0},md:{kzqmXN:`xw4jnvo`,kZKoxP:`x1qx5ct2`,k3aq6I:`x15481yp x12xz5k6`,$$css:!0}},_j={sm:{kAzted:`xisnujt`,$$css:!0},md:{kAzted:`xjwf9q1`,$$css:!0}},vj={container:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`x1txdalj`,$$css:!0},containerLabelHidden:{kOIVth:`xxhr3t`,$$css:!0},containerSpread:{kjj79g:`x1qughib`,kzqmXN:`xh8yej3`,$$css:!0},statusGap:{keoZOQ:`xtbrsbv`,$$css:!0},switchWrapper:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kmuXW:`x2lah0s`,kHBbk8:`xc8icb0`,$$css:!0},input:{kVAEAm:`x10l6tqk`,kogj98:`x1ghz6dp`,kmVPX3:`x1717udv`,kSiTet:`xg01cxk`,kkrTdU:`x1ypdohk x16khyan`,kY2c9j:`x1vjfegm`,k7Eaqz:`xkagaj0`,kAzted:`x80b3aj`,k87sOh:`xijlfn0`,kLqNvP:`x1hsn8va`,k3aq6I:`x8i4i9p`,$$css:!0},inputDisabled:{kkrTdU:`xt0e3qv`,$$css:!0},inputBusy:{kfzvcC:`x47corl`,$$css:!0},track:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kaIpWk:`xjspbzw`,k1ekBW:`x15406qy`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,kB7OPa:`x9f619`,kMzoRj:`xc342km x13rsnn2`,ksu8eU:`xng3xce xx61lck`,kVAM5u:`x1w1tqly`,$$css:!0},trackFocus:{kI3sdo:`x1a2a7pz xafswnp`,kInvED:`xwz5zln`,$$css:!0},trackOff:{kWkggS:`xspzpui x1a8ae7b x9yvj25`,$$css:!0},trackOn:{kWkggS:`x1ewilqj xcgwt1n x1jzqe4`,$$css:!0},trackDisabled:{kSiTet:`xbyyjgo`,kVAM5u:`xmnqt3w`,$$css:!0},trackDisabledOff:{kWkggS:`xspzpui`,$$css:!0},thumb:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kaIpWk:`xjspbzw`,k1ekBW:`xh3q6i0`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,$$css:!0},thumbOff:{kWkggS:`x10xzikg xwvh9j7`,$$css:!0},thumbOn:{kWkggS:`x10xzikg x1sir5s4`,$$css:!0},labelWrapper:{k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kOIVth:`x1lsbc85`,kjj79g:`xl56j7k`,$$css:!0}},yj={width:e=>[{kzqmXN:e==null?e:`x5lhr3w`,$$css:!0},{"--x-width":(e=>typeof e==`number`?e+`px`:e??void 0)(e)}]};function bj({label:e,isLabelHidden:t=!1,description:n,onChange:r,changeAction:i,isLoading:a=!1,value:o,isDisabled:s=!1,htmlName:c,disabledMessage:l,isOptional:u=!1,isRequired:d=!1,onFocus:f,onBlur:p,labelIcon:m,labelTooltip:h,labelPosition:g=`end`,labelSpacing:_=`hug`,status:v,size:y=`md`,width:b,xstyle:x,className:S,style:C,ref:T,...E}){let D=(0,K.useId)(),k=(0,K.useId)(),A=(0,K.useId)(),j=YO({isRequired:d,isOptional:u}),[,M]=(0,K.useTransition)(),[N,P]=(0,K.useOptimistic)(o),I=a||N!==o,ee=N===!0,L=s&&!!l,R=F({placement:`above`,focusTrigger:`always`,isEnabled:L}),te=[];n&&te.push(k),v?.message&&te.push(A),L&&te.push(R.describedBy);let z=te.length>0?te.join(` `):void 0,B=(0,q.jsxs)(`div`,{...w(vj.switchWrapper,fj[y]),children:[(0,q.jsx)(`input`,{ref:we(T,R.positionRef),id:D,type:`checkbox`,role:`switch`,name:s?void 0:c,checked:ee,disabled:s&&!L,"aria-disabled":L?`true`:void 0,form:L?``:void 0,required:d,"aria-required":j?`true`:void 0,onChange:e=>{if(s||I)return;let t=e.target.checked;r?.(t,e),i&&!e.defaultPrevented&&M(async()=>{P(t),await i(t,e)})},onFocus:f,onBlur:p,"aria-describedby":z,"aria-invalid":v?.type===`error`||void 0,"aria-busy":I||void 0,...w(vj.input,pj[y],s&&vj.inputDisabled,I&&vj.inputBusy)}),(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(O(`switch`,{checked:ee?`checked`:null,disabled:s?`disabled`:null,size:y}),w(vj.track,mj[y],ee?vj.trackOn:vj.trackOff,!s&&vj.trackFocus,s&&vj.trackDisabled,s&&!ee&&vj.trackDisabledOff)),children:(0,q.jsx)(`div`,{...H(O(`switch-thumb`,{checked:ee?`checked`:null,size:y}),w(vj.thumb,ee?gj[y]:hj[y],ee?vj.thumbOn:vj.thumbOff)),children:I&&(0,q.jsx)(Gt,{size:`sm`})})}),I&&(0,q.jsx)(Kt,{role:`status`,children:`Loading`})]}),ne=(0,q.jsx)(`div`,{...w(vj.labelWrapper,_j[y]),children:(0,q.jsx)(MO,{...O(`switch-label`),label:e,inputID:D,isLabelHidden:t,isDisabled:s,isOptional:u,isRequired:d,labelIcon:m,labelTooltip:h,description:n,descriptionID:k})});return(0,q.jsxs)(`div`,{...H(O(`switch-field`,{labelPosition:g===`end`?void 0:g,labelSpacing:_===`hug`?void 0:_}),w(b!=null&&yj.width(b),x),S,C),...E,children:[(0,q.jsxs)(`div`,{ref:e=>{R.interactionRef(e)},...w(vj.container,t&&vj.containerLabelHidden,_===`spread`&&vj.containerSpread,!s&&dj),children:[` `,g===`start`?(0,q.jsxs)(q.Fragment,{children:[ne,B]}):(0,q.jsxs)(q.Fragment,{children:[B,ne]})]}),v?.message&&(0,q.jsx)(IO,{type:v.type,message:v.message,id:A,variant:`detached`,xstyle:vj.statusGap}),L&&R.renderTooltip(l)]})}bj.displayName=`Switch`;var xj=[`chrome`,`edge`,`brave`,`chromium`,`safari`,`firefox`],Sj=[`embedded`,...xj],Cj=e=>xj.some(t=>t===e);function wj(){let[e,t]=(0,K.useState)(),n=(0,K.useRef)(void 0),r=(0,K.useRef)(!1),i=(0,K.useRef)(!0),a=(0,K.useRef)(void 0),o=(0,K.useCallback)(()=>{a.current?.(),a.current=void 0,n.current?.close(),n.current=void 0,i.current&&t(void 0)},[]);return(0,K.useEffect)(()=>(i.current=!0,window.addEventListener(`pagehide`,o),()=>{i.current=!1,window.removeEventListener(`pagehide`,o),o()}),[o]),{container:e,open:async()=>{if(n.current&&!n.current.closed)return n.current.focus(),!0;if(r.current)return!1;r.current=!0;try{let e=window.documentPictureInPicture,r=e?await e.requestWindow({width:460,height:740}):window.open(`about:blank`,`_blank`,`popup,width=460,height=740`);if(!r)return!1;if(!i.current)return r.close(),!1;n.current=r,r.document.title=`OpenPI Browser Bridge`;let o=()=>{r.document.documentElement.lang=document.documentElement.lang,r.document.documentElement.dataset.theme=document.documentElement.dataset.theme,r.document.documentElement.style.cssText=document.documentElement.style.cssText};o(),r.document.documentElement.classList.add(`browser-guide-window`);for(let e of document.styleSheets)try{let t=r.document.createElement(`style`);t.textContent=[...e.cssRules].map(e=>e.cssText).join(` `),r.document.head.append(t)}catch{if(!e.href)continue;let t=r.document.createElement(`link`);t.rel=`stylesheet`,t.href=e.href,r.document.head.append(t)}let s=r.document.createElement(`main`);s.className=`browser-settings browser-settings-detached`,r.document.body.append(s);let c=new MutationObserver(o);c.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`,`style`,`lang`]});let l=()=>{c.disconnect(),n.current===r&&(n.current=void 0,a.current=void 0,i.current&&t(void 0))};return r.addEventListener(`pagehide`,l,{once:!0}),a.current=()=>{c.disconnect(),r.removeEventListener(`pagehide`,l)},t(s),!0}catch{return o(),!1}finally{r.current=!1}},close:o,isOpen:()=>!!(n.current&&!n.current.closed)}}function Tj({id:e,name:t,label:n,value:r,options:i,disabled:a=!1,onChange:o,className:s,menuWidth:c=`min(300px, calc(100vw - 32px))`}){let l=i.find(e=>e.value===r);return(0,q.jsx)(yo,{button:{id:e,name:t,label:l?.label??r,"aria-label":n,variant:`secondary`,size:`sm`,className:`settings-select-menu-trigger${s?` ${s}`:``}`,isDisabled:a},className:`settings-select-menu`,menuWidth:c,alignment:`end`,children:(0,q.jsx)(Bo,{value:r,label:n,onChange:e=>{e!==r&&o(e)},children:i.map(e=>(0,q.jsx)(Ho,{value:e.value,label:e.label,isDisabled:a||e.disabled,description:e.description?(0,q.jsx)(`span`,{className:`settings-select-option-description`,children:e.description}):void 0},e.value))})})}var Ej={chrome:`Chrome`,edge:`Microsoft Edge`,brave:`Brave`,chromium:`Chromium`,safari:`Safari`,firefox:`Firefox`};function Dj({browser:e}){return(0,q.jsx)(`span`,{className:`browser-settings-mark ${e}`,"aria-hidden":`true`,children:e===`chrome`||e===`chromium`?(0,q.jsx)(`i`,{}):(0,q.jsx)(Es,{})})}function Oj({onConfigure:e,setupPending:t=!1}){let{t:n}=W(),r=wj(),i=(0,K.useRef)(r.isOpen);i.current=r.isOpen;let[a,o]=(0,K.useState)(),[s,c]=(0,K.useState)(),[l,u]=(0,K.useState)(!1),d=l||t,[f,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(),[g,_]=(0,K.useState)(`chrome`),[v,y]=(0,K.useState)(1),[b,x]=(0,K.useState)(!1),[S,C]=(0,K.useState)(),w=(0,K.useRef)(0),T=(0,K.useRef)(null),E=(0,K.useRef)(null),D=(0,K.useRef)(!0);(0,K.useEffect)(()=>{m&&(T.current?.scrollIntoView?.({block:`start`}),E.current?.focus({preventScroll:!0}))},[m,v,r.container]);let O=(0,K.useCallback)(async()=>{let e=++w.current;try{let t=await new de().request(`/api/settings/browser`);return D.current&&e===w.current&&(o(t),c(void 0)),t}catch(t){D.current&&e===w.current&&c(t instanceof Error?t.message:String(t));return}},[]);(0,K.useEffect)(()=>{D.current=!0,O();let e=setInterval(()=>{(document.visibilityState===`visible`||i.current())&&O()},3e3),t=()=>void O();return window.addEventListener(`focus`,t),()=>{D.current=!1,clearInterval(e),window.removeEventListener(`focus`,t)}},[O]);let k=async t=>{u(!0),c(void 0),C(void 0),++w.current;try{let r=await e(`Configure browser access: ${[t.control===void 0?void 0:`browser_control=${t.control}`,t.embedded===void 0?void 0:`browser_embedded=${t.embedded}`,t.defaultBrowser===void 0?void 0:`browser_default=${JSON.stringify(t.defaultBrowser)}`,t.externalBrowsers===void 0?void 0:`browser_external=${JSON.stringify(t.externalBrowsers)}`].filter(e=>e!==void 0).join(`, `)}. Preserve all other settings.`);if(!D.current)return;if(!r)throw Error(n(`setupRequestFailed`));C(n(`setupRequestAccepted`))}catch(e){await O(),D.current&&c(e instanceof Error?e.message:String(e))}finally{D.current&&u(!1)}},A=async(e,t)=>{u(!0),c(void 0),C(void 0);try{if(await new de().request(`/api/settings/browser/action`,{method:`POST`,body:JSON.stringify({browser:e,action:t})}),D.current)return!0}catch(e){D.current&&c(e instanceof Error?e.message:String(e))}finally{D.current&&u(!1)}return!1},j=e=>e===`embedded`?n(`browserEmbedded`):Ej[e];if(!a)return(0,q.jsxs)(`div`,{className:`browser-settings-load`,role:s?`alert`:`status`,children:[(0,q.jsx)(Es,{}),(0,q.jsx)(`p`,{children:s||n(`browserLoading`)}),s&&(0,q.jsx)(`button`,{type:`button`,onClick:()=>void O(),children:n(`browserCheck`)})]});let{config:M}=a,N=a.profiles.find(e=>e.current&&e.connected&&e.version===a.extensionVersion),P=e=>a.profiles.filter(t=>t.connected&&t.version===a.extensionVersion&&(e===`embedded`?t.current&&![`safari`,`firefox`].includes(t.browser):t.browser===e)),F=e=>e===`embedded`?M.embedded:M.externalBrowsers.includes(e),I=(e,t)=>e===`embedded`?{embedded:t}:{externalBrowsers:t?[...new Set([...M.externalBrowsers,e])]:M.externalBrowsers.filter(t=>t!==e)},ee=e=>{h(e),y(1),C(void 0),x(!1),_(e===`embedded`?N&&![`safari`,`firefox`].includes(N.browser)?N.browser:`chrome`:e)},L=e=>{let t=P(e).length>0,r=e===`embedded`||a.browsers.some(t=>t.id===e&&t.installed),i=a.profiles.some(t=>t.connected&&t.version!==a.extensionVersion&&(e===`embedded`?t.current&&![`safari`,`firefox`].includes(t.browser):t.browser===e));return(0,q.jsxs)(`div`,{className:`browser-settings-row`,children:[(0,q.jsx)(Dj,{browser:e}),(0,q.jsxs)(`div`,{className:`browser-settings-description`,children:[(0,q.jsx)(`strong`,{children:j(e)}),(0,q.jsx)(`span`,{className:t?`connected`:``,children:t?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`i`,{}),n(`browserConnected`)]}):n(i?`browserUpdateNeeded`:r?`browserNeedsSetup`:`browserNotFound`)})]}),(0,q.jsx)(`button`,{className:`browser-settings-button`,type:`button`,disabled:l,"aria-label":n(t?`browserManageNamed`:`browserSetupNamed`,{browser:j(e)}),onClick:()=>ee(e),children:n(t?`browserManage`:`browserSetUp`)}),(0,q.jsx)(bj,{label:n(`browserAllowNamed`,{browser:j(e)}),isLabelHidden:!0,size:`sm`,value:F(e),isDisabled:d,onChange:t=>void k(I(e,t))})]},e)},R=m!==void 0&&P(m).length>0,te=a.browsers.some(e=>e.id===g&&e.installed),z=g===`safari`||g===`firefox`,B=z?a.portableExtensionPath??a.extensionPath:a.extensionPath,ne=g===`firefox`?`${B.replace(/[\\/]+$/,``)}/manifest.json`:B,re=z?`browser-extension-portable`:`browser-extension`,V=g===`safari`?n(`browserSafariSettings`):g===`firefox`?`about:debugging#/runtime/this-firefox`:`${g===`edge`?`edge`:g===`brave`?`brave`:`chrome`}://extensions/`,ie=n(g===`safari`?`browserSafariDeveloper`:g===`firefox`?`browserFirefoxThis`:`browserDeveloperMode`),ae=n(g===`safari`?`browserSafariTemporary`:g===`firefox`?`browserFirefoxTemporary`:`browserLoadUnpacked`),oe=[n(`browserStepOpen`),ie,n(`browserStepAdd`),n(`browserStepConnect`)];return(0,q.jsxs)(`div`,{className:`settings-content-page browser-settings`,children:[(0,q.jsxs)(`header`,{className:`browser-settings-heading`,children:[(0,q.jsx)(`h1`,{children:n(`browserSettings`)}),(0,q.jsx)(`p`,{children:n(`browserSettingsIntro`)})]}),(0,q.jsxs)(`div`,{className:`browser-settings-card browser-settings-main-card`,children:[(0,q.jsxs)(`div`,{className:`browser-settings-control`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:n(`browserControl`)}),(0,q.jsx)(`p`,{children:n(`browserControlHint`)})]}),(0,q.jsx)(bj,{label:n(`browserControl`),isLabelHidden:!0,size:`sm`,value:M.control,isDisabled:d,onChange:e=>void k({control:e})})]}),(0,q.jsxs)(`div`,{className:`browser-settings-default`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`label`,{htmlFor:`browser-default`,children:n(`browserDefault`)}),(0,q.jsx)(`p`,{children:n(`browserDefaultHint`)})]}),(0,q.jsx)(Tj,{id:`browser-default`,label:n(`browserDefault`),value:M.defaultBrowser,disabled:d,onChange:e=>{let t=Sj.find(t=>t===e);t&&k({defaultBrowser:t})},options:Sj.map(e=>({value:e,label:`${j(e)}${F(e)?``:` · ${n(`browserBlocked`)}`}`,disabled:!F(e)}))})]})]}),!F(M.defaultBrowser)&&(0,q.jsx)(`p`,{className:`browser-settings-warning`,role:`status`,children:n(`browserDefaultBlocked`)}),(0,q.jsxs)(`div`,{className:`browser-settings-section-heading`,children:[(0,q.jsx)(`h2`,{children:n(`browserAllowedTitle`)}),(0,q.jsx)(`span`,{children:!M.control&&n(`browserOffHint`)})]}),(0,q.jsxs)(`div`,{className:`browser-settings-card`,children:[L(`embedded`),L(`chrome`),(0,q.jsxs)(`details`,{className:`browser-settings-more`,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(os,{}),n(`browserMore`)]}),xj.filter(e=>e!==`chrome`).map(L)]})]}),(0,q.jsx)(`p`,{className:`browser-settings-example`,children:n(`browserSpeakHint`)}),r.container&&(0,q.jsxs)(`div`,{className:`browser-settings-guide-placeholder`,role:`status`,children:[(0,q.jsx)(`p`,{children:n(`browserGuideDetached`)}),(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-button`,onClick:()=>void r.open(),children:n(`browserShowGuide`)}),(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-text-button`,onClick:r.close,children:n(`browserGuideInline`)})]}),m!==void 0&&(e=>r.container?(0,$c.createPortal)(e,r.container):e)((0,q.jsxs)(`section`,{ref:T,className:`browser-settings-guide`,"aria-label":n(`browserGuideTitle`,{browser:j(m)}),children:[(0,q.jsxs)(`div`,{className:`browser-settings-guide-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{children:n(R?`browserConnectionTitle`:`browserGuideEyebrow`)}),(0,q.jsx)(`h3`,{children:n(`browserGuideTitle`,{browser:j(m)})})]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,disabled:l,"aria-label":n(`browserCloseGuide`),onClick:()=>{r.close(),h(void 0)},children:(0,q.jsx)(je,{})})]}),!r.container&&!R&&(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-text-button`,onClick:async()=>{await r.open()||C(n(`browserGuideBlocked`))},children:[(0,q.jsx)(Os,{}),n(`browserGuidePopout`)]}),R?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`browser-settings-ready`,children:[(0,q.jsx)(ds,{}),n(`browserConnectionReady`)]}),(0,q.jsx)(`p`,{children:m===`embedded`?n(`browserEmbeddedDetail`):n(`browserExternalDetail`,{browser:j(m)})}),(0,q.jsxs)(`div`,{className:`browser-settings-guide-actions`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-button`,disabled:l,onClick:()=>void A(m===`embedded`?N.browser:m,`manage`),children:[n(`browserManageExtension`),(0,q.jsx)(Os,{})]}),(!F(m)||!M.control)&&(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-primary`,disabled:d,onClick:()=>void k({control:!0,...I(m,!0)}),children:n(`browserAllowUse`)}),F(m)&&M.defaultBrowser!==m&&(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-button`,disabled:d,onClick:()=>void k({defaultBrowser:m}),children:n(`browserMakeDefault`)})]})]}):(0,q.jsxs)(q.Fragment,{children:[m===`embedded`&&(0,q.jsxs)(`label`,{className:`browser-settings-install-browser`,htmlFor:`browser-install-target`,children:[n(`browserInstallIn`),(0,q.jsx)(Tj,{id:`browser-install-target`,label:n(`browserInstallIn`),value:g,disabled:l,onChange:e=>{let t=xj.find(t=>t===e);t&&(_(t),y(1),x(!1),C(void 0))},options:xj.filter(e=>![`safari`,`firefox`].includes(e)).map(e=>({value:e,label:Ej[e]}))})]}),(0,q.jsx)(`ol`,{className:`browser-settings-progress`,"aria-label":n(`browserSetupSteps`),children:oe.map((e,t)=>(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,"aria-current":v===t+1?`step`:void 0,"aria-label":n(`browserStepLabel`,{step:t+1,label:e}),disabled:l,onClick:()=>{y(t+1),C(void 0)},children:[(0,q.jsx)(`span`,{children:t+1}),e]})},e))}),(0,q.jsxs)(`div`,{className:`browser-settings-wizard`,"aria-live":`polite`,children:[(0,q.jsx)(`span`,{className:`browser-settings-step-count`,children:n(`browserStepCount`,{step:v,total:oe.length})}),(0,q.jsx)(`h4`,{ref:E,tabIndex:-1,children:n(v===1?`browserOpenManagerTitle`:v===2?g===`safari`?`browserSafariDeveloperTitle`:g===`firefox`?`browserFirefoxDeveloperTitle`:`browserDeveloperTitle`:v===3?`browserInstallTitle`:`browserConnectTitle`,{browser:Ej[g]})}),(0,q.jsx)(`p`,{children:n(v===1?g===`safari`?`browserSafariOpenHint`:`browserOpenManagerHint`:v===2?g===`safari`?`browserSafariDeveloperHint`:g===`firefox`?`browserFirefoxDeveloperHint`:`browserDeveloperHint`:v===3?g===`safari`?`browserSafariLoadHint`:g===`firefox`?`browserFirefoxLoadHint`:`browserLoadHint`:`browserConnectHint`,{browser:Ej[g],loadLabel:ae})}),v===1&&(0,q.jsxs)(`div`,{className:`browser-settings-address`,children:[(0,q.jsx)(Dj,{browser:g}),(0,q.jsx)(`code`,{children:V})]}),v===2&&(0,q.jsxs)(`figure`,{className:`browser-settings-illustration ${g}`,children:[(0,q.jsx)(`figcaption`,{children:n(`browserIllustration`,{browser:Ej[g]})}),(0,q.jsxs)(`div`,{className:`browser-settings-demo`,"aria-hidden":`true`,children:[(0,q.jsxs)(`div`,{className:`browser-settings-demo-bar`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`code`,{children:V})]}),(0,q.jsxs)(`div`,{className:`browser-settings-demo-heading`,children:[(0,q.jsx)(`span`,{children:n(`browserExtensions`)}),(0,q.jsxs)(`span`,{className:`browser-settings-demo-toggle highlight`,children:[ie,g!==`firefox`&&(0,q.jsx)(`i`,{})]})]}),(0,q.jsxs)(`div`,{className:`browser-settings-demo-toolbar`,children:[(0,q.jsx)(`span`,{children:ae}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]})]})]}),v===3&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`ol`,{className:`browser-settings-install-steps`,children:[(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{className:`browser-settings-install-label`,children:[(0,q.jsx)(`strong`,{children:n(g===`firefox`?`browserLocateManifest`:`browserLocateTarget`)}),(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-button`,disabled:l,onClick:()=>void A(g,`folder`),children:n(g===`firefox`?`browserRevealManifest`:`browserRevealTarget`)})]}),(0,q.jsxs)(`div`,{className:`browser-settings-selection`,children:[(0,q.jsx)(zs,{"aria-hidden":`true`}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:g===`firefox`?`manifest.json`:re}),(0,q.jsx)(`p`,{children:n(g===`firefox`?`browserSelectManifestHint`:`browserSelectFolderHint`)})]})]})]}),(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`strong`,{children:n(z?`browserLoadInBrowser`:`browserDragToBrowser`,{browser:Ej[g],loadLabel:ae})}),(0,q.jsx)(`p`,{children:n(z?`browserSelectLocatedTarget`:`browserDragFolderHint`,{browser:Ej[g],folder:re})}),(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-text-button`,disabled:l||!te,onClick:()=>void A(g,`manage`),children:[n(`browserOpenManager`,{browser:Ej[g]}),(0,q.jsx)(Os,{})]})]})]}),(0,q.jsxs)(`details`,{className:`browser-settings-picker-help`,children:[(0,q.jsx)(`summary`,{children:n(z?`browserManualSelection`:`browserManualInstall`)}),(0,q.jsxs)(`div`,{className:`browser-settings-install-label`,children:[(0,q.jsx)(`strong`,{children:n(`browserCopyLocation`)}),(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-button`,onClick:async e=>{let t=await td(ne,e.currentTarget.ownerDocument);x(t),C(t?void 0:n(`browserCopyFailed`))},children:[b?(0,q.jsx)(rs,{}):(0,q.jsx)(Ss,{}),n(b?`browserPathCopied`:`browserCopyPath`)]})]}),(0,q.jsx)(`code`,{className:`browser-settings-install-path`,children:ne}),(0,q.jsx)(`p`,{children:n(`browserLoadInBrowser`,{browser:Ej[g],loadLabel:ae})}),!z&&(0,q.jsx)(`p`,{children:n(`browserLoadAlternate`)}),(0,q.jsx)(`p`,{children:n(navigator.userAgent.includes(`Mac`)?`browserChooseFolderMac`:`browserChooseFolderOther`,{confirm:n(g===`firefox`?`browserConfirmFile`:`browserConfirmFolder`)})})]}),(0,q.jsx)(`p`,{className:`browser-settings-install-checkpoint`,children:n(`browserInstallCheckpoint`)})]}),v===4&&(0,q.jsxs)(`div`,{className:`browser-settings-waiting`,role:`status`,children:[(0,q.jsx)(me,{}),(0,q.jsx)(`span`,{children:n(`browserWaiting`)})]}),!te&&(0,q.jsx)(`p`,{className:`browser-settings-warning`,children:n(`browserInstallBrowserFirst`,{browser:Ej[g]})}),(0,q.jsxs)(`div`,{className:`browser-settings-wizard-actions`,children:[v>1&&(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-button`,disabled:l,onClick:()=>{y(v-1),C(void 0)},children:[(0,q.jsx)(Ko,{}),n(`browserPreviousStep`)]}),v===1&&(0,q.jsx)(`button`,{type:`button`,className:`browser-settings-text-button`,disabled:l,onClick:()=>y(4),children:n(`browserAlreadyInstalled`)}),v<4?(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-primary`,disabled:l||!te,onClick:async()=>{(v===2||await A(g,v===1?`manage`:`connect`))&&y(v+1)},children:[n(l?`browserOpening`:v===1?`browserOpenManager`:v===2?g===`firefox`?`browserFirefoxDone`:`browserDeveloperDone`:`browserInstalledConnect`,{browser:Ej[g]}),v===2?(0,q.jsx)(qo,{}):(0,q.jsx)(Os,{})]}):(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-primary`,disabled:l||f,onClick:async()=>{p(!0);let e=await O();if(D.current){p(!1);let t=e?.profiles.some(t=>t.connected&&t.version===e.extensionVersion&&(m===`embedded`?t.current&&![`safari`,`firefox`].includes(t.browser):t.browser===m));C(n(t?`browserConnectionReady`:`browserNotConnectedYet`))}},children:[(0,q.jsx)(me,{className:f?`settings-spin`:``}),n(`browserCheck`)]})]}),v===4?(0,q.jsxs)(`div`,{className:`browser-settings-connect-help`,children:[(0,q.jsx)(`p`,{children:n(`browserAllowHint`)}),(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-text-button`,disabled:l||!te,onClick:()=>void A(g,`connect`),children:[n(`browserOpenIn`,{browser:Ej[g]}),(0,q.jsx)(Os,{})]})]}):v===2&&(0,q.jsxs)(`button`,{type:`button`,className:`browser-settings-text-button`,disabled:l||!te,onClick:()=>void A(g,`manage`),children:[n(`browserReopenManager`),(0,q.jsx)(Os,{})]})]})]}),(0,q.jsxs)(`details`,{className:`browser-settings-help`,children:[(0,q.jsxs)(`summary`,{children:[(0,q.jsx)(is,{}),n(`browserHelp`)]}),(0,q.jsx)(`p`,{children:n(`browserReloadHint`)}),(0,q.jsx)(`p`,{children:n(`browserSupportedHint`)})]}),s&&(0,q.jsx)(`div`,{className:`browser-settings-error`,role:`alert`,children:s}),(0,q.jsx)(`div`,{className:`browser-settings-feedback`,role:`status`,"aria-live":`polite`,children:l?n(`browserSaving`):S})]})),!m&&s&&(0,q.jsxs)(`div`,{className:`browser-settings-error`,role:`alert`,children:[s,(0,q.jsx)(`button`,{type:`button`,onClick:()=>void O(),children:n(`browserCheck`)})]}),(0,q.jsx)(`div`,{className:`browser-settings-feedback`,role:`status`,"aria-live":`polite`,children:!m&&(l?n(`browserSaving`):S)})]})}function kj({label:e,value:t,options:n,disabled:r,onChange:i}){return(0,q.jsx)(yo,{button:{label:n.find(e=>e.value===t)?.label??t,"aria-label":e,variant:`secondary`,size:`sm`,className:`configuration-menu-trigger`,isDisabled:r},className:`configuration-menu`,menuWidth:`min(360px, calc(100vw - 32px))`,alignment:`end`,items:n.map(e=>({id:e.value,label:e.label,isDisabled:r,description:e.description?(0,q.jsx)(`span`,{className:`configuration-option-description`,children:e.description}):void 0,endContent:t===e.value?(0,q.jsx)(`span`,{className:`settings-select-check`,"aria-hidden":`true`,children:(0,q.jsx)(rs,{})}):void 0,onClick:()=>{e.value!==t&&i(e.value)}}))})}function Aj({catalog:e,error:t,pending:n,preferencePending:r,onConfigure:i,onUpdatePreferences:a,onRefresh:o,onOpenRuntimeStatus:s}){let{t:c}=W(),l=e?.setupWritable===!1||!!e?.resources.diagnostics.settingsErrors,u=n||r||!!t||!!e?.resources.diagnostics.settingsErrors,d=e?.setup.ui.webHiddenThinkingLevels??[],f=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],p=e?.setup.response?.verbosity??`default`,m=e?.setup.response?.reasoningSummary??`default`;return(0,q.jsxs)(`section`,{className:`settings-content-page settings-configuration-panel`,children:[(0,q.jsxs)(`header`,{className:`settings-page-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:c(`configurationSettings`)}),(0,q.jsx)(`p`,{children:c(`configurationIntro`)})]}),(0,q.jsx)(`button`,{type:`button`,"aria-label":c(`refreshStatus`),onClick:o,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]}),t&&(0,q.jsx)(`p`,{className:`inspection-warning`,role:`alert`,children:t}),!e&&!t&&(0,q.jsx)(`p`,{role:`status`,children:c(`settingsCatalogLoading`)}),l&&(0,q.jsxs)(`p`,{className:`inspection-warning`,role:`alert`,children:[c(`configurationReadFailure`),e?.setupDiagnostics?.map(e=>(0,q.jsxs)(`span`,{children:[e.path,`: `,e.message]},`${e.path}:${e.message}`))]}),e&&!l&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`configuration-scope`,children:[(0,q.jsxs)(`span`,{className:`configuration-scope-label`,children:[(0,q.jsx)(qc,{"aria-hidden":`true`}),c(`configurationUserScope`)]}),(0,q.jsx)(`span`,{children:c(`configurationSetupHint`)})]}),(0,q.jsxs)(`div`,{className:`configuration-group`,children:[(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationApproval`)}),(0,q.jsx)(`p`,{children:c(`configurationApprovalDetail`)})]}),(0,q.jsx)(`span`,{className:`configuration-readonly`,children:c(`configurationPiPermissions`)})]}),(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationSandbox`)}),(0,q.jsx)(`p`,{children:c(`configurationSandboxDetail`)})]}),(0,q.jsx)(`span`,{className:`configuration-readonly`,children:c(`configurationSandboxUnavailable`)})]}),(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`webSearchSettings`)}),(0,q.jsx)(`p`,{children:c(`configurationSearchDetail`)}),e.webSearch?.available!==!0&&(0,q.jsx)(`p`,{children:c(`webSearchUnsupported`)})]}),(0,q.jsx)(`div`,{className:`configuration-control`,children:(0,q.jsx)(kj,{label:c(`webSearchSettings`),value:e.setup.webSearch?.enabled===!0?`on`:`off`,options:[{value:`off`,label:c(`disabled`),description:c(`configurationSearchOff`)},{value:`on`,label:c(`enabled`),description:c(`configurationSearchOn`)}],disabled:u,onChange:e=>{i(c(e===`on`?`webSearchNativeRequest`:`webSearchDisableRequest`))}})})]}),(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationVerbosity`)}),(0,q.jsx)(`p`,{children:c(`configurationVerbosityDetail`)}),e.responseSupport?.verbosity!==!0&&(0,q.jsx)(`p`,{children:c(`configurationResponsesUnavailable`)})]}),(0,q.jsx)(`div`,{className:`configuration-control`,children:(0,q.jsx)(kj,{label:c(`configurationVerbosity`),value:p,options:[`default`,`low`,`medium`,`high`].map(e=>({value:e,label:c(`configurationVerbosity_${e}`),description:e==="default"?void 0:c(`configurationVerbosityHelp_${e}`)})),disabled:u||e.responseSupport?.verbosity!==!0,onChange:e=>{i(c(`configurationVerbosityRequest`,{value:e}))}})})]}),(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationSummary`)}),(0,q.jsx)(`p`,{children:c(`configurationSummaryDetail`)}),e.responseSupport?.reasoningSummary!==!0&&(0,q.jsx)(`p`,{children:c(`configurationSummaryUnavailable`)})]}),(0,q.jsx)(`div`,{className:`configuration-control`,children:(0,q.jsx)(kj,{label:c(`configurationSummary`),value:m,options:[`default`,`auto`,`concise`,`detailed`,`none`].map(e=>({value:e,label:c(`configurationSummary_${e}`),description:e==="default"?void 0:c(`configurationSummaryHelp_${e}`)})),disabled:u||e.responseSupport?.reasoningSummary!==!0,onChange:e=>{i(c(`configurationSummaryRequest`,{value:e}))}})})]})]}),(0,q.jsxs)(`section`,{className:`configuration-section`,children:[(0,q.jsx)(`h2`,{children:c(`configurationModelFeatures`)}),(0,q.jsx)(`div`,{className:`configuration-group`,children:(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationReasoningLevels`)}),(0,q.jsx)(`p`,{children:c(`configurationReasoningDetail`)})]}),(0,q.jsx)(`div`,{className:`configuration-control`,children:(0,q.jsx)(yo,{button:{label:c(`configurationReasoningCount`,{count:f.filter(e=>!d.includes(e)).length}),"aria-label":c(`configurationReasoningLevels`),variant:`secondary`,size:`sm`,className:`configuration-menu-trigger`,isDisabled:u},className:`configuration-level-menu`,menuWidth:`min(240px, calc(100vw - 32px))`,alignment:`end`,children:f.map(e=>(0,q.jsx)(Ro,{label:e,value:!d.includes(e),isDisabled:u,endContent:(0,q.jsx)(`span`,{className:`configuration-check`,children:!d.includes(e)&&(0,q.jsx)(rs,{"aria-hidden":`true`})}),onChange:t=>{a({thinkingLevelVisibility:{level:e,visible:t}})}},e))})})]})})]}),(0,q.jsxs)(`section`,{className:`configuration-section`,children:[(0,q.jsx)(`h2`,{children:c(`configurationDependencies`)}),(0,q.jsx)(`div`,{className:`configuration-group`,children:(0,q.jsxs)(`div`,{className:`configuration-row`,children:[(0,q.jsxs)(`div`,{className:`configuration-copy`,children:[(0,q.jsx)(`strong`,{children:c(`configurationEnvironment`)}),(0,q.jsx)(`p`,{children:c(`configurationEnvironmentDetail`)})]}),(0,q.jsxs)(`button`,{type:`button`,className:`configuration-runtime-button`,onClick:s,children:[c(`configurationRuntimeStatus`),(0,q.jsx)(Yo,{"aria-hidden":`true`})]})]})})]})]})]})}function jj({catalog:e,error:t,pending:n,onConfigure:r,onRefresh:i}){let{t:a}=W(),o=e?.setup.webSearch?.enabled===!0,s=e?.webSearch?.available===!0,c=n||!e||!!t||!!e?.resources.diagnostics.settingsErrors;return(0,q.jsxs)(`section`,{className:`settings-content-page settings-web-search-panel`,children:[(0,q.jsxs)(`header`,{className:`settings-page-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:a(`webSearchSettings`)}),(0,q.jsx)(`p`,{children:a(`webSearchIntro`)})]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button settings-heading-refresh`,"aria-label":a(`refreshStatus`),onClick:i,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]}),t&&(0,q.jsx)(`p`,{className:`inspection-warning`,role:`alert`,children:t}),!e&&!t&&(0,q.jsx)(`p`,{role:`status`,children:a(`settingsCatalogLoading`)}),(0,q.jsxs)(`section`,{className:`settings-control-group`,children:[(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsxs)(`div`,{className:`settings-control-copy`,children:[(0,q.jsx)(`h2`,{children:a(`webSearchCurrentModel`)}),(0,q.jsx)(`p`,{children:a(`webSearchNativeDetail`)})]}),(0,q.jsx)(Br,{label:a(o?`webSearchDisable`:`webSearchEnable`),variant:`secondary`,size:`sm`,isDisabled:c,isLoading:n,onClick:()=>void r(a(o?`webSearchDisableRequest`:`webSearchNativeRequest`))})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`div`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:a(`model`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:e?.webSearch?.model?`${e.webSearch.provider} / ${e.webSearch.model}`:a(`unavailable`)})]})]}),(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:a(`webSearchDefaultOff`)}),(0,q.jsx)(`p`,{role:`status`,className:`settings-resource-caption`,children:a(s?`webSearchSupported`:`webSearchUnsupported`)})]})}var Mj={wrapper:{k8WAf4:`xu0wf1k`,kg3NbH:`x7a5moj`,$$css:!0},icon:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kmuXW:`x2lah0s`,$$css:!0}};function Nj({ref:e,label:t,clearLabel:n,placeholder:r,value:i,onValueChange:a,onKeyDown:o,onFocus:s,onBlur:c,onContainerKeyDown:l,xstyle:u,className:d,style:f,...p}){let[m,h]=(0,K.useState)(!1);(0,K.useEffect)(()=>{D()},[]);let g=(0,K.useCallback)(e=>{h(N()===`keyboard`),s?.(e)},[s]),_=(0,K.useCallback)(e=>{h(!1),c?.(e)},[c]),v=(0,K.useCallback)(()=>{a(``),typeof e==`object`&&e?.current&&e.current.focus()},[a,e]);return(0,q.jsx)(`div`,{onKeyDown:l,...H(w(Mj.wrapper,u),d,f),children:(0,q.jsxs)(`div`,{"data-keyboard-focus":m?`true`:void 0,...{0:{className:`x9f619 x78zum5 x6s0dn4 x1txdalj xh8yej3 x1vofgu7 xf314gf xh6dtrn xkdsq27 xuedmi6 x12w9bfk xlr8y92`},1:{className:`x9f619 x78zum5 x6s0dn4 x1txdalj xh8yej3 x1vofgu7 xf314gf xh6dtrn xkdsq27 xuedmi6 x12w9bfk xlr8y92 x1gnnqk1 x1btxeh5`}}[!!m<<0],children:[(0,q.jsx)(ya,{icon:`search`,size:`sm`,color:`secondary`,xstyle:Mj.icon}),(0,q.jsx)(`input`,{ref:e,type:`text`,"aria-label":t,placeholder:r,value:i,onChange:e=>a(e.target.value),onKeyDown:o,onFocus:g,onBlur:_,className:`x1iyjqo2 xs83m0k xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1tgivj0 x9ynric xcr08ib xdk3u5w x1kq96og x1a2a7pz xeyghm5`,...p}),i!==``&&(0,q.jsx)(KO,{label:n,onClick:v})]})})}Nj.displayName=`PanelSearchInput`;function Pj(e){return typeof e==`string`||!(`type`in e)}function Fj(e){return typeof e==`object`&&`type`in e&&e.type===`divider`}function Ij(e){return typeof e==`object`&&`type`in e&&e.type===`section`}function Lj(e){return typeof e==`string`?{value:e,label:e}:{...e,label:e.label??e.value}}function Rj(e){let t=[];for(let n of e)if(Pj(n))t.push(Lj(n));else if(Ij(n))for(let e of n.options)t.push(Lj(e));return t}var zj=1;function Bj(e){let t=0,n=e;for(;n;)t+=n.offsetTop,n=n.offsetParent;return t}function Vj({isOpen:e,selectedItemIndex:t,listboxId:n,listboxRef:r,anchorRef:i}){let[a,o]=(0,K.useState)(0),[s,c]=(0,K.useState)(!1),l=(0,K.useCallback)((e,t)=>{o(e),c(t)},[]);return ne(()=>{if(!e){l(0,!1);return}if(!r.current||!i.current){l(0,!0);return}let a=`${n}-item-${t>=0?t:0}`,o=document.getElementById(a);if(!o){l(0,!0);return}let s=r.current,c=i.current.getBoundingClientRect(),u=s.offsetHeight;if(u<=0){l(0,!0);return}let d=Bj(o)-Bj(s)-s.scrollTop+o.offsetHeight/2,f=c.top+c.height/2-d-zj,p=window.innerHeight,m=Math.max(0,p-u),h=Math.min(Math.max(f,0),m),g=Math.max(0,c.bottom-h);l(g,!0)},[e,t,n,r,i,l]),{offset:a,isPositioned:s}}function Hj({selectableItems:e,value:t,isDisabled:n=!1,isOpen:r,hasSearch:i=!1,onOpen:a,onClose:o,onSelect:s,onClear:c,onSearchSeed:l,wasJustDismissed:u,listboxId:d}){let[f,p]=(0,K.useState)(-1),m=(0,K.useCallback)(e=>`${d}-item-${e}`,[d]),h=(0,K.useCallback)(()=>e.map((e,t)=>e.disabled?-1:t).filter(e=>e>=0),[e]),g=(0,K.useCallback)(()=>e.findIndex(e=>e.value===t),[e,t]),_=(0,K.useCallback)(()=>{p(-1),o()},[o]),v=(0,K.useCallback)(e=>{e.disabled||(s?.(e.value),_())},[s,_]),y=(0,K.useCallback)(()=>{if(!(n||u?.())){if(r)_();else if(a(),!i){let e=g();p(e>=0?e:0)}}},[n,u,r,a,_,g,i]),b=(0,K.useCallback)((e,t)=>{e.disabled||p(t)},[]);return{highlightedIndex:f,setHighlightedIndex:p,getItemId:m,onTriggerClick:y,onKeyDown:(0,K.useCallback)(o=>{if(n)return;let s=h();switch(o.key){case`ArrowDown`:if(o.preventDefault(),!r)a(),p(0);else{let e=s.indexOf(f),t=Math.min(e+1,s.length-1);p(s[t]??f)}break;case`ArrowUp`:if(o.preventDefault(),!r)a(),p(e.length-1);else{let e=s.indexOf(f),t=Math.max(e-1,0);p(s[t]??f)}break;case` `:if(i)break;case`Enter`:if(o.preventDefault(),r&&f>=0){let t=e[f];t&&!t.disabled&&v(t)}else if(!r&&(a(),!i)){let e=g();p(e>=0?e:0)}break;case`Escape`:r&&(o.preventDefault(),_());break;case`Tab`:r&&_();break;case`Home`:o.preventDefault(),r&&s.length>0&&p(s[0]);break;case`End`:o.preventDefault(),r&&s.length>0&&p(s[s.length-1]);break;case`PageUp`:o.preventDefault(),r&&s.length>0&&p(s[0]);break;case`PageDown`:o.preventDefault(),r&&s.length>0&&p(s[s.length-1]);break;case`Delete`:case`Backspace`:!i&&!r&&c!=null&&t!=null&&(o.preventDefault(),c());break;default:i&&l&&o.key.length===1&&!o.ctrlKey&&!o.metaKey&&(r||a(),l(o.key))}},[n,r,a,_,e,f,v,g,h,i,c,l,t]),onItemSelect:v,onItemMouseEnter:b}}var Uj=(0,K.createContext)(`stacked`);Uj.displayName=`SelectorRowLayoutContext`;function Wj(){return(0,K.use)(Uj)}var Gj={root:{k8WAf4:`xt970qd`,kg3NbH:`xnjsko4`,kaIpWk:`x2u8bby`,$$css:!0}};function Kj({icon:e,label:t,description:n,layout:r,endContent:i,xstyle:a,className:o,style:s}){let c=Wj();return(0,q.jsx)(Na,{startContent:e?xa(e,{size:`sm`,color:`secondary`}):void 0,label:t,description:n,layout:c===`inline`?`inline`:r,endContent:i,xstyle:[Gj.root,a],...H(O(`selector-option`),{className:o,style:s})})}Kj.displayName=`SelectorOption`;var qj={triggerContainer:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`x1qughib`,kOIVth:`x1txdalj`,kzqmXN:`xh8yej3`,k8WAf4:`xce4md1`,kg3NbH:`xrrkdod`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib xdk3u5w`,kLWn49:`x7acx1w`,kMwMTN:`x1tgivj0`,kkrTdU:`x1ypdohk x16khyan`,$$css:!0},triggerPlaceholder:{kMwMTN:`xv1l7n4`,$$css:!0},triggerInGroup:{kAzted:`x2lwn1j`,k8WAf4:`xt970qd`,$$css:!0},triggerIcon:{kmuXW:`x2lah0s`,$$css:!0},triggerIconRotation:{k1ekBW:`x11xpdln`,kIyJzY:`xuedmi6`,kAMwcw:`xlr8y92`,k3nNDw:`x1g0ag68`,$$css:!0},triggerIconOpen:{k3aq6I:`x19jd1h0`,$$css:!0},triggerGhost:{kzqmXN:`x14atkfc`,kMzoRj:`xc342km`,kWkggS:`xjbqb8w`,kGVxlE:`x1gnnqk1 x1s17dad x15ysqaf`,k63SB2:`x1e4wzip`,k1ekBW:`xrafxwg`,k3aq6I:`x3oybdh xk4oym4`,$$css:!0},triggerGhostDisabled:{kKwaWg:`x18o3ruo`,k3aq6I:`x1c071of x1pdlv7q`,$$css:!0},statusButton:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kmVPX3:`x1717udv`,kogj98:`x1ghz6dp`,kMzoRj:`xc342km`,ksu8eU:`xng3xce`,kWkggS:`xjbqb8w`,kMwMTN:`x1heor9g`,kkrTdU:`x1ypdohk x16khyan`,kaIpWk:`xh6dtrn`,$$css:!0},searchRowInput:{kg3NbH:`x2hg6jq`,$$css:!0},popover:{k7Eaqz:`xrzjruh`,$$css:!0},divider:{kqGvvJ:`xsq74q5`,$$css:!0},item:{kB7OPa:`x9f619`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`x1qughib`,kOIVth:`x1txdalj`,kzqmXN:`xh8yej3`,kmVPX3:`xlsj2fj`,kaIpWk:`xh6dtrn`,kMv6JI:`x9ynric`,kGuDYH:`xcr08ib`,kMwMTN:`x1tgivj0`,kWkggS:`xjbqb8w`,kkrTdU:`x1ypdohk x16khyan`,k9WMMc:`x1yc453h`,kI3sdo:`x1a2a7pz`,$$css:!0},itemHighlighted:{kWkggS:`x1lmrjuc`,$$css:!0},itemSelected:{k63SB2:`x1e4wzip`,$$css:!0},itemDisabled:{kSiTet:`xbyyjgo`,kkrTdU:`xt0e3qv`,$$css:!0}},Jj={sm:{kAzted:`x1gdqauq`,k8WAf4:`x1ecmfrv`,$$css:!0},md:{kAzted:`x1uogy3y`,k8WAf4:`x1ioay2v`,$$css:!0},lg:{kAzted:`x1xf4nls`,k8WAf4:`x1vn5h1t`,$$css:!0}},Yj={sm:{k8WAf4:`xu0wf1k`,kg3NbH:`xf314gf`,$$css:!0},md:{k8WAf4:`x1vofgu7`,$$css:!0},lg:{$$css:!0}},Xj={warning:`warning`,error:`error`,success:`success`},Zj={warning:`warning`,error:`error`,success:`success`},Qj={warning:`@astryx.input.statusButton.warning`,error:`@astryx.input.statusButton.error`,success:`@astryx.input.statusButton.success`};function $j({option:e}){return(0,q.jsx)(Kj,{icon:e.icon,label:e.label??e.value,description:e.description})}function eM(e,t){return!t||(e.label??e.value).toLowerCase().includes(t.toLowerCase())}function tM(e,t){return t?e.filter(e=>eM(e,t)):e}function nM(e){let t=jr(),{label:n,isLabelHidden:r=!1,description:i,isOptional:a=!1,isRequired:o=!1,isDisabled:s=!1,disabledMessage:c,options:l,value:u,onChange:d,changeAction:f,isLoading:m=!1,placeholder:h,size:g,variant:_=`input`,status:v,statusVariant:y=`attached`,labelTooltip:b,startIcon:x,htmlName:S,renderOption:C,renderValue:T,indicatorPosition:E=`end`,hasSearch:D=!1,searchPlaceholder:k,emptyText:A,emptySearchText:j,placement:N,isDefaultOpen:P=!1,"data-testid":I,width:ee,xstyle:L,className:te,style:z,hasClear:B,id:ne,...re}=e,V=YO({isRequired:o,isOptional:a}),oe=h??t(`@astryx.selector.placeholder`),se=k??t(`@astryx.selector.searchPlaceholder`),ce=A??t(`@astryx.selector.empty`),le=j??t(`@astryx.selector.emptySearchResults`),ue=B===!0,de=Zt(g,`md`),pe=_===`ghost`&&y===`attached`?`detached`:y,me=u===null?void 0:u,he=(0,K.useId)(),ge=ne??he,_e=(0,K.useId)(),ve=(0,K.useId)(),ye=(0,K.useId)(),be=(0,K.useId)(),xe=(0,K.useId)(),Se=(0,K.useRef)(null),Ce=(0,K.useRef)(null),we=(0,K.useRef)(null),Te=ZO(),[Ee,U]=(0,K.useState)(``),De=(0,K.useRef)(``),Oe=Ee.length>0,[,ke]=(0,K.useTransition)(),[W,Ae]=(0,K.useOptimistic)(me),G=m||W!==me,je=vu(),Me=typeof ce==`string`?ce:t(`@astryx.selector.empty`),Ne=typeof le==`string`?le:t(`@astryx.selector.emptySearchResults`),Pe=s&&!!c,Fe=F({placement:`above`,focusTrigger:`always`,isEnabled:Pe}),Ie=F({placement:`above`,isEnabled:pe===`tooltip`&&!!v?.message}),{ariaLabelledBy:Le,ariaDescribedBy:Re}=gt(be,[i?ve:null,!Te&&pe!==`tooltip`&&v?.message?ye:null,pe===`tooltip`&&v?.message?Ie.describedBy:null,Pe?Fe.describedBy:null],Te),ze=(0,K.useMemo)(()=>Rj(l),[l]),Be=(0,K.useMemo)(()=>tM(ze,Ee),[ze,Ee]),Ve=(0,K.useMemo)(()=>ze.findIndex(e=>e.value===W),[ze,W]),He=(0,K.useMemo)(()=>Ve>=0?ze[Ve]:void 0,[ze,Ve]),Ue=(0,K.useRef)(null),We=(0,K.useRef)(()=>{}),Ge=Gr({onHide:(0,K.useCallback)(()=>{U(``),De.current=``,We.current(),je(``),Ce.current?.focus()},[je]),hasLightDismiss:!0,hasCloseButton:!1,hasAutoFocus:!1,role:`none`,surfaceTarget:`selector-popup`}),Ke=ae(Ge.id,Ge.isOpen);(0,K.useEffect)(()=>{P&&Ge.show()},[]);let qe=(0,K.useCallback)(e=>{if(e.length===0){je(``);return}if(m){je(``);return}let n=tM(ze,e).length;je(n===0?Ne:t(`@astryx.selector.resultCount`,{count:n}))},[je,m,ze,Ne,t]),Je=(0,K.useCallback)(e=>{U(e),De.current=e,qe(e)},[qe]),Ye=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!(Ge.isOpen&&!m&&Ee===``&&ze.length===0)){Ye.current=null;return}Ye.current!==Me&&(Ye.current=Me,je(Me))},[Ge.isOpen,m,Ee,ze.length,Me,je]);let Xe=N==null&&!D,{offset:Ze,isPositioned:Qe}=Vj({isOpen:Ge.isOpen&&Xe,selectedItemIndex:Ve,listboxId:_e,listboxRef:Ue,anchorRef:Se}),$e=Xe?Ze:0,et=!Xe||Qe,tt=N??`below`,nt=$e>0?{marginBlockStart:`-${$e}px`}:void 0,rt=(0,K.useCallback)(()=>{We.current(),d?.(null),f&&ke(async()=>{Ae(void 0),await f(null)})},[d,f,ke,Ae]),it=(0,K.useCallback)(e=>{let t=De.current+e;De.current=t,U(t),qe(t)},[qe]),at=(0,K.useCallback)(e=>{d?.(e),f&&ke(async()=>{Ae(e),await f(e)})},[d,f,ke,Ae]),{highlightedIndex:ot,setHighlightedIndex:st,getItemId:ct,onTriggerClick:lt,onKeyDown:ut,onItemSelect:dt,onItemMouseEnter:ft}=Hj({selectableItems:Be,wasJustDismissed:Ge.wasJustDismissed,value:W,isDisabled:s,isOpen:Ge.isOpen,hasSearch:D,onOpen:(0,K.useCallback)(()=>{Ge.show(),D&&requestAnimationFrame(()=>{let e=we.current;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))})},[Ge,D]),onClose:Ge.hide,onSelect:at,onClear:ue?rt:void 0,onSearchSeed:it,listboxId:_e}),pt=io({getItemLabels:()=>ze.map(e=>e.label??e.value),isDisabled:e=>ze[e]?.disabled===!0,getCurrentIndex:()=>Ge.isOpen?ot:Ve,onMatch:e=>{let t=ze[e];Ge.isOpen?st(e):t.value!==W&&(at(t.value),je(t.label??t.value))}});We.current=pt.reset;let mt=(0,K.useCallback)(e=>{if(!s&&!D&&pt.onKeyDown(e)){e.preventDefault();return}ut(e)},[s,D,pt,ut]);(0,K.useEffect)(()=>{!Ge.isOpen||ot<0||document.getElementById(ct(ot))?.scrollIntoView?.({block:`nearest`})},[Ge.isOpen,ot,ct]);let ht=(0,K.useCallback)(e=>{e.stopPropagation(),rt()},[rt]),_t=(0,K.useCallback)(()=>D?(0,q.jsx)(Nj,{ref:we,id:xe,label:t(`@astryx.selector.searchOptions`),clearLabel:t(`@astryx.textInput.clearLabel`,{label:t(`@astryx.selector.searchOptions`)}),...O(`selector-search`),xstyle:_!==`ghost`&&qj.searchRowInput,role:`combobox`,"aria-expanded":Ge.isOpen,"aria-controls":_e,"aria-autocomplete":`list`,"aria-activedescendant":Ge.isOpen&&ot>=0?ct(ot):void 0,value:Ee,onValueChange:Je,onContainerKeyDown:e=>{e.target!==we.current&&e.key===`Tab`&&!e.shiftKey&&ut(e)},onKeyDown:e=>{if(!M(e.nativeEvent)){if(e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`PageUp`||e.key===`PageDown`||e.key===`Enter`||e.key===`Escape`){ut(e);return}e.key===`Tab`&&(e.shiftKey||!Oe)&&ut(e)}},placeholder:se}):null,[D,xe,_e,Ee,Oe,se,Je,ut,Ge.isOpen,ot,ct,_,t]),vt=Io(`check`),yt=(0,K.useCallback)((e,t)=>{let n=t===ot,r=e.value===me,i=(0,q.jsx)(`span`,{className:`x3nfvp2 x6s0dn4 xl56j7k x2lah0s xgomdpo`,children:(0,q.jsx)(vt,{state:r?`checked`:`unchecked`,size:`sm`,isDisabled:e.disabled??!1,...O(`selector-check`)})}),a=(0,q.jsx)(`span`,{className:`x78zum5 x6s0dn4 x1txdalj x98rzlu xeuugli`,children:C?C(e):(0,q.jsx)($j,{option:e})}),o=E===`start`?(0,q.jsxs)(q.Fragment,{children:[i,a]}):(0,q.jsxs)(q.Fragment,{children:[a,i]});return(0,q.jsx)(`div`,{id:ct(t),role:`option`,"aria-selected":r,"aria-disabled":e.disabled,onClick:()=>dt(e),onMouseEnter:()=>ft(e,t),...H(O(`selector-option-row`,{size:de,selected:r?`selected`:null,disabled:e.disabled?`disabled`:null}),w(qj.item,Yj[de],n&&qj.itemHighlighted,r&&qj.itemSelected,e.disabled&&qj.itemDisabled)),children:o},e.value)},[C,E,ot,de,me,ct,dt,ft,vt]),bt=(0,K.useCallback)(()=>{let e=D&&!!Ee;if(Be.length===0&&!m)return[(0,q.jsx)(`div`,{role:`presentation`,...H(O(`selector-empty-state`),{className:`x1b2ylru x2b8uid xv1l7n4 x9ynric xcr08ib`}),children:e?le:ce},`empty`)];let t=0,n=[];for(let r=0;r{Se.current=e,Ge.triggerRef(e),Fe.ref(e)},onClick:lt,"data-testid":I,...H(O(`selector`,{variant:_,size:de,status:v?.type??null,disabled:s?`disabled`:null}),w(BO.base,qj.triggerContainer,Jj[de],_===`ghost`&&qj.triggerGhost,_===`ghost`&&rn.backgroundImage,_===`ghost`&&fe.focusWithin,s&&BO.disabled,_===`ghost`&&s&&qj.triggerGhostDisabled,!He&&qj.triggerPlaceholder,_!==`ghost`&&v&&VO[v.type],_!==`ghost`&&v&&!s&&HO[v.type],_!==`ghost`&&Te&&JO.inGroup,Te&&qj.triggerInGroup,L),te,z),children:[x&&xa(x,{size:`sm`,color:`secondary`}),Te&&(0,q.jsx)(Kt,{id:be,children:n}),(0,q.jsx)(`button`,{ref:Ce,id:ge,type:`button`,role:D?void 0:`combobox`,...re,"aria-haspopup":`listbox`,"aria-expanded":Ge.isOpen,"aria-controls":_e,"aria-activedescendant":!D&&Ge.isOpen&&ot>=0?ct(ot):void 0,"aria-describedby":Re,"aria-labelledby":Le,"aria-required":V?`true`:void 0,"aria-invalid":v?.type===`error`?`true`:void 0,"aria-busy":G||void 0,disabled:s&&!Pe,"aria-disabled":Pe?`true`:void 0,onKeyDown:mt,tabIndex:s&&!Pe?-1:0,...{0:{className:`x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x16khyan x1a2a7pz`},1:{className:`x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x16khyan x1a2a7pz xkh2ocl`}}[!!Te<<0],children:Ct}),S!=null&&(0,q.jsx)(`input`,{type:`hidden`,name:S,value:u??``,disabled:s}),G&&(0,q.jsx)(Gt,{size:`sm`}),ue&&u!=null&&!s&&(0,q.jsx)(qO,{...Ke,label:t(`@astryx.selector.clearLabel`,{label:n}),onClick:ht,iconClassName:ie(`selector-clear-icon`)}),xt?St?(0,q.jsx)(`button`,{ref:Ie.ref,type:`button`,"aria-label":t(Qj[v.type]),"aria-describedby":Ie.describedBy,...Ke,onClick:e=>e.stopPropagation(),...w(fe.focusVisible,qj.statusButton),children:(0,q.jsx)(ya,{icon:Xj[v.type],size:`sm`,color:Zj[v.type],xstyle:qj.triggerIcon})}):(0,q.jsx)(ya,{icon:Xj[v.type],size:`sm`,color:Zj[v.type],xstyle:qj.triggerIcon}):(0,q.jsx)(ya,{icon:`chevronDown`,size:`sm`,color:`secondary`,xstyle:[qj.triggerIcon,qj.triggerIconRotation,Ge.isOpen&&qj.triggerIconOpen],...O(`selector-indicator-icon`,{state:Ge.isOpen?`expanded`:`collapsed`})})]}),Ge.render(D?(0,q.jsxs)(`div`,{children:[_t(),(0,q.jsx)(Ga,{}),(0,q.jsx)(`div`,{ref:Ue,id:_e,role:`listbox`,"aria-labelledby":ge,...{0:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj x1hc1fzr x1ey1afo`},1:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x1hc1fzr x1ey1afo x2hg6jq`}}[(_!==`ghost`)<<0],children:bt()})]}):(0,q.jsx)(`div`,{ref:Ue,id:_e,role:`listbox`,"aria-labelledby":ge,...{0:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj x1hc1fzr x1ey1afo`},2:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x1hc1fzr x1ey1afo x2hg6jq`},1:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj xg01cxk xq2gx43`},3:{className:`x9f619 xuyqlj2 x1odjw0f xu0wf1k x2hg6jq xg01cxk xq2gx43`}}[(_!==`ghost`)<<1|!et<<0],children:bt()}),{placement:tt,alignment:`start`,offset:Xe?void 0:p[`--spacing-1`],xstyle:[qj.popover,R[tt]],style:nt}),St&&Ie.renderTooltip(v?.message??``),Pe&&Fe.renderTooltip(c)]});return Te?wt:(0,q.jsx)(zO,{label:n,isLabelHidden:r,description:i,inputID:ge,descriptionID:i?ve:void 0,isOptional:a,isRequired:o,isDisabled:s,status:v?{type:v.type,message:v.message,messageID:v.message?ye:void 0}:void 0,statusVariant:pe,labelTooltip:b,width:ee,children:wt})}nM.displayName=`Selector`;function rM(e){return e?.status===`running`||e?.status===`cancelling`}function iM({sessionId:e,auth:t,busy:n,onSaving:r,onAuthenticated:i,onReload:a}){let{t:o}=W(),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(!1),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(0),[_,v]=(0,K.useState)(``),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(!1),T=(0,K.useRef)(!1),E=(0,K.useRef)(null),D=(0,K.useRef)(!1),O=(0,K.useRef)(0),k=(0,K.useRef)(null),A=(0,K.useRef)({onSaving:r,onAuthenticated:i});A.current={onSaving:r,onAuthenticated:i};let j=rM(s),M=t.id,N=`${e}:${M}`,P=(0,K.useRef)({key:N});P.current.key!==N&&(P.current={key:N});let F=P.current,I=(0,K.useCallback)((t,n)=>{if(t&&(t.sessionId!==e||t.provider!==M||n&&t.id!==n))throw Error(`Login ownership changed`);if(n&&!t)throw Error(`Login status unavailable`);if(!T.current||P.current!==F){t&&rM(t)&&new de().cancelProviderLogin(e,t.id).catch(()=>void 0);return}E.current=t,c(t),m(!1),t?.status===`succeeded`&&!t.refreshRequired&&k.current!==t.id&&(k.current=t.id,A.current.onAuthenticated())},[e,M,F]);(0,K.useEffect)(()=>{T.current=!0,E.current=null,D.current=!1,k.current=null,c(null),u(!1),f(!1),m(!1),b(!1),w(!1);let t=new AbortController,n=O.current;return new de().providerLogin(e,void 0,t.signal).then(e=>{!t.signal.aborted&&n===O.current&&!D.current&&e?.provider===M&&rM(e)&&I(e)}).catch(()=>void 0),()=>{T.current=!1,t.abort();let n=E.current;n&&rM(n)&&new de().cancelProviderLogin(e,n.id).catch(()=>void 0),A.current.onSaving(!1)}},[e,M,I]),(0,K.useEffect)(()=>{A.current.onSaving(j||l)},[j,l]);let ee=s?.prompt?.id;(0,K.useEffect)(()=>{v(``)},[ee]);let L=s?.id;(0,K.useEffect)(()=>{b(!1)},[L]),(0,K.useEffect)(()=>{if(l||D.current||!j||!L)return;let t=new AbortController,n=O.current,r=0,i=async()=>{try{let a=await new de().providerLogin(e,L,t.signal);if(t.signal.aborted||n!==O.current||D.current)return;I(a,L),rM(a)&&(r=window.setTimeout(()=>void i(),900))}catch{!t.signal.aborted&&n===O.current&&!D.current&&m(!0)}};return i(),()=>{t.abort(),clearTimeout(r)}},[e,I,L,j,l,h]);let R=async(e,t)=>{if(!D.current){D.current=!0,O.current++,u(!0),f(!1);try{I(await e(),t)}catch{T.current&&P.current===F&&f(!0)}finally{P.current===F&&(D.current=!1,O.current++,T.current&&(u(!1),g(e=>e+1)))}}},te=()=>{n||j||R(()=>new de().startProviderLogin(e,M))},z=t=>{let n=s?.prompt;if(!s||!n)return;let r=s.id;R(()=>new de().respondProviderLogin(e,r,n.id,t))},B=()=>{let t=s?.id;return R(()=>new de().providerLogin(e,t),t)},ne=s?.prompt,re=s?.auth||s?.device,V=ne&&ne.type!==`select`&&(0,q.jsxs)(`div`,{className:`models-login-input`,children:[(0,q.jsxs)(`label`,{className:`models-field`,children:[ne.type===`manual_code`?o(`accountLoginPaste`):ne.message,(0,q.jsx)(`input`,{type:ne.type===`secret`||ne.type===`manual_code`?`password`:`text`,autoComplete:`off`,spellCheck:!1,value:_,maxLength:8192,placeholder:ne.placeholder,disabled:l||s.status!==`running`,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key!==`Enter`||e.nativeEvent.isComposing||(e.preventDefault(),(ne.type===`text`||_.trim())&&z(_))}})]}),(0,q.jsx)(`button`,{type:`button`,className:`models-button primary`,disabled:l||ne.type!==`text`&&!_.trim()||s.status!==`running`,onClick:()=>z(_),children:o(`accountLoginContinue`)})]});return(0,q.jsxs)(`div`,{className:`models-account-login`,children:[!j&&!C&&(!s||[`failed`,`expired`,`cancelled`].includes(s.status))&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`models-login-intro`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:M===`openai`?o(`accountLoginChatGPT`):M===`anthropic`?o(`accountLoginClaude`):t.loginLabel||t.name}),(0,q.jsx)(`p`,{className:`models-hint`,children:o(t.subscription?`accountLoginExisting`:`accountLoginIntro`)})]})}),(0,q.jsxs)(`div`,{className:`models-login-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button primary`,disabled:n||l||d,onClick:te,children:o(t.subscription?`accountLoginAgain`:`accountLoginStart`)}),t.subscription&&(0,q.jsx)(`button`,{type:`button`,className:`models-link`,disabled:n||l,onClick:()=>S(!0),children:o(`accountLogout`)})]})]}),j&&(0,q.jsxs)(`div`,{className:`models-login-flow`,children:[(0,q.jsxs)(`div`,{className:`models-login-status`,role:`status`,children:[(0,q.jsx)(rc,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o(s?.status===`cancelling`?`accountLoginCancelling`:re?`accountLoginWaiting`:ne?`accountLoginChoose`:`accountLoginStarting`)})]}),re&&(0,q.jsx)(`p`,{className:`models-hint`,children:o(s?.device?`accountLoginDeviceHelp`:`accountLoginBrowserHelp`)}),s?.device&&(0,q.jsxs)(`div`,{className:`models-device-code`,children:[(0,q.jsx)(`code`,{children:s.device.code}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":o(`accountLoginCopyCode`),onClick:()=>{s.device&&navigator.clipboard.writeText(s.device.code).then(()=>{T.current&&P.current===F&&b(!0)}).catch(()=>{T.current&&P.current===F&&b(!1)})},children:y?(0,q.jsx)(rs,{}):(0,q.jsx)(Ss,{})})]}),re&&(0,q.jsxs)(`a`,{className:`models-button primary models-login-open`,href:s?.device?.url||s?.auth?.url,target:`_blank`,rel:`noopener noreferrer`,children:[o(`accountLoginOpen`),(0,q.jsx)(Yo,{"aria-hidden":`true`})]}),ne?.type===`select`&&(0,q.jsx)(`fieldset`,{className:`models-login-options`,"aria-label":ne.message,children:ne.options?.map(e=>{let t=[`openai`,`openai-codex`].includes(M)&&[`browser`,`device_code`].includes(e.id);return(0,q.jsxs)(`button`,{type:`button`,className:`models-login-option`,disabled:l||s?.status!==`running`,onClick:()=>z(e.id),children:[(0,q.jsx)(`strong`,{children:t?o(e.id===`browser`?`accountLoginBrowser`:`accountLoginDevice`):e.label}),(t||e.description)&&(0,q.jsx)(`span`,{children:t?o(e.id===`browser`?`accountLoginBrowserOption`:`accountLoginDeviceOption`):e.description})]},e.id)})}),ne?.type===`manual_code`&&re?(0,q.jsxs)(`details`,{className:`models-login-fallback`,children:[(0,q.jsx)(`summary`,{children:o(`accountLoginFallback`)}),(0,q.jsx)(`p`,{className:`models-hint`,children:o(`accountLoginRemoteHelp`)}),V]}):V,s?.messages.map(e=>(0,q.jsxs)(`div`,{className:`models-hint`,children:[(0,q.jsx)(`p`,{children:e.message}),e.links?.map(e=>(0,q.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.label,(0,q.jsx)(Yo,{"aria-hidden":`true`})]},e.url))]},e.id)),(0,q.jsx)(`button`,{type:`button`,className:`models-link models-login-cancel`,disabled:l||s?.status===`cancelling`,onClick:()=>{s&&R(()=>new de().cancelProviderLogin(e,s.id))},children:o(`accountLoginCancel`)})]}),s?.status===`succeeded`&&s.refreshRequired&&(0,q.jsxs)(`p`,{className:`models-hint`,role:`status`,children:[o(`accountLoginRefreshRequired`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:a,children:o(`refreshStatus`)})]}),C&&(0,q.jsxs)(`p`,{className:`models-hint`,role:`status`,children:[o(`accountLogoutRefreshRequired`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:a,children:o(`refreshStatus`)})]}),s&&[`failed`,`expired`,`cancelled`].includes(s.status)&&(0,q.jsx)(`p`,{className:s.status===`failed`?`models-error`:`models-hint`,role:`status`,children:o(`accountLogin_${s.status}`)}),d&&(0,q.jsxs)(`p`,{className:`models-error`,role:`alert`,children:[o(`accountLoginRequestFailed`),(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:()=>void B(),children:o(`refreshStatus`)})]}),p&&(0,q.jsxs)(`p`,{className:`models-error`,role:`alert`,children:[o(`accountLoginStatusUnknown`),(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:()=>g(e=>e+1),children:o(`refreshStatus`)})]}),x&&(0,q.jsx)(uj,{isOpen:!0,title:o(`accountLogoutTitle`,{provider:t.name}),description:o(`accountLogoutDetail`),cancelLabel:o(`cancel`),actionLabel:o(`accountLogout`),isActionLoading:l,onOpenChange:e=>{!e&&!l&&S(!1)},onAction:()=>{D.current||n||(D.current=!0,O.current++,u(!0),f(!1),new de().logoutProvider(e,M).then(e=>{!T.current||P.current!==F||(S(!1),e.refreshRequired?w(!0):a())}).catch(()=>{T.current&&P.current===F&&(S(!1),f(!0))}).finally(()=>{P.current===F&&(D.current=!1,O.current++,T.current&&(u(!1),g(e=>e+1)))}))}})]})}var aM={assign:0,create:0,clone:0,discard:0,update:0};function oM(e){return Array.isArray(e)}function sM(e){return mM(typeof e,`bigint`)}function cM(e){return mM(typeof e,`boolean`)}function lM(e){return mM(e,null)}function uM(e){return Number.isFinite(e)}function dM(e){return fM(e)&&!oM(e)}function fM(e){return mM(typeof e,`object`)&&!lM(e)}function pM(e){return mM(typeof e,`string`)}function mM(e,t){return e===t}function hM(e,t){return e>t}function gM(e,t){return eHM(e))}function RM(e){return e.slice()}function zM(e){return new RegExp(e.source,e.flags)}function BM(e){return new Map(HM([...e.entries()]))}function VM(e){return new Set(HM([...e.values()]))}function HM(e){return wM(e)?RM(e):TM(e)?zM(e):DM(e)?BM(e):EM(e)?VM(e):oM(e)?LM(e):fM(e)?IM(e):e}function UM(e){return aM.clone+=1,HM(e)}function WM(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function GM(e,t){return{...e,...t}}function KM(e,t,n={}){aM.create+=1;let r=GM(t,n);return AM(kM().enumerableKind?GM(r,e):WM(r,e))}function qM(e,t){aM.discard+=1;let n={};for(let r of xM(e)){if(t.includes(r))continue;let i=Object.getOwnPropertyDescriptor(e,r);i.value=UM(i.value),Object.defineProperty(n,r,i)}return AM(n)}function JM(e,t,n){aM.update+=1;let r=kM(),i=UM(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return AM(i)}function YM(e,t){return fM(e)&&bM(e,`~kind`)&&mM(e[`~kind`],t)}function XM(e){return fM(e)}function ZM(e,t,n){return KM({"~kind":`Deferred`},{type:`deferred`,action:e,parameters:t,options:n},{})}function QM(e){return YM(e,`Deferred`)}function $M(e){return JM(e,{"~readonly":!0},{})}function eN(e,t){return JM($M(e),{},t)}function tN(e,t,n,r){return eN(BU(e,t,n),r)}function nN(e){return JM(e,{"~optional":!0},{})}function rN(e,t){return JM(nN(e),{},t)}function iN(e,t,n,r){return rN(BU(e,t,n),r)}function aN(e,t){return KM({"~kind":`Array`},{type:`array`,items:e},t)}function oN(e){return YM(e,`Array`)}function sN(e){return qM(e,[`~kind`,`type`,`items`])}function cN(e,t,n={}){return KM({"~kind":`Constructor`},{type:`constructor`,parameters:e,instanceType:t},n)}function lN(e){return YM(e,`Constructor`)}function uN(e){return qM(e,[`~kind`,`type`,`parameters`,`instanceType`])}function dN(e,t,n={}){return KM({"~kind":`Function`},{type:`function`,parameters:e,returnType:t},n)}function fN(e){return YM(e,`Function`)}function pN(e){return qM(e,[`~kind`,`type`,`parameters`,`returnType`])}function mN(e,t){return KM({"~kind":`Ref`},{$ref:e},t)}function hN(e){return YM(e,`Ref`)}function gN(e,t){return KM({"~kind":`Generic`},{type:`generic`,parameters:e,expression:t})}function _N(e){return YM(e,`Generic`)}function vN(e){return KM({"~kind":`Any`},{},e)}function yN(e){return YM(e,`Any`)}var bN=`(?!)`;function xN(e){return KM({"~kind":`Never`},{not:{}},e)}function SN(e){return YM(e,`Never`)}function CN(e,t={}){return rN(e,t)}function wN(e){return CN(e)}function TN(e){return XM(e)&&bM(e,`~optional`)}function EN(e){return xM(e).filter(t=>!TN(e[t]))}function DN(e){return xM(e)}function ON(e){return CM(e)}function kN(e,t={}){let n=EN(e);return KM({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}function AN(e){return YM(e,`Object`)}function jN(e){return qM(e,[`~kind`,`type`,`properties`,`required`])}function MN(e){return KM({"~kind":`Unknown`},{},e)}function NN(e){return YM(e,`Unknown`)}function PN(e,t,n){return KM({"~kind":`Cyclic`},{$defs:xM(e).reduce((t,n)=>({...t,[n]:JM(e[n],{},{$id:n})}),{}),$ref:t},n)}function FN(e){return YM(e,`Cyclic`)}function IN(e){return dM(e)&&bM(e,`~unsafe`)&&lM(e[`~unsafe`])}function LN(e){return YM(e,`Infer`)}function RN(e,t,n,r={}){return KM({"~kind":`Dependent`},{if:e,then:t,else:n},r)}function zN(e){return YM(e,`Dependent`)}function BN(e){return qM(e,[`~kind`,`if`,`then`,`else`])}function VN(e){return dM(e)}function HN(e){return xM(e).filter(e=>isNaN(e)).reduce((t,n)=>[...t,e[n]],[])}function UN(e,t){return KM({"~kind":`Enum`},{enum:VN(e)?HN(e):e},t)}function WN(e){return YM(e,`Enum`)}function GN(e,t={}){return KM({"~kind":`Intersect`},{allOf:e},t)}function KN(e){return YM(e,`Intersect`)}function qN(e){return qM(e,[`~kind`,`allOf`])}function JN(){throw Error(`Unreachable`)}var YN;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(YN||={}),Array.from({length:256}).map((e,t)=>BigInt(t));var XN=new Float64Array(1);new DataView(XN.buffer),new Uint8Array(XN.buffer),new TextEncoder;function ZN(e){return XM(e)&&bM(e,`~immutable`)}function QN(e,t={}){return eN(e,t)}function $N(e){return XM(e)&&bM(e,`~readonly`)}var eP=`-?(?:0|[1-9][0-9]*)n`;function tP(e){return KM({"~kind":`BigInt`},{type:`bigint`},e)}function nP(e){return YM(e,`BigInt`)}function rP(e){return YM(e,`Boolean`)}var iP=`-?(?:0|[1-9][0-9]*)`;function aP(e){return KM({"~kind":`Integer`},{type:`integer`},e)}function oP(e){return YM(e,`Integer`)}var sP=class extends Error{constructor(e){super(`Invalid Literal value`),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function cP(e){return sM(e)?`bigint`:cM(e)?`boolean`:uM(e)?`number`:pM(e)?`string`:(()=>{throw new sP(e)})()}function lP(e,t){return KM({"~kind":`Literal`},{type:cP(e),const:e},t)}function uP(e){return sM(e)||cM(e)||uM(e)||pM(e)}function dP(e){return pP(e)&&uM(e.const)}function fP(e){return pP(e)&&pM(e.const)}function pP(e){return YM(e,`Literal`)}function mP(e){return KM({"~kind":`Null`},{type:`null`},e)}function hP(e){return YM(e,`Null`)}var gP=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function _P(e){return KM({"~kind":`Number`},{type:`number`},e)}function vP(e){return YM(e,`Number`)}function yP(e){return KM({"~kind":`Symbol`},{type:`symbol`},e)}function bP(e){return YM(e,`Symbol`)}function xP(e){return KM({"~kind":`String`},{type:`string`},e)}function SP(e){return YM(e,`String`)}function CP(e,t={}){return KM({"~kind":`Union`},{anyOf:e},t)}function wP(e){return YM(e,`Union`)}function TP(e){return qM(e,[`~kind`,`anyOf`])}function EP(e){let t=nL(e);return mM(t.length,2)?t[0]:[]}function DP(e){return!0}function OP(e){return vM(e,(e,t)=>AP(e)?OP(t):!1,()=>!0)}function kP(e){return!mM(e.length,0)&&OP(e)}function AP(e){return wP(e)?kP(e.anyOf):pP(e)?DP(e.const):!1}function jP(e){return kP(e)}function MP(e){return KM({"~kind":`TemplateLiteral`},{type:`string`,pattern:e},{})}function NP(e,t,n=[]){return vM(e,(e,r)=>NP(r,t,[...n,`${e}${t}`]),()=>n)}function PP(e,t){return mM(e.length,0)?[`${t}`]:NP(e,t)}function FP(e,t,n=[]){return vM(t,(t,r)=>FP(e,r,[...n,...IP(e,t)]),()=>n)}function IP(e,t){return wP(t)?FP(e,t.anyOf):pP(t)?PP(e,t.const):JN()}function LP(e,t){return vM(t,(t,n)=>LP(IP(e,t),n),()=>e)}function RP(e){return e.map(e=>lP(e))}function zP(e){return CP(RP(LP([],e)))}function BP(e){return mM(e.length,0)?JN():mM(e.length,1)&&pP(e[0])?e[0]:zP(e)}function VP(e){let t=EP(e);return mM(t.length,0)?xP():jP(t)?BP(t):MP(e)}function HP(e){let t=VP(e);return CL(t)?xP():t}function UP(e,t){return KM({"~kind":`Record`},{type:`object`,patternProperties:{[e]:t}})}function WP(e){return UP(XF,e)}function GP(e){return kN({true:e,false:e})}function KP(e,t={}){let[n,r,i]=[e,e.length,!1];return KM({"~kind":`Tuple`},{type:`array`,additionalItems:i,items:n,minItems:r},t)}function qP(e){return YM(e,`Tuple`)}function JP(e){return qM(e,[`~kind`,`type`,`items`,`minItems`,`additionalItems`])}function YP(e){return qM(e,[`~readonly`])}function XP(e,t){return JM(YP(e),{},t)}function ZP(e,t,n,r){return XP(BU(e,t,n),r)}function QP(e,t={}){return XP(e,t)}function $P(e){return qM(e,[`~optional`])}function eF(e,t){return JM($P(e),{},t)}function tF(e,t,n,r){return eF(BU(e,t,n),r)}function nF(e,t={}){return eF(e,t)}function rF(e){return e.reduceRight((e,t,n)=>({[n]:t,...e}),{})}function iF(e){return kN(rF(e.items))}function aF(e){return AN(e)||qP(e)}function oF(e,t){return $N(e)?!!$N(t):!1}function sF(e,t){return TN(e)?!!TN(t):!1}function cF(e,t){let n=oF(e,t),r=sF(e,t),i=QP(nF(EF([e,t])));return n&&r?QN(CN(i)):n&&!r?QN(i):!n&&r?CN(i):i}function lF(e,t,n){return n in e?n in t?cF(e[n],t[n]):e[n]:n in t?t[n]:xN()}function uF(e,t){return[...new Set([...xM(e),...xM(t)])].reduce((n,r)=>({...n,[r]:lF(e,t,r)}),{})}function dF(e){return AN(e)?e.properties:qP(e)?rF(e.items):{}}function fF(e,t){return kN(uF(dF(e),dF(t)))}function pF(e,t){let n=Dz(e,t);return mM(n,2)?e:mM(n,3)||mM(n,0)?t:xN()}function mF(e,t){let n=aF(e),r=aF(t);return n&&r?fF(e,t):n&&!r?e:!n&&r?t:pF(e,t)}function hF(e,t){return SN(e)||yN(e)?e:NN(e)||SN(t)||yN(t)?t:NN(t)?e:mF(e,t)}function gF(e,t){return wP(e)||wP(t)}function _F(e,t){let n=kF(e),r=kF(t);return gF(n,r)?EF([n,r]):hF(n,r)}function vF(e,t,n=[]){return vM(t,(t,r)=>vF(e,r,[...n,_F(t,e)]),()=>mM(n.length,0)?[e]:n)}function yF(e,t,n=[]){return vM(e,(e,r)=>yF(r,t,[...n,...bF([e],t)]),()=>n)}function bF(e,t=[]){return vM(e,(e,n)=>wP(e)?bF(n,yF(e.anyOf,t)):bF(n,vF(e,t)),()=>t)}function xF(e,t){return AL(Ez({},e,t))?[]:[e]}function SF(e,t,n=[]){return vM(e,(e,r)=>SF(r,t,[...n,...xF(e,t)]),()=>n)}function CF(e,t){let n=kF(e);return OF(SF(wP(n)?n.anyOf:[n],t))}function wF(e,t,n){return OF([EF([e,t]),CF(n,e)])}function TF(e,t=[]){return vM(e,(e,n)=>TF(n,[...t,lP(e)]),()=>OF(t))}function EF(e){return OF(jz(bF(e)))}function DF(e){return kF(HP(e))}function OF(e){return AF(jz(e))}function kF(e){return zN(e)?wF(e.if,e.then,e.else):WN(e)?TF(e.enum):KN(e)?EF(e.allOf):CL(e)?DF(e.pattern):wP(e)?OF(e.anyOf):e}function AF(e){return mM(e.length,1)?e[0]:mM(e.length,0)?xN():CP(e)}function jF(e,t){return GF(TF(e),t)}function MF(e,t){return UP(JF,t)}function NF(e,t){return GF(EF(e),t)}function PF(e,t){return pM(e)||uM(e)?kN({[e]:t}):mM(e,!1)?kN({false:t}):mM(e,!0)?kN({true:t}):kN({})}function FF(e,t){return UP(YF,t)}function IF(e,t){return bM(e,`pattern`)&&(pM(e.pattern)||e.pattern instanceof RegExp)?UP(e.pattern.toString(),t):UP(XF,t)}function LF(e,t){return jP(EP(e))?GF(DF(e),t):UP(e,t)}function RF(e){return wP(e)?zF(e.anyOf):[e]}function zF(e,t=[]){return vM(e,(e,n)=>zF(n,[...t,...RF(e)]),()=>t)}function BF(e){return e.some(e=>SP(e)||vP(e)||oP(e))}function VF(e,t){return mM(BF(e),!0)?UP(XF,t):void 0}function HF(e,t){return e.reduce((e,n)=>pP(n)&&(pM(n.const)||uM(n.const))?{...e,[n.const]:t}:e,{})}function UF(e,t){return kN(HF(e,t))}function WF(e,t){let n=zF(e),r=VF(n,t);return XM(r)?r:UF(n,t)}function GF(e,t){return yN(e)?WP(t):rP(e)?GP(t):WN(e)?jF(e.enum,t):oP(e)?MF(e,t):KN(e)?NF(e.allOf,t):pP(e)?PF(e.const,t):vP(e)?FF(e,t):wP(e)?WF(e.anyOf,t):SP(e)?IF(e,t):CL(e)?LF(e.pattern,t):kN({})}function KF(e,t,n){return NU([e])?JM(GF(e,t),{},n):ZF(e,t,n)}function qF(e,t,n,r,i){return KF(BU(e,t,n),BU(e,t,r),i)}var JF=`^${iP}$`,YF=`^${gP}$`,XF=`^.*$`;function ZF(e,t,n={}){return ZM(`Record`,[e,t],n)}function QF(e,t,n={}){return KF(e,t,n)}function $F(e,t){return UP(e,t)}function eI(e){return mM(e,XF)?xP():mM(e,JF)?aP():mM(e,YF)?_P():VP(e)}function tI(e){return xM(e.patternProperties)[0]}function nI(e){return eI(tI(e))}function rI(e){return e.patternProperties[tI(e)]}function iI(e){return YM(e,`Record`)}function aI(e){return KM({"~kind":`Rest`},{type:`rest`,items:e},{})}function oI(e){return YM(e,`Rest`)}function sI(e){return YM(e,`This`)}function cI(e){return KM({"~kind":`Undefined`},{type:`undefined`},e)}function lI(e){return YM(e,`Undefined`)}function uI(e){return YM(e,`Void`)}function dI(e){return tP()}function fI(e){return xP()}function pI(e){return _P()}function mI(e){return aP()}function hI(e){return xN()}function gI(e){return lP(e)}function _I(e){return e}function vI(e){return CP(e[1])}function yI(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function bI(e){return[e[0],...e[1]]}function xI(e){return e}function SI(e){return e[1]}function CI(e){return mM(e.length,2)}function wI(e,t,n){return CI(e)?t(e[0],e[1]):n()}function TI(e,t){return mM(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function EI(e,t){for(let n=0;nString.fromCharCode(e+n))}var OI=[...DI(97,122),...DI(65,90)],kI=[`0`,...DI(49,57)],AI=`//`,jI=`/*`,MI=`*/`;function NI(e){let t=e.indexOf(MI);return mM(t,-1)?``:e.slice(t+2)}function PI(e){let t=e.indexOf(` `);return mM(t,-1)?``:e.slice(t)}function FI(e){return e.replace(/^[ \t\r\f\v]+/,``)}function II(e){let t=FI(e);return t.startsWith(jI)?II(NI(t.slice(2))):t.startsWith(AI)?II(PI(t.slice(2))):t}function LI(e){let t=e.trimStart();return t.startsWith(jI)?LI(NI(t.slice(2))):t.startsWith(AI)?LI(PI(t.slice(2))):t}[...kI];function RI(e,t){return EI([e],t)}function zI(e,t){return mM(e,``)?[``,t]:e.startsWith(` -`)?RI(e,II(t)):e.startsWith(` `)?RI(e,t):RI(e,LI(t))}[...OI,...kI],[...kI];function BI(e){return mM(e,``)?[]:[e.slice(0,1),e.slice(1)]}function VI(e,t){return vM(e,(e,n)=>t.startsWith(e)?!0:VI(n,t),()=>!1)}function HI(e,t,n=``){return wI(BI(t),(r,i)=>VI(e,t)?[n,t]:HI(e,i,`${n}${r}`),()=>[])}function UI(e,t){return wI(HI(e,t),(e,t)=>mM(e,``)?[]:[e,t],()=>[])}var WI=(e,t,n=()=>[])=>e.length===2?t(e):n(),GI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[dI(e),t]),KI=e=>WI(zI(`.*`,e),([e,t])=>[fI(e),t]),qI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,e),([e,t])=>[pI(e),t]),JI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[mI(e),t]),YI=e=>WI(zI(`(?!)`,e),([e,t])=>[hI(e),t]),XI=e=>WI(UI([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[gI(e),t]),ZI=e=>WI(WI(GI(e),([e,t])=>[e,t],()=>WI(KI(e),([e,t])=>[e,t],()=>WI(qI(e),([e,t])=>[e,t],()=>WI(JI(e),([e,t])=>[e,t],()=>WI(YI(e),([e,t])=>[e,t],()=>WI(QI(e),([e,t])=>[e,t],()=>WI(XI(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[_I(e),t]),QI=e=>WI(WI(zI(`(`,e),([e,t])=>WI(tL(t),([t,n])=>WI(zI(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[vI(e),t]),$I=e=>WI(WI(WI(eL(e),([e,t])=>WI(zI(`|`,t),([t,n])=>WI($I(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>WI(WI(eL(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>WI([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[yI(e),t]),eL=e=>WI(WI(ZI(e),([e,t])=>WI(tL(t),([t,n])=>[[e,t],n])),([e,t])=>[bI(e),t]),tL=e=>WI(WI($I(e),([e,t])=>[e,t],()=>WI(eL(e),([e,t])=>[e,t],()=>[])),([e,t])=>[xI(e),t]),nL=e=>WI(WI(zI(`^`,e),([e,t])=>WI(tL(t),([t,n])=>WI(zI(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[SI(e),t]);function rL(e){return e.join(`|`)}function iL(e){return e.slice(1,e.length-1)}function aL(e,t,n){return gL(t,`${n}${e}`)}function oL(e,t){return gL(e,`${t}${eP}`)}function sL(e,t){return gL(e,`${t}${iP}`)}function cL(e,t){return gL(e,`${t}${gP}`)}function lL(e,t){return hL(CP([lP(`false`),lP(`true`)]),e,t)}function uL(e,t){return gL(e,`${t}.*`)}function dL(e,t,n){return gL(t,`${n}${iL(e)}`)}function fL(e,t,n){return hL(yL(e,{}),t,n)}function pL(e,t,n){return hL(TF(e),t,n)}function mL(e,t,n,r=[]){return vM(e,(e,i)=>mL(i,t,n,[...r,hL(e,[],``)]),()=>gL(t,`${n}(${rL(r)})`))}function hL(e,t,n){return WN(e)?pL(e.enum,t,n):oP(e)?sL(t,n):pP(e)?aL(e.const,t,n):nP(e)?oL(t,n):rP(e)?lL(t,n):vP(e)?cL(t,n):SP(e)?uL(t,n):CL(e)?dL(e.pattern,t,n):SL(e)?fL(e.parameters[0],t,n):wP(e)?mL(e.anyOf,t,n):bN}function gL(e,t){return vM(e,(e,n)=>hL(e,n,t),()=>t)}function _L(e){return`^${gL(e,``)}$`}function vL(e){return MP(_L(e))}function yL(e,t){return NU(e)?JM(vL(e),{},t):xL(e,t)}function bL(e,t,n,r){return yL(IU(e,t,n),r)}function xL(e,t={}){return ZM(`TemplateLiteral`,[e],t)}function SL(e){return XM(e)&&bM(e,`action`)&&mM(e.action,`TemplateLiteral`)}function CL(e){return YM(e,`TemplateLiteral`)}function wL(e){return KM({"~kind":`ExtendsUnion`},{inferred:e})}function TL(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`inferred`)&&mM(e[`~kind`],`ExtendsUnion`)&&fM(e.inferred)}function EL(e){return KM({"~kind":`ExtendsTrue`},{inferred:e})}function DL(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`inferred`)&&mM(e[`~kind`],`ExtendsTrue`)&&fM(e.inferred)}function OL(){return KM({"~kind":`ExtendsFalse`},{})}function kL(e){return fM(e)&&bM(e,`~kind`)&&mM(e[`~kind`],`ExtendsFalse`)}function AL(e){return TL(e)||DL(e)}function jL(e,t,n){return AL(e)?t(e.inferred):n()}function ML(e,t,n,r){return jL(XR(e,n,r),r=>EL(jM(jM(e,r),{[t]:n})),()=>OL())}function NL(e,t){return EL(e)}function PL(e,t,n,r,i){return jL(XR(e,t,n),e=>jL(XR(e,t,r),e=>EL(e),()=>OL()),()=>jL(XR(e,t,i),e=>EL(e),()=>OL()))}function FL(e,t,n){return XR(e,t,TF(n))}function IL(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>IL(e,t,r),()=>OL()),()=>EL(e))}function LL(e,t,n){return XR(e,t,DF(n))}function RL(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>EL(e),()=>RL(e,t,r)),()=>OL())}function zL(e,t,n){return yN(n)?NL(e,t):zN(n)?PL(e,t,n.if,n.then,n.else):WN(n)?FL(e,t,n.enum):LN(n)?ML(e,n.name,t,n.extends):KN(n)?IL(e,t,n.allOf):CL(n)?LL(e,t,n.pattern):wP(n)?RL(e,t,n.anyOf):NN(n)?EL(e):OL()}function BL(e,t,n){return LN(n)?zL(e,t,n):yN(n)||NN(n)?EL(e):wL(e)}function VL(e,t){let n=ZN(e),r=ZN(t);return n&&r||!n&&r?!0:!(n&&!r)}function HL(e,t,n,r){return oN(r)?VL(t,r)?XR(e,n,r.items):OL():zL(e,t,r)}function UL(e,t,n){return nP(n)?EL(e):zL(e,t,n)}function WL(e,t,n){return rP(n)?EL(e):zL(e,t,n)}function GL(e,t,n,r,i){let a=LN(r)?t:r,o=LN(r)?r:t,s=TN(t),c=TN(r);return!s&&c?OL():jL(XR(e,a,o),e=>JL(e,n,i),()=>OL())}function KL(e,t,n,r){return vM(r,(r,i)=>GL(e,t,n,r,i),()=>TN(t)?EL(e):OL())}function qL(e,t,n){return vM(t,(t,r)=>KL(e,t,r,n),()=>EL(e))}function JL(e,t,n){return qL(e,t,n)}function YL(e,t,n){return uI(n)?EL(e):XR(e,t,n)}function XL(e,t,n,r){return yN(r)||NN(r)?EL(e):lN(r)?jL(JL(e,t,r.parameters),e=>YL(e,n,r.instanceType),()=>OL()):OL()}function ZL(e,t,n,r,i){return jL(XR(e,t,i),()=>XR(e,n,i),()=>XR(e,r,i))}function QL(e,t,n){return XR(e,TF(t),n)}function $L(e,t,n,r){return yN(r)||NN(r)?EL(e):fN(r)?jL(JL(e,t,r.parameters),e=>YL(e,n,r.returnType),()=>OL()):OL()}function eR(e,t,n){return oP(n)||vP(n)?EL(e):zL(e,t,n)}function tR(e,t,n){return XR(e,EF(t),n)}function nR(e,t,n){return t===n?EL(e):OL()}function rR(e,t,n){return pP(n)?nR(e,t,n.const):nP(n)?EL(e):zL(e,lP(t),n)}function iR(e,t,n){return pP(n)?nR(e,t,n.const):rP(n)?EL(e):zL(e,lP(t),n)}function aR(e,t,n){return pP(n)?nR(e,t,n.const):vP(n)?EL(e):zL(e,lP(t),n)}function oR(e,t,n){return pP(n)?nR(e,t,n.const):SP(n)?EL(e):zL(e,lP(t),n)}function sR(e,t,n){return sM(t.const)?rR(e,t.const,n):cM(t.const)?iR(e,t.const,n):uM(t.const)?aR(e,t.const,n):pM(t.const)?oR(e,t.const,n):JN()}function cR(e,t,n){return LN(n)?zL(e,t,n):EL(e)}function lR(e,t,n){return hP(n)?EL(e):zL(e,t,n)}function uR(e,t,n){return vP(n)?EL(e):zL(e,t,n)}function dR(e,t,n){return TN(t)?TN(n)?EL(e):OL():EL(e)}function fR(e,t,n){return LN(n)&&SN(n.extends)?OL():jL(XR(e,t,n),e=>dR(e,t,n),()=>OL())}function pR(e,t){return e.reduce((e,n)=>n in t&&AL(t[n])?{...e,...t[n].inferred}:JN(),{})}function mR(e,t,n){let r={};for(let i of xM(n))r[i]=i in t?fR({},t[i],n[i]):TN(n[i])?LN(n[i])?EL(jM(e,{[n[i].name]:n[i].extends})):EL(e):OL();let i=CM(r).every(e=>AL(e)),a=i?pR(xM(r),r):{};return i?EL(a):OL()}function hR(e,t,n){let r=mR(e,t,n);return AL(r)?EL(jM(e,r.inferred)):OL()}function gR(e,t,n){return hR(e,t,n)}function _R(e,t){return xM(t).reduce((n,r)=>({...n,[r]:bM(e,r)?wP(n[r])?CP([...n[r].anyOf,t[r]]):CP([e[r],t[r]]):t[r]}),e)}function vR(e,t,n,r){return vM(t,(t,i)=>jL(XR({},e[t],n),t=>vR(e,i,n,_R(r,t)),()=>OL()),()=>EL(r))}function yR(e,t,n,r){return vR(t,xM(t),r,e)}function bR(e,t,n){return iI(n)?yR(e,t,tI(n),rI(n)):AN(n)?gR(e,t,n.properties):zL(e,kN(t),n)}function xR(e,t){return mM(xM(t).length,0)?EL(e):OL()}function SR(e,t,n,r,i){return XR(e,n,i)}function CR(e,t,n,r){return iI(r)?SR(e,eI(t),n,eI(tI(r)),rI(r)):AN(r)?xR(e,r.properties):yN(r)||NN(r)?EL(e):OL()}function wR(e,t,n){return SP(n)?EL(e):zL(e,t,n)}function TR(e,t,n){return bP(n)?EL(e):zL(e,t,n)}function ER(e,t,n){return XR(e,DF(t),n)}function DR(e,t){return KM({"~kind":`Inferrable`},{name:e,type:t},{})}function OR(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`name`)&&bM(e,`type`)&&mM(e[`~kind`],`Inferrable`)&&pM(e.name)&&fM(e.type)}function kR(e){return oI(e)?LN(e.items)?oN(e.items.extends)?DR(e.items.name,e.items.extends.items):NN(e.items.extends)?DR(e.items.name,e.items.extends):void 0:JN():void 0}function AR(e){return LN(e)?DR(e.name,e.extends):void 0}function jR(e,t,n=[]){return vM(e,(e,r)=>jL(XR({},e,t),()=>jR(r,t,[...n,e]),()=>void 0),()=>n)}function MR(e,t,n,r){let i=jR(n,r);return oM(i)?EL(jM(e,{[t]:KP(i)})):OL()}function NR(e,t,n,r){let i=jR(n,r);return oM(i)?EL(jM(e,{[t]:CP(i)})):OL()}function PR(e){return[...e].reverse()}function FR(e,t){return t?PR(e):e}function IR(e){let t=e.length>0?e[0]:void 0;return XM(XM(t)?kR(t):void 0)}function LR(e,t,n,r,i,a){return jL(XR(e,n,i),e=>BR(e,t,r,a),()=>OL())}function RR(e,t,n,r,i){let a=kR(r);return OR(a)?MR(e,a.name,FR(n,t),a.type):vM(n,(n,a)=>LR(e,t,n,a,r,i),()=>OL())}function zR(e,t,n,r){return vM(r,(r,i)=>RR(e,t,n,r,i),()=>mM(n.length,0)?EL(e):OL())}function BR(e,t,n,r){return zR(e,t,n,r)}function VR(e,t,n){let r=FU(e,MU([],[]),n),i=IR(r);return BR(e,i,FR(t,i),FR(r,i))}function HR(e,t,n){let r=AR(n);return OR(r)?NR(e,r.name,t,r.type):vM(t,(t,r)=>jL(XR(e,t,n),e=>HR(e,r,n),()=>OL()),()=>EL(e))}function UR(e,t,n){let r=FU(e,MU([],[]),t);return qP(n)?VR(e,r,n.items):oN(n)?HR(e,r,n.items):zL(e,KP(r),n)}function WR(e,t,n){return uI(n)||lI(n)?EL(e):zL(e,t,n)}function GR(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>EL(e),()=>GR(e,t,r)),()=>OL())}function KR(e,t,n){return vM(t,(t,r)=>jL(GR(e,t,n),e=>KR(e,r,n),()=>OL()),()=>EL(e))}function qR(e,t,n){let r=AR(n);return OR(r)?NR(e,r.name,t,r.type):wP(n)?KR(e,t,n.anyOf):KR(e,t,[n])}function JR(e,t,n){return LN(n)?zL(e,t,n):yN(n)||NN(n)?EL(e):OL()}function YR(e,t,n){return uI(n)?EL(e):zL(e,t,n)}function XR(e,t,n){return yN(t)?BL(e,t,n):oN(t)?HL(e,t,t.items,n):nP(t)?UL(e,t,n):rP(t)?WL(e,t,n):lN(t)?XL(e,t.parameters,t.instanceType,n):zN(t)?ZL(e,t.if,t.then,t.else,n):WN(t)?QL(e,t.enum,n):fN(t)?$L(e,t.parameters,t.returnType,n):oP(t)?eR(e,t,n):KN(t)?tR(e,t.allOf,n):pP(t)?sR(e,t,n):SN(t)?cR(e,t,n):hP(t)?lR(e,t,n):vP(t)?uR(e,t,n):AN(t)?bR(e,t.properties,n):iI(t)?CR(e,tI(t),rI(t),n):SP(t)?wR(e,t,n):bP(t)?TR(e,t,n):CL(t)?ER(e,t.pattern,n):qP(t)?UR(e,t.items,n):lI(t)?WR(e,t,n):wP(t)?qR(e,t.anyOf,n):NN(t)?JR(e,t,n):uI(t)?YR(e,t,n):OL()}function ZR(e,t){return EF([...e,kN(t)])}function QR(e,t,n){return NU(e)?JM(ZR(e,t),{},n):ez(e,t,n)}function $R(e,t,n,r,i){return QR(IU(e,t,n),PU(e,t,r),i)}function ez(e,t,n={}){return ZM(`Interface`,[e,t],n)}function tz(e){return XM(e)&&bM(e,`action`)&&mM(e.action,`Interface`)}function nz(e,t,n){return e.includes(n)?!0:az([...e,n],t,t[n])}function rz(e,t,n){return iz(e,t,ON(n))}function iz(e,t,n){return vM(n,(n,r)=>az(e,t,n)?!0:iz(e,t,r),()=>!1)}function az(e,t,n){return hN(n)?nz(e,t,n.$ref):oN(n)?az(e,t,n.items):lN(n)?iz(e,t,[...n.parameters,n.instanceType]):fN(n)?iz(e,t,[...n.parameters,n.returnType]):tz(n)?rz(e,t,n.parameters[1]):KN(n)?iz(e,t,n.allOf):AN(n)?rz(e,t,n.properties):wP(n)?iz(e,t,n.anyOf):qP(n)?iz(e,t,n.items):iI(n)?az(e,t,rI(n)):!1}function oz(e,t,n){return az(e,t,n)}function sz(e,t){return t.reduce((t,n)=>oz([n],e,e[n])?[...t,n]:t,[])}function cz(e){return sz(e,DN(e))}function lz(e,t,n){return n.includes(t)?n:t in e?fz(e,e[t],[...n,t]):JN()}function uz(e,t,n){return dz(e,ON(t),n)}function dz(e,t,n){return t.reduce((t,n)=>fz(e,n,t),n)}function fz(e,t,n){return hN(t)?lz(e,t.$ref,n):oN(t)?fz(e,t.items,n):lN(t)?dz(e,[...t.parameters,t.instanceType],n):fN(t)?dz(e,[...t.parameters,t.returnType],n):tz(t)?uz(e,t.parameters[1],n):KN(t)?dz(e,t.allOf,n):AN(t)?uz(e,t.properties,n):wP(t)?dz(e,t.anyOf,n):qP(t)?dz(e,t.items,n):iI(t)?fz(e,rI(t),n):n}function pz(e,t,n){return fz(e,n,[t])}function mz(e){return vN()}function hz(e){return xM(e).reduce((t,n)=>({...t,[n]:_z(e[n])}),{})}function gz(e){return e.reduce((e,t)=>[...e,_z(t)],[])}function _z(e){return hN(e)?mz(e.$ref):oN(e)?aN(_z(e.items),sN(e)):lN(e)?cN(gz(e.parameters),_z(e.instanceType)):fN(e)?dN(gz(e.parameters),_z(e.returnType)):KN(e)?GN(gz(e.allOf)):AN(e)?kN(hz(e.properties)):iI(e)?QF(nI(e),_z(rI(e))):wP(e)?CP(gz(e.anyOf)):qP(e)?KP(gz(e.items)):e}function vz(e,t){return t in e?_z(e[t]):MN()}function yz(e){return vz(e.$defs,e.$ref)}function bz(e,t,n){let r=IU(e,MU([],[]),t),i=PU({},MU([],[]),n);return EF([...r,kN(i)])}function xz(e,t){return xM(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=tz(r)?bz(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function Sz(e,t,n){return PN(xz(e,pz(e,t,n)),t)}function Cz(e,t){return t in e?hN(e[t])?Cz(e,e[t].$ref):e[t]:xN()}function wz(e,t){return Cz(e,t)}function Tz(e){return FN(e)?yz(e):IN(e)?MN():e}function Ez(e,t,n){return XR(e,Tz(t),Tz(n))}function Dz(e,t){let n=[Ez({},e,t),Ez({},t,e)];return AL(n[0])&&AL(n[1])?0:AL(n[0])&&kL(n[1])?2:kL(n[0])&&AL(n[1])?3:1}function Oz(e,t,n=[],r=t){return vM(t,(t,i)=>{let a=Dz(e,t);return mM(a,2)||mM(a,0)?r:mM(a,1)?Oz(e,i,[...n,t],r):Oz(e,i,n,r)},()=>[...n,e])}function kz(e,t,n){let r=kF(e);return yN(r)||NN(r)?[r]:SN(r)?Az(t,n):AN(r)?Az(t,[...n,r]):Az(t,Oz(r,n))}function Az(e,t=[]){return vM(e,(e,n)=>kz(e,n,t),()=>t)}function jz(e){return zF(Az(e))}function Mz(e,t){return JM(kF(e),{},t)}function Nz(e,t,n,r){return Mz(BU(e,t,n),r)}function Pz(e,t=[]){return QM(e)&&mM(e.action,`Conditional`)?hN(e.parameters[0])?Pz(e.parameters[2],Pz(e.parameters[3],[...t,e.parameters[0].$ref])):Pz(e.parameters[2],Pz(e.parameters[3],t)):QM(e)&&mM(e.action,`Mapped`)&&QM(e.parameters[1])&&mM(e.parameters[1].action,`KeyOf`)&&hN(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function Fz(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function Iz(e,t,n=[]){return vM(e,(e,r)=>vM(t,(t,i)=>Iz(r,i,[...n,[t,e]]),()=>n),()=>n)}function Lz(e){return CL(e)?DF(e.pattern):WN(e)?TF(e.enum):e}function Rz(e){let t=Lz(e);return wP(t)?[...t.anyOf]:[t]}function zz(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function Bz(e,t){return t.reduce((t,n)=>[...t,...zz(e,n)],[])}function Vz(e){return e.reduce((e,t)=>mM(t[0],!0)?Bz(e,Rz(t[1])):Bz(e,[t[1]]),[[]])}function Hz(e,t,n){let r=Iz(t,Fz(e,Pz(n)));return QM(n)&&mM(n.action,`Conditional`)||QM(n)&&mM(n.action,`Mapped`)?Vz(r):[t]}function Uz(){return[`(not-resolvable)`,xN()]}function Wz(){return[`(not-generic)`,xN()]}function Gz(e,t,n){return[e,gN(t,n)]}function Kz(e,t,n){return t in e?qz(e,t,e[t],n):Uz()}function qz(e,t,n,r){return _N(n)?Gz(t,n.parameters,n.expression):hN(n)?Kz(e,n.$ref,r):Wz()}function Jz(e,t,n){return qz(e,`(anonymous)`,t,n)}function Yz(e,t,n){if(LN(t)||fB(t)||AL(Ez({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function Xz(e,t,n,r,i){let a=BU(e,t,i);return Yz(n,a,r),jM(e,{[n]:a})}function Zz(e,t,n,r,i){let a=BU(e,t,n.extends),o=BU(e,t,n.equals);return vM(i,(i,o)=>Qz(Xz(e,t,n.name,a,i),t,r,o),()=>Qz(Xz(e,t,n.name,a,o),t,r,[]))}function Qz(e,t,n,r){return vM(n,(n,i)=>Zz(e,t,n,i,r),()=>e)}function $z(e,t,n,r){return Qz(e,t,n,r)}var eB=0,tB=0;function nB(){if(!gM(tB,kM().maxInstantiationCount))throw Error(`Type instantiation is excessively deep and possibly infinite`)}function rB(){nB(),tB++,eB++}function iB(){eB--,mM(eB,0)&&(tB=0)}function aB(e){return hM(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function oB(e,t){return mM(aB(e),t)}function sB(e,t,n,r,i,a){rB();try{let o=$z(e,t,r,a),s=BU(o,MU([...t.callstack,n.$ref],t.visited),i);return BU(o,MU([],[]),s)}finally{iB()}}function cB(e,t,n,r,i,a){return a.reduce((a,o)=>{let s=sB(e,t,n,r,i,o);return[...a,s]},[])}function lB(e,t,n,r,i,a){let o=cB(e,t,n,r,i,Hz(r,a,i));return mM(o.length,1)?o[0]:OF(o)}function uB(e,t,n,r){let i=IU(e,t,r),a=Jz(e,n,r),o=a[0],s=a[1];return _N(s)?oB(t,o)?dB(mN(o),i):lB(e,t,mN(o),s.parameters,s.expression,i):dB(n,i)}function dB(e,t){return KM({"~kind":`Call`},{type:`call`,target:e,arguments:t},{})}function fB(e){return YM(e,`Call`)}function pB(e){return qM(e,[`~immutable`])}function mB(e,t){return JM(pB(e),{},t)}function hB(e,t,n,r){return mB(BU(e,t,n),r)}function gB(e,t){return e(t)}function _B(e,t){return pM(t)?lP(gB(e,t)):lP(t)}function vB(e,t){return bB(e,DF(t))}function yB(e,t){return CP(t.map(t=>bB(e,t)))}function bB(e,t){return pP(t)?_B(e,t.const):CL(t)?vB(e,t.pattern):wP(t)?yB(e,t.anyOf):t}function xB(e,t={}){return ZM(`Capitalize`,[e],t)}function SB(e,t={}){return ZM(`Lowercase`,[e],t)}function CB(e,t={}){return ZM(`Uncapitalize`,[e],t)}function wB(e,t={}){return ZM(`Uppercase`,[e],t)}var TB=e=>e[0].toUpperCase()+e.slice(1),EB=e=>e.toLowerCase(),DB=e=>e[0].toLowerCase()+e.slice(1),OB=e=>e.toUpperCase();function kB(e,t){return NU([e])?JM(bB(TB,e),{},t):xB(e,t)}function AB(e,t){return NU([e])?JM(bB(EB,e),{},t):SB(e,t)}function jB(e,t){return NU([e])?JM(bB(DB,e),{},t):CB(e,t)}function MB(e,t){return NU([e])?JM(bB(OB,e),{},t):wB(e,t)}function NB(e,t,n,r){return kB(BU(e,t,n),r)}function PB(e,t,n,r){return AB(BU(e,t,n),r)}function FB(e,t,n,r){return jB(BU(e,t,n),r)}function IB(e,t,n,r){return MB(BU(e,t,n),r)}function LB(e,t,n,r,i={}){return ZM(`Conditional`,[e,t,n,r],i)}function RB(e,t,n,r,i,a){let o=Ez(e,n,r);return TL(o)?CP([BU(o.inferred,t,i),BU(e,t,a)]):DL(o)?BU(o.inferred,t,i):BU(e,t,a)}function zB(e,t,n,r,i,a,o){return NU([n,r])?JM(RB(e,t,n,r,i,a),{},o):LB(n,r,i,a,o)}function BB(e,t,n,r,i,a,o){return zB(e,t,BU(e,t,n),BU(e,t,r),i,a,o)}function VB(e,t={}){return ZM(`ConstructorParameters`,[e],t)}function HB(e){let t=lN(e)?e.parameters:[];return KP(FU({},MU([],[]),t))}function UB(e,t){return NU([e])?JM(HB(e),{},t):VB(e,t)}function WB(e,t,n,r){return UB(BU(e,t,n),r)}function GB(e,t,n={}){return ZM(`Exclude`,[e,t],n)}function KB(e,t,n){return NU([e,t])?JM(CF(e,t),{},n):GB(e,t,n)}function qB(e,t,n,r,i){return KB(BU(e,t,n),BU(e,t,r),i)}function JB(e,t,n={}){return ZM(`Extract`,[e,t],n)}function YB(e,t){return AL(Ez({},e,t))?[e]:[]}function XB(e,t,n=[]){return vM(e,(e,r)=>XB(r,t,[...n,...YB(e,t)]),()=>n)}function ZB(e,t){let n=kF(e);return OF(XB(wP(n)?n.anyOf:[n],t))}function QB(e,t,n){return NU([e,t])?JM(ZB(e,t),{},n):JB(e,t,n)}function $B(e,t,n,r,i){return QB(BU(e,t,n),BU(e,t,r),i)}function eV(e,t,n={}){return ZM(`Index`,[e,t],n)}function tV(e,t){return uV(wz(e,t))}function nV(e,t,n){return uV(wF(e,t,n))}function rV(e,t){let n=xM(e).filter(e=>!bM(t,e)),r=xM(t).filter(t=>!bM(e,t)),i=xM(e).filter(e=>bM(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:EF([e[r],t[r]])}),{});return jM(jM(a,o),s)}function iV(e){return e.reduce((e,t)=>rV(e,uV(t)),{})}function aV(e){return e}function oV(e){return uV(iF(KP(e)))}function sV(e,t){return xM(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:OF([e[r],t[r]])}),{})}function cV(e,t){return vM(e,(e,n)=>cV(n,sV(t,uV(e))),()=>t)}function lV(e){return vM(e,(e,t)=>cV(t,uV(e)),()=>JN())}function uV(e){return FN(e)?tV(e.$defs,e.$ref):zN(e)?nV(e.if,e.then,e.else):KN(e)?iV(e.allOf):wP(e)?lV(e.anyOf):qP(e)?oV(e.items):AN(e)?aV(e.properties):{}}function dV(e){return kN(uV(e))}var fV=RegExp(`^(?:0|[1-9][0-9]*)$`);function pV(e){let t=`${e}`;return fV.test(t)?parseInt(t):e}function mV(e){return lP(pV(e))}function hV(e){return e.map(e=>gV(e))}function gV(e){return KN(e)?GN(hV(e.allOf)):wP(e)?CP(hV(e.anyOf)):pP(e)?mV(e.const):e}function _V(e,t){return AL(Ez({},gV(t),_P()))?e:pP(t)&&mM(t.const,`length`)?_P():xN()}function vV(e,t){return TV(wz(e,t))}function yV(e,t,n){return TV(wF(e,t,n))}function bV(e){return TV(TF(e))}function xV(e){return TV(EF(e))}function SV(e){return[`${e}`]}function CV(e){return TV(DF(e))}function wV(e){return e.reduce((e,t)=>[...e,...TV(t)],[])}function TV(e){return FN(e)?vV(e.$defs,e.$ref):zN(e)?yV(e.if,e.then,e.else):WN(e)?bV(e.enum):KN(e)?xV(e.allOf):pP(e)?SV(e.const):CL(e)?CV(e.pattern):wP(e)?wV(e.anyOf):[]}function EV(e){return TV(e)}function DV(e,t){return t.map(t=>OV(e,t))}function OV(e,t){return oN(t)?aN(OV(e,t.items)):lN(t)?cN(DV(e,t.parameters),OV(e,t.instanceType)):fN(t)?dN(DV(e,t.parameters),OV(e,t.returnType)):qP(t)?KP(DV(e,t.items)):wP(t)?CP(DV(e,t.anyOf)):KN(t)?GN(DV(e,t.allOf)):sI(t)?kN(e):t}function kV(e,t){return OV(e,t)}function AV(e,t){return kV(e,t in e?e[t]:xN())}function jV(e,t){return t.reduce((t,n)=>[...t,AV(e,n)],[])}function MV(e,t){return OF(jV(e,EV(t)))}var NV=new RegExp(JF);function PV(e){return e.filter(e=>NV.test(e))}function FV(e){return OF(jV(e,PV(DN(e))))}function IV(e,t){return vP(t)?FV(e):MV(e,t)}function LV(e){return lP(pV(e))}function RV(e){return e.map(e=>zV(e))}function zV(e){return KN(e)?GN(RV(e.allOf)):wP(e)?CP(RV(e.anyOf)):pP(e)?LV(e.const):e}function BV(e,t){return e.reduceRight((e,n,r)=>AL(Ez({},lP(r),t))?[n,...e]:e,[])}function VV(e,t){return AF(BV(e,zV(t)))}function HV(e){return AF(e)}function UV(e,t){return pP(t)&&mM(t.const,`length`)?lP(e.length):vP(t)||oP(t)?HV(e):VV(e,t)}function WV(e,t){return oN(e)?_V(e.items,t):AN(e)?IV(e.properties,t):qP(e)?UV(e.items,t):xN()}function GV(e){return FN(e)||zN(e)||KN(e)||wP(e)?dV(e):e}function KV(e,t,n){return NU([e,t])?JM(WV(GV(e),t),{},n):eV(e,t,n)}function qV(e,t,n,r,i){return KV(BU(e,t,n),BU(e,t,r),i)}function JV(e,t={}){return ZM(`InstanceType`,[e],t)}function YV(e){return lN(e)?e.instanceType:xN()}function XV(e,t){return NU([e])?JM(YV(e),{},t):JV(e,t)}function ZV(e,t,n,r={}){return XV(BU(e,t,n),r)}function QV(e,t={}){return ZM(`KeyOf`,[e],t)}function $V(){return CP([_P(),xP(),yP()])}function eH(e){return _P()}function tH(e){return e.reduce((e,t)=>uP(t)?[...e,lP(pV(t))]:JN(),[])}function nH(e){return AF(tH(xM(e)))}function rH(e){return nI(e)}function iH(e){return AF(e.map((e,t)=>lP(t)))}function aH(e){return yN(e)?$V():oN(e)?eH(e.items):AN(e)?nH(e.properties):iI(e)?rH(e):qP(e)?iH(e.items):xN()}function oH(e){return FN(e)||zN(e)||KN(e)||wP(e)?dV(e):e}function sH(e,t){return NU([e])?JM(aH(oH(e)),{},t):QV(e,t)}function cH(e,t,n,r){return sH(BU(e,t,n),r)}function lH(e,t,n,r,i={}){return ZM(`Mapped`,[e,t,n,r],i)}function uH(e){return mH(DF(e))}function dH(e){return e.reduce((e,t)=>[...e,...mH(t)],[])}function fH(e){return mH(TF(e))}function pH(e){return uM(e)?[lP(`${e}`)]:[lP(e)]}function mH(e){return WN(e)?fH(e.enum):pP(e)?pH(e.const):CL(e)?uH(e.pattern):wP(e)?dH(e.anyOf):[e]}function hH(e){return mH(e)}function gH(e){return CL(e)?DF(e.pattern):e}function _H(e,t,n,r,i,a){let o=jM(e,{[n.name]:r}),s=gH(BU(o,t,i)),c=BU(o,t,a);return dP(s)||fP(s)?{[s.const]:c}:{}}function vH(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,_H(e,t,n,o,i,a)],[])}function yH(e){return e.reduce((e,t)=>[...e,kN(t)],[])}function bH(e,t,n,r,i,a){return EF(yH(vH(e,t,n,hH(r),i,a)))}function xH(e,t,n,r,i,a,o){return NU([r])?JM(bH(e,t,n,r,i,a),{},o):lH(n,r,i,a,o)}function SH(e,t,n,r,i,a,o){return xH(e,t,n,BU(e,t,r),i,a,o)}function CH(e,t,n){let r=jM(e,t);return xM(t).filter(e=>n.includes(e)).reduce((e,n)=>({...e,[n]:Sz(r,n,t[n])}),{})}function wH(e,t,n){let r=jM(e,t);return xM(t).filter(e=>!n.includes(e)).reduce((e,n)=>({...e,[n]:BU(r,MU([],[]),t[n])}),{})}function TH(e,t,n){let r=cz(t),i=CH(e,t,r),a=wH(e,t,r);return JM({...i,...a},{},n)}function EH(e,t,n,r){return TH(e,n,r)}function DH(e,t={}){return ZM(`NonNullable`,[e],t)}function OH(e){return KB(e,CP([mP(),cI()]),{})}function kH(e,t){return NU([e])?JM(OH(e),{},t):DH(e,t)}function AH(e,t,n,r){return kH(BU(e,t,n),r)}function jH(e,t,n={}){return ZM(`Omit`,[e,t],n)}function MH(e){let t=dV(e);return AN(t)?t.properties:JN()}function NH(e,t){return xM(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function PH(e,t){return kN(NH(MH(e),EV(t)))}function FH(e,t,n){return NU([e,t])?JM(PH(e,t),{},n):jH(e,t,n)}function IH(e,t,n,r,i){return FH(BU(e,t,n),BU(e,t,r),i)}function LH(e,t={}){return ZM(`Parameters`,[e],t)}function RH(e){let t=fN(e)?e.parameters:[];return KP(FU({},MU([],[]),t))}function zH(e,t){return NU([e])?JM(RH(e),{},t):LH(e,t)}function BH(e,t,n,r){return zH(BU(e,t,n),r)}function VH(e,t={}){return ZM(`Partial`,[e],t)}function HH(e,t={}){return YH(e,t)}function UH(e,t){let n=JH(wz(e,t));return PN(jM(e,{[t]:n}),t)}function WH(e,t,n){return JH(wF(e,t,n))}function GH(e){return JH(EF(e))}function KH(e){return CP(e.map(e=>JH(e)))}function qH(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:CN(e[n])}),{}))}function JH(e){return FN(e)?UH(e.$defs,e.$ref):zN(e)?WH(e.if,e.then,e.else):KN(e)?GH(e.allOf):wP(e)?KH(e.anyOf):AN(e)?qH(e.properties):kN({})}function YH(e,t){return NU([e])?JM(JH(e),{},t):VH(e,t)}function XH(e,t,n,r){return YH(BU(e,t,n),r)}function ZH(e,t,n={}){return ZM(`Pick`,[e,t],n)}function QH(e,t){return xM(e).reduce((n,r)=>t.includes(r)?jM(n,{[r]:e[r]}):n,{})}function $H(e,t){return kN(QH(MH(e),EV(t)))}function eU(e,t,n){return NU([e,t])?JM($H(e,t),{},n):ZH(e,t,n)}function tU(e,t,n,r,i){return eU(BU(e,t,n),BU(e,t,r),i)}function nU(e,t={}){return ZM(`ReadonlyObject`,[e],t)}function rU(e){return WU(aN(e))}function iU(e,t){let n=uU(wz(e,t));return PN(jM(e,{[t]:n}),t)}function aU(e,t,n){return uU(wF(e,t,n))}function oU(e){return uU(EF(e))}function sU(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:QN(e[n])}),{}))}function cU(e){return WU(KP(e))}function lU(e){return CP(e.map(e=>uU(e)))}function uU(e){return oN(e)?rU(e.items):FN(e)?iU(e.$defs,e.$ref):zN(e)?aU(e.if,e.then,e.else):KN(e)?oU(e.allOf):AN(e)?sU(e.properties):qP(e)?cU(e.items):wP(e)?lU(e.anyOf):e}function dU(e,t){return NU([e])?JM(uU(e),{},t):nU(e)}function fU(e,t,n,r){return dU(BU(e,t,n),r)}function pU(e,t,n,r){return t.visited.includes(r)?n:r in e?BU(e,MU(t.callstack,[...t.visited,r]),e[r]):n}function mU(e,t){let n=yU(wz(e,t));return PN(jM(e,{[t]:n}),t)}function hU(e,t,n){return yU(wF(e,t,n))}function gU(e){return yU(EF(e))}function _U(e){return CP(e.map(e=>yU(e)))}function vU(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:nF(e[n])}),{}))}function yU(e){return FN(e)?mU(e.$defs,e.$ref):zN(e)?hU(e.if,e.then,e.else):KN(e)?gU(e.allOf):wP(e)?_U(e.anyOf):AN(e)?vU(e.properties):kN({})}function bU(e,t={}){return ZM(`Required`,[e],t)}function xU(e,t){return NU([e])?JM(yU(e),{},t):bU(e,t)}function SU(e,t,n,r){return xU(BU(e,t,n),r)}function CU(e,t={}){return ZM(`ReturnType`,[e],t)}function wU(e){return fN(e)?e.returnType:xN()}function TU(e,t){return NU([e])?JM(wU(e),{},t):CU(e,t)}function EU(e,t,n,r={}){return TU(BU(e,t,n),r)}function DU(e,t){return ZM(`With`,[e,t],{})}function OU(e,t){return NU([e])?JM(e,{},t):DU(e,t)}function kU(e,t,n,r){return OU(BU(e,t,n),r)}function AU(e){return oI(e)?qP(e.items)?jU(e.items.items):LN(e.items)||hN(e.items)?[e]:[xN()]:[e]}function jU(e){return e.reduce((e,t)=>[...e,...AU(t)],[])}function MU(e,t){return{callstack:e,visited:t}}function NU(e){return vM(e,(e,t)=>!hN(e)&&NU(t),()=>!0)}function PU(e,t,n){return xM(n).reduce((r,i)=>({...r,[i]:BU(e,t,n[i])}),{})}function FU(e,t,n){return jU(IU(e,t,n))}function IU(e,t,n){return n.map(n=>BU(e,t,n))}function LU(e,t){let n=TN(e)?rN(t,{}):t,r=$N(e)?eN(n,{}):n;return ZN(e)?HU(r,{}):r}function RU(e,t,n,r,i){return mM(n,`AddImmutable`)?UU(e,t,r[0],i):mM(n,`RemoveImmutable`)?hB(e,t,r[0],i):mM(n,`AddReadonly`)?tN(e,t,r[0],i):mM(n,`RemoveReadonly`)?ZP(e,t,r[0],i):mM(n,`AddOptional`)?iN(e,t,r[0],i):mM(n,`RemoveOptional`)?tF(e,t,r[0],i):mM(n,`Capitalize`)?NB(e,t,r[0],i):mM(n,`Conditional`)?BB(e,t,r[0],r[1],r[2],r[3],i):mM(n,`ConstructorParameters`)?WB(e,t,r[0],i):mM(n,`Evaluate`)?Nz(e,t,r[0],i):mM(n,`Exclude`)?qB(e,t,r[0],r[1],i):mM(n,`Extract`)?$B(e,t,r[0],r[1],i):mM(n,`Index`)?qV(e,t,r[0],r[1],i):mM(n,`InstanceType`)?ZV(e,t,r[0],i):mM(n,`Interface`)?$R(e,t,r[0],r[1],i):mM(n,`KeyOf`)?cH(e,t,r[0],i):mM(n,`Lowercase`)?PB(e,t,r[0],i):mM(n,`Mapped`)?SH(e,t,r[0],r[1],r[2],r[3],i):mM(n,`Module`)?EH(e,t,r[0],i):mM(n,`NonNullable`)?AH(e,t,r[0],i):mM(n,`Pick`)?tU(e,t,r[0],r[1],i):mM(n,`Parameters`)?BH(e,t,r[0],i):mM(n,`Partial`)?XH(e,t,r[0],i):mM(n,`Omit`)?IH(e,t,r[0],r[1],i):mM(n,`ReadonlyObject`)?fU(e,t,r[0],i):mM(n,`Record`)?qF(e,t,r[0],r[1],i):mM(n,`Required`)?SU(e,t,r[0],i):mM(n,`ReturnType`)?EU(e,t,r[0],i):mM(n,`TemplateLiteral`)?bL(e,t,r[0],i):mM(n,`Uncapitalize`)?FB(e,t,r[0],i):mM(n,`Uppercase`)?IB(e,t,r[0],i):mM(n,`With`)?kU(e,t,r[0],r[1]):ZM(n,r,i)}function zU(e,t,n){return LU(n,hN(n)?pU(e,t,n,n.$ref):oN(n)?aN(BU(e,t,n.items),sN(n)):fB(n)?uB(e,t,n.target,n.arguments):lN(n)?cN(IU(e,t,n.parameters),BU(e,t,n.instanceType),uN(n)):fN(n)?dN(IU(e,t,n.parameters),BU(e,t,n.returnType),pN(n)):zN(n)?RN(BU(e,t,n.if),BU(e,t,n.then),BU(e,t,n.else),BN(n)):KN(n)?GN(IU(e,t,n.allOf),qN(n)):AN(n)?kN(PU(e,t,n.properties),jN(n)):iI(n)?$F(tI(n),BU(e,t,rI(n))):oI(n)?aI(BU(e,t,n.items)):qP(n)?KP(FU(e,t,n.items),JP(n)):wP(n)?CP(IU(e,t,n.anyOf),TP(n)):n)}function BU(e,t,n){return QM(n)?RU(e,t,n.action,n.parameters,n.options):zU(e,t,n)}function VU(e){return JM(e,{"~immutable":!0},{})}function HU(e,t){return JM(VU(e),{},t)}function UU(e,t,n,r){return HU(BU(e,t,n),r)}function WU(e,t={}){return HU(e,t)}var GU=[`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],KU=[`off`,...GU],qU=[`text`,`image`],JU=[`none`,`short`,`long`],YU=[`short`,`long`];UN(GU);var XU=UN(KU);UN(qU),UN(JU),HH(QF(XU,CP([xP(),mP()]))),HH(QF(UN(YU),_P({exclusiveMinimum:0})),{description:`Best-effort prompt cache lifetime in seconds for each retention tier. A missing tier means the lifetime is unknown, so Pi does not warm it.`});var ZU={input:_P({description:`Input cost in USD per million tokens.`}),output:_P({description:`Output cost in USD per million tokens.`}),cacheRead:_P({description:`Cache-read cost in USD per million tokens.`}),cacheWrite:_P({description:`Cache-write cost in USD per million tokens.`})};kN(ZU);var QU=kN({inputTokensAbove:_P({description:`Use this tier when total request input exceeds this token count.`}),...ZU});kN({...ZU,tiers:wN(aN(QU,{description:`Request-wide pricing tiers. The highest matching input threshold applies to the full request.`}))});function $U(e){return kN({maxWidth:wN(aP({minimum:1})),maxHeight:wN(aP({minimum:1})),maxBytes:wN(aP({minimum:1,description:`Maximum base64-encoded payload size in bytes.`})),jpegQuality:wN(aP({minimum:1,maximum:100}))},e)}$U();var eW=kN({resize:wN($U({description:`Cache-safe resize profile applied before a new image enters conversation history.`})),maxPerMessage:wN(aP({minimum:1,description:`Maximum images accepted in one provider message.`})),maxPerRequest:wN(aP({minimum:1,description:`Maximum images accepted across one provider request.`}))});kN({maxRequestBytes:wN(aP({minimum:1,description:`Maximum serialized provider request size in bytes.`})),images:wN(eW)});function tW({sessionId:e,template:t,existingIds:n,apiKey:r,onClose:i,onAdd:a}){let{t:o}=W(),[s,c]=(0,K.useState)([]),[l,u]=(0,K.useState)(new Set),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)(!0),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(0),x=(0,K.useRef)({template:t,apiKey:r,existingIds:n}),S=new Set(n),C=Math.max(0,100-S.size),w=s.filter(e=>`${e.id} ${e.name}`.toLowerCase().includes(d.trim().toLowerCase())),T=w.filter(e=>!S.has(e.id)),E=T.length>0&&T.every(e=>l.has(e.id));return(0,K.useEffect)(()=>{let t=new AbortController,{template:n,apiKey:r,existingIds:i}=x.current;return m(!0),v(!1),new de().discoverProviderModels(e,{provider:n.provider,baseUrl:n.baseUrl,api:n.api,...r.trim()?{apiKey:r.trim()}:{}},t.signal).then(e=>{t.signal.aborted||(c(e.models),g(e.truncated),m(!1),u(new Set(e.models.filter(e=>!i.includes(e.id)).slice(0,Math.max(0,100-i.length)).map(e=>e.id))))},()=>{t.signal.aborted||(v(!0),m(!1))}),()=>t.abort()},[e,y]),(0,q.jsx)(Se,{isOpen:!0,width:380,padding:0,className:`models-picker-dialog`,"aria-label":o(`providerPickerTitle`),onOpenChange:e=>!e&&i(),children:(0,q.jsxs)(`div`,{className:`models-picker`,children:[(0,q.jsxs)(`header`,{children:[(0,q.jsx)(`h2`,{children:o(`providerPickerTitle`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":o(`close`),onClick:i,children:(0,q.jsx)(je,{})})]}),(0,q.jsx)(`p`,{children:o(`providerPickerIntro`)}),(0,q.jsxs)(`div`,{className:`models-picker-toolbar`,children:[(0,q.jsx)(`input`,{"data-autofocus":!0,type:`search`,"aria-label":o(`providerPickerSearch`),placeholder:o(`providerPickerSearch`),value:d,onKeyDown:e=>{e.key===`Enter`&&e.preventDefault()},onChange:e=>f(e.target.value)}),(0,q.jsx)(`button`,{type:`button`,className:`models-link`,disabled:p||!T.length,onClick:()=>u(e=>{let t=new Set(e);for(let e of T)E?t.delete(e.id):t.size(0,q.jsxs)(`label`,{className:`models-picker-row`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:S.has(e.id)||l.has(e.id),disabled:S.has(e.id)||!l.has(e.id)&&l.size>=C,onChange:t=>u(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}),(0,q.jsx)(`span`,{title:e.name,children:e.id}),S.has(e.id)&&(0,q.jsx)(`small`,{children:o(`providerPickerAdded`)})]},e.id)),!p&&!_&&!w.length&&(0,q.jsx)(`p`,{className:`models-picker-empty`,children:o(d?`providerPickerNoMatch`:`providerPickerEmpty`)}),_&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[(0,q.jsx)(`p`,{children:o(`providerPickerError_load`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:()=>b(e=>e+1),children:o(`retryAdmissionCheck`)})]})]}),h&&(0,q.jsx)(`p`,{className:`models-hint`,children:o(`providerPickerBounded`)}),(0,q.jsxs)(`footer`,{children:[(0,q.jsx)(`span`,{className:`models-hint`,"aria-live":`polite`,children:l.size>0&&o(`providerPickerSelected`,{count:l.size})}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:i,children:o(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:!l.size||p||_,onClick:()=>a(s.filter(e=>l.has(e.id))),children:o(`providerPickerSave`)})]})]})})}function nW(e){let t=e.trim();if(!t)return;let n=/^(\d+(?:\.\d+)?)([km])?$/i.exec(t);if(!n)return NaN;let r=n[2]?.toLowerCase()===`m`?1e6:n[2]?.toLowerCase()===`k`?1e3:1,i=Number(n[1])*r,a=Math.round(i),o=Math.abs(i-a)<1e-6?a:i;return Number.isSafeInteger(o)&&o>0&&o<=1e8?o:NaN}function rW(e){if(e===void 0)return``;if(Number.isInteger(e)&&e>0){if(e%1e6==0)return`${e/1e6}M`;if(e%1e3==0)return`${e/1e3}K`}return String(e)}function iW({sessionId:e,providerId:t,configuration:n,auth:r,isNew:i,custom:a,taken:o,currentModel:s,availableModels:c,busy:l,onDirty:u,onSaving:d,onClose:f,onReload:p}){let{t:m}=W(),[h]=(0,K.useState)(()=>{let e=n.providers?.find(e=>e.provider===t),i=n.models.filter(e=>e.provider===t).map(e=>({...e,rowKey:crypto.randomUUID()}));return{provider:t,name:e?.name||r?.name||t,baseUrl:e?.baseUrl||i[0]?.baseUrl||r?.baseUrl||``,api:e?.api||i[0]?.api||r?.api||`openai-completions`,models:i}}),[g]=(0,K.useState)(n.revision),[_,v]=(0,K.useState)(h),[y,b]=(0,K.useState)(``),x=!i&&!!r?.authMethods.includes(`oauth`),S=a||!!r?.authMethods.includes(`api_key`),[C,w]=(0,K.useState)(x&&(!r?.configured||r?.subscription||!S)?`oauth`:`api_key`),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1),k=(0,K.useRef)(null),A=(0,K.useRef)(!1),[j,M]=(0,K.useState)(new Set),[N,P]=(0,K.useState)({}),[F,I]=(0,K.useState)(!1),[ee,L]=(0,K.useState)(null),[R,te]=(0,K.useState)(!1),z=(0,K.useRef)(null),B=(0,K.useRef)({onDirty:u,onSaving:d});B.current={onDirty:u,onSaving:d};let ne=JSON.stringify(_)!==JSON.stringify(h),re=ne||y.length>0;(0,K.useEffect)(()=>{B.current.onDirty(re)},[re]),(0,K.useEffect)(()=>{B.current.onSaving(F||T)},[F,T]),(0,K.useEffect)(()=>{D?A.current=!0:A.current&&(A.current=!1,k.current?.focus({preventScroll:!0}))},[D]),(0,K.useEffect)(()=>()=>{z.current?.abort(),B.current.onSaving(!1),B.current.onDirty(!1)},[]);let V=n.providers?.find(e=>e.provider===t)?.editable!==!1,ie=l||F||T,ae=ie||R||!V,oe=!/^[a-zA-Z0-9._-]+$/.test(_.provider)||[`__proto__`,`constructor`,`prototype`].includes(_.provider)||i&&a&&o.includes(_.provider),se=_.models.findIndex(e=>!e.id.trim()||[e.contextWindow,e.maxTokens].some(e=>e!==void 0&&!Number.isFinite(e))||_.models.some(t=>t.rowKey!==e.rowKey&&t.id.trim()===e.id.trim())),ce=se!==-1,le=i&&a||ne,H=!oe&&!/[\r\n\u0000]/u.test(y)&&(R||!le||(!a||_.models.length>0)&&!ce&&!!_.baseUrl)&&(le||y.trim().length>0),ue=e=>{v(t=>({...t,...e})),ee!==`conflict`&&L(null)},fe=(e,t)=>ue({models:_.models.map((n,r)=>r===e?{...n,...t}:n)}),pe=_.models.map(e=>n.thinkingDefaults?.[`${e.provider}/${e.id}`]),me=_.models.map((e,t)=>{let n=e.thinkingLevelMap??pe[t];return KU.filter(e=>n?.[e]!==null&&(e!==`xhigh`&&e!==`max`||n?.[e]!==void 0))}),he={id:``,name:``,reasoning:!1,provider:_.provider,baseUrl:_.baseUrl,api:_.api},_e=async()=>{if(ie||D||!H||ee===`conflict`)return;let t=new AbortController;z.current=t,I(!0),L(null);let n=R,r=new de;try{if(le&&!n){if(await r.changeProviderConfiguration(e,g,{action:`save`,configuration:{..._,name:_.name.trim()||_.provider,models:_.models.map(({rowKey:e,...t})=>({...t,id:t.id.trim(),name:t.name.trim()||t.id.trim(),provider:_.provider,baseUrl:_.baseUrl===h.baseUrl&&t.baseUrl||_.baseUrl,api:_.api===h.api?t.api:_.api}))}},t.signal),t.signal.aborted)return;n=!0,te(!0)}if(y.trim()&&await r.saveProviderKey(e,_.provider,y.trim(),t.signal),t.signal.aborted)return;b(``),B.current.onDirty(!1),f(_.name||_.provider,_.provider)}catch(e){t.signal.aborted||L(e instanceof ge&&e.code===`MODEL_CONFIGURATION_CONFLICT`?`conflict`:e instanceof ge&&e.code===`MODEL_NOT_AVAILABLE`?`current`:n?`key`:`failed`)}finally{t.signal.aborted||I(!1)}},ve=e=>(0,q.jsxs)(`label`,{className:`models-field`,children:[m(e===`name`?`providerDisplayName`:`modelConfig_${e}`),(0,q.jsx)(`input`,{type:e===`baseUrl`?`url`:`text`,value:_[e],maxLength:e===`baseUrl`?2048:160,autoComplete:`off`,disabled:ae,required:e===`provider`||e===`baseUrl`&&le,"aria-invalid":e===`provider`&&_.provider.length>0&&oe,placeholder:e===`provider`?`my-provider`:e===`name`?_.provider:`https://api.example.com/v1`,onChange:t=>ue({[e]:t.target.value})})]}),ye=(0,q.jsxs)(`label`,{className:`models-field`,htmlFor:`provider-api-${t||`custom`}`,children:[m(`modelConfig_api`),(0,q.jsx)(Tj,{id:`provider-api-${t||`custom`}`,label:m(`modelConfig_api`),value:_.api,disabled:ae,onChange:e=>{(e===`openai-responses`||e===`openai-completions`||e===`anthropic-messages`)&&ue({api:e})},options:[{value:`openai-completions`,label:`OpenAI Chat Completions`},{value:`openai-responses`,label:`OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`}]})]}),be=(0,q.jsxs)(`div`,{className:`models-catalog`,children:[(0,q.jsxs)(`div`,{className:`models-list-head`,children:[(0,q.jsx)(`span`,{children:m(`modelSettings`)}),(0,q.jsx)(`button`,{type:`button`,ref:k,className:`models-link`,disabled:ae||oe||!_.baseUrl,onClick:()=>O(!0),children:m(`providerFetchModels`)})]}),!V&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerModelsReadOnly`)}),_.models.length===0&&(0,q.jsx)(`p`,{className:`models-empty`,children:m(a?`providerModelsEmpty`:`providerModelsInherited`,{count:c.length})}),(0,q.jsxs)(`div`,{className:`models-entry-list`,children:[s&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerCurrentSessionModel`,{model:`${s.provider} / ${s.id}`})}),_.models.map((e,t)=>(0,q.jsxs)(`div`,{className:`models-entry`,children:[s?.provider===_.provider&&s.id===e.id&&(0,q.jsx)(`p`,{className:`models-current-label`,children:m(`currentModel`)}),(0,q.jsxs)(`div`,{className:`models-entry-row`,children:[(0,q.jsx)(`input`,{"aria-label":m(`providerModelId`,{number:t+1}),placeholder:m(`modelConfig_id`),value:e.id,maxLength:256,required:!0,disabled:ae||s?.provider===_.provider&&s.id===e.id,onChange:e=>fe(t,{id:e.target.value})}),(0,q.jsx)(`input`,{"aria-label":m(`providerModelName`,{number:t+1}),placeholder:m(`modelConfig_name`),value:e.name,maxLength:256,disabled:ae,onChange:e=>fe(t,{name:e.target.value})}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":m(`providerModelDetails`,{model:e.name||e.id||t+1}),"aria-expanded":j.has(e.rowKey),title:m(`providerModelOptions`),onClick:()=>M(t=>{let n=new Set(t);return n.delete(e.rowKey)||n.add(e.rowKey),n}),children:(0,q.jsx)(os,{})}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon danger`,"aria-label":m(`providerRemoveModel`,{model:e.name||e.id||t+1}),disabled:ae||s?.provider===_.provider&&s.id===e.id,title:s?.provider===_.provider&&s.id===e.id?m(`providerCurrentRemoval`):m(`providerRemoveModel`,{model:e.name||e.id||t+1}),onClick:()=>{ue({models:_.models.filter((e,n)=>n!==t)}),M(t=>new Set([...t].filter(t=>t!==e.rowKey))),P(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.rowKey)))},children:(0,q.jsx)(Uc,{})})]}),j.has(e.rowKey)&&(0,q.jsxs)(`div`,{className:`models-entry-details`,children:[[`contextWindow`,`maxTokens`].map(n=>(0,q.jsxs)(`label`,{className:`models-field models-capacity`,children:[m(`modelConfig_${n}`),(0,q.jsx)(`input`,{type:`text`,inputMode:`numeric`,autoComplete:`off`,spellCheck:!1,"aria-label":m(`providerCapacityLabel`,{field:m(`modelConfig_${n}`),number:t+1}),"aria-invalid":e[n]!==void 0&&!Number.isFinite(e[n]),placeholder:n===`contextWindow`?`256K`:`32K`,value:N[e.rowKey]?.[n]??rW(e[n]),disabled:ae,onChange:r=>{let i=r.target.value;P(t=>({...t,[e.rowKey]:{...t[e.rowKey],[n]:i}})),fe(t,{[n]:nW(i)})}})]},n)),(0,q.jsxs)(`fieldset`,{className:`models-input-types`,"aria-label":m(`providerCapacityLabel`,{field:m(`providerInputTypes`),number:t+1}),children:[(0,q.jsx)(`legend`,{children:m(`providerInputTypes`)}),(0,q.jsx)(`div`,{children:[`text`,`image`].map(n=>{let r=e.input??[`text`];return(0,q.jsxs)(`label`,{className:`models-checkbox`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:r.includes(n),disabled:ae||r.length===1&&r.includes(n),onChange:e=>fe(t,{input:[`text`,`image`].filter(t=>t===n?e.target.checked:r.includes(t))})}),m(n===`text`?`providerInputText`:`providerInputImage`)]},n)})})]}),(0,q.jsx)(`p`,{className:`models-hint models-capability-hint`,children:m(`providerImageHint`)}),(0,q.jsxs)(`label`,{className:`models-checkbox models-reasoning`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:e.reasoning,disabled:ae,onChange:e=>fe(t,{reasoning:e.target.checked})}),m(`modelConfig_reasoning`)]}),(0,q.jsx)(`p`,{className:`models-hint models-capability-hint`,children:m(`providerReasoningHint`)}),e.reasoning&&(0,q.jsxs)(`div`,{className:`models-thinking-levels`,children:[(0,q.jsxs)(`div`,{className:`models-thinking-copy`,children:[(0,q.jsx)(`strong`,{children:m(`providerThinkingLevels`)}),(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerThinkingLevelsHint`)})]}),(0,q.jsx)(yo,{button:{label:e.thinkingLevelMap==null?m(`providerThinkingAutomatic`):m(`providerThinkingSelected`,{count:me[t].length}),"aria-label":m(`providerCapacityLabel`,{field:m(`providerThinkingLevels`),number:t+1}),variant:`secondary`,size:`sm`,className:`models-thinking-trigger`,isDisabled:ae},className:`configuration-level-menu`,menuWidth:`min(240px, calc(100vw - 32px))`,alignment:`end`,children:KU.map(n=>{let r=me[t],i=r.includes(n);return(0,q.jsx)(Ro,{label:n,value:i,isDisabled:ae||i&&r.length===1,endContent:(0,q.jsx)(`span`,{className:`configuration-check`,children:i&&(0,q.jsx)(rs,{"aria-hidden":`true`})}),onChange:i=>{fe(t,{thinkingLevelMap:Object.fromEntries(KU.map(a=>{let o=a===n?i:r.includes(a),s=h.models.find(t=>t.rowKey===e.rowKey)?.thinkingLevelMap?.[a];return[a,o?e.thinkingLevelMap?.[a]??s??pe[t]?.[a]??(a===`off`?`none`:a):null]}))})}},n)})}),e.thinkingLevelMap!=null&&(0,q.jsx)(`button`,{type:`button`,className:`models-link models-thinking-reset`,disabled:ae,onClick:()=>fe(t,{thinkingLevelMap:null}),children:m(`providerThinkingReset`)})]})]})]},e.rowKey))]}),(0,q.jsxs)(`button`,{type:`button`,className:`models-button models-add-model`,disabled:ae||_.models.length>=100,onClick:()=>{ue({models:[..._.models,{...he,rowKey:crypto.randomUUID()}]})},children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),m(`addModel`)]}),ce&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:m(`providerModelInvalid`,{number:se+1})})]});return(0,q.jsxs)(`form`,{className:`models-editor`,onSubmit:e=>{e.preventDefault(),_e()},children:[!i&&a&&(0,q.jsxs)(`div`,{className:`models-editor-heading`,children:[(0,q.jsx)(`span`,{children:_.name||_.provider}),_.name!==_.provider&&(0,q.jsx)(`small`,{children:_.provider})]}),i&&a&&(0,q.jsxs)(q.Fragment,{children:[ve(`provider`),_.provider&&oe&&(0,q.jsx)(`p`,{className:`models-error`,children:m(`providerIdInvalid`)}),ve(`name`),ve(`baseUrl`),ye]}),x&&S&&(0,q.jsxs)(`fieldset`,{className:`models-add-modes`,"aria-label":m(`accountLoginMethod`),children:[(0,q.jsx)(`button`,{type:`button`,"aria-pressed":C===`oauth`,disabled:ie,onClick:()=>w(`oauth`),children:m(`accountLoginTab`)}),(0,q.jsx)(`button`,{type:`button`,"aria-pressed":C===`api_key`,disabled:ie,onClick:()=>w(`api_key`),children:m(`accountLoginKeyTab`)})]}),x&&C===`oauth`&&r&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(iM,{sessionId:e,auth:r,busy:l||F||re,onSaving:E,onAuthenticated:()=>f(_.name||_.provider,_.provider),onReload:p}),re&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`accountLoginUnsaved`)})]}),S&&C===`api_key`?(0,q.jsxs)(`label`,{className:`models-field`,children:[m(`providerApiKey`),(0,q.jsx)(`input`,{type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:8192,value:y,placeholder:m(r?.configured?`providerKeyKeep`:`providerKeyOptional`),disabled:ie,onChange:e=>{b(e.target.value),ee!==`conflict`&&L(null)}})]}):x?null:(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerNativeAuth`)}),i&&a?be:(0,q.jsxs)(`details`,{className:`models-customized`,children:[(0,q.jsx)(`summary`,{children:m(`providerCustomSettings`)}),(0,q.jsxs)(`div`,{children:[a&&ve(`name`),ve(`baseUrl`),a&&ye,be]})]}),ee&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:m(ee===`conflict`?`modelConfigurationConflict`:ee===`key`?`providerProfileSavedKeyFailed`:ee===`current`?`providerCurrentRemoval`:`providerConfigurationFailed`)}),ee===`conflict`&&(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:p,children:m(`providerReload`)}),!T&&(0,q.jsxs)(`div`,{className:`models-editor-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:F,onClick:()=>R?p():f(),children:m(`cancel`)}),(C===`api_key`||ne)&&(0,q.jsx)(`button`,{type:`submit`,className:`models-button primary`,disabled:ie||!H||ee===`conflict`,"aria-busy":F,children:m(F?`savingSettings`:`providerSave`)})]}),D&&(0,q.jsx)(tW,{sessionId:e,template:he,existingIds:_.models.map(e=>e.id),apiKey:y,onClose:()=>O(!1),onAdd:e=>{ue({models:[..._.models,...e.map(e=>({...he,...e,rowKey:crypto.randomUUID()}))]}),O(!1)}})]})}function aW({sessionId:e,sessionPath:t,provider:n,purpose:r,initialModel:i,busy:a,onSelectModel:o,onDefaultSaved:s,onSaving:c,onClose:l}){let{t:u}=W(),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)([]),[h,g]=(0,K.useState)(i?`${i.provider}/${i.id}`:``),[_,v]=(0,K.useState)(!0),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(0),[C,w]=(0,K.useState)(0),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1),[k,A]=(0,K.useState)(null);(0,K.useEffect)(()=>{let t=new AbortController;v(!0),b(!1);let r=window.setTimeout(()=>{new de().searchModels(d.trim(),e,t.signal,n).then(e=>{t.signal.aborted||(m(e.models),S(e.truncation.matchesOmitted),v(!1))},()=>{t.signal.aborted||(b(!0),v(!1))})},d?200:0);return()=>{t.abort(),window.clearTimeout(r)}},[e,n,d,C]);let j=p.find(e=>`${e.provider}/${e.id}`===h)??p[0],M=new Map;for(let e of p){let t=M.get(e.provider);t?t.push(e):M.set(e.provider,[e])}let N=async()=>{if(!j||_||D||a||!t)return;O(!0),c(!0),A(null);let n=!1;try{if(r===`use`){if(!await o(`${j.provider}/${j.id}`))throw Error(`selection failed`);n=!0}(r==="default"||T)&&s(await new de().saveModelDefault(j.provider,j.id,e,t)),l()}catch{A(n?`modelDefaultPartial`:r==="default"?`modelDefaultSaveFailed`:`modelConnectionUseFailed`)}finally{O(!1),c(!1)}};return(0,q.jsxs)(`div`,{className:`models-connection-choice`,children:[(0,q.jsx)(`p`,{className:`models-hint`,children:u(r==="default"?`modelDefaultHint`:`modelConnectionNextHint`)}),(p.length>8||x>0||d)&&(0,q.jsx)(`input`,{type:`search`,"aria-label":u(`modelConnectionSearch`),placeholder:u(`modelConnectionSearch`),maxLength:200,value:d,disabled:D,onChange:e=>f(e.target.value)}),y?(0,q.jsxs)(`p`,{className:`models-error`,role:`alert`,children:[u(`modelConnectionLoadFailed`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:()=>w(e=>e+1),children:u(`retryAdmissionCheck`)})]}):_?(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`loadingModels`)}):p.length?(0,q.jsx)(nM,{label:u(`selectModel`),className:`models-provider-picker`,placement:`below`,value:j?`${j.provider}/${j.id}`:``,isDisabled:D,options:[...M].map(([e,t])=>({type:`section`,title:e,options:t.map(e=>({value:`${e.provider}/${e.id}`,label:e.name||e.id,description:`${e.provider} · ${e.id}`,icon:(0,q.jsx)(Yk,{id:e.provider})}))})),onChange:e=>g(e)}):(0,q.jsx)(`p`,{className:`models-hint`,children:u(d?`modelConnectionNoMatch`:`modelConnectionNoModels`)}),x>0&&!_&&(0,q.jsx)(`p`,{className:`models-hint`,children:u(`modelConnectionMore`,{count:x})}),r===`use`&&(0,q.jsxs)(`label`,{className:`models-checkbox`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:T,disabled:D,onChange:e=>E(e.target.checked)}),u(`modelMakeDefault`)]}),k&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:u(k)}),(0,q.jsxs)(`div`,{className:`models-editor-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:D,onClick:l,children:u(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button primary`,disabled:D||a||_||y||!j||!t,onClick:()=>void N(),children:u(D?`providerSaving`:r==="default"?`modelDefaultSave`:`modelConnectionUse`)})]})]})}function oW({sessionId:e,sessionPath:t,models:n,currentModel:r,busy:i,focusCredentials:a,onSaved:o,onSelectModel:s,onDraftChange:c,onSavingChange:l}){let{t:u}=W(),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(0),[h,g]=(0,K.useState)(!0),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(null),[x,S]=(0,K.useState)([]),[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(`account`),[D,O]=(0,K.useState)(``),[k,A]=(0,K.useState)(``),[j,M]=(0,K.useState)({}),[N,P]=(0,K.useState)(!1),[F,I]=(0,K.useState)({}),[ee,L]=(0,K.useState)(!1),R=N||ee||Object.values(F).some(Boolean),[te,z]=(0,K.useState)(null),[B,ne]=(0,K.useState)(!1),[re,V]=(0,K.useState)(null),[ie,ae]=(0,K.useState)(null),[oe,se]=(0,K.useState)(null),[ce,le]=(0,K.useState)(null),H=(0,K.useRef)(null),ue=(0,K.useRef)(a),fe=(0,K.useRef)(null),pe=(0,K.useRef)(new Map),me=(0,K.useRef)(null),he=(0,K.useRef)(null),_e=(0,K.useRef)({onDraftChange:c,onSavingChange:l});_e.current={onDraftChange:c,onSavingChange:l},(0,K.useEffect)(()=>{c(Object.values(j).some(Boolean))},[j,c]),(0,K.useEffect)(()=>{l(R)},[R,l]),(0,K.useEffect)(()=>{!re&&!R&&he.current&&(he.current.focus({preventScroll:!0}),he.current=null)},[re,R]),(0,K.useEffect)(()=>{if(!fe.current)return;let e=fe.current;fe.current=null,(pe.current.get(e)??me.current)?.focus({preventScroll:!0})}),(0,K.useEffect)(()=>()=>{H.current?.abort(),_e.current.onDraftChange(!1),_e.current.onSavingChange(!1)},[]),(0,K.useEffect)(()=>{let t=new AbortController;g(!0),v(!1);let n=new de;return Promise.all([n.modelConfigurations(e,t.signal),n.providerAuth(e,t.signal)]).then(([e,n])=>{if(!t.signal.aborted&&(f({configuration:e,auth:n}),g(!1),ue.current)){ue.current=!1;let e=r?.provider||n.providers.find(e=>e.configured)?.id;e&&(b(e),S([e]))}},()=>{t.signal.aborted||(v(!0),g(!1))}),()=>t.abort()},[e,p,r?.provider]),(0,K.useEffect)(()=>{let t=new AbortController;return ne(!1),new de().modelDefaults(e,t.signal).then(e=>{t.signal.aborted||z(e)},()=>{t.signal.aborted||ne(!0)}),()=>t.abort()},[e,p]);let ve=d?.configuration,ye=new Set([...ve?.providers?.map(e=>e.provider)??[],...ve?.models.map(e=>e.provider)??[]]),be=new Set([...ye,...d?.auth.providers.filter(e=>e.configured).map(e=>e.id)??[],...n.map(e=>e.provider),...x.filter(e=>!e.startsWith(`add:`))]),xe=[...be].map(e=>{let t=d?.auth.providers.find(t=>t.id===e);return{id:e,name:ve?.providers?.find(t=>t.provider===e)?.name||t?.name||e,auth:t}}),Se=d?.auth.providers.filter(e=>e.authMethods.includes(`api_key`)&&!be.has(e.id))??[],Ce=d?.auth.providers.filter(e=>e.authMethods.includes(`oauth`)&&!e.subscription)??[],we=Ce.find(e=>e.id===D)??Ce[0],Te=Se.find(e=>e.id===k)??Se[0],Ee=[{id:`account`,label:`accountLoginTab`,hint:`providerAccountHint`,available:Ce.length>0},{id:`catalog`,label:`providerAddCatalog`,hint:`providerCatalogHint`,available:Se.length>0},{id:`custom`,label:`providerAddCustom`,hint:`providerCustomHint`,available:!0}],U=e=>{E(e);let t=e===`custom`?`add:custom`:e===`account`?we&&`add:account:${we.id}`:Te&&`add:${Te.id}`;t&&S(e=>e.includes(t)?e:[...e,t])},De=e=>{he.current=null,V(null),ae(null),w(!1),b(y===e?null:e),S(t=>t.includes(e)?t:[...t,e])},Oe=(e,t,n)=>{he.current=null,fe.current=e;let r=t=>e.startsWith(`add:`)?t.startsWith(`add:`):t===e;S(e=>e.filter(e=>!r(e))),M(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!r(e)))),e.startsWith(`add:`)?w(!1):b(null),t&&(ae(t),V({purpose:`use`,provider:n??e}),m(e=>e+1),o().catch(()=>!1))},ke=(t,a,s,c)=>{if(!ve)return null;let l=d?.auth.providers.find(e=>e.id===a),f=e=>I(n=>n[t]===e?n:{...n,[t]:e}),p=()=>{Oe(t),m(e=>e+1),o().catch(()=>!1)};return t.startsWith(`add:account:`)?l&&(0,q.jsxs)(`div`,{className:`models-editor`,children:[(0,q.jsx)(iM,{sessionId:e,auth:l,busy:i,onSaving:f,onAuthenticated:()=>Oe(t,l.name||l.id,l.id),onReload:p}),!F[t]&&(0,q.jsx)(`div`,{className:`models-editor-actions`,children:(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:()=>Oe(t),children:u(`cancel`)})})]}):(0,q.jsx)(iW,{sessionId:e,providerId:a,configuration:ve,auth:l,isNew:s,custom:c,taken:[...d?.auth.providers.map(e=>e.id)??[],...ye],currentModel:r,availableModels:n.filter(e=>e.provider===a),busy:i,onDirty:e=>M(n=>n[t]===e?n:{...n,[t]:e}),onSaving:f,onClose:(e,n)=>Oe(t,e,n),onReload:p},t)},G=e=>xe.find(t=>t.id===e)?.name??e,je=e=>n.find(t=>t.provider===e.provider&&t.id===e.id)?.name||e.id,Me=(e,t,n)=>{he.current=t,V({purpose:e,provider:n}),b(null),w(!1)},Ne=(n,a)=>(0,q.jsx)(aW,{sessionId:e,sessionPath:t,provider:a,purpose:n,initialModel:n==="default"?te?.model:r,busy:i,onSelectModel:s,onDefaultSaved:e=>{z(e),ne(!1),o().catch(()=>!1)},onSaving:L,onClose:()=>{V(null)}},`${n}:${a??`all`}`);return(0,q.jsxs)(`div`,{className:`settings-content-page models-page`,children:[(0,q.jsxs)(`div`,{className:`models-section`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:u(`modelSettings`)}),(0,q.jsx)(`p`,{children:u(`modelsIntro`)})]})}),ie&&(0,q.jsxs)(`p`,{className:`models-saved`,role:`status`,children:[u(`providerSaved`,{provider:ie}),r&&(0,q.jsxs)(`span`,{children:[` `,u(`providerCurrentSessionModel`,{model:`${r.provider} / ${r.id}`})]})]}),_&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[u(`providerLoadFailed`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:h,onClick:()=>m(e=>e+1),children:u(`retryAdmissionCheck`)})]}),ce&&!oe&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[ce,` `,(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:h,onClick:()=>{le(null),m(e=>e+1)},children:u(`refreshStatus`)})]}),!d&&h&&(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`providerLoading`)}),(0,q.jsxs)(`div`,{className:`models-default-card`,children:[(0,q.jsxs)(`div`,{className:`models-default-row`,children:[(0,q.jsxs)(`div`,{className:`models-default-copy`,children:[(0,q.jsx)(`span`,{className:`models-default-title`,children:u(`modelDefaultTitle`)}),B?(0,q.jsx)(`span`,{className:`models-hint`,children:u(`modelDefaultReadFailed`)}):te?.model?(0,q.jsxs)(`span`,{className:`models-default-value`,children:[(0,q.jsx)(`span`,{className:`models-default-avatar`,"aria-hidden":`true`,children:(0,q.jsx)(Yk,{id:te.model.provider,modelId:te.model.id})}),(0,q.jsxs)(`span`,{children:[je(te.model),(0,q.jsx)(`small`,{children:G(te.model.provider)})]})]}):(0,q.jsx)(`span`,{className:`models-hint`,children:u(te?`modelDefaultNotSet`:`loadingModels`)})]}),(0,q.jsxs)(`button`,{type:`button`,className:`models-button primary models-default-choose`,disabled:R||i||Object.values(j).some(Boolean)||!t,"aria-expanded":re?.purpose==="default",onClick:e=>B?m(e=>e+1):re?.purpose==="default"?V(null):Me(`default`,e.currentTarget),children:[(0,q.jsx)(`span`,{children:u(B?`refreshStatus`:`modelDefaultChoose`)}),!B&&(0,q.jsx)(os,{"aria-hidden":`true`})]})]}),te?.projectOverride&&(0,q.jsx)(`p`,{className:`models-hint`,children:u(`modelDefaultProjectOverride`,{model:`${G(te.projectOverride.provider)} / ${je(te.projectOverride)}`})}),re?.purpose==="default"&&Ne(`default`)]}),(0,q.jsxs)(`div`,{className:`models-connections-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:u(`modelConnectionsTitle`)}),(0,q.jsx)(`p`,{children:u(`modelConnectionsIntro`)})]}),(0,q.jsx)(`span`,{"aria-hidden":`true`,children:xe.length})]}),(0,q.jsx)(`ul`,{className:`models-provider-list`,children:xe.map(e=>{let n=!C&&y===e.id,a=e.auth?.custom??ye.has(e.id);return(0,q.jsxs)(`li`,{className:`models-provider-card`,children:[(0,q.jsxs)(`div`,{className:`models-provider-head`,children:[(0,q.jsxs)(`div`,{className:`models-provider-identity`,children:[(0,q.jsx)(`span`,{className:`models-provider-avatar`,"aria-hidden":`true`,children:(0,q.jsx)(Yk,{id:e.id})}),(0,q.jsxs)(`div`,{className:`models-provider-label`,children:[(0,q.jsx)(`span`,{className:`models-provider-name`,children:e.name}),a&&(0,q.jsx)(`span`,{className:`models-provider-tag`,children:u(`providerCustomTag`)}),te?.model?.provider===e.id&&(0,q.jsx)(`span`,{className:`models-provider-tag is-default`,children:u(`modelDefaultBadge`)}),r?.provider===e.id&&(0,q.jsx)(`span`,{className:`models-provider-tag is-current`,children:u(`modelCurrentBadge`)}),e.auth&&(0,q.jsxs)(`span`,{className:`models-provider-status`,children:[(0,q.jsx)(`span`,{className:`models-credential-dot ${e.auth.configured?`configured`:`missing`}`,role:`img`,"aria-label":u(e.auth.configured?`credentialConfigured`:`credentialMissing`),title:u(e.auth.configured?`credentialConfigured`:`credentialMissing`)}),u(e.auth.subscription?`accountLoginConfigured`:e.auth.configured?`credentialConfigured`:`credentialMissing`)]})]})]}),(0,q.jsxs)(`div`,{className:`models-provider-actions`,children:[e.auth?.configured&&(0,q.jsx)(`button`,{type:`button`,className:`models-button models-select-connection`,disabled:R||i||Object.values(j).some(Boolean)||!t,"aria-label":u(`modelConnectionChooseProvider`,{provider:e.name}),"aria-expanded":re?.purpose===`use`&&re.provider===e.id,onClick:t=>re?.purpose===`use`&&re.provider===e.id?V(null):Me(`use`,t.currentTarget,e.id),children:u(`selectModel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,"aria-label":u(`editProvider`,{provider:e.name}),ref:t=>{t?pe.current.set(e.id,t):pe.current.delete(e.id)},"aria-expanded":n,disabled:R,onClick:()=>De(e.id),children:u(e.auth?.authMethods.includes(`oauth`)&&!e.auth.configured?`accountLoginStart`:`providerEdit`)}),ye.has(e.id)&&(0,q.jsx)(`button`,{type:`button`,className:`models-button danger`,"aria-label":u(`removeProvider`,{provider:e.name}),disabled:R||i||r?.provider===e.id,title:r?.provider===e.id?u(`providerCurrentRemoval`):void 0,onClick:()=>{se(e.id),le(null)},children:u(`providerRemove`)})]})]}),re?.purpose===`use`&&re.provider===e.id&&Ne(`use`,e.id),x.includes(e.id)&&(0,q.jsx)(`div`,{hidden:!n,children:ke(e.id,e.id,!1,a)})]},e.id)})}),ve&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{hidden:!C,className:`models-add-card`,children:[(0,q.jsx)(`fieldset`,{className:`models-add-modes`,"aria-label":u(`providerAddMode`),onKeyDown:e=>{if(R||![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=Ee.filter(e=>e.available),n=t.findIndex(e=>e.id===T),r=t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length].id;U(r),e.currentTarget.querySelectorAll(`button`)[Ee.findIndex(e=>e.id===r)]?.focus()},children:Ee.map(e=>(0,q.jsx)(`button`,{type:`button`,"aria-pressed":T===e.id,disabled:R||!e.available,onClick:()=>U(e.id),children:u(e.label)},e.id))}),(0,q.jsx)(`p`,{className:`models-hint`,children:u(Ee.find(e=>e.id===T)?.hint??`providerCustomHint`)}),(0,q.jsxs)(`div`,{hidden:T!==`account`,children:[we&&(0,q.jsx)(`div`,{className:`models-provider-select`,children:(0,q.jsx)(nM,{label:u(`provider`),className:`models-provider-picker`,options:Ce.map(e=>({value:e.id,label:e.name||e.id,icon:(0,q.jsx)(Yk,{id:e.id})})),value:we.id,isDisabled:R,placement:`below`,onChange:e=>{O(e);let t=`add:account:${e}`;S(e=>e.includes(t)?e:[...e,t])}})}),x.filter(e=>e.startsWith(`add:account:`)).map(e=>(0,q.jsx)(`div`,{hidden:e!==`add:account:${we?.id}`,children:ke(e,e.slice(12),!0,!1)},e))]}),(0,q.jsxs)(`div`,{hidden:T!==`catalog`,children:[Te&&(0,q.jsx)(`div`,{className:`models-provider-select`,children:(0,q.jsx)(nM,{label:u(`provider`),className:`models-provider-picker`,options:Se.map(e=>({value:e.id,label:e.name||e.id,icon:(0,q.jsx)(Yk,{id:e.id})})),value:Te.id,isDisabled:R,placement:`below`,onChange:e=>{A(e);let t=`add:${e}`;S(e=>e.includes(t)?e:[...e,t])}})}),x.filter(e=>e.startsWith(`add:`)&&e!==`add:custom`&&!e.startsWith(`add:account:`)).map(e=>(0,q.jsx)(`div`,{hidden:e!==`add:${Te?.id}`,children:ke(e,e.slice(4),!0,!1)},e))]}),x.includes(`add:custom`)&&(0,q.jsx)(`div`,{hidden:T!==`custom`,children:ke(`add:custom`,``,!0,!0)})]}),!C&&(0,q.jsxs)(`button`,{type:`button`,className:`models-add-button`,ref:me,disabled:R,onClick:()=>{he.current=null,V(null),w(!0),b(null),ae(null),U(Ee.find(e=>e.id===T)?.available?T:Ee.find(e=>e.available).id)},children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),u(`providerAdd`)]})]}),i&&(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`modelSelectionBusy`)})]}),oe&&(0,q.jsx)(uj,{isOpen:!0,title:u(`removeProvider`,{provider:xe.find(e=>e.id===oe)?.name||oe}),description:ce||u(`providerRemoveDetail`),isActionLoading:R,cancelLabel:u(`cancel`),actionLabel:u(R?`savingSettings`:`providerRemove`),onOpenChange:e=>{!e&&!R&&se(null)},onAction:()=>{if(R||i||!ve)return;let t=new AbortController;H.current=t,P(!0),le(null),new de().changeProviderConfiguration(e,ve.revision,{action:`remove`,provider:oe},t.signal).then(()=>{t.signal.aborted||(Oe(oe),se(null),m(e=>e+1),o().catch(()=>!1))},e=>{t.signal.aborted||le(u(e instanceof ge&&e.code===`MODEL_CONFIGURATION_CONFLICT`?`modelConfigurationConflict`:`providerConfigurationFailed`))}).finally(()=>{t.signal.aborted||P(!1)})}})]})}function sW(){let e={version:`1.1.0`,id:`0746de8f104151b57ab00e1b97ff31bc252ab81b2e22c6739aa61c0100ae4658`,mode:`production`},{t}=W(),[n,r]=(0,K.useState)(null),[i,a]=(0,K.useState)(`loading`),[o,s]=(0,K.useState)(0);(0,K.useEffect)(()=>{let e=new AbortController,t=new de;return a(`loading`),r(null),t.request(`/api/diagnostics`,{signal:e.signal}).then(t=>{e.signal.aborted||(r(t.openpi??null),a(`ready`))},()=>{e.signal.aborted||a(`error`)}),()=>e.abort()},[o]);let c=t(`notReported`),l=e?.id&&n?.frontendAtStartup?.id&&e.id!==n.frontendAtStartup.id;return(0,q.jsxs)(`section`,{className:`settings-section-block`,"aria-label":t(`runtimeIdentity`),children:[(0,q.jsx)(`h2`,{children:t(`runtimeIdentity`)}),(0,q.jsx)(`p`,{children:t(`runtimeIdentityHint`)}),i===`loading`&&(0,q.jsx)(`p`,{role:`status`,children:t(`settingsCatalogLoading`)}),i===`error`&&(0,q.jsx)(`p`,{role:`alert`,children:t(`runtimeIdentityFailed`)}),(0,q.jsxs)(`dl`,{className:`settings-summary-list runtime-identity-list`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeBackendVersion`)}),(0,q.jsx)(`dd`,{children:n?.version??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimePackageRoot`)}),(0,q.jsx)(`dd`,{children:n?.packageRoot??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeStartedAt`)}),(0,q.jsx)(`dd`,{children:n?new Date(n.startedAt).toLocaleString():c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeGitRevision`)}),(0,q.jsx)(`dd`,{children:n?.git?.revision??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeGitState`)}),(0,q.jsx)(`dd`,{children:n?.git?.dirty==null?c:t(n.git.dirty?`runtimeGitDirty`:`runtimeGitClean`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeFrontendVersion`)}),(0,q.jsx)(`dd`,{children:e?.version??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeFrontendBuild`)}),(0,q.jsx)(`dd`,{children:e?.mode===`development`?t(`runtimeDevelopmentBuild`):e?.id??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeStartupBuild`)}),(0,q.jsx)(`dd`,{children:n?.frontendAtStartup?.id??c})]})]}),l&&(0,q.jsx)(`p`,{role:`status`,children:t(`runtimeBuildMismatch`)}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>s(e=>e+1),disabled:i===`loading`,children:t(`refreshStatus`)})]})}var cW=20,lW={track:{kVAEAm:`x10l6tqk`,kWkggS:`xdsb6cv`,kaIpWk:`xjspbzw`,$$css:!0},trackHorizontal:{kLqNvP:`x1o0tod`,kt4wiu:`xtijo5x`,kZKoxP:`xqu0tyb`,k87sOh:`xwa60dl`,k3aq6I:`x1cb1t30`,$$css:!0},trackVertical:{k87sOh:`x13vifvy`,krVfgx:`x1ey2m1c`,kzqmXN:`x51ohtg`,$$css:!0},filledTrack:{kVAEAm:`x10l6tqk`,kWkggS:`x1ewilqj`,kaIpWk:`xjspbzw`,$$css:!0},filledTrackHorizontal:{kZKoxP:`xqu0tyb`,k87sOh:`xwa60dl`,k3aq6I:`x1cb1t30`,$$css:!0},filledTrackVertical:{kzqmXN:`x51ohtg`,$$css:!0},thumb:{kVAEAm:`x10l6tqk`,kzqmXN:`xw4jnvo`,kZKoxP:`x1qx5ct2`,kaIpWk:`xjspbzw`,kWkggS:`x1ewilqj`,k3aq6I:`x11lhmoz`,k1ekBW:`x106061f`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,kI3sdo:`x1a2a7pz`,kkrTdU:`x1jm3nie x16khyan`,kY2c9j:`x1vjfegm`,$$css:!0},thumbHorizontal:{k87sOh:`xwa60dl`,k3aq6I:`x11lhmoz xoffwj3`,$$css:!0},thumbHover:{kWkggS:`x1ewilqj xvxo0qp`,$$css:!0},thumbDisabled:{kWkggS:`xwmxj5m`,kkrTdU:`xt0e3qv`,$$css:!0}};function uW(e,t,n){return Math.min(Math.max(e,t),n)}function dW(e){if(Math.abs(e)<1){let t=e.toExponential().split(`e-`);if(t.length===2)return(t[0].split(`.`)[1]?.length??0)+parseInt(t[1],10)}let t=String(e).split(`.`)[1];return t?t.length:0}function fW(e,t,n){if(n<=0)return e;let r=t+Math.round((e-t)/n)*n,i=Math.min(Math.max(dW(t),dW(n)),20);return Number(r.toFixed(i))}function pW(e,t,n){return n===t?0:(e-t)/(n-t)*100}var mW=cW/2;function hW(e){return vW(e,mW-e/100*cW)}function gW(e,t){let n=t-e;return vW(n,-(n/100)*cW)}function _W(e,t){let n=t-cW;return n>0?(e-mW)/n:t>0?e/t:0}function vW(e,t){let n=e=>Number(e.toFixed(3));return`calc(${n(e)}% ${t<0?`-`:`+`} ${Math.abs(n(t))}px)`}function yW({ref:e,...t}){let{label:n,isLabelHidden:r=!1,description:i,isDisabled:a=!1,disabledMessage:o,isOptional:s=!1,isRequired:c=!1,status:l,labelTooltip:u,min:d=0,max:f=100,step:p=1,orientation:m=`horizontal`,formatValue:h,htmlName:g,valueDisplay:_=`tooltip`,marks:v,width:y,xstyle:b,className:x,style:S,"data-testid":C,value:T,onChange:E,onChangeEnd:k}=t,A=Array.isArray(T),j=A&&`minStepsBetweenThumbs`in t?t.minStepsBetweenThumbs??0:0,M=m===`horizontal`,P=(0,K.useId)(),I=(0,K.useId)(),ee=(0,K.useId)(),L=(0,K.useId)(),R=(0,K.useId)(),te=(0,K.useRef)(null),z=(0,K.useRef)(null),[B,ne]=(0,K.useState)(null),[re,ie]=(0,K.useState)(null);(0,K.useEffect)(()=>{D()},[]);let ae=(0,K.useCallback)((e,t)=>{ie(!a&&N()===`keyboard`?e:null)},[a]),oe=(0,K.useCallback)(e=>{ie(null)},[]),se=a&&!!o,ce=F({placement:`above`,focusTrigger:`always`,isEnabled:se}),le=c&&!s,ue=[];i&&ue.push(ee),l?.message&&ue.push(L),le&&ue.push(R),se&&ue.push(ce.describedBy);let de=ue.length>0?ue.join(` `):void 0,pe=(0,K.useMemo)(()=>(Array.isArray(T)?T:[T??d]).map(e=>uW(e,d,f)),[T,d,f]),me=(0,K.useRef)(pe);me.current=pe;let he=(0,K.useCallback)((e,t)=>{let n=te.current;if(!n)return d;let r=n.getBoundingClientRect(),i;return i=M?_W(Ya(n)?r.right-e:e-r.left,r.width):1-_W(t-r.top,r.height),i=uW(i,0,1),uW(fW(d+i*(f-d),d,p),d,f)},[d,f,p,M]),ge=(0,K.useCallback)(e=>{if(!A)return 0;let[t,n]=pe;return Math.abs(e-t)<=Math.abs(e-n)?0:1},[A,pe]),_e=(0,K.useCallback)((e,t)=>{if(a)return;let n=uW(fW(t,d,p),d,f);if(A){let t=[...pe];t[e]=n;let r=j*p;e===0?t[0]=Math.min(t[0],t[1]-r):t[1]=Math.max(t[1],t[0]+r),t[0]=uW(t[0],d,f),t[1]=uW(t[1],d,f),E?.(t)}else E?.(n)},[a,A,pe,d,f,p,j,E]),ve=(0,K.useRef)(k);ve.current=k;let ye=(0,K.useCallback)(e=>{let t=e??me.current,n=ve.current;A?n?.(t):n?.(t[0])},[A]),be=(0,K.useCallback)(e=>{if(a)return;e.preventDefault();let t=e.target.closest(`[data-mark-value]`),n=t?Number(t.dataset.markValue):he(e.clientX,e.clientY),r=ge(n);z.current=r,ne(r),_e(r,n);let i=te.current;i&&i.querySelectorAll(`[role="slider"]`)[r]?.focus(),ie(null),typeof e.currentTarget.setPointerCapture==`function`&&e.currentTarget.setPointerCapture(e.pointerId)},[a,he,ge,_e]),xe=(0,K.useCallback)(e=>{if(z.current===null||a)return;let t=he(e.clientX,e.clientY);_e(z.current,t)},[a,he,_e]),Se=(0,K.useCallback)(e=>{z.current!==null&&(z.current=null,ne(null),ye())},[ye]),Ce=(0,K.useCallback)((e,t)=>{if(a)return;N()===`keyboard`&&ie(e);let n=pe[e],r;switch(t.key){case`ArrowRight`:case`ArrowUp`:r=n+p;break;case`ArrowLeft`:case`ArrowDown`:r=n-p;break;case`PageUp`:r=n+p*10;break;case`PageDown`:r=n-p*10;break;case`Home`:r=d;break;case`End`:r=f;break;default:return}t.preventDefault();let i=uW(fW(r,d,p),d,f);if(_e(e,r),A){let t=[...pe];t[e]=i;let n=j*p;e===0?t[0]=Math.min(t[0],t[1]-n):t[1]=Math.max(t[1],t[0]+n),t[0]=uW(t[0],d,f),t[1]=uW(t[1],d,f),ye(t)}else ye([i])},[a,A,pe,p,d,f,j,_e,ye]),Te=e=>h?h(e):String(e),Ee=e=>{let t=pe[e],n=pW(t,d,f),r=M?{insetInlineStart:hW(n)}:{bottom:hW(n),left:`50%`},i=A?e===0?`Minimum value`:`Maximum value`:void 0,o=j*p,s=A&&e===1?uW(pe[0]+o,d,f):d,c=A&&e===0?uW(pe[1]-o,d,f):f,u=_===`tooltip`&&!se,g=M?`above`:`start`,v=(0,q.jsx)(`div`,{id:A?void 0:P,role:`slider`,tabIndex:a&&!se?-1:0,"aria-valuemin":s,"aria-valuemax":c,"aria-valuenow":t,"aria-valuetext":h?h(t):void 0,"aria-orientation":m,"aria-disabled":a||void 0,"aria-invalid":l?.type===`error`||void 0,"aria-label":i,"aria-labelledby":A?void 0:I,"aria-describedby":de,onKeyDown:t=>Ce(e,t),onFocus:t=>ae(e,t),onBlur:oe,...H(O(`slider-thumb`,{orientation:m,disabled:a?`disabled`:null}),w(lW.thumb,M?lW.thumbHorizontal:Et.centerInline(`50%`),!a&&lW.thumbHover,!a&&re===e&&fe.focusVisible,a&&lW.thumbDisabled),void 0,r)},e);return u?(0,q.jsx)(V,{content:Te(t),placement:g,delay:0,focusTrigger:`always`,isOpen:B===e||void 0,children:v},e):v},U=(()=>{if(A){let[e,t]=pe,n=pW(e,d,f),r=pW(t,d,f);return M?{insetInlineStart:hW(n),width:gW(n,r)}:{bottom:hW(n),height:gW(n,r)}}let e=pW(pe[0],d,f);return M?{insetInlineStart:`0%`,width:hW(e)}:{bottom:`0%`,height:hW(e)}})(),De=_===`text`?(0,q.jsx)(`span`,{className:`x9ynric xcr08ib x1tgivj0 xuxw1ft x2lah0s`,children:A?`${Te(pe[0])} – ${Te(pe[1])}`:Te(pe[0])}):null;return(0,q.jsxs)(zO,{"data-testid":C,label:n,isLabelHidden:r,description:i,inputID:P,labelID:I,isGroupLabel:!0,descriptionID:i?ee:void 0,isOptional:s,isRequired:c,isDisabled:a,status:l?{type:l.type,message:l.message,messageID:l.message?L:void 0}:void 0,labelTooltip:u,statusVariant:`detached`,width:y,xstyle:b,className:x,style:S,children:[(0,q.jsxs)(`div`,{...H(O(`slider`,{orientation:m,disabled:a?`disabled`:null}),{className:`x78zum5 x6s0dn4 x1txdalj`}),children:[g!=null&&pe.map((e,t)=>(0,q.jsx)(`input`,{type:`hidden`,name:g,value:String(e),disabled:a},t===0?`start`:`end`)),(0,q.jsxs)(`div`,{ref:we(e,te,ce.ref),...A?{role:`group`,"aria-labelledby":I}:void 0,onPointerDown:be,onPointerMove:xe,onPointerUp:Se,onPointerCancel:Se,...{0:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k x1ypdohk x16khyan`},2:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 x1ypdohk x16khyan`},1:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k xbyyjgo xt0e3qv`},3:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 xbyyjgo xt0e3qv`}}[!!M<<1|!!a<<0],children:[(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(O(`slider-track`,{orientation:m}),w(lW.track,M?lW.trackHorizontal:[lW.trackVertical,Et.centerInline(`0px`)]))}),(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(w(lW.filledTrack,M?lW.filledTrackHorizontal:[lW.filledTrackVertical,Et.centerInline(`0px`)]),{style:U})}),v&&(0,q.jsx)(`div`,{"aria-hidden":`true`,...{0:{className:`x10l6tqk x13vifvy x1ey2m1c xbudbmw`},1:{className:`x10l6tqk x1o0tod xtijo5x xwa60dl`}}[!!M<<0],children:v.map(e=>{let t=pW(e.value,d,f),n=M?{insetInlineStart:hW(t)}:{bottom:hW(t)};return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{"data-testid":`slider-mark`,"data-mark-value":e.value,...H({0:{className:`x10l6tqk x7njt3n xjspbzw x36qwtl x1xc55vz x1m9mm8y`},1:{className:`x10l6tqk x7njt3n xjspbzw xfo62xy xdk7pt x11lhmoz xoffwj3`}}[!!M<<0],{style:n})}),e.label&&(0,q.jsx)(`span`,{"data-testid":`slider-mark-label`,"data-mark-value":e.value,...H({0:{className:`x10l6tqk x9ynric x141an7d xv1l7n4 xuxw1ft x131p8rn x9p6ekw`},1:{className:`x10l6tqk x9ynric x141an7d xv1l7n4 xuxw1ft xuuh30 x1nyx83j xuivejd`}}[!!M<<0],{style:n}),children:e.label})]},e.value)})}),pe.map((e,t)=>Ee(t))]}),De]}),le&&(0,q.jsx)(Kt,{id:R,children:`Required`}),se&&ce.renderTooltip(o)]})}yW.displayName=`Slider`;var bW=[`explorer`,`implementer`,`reviewer`,`advisor`];function xW({catalog:e,error:t,onRefresh:n}){let{t:r}=W();return!t&&!e?(0,q.jsxs)(`div`,{className:`settings-load-state`,role:`status`,children:[(0,q.jsx)(me,{className:`settings-spin`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:r(`settingsCatalogLoading`)})]}):t?(0,q.jsxs)(`div`,{className:`settings-load-state error`,role:`alert`,children:[(0,q.jsx)(`strong`,{children:r(`settingsCatalogFailed`)}),(0,q.jsx)(`span`,{children:t}),(0,q.jsx)(`button`,{type:`button`,onClick:n,children:r(`retryAdmissionCheck`)})]}):null}function SW({icon:e,title:t,description:n,value:r,disabled:i,loading:a,onChange:o}){return(0,q.jsxs)(`div`,{className:`settings-inline-control settings-toggle-row`,children:[(0,q.jsx)(e,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-inline-copy`,children:[(0,q.jsx)(`strong`,{children:t}),n&&(0,q.jsx)(`small`,{children:n})]}),(0,q.jsx)(bj,{label:t,isLabelHidden:!0,value:r,size:`sm`,isDisabled:i,isLoading:a,onChange:o})]})}function CW({isPending:e,isBlocked:t=!1,onConfigure:n,request:r,label:i}){return(0,q.jsx)(Br,{label:i,variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Xc,{"aria-hidden":`true`}),isDisabled:e||t,isLoading:e,onClick:()=>void n(r)})}function wW({pending:e,onConfigure:t,placeholder:n}){let{t:r}=W(),[i,a]=(0,K.useState)(``);return(0,q.jsxs)(`form`,{className:`settings-edit-form`,onSubmit:n=>{n.preventDefault(),!e&&i.trim()&&t(i.trim())},children:[(0,q.jsxs)(`label`,{className:`settings-form-field`,children:[r(`setupConfigurationRequest`),(0,q.jsx)(`textarea`,{required:!0,maxLength:2e3,value:i,disabled:e,placeholder:n,onChange:e=>a(e.target.value)})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:e||!i.trim(),children:r(`configureViaSetup`)}),(0,q.jsx)(`small`,{children:r(`setupFormDetail`)})]})}function TW({catalog:e,error:t,currentModel:n,thinkingLevel:r,cwd:i,setupPending:a,setupBlocked:o=!1,preferencePending:s,setupBusy:c,setupBlockedReason:l,onConfigure:u,onUpdatePreferences:d,onOpenRuntimeStatus:f,onRefresh:p}){let{t:m}=W(),h=e?.setup,g=h?.workflows.concurrency??0,_=h?.workflows.maxAgentCalls??0,[v,y]=(0,K.useState)(g),[b,x]=(0,K.useState)(_);return(0,K.useEffect)(()=>y(g),[g]),(0,K.useEffect)(()=>x(_),[_]),(0,q.jsxs)(`section`,{className:`settings-content-page settings-general-panel`,children:[(0,q.jsxs)(`div`,{className:`settings-page-heading`,children:[(0,q.jsx)(`div`,{children:(0,q.jsx)(`h1`,{children:m(`generalSettings`)})}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:u,request:m(`setupRequestReviewAll`),label:m(`configureOpenPi`)})]}),c&&(0,q.jsx)(`p`,{className:`settings-pending-hint`,role:`status`,children:l||m(`settingsSetupBusyHint`)}),(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:p}),h&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`section`,{className:`settings-section-block`,children:(0,q.jsxs)(`div`,{className:`settings-follow-up-control`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:m(`followUpBehavior`)}),(0,q.jsx)(`p`,{children:m(`followUpBehaviorDetail`)})]}),(0,q.jsxs)(`fieldset`,{className:`settings-follow-up-choices`,disabled:s,children:[(0,q.jsx)(`legend`,{className:`sr-only`,children:m(`followUpBehavior`)}),[`followUp`,`steer`].map(e=>(0,q.jsxs)(`label`,{children:[(0,q.jsx)(`input`,{type:`radio`,name:`follow-up-behavior`,value:e,"aria-label":m(e===`steer`?`followUpSteer`:`followUpQueue`),checked:(h.ui.webFollowUpBehavior??`followUp`)===e,onChange:()=>void d({followUpBehavior:e})}),(0,q.jsxs)(`span`,{className:`settings-follow-up-option`,children:[e===`steer`?(0,q.jsx)(Cs,{"aria-hidden":`true`}):(0,q.jsx)(tc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-follow-up-option-copy`,children:[(0,q.jsx)(`strong`,{children:m(e===`steer`?`followUpSteer`:`followUpQueue`)}),(0,q.jsx)(`small`,{children:m(e===`steer`?`followUpSteerDetail`:`followUpQueueDetail`)})]})]})]},e))]})]})}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`agentBehavior`)}),(0,q.jsxs)(`div`,{className:`settings-chat-controls`,children:[(0,q.jsxs)(`form`,{className:`settings-limits-control`,onSubmit:e=>{e.preventDefault(),!a&&!o&&u(m(`setupRequestLimits`,{concurrency:v,calls:b}))},children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(Us,{"aria-hidden":`true`}),m(`workflowLimits`)]}),(0,q.jsx)(`small`,{children:m(`workflowLimitsValue`,{concurrency:h.workflows.concurrency,calls:h.workflows.maxAgentCalls})}),(0,q.jsxs)(`label`,{children:[m(`workflowConcurrency`),(0,q.jsx)(`input`,{type:`number`,min:1,value:v,disabled:a||o,onChange:e=>y(Number(e.target.value)),required:!0})]}),(0,q.jsxs)(`label`,{children:[m(`workflowCalls`),(0,q.jsx)(`input`,{type:`number`,min:1,value:b,disabled:a||o,onChange:e=>x(Number(e.target.value)),required:!0})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:a||o||v===h.workflows.concurrency&&b===h.workflows.maxAgentCalls,children:m(`configureViaSetup`)})]}),(0,q.jsx)(SW,{icon:Pc,title:m(`nextActionSuggestions`),description:m(`nextActionSuggestionsDetail`),value:h.suggestions.enabled,disabled:a||o,loading:a,onChange:e=>void u(m(e?`setupRequestEnableSuggestions`:`setupRequestDisableSuggestions`))}),h.suggestions.model&&(0,q.jsx)(`small`,{children:`${h.suggestions.model.provider}/${h.suggestions.model.model} · ${h.suggestions.model.reasoning}`}),(0,q.jsxs)(`div`,{className:`settings-inline-control`,children:[(0,q.jsx)(bs,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-inline-copy`,children:[(0,q.jsxs)(`strong`,{children:[m(`postEditCommand`),(0,q.jsx)(`span`,{className:`settings-inline-status`,children:m(h.postEditConfigured?`configured`:`disabled`)})]}),(0,q.jsx)(`small`,{children:m(`postEditCommandDetail`)})]}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:u,request:m(`setupRequestPostEdit`),label:m(`configurePostEdit`)})]}),(0,q.jsx)(`small`,{children:m(`agentSettingsSetupHint`)})]})]}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`resultDisplay`)}),(0,q.jsxs)(`div`,{className:`settings-chat-controls`,children:[[[`subagentResultDisplay`,`subagentResults`,ws],[`bashToolDisplay`,`bashOperations`,Vc],[`fileMutationDisplay`,`fileMutations`,Fs]].map(([e,t,n])=>(0,q.jsxs)(`label`,{className:`settings-inline-control`,htmlFor:`settings-${e}`,children:[(0,q.jsx)(n,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`settings-inline-copy`,children:(0,q.jsx)(`strong`,{children:m(t)})}),(0,q.jsx)(Tj,{id:`settings-${e}`,className:`settings-select-control`,label:m(t),value:h.ui[e],disabled:s,onChange:t=>{(t===`full`||t===`compact`)&&d({[e]:t})},options:[{value:`compact`,label:m(`detailDisplay_compact`)},{value:`full`,label:m(`detailDisplay_full`)}]})]},e)),(0,q.jsx)(SW,{icon:mc,title:m(`terminalFooter`),value:h.ui.customFooter,disabled:s,loading:s,onChange:e=>void d({customFooter:e})}),(0,q.jsxs)(`label`,{className:`settings-inline-control`,htmlFor:`settings-footer-style`,children:[(0,q.jsx)(`span`,{children:m(`terminalFooterStyle`)}),(0,q.jsx)(Tj,{id:`settings-footer-style`,className:`settings-select-control`,label:m(`terminalFooterStyle`),value:h.ui.footerStyle,disabled:s||!h.ui.customFooter,onChange:e=>{(e===`plain`||e===`powerline`||e===`powerline-mono`)&&d({footerStyle:e})},options:[{value:`plain`,label:`Plain`},{value:`powerline`,label:`Powerline`},{value:`powerline-mono`,label:`Powerline Mono`}]})]}),(0,q.jsx)(`small`,{children:m(`terminalFooterHint`)})]})]})]}),(0,q.jsx)(sW,{}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`sessionSettings`)}),(0,q.jsxs)(`dl`,{className:`settings-summary-list`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`selectedModel`)}),(0,q.jsx)(`dd`,{children:n?.label??m(`noModels`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`thinkingLevel`)}),(0,q.jsx)(`dd`,{children:r})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`currentWorkspace`)}),(0,q.jsx)(`dd`,{title:i,children:i})]})]}),(0,q.jsx)(Br,{label:m(`openRuntimeDetails`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ls,{"aria-hidden":`true`}),className:`settings-runtime-action`,onClick:f})]})]})}function EW(e){return e.split(/[\\/]/u).filter(Boolean).at(-1)||e}function DW({kind:e,query:t,scope:n,onQuery:r,onScope:i,onAdd:a}){let{t:o}=W();return(0,q.jsxs)(`div`,{className:`settings-resource-toolbar`,children:[(0,q.jsxs)(`div`,{className:`settings-resource-toolbar-heading`,children:[(0,q.jsx)(`strong`,{children:o(`resources`)}),(0,q.jsx)(Br,{label:o(e===`skills`?`addSkill`:`addPlugin`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:a})]}),(0,q.jsxs)(`label`,{className:`settings-resource-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":o(`searchResources`),placeholder:o(`searchResources`),value:t,onChange:e=>r(e.target.value)})]}),(0,q.jsx)(Tj,{label:o(`filterResourceScope`),value:n,onChange:i,options:[{value:`all`,label:o(`allResourceScopes`)},...[`project`,`user`,`temporary`].map(e=>({value:e,label:o(`resourceScope_${e}`)}))]})]})}function OW({kind:e,pending:t,onConfigure:n,onCancel:r}){let{t:i}=W(),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(`user`);return(0,q.jsxs)(`section`,{className:`settings-resource-install`,children:[(0,q.jsx)(`header`,{className:`settings-detail-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:i(e===`skills`?`addSkill`:`addPlugin`)}),(0,q.jsx)(`p`,{children:i(`resourceInstallIntro`)})]})}),(0,q.jsxs)(`form`,{className:`settings-edit-form`,onSubmit:r=>{r.preventDefault(),!t&&a.trim()&&n(i(`setupResourceInstallRequest`,{kind:i(e===`skills`?`skillsSettings`:`pluginsSettings`),source:JSON.stringify(a.trim()),scope:s}))},children:[(0,q.jsxs)(`label`,{className:`settings-form-field`,children:[i(`resourcePackageSource`),(0,q.jsx)(`input`,{required:!0,maxLength:1e3,value:a,placeholder:i(`resourcePackageSourcePlaceholder`),disabled:t,onChange:e=>{o(e.target.value)}})]}),(0,q.jsxs)(`label`,{className:`settings-form-field`,htmlFor:`resource-install-scope`,children:[i(`scope`),(0,q.jsx)(Tj,{id:`resource-install-scope`,label:i(`scope`),value:s,disabled:t,onChange:c,options:[{value:`user`,label:i(`resourceScope_user`)},{value:`project`,label:i(`resourceScope_project`)}]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-actions`,children:[(0,q.jsx)(Br,{type:`submit`,label:i(`configureViaSetup`),variant:`secondary`,size:`sm`,isDisabled:t||!a.trim()}),(0,q.jsx)(Br,{label:i(`cancel`),variant:`ghost`,size:`sm`,onClick:r})]}),(0,q.jsx)(`small`,{children:i(`resourceInstallReview`)})]}),e===`skills`&&(0,q.jsxs)(`a`,{className:`settings-resource-link`,href:`https://skills.sh`,target:`_blank`,rel:`noreferrer`,children:[i(`browseSkills`),(0,q.jsx)(Os,{"aria-hidden":`true`})]})]})}function kW({catalog:e,pending:t,onReload:n,kind:r,onConfigure:i,children:a}){let{t:o}=W(),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(null);return(0,q.jsxs)(`section`,{className:`settings-resource-management`,children:[a&&(0,q.jsx)(`div`,{className:`settings-resource-actions`,children:a}),(0,q.jsxs)(`div`,{className:`settings-resource-reload`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:o(`resourceSessionState`)}),(0,q.jsx)(`p`,{children:o(`resourcesReloadNote`)})]}),(0,q.jsx)(Br,{label:o(`reloadResources`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(me,{"aria-hidden":`true`}),isDisabled:t||l||!e?.sessionPath||!n,isLoading:l,onClick:()=>c(!0)})]}),d&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,role:`status`,children:d}),(0,q.jsxs)(`details`,{className:`settings-resource-advanced`,children:[(0,q.jsx)(`summary`,{children:o(`advancedResourceConfiguration`)}),(0,q.jsx)(wW,{pending:t,onConfigure:i,placeholder:o(r===`skills`?`setupSkillsPlaceholder`:`setupPluginsPlaceholder`)})]}),s&&(0,q.jsx)(uj,{isOpen:!0,onOpenChange:c,title:o(`reloadResources`),description:o(`resourceReloadReview`),cancelLabel:o(`cancel`),actionLabel:o(`reloadResources`),onAction:()=>{c(!1),u(!0),f(null),n?.().then(()=>f(o(`resourceReloaded`)),e=>f(e instanceof Error?e.message:o(`resourceReloadFailed`))).finally(()=>u(!1))}})]})}function AW({catalog:e}){let{t}=W();if(!e)return null;let{diagnostics:n,truncation:r}=e.resources;return!n.settingsErrors&&!n.extensionErrors&&!n.skillErrors&&!r.truncated?null:(0,q.jsxs)(`p`,{className:`settings-resource-notice`,role:`status`,children:[t(`resourceDiagnostics`,n),n.settingsErrors?` ${t(`resourceConfigurationDiagnostics`,{count:n.settingsErrors})}`:``,r.truncated&&` ${t(`resourceCatalogTruncated`)}`]})}function jW({catalog:e,error:t,onRefresh:n,setupPending:r,onConfigure:i,onReload:a}){let{t:o}=W(),s=e?.resources.skills??[],[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(`all`),[f,p]=(0,K.useState)(!1),m=(0,K.useMemo)(()=>s.filter(e=>(u===`all`||e.scope===u)&&`${e.name} ${e.description} ${e.source}`.toLocaleLowerCase().includes(c.trim().toLocaleLowerCase())),[s,c,u]),h=(0,K.useMemo)(()=>[`project`,`user`,`temporary`].map(e=>({scope:e,skills:m.filter(t=>t.scope===e)})).filter(e=>e.skills.length>0),[m]),[g,_]=(0,K.useState)(``),[v,y]=(0,K.useState)(null),b=m.find(e=>e.id===g)??m[0],x=m.filter(e=>e.canManage!==!1),S=JSON.stringify(x.map(e=>e.filePath)),C=new TextEncoder().encode(S).length>12e3;(0,K.useEffect)(()=>{s.length&&!s.some(e=>e.id===g)&&_(s[0].id)},[g,s]);let w=e=>{y(null),td(`/skill:${e.name} `).then(e=>y(e?`copied`:`failed`))};return(0,q.jsxs)(`section`,{className:`settings-content-page settings-managed-panel`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:o(`skillsSettings`)}),(0,q.jsx)(`p`,{children:o(`skillsEmptyIntro`)})]})}),(0,q.jsxs)(`aside`,{className:`settings-resource-sidebar`,children:[(0,q.jsx)(DW,{kind:`skills`,query:c,scope:u,onQuery:l,onScope:d,onAdd:()=>p(!0)}),(0,q.jsxs)(`div`,{className:`settings-resource-list`,children:[h.map(e=>(0,q.jsxs)(`section`,{className:`settings-resource-group`,children:[(0,q.jsx)(`span`,{className:`settings-sidebar-label`,children:o(`resourceScope_${e.scope}`)}),e.skills.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:`settings-resource-item`,"aria-current":e.id===b?.id?`page`:void 0,onClick:()=>{_(e.id),y(null),p(!1)},children:[(0,q.jsx)(Pc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:e.name}),(0,q.jsx)(`small`,{children:o(e.disableModelInvocation?`explicitOnly`:`availableToModel`)})]})]},e.id))]},e.scope)),!e&&!t&&(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}),e&&!m.length&&(0,q.jsx)(`p`,{className:`settings-resource-empty`,children:o(s.length?`noMatchingResources`:`noSkillsFound`)})]}),(0,q.jsxs)(`div`,{className:`settings-sidebar-footer`,children:[(0,q.jsx)(`span`,{children:o(`skillCount`,{count:s.length})}),(0,q.jsx)(`button`,{type:`button`,"aria-label":o(`refreshStatus`),onClick:n,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-detail`,children:[(0,q.jsx)(AW,{catalog:e}),f?(0,q.jsx)(OW,{kind:`skills`,pending:r,onConfigure:i,onCancel:()=>p(!1)}):t?(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}):b?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`settings-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:b.name}),(0,q.jsx)(`p`,{children:b.description})]}),(0,q.jsx)(Br,{label:o(v===`copied`?`copiedMessage`:`copySkillInvocation`),variant:`secondary`,size:`sm`,icon:v===`copied`?(0,q.jsx)(rs,{}):(0,q.jsx)(_s,{}),onClick:()=>w(b)})]}),(0,q.jsxs)(`dl`,{className:`settings-detail-metadata`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`source`)}),(0,q.jsx)(`dd`,{children:b.source===`auto`?o(`resourceSourceAuto`):b.source===`local`?o(`resourceSourceLocal`):b.source===`builtin`?o(`builtIn`):b.source})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`scope`)}),(0,q.jsx)(`dd`,{children:o(`resourceScope_${b.scope}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`invocation`)}),(0,q.jsx)(`dd`,{children:(0,q.jsx)(`code`,{children:`/skill:${b.name}`})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`modelInvocation`)}),(0,q.jsx)(`dd`,{children:o(b.disableModelInvocation?`explicitOnly`:`availableToModel`)})]})]}),(0,q.jsxs)(`section`,{className:`settings-path-block`,children:[(0,q.jsx)(Fs,{"aria-hidden":`true`}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:o(`skillFile`)}),(0,q.jsx)(`code`,{children:b.filePath})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-actions`,children:[(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(b.disableModelInvocation?`enableSkillInvocation`:`disableSkillInvocation`),request:o(`setupSkillInvocationRequest`,{path:b.filePath,disabled:!b.disableModelInvocation})}),(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(`updateResource`),request:o(`setupSkillManageRequest`,{action:`update`,path:JSON.stringify(b.filePath),source:JSON.stringify(b.source),scope:b.scope})}),(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(`removeResource`),request:o(`setupSkillManageRequest`,{action:`remove`,path:JSON.stringify(b.filePath),source:JSON.stringify(b.source),scope:b.scope})})]}),b.canManage===!1&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,children:o(`resourceTargetTruncated`)}),v===`failed`&&(0,q.jsx)(`p`,{className:`inspection-warning`,children:o(`copyFailed`)})]}):(0,q.jsxs)(`div`,{className:`settings-empty-detail`,children:[(0,q.jsx)(Pc,{"aria-hidden":`true`}),(0,q.jsx)(`h2`,{children:o(s.length?`noMatchingResources`:`skillsEmptyTitle`)}),(0,q.jsx)(Br,{label:o(`addSkill`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:()=>p(!0)})]}),!f&&(0,q.jsxs)(kW,{catalog:e,pending:r,onReload:a,kind:`skills`,onConfigure:i,children:[x.length>1&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(CW,{isPending:r,isBlocked:C,onConfigure:i,label:o(`enableVisibleSkills`,{count:x.length}),request:o(`setupSkillsBulkRequest`,{paths:S,disabled:!1})}),(0,q.jsx)(CW,{isPending:r,isBlocked:C,onConfigure:i,label:o(`disableVisibleSkills`,{count:x.length}),request:o(`setupSkillsBulkRequest`,{paths:S,disabled:!0})})]}),C&&(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`resourceBulkTooLarge`)})]})]})]})}function MW({catalog:e,error:t,currentModel:n,models:r,activity:i,setupPending:a,setupBlocked:o=!1,onConfigure:s,onRefresh:c}){let{t:l}=W(),[u,d]=(0,K.useState)(`explorer`),f=e?.setup.subagents.roleModels[u],[p,m]=(0,K.useState)(``),[h,g]=(0,K.useState)(1);(0,K.useEffect)(()=>{let t=e?.setup.subagents.roleModels[u];m(t?`${t.provider}/${t.model}`:``),g(e?.setup.workflows.concurrency??1)},[u,e]);let _=i?.items.filter(e=>e.status===`running`).length??0,v=i?.items.filter(e=>e.status!==`running`).length??0;return(0,q.jsxs)(`section`,{className:`settings-content-page settings-subagents-panel`,children:[(0,q.jsxs)(`header`,{className:`settings-page-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:l(`subagentsSettings`)}),(0,q.jsx)(`p`,{children:l(`subagentConfigurationIntro`)})]}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:s,request:l(`setupRequestSubagents`),label:l(`configureRoles`)})]}),(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:c}),(0,q.jsx)(`div`,{className:`settings-control-group`,children:(0,q.jsxs)(`label`,{className:`settings-control-row`,htmlFor:`subagent-role`,children:[(0,q.jsxs)(`span`,{className:`settings-control-copy`,children:[(0,q.jsx)(`strong`,{children:l(`builtInRoles`)}),(0,q.jsx)(`span`,{children:l(`subagentRoleShort_${u}`)})]}),(0,q.jsx)(Tj,{id:`subagent-role`,name:`subagentRole`,label:l(`builtInRoles`),value:u,onChange:e=>{let t=bW.find(t=>t===e);t&&d(t)},options:bW.map(e=>({value:e,label:l(`subagentRole_${e}`)}))})]})}),(0,q.jsx)(`div`,{className:`settings-role-detail`,children:e&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`header`,{className:`settings-detail-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:l(`subagentRole_${u}`)}),(0,q.jsx)(`p`,{children:l(`subagentRoleDescription_${u}`)})]})}),(0,q.jsxs)(`form`,{className:`settings-edit-form settings-role-form`,onSubmit:e=>{e.preventDefault(),!(a||o)&&s(l(`setupRoleFormRequest`,{role:u,model:p||l(`inheritParentModel`),concurrency:h}))},children:[(0,q.jsxs)(`div`,{className:`settings-control-group`,children:[(0,q.jsxs)(`label`,{className:`settings-control-row`,htmlFor:`role-model`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`modelAssignment`)})}),(0,q.jsx)(Tj,{id:`role-model`,name:`roleModel`,label:l(`modelAssignment`),value:p,disabled:a||o,onChange:m,menuWidth:`min(380px, calc(100vw - 32px))`,options:[{value:``,label:l(`inheritParentModel`)},...p&&!r.some(e=>`${e.provider}/${e.id}`===p)?[{value:p,label:p}]:[],...r.map(e=>({value:`${e.provider}/${e.id}`,label:e.label}))]})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`effectiveModel`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:f?`${f.provider}/${f.model}`:n?.label??l(`unknownState`)})]}),(0,q.jsxs)(`label`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`workflowConcurrencyLabel`)})}),(0,q.jsx)(`input`,{name:`concurrency`,type:`number`,autoComplete:`off`,min:1,max:64,required:!0,value:h,disabled:a||o,onChange:e=>g(Number(e.target.value))})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`workflowCallLimit`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:e.setup.workflows.maxAgentCalls})]})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:a||o,children:l(`configureViaSetup`)}),(0,q.jsx)(`small`,{className:`settings-resource-caption`,children:l(`setupFormDetail`)})]}),(0,q.jsxs)(`section`,{className:`settings-role-principles`,children:[(0,q.jsx)(`h2`,{children:l(`runtimeBoundaries`)}),(0,q.jsxs)(`div`,{className:`settings-control-group`,children:[(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(Ys,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:l(`subagentAuthorityNote`)})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(ws,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:l(`subagentModelNote`)})]})]}),(0,q.jsxs)(`p`,{className:`settings-resource-caption`,children:[l(`subagentActiveCount`,{count:_}),` ·`,` `,l(`subagentCompletedCount`,{count:v})]})]})]})})]})}function NW(e){return e.extensions.length+e.skills.length+e.prompts.length+e.themes.length}function PW(e){return e.enabled===!1?`disabled`:e.configured&&!e.installed?`missing`:e.diagnostics?.length?`error`:NW(e)?`loaded`:e.installed?`installed`:`notLoaded`}function FW({catalog:e,error:t,onRefresh:n,setupPending:r,onConfigure:i,onReload:a}){let{t:o}=W(),s=e?.resources.plugins??[],[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(`all`),[f,p]=(0,K.useState)(!1),m=(0,K.useMemo)(()=>s.filter(e=>(u===`all`||e.scope===u)&&`${e.name??``} ${e.source}`.toLocaleLowerCase().includes(c.trim().toLocaleLowerCase())),[s,c,u]),[h,g]=(0,K.useState)(``),_=m.find(e=>e.id===h)??m[0],v=m.filter(e=>e.configured&&e.canManage!==!1),y=e=>e.name??(e.source===`auto`?o(`resourceSourceAuto`):e.source===`builtin`?o(`builtIn`):EW(e.source)),b=JSON.stringify(v.map(({source:e,scope:t,baseDir:n})=>({source:e,scope:t,path:n}))),x=new TextEncoder().encode(b).length>12e3;return(0,K.useEffect)(()=>{s.length&&!s.some(e=>e.id===h)&&g(s[0].id)},[s,h]),(0,q.jsxs)(`section`,{className:`settings-content-page settings-managed-panel`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:o(`pluginsSettings`)}),(0,q.jsx)(`p`,{children:o(`pluginsEmptyIntro`)})]})}),(0,q.jsxs)(`aside`,{className:`settings-resource-sidebar`,children:[(0,q.jsx)(DW,{kind:`plugins`,query:c,scope:u,onQuery:l,onScope:d,onAdd:()=>p(!0)}),(0,q.jsxs)(`div`,{className:`settings-resource-list`,children:[m.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:`settings-resource-item`,"aria-current":e.id===_?.id?`page`:void 0,onClick:()=>{g(e.id),p(!1)},children:[(0,q.jsx)(Sc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:y(e)}),(0,q.jsxs)(`small`,{children:[o(`resourceScope_${e.scope}`),` ·`,` `,o(`pluginState_${PW(e)}`)]})]})]},e.id)),!e&&!t&&(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}),e&&!m.length&&(0,q.jsx)(`p`,{className:`settings-resource-empty`,children:o(s.length?`noMatchingResources`:`noPluginsFound`)})]}),(0,q.jsxs)(`div`,{className:`settings-sidebar-footer`,children:[(0,q.jsx)(`span`,{children:e?o(`pluginCount`,{count:s.length}):o(`settingsCatalogLoading`)}),(0,q.jsx)(`button`,{type:`button`,"aria-label":o(`refreshStatus`),onClick:n,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-detail`,children:[(0,q.jsx)(AW,{catalog:e}),f?(0,q.jsx)(OW,{kind:`plugins`,pending:r,onConfigure:i,onCancel:()=>p(!1)}):t?(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}):_?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`settings-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:y(_)}),(0,q.jsx)(`code`,{children:_.source})]}),(0,q.jsx)(`span`,{className:`settings-status-badge ${PW(_)===`loaded`?`healthy`:``}`,children:o(`pluginState_${PW(_)}`)})]}),(0,q.jsxs)(`dl`,{className:`settings-detail-metadata settings-detail-metadata-wide`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`scope`)}),(0,q.jsx)(`dd`,{children:o(`resourceScope_${_.scope}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`resourceOrigin`)}),(0,q.jsx)(`dd`,{children:o(`resourceOrigin_${_.origin}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`installedVersion`)}),(0,q.jsx)(`dd`,{children:_.installedVersion??o(`notReported`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`configuredVersion`)}),(0,q.jsx)(`dd`,{children:_.configuredVersion??o(`resourceVersionUnpinned`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`resources`)}),(0,q.jsx)(`dd`,{children:o(`pluginResourceSummary`,{extensions:_.extensions.length,skills:_.skills.length,prompts:_.prompts.length,themes:_.themes.length})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`baseDirectory`)}),(0,q.jsx)(`dd`,{title:_.baseDir,children:_.baseDir??o(`notReported`)})]})]}),[...new Set(_.diagnostics)].map(e=>(0,q.jsx)(`p`,{className:`settings-resource-notice`,role:`status`,children:e},e)),_.canManage===!1&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,children:o(`resourceTargetTruncated`)}),_.configured&&_.canManage!==!1&&(0,q.jsx)(`div`,{className:`settings-resource-actions settings-resource-primary-actions`,children:[_.enabled===!1?`enable`:`disable`,`update`,`remove`].map(e=>(0,q.jsx)(CW,{isPending:r,onConfigure:i,label:o(`pluginAction_${e}`),request:o(`setupPluginOperationRequest`,{action:e,source:JSON.stringify(_.source),path:JSON.stringify(_.baseDir??null),scope:_.scope})},e))}),(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`pluginLoadedResources`,{count:NW(_)})}),(0,q.jsxs)(`section`,{className:`settings-resource-groups`,children:[_.extensions.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`extensions`)}),(0,q.jsx)(`ul`,{children:_.extensions.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:e.name}),(0,q.jsx)(`code`,{children:e.path})]}),(0,q.jsx)(`span`,{children:o(`extensionSurfaceCount`,{tools:e.toolCount,commands:e.commandCount})})]},e.path))})]}),_.skills.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`skillsSettings`)}),(0,q.jsx)(`p`,{children:_.skills.join(` · `)})]}),_.prompts.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`prompts`)}),(0,q.jsx)(`p`,{children:_.prompts.join(` · `)})]}),_.themes.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`themes`)}),(0,q.jsx)(`p`,{children:_.themes.join(` · `)})]})]})]}):(0,q.jsxs)(`div`,{className:`settings-empty-detail`,children:[(0,q.jsx)(Sc,{"aria-hidden":`true`}),(0,q.jsx)(`h2`,{children:o(s.length?`noMatchingResources`:`pluginsEmptyTitle`)}),(0,q.jsx)(Br,{label:o(`addPlugin`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:()=>p(!0)})]}),!f&&(0,q.jsxs)(kW,{catalog:e,pending:r,onReload:a,kind:`plugins`,onConfigure:i,children:[v.length>1&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(CW,{isPending:r,isBlocked:x,onConfigure:i,label:o(`enableVisiblePlugins`,{count:v.length}),request:o(`setupPluginsBulkRequest`,{packages:b,disabled:!1})}),(0,q.jsx)(CW,{isPending:r,isBlocked:x,onConfigure:i,label:o(`disableVisiblePlugins`,{count:v.length}),request:o(`setupPluginsBulkRequest`,{packages:b,disabled:!0})})]}),x&&(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`resourceBulkTooLarge`)})]})]})]})}function IW(e,t=``,n){let r=(0,K.useMemo)(()=>new de,[]),[i,a]=(0,K.useState)(0),o=JSON.stringify([e,t]),s=(0,K.useRef)(o);s.current=o;let c=(0,K.useRef)(0),[l,u]=(0,K.useState)(null),d=(0,K.useCallback)(()=>a(e=>e+1),[]);return(0,K.useEffect)(()=>{let t=new AbortController,n=++c.current;return u(e=>({owner:o,catalog:e?.owner===o?e.catalog:null,error:null})),r.settingsCatalog(e,t.signal).then(e=>{!t.signal.aborted&&c.current===n&&u({owner:o,catalog:e,error:null})},e=>{!t.signal.aborted&&c.current===n&&u(t=>({owner:o,catalog:t?.owner===o?t.catalog:null,error:e instanceof Error?e.message:String(e)}))}),()=>t.abort()},[r,i,e,o,n]),{catalog:l?.owner===o?l.catalog:null,error:l?.owner===o?l.error:null,refresh:d,updateSetup:e=>{s.current===o&&(c.current++,u(t=>t?.owner===o&&t.catalog?{...t,catalog:{...t.catalog,setup:e}}:t))}}}var LW=[`default`,`mist`,`rose`,`pine`],RW=[`codex`,`sans`,`serif`,`mono`],zW=[`system`,`light`,`dark`],BW={palette:`default`,accent:``,background:``,foreground:``,font:`codex`};function VW(e){return e===`pine`?`dark`:e===`mist`||e===`rose`?`light`:e}function HW(e,t){return e===`mist`||e===`rose`||e===`pine`?e:t.palette}function UW(e,t){switch(e){case`mist`:return t?{background:`#182126`,foreground:`#EDF3F5`,sidebar:`#1D292F`,accent:`#7BB5CA`}:{background:`#F8FBFC`,foreground:`#253239`,sidebar:`#EEF3F5`,accent:`#347991`};case`rose`:return t?{background:`#211A1C`,foreground:`#F4ECEC`,sidebar:`#2A2123`,accent:`#E09AA5`}:{background:`#FFF9F7`,foreground:`#342729`,sidebar:`#F6EDEA`,accent:`#B45562`};case`pine`:return t?{background:`#101A17`,foreground:`#EAF2EC`,sidebar:`#16241F`,accent:`#86C89E`}:{background:`#F4F8F5`,foreground:`#20352A`,sidebar:`#E9F1EB`,accent:`#32704A`};default:return t?{background:`#17191C`,foreground:`#EDF0F2`,sidebar:`#1D2024`,accent:`#74A9E6`}:{background:`#FFFFFF`,foreground:`#1A1C1F`,sidebar:`#F6F7F9`,accent:`#2563EB`}}}function WW(e){if(e.length>2e3)return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;if(Object.keys(n).sort().join(`,`)!==`appearance,theme,version`||n.version!==1)return null;let r=zW.find(e=>e===n.theme);if(!r||!n.appearance||typeof n.appearance!=`object`||Array.isArray(n.appearance))return null;let i=n.appearance;if(Object.keys(i).sort().join(`,`)!==`accent,background,font,foreground,palette`)return null;let a=LW.find(e=>e===i.palette),o=i.font===`system`?`codex`:RW.find(e=>e===i.font),{accent:s,background:c,foreground:l}=i;return!a||!o||typeof s!=`string`||typeof c!=`string`||typeof l!=`string`||![s,c,l].every(e=>e===``||/^#[0-9a-f]{6}$/iu.test(e))?null:{theme:r,appearance:{palette:a,font:o,accent:s,background:c,foreground:l}}}catch{return null}}var GW=[``,`#2563EB`,`#7C3AED`,`#DB2777`,`#D97706`,`#16A34A`];function KW({label:e,value:t,options:n,disabled:r,onSelect:i}){let a=n.find(e=>e.id===t);return(0,q.jsx)(yo,{className:`settings-select-menu`,button:{label:a?.label??t,"aria-label":e,variant:`secondary`,size:`sm`,className:`appearance-menu-trigger`,isDisabled:r,...a?.color?{icon:(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:a.color}})}:{}},menuWidth:200,alignment:`end`,items:n.map(e=>({id:e.id||`default`,label:e.label,isDisabled:r,...e.color?{icon:(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:e.color}})}:{},endContent:t===e.id?(0,q.jsx)(`span`,{className:`settings-select-check`,"aria-hidden":`true`,children:(0,q.jsx)(rs,{})}):void 0,onClick:()=>i(e.id)}))})}function qW({label:e,value:t,fallback:n,disabled:r,onSave:i}){let a=(t||n).toUpperCase(),o=(0,K.useRef)(a);o.current=a;let[s,c]=(0,K.useState)(a);(0,K.useEffect)(()=>c(a),[a]);let l=e=>{c(e),e!==a&&/^#[0-9a-f]{6}$/iu.test(e)&&i(e).then(e=>{e||c(o.current)})};return(0,q.jsxs)(`div`,{className:`appearance-color-input`,children:[(0,q.jsxs)(`label`,{className:`appearance-color-picker`,children:[(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:a}}),(0,q.jsx)(`input`,{"aria-label":`${e} — ${a}`,type:`color`,value:a,disabled:r,onChange:e=>l(e.target.value.toUpperCase())})]}),(0,q.jsx)(`input`,{className:`appearance-color-hex`,type:`text`,"aria-label":e,value:s,maxLength:7,spellCheck:!1,disabled:r,onChange:e=>l(e.target.value.toUpperCase()),onBlur:()=>c(a)})]})}function JW({catalog:e,theme:t,pending:n,error:r,onRefresh:i,onUpdatePreferences:a}){let{t:o}=W(),{mode:s}=sa(),c=e?.setup,l=c?.ui.webTheme??t,u=c?.ui.webAppearance??BW,d=HW(l,u),f=VW(l),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(``),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(null),[C,w]=(0,K.useState)(c?.ui.webChatWidth??820),[T,E]=(0,K.useState)(c?.ui.webChatFontSize??14),D=(0,K.useRef)({chatWidth:C,fontSize:T});c&&(D.current={chatWidth:c.ui.webChatWidth,fontSize:c.ui.webChatFontSize}),(0,K.useEffect)(()=>{c&&(w(c.ui.webChatWidth),E(c.ui.webChatFontSize))},[c]);let O=e?.setupWritable===!1||!!e?.resources.diagnostics.settingsErrors,k=n||!c||!!r||O,A=WW(_),j=e=>a({appearance:e}),M=()=>{n||(g(!1),v(``),b(!1))},N=f===`dark`||f===`system`&&s===`dark`,P=UW(d,N);return(0,q.jsxs)(`section`,{className:`settings-content-page settings-appearance-panel`,children:[(0,q.jsx)(`h1`,{children:o(`appearance`)}),(!c||r||O)&&(0,q.jsxs)(`div`,{className:`settings-load-state`,role:r||O?`alert`:`status`,children:[(0,q.jsx)(me,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o(O?`configurationReadFailure`:r?`settingsCatalogFailed`:`settingsCatalogLoading`)}),(r||O)&&(0,q.jsx)(`button`,{type:`button`,onClick:i,children:o(`retryAdmissionCheck`)})]}),(0,q.jsxs)(`section`,{className:`appearance-section`,"aria-labelledby":`appearance-visual-title`,children:[(0,q.jsx)(`h2`,{id:`appearance-visual-title`,children:o(`appearanceVisualStyle`)}),(0,q.jsxs)(`div`,{className:`appearance-card appearance-mode-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceMode`)}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":o(`appearanceMode`),className:`appearance-mode-options`,children:zW.map(e=>(0,q.jsx)(V,{content:o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`),children:(0,q.jsxs)(`label`,{className:`appearance-mode-option`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`openpi-appearance-mode`,"aria-label":o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`),checked:f===e,disabled:k,onChange:()=>void a({theme:e})}),(0,q.jsxs)(`span`,{"aria-hidden":`true`,className:`appearance-mode-preview`,"data-mode":e,"data-selected":f===e,children:[(0,q.jsxs)(`span`,{className:`appearance-mini-window`,children:[(0,q.jsx)(`span`,{className:`appearance-mini-sidebar`}),(0,q.jsxs)(`span`,{className:`appearance-mini-chat`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`em`,{})]})]}),e===`system`&&(0,q.jsxs)(`span`,{className:`appearance-mini-window appearance-mini-dark`,children:[(0,q.jsx)(`span`,{className:`appearance-mini-sidebar`}),(0,q.jsxs)(`span`,{className:`appearance-mini-chat`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`em`,{})]})]})]}),(0,q.jsx)(`span`,{className:`appearance-mode-label`,children:o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`)})]})},e))})]}),(0,q.jsxs)(`div`,{className:`appearance-card`,children:[(0,q.jsxs)(`div`,{className:`appearance-row appearance-theme-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceTheme`)}),(0,q.jsxs)(`div`,{className:`appearance-theme-actions`,children:[(0,q.jsx)(V,{content:o(`appearanceImport`),children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":o(`appearanceImport`),disabled:k,onClick:()=>{b(!1),g(!0)},children:(0,q.jsx)(Ts,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:o(`appearanceCopy`),children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":o(`appearanceCopy`),disabled:k,onClick:()=>{td(JSON.stringify({version:1,theme:f,appearance:{...u,palette:d}})).then(e=>S(e?`saved`:`failed`))},children:(0,q.jsx)(Ss,{"aria-hidden":`true`})})})]})]}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":o(`appearanceTheme`),"aria-busy":n,className:`appearance-palette-options`,children:LW.map(e=>{let t=UW(e,N),n=e==="default"?`OpenPI`:o(`theme${e[0].toUpperCase()}${e.slice(1)}`);return(0,q.jsxs)(`label`,{className:`appearance-palette-option`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`openpi-appearance-palette`,"aria-label":n,checked:d===e,disabled:k,onChange:()=>void j({palette:e})}),(0,q.jsxs)(`span`,{className:`appearance-palette-preview`,"aria-hidden":`true`,style:{background:t.background,color:t.foreground},children:[(0,q.jsxs)(`span`,{className:`appearance-palette-shell`,style:{background:t.sidebar},children:[(0,q.jsxs)(`span`,{className:`appearance-palette-sidebar`,children:[(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]}),(0,q.jsxs)(`span`,{className:`appearance-palette-canvas`,style:{background:t.background},children:[(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`em`,{style:{borderColor:t.accent},children:(0,q.jsx)(`span`,{className:`appearance-palette-send`,style:{background:t.accent}})})]})]}),(0,q.jsx)(`span`,{className:`appearance-palette-check`,children:(0,q.jsx)(rs,{})})]}),(0,q.jsx)(`span`,{className:`appearance-palette-label`,children:n})]},e)})}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceAccent`)}),(0,q.jsxs)(`div`,{className:`appearance-accent-controls`,children:[(0,q.jsx)(KW,{label:o(`appearanceAccent`),value:u.accent,options:GW.map((e,t)=>({id:e,label:o(`appearanceAccent${t}`),color:e||`var(--text)`})),disabled:k,onSelect:e=>void j({accent:e})}),(0,q.jsx)(qW,{label:o(`appearanceCustomAccent`),value:u.accent,fallback:`#2563EB`,disabled:k,onSave:e=>j({accent:e})})]})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceBackground`)}),(0,q.jsx)(qW,{label:o(`appearanceBackground`),value:u.background,fallback:P.background,disabled:k,onSave:e=>j({background:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceForeground`)}),(0,q.jsx)(qW,{label:o(`appearanceForeground`),value:u.foreground,fallback:P.foreground,disabled:k,onSave:e=>j({foreground:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceFont`)}),(0,q.jsx)(KW,{label:o(`appearanceFont`),value:u.font===`system`?`codex`:u.font,options:RW.map(e=>({id:e,label:o(`appearanceFont_${e}`)})),disabled:k,onSelect:e=>{let t=RW.find(t=>t===e);t&&j({font:t})}})]})]}),x&&(0,q.jsx)(`p`,{role:x===`failed`?`alert`:`status`,className:`appearance-share-status`,children:o(x===`saved`?`appearanceCopied`:`appearanceCopyFailed`)})]}),(0,q.jsxs)(`section`,{className:`appearance-section`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`appearance-advanced-toggle`,"aria-expanded":p,"aria-controls":`appearance-advanced`,onClick:()=>m(!p),children:[o(`appearanceAdvanced`),p?(0,q.jsx)(is,{"aria-hidden":`true`}):(0,q.jsx)(os,{"aria-hidden":`true`})]}),p&&c&&(0,q.jsxs)(`div`,{id:`appearance-advanced`,className:`appearance-card appearance-advanced-content`,children:[(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`expandThinkingByDefault`)}),(0,q.jsx)(bj,{label:o(`expandThinkingByDefault`),isLabelHidden:!0,value:c.ui.webExpandThinking,size:`sm`,isDisabled:k,onChange:e=>void a({expandThinking:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-slider-row`,children:[(0,q.jsxs)(`div`,{className:`settings-slider-heading`,children:[(0,q.jsx)(`span`,{children:o(`chatContentWidth`)}),(0,q.jsxs)(`output`,{children:[C,`px`]}),(0,q.jsx)(`button`,{type:`button`,className:`settings-reset-button`,"aria-label":o(`resetChatContentWidth`),disabled:k||C===820,onClick:()=>{w(820),a({chatWidth:820}).then(e=>{e||w(D.current.chatWidth)})},children:(0,q.jsx)(he,{"aria-hidden":`true`})})]}),(0,q.jsx)(yW,{label:o(`chatContentWidth`),isLabelHidden:!0,value:C,min:820,max:2e3,step:10,width:`100%`,valueDisplay:`none`,isDisabled:k,onChange:e=>w(e),onChangeEnd:e=>{e!==c.ui.webChatWidth&&a({chatWidth:e}).then(e=>{e||w(D.current.chatWidth)})}})]}),(0,q.jsxs)(`div`,{className:`appearance-slider-row`,children:[(0,q.jsxs)(`div`,{className:`settings-slider-heading`,children:[(0,q.jsx)(`span`,{children:o(`chatFontSize`)}),(0,q.jsxs)(`output`,{children:[T,`px`]}),(0,q.jsx)(`button`,{type:`button`,className:`settings-reset-button`,"aria-label":o(`resetChatFontSize`),disabled:k||T===14,onClick:()=>{E(14),a({chatFontSize:14}).then(e=>{e||E(D.current.fontSize)})},children:(0,q.jsx)(he,{"aria-hidden":`true`})})]}),(0,q.jsx)(yW,{label:o(`chatFontSize`),isLabelHidden:!0,value:T,min:12,max:24,step:1,width:`100%`,valueDisplay:`none`,isDisabled:k,onChange:e=>E(e),onChangeEnd:e=>{e!==c.ui.webChatFontSize&&a({chatFontSize:e}).then(e=>{e||E(D.current.fontSize)})}})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceReset`)}),(0,q.jsxs)(`button`,{type:`button`,className:`appearance-reset`,disabled:k,onClick:()=>void a({theme:`system`,appearance:BW,chatWidth:820,chatFontSize:14,expandThinking:!1}),children:[(0,q.jsx)(he,{"aria-hidden":`true`}),o(`appearanceResetAction`)]})]})]})]}),(0,q.jsxs)(Se,{isOpen:h,onOpenChange:e=>{e||M()},"aria-label":o(`appearanceImport`),width:480,className:`appearance-import-dialog`,children:[(0,q.jsx)(`h2`,{className:`appearance-import-title`,children:o(`appearanceImport`)}),(0,q.jsxs)(`form`,{className:`appearance-import-form`,onSubmit:e=>{e.preventDefault(),!(!A||k)&&(b(!1),a(A).then(e=>{e?(g(!1),v(``)):b(!0)}))},children:[(0,q.jsxs)(`label`,{children:[o(`appearanceThemeValue`),(0,q.jsx)(`textarea`,{maxLength:2e3,value:_,disabled:n,placeholder:o(`appearanceImportPlaceholder`),onChange:e=>{b(!1),v(e.target.value)}})]}),_&&!A&&(0,q.jsx)(`p`,{role:`alert`,children:o(`appearanceImportInvalid`)}),y&&(0,q.jsx)(`p`,{role:`alert`,children:o(`settingsPreferencesSaveFailed`)}),(0,q.jsxs)(`div`,{className:`appearance-import-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:n,onClick:M,children:o(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,disabled:k||!A,children:o(n?`savingSettings`:`appearanceImportAction`)})]})]})]})]})}function YW({workspaces:e,onRestore:t}){let{t:n,i18n:r}=W(),i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(``),[l,u]=(0,K.useState)(`updated`),[d,f]=(0,K.useState)(new Set),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(null),[y,b]=(0,K.useState)(null),[x,S]=(0,K.useState)(new Set),C=(0,K.useRef)(new Set),w=(0,K.useRef)(null),T=(0,K.useRef)(!1),E=JSON.stringify([a.trim(),s,l]),D=(0,K.useRef)({key:E});D.current.key!==E&&(D.current={key:E});let O=p?.scope===E?p:null,k=_?.scope===E?_:null,A=(0,K.useCallback)(async(e,t=0)=>{w.current?.abort();let n=new AbortController;w.current=n,g(!0),v(null);let r={query:a.trim(),sort:l,...s?{cwd:s}:{},limit:25};try{let a=await i.listArchivedSessions({...r,...e?{cursor:e}:{}},n.signal);if(n.signal.aborted||w.current!==n)return;let o=[...a.sessions];for(;!e&&o.length!o.some(t=>t.path===e.path));if(o.push(...e),!e.length)break}m(t=>({...a,scope:E,sessions:e&&t?.scope===E?[...t.sessions,...o.filter(e=>!t.sessions.some(t=>t.path===e.path))]:o}))}catch(t){!n.signal.aborted&&w.current===n&&v({scope:E,stale:t instanceof ge&&t.code===`ARCHIVED_SESSION_CURSOR_STALE`,...e?{cursor:e}:{}})}finally{w.current===n&&(w.current=null,g(!1))}},[i,s,a,E,l]);(0,K.useEffect)(()=>(T.current=!0,()=>{T.current=!1}),[]),(0,K.useEffect)(()=>(b(null),A(),()=>{w.current?.abort(),w.current=null}),[A]);let j=async e=>{if(C.current.has(e))return;C.current.add(e),S(new Set(C.current)),b(null);let n=D.current;try{let r=await t(e);if(!T.current||D.current!==n)return;if(!r){b(e);return}let i=O?.sessions.length??0;m(t=>t?{...t,sessions:t.sessions.filter(t=>t.path!==e)}:null),await A(void 0,i)}catch{T.current&&D.current===n&&b(e)}finally{C.current.delete(e),T.current&&S(new Set(C.current))}},M=new Map;for(let e of O?.sessions??[]){let t=e.workspacePath??e.cwd,n=M.get(t)??[];n.push(e),M.set(t,n)}let N=t=>e.find(e=>e.path===t)?.name??t.split(/[\\/]/u).filter(Boolean).at(-1)??t,P=[...new Set([...e.map(e=>e.path),...M.keys(),...s?[s]:[]])];return(0,q.jsxs)(`section`,{className:`settings-content-page settings-archive-panel`,children:[(0,q.jsx)(`h1`,{children:n(`settingsArchivedChats`)}),(0,q.jsxs)(`div`,{className:`settings-archive-toolbar`,children:[(0,q.jsxs)(`label`,{className:`settings-archive-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":n(`searchArchivedChats`),placeholder:n(`searchArchivedChats`),maxLength:160,value:a,onChange:e=>o(e.target.value)}),a&&(0,q.jsx)(`button`,{type:`button`,"aria-label":n(`settingsClearSearch`),onClick:()=>o(``),children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),(0,q.jsx)(Tj,{label:n(`archiveProjectFilter`),value:s,onChange:c,options:[{value:``,label:n(`archiveAllProjects`)},...P.map(e=>({value:e,label:N(e)}))]}),(0,q.jsx)(Tj,{label:n(`archiveSort`),value:l,onChange:e=>u(e===`created`?`created`:`updated`),options:[{value:`updated`,label:n(`archiveSortUpdated`)},{value:`created`,label:n(`archiveSortCreated`)}]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":n(`refreshArchives`),disabled:h,onClick:()=>void A(void 0,O?.sessions.length),children:(0,q.jsx)(me,{"aria-hidden":`true`})})]}),k&&(0,q.jsxs)(`div`,{className:`settings-archive-error`,role:`alert`,children:[(0,q.jsx)(`span`,{children:n(k.stale?`archiveCursorStale`:`archiveLoadFailed`)}),(0,q.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>void A(k.stale?void 0:k.cursor),children:n(`retryAdmissionCheck`)})]}),y&&(0,q.jsx)(`div`,{className:`settings-archive-error`,role:`alert`,children:n(`restoreFailed`)}),h&&(0,q.jsx)(`p`,{role:`status`,className:`settings-archive-status`,children:n(`loadingArchives`)}),!h&&!k&&O?.sessions.length===0&&(0,q.jsxs)(`div`,{className:`settings-archive-empty`,children:[(0,q.jsx)(Go,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:n(a.trim()||s?`noMatchingScannedArchives`:O.truncation.truncated?`noScannedArchives`:`noArchivedSessions`)})]}),(0,q.jsx)(`div`,{className:`settings-archive-groups`,children:[...M].map(([e,t])=>(0,q.jsxs)(`section`,{className:`settings-archive-group`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`settings-archive-group-heading`,"aria-label":n(`archiveProjectGroup`,{project:N(e),count:t.length}),"aria-expanded":!d.has(e),"aria-controls":`archive-group-${encodeURIComponent(e)}`,onClick:()=>f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),children:[d.has(e)?(0,q.jsx)(os,{"aria-hidden":`true`}):(0,q.jsx)(is,{"aria-hidden":`true`}),(0,q.jsx)(Vs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{title:e,children:N(e)}),(0,q.jsx)(`small`,{children:t.length})]}),!d.has(e)&&(0,q.jsx)(`ul`,{id:`archive-group-${encodeURIComponent(e)}`,className:`settings-archive-list`,children:t.map(e=>{let t=e.name||e.firstMessage||n(`untitledSession`),i=new Date(l===`created`?e.created:e.modified);return(0,q.jsxs)(`li`,{className:`settings-archive-row`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`settings-archive-chat-title`,title:t,children:t}),(0,q.jsx)(`time`,{dateTime:Number.isNaN(i.getTime())?void 0:i.toISOString(),children:Number.isNaN(i.getTime())?n(`unknownState`):new Intl.DateTimeFormat(r.language,{dateStyle:`medium`}).format(i)})]}),(0,q.jsxs)(`button`,{type:`button`,"aria-label":n(`restoreArchivedChat`,{title:t}),disabled:x.has(e.path),onClick:()=>void j(e.path),children:[(0,q.jsx)(Wo,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:n(x.has(e.path)?`restoringConversation`:`restoreConversation`)})]})]},e.path)})})]},e))}),!!O?.truncation.recordsUnscanned&&(0,q.jsx)(`p`,{className:`settings-archive-status`,children:n(`archiveScanBounded`,{count:O.truncation.recordsUnscanned})}),O?.nextCursor&&(0,q.jsx)(`button`,{type:`button`,className:`settings-archive-more`,disabled:h,onClick:()=>void A(O.nextCursor),children:n(`moreArchives`)})]})}var XW=[{id:`general`,group:`settingsPersonal`,label:`generalSettings`,Icon:Nc,terms:[`agentBehavior`,`resultDisplay`,`workflowLimits`,`runtimeIdentity`,`runtimeBackendVersion`,`runtimePackageRoot`,`runtimeStartedAt`,`runtimeGitRevision`,`runtimeGitState`,`runtimeFrontendVersion`,`runtimeFrontendBuild`,`runtimeStartupBuild`]},{id:`appearance`,group:`settingsPersonal`,label:`appearance`,Icon:zc,terms:[`appearanceTheme`,`appearanceAccent`,`appearanceFont`,`chatContentWidth`,`chatFontSize`]},{id:`archived-chats`,group:`settingsPersonal`,label:`settingsArchivedChats`,Icon:Go,terms:[`restoreConversation`]},{id:`configuration`,group:`settingsPersonal`,label:`configurationSettings`,Icon:Mc,terms:[`configurationApproval`,`configurationSandbox`,`configurationVerbosity`,`configurationSummary`,`configurationReasoningLevels`,`configurationDependencies`]},{id:`models`,group:`settingsAgent`,label:`modelSettings`,Icon:ws,terms:[`modelDefaultTitle`]},{id:`subagents`,group:`settingsAgent`,label:`subagentsSettings`,Icon:$o,terms:[]},{id:`web-search`,group:`settingsAgent`,label:`webSearchSettings`,Icon:Dc,terms:[]},{id:`skills`,group:`settingsIntegrations`,label:`skillsSettings`,Icon:Xs,terms:[]},{id:`plugins`,group:`settingsIntegrations`,label:`pluginsSettings`,Icon:Sc,terms:[]},{id:`browser`,group:`settingsIntegrations`,label:`browserSettings`,Icon:Es,terms:[]}];function ZW(e){return XW.find(({id:t})=>t===e)?.id}function QW({sessionId:e,sessionPath:t,cwd:n,entry:r=`general`,models:i,currentModel:a,thinkingLevel:o,theme:s,preferences:c,workspaces:l=[],onRestoreSession:u,capabilities:d,setupBusy:f,setupBlockedReason:p,plan:m,planSelectionPending:h=!1,onExitPlan:g,setupOutcome:_,onConfigureOpenPi:v,interaction:y,onPreferencesChanged:b,onSelectModel:x,onOpenRuntimeStatus:S,onClose:C}){let{t:w}=W(),T=f||!!p,E=(0,K.useRef)(null),D=(0,K.useRef)(null),[O,k]=(0,K.useState)(``),[A,j]=(0,K.useState)(r===`credentials`?`models`:r),[M,N]=(0,K.useState)(r===`credentials`||r===`models`),[P,F]=(0,K.useState)(!1),[I,ee]=(0,K.useState)(!1),[L,R]=(0,K.useState)(`general`),te=(0,K.useRef)(!1),z=(0,K.useRef)(!1),B=(0,K.useRef)(0),[ne,re]=(0,K.useState)(!1),V=(0,K.useRef)(!1),[ie,ae]=(0,K.useState)(!1),[oe,se]=(0,K.useState)(null),[ce,le]=(0,K.useState)(!1),[H,ue]=(0,K.useState)(!1),[fe,pe]=(0,K.useState)(null),me=H,he=(0,K.useRef)(void 0),ge=m!==void 0&&m!==`inactive`,_e=P||T||ge||h,ve=I&&L!==A||!I&&(A===`skills`||A===`plugins`||A===`web-search`)?void 0:!I||_?.requestId!==he.current?_:void 0,{catalog:ye,error:be,refresh:xe,updateSetup:Ce}=IW(e,a?`${a.provider}/${a.id}`:``,JSON.stringify(c)),we=ve!==void 0&&[`failed`,`cancelled`,`unconfirmed`].includes(ve.status);(0,K.useEffect)(()=>{E.current?.focus()},[]),(0,K.useEffect)(()=>{if(I){if(ve&&ve.status!==`pending`&&te.current){te.current=!1,z.current=!1,window.clearTimeout(B.current),xe(),b();return}if(T){z.current=!0;return}!z.current||!te.current||(te.current=!1,z.current=!1,window.clearTimeout(B.current),xe(),b())}},[b,xe,T,I,ve]),(0,K.useEffect)(()=>()=>window.clearTimeout(B.current),[]);let Te=async e=>{if(ae(!1),_e)return!1;he.current=_?.requestId,R(A),F(!0),ee(!1),te.current=!1,z.current=!1,window.clearTimeout(B.current),se(null);try{let t=await v(e);return t?(ee(!0),te.current=!0,B.current=window.setTimeout(()=>{!te.current||z.current||(te.current=!1,z.current=!1,xe(),b())},2e3)):se(w(`setupRequestFailed`)),t}catch(e){return F(!1),se(e instanceof Error?e.message:w(`setupRequestFailed`)),!1}finally{F(!1)}},Ee=async()=>{if(_e||!ye?.sessionPath)throw Error(w(`resourceReloadFailed`));F(!0);try{await new de().reloadSettingsResources(e,ye.sessionPath),xe(),b()}finally{F(!1)}},U=async e=>{if(V.current||!ye)return!1;V.current=!0,re(!0),ae(!1),se(null);try{let t=await new de().savePreferences(e);return Ce(t.setup),ae(!0),b(),!0}catch{return se(w(`settingsPreferencesSaveFailed`)),!1}finally{V.current=!1,re(!1)}},De=e=>{me||(j(e),k(``),e===`models`&&N(!0),se(null))};(0,K.useEffect)(()=>{let e=new URL(window.location.href);e.searchParams.set(`settings`,A),window.history.replaceState(window.history.state,``,e)},[A]);let Oe=XW.filter(({label:e,terms:t})=>[e,...t].some(e=>w(e).normalize(`NFKC`).toLocaleLowerCase().includes(O.trim().normalize(`NFKC`).toLocaleLowerCase()))),ke=(e,t=!1)=>{if(!me){if(ce&&!t){pe(e);return}pe(null),e.kind===`runtime`?S():C()}};return(0,q.jsxs)(Se,{isOpen:!0,purpose:`info`,padding:0,width:`calc(100vw - 32px)`,maxHeight:`calc(100dvh - 16px)`,className:`provider-settings-dialog`,"aria-label":w(`settings`),onOpenChange:e=>{!e&&!fe&&ke({kind:`close`})},children:[(0,q.jsxs)(`section`,{className:`provider-settings-surface`,children:[(0,q.jsxs)(`aside`,{className:`provider-settings-sidebar`,children:[(0,q.jsxs)(`header`,{className:`provider-settings-header`,children:[(0,q.jsx)(`strong`,{className:`provider-settings-title`,children:w(`settings`)}),(0,q.jsx)(`select`,{className:`provider-settings-mobile-picker`,"aria-label":w(`settingsNavigation`),disabled:me,value:A,onChange:e=>{let t=XW.find(({id:t})=>t===e.target.value);t&&De(t.id)},children:XW.map(({id:e,label:t})=>(0,q.jsx)(`option`,{value:e,children:w(t)},e))})]}),(0,q.jsxs)(`label`,{className:`provider-settings-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":w(`settingsSearch`),placeholder:w(`settingsSearch`),value:O,onChange:e=>k(e.target.value),disabled:me}),O&&(0,q.jsx)(`button`,{type:`button`,"aria-label":w(`settingsClearSearch`),onClick:()=>k(``),children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),(0,q.jsxs)(`div`,{className:`provider-settings-navigation`,ref:D,"aria-label":w(`settingsNavigation`),role:`tablist`,"aria-orientation":`vertical`,children:[[`settingsPersonal`,`settingsAgent`,`settingsIntegrations`].map(e=>(0,q.jsxs)(`div`,{className:`provider-settings-nav-group`,children:[Oe.some(t=>t.group===e)&&(0,q.jsx)(`p`,{children:w(e)}),Oe.filter(t=>t.group===e).map(({id:e,label:t,Icon:n})=>(0,q.jsxs)(`button`,{type:`button`,role:`tab`,disabled:me,id:`settings-tab-${e}`,tabIndex:A===e||!Oe.some(e=>e.id===A)&&Oe[0]?.id===e?0:-1,"aria-selected":A===e,"aria-controls":`settings-panel-${e}`,className:`provider-settings-tab`,title:w(t),onClick:()=>De(e),onKeyDown:t=>{if(t.altKey||t.ctrlKey||t.metaKey||t.nativeEvent.isComposing)return;let n=Oe.findIndex(t=>t.id===e),r=t.key===`Home`?0:t.key===`End`?Oe.length-1:t.key===`ArrowDown`||t.key===`ArrowRight`?(n+1)%Oe.length:t.key===`ArrowUp`||t.key===`ArrowLeft`?(n+Oe.length-1)%Oe.length:void 0;if(r===void 0)return;t.preventDefault();let i=Oe[r].id;De(i),D.current?.querySelector(`#settings-tab-${i}`)?.focus()},children:[(0,q.jsx)(n,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:w(t)})]},e))]},e)),Oe.length===0&&(0,q.jsx)(`p`,{className:`provider-settings-no-results`,role:`status`,children:w(`settingsNoResults`)})]}),(0,q.jsx)(`button`,{ref:E,type:`button`,className:`icon-button provider-settings-close`,"aria-label":w(`close`),disabled:me,title:w(me?`savingSettings`:`close`),onClick:()=>ke({kind:`close`}),children:(0,q.jsx)(je,{})})]}),(0,q.jsxs)(`div`,{className:`provider-settings-body`,children:[ge&&A!==`browser`&&(0,q.jsxs)(`div`,{className:`settings-plan-notice`,role:`status`,children:[(0,q.jsx)(`span`,{children:w(T?`setupPlanBusy`:`setupPlanBlocked`)}),(0,q.jsx)(Br,{label:w(`planModeExit`),variant:`secondary`,size:`sm`,isDisabled:T||h||!g,onClick:()=>void g?.()})]}),(0,q.jsxs)(`div`,{className:`provider-settings-main`,children:[(0,q.jsx)(`div`,{id:`settings-panel-configuration`,"aria-labelledby":`settings-tab-configuration`,"aria-label":w(`configurationSettings`),role:`tabpanel`,hidden:A!==`configuration`,children:A===`configuration`&&(0,q.jsx)(Aj,{catalog:ye,error:be,pending:_e||I&&L===`configuration`&&(!ve||ve.status===`pending`),preferencePending:ne,onConfigure:Te,onUpdatePreferences:U,onRefresh:xe,onOpenRuntimeStatus:()=>ke({kind:`runtime`})})}),(0,q.jsx)(`div`,{id:`settings-panel-appearance`,"aria-labelledby":`settings-tab-appearance`,"aria-label":w(`appearance`),role:`tabpanel`,hidden:A!==`appearance`,children:(0,q.jsx)(JW,{catalog:ye,theme:s,pending:ne,error:be,onRefresh:xe,onUpdatePreferences:U})}),(0,q.jsx)(`div`,{id:`settings-panel-archived-chats`,"aria-labelledby":`settings-tab-archived-chats`,"aria-label":w(`settingsArchivedChats`),role:`tabpanel`,hidden:A!==`archived-chats`,children:A===`archived-chats`&&(0,q.jsx)(YW,{workspaces:l,onRestore:u??(async()=>!1)})}),(0,q.jsx)(`div`,{id:`settings-panel-web-search`,"aria-labelledby":`settings-tab-web-search`,"aria-label":w(`webSearchSettings`),role:`tabpanel`,hidden:A!==`web-search`,children:A===`web-search`&&(0,q.jsx)(jj,{catalog:ye,error:be,pending:_e,onConfigure:Te,onRefresh:xe})}),(0,q.jsx)(`div`,{id:`settings-panel-browser`,"aria-labelledby":`settings-tab-browser`,"aria-label":w(`browserSettings`),role:`tabpanel`,hidden:A!==`browser`,children:A===`browser`&&(0,q.jsx)(Oj,{onConfigure:Te,setupPending:_e})}),(0,q.jsx)(`div`,{id:`settings-panel-general`,"aria-labelledby":`settings-tab-general`,"aria-label":w(`generalSettings`),role:`tabpanel`,hidden:A!==`general`,children:(0,q.jsx)(TW,{catalog:ye,error:be,currentModel:a,thinkingLevel:o,cwd:n,setupPending:P||T,preferencePending:ne||!ye,setupBusy:T,setupBlockedReason:p,setupBlocked:ge||h,onConfigure:Te,onUpdatePreferences:U,onOpenRuntimeStatus:()=>ke({kind:`runtime`}),onRefresh:xe})}),(0,q.jsx)(`section`,{id:`settings-panel-models`,"aria-labelledby":`settings-tab-models`,"aria-label":w(`modelSettings`),className:`settings-models`,role:`tabpanel`,hidden:A!==`models`,children:M&&(0,q.jsx)(oW,{sessionId:e,sessionPath:t,models:i,currentModel:a,busy:T,focusCredentials:r===`credentials`,onSaved:async()=>(xe(),b()),onSelectModel:x,onDraftChange:le,onSavingChange:ue},e)}),(0,q.jsx)(`div`,{id:`settings-panel-skills`,"aria-labelledby":`settings-tab-skills`,"aria-label":w(`skillsSettings`),role:`tabpanel`,hidden:A!==`skills`,children:(0,q.jsx)(jW,{catalog:ye,error:be,onRefresh:xe,setupPending:_e,onConfigure:Te,onReload:Ee},e)}),(0,q.jsx)(`div`,{id:`settings-panel-subagents`,"aria-labelledby":`settings-tab-subagents`,"aria-label":w(`subagentsSettings`),role:`tabpanel`,hidden:A!==`subagents`,children:(0,q.jsx)(MW,{catalog:ye,error:be,currentModel:a,models:i,activity:d?.subagents,setupPending:P||T,setupBlocked:ge||h,onConfigure:Te,onRefresh:xe})}),(0,q.jsx)(`div`,{id:`settings-panel-plugins`,"aria-labelledby":`settings-tab-plugins`,"aria-label":w(`pluginsSettings`),role:`tabpanel`,hidden:A!==`plugins`,children:(0,q.jsx)(FW,{catalog:ye,error:be,onRefresh:xe,setupPending:_e,onConfigure:Te,onReload:Ee},e)})]}),y,oe&&(0,q.jsx)(`div`,{className:`settings-global-error`,role:`alert`,children:oe}),(ne||ie)&&!oe&&!we&&(0,q.jsx)(`div`,{className:`settings-global-status`,role:`status`,children:w(ne?`savingSettings`:`settingsPreferencesSaved`)}),!ne&&(!ie||we)&&(I&&L===A||ve)&&!oe&&(0,q.jsxs)(`div`,{className:ve?.status===`failed`?`settings-global-error`:`settings-global-status`,role:ve?.status===`failed`?`alert`:`status`,children:[w(ve?(A===`skills`||A===`plugins`||A===`web-search`)&&[`unconfirmed`,`saved`,`unchanged`].includes(ve.status)?`resourceRequestFinished`:`setupOutcome_${ve.status}`:T?`setupRequestRunning`:A===`skills`||A===`plugins`||A===`web-search`?`resourceRequestSubmitted`:`setupRequestAccepted`),ve?.error&&(0,q.jsx)(`p`,{children:ve.error})]})]})]}),fe&&(0,q.jsx)(uj,{isOpen:!0,onOpenChange:e=>{e||pe(null)},title:w(`unsavedSettingsTitle`),description:w(`unsavedSettingsDetail`),cancelLabel:w(`keepEditing`),actionLabel:w(`discardAndContinue`),onAction:()=>ke(fe,!0)})]})}function $W({identity:e}){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;let n=t%6;return(0,q.jsx)(`span`,{className:`subagent-avatar tone-${n}`,"aria-hidden":`true`,children:(0,q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,children:[(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,q.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`}),(0,q.jsx)(`path`,{d:`M3 12h18M5 6.5c4 3 10 3 14 0M5 17.5c4-3 10-3 14 0`})]},`sphere`),(0,q.jsx)(`g`,{children:(0,q.jsx)(`path`,{d:`M4 20V4a16 16 0 0 1 16 16H4ZM4 4l16 16M4 9l11 11M4 14l6 6M10 5l-6 15M16 10L4 20`})},`fan`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`path`,{d:`m12 2 3 6 7-1-4 5 4 5-7-1-3 6-3-6-7 1 4-5-4-5 7 1Z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`})]},`rosette`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,q.jsx)(`path`,{d:`M3 12h18M12 3a9 9 0 0 0 0 18M12 6a6 6 0 0 0 0 12M12 9a3 3 0 0 0 0 6M12 3v18`})]},`arcs`),(0,q.jsx)(`g`,{children:(0,q.jsx)(`path`,{d:`m12 2 9 5v10l-9 5-9-5V7Zm0 0v20M3 7l18 10M21 7 3 17M3 7l9 5 9-5M3 17l9-5 9 5`})},`prism`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`path`,{d:`M12 12V2c6 0 10 4 10 10H12Zm0 0v10C6 22 2 18 2 12h10ZM12 12H2C2 6 6 2 12 2v10Zm0 0h10c0 6-4 10-10 10V12Z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2`,fill:`currentColor`})]},`windmill`)][n]})})}function eG(e,t,n,r){let i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(0),p=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(!n)return;let r=new AbortController;return p.current=r,c(!0),u(!1),i.sessionSources(e,t,r.signal).then(n=>{!r.signal.aborted&&n.sessionId===e&&n.path===t&&o(n)}).catch(()=>{r.signal.aborted||u(!0)}).finally(()=>{r.signal.aborted||(c(!1),p.current=null)}),()=>{r.abort(),p.current?.abort(),p.current=null}},[i,e,t,n,r,d]),{page:a?.sessionId===e&&a.path===t?a:null,loading:s,error:l,loadMore:async()=>{if(p.current||!a||a.nextOffset===void 0)return;let n=new AbortController;p.current=n,c(!0),u(!1);try{let r=await i.sessionSources(e,t,n.signal,a.nextOffset,a.revision);!n.signal.aborted&&r.sessionId===e&&r.path===t&&r.revision===a.revision&&o({...r,sources:[...a.sources,...r.sources]})}catch{n.signal.aborted||u(!0)}finally{n.signal.aborted||(c(!1),p.current=null)}},refresh:()=>f(e=>e+1)}}function tG({sessionId:e,path:t,source:n,thumbnail:r=!1,active:i=!0}){let{t:a}=W(),o=(0,K.useRef)(null),[s,c]=(0,K.useState)(!1),l=JSON.stringify([e,t,n.entryId,n.partIndex]),[u,d]=(0,K.useState)(null);(0,K.useEffect)(()=>{if(!r||!o.current||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(([e])=>c(!!e?.isIntersecting));return e.observe(o.current),()=>e.disconnect()},[r]),(0,K.useEffect)(()=>{if(!i||r&&!s){d(null);return}let a=new AbortController,o;return d({identity:l}),new de().sourceImage(e,t,n.entryId,n.partIndex,a.signal).then(e=>{if(a.signal.aborted)return;if(![`image/png`,`image/jpeg`,`image/gif`,`image/webp`].includes(e.mimeType)||e.data.length>xe)throw Error(`Invalid image`);let t=atob(e.data);if(t.length>10485760||btoa(t)!==e.data)throw Error(`Invalid image`);let n=Uint8Array.from(t,e=>e.charCodeAt(0));o=URL.createObjectURL(new Blob([n],{type:e.mimeType})),d({identity:l,url:o})}).catch(()=>{a.signal.aborted||d({identity:l,failed:!0})}),()=>{a.abort(),o&&URL.revokeObjectURL(o)}},[e,t,n.entryId,n.partIndex,l,i,r,s]);let f=i&&(!r||s)&&u?.identity===l?u:null;return(0,q.jsx)(`span`,{ref:o,className:`session-source-image`,"data-thumbnail":r||void 0,children:f?.url&&!f.failed?(0,q.jsx)(`img`,{src:f.url,draggable:!1,alt:r?``:n.name||a(`attachedImage`),onError:()=>d({identity:l,failed:!0})}):r?(0,q.jsx)(qs,{"aria-hidden":`true`}):(0,q.jsx)(`p`,{role:f?.failed?`alert`:`status`,children:a(f?.failed?`imagePreviewFailed`:`readingFile`)})})}function nG({source:e,sessionId:t,path:n,onOpen:r,thumbnail:i=!0,detailed:a=!1}){let{t:o}=W();return(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row session-source-row${a?` source-detail-row`:``}`,title:e.reference||e.name||o(`attachedImage`),onClick:r,children:[(0,q.jsx)(`span`,{className:`session-source-icon`,children:e.kind===`image`?i?(0,q.jsx)(tG,{sessionId:t,path:n,source:e,thumbnail:!0}):(0,q.jsx)(qs,{"aria-hidden":`true`}):(0,q.jsx)(Fs,{"aria-hidden":`true`})}),a?(0,q.jsxs)(`span`,{className:`session-source-copy`,children:[(0,q.jsx)(`strong`,{children:e.name||o(`attachedImage`)}),e.reference&&(0,q.jsx)(`span`,{className:`source-detail-reference`,children:e.reference}),(0,q.jsx)(`span`,{className:`source-detail-status`,children:o(`sourceAttached`)})]}):(0,q.jsx)(`span`,{children:e.name||o(`attachedImage`)})]})}function rG({sessionId:e,path:t,data:n,onSelect:r}){let{t:i}=W(),a=be(),o=(0,K.useRef)(null),s=(0,K.useRef)(a?.sources?.scroll??0);return(0,K.useLayoutEffect)(()=>{n.page?.sources.length&&o.current&&(o.current.scrollTop=s.current)},[n.page?.sources.length]),(0,q.jsxs)(`div`,{className:`session-sources-list`,ref:o,onScroll:e=>{s.current=e.currentTarget.scrollTop,a&&(a.sources={scroll:s.current})},children:[!n.loading&&!n.error&&!n.page?.sources.length&&(0,q.jsx)(`p`,{children:i(`sourcesEmpty`)}),n.page?.sources.map(n=>(0,q.jsx)(nG,{source:n,sessionId:e,path:t,onOpen:()=>r(n),detailed:!0},n.id)),n.error&&(0,q.jsxs)(`p`,{role:`alert`,children:[i(`sourcesFailed`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:n.refresh,children:i(`gitReviewRetry`)})]}),n.loading&&(0,q.jsx)(`p`,{role:`status`,children:i(`readingFile`)}),n.page?.nextOffset!==void 0&&(0,q.jsx)(`button`,{className:`sources-load-more`,type:`button`,disabled:n.loading,onClick:()=>void n.loadMore(),children:i(`sourcesLoadMore`)}),n.page?.truncated&&(0,q.jsx)(`p`,{children:i(`sourcesPartial`)})]})}function iG({sessionId:e,path:t,revision:n}){let{t:r}=W(),i=eG(e,t,!0,n),a=(0,K.useRef)(null);(0,K.useEffect)(()=>{let e=requestAnimationFrame(()=>a.current?.focus({preventScroll:!0}));return()=>cancelAnimationFrame(e)},[]);let o=(0,K.useContext)($E),[s,c]=(0,K.useState)(null),l=e=>{e?.kind===`file`&&e.reference?o?.open(e.reference,void 0,document.activeElement instanceof HTMLElement?document.activeElement:void 0):c(e)};return(0,q.jsxs)(`section`,{className:`session-sources-panel`,ref:a,tabIndex:-1,"aria-label":r(`sessionSources`),children:[(0,q.jsx)(rG,{sessionId:e,path:t,data:i,onSelect:l}),(0,q.jsx)(aG,{sessionId:e,path:t,open:!!s,source:s,data:i,onSelect:l,onClose:()=>c(null)})]})}function aG({sessionId:e,path:t,open:n,source:r,data:i,onSelect:a,onClose:o}){let{t:s}=W(),[c,l]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{r?.id,l(!1)},[e,t,r?.id]),(0,q.jsx)(Se,{isOpen:n,onOpenChange:e=>!e&&o(),purpose:`info`,width:800,maxHeight:`calc(100dvh - 32px)`,padding:0,"aria-label":s(`sessionSources`),children:n&&(0,q.jsxs)(`div`,{className:`session-sources-dialog draft-image-preview`,children:[(0,q.jsxs)(`header`,{children:[r&&i&&(0,q.jsx)(`button`,{type:`button`,"aria-label":s(`sourcesBack`),onClick:()=>a(null),children:(0,q.jsx)(Ko,{})}),(0,q.jsx)(`strong`,{title:r?.name,children:r?r.name||s(`attachedImage`):s(`sessionSources`)}),r&&(0,q.jsx)(`button`,{type:`button`,"aria-pressed":c,onClick:()=>l(e=>!e),children:s(c?`fitImage`:`originalImageSize`)}),(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,"aria-label":s(`close`),onClick:o,children:(0,q.jsx)(je,{})})]}),r?(0,q.jsx)(lO,{original:c,children:(0,q.jsx)(tG,{sessionId:e,path:t,source:r,active:n},JSON.stringify([e,t,r.id]))},JSON.stringify([e,t,r.id])):i?(0,q.jsx)(rG,{sessionId:e,path:t,data:i,onSelect:a}):null]})})}function oG({sessionId:e,workspace:t,agents:n,omitted:r,omittedWorkflows:i=0,review:a,onSubagents:o,onReview:s,onSources:c,sessionPath:l,revision:u,onAddSources:d,reviewLoading:f=!1,reviewError:p}){let{t:m}=W(),[h,g]=(0,K.useState)(!1),_=(0,K.useRef)(null),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!0),S=(0,K.useId)(),[C,w]=(0,K.useState)(null),T=eG(e,l??``,!!(l&&(h||v)),u),E=(0,K.useContext)($E),D=a?.ok?a.snapshot.totals:void 0,O=e=>{!e&&c?(y(!1),w(null),P(c)):e?.kind===`file`&&e.reference?(y(!1),P(()=>E?.open(e.reference,void 0,_.current??void 0))):P(()=>{w(e),y(!0)})},k=n.filter(e=>e.state===`running`),A=n.filter(e=>e.state===`done`),j=n.length-k.length-A.length,M=[...k,...n.filter(e=>e.state!==`running`)].slice(0,4),N=[k.length?m(`subagentSummaryRunning`,{count:k.length}):``,A.length?m(`subagentSummaryDone`,{count:A.length}):``,j?m(`subagentSummaryOther`,{count:j}):``].filter(Boolean).join(` · `)||m(`subagentNoneYet`),P=e=>{g(!1),_.current?.focus(),e()};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Zu,{isOpen:h,onOpenChange:g,placement:`below`,alignment:`end`,width:`min(340px, calc(100vw - 24px))`,label:m(`sessionOverview`),closeButtonLabel:m(`close`),isModal:!1,content:(0,q.jsxs)(`div`,{className:`session-overview`,children:[(0,q.jsx)(`p`,{className:`session-overview-title`,children:t}),(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row`,title:m(`sessionOverviewChanges`),onClick:()=>P(s),children:[(0,q.jsx)(Ms,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:m(`overviewChanges`)}),D&&!p?(0,q.jsxs)(`span`,{className:`session-overview-diff`,title:m(D.complete?`overviewLineTotals`:`overviewPartialTotals`),children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,D.additions.toLocaleString()]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,D.deletions.toLocaleString()]}),!D.complete&&(0,q.jsx)(`span`,{className:`session-overview-note`,children:m(`gitReviewPartialLabel`)})]}):(0,q.jsx)(`span`,{className:`session-overview-note`,children:m(f?`overviewCounting`:a?.ok?`overviewCountsUnknown`:`overviewReviewUnavailable`)})]}),(0,q.jsxs)(`div`,{className:`session-overview-section`,children:[(0,q.jsx)(`p`,{children:m(`subagentDetails`)}),(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row session-overview-agents`,onClick:()=>P(o),"aria-label":`${m(`subagentDetails`)}: ${N}`,children:[M.length>0&&(0,q.jsx)(`span`,{className:`subagent-avatar-stack`,children:M.map(t=>(0,q.jsx)($W,{identity:`${e}:${t.id}`},t.id))}),(0,q.jsx)(`span`,{className:`session-overview-agent-counts`,children:N.split(` · `).map(e=>(0,q.jsx)(`span`,{children:e},e))}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),r>0&&(0,q.jsx)(`small`,{children:m(`subagentListTruncated`,{count:r})}),i>0&&(0,q.jsx)(`small`,{children:m(`subagentWorkflowsTruncated`,{count:i})})]}),l&&(0,q.jsxs)(`div`,{className:`session-overview-section`,children:[(0,q.jsxs)(`div`,{className:`session-overview-section-heading`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`session-sources-toggle`,"aria-expanded":b,"aria-controls":S,onClick:()=>x(e=>!e),children:[(0,q.jsx)(`span`,{children:m(`sessionSources`)}),T.page&&(T.page.total!==void 0||T.page.nextOffset===void 0)&&(0,q.jsxs)(`span`,{children:[`· `,T.page.total??T.page.sources.length,T.page.truncated?`+`:``]}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),d&&(0,q.jsx)(V,{content:m(`sourcesAdd`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":m(`sourcesAdd`),onClick:()=>P(d),children:(0,q.jsx)(Ae,{})})})]}),(0,q.jsxs)(`div`,{id:S,hidden:!b,children:[T.page?.sources.slice(0,3).map(t=>(0,q.jsx)(nG,{source:t,sessionId:e,path:l,onOpen:()=>O(t)},t.id)),T.error?(0,q.jsxs)(`p`,{role:`alert`,children:[m(`sourcesFailed`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:T.refresh,children:m(`gitReviewRetry`)})]}):!T.page?.sources.length&&(0,q.jsx)(`p`,{children:m(T.loading?`readingFile`:`sourcesEmpty`)}),!!(T.page&&(T.page.sources.length>3||T.page.nextOffset!==void 0))&&(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row sources-view-all`,onClick:()=>O(null),children:[(0,q.jsx)(Qs,{}),(0,q.jsx)(`span`,{children:m(`sourcesViewAll`)}),(0,q.jsx)(os,{})]})]})]})]}),children:e=>(0,q.jsx)(V,{content:m(`sessionOverview`),placement:`below`,children:(0,q.jsx)(`button`,{...e,ref:t=>{e.ref(t),_.current=t},type:`button`,className:`task-tools-trigger`,"aria-label":m(`sessionOverview`),children:(0,q.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,q.jsx)(`circle`,{cx:`5.5`,cy:`7`,r:`2.8`}),(0,q.jsx)(`circle`,{cx:`5.5`,cy:`17`,r:`2.8`}),(0,q.jsx)(`path`,{d:`M12 7h8M12 17h8`})]})})})}),l&&(0,q.jsx)(aG,{sessionId:e,path:l,open:v,source:C,data:T,onSelect:O,onClose:()=>{y(!1),w(null)}})]})}function sG(e){return e<1e3?Math.round(e).toString():e<1e4?`${(e/1e3).toFixed(1)}k`:e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1)}M`}function cG(e){if(!e)return;let{input:t,output:n,cacheRead:r,cacheWrite:i}=e;if(t===0&&n===0&&r===0&&i===0)return;let a=t+r+i,o=r>0?` (${sG(r)} cached)`:``;return`${sG(a)} in${o} · ${sG(n)} out`}function lG(e,t,n){if([`session_start`,`session_switched`,`session_created`].includes(t))return e.length===0?e:[];if([`agent_settled`,`turn_settled`].includes(t))return e.some(e=>e.state===`running`)?e.map(e=>e.state===`running`?{...e,state:`unknown`}:e):e;if(!t.startsWith(`tool_execution_`))return e;let r=n.toolCallId;if(typeof r!=`string`||r.length>500)return e;let i=e.find(e=>e.call.id===r);if(i&&i.state!==`running`&&(i.state!==`unknown`||t!==`tool_execution_end`))return e;let a=dd(n.call),o=a.type===`toolCall`&&typeof a.name==`string`&&typeof a.arguments==`string`?a:i?.call;if(!o||o.evidenceTruncated&&o.id?.includes(`[truncated]`))return e;let s=dd(n.result),c=typeof s.content==`string`?s:i?.result,l=typeof n.parentToolCallId==`string`&&n.parentToolCallId.length<=500?n.parentToolCallId:i?.parentToolCallId,u={call:o,result:c,...l?{parentToolCallId:l}:{},state:t===`tool_execution_end`?n.isError===!0?`failed`:`returned`:`running`},d=(i?e.map(e=>e.call.id===r?u:e):[...e,u]).slice(-32);for(;d.length>0&&new TextEncoder().encode(JSON.stringify(d)).byteLength>524288;)d.shift();return d}var uG={en:{translation:{quitOpenPI:`Quit OpenPI`,quittingOpenPI:`Quitting…`,quitConfirmHelp:`Quit this OpenPI Web application? All running tasks in this Web application will stop. Conversations are saved and will be available when you restart.`,quitTabHelp:`Closing this browser tab alone leaves OpenPI and its tasks running in the background.`,quitAccepted:`OpenPI is shutting down`,quitAcceptedHelp:`The quit request was accepted. Wait for the terminal to confirm that OpenPI has stopped, then you can close this tab.`,quitRestartHelp:`To restart, run openpi web in a terminal, or /web in Pi, then open the address it displays. Refreshing this page does not restart OpenPI.`,quitFailed:`Could not confirm shutdown. Check the terminal before trying again. You can also stop OpenPI with Ctrl+C in its terminal.`,promptPending:`Processing your request…`,commandFeedbackTruncated:`This is a limited command preview. Narrow the query or run it in the TUI for the full output.`,planMode_inactive:`Normal mode`,planMode_planning:`Planning · writes blocked`,planMode_ready:`Plan ready · awaiting review`,planMode_invalid:`Plan state invalid · writes blocked`,planModeEnter:`Plan`,promptPlanMessage:`This conversation uses Plan mode · discuss the plan; no implementation yet`,planModeUnconfirmed:`Could not confirm Plan mode. Refresh before continuing.`,planModeExit:`Exit planning`,planModeImplement:`Prepare implementation prompt`,planImplementationReplaceDraft:`Preparing this plan will replace the current draft and turn off Plan mode. The prompt will not be sent. Continue?`,commandSupport_plan:`Planning and same-session implementation prompts are available. Starting a fresh implementation session still requires the TUI.`,commandSupport_setup:`Configuration uses the active model; questions are answered in Web.`,handoffWaiting:`Manual action`,handoffDone:`Done`,handoffUnable:`Unable to complete`,handoffDoneHelp:`I performed the action. The agent still needs to verify it.`,handoffUnableHelp:`I could not finish. I can add a note about the blocker.`,handoffReview:`Review status`,handoffSubmit:`Submit status`,handoffSignal:`Expected result:`,handoffVerify:`Reporting Done lets the agent continue and verify; it is not proof of success.`,planCardLabel:`Development plan`,planCardReady:`Plan ready`,planCardResult:`Plan result`,planCardNotApproval:`This step produced a plan. It did not approve or start implementation.`,planCardCollapse:`Collapse`,planCardExpand:`Expand`,planCardCopy:`Copy plan`,planCardCopyPreview:`Copy visible preview`,planCardTruncated:`Only a bounded preview is displayed.`,planCardLoadFull:`Load full plan`,planCardLoadingFull:`Loading plan...`,planCardLoadFailed:`Could not load the full plan. Retry`,planCardEvidence:`Tool result · plan_ready`,questionWaiting:`Question`,questionPreview:`View preview`,questionSkip:`Skip`,questionProgress:`{{current}} of {{total}}`,questionReview:`Review answers`,questionReviewTitle:`Ready to send?`,questionReviewHelp:`Review your choices. Nothing is sent until you submit.`,questionEdit:`Edit answer: {{question}}`,questionDismiss:`Dismiss questions without answering`,questionCustom:`Or write your own reply`,questionCustomHelp:`Or leave it blank to ask for a clearer question.`,questionYourAnswer:`Your answer`,questionCustomPlaceholder:`Describe what you have in mind…`,questionNotes:`Additional context (optional)`,questionNotesPlaceholder:`Add a constraint or clarify your choice…`,questionRephrase:`Ask for a clearer or smaller question`,questionBack:`Back`,questionNext:`Next question`,questionSubmit:`Submit answers`,questionSubmitting:`Sending…`,questionRetry:`Check submission`,questionUncertain:`We could not confirm delivery. Your submitted answers are kept here. Check submission to recover the result without sending them twice.`,questionDisconnected:`Reconnecting… Your choices stay here; submitting is paused.`,questionLimit:`Keep each answer or note within {{count}} UTF-8 bytes.`,questionLoadFailed:`Could not check for questions awaiting your answer.`,questionDraftLimit:`Question drafts are full. Shorten or clear an existing answer before adding more text.`,questionRetryLoad:`Try again`,questionCloseReceipt:`Close question status`,questionState_dismissed:`Questions dismissed. No answers were submitted.`,questionState_cancelled:`Questions cancelled. No answers were submitted.`,questionState_expired:`Questions expired. No answers were submitted.`,questionState_stale:`This request is no longer active. Check the conversation for its result.`,conversationView:`Conversation view`,jumpToLatest:`Jump to latest`,historyLoading:`Loading history…`,historyOmitted:`{{count}} earlier entries · Scroll up to load automatically`,historyChanged:`The Session branch changed. History has been reset to the current branch.`,historyUnavailable:`Could not load history. Please retry.`,historyValidationUnavailable:`Could not verify the conversation history. Please retry.`,historyVerifying:`Checking conversation history…`,messageLoadFull:`Load full message`,messageLoadMore:`Load more`,messageLoadingFull:`Loading message…`,messageLoadFailed:`Could not load this message. Retry`,filePreview:`File preview`,changeEvidence:`Changes`,changeEvidenceScope:`Read-only Git snapshot of changes since this session started.`,turnLabel:`Turn {{number}}`,turnState_running:`Running`,turnState_complete:`Completed`,turnState_failed:`Failed`,turnState_interrupted:`Interrupted`,turnState_waiting:`Waiting for response`,turnState_forked:`Forked · Ready to continue`,turnChanges_one:`{{count}} file changed during this turn`,turnChanges_other:`{{count}} files changed during this turn`,turnChangesPartial:`At least {{count}} files changed during this turn`,turnChangesIncomplete:`This turn's change record is incomplete.`,turnChangesMore:`Show {{count}} more files`,turnChangesLess:`Show fewer files`,turnChangesReview:`Review turn changes`,turnChangesReviewButton:`Review`,turnChangesBack:`Back to turn changes`,turnChangesLoading:`Loading this turn's changes…`,turnChangesUnavailable:`This turn's saved diff is unavailable.`,messageCopyRequiresFull:`Load the full message before copying.`,filesChanged_one:`{{count}} file changed`,filesChanged_other:`{{count}} files changed`,reviewChanges:`Review changes`,workspaceChanges:`Workspace changes`,overviewChanges:`Changes`,overviewLineTotals:`Text lines added and removed across the current Git comparison`,overviewPartialTotals:`Known line counts only; some files could not be counted. Open Changes for details.`,overviewCounting:`Counting…`,overviewCountsUnknown:`Counts unavailable`,overviewReviewUnavailable:`Unavailable`,sessionSources:`Sources`,sourcesAdd:`Add source`,sourcesDescription:`Browse this conversation's attached images and files`,sourceAttached:`Attached to this conversation`,sourcesEmpty:`No sources yet`,sourcesFailed:`Could not load sources.`,sourcesViewAll:`View all`,sourcesLoadMore:`Load more sources`,sourcesBack:`Back to sources`,sourcesPartial:`This list has reached its display limit. Earlier sources remain in the conversation.`,turnChangesScope:`Saved workspace changes during this turn`,turnEdits_one:`Edited {{count}} file`,turnEdits_other:`Edited {{count}} files`,turnEditsPartial:`Recorded edits to {{count}} files`,turnEditsScope:`This turn's recorded file-tool writes · saved; shell and external edits are not included`,turnEditStatsUnknown:`Line counts unavailable`,turnEditReason_before_unavailable:`The write completed, but previous contents were not authorized for reading. A before/after diff is unavailable.`,turnEditReason_content_limit:`The write completed. Content exceeds the saved comparison limit, so exact line counts are unavailable.`,turnEditReason_concurrent_change:`The file changed between recorded operations. A reliable net diff for this turn is unavailable.`,gitReviewLoadedCount:`{{count}} files loaded`,gitReviewPartialLabel:`Partial`,gitReviewSearch:`Search file paths`,gitReviewExpand:`Expand review`,gitReviewSearchLoaded:`Search loaded files`,gitReviewMarkViewed:`Mark {{path}} as viewed`,gitReviewMarkCurrentViewed:`Mark current file {{path}} as viewed`,gitReviewViewedLabel:`Viewed`,gitReviewViewedProgress:`Viewed {{viewed}} / {{loaded}} loaded files`,gitReviewViewedLimit:`Up to {{count}} viewed marks are remembered for this comparison.`,gitReviewNoMatch:`No matching files.`,gitReviewNoLoadedMatch:`No matches in the loaded files.`,gitReviewLoadNext:`Load the next files`,gitReviewChanged:`The workspace changed. Refresh the list before loading more.`,gitReviewNewVersion:`New changes are available. You are reading the previous version.`,gitReviewShowLatest:`Show latest diff`,gitReviewBinary:`No text diff is available for this binary file.`,gitReviewBinaryShort:`Binary`,gitReviewPendingStats:`Not loaded`,gitReviewComparison:`{{current}} compared with {{base}}`,gitReviewWorkingTree:`Working tree compared with HEAD`,gitReviewSessionSnapshot:`Changes since this session started`,gitReviewDetached:`Detached HEAD`,gitReviewLoading:`Reading Git changes…`,gitReviewRetry:`Retry`,gitReviewRefresh:`Refresh changes`,gitReviewOlderResult:`Showing the previous result.`,gitReviewNotRepository:`This workspace is not a Git repository.`,gitReviewUnborn:`This repository has no readable HEAD yet.`,gitReviewFailed:`Git changes could not be read.`,gitReviewTruncated:`The change snapshot reached its file or diff size limit.`,gitReviewEmpty:`No changes in this comparison.`,gitReviewHiddenLines:`{{count}} more diff lines hidden.`,gitReviewDiffTruncated:`This file's diff was not loaded because the snapshot reached its size limit.`,gitReviewShowMore:`Show {{count}} more files`,gitReviewBackToFiles:`Back to changed files`,gitReviewFilePreview:`Diff for {{file}}`,gitReviewNoDiff:`No text diff is available for this file.`,changeDiff:`Change diff`,diffViewMode:`Diff view`,diffUnified:`Unified`,diffSplit:`Side by side`,diffBefore:`Before`,diffAfter:`After`,diffView:`Diff`,gitFileStatus_added:`Added`,gitFileStatus_modified:`Modified`,gitFileStatus_deleted:`Deleted`,gitFileStatus_renamed:`Renamed`,gitFileStatus_copied:`Copied`,gitFileStatus_untracked:`Untracked`,gitFileStatus_unknown:`Changed`,closePreview:`Close preview`,imageZoom:`Image zoom`,imageZoomHelp:`Zoom is relative to Fit. Use Ctrl + wheel to zoom, then drag to pan.`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,previousImage:`Previous image`,nextImage:`Next image`,imagePosition:`Image {{current}} of {{total}}`,artifactReadOnly:`Read-only`,artifactReferenceUnavailable:`File preview is unavailable in this view: {{path}}`,artifactSession:`Session {{sessionId}}`,copyFilePath:`Copy file path`,filePathCopied:`File path copied`,refreshFile:`Refresh file`,downloadFile:`Download file`,downloadingFile:`Downloading…`,artifactOlderPreview:`Showing an older preview. `,readingFile:`Reading file…`,artifactVersion:`Version`,artifactBytes:`{{count}} bytes`,artifactPreviewTruncated:`Preview truncated. Download the file for the complete content.`,artifactUnsupported:`This file type cannot be previewed. Use Download.`,filesLargeMarkdownSource:`This Markdown preview is large, so it is shown as source to keep scrolling responsive. All loaded text is included.`,chatView:`Chat`,trajectory:`Trajectory`,trajectoryScope:`Recorded Session messages in order, not execution durations or the complete model request.`,trajectoryRunning:`Work is active. This view updates as saved records arrive; in-flight text is available in Chat.`,trajectoryTruncated:`Loaded history is partial: {{entries}} entries omitted, {{parts}} parts omitted, {{messages}} messages truncated.`,trajectoryEmpty:`No saved records yet.`,trajectoryOrder:`Record order`,trajectoryOverview:`Overview`,trajectorySequenceHint:`Record order · widths are not elapsed time`,trajectoryClearRange:`Clear selection`,trajectoryContextLane:`Context`,trajectoryModelLane:`Model`,trajectoryToolLane:`Tools`,trajectorySelectRecord:`Select record {{number}}: {{name}}`,trajectoryTimingTab:`Timing`,trajectoryUsageTab:`Usage`,trajectoryDurationLabel:`Duration`,trajectoryTimingSource:`Source`,trajectoryTimingUnknown:`No execution duration was recorded. Record timestamps are not operation start times.`,trajectoryTimingNative:`Pi nested tool execution`,trajectoryTTFT:`Time to first output`,trajectoryGenerationTime:`Generation time`,trajectoryThroughput:`Output tokens / second`,trajectoryNotRecorded:`Not recorded`,trajectoryUsageUnknown:`This response has no reported token usage in the loaded records.`,trajectoryUsage_input:`Uncached input`,trajectoryUsage_cacheRead:`Cache read`,trajectoryUsage_cacheWrite:`Cache write`,trajectoryUsage_output:`Output`,trajectoryProvider:`Provider`,trajectoryModel:`Model`,trajectoryCode:`Code`,trajectoryWrap:`Wrap lines`,trajectoryCopy:`Copy source`,trajectoryCopied:`Copied`,trajectoryRawArguments:`Original JSON`,trajectoryFoldTurns:`Turns`,trajectoryFoldCalls:`Calls`,trajectoryMetrics:`Loaded execution summary`,trajectoryRequestCount:`{{count}} model responses`,trajectoryToolCount:`{{count}} tool calls`,trajectoryModelResponses:`Model responses`,trajectoryToolCalls:`Tool calls`,trajectoryLastTurn:`Latest recorded turn`,trajectoryEventColumn:`Event`,trajectoryContentColumn:`Content`,trajectoryTurn:`Turn {{number}}`,trajectoryLoadHistory:`Load earlier history`,trajectoryLatestRecords:`Jump to latest records`,trajectoryHistoryLoading:`Loading history…`,trajectoryNestedOutputMissing:`Pi recorded this nested call's status, but did not persist its result body. The outer script's output is separate.`,trajectoryRecordCount:`{{count}} records`,trajectoryMatches:`{{count}} matches`,trajectorySearch:`Search loaded records`,trajectoryNoMatches:`No matching records.`,trajectoryEarlierGroup:`Earlier context`,trajectoryEventCount:`{{count}} Session changes`,trajectorySummary:`Overview`,trajectoryInputTab:`Input`,trajectoryResultTab:`Result`,trajectoryConversationGroup:`Conversation`,trajectoryReasoningTitle:`Thinking`,trajectoryRecordNumber:`Record {{number}}`,trajectoryRecordInfo:`Record information`,trajectoryRecordId:`Record ID`,trajectoryCallId:`Tool call ID`,trajectoryEventType:`Event type`,trajectoryEvent_model_change:`Model changed`,trajectoryEvent_thinking_level_change:`Thinking level changed`,trajectoryEvent_compaction:`Context compacted`,trajectoryEvent_session_info:`Session information updated`,trajectoryEvent_custom:`Session record`,trajectoryEarlier:`Show earlier records ({{count}} remaining in loaded history)`,trajectoryDetails:`Record details`,trajectoryRecordedAt:`Record timestamp`,trajectoryEvidenceTruncated:`This evidence was truncated in the Session projection.`,trajectoryArguments:`Tool arguments`,trajectoryRecordedContent:`Recorded content`,trajectoryThinking:`Recorded model reasoning`,trajectoryOutput:`Tool result`,trajectoryMissingResult:`No unambiguous result is included in the loaded records. This does not imply the tool is still running.`,trajectoryStructured:`Structured result`,trajectoryEventOnly:`Only this event’s type and timestamp are available.`,trajectory_user:`User message`,trajectory_assistant:`Assistant`,trajectory_call:`Tool call`,trajectory_result:`Unpaired result`,trajectory_event:`Session event`,trajectoryRole_user:`User`,trajectoryRole_assistant:`Assistant`,trajectoryRole_call:`Tool`,trajectoryRole_result:`Result`,trajectoryRole_event:`Event`,trajectory_returned:`Tool returned a result.`,trajectory_error:`Tool returned an error`,trajectory_unknown:`Outcome not established`,runtimeStatus:`Runtime status`,runtimeIdentity:`OpenPI runtime information`,runtimeIdentityHint:`Backend information was captured at startup. It does not track later disk changes or Session reloads, and is not proof of every loaded module. Frontend identity describes this page build.`,runtimeIdentityFailed:`Could not read backend runtime information. Try again.`,runtimeBackendVersion:`Backend package version`,runtimePackageRoot:`Backend package directory`,runtimeStartedAt:`Process started`,runtimeGitRevision:`Git revision at startup`,runtimeGitState:`Working tree at startup`,runtimeGitDirty:`Local changes present`,runtimeGitClean:`Clean`,runtimeFrontendVersion:`Page package version`,runtimeFrontendBuild:`Page build ID`,runtimeStartupBuild:`Page build ID recorded at startup`,runtimeDevelopmentBuild:`Development server (no production build ID)`,runtimeBuildMismatch:`This page build differs from the build recorded when the backend started. Refresh the page or restart the service, then check again.`,refreshStatus:`Refresh status`,openTools:`Open tools`,openToolsUnavailable:`Select a chat to open tools`,sideConversation:`Side conversation`,sideConversationDescription:`Ask a focused question in a separate Pi session without interrupting the main task.`,workbarChangesDescription:`Inspect the current Git branch and working tree.`,terminal:`Terminal`,renameTerminal:`Rename terminal`,terminalName:`Terminal name`,workbarTerminalDescription:`Open an interactive shell for the current workspace.`,restartTerminal:`Restart terminal`,reconnectTerminal:`Reconnect terminal`,restartTerminalTitle:`Restart this terminal?`,restartTerminalDetail:`The current terminal will be closed. Running processes may be interrupted.`,terminalReconnecting:`Reconnecting terminal...`,terminalScrollToBottom:`Scroll to bottom`,terminalOutputResynced:`Terminal output resynchronized.`,terminalRestarting:`Restarting terminal...`,terminalConnecting:`Starting terminal…`,terminalExited:`Terminal exited.`,terminalExitCode:`Terminal exited with code {{code}}.`,terminalDisconnected:`Terminal connection ended unexpectedly.`,terminalError:`Terminal unavailable.`,terminalLoadError:`The terminal interface could not load. Refresh the page to try again.`,reloadPage:`Refresh page`,browser:`Browser`,sessionFileRecords:`Session file records`,gitReviewSource:`Changes`,gitReviewBaseBranch:`Compare against branch`,gitReviewChooseBase:`Choose comparison branch`,gitReviewSearchBranches:`Search branches`,gitReviewLocalBranch:`Local branch`,gitReviewRemoteBranch:`Remote branch`,gitReviewBranchesTruncated:`Showing a bounded list of branches. Some branches are omitted.`,gitReviewNoMatchingBranches:`No matching branches.`,gitReviewBaseUnavailable:`No default comparison branch is available. Choose a branch to review committed changes.`,gitReviewBaseInvalid:`The selected comparison branch is unavailable. Choose another branch.`,gitReviewUnstaged:`Unstaged changes`,gitReviewStaged:`Staged changes`,gitReviewBranch:`Branch changes`,gitReviewFileMissing:`This file no longer has changes in this view. Refresh the file list.`,artifactExternalAccess:`This file is in another working directory. You can authorize read-only access to this file for this session; other files remain inaccessible.`,artifactAuthorizeFile:`Open this file read-only`,sideConversationPending:`Preparing side conversation…`,resizeSidebar:`Resize sidebar`,resizePanes:`Resize panes`,resizeWorkbar:`Resize workbar`,browserPasteTooLarge:`Paste at most {{count}} characters at a time.`,browserInputTooLarge:`Enter at most {{count}} characters at a time.`,browserInputTargetChanged:`The input target changed or could not be confirmed. An input operation was not executed.`,workbarBrowserDescription:`Open and interact with a page inside the OpenPI workbar.`,browserReady:`Enter an address to start browsing`,browserStarting:`Starting the embedded browser…`,browserOpened:`Opened in the embedded browser`,browserOpenAgain:`Open again`,browserOpenFailed:`The embedded browser is unavailable.`,browserBack:`Back`,browserForward:`Forward`,browserReload:`Reload`,browserTabs:`Browser tabs`,browserNewTab:`New tab`,browserAddTab:`New browser tab`,browserCloseTab:`Close {{title}}`,browserTabLimit:`Up to {{count}} browser tabs`,browserPageTitle:`Web page: {{address}}`,browserEnteredAddress:`Last address opened from this toolbar`,browserAddressNotAllowed:`Enter an HTTP(S) address without embedded credentials, outside this application's origin.`,browserLocationUnknown:`This page navigated. Its new address is unavailable. Reload returns to the address you entered.`,browserDirectDescription:`Browse pages directly. Sites that refuse embedding can be opened in your external browser.`,browserDirectHint:`The address records toolbar navigation only. Page popups open in your external browser. Blank page? Use Open in external browser.`,browserEnhancedHint:`Browser enhancement is on: addresses sync and ordinary popup links open in these tabs. Some site policies, login popups and cross-site history still require an external browser.`,files:`Files`,filesExplorer:`Workspace files`,filesSearch:`Filter files…`,refreshFiles:`Refresh files`,filesWorkspaceActions:`Workspace file actions`,filesCreateMenu:`New`,filesImportMenu:`Import`,filesMoreMenu:`More`,filesNewFile:`New file`,filesNewDirectory:`New folder`,filesImport:`Import files`,filesImportFolder:`Import folder`,filesImportFolderChoose:`Choose a folder to import`,filesImportFolderLimit:`Import up to 2,000 files and folders at a time, with at most 64 nested levels.`,filesSelectMultiple:`Select multiple files`,filesSelectItem:`Select {{name}}`,filesSelectedCount:`{{count}} selected`,filesRename:`Rename`,filesNewName:`New name`,filesMove:`Move`,filesMoveDestination:`Destination folder (workspace relative path)`,filesTrashAction:`Move to trash`,filesTrash:`Workspace trash`,filesTrashDetail:`Removed files stay in this workspace and can be restored. Existing names are preserved.`,filesTrashEmpty:`No removed files`,filesTrashUnavailable:`{{count}} entries could not be verified. Their contents remain in .openpi-trash; automatic restore is unavailable.`,filesRestore:`Restore`,filesRestoreItem:`Restore {{name}}`,filesUndoTrash:`Undo removal`,filesOrganizationResults:`File operation results`,filesOperationDone:`Done`,filesRefreshBeforeOrganizing:`Refresh the file tree before organizing this item.`,filesImportChoose:`Choose files to import`,filesTargetDirectory:`Destination`,filesWorkspaceRoot:`Workspace root`,filesFileName:`File name`,filesDirectoryName:`Folder name`,filesCreate:`Create`,filesCreating:`Creating…`,filesCreated:`Created: {{path}}`,filesNameInvalid:`Enter one file or folder name without path separators.`,filesNameExists:`This name already exists. Choose a different name; the existing file was preserved.`,filesMutationFailed:`Could not write this file. Your input is preserved.`,filesWriteUnavailable:`Switch to this session to write workspace files.`,filesImportLimit:`Each file can be up to 50 MiB. Existing names are never overwritten.`,filesImportTooLarge:`This file exceeds the 50 MiB import limit.`,filesImportDirectoryUnsupported:`Folders cannot be imported. Choose the files inside the folder.`,filesImportResults:`File import results`,filesImportPending:`Waiting to import`,filesImporting:`Importing…`,filesImported:`Saved to the workspace`,filesImportedNoPreview:`Saved. Preview supports up to 20 MiB; copy the path to use this file in chat.`,filesClearImported:`Clear completed imports`,filesRetryImport:`Retry import`,filesPathActions:`Path actions for {{name}}`,filesCopyRelativePath:`Copy relative path`,filesCopyAbsolutePath:`Copy absolute path`,filesPathCopied:`Copied path: {{path}}`,filesReadFailed:`Unable to read files.`,filesRetryRead:`Try again`,filesErrorDetails:`Error details`,filesReadFailedDetail:`The file list could not be loaded. Check your connection and try again.`,filesReadDenied:`This session's workspace is currently unavailable or cannot be verified. Check the session and workspace, then try again.`,filesSymlink:`Symbolic link — not followed by the file browser`,filesTruncated:`The result is incomplete. Refine your search.`,filesNoMatches:`No matching files`,filesEmpty:`This folder is empty`,filesChoose:`Choose a file to preview`,filesChooseDetail:`Browse your workspace on the right. Files open here, keeping the explorer in place.`,filesHideTree:`Hide file tree`,filesShowTree:`Show file tree`,filesPreview:`Preview`,filesSource:`View source`,filesEdit:`Edit`,filesMode:`File view`,filesEditor:`File editor`,filesSave:`Save file`,filesSaving:`Saving…`,filesSaved:`Saved`,filesUnsaved:`Unsaved changes · draft kept in this window`,filesDiscard:`Discard draft`,filesDiscardConfirm:`Discard your unsaved changes to this file?`,filesSaveConflict:`The file changed on disk. Your draft is preserved. Refresh to inspect the current version, then reconcile your changes before saving.`,filesSaveFailed:`Could not save. Your draft is preserved; check the file and retry.`,filesEditLoadFirst:`Continue reading the complete file before editing.`,filesEditUnavailable:`Editing supports workspace UTF-8 text files up to 1 MiB. At most 16 unsaved drafts can be kept.`,filesOutline:`Document outline`,filesDiskVersion:`Inspect current disk version`,filesReconcile:`Reviewed · continue editing my draft against this version`,filesTable:`Table preview`,filesRow:`Row`,filesSheets:`Worksheets`,filesTableTruncated:`Showing a partial table preview. Download the original file for complete content.`,filesOfficeLayout:`Document content preview; pagination and typography may differ from Office.`,filesSlidesLayout:`Slide text and images; themes, charts and animations may differ from PowerPoint.`,filesPreviousPage:`Previous page`,filesNextPage:`Next page`,filesZoomOut:`Zoom out`,filesZoomIn:`Zoom in`,filesZoomReset:`Reset zoom`,filesPdfPage:`Page {{page}}`,filesDocumentLimit:`This document exceeds the preview limit. Download it to open locally.`,filesPreviewFailed:`Unable to preview this file. You can still download it.`,filesDiagram:`Mermaid diagram`,filesDiagramLoadError:`Unable to load diagram preview. The source is shown below. Refresh the page to try again.`,filesExpandDiagram:`Expand diagram`,filesFitImage:`Fit`,filesOriginalImage:`Original size`,filesLoadMore:`Load more`,filesLoaded:`{{count}} items loaded`,filesReadMore:`Continue reading`,filesContentChanged:`The file changed. Refresh when ready; your current reading position is preserved.`,workbarFilesDescription:`Browse workspace files with an inline preview and file tree.`,backToSideConversations:`Back to side conversations`,continueSideConversation:`Send a follow-up…`,startSideConversation:`Ask a side question…`,sideConversationModelInherited:`New side conversations use the main conversation’s model and thinking level.`,sideConversationModelFixed:`This is the model used by this side conversation.`,stop:`Stop`,start:`Start`,browserAddress:`Browser address`,browserGo:`Open address`,openExternalBrowser:`Open in external browser`,invalidBrowserAddress:`Enter a valid HTTP or HTTPS address.`,addImages:`Add images`,addFiles:`Add files`,fileAttachments:`File attachments`,previewFileAttachment:`Preview file`,fileAttachmentDescription:`Documents, spreadsheets, PDFs, text, code, and other files`,fileAttachmentCount:`Attach up to {{count}} items.`,fileAttachmentTooLarge:`Files must total 50 MB or less.`,fileAttachmentReadFailed:`Could not read this file. Check the format or whether it is password protected.`,fileAttachmentTextReady:`Text ready`,fileAttachmentTextTruncated:`Partial text · original retained`,fileAttachmentOriginalReady:`Original file ready`,fileAttachmentExtractionFailed:`Text unavailable · original retained`,fileAttachmentEncodingUnavailable:`The text encoding could not be read. The original bytes are preserved.`,fileAttachmentDocumentUnavailable:`Text could not be extracted. The document may be password protected or have an unsupported format. The original bytes are preserved.`,fileAttachmentNoText:`The original file will be attached for the agent to read with its tools. No text was extracted.`,fileAttachmentPreviewTruncated:`Preview shows the first 20,000 characters. The complete extracted text will be attached.`,fileAttachmentExtractedContent:`Extracted text`,fileAttachmentPromptLabel:`User-provided files:`,fileAttachmentPromptTooLong:`The message and file references exceed the input limit. Shorten the message or attach fewer files.`,imageAttachmentDescription:`PNG, JPEG, GIF, or WebP`,imageAttachments:`Image attachments`,imageAttachmentsLoading:`Preparing attachments…`,commandOpensPanel:`Open panel`,commandPanelArguments:`This command opens a panel and cannot include arguments or images. Remove them, or use the panel directly.`,commandPanelUnavailable:`The panel could not be opened. Your command is preserved.`,commandUnavailable_terminal_only:`Requires Pi's terminal interface.`,commandUnavailable_not_integrated:`This extension command is not connected to Web yet. Use it in Pi's terminal.`,artifactImagePreviewFailed:`Unable to preview this image. Refresh the file to retry, or download it.`,artifactFileDetails:`File details`,turnElapsedRunning:`Working for {{duration}}`,compactionElapsed:`Waiting {{duration}}`,compactionRunning:`Compacting context`,compactionCompleted:`Context automatically compacted`,compactionFailed:`Context compaction failed`,compactionInterrupted:`Compaction interrupted`,compactionUnchanged:`Compaction finished without a new summary`,compactionUnavailable:`Context compaction status unavailable`,compactionReconnectHelp:`Connection interrupted. The current status will be checked after reconnecting.`,compactionDraftHelp:`Compacting history. Messages you send will be queued.`,turnElapsedFinished:`Worked for {{duration}}`,composerAdd:`Add`,composerCommands:`Commands`,composerFile:`File`,composerPlan:`Plan`,composerCompact:`Compact`,composerModel:`Model`,composerBack:`Back`,composerPlanDescription:`Enter or leave Plan mode`,composerCompactDescription:`Summarize earlier conversation history`,composerModelDescription:`Select this Session's model`,compactionQueueWaiting:`Waiting for compaction to finish`,compactionQueueBlocked:`Messages retained. Retry when ready or clear the queue.`,clearPromptQueue:`Clear queue`,queueUpdateFailed:`Could not update the queue. Check the current session and try again.`,queueStatusUnconfirmed:`The request was received, but the latest queue state could not be verified. Refresh before trying again.`,turnElapsedOutcome_cancelled:`Stopped`,turnElapsedOutcome_failed:`Failed`,turnElapsedOutcome_uncertain:`Outcome unconfirmed`,settingsSetupBusyHint:`Agent configuration is available after this turn. Display settings can be changed now.`,resetChatContentWidth:`Reset chat content width`,resetChatFontSize:`Reset chat font size`,setupResolveAdmission:`Return to the conversation to resolve the pending message before applying settings.`,removeAttachment:`Remove attachment`,dropImagesHere:`Drop files or images here`,imageAttachmentCount:`Attach up to {{count}} images.`,imageAttachmentTooLarge:`Each image must be 10 MB or smaller.`,imageAttachmentTotalTooLarge:`The attached images must total 32 MB or less.`,imageAttachmentUnsupported:`Only valid PNG, JPEG, GIF, and WebP images are supported.`,imageAttachmentReadFailed:`Could not read this image. Add it again to retry; your message is preserved.`,attachedImage:`Attached image`,previewAttachment:`Preview image`,closeImagePreview:`Close image preview`,imagePreviewFailed:`Unable to display this image.`,fitImage:`Fit image`,originalImageSize:`Original size`,imageViewMode:`Image view`,sessionUsage:`Session token usage`,sessionInputTokens:`Input tokens`,sessionOutputTokens:`Output tokens`,sessionCacheTokens:`Cached tokens`,sessionContextUsage:`Context usage and context window`,usageContextLabel:`Context`,usageUnknown:`Unknown`,usageOpenDetails:`Input {{input}} · Output {{output}} · Context {{percent}} / {{capacity}} · View token usage`,usageContextHelp:`Estimated tokens in the current branch / model context limit.`,usageSessionTotals:`Session totals`,usageInputLabel:`Input`,usageOutputLabel:`Output`,usageCacheReadLabel:`Cache read`,usageCacheWriteLabel:`Cache write`,usageTotalLabel:`Total`,usageWorkspaceLabel:`Workspace`,usageSessionId:`Session ID`,usageTotalsHelp:`Session token totals include cache usage.`,subagentDetails:`Subagents`,sessionOverview:`Session overview`,sessionOverviewChanges:`Changes in the current review scope`,subagentSummaryRunning:`{{count}} running`,subagentSummaryDone:`{{count}} completed`,subagentSummaryOther:`{{count}} other`,subagentNoneYet:`No subagents yet`,subagentOtherGroup:`Failed / interrupted`,subagentShowMore:`Show {{count}} more`,backToSubagents:`Back to subagents`,subagentActiveGroup:`Active`,subagentFinishedGroup:`Completed`,subagentNoneRunning:`No subagents running.`,subagentNoneFinished:`Completed tasks will appear here.`,subagentProgress:`Subagents: {{running}} running · {{completed}} completed`,subagentSummaryUnknown:`{{count}} without confirmed status`,subagentTasks:`Subagent tasks`,inspectSubagent:`Open subagent: {{name}}`,subagentState_running:`Running`,subagentProcessing:`Working…`,subagentState_done:`Completed`,subagentState_error:`Failed`,subagentState_interrupted:`Interrupted`,subagentStarting:`Starting…`,subagentSpawnFailed:`Failed to start`,subagentStateUnavailable:`Started · state unavailable`,subagentSpawnReceipt:`Start receipt`,subagentSpawnReceiptHint:`This confirms the start request, not the subagent's final result.`,subagentTask:`Assigned task`,subagentTranscript:`Subagent conversation`,subagentResult:`Result`,subagentSpend:`Cumulative token spend`,subagentSaved:`Saved record`,subagentRecordedState:`Last recorded state`,subagentSavedHint:`From this parent session's saved receipts. A result may include other tasks from the same batch; this is not the child's full live conversation.`,subagentReadOnly:`Read-only view · closing this panel does not stop the task`,subagentUnavailable:`Live details are no longer available for this subagent in the current session. The start receipt is not evidence of completion.`,subagentStale:`Could not refresh. The details below are the last received snapshot.`,subagentNoMessages:`No messages received yet.`,subagentTranscriptUnavailable:`This view retains a task summary and cannot show the full child conversation.`,subagentWorkflowsTruncated:`{{count}} workflows are outside the loaded list; their task counts are unknown.`,subagentState_unknown:`Unconfirmed`,subagentUnconfirmedGroup:`Unconfirmed`,subagentTruncated:`Showing recent messages. {{count}} earlier messages are not included in this view.`,subagentTextTruncated:`Some long content is shown as an excerpt.`,subagentListTruncated:`{{count}} additional tasks are outside the loaded list.`,subagentThinkingRedacted:`Reasoning was redacted by the provider.`,inspectionChanged:`The active session changed. Reopen this panel.`,inspectionUnavailable:`Details are unavailable.`,inspectionLoading:`Loading status…`,thinkingUnavailable:`Thinking state is unavailable.`,trustUnavailable:`Project trust status is unavailable.`,copySetupCommand:`Copy setup command`,savedTrustDecision:`Saved decision`,activeSessionTrust:`Active Session trust`,trustDecision_trusted:`Trusted`,trustDecision_denied:`Denied`,trustDecision_undecided:`Undecided`,trustDecision_unknown:`Unknown`,trustActiveYes:`Trusted in this Session`,trustActiveNo:`Not trusted in this Session`,modelAndThinking:`Model and reasoning`,selectedModel:`Current model`,thinkingLevel:`Thinking level`,availableThinking:`Available levels`,unknownState:`Unknown`,projectTrust:`Project trust`,trust_trusted:`This session trusts the workspace.`,trust_untrusted:`Trust for this workspace has been denied.`,trust_restricted:`Project resources are restricted pending a trust decision.`,trust_unknown:`Trust state is not available.`,trustRefreshNeeded:`The saved decision and active session differ. Refresh the session through Pi to apply it.`,providerAvailability:`Provider credentials`,settings:`Settings`,settingsNavigation:`Settings navigation`,generalSettings:`General`,configurationSettings:`Configuration`,configurationIntro:`Permissions, web access and model responses.`,configurationReadFailure:`Configuration could not be read safely. Fix the settings file, then refresh.`,configurationUserScope:`User configuration`,configurationSetupHint:`Response and search changes use OpenPI setup`,configurationApproval:`Approval policy`,configurationApprovalDetail:`Tool approvals follow the installed Pi extensions.`,configurationPiPermissions:`Pi extensions`,configurationSandbox:`Sandbox`,configurationSandboxDetail:`Tools run with the host process permissions.`,configurationSandboxUnavailable:`No OS sandbox`,configurationSearchDetail:`Let the current Session model search the web when supported.`,configurationSearchOff:`Do not offer native search to the current model.`,configurationSearchOn:`Offer native search when the current connection supports it.`,configurationVerbosity:`Output verbosity`,configurationVerbosityDetail:`Choose how much detail the model includes in its response.`,configurationResponsesUnavailable:`The current connection does not use a supported Responses API.`,configurationVerbosity_default:`Model default`,configurationVerbosity_low:`Low`,configurationVerbosity_medium:`Medium`,configurationVerbosity_high:`High`,configurationVerbosityHelp_low:`Prefer short answers with fewer details.`,configurationVerbosityHelp_medium:`Include useful explanation and a moderate amount of detail.`,configurationVerbosityHelp_high:`Include more complete explanation and detail.`,configurationVerbosityRequest:`Set only response_verbosity to {{value}}; preserve the other OpenPI settings.`,configurationSummary:`Reasoning summary`,configurationSummaryDetail:`Choose the summary requested from a supported reasoning model.`,configurationSummaryUnavailable:`The current connection does not support reasoning summaries.`,configurationSummary_default:`Model default`,configurationSummary_auto:`Auto`,configurationSummary_concise:`Concise`,configurationSummary_detailed:`Detailed`,configurationSummary_none:`Off`,configurationSummaryHelp_auto:`Let the model choose the summary length.`,configurationSummaryHelp_concise:`Request a brief reasoning summary.`,configurationSummaryHelp_detailed:`Request a more detailed reasoning summary.`,configurationSummaryHelp_none:`Do not request a summary. Keep the current reasoning effort.`,configurationSummaryRequest:`Set only response_reasoning_summary to {{value}}; preserve the other OpenPI settings.`,configurationModelFeatures:`Model features`,configurationReasoningLevels:`Available reasoning efforts`,configurationReasoningDetail:`Choose which levels appear in model controls. Only levels supported by the current model are shown; the current level stays visible.`,configurationReasoningCount:`{{count}} selected`,configurationDependencies:`Workspace dependencies`,configurationEnvironment:`Local environment`,configurationEnvironmentDetail:`Node.js, Python and other tools come from your environment. OpenPI does not install a bundled workspace runtime.`,configurationRuntimeStatus:`Runtime status`,browserSettings:`Browser`,webSearchSettings:`Web search`,webSearchCurrentModel:`Current Session model`,webSearchNativeDetail:`Use your current model provider's native search with the existing connection and credentials.`,webSearchSupported:`This connection supports native search. When enabled, the model decides when to search.`,webSearchUnsupported:`Native search is unsupported or unconfirmed for this connection. No search tool is provided and no other provider is used.`,webSearchNativeRequest:`Enable native web search using the current Session model and existing Pi credentials. Do not switch model, connection protocol, or search provider. Unsupported or unknown connections must receive no search tool.`,webSearchIntro:`Let your model search current sources and read the original pages.`,webSearchPackageDetail:`Optional search, page reading, and PDF extraction through a Pi package.`,webSearchDefaultOff:`Off by default. This optional extension follows the current Session model; it needs no separate search key or plugin installation.`,webSearchLoaded:`Package loaded in this Session`,webSearchNotLoaded:`Package not loaded in this Session`,webSearchSource:`Review plugin source`,webSearchProfile:`Search setup`,webSearchExa:`Exa — no API key required`,webSearchExisting:`Keep my existing search preferences`,webSearchProfileHint:`Exa uses search queries with direct page reading. Existing preferences stay untouched. Other search services can be configured after installation.`,webSearchEnable:`Enable web search…`,webSearchDisable:`Disable web search…`,webSearchConfigure:`Change search service…`,webSearchExaRequest:`Enable optional web search with Pi Web Access and Exa, which needs no API key. Let me review the installation confirmation, preserve other preferences, and do not reload automatically.`,webSearchExistingRequest:`Enable optional web search with Pi Web Access and keep my existing search preferences unchanged. Let me review the installation confirmation, preserve other preferences, and do not reload automatically.`,webSearchDisableRequest:`Disable native web search. Preserve other settings and Session history.`,webSearchProviderRequest:`Help me change the search service for my installed Pi Web Access plugin. Explain available services and permissions, preserve unrelated preferences, keep credentials with the search plugin, and do not reload automatically.`,browserSettingsIntro:`Let OpenPI read pages, click, type and take screenshots.`,browserControl:`Browser control`,browserControlHint:`Requests a setup change. Access changes after the configuration is saved.`,browserDefault:`Default browser`,browserDefaultHint:`Requests a setup change for the browser used when none is named.`,browserEmbedded:`OpenPI browser`,browserAllowedTitle:`Allowed browsers`,browserOffHint:`Your choices take effect when browser control is on.`,browserConnected:`Connected`,browserNeedsSetup:`Extension setup needed`,browserNotFound:`Browser not detected`,browserUpdateNeeded:`Extension update needed`,browserBlocked:`Not allowed`,browserDefaultBlocked:`Your default browser is not allowed. Allow it or choose another default.`,browserSetUp:`Set up`,browserManage:`Manage`,browserSetupNamed:`Set up {{browser}}`,browserManageNamed:`Manage {{browser}}`,browserAllowNamed:`Allow {{browser}}`,browserMore:`More browsers`,browserSpeakHint:`Say “Use Chrome to…” to choose a different browser for a request.`,browserGuideTitle:`Connect {{browser}}`,browserGuideEyebrow:`One step at a time`,browserConnectionTitle:`Connection`,browserCloseGuide:`Close browser setup`,browserConnectionReady:`Connected. Choose whether OpenPI may use this browser.`,browserEmbeddedDetail:`Pages open inside OpenPI. Some websites require a regular browser to sign in or display correctly.`,browserExternalDetail:`OpenPI can use existing tabs and signed-in pages in your connected {{browser}} profile. Keep an OpenPI tab open in that profile.`,browserManageExtension:`Manage extension`,browserAllowUse:`Allow OpenPI to use it`,browserMakeDefault:`Use as default`,browserInstallIn:`Install in`,browserInstallTitle:`Install OpenPI Browser Bridge`,browserSetupSteps:`Setup steps`,browserGuidePopout:`Keep this guide in a separate window`,browserGuideDetached:`Your guide is open in a separate window. Follow it alongside the browser settings.`,browserShowGuide:`Show guide`,browserGuideInline:`Return guide here`,browserGuideBlocked:`The guide window could not open. Allow pop-ups and try again, or follow the steps here.`,browserSafariSettings:`Safari → Settings`,browserSafariDeveloper:`Developer settings`,browserSafariTemporary:`Add Temporary Extension…`,browserSafariOpenHint:`Open Safari, then choose Safari → Settings. Keep this guide alongside it. Requires Safari 26 or later on macOS.`,browserSafariDeveloperTitle:`Show Safari’s developer settings`,browserSafariDeveloperHint:`In Settings → Advanced, turn on Show features for web developers. Then select the Developer tab.`,browserSafariLoadHint:`In Developer, click Add Temporary Extension and select the folder below. Enable OpenPI Browser Bridge and allow the websites you want to control, including the local OpenPI page. Temporary extensions need reloading after Safari quits.`,browserFirefoxThis:`This Firefox`,browserFirefoxTemporary:`Load Temporary Add-on…`,browserFirefoxDeveloperTitle:`Select This Firefox`,browserFirefoxDeveloperHint:`On about:debugging, choose This Firefox in the left sidebar. Firefox does not need a Developer mode switch.`,browserFirefoxLoadHint:`Click Load Temporary Add-on and select manifest.json in the folder below. This development installation lasts until Firefox restarts; a permanent installation requires a Mozilla-signed package.`,browserFirefoxDone:`Selected. Next`,browserStepCount:`Step {{step}} of {{total}}`,browserStepLabel:`Step {{step}}: {{label}}`,browserStepOpen:`Open page`,browserStepAdd:`Add extension`,browserStepConnect:`Connect`,browserOpenManagerTitle:`Open {{browser}} extensions`,browserOpenManagerHint:`This opens {{browser}}. Complete the action on its extensions page, then return here to continue.`,browserOpenManager:`Open {{browser}} extensions`,browserReopenManager:`Open extensions page again`,browserAlreadyInstalled:`Already installed? Connect`,browserDeveloperMode:`Developer mode`,browserDeveloperTitle:`Turn on Developer mode`,browserDeveloperHint:`Turn on Developer mode on the extensions page. The {{loadLabel}} button will appear.`,browserDeveloperDone:`It’s on. Next`,browserIllustration:`Illustration · In {{browser}}`,browserExtensions:`Extensions`,browserLoadUnpacked:`Load unpacked`,browserLoadHint:`The extension is ready on this computer. Follow these steps in {{browser}} to load it.`,browserCopyLocation:`Copy the location below`,browserLocateTarget:`Find the extension on this computer`,browserRevealTarget:`Locate extension`,browserLocateManifest:`Find the extension’s manifest.json`,browserRevealManifest:`Locate manifest.json`,browserDragToBrowser:`Drag the folder onto {{browser}} extensions`,browserDragFolderHint:`Drag the entire {{folder}} folder from your file manager onto the extensions page, with Developer mode on.`,browserSelectLocatedTarget:`In the browser’s file picker, select the item located in the previous step.`,browserManualInstall:`Need another way? Select by path`,browserManualSelection:`Can’t find it? Select by path`,browserLoadInBrowser:`In {{browser}}, click “{{loadLabel}}”`,browserLoadAlternate:`The button appears when Developer mode is on.`,browserConfirmFolder:`Select`,browserConfirmFile:`Open`,browserSelectFolderHint:`Select this entire folder, not a .js file inside it.`,browserSelectManifestHint:`Select manifest.json, not one of the .js files.`,browserInstallCheckpoint:`Continue when OpenPI Browser Bridge appears in the extensions list.`,browserPathCopied:`Path copied`,browserCopyFailed:`Couldn’t copy. Select the path above and copy it manually.`,browserChooseFolderMac:`Press ⌘ ⇧ G, paste the copied path and press Return. Then click “{{confirm}}”.`,browserChooseFolderOther:`Paste the copied path into the location bar and press Enter. Then click “{{confirm}}”.`,browserInstalledConnect:`Added. Connect to OpenPI`,browserPreviousStep:`Back`,browserWaiting:`Waiting for OpenPI Browser Bridge… We’ll detect it automatically.`,browserInstallBrowserFirst:`Install {{browser}} first, or open this OpenPI address in your installed browser.`,browserConnectTitle:`Connect to OpenPI`,browserConnectHint:`Open OpenPI in {{browser}}. Use the profile where you installed the extension.`,browserOpenIn:`Open in {{browser}}`,browserAllowHint:`Once connected, you can allow OpenPI to use this browser. Installing the extension does not change your browser permissions.`,browserCheck:`Check connection`,browserNotConnectedYet:`No connection yet. Finish installation, refresh OpenPI in that browser and check again.`,browserHelp:`Setup help`,browserReloadHint:`Already installed? Reload OpenPI Browser Bridge in the extension manager and refresh OpenPI. Accept the browser’s permission prompt if shown.`,browserSupportedHint:`Chrome, Edge, Brave and Chromium 145+ support embedded and native pages. Safari 26+ on macOS and Firefox 128+ use the portable extension for native tabs; nested frames must be opened separately. Temporary Safari/Firefox installations need reloading after browser restart.`,browserCopyPath:`Copy path`,browserOpening:`Opening browser…`,browserLoading:`Checking browser connections…`,browserSaved:`Saved. Browser permissions take effect immediately.`,browserSaving:`Working…`,modelSettings:`Models`,skillsSettings:`Skills`,subagentsSettings:`Sub-agents`,pluginsSettings:`Plugins`,configureOpenPi:`Configure OpenPI`,setupRequestReviewAll:`review every OpenPI configuration area with me`,setupRequestSetTheme:`set only the OpenPI Web theme to {{value}} and preserve every other setting`,setupRequestSetChatWidth:`set only the OpenPI Web chat content width to {{value}}px and preserve every other setting`,setupRequestSetChatFontSize:`set only the OpenPI Web chat font size to {{value}}px and preserve every other setting`,setupRequestEnableExpandedThinking:`expand thinking blocks by default in OpenPI Web and preserve every other setting`,setupRequestDisableExpandedThinking:`collapse thinking blocks by default in OpenPI Web and preserve every other setting`,setupRequestSubagents:`review and configure Agent role models and workflow limits`,setupRequestFailed:`The OpenPI setup request was not accepted.`,setupRequestRunning:`Applying OpenPI settings…`,setupRequestAccepted:`Configuration request accepted.`,setupPlanBlocked:`Exit Plan mode before changing agent configuration. Display settings can be changed directly; exiting does not start implementation.`,setupPlanBusy:`Agent configuration requires an idle turn and leaving Plan mode. Display settings can be changed now.`,setupOutcome_pending:`Configuration request is awaiting a save receipt.`,toolCallArguments:`Tool arguments`,toolCallOutput:`Tool result`,setupOutcome_saved:`OpenPI configuration was saved and applied.`,setupOutcome_unchanged:`Configuration was saved; effective settings are unchanged.`,setupOutcome_failed:`The setup request failed. Review the error and current settings before retrying.`,setupOutcome_cancelled:`Setup was cancelled without a confirmed save.`,setupOutcome_unconfirmed:`No successful save was confirmed. Review current settings before retrying /openpi-setup.`,settingsUpdateFailed:`The Web preference could not be saved.`,settingsPreferencesSaved:`Preferences saved.`,settingsPreferencesSaveFailed:`Could not save display settings. Check configuration diagnostics and retry.`,settingsCatalogLoading:`Loading Pi resources…`,settingsCatalogFailed:`Could not load Pi settings resources.`,appearance:`Appearance`,settingsPersonal:`Personal`,settingsAgent:`Agent`,settingsIntegrations:`Integrations`,settingsArchivedChats:`Archived chats`,settingsSearch:`Search settings`,settingsClearSearch:`Clear search`,settingsNoResults:`No matching settings`,appearanceVisualStyle:`Visual style`,appearanceMode:`Mode`,appearanceTheme:`Theme`,appearanceAccent:`Accent color`,appearanceBackground:`Background`,appearanceForeground:`Foreground`,appearanceFont:`Font`,appearanceFont_codex:`Codex default`,appearanceFont_sans:`Sans serif`,appearanceFont_serif:`Serif`,appearanceFont_mono:`Monospace`,appearanceAccent0:`Default`,appearanceAccent1:`Blue`,appearanceAccent2:`Purple`,appearanceAccent3:`Pink`,appearanceAccent4:`Orange`,appearanceAccent5:`Green`,appearanceCustomAccent:`Custom accent color`,appearanceAdvanced:`Advanced`,appearanceReset:`Restore defaults`,appearanceResetAction:`Reset appearance`,appearanceImport:`Import theme`,appearanceCopy:`Copy theme`,appearanceCopied:`Theme copied`,appearanceCopyFailed:`Could not copy theme. Try again.`,appearanceThemeValue:`Theme data`,appearanceImportPlaceholder:`Paste an OpenPI theme…`,appearanceImportInvalid:`Enter valid OpenPI theme data.`,appearanceImportAction:`Import`,searchArchivedChats:`Search archived chats`,archiveProjectFilter:`Filter by project`,archiveAllProjects:`All projects`,archiveProjectGroup:`{{project}} · {{count}} archived chats`,archiveSort:`Sort archived chats`,archiveSortUpdated:`Last updated`,archiveSortCreated:`Date created`,restoreArchivedChat:`Restore {{title}}`,themeLight:`Light`,themeDark:`Dark`,themeMist:`Mist`,themeRose:`Rose`,themePine:`Pine`,themeSystem:`System`,conversationSettings:`Conversation`,expandThinkingByDefault:`Expand thinking by default`,chatContentWidth:`Chat content width`,chatFontSize:`Chat font size`,agentBehavior:`Agent behavior`,workflowLimits:`Workflow limits`,workflowConcurrency:`Workflow concurrency`,workflowCalls:`Total calls`,agentSettingsSetupHint:`Agent changes are applied through /openpi-setup in the current session.`,setupRequestLimits:`Set workflow concurrency to {{concurrency}} and total agent calls to {{calls}}. Preserve other settings.`,setupRequestEnableSuggestions:`Enable next-action suggestions. Help me choose a model if required; preserve other settings.`,setupRequestDisableSuggestions:`Disable next-action suggestions. Preserve other settings.`,setupRequestPostEdit:`Help me configure or disable the post-edit command. Show the current configuration and ask which command to use.`,configurePostEdit:`Configure post-edit command`,workflowLimitsValue:`{{concurrency}} concurrent · {{calls}} total calls`,nextActionSuggestions:`Next-action suggestions`,nextActionSuggestionsDetail:`Offer a few useful next actions when the current task finishes.`,enabled:`Enabled`,disabled:`Disabled`,configured:`Configured`,postEditCommand:`Post-edit command`,postEditCommandDetail:`Run a command after edits. Nothing runs while this is off.`,resultDisplay:`Default result display`,subagentResults:`Subagent results`,bashOperations:`Bash operations`,fileMutations:`Write / Edit operations`,footer:`Footer`,terminalFooter:`Pi terminal footer`,terminalFooterStyle:`Terminal footer style`,terminalFooterHint:`Applies to Pi's command-line interface. An already open Pi interface updates when restarted or when setup is applied.`,detailDisplay_full:`Full`,detailDisplay_compact:`Compact`,sessionSettings:`Session`,currentModel:`Current`,providerCurrentSessionModel:`This conversation uses {{model}}.`,useThisModel:`Use model`,model:`Model`,modelConnection:`Model connection`,provider:`Provider`,modelId:`Model ID`,providerStatusUnavailable:`This provider is not present in the bounded authentication snapshot.`,providerSettings:`Provider credentials`,providerSettingsIntro:`Inspect which Pi providers can authenticate the current Web session.`,openRuntimeDetails:`Open runtime details`,currentWorkspace:`Current workspace`,providerAuth_api_key:`API key`,providerAuth_oauth:`OAuth`,providerAuthUnknown:`Authentication method not reported`,authentication:`Authentication`,accessType:`Access`,providerAccessSubscription:`Subscription account`,providerAccessStandard:`Provider credentials`,configurationOwner:`Configuration owner`,providerLoading:`Loading provider status…`,providerLoadFailed:`Could not load provider status.`,providerReadOnly:`Managed by Pi`,selectProvider:`Select a provider`,gitReviewBaselineUnavailable:`No usable session baseline was retained (it may exceed the capture limit). Choose Unstaged, Staged or Branch to inspect Git changes, or open the session file records.`,modelsIntro:`Sign in with an account or add an API key. Your existing Pi connections are available here.`,modelConnectionsTitle:`Model connections`,modelConnectionsIntro:`Manage credentials and choose models for new and current chats.`,accountLoginMethod:`Connection method`,accountLoginTab:`Account`,accountLoginChatGPT:`ChatGPT account`,accountLoginClaude:`Claude account`,accountLoginKeyTab:`API key`,accountLoginConfigured:`Account signed in`,accountLoginIntro:`Continue in your browser. No API key needed.`,accountLoginExisting:`Your account credential is saved in Pi.`,accountLoginStart:`Sign in`,accountLoginAgain:`Sign in again`,accountLoginUnsaved:`Save or discard your other changes before signing in.`,accountLoginStarting:`Preparing sign-in…`,accountLoginWaiting:`Waiting for authorization`,accountLoginChoose:`Choose how to sign in`,accountLoginCancelling:`Cancelling sign-in…`,accountLoginBrowser:`Continue in browser`,accountLoginDevice:`Use a device code`,accountLoginBrowserOption:`Sign in on this computer. Returns here automatically.`,accountLoginDeviceOption:`For remote servers or when browser sign-in is unavailable.`,accountLoginBrowserHelp:`Open the sign-in page and approve access. This page updates automatically.`,accountLoginDeviceHelp:`Open the authorization page and enter this code. Keep this page open.`,accountLoginOpen:`Open sign-in page`,accountLoginCopyCode:`Copy device code`,accountLoginPaste:`Authorization code or callback URL`,accountLoginContinue:`Continue`,accountLoginFallback:`Signed in but still waiting?`,accountLoginRemoteHelp:`If automatic return does not work, copy the final callback URL from your browser and paste it here.`,accountLoginCancel:`Cancel sign-in`,accountLogin_failed:`Sign-in failed. Try again or choose another method.`,accountLogin_expired:`Sign-in expired. Start again to get a new authorization link.`,accountLogin_cancelled:`Sign-in cancelled.`,accountLoginRequestFailed:`The request did not complete. Refresh status before retrying.`,accountLoginStatusUnknown:`Cannot check sign-in status. Your authorization may still be in progress.`,accountLoginRefreshRequired:`The credential was saved, but Pi could not update its model list. Reload Pi before using this connection.`,accountLogout:`Sign out`,accountLogoutRefreshRequired:`The saved credential was removed, but Pi could not update its model list. Reload Pi to refresh the status.`,accountLogoutTitle:`Sign out of {{provider}}?`,accountLogoutDetail:`Removes this provider’s saved credential from Pi on this machine. Other Pi sessions using it will also need to sign in again. Environment credentials are unchanged.`,providerInputTypes:`Input types`,providerInputText:`Text`,providerInputImage:`Images`,providerCustomTag:`Custom`,providerEdit:`Edit`,providerRemove:`Delete`,providerSave:`Save`,editProvider:`Edit {{provider}}`,removeProvider:`Delete {{provider}}`,providerAdd:`Add model provider`,providerAddMode:`How to add`,providerAddCatalog:`Third-party providers`,providerAddCustom:`Custom model API`,providerAccountHint:`Use an existing account to connect. Choose a provider and continue in your browser.`,providerCatalogHint:`Choose a provider from the built-in catalog and enter its API key.`,providerCustomHint:`Connect a gateway or self-hosted service using an OpenAI or Anthropic compatible API.`,providerKeyKeep:`Leave blank to keep the existing key`,providerKeyOptional:`Enter an API key, or leave blank to use environment authentication`,providerDisplayName:`Provider name`,providerCustomSettings:`Custom settings`,providerSaved:`Saved {{provider}}.`,modelDefaultTitle:`Default for new chats`,modelDefaultChoose:`Choose model`,modelDefaultBadge:`Default`,modelCurrentBadge:`In use`,modelDefaultNotSet:`Not set · Pi chooses when a new chat starts`,modelDefaultHint:`Choose the model for future chats. Existing chats keep their own model. This also updates Pi's default.`,modelDefaultReadFailed:`Could not read the default model.`,modelDefaultProjectOverride:`This workspace has a Pi override: {{model}}.`,modelDefaultSave:`Save default`,modelMakeDefault:`Also make this the default for new chats`,modelDefaultSaveFailed:`The default was not confirmed. Refresh status and try again.`,modelDefaultPartial:`The chat model changed, but saving the default was not confirmed. Refresh status before retrying.`,modelConnectionNextHint:`Choose a model from this connection to use in the current chat.`,modelConnectionSearch:`Search models…`,modelConnectionChooseProvider:`Choose a model from {{provider}}`,modelConnectionUse:`Use in this chat`,modelConnectionUseFailed:`The model change was not confirmed. Refresh the model list and try again.`,modelConnectionLoadFailed:`Could not load models.`,modelConnectionNoModels:`No selectable models yet. Check the connection or add a model definition.`,modelConnectionNoMatch:`No matching models.`,modelConnectionMore:`{{count}} more models. Search to narrow the list.`,providerModelsEmpty:`No models yet. Fetch available models or add one manually.`,providerModelsInherited:`Uses the provider’s built-in model catalog.`,providerModelsReadOnly:`This provider contains model settings that must be edited in Pi’s configuration file.`,providerModelId:`Model {{number}} ID`,providerModelName:`Model {{number}} name`,providerModelDetails:`Model details: {{model}}`,providerRemoveModel:`Remove model: {{model}}`,providerIdInvalid:`Use a unique provider ID with letters, numbers, hyphens, dots or underscores.`,providerNativeAuth:`This provider uses Pi’s native sign-in.`,providerConfigurationFailed:`Could not save. Check the fields and retry when the session is idle.`,providerProfileSavedKeyFailed:`The provider was saved, but its API key was not. Retry saving the key.`,providerReload:`Discard draft and reload`,providerCurrentRemoval:`Select another model before removing the model currently in use.`,providerRemoveDetail:`Remove this provider’s configuration and custom models? Credentials managed by Pi are kept.`,providerPickerIntro:`Select the models you want to add from this provider.`,providerPickerSelected:`{{count}} selected`,providerApiKey:`API key`,providerKeyPlaceholder:`Paste a key to add or replace it`,saveProviderKey:`Save API key`,savingSettings:`Saving…`,keepEditing:`Keep editing`,discardAndContinue:`Discard and continue`,unsavedSettingsTitle:`Discard unsaved changes?`,unsavedSettingsDetail:`Unsaved model and credential changes will be lost.`,unsavedCredentialTitle:`Discard the unsaved credential?`,unsavedCredentialDetail:`The new key has not been saved and will be cleared.`,modelSelectionBusy:`This session is busy. Model changes are unavailable.`,providerKeySaved:`Saved to Pi credentials. Existing keys are never displayed.`,providerSaveFailed:`Credential save did not complete. Wait until the session is idle, refresh status and retry. Some providers need additional authentication settings.`,providerWriteDetail:`Save API keys here directly to Pi. Keys never enter a model conversation. For OAuth or additional provider fields, use Pi's native login.`,editModelConfiguration:`Add or edit a custom model`,modelConfigurationDetail:`Set up a provider connection, then choose available models or add one manually. Saving does not send a model request.`,configuredModels:`Custom model configuration`,addModel:`Add a model`,modelConfig_provider:`Provider ID`,modelConfig_id:`Model ID`,modelConfig_name:`Display name`,modelConfig_baseUrl:`API base URL`,modelConfig_api:`API format`,modelConfig_contextWindow:`Context window`,modelConfig_maxTokens:`Max output tokens`,providerCapacityLabel:`{{field}} {{number}}`,providerModelOptions:`Model options`,providerModelInvalid:`Model {{number}}: use a unique model ID and positive token counts, such as 128K or 1M. Leave capacities blank to use defaults.`,modelConfig_reasoning:`Supports reasoning`,saveModelConfiguration:`Save model`,reloadModelConfiguration:`Discard draft and load latest`,retryModelConfiguration:`Retry loading`,discardModelDraftTitle:`Discard this model draft?`,discardModelDraftDetail:`The latest configuration will replace this unsaved draft.`,discardAndReload:`Discard and reload`,modelConfigurationUnsaved:`Unsaved changes`,modelConfigurationConflict:`Model configuration changed elsewhere. Your draft is unchanged.`,modelConfigurationLoadFailed:`Could not load model configuration. Your draft is unchanged.`,modelConfigurationSaved:`Saved to Pi models.json. Configure the provider API key to make this model available.`,modelConfigurationFailed:`Model save did not complete. Your draft is unchanged.`,setupConfigurationRequest:`Configuration request`,configureViaSetup:`Apply via OpenPI setup`,setupFormDetail:`Uses /openpi-setup. Follow progress and any required confirmation in the conversation; submission does not mean the configuration is saved.`,setupSkillsPlaceholder:`Describe the skill to add or configure, including its source or local path`,setupPluginsPlaceholder:`Describe the Pi package to configure, including its exact package name or local path`,enableSkillInvocation:`Allow model invocation`,disableSkillInvocation:`Require explicit invocation`,setupSkillInvocationRequest:`Configure this Pi skill: {{path}}. Set its native disable-model-invocation field to {{disabled}}. Preserve other content and explain when the change takes effect.`,setupRoleFormRequest:`Configure the OpenPI {{role}} role to use {{model}} and set workflow concurrency to {{concurrency}}. Inherit parent thinking, validate the selection and preserve unrelated configuration.`,providerReadOnlyDetail:`This page is read-only and never receives credential values. Configure provider authentication through Pi, then refresh this status.`,openProviderSettings:`Open provider settings`,credentialConfigured:`Configured`,credentialMissing:`Not configured`,authNotVerified:`Configured credentials do not guarantee a successful model request.`,configurationViaPi:`Read-only status. Manage model credentials and trust through Pi; manage OpenPI options with /openpi-setup.`,noSkillsFound:`No skills are loaded for this Session.`,addSkill:`Add skill`,addPlugin:`Add plugin`,searchResources:`Search by name or source`,filterResourceScope:`Resource scope`,allResourceScopes:`All scopes`,noMatchingResources:`No matching resources`,resourceBulkTooLarge:`Filter the list further before submitting a bulk request.`,resourceManagement:`Pi resources`,resourceSourceAuto:`Pi automatic discovery`,resourceSourceLocal:`Local resource`,resourcePackageSource:`Package, repository or local path`,resourcePackageSourcePlaceholder:`npm:package@version · git:owner/repo · /path/to/skill`,resourceInstallIntro:`Choose a source and scope. OpenPI setup will review and apply the request in the conversation.`,resourceInstallReview:`Review the exact source and permissions in the conversation. Submitting this request does not mean it is installed or loaded.`,resourceRequestSubmitted:`Request submitted. Follow progress and confirmations in the conversation, then refresh this catalog.`,browseSkills:`Browse skills.sh`,resourceSessionState:`Apply to this Session`,resourcesReloadNote:`Refresh reads the catalog. Reload applies saved resources to this idle Session; changes are never reloaded automatically.`,reloadResources:`Reload resources`,resourceReloadReview:`Apply saved Pi skill and plugin configuration and restart extensions in the current Session? Wait for running work to finish first.`,resourceReloaded:`Resources reloaded. Review the refreshed catalog and diagnostics.`,resourceReloadFailed:`Could not reload resources. Wait for this Session to become idle and refresh before retrying.`,advancedResourceConfiguration:`Advanced configuration`,resourceDiagnostics:`Pi reports {{extensionErrors}} extension diagnostics and {{skillErrors}} skill diagnostics.`,resourceConfigurationDiagnostics:`{{count}} settings files could not be read. Review Pi configuration diagnostics.`,resourceCatalogTruncated:`This catalog is bounded; some resources are omitted.`,resourceTargetTruncated:`This source or path is truncated. Confirm the full target through Advanced configuration before making changes.`,updateResource:`Review update`,removeResource:`Review removal`,skillsEmptyTitle:`Add your first skill`,skillsEmptyIntro:`Skills give Pi reusable instructions. Add a package, repository or local skill; project skills follow Pi project trust.`,pluginsEmptyTitle:`Extend Pi with a plugin`,pluginsEmptyIntro:`Packages can include extensions, skills, prompts and themes. Add a source to review its installation through OpenPI setup.`,pluginCount:`{{count}} plugin sources`,installedVersion:`Installed version`,configuredVersion:`Configured version`,resourceVersionUnpinned:`Not pinned / local source`,pluginState_loaded:`Session resources loaded`,pluginState_installed:`Installed · not loaded`,pluginState_disabled:`Disabled in configuration`,pluginState_missing:`Package missing`,pluginState_error:`Load diagnostics`,pluginState_notLoaded:`Not loaded`,pluginLoadedResources:`{{count}} resources in this Session's catalog. Configuration changes require an explicit reload.`,pluginAction_enable:`Review enable`,pluginAction_disable:`Review disable`,pluginAction_update:`Review update`,pluginAction_remove:`Review removal`,enableVisibleSkills:`Allow model use ({{count}} shown)`,disableVisibleSkills:`Explicit use only ({{count}} shown)`,enableVisiblePlugins:`Enable {{count}} shown packages`,disableVisiblePlugins:`Disable {{count}} shown packages`,setupResourceInstallRequest:`Add these Pi {{kind}} from source {{source}} in scope {{scope}}. Inspect the source and resolve a fixed package identity, review required installation permissions with me using ask_user, then use Pi's native package/skill configuration. For a skill request, preserve unrelated extensions and other resources. Preserve existing preferences and project trust; do not reload this Session automatically. Report saved configuration and any remaining action separately. Do not change unrelated OpenPI settings.`,setupPluginOperationRequest:`Review Pi package action {{action}} for exactly configured source {{source}}, native root {{path}}, scope {{scope}}. Resolve relative sources against the native scope's settings directory. Use Pi's native package management. For updates, inspect available versions and review a fixed target identity and required permissions with me using ask_user before installing. Preserve resource filters and all unrelated preferences; if a toggle would destroy filters, stop and explain. Removal must not delete a local source directory. Do not reload automatically. Report persisted and active states separately; do not change unrelated OpenPI settings.`,setupSkillManageRequest:`Review Pi skill action {{action}} for exactly file {{path}}, source {{source}}, scope {{scope}}. Inspect native ownership first. Review the update/removal and required permissions with me using ask_user. Preserve unrelated skills and package resources; do not remove an entire shared package to remove one skill. Preserve project trust and do not reload automatically. Do not change unrelated OpenPI settings.`,setupSkillsBulkRequest:`For exactly these currently displayed Pi skill files {{paths}}, set native disable-model-invocation to {{disabled}}. Inspect ownership, preserve all other content and preferences, review necessary changes with me, and report any files that cannot be changed safely. Explicit /skill invocation remains available. Do not reload automatically or change unrelated OpenPI settings.`,setupPluginsBulkRequest:`For exactly these currently displayed Pi packages {{packages}}, set disabled to {{disabled}} through native Pi configuration. Preserve all other preferences and resource filters; skip and report entries whose filters cannot be preserved. Respect scope and project trust, review necessary changes with me, and do not reload automatically or change unrelated OpenPI settings.`,resourceRequestFinished:`The setup turn has ended. Refresh and inspect Pi's configuration and Session resources to confirm what changed.`,skillCount_one:`{{count}} skill`,skillCount_other:`{{count}} skills`,skill:`Skill`,copySkillInvocation:`Copy invocation`,source:`Source`,scope:`Scope`,invocation:`Invocation`,modelInvocation:`Model invocation`,resourceScope_user:`Global`,resourceScope_project:`Project`,resourceScope_temporary:`Temporary`,explicitOnly:`Explicit invocation only`,availableToModel:`Available to the model`,skillFile:`Skill file`,selectSkill:`Select a skill`,subagentConfiguration:`Pi-native subagent roles`,subagentConfigurationIntro:`Role models inherit from the parent unless OpenPI setup assigns an available model.`,subagentActiveCount_one:`{{count}} active`,subagentActiveCount_other:`{{count}} active`,subagentCompletedCount_one:`{{count}} recorded`,subagentCompletedCount_other:`{{count}} recorded`,subagentConcurrency:`Limit {{count}}`,builtInRoles:`Built-in roles`,subagentRole_explorer:`Explorer`,subagentRole_implementer:`Implementer`,subagentRole_reviewer:`Reviewer`,subagentRole_advisor:`Advisor`,subagentRoleShort_explorer:`Read-only investigation`,subagentRoleShort_implementer:`Focused implementation`,subagentRoleShort_reviewer:`Correctness review`,subagentRoleShort_advisor:`Technical analysis`,subagentRoleDescription_explorer:`Explores the codebase and reports evidence without modifying files.`,subagentRoleDescription_implementer:`Implements a bounded change and runs the relevant repository checks.`,subagentRoleDescription_reviewer:`Reviews correctness, safety, regressions, and missing validation.`,subagentRoleDescription_advisor:`Analyzes difficult technical questions and recommends a concrete next step.`,configureRoles:`Configure roles`,builtInRole:`Built-in role`,builtIn:`Built-in`,modelAssignment:`Model assignment`,inheritParentModel:`Inherit parent model`,effectiveModel:`Effective model`,workflowConcurrencyLabel:`Concurrent agents`,workflowCallLimit:`Total agent calls`,runtimeBoundaries:`Runtime boundaries`,subagentAuthorityNote:`Child authority is the fail-closed intersection of the parent Session and role capabilities.`,subagentModelNote:`No hardcoded provider is introduced; an unassigned role follows the parent model and thinking level.`,resourceCount_one:`{{count}} resource`,resourceCount_other:`{{count}} resources`,noPluginsFound:`No loaded plugin sources were reported.`,pluginCatalogTotals:`{{extensions}} ext · {{skills}} skills · {{prompts}} prompts · {{themes}} themes`,loaded:`Loaded`,resourceOrigin:`Origin`,resourceOrigin_package:`Package`,resourceOrigin_topLevel:`Top-level resource`,resources:`Resources`,baseDirectory:`Base directory`,notReported:`Not reported`,extensions:`Extensions`,extensionSurfaceCount:`{{tools}} tools · {{commands}} commands`,prompts:`Prompts`,themes:`Themes`,pluginResourceSummary:`{{extensions}} ext · {{skills}} skills · {{prompts}} prompts · {{themes}} themes`,pluginsManagedByPi:`These resources are loaded by Pi. Submit changes using the setup form above. Package changes follow native confirmation and take effect through Pi's reload lifecycle.`,selectPlugin:`Select a plugin source`,statusCaptured:`Snapshot at {{time}} · refresh for the latest state`,conversationViews:`Conversation views`,currentConversations:`Current`,archivedConversations:`Archived`,refreshArchives:`Refresh archived conversations`,loadingArchives:`Loading archived conversations...`,moreArchives:`Load more archived conversations`,retryArchives:`Retry archived conversations`,archiveLoadFailed:`Could not load archived conversations.`,archiveCursorStale:`Archived conversations changed. Refresh to continue.`,archiveScanBounded:`{{count}} older records have not been scanned.`,noArchivedSessions:`No archived conversations.`,noScannedArchives:`No archived conversations in the scanned history.`,noMatchingScannedArchives:`No matching archived conversations in the scanned history.`,draftLimit:`Draft storage is full. Send or clear an existing draft before adding more content.`,restoreConversation:`Restore conversation`,restoringConversation:`Restoring…`,loadedArchives:`Archived conversations in the loaded history`,loadedHistoryBounded:`{{sessions}} more sessions and {{workspaces}} workspace summaries are not loaded. Search covers the loaded list only.`,noLoadedArchives:`No archived conversations in this loaded list.`,restoreFailed:`Could not confirm restoration. Refresh and try again.`,execution_running:`Running`,execution_done:`Completed`,execution_killed:`Stopped`,execution_timed_out:`Timed out`,execution_failed:`Failed`,execution_uncertain:`Uncertain`,activeOnlyHint:`Only the active Web session accepts messages.`,acceptedHint:`Message accepted by OpenPI Web.`,promptAdmissionUnknown:`It is unclear whether the last message was received.`,promptAdmissionUnknownDetail:`Review the refreshed Session history and runtime status before deciding. Sending as a new message may create a duplicate message.`,promptAdmissionCheckingDetail:`Checking the latest Session history and runtime status before resend options are enabled.`,promptAdmissionVerificationFailedDetail:`Could not refresh the latest Session history and runtime status. Check again before sending as a new message.`,abandonAdmission:`Don't resend for now`,retryAdmissionCheck:`Check again`,retryOriginalAdmission:`Retry original message`,promptTooLong:`Message exceeds the send limit ({{count}} / {{limit}}).`,sendAsNew:`Send as new message`,sendingAsNew:`Sending…`,stopTurn:`Stop current turn`,stoppingTurn:`Stopping current turn…`,stoppedTurn:`Current turn stopped.`,pendingFollowUpsHint:`{{count}} messages queued`,sendNextTurn:`Send next turn`,followUpBehavior:`Follow-up behavior`,followUpBehaviorDetail:`While OpenPI is running, queue new messages for the next turn or guide the current turn. Press ⌘/Ctrl+Enter to use the other option once.`,followUpQueue:`Queue`,followUpQueueDetail:`Next turn`,followUpSteer:`Steer`,followUpSteerDetail:`Current turn`,steerCurrentTurn:`Steer current turn`,steeringHint:`Use this instruction after the current tool step finishes.`,pendingSteeringHint:`{{count}} instructions received; waiting for the current tool step`,steeringMessagesTitle:`Pending instructions for this turn`,steerStaleTurn:`That turn has ended or changed. Your draft is kept. Check the updated status and send again.`,sourceFeedbackNew:`{{path}} · new line {{line}}`,sourceFeedbackOld:`{{path}} · old line {{line}}`,forkMessage:`Fork from here`,forkMessageHint:`Create a new conversation from this message. Keep the original conversation; no message is sent.`,forkSessionPending:`Creating a fork…`,forkSessionCreated:`Fork created. The original conversation remains in the sidebar.`,forkSessionCancelled:`Fork cancelled. The original conversation is kept.`,forkSessionUncertain:`The fork could not be confirmed. Refresh and inspect your conversations before trying again.`,forkSessionUnavailable:`Switch to this conversation and let its current work and queued messages finish before forking.`,reviewQuoteLine:`Reference this line`,reviewSelectOldLine:`Select old line {{line}}`,reviewSelectNewLine:`Select new line {{line}}`,queuedMore:`{{count}} more queued`,queuedImage:`Image attachment`,queuedMessageExpand:`Expand queued message`,queuedMessageCollapse:`Collapse queued message`,backgroundSessionRunning:`This session is running in the background…`,observedSessionTools:`{{count}} active tools`,toolsRequireCurrentSession:`Switch to this session to use interactive tools.`,activateViewedSession:`Switch to this session`,activateViewedSessionHint:`Send a message to continue this conversation.`,addWorkspace:`Add workspace`,addWorkspaceMenu:`Add workspace...`,archiveConversation:`Archive conversation`,pinnedConversations:`Pinned`,sidebarOptions:`Sidebar options`,sidebarProjectOptions:`Project sidebar options`,sidebarRecentOptions:`Chat sidebar options`,sidebarActivityOptions:`Activity view options`,sidebarShow:`Show`,sidebarGroupBy:`Group conversations`,sidebarByProject:`By project`,sidebarFlatList:`All conversations`,sidebarChatSort:`Conversation order`,sidebarRecent:`Recent`,sidebarProjectsInRecents:`Show projects in Recent`,sidebarShowMore:`Show more`,sidebarShowLess:`Show less`,sidebarFilterList:`Filter this list`,sidebarSaveFailed:`Could not save the change. Please try again.`,pinWorkspace:`Pin project`,unpinWorkspace:`Unpin project`,markConversationRead:`Mark as read`,markConversationUnread:`Mark as unread`,sidebarState_unread:`Unread conversation`,sidebarActivity:`Activity`,sidebarViewActivity:`View activity`,sidebarViewChats:`View conversations`,sidebarPriority:`Priority`,sidebarActivityEmpty:`Nothing needs attention`,sidebarActivityEmptyHint:`Completed work and conversations needing your attention appear here.`,sidebarMarkAllRead:`Mark all as read`,sidebarClearRead:`Clear read chats from Priority`,sidebarReadFailed:`Could not update read status. Please try again.`,sidebarToday:`Today`,sidebarYesterday:`Yesterday`,sidebarEarlier:`Earlier`,sidebarActivityCompleted:`Completed`,sidebarActivityFailed:`Failed`,sidebarActivityRead:`Read`,modelAdvanced:`Advanced parameters`,providerConnectionHeading:`Provider connection`,providerFetchModels:`Get available models`,providerFetchHint:`Enter the provider and endpoint, then choose models in one step.`,providerPickerTitle:`Choose models to add`,providerPickerAccess:`Connection credentials`,providerPickerKey:`Access key (optional)`,providerPickerKeyHint:`Leave blank to use saved credentials for this endpoint. A key entered here is used for discovery only and is not saved.`,providerPickerSearch:`Search models`,providerPickerSelectAll:`Select all`,providerPickerClear:`Clear selection`,providerPickerLoading:`Reading available models…`,providerPickerAdded:`Added`,providerPickerNoMatch:`No matching models`,providerPickerEmpty:`No models returned. You can still add one manually.`,providerPickerBounded:`Showing the first 500 models. Add other IDs manually.`,providerPickerError_load:`Could not read the model list. Check the endpoint and credentials, then retry or add a model manually.`,providerPickerError_save:`Could not confirm the save. Your selection is kept; check the connection before retrying.`,providerPickerError_conflict:`Configuration changed elsewhere. Close this dialog and reload configuration before saving again.`,providerPickerDefaults:`New models use {{context}} context / {{output}} output tokens. You can adjust these per model after adding.`,providerPickerRetry:`Refresh list`,providerPickerCount:`{{count}} selected · up to 100`,providerPickerSave:`Add selected`,sidebarState_running:`Running`,sidebarState_compacting:`Organizing context`,sidebarState_waiting:`Waiting for your response`,sidebarState_completed:`Completed · unread result`,sidebarState_failed:`Failed · open conversation for details`,pinnedOptions:`Pinned options`,pinConversation:`Pin conversation`,unpinConversation:`Unpin conversation`,pinnedRecentlyUpdated:`Recently updated`,pinnedManualOrder:`Manual order`,movePinUp:`Move up`,movePinDown:`Move down`,pinSaveFailed:`Could not save pinned conversations. Please try again.`,cancel:`Cancel`,chooseWorkspaceHint:`Choose a workspace and describe the work`,close:`Close`,closeSearch:`Close search`,collapseSidebar:`Collapse sidebar`,confirmEdit:`Save and rerun`,editMessageHint:`Rerun from here in a new branch. Keep the original conversation, images and file references. Existing workspace changes are kept.`,regenerateMessage:`Regenerate response`,regenerateMessageHint:`Rerun this question in a new branch, keeping its original attachments and conversation.`,messageRerunStarted:`Rerun admitted in a new branch. The original conversation is kept.`,openOriginalConversation:`View original conversation`,messageRerunWorkspaceHint:`Existing workspace changes are kept.`,modelRequestRecovered:`Request recovered`,modelReconnecting:`Reconnecting`,modelReconnectUnknown:`Reconnection status unconfirmed`,modelEarlierAttempts:`Earlier request errors`,modelFailedAttempts:`Failed attempts ({{count}})`,draftStorageUnavailable:`Draft could not be saved on this device. Keep this page open or copy your message.`,draftStorageInvalid:`Some saved draft content could not be restored. Check your message and attachments.`,draftStorageRetry:`Retry saving draft`,workbarBackToChat:`Back to chat`,workbarCollapseTools:`Collapse tools`,workbarEndTerminal:`Close {{name}} and end its process`,workbarNewTerminal:`New terminal`,workbarContinueInChat:`Continue in chat`,transcriptSearch:`Search message contents`,transcriptSearchPlaceholder:`Search titles, projects, or messages…`,transcriptSearchRecent:`Recent conversations`,transcriptSearchSessions:`Conversations`,transcriptSearchMessages:`Message contents`,transcriptSearchSessionResult:`Open conversation {{session}}`,transcriptSearchSessionOpenFailed:`Could not open this conversation. Try again.`,transcriptSearchIncludeArchived:`Include archived conversations`,transcriptSearching:`Searching messages…`,transcriptSearchEmpty:`No matching messages found.`,transcriptSearchFailed:`Could not search messages. Try again.`,transcriptSearchRetry:`Retry search`,transcriptSearchPartial:`Some history could not be searched. Results may be incomplete.`,transcriptSearchOpenFailed:`This message could not be opened. It may have moved or belong to another branch.`,transcriptSearchResult:`Open message from {{source}} in {{session}}`,transcriptSearchSource_user:`you`,transcriptSearchSource_assistant:`assistant`,transcriptSearchSource_tool_call:`tool call`,transcriptSearchSource_tool_result:`tool output`,connected:`Connected`,connecting:`Connecting`,conversationName:`Conversation name`,conversationOptions:`Conversation options`,sidebarRename:`Rename`,sidebarPin:`Pin`,sidebarUnpin:`Unpin`,sidebarFork:`Fork`,sidebarForkLocal:`Fork chat`,sidebarForkSameWorktree:`Fork in same worktree`,archiveNoticeTitle:`Chat archived`,archiveNoticeView:`View`,archiveNoticeUndo:`Undo`,archiveNoticeFailed:`Could not complete this action. Try again.`,sidebarForkWorktree:`Fork chat in new worktree`,sidebarForkCancelling:`Requesting cancellation…`,sidebarForkFinishing:`Cancellation is no longer available. Confirming the result…`,sidebarForkCancelUnconfirmed:`Cancellation could not be confirmed. Waiting for the fork result.`,sidebarForkWorktreePreserved:`The worktree was kept at {{path}}. Inspect it before retrying.`,sidebarForkWorktreePending:`Creating a worktree and conversation…`,sidebarForkOptionsLoading:`Checking worktree availability…`,sidebarForkOptionsFailed:`Unable to check worktrees. Reopen menu to retry.`,sidebarForkUnavailable:`Send a message before forking this conversation.`,sidebarForkArchived:`Restore this conversation before forking.`,sidebarForkFailed:`Could not create the fork. The original conversation is unchanged.`,sidebarCopy:`Copy`,sidebarCopyLink:`Copy conversation link`,sidebarCopyMarkdown:`Copy as Markdown`,sidebarCopyCwd:`Copy working directory`,sidebarCopied:`Copied`,sidebarCopyFailed:`Could not copy. Try again.`,sidebarNewWindow:`Open in new window`,sidebarOpenIn:`Open in`,sidebarAppsLoading:`Loading available apps…`,sidebarAppsFailed:`Unable to load apps. Reopen menu to retry.`,sidebarOpenFailed:`Unable to open this project in the selected app.`,sidebarArchive:`Archive`,sidebarRestore:`Restore`,sidebarDelete:`Permanently delete`,managedWorktreeRecoveryFull:`Check earlier unfinished removal requests before starting another.`,managedWorktreesChanged:`The worktree list changed. Refresh it before reviewing a target.`,managedWorktreesRefresh:`Refresh worktrees`,managedWorktreesBack:`Back to worktrees`,managedWorktreesRetry:`Retry request`,managedWorktrees:`Retained worktrees`,managedWorktreesDescription:`Worktrees created by OpenPI are kept when a conversation is deleted. Review an exact path before requesting removal. Active, shared, changed or unverified worktrees stay in place.`,managedWorktreeConfirm:`Remove this managed worktree? The server rechecks ownership, active conversations and local changes before removal.`,managedWorktreeRemoved:`Worktree removed.`,managedWorktreePreserved:`Worktree kept:`,managedWorktreeUncertainTerminal:`Removal outcome is uncertain. Automatic removal cannot be repeated. Inspect the retained path before taking further action.`,managedWorktreeUncertain:`Removal outcome is unknown. Retry to check the original request.`,managedWorktreeRemoving:`Checking and removing…`,managedWorktreeRemove:`Remove worktree`,managedWorktreeReview:`Review removal`,managedWorktreesEmpty:`No managed worktrees were found on this page.`,managedWorktreesUnavailable:`{{count}} ownership records could not be verified.`,managedWorktreesLoadFailed:`Could not load retained worktrees. Retry without changing the target.`,managedWorktreesMore:`Load more worktrees`,managedWorktreeRetainedAfterDelete:`Conversation deleted. Worktree kept at {{path}}. Review retained worktrees in the project menu.`,sidebarDeleteTitle:`Delete conversation?`,sidebarDeleteDescription:`Permanently delete “{{name}}”? This cannot be undone.`,sidebarDeleteConfirm:`Delete`,sidebarDeleting:`Deleting…`,sidebarDeleteFailed:`Could not delete this conversation. Retry or cancel.`,sidebarActionRunning:`Let current work and queued messages finish first.`,sidebarActionDisconnected:`Reconnect before changing this conversation.`,sessionDeleteCancelled:`Deletion cancelled`,sessionDeleteUncertain:`Could not confirm whether the conversation was deleted. Refresh and try again.`,sessionDeleted:`Conversation permanently deleted`,sessionDeleteMetadataPending:`The conversation was deleted, but its sidebar records could not be fully cleared.`,sessionLinkUnavailable:`The linked conversation no longer exists or its identity has changed.`,sidebarDropPin:`Drop here to pin`,sidebarDropProjectLast:`Move project to the end`,conversationTurns:`Conversation turns`,conversationTurnPosition:`Go to turn {{position}}`,turnPreviewLoading:`Loading preview…`,turnPreviewUnavailable:`Preview unavailable. Try again.`,commands:`Slash commands`,addContext:`Add context`,fileReference:`Reference workspace file`,fileReferenceTitle:`Reference workspace file`,fileReferenceDetail:`Add a path reference to the prompt without uploading file contents.`,fileReferenceLabel:`Workspace file path`,fileReferencePlaceholder:`src/app.tsx`,fileReferenceValidatedHint:`The current Session verifies that this is a readable workspace file.`,fileReferenceDraftHint:`This path will be resolved by Pi after the new Session starts.`,fileReferenceChecking:`Checking…`,fileReferenceFailed:`Could not verify this file.`,fileReferenceDenied:`Choose a file inside the current Session workspace.`,fileReferenceMissing:`This workspace file no longer exists.`,fileReferenceUnsupported:`Only regular workspace files can be referenced.`,fileReferenceExpired:`The active Session changed. Reopen the file reference and try again.`,fileReferenceBusy:`File validation is busy. Try again shortly.`,insertReference:`Insert reference`,commandsSessionRequired:`Slash commands are available after the Session starts.`,commandsEmptyDraftOnly:`Slash commands can be inserted only into an empty draft.`,commandsLoading:`Loading commands...`,commandsUnavailable:`Commands are temporarily unavailable.`,commandsNoMatch:`No matching commands.`,commandsNoAvailable:`No discovered commands can run in Web. Type a command name to inspect its availability.`,commandsBounded:`{{count}} more commands are not shown.`,commandSessionRequired:`Commands require an active Web session.`,commandUnsupported:`Not adapted · manual commands still reach Pi`,commandAcceptsArguments:`Accepts arguments`,commandSource_extension:`Extension`,commandSource_prompt:`Prompt template`,commandSource_skill:`Skill`,copiedMessage:`Copied`,copyMessage:`Copy message`,copyFailed:`Copy failed. Please select and copy the message manually.`,copiedCode:`Code copied`,copyCode:`Copy code`,copyCodeFailed:`Could not copy this code. Select and copy it manually.`,codeBlock:`Code block`,wrapCode:`Wrap lines`,expandCode:`Show all {{count}} lines`,collapseCode:`Collapse code`,expandInput:`Expand input`,collapseInput:`Collapse input`,deleteWorkspace:`Delete workspace`,describeTask:`Describe a task`,editMessage:`Edit and rerun from here`,enterHint:`Enter to send, Shift+Enter for a new line.`,expandSidebar:`Expand sidebar`,importWorkspace:`Import workspace`,loadingModels:`Loading models...`,modelsTruncated:`Showing {{shown}} models. {{omitted}} more are available; search to find them.`,searchModels:`Search available models`,searchModelsPlaceholder:`Search provider, model name, or ID...`,searchingModels:`Searching models...`,noMatchingModels:`No matching models`,modelSearchFailed:`Could not search models. Try again.`,retryModelSearch:`Retry model search`,fileReferenceDraftChanged:`The draft changed. Reopen the file reference.`,modelSearchTruncated:`{{omitted}} matching models are not shown.`,modelPreparing:`Preparing task...`,modelRetrying:`Retrying model request...`,modelRunning:`Working…`,modelRequestFailed:`Model request failed`,modelRequestStopped:`Model request stopped`,modelFailureUnknown:`The provider did not return an error reason.`,retryPrompt:`Retry prompt`,retryingPrompt:`Retrying...`,newSession:`New session`,noConversations:`No conversations yet`,noMatching:`No matching conversations`,noMatchingLoaded:`No matching conversations in the loaded history`,noModels:`No models available`,noOutput:`no output`,noSessions:`No sessions`,openSidebar:`Open sidebar`,promptMessage:`Send a message or start a task, / for commands`,promptReadonly:`A non-active session cannot receive prompts`,promptStart:`Choose a workspace to begin.`,promptTask:`Describe what you want to build.`,queuedHint:`The message will be queued after the current turn.`,reconnecting:`Reconnecting`,removeWorkspace:`Remove from sidebar`,workspaceOptions:`Workspace options`,renameFailed:`Could not save the name. Your changes were kept.`,savingName:`Saving...`,workspaceRemoveFailed:`Could not remove the workspace. Try again.`,removingWorkspace:`Removing...`,renameConversation:`Rename conversation`,renameWorkspace:`Rename workspace`,save:`Save`,searchConversations:`Search conversations`,searchPlaceholder:`Filter titles and workspaces…`,selectModel:`Select model`,configureModels:`Configure models`,openModelSettings:`Model settings`,selectThinking:`Select thinking level`,thinkingAvailableLevels:`Available: {{levels}}`,resetThinking:`Restore the opening level ({{level}})`,modelThinkingNotEnabled:`Thinking is not enabled for this model. Enable reasoning support in model settings if your provider supports it.`,providerReasoningHint:`Enable only if the provider supports reasoning. Adjust the active level in the composer.`,providerThinkingLevels:`Supported thinking levels`,providerThinkingLevelsHint:`Choose the levels this model supports. Saving updates the conversation picker.`,providerThinkingAutomatic:`Automatic (Pi defaults)`,providerThinkingSelected_one:`{{count}} level selected`,providerThinkingSelected_other:`{{count}} levels selected`,providerThinkingReset:`Use Pi defaults`,providerImageHint:`When Image is unchecked, the model will not receive image attachments.`,selectWorkspace:`Select workspace`,send:`Send`,processDetails:`Execution details`,processRunning:`Working`,processThinkingCount_one:`{{count}} reasoning note`,processThinkingCount_other:`{{count}} reasoning notes`,processToolCount_one:`{{count}} tool call`,processToolCount_other:`{{count}} tool calls`,processFailureCount_one:`{{count}} failed`,processFailureCount_other:`{{count}} failed`,runtimeActivities:`Activity`,activityAgentProgress:`{{completed}}/{{total}} agents finished`,activityCapacity:`Concurrent tasks: {{running}}/{{limit}} · {{queued}} waiting`,composerQueuedCount:`Queued {{count}}`,composerSteeringCount:`Steering {{count}}`,runtimeActivityRunning_one:`{{count}} running`,runtimeActivityRunning_other:`{{count}} running`,runtimeActivityCount_one:`{{count}} activity`,runtimeActivityCount_other:`{{count}} activities`,processActivityCount_one:`{{count}} agent activity`,processActivityCount_other:`{{count}} agent activities`,switchingSession:`Switching session...`,thinkingActive:`Thinking...`,thinkingActiveLevel:`Thinking ({{level}})...`,thinkingDone:`Thinking`,thinkingLoadFull:`Load full thinking`,thinkingLoadingFull:`Loading thinking…`,thinkingLoadFailed:`Unable to load thinking. Retry`,thinkingPartialText:`Showing part of the saved thinking. More text can be loaded below.`,thinkingPreviewOnly:`Thinking preview reached its limit. The full saved text will be available when this message finishes.`,toolState_running:`Running`,toolState_returned:`Returned`,toolState_failed:`Failed`,toolState_cancelled:`Stopped`,toolState_timed_out:`Timed out`,toolState_unknown:`Unconfirmed`,toolSnapshotMissingResult:`No result at fork`,toolActivity_running:`{{action}}…`,toolActivity_failed:`{{action}} failed`,toolActivity_cancelled:`{{action}} stopped`,toolActivity_timed_out:`{{action}} timed out`,toolActivity_unknown:`{{action}}`,toolAction_read:`Read`,toolAction_write:`Write file`,toolAction_edit:`Edit file`,toolAction_command:`Run command`,toolAction_search:`Search`,toolAction_list:`List files`,toolAction_web:`Browse web`,toolAction_agent:`Agent activity`,subagentAction_spawn:`Start subagent`,subagentAction_send:`Send follow-up`,subagentAction_check:`Check subagent`,subagentAction_wait:`Wait for subagent`,subagentAction_cancel:`Stop subagent`,subagentActionDone_spawn:`Started subagent`,subagentActionDone_send:`Sent follow-up`,subagentActionDone_check:`Checked subagent`,subagentActionDone_wait:`Finished waiting`,subagentActionDone_cancel:`Stop request returned`,toolAction_workflow:`Workflow`,toolAction_plan:`Prepare plan`,toolAction_git:`Review changes`,toolAction_call:`Use tool`,toolActionDone_read:`Read`,toolActionDone_write:`Wrote file`,toolActionDone_edit:`Edited`,toolActionDone_command:`Ran command`,toolActionDone_search:`Searched`,toolActionDone_list:`Listed files`,toolActionDone_web:`Browsed web`,toolActionDone_agent:`Agent activity returned`,toolActionDone_workflow:`Workflow tool returned`,toolActionDone_plan:`Plan tool returned`,toolActionDone_git:`Reviewed changes`,toolActionDone_call:`Used tool`,toolActionGroup_read:`read files`,toolActionGroup_write:`write files`,toolActionGroup_edit:`edit files`,toolActionGroup_command:`run commands`,toolActionGroup_search:`search`,toolActionGroup_list:`list files`,toolActionGroup_web:`browse web`,toolActionGroup_agent:`agent activity`,toolActionGroup_workflow:`workflow activity`,toolActionGroup_plan:`planning`,toolActionGroup_git:`review changes`,toolActionGroup_call:`use tools`,toolGroup_done:`Activity · {{actions}}`,toolGroup_running:`Working · {{actions}}`,toolGroup_unknown:`Activity · {{actions}}`,toolGroupSeparator:`, `,toolSearchTarget:`“{{pattern}}” · {{path}}`,toolDiffStatsHelp:`Added and removed lines in the displayed diff`,toolRequestedFile:`File:`,toolWorkspace:`Workspace`,toolRawEvidence:`Arguments and original result`,toolCodemodeDetails:`Script and original result`,toolNestedOutputMissing:`This session records the call and its status, but not the nested tool output.`,toolNestedArgumentsMissing:`This session omits the full arguments and nested tool output.`,toolNestedIncomplete:`The nested-call record is incomplete; some calls, arguments or final states are unavailable.`,toolPartialEvidence:`Partial output: a byte, line or item limit was reached. The original result may also be truncated.`,toolFileChange_created:`File created`,toolFileChange_unchanged:`No content changes`,toolFileChange_overwritten:`File overwritten`,toolChangeUnavailable:`This result does not include a change comparison.`,toolTestResults:`Reported test results · {{format}}`,toolTestCounts:`{{tests}} tests · {{passed}} passed · {{failed}} failed · {{cancelled}} cancelled`,toolTestCountsHelp:`Counts come from command output. The execution status is shown separately.`,toolReadMore:`Read another range using the path and offset. The original result contains continuation details.`,toolFullOutputReference:`Full output:`,subagentBackgroundResult_one:`Background subagent result · {{count}}`,subagentBackgroundResult_other:`Background subagent results · {{count}}`,thinkingDraftHint:`Choose a workspace and create a session first.`,thinkingInactiveHint:`Only the active session can change its thinking level.`,thinkingLevelMismatch:`The confirmed thinking level is not offered by the current model. Choosing another level will correct it.`,thinkingLockedRunning:`Stop the current turn before changing the thinking level.`,thinkingModelPendingHint:`Wait for the model change to finish.`,thinkingNotConfirmed:`Thinking level was not confirmed. Please try again.`,thinkingPendingHint:`Applying the thinking level...`,thinkingUnsupported:`Thinking is unavailable`,thinkingUnsupportedHint:`No model is selected, or the current model does not support thinking.`,unavailable:`Unavailable`,ungrouped:`Ungrouped`,untitledSession:`New session`,workspaceDeleteConfirm:`The folder and conversation records will be kept. Its conversations will move to Ungrouped.`,workspaceName:`Workspace name`,workspaces:`Workspaces`,sidebarProjects:`Projects`}},zh:{translation:{quitOpenPI:`退出 OpenPI`,quittingOpenPI:`正在退出…`,quitConfirmHelp:`确定退出此 OpenPI Web 应用吗?此 Web 应用中所有正在运行的任务都会停止,对话会保存,重启后可继续查看。`,quitTabHelp:`仅关闭浏览器标签页会让 OpenPI 和任务继续在后台运行。`,quitAccepted:`OpenPI 正在关闭`,quitAcceptedHelp:`退出请求已接受。请等待终端确认 OpenPI 已停止,然后可以关闭此标签页。`,quitRestartHelp:`重新启动:在终端运行 openpi web,或在 Pi 中运行 /web,然后打开显示的地址。刷新此页面不会重启 OpenPI。`,quitFailed:`无法确认是否已关闭。请先检查终端,再重试。也可以在 OpenPI 所在终端按 Ctrl+C 停止应用。`,promptPending:`正在处理请求…`,commandFeedbackTruncated:`这里只显示部分命令结果。请缩小查询范围,或在 TUI 查看完整输出。`,planMode_inactive:`普通模式`,planMode_planning:`规划中 · 禁止写入`,planMode_ready:`计划就绪 · 等待审阅`,planMode_invalid:`计划状态异常 · 禁止写入`,planModeEnter:`进入规划`,promptPlanMessage:`本次对话使用 Plan 模式 · 继续讨论计划,暂不实施`,planModeUnconfirmed:`暂时无法确认 Plan 状态,请刷新后再继续。`,planModeExit:`退出规划`,planModeImplement:`准备实施提示`,planImplementationReplaceDraft:`准备实施会替换当前草稿并关闭规划模式,但不会发送提示词。是否继续?`,commandSupport_plan:`支持规划和准备当前会话的实施提示;新建实施会话仍需使用 TUI。`,commandSupport_setup:`通过当前模型配置,在 Web 回答问题。`,handoffWaiting:`需要你操作`,handoffDone:`已完成`,handoffUnable:`无法完成`,handoffDoneHelp:`已执行操作,接下来由模型验证结果。`,handoffUnableHelp:`未能完成,可以补充遇到的障碍。`,handoffReview:`复核状态`,handoffSubmit:`提交状态`,handoffSignal:`预期结果:`,handoffVerify:`提交完成后,模型仍需验证结果;你的反馈本身不代表验证成功。`,planCardLabel:`开发计划`,planCardReady:`计划已就绪`,planCardResult:`计划结果`,planCardNotApproval:`此步骤仅生成计划,不代表已批准或开始实施。`,planCardCollapse:`收起`,planCardExpand:`展开`,planCardCopy:`复制计划`,planCardCopyPreview:`复制可见预览`,planCardTruncated:`当前仅显示截断预览。`,planCardLoadFull:`加载完整计划`,planCardLoadingFull:`正在加载计划...`,planCardLoadFailed:`无法加载完整计划,重试`,planCardEvidence:`工具结果 · plan_ready`,questionWaiting:`问题`,questionPreview:`查看预览`,questionSkip:`跳过`,questionProgress:`{{current}} / {{total}}`,questionReview:`复核答案`,questionReviewTitle:`确认这些选择?`,questionReviewHelp:`可以返回修改,点击提交后才会发送给助手。`,questionEdit:`修改答案:{{question}}`,questionDismiss:`关闭提问,不提交答案`,questionCustom:`或自行撰写回复`,questionCustomHelp:`留空提交,表示希望助手把问题说清楚或拆小。`,questionYourAnswer:`你的答案`,questionCustomPlaceholder:`说说你的想法…`,questionNotes:`补充说明(选填)`,questionNotesPlaceholder:`补充限制条件,或解释你的选择…`,questionRephrase:`请助手把问题说清楚或拆小`,questionBack:`上一步`,questionNext:`下一题`,questionSubmit:`提交答案`,questionSubmitting:`正在提交…`,questionRetry:`核对提交结果`,questionUncertain:`暂时无法确认是否送达,已保留本次提交的答案。点击核对可恢复结果,不会重复提交。`,questionDisconnected:`正在重新连接… 已保留你的选择,暂时无法提交。`,questionLimit:`每项答案或补充说明不能超过 {{count}} 个 UTF-8 字节。`,questionLoadFailed:`暂时无法读取等待回答的问题。`,questionDraftLimit:`提问草稿已达上限,请缩短或清空已有答案后再添加内容。`,questionRetryLoad:`重试`,questionCloseReceipt:`关闭问答状态提示`,questionState_dismissed:`已关闭提问,没有提交答案。`,questionState_cancelled:`提问已取消,没有提交答案。`,questionState_expired:`提问已过期,没有提交答案。`,questionState_stale:`该提问已失效,请查看对话中的处理结果。`,conversationView:`会话视图`,jumpToLatest:`跳至最新`,historyLoading:`正在加载历史…`,historyOmitted:`还有 {{count}} 条较早记录 · 向上滚动自动加载`,historyChanged:`会话分支已更改,已切换到当前分支的历史。`,historyUnavailable:`历史记录加载失败,请重试。`,historyValidationUnavailable:`无法校验会话历史,请重试。`,historyVerifying:`正在校验会话历史…`,messageLoadFull:`加载完整消息`,messageLoadMore:`加载更多`,messageLoadingFull:`正在加载消息…`,messageLoadFailed:`无法加载这条消息,重试`,filePreview:`文件预览`,changeEvidence:`变更`,changeEvidenceScope:`按所选范围查看当前工作目录的只读 Git 变更。`,turnLabel:`第 {{number}} 轮`,turnState_running:`运行中`,turnState_complete:`已完成`,turnState_failed:`失败`,turnState_interrupted:`已中断`,turnState_waiting:`等待回复`,turnState_forked:`已分叉,可继续对话`,turnChanges:`本轮更改 {{count}} 个文件`,turnChangesPartial:`本轮已记录 {{count}} 个文件`,turnChangesIncomplete:`这一轮的变更记录不完整。`,turnChangesMore:`再显示 {{count}} 个文件`,turnChangesLess:`收起文件`,turnChangesReview:`审阅本轮变更`,turnChangesReviewButton:`审阅`,turnChangesBack:`返回本轮变更`,turnChangesLoading:`正在加载本轮变更…`,turnChangesUnavailable:`无法读取本轮保存的差异。`,messageCopyRequiresFull:`加载完整消息后才能复制。`,filesChanged:`{{count}} 个文件已更改`,reviewChanges:`查看变更`,workspaceChanges:`工作区更改`,overviewChanges:`变更`,overviewLineTotals:`当前 Git 比较范围内的文本新增与删除行数`,overviewPartialTotals:`仅展示已核实的行数,部分文件尚无法统计。点击变更查看详情。`,overviewCounting:`统计中…`,overviewCountsUnknown:`行数未知`,overviewReviewUnavailable:`暂不可用`,sessionSources:`来源`,sourcesAdd:`添加来源`,sourcesDescription:`查看此对话附加的图片与文件`,sourceAttached:`已附加到对话`,sourcesEmpty:`暂无来源`,sourcesFailed:`来源加载失败。`,sourcesViewAll:`查看全部`,sourcesLoadMore:`加载更多来源`,sourcesBack:`返回来源列表`,sourcesPartial:`已达到列表展示上限,更早的来源仍可在对话中查看。`,turnChangesScope:`该轮开始至结束的工作区差异 · 已保存`,turnEdits:`已编辑 {{count}} 个文件`,turnEditsPartial:`已记录 {{count}} 个文件的编辑`,turnEditsScope:`本轮文件工具写入记录 · 已保存;不含命令行与外部修改`,turnEditStatsUnknown:`行数未知`,turnEditReason_before_unavailable:`文件已写入,但该操作未授权读取旧内容,无法提供可靠的前后差异。`,turnEditReason_content_limit:`文件已写入,内容超过已保存对比的大小限制,无法提供准确行数。`,turnEditReason_concurrent_change:`文件在已记录的操作之间发生了变化,无法确认本轮净增删行数。`,gitReviewLoadedCount:`已载入 {{count}} 个文件`,gitReviewPartialLabel:`部分`,gitReviewSearch:`搜索文件路径`,gitReviewExpand:`展开审阅`,gitReviewSearchLoaded:`搜索已载入文件`,gitReviewMarkViewed:`标记 {{path}} 为已查看`,gitReviewMarkCurrentViewed:`标记当前文件 {{path}} 为已查看`,gitReviewViewedLabel:`已查看`,gitReviewViewedProgress:`已查看 {{viewed}} / 已加载 {{loaded}} 个文件`,gitReviewViewedLimit:`本次对比最多保留 {{count}} 个已查看标记。`,gitReviewNoMatch:`没有匹配的文件。`,gitReviewNoLoadedMatch:`已载入文件中没有匹配项。`,gitReviewLoadNext:`载入下一批文件`,gitReviewChanged:`工作区已有变化,请刷新清单后继续载入。`,gitReviewNewVersion:`有新的更改,当前仍显示你正在阅读的版本。`,gitReviewShowLatest:`查看最新差异`,gitReviewBinary:`此二进制文件无法显示文本差异。`,gitReviewBinaryShort:`二进制`,gitReviewPendingStats:`待读取`,gitReviewComparison:`{{current}} 对比 {{base}}`,gitReviewWorkingTree:`工作区对比 HEAD`,gitReviewSessionSnapshot:`自本会话开始后的变更`,gitReviewDetached:`游离 HEAD`,gitReviewLoading:`正在读取 Git 变更…`,gitReviewRetry:`重试`,gitReviewRefresh:`刷新变更`,gitReviewOlderResult:`当前显示上一次读取结果。`,gitReviewNotRepository:`此工作区不是 Git 仓库。`,gitReviewUnborn:`此仓库还没有可读取的 HEAD。`,gitReviewFailed:`无法读取 Git 变更。`,gitReviewTruncated:`结果不完整,部分文件或差异未载入。`,gitReviewEmpty:`当前范围内没有文件变更。`,gitReviewHiddenLines:`另有 {{count}} 行 diff 未显示。`,gitReviewDiffTruncated:`快照已达到大小上限,未加载此文件的 diff。`,gitReviewShowMore:`再显示 {{count}} 个文件`,gitReviewBackToFiles:`返回变更文件`,gitReviewFilePreview:`{{file}} 的差异`,gitReviewNoDiff:`此文件没有可显示的文本差异。`,changeDiff:`变更差异`,diffViewMode:`差异视图`,diffUnified:`统一`,diffSplit:`并排`,diffBefore:`修改前`,diffAfter:`修改后`,diffView:`差异`,gitFileStatus_added:`已新增`,gitFileStatus_modified:`已修改`,gitFileStatus_deleted:`已删除`,gitFileStatus_renamed:`已重命名`,gitFileStatus_copied:`已复制`,gitFileStatus_untracked:`未跟踪`,gitFileStatus_unknown:`已变更`,closePreview:`关闭预览`,imageZoom:`图片缩放`,imageZoomHelp:`缩放相对于适应窗口。Ctrl + 滚轮缩放,放大后可拖动查看。`,zoomIn:`放大图片`,zoomOut:`缩小图片`,previousImage:`上一张图片`,nextImage:`下一张图片`,imagePosition:`第 {{current}} 张,共 {{total}} 张图片`,artifactReadOnly:`只读`,artifactReferenceUnavailable:`此视图无法打开文件预览:{{path}}`,artifactSession:`所属会话 {{sessionId}}`,copyFilePath:`复制文件路径`,filePathCopied:`已复制文件路径`,refreshFile:`刷新文件`,downloadFile:`下载文件`,downloadingFile:`正在下载…`,artifactOlderPreview:`当前显示旧版预览。`,readingFile:`正在读取文件…`,artifactVersion:`版本`,artifactBytes:`{{count}} 字节`,artifactPreviewTruncated:`预览已截断;下载文件可获取完整内容。`,artifactUnsupported:`此类型无法预览,请下载文件。`,filesLargeMarkdownSource:`Markdown 预览较大,已显示为源码以保持滚动流畅。已加载的文字全部保留。`,chatView:`对话`,trajectory:`执行轨迹`,trajectoryScope:`按记录顺序展示会话消息,不表示执行耗时,也不是完整模型请求。`,trajectoryRunning:`任务仍在进行。已保存记录到达后自动更新;实时生成内容可在“对话”中查看。`,trajectoryTruncated:`当前历史不完整:省略 {{entries}} 条记录、{{parts}} 个内容片段,{{messages}} 条消息被截断。`,trajectoryEmpty:`尚无已保存记录。`,trajectoryOrder:`记录顺序`,trajectoryOverview:`总览`,trajectorySequenceHint:`按记录顺序排列 · 宽度不表示执行耗时`,trajectoryClearRange:`清除选区`,trajectoryContextLane:`上下文`,trajectoryModelLane:`模型`,trajectoryToolLane:`工具`,trajectorySelectRecord:`选择记录 {{number}}:{{name}}`,trajectoryTimingTab:`时间`,trajectoryUsageTab:`用量`,trajectoryDurationLabel:`耗时`,trajectoryTimingSource:`数据来源`,trajectoryTimingUnknown:`尚未记录执行耗时。保存时间不等于操作开始时间。`,trajectoryTimingNative:`Pi 嵌套工具执行记录`,trajectoryTTFT:`首段输出等待`,trajectoryGenerationTime:`生成时间`,trajectoryThroughput:`每秒输出 tokens`,trajectoryNotRecorded:`未记录`,trajectoryUsageUnknown:`已加载记录中没有此响应的 token 用量。`,trajectoryUsage_input:`未缓存输入`,trajectoryUsage_cacheRead:`缓存读取`,trajectoryUsage_cacheWrite:`缓存写入`,trajectoryUsage_output:`输出`,trajectoryProvider:`提供商`,trajectoryModel:`模型`,trajectoryCode:`代码`,trajectoryWrap:`自动换行`,trajectoryCopy:`复制原文`,trajectoryCopied:`已复制`,trajectoryRawArguments:`原始 JSON`,trajectoryFoldTurns:`回合`,trajectoryFoldCalls:`工具调用`,trajectoryMetrics:`已加载执行摘要`,trajectoryRequestCount:`{{count}} 次模型响应`,trajectoryToolCount:`{{count}} 次工具调用`,trajectoryModelResponses:`模型响应`,trajectoryToolCalls:`工具调用`,trajectoryLastTurn:`最近已记录回合`,trajectoryEventColumn:`事件`,trajectoryContentColumn:`内容`,trajectoryTurn:`回合 {{number}}`,trajectoryLoadHistory:`加载更早历史`,trajectoryLatestRecords:`回到最新记录`,trajectoryHistoryLoading:`正在加载历史…`,trajectoryNestedOutputMissing:`Pi 已记录此嵌套调用的状态,但未保存其结果正文。外层脚本输出单独保留。`,trajectoryRecordCount:`{{count}} 条记录`,trajectoryMatches:`{{count}} 条匹配`,trajectorySearch:`搜索已加载记录`,trajectoryNoMatches:`没有匹配的记录。`,trajectoryEarlierGroup:`较早上下文`,trajectoryEventCount:`{{count}} 条会话变更`,trajectorySummary:`概览`,trajectoryInputTab:`输入`,trajectoryResultTab:`结果`,trajectoryConversationGroup:`本轮对话`,trajectoryReasoningTitle:`思考`,trajectoryRecordNumber:`记录 {{number}}`,trajectoryRecordInfo:`记录信息`,trajectoryRecordId:`记录 ID`,trajectoryCallId:`工具调用 ID`,trajectoryEventType:`事件类型`,trajectoryEvent_model_change:`切换模型`,trajectoryEvent_thinking_level_change:`调整思考级别`,trajectoryEvent_compaction:`压缩上下文`,trajectoryEvent_session_info:`更新会话信息`,trajectoryEvent_custom:`会话记录`,trajectoryEarlier:`显示更早记录(已加载历史中还有 {{count}} 条)`,trajectoryDetails:`记录详情`,trajectoryRecordedAt:`记录时间`,trajectoryEvidenceTruncated:`此证据在会话投影中已被截断。`,trajectoryArguments:`工具参数`,trajectoryRecordedContent:`已记录内容`,trajectoryThinking:`模型返回的推理内容`,trajectoryOutput:`工具结果`,trajectoryMissingResult:`当前记录中没有可明确配对的结果。这不表示工具仍在运行。`,trajectoryStructured:`结构化结果`,trajectoryEventOnly:`当前仅提供此事件的类型和记录时间。`,trajectory_user:`用户消息`,trajectory_assistant:`助手回复`,trajectory_call:`工具调用`,trajectory_result:`未配对结果`,trajectory_event:`会话事件`,trajectoryRole_user:`用户`,trajectoryRole_assistant:`助手`,trajectoryRole_call:`工具`,trajectoryRole_result:`结果`,trajectoryRole_event:`事件`,trajectory_returned:`工具已返回结果。`,trajectory_error:`工具返回错误`,trajectory_unknown:`尚无法确定结果`,runtimeStatus:`运行状态`,runtimeIdentity:`OpenPI 运行信息`,runtimeIdentityHint:`后端信息在启动时采样,不随之后的磁盘改动或会话重新加载更新,也不证明所有模块的加载版本。前端标识对应当前页面构建。`,runtimeIdentityFailed:`无法读取后端运行信息,请重试。`,runtimeBackendVersion:`后端包版本`,runtimePackageRoot:`后端包目录`,runtimeStartedAt:`进程启动时间`,runtimeGitRevision:`启动时 Git 提交`,runtimeGitState:`启动时工作区状态`,runtimeGitDirty:`存在本地改动`,runtimeGitClean:`干净`,runtimeFrontendVersion:`页面包版本`,runtimeFrontendBuild:`页面构建标识`,runtimeStartupBuild:`后端启动时记录的页面构建标识`,runtimeDevelopmentBuild:`开发服务器(无生产构建标识)`,runtimeBuildMismatch:`当前页面构建与后端启动时记录的构建不同。请刷新页面或重启服务后重新检查。`,refreshStatus:`刷新状态`,openTools:`打开工具`,openToolsUnavailable:`选择会话后可打开工具`,sideConversation:`侧边对话`,sideConversationDescription:`在独立 Pi 会话中追问具体问题,不打断当前主任务。`,workbarChangesDescription:`查看当前目录的未暂存、已暂存、分支或会话变更。`,terminal:`终端`,renameTerminal:`重命名终端`,terminalName:`终端名称`,workbarTerminalDescription:`打开当前工作区的交互式终端。`,restartTerminal:`重新启动终端`,reconnectTerminal:`重新连接终端`,restartTerminalTitle:`重新启动此终端?`,restartTerminalDetail:`当前终端会被关闭,其中运行的进程可能被中断。`,terminalReconnecting:`正在重新连接终端...`,terminalScrollToBottom:`回到底部`,terminalOutputResynced:`终端输出已重新同步`,terminalRestarting:`正在重新启动终端...`,terminalConnecting:`正在启动终端…`,terminalExited:`终端已退出。`,terminalExitCode:`终端已退出,状态码 {{code}}。`,terminalDisconnected:`终端连接意外中断。`,terminalError:`终端不可用。`,terminalLoadError:`终端界面加载失败,请刷新页面后重试。`,reloadPage:`刷新页面`,browser:`浏览器`,sessionFileRecords:`本会话文件记录`,gitReviewSource:`变更范围`,gitReviewBaseBranch:`对比分支`,gitReviewChooseBase:`选择对比分支`,gitReviewSearchBranches:`搜索分支`,gitReviewLocalBranch:`本地分支`,gitReviewRemoteBranch:`远程分支`,gitReviewBranchesTruncated:`显示有数量限制的分支列表,部分分支已省略。`,gitReviewNoMatchingBranches:`没有匹配的分支。`,gitReviewBaseUnavailable:`没有可用的默认对比分支。请选择分支以审阅已提交的变更。`,gitReviewBaseInvalid:`所选对比分支已不可用,请选择其他分支。`,gitReviewUnstaged:`未暂存(含未跟踪)`,gitReviewStaged:`已暂存变更`,gitReviewBranch:`分支变更`,gitReviewFileMissing:`此文件在当前范围内已无变更,请刷新文件列表。`,artifactExternalAccess:`此文件位于其他工作目录。可为当前会话授权只读打开这一个文件,不会开放其他文件的访问。`,artifactAuthorizeFile:`只读打开此文件`,sideConversationPending:`正在准备侧边会话…`,resizeSidebar:`调整侧边栏宽度`,resizePanes:`调整面板宽度`,resizeWorkbar:`调整工具栏宽度`,browserPasteTooLarge:`每次最多粘贴 {{count}} 个字符。`,browserInputTooLarge:`每次最多输入 {{count}} 个字符。`,browserInputTargetChanged:`输入目标已变化或无法确认,有输入操作未执行。`,workbarBrowserDescription:`在 OpenPI 工作栏内打开并操作网页。`,browserReady:`输入地址开始浏览`,browserStarting:`正在启动内嵌浏览器…`,browserOpened:`已在内嵌浏览器中打开`,browserOpenAgain:`再次打开`,browserOpenFailed:`内嵌浏览器暂不可用。`,browserBack:`后退`,browserForward:`前进`,browserReload:`重新加载`,browserTabs:`网页标签页`,browserNewTab:`新标签页`,browserAddTab:`新建网页标签页`,browserCloseTab:`关闭 {{title}}`,browserTabLimit:`最多打开 {{count}} 个网页标签页`,browserPageTitle:`网页:{{address}}`,browserEnteredAddress:`最近从此地址栏打开的地址`,browserAddressNotAllowed:`请输入不含用户名或密码、且不属于 OpenPI 自身地址的 HTTP(S) 网址。`,browserLocationUnknown:`网页已跳转,新地址无法读取。重新加载会返回你输入的地址。`,browserDirectDescription:`直接浏览网页。不允许嵌入的网站可在外部浏览器打开。`,browserDirectHint:`地址栏仅记录手动打开的地址。网页弹窗在外部浏览器打开;遇到空白页,可点击外部打开。`,browserEnhancedHint:`浏览增强已开启:地址自动同步,普通弹窗链接在内部标签页打开。部分站点限制、登录弹窗和跨站历史仍需外部浏览器。`,files:`文件`,filesExplorer:`工作区文件`,filesSearch:`筛选文件…`,refreshFiles:`刷新文件`,filesWorkspaceActions:`工作区文件操作`,filesCreateMenu:`新建`,filesImportMenu:`导入`,filesMoreMenu:`更多`,filesNewFile:`新建文件`,filesNewDirectory:`新建文件夹`,filesImport:`导入文件`,filesImportFolder:`导入文件夹`,filesImportFolderChoose:`选择要导入的文件夹`,filesImportFolderLimit:`每次最多导入 2,000 个文件和文件夹,目录层级最多 64 层。`,filesSelectMultiple:`多选文件`,filesSelectItem:`选择 {{name}}`,filesSelectedCount:`已选 {{count}} 项`,filesRename:`重命名`,filesNewName:`新名称`,filesMove:`移动`,filesMoveDestination:`目标文件夹(工作区内相对路径)`,filesTrashAction:`移入回收站`,filesTrash:`工作区回收站`,filesTrashDetail:`移除的文件保留在当前工作区,可恢复;不会覆盖同名文件。`,filesTrashEmpty:`暂无已移除文件`,filesTrashUnavailable:`{{count}} 项记录无法核验,内容仍保留在 .openpi-trash 中,暂不能自动恢复。`,filesRestore:`恢复`,filesRestoreItem:`恢复 {{name}}`,filesUndoTrash:`撤销移除`,filesOrganizationResults:`文件操作结果`,filesOperationDone:`完成`,filesRefreshBeforeOrganizing:`请先刷新文件树,再整理这项文件。`,filesImportChoose:`选择要导入的文件`,filesTargetDirectory:`目标目录`,filesWorkspaceRoot:`工作区根目录`,filesFileName:`文件名称`,filesDirectoryName:`文件夹名称`,filesCreate:`创建`,filesCreating:`创建中…`,filesCreated:`已创建:{{path}}`,filesNameInvalid:`请输入单个文件或文件夹名称,不要包含路径分隔符。`,filesNameExists:`此名称已存在,请更换名称;原有文件已保留。`,filesMutationFailed:`写入失败,输入已保留。`,filesWriteUnavailable:`请先切换到此会话,再修改工作区文件。`,filesImportLimit:`每个文件最多 50 MiB,同名文件不会覆盖。`,filesImportTooLarge:`此文件超过 50 MiB 导入上限。`,filesImportDirectoryUnsupported:`不支持导入整个文件夹,请选择其中的文件。`,filesImportResults:`文件导入结果`,filesImportPending:`等待导入`,filesImporting:`导入中…`,filesImported:`已保存到工作区`,filesImportedNoPreview:`已保存。预览上限为 20 MiB;可复制路径,在对话中引用此文件。`,filesClearImported:`清除已完成的导入`,filesRetryImport:`重试导入`,filesPathActions:`{{name}} 的路径操作`,filesCopyRelativePath:`复制相对路径`,filesCopyAbsolutePath:`复制绝对路径`,filesPathCopied:`已复制路径:{{path}}`,filesReadFailed:`无法读取文件。`,filesRetryRead:`重试读取`,filesErrorDetails:`错误详情`,filesReadFailedDetail:`文件列表未能加载,请检查连接后重试。`,filesReadDenied:`当前会话的工作区暂不可访问,或无法确认目录身份。请确认会话与工作区后重试。`,filesSymlink:`符号链接,文件浏览器不会自动跟随`,filesTruncated:`结果不完整,请缩小搜索范围。`,filesNoMatches:`没有匹配的文件`,filesEmpty:`此文件夹为空`,filesChoose:`选择文件进行预览`,filesChooseDetail:`从右侧浏览工作区文件,在这里直接预览。`,filesHideTree:`收起文件树`,filesShowTree:`显示文件树`,filesPreview:`预览`,filesSource:`查看源代码`,filesEdit:`编辑`,filesMode:`文件视图`,filesEditor:`文件编辑器`,filesSave:`保存文件`,filesSaving:`保存中…`,filesSaved:`已保存`,filesUnsaved:`未保存的修改 · 草稿保留在当前窗口`,filesDiscard:`放弃草稿`,filesDiscardConfirm:`放弃此文件尚未保存的修改?`,filesSaveConflict:`磁盘上的文件已改变,编辑草稿已保留。请刷新查看最新内容,核对修改后再保存。`,filesSaveFailed:`保存失败,编辑草稿已保留。请检查文件后重试。`,filesEditLoadFirst:`请先继续读取完整文件,再编辑。`,filesEditUnavailable:`支持编辑工作区内不超过 1 MiB 的 UTF-8 文本,最多保留 16 份未保存草稿。`,filesOutline:`章节目录`,filesDiskVersion:`查看当前磁盘版本`,filesReconcile:`已核对,保留草稿并基于此版本继续编辑`,filesTable:`表格预览`,filesRow:`行`,filesSheets:`工作表`,filesTableTruncated:`当前仅显示部分表格内容;下载原文件可查看完整内容。`,filesOfficeLayout:`文档内容预览;分页和排版可能与 Office 不同。`,filesSlidesLayout:`幻灯片文字与图片预览;主题、图表和动画可能与 PowerPoint 不同。`,filesPreviousPage:`上一页`,filesNextPage:`下一页`,filesZoomOut:`缩小`,filesZoomIn:`放大`,filesZoomReset:`重置缩放`,filesPdfPage:`第 {{page}} 页`,filesDocumentLimit:`此文档超出预览处理范围,请下载后在本地打开。`,filesPreviewFailed:`无法预览此文件,仍可下载后打开。`,filesDiagram:`Mermaid 图表`,filesDiagramLoadError:`图表预览加载失败,已显示源码。刷新页面后可重试。`,filesExpandDiagram:`放大图表`,filesFitImage:`适应宽度`,filesOriginalImage:`原始尺寸`,filesLoadMore:`加载更多`,filesLoaded:`已加载 {{count}} 项`,filesReadMore:`继续读取`,filesContentChanged:`文件已更新。当前阅读内容已保留,可在准备好后刷新。`,workbarFilesDescription:`浏览工作区文件,在文件树旁直接预览。`,backToSideConversations:`返回侧边对话`,continueSideConversation:`继续追问…`,startSideConversation:`提出一个侧边问题…`,sideConversationModelInherited:`新侧边对话使用主会话的模型与思考等级。`,sideConversationModelFixed:`这是当前侧边对话使用的模型。`,stop:`停止`,start:`开始`,browserAddress:`浏览器地址`,browserGo:`打开地址`,openExternalBrowser:`在外部浏览器打开`,invalidBrowserAddress:`请输入有效的 HTTP 或 HTTPS 地址。`,addImages:`添加图片`,addFiles:`添加文件`,fileAttachments:`文件附件`,previewFileAttachment:`预览文件`,fileAttachmentDescription:`文档、表格、PDF、文本、代码及其他文件`,fileAttachmentCount:`最多可添加 {{count}} 个附件。`,fileAttachmentTooLarge:`文件总大小不能超过 50 MB。`,fileAttachmentReadFailed:`无法读取此文件,请检查格式或是否有密码保护。`,fileAttachmentTextReady:`文本已就绪`,fileAttachmentTextTruncated:`部分文本 · 保留原文件`,fileAttachmentOriginalReady:`原文件已就绪`,fileAttachmentExtractionFailed:`未提取文本 · 原文件保留`,fileAttachmentEncodingUnavailable:`无法读取文本编码,原文件字节已保留。`,fileAttachmentDocumentUnavailable:`无法提取文本。文件可能受密码保护或格式暂不支持,原文件字节已保留。`,fileAttachmentNoText:`发送后,代理可通过工具读取原文件;此文件未提取出文本。`,fileAttachmentPreviewTruncated:`预览显示前 20,000 个字符,发送时会附上全部已提取文本。`,fileAttachmentExtractedContent:`已提取文本`,fileAttachmentPromptLabel:`用户提供的文件:`,fileAttachmentPromptTooLong:`消息和文件引用超过输入限制,请缩短消息或减少附件。`,imageAttachmentDescription:`支持 PNG、JPEG、GIF 或 WebP`,imageAttachments:`图片附件`,imageAttachmentsLoading:`正在准备附件…`,commandOpensPanel:`打开面板`,commandPanelArguments:`此命令用于打开面板,不能携带参数或图片。请移除后重试,或直接使用对应面板。`,commandPanelUnavailable:`未能打开面板,已保留命令。`,commandUnavailable_terminal_only:`需要在 Pi 终端界面中使用。`,commandUnavailable_not_integrated:`此扩展命令尚未接入 Web,请在 Pi 终端中使用。`,artifactImagePreviewFailed:`图片预览失败。请刷新文件重试,或下载后查看。`,artifactFileDetails:`文件信息`,turnElapsedRunning:`正在处理 · {{duration}}`,compactionElapsed:`已等待 {{duration}}`,compactionRunning:`正在压缩上下文`,compactionCompleted:`上下文已自动压缩`,compactionFailed:`上下文压缩失败`,compactionInterrupted:`压缩已中断`,compactionUnchanged:`压缩已结束,未生成新的摘要`,compactionUnavailable:`上下文压缩状态暂不可用`,compactionReconnectHelp:`连接已中断,恢复连接后将核实当前状态。`,compactionDraftHelp:`正在压缩上下文,发送的消息会排队等待。`,turnElapsedFinished:`用时 {{duration}}`,composerAdd:`添加`,composerCommands:`指令`,composerFile:`文件`,composerPlan:`计划`,composerCompact:`压缩`,composerModel:`模型`,composerBack:`返回`,composerPlanDescription:`进入或退出计划模式`,composerCompactDescription:`整理之前的对话,释放上下文空间`,composerModelDescription:`选择本会话使用的模型`,compactionQueueWaiting:`等待压缩完成`,compactionQueueBlocked:`消息已保留,可重试或清空队列。`,clearPromptQueue:`取消排队`,queueUpdateFailed:`未能更新队列,请确认当前会话后重试。`,queueStatusUnconfirmed:`请求已接收,但暂时无法确认最新队列状态。请刷新后再操作。`,turnElapsedOutcome_cancelled:`已停止`,turnElapsedOutcome_failed:`失败`,turnElapsedOutcome_uncertain:`结果待确认`,settingsSetupBusyHint:`Agent 配置需等待当前轮次结束;显示设置可直接调整。`,resetChatContentWidth:`恢复默认聊天宽度`,resetChatFontSize:`恢复默认字体大小`,setupResolveAdmission:`请先返回对话,处理尚未确认的消息,再应用设置。`,removeAttachment:`移除附件`,dropImagesHere:`将文件或图片拖到这里`,imageAttachmentCount:`最多可添加 {{count}} 张图片。`,imageAttachmentTooLarge:`单张图片不能超过 10 MB。`,imageAttachmentTotalTooLarge:`图片总大小不能超过 32 MB。`,imageAttachmentUnsupported:`仅支持有效的 PNG、JPEG、GIF 和 WebP 图片。`,imageAttachmentReadFailed:`无法读取此图片,请重新添加重试;消息内容已保留。`,attachedImage:`已附加图片`,previewAttachment:`预览图片`,closeImagePreview:`关闭图片预览`,imagePreviewFailed:`无法显示这张图片。`,fitImage:`适应窗口`,originalImageSize:`原始尺寸`,imageViewMode:`图片查看`,sessionUsage:`会话 Token 用量`,sessionInputTokens:`输入 Token`,sessionOutputTokens:`输出 Token`,sessionCacheTokens:`缓存 Token`,sessionContextUsage:`上下文占用与窗口大小`,usageContextLabel:`上下文`,usageUnknown:`未知`,usageOpenDetails:`输入 {{input}} · 输出 {{output}} · 上下文 {{percent}} / {{capacity}} · 查看会话用量`,usageContextHelp:`当前分支的估算占用 / 模型上下文容量上限。`,usageSessionTotals:`累计用量`,usageInputLabel:`输入`,usageOutputLabel:`输出`,usageCacheReadLabel:`缓存读取`,usageCacheWriteLabel:`缓存写入`,usageTotalLabel:`总计`,usageWorkspaceLabel:`工作区`,usageSessionId:`会话 ID`,usageTotalsHelp:`本会话累计 Token 用量,包含缓存。`,subagentDetails:`子代理`,sessionOverview:`会话概览`,sessionOverviewChanges:`当前审阅范围的更改`,subagentSummaryRunning:`{{count}} 运行中`,subagentSummaryDone:`{{count}} 完成`,subagentSummaryOther:`{{count}} 其他记录`,subagentNoneYet:`暂无子代理`,subagentOtherGroup:`失败 / 已中断`,subagentShowMore:`再显示 {{count}} 个`,backToSubagents:`返回子代理列表`,subagentActiveGroup:`已开启`,subagentFinishedGroup:`完成`,subagentNoneRunning:`暂无正在运行的子代理。`,subagentNoneFinished:`任务结束后会显示在这里。`,subagentProgress:`子代理:{{running}} 运行中 · {{completed}} 已完成`,subagentSummaryUnknown:`{{count}} 个状态未确认`,subagentTasks:`子代理任务列表`,inspectSubagent:`打开子代理:{{name}}`,subagentState_running:`运行中`,subagentProcessing:`处理中`,subagentState_done:`已完成`,subagentState_error:`失败`,subagentState_interrupted:`已中断`,subagentStarting:`正在启动…`,subagentSpawnFailed:`启动失败`,subagentStateUnavailable:`已启动 · 状态未保留`,subagentSpawnReceipt:`启动回执`,subagentSpawnReceiptHint:`此回执仅确认启动请求,不表示子代理任务已完成。`,subagentTask:`分配的任务`,subagentTranscript:`子代理对话`,subagentResult:`执行结果`,subagentSpend:`累计 token 消耗`,subagentSaved:`已保存记录`,subagentRecordedState:`最后记录的状态`,subagentSavedHint:`来自当前父会话已保存的回执;结果可能包含同批其他任务,并非子代理的完整实时对话。`,subagentReadOnly:`只读查看 · 关闭此面板不会停止任务`,subagentUnavailable:`当前会话已无法提供此子代理的实时详情。启动回执不代表任务已完成。`,subagentStale:`刷新失败,下方保留的是上次收到的状态。`,subagentNoMessages:`暂未收到消息。`,subagentTranscriptUnavailable:`此视图仅保留任务摘要,无法显示完整子代理对话。`,subagentWorkflowsTruncated:`另有 {{count}} 个 workflow 未包含在当前列表中,其任务数量未知。`,subagentState_unknown:`未确认`,subagentUnconfirmedGroup:`未确认`,subagentTruncated:`当前显示最近的消息,另有 {{count}} 条较早消息未包含在此视图中。`,subagentTextTruncated:`部分较长内容仅显示节选。`,subagentListTruncated:`另有 {{count}} 个任务未包含在当前列表中。`,subagentThinkingRedacted:`服务商已隐藏此段思考内容。`,inspectionChanged:`当前会话已切换,请重新打开详情。`,inspectionUnavailable:`暂时无法读取详情。`,inspectionLoading:`正在读取状态…`,thinkingUnavailable:`暂时无法读取思考等级。`,trustUnavailable:`暂时无法读取项目信任状态。`,copySetupCommand:`复制配置命令`,savedTrustDecision:`已保存决定`,activeSessionTrust:`当前会话信任`,trustDecision_trusted:`已信任`,trustDecision_denied:`已拒绝`,trustDecision_undecided:`未决定`,trustDecision_unknown:`未知`,trustActiveYes:`当前会话已信任`,trustActiveNo:`当前会话未信任`,modelAndThinking:`模型与思考`,selectedModel:`当前模型`,thinkingLevel:`思考等级`,availableThinking:`支持的等级`,unknownState:`未知`,projectTrust:`项目信任`,trust_trusted:`当前会话信任此工作区。`,trust_untrusted:`此工作区的信任已被拒绝。`,trust_restricted:`项目资源受到限制,等待信任决定。`,trust_unknown:`尚无法确定信任状态。`,trustRefreshNeeded:`保存的信任决定与当前会话不同,请通过 Pi 刷新会话后生效。`,providerAvailability:`服务商凭据`,settings:`设置`,settingsNavigation:`设置导航`,generalSettings:`常规`,configurationSettings:`配置`,configurationIntro:`配置工具权限、网络访问与模型响应。`,configurationReadFailure:`无法安全读取配置。请修复设置文件后刷新。`,configurationUserScope:`用户配置`,configurationSetupHint:`响应与搜索选项通过 OpenPI setup 应用`,configurationApproval:`批准策略`,configurationApprovalDetail:`工具审批沿用已安装 Pi 扩展的权限机制。`,configurationPiPermissions:`由 Pi 扩展管理`,configurationSandbox:`沙箱设置`,configurationSandboxDetail:`工具使用宿主进程的权限运行。`,configurationSandboxUnavailable:`未提供 OS 沙箱`,configurationSearchDetail:`允许当前会话模型在支持时访问网络。`,configurationSearchOff:`不向当前模型提供原生搜索。`,configurationSearchOn:`在当前连接支持时允许原生搜索。`,configurationVerbosity:`输出详细程度`,configurationVerbosityDetail:`选择模型回复包含细节的详细程度。`,configurationResponsesUnavailable:`当前连接未使用支持的 Responses 接口。`,configurationVerbosity_default:`模型默认`,configurationVerbosity_low:`简短`,configurationVerbosity_medium:`适中`,configurationVerbosity_high:`详细`,configurationVerbosityHelp_low:`简短直接地回答,减少额外细节。`,configurationVerbosityHelp_medium:`给出必要解释与适量细节。`,configurationVerbosityHelp_high:`提供更完整的解释与细节。`,configurationVerbosityRequest:`只把 response_verbosity 设为 {{value}},保留其他 OpenPI 配置。`,configurationSummary:`推理摘要`,configurationSummaryDetail:`选择向支持的推理模型请求哪种摘要。`,configurationSummaryUnavailable:`当前连接不支持推理摘要。`,configurationSummary_default:`模型默认`,configurationSummary_auto:`自动`,configurationSummary_concise:`简洁`,configurationSummary_detailed:`详细`,configurationSummary_none:`关闭`,configurationSummaryHelp_auto:`由模型自动选择摘要长度。`,configurationSummaryHelp_concise:`请求简洁的推理摘要。`,configurationSummaryHelp_detailed:`请求较详细的推理摘要。`,configurationSummaryHelp_none:`不请求推理摘要;保留当前推理强度。`,configurationSummaryRequest:`只把 response_reasoning_summary 设为 {{value}},保留其他 OpenPI 配置。`,configurationModelFeatures:`模型功能`,configurationReasoningLevels:`可用推理强度`,configurationReasoningDetail:`选择在模型控件中显示哪些级别。控件只显示当前模型支持的档位,当前档位始终保留。`,configurationReasoningCount:`已选择 {{count}} 个`,configurationDependencies:`工作空间依赖项`,configurationEnvironment:`本地运行环境`,configurationEnvironmentDetail:`Node.js、Python 等工具由当前环境提供。OpenPI 不安装捆绑的工作空间运行时。`,configurationRuntimeStatus:`运行状态`,browserSettings:`浏览器`,webSearchSettings:`联网搜索`,webSearchCurrentModel:`当前会话模型`,webSearchNativeDetail:`调用当前模型供应商的原生搜索,复用现有连接和凭据。`,webSearchSupported:`当前连接支持原生搜索。开启后,由模型决定何时联网。`,webSearchUnsupported:`当前连接不支持或尚未确认支持原生搜索,不提供搜索工具,也不会切换到其他供应商。`,webSearchNativeRequest:`开启联网搜索,使用当前会话模型的原生搜索和已有 Pi 凭据。不要切换模型、连接协议或搜索供应商;当前连接不支持或支持情况未知时,不提供搜索工具。`,webSearchIntro:`让模型搜索最新资料,并打开原始网页核实。`,webSearchPackageDetail:`通过可选 Pi 插件提供搜索、网页读取和 PDF 提取。`,webSearchDefaultOff:`默认关闭。可选扩展跟随当前会话模型,无需另填搜索密钥或安装插件。`,webSearchLoaded:`本会话已加载插件`,webSearchNotLoaded:`本会话尚未加载插件`,webSearchSource:`查看插件源码`,webSearchProfile:`搜索设置`,webSearchExa:`Exa — 无需 API 密钥`,webSearchExisting:`保留我已有的搜索偏好`,webSearchProfileHint:`Exa 提供搜索,网页由本机直接读取。已有偏好会原样保留;安装后也可更换搜索服务。`,webSearchEnable:`启用联网搜索…`,webSearchDisable:`关闭联网搜索…`,webSearchConfigure:`更换搜索服务…`,webSearchExaRequest:`启用可选联网搜索,使用 Pi Web Access 和无需 API 密钥的 Exa。让我审阅插件安装确认,保留其他偏好,不要自动重新加载。`,webSearchExistingRequest:`启用可选联网搜索,使用 Pi Web Access,原样保留我已有的搜索偏好。让我审阅插件安装确认,保留其他偏好,不要自动重新加载。`,webSearchDisableRequest:`关闭原生联网搜索。保留其他设置和会话记录。`,webSearchProviderRequest:`帮我更换已安装 Pi Web Access 插件的搜索服务。介绍可用服务与权限,保留无关偏好,密钥留在搜索插件中,不要自动重新加载。`,browserSettingsIntro:`让 OpenPI 阅读网页、点击、输入和截图。`,browserControl:`浏览器控制`,browserControlHint:`提交设置变更请求,保存配置后生效。`,browserDefault:`默认浏览器`,browserDefaultHint:`提交设置变更请求,选择未指定浏览器时使用的默认项。`,browserEmbedded:`OpenPI 内置浏览器`,browserAllowedTitle:`允许使用的浏览器`,browserOffHint:`下方选择将在开启浏览器控制后生效。`,browserConnected:`已连接`,browserNeedsSetup:`需要连接浏览器扩展`,browserNotFound:`未检测到此浏览器`,browserUpdateNeeded:`需要更新扩展`,browserBlocked:`未授权`,browserDefaultBlocked:`当前默认浏览器未获授权,请允许使用或更换默认值。`,browserSetUp:`设置`,browserManage:`管理`,browserSetupNamed:`设置 {{browser}}`,browserManageNamed:`管理 {{browser}}`,browserAllowNamed:`允许使用 {{browser}}`,browserMore:`更多浏览器`,browserSpeakHint:`对话中说“使用 Chrome …”,即可指定这次使用的浏览器。`,browserGuideTitle:`连接 {{browser}}`,browserGuideEyebrow:`跟着做,一次一步`,browserConnectionTitle:`连接状态`,browserCloseGuide:`收起浏览器设置引导`,browserConnectionReady:`连接正常,可选择是否允许 OpenPI 使用。`,browserEmbeddedDetail:`网页在 OpenPI 内打开。部分网站需要使用普通浏览器才能登录或正常显示。`,browserExternalDetail:`OpenPI 可以使用已连接的 {{browser}} 配置中的现有标签和登录状态。请在该配置中保留一个 OpenPI 标签页。`,browserManageExtension:`管理扩展`,browserAllowUse:`允许 OpenPI 使用`,browserMakeDefault:`设为默认`,browserInstallIn:`安装到`,browserInstallTitle:`安装 OpenPI Browser Bridge`,browserSetupSteps:`设置步骤`,browserGuidePopout:`在独立窗口中跟随操作`,browserGuideDetached:`引导已在独立窗口打开,可以对照浏览器设置逐步完成。`,browserShowGuide:`显示引导窗口`,browserGuideInline:`把引导放回这里`,browserGuideBlocked:`未能打开引导窗口。可允许弹出式窗口后重试,也可继续查看这里的步骤。`,browserSafariSettings:`Safari → 设置`,browserSafariDeveloper:`开发者设置`,browserSafariTemporary:`添加临时扩展…`,browserSafariOpenHint:`打开 Safari 后,在菜单栏选择「Safari → 设置」,对照此引导操作。需要 macOS 上的 Safari 26 或更新版本。`,browserSafariDeveloperTitle:`显示 Safari 开发者设置`,browserSafariDeveloperHint:`在「设置 → 高级」中开启「显示网页开发者功能」,再进入「开发者」标签。`,browserSafariLoadHint:`在「开发者」中点击「添加临时扩展」,选择下方文件夹。启用 OpenPI Browser Bridge,允许访问要控制的网站及本地 OpenPI 页面。退出 Safari 后需重新加载临时扩展。`,browserFirefoxThis:`此 Firefox`,browserFirefoxTemporary:`临时载入附加组件…`,browserFirefoxDeveloperTitle:`选择「此 Firefox」`,browserFirefoxDeveloperHint:`在 about:debugging 左侧选择「此 Firefox」。Firefox 不需要开启「开发者模式」开关。`,browserFirefoxLoadHint:`点击「临时载入附加组件」,选择下方文件夹中的 manifest.json。此安装在 Firefox 重启后失效;永久安装需要经过 Mozilla 签名的扩展包。`,browserFirefoxDone:`已选中,下一步`,browserStepCount:`第 {{step}} 步,共 {{total}} 步`,browserStepLabel:`第 {{step}} 步:{{label}}`,browserStepOpen:`打开扩展页`,browserStepAdd:`添加扩展`,browserStepConnect:`连接`,browserOpenManagerTitle:`打开 {{browser}} 扩展页`,browserOpenManagerHint:`接下来会打开 {{browser}}。在扩展页完成操作后,回到这里继续。`,browserOpenManager:`打开 {{browser}} 扩展页`,browserReopenManager:`重新打开扩展页`,browserAlreadyInstalled:`已经安装?直接连接`,browserDeveloperMode:`开发者模式`,browserDeveloperTitle:`开启「开发者模式」`,browserDeveloperHint:`在扩展页开启「开发者模式」,页面会出现「{{loadLabel}}」按钮。`,browserDeveloperDone:`已开启,下一步`,browserIllustration:`操作示意 · 在 {{browser}} 中完成`,browserExtensions:`扩展程序`,browserLoadUnpacked:`加载未打包的扩展程序`,browserLoadHint:`扩展已准备在本机,按下面的顺序在 {{browser}} 中载入。`,browserCopyLocation:`复制下面的路径`,browserLocateTarget:`找到本机的扩展文件夹`,browserRevealTarget:`定位扩展文件夹`,browserLocateManifest:`找到扩展中的 manifest.json`,browserRevealManifest:`定位 manifest.json`,browserDragToBrowser:`把文件夹拖到 {{browser}} 扩展页`,browserDragFolderHint:`将文件管理器中的 {{folder}} 整个文件夹拖到扩展页,保持「开发者模式」开启。`,browserSelectLocatedTarget:`在浏览器弹出的选择窗口中,选择上一步定位的项目。`,browserManualInstall:`无法拖入?使用路径选择`,browserManualSelection:`找不到?使用路径选择`,browserLoadInBrowser:`在 {{browser}} 点击「{{loadLabel}}」`,browserLoadAlternate:`部分版本显示为「加载已解压的扩展程序」或 Load unpacked。`,browserConfirmFolder:`选择`,browserConfirmFile:`打开`,browserSelectFolderHint:`选择整个文件夹,不要选择里面的 .js 文件。`,browserSelectManifestHint:`只选择 manifest.json,不要选择 .js 文件。`,browserInstallCheckpoint:`在扩展列表看到 OpenPI Browser Bridge 卡片后,再继续连接。`,browserPathCopied:`已复制路径`,browserCopyFailed:`未能复制,请选中上方路径手动复制。`,browserChooseFolderMac:`按 ⌘ ⇧ G,粘贴刚复制的路径并按回车定位,再点击「{{confirm}}」。`,browserChooseFolderOther:`在选择窗口的地址栏粘贴刚复制的路径并回车,再点击「{{confirm}}」。`,browserInstalledConnect:`已添加,连接 OpenPI`,browserPreviousStep:`上一步`,browserWaiting:`等待 OpenPI Browser Bridge 连接,连接后会自动进入下一步。`,browserInstallBrowserFirst:`请先安装 {{browser}},或在已安装的浏览器中打开当前 OpenPI 地址。`,browserConnectTitle:`连接 OpenPI`,browserConnectHint:`在 {{browser}} 中打开 OpenPI,使用刚安装扩展的浏览器配置。`,browserOpenIn:`在 {{browser}} 中打开`,browserAllowHint:`连接成功后,可以允许 OpenPI 使用此浏览器。安装扩展不会自动开启浏览器控制。`,browserCheck:`检查连接`,browserNotConnectedYet:`还未连接。请完成安装,在该浏览器中刷新 OpenPI 后再次检查。`,browserHelp:`设置帮助`,browserReloadHint:`已安装旧版?在扩展页重新加载 OpenPI Browser Bridge,再刷新 OpenPI。如浏览器提示权限,请完成其原生确认。`,browserSupportedHint:`Chrome、Edge、Brave、Chromium 145+ 可控制内置页面及普通标签。macOS Safari 26+、Firefox 128+ 通过兼容扩展控制普通标签,嵌套框架需单独打开。Safari、Firefox 的临时安装需在浏览器重启后重新加载。`,browserCopyPath:`复制路径`,browserOpening:`正在打开浏览器…`,browserLoading:`正在检查浏览器连接…`,browserSaved:`已保存,浏览器权限立即生效。`,browserSaving:`正在处理…`,modelSettings:`模型`,skillsSettings:`技能`,subagentsSettings:`子代理`,pluginsSettings:`插件`,configureOpenPi:`配置 OpenPI`,setupRequestReviewAll:`和我一起检查全部 OpenPI 配置项`,setupRequestSetTheme:`仅将 OpenPI Web 主题设置为 {{value}},其他配置保持不变`,setupRequestSetChatWidth:`仅将 OpenPI Web 聊天内容宽度设置为 {{value}}px,其他配置保持不变`,setupRequestSetChatFontSize:`仅将 OpenPI Web 聊天字体大小设置为 {{value}}px,其他配置保持不变`,setupRequestEnableExpandedThinking:`仅将 OpenPI Web 的思考块改为默认展开,其他配置保持不变`,setupRequestDisableExpandedThinking:`仅将 OpenPI Web 的思考块改为默认折叠,其他配置保持不变`,setupRequestSubagents:`检查并配置 Agent 角色模型和工作流上限`,setupRequestFailed:`OpenPI 配置请求未被接收。`,setupRequestRunning:`正在应用 OpenPI 设置…`,setupRequestAccepted:`配置请求已接收。`,setupPlanBlocked:`Agent 配置需先退出 Plan 模式;显示设置可直接调整。退出不会开始实施计划。`,setupPlanBusy:`Agent 配置需等待当前回合结束并退出 Plan 模式;显示设置可直接调整。`,setupOutcome_pending:`配置请求正在处理,尚未收到保存回执。`,toolCallArguments:`工具参数`,toolCallOutput:`工具结果`,setupOutcome_saved:`OpenPI 配置已保存并应用。`,setupOutcome_unchanged:`配置已保存,实际设置没有变化。`,setupOutcome_failed:`配置请求失败,请查看错误和当前设置后再重试。`,setupOutcome_cancelled:`配置过程已取消,未确认成功保存。`,setupOutcome_unconfirmed:`本次未确认成功保存,请核对当前设置后再运行 /openpi-setup。`,settingsUpdateFailed:`无法保存 Web 显示设置。`,settingsPreferencesSaved:`偏好设置已保存。`,settingsPreferencesSaveFailed:`无法保存显示设置,请检查配置诊断后重试。`,settingsCatalogLoading:`正在加载 Pi 资源…`,settingsCatalogFailed:`无法加载 Pi 设置资源。`,appearance:`外观`,settingsPersonal:`个人`,settingsAgent:`Agent`,settingsIntegrations:`集成`,settingsArchivedChats:`已归档聊天`,settingsSearch:`搜索设置`,settingsClearSearch:`清除搜索`,settingsNoResults:`没有匹配的设置`,appearanceVisualStyle:`视觉风格`,appearanceMode:`模式`,appearanceTheme:`主题`,appearanceAccent:`强调色`,appearanceBackground:`背景`,appearanceForeground:`前景`,appearanceFont:`字体`,appearanceFont_codex:`Codex 默认`,appearanceFont_sans:`无衬线`,appearanceFont_serif:`衬线`,appearanceFont_mono:`等宽`,appearanceAccent0:`默认`,appearanceAccent1:`蓝色`,appearanceAccent2:`紫色`,appearanceAccent3:`粉色`,appearanceAccent4:`橙色`,appearanceAccent5:`绿色`,appearanceCustomAccent:`自定义强调色`,appearanceAdvanced:`高级`,appearanceReset:`恢复默认设置`,appearanceResetAction:`重置外观`,appearanceImport:`导入主题`,appearanceCopy:`复制主题`,appearanceCopied:`主题已复制`,appearanceCopyFailed:`无法复制主题,请重试。`,appearanceThemeValue:`主题数据`,appearanceImportPlaceholder:`粘贴 OpenPI 主题…`,appearanceImportInvalid:`请输入有效的 OpenPI 主题数据。`,appearanceImportAction:`导入`,searchArchivedChats:`搜索已归档聊天`,archiveProjectFilter:`按项目筛选`,archiveAllProjects:`所有项目`,archiveProjectGroup:`{{project}} · {{count}} 条归档聊天`,archiveSort:`归档聊天排序`,archiveSortUpdated:`最近更新`,archiveSortCreated:`创建时间`,restoreArchivedChat:`恢复 {{title}}`,themeLight:`浅色`,themeDark:`深色`,themeMist:`雾青`,themeRose:`蔷薇`,themePine:`松夜`,themeSystem:`跟随系统`,conversationSettings:`对话`,expandThinkingByDefault:`默认展开思考块`,chatContentWidth:`聊天内容宽度`,chatFontSize:`聊天字体大小`,agentBehavior:`Agent 行为`,workflowLimits:`工作流上限`,workflowConcurrency:`工作流并行上限`,workflowCalls:`总调用次数`,agentSettingsSetupHint:`Agent 设置通过当前会话中的 /openpi-setup 生效。`,setupRequestLimits:`将工作流并行上限设置为 {{concurrency}},总子代理调用上限设置为 {{calls}},保留其他配置。`,setupRequestEnableSuggestions:`启用下一步建议。如需模型配置,请帮助我选择模型,保留其他配置。`,setupRequestDisableSuggestions:`关闭下一步建议,保留其他配置。`,setupRequestPostEdit:`帮我配置或关闭编辑后命令。先展示当前配置,再询问要使用的命令。`,configurePostEdit:`配置编辑后命令`,workflowLimitsValue:`并行 {{concurrency}} · 总调用 {{calls}}`,nextActionSuggestions:`下一步建议`,nextActionSuggestionsDetail:`当前任务结束后,提供几个可选择的下一步操作。`,enabled:`已启用`,disabled:`已关闭`,configured:`已配置`,postEditCommand:`编辑后命令`,postEditCommandDetail:`编辑完成后运行一个命令;关闭时不会执行任何命令。`,resultDisplay:`默认结果显示`,subagentResults:`子代理结果`,bashOperations:`Bash 操作`,fileMutations:`Write / Edit 操作`,footer:`页脚`,terminalFooter:`Pi 终端页脚`,terminalFooterStyle:`终端页脚样式`,terminalFooterHint:`影响 Pi 命令行界面的页脚;已打开的 Pi 界面在下次启动或配置应用后更新。`,detailDisplay_full:`完整`,detailDisplay_compact:`紧凑`,sessionSettings:`会话`,currentModel:`当前`,providerCurrentSessionModel:`当前会话使用 {{model}}。`,useThisModel:`使用此模型`,model:`模型`,modelConnection:`模型连接`,provider:`服务商`,modelId:`模型 ID`,providerStatusUnavailable:`此服务商不在当前有界认证快照中。`,providerSettings:`服务商凭据`,providerSettingsIntro:`查看当前 Web 会话可通过哪些 Pi 服务商完成认证。`,openRuntimeDetails:`打开运行详情`,currentWorkspace:`当前工作区`,providerAuth_api_key:`API 密钥`,providerAuth_oauth:`OAuth`,providerAuthUnknown:`未报告认证方式`,authentication:`认证方式`,accessType:`访问方式`,providerAccessSubscription:`订阅账户`,providerAccessStandard:`服务商凭据`,configurationOwner:`配置归属`,providerLoading:`正在加载服务商状态…`,providerLoadFailed:`无法加载服务商状态。`,providerReadOnly:`由 Pi 管理`,selectProvider:`选择服务商`,gitReviewBaselineUnavailable:`未保留可用的会话基线,可能超出了捕获限额。请切换到未暂存、已暂存或分支查看 Git 变更,也可打开本会话文件记录。`,modelsIntro:`登录账户或添加 API 密钥。已有的 Pi 连接也会显示在这里。`,modelConnectionsTitle:`模型连接`,modelConnectionsIntro:`管理连接凭据,选择新会话和当前会话使用的模型。`,accountLoginMethod:`连接方式`,accountLoginTab:`账户登录`,accountLoginChatGPT:`ChatGPT 账户`,accountLoginClaude:`Claude 账户`,accountLoginKeyTab:`API 密钥`,accountLoginConfigured:`账户已登录`,accountLoginIntro:`在浏览器中完成授权,无需填写 API 密钥。`,accountLoginExisting:`账户凭据已保存在 Pi 中。`,accountLoginStart:`登录`,accountLoginAgain:`重新登录`,accountLoginUnsaved:`请先保存或放弃其他修改,再登录账户。`,accountLoginStarting:`正在准备登录…`,accountLoginWaiting:`等待账户授权`,accountLoginChoose:`选择登录方式`,accountLoginCancelling:`正在取消登录…`,accountLoginBrowser:`在浏览器中继续`,accountLoginDevice:`使用设备码登录`,accountLoginBrowserOption:`在当前电脑上登录,完成后自动返回。`,accountLoginDeviceOption:`适合远程服务器,或无法自动返回的情况。`,accountLoginBrowserHelp:`打开登录页并完成授权,这里会自动更新。`,accountLoginDeviceHelp:`打开授权页并输入下方代码,请保持此页面打开。`,accountLoginOpen:`打开登录页`,accountLoginCopyCode:`复制设备码`,accountLoginPaste:`授权码或回调地址`,accountLoginContinue:`继续`,accountLoginFallback:`已登录,但这里没有更新?`,accountLoginRemoteHelp:`如果无法自动返回,请复制浏览器最后的回调地址,并粘贴到下方。`,accountLoginCancel:`取消登录`,accountLogin_failed:`登录未完成,请重试或选择其他登录方式。`,accountLogin_expired:`登录已过期,请重新开始获取新的授权链接。`,accountLogin_cancelled:`已取消登录。`,accountLoginRequestFailed:`请求未完成,请先刷新状态再重试。`,accountLoginStatusUnknown:`暂时无法查询登录状态,账户授权可能仍在进行。`,accountLoginRefreshRequired:`凭据已保存,但 Pi 未能更新模型列表。请重载 Pi 后使用此连接。`,accountLogout:`退出登录`,accountLogoutRefreshRequired:`已移除保存的凭据,但 Pi 未能更新模型列表。请重载 Pi 刷新状态。`,accountLogoutTitle:`退出 {{provider}}?`,accountLogoutDetail:`将移除此电脑上 Pi 保存的该服务凭据,其他使用它的 Pi 会话也需要重新登录。环境凭据不受影响。`,providerInputTypes:`输入类型`,providerInputText:`文本`,providerInputImage:`图片`,providerCustomTag:`自定义`,providerEdit:`编辑`,providerRemove:`删除`,providerSave:`保存`,editProvider:`编辑 {{provider}}`,removeProvider:`删除 {{provider}}`,providerAdd:`添加模型提供商`,providerAddMode:`添加方式`,providerAddCatalog:`第三方模型提供商`,providerAddCustom:`自定义模型 API`,providerAccountHint:`使用已有账户连接模型,选择服务商后前往浏览器授权。`,providerCatalogHint:`从内置目录中选择提供商,填入其 API 密钥即可使用。`,providerCustomHint:`连接中转站、自部署服务或其他兼容 OpenAI / Anthropic 协议的接口,需填写 API 地址、协议和模型。`,providerKeyKeep:`已配置密钥,留空保持不变`,providerKeyOptional:`输入 API 密钥,或留空使用环境认证`,providerDisplayName:`提供商名称`,providerCustomSettings:`自定义设置`,providerSaved:`已保存 {{provider}}。`,modelDefaultTitle:`新会话默认模型`,modelDefaultChoose:`选择模型`,modelDefaultBadge:`默认`,modelCurrentBadge:`当前使用`,modelDefaultNotSet:`未设置 · 新会话启动时由 Pi 选择`,modelDefaultHint:`选择以后新会话使用的模型,已有会话保留自己的选择。此设置也会更新 Pi 的默认模型。`,modelDefaultReadFailed:`暂时无法读取默认模型。`,modelDefaultProjectOverride:`此工作区有 Pi 独立设置:{{model}}。`,modelDefaultSave:`保存默认模型`,modelMakeDefault:`同时设为新会话默认模型`,modelDefaultSaveFailed:`默认模型保存尚未确认,请刷新状态后重试。`,modelDefaultPartial:`当前模型已切换,但默认模型保存尚未确认,请刷新状态后再试。`,modelConnectionNextHint:`从此连接选择一个模型,用于当前会话。`,modelConnectionSearch:`搜索模型…`,modelConnectionChooseProvider:`选择 {{provider}} 的模型`,modelConnectionUse:`用于当前会话`,modelConnectionUseFailed:`模型切换尚未确认,请刷新模型列表后重试。`,modelConnectionLoadFailed:`暂时无法读取模型列表。`,modelConnectionNoModels:`暂无可选模型,请检查连接或添加模型定义。`,modelConnectionNoMatch:`没有匹配的模型。`,modelConnectionMore:`还有 {{count}} 个模型,可搜索缩小范围。`,providerModelsEmpty:`还没有模型,获取可用模型或手动添加。`,providerModelsInherited:`使用提供商的内置模型目录。`,providerModelsReadOnly:`此提供商包含当前页面未支持的模型设置,请在 Pi 配置文件中编辑。`,providerModelId:`模型 {{number}} ID`,providerModelName:`模型 {{number}} 名称`,providerModelDetails:`模型参数:{{model}}`,providerRemoveModel:`删除模型:{{model}}`,providerIdInvalid:`请使用未被占用的提供商 ID,仅包含字母、数字、连字符、点或下划线。`,providerNativeAuth:`此提供商使用 Pi 原生登录。`,providerConfigurationFailed:`保存失败,请检查填写内容,并在会话空闲时重试。`,providerProfileSavedKeyFailed:`提供商配置已保存,但密钥保存失败。重试将只保存密钥。`,providerReload:`放弃草稿并重新加载`,providerCurrentRemoval:`请先切换当前使用的模型,再删除。`,providerRemoveDetail:`删除此提供商的配置和自定义模型?由 Pi 管理的凭据将保留。`,providerPickerIntro:`以下是模型提供商的可用模型,勾选要添加的模型。`,providerPickerSelected:`已选 {{count}} 个`,providerApiKey:`API 密钥`,providerKeyPlaceholder:`粘贴密钥以添加或替换`,saveProviderKey:`保存密钥`,savingSettings:`正在保存…`,keepEditing:`继续编辑`,discardAndContinue:`放弃更改并继续`,unsavedSettingsTitle:`放弃未保存的更改?`,unsavedSettingsDetail:`未保存的模型和凭据修改将被丢弃。`,unsavedCredentialTitle:`放弃未保存的凭据?`,unsavedCredentialDetail:`新密钥尚未保存,继续后将清空。`,modelSelectionBusy:`当前会话忙碌,暂不能切换模型。`,providerKeySaved:`已保存到 Pi 凭据存储。已有密钥不会回显。`,providerSaveFailed:`密钥保存未完成。请等待会话空闲,刷新状态后重试;部分服务商需要额外认证信息。`,providerWriteDetail:`在这里直接保存到 Pi 凭据存储,密钥不会进入模型对话。OAuth 或需要额外字段的认证请使用 Pi 原生登录。`,editModelConfiguration:`添加或编辑自定义模型`,modelConfigurationDetail:`先设置提供商连接,再获取模型列表或手动添加。保存配置不会调用模型。`,configuredModels:`自定义模型配置`,addModel:`添加模型`,modelConfig_provider:`服务商 ID`,modelConfig_id:`模型 ID`,modelConfig_name:`显示名称`,modelConfig_baseUrl:`API 地址`,modelConfig_api:`API 格式`,modelConfig_contextWindow:`上下文窗口`,modelConfig_maxTokens:`最大输出 token 数`,providerCapacityLabel:`{{field}} {{number}}`,providerModelOptions:`模型选项`,providerModelInvalid:`模型 {{number}}:模型 ID 不能为空或重复;容量需为正数,例如 128K 或 1M,留空使用默认值。`,modelConfig_reasoning:`支持推理`,saveModelConfiguration:`保存模型`,reloadModelConfiguration:`放弃草稿并载入最新配置`,retryModelConfiguration:`重试读取`,discardModelDraftTitle:`放弃这份模型草稿?`,discardModelDraftDetail:`最新配置将替换这份未保存的草稿。`,discardAndReload:`放弃并重新载入`,modelConfigurationUnsaved:`未保存的更改`,modelConfigurationConflict:`模型配置已在别处更改,当前草稿已保留。`,modelConfigurationLoadFailed:`无法读取模型配置,草稿已保留。`,modelConfigurationSaved:`已保存到 Pi models.json。配置服务商密钥后即可选择此模型。`,modelConfigurationFailed:`模型保存未完成,草稿已保留。`,setupConfigurationRequest:`配置需求`,configureViaSetup:`通过 OpenPI setup 应用`,setupFormDetail:`统一走 /openpi-setup。请在对话中查看进度及必要的确认;提交成功不等于配置已保存。`,setupSkillsPlaceholder:`填写要添加或调整的技能,以及来源或本地路径`,setupPluginsPlaceholder:`填写要配置的 Pi 插件,以及准确的包名或本地路径`,enableSkillInvocation:`允许模型调用`,disableSkillInvocation:`改为仅显式调用`,setupSkillInvocationRequest:`配置这个 Pi 技能:{{path}}。将原生 disable-model-invocation 字段设为 {{disabled}},保留其余内容,并说明何时生效。`,setupRoleFormRequest:`将 OpenPI 的 {{role}} 角色配置为使用 {{model}},工作流并发设为 {{concurrency}}。推理级别继承父会话,校验选择有效性,并保留其他配置。`,providerReadOnlyDetail:`此页面只读且不会接收凭据内容。请通过 Pi 配置服务商认证,然后刷新此状态。`,openProviderSettings:`打开服务商设置`,credentialConfigured:`已配置`,credentialMissing:`未配置`,authNotVerified:`凭据已配置不代表模型请求一定成功。`,configurationViaPi:`此处为只读状态。模型凭据与信任由 Pi 管理,OpenPI 选项通过 /openpi-setup 配置。`,noSkillsFound:`当前会话没有加载技能。`,addSkill:`添加技能`,addPlugin:`添加插件`,searchResources:`搜索名称或来源`,filterResourceScope:`资源范围`,allResourceScopes:`全部范围`,noMatchingResources:`没有匹配的资源`,resourceBulkTooLarge:`请进一步筛选列表后,再提交批量配置请求。`,resourceManagement:`Pi 资源`,resourceSourceAuto:`Pi 自动发现`,resourceSourceLocal:`本地资源`,resourcePackageSource:`软件包、仓库或本地路径`,resourcePackageSourcePlaceholder:`npm:包名@版本 · git:owner/repo · /path/to/skill`,resourceInstallIntro:`选择来源和范围,在对话中通过 OpenPI setup 审查并应用。`,resourceInstallReview:`请在对话中确认准确来源和权限。提交请求不代表已安装或已加载。`,resourceRequestSubmitted:`请求已提交。请在对话中查看进度和确认,完成后刷新此目录。`,browseSkills:`浏览 skills.sh 技能`,resourceSessionState:`应用到当前会话`,resourcesReloadNote:`刷新只读取目录;重新加载才会将已保存的资源应用到空闲会话。配置变更不会自动重新加载。`,reloadResources:`重新加载资源`,resourceReloadReview:`将已保存的 Pi 技能与插件配置应用到当前会话,并重新启动扩展?请先等待运行中的工作结束。`,resourceReloaded:`资源已重新加载,请查看更新后的目录和诊断。`,resourceReloadFailed:`无法重新加载资源。请等待当前会话空闲,刷新后重试。`,advancedResourceConfiguration:`高级配置`,resourceDiagnostics:`Pi 报告了 {{extensionErrors}} 项扩展诊断与 {{skillErrors}} 项技能诊断。`,resourceConfigurationDiagnostics:`{{count}} 项设置读取失败,请检查 Pi 配置诊断。`,resourceCatalogTruncated:`此目录有数量上限,部分资源未展示。`,resourceTargetTruncated:`此来源或路径已截断,请通过高级配置确认完整目标后再进行管理。`,updateResource:`检查更新`,removeResource:`审查移除`,skillsEmptyTitle:`添加你的第一个技能`,skillsEmptyIntro:`技能为 Pi 提供可复用的指引。可以添加软件包、仓库或本地技能;项目技能遵循 Pi 的项目信任。`,pluginsEmptyTitle:`用插件扩展 Pi`,pluginsEmptyIntro:`软件包可以包含扩展、技能、提示词和主题。添加来源后,通过 OpenPI setup 审查安装。`,pluginCount:`{{count}} 个插件来源`,installedVersion:`已安装版本`,configuredVersion:`配置版本`,resourceVersionUnpinned:`未固定版本 / 本地来源`,pluginState_loaded:`本会话资源已加载`,pluginState_installed:`已安装 · 未加载`,pluginState_disabled:`配置已禁用`,pluginState_missing:`软件包缺失`,pluginState_error:`加载诊断`,pluginState_notLoaded:`未加载`,pluginLoadedResources:`当前会话目录包含 {{count}} 项资源。配置变更需要明确重新加载后才会应用。`,pluginAction_enable:`审查启用`,pluginAction_disable:`审查禁用`,pluginAction_update:`检查更新`,pluginAction_remove:`审查移除`,enableVisibleSkills:`允许模型使用(当前 {{count}} 项)`,disableVisibleSkills:`仅显式调用(当前 {{count}} 项)`,enableVisiblePlugins:`启用当前 {{count}} 个软件包`,disableVisiblePlugins:`禁用当前 {{count}} 个软件包`,setupResourceInstallRequest:`添加 Pi {{kind}},来源为 {{source}},范围为 {{scope}}。先检查来源并确定固定的软件包身份,通过 ask_user 与我确认安装权限,再使用 Pi 原生的软件包或技能配置。添加技能时保留其他扩展和资源。保留现有偏好与项目信任,不要自动重新加载当前会话。分别报告已保存的配置与仍需执行的操作,不要改动无关的 OpenPI 设置。`,setupPluginOperationRequest:`审查 Pi 软件包操作 {{action}},只针对配置来源 {{source}}、原生安装目录 {{path}}、范围 {{scope}}。相对来源应以该范围的原生设置目录解析。使用 Pi 原生包管理;更新时检查可用版本,通过 ask_user 与我确认固定的目标身份和安装权限。保留资源过滤器及所有无关偏好;如果切换会破坏过滤器,停止并说明。移除时不得删除本地来源目录。不要自动重新加载,分别报告已持久化与当前会话状态,不要改动无关的 OpenPI 设置。`,setupSkillManageRequest:`审查 Pi 技能操作 {{action}},只针对文件 {{path}}、来源 {{source}}、范围 {{scope}}。先检查原生资源归属,通过 ask_user 与我确认更新或移除及所需权限。保留无关技能与软件包资源,不要为了移除一个技能删除整个共享软件包。保留项目信任,不要自动重新加载,也不要改动无关的 OpenPI 设置。`,setupSkillsBulkRequest:`只针对当前展示的 Pi 技能文件 {{paths}},将原生 disable-model-invocation 设为 {{disabled}}。检查资源归属,保留其余内容和偏好,与我审查必要变更,报告无法安全修改的文件。显式 /skill 调用仍应可用。不要自动重新加载,也不要改动无关的 OpenPI 设置。`,setupPluginsBulkRequest:`只针对当前展示的 Pi 软件包 {{packages}},通过 Pi 原生配置将 disabled 设为 {{disabled}}。保留其他偏好与资源过滤器;无法保留过滤器的条目应跳过并报告。遵循范围与项目信任,与我审查必要变更,不要自动重新加载,也不要改动无关的 OpenPI 设置。`,resourceRequestFinished:`配置回合已结束。请刷新并查看 Pi 原生配置与会话资源,确认实际变更。`,skillCount_one:`{{count}} 个技能`,skillCount_other:`{{count}} 个技能`,skill:`技能`,copySkillInvocation:`复制调用命令`,source:`来源`,scope:`范围`,invocation:`调用方式`,modelInvocation:`模型调用`,resourceScope_user:`全局`,resourceScope_project:`项目`,resourceScope_temporary:`临时`,explicitOnly:`仅允许明确调用`,availableToModel:`模型可按需使用`,skillFile:`技能文件`,selectSkill:`选择一个技能`,subagentConfiguration:`Pi 原生子代理角色`,subagentConfigurationIntro:`未在 OpenPI 配置中指定模型时,角色继承父会话模型。`,subagentActiveCount_one:`{{count}} 个运行中`,subagentActiveCount_other:`{{count}} 个运行中`,subagentCompletedCount_one:`{{count}} 条记录`,subagentCompletedCount_other:`{{count}} 条记录`,subagentConcurrency:`上限 {{count}}`,builtInRoles:`内置角色`,subagentRole_explorer:`探索者`,subagentRole_implementer:`实现者`,subagentRole_reviewer:`审查者`,subagentRole_advisor:`顾问`,subagentRoleShort_explorer:`只读调查`,subagentRoleShort_implementer:`聚焦实现`,subagentRoleShort_reviewer:`正确性审查`,subagentRoleShort_advisor:`技术分析`,subagentRoleDescription_explorer:`调查代码库并报告证据,不修改文件。`,subagentRoleDescription_implementer:`实现边界明确的改动并运行相关仓库检查。`,subagentRoleDescription_reviewer:`审查正确性、安全性、回归风险和缺失验证。`,subagentRoleDescription_advisor:`分析困难技术问题并提出具体下一步建议。`,configureRoles:`配置角色`,builtInRole:`内置角色`,builtIn:`内置`,modelAssignment:`模型分配`,inheritParentModel:`继承父会话模型`,effectiveModel:`实际模型`,workflowConcurrencyLabel:`并行 Agent`,workflowCallLimit:`Agent 总调用数`,runtimeBoundaries:`运行时边界`,subagentAuthorityNote:`子会话权限是父会话与角色能力的故障关闭交集,不会静默扩大权限。`,subagentModelNote:`不会硬编码服务商;未分配的角色继承父会话模型和思考等级。`,resourceCount_one:`{{count}} 项资源`,resourceCount_other:`{{count}} 项资源`,noPluginsFound:`Pi 未报告已加载的插件来源。`,pluginCatalogTotals:`{{extensions}} 扩展 · {{skills}} 技能 · {{prompts}} 提示词 · {{themes}} 主题`,loaded:`已加载`,resourceOrigin:`来源类型`,resourceOrigin_package:`软件包`,resourceOrigin_topLevel:`顶层资源`,resources:`资源`,baseDirectory:`基础目录`,notReported:`未报告`,extensions:`扩展`,extensionSurfaceCount:`{{tools}} 个工具 · {{commands}} 个命令`,prompts:`提示词`,themes:`主题`,pluginResourceSummary:`{{extensions}} 扩展 · {{skills}} 技能 · {{prompts}} 提示词 · {{themes}} 主题`,pluginsManagedByPi:`这些资源由 Pi 加载。可通过上方 setup 表单提交变更;软件包操作沿用原生确认,并通过 Pi 的重新加载流程生效。`,selectPlugin:`选择一个插件来源`,statusCaptured:`采集于 {{time}} · 刷新查看最新状态`,conversationViews:`会话视图`,currentConversations:`当前`,archivedConversations:`已归档`,refreshArchives:`刷新归档会话`,loadingArchives:`正在加载归档会话...`,moreArchives:`加载更多归档会话`,retryArchives:`重试读取归档会话`,archiveLoadFailed:`无法加载归档会话。`,archiveCursorStale:`归档会话已变化,请刷新后继续。`,archiveScanBounded:`还有 {{count}} 条更早记录未扫描。`,noArchivedSessions:`没有归档会话。`,noScannedArchives:`已扫描历史中没有归档会话。`,noMatchingScannedArchives:`已扫描历史中没有匹配的归档会话。`,draftLimit:`草稿暂存已满,请先发送或清空已有草稿。`,restoreConversation:`恢复会话`,restoringConversation:`正在恢复…`,loadedArchives:`已加载历史中的归档会话`,loadedHistoryBounded:`另有 {{sessions}} 个会话和 {{workspaces}} 个工作区摘要未加载。搜索仅覆盖已加载列表。`,noLoadedArchives:`已加载列表中没有归档会话。`,restoreFailed:`暂时无法确认恢复结果,请刷新后重试。`,execution_running:`运行中`,execution_done:`已完成`,execution_killed:`已停止`,execution_timed_out:`已超时`,execution_failed:`失败`,execution_uncertain:`状态不确定`,activeOnlyHint:`只有当前 Web 会话可以接收消息。`,stopTurn:`停止当前轮次`,stoppingTurn:`正在停止当前轮次…`,stoppedTurn:`当前轮次已停止。`,pendingFollowUpsHint:`{{count}} 条消息正在排队`,sendNextTurn:`下一轮发送`,followUpBehavior:`跟进处理方式`,followUpBehaviorDetail:`OpenPI 运行时,将后续消息排队到下一轮,或引导当前轮次。按 ⌘/Ctrl+Enter 可仅对这条消息使用另一种方式。`,followUpQueue:`排队`,followUpQueueDetail:`下一轮发送`,followUpSteer:`引导`,followUpSteerDetail:`加入当前轮次`,steerCurrentTurn:`当前执行纠偏`,steeringHint:`在当前工具步骤结束后加入这条指示。`,pendingSteeringHint:`已接收 {{count}} 条纠偏指示,等待当前工具步骤结束`,steeringMessagesTitle:`当前轮次待处理的纠偏指示`,steerStaleTurn:`目标轮次已结束或变化。草稿已保留,请确认更新后的状态并重新发送。`,sourceFeedbackNew:`{{path}} · 新版本第 {{line}} 行`,sourceFeedbackOld:`{{path}} · 旧版本第 {{line}} 行`,forkMessage:`从此处分叉`,forkMessageHint:`从此消息创建新聊天,保留原聊天;不会自动发送消息。`,forkSessionPending:`正在创建分叉会话…`,forkSessionCreated:`已创建分叉会话,原会话保留在侧栏。`,forkSessionCancelled:`分叉已取消,原会话已保留。`,forkSessionUncertain:`无法确认分叉结果。请先刷新并检查会话列表,再决定是否重试。`,forkSessionUnavailable:`切换到此会话并等待当前执行和排队消息结束后,可以从这里创建新会话。`,reviewQuoteLine:`引用此行`,reviewSelectOldLine:`选择旧版本第 {{line}} 行`,reviewSelectNewLine:`选择新版本第 {{line}} 行`,queuedMore:`还有 {{count}} 条排队消息`,queuedImage:`图片附件`,queuedMessageExpand:`展开排队消息`,queuedMessageCollapse:`收起排队消息`,backgroundSessionRunning:`此会话正在后台运行…`,observedSessionTools:`{{count}} 个正在执行的工具`,toolsRequireCurrentSession:`切换到此会话后可使用交互工具。`,activateViewedSession:`切换到此会话`,activateViewedSessionHint:`发送消息即可继续此会话。`,acceptedHint:`OpenPI Web 已接收消息。`,promptAdmissionUnknown:`无法确认上次发送的消息是否已被接收。`,promptAdmissionUnknownDetail:`请先核对已刷新的会话历史和运行状态,再决定下一步。作为新消息发送可能产生重复消息。`,promptAdmissionCheckingDetail:`正在核对最新的会话历史和运行状态,核对完成前不能作为新消息发送。`,promptAdmissionVerificationFailedDetail:`暂时无法刷新最新的会话历史和运行状态。请重新核对后再决定是否作为新消息发送。`,abandonAdmission:`暂不重新发送`,retryAdmissionCheck:`重新核对`,retryOriginalAdmission:`重试原消息`,promptTooLong:`文本超出发送上限({{count}} / {{limit}})。`,sendAsNew:`作为新消息发送`,sendingAsNew:`正在发送…`,addWorkspace:`添加工作区`,addWorkspaceMenu:`添加工作区...`,archiveConversation:`归档会话`,pinnedConversations:`置顶`,sidebarOptions:`侧栏选项`,sidebarProjectOptions:`项目侧栏选项`,sidebarRecentOptions:`会话侧栏选项`,sidebarActivityOptions:`动态视图选项`,sidebarShow:`显示`,sidebarGroupBy:`会话分组`,sidebarByProject:`按项目分组`,sidebarFlatList:`所有会话`,sidebarChatSort:`会话排序`,sidebarRecent:`最近`,sidebarProjectsInRecents:`在最近列表显示项目会话`,sidebarShowMore:`展开显示`,sidebarShowLess:`收起显示`,sidebarFilterList:`筛选当前列表`,sidebarSaveFailed:`更改未能保存,请重试。`,pinWorkspace:`置顶项目`,unpinWorkspace:`取消置顶项目`,markConversationRead:`标记为已读`,markConversationUnread:`标记为未读`,sidebarState_unread:`未读会话`,sidebarActivity:`动态`,sidebarViewActivity:`查看动态`,sidebarViewChats:`查看会话`,sidebarPriority:`优先关注`,sidebarActivityEmpty:`没有需要关注的会话`,sidebarActivityEmptyHint:`已完成的工作和需要你处理的会话会显示在这里。`,sidebarMarkAllRead:`全部标记为已读`,sidebarClearRead:`清除优先关注中的已读会话`,sidebarReadFailed:`未能更新已读状态,请重试。`,sidebarToday:`今天`,sidebarYesterday:`昨天`,sidebarEarlier:`更早`,sidebarActivityCompleted:`已完成`,sidebarActivityFailed:`执行失败`,sidebarActivityRead:`已读`,modelAdvanced:`高级参数`,providerConnectionHeading:`提供商连接`,providerFetchModels:`获取可用模型`,providerFetchHint:`填写提供商和端点后,可一次选择多个模型。`,providerPickerTitle:`选择要添加的模型`,providerPickerAccess:`连接凭据`,providerPickerKey:`访问密钥(可选)`,providerPickerKeyHint:`留空使用此端点已保存的凭据。此处输入的密钥仅用于获取列表,不会保存。`,providerPickerSearch:`搜索模型`,providerPickerSelectAll:`全选`,providerPickerClear:`清空选择`,providerPickerLoading:`正在获取可用模型…`,providerPickerAdded:`已添加`,providerPickerNoMatch:`没有匹配的模型`,providerPickerEmpty:`提供商没有返回模型,仍可手动添加。`,providerPickerBounded:`当前显示前 500 个模型,其他模型可手动填写 ID。`,providerPickerError_load:`未能获取模型列表,请检查端点和凭据后重试,也可以手动添加。`,providerPickerError_save:`尚未确认保存成功。已保留你的选择,请检查连接后重试。`,providerPickerError_conflict:`配置已在其他地方更新,请关闭弹窗、重新读取配置后再保存。`,providerPickerDefaults:`新模型使用 {{context}} 上下文 / {{output}} 输出 token,添加后可逐个调整。`,providerPickerRetry:`刷新列表`,providerPickerCount:`已选 {{count}} 个 · 最多 100 个`,providerPickerSave:`添加所选`,sidebarState_running:`执行中`,sidebarState_compacting:`正在整理上下文`,sidebarState_waiting:`等待你的回复`,sidebarState_completed:`已完成 · 结果未读`,sidebarState_failed:`执行失败 · 打开会话查看详情`,pinnedOptions:`置顶选项`,pinConversation:`置顶会话`,unpinConversation:`取消置顶`,pinnedRecentlyUpdated:`最近更新`,pinnedManualOrder:`手动排序`,movePinUp:`上移`,movePinDown:`下移`,pinSaveFailed:`置顶设置未能保存,请重试。`,cancel:`取消`,chooseWorkspaceHint:`选择工作区并描述任务`,close:`关闭`,closeSearch:`关闭搜索`,collapseSidebar:`收起侧边栏`,confirmEdit:`保存并重新运行`,editMessageHint:`从这里创建新分支并重新运行;保留原对话、图片和文件引用。已有工作区改动会保留。`,regenerateMessage:`重新生成回答`,regenerateMessageHint:`在新分支重新运行这条问题,保留原附件和原对话。`,messageRerunStarted:`已在新分支接收重跑消息,原对话已保留。`,openOriginalConversation:`查看原对话`,messageRerunWorkspaceHint:`已有工作区改动会保留。`,modelRequestRecovered:`请求已恢复`,modelReconnecting:`正在重新连接`,modelReconnectUnknown:`重连状态待确认`,modelEarlierAttempts:`先前请求错误`,modelFailedAttempts:`失败尝试({{count}} 次)`,draftStorageUnavailable:`草稿未能保存到此设备,请保持页面打开或复制消息。`,draftStorageInvalid:`部分保存的草稿内容无法恢复,请检查消息和附件。`,draftStorageRetry:`重试保存草稿`,workbarBackToChat:`返回聊天`,workbarCollapseTools:`收起工具栏`,workbarEndTerminal:`关闭 {{name}} 并结束进程`,workbarNewTerminal:`新建终端`,workbarContinueInChat:`继续追问`,transcriptSearch:`搜索消息内容`,transcriptSearchPlaceholder:`搜索标题、项目或消息…`,transcriptSearchRecent:`最近会话`,transcriptSearchSessions:`会话`,transcriptSearchMessages:`消息内容`,transcriptSearchSessionResult:`打开会话 {{session}}`,transcriptSearchSessionOpenFailed:`暂时无法打开此会话,请重试。`,transcriptSearchIncludeArchived:`包含归档会话`,transcriptSearching:`正在搜索消息…`,transcriptSearchEmpty:`没有匹配的消息。`,transcriptSearchFailed:`暂时无法搜索消息,请重试。`,transcriptSearchRetry:`重试搜索`,transcriptSearchPartial:`部分历史未能搜索,结果可能不完整。`,transcriptSearchOpenFailed:`无法打开这条消息,它可能已移动或位于其他分支。`,transcriptSearchResult:`打开 {{session}} 中来自{{source}}的消息`,transcriptSearchSource_user:`你`,transcriptSearchSource_assistant:`助手`,transcriptSearchSource_tool_call:`工具调用`,transcriptSearchSource_tool_result:`工具结果`,connected:`已连接`,connecting:`正在连接`,conversationName:`会话名称`,conversationOptions:`会话选项`,sidebarRename:`重命名`,sidebarPin:`置顶`,sidebarUnpin:`取消置顶`,sidebarFork:`分叉`,sidebarForkLocal:`创建聊天分支`,sidebarForkSameWorktree:`在同一工作树中分叉`,archiveNoticeTitle:`聊天已归档`,archiveNoticeView:`查看`,archiveNoticeUndo:`撤销`,archiveNoticeFailed:`操作未完成,请重试。`,sidebarForkWorktree:`在新工作树中创建聊天分支`,sidebarForkCancelling:`正在请求取消…`,sidebarForkFinishing:`无法再取消,正在确认创建结果…`,sidebarForkCancelUnconfirmed:`无法确认取消,正在等待分叉结果。`,sidebarForkWorktreePreserved:`工作树已保留在 {{path}},请检查后再重试。`,sidebarForkWorktreePending:`正在创建工作树和聊天分支…`,sidebarForkOptionsLoading:`正在检查工作树是否可用…`,sidebarForkOptionsFailed:`无法检查工作树,请重新打开菜单重试。`,sidebarForkUnavailable:`发送消息后才能创建此聊天的分支。`,sidebarForkArchived:`请先恢复此会话,再创建分叉。`,sidebarForkFailed:`未能创建分叉,原会话已保留。`,sidebarCopy:`复制`,sidebarCopyLink:`复制会话链接`,sidebarCopyMarkdown:`复制为 Markdown`,sidebarCopyCwd:`复制工作目录`,sidebarCopied:`已复制`,sidebarCopyFailed:`复制失败,请重试。`,sidebarNewWindow:`在新窗口中打开`,sidebarOpenIn:`打开方式`,sidebarAppsLoading:`正在加载可用应用…`,sidebarAppsFailed:`无法加载应用,请重新打开菜单重试。`,sidebarOpenFailed:`无法在所选应用中打开此项目。`,sidebarArchive:`归档`,sidebarRestore:`恢复`,sidebarDelete:`永久删除`,managedWorktreeRecoveryFull:`请先核对先前未确认的移除请求,再开始新的请求。`,managedWorktreesChanged:`工作树列表已变化,请刷新后重新核对目标。`,managedWorktreesRefresh:`刷新工作树列表`,managedWorktreesBack:`返回工作树列表`,managedWorktreesRetry:`重试请求`,managedWorktrees:`保留的工作树`,managedWorktreesDescription:`删除会话会保留 OpenPI 创建的工作树。请核对准确路径后再请求移除。使用中、共享、有改动或无法确认归属的工作树会保留。`,managedWorktreeConfirm:`移除此工作树?服务端会重新核对归属、使用中的会话及本地改动后再操作。`,managedWorktreeRemoved:`工作树已移除。`,managedWorktreePreserved:`工作树已保留:`,managedWorktreeUncertainTerminal:`移除结果无法确认,不能自动重复移除。请先检查保留路径,再决定后续操作。`,managedWorktreeUncertain:`尚不能确认移除结果。重试会核对原请求。`,managedWorktreeRemoving:`正在核对并移除…`,managedWorktreeRemove:`移除工作树`,managedWorktreeReview:`核对移除`,managedWorktreesEmpty:`这一页没有找到托管工作树。`,managedWorktreesUnavailable:`有 {{count}} 条归属记录无法确认。`,managedWorktreesLoadFailed:`无法加载保留的工作树。请重试,目标不会改变。`,managedWorktreesMore:`加载更多工作树`,managedWorktreeRetainedAfterDelete:`会话已删除,工作树保留在 {{path}}。可从项目菜单核对保留的工作树。`,sidebarDeleteTitle:`删除会话?`,sidebarDeleteDescription:`确定永久删除“{{name}}”?此操作无法撤销。`,sidebarDeleteConfirm:`删除`,sidebarDeleting:`正在删除…`,sidebarDeleteFailed:`未能删除此会话,请重试或取消。`,sidebarActionRunning:`请等待当前工作和排队消息结束。`,sidebarActionDisconnected:`请先恢复连接,再修改此会话。`,sessionDeleteCancelled:`删除已取消`,sessionDeleteUncertain:`无法确认会话是否删除,请刷新后重试`,sessionDeleted:`会话已永久删除`,sessionDeleteMetadataPending:`会话已删除,但侧栏记录未清理完成`,sessionLinkUnavailable:`链接中的会话已不存在或身份已变化`,sidebarDropPin:`拖到此处置顶`,sidebarDropProjectLast:`将项目移到最后`,conversationTurns:`会话轮次`,conversationTurnPosition:`前往第 {{position}} 轮`,turnPreviewLoading:`正在加载预览…`,turnPreviewUnavailable:`暂时无法读取,请重试。`,commands:`斜杠命令`,addContext:`添加上下文`,fileReference:`引用工作区文件`,fileReferenceTitle:`引用工作区文件`,fileReferenceDetail:`将路径引用加入提示词,不上传文件内容。`,fileReferenceLabel:`工作区文件路径`,fileReferencePlaceholder:`src/app.tsx`,fileReferenceValidatedHint:`当前会话会验证该路径是可读取的工作区文件。`,fileReferenceDraftHint:`新会话启动后,Pi 会按其工具权限解析该路径。`,fileReferenceChecking:`正在检查…`,fileReferenceFailed:`无法验证该文件。`,fileReferenceDenied:`请选择当前会话工作区内的文件。`,fileReferenceMissing:`该工作区文件已不存在。`,fileReferenceUnsupported:`只能引用工作区中的普通文件。`,fileReferenceExpired:`活动会话已变化,请重新打开文件引用后再试。`,fileReferenceBusy:`文件校验正忙,请稍后重试。`,insertReference:`插入引用`,commandsSessionRequired:`会话启动后才能插入斜杠命令。`,commandsEmptyDraftOnly:`只能在空白草稿中插入斜杠命令。`,commandsLoading:`正在加载命令…`,commandsUnavailable:`暂时无法读取命令。`,commandsNoMatch:`没有匹配的命令。`,commandsNoAvailable:`已发现的命令均不能在 Web 中运行。输入具体命令名可查看其可用性。`,commandsBounded:`另有 {{count}} 个命令未显示。`,commandSessionRequired:`命令仅在已创建的 Web 会话中可用。`,commandUnsupported:`尚未适配 · 手动命令仍交给 Pi`,commandAcceptsArguments:`可输入参数`,commandSource_extension:`扩展命令`,commandSource_prompt:`提示词模板`,commandSource_skill:`技能`,copiedMessage:`已复制`,copyMessage:`复制消息`,copyFailed:`复制失败,请选中消息后手动复制。`,copiedCode:`代码已复制`,copyCode:`复制代码`,copyCodeFailed:`无法复制代码,请选中后手动复制。`,codeBlock:`代码块`,wrapCode:`自动换行`,expandCode:`展开全部 {{count}} 行`,collapseCode:`收起代码`,expandInput:`展开输入框`,collapseInput:`收起输入框`,deleteWorkspace:`删除工作区`,describeTask:`描述任务`,editMessage:`修改并从这里重跑`,enterHint:`按 Enter 发送,Shift+Enter 换行。`,expandSidebar:`展开侧边栏`,importWorkspace:`导入工作区`,loadingModels:`正在加载模型...`,modelsTruncated:`当前显示 {{shown}} 个模型,还有 {{omitted}} 个可用;搜索即可查找。`,searchModels:`搜索可用模型`,searchModelsPlaceholder:`搜索服务商、模型名称或 ID...`,searchingModels:`正在搜索模型...`,noMatchingModels:`没有匹配的模型`,modelSearchFailed:`模型搜索失败,请重试。`,retryModelSearch:`重试模型搜索`,fileReferenceDraftChanged:`草稿已变化,请重新打开文件引用。`,modelSearchTruncated:`还有 {{omitted}} 个匹配模型未显示。`,modelPreparing:`正在准备任务...`,modelRetrying:`模型请求重试中...`,modelRunning:`正在运行…`,modelRequestFailed:`模型请求失败`,modelRequestStopped:`模型请求已停止`,modelFailureUnknown:`服务商没有返回具体失败原因。`,retryPrompt:`重试消息`,retryingPrompt:`正在重试…`,newSession:`新建会话`,noConversations:`暂无对话`,noMatching:`没有匹配的会话`,noMatchingLoaded:`已加载历史中没有匹配的会话`,noModels:`没有可用模型`,noOutput:`无输出`,noSessions:`暂无会话`,openSidebar:`打开侧边栏`,promptMessage:`发消息或创建任务,/ 调用指令`,promptReadonly:`非当前会话不能接收消息`,promptStart:`选择一个工作区开始`,promptTask:`描述你想要构建的任务`,queuedHint:`当前回合结束后将发送消息。`,reconnecting:`正在重连`,removeWorkspace:`从侧边栏移除`,workspaceOptions:`工作区选项`,renameFailed:`无法保存名称,已保留你的修改。`,savingName:`正在保存...`,workspaceRemoveFailed:`无法移出工作区,请重试。`,removingWorkspace:`正在移出...`,renameConversation:`重命名会话`,renameWorkspace:`重命名工作区`,save:`保存`,searchConversations:`搜索会话`,searchPlaceholder:`筛选标题与工作目录…`,selectModel:`选择模型`,configureModels:`配置模型`,openModelSettings:`模型设置`,selectThinking:`选择思考等级`,thinkingAvailableLevels:`可选等级:{{levels}}`,resetThinking:`恢复打开时的等级({{level}})`,modelThinkingNotEnabled:`此模型未启用思考。如提供商支持,可在模型设置中开启「支持推理」。`,providerReasoningHint:`按提供商能力开启,在聊天输入框调节当前思考等级。`,providerThinkingLevels:`支持的思考等级`,providerThinkingLevelsHint:`选择此模型支持的等级,保存后同步到会话选择器。`,providerThinkingAutomatic:`自动(Pi 默认)`,providerThinkingSelected:`已选 {{count}} 项`,providerThinkingReset:`使用 Pi 默认等级`,providerImageHint:`未勾选图片时,模型不会收到图片附件。`,selectWorkspace:`选择工作区`,send:`发送`,processDetails:`执行过程`,processRunning:`正在执行`,processThinkingCount:`{{count}} 段思考`,processToolCount:`{{count}} 次工具调用`,processFailureCount:`{{count}} 次失败`,runtimeActivities:`执行活动`,activityAgentProgress:`{{completed}}/{{total}} 个子代理已结束`,activityCapacity:`并行任务:{{running}}/{{limit}} · {{queued}} 个等待中`,composerQueuedCount:`排队 {{count}}`,composerSteeringCount:`引导 {{count}}`,runtimeActivityRunning:`{{count}} 项进行中`,runtimeActivityCount:`{{count}} 项活动`,processActivityCount:`{{count}} 项 Agent 活动`,switchingSession:`正在切换会话...`,thinkingActive:`思考中...`,thinkingActiveLevel:`思考中({{level}})...`,thinkingDone:`思考过程`,thinkingLoadFull:`查看完整思考`,thinkingLoadingFull:`正在加载思考…`,thinkingLoadFailed:`思考加载失败,点击重试`,thinkingPartialText:`当前显示部分已保存的思考,可继续加载下方内容。`,thinkingPreviewOnly:`思考预览已达到显示上限,此消息保存后可查看完整内容。`,toolState_running:`执行中`,toolState_returned:`已返回`,toolState_failed:`失败`,toolState_cancelled:`已停止`,toolState_timed_out:`超时`,toolState_unknown:`未确认`,toolSnapshotMissingResult:`分叉时尚无结果`,toolActivity_running:`正在{{action}}`,toolActivity_failed:`{{action}}失败`,toolActivity_cancelled:`{{action}}已停止`,toolActivity_timed_out:`{{action}}超时`,toolActivity_unknown:`{{action}}`,toolAction_read:`读取`,toolAction_write:`写入文件`,toolAction_edit:`编辑文件`,toolAction_command:`运行`,toolAction_search:`搜索`,toolAction_list:`列出文件`,toolAction_web:`浏览网页`,toolAction_agent:`使用子代理`,subagentAction_spawn:`启动子代理`,subagentAction_send:`发送补充消息`,subagentAction_check:`查询子代理`,subagentAction_wait:`等待子代理`,subagentAction_cancel:`停止子代理`,subagentActionDone_spawn:`已启动子代理`,subagentActionDone_send:`已发送补充消息`,subagentActionDone_check:`已查询子代理`,subagentActionDone_wait:`已结束等待`,subagentActionDone_cancel:`停止请求已返回`,toolAction_workflow:`调用工作流`,toolAction_plan:`准备计划`,toolAction_git:`查看变更`,toolAction_call:`调用工具`,toolActionDone_read:`已读取`,toolActionDone_write:`已写入`,toolActionDone_edit:`已编辑`,toolActionDone_command:`已运行`,toolActionDone_search:`已搜索`,toolActionDone_list:`已列出的文件`,toolActionDone_web:`已浏览网页`,toolActionDone_agent:`子代理工具已返回`,toolActionDone_workflow:`工作流工具已返回`,toolActionDone_plan:`计划工具已返回`,toolActionDone_git:`已查看变更`,toolActionDone_call:`已调用工具`,toolActionGroup_read:`读取文件`,toolActionGroup_write:`写入文件`,toolActionGroup_edit:`编辑文件`,toolActionGroup_command:`运行命令`,toolActionGroup_search:`搜索`,toolActionGroup_list:`列出文件`,toolActionGroup_web:`浏览网页`,toolActionGroup_agent:`子代理活动`,toolActionGroup_workflow:`工作流活动`,toolActionGroup_plan:`准备计划`,toolActionGroup_git:`查看变更`,toolActionGroup_call:`调用工具`,toolGroup_done:`{{actions}}`,toolGroup_running:`正在{{actions}}`,toolGroup_unknown:`{{actions}}`,toolGroupSeparator:`、`,toolSearchTarget:`“{{pattern}}” · {{path}}`,toolDiffStatsHelp:`当前显示差异中的新增和删除行数`,toolRequestedFile:`文件:`,toolWorkspace:`工作区`,toolRawEvidence:`参数与原始结果`,toolCodemodeDetails:`脚本与原始结果`,toolNestedOutputMissing:`会话记录保留了调用和状态,未保存此子工具的输出。`,toolNestedArgumentsMissing:`会话记录未保留完整参数和此子工具的输出。`,toolNestedIncomplete:`子调用记录不完整,部分调用、参数或最终状态不可用。`,toolPartialEvidence:`输出未完整显示:已达到字节、行数或条目上限。原始结果也可能被截断。`,toolFileChange_created:`已创建文件`,toolFileChange_unchanged:`文件内容未改变`,toolFileChange_overwritten:`已覆盖文件`,toolChangeUnavailable:`此工具结果未提供修改对比。`,toolTestResults:`测试结果摘要 · {{format}}`,toolTestCounts:`{{tests}} 项测试 · {{passed}} 通过 · {{failed}} 失败 · {{cancelled}} 取消`,toolTestCountsHelp:`数量来自命令输出,执行状态单独显示。`,toolReadMore:`可使用文件路径和 offset 继续读取,具体方式见原始结果。`,toolFullOutputReference:`完整输出:`,subagentBackgroundResult:`后台子代理结果 · {{count}}`,thinkingDraftHint:`请先选择工作区并创建会话。`,thinkingInactiveHint:`只有当前会话可以更改思考等级。`,thinkingLevelMismatch:`当前确认的思考等级不在此模型支持范围内;选择其它等级即可修正。`,thinkingLockedRunning:`请先停止当前轮次,再更改思考等级。`,thinkingModelPendingHint:`请等待模型切换完成。`,thinkingNotConfirmed:`思考等级未获确认,请重试。`,thinkingPendingHint:`正在应用思考等级...`,thinkingUnsupported:`暂不支持思考`,thinkingUnsupportedHint:`尚未选择模型,或当前模型不支持思考。`,unavailable:`不可用`,ungrouped:`未分组`,untitledSession:`新会话`,workspaceDeleteConfirm:`文件夹与会话记录会保留,其中的会话会被放到“未分组”;再次打开此目录时将是一个干净的工作区。`,workspaceName:`工作区名称`,workspaces:`工作区`,sidebarProjects:`项目`}}},dG=navigator.language?.toLowerCase().startsWith(`zh`)?`zh`:`en`;Xl.use(Zl).init({fallbackLng:`en`,initAsync:!1,interpolation:{escapeValue:!1},lng:dG,resources:uG}),document.documentElement.lang=dG===`zh`?`zh-CN`:`en`;var fG=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},pG=10,mG=13,hG=32,gG=6;function _G(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{maxBufferSize:t,onComment:n,onError:r,onEvent:i,onId:a,onRetry:o}=e,s=[],c=0,l=!0,u,d=``,f=0,p,m=!1,h=!1,g=!1;function _(e){if(m)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l&&(l=!1,e.charCodeAt(0)===65279?e=e.slice(1):e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),(h||g)&&(e=v(e),!e))return;if(!s.length){let t=S(e);t!==``&&y(t),x();return}if(e.indexOf(` +`)?RI(e,II(t)):e.startsWith(` `)?RI(e,t):RI(e,LI(t))}[...OI,...kI],[...kI];function BI(e){return mM(e,``)?[]:[e.slice(0,1),e.slice(1)]}function VI(e,t){return vM(e,(e,n)=>t.startsWith(e)?!0:VI(n,t),()=>!1)}function HI(e,t,n=``){return wI(BI(t),(r,i)=>VI(e,t)?[n,t]:HI(e,i,`${n}${r}`),()=>[])}function UI(e,t){return wI(HI(e,t),(e,t)=>mM(e,``)?[]:[e,t],()=>[])}var WI=(e,t,n=()=>[])=>e.length===2?t(e):n(),GI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[dI(e),t]),KI=e=>WI(zI(`.*`,e),([e,t])=>[fI(e),t]),qI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,e),([e,t])=>[pI(e),t]),JI=e=>WI(zI(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[mI(e),t]),YI=e=>WI(zI(`(?!)`,e),([e,t])=>[hI(e),t]),XI=e=>WI(UI([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[gI(e),t]),ZI=e=>WI(WI(GI(e),([e,t])=>[e,t],()=>WI(KI(e),([e,t])=>[e,t],()=>WI(qI(e),([e,t])=>[e,t],()=>WI(JI(e),([e,t])=>[e,t],()=>WI(YI(e),([e,t])=>[e,t],()=>WI(QI(e),([e,t])=>[e,t],()=>WI(XI(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[_I(e),t]),QI=e=>WI(WI(zI(`(`,e),([e,t])=>WI(tL(t),([t,n])=>WI(zI(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[vI(e),t]),$I=e=>WI(WI(WI(eL(e),([e,t])=>WI(zI(`|`,t),([t,n])=>WI($I(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>WI(WI(eL(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>WI([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[yI(e),t]),eL=e=>WI(WI(ZI(e),([e,t])=>WI(tL(t),([t,n])=>[[e,t],n])),([e,t])=>[bI(e),t]),tL=e=>WI(WI($I(e),([e,t])=>[e,t],()=>WI(eL(e),([e,t])=>[e,t],()=>[])),([e,t])=>[xI(e),t]),nL=e=>WI(WI(zI(`^`,e),([e,t])=>WI(tL(t),([t,n])=>WI(zI(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[SI(e),t]);function rL(e){return e.join(`|`)}function iL(e){return e.slice(1,e.length-1)}function aL(e,t,n){return gL(t,`${n}${e}`)}function oL(e,t){return gL(e,`${t}${eP}`)}function sL(e,t){return gL(e,`${t}${iP}`)}function cL(e,t){return gL(e,`${t}${gP}`)}function lL(e,t){return hL(CP([lP(`false`),lP(`true`)]),e,t)}function uL(e,t){return gL(e,`${t}.*`)}function dL(e,t,n){return gL(t,`${n}${iL(e)}`)}function fL(e,t,n){return hL(yL(e,{}),t,n)}function pL(e,t,n){return hL(TF(e),t,n)}function mL(e,t,n,r=[]){return vM(e,(e,i)=>mL(i,t,n,[...r,hL(e,[],``)]),()=>gL(t,`${n}(${rL(r)})`))}function hL(e,t,n){return WN(e)?pL(e.enum,t,n):oP(e)?sL(t,n):pP(e)?aL(e.const,t,n):nP(e)?oL(t,n):rP(e)?lL(t,n):vP(e)?cL(t,n):SP(e)?uL(t,n):CL(e)?dL(e.pattern,t,n):SL(e)?fL(e.parameters[0],t,n):wP(e)?mL(e.anyOf,t,n):bN}function gL(e,t){return vM(e,(e,n)=>hL(e,n,t),()=>t)}function _L(e){return`^${gL(e,``)}$`}function vL(e){return MP(_L(e))}function yL(e,t){return NU(e)?JM(vL(e),{},t):xL(e,t)}function bL(e,t,n,r){return yL(IU(e,t,n),r)}function xL(e,t={}){return ZM(`TemplateLiteral`,[e],t)}function SL(e){return XM(e)&&bM(e,`action`)&&mM(e.action,`TemplateLiteral`)}function CL(e){return YM(e,`TemplateLiteral`)}function wL(e){return KM({"~kind":`ExtendsUnion`},{inferred:e})}function TL(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`inferred`)&&mM(e[`~kind`],`ExtendsUnion`)&&fM(e.inferred)}function EL(e){return KM({"~kind":`ExtendsTrue`},{inferred:e})}function DL(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`inferred`)&&mM(e[`~kind`],`ExtendsTrue`)&&fM(e.inferred)}function OL(){return KM({"~kind":`ExtendsFalse`},{})}function kL(e){return fM(e)&&bM(e,`~kind`)&&mM(e[`~kind`],`ExtendsFalse`)}function AL(e){return TL(e)||DL(e)}function jL(e,t,n){return AL(e)?t(e.inferred):n()}function ML(e,t,n,r){return jL(XR(e,n,r),r=>EL(jM(jM(e,r),{[t]:n})),()=>OL())}function NL(e,t){return EL(e)}function PL(e,t,n,r,i){return jL(XR(e,t,n),e=>jL(XR(e,t,r),e=>EL(e),()=>OL()),()=>jL(XR(e,t,i),e=>EL(e),()=>OL()))}function FL(e,t,n){return XR(e,t,TF(n))}function IL(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>IL(e,t,r),()=>OL()),()=>EL(e))}function LL(e,t,n){return XR(e,t,DF(n))}function RL(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>EL(e),()=>RL(e,t,r)),()=>OL())}function zL(e,t,n){return yN(n)?NL(e,t):zN(n)?PL(e,t,n.if,n.then,n.else):WN(n)?FL(e,t,n.enum):LN(n)?ML(e,n.name,t,n.extends):KN(n)?IL(e,t,n.allOf):CL(n)?LL(e,t,n.pattern):wP(n)?RL(e,t,n.anyOf):NN(n)?EL(e):OL()}function BL(e,t,n){return LN(n)?zL(e,t,n):yN(n)||NN(n)?EL(e):wL(e)}function VL(e,t){let n=ZN(e),r=ZN(t);return n&&r||!n&&r?!0:!(n&&!r)}function HL(e,t,n,r){return oN(r)?VL(t,r)?XR(e,n,r.items):OL():zL(e,t,r)}function UL(e,t,n){return nP(n)?EL(e):zL(e,t,n)}function WL(e,t,n){return rP(n)?EL(e):zL(e,t,n)}function GL(e,t,n,r,i){let a=LN(r)?t:r,o=LN(r)?r:t,s=TN(t),c=TN(r);return!s&&c?OL():jL(XR(e,a,o),e=>JL(e,n,i),()=>OL())}function KL(e,t,n,r){return vM(r,(r,i)=>GL(e,t,n,r,i),()=>TN(t)?EL(e):OL())}function qL(e,t,n){return vM(t,(t,r)=>KL(e,t,r,n),()=>EL(e))}function JL(e,t,n){return qL(e,t,n)}function YL(e,t,n){return uI(n)?EL(e):XR(e,t,n)}function XL(e,t,n,r){return yN(r)||NN(r)?EL(e):lN(r)?jL(JL(e,t,r.parameters),e=>YL(e,n,r.instanceType),()=>OL()):OL()}function ZL(e,t,n,r,i){return jL(XR(e,t,i),()=>XR(e,n,i),()=>XR(e,r,i))}function QL(e,t,n){return XR(e,TF(t),n)}function $L(e,t,n,r){return yN(r)||NN(r)?EL(e):fN(r)?jL(JL(e,t,r.parameters),e=>YL(e,n,r.returnType),()=>OL()):OL()}function eR(e,t,n){return oP(n)||vP(n)?EL(e):zL(e,t,n)}function tR(e,t,n){return XR(e,EF(t),n)}function nR(e,t,n){return t===n?EL(e):OL()}function rR(e,t,n){return pP(n)?nR(e,t,n.const):nP(n)?EL(e):zL(e,lP(t),n)}function iR(e,t,n){return pP(n)?nR(e,t,n.const):rP(n)?EL(e):zL(e,lP(t),n)}function aR(e,t,n){return pP(n)?nR(e,t,n.const):vP(n)?EL(e):zL(e,lP(t),n)}function oR(e,t,n){return pP(n)?nR(e,t,n.const):SP(n)?EL(e):zL(e,lP(t),n)}function sR(e,t,n){return sM(t.const)?rR(e,t.const,n):cM(t.const)?iR(e,t.const,n):uM(t.const)?aR(e,t.const,n):pM(t.const)?oR(e,t.const,n):JN()}function cR(e,t,n){return LN(n)?zL(e,t,n):EL(e)}function lR(e,t,n){return hP(n)?EL(e):zL(e,t,n)}function uR(e,t,n){return vP(n)?EL(e):zL(e,t,n)}function dR(e,t,n){return TN(t)?TN(n)?EL(e):OL():EL(e)}function fR(e,t,n){return LN(n)&&SN(n.extends)?OL():jL(XR(e,t,n),e=>dR(e,t,n),()=>OL())}function pR(e,t){return e.reduce((e,n)=>n in t&&AL(t[n])?{...e,...t[n].inferred}:JN(),{})}function mR(e,t,n){let r={};for(let i of xM(n))r[i]=i in t?fR({},t[i],n[i]):TN(n[i])?LN(n[i])?EL(jM(e,{[n[i].name]:n[i].extends})):EL(e):OL();let i=CM(r).every(e=>AL(e)),a=i?pR(xM(r),r):{};return i?EL(a):OL()}function hR(e,t,n){let r=mR(e,t,n);return AL(r)?EL(jM(e,r.inferred)):OL()}function gR(e,t,n){return hR(e,t,n)}function _R(e,t){return xM(t).reduce((n,r)=>({...n,[r]:bM(e,r)?wP(n[r])?CP([...n[r].anyOf,t[r]]):CP([e[r],t[r]]):t[r]}),e)}function vR(e,t,n,r){return vM(t,(t,i)=>jL(XR({},e[t],n),t=>vR(e,i,n,_R(r,t)),()=>OL()),()=>EL(r))}function yR(e,t,n,r){return vR(t,xM(t),r,e)}function bR(e,t,n){return iI(n)?yR(e,t,tI(n),rI(n)):AN(n)?gR(e,t,n.properties):zL(e,kN(t),n)}function xR(e,t){return mM(xM(t).length,0)?EL(e):OL()}function SR(e,t,n,r,i){return XR(e,n,i)}function CR(e,t,n,r){return iI(r)?SR(e,eI(t),n,eI(tI(r)),rI(r)):AN(r)?xR(e,r.properties):yN(r)||NN(r)?EL(e):OL()}function wR(e,t,n){return SP(n)?EL(e):zL(e,t,n)}function TR(e,t,n){return bP(n)?EL(e):zL(e,t,n)}function ER(e,t,n){return XR(e,DF(t),n)}function DR(e,t){return KM({"~kind":`Inferrable`},{name:e,type:t},{})}function OR(e){return fM(e)&&bM(e,`~kind`)&&bM(e,`name`)&&bM(e,`type`)&&mM(e[`~kind`],`Inferrable`)&&pM(e.name)&&fM(e.type)}function kR(e){return oI(e)?LN(e.items)?oN(e.items.extends)?DR(e.items.name,e.items.extends.items):NN(e.items.extends)?DR(e.items.name,e.items.extends):void 0:JN():void 0}function AR(e){return LN(e)?DR(e.name,e.extends):void 0}function jR(e,t,n=[]){return vM(e,(e,r)=>jL(XR({},e,t),()=>jR(r,t,[...n,e]),()=>void 0),()=>n)}function MR(e,t,n,r){let i=jR(n,r);return oM(i)?EL(jM(e,{[t]:KP(i)})):OL()}function NR(e,t,n,r){let i=jR(n,r);return oM(i)?EL(jM(e,{[t]:CP(i)})):OL()}function PR(e){return[...e].reverse()}function FR(e,t){return t?PR(e):e}function IR(e){let t=e.length>0?e[0]:void 0;return XM(XM(t)?kR(t):void 0)}function LR(e,t,n,r,i,a){return jL(XR(e,n,i),e=>BR(e,t,r,a),()=>OL())}function RR(e,t,n,r,i){let a=kR(r);return OR(a)?MR(e,a.name,FR(n,t),a.type):vM(n,(n,a)=>LR(e,t,n,a,r,i),()=>OL())}function zR(e,t,n,r){return vM(r,(r,i)=>RR(e,t,n,r,i),()=>mM(n.length,0)?EL(e):OL())}function BR(e,t,n,r){return zR(e,t,n,r)}function VR(e,t,n){let r=FU(e,MU([],[]),n),i=IR(r);return BR(e,i,FR(t,i),FR(r,i))}function HR(e,t,n){let r=AR(n);return OR(r)?NR(e,r.name,t,r.type):vM(t,(t,r)=>jL(XR(e,t,n),e=>HR(e,r,n),()=>OL()),()=>EL(e))}function UR(e,t,n){let r=FU(e,MU([],[]),t);return qP(n)?VR(e,r,n.items):oN(n)?HR(e,r,n.items):zL(e,KP(r),n)}function WR(e,t,n){return uI(n)||lI(n)?EL(e):zL(e,t,n)}function GR(e,t,n){return vM(n,(n,r)=>jL(XR(e,t,n),e=>EL(e),()=>GR(e,t,r)),()=>OL())}function KR(e,t,n){return vM(t,(t,r)=>jL(GR(e,t,n),e=>KR(e,r,n),()=>OL()),()=>EL(e))}function qR(e,t,n){let r=AR(n);return OR(r)?NR(e,r.name,t,r.type):wP(n)?KR(e,t,n.anyOf):KR(e,t,[n])}function JR(e,t,n){return LN(n)?zL(e,t,n):yN(n)||NN(n)?EL(e):OL()}function YR(e,t,n){return uI(n)?EL(e):zL(e,t,n)}function XR(e,t,n){return yN(t)?BL(e,t,n):oN(t)?HL(e,t,t.items,n):nP(t)?UL(e,t,n):rP(t)?WL(e,t,n):lN(t)?XL(e,t.parameters,t.instanceType,n):zN(t)?ZL(e,t.if,t.then,t.else,n):WN(t)?QL(e,t.enum,n):fN(t)?$L(e,t.parameters,t.returnType,n):oP(t)?eR(e,t,n):KN(t)?tR(e,t.allOf,n):pP(t)?sR(e,t,n):SN(t)?cR(e,t,n):hP(t)?lR(e,t,n):vP(t)?uR(e,t,n):AN(t)?bR(e,t.properties,n):iI(t)?CR(e,tI(t),rI(t),n):SP(t)?wR(e,t,n):bP(t)?TR(e,t,n):CL(t)?ER(e,t.pattern,n):qP(t)?UR(e,t.items,n):lI(t)?WR(e,t,n):wP(t)?qR(e,t.anyOf,n):NN(t)?JR(e,t,n):uI(t)?YR(e,t,n):OL()}function ZR(e,t){return EF([...e,kN(t)])}function QR(e,t,n){return NU(e)?JM(ZR(e,t),{},n):ez(e,t,n)}function $R(e,t,n,r,i){return QR(IU(e,t,n),PU(e,t,r),i)}function ez(e,t,n={}){return ZM(`Interface`,[e,t],n)}function tz(e){return XM(e)&&bM(e,`action`)&&mM(e.action,`Interface`)}function nz(e,t,n){return e.includes(n)?!0:az([...e,n],t,t[n])}function rz(e,t,n){return iz(e,t,ON(n))}function iz(e,t,n){return vM(n,(n,r)=>az(e,t,n)?!0:iz(e,t,r),()=>!1)}function az(e,t,n){return hN(n)?nz(e,t,n.$ref):oN(n)?az(e,t,n.items):lN(n)?iz(e,t,[...n.parameters,n.instanceType]):fN(n)?iz(e,t,[...n.parameters,n.returnType]):tz(n)?rz(e,t,n.parameters[1]):KN(n)?iz(e,t,n.allOf):AN(n)?rz(e,t,n.properties):wP(n)?iz(e,t,n.anyOf):qP(n)?iz(e,t,n.items):iI(n)?az(e,t,rI(n)):!1}function oz(e,t,n){return az(e,t,n)}function sz(e,t){return t.reduce((t,n)=>oz([n],e,e[n])?[...t,n]:t,[])}function cz(e){return sz(e,DN(e))}function lz(e,t,n){return n.includes(t)?n:t in e?fz(e,e[t],[...n,t]):JN()}function uz(e,t,n){return dz(e,ON(t),n)}function dz(e,t,n){return t.reduce((t,n)=>fz(e,n,t),n)}function fz(e,t,n){return hN(t)?lz(e,t.$ref,n):oN(t)?fz(e,t.items,n):lN(t)?dz(e,[...t.parameters,t.instanceType],n):fN(t)?dz(e,[...t.parameters,t.returnType],n):tz(t)?uz(e,t.parameters[1],n):KN(t)?dz(e,t.allOf,n):AN(t)?uz(e,t.properties,n):wP(t)?dz(e,t.anyOf,n):qP(t)?dz(e,t.items,n):iI(t)?fz(e,rI(t),n):n}function pz(e,t,n){return fz(e,n,[t])}function mz(e){return vN()}function hz(e){return xM(e).reduce((t,n)=>({...t,[n]:_z(e[n])}),{})}function gz(e){return e.reduce((e,t)=>[...e,_z(t)],[])}function _z(e){return hN(e)?mz(e.$ref):oN(e)?aN(_z(e.items),sN(e)):lN(e)?cN(gz(e.parameters),_z(e.instanceType)):fN(e)?dN(gz(e.parameters),_z(e.returnType)):KN(e)?GN(gz(e.allOf)):AN(e)?kN(hz(e.properties)):iI(e)?QF(nI(e),_z(rI(e))):wP(e)?CP(gz(e.anyOf)):qP(e)?KP(gz(e.items)):e}function vz(e,t){return t in e?_z(e[t]):MN()}function yz(e){return vz(e.$defs,e.$ref)}function bz(e,t,n){let r=IU(e,MU([],[]),t),i=PU({},MU([],[]),n);return EF([...r,kN(i)])}function xz(e,t){return xM(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=tz(r)?bz(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function Sz(e,t,n){return PN(xz(e,pz(e,t,n)),t)}function Cz(e,t){return t in e?hN(e[t])?Cz(e,e[t].$ref):e[t]:xN()}function wz(e,t){return Cz(e,t)}function Tz(e){return FN(e)?yz(e):IN(e)?MN():e}function Ez(e,t,n){return XR(e,Tz(t),Tz(n))}function Dz(e,t){let n=[Ez({},e,t),Ez({},t,e)];return AL(n[0])&&AL(n[1])?0:AL(n[0])&&kL(n[1])?2:kL(n[0])&&AL(n[1])?3:1}function Oz(e,t,n=[],r=t){return vM(t,(t,i)=>{let a=Dz(e,t);return mM(a,2)||mM(a,0)?r:mM(a,1)?Oz(e,i,[...n,t],r):Oz(e,i,n,r)},()=>[...n,e])}function kz(e,t,n){let r=kF(e);return yN(r)||NN(r)?[r]:SN(r)?Az(t,n):AN(r)?Az(t,[...n,r]):Az(t,Oz(r,n))}function Az(e,t=[]){return vM(e,(e,n)=>kz(e,n,t),()=>t)}function jz(e){return zF(Az(e))}function Mz(e,t){return JM(kF(e),{},t)}function Nz(e,t,n,r){return Mz(BU(e,t,n),r)}function Pz(e,t=[]){return QM(e)&&mM(e.action,`Conditional`)?hN(e.parameters[0])?Pz(e.parameters[2],Pz(e.parameters[3],[...t,e.parameters[0].$ref])):Pz(e.parameters[2],Pz(e.parameters[3],t)):QM(e)&&mM(e.action,`Mapped`)&&QM(e.parameters[1])&&mM(e.parameters[1].action,`KeyOf`)&&hN(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function Fz(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function Iz(e,t,n=[]){return vM(e,(e,r)=>vM(t,(t,i)=>Iz(r,i,[...n,[t,e]]),()=>n),()=>n)}function Lz(e){return CL(e)?DF(e.pattern):WN(e)?TF(e.enum):e}function Rz(e){let t=Lz(e);return wP(t)?[...t.anyOf]:[t]}function zz(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function Bz(e,t){return t.reduce((t,n)=>[...t,...zz(e,n)],[])}function Vz(e){return e.reduce((e,t)=>mM(t[0],!0)?Bz(e,Rz(t[1])):Bz(e,[t[1]]),[[]])}function Hz(e,t,n){let r=Iz(t,Fz(e,Pz(n)));return QM(n)&&mM(n.action,`Conditional`)||QM(n)&&mM(n.action,`Mapped`)?Vz(r):[t]}function Uz(){return[`(not-resolvable)`,xN()]}function Wz(){return[`(not-generic)`,xN()]}function Gz(e,t,n){return[e,gN(t,n)]}function Kz(e,t,n){return t in e?qz(e,t,e[t],n):Uz()}function qz(e,t,n,r){return _N(n)?Gz(t,n.parameters,n.expression):hN(n)?Kz(e,n.$ref,r):Wz()}function Jz(e,t,n){return qz(e,`(anonymous)`,t,n)}function Yz(e,t,n){if(LN(t)||fB(t)||AL(Ez({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function Xz(e,t,n,r,i){let a=BU(e,t,i);return Yz(n,a,r),jM(e,{[n]:a})}function Zz(e,t,n,r,i){let a=BU(e,t,n.extends),o=BU(e,t,n.equals);return vM(i,(i,o)=>Qz(Xz(e,t,n.name,a,i),t,r,o),()=>Qz(Xz(e,t,n.name,a,o),t,r,[]))}function Qz(e,t,n,r){return vM(n,(n,i)=>Zz(e,t,n,i,r),()=>e)}function $z(e,t,n,r){return Qz(e,t,n,r)}var eB=0,tB=0;function nB(){if(!gM(tB,kM().maxInstantiationCount))throw Error(`Type instantiation is excessively deep and possibly infinite`)}function rB(){nB(),tB++,eB++}function iB(){eB--,mM(eB,0)&&(tB=0)}function aB(e){return hM(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function oB(e,t){return mM(aB(e),t)}function sB(e,t,n,r,i,a){rB();try{let o=$z(e,t,r,a),s=BU(o,MU([...t.callstack,n.$ref],t.visited),i);return BU(o,MU([],[]),s)}finally{iB()}}function cB(e,t,n,r,i,a){return a.reduce((a,o)=>{let s=sB(e,t,n,r,i,o);return[...a,s]},[])}function lB(e,t,n,r,i,a){let o=cB(e,t,n,r,i,Hz(r,a,i));return mM(o.length,1)?o[0]:OF(o)}function uB(e,t,n,r){let i=IU(e,t,r),a=Jz(e,n,r),o=a[0],s=a[1];return _N(s)?oB(t,o)?dB(mN(o),i):lB(e,t,mN(o),s.parameters,s.expression,i):dB(n,i)}function dB(e,t){return KM({"~kind":`Call`},{type:`call`,target:e,arguments:t},{})}function fB(e){return YM(e,`Call`)}function pB(e){return qM(e,[`~immutable`])}function mB(e,t){return JM(pB(e),{},t)}function hB(e,t,n,r){return mB(BU(e,t,n),r)}function gB(e,t){return e(t)}function _B(e,t){return pM(t)?lP(gB(e,t)):lP(t)}function vB(e,t){return bB(e,DF(t))}function yB(e,t){return CP(t.map(t=>bB(e,t)))}function bB(e,t){return pP(t)?_B(e,t.const):CL(t)?vB(e,t.pattern):wP(t)?yB(e,t.anyOf):t}function xB(e,t={}){return ZM(`Capitalize`,[e],t)}function SB(e,t={}){return ZM(`Lowercase`,[e],t)}function CB(e,t={}){return ZM(`Uncapitalize`,[e],t)}function wB(e,t={}){return ZM(`Uppercase`,[e],t)}var TB=e=>e[0].toUpperCase()+e.slice(1),EB=e=>e.toLowerCase(),DB=e=>e[0].toLowerCase()+e.slice(1),OB=e=>e.toUpperCase();function kB(e,t){return NU([e])?JM(bB(TB,e),{},t):xB(e,t)}function AB(e,t){return NU([e])?JM(bB(EB,e),{},t):SB(e,t)}function jB(e,t){return NU([e])?JM(bB(DB,e),{},t):CB(e,t)}function MB(e,t){return NU([e])?JM(bB(OB,e),{},t):wB(e,t)}function NB(e,t,n,r){return kB(BU(e,t,n),r)}function PB(e,t,n,r){return AB(BU(e,t,n),r)}function FB(e,t,n,r){return jB(BU(e,t,n),r)}function IB(e,t,n,r){return MB(BU(e,t,n),r)}function LB(e,t,n,r,i={}){return ZM(`Conditional`,[e,t,n,r],i)}function RB(e,t,n,r,i,a){let o=Ez(e,n,r);return TL(o)?CP([BU(o.inferred,t,i),BU(e,t,a)]):DL(o)?BU(o.inferred,t,i):BU(e,t,a)}function zB(e,t,n,r,i,a,o){return NU([n,r])?JM(RB(e,t,n,r,i,a),{},o):LB(n,r,i,a,o)}function BB(e,t,n,r,i,a,o){return zB(e,t,BU(e,t,n),BU(e,t,r),i,a,o)}function VB(e,t={}){return ZM(`ConstructorParameters`,[e],t)}function HB(e){let t=lN(e)?e.parameters:[];return KP(FU({},MU([],[]),t))}function UB(e,t){return NU([e])?JM(HB(e),{},t):VB(e,t)}function WB(e,t,n,r){return UB(BU(e,t,n),r)}function GB(e,t,n={}){return ZM(`Exclude`,[e,t],n)}function KB(e,t,n){return NU([e,t])?JM(CF(e,t),{},n):GB(e,t,n)}function qB(e,t,n,r,i){return KB(BU(e,t,n),BU(e,t,r),i)}function JB(e,t,n={}){return ZM(`Extract`,[e,t],n)}function YB(e,t){return AL(Ez({},e,t))?[e]:[]}function XB(e,t,n=[]){return vM(e,(e,r)=>XB(r,t,[...n,...YB(e,t)]),()=>n)}function ZB(e,t){let n=kF(e);return OF(XB(wP(n)?n.anyOf:[n],t))}function QB(e,t,n){return NU([e,t])?JM(ZB(e,t),{},n):JB(e,t,n)}function $B(e,t,n,r,i){return QB(BU(e,t,n),BU(e,t,r),i)}function eV(e,t,n={}){return ZM(`Index`,[e,t],n)}function tV(e,t){return uV(wz(e,t))}function nV(e,t,n){return uV(wF(e,t,n))}function rV(e,t){let n=xM(e).filter(e=>!bM(t,e)),r=xM(t).filter(t=>!bM(e,t)),i=xM(e).filter(e=>bM(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:EF([e[r],t[r]])}),{});return jM(jM(a,o),s)}function iV(e){return e.reduce((e,t)=>rV(e,uV(t)),{})}function aV(e){return e}function oV(e){return uV(iF(KP(e)))}function sV(e,t){return xM(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:OF([e[r],t[r]])}),{})}function cV(e,t){return vM(e,(e,n)=>cV(n,sV(t,uV(e))),()=>t)}function lV(e){return vM(e,(e,t)=>cV(t,uV(e)),()=>JN())}function uV(e){return FN(e)?tV(e.$defs,e.$ref):zN(e)?nV(e.if,e.then,e.else):KN(e)?iV(e.allOf):wP(e)?lV(e.anyOf):qP(e)?oV(e.items):AN(e)?aV(e.properties):{}}function dV(e){return kN(uV(e))}var fV=RegExp(`^(?:0|[1-9][0-9]*)$`);function pV(e){let t=`${e}`;return fV.test(t)?parseInt(t):e}function mV(e){return lP(pV(e))}function hV(e){return e.map(e=>gV(e))}function gV(e){return KN(e)?GN(hV(e.allOf)):wP(e)?CP(hV(e.anyOf)):pP(e)?mV(e.const):e}function _V(e,t){return AL(Ez({},gV(t),_P()))?e:pP(t)&&mM(t.const,`length`)?_P():xN()}function vV(e,t){return TV(wz(e,t))}function yV(e,t,n){return TV(wF(e,t,n))}function bV(e){return TV(TF(e))}function xV(e){return TV(EF(e))}function SV(e){return[`${e}`]}function CV(e){return TV(DF(e))}function wV(e){return e.reduce((e,t)=>[...e,...TV(t)],[])}function TV(e){return FN(e)?vV(e.$defs,e.$ref):zN(e)?yV(e.if,e.then,e.else):WN(e)?bV(e.enum):KN(e)?xV(e.allOf):pP(e)?SV(e.const):CL(e)?CV(e.pattern):wP(e)?wV(e.anyOf):[]}function EV(e){return TV(e)}function DV(e,t){return t.map(t=>OV(e,t))}function OV(e,t){return oN(t)?aN(OV(e,t.items)):lN(t)?cN(DV(e,t.parameters),OV(e,t.instanceType)):fN(t)?dN(DV(e,t.parameters),OV(e,t.returnType)):qP(t)?KP(DV(e,t.items)):wP(t)?CP(DV(e,t.anyOf)):KN(t)?GN(DV(e,t.allOf)):sI(t)?kN(e):t}function kV(e,t){return OV(e,t)}function AV(e,t){return kV(e,t in e?e[t]:xN())}function jV(e,t){return t.reduce((t,n)=>[...t,AV(e,n)],[])}function MV(e,t){return OF(jV(e,EV(t)))}var NV=new RegExp(JF);function PV(e){return e.filter(e=>NV.test(e))}function FV(e){return OF(jV(e,PV(DN(e))))}function IV(e,t){return vP(t)?FV(e):MV(e,t)}function LV(e){return lP(pV(e))}function RV(e){return e.map(e=>zV(e))}function zV(e){return KN(e)?GN(RV(e.allOf)):wP(e)?CP(RV(e.anyOf)):pP(e)?LV(e.const):e}function BV(e,t){return e.reduceRight((e,n,r)=>AL(Ez({},lP(r),t))?[n,...e]:e,[])}function VV(e,t){return AF(BV(e,zV(t)))}function HV(e){return AF(e)}function UV(e,t){return pP(t)&&mM(t.const,`length`)?lP(e.length):vP(t)||oP(t)?HV(e):VV(e,t)}function WV(e,t){return oN(e)?_V(e.items,t):AN(e)?IV(e.properties,t):qP(e)?UV(e.items,t):xN()}function GV(e){return FN(e)||zN(e)||KN(e)||wP(e)?dV(e):e}function KV(e,t,n){return NU([e,t])?JM(WV(GV(e),t),{},n):eV(e,t,n)}function qV(e,t,n,r,i){return KV(BU(e,t,n),BU(e,t,r),i)}function JV(e,t={}){return ZM(`InstanceType`,[e],t)}function YV(e){return lN(e)?e.instanceType:xN()}function XV(e,t){return NU([e])?JM(YV(e),{},t):JV(e,t)}function ZV(e,t,n,r={}){return XV(BU(e,t,n),r)}function QV(e,t={}){return ZM(`KeyOf`,[e],t)}function $V(){return CP([_P(),xP(),yP()])}function eH(e){return _P()}function tH(e){return e.reduce((e,t)=>uP(t)?[...e,lP(pV(t))]:JN(),[])}function nH(e){return AF(tH(xM(e)))}function rH(e){return nI(e)}function iH(e){return AF(e.map((e,t)=>lP(t)))}function aH(e){return yN(e)?$V():oN(e)?eH(e.items):AN(e)?nH(e.properties):iI(e)?rH(e):qP(e)?iH(e.items):xN()}function oH(e){return FN(e)||zN(e)||KN(e)||wP(e)?dV(e):e}function sH(e,t){return NU([e])?JM(aH(oH(e)),{},t):QV(e,t)}function cH(e,t,n,r){return sH(BU(e,t,n),r)}function lH(e,t,n,r,i={}){return ZM(`Mapped`,[e,t,n,r],i)}function uH(e){return mH(DF(e))}function dH(e){return e.reduce((e,t)=>[...e,...mH(t)],[])}function fH(e){return mH(TF(e))}function pH(e){return uM(e)?[lP(`${e}`)]:[lP(e)]}function mH(e){return WN(e)?fH(e.enum):pP(e)?pH(e.const):CL(e)?uH(e.pattern):wP(e)?dH(e.anyOf):[e]}function hH(e){return mH(e)}function gH(e){return CL(e)?DF(e.pattern):e}function _H(e,t,n,r,i,a){let o=jM(e,{[n.name]:r}),s=gH(BU(o,t,i)),c=BU(o,t,a);return dP(s)||fP(s)?{[s.const]:c}:{}}function vH(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,_H(e,t,n,o,i,a)],[])}function yH(e){return e.reduce((e,t)=>[...e,kN(t)],[])}function bH(e,t,n,r,i,a){return EF(yH(vH(e,t,n,hH(r),i,a)))}function xH(e,t,n,r,i,a,o){return NU([r])?JM(bH(e,t,n,r,i,a),{},o):lH(n,r,i,a,o)}function SH(e,t,n,r,i,a,o){return xH(e,t,n,BU(e,t,r),i,a,o)}function CH(e,t,n){let r=jM(e,t);return xM(t).filter(e=>n.includes(e)).reduce((e,n)=>({...e,[n]:Sz(r,n,t[n])}),{})}function wH(e,t,n){let r=jM(e,t);return xM(t).filter(e=>!n.includes(e)).reduce((e,n)=>({...e,[n]:BU(r,MU([],[]),t[n])}),{})}function TH(e,t,n){let r=cz(t),i=CH(e,t,r),a=wH(e,t,r);return JM({...i,...a},{},n)}function EH(e,t,n,r){return TH(e,n,r)}function DH(e,t={}){return ZM(`NonNullable`,[e],t)}function OH(e){return KB(e,CP([mP(),cI()]),{})}function kH(e,t){return NU([e])?JM(OH(e),{},t):DH(e,t)}function AH(e,t,n,r){return kH(BU(e,t,n),r)}function jH(e,t,n={}){return ZM(`Omit`,[e,t],n)}function MH(e){let t=dV(e);return AN(t)?t.properties:JN()}function NH(e,t){return xM(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function PH(e,t){return kN(NH(MH(e),EV(t)))}function FH(e,t,n){return NU([e,t])?JM(PH(e,t),{},n):jH(e,t,n)}function IH(e,t,n,r,i){return FH(BU(e,t,n),BU(e,t,r),i)}function LH(e,t={}){return ZM(`Parameters`,[e],t)}function RH(e){let t=fN(e)?e.parameters:[];return KP(FU({},MU([],[]),t))}function zH(e,t){return NU([e])?JM(RH(e),{},t):LH(e,t)}function BH(e,t,n,r){return zH(BU(e,t,n),r)}function VH(e,t={}){return ZM(`Partial`,[e],t)}function HH(e,t={}){return YH(e,t)}function UH(e,t){let n=JH(wz(e,t));return PN(jM(e,{[t]:n}),t)}function WH(e,t,n){return JH(wF(e,t,n))}function GH(e){return JH(EF(e))}function KH(e){return CP(e.map(e=>JH(e)))}function qH(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:CN(e[n])}),{}))}function JH(e){return FN(e)?UH(e.$defs,e.$ref):zN(e)?WH(e.if,e.then,e.else):KN(e)?GH(e.allOf):wP(e)?KH(e.anyOf):AN(e)?qH(e.properties):kN({})}function YH(e,t){return NU([e])?JM(JH(e),{},t):VH(e,t)}function XH(e,t,n,r){return YH(BU(e,t,n),r)}function ZH(e,t,n={}){return ZM(`Pick`,[e,t],n)}function QH(e,t){return xM(e).reduce((n,r)=>t.includes(r)?jM(n,{[r]:e[r]}):n,{})}function $H(e,t){return kN(QH(MH(e),EV(t)))}function eU(e,t,n){return NU([e,t])?JM($H(e,t),{},n):ZH(e,t,n)}function tU(e,t,n,r,i){return eU(BU(e,t,n),BU(e,t,r),i)}function nU(e,t={}){return ZM(`ReadonlyObject`,[e],t)}function rU(e){return WU(aN(e))}function iU(e,t){let n=uU(wz(e,t));return PN(jM(e,{[t]:n}),t)}function aU(e,t,n){return uU(wF(e,t,n))}function oU(e){return uU(EF(e))}function sU(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:QN(e[n])}),{}))}function cU(e){return WU(KP(e))}function lU(e){return CP(e.map(e=>uU(e)))}function uU(e){return oN(e)?rU(e.items):FN(e)?iU(e.$defs,e.$ref):zN(e)?aU(e.if,e.then,e.else):KN(e)?oU(e.allOf):AN(e)?sU(e.properties):qP(e)?cU(e.items):wP(e)?lU(e.anyOf):e}function dU(e,t){return NU([e])?JM(uU(e),{},t):nU(e)}function fU(e,t,n,r){return dU(BU(e,t,n),r)}function pU(e,t,n,r){return t.visited.includes(r)?n:r in e?BU(e,MU(t.callstack,[...t.visited,r]),e[r]):n}function mU(e,t){let n=yU(wz(e,t));return PN(jM(e,{[t]:n}),t)}function hU(e,t,n){return yU(wF(e,t,n))}function gU(e){return yU(EF(e))}function _U(e){return CP(e.map(e=>yU(e)))}function vU(e){return kN(xM(e).reduce((t,n)=>({...t,[n]:nF(e[n])}),{}))}function yU(e){return FN(e)?mU(e.$defs,e.$ref):zN(e)?hU(e.if,e.then,e.else):KN(e)?gU(e.allOf):wP(e)?_U(e.anyOf):AN(e)?vU(e.properties):kN({})}function bU(e,t={}){return ZM(`Required`,[e],t)}function xU(e,t){return NU([e])?JM(yU(e),{},t):bU(e,t)}function SU(e,t,n,r){return xU(BU(e,t,n),r)}function CU(e,t={}){return ZM(`ReturnType`,[e],t)}function wU(e){return fN(e)?e.returnType:xN()}function TU(e,t){return NU([e])?JM(wU(e),{},t):CU(e,t)}function EU(e,t,n,r={}){return TU(BU(e,t,n),r)}function DU(e,t){return ZM(`With`,[e,t],{})}function OU(e,t){return NU([e])?JM(e,{},t):DU(e,t)}function kU(e,t,n,r){return OU(BU(e,t,n),r)}function AU(e){return oI(e)?qP(e.items)?jU(e.items.items):LN(e.items)||hN(e.items)?[e]:[xN()]:[e]}function jU(e){return e.reduce((e,t)=>[...e,...AU(t)],[])}function MU(e,t){return{callstack:e,visited:t}}function NU(e){return vM(e,(e,t)=>!hN(e)&&NU(t),()=>!0)}function PU(e,t,n){return xM(n).reduce((r,i)=>({...r,[i]:BU(e,t,n[i])}),{})}function FU(e,t,n){return jU(IU(e,t,n))}function IU(e,t,n){return n.map(n=>BU(e,t,n))}function LU(e,t){let n=TN(e)?rN(t,{}):t,r=$N(e)?eN(n,{}):n;return ZN(e)?HU(r,{}):r}function RU(e,t,n,r,i){return mM(n,`AddImmutable`)?UU(e,t,r[0],i):mM(n,`RemoveImmutable`)?hB(e,t,r[0],i):mM(n,`AddReadonly`)?tN(e,t,r[0],i):mM(n,`RemoveReadonly`)?ZP(e,t,r[0],i):mM(n,`AddOptional`)?iN(e,t,r[0],i):mM(n,`RemoveOptional`)?tF(e,t,r[0],i):mM(n,`Capitalize`)?NB(e,t,r[0],i):mM(n,`Conditional`)?BB(e,t,r[0],r[1],r[2],r[3],i):mM(n,`ConstructorParameters`)?WB(e,t,r[0],i):mM(n,`Evaluate`)?Nz(e,t,r[0],i):mM(n,`Exclude`)?qB(e,t,r[0],r[1],i):mM(n,`Extract`)?$B(e,t,r[0],r[1],i):mM(n,`Index`)?qV(e,t,r[0],r[1],i):mM(n,`InstanceType`)?ZV(e,t,r[0],i):mM(n,`Interface`)?$R(e,t,r[0],r[1],i):mM(n,`KeyOf`)?cH(e,t,r[0],i):mM(n,`Lowercase`)?PB(e,t,r[0],i):mM(n,`Mapped`)?SH(e,t,r[0],r[1],r[2],r[3],i):mM(n,`Module`)?EH(e,t,r[0],i):mM(n,`NonNullable`)?AH(e,t,r[0],i):mM(n,`Pick`)?tU(e,t,r[0],r[1],i):mM(n,`Parameters`)?BH(e,t,r[0],i):mM(n,`Partial`)?XH(e,t,r[0],i):mM(n,`Omit`)?IH(e,t,r[0],r[1],i):mM(n,`ReadonlyObject`)?fU(e,t,r[0],i):mM(n,`Record`)?qF(e,t,r[0],r[1],i):mM(n,`Required`)?SU(e,t,r[0],i):mM(n,`ReturnType`)?EU(e,t,r[0],i):mM(n,`TemplateLiteral`)?bL(e,t,r[0],i):mM(n,`Uncapitalize`)?FB(e,t,r[0],i):mM(n,`Uppercase`)?IB(e,t,r[0],i):mM(n,`With`)?kU(e,t,r[0],r[1]):ZM(n,r,i)}function zU(e,t,n){return LU(n,hN(n)?pU(e,t,n,n.$ref):oN(n)?aN(BU(e,t,n.items),sN(n)):fB(n)?uB(e,t,n.target,n.arguments):lN(n)?cN(IU(e,t,n.parameters),BU(e,t,n.instanceType),uN(n)):fN(n)?dN(IU(e,t,n.parameters),BU(e,t,n.returnType),pN(n)):zN(n)?RN(BU(e,t,n.if),BU(e,t,n.then),BU(e,t,n.else),BN(n)):KN(n)?GN(IU(e,t,n.allOf),qN(n)):AN(n)?kN(PU(e,t,n.properties),jN(n)):iI(n)?$F(tI(n),BU(e,t,rI(n))):oI(n)?aI(BU(e,t,n.items)):qP(n)?KP(FU(e,t,n.items),JP(n)):wP(n)?CP(IU(e,t,n.anyOf),TP(n)):n)}function BU(e,t,n){return QM(n)?RU(e,t,n.action,n.parameters,n.options):zU(e,t,n)}function VU(e){return JM(e,{"~immutable":!0},{})}function HU(e,t){return JM(VU(e),{},t)}function UU(e,t,n,r){return HU(BU(e,t,n),r)}function WU(e,t={}){return HU(e,t)}var GU=[`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],KU=[`off`,...GU],qU=[`text`,`image`],JU=[`none`,`short`,`long`],YU=[`short`,`long`];UN(GU);var XU=UN(KU);UN(qU),UN(JU),HH(QF(XU,CP([xP(),mP()]))),HH(QF(UN(YU),_P({exclusiveMinimum:0})),{description:`Best-effort prompt cache lifetime in seconds for each retention tier. A missing tier means the lifetime is unknown, so Pi does not warm it.`});var ZU={input:_P({description:`Input cost in USD per million tokens.`}),output:_P({description:`Output cost in USD per million tokens.`}),cacheRead:_P({description:`Cache-read cost in USD per million tokens.`}),cacheWrite:_P({description:`Cache-write cost in USD per million tokens.`})};kN(ZU);var QU=kN({inputTokensAbove:_P({description:`Use this tier when total request input exceeds this token count.`}),...ZU});kN({...ZU,tiers:wN(aN(QU,{description:`Request-wide pricing tiers. The highest matching input threshold applies to the full request.`}))});function $U(e){return kN({maxWidth:wN(aP({minimum:1})),maxHeight:wN(aP({minimum:1})),maxBytes:wN(aP({minimum:1,description:`Maximum base64-encoded payload size in bytes.`})),jpegQuality:wN(aP({minimum:1,maximum:100}))},e)}$U();var eW=kN({resize:wN($U({description:`Cache-safe resize profile applied before a new image enters conversation history.`})),maxPerMessage:wN(aP({minimum:1,description:`Maximum images accepted in one provider message.`})),maxPerRequest:wN(aP({minimum:1,description:`Maximum images accepted across one provider request.`}))});kN({maxRequestBytes:wN(aP({minimum:1,description:`Maximum serialized provider request size in bytes.`})),images:wN(eW)});function tW({sessionId:e,template:t,existingIds:n,apiKey:r,onClose:i,onAdd:a}){let{t:o}=W(),[s,c]=(0,K.useState)([]),[l,u]=(0,K.useState)(new Set),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)(!0),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(0),x=(0,K.useRef)({template:t,apiKey:r,existingIds:n}),S=new Set(n),C=Math.max(0,100-S.size),w=s.filter(e=>`${e.id} ${e.name}`.toLowerCase().includes(d.trim().toLowerCase())),T=w.filter(e=>!S.has(e.id)),E=T.length>0&&T.every(e=>l.has(e.id));return(0,K.useEffect)(()=>{let t=new AbortController,{template:n,apiKey:r,existingIds:i}=x.current;return m(!0),v(!1),new de().discoverProviderModels(e,{provider:n.provider,baseUrl:n.baseUrl,api:n.api,...r.trim()?{apiKey:r.trim()}:{}},t.signal).then(e=>{t.signal.aborted||(c(e.models),g(e.truncated),m(!1),u(new Set(e.models.filter(e=>!i.includes(e.id)).slice(0,Math.max(0,100-i.length)).map(e=>e.id))))},()=>{t.signal.aborted||(v(!0),m(!1))}),()=>t.abort()},[e,y]),(0,q.jsx)(Se,{isOpen:!0,width:380,padding:0,className:`models-picker-dialog`,"aria-label":o(`providerPickerTitle`),onOpenChange:e=>!e&&i(),children:(0,q.jsxs)(`div`,{className:`models-picker`,children:[(0,q.jsxs)(`header`,{children:[(0,q.jsx)(`h2`,{children:o(`providerPickerTitle`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":o(`close`),onClick:i,children:(0,q.jsx)(je,{})})]}),(0,q.jsx)(`p`,{children:o(`providerPickerIntro`)}),(0,q.jsxs)(`div`,{className:`models-picker-toolbar`,children:[(0,q.jsx)(`input`,{"data-autofocus":!0,type:`search`,"aria-label":o(`providerPickerSearch`),placeholder:o(`providerPickerSearch`),value:d,onKeyDown:e=>{e.key===`Enter`&&e.preventDefault()},onChange:e=>f(e.target.value)}),(0,q.jsx)(`button`,{type:`button`,className:`models-link`,disabled:p||!T.length,onClick:()=>u(e=>{let t=new Set(e);for(let e of T)E?t.delete(e.id):t.size(0,q.jsxs)(`label`,{className:`models-picker-row`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:S.has(e.id)||l.has(e.id),disabled:S.has(e.id)||!l.has(e.id)&&l.size>=C,onChange:t=>u(n=>{let r=new Set(n);return t.target.checked?r.add(e.id):r.delete(e.id),r})}),(0,q.jsx)(`span`,{title:e.name,children:e.id}),S.has(e.id)&&(0,q.jsx)(`small`,{children:o(`providerPickerAdded`)})]},e.id)),!p&&!_&&!w.length&&(0,q.jsx)(`p`,{className:`models-picker-empty`,children:o(d?`providerPickerNoMatch`:`providerPickerEmpty`)}),_&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[(0,q.jsx)(`p`,{children:o(`providerPickerError_load`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:()=>b(e=>e+1),children:o(`retryAdmissionCheck`)})]})]}),h&&(0,q.jsx)(`p`,{className:`models-hint`,children:o(`providerPickerBounded`)}),(0,q.jsxs)(`footer`,{children:[(0,q.jsx)(`span`,{className:`models-hint`,"aria-live":`polite`,children:l.size>0&&o(`providerPickerSelected`,{count:l.size})}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:i,children:o(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:!l.size||p||_,onClick:()=>a(s.filter(e=>l.has(e.id))),children:o(`providerPickerSave`)})]})]})})}function nW(e){let t=e.trim();if(!t)return;let n=/^(\d+(?:\.\d+)?)([km])?$/i.exec(t);if(!n)return NaN;let r=n[2]?.toLowerCase()===`m`?1e6:n[2]?.toLowerCase()===`k`?1e3:1,i=Number(n[1])*r,a=Math.round(i),o=Math.abs(i-a)<1e-6?a:i;return Number.isSafeInteger(o)&&o>0&&o<=1e8?o:NaN}function rW(e){if(e===void 0)return``;if(Number.isInteger(e)&&e>0){if(e%1e6==0)return`${e/1e6}M`;if(e%1e3==0)return`${e/1e3}K`}return String(e)}function iW({sessionId:e,providerId:t,configuration:n,auth:r,isNew:i,custom:a,taken:o,currentModel:s,availableModels:c,busy:l,onDirty:u,onSaving:d,onClose:f,onReload:p}){let{t:m}=W(),[h]=(0,K.useState)(()=>{let e=n.providers?.find(e=>e.provider===t),i=n.models.filter(e=>e.provider===t).map(e=>({...e,rowKey:crypto.randomUUID()}));return{provider:t,name:e?.name||r?.name||t,baseUrl:e?.baseUrl||i[0]?.baseUrl||r?.baseUrl||``,api:e?.api||i[0]?.api||r?.api||`openai-completions`,models:i}}),[g]=(0,K.useState)(n.revision),[_,v]=(0,K.useState)(h),[y,b]=(0,K.useState)(``),x=!i&&!!r?.authMethods.includes(`oauth`),S=a||!!r?.authMethods.includes(`api_key`),[C,w]=(0,K.useState)(x&&(!r?.configured||r?.subscription||!S)?`oauth`:`api_key`),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1),k=(0,K.useRef)(null),A=(0,K.useRef)(!1),[j,M]=(0,K.useState)(new Set),[N,P]=(0,K.useState)({}),[F,I]=(0,K.useState)(!1),[ee,L]=(0,K.useState)(null),[R,te]=(0,K.useState)(!1),z=(0,K.useRef)(null),B=(0,K.useRef)({onDirty:u,onSaving:d});B.current={onDirty:u,onSaving:d};let ne=JSON.stringify(_)!==JSON.stringify(h),re=ne||y.length>0;(0,K.useEffect)(()=>{B.current.onDirty(re)},[re]),(0,K.useEffect)(()=>{B.current.onSaving(F||T)},[F,T]),(0,K.useEffect)(()=>{D?A.current=!0:A.current&&(A.current=!1,k.current?.focus({preventScroll:!0}))},[D]),(0,K.useEffect)(()=>()=>{z.current?.abort(),B.current.onSaving(!1),B.current.onDirty(!1)},[]);let V=n.providers?.find(e=>e.provider===t)?.editable!==!1,ie=l||F||T,ae=ie||R||!V,oe=!/^[a-zA-Z0-9._-]+$/.test(_.provider)||[`__proto__`,`constructor`,`prototype`].includes(_.provider)||i&&a&&o.includes(_.provider),se=_.models.findIndex(e=>!e.id.trim()||[e.contextWindow,e.maxTokens].some(e=>e!==void 0&&!Number.isFinite(e))||_.models.some(t=>t.rowKey!==e.rowKey&&t.id.trim()===e.id.trim())),ce=se!==-1,le=i&&a||ne,H=!oe&&!/[\r\n\u0000]/u.test(y)&&(R||!le||(!a||_.models.length>0)&&!ce&&!!_.baseUrl)&&(le||y.trim().length>0),ue=e=>{v(t=>({...t,...e})),ee!==`conflict`&&L(null)},fe=(e,t)=>ue({models:_.models.map((n,r)=>r===e?{...n,...t}:n)}),pe=_.models.map(e=>n.thinkingDefaults?.[`${e.provider}/${e.id}`]),me=_.models.map((e,t)=>{let n=e.thinkingLevelMap??pe[t];return KU.filter(e=>n?.[e]!==null&&(e!==`xhigh`&&e!==`max`||n?.[e]!==void 0))}),he={id:``,name:``,reasoning:!1,provider:_.provider,baseUrl:_.baseUrl,api:_.api},_e=async()=>{if(ie||D||!H||ee===`conflict`)return;let t=new AbortController;z.current=t,I(!0),L(null);let n=R,r=new de;try{if(le&&!n){if(await r.changeProviderConfiguration(e,g,{action:`save`,configuration:{..._,name:_.name.trim()||_.provider,models:_.models.map(({rowKey:e,...t})=>({...t,id:t.id.trim(),name:t.name.trim()||t.id.trim(),provider:_.provider,baseUrl:_.baseUrl===h.baseUrl&&t.baseUrl||_.baseUrl,api:_.api===h.api?t.api:_.api}))}},t.signal),t.signal.aborted)return;n=!0,te(!0)}if(y.trim()&&await r.saveProviderKey(e,_.provider,y.trim(),t.signal),t.signal.aborted)return;b(``),B.current.onDirty(!1),f(_.name||_.provider,_.provider)}catch(e){t.signal.aborted||L(e instanceof ge&&e.code===`MODEL_CONFIGURATION_CONFLICT`?`conflict`:e instanceof ge&&e.code===`MODEL_NOT_AVAILABLE`?`current`:n?`key`:`failed`)}finally{t.signal.aborted||I(!1)}},ve=e=>(0,q.jsxs)(`label`,{className:`models-field`,children:[m(e===`name`?`providerDisplayName`:`modelConfig_${e}`),(0,q.jsx)(`input`,{type:e===`baseUrl`?`url`:`text`,value:_[e],maxLength:e===`baseUrl`?2048:160,autoComplete:`off`,disabled:ae,required:e===`provider`||e===`baseUrl`&&le,"aria-invalid":e===`provider`&&_.provider.length>0&&oe,placeholder:e===`provider`?`my-provider`:e===`name`?_.provider:`https://api.example.com/v1`,onChange:t=>ue({[e]:t.target.value})})]}),ye=(0,q.jsxs)(`label`,{className:`models-field`,htmlFor:`provider-api-${t||`custom`}`,children:[m(`modelConfig_api`),(0,q.jsx)(Tj,{id:`provider-api-${t||`custom`}`,label:m(`modelConfig_api`),value:_.api,disabled:ae,onChange:e=>{(e===`openai-responses`||e===`openai-completions`||e===`anthropic-messages`)&&ue({api:e})},options:[{value:`openai-completions`,label:`OpenAI Chat Completions`},{value:`openai-responses`,label:`OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`}]})]}),be=(0,q.jsxs)(`div`,{className:`models-catalog`,children:[(0,q.jsxs)(`div`,{className:`models-list-head`,children:[(0,q.jsx)(`span`,{children:m(`modelSettings`)}),(0,q.jsx)(`button`,{type:`button`,ref:k,className:`models-link`,disabled:ae||oe||!_.baseUrl,onClick:()=>O(!0),children:m(`providerFetchModels`)})]}),!V&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerModelsReadOnly`)}),_.models.length===0&&(0,q.jsx)(`p`,{className:`models-empty`,children:m(a?`providerModelsEmpty`:`providerModelsInherited`,{count:c.length})}),(0,q.jsxs)(`div`,{className:`models-entry-list`,children:[s&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerCurrentSessionModel`,{model:`${s.provider} / ${s.id}`})}),_.models.map((e,t)=>(0,q.jsxs)(`div`,{className:`models-entry`,children:[s?.provider===_.provider&&s.id===e.id&&(0,q.jsx)(`p`,{className:`models-current-label`,children:m(`currentModel`)}),(0,q.jsxs)(`div`,{className:`models-entry-row`,children:[(0,q.jsx)(`input`,{"aria-label":m(`providerModelId`,{number:t+1}),placeholder:m(`modelConfig_id`),value:e.id,maxLength:256,required:!0,disabled:ae||s?.provider===_.provider&&s.id===e.id,onChange:e=>fe(t,{id:e.target.value})}),(0,q.jsx)(`input`,{"aria-label":m(`providerModelName`,{number:t+1}),placeholder:m(`modelConfig_name`),value:e.name,maxLength:256,disabled:ae,onChange:e=>fe(t,{name:e.target.value})}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon`,"aria-label":m(`providerModelDetails`,{model:e.name||e.id||t+1}),"aria-expanded":j.has(e.rowKey),title:m(`providerModelOptions`),onClick:()=>M(t=>{let n=new Set(t);return n.delete(e.rowKey)||n.add(e.rowKey),n}),children:(0,q.jsx)(os,{})}),(0,q.jsx)(`button`,{type:`button`,className:`models-icon danger`,"aria-label":m(`providerRemoveModel`,{model:e.name||e.id||t+1}),disabled:ae||s?.provider===_.provider&&s.id===e.id,title:s?.provider===_.provider&&s.id===e.id?m(`providerCurrentRemoval`):m(`providerRemoveModel`,{model:e.name||e.id||t+1}),onClick:()=>{ue({models:_.models.filter((e,n)=>n!==t)}),M(t=>new Set([...t].filter(t=>t!==e.rowKey))),P(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.rowKey)))},children:(0,q.jsx)(Uc,{})})]}),j.has(e.rowKey)&&(0,q.jsxs)(`div`,{className:`models-entry-details`,children:[[`contextWindow`,`maxTokens`].map(n=>(0,q.jsxs)(`label`,{className:`models-field models-capacity`,children:[m(`modelConfig_${n}`),(0,q.jsx)(`input`,{type:`text`,inputMode:`numeric`,autoComplete:`off`,spellCheck:!1,"aria-label":m(`providerCapacityLabel`,{field:m(`modelConfig_${n}`),number:t+1}),"aria-invalid":e[n]!==void 0&&!Number.isFinite(e[n]),placeholder:n===`contextWindow`?`256K`:`32K`,value:N[e.rowKey]?.[n]??rW(e[n]),disabled:ae,onChange:r=>{let i=r.target.value;P(t=>({...t,[e.rowKey]:{...t[e.rowKey],[n]:i}})),fe(t,{[n]:nW(i)})}})]},n)),(0,q.jsxs)(`fieldset`,{className:`models-input-types`,"aria-label":m(`providerCapacityLabel`,{field:m(`providerInputTypes`),number:t+1}),children:[(0,q.jsx)(`legend`,{children:m(`providerInputTypes`)}),(0,q.jsx)(`div`,{children:[`text`,`image`].map(n=>{let r=e.input??[`text`];return(0,q.jsxs)(`label`,{className:`models-checkbox`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:r.includes(n),disabled:ae||r.length===1&&r.includes(n),onChange:e=>fe(t,{input:[`text`,`image`].filter(t=>t===n?e.target.checked:r.includes(t))})}),m(n===`text`?`providerInputText`:`providerInputImage`)]},n)})})]}),(0,q.jsx)(`p`,{className:`models-hint models-capability-hint`,children:m(`providerImageHint`)}),(0,q.jsxs)(`label`,{className:`models-checkbox models-reasoning`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:e.reasoning,disabled:ae,onChange:e=>fe(t,{reasoning:e.target.checked})}),m(`modelConfig_reasoning`)]}),(0,q.jsx)(`p`,{className:`models-hint models-capability-hint`,children:m(`providerReasoningHint`)}),e.reasoning&&(0,q.jsxs)(`div`,{className:`models-thinking-levels`,children:[(0,q.jsxs)(`div`,{className:`models-thinking-copy`,children:[(0,q.jsx)(`strong`,{children:m(`providerThinkingLevels`)}),(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerThinkingLevelsHint`)})]}),(0,q.jsx)(yo,{button:{label:e.thinkingLevelMap==null?m(`providerThinkingAutomatic`):m(`providerThinkingSelected`,{count:me[t].length}),"aria-label":m(`providerCapacityLabel`,{field:m(`providerThinkingLevels`),number:t+1}),variant:`secondary`,size:`sm`,className:`models-thinking-trigger`,isDisabled:ae},className:`configuration-level-menu`,menuWidth:`min(240px, calc(100vw - 32px))`,alignment:`end`,children:KU.map(n=>{let r=me[t],i=r.includes(n);return(0,q.jsx)(Ro,{label:n,value:i,isDisabled:ae||i&&r.length===1,endContent:(0,q.jsx)(`span`,{className:`configuration-check`,children:i&&(0,q.jsx)(rs,{"aria-hidden":`true`})}),onChange:i=>{fe(t,{thinkingLevelMap:Object.fromEntries(KU.map(a=>{let o=a===n?i:r.includes(a),s=h.models.find(t=>t.rowKey===e.rowKey)?.thinkingLevelMap?.[a];return[a,o?e.thinkingLevelMap?.[a]??s??pe[t]?.[a]??(a===`off`?`none`:a):null]}))})}},n)})}),e.thinkingLevelMap!=null&&(0,q.jsx)(`button`,{type:`button`,className:`models-link models-thinking-reset`,disabled:ae,onClick:()=>fe(t,{thinkingLevelMap:null}),children:m(`providerThinkingReset`)})]})]})]},e.rowKey))]}),(0,q.jsxs)(`button`,{type:`button`,className:`models-button models-add-model`,disabled:ae||_.models.length>=100,onClick:()=>{ue({models:[..._.models,{...he,rowKey:crypto.randomUUID()}]})},children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),m(`addModel`)]}),ce&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:m(`providerModelInvalid`,{number:se+1})})]});return(0,q.jsxs)(`form`,{className:`models-editor`,onSubmit:e=>{e.preventDefault(),_e()},children:[!i&&a&&(0,q.jsxs)(`div`,{className:`models-editor-heading`,children:[(0,q.jsx)(`span`,{children:_.name||_.provider}),_.name!==_.provider&&(0,q.jsx)(`small`,{children:_.provider})]}),i&&a&&(0,q.jsxs)(q.Fragment,{children:[ve(`provider`),_.provider&&oe&&(0,q.jsx)(`p`,{className:`models-error`,children:m(`providerIdInvalid`)}),ve(`name`),ve(`baseUrl`),ye]}),x&&S&&(0,q.jsxs)(`fieldset`,{className:`models-add-modes`,"aria-label":m(`accountLoginMethod`),children:[(0,q.jsx)(`button`,{type:`button`,"aria-pressed":C===`oauth`,disabled:ie,onClick:()=>w(`oauth`),children:m(`accountLoginTab`)}),(0,q.jsx)(`button`,{type:`button`,"aria-pressed":C===`api_key`,disabled:ie,onClick:()=>w(`api_key`),children:m(`accountLoginKeyTab`)})]}),x&&C===`oauth`&&r&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(iM,{sessionId:e,auth:r,busy:l||F||re,onSaving:E,onAuthenticated:()=>f(_.name||_.provider,_.provider),onReload:p}),re&&(0,q.jsx)(`p`,{className:`models-hint`,children:m(`accountLoginUnsaved`)})]}),S&&C===`api_key`?(0,q.jsxs)(`label`,{className:`models-field`,children:[m(`providerApiKey`),(0,q.jsx)(`input`,{type:`password`,autoComplete:`new-password`,spellCheck:!1,maxLength:8192,value:y,placeholder:m(r?.configured?`providerKeyKeep`:`providerKeyOptional`),disabled:ie,onChange:e=>{b(e.target.value),ee!==`conflict`&&L(null)}})]}):x?null:(0,q.jsx)(`p`,{className:`models-hint`,children:m(`providerNativeAuth`)}),i&&a?be:(0,q.jsxs)(`details`,{className:`models-customized`,children:[(0,q.jsx)(`summary`,{children:m(`providerCustomSettings`)}),(0,q.jsxs)(`div`,{children:[a&&ve(`name`),ve(`baseUrl`),a&&ye,be]})]}),ee&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:m(ee===`conflict`?`modelConfigurationConflict`:ee===`key`?`providerProfileSavedKeyFailed`:ee===`current`?`providerCurrentRemoval`:`providerConfigurationFailed`)}),ee===`conflict`&&(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:p,children:m(`providerReload`)}),!T&&(0,q.jsxs)(`div`,{className:`models-editor-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:F,onClick:()=>R?p():f(),children:m(`cancel`)}),(C===`api_key`||ne)&&(0,q.jsx)(`button`,{type:`submit`,className:`models-button primary`,disabled:ie||!H||ee===`conflict`,"aria-busy":F,children:m(F?`savingSettings`:`providerSave`)})]}),D&&(0,q.jsx)(tW,{sessionId:e,template:he,existingIds:_.models.map(e=>e.id),apiKey:y,onClose:()=>O(!1),onAdd:e=>{ue({models:[..._.models,...e.map(e=>({...he,...e,rowKey:crypto.randomUUID()}))]}),O(!1)}})]})}function aW({sessionId:e,sessionPath:t,provider:n,purpose:r,initialModel:i,busy:a,onSelectModel:o,onDefaultSaved:s,onSaving:c,onClose:l}){let{t:u}=W(),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)([]),[h,g]=(0,K.useState)(i?`${i.provider}/${i.id}`:``),[_,v]=(0,K.useState)(!0),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(0),[C,w]=(0,K.useState)(0),[T,E]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1),[k,A]=(0,K.useState)(null);(0,K.useEffect)(()=>{let t=new AbortController;v(!0),b(!1);let r=window.setTimeout(()=>{new de().searchModels(d.trim(),e,t.signal,n).then(e=>{t.signal.aborted||(m(e.models),S(e.truncation.matchesOmitted),v(!1))},()=>{t.signal.aborted||(b(!0),v(!1))})},d?200:0);return()=>{t.abort(),window.clearTimeout(r)}},[e,n,d,C]);let j=p.find(e=>`${e.provider}/${e.id}`===h)??p[0],M=new Map;for(let e of p){let t=M.get(e.provider);t?t.push(e):M.set(e.provider,[e])}let N=async()=>{if(!j||_||D||a||!t)return;O(!0),c(!0),A(null);let n=!1;try{if(r===`use`){if(!await o(`${j.provider}/${j.id}`))throw Error(`selection failed`);n=!0}(r==="default"||T)&&s(await new de().saveModelDefault(j.provider,j.id,e,t)),l()}catch{A(n?`modelDefaultPartial`:r==="default"?`modelDefaultSaveFailed`:`modelConnectionUseFailed`)}finally{O(!1),c(!1)}};return(0,q.jsxs)(`div`,{className:`models-connection-choice`,children:[(0,q.jsx)(`p`,{className:`models-hint`,children:u(r==="default"?`modelDefaultHint`:`modelConnectionNextHint`)}),(p.length>8||x>0||d)&&(0,q.jsx)(`input`,{type:`search`,"aria-label":u(`modelConnectionSearch`),placeholder:u(`modelConnectionSearch`),maxLength:200,value:d,disabled:D,onChange:e=>f(e.target.value)}),y?(0,q.jsxs)(`p`,{className:`models-error`,role:`alert`,children:[u(`modelConnectionLoadFailed`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-link`,onClick:()=>w(e=>e+1),children:u(`retryAdmissionCheck`)})]}):_?(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`loadingModels`)}):p.length?(0,q.jsx)(nM,{label:u(`selectModel`),className:`models-provider-picker`,placement:`below`,value:j?`${j.provider}/${j.id}`:``,isDisabled:D,options:[...M].map(([e,t])=>({type:`section`,title:e,options:t.map(e=>({value:`${e.provider}/${e.id}`,label:e.name||e.id,description:`${e.provider} · ${e.id}`,icon:(0,q.jsx)(Yk,{id:e.provider})}))})),onChange:e=>g(e)}):(0,q.jsx)(`p`,{className:`models-hint`,children:u(d?`modelConnectionNoMatch`:`modelConnectionNoModels`)}),x>0&&!_&&(0,q.jsx)(`p`,{className:`models-hint`,children:u(`modelConnectionMore`,{count:x})}),r===`use`&&(0,q.jsxs)(`label`,{className:`models-checkbox`,children:[(0,q.jsx)(`input`,{type:`checkbox`,checked:T,disabled:D,onChange:e=>E(e.target.checked)}),u(`modelMakeDefault`)]}),k&&(0,q.jsx)(`p`,{className:`models-error`,role:`alert`,children:u(k)}),(0,q.jsxs)(`div`,{className:`models-editor-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:D,onClick:l,children:u(`cancel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button primary`,disabled:D||a||_||y||!j||!t,onClick:()=>void N(),children:u(D?`providerSaving`:r==="default"?`modelDefaultSave`:`modelConnectionUse`)})]})]})}function oW({sessionId:e,sessionPath:t,models:n,currentModel:r,busy:i,focusCredentials:a,onSaved:o,onSelectModel:s,onDraftChange:c,onSavingChange:l}){let{t:u}=W(),[d,f]=(0,K.useState)(null),[p,m]=(0,K.useState)(0),[h,g]=(0,K.useState)(!0),[_,v]=(0,K.useState)(!1),[y,b]=(0,K.useState)(null),[x,S]=(0,K.useState)([]),[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(`account`),[D,O]=(0,K.useState)(``),[k,A]=(0,K.useState)(``),[j,M]=(0,K.useState)({}),[N,P]=(0,K.useState)(!1),[F,I]=(0,K.useState)({}),[ee,L]=(0,K.useState)(!1),R=N||ee||Object.values(F).some(Boolean),[te,z]=(0,K.useState)(null),[B,ne]=(0,K.useState)(!1),[re,V]=(0,K.useState)(null),[ie,ae]=(0,K.useState)(null),[oe,se]=(0,K.useState)(null),[ce,le]=(0,K.useState)(null),H=(0,K.useRef)(null),ue=(0,K.useRef)(a),fe=(0,K.useRef)(null),pe=(0,K.useRef)(new Map),me=(0,K.useRef)(null),he=(0,K.useRef)(null),_e=(0,K.useRef)({onDraftChange:c,onSavingChange:l});_e.current={onDraftChange:c,onSavingChange:l},(0,K.useEffect)(()=>{c(Object.values(j).some(Boolean))},[j,c]),(0,K.useEffect)(()=>{l(R)},[R,l]),(0,K.useEffect)(()=>{!re&&!R&&he.current&&(he.current.focus({preventScroll:!0}),he.current=null)},[re,R]),(0,K.useEffect)(()=>{if(!fe.current)return;let e=fe.current;fe.current=null,(pe.current.get(e)??me.current)?.focus({preventScroll:!0})}),(0,K.useEffect)(()=>()=>{H.current?.abort(),_e.current.onDraftChange(!1),_e.current.onSavingChange(!1)},[]),(0,K.useEffect)(()=>{let t=new AbortController;g(!0),v(!1);let n=new de;return Promise.all([n.modelConfigurations(e,t.signal),n.providerAuth(e,t.signal)]).then(([e,n])=>{if(!t.signal.aborted&&(f({configuration:e,auth:n}),g(!1),ue.current)){ue.current=!1;let e=r?.provider||n.providers.find(e=>e.configured)?.id;e&&(b(e),S([e]))}},()=>{t.signal.aborted||(v(!0),g(!1))}),()=>t.abort()},[e,p,r?.provider]),(0,K.useEffect)(()=>{let t=new AbortController;return ne(!1),new de().modelDefaults(e,t.signal).then(e=>{t.signal.aborted||z(e)},()=>{t.signal.aborted||ne(!0)}),()=>t.abort()},[e,p]);let ve=d?.configuration,ye=new Set([...ve?.providers?.map(e=>e.provider)??[],...ve?.models.map(e=>e.provider)??[]]),be=new Set([...ye,...d?.auth.providers.filter(e=>e.configured).map(e=>e.id)??[],...n.map(e=>e.provider),...x.filter(e=>!e.startsWith(`add:`))]),xe=[...be].map(e=>{let t=d?.auth.providers.find(t=>t.id===e);return{id:e,name:ve?.providers?.find(t=>t.provider===e)?.name||t?.name||e,auth:t}}),Se=d?.auth.providers.filter(e=>e.authMethods.includes(`api_key`)&&!be.has(e.id))??[],Ce=d?.auth.providers.filter(e=>e.authMethods.includes(`oauth`)&&!e.subscription)??[],we=Ce.find(e=>e.id===D)??Ce[0],Te=Se.find(e=>e.id===k)??Se[0],Ee=[{id:`account`,label:`accountLoginTab`,hint:`providerAccountHint`,available:Ce.length>0},{id:`catalog`,label:`providerAddCatalog`,hint:`providerCatalogHint`,available:Se.length>0},{id:`custom`,label:`providerAddCustom`,hint:`providerCustomHint`,available:!0}],U=e=>{E(e);let t=e===`custom`?`add:custom`:e===`account`?we&&`add:account:${we.id}`:Te&&`add:${Te.id}`;t&&S(e=>e.includes(t)?e:[...e,t])},De=e=>{he.current=null,V(null),ae(null),w(!1),b(y===e?null:e),S(t=>t.includes(e)?t:[...t,e])},Oe=(e,t,n)=>{he.current=null,fe.current=e;let r=t=>e.startsWith(`add:`)?t.startsWith(`add:`):t===e;S(e=>e.filter(e=>!r(e))),M(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!r(e)))),e.startsWith(`add:`)?w(!1):b(null),t&&(ae(t),V({purpose:`use`,provider:n??e}),m(e=>e+1),o().catch(()=>!1))},ke=(t,a,s,c)=>{if(!ve)return null;let l=d?.auth.providers.find(e=>e.id===a),f=e=>I(n=>n[t]===e?n:{...n,[t]:e}),p=()=>{Oe(t),m(e=>e+1),o().catch(()=>!1)};return t.startsWith(`add:account:`)?l&&(0,q.jsxs)(`div`,{className:`models-editor`,children:[(0,q.jsx)(iM,{sessionId:e,auth:l,busy:i,onSaving:f,onAuthenticated:()=>Oe(t,l.name||l.id,l.id),onReload:p}),!F[t]&&(0,q.jsx)(`div`,{className:`models-editor-actions`,children:(0,q.jsx)(`button`,{type:`button`,className:`models-button`,onClick:()=>Oe(t),children:u(`cancel`)})})]}):(0,q.jsx)(iW,{sessionId:e,providerId:a,configuration:ve,auth:l,isNew:s,custom:c,taken:[...d?.auth.providers.map(e=>e.id)??[],...ye],currentModel:r,availableModels:n.filter(e=>e.provider===a),busy:i,onDirty:e=>M(n=>n[t]===e?n:{...n,[t]:e}),onSaving:f,onClose:(e,n)=>Oe(t,e,n),onReload:p},t)},G=e=>xe.find(t=>t.id===e)?.name??e,je=e=>n.find(t=>t.provider===e.provider&&t.id===e.id)?.name||e.id,Me=(e,t,n)=>{he.current=t,V({purpose:e,provider:n}),b(null),w(!1)},Ne=(n,a)=>(0,q.jsx)(aW,{sessionId:e,sessionPath:t,provider:a,purpose:n,initialModel:n==="default"?te?.model:r,busy:i,onSelectModel:s,onDefaultSaved:e=>{z(e),ne(!1),o().catch(()=>!1)},onSaving:L,onClose:()=>{V(null)}},`${n}:${a??`all`}`);return(0,q.jsxs)(`div`,{className:`settings-content-page models-page`,children:[(0,q.jsxs)(`div`,{className:`models-section`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:u(`modelSettings`)}),(0,q.jsx)(`p`,{children:u(`modelsIntro`)})]})}),ie&&(0,q.jsxs)(`p`,{className:`models-saved`,role:`status`,children:[u(`providerSaved`,{provider:ie}),r&&(0,q.jsxs)(`span`,{children:[` `,u(`providerCurrentSessionModel`,{model:`${r.provider} / ${r.id}`})]})]}),_&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[u(`providerLoadFailed`),` `,(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:h,onClick:()=>m(e=>e+1),children:u(`retryAdmissionCheck`)})]}),ce&&!oe&&(0,q.jsxs)(`div`,{className:`models-error`,role:`alert`,children:[ce,` `,(0,q.jsx)(`button`,{type:`button`,className:`models-button`,disabled:h,onClick:()=>{le(null),m(e=>e+1)},children:u(`refreshStatus`)})]}),!d&&h&&(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`providerLoading`)}),(0,q.jsxs)(`div`,{className:`models-default-card`,children:[(0,q.jsxs)(`div`,{className:`models-default-row`,children:[(0,q.jsxs)(`div`,{className:`models-default-copy`,children:[(0,q.jsx)(`span`,{className:`models-default-title`,children:u(`modelDefaultTitle`)}),B?(0,q.jsx)(`span`,{className:`models-hint`,children:u(`modelDefaultReadFailed`)}):te?.model?(0,q.jsxs)(`span`,{className:`models-default-value`,children:[(0,q.jsx)(`span`,{className:`models-default-avatar`,"aria-hidden":`true`,children:(0,q.jsx)(Yk,{id:te.model.provider,modelId:te.model.id})}),(0,q.jsxs)(`span`,{children:[je(te.model),(0,q.jsx)(`small`,{children:G(te.model.provider)})]})]}):(0,q.jsx)(`span`,{className:`models-hint`,children:u(te?`modelDefaultNotSet`:`loadingModels`)})]}),(0,q.jsxs)(`button`,{type:`button`,className:`models-button primary models-default-choose`,disabled:R||i||Object.values(j).some(Boolean)||!t,"aria-expanded":re?.purpose==="default",onClick:e=>B?m(e=>e+1):re?.purpose==="default"?V(null):Me(`default`,e.currentTarget),children:[(0,q.jsx)(`span`,{children:u(B?`refreshStatus`:`modelDefaultChoose`)}),!B&&(0,q.jsx)(os,{"aria-hidden":`true`})]})]}),te?.projectOverride&&(0,q.jsx)(`p`,{className:`models-hint`,children:u(`modelDefaultProjectOverride`,{model:`${G(te.projectOverride.provider)} / ${je(te.projectOverride)}`})}),re?.purpose==="default"&&Ne(`default`)]}),(0,q.jsxs)(`div`,{className:`models-connections-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:u(`modelConnectionsTitle`)}),(0,q.jsx)(`p`,{children:u(`modelConnectionsIntro`)})]}),(0,q.jsx)(`span`,{"aria-hidden":`true`,children:xe.length})]}),(0,q.jsx)(`ul`,{className:`models-provider-list`,children:xe.map(e=>{let n=!C&&y===e.id,a=e.auth?.custom??ye.has(e.id);return(0,q.jsxs)(`li`,{className:`models-provider-card`,children:[(0,q.jsxs)(`div`,{className:`models-provider-head`,children:[(0,q.jsxs)(`div`,{className:`models-provider-identity`,children:[(0,q.jsx)(`span`,{className:`models-provider-avatar`,"aria-hidden":`true`,children:(0,q.jsx)(Yk,{id:e.id})}),(0,q.jsxs)(`div`,{className:`models-provider-label`,children:[(0,q.jsx)(`span`,{className:`models-provider-name`,children:e.name}),a&&(0,q.jsx)(`span`,{className:`models-provider-tag`,children:u(`providerCustomTag`)}),te?.model?.provider===e.id&&(0,q.jsx)(`span`,{className:`models-provider-tag is-default`,children:u(`modelDefaultBadge`)}),r?.provider===e.id&&(0,q.jsx)(`span`,{className:`models-provider-tag is-current`,children:u(`modelCurrentBadge`)}),e.auth&&(0,q.jsxs)(`span`,{className:`models-provider-status`,children:[(0,q.jsx)(`span`,{className:`models-credential-dot ${e.auth.configured?`configured`:`missing`}`,role:`img`,"aria-label":u(e.auth.configured?`credentialConfigured`:`credentialMissing`),title:u(e.auth.configured?`credentialConfigured`:`credentialMissing`)}),u(e.auth.subscription?`accountLoginConfigured`:e.auth.configured?`credentialConfigured`:`credentialMissing`)]})]})]}),(0,q.jsxs)(`div`,{className:`models-provider-actions`,children:[e.auth?.configured&&(0,q.jsx)(`button`,{type:`button`,className:`models-button models-select-connection`,disabled:R||i||Object.values(j).some(Boolean)||!t,"aria-label":u(`modelConnectionChooseProvider`,{provider:e.name}),"aria-expanded":re?.purpose===`use`&&re.provider===e.id,onClick:t=>re?.purpose===`use`&&re.provider===e.id?V(null):Me(`use`,t.currentTarget,e.id),children:u(`selectModel`)}),(0,q.jsx)(`button`,{type:`button`,className:`models-button`,"aria-label":u(`editProvider`,{provider:e.name}),ref:t=>{t?pe.current.set(e.id,t):pe.current.delete(e.id)},"aria-expanded":n,disabled:R,onClick:()=>De(e.id),children:u(e.auth?.authMethods.includes(`oauth`)&&!e.auth.configured?`accountLoginStart`:`providerEdit`)}),ye.has(e.id)&&(0,q.jsx)(`button`,{type:`button`,className:`models-button danger`,"aria-label":u(`removeProvider`,{provider:e.name}),disabled:R||i||r?.provider===e.id,title:r?.provider===e.id?u(`providerCurrentRemoval`):void 0,onClick:()=>{se(e.id),le(null)},children:u(`providerRemove`)})]})]}),re?.purpose===`use`&&re.provider===e.id&&Ne(`use`,e.id),x.includes(e.id)&&(0,q.jsx)(`div`,{hidden:!n,children:ke(e.id,e.id,!1,a)})]},e.id)})}),ve&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{hidden:!C,className:`models-add-card`,children:[(0,q.jsx)(`fieldset`,{className:`models-add-modes`,"aria-label":u(`providerAddMode`),onKeyDown:e=>{if(R||![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=Ee.filter(e=>e.available),n=t.findIndex(e=>e.id===T),r=t[e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length].id;U(r),e.currentTarget.querySelectorAll(`button`)[Ee.findIndex(e=>e.id===r)]?.focus()},children:Ee.map(e=>(0,q.jsx)(`button`,{type:`button`,"aria-pressed":T===e.id,disabled:R||!e.available,onClick:()=>U(e.id),children:u(e.label)},e.id))}),(0,q.jsx)(`p`,{className:`models-hint`,children:u(Ee.find(e=>e.id===T)?.hint??`providerCustomHint`)}),(0,q.jsxs)(`div`,{hidden:T!==`account`,children:[we&&(0,q.jsx)(`div`,{className:`models-provider-select`,children:(0,q.jsx)(nM,{label:u(`provider`),className:`models-provider-picker`,options:Ce.map(e=>({value:e.id,label:e.name||e.id,icon:(0,q.jsx)(Yk,{id:e.id})})),value:we.id,isDisabled:R,placement:`below`,onChange:e=>{O(e);let t=`add:account:${e}`;S(e=>e.includes(t)?e:[...e,t])}})}),x.filter(e=>e.startsWith(`add:account:`)).map(e=>(0,q.jsx)(`div`,{hidden:e!==`add:account:${we?.id}`,children:ke(e,e.slice(12),!0,!1)},e))]}),(0,q.jsxs)(`div`,{hidden:T!==`catalog`,children:[Te&&(0,q.jsx)(`div`,{className:`models-provider-select`,children:(0,q.jsx)(nM,{label:u(`provider`),className:`models-provider-picker`,options:Se.map(e=>({value:e.id,label:e.name||e.id,icon:(0,q.jsx)(Yk,{id:e.id})})),value:Te.id,isDisabled:R,placement:`below`,onChange:e=>{A(e);let t=`add:${e}`;S(e=>e.includes(t)?e:[...e,t])}})}),x.filter(e=>e.startsWith(`add:`)&&e!==`add:custom`&&!e.startsWith(`add:account:`)).map(e=>(0,q.jsx)(`div`,{hidden:e!==`add:${Te?.id}`,children:ke(e,e.slice(4),!0,!1)},e))]}),x.includes(`add:custom`)&&(0,q.jsx)(`div`,{hidden:T!==`custom`,children:ke(`add:custom`,``,!0,!0)})]}),!C&&(0,q.jsxs)(`button`,{type:`button`,className:`models-add-button`,ref:me,disabled:R,onClick:()=>{he.current=null,V(null),w(!0),b(null),ae(null),U(Ee.find(e=>e.id===T)?.available?T:Ee.find(e=>e.available).id)},children:[(0,q.jsx)(Ae,{"aria-hidden":`true`}),u(`providerAdd`)]})]}),i&&(0,q.jsx)(`p`,{className:`models-hint`,role:`status`,children:u(`modelSelectionBusy`)})]}),oe&&(0,q.jsx)(uj,{isOpen:!0,title:u(`removeProvider`,{provider:xe.find(e=>e.id===oe)?.name||oe}),description:ce||u(`providerRemoveDetail`),isActionLoading:R,cancelLabel:u(`cancel`),actionLabel:u(R?`savingSettings`:`providerRemove`),onOpenChange:e=>{!e&&!R&&se(null)},onAction:()=>{if(R||i||!ve)return;let t=new AbortController;H.current=t,P(!0),le(null),new de().changeProviderConfiguration(e,ve.revision,{action:`remove`,provider:oe},t.signal).then(()=>{t.signal.aborted||(Oe(oe),se(null),m(e=>e+1),o().catch(()=>!1))},e=>{t.signal.aborted||le(u(e instanceof ge&&e.code===`MODEL_CONFIGURATION_CONFLICT`?`modelConfigurationConflict`:`providerConfigurationFailed`))}).finally(()=>{t.signal.aborted||P(!1)})}})]})}function sW(){let e={version:`1.1.0`,id:`909cb8acf6444fb32520b4a53840f089859193a9cfb17443769459fda862f66d`,mode:`production`},{t}=W(),[n,r]=(0,K.useState)(null),[i,a]=(0,K.useState)(`loading`),[o,s]=(0,K.useState)(0);(0,K.useEffect)(()=>{let e=new AbortController,t=new de;return a(`loading`),r(null),t.request(`/api/diagnostics`,{signal:e.signal}).then(t=>{e.signal.aborted||(r(t.openpi??null),a(`ready`))},()=>{e.signal.aborted||a(`error`)}),()=>e.abort()},[o]);let c=t(`notReported`),l=e?.id&&n?.frontendAtStartup?.id&&e.id!==n.frontendAtStartup.id;return(0,q.jsxs)(`section`,{className:`settings-section-block`,"aria-label":t(`runtimeIdentity`),children:[(0,q.jsx)(`h2`,{children:t(`runtimeIdentity`)}),(0,q.jsx)(`p`,{children:t(`runtimeIdentityHint`)}),i===`loading`&&(0,q.jsx)(`p`,{role:`status`,children:t(`settingsCatalogLoading`)}),i===`error`&&(0,q.jsx)(`p`,{role:`alert`,children:t(`runtimeIdentityFailed`)}),(0,q.jsxs)(`dl`,{className:`settings-summary-list runtime-identity-list`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeBackendVersion`)}),(0,q.jsx)(`dd`,{children:n?.version??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimePackageRoot`)}),(0,q.jsx)(`dd`,{children:n?.packageRoot??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeStartedAt`)}),(0,q.jsx)(`dd`,{children:n?new Date(n.startedAt).toLocaleString():c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeGitRevision`)}),(0,q.jsx)(`dd`,{children:n?.git?.revision??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeGitState`)}),(0,q.jsx)(`dd`,{children:n?.git?.dirty==null?c:t(n.git.dirty?`runtimeGitDirty`:`runtimeGitClean`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeFrontendVersion`)}),(0,q.jsx)(`dd`,{children:e?.version??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeFrontendBuild`)}),(0,q.jsx)(`dd`,{children:e?.mode===`development`?t(`runtimeDevelopmentBuild`):e?.id??c})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:t(`runtimeStartupBuild`)}),(0,q.jsx)(`dd`,{children:n?.frontendAtStartup?.id??c})]})]}),l&&(0,q.jsx)(`p`,{role:`status`,children:t(`runtimeBuildMismatch`)}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>s(e=>e+1),disabled:i===`loading`,children:t(`refreshStatus`)})]})}var cW=20,lW={track:{kVAEAm:`x10l6tqk`,kWkggS:`xdsb6cv`,kaIpWk:`xjspbzw`,$$css:!0},trackHorizontal:{kLqNvP:`x1o0tod`,kt4wiu:`xtijo5x`,kZKoxP:`xqu0tyb`,k87sOh:`xwa60dl`,k3aq6I:`x1cb1t30`,$$css:!0},trackVertical:{k87sOh:`x13vifvy`,krVfgx:`x1ey2m1c`,kzqmXN:`x51ohtg`,$$css:!0},filledTrack:{kVAEAm:`x10l6tqk`,kWkggS:`x1ewilqj`,kaIpWk:`xjspbzw`,$$css:!0},filledTrackHorizontal:{kZKoxP:`xqu0tyb`,k87sOh:`xwa60dl`,k3aq6I:`x1cb1t30`,$$css:!0},filledTrackVertical:{kzqmXN:`x51ohtg`,$$css:!0},thumb:{kVAEAm:`x10l6tqk`,kzqmXN:`xw4jnvo`,kZKoxP:`x1qx5ct2`,kaIpWk:`xjspbzw`,kWkggS:`x1ewilqj`,k3aq6I:`x11lhmoz`,k1ekBW:`x106061f`,kIyJzY:`xuedmi6 x12w9bfk`,kAMwcw:`xlr8y92`,kI3sdo:`x1a2a7pz`,kkrTdU:`x1jm3nie x16khyan`,kY2c9j:`x1vjfegm`,$$css:!0},thumbHorizontal:{k87sOh:`xwa60dl`,k3aq6I:`x11lhmoz xoffwj3`,$$css:!0},thumbHover:{kWkggS:`x1ewilqj xvxo0qp`,$$css:!0},thumbDisabled:{kWkggS:`xwmxj5m`,kkrTdU:`xt0e3qv`,$$css:!0}};function uW(e,t,n){return Math.min(Math.max(e,t),n)}function dW(e){if(Math.abs(e)<1){let t=e.toExponential().split(`e-`);if(t.length===2)return(t[0].split(`.`)[1]?.length??0)+parseInt(t[1],10)}let t=String(e).split(`.`)[1];return t?t.length:0}function fW(e,t,n){if(n<=0)return e;let r=t+Math.round((e-t)/n)*n,i=Math.min(Math.max(dW(t),dW(n)),20);return Number(r.toFixed(i))}function pW(e,t,n){return n===t?0:(e-t)/(n-t)*100}var mW=cW/2;function hW(e){return vW(e,mW-e/100*cW)}function gW(e,t){let n=t-e;return vW(n,-(n/100)*cW)}function _W(e,t){let n=t-cW;return n>0?(e-mW)/n:t>0?e/t:0}function vW(e,t){let n=e=>Number(e.toFixed(3));return`calc(${n(e)}% ${t<0?`-`:`+`} ${Math.abs(n(t))}px)`}function yW({ref:e,...t}){let{label:n,isLabelHidden:r=!1,description:i,isDisabled:a=!1,disabledMessage:o,isOptional:s=!1,isRequired:c=!1,status:l,labelTooltip:u,min:d=0,max:f=100,step:p=1,orientation:m=`horizontal`,formatValue:h,htmlName:g,valueDisplay:_=`tooltip`,marks:v,width:y,xstyle:b,className:x,style:S,"data-testid":C,value:T,onChange:E,onChangeEnd:k}=t,A=Array.isArray(T),j=A&&`minStepsBetweenThumbs`in t?t.minStepsBetweenThumbs??0:0,M=m===`horizontal`,P=(0,K.useId)(),I=(0,K.useId)(),ee=(0,K.useId)(),L=(0,K.useId)(),R=(0,K.useId)(),te=(0,K.useRef)(null),z=(0,K.useRef)(null),[B,ne]=(0,K.useState)(null),[re,ie]=(0,K.useState)(null);(0,K.useEffect)(()=>{D()},[]);let ae=(0,K.useCallback)((e,t)=>{ie(!a&&N()===`keyboard`?e:null)},[a]),oe=(0,K.useCallback)(e=>{ie(null)},[]),se=a&&!!o,ce=F({placement:`above`,focusTrigger:`always`,isEnabled:se}),le=c&&!s,ue=[];i&&ue.push(ee),l?.message&&ue.push(L),le&&ue.push(R),se&&ue.push(ce.describedBy);let de=ue.length>0?ue.join(` `):void 0,pe=(0,K.useMemo)(()=>(Array.isArray(T)?T:[T??d]).map(e=>uW(e,d,f)),[T,d,f]),me=(0,K.useRef)(pe);me.current=pe;let he=(0,K.useCallback)((e,t)=>{let n=te.current;if(!n)return d;let r=n.getBoundingClientRect(),i;return i=M?_W(Ya(n)?r.right-e:e-r.left,r.width):1-_W(t-r.top,r.height),i=uW(i,0,1),uW(fW(d+i*(f-d),d,p),d,f)},[d,f,p,M]),ge=(0,K.useCallback)(e=>{if(!A)return 0;let[t,n]=pe;return Math.abs(e-t)<=Math.abs(e-n)?0:1},[A,pe]),_e=(0,K.useCallback)((e,t)=>{if(a)return;let n=uW(fW(t,d,p),d,f);if(A){let t=[...pe];t[e]=n;let r=j*p;e===0?t[0]=Math.min(t[0],t[1]-r):t[1]=Math.max(t[1],t[0]+r),t[0]=uW(t[0],d,f),t[1]=uW(t[1],d,f),E?.(t)}else E?.(n)},[a,A,pe,d,f,p,j,E]),ve=(0,K.useRef)(k);ve.current=k;let ye=(0,K.useCallback)(e=>{let t=e??me.current,n=ve.current;A?n?.(t):n?.(t[0])},[A]),be=(0,K.useCallback)(e=>{if(a)return;e.preventDefault();let t=e.target.closest(`[data-mark-value]`),n=t?Number(t.dataset.markValue):he(e.clientX,e.clientY),r=ge(n);z.current=r,ne(r),_e(r,n);let i=te.current;i&&i.querySelectorAll(`[role="slider"]`)[r]?.focus(),ie(null),typeof e.currentTarget.setPointerCapture==`function`&&e.currentTarget.setPointerCapture(e.pointerId)},[a,he,ge,_e]),xe=(0,K.useCallback)(e=>{if(z.current===null||a)return;let t=he(e.clientX,e.clientY);_e(z.current,t)},[a,he,_e]),Se=(0,K.useCallback)(e=>{z.current!==null&&(z.current=null,ne(null),ye())},[ye]),Ce=(0,K.useCallback)((e,t)=>{if(a)return;N()===`keyboard`&&ie(e);let n=pe[e],r;switch(t.key){case`ArrowRight`:case`ArrowUp`:r=n+p;break;case`ArrowLeft`:case`ArrowDown`:r=n-p;break;case`PageUp`:r=n+p*10;break;case`PageDown`:r=n-p*10;break;case`Home`:r=d;break;case`End`:r=f;break;default:return}t.preventDefault();let i=uW(fW(r,d,p),d,f);if(_e(e,r),A){let t=[...pe];t[e]=i;let n=j*p;e===0?t[0]=Math.min(t[0],t[1]-n):t[1]=Math.max(t[1],t[0]+n),t[0]=uW(t[0],d,f),t[1]=uW(t[1],d,f),ye(t)}else ye([i])},[a,A,pe,p,d,f,j,_e,ye]),Te=e=>h?h(e):String(e),Ee=e=>{let t=pe[e],n=pW(t,d,f),r=M?{insetInlineStart:hW(n)}:{bottom:hW(n),left:`50%`},i=A?e===0?`Minimum value`:`Maximum value`:void 0,o=j*p,s=A&&e===1?uW(pe[0]+o,d,f):d,c=A&&e===0?uW(pe[1]-o,d,f):f,u=_===`tooltip`&&!se,g=M?`above`:`start`,v=(0,q.jsx)(`div`,{id:A?void 0:P,role:`slider`,tabIndex:a&&!se?-1:0,"aria-valuemin":s,"aria-valuemax":c,"aria-valuenow":t,"aria-valuetext":h?h(t):void 0,"aria-orientation":m,"aria-disabled":a||void 0,"aria-invalid":l?.type===`error`||void 0,"aria-label":i,"aria-labelledby":A?void 0:I,"aria-describedby":de,onKeyDown:t=>Ce(e,t),onFocus:t=>ae(e,t),onBlur:oe,...H(O(`slider-thumb`,{orientation:m,disabled:a?`disabled`:null}),w(lW.thumb,M?lW.thumbHorizontal:Et.centerInline(`50%`),!a&&lW.thumbHover,!a&&re===e&&fe.focusVisible,a&&lW.thumbDisabled),void 0,r)},e);return u?(0,q.jsx)(V,{content:Te(t),placement:g,delay:0,focusTrigger:`always`,isOpen:B===e||void 0,children:v},e):v},U=(()=>{if(A){let[e,t]=pe,n=pW(e,d,f),r=pW(t,d,f);return M?{insetInlineStart:hW(n),width:gW(n,r)}:{bottom:hW(n),height:gW(n,r)}}let e=pW(pe[0],d,f);return M?{insetInlineStart:`0%`,width:hW(e)}:{bottom:`0%`,height:hW(e)}})(),De=_===`text`?(0,q.jsx)(`span`,{className:`x9ynric xcr08ib x1tgivj0 xuxw1ft x2lah0s`,children:A?`${Te(pe[0])} – ${Te(pe[1])}`:Te(pe[0])}):null;return(0,q.jsxs)(zO,{"data-testid":C,label:n,isLabelHidden:r,description:i,inputID:P,labelID:I,isGroupLabel:!0,descriptionID:i?ee:void 0,isOptional:s,isRequired:c,isDisabled:a,status:l?{type:l.type,message:l.message,messageID:l.message?L:void 0}:void 0,labelTooltip:u,statusVariant:`detached`,width:y,xstyle:b,className:x,style:S,children:[(0,q.jsxs)(`div`,{...H(O(`slider`,{orientation:m,disabled:a?`disabled`:null}),{className:`x78zum5 x6s0dn4 x1txdalj`}),children:[g!=null&&pe.map((e,t)=>(0,q.jsx)(`input`,{type:`hidden`,name:g,value:String(e),disabled:a},t===0?`start`:`end`)),(0,q.jsxs)(`div`,{ref:we(e,te,ce.ref),...A?{role:`group`,"aria-labelledby":I}:void 0,onPointerDown:be,onPointerMove:xe,onPointerUp:Se,onPointerCancel:Se,...{0:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k x1ypdohk x16khyan`},2:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 x1ypdohk x16khyan`},1:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 xw4jnvo x1ymw6g xkagaj0 xdt5ytf xl56j7k xbyyjgo xt0e3qv`},3:{className:`x1n2onr6 x78zum5 x6s0dn4 x1iyjqo2 x5ve5x3 x87ps6o xc8icb0 x1qx5ct2 x80b3aj xh8yej3 xbyyjgo xt0e3qv`}}[!!M<<1|!!a<<0],children:[(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(O(`slider-track`,{orientation:m}),w(lW.track,M?lW.trackHorizontal:[lW.trackVertical,Et.centerInline(`0px`)]))}),(0,q.jsx)(`div`,{"aria-hidden":`true`,...H(w(lW.filledTrack,M?lW.filledTrackHorizontal:[lW.filledTrackVertical,Et.centerInline(`0px`)]),{style:U})}),v&&(0,q.jsx)(`div`,{"aria-hidden":`true`,...{0:{className:`x10l6tqk x13vifvy x1ey2m1c xbudbmw`},1:{className:`x10l6tqk x1o0tod xtijo5x xwa60dl`}}[!!M<<0],children:v.map(e=>{let t=pW(e.value,d,f),n=M?{insetInlineStart:hW(t)}:{bottom:hW(t)};return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{"data-testid":`slider-mark`,"data-mark-value":e.value,...H({0:{className:`x10l6tqk x7njt3n xjspbzw x36qwtl x1xc55vz x1m9mm8y`},1:{className:`x10l6tqk x7njt3n xjspbzw xfo62xy xdk7pt x11lhmoz xoffwj3`}}[!!M<<0],{style:n})}),e.label&&(0,q.jsx)(`span`,{"data-testid":`slider-mark-label`,"data-mark-value":e.value,...H({0:{className:`x10l6tqk x9ynric x141an7d xv1l7n4 xuxw1ft x131p8rn x9p6ekw`},1:{className:`x10l6tqk x9ynric x141an7d xv1l7n4 xuxw1ft xuuh30 x1nyx83j xuivejd`}}[!!M<<0],{style:n}),children:e.label})]},e.value)})}),pe.map((e,t)=>Ee(t))]}),De]}),le&&(0,q.jsx)(Kt,{id:R,children:`Required`}),se&&ce.renderTooltip(o)]})}yW.displayName=`Slider`;var bW=[`explorer`,`implementer`,`reviewer`,`advisor`];function xW({catalog:e,error:t,onRefresh:n}){let{t:r}=W();return!t&&!e?(0,q.jsxs)(`div`,{className:`settings-load-state`,role:`status`,children:[(0,q.jsx)(me,{className:`settings-spin`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:r(`settingsCatalogLoading`)})]}):t?(0,q.jsxs)(`div`,{className:`settings-load-state error`,role:`alert`,children:[(0,q.jsx)(`strong`,{children:r(`settingsCatalogFailed`)}),(0,q.jsx)(`span`,{children:t}),(0,q.jsx)(`button`,{type:`button`,onClick:n,children:r(`retryAdmissionCheck`)})]}):null}function SW({icon:e,title:t,description:n,value:r,disabled:i,loading:a,onChange:o}){return(0,q.jsxs)(`div`,{className:`settings-inline-control settings-toggle-row`,children:[(0,q.jsx)(e,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-inline-copy`,children:[(0,q.jsx)(`strong`,{children:t}),n&&(0,q.jsx)(`small`,{children:n})]}),(0,q.jsx)(bj,{label:t,isLabelHidden:!0,value:r,size:`sm`,isDisabled:i,isLoading:a,onChange:o})]})}function CW({isPending:e,isBlocked:t=!1,onConfigure:n,request:r,label:i}){return(0,q.jsx)(Br,{label:i,variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Xc,{"aria-hidden":`true`}),isDisabled:e||t,isLoading:e,onClick:()=>void n(r)})}function wW({pending:e,onConfigure:t,placeholder:n}){let{t:r}=W(),[i,a]=(0,K.useState)(``);return(0,q.jsxs)(`form`,{className:`settings-edit-form`,onSubmit:n=>{n.preventDefault(),!e&&i.trim()&&t(i.trim())},children:[(0,q.jsxs)(`label`,{className:`settings-form-field`,children:[r(`setupConfigurationRequest`),(0,q.jsx)(`textarea`,{required:!0,maxLength:2e3,value:i,disabled:e,placeholder:n,onChange:e=>a(e.target.value)})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:e||!i.trim(),children:r(`configureViaSetup`)}),(0,q.jsx)(`small`,{children:r(`setupFormDetail`)})]})}function TW({catalog:e,error:t,currentModel:n,thinkingLevel:r,cwd:i,setupPending:a,setupBlocked:o=!1,preferencePending:s,setupBusy:c,setupBlockedReason:l,onConfigure:u,onUpdatePreferences:d,onOpenRuntimeStatus:f,onRefresh:p}){let{t:m}=W(),h=e?.setup,g=h?.workflows.concurrency??0,_=h?.workflows.maxAgentCalls??0,[v,y]=(0,K.useState)(g),[b,x]=(0,K.useState)(_);return(0,K.useEffect)(()=>y(g),[g]),(0,K.useEffect)(()=>x(_),[_]),(0,q.jsxs)(`section`,{className:`settings-content-page settings-general-panel`,children:[(0,q.jsxs)(`div`,{className:`settings-page-heading`,children:[(0,q.jsx)(`div`,{children:(0,q.jsx)(`h1`,{children:m(`generalSettings`)})}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:u,request:m(`setupRequestReviewAll`),label:m(`configureOpenPi`)})]}),c&&(0,q.jsx)(`p`,{className:`settings-pending-hint`,role:`status`,children:l||m(`settingsSetupBusyHint`)}),(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:p}),h&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`section`,{className:`settings-section-block`,children:(0,q.jsxs)(`div`,{className:`settings-follow-up-control`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:m(`followUpBehavior`)}),(0,q.jsx)(`p`,{children:m(`followUpBehaviorDetail`)})]}),(0,q.jsxs)(`fieldset`,{className:`settings-follow-up-choices`,disabled:s,children:[(0,q.jsx)(`legend`,{className:`sr-only`,children:m(`followUpBehavior`)}),[`followUp`,`steer`].map(e=>(0,q.jsxs)(`label`,{children:[(0,q.jsx)(`input`,{type:`radio`,name:`follow-up-behavior`,value:e,"aria-label":m(e===`steer`?`followUpSteer`:`followUpQueue`),checked:(h.ui.webFollowUpBehavior??`followUp`)===e,onChange:()=>void d({followUpBehavior:e})}),(0,q.jsxs)(`span`,{className:`settings-follow-up-option`,children:[e===`steer`?(0,q.jsx)(Cs,{"aria-hidden":`true`}):(0,q.jsx)(tc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-follow-up-option-copy`,children:[(0,q.jsx)(`strong`,{children:m(e===`steer`?`followUpSteer`:`followUpQueue`)}),(0,q.jsx)(`small`,{children:m(e===`steer`?`followUpSteerDetail`:`followUpQueueDetail`)})]})]})]},e))]})]})}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`agentBehavior`)}),(0,q.jsxs)(`div`,{className:`settings-chat-controls`,children:[(0,q.jsxs)(`form`,{className:`settings-limits-control`,onSubmit:e=>{e.preventDefault(),!a&&!o&&u(m(`setupRequestLimits`,{concurrency:v,calls:b}))},children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(Us,{"aria-hidden":`true`}),m(`workflowLimits`)]}),(0,q.jsx)(`small`,{children:m(`workflowLimitsValue`,{concurrency:h.workflows.concurrency,calls:h.workflows.maxAgentCalls})}),(0,q.jsxs)(`label`,{children:[m(`workflowConcurrency`),(0,q.jsx)(`input`,{type:`number`,min:1,value:v,disabled:a||o,onChange:e=>y(Number(e.target.value)),required:!0})]}),(0,q.jsxs)(`label`,{children:[m(`workflowCalls`),(0,q.jsx)(`input`,{type:`number`,min:1,value:b,disabled:a||o,onChange:e=>x(Number(e.target.value)),required:!0})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:a||o||v===h.workflows.concurrency&&b===h.workflows.maxAgentCalls,children:m(`configureViaSetup`)})]}),(0,q.jsx)(SW,{icon:Pc,title:m(`nextActionSuggestions`),description:m(`nextActionSuggestionsDetail`),value:h.suggestions.enabled,disabled:a||o,loading:a,onChange:e=>void u(m(e?`setupRequestEnableSuggestions`:`setupRequestDisableSuggestions`))}),h.suggestions.model&&(0,q.jsx)(`small`,{children:`${h.suggestions.model.provider}/${h.suggestions.model.model} · ${h.suggestions.model.reasoning}`}),(0,q.jsxs)(`div`,{className:`settings-inline-control`,children:[(0,q.jsx)(bs,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`settings-inline-copy`,children:[(0,q.jsxs)(`strong`,{children:[m(`postEditCommand`),(0,q.jsx)(`span`,{className:`settings-inline-status`,children:m(h.postEditConfigured?`configured`:`disabled`)})]}),(0,q.jsx)(`small`,{children:m(`postEditCommandDetail`)})]}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:u,request:m(`setupRequestPostEdit`),label:m(`configurePostEdit`)})]}),(0,q.jsx)(`small`,{children:m(`agentSettingsSetupHint`)})]})]}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`resultDisplay`)}),(0,q.jsxs)(`div`,{className:`settings-chat-controls`,children:[[[`subagentResultDisplay`,`subagentResults`,ws],[`bashToolDisplay`,`bashOperations`,Vc],[`fileMutationDisplay`,`fileMutations`,Fs]].map(([e,t,n])=>(0,q.jsxs)(`label`,{className:`settings-inline-control`,htmlFor:`settings-${e}`,children:[(0,q.jsx)(n,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`settings-inline-copy`,children:(0,q.jsx)(`strong`,{children:m(t)})}),(0,q.jsx)(Tj,{id:`settings-${e}`,className:`settings-select-control`,label:m(t),value:h.ui[e],disabled:s,onChange:t=>{(t===`full`||t===`compact`)&&d({[e]:t})},options:[{value:`compact`,label:m(`detailDisplay_compact`)},{value:`full`,label:m(`detailDisplay_full`)}]})]},e)),(0,q.jsx)(SW,{icon:mc,title:m(`terminalFooter`),value:h.ui.customFooter,disabled:s,loading:s,onChange:e=>void d({customFooter:e})}),(0,q.jsxs)(`label`,{className:`settings-inline-control`,htmlFor:`settings-footer-style`,children:[(0,q.jsx)(`span`,{children:m(`terminalFooterStyle`)}),(0,q.jsx)(Tj,{id:`settings-footer-style`,className:`settings-select-control`,label:m(`terminalFooterStyle`),value:h.ui.footerStyle,disabled:s||!h.ui.customFooter,onChange:e=>{(e===`plain`||e===`powerline`||e===`powerline-mono`)&&d({footerStyle:e})},options:[{value:`plain`,label:`Plain`},{value:`powerline`,label:`Powerline`},{value:`powerline-mono`,label:`Powerline Mono`}]})]}),(0,q.jsx)(`small`,{children:m(`terminalFooterHint`)})]})]})]}),(0,q.jsx)(sW,{}),(0,q.jsxs)(`section`,{className:`settings-section-block`,children:[(0,q.jsx)(`h2`,{children:m(`sessionSettings`)}),(0,q.jsxs)(`dl`,{className:`settings-summary-list`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`selectedModel`)}),(0,q.jsx)(`dd`,{children:n?.label??m(`noModels`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`thinkingLevel`)}),(0,q.jsx)(`dd`,{children:r})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:m(`currentWorkspace`)}),(0,q.jsx)(`dd`,{title:i,children:i})]})]}),(0,q.jsx)(Br,{label:m(`openRuntimeDetails`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ls,{"aria-hidden":`true`}),className:`settings-runtime-action`,onClick:f})]})]})}function EW(e){return e.split(/[\\/]/u).filter(Boolean).at(-1)||e}function DW({kind:e,query:t,scope:n,onQuery:r,onScope:i,onAdd:a}){let{t:o}=W();return(0,q.jsxs)(`div`,{className:`settings-resource-toolbar`,children:[(0,q.jsxs)(`div`,{className:`settings-resource-toolbar-heading`,children:[(0,q.jsx)(`strong`,{children:o(`resources`)}),(0,q.jsx)(Br,{label:o(e===`skills`?`addSkill`:`addPlugin`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:a})]}),(0,q.jsxs)(`label`,{className:`settings-resource-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":o(`searchResources`),placeholder:o(`searchResources`),value:t,onChange:e=>r(e.target.value)})]}),(0,q.jsx)(Tj,{label:o(`filterResourceScope`),value:n,onChange:i,options:[{value:`all`,label:o(`allResourceScopes`)},...[`project`,`user`,`temporary`].map(e=>({value:e,label:o(`resourceScope_${e}`)}))]})]})}function OW({kind:e,pending:t,onConfigure:n,onCancel:r}){let{t:i}=W(),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(`user`);return(0,q.jsxs)(`section`,{className:`settings-resource-install`,children:[(0,q.jsx)(`header`,{className:`settings-detail-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:i(e===`skills`?`addSkill`:`addPlugin`)}),(0,q.jsx)(`p`,{children:i(`resourceInstallIntro`)})]})}),(0,q.jsxs)(`form`,{className:`settings-edit-form`,onSubmit:r=>{r.preventDefault(),!t&&a.trim()&&n(i(`setupResourceInstallRequest`,{kind:i(e===`skills`?`skillsSettings`:`pluginsSettings`),source:JSON.stringify(a.trim()),scope:s}))},children:[(0,q.jsxs)(`label`,{className:`settings-form-field`,children:[i(`resourcePackageSource`),(0,q.jsx)(`input`,{required:!0,maxLength:1e3,value:a,placeholder:i(`resourcePackageSourcePlaceholder`),disabled:t,onChange:e=>{o(e.target.value)}})]}),(0,q.jsxs)(`label`,{className:`settings-form-field`,htmlFor:`resource-install-scope`,children:[i(`scope`),(0,q.jsx)(Tj,{id:`resource-install-scope`,label:i(`scope`),value:s,disabled:t,onChange:c,options:[{value:`user`,label:i(`resourceScope_user`)},{value:`project`,label:i(`resourceScope_project`)}]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-actions`,children:[(0,q.jsx)(Br,{type:`submit`,label:i(`configureViaSetup`),variant:`secondary`,size:`sm`,isDisabled:t||!a.trim()}),(0,q.jsx)(Br,{label:i(`cancel`),variant:`ghost`,size:`sm`,onClick:r})]}),(0,q.jsx)(`small`,{children:i(`resourceInstallReview`)})]}),e===`skills`&&(0,q.jsxs)(`a`,{className:`settings-resource-link`,href:`https://skills.sh`,target:`_blank`,rel:`noreferrer`,children:[i(`browseSkills`),(0,q.jsx)(Os,{"aria-hidden":`true`})]})]})}function kW({catalog:e,pending:t,onReload:n,kind:r,onConfigure:i,children:a}){let{t:o}=W(),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(null);return(0,q.jsxs)(`section`,{className:`settings-resource-management`,children:[a&&(0,q.jsx)(`div`,{className:`settings-resource-actions`,children:a}),(0,q.jsxs)(`div`,{className:`settings-resource-reload`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:o(`resourceSessionState`)}),(0,q.jsx)(`p`,{children:o(`resourcesReloadNote`)})]}),(0,q.jsx)(Br,{label:o(`reloadResources`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(me,{"aria-hidden":`true`}),isDisabled:t||l||!e?.sessionPath||!n,isLoading:l,onClick:()=>c(!0)})]}),d&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,role:`status`,children:d}),(0,q.jsxs)(`details`,{className:`settings-resource-advanced`,children:[(0,q.jsx)(`summary`,{children:o(`advancedResourceConfiguration`)}),(0,q.jsx)(wW,{pending:t,onConfigure:i,placeholder:o(r===`skills`?`setupSkillsPlaceholder`:`setupPluginsPlaceholder`)})]}),s&&(0,q.jsx)(uj,{isOpen:!0,onOpenChange:c,title:o(`reloadResources`),description:o(`resourceReloadReview`),cancelLabel:o(`cancel`),actionLabel:o(`reloadResources`),onAction:()=>{c(!1),u(!0),f(null),n?.().then(()=>f(o(`resourceReloaded`)),e=>f(e instanceof Error?e.message:o(`resourceReloadFailed`))).finally(()=>u(!1))}})]})}function AW({catalog:e}){let{t}=W();if(!e)return null;let{diagnostics:n,truncation:r}=e.resources;return!n.settingsErrors&&!n.extensionErrors&&!n.skillErrors&&!r.truncated?null:(0,q.jsxs)(`p`,{className:`settings-resource-notice`,role:`status`,children:[t(`resourceDiagnostics`,n),n.settingsErrors?` ${t(`resourceConfigurationDiagnostics`,{count:n.settingsErrors})}`:``,r.truncated&&` ${t(`resourceCatalogTruncated`)}`]})}function jW({catalog:e,error:t,onRefresh:n,setupPending:r,onConfigure:i,onReload:a}){let{t:o}=W(),s=e?.resources.skills??[],[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(`all`),[f,p]=(0,K.useState)(!1),m=(0,K.useMemo)(()=>s.filter(e=>(u===`all`||e.scope===u)&&`${e.name} ${e.description} ${e.source}`.toLocaleLowerCase().includes(c.trim().toLocaleLowerCase())),[s,c,u]),h=(0,K.useMemo)(()=>[`project`,`user`,`temporary`].map(e=>({scope:e,skills:m.filter(t=>t.scope===e)})).filter(e=>e.skills.length>0),[m]),[g,_]=(0,K.useState)(``),[v,y]=(0,K.useState)(null),b=m.find(e=>e.id===g)??m[0],x=m.filter(e=>e.canManage!==!1),S=JSON.stringify(x.map(e=>e.filePath)),C=new TextEncoder().encode(S).length>12e3;(0,K.useEffect)(()=>{s.length&&!s.some(e=>e.id===g)&&_(s[0].id)},[g,s]);let w=e=>{y(null),td(`/skill:${e.name} `).then(e=>y(e?`copied`:`failed`))};return(0,q.jsxs)(`section`,{className:`settings-content-page settings-managed-panel`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:o(`skillsSettings`)}),(0,q.jsx)(`p`,{children:o(`skillsEmptyIntro`)})]})}),(0,q.jsxs)(`aside`,{className:`settings-resource-sidebar`,children:[(0,q.jsx)(DW,{kind:`skills`,query:c,scope:u,onQuery:l,onScope:d,onAdd:()=>p(!0)}),(0,q.jsxs)(`div`,{className:`settings-resource-list`,children:[h.map(e=>(0,q.jsxs)(`section`,{className:`settings-resource-group`,children:[(0,q.jsx)(`span`,{className:`settings-sidebar-label`,children:o(`resourceScope_${e.scope}`)}),e.skills.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:`settings-resource-item`,"aria-current":e.id===b?.id?`page`:void 0,onClick:()=>{_(e.id),y(null),p(!1)},children:[(0,q.jsx)(Pc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:e.name}),(0,q.jsx)(`small`,{children:o(e.disableModelInvocation?`explicitOnly`:`availableToModel`)})]})]},e.id))]},e.scope)),!e&&!t&&(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}),e&&!m.length&&(0,q.jsx)(`p`,{className:`settings-resource-empty`,children:o(s.length?`noMatchingResources`:`noSkillsFound`)})]}),(0,q.jsxs)(`div`,{className:`settings-sidebar-footer`,children:[(0,q.jsx)(`span`,{children:o(`skillCount`,{count:s.length})}),(0,q.jsx)(`button`,{type:`button`,"aria-label":o(`refreshStatus`),onClick:n,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-detail`,children:[(0,q.jsx)(AW,{catalog:e}),f?(0,q.jsx)(OW,{kind:`skills`,pending:r,onConfigure:i,onCancel:()=>p(!1)}):t?(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}):b?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`settings-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:b.name}),(0,q.jsx)(`p`,{children:b.description})]}),(0,q.jsx)(Br,{label:o(v===`copied`?`copiedMessage`:`copySkillInvocation`),variant:`secondary`,size:`sm`,icon:v===`copied`?(0,q.jsx)(rs,{}):(0,q.jsx)(_s,{}),onClick:()=>w(b)})]}),(0,q.jsxs)(`dl`,{className:`settings-detail-metadata`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`source`)}),(0,q.jsx)(`dd`,{children:b.source===`auto`?o(`resourceSourceAuto`):b.source===`local`?o(`resourceSourceLocal`):b.source===`builtin`?o(`builtIn`):b.source})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`scope`)}),(0,q.jsx)(`dd`,{children:o(`resourceScope_${b.scope}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`invocation`)}),(0,q.jsx)(`dd`,{children:(0,q.jsx)(`code`,{children:`/skill:${b.name}`})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`modelInvocation`)}),(0,q.jsx)(`dd`,{children:o(b.disableModelInvocation?`explicitOnly`:`availableToModel`)})]})]}),(0,q.jsxs)(`section`,{className:`settings-path-block`,children:[(0,q.jsx)(Fs,{"aria-hidden":`true`}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:o(`skillFile`)}),(0,q.jsx)(`code`,{children:b.filePath})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-actions`,children:[(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(b.disableModelInvocation?`enableSkillInvocation`:`disableSkillInvocation`),request:o(`setupSkillInvocationRequest`,{path:b.filePath,disabled:!b.disableModelInvocation})}),(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(`updateResource`),request:o(`setupSkillManageRequest`,{action:`update`,path:JSON.stringify(b.filePath),source:JSON.stringify(b.source),scope:b.scope})}),(0,q.jsx)(CW,{isPending:r,isBlocked:b.canManage===!1,onConfigure:i,label:o(`removeResource`),request:o(`setupSkillManageRequest`,{action:`remove`,path:JSON.stringify(b.filePath),source:JSON.stringify(b.source),scope:b.scope})})]}),b.canManage===!1&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,children:o(`resourceTargetTruncated`)}),v===`failed`&&(0,q.jsx)(`p`,{className:`inspection-warning`,children:o(`copyFailed`)})]}):(0,q.jsxs)(`div`,{className:`settings-empty-detail`,children:[(0,q.jsx)(Pc,{"aria-hidden":`true`}),(0,q.jsx)(`h2`,{children:o(s.length?`noMatchingResources`:`skillsEmptyTitle`)}),(0,q.jsx)(Br,{label:o(`addSkill`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:()=>p(!0)})]}),!f&&(0,q.jsxs)(kW,{catalog:e,pending:r,onReload:a,kind:`skills`,onConfigure:i,children:[x.length>1&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(CW,{isPending:r,isBlocked:C,onConfigure:i,label:o(`enableVisibleSkills`,{count:x.length}),request:o(`setupSkillsBulkRequest`,{paths:S,disabled:!1})}),(0,q.jsx)(CW,{isPending:r,isBlocked:C,onConfigure:i,label:o(`disableVisibleSkills`,{count:x.length}),request:o(`setupSkillsBulkRequest`,{paths:S,disabled:!0})})]}),C&&(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`resourceBulkTooLarge`)})]})]})]})}function MW({catalog:e,error:t,currentModel:n,models:r,activity:i,setupPending:a,setupBlocked:o=!1,onConfigure:s,onRefresh:c}){let{t:l}=W(),[u,d]=(0,K.useState)(`explorer`),f=e?.setup.subagents.roleModels[u],[p,m]=(0,K.useState)(``),[h,g]=(0,K.useState)(1);(0,K.useEffect)(()=>{let t=e?.setup.subagents.roleModels[u];m(t?`${t.provider}/${t.model}`:``),g(e?.setup.workflows.concurrency??1)},[u,e]);let _=i?.items.filter(e=>e.status===`running`).length??0,v=i?.items.filter(e=>e.status!==`running`).length??0;return(0,q.jsxs)(`section`,{className:`settings-content-page settings-subagents-panel`,children:[(0,q.jsxs)(`header`,{className:`settings-page-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:l(`subagentsSettings`)}),(0,q.jsx)(`p`,{children:l(`subagentConfigurationIntro`)})]}),(0,q.jsx)(CW,{isPending:a,isBlocked:o,onConfigure:s,request:l(`setupRequestSubagents`),label:l(`configureRoles`)})]}),(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:c}),(0,q.jsx)(`div`,{className:`settings-control-group`,children:(0,q.jsxs)(`label`,{className:`settings-control-row`,htmlFor:`subagent-role`,children:[(0,q.jsxs)(`span`,{className:`settings-control-copy`,children:[(0,q.jsx)(`strong`,{children:l(`builtInRoles`)}),(0,q.jsx)(`span`,{children:l(`subagentRoleShort_${u}`)})]}),(0,q.jsx)(Tj,{id:`subagent-role`,name:`subagentRole`,label:l(`builtInRoles`),value:u,onChange:e=>{let t=bW.find(t=>t===e);t&&d(t)},options:bW.map(e=>({value:e,label:l(`subagentRole_${e}`)}))})]})}),(0,q.jsx)(`div`,{className:`settings-role-detail`,children:e&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`header`,{className:`settings-detail-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:l(`subagentRole_${u}`)}),(0,q.jsx)(`p`,{children:l(`subagentRoleDescription_${u}`)})]})}),(0,q.jsxs)(`form`,{className:`settings-edit-form settings-role-form`,onSubmit:e=>{e.preventDefault(),!(a||o)&&s(l(`setupRoleFormRequest`,{role:u,model:p||l(`inheritParentModel`),concurrency:h}))},children:[(0,q.jsxs)(`div`,{className:`settings-control-group`,children:[(0,q.jsxs)(`label`,{className:`settings-control-row`,htmlFor:`role-model`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`modelAssignment`)})}),(0,q.jsx)(Tj,{id:`role-model`,name:`roleModel`,label:l(`modelAssignment`),value:p,disabled:a||o,onChange:m,menuWidth:`min(380px, calc(100vw - 32px))`,options:[{value:``,label:l(`inheritParentModel`)},...p&&!r.some(e=>`${e.provider}/${e.id}`===p)?[{value:p,label:p}]:[],...r.map(e=>({value:`${e.provider}/${e.id}`,label:e.label}))]})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`effectiveModel`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:f?`${f.provider}/${f.model}`:n?.label??l(`unknownState`)})]}),(0,q.jsxs)(`label`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`workflowConcurrencyLabel`)})}),(0,q.jsx)(`input`,{name:`concurrency`,type:`number`,autoComplete:`off`,min:1,max:64,required:!0,value:h,disabled:a||o,onChange:e=>g(Number(e.target.value))})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(`span`,{className:`settings-control-copy`,children:(0,q.jsx)(`strong`,{children:l(`workflowCallLimit`)})}),(0,q.jsx)(`span`,{className:`settings-control-value`,children:e.setup.workflows.maxAgentCalls})]})]}),(0,q.jsx)(`button`,{type:`submit`,disabled:a||o,children:l(`configureViaSetup`)}),(0,q.jsx)(`small`,{className:`settings-resource-caption`,children:l(`setupFormDetail`)})]}),(0,q.jsxs)(`section`,{className:`settings-role-principles`,children:[(0,q.jsx)(`h2`,{children:l(`runtimeBoundaries`)}),(0,q.jsxs)(`div`,{className:`settings-control-group`,children:[(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(Ys,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:l(`subagentAuthorityNote`)})]}),(0,q.jsxs)(`div`,{className:`settings-control-row`,children:[(0,q.jsx)(ws,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:l(`subagentModelNote`)})]})]}),(0,q.jsxs)(`p`,{className:`settings-resource-caption`,children:[l(`subagentActiveCount`,{count:_}),` ·`,` `,l(`subagentCompletedCount`,{count:v})]})]})]})})]})}function NW(e){return e.extensions.length+e.skills.length+e.prompts.length+e.themes.length}function PW(e){return e.enabled===!1?`disabled`:e.configured&&!e.installed?`missing`:e.diagnostics?.length?`error`:NW(e)?`loaded`:e.installed?`installed`:`notLoaded`}function FW({catalog:e,error:t,onRefresh:n,setupPending:r,onConfigure:i,onReload:a}){let{t:o}=W(),s=e?.resources.plugins??[],[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)(`all`),[f,p]=(0,K.useState)(!1),m=(0,K.useMemo)(()=>s.filter(e=>(u===`all`||e.scope===u)&&`${e.name??``} ${e.source}`.toLocaleLowerCase().includes(c.trim().toLocaleLowerCase())),[s,c,u]),[h,g]=(0,K.useState)(``),_=m.find(e=>e.id===h)??m[0],v=m.filter(e=>e.configured&&e.canManage!==!1),y=e=>e.name??(e.source===`auto`?o(`resourceSourceAuto`):e.source===`builtin`?o(`builtIn`):EW(e.source)),b=JSON.stringify(v.map(({source:e,scope:t,baseDir:n})=>({source:e,scope:t,path:n}))),x=new TextEncoder().encode(b).length>12e3;return(0,K.useEffect)(()=>{s.length&&!s.some(e=>e.id===h)&&g(s[0].id)},[s,h]),(0,q.jsxs)(`section`,{className:`settings-content-page settings-managed-panel`,children:[(0,q.jsx)(`header`,{className:`settings-page-heading`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{children:o(`pluginsSettings`)}),(0,q.jsx)(`p`,{children:o(`pluginsEmptyIntro`)})]})}),(0,q.jsxs)(`aside`,{className:`settings-resource-sidebar`,children:[(0,q.jsx)(DW,{kind:`plugins`,query:c,scope:u,onQuery:l,onScope:d,onAdd:()=>p(!0)}),(0,q.jsxs)(`div`,{className:`settings-resource-list`,children:[m.map(e=>(0,q.jsxs)(`button`,{type:`button`,className:`settings-resource-item`,"aria-current":e.id===_?.id?`page`:void 0,onClick:()=>{g(e.id),p(!1)},children:[(0,q.jsx)(Sc,{"aria-hidden":`true`}),(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`strong`,{children:y(e)}),(0,q.jsxs)(`small`,{children:[o(`resourceScope_${e.scope}`),` ·`,` `,o(`pluginState_${PW(e)}`)]})]})]},e.id)),!e&&!t&&(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}),e&&!m.length&&(0,q.jsx)(`p`,{className:`settings-resource-empty`,children:o(s.length?`noMatchingResources`:`noPluginsFound`)})]}),(0,q.jsxs)(`div`,{className:`settings-sidebar-footer`,children:[(0,q.jsx)(`span`,{children:e?o(`pluginCount`,{count:s.length}):o(`settingsCatalogLoading`)}),(0,q.jsx)(`button`,{type:`button`,"aria-label":o(`refreshStatus`),onClick:n,children:(0,q.jsx)(me,{"aria-hidden":`true`})})]})]}),(0,q.jsxs)(`div`,{className:`settings-resource-detail`,children:[(0,q.jsx)(AW,{catalog:e}),f?(0,q.jsx)(OW,{kind:`plugins`,pending:r,onConfigure:i,onCancel:()=>p(!1)}):t?(0,q.jsx)(xW,{catalog:e,error:t,onRefresh:n}):_?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`header`,{className:`settings-detail-heading`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:y(_)}),(0,q.jsx)(`code`,{children:_.source})]}),(0,q.jsx)(`span`,{className:`settings-status-badge ${PW(_)===`loaded`?`healthy`:``}`,children:o(`pluginState_${PW(_)}`)})]}),(0,q.jsxs)(`dl`,{className:`settings-detail-metadata settings-detail-metadata-wide`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`scope`)}),(0,q.jsx)(`dd`,{children:o(`resourceScope_${_.scope}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`resourceOrigin`)}),(0,q.jsx)(`dd`,{children:o(`resourceOrigin_${_.origin}`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`installedVersion`)}),(0,q.jsx)(`dd`,{children:_.installedVersion??o(`notReported`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`configuredVersion`)}),(0,q.jsx)(`dd`,{children:_.configuredVersion??o(`resourceVersionUnpinned`)})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`resources`)}),(0,q.jsx)(`dd`,{children:o(`pluginResourceSummary`,{extensions:_.extensions.length,skills:_.skills.length,prompts:_.prompts.length,themes:_.themes.length})})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:o(`baseDirectory`)}),(0,q.jsx)(`dd`,{title:_.baseDir,children:_.baseDir??o(`notReported`)})]})]}),[...new Set(_.diagnostics)].map(e=>(0,q.jsx)(`p`,{className:`settings-resource-notice`,role:`status`,children:e},e)),_.canManage===!1&&(0,q.jsx)(`p`,{className:`settings-resource-notice`,children:o(`resourceTargetTruncated`)}),_.configured&&_.canManage!==!1&&(0,q.jsx)(`div`,{className:`settings-resource-actions settings-resource-primary-actions`,children:[_.enabled===!1?`enable`:`disable`,`update`,`remove`].map(e=>(0,q.jsx)(CW,{isPending:r,onConfigure:i,label:o(`pluginAction_${e}`),request:o(`setupPluginOperationRequest`,{action:e,source:JSON.stringify(_.source),path:JSON.stringify(_.baseDir??null),scope:_.scope})},e))}),(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`pluginLoadedResources`,{count:NW(_)})}),(0,q.jsxs)(`section`,{className:`settings-resource-groups`,children:[_.extensions.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`extensions`)}),(0,q.jsx)(`ul`,{children:_.extensions.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`strong`,{children:e.name}),(0,q.jsx)(`code`,{children:e.path})]}),(0,q.jsx)(`span`,{children:o(`extensionSurfaceCount`,{tools:e.toolCount,commands:e.commandCount})})]},e.path))})]}),_.skills.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`skillsSettings`)}),(0,q.jsx)(`p`,{children:_.skills.join(` · `)})]}),_.prompts.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`prompts`)}),(0,q.jsx)(`p`,{children:_.prompts.join(` · `)})]}),_.themes.length>0&&(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h2`,{children:o(`themes`)}),(0,q.jsx)(`p`,{children:_.themes.join(` · `)})]})]})]}):(0,q.jsxs)(`div`,{className:`settings-empty-detail`,children:[(0,q.jsx)(Sc,{"aria-hidden":`true`}),(0,q.jsx)(`h2`,{children:o(s.length?`noMatchingResources`:`pluginsEmptyTitle`)}),(0,q.jsx)(Br,{label:o(`addPlugin`),variant:`secondary`,size:`sm`,icon:(0,q.jsx)(Ae,{"aria-hidden":`true`}),onClick:()=>p(!0)})]}),!f&&(0,q.jsxs)(kW,{catalog:e,pending:r,onReload:a,kind:`plugins`,onConfigure:i,children:[v.length>1&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(CW,{isPending:r,isBlocked:x,onConfigure:i,label:o(`enableVisiblePlugins`,{count:v.length}),request:o(`setupPluginsBulkRequest`,{packages:b,disabled:!1})}),(0,q.jsx)(CW,{isPending:r,isBlocked:x,onConfigure:i,label:o(`disableVisiblePlugins`,{count:v.length}),request:o(`setupPluginsBulkRequest`,{packages:b,disabled:!0})})]}),x&&(0,q.jsx)(`p`,{className:`settings-resource-caption`,children:o(`resourceBulkTooLarge`)})]})]})]})}function IW(e,t=``,n){let r=(0,K.useMemo)(()=>new de,[]),[i,a]=(0,K.useState)(0),o=JSON.stringify([e,t]),s=(0,K.useRef)(o);s.current=o;let c=(0,K.useRef)(0),[l,u]=(0,K.useState)(null),d=(0,K.useCallback)(()=>a(e=>e+1),[]);return(0,K.useEffect)(()=>{let t=new AbortController,n=++c.current;return u(e=>({owner:o,catalog:e?.owner===o?e.catalog:null,error:null})),r.settingsCatalog(e,t.signal).then(e=>{!t.signal.aborted&&c.current===n&&u({owner:o,catalog:e,error:null})},e=>{!t.signal.aborted&&c.current===n&&u(t=>({owner:o,catalog:t?.owner===o?t.catalog:null,error:e instanceof Error?e.message:String(e)}))}),()=>t.abort()},[r,i,e,o,n]),{catalog:l?.owner===o?l.catalog:null,error:l?.owner===o?l.error:null,refresh:d,updateSetup:e=>{s.current===o&&(c.current++,u(t=>t?.owner===o&&t.catalog?{...t,catalog:{...t.catalog,setup:e}}:t))}}}var LW=[`default`,`mist`,`rose`,`pine`],RW=[`codex`,`sans`,`serif`,`mono`],zW=[`system`,`light`,`dark`],BW={palette:`default`,accent:``,background:``,foreground:``,font:`codex`};function VW(e){return e===`pine`?`dark`:e===`mist`||e===`rose`?`light`:e}function HW(e,t){return e===`mist`||e===`rose`||e===`pine`?e:t.palette}function UW(e,t){switch(e){case`mist`:return t?{background:`#182126`,foreground:`#EDF3F5`,sidebar:`#1D292F`,accent:`#7BB5CA`}:{background:`#F8FBFC`,foreground:`#253239`,sidebar:`#EEF3F5`,accent:`#347991`};case`rose`:return t?{background:`#211A1C`,foreground:`#F4ECEC`,sidebar:`#2A2123`,accent:`#E09AA5`}:{background:`#FFF9F7`,foreground:`#342729`,sidebar:`#F6EDEA`,accent:`#B45562`};case`pine`:return t?{background:`#101A17`,foreground:`#EAF2EC`,sidebar:`#16241F`,accent:`#86C89E`}:{background:`#F4F8F5`,foreground:`#20352A`,sidebar:`#E9F1EB`,accent:`#32704A`};default:return t?{background:`#17191C`,foreground:`#EDF0F2`,sidebar:`#1D2024`,accent:`#74A9E6`}:{background:`#FFFFFF`,foreground:`#1A1C1F`,sidebar:`#F6F7F9`,accent:`#2563EB`}}}function WW(e){if(e.length>2e3)return null;try{let t=JSON.parse(e);if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t;if(Object.keys(n).sort().join(`,`)!==`appearance,theme,version`||n.version!==1)return null;let r=zW.find(e=>e===n.theme);if(!r||!n.appearance||typeof n.appearance!=`object`||Array.isArray(n.appearance))return null;let i=n.appearance;if(Object.keys(i).sort().join(`,`)!==`accent,background,font,foreground,palette`)return null;let a=LW.find(e=>e===i.palette),o=i.font===`system`?`codex`:RW.find(e=>e===i.font),{accent:s,background:c,foreground:l}=i;return!a||!o||typeof s!=`string`||typeof c!=`string`||typeof l!=`string`||![s,c,l].every(e=>e===``||/^#[0-9a-f]{6}$/iu.test(e))?null:{theme:r,appearance:{palette:a,font:o,accent:s,background:c,foreground:l}}}catch{return null}}var GW=[``,`#2563EB`,`#7C3AED`,`#DB2777`,`#D97706`,`#16A34A`];function KW({label:e,value:t,options:n,disabled:r,onSelect:i}){let a=n.find(e=>e.id===t);return(0,q.jsx)(yo,{className:`settings-select-menu`,button:{label:a?.label??t,"aria-label":e,variant:`secondary`,size:`sm`,className:`appearance-menu-trigger`,isDisabled:r,...a?.color?{icon:(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:a.color}})}:{}},menuWidth:200,alignment:`end`,items:n.map(e=>({id:e.id||`default`,label:e.label,isDisabled:r,...e.color?{icon:(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:e.color}})}:{},endContent:t===e.id?(0,q.jsx)(`span`,{className:`settings-select-check`,"aria-hidden":`true`,children:(0,q.jsx)(rs,{})}):void 0,onClick:()=>i(e.id)}))})}function qW({label:e,value:t,fallback:n,disabled:r,onSave:i}){let a=(t||n).toUpperCase(),o=(0,K.useRef)(a);o.current=a;let[s,c]=(0,K.useState)(a);(0,K.useEffect)(()=>c(a),[a]);let l=e=>{c(e),e!==a&&/^#[0-9a-f]{6}$/iu.test(e)&&i(e).then(e=>{e||c(o.current)})};return(0,q.jsxs)(`div`,{className:`appearance-color-input`,children:[(0,q.jsxs)(`label`,{className:`appearance-color-picker`,children:[(0,q.jsx)(`span`,{className:`appearance-color-dot`,style:{background:a}}),(0,q.jsx)(`input`,{"aria-label":`${e} — ${a}`,type:`color`,value:a,disabled:r,onChange:e=>l(e.target.value.toUpperCase())})]}),(0,q.jsx)(`input`,{className:`appearance-color-hex`,type:`text`,"aria-label":e,value:s,maxLength:7,spellCheck:!1,disabled:r,onChange:e=>l(e.target.value.toUpperCase()),onBlur:()=>c(a)})]})}function JW({catalog:e,theme:t,pending:n,error:r,onRefresh:i,onUpdatePreferences:a}){let{t:o}=W(),{mode:s}=sa(),c=e?.setup,l=c?.ui.webTheme??t,u=c?.ui.webAppearance??BW,d=HW(l,u),f=VW(l),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(``),[y,b]=(0,K.useState)(!1),[x,S]=(0,K.useState)(null),[C,w]=(0,K.useState)(c?.ui.webChatWidth??820),[T,E]=(0,K.useState)(c?.ui.webChatFontSize??14),D=(0,K.useRef)({chatWidth:C,fontSize:T});c&&(D.current={chatWidth:c.ui.webChatWidth,fontSize:c.ui.webChatFontSize}),(0,K.useEffect)(()=>{c&&(w(c.ui.webChatWidth),E(c.ui.webChatFontSize))},[c]);let O=e?.setupWritable===!1||!!e?.resources.diagnostics.settingsErrors,k=n||!c||!!r||O,A=WW(_),j=e=>a({appearance:e}),M=()=>{n||(g(!1),v(``),b(!1))},N=f===`dark`||f===`system`&&s===`dark`,P=UW(d,N);return(0,q.jsxs)(`section`,{className:`settings-content-page settings-appearance-panel`,children:[(0,q.jsx)(`h1`,{children:o(`appearance`)}),(!c||r||O)&&(0,q.jsxs)(`div`,{className:`settings-load-state`,role:r||O?`alert`:`status`,children:[(0,q.jsx)(me,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:o(O?`configurationReadFailure`:r?`settingsCatalogFailed`:`settingsCatalogLoading`)}),(r||O)&&(0,q.jsx)(`button`,{type:`button`,onClick:i,children:o(`retryAdmissionCheck`)})]}),(0,q.jsxs)(`section`,{className:`appearance-section`,"aria-labelledby":`appearance-visual-title`,children:[(0,q.jsx)(`h2`,{id:`appearance-visual-title`,children:o(`appearanceVisualStyle`)}),(0,q.jsxs)(`div`,{className:`appearance-card appearance-mode-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceMode`)}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":o(`appearanceMode`),className:`appearance-mode-options`,children:zW.map(e=>(0,q.jsx)(V,{content:o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`),children:(0,q.jsxs)(`label`,{className:`appearance-mode-option`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`openpi-appearance-mode`,"aria-label":o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`),checked:f===e,disabled:k,onChange:()=>void a({theme:e})}),(0,q.jsxs)(`span`,{"aria-hidden":`true`,className:`appearance-mode-preview`,"data-mode":e,"data-selected":f===e,children:[(0,q.jsxs)(`span`,{className:`appearance-mini-window`,children:[(0,q.jsx)(`span`,{className:`appearance-mini-sidebar`}),(0,q.jsxs)(`span`,{className:`appearance-mini-chat`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`em`,{})]})]}),e===`system`&&(0,q.jsxs)(`span`,{className:`appearance-mini-window appearance-mini-dark`,children:[(0,q.jsx)(`span`,{className:`appearance-mini-sidebar`}),(0,q.jsxs)(`span`,{className:`appearance-mini-chat`,children:[(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`b`,{}),(0,q.jsx)(`em`,{})]})]})]}),(0,q.jsx)(`span`,{className:`appearance-mode-label`,children:o(e===`system`?`themeSystem`:e===`light`?`themeLight`:`themeDark`)})]})},e))})]}),(0,q.jsxs)(`div`,{className:`appearance-card`,children:[(0,q.jsxs)(`div`,{className:`appearance-row appearance-theme-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceTheme`)}),(0,q.jsxs)(`div`,{className:`appearance-theme-actions`,children:[(0,q.jsx)(V,{content:o(`appearanceImport`),children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":o(`appearanceImport`),disabled:k,onClick:()=>{b(!1),g(!0)},children:(0,q.jsx)(Ts,{"aria-hidden":`true`})})}),(0,q.jsx)(V,{content:o(`appearanceCopy`),children:(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":o(`appearanceCopy`),disabled:k,onClick:()=>{td(JSON.stringify({version:1,theme:f,appearance:{...u,palette:d}})).then(e=>S(e?`saved`:`failed`))},children:(0,q.jsx)(Ss,{"aria-hidden":`true`})})})]})]}),(0,q.jsx)(`div`,{role:`radiogroup`,"aria-label":o(`appearanceTheme`),"aria-busy":n,className:`appearance-palette-options`,children:LW.map(e=>{let t=UW(e,N),n=e==="default"?`OpenPI`:o(`theme${e[0].toUpperCase()}${e.slice(1)}`);return(0,q.jsxs)(`label`,{className:`appearance-palette-option`,children:[(0,q.jsx)(`input`,{type:`radio`,name:`openpi-appearance-palette`,"aria-label":n,checked:d===e,disabled:k,onChange:()=>void j({palette:e})}),(0,q.jsxs)(`span`,{className:`appearance-palette-preview`,"aria-hidden":`true`,style:{background:t.background,color:t.foreground},children:[(0,q.jsxs)(`span`,{className:`appearance-palette-shell`,style:{background:t.sidebar},children:[(0,q.jsxs)(`span`,{className:`appearance-palette-sidebar`,children:[(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{})]}),(0,q.jsxs)(`span`,{className:`appearance-palette-canvas`,style:{background:t.background},children:[(0,q.jsx)(`b`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`i`,{}),(0,q.jsx)(`em`,{style:{borderColor:t.accent},children:(0,q.jsx)(`span`,{className:`appearance-palette-send`,style:{background:t.accent}})})]})]}),(0,q.jsx)(`span`,{className:`appearance-palette-check`,children:(0,q.jsx)(rs,{})})]}),(0,q.jsx)(`span`,{className:`appearance-palette-label`,children:n})]},e)})}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceAccent`)}),(0,q.jsxs)(`div`,{className:`appearance-accent-controls`,children:[(0,q.jsx)(KW,{label:o(`appearanceAccent`),value:u.accent,options:GW.map((e,t)=>({id:e,label:o(`appearanceAccent${t}`),color:e||`var(--text)`})),disabled:k,onSelect:e=>void j({accent:e})}),(0,q.jsx)(qW,{label:o(`appearanceCustomAccent`),value:u.accent,fallback:`#2563EB`,disabled:k,onSave:e=>j({accent:e})})]})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceBackground`)}),(0,q.jsx)(qW,{label:o(`appearanceBackground`),value:u.background,fallback:P.background,disabled:k,onSave:e=>j({background:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceForeground`)}),(0,q.jsx)(qW,{label:o(`appearanceForeground`),value:u.foreground,fallback:P.foreground,disabled:k,onSave:e=>j({foreground:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceFont`)}),(0,q.jsx)(KW,{label:o(`appearanceFont`),value:u.font===`system`?`codex`:u.font,options:RW.map(e=>({id:e,label:o(`appearanceFont_${e}`)})),disabled:k,onSelect:e=>{let t=RW.find(t=>t===e);t&&j({font:t})}})]})]}),x&&(0,q.jsx)(`p`,{role:x===`failed`?`alert`:`status`,className:`appearance-share-status`,children:o(x===`saved`?`appearanceCopied`:`appearanceCopyFailed`)})]}),(0,q.jsxs)(`section`,{className:`appearance-section`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`appearance-advanced-toggle`,"aria-expanded":p,"aria-controls":`appearance-advanced`,onClick:()=>m(!p),children:[o(`appearanceAdvanced`),p?(0,q.jsx)(is,{"aria-hidden":`true`}):(0,q.jsx)(os,{"aria-hidden":`true`})]}),p&&c&&(0,q.jsxs)(`div`,{id:`appearance-advanced`,className:`appearance-card appearance-advanced-content`,children:[(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`expandThinkingByDefault`)}),(0,q.jsx)(bj,{label:o(`expandThinkingByDefault`),isLabelHidden:!0,value:c.ui.webExpandThinking,size:`sm`,isDisabled:k,onChange:e=>void a({expandThinking:e})})]}),(0,q.jsxs)(`div`,{className:`appearance-slider-row`,children:[(0,q.jsxs)(`div`,{className:`settings-slider-heading`,children:[(0,q.jsx)(`span`,{children:o(`chatContentWidth`)}),(0,q.jsxs)(`output`,{children:[C,`px`]}),(0,q.jsx)(`button`,{type:`button`,className:`settings-reset-button`,"aria-label":o(`resetChatContentWidth`),disabled:k||C===820,onClick:()=>{w(820),a({chatWidth:820}).then(e=>{e||w(D.current.chatWidth)})},children:(0,q.jsx)(he,{"aria-hidden":`true`})})]}),(0,q.jsx)(yW,{label:o(`chatContentWidth`),isLabelHidden:!0,value:C,min:820,max:2e3,step:10,width:`100%`,valueDisplay:`none`,isDisabled:k,onChange:e=>w(e),onChangeEnd:e=>{e!==c.ui.webChatWidth&&a({chatWidth:e}).then(e=>{e||w(D.current.chatWidth)})}})]}),(0,q.jsxs)(`div`,{className:`appearance-slider-row`,children:[(0,q.jsxs)(`div`,{className:`settings-slider-heading`,children:[(0,q.jsx)(`span`,{children:o(`chatFontSize`)}),(0,q.jsxs)(`output`,{children:[T,`px`]}),(0,q.jsx)(`button`,{type:`button`,className:`settings-reset-button`,"aria-label":o(`resetChatFontSize`),disabled:k||T===14,onClick:()=>{E(14),a({chatFontSize:14}).then(e=>{e||E(D.current.fontSize)})},children:(0,q.jsx)(he,{"aria-hidden":`true`})})]}),(0,q.jsx)(yW,{label:o(`chatFontSize`),isLabelHidden:!0,value:T,min:12,max:24,step:1,width:`100%`,valueDisplay:`none`,isDisabled:k,onChange:e=>E(e),onChangeEnd:e=>{e!==c.ui.webChatFontSize&&a({chatFontSize:e}).then(e=>{e||E(D.current.fontSize)})}})]}),(0,q.jsxs)(`div`,{className:`appearance-row`,children:[(0,q.jsx)(`span`,{children:o(`appearanceReset`)}),(0,q.jsxs)(`button`,{type:`button`,className:`appearance-reset`,disabled:k,onClick:()=>void a({theme:`system`,appearance:BW,chatWidth:820,chatFontSize:14,expandThinking:!1}),children:[(0,q.jsx)(he,{"aria-hidden":`true`}),o(`appearanceResetAction`)]})]})]})]}),(0,q.jsxs)(Se,{isOpen:h,onOpenChange:e=>{e||M()},"aria-label":o(`appearanceImport`),width:480,className:`appearance-import-dialog`,children:[(0,q.jsx)(`h2`,{className:`appearance-import-title`,children:o(`appearanceImport`)}),(0,q.jsxs)(`form`,{className:`appearance-import-form`,onSubmit:e=>{e.preventDefault(),!(!A||k)&&(b(!1),a(A).then(e=>{e?(g(!1),v(``)):b(!0)}))},children:[(0,q.jsxs)(`label`,{children:[o(`appearanceThemeValue`),(0,q.jsx)(`textarea`,{maxLength:2e3,value:_,disabled:n,placeholder:o(`appearanceImportPlaceholder`),onChange:e=>{b(!1),v(e.target.value)}})]}),_&&!A&&(0,q.jsx)(`p`,{role:`alert`,children:o(`appearanceImportInvalid`)}),y&&(0,q.jsx)(`p`,{role:`alert`,children:o(`settingsPreferencesSaveFailed`)}),(0,q.jsxs)(`div`,{className:`appearance-import-actions`,children:[(0,q.jsx)(`button`,{type:`button`,disabled:n,onClick:M,children:o(`cancel`)}),(0,q.jsx)(`button`,{type:`submit`,disabled:k||!A,children:o(n?`savingSettings`:`appearanceImportAction`)})]})]})]})]})}function YW({workspaces:e,onRestore:t}){let{t:n,i18n:r}=W(),i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(``),[l,u]=(0,K.useState)(`updated`),[d,f]=(0,K.useState)(new Set),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(null),[y,b]=(0,K.useState)(null),[x,S]=(0,K.useState)(new Set),C=(0,K.useRef)(new Set),w=(0,K.useRef)(null),T=(0,K.useRef)(!1),E=JSON.stringify([a.trim(),s,l]),D=(0,K.useRef)({key:E});D.current.key!==E&&(D.current={key:E});let O=p?.scope===E?p:null,k=_?.scope===E?_:null,A=(0,K.useCallback)(async(e,t=0)=>{w.current?.abort();let n=new AbortController;w.current=n,g(!0),v(null);let r={query:a.trim(),sort:l,...s?{cwd:s}:{},limit:25};try{let a=await i.listArchivedSessions({...r,...e?{cursor:e}:{}},n.signal);if(n.signal.aborted||w.current!==n)return;let o=[...a.sessions];for(;!e&&o.length!o.some(t=>t.path===e.path));if(o.push(...e),!e.length)break}m(t=>({...a,scope:E,sessions:e&&t?.scope===E?[...t.sessions,...o.filter(e=>!t.sessions.some(t=>t.path===e.path))]:o}))}catch(t){!n.signal.aborted&&w.current===n&&v({scope:E,stale:t instanceof ge&&t.code===`ARCHIVED_SESSION_CURSOR_STALE`,...e?{cursor:e}:{}})}finally{w.current===n&&(w.current=null,g(!1))}},[i,s,a,E,l]);(0,K.useEffect)(()=>(T.current=!0,()=>{T.current=!1}),[]),(0,K.useEffect)(()=>(b(null),A(),()=>{w.current?.abort(),w.current=null}),[A]);let j=async e=>{if(C.current.has(e))return;C.current.add(e),S(new Set(C.current)),b(null);let n=D.current;try{let r=await t(e);if(!T.current||D.current!==n)return;if(!r){b(e);return}let i=O?.sessions.length??0;m(t=>t?{...t,sessions:t.sessions.filter(t=>t.path!==e)}:null),await A(void 0,i)}catch{T.current&&D.current===n&&b(e)}finally{C.current.delete(e),T.current&&S(new Set(C.current))}},M=new Map;for(let e of O?.sessions??[]){let t=e.workspacePath??e.cwd,n=M.get(t)??[];n.push(e),M.set(t,n)}let N=t=>e.find(e=>e.path===t)?.name??t.split(/[\\/]/u).filter(Boolean).at(-1)??t,P=[...new Set([...e.map(e=>e.path),...M.keys(),...s?[s]:[]])];return(0,q.jsxs)(`section`,{className:`settings-content-page settings-archive-panel`,children:[(0,q.jsx)(`h1`,{children:n(`settingsArchivedChats`)}),(0,q.jsxs)(`div`,{className:`settings-archive-toolbar`,children:[(0,q.jsxs)(`label`,{className:`settings-archive-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":n(`searchArchivedChats`),placeholder:n(`searchArchivedChats`),maxLength:160,value:a,onChange:e=>o(e.target.value)}),a&&(0,q.jsx)(`button`,{type:`button`,"aria-label":n(`settingsClearSearch`),onClick:()=>o(``),children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),(0,q.jsx)(Tj,{label:n(`archiveProjectFilter`),value:s,onChange:c,options:[{value:``,label:n(`archiveAllProjects`)},...P.map(e=>({value:e,label:N(e)}))]}),(0,q.jsx)(Tj,{label:n(`archiveSort`),value:l,onChange:e=>u(e===`created`?`created`:`updated`),options:[{value:`updated`,label:n(`archiveSortUpdated`)},{value:`created`,label:n(`archiveSortCreated`)}]}),(0,q.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":n(`refreshArchives`),disabled:h,onClick:()=>void A(void 0,O?.sessions.length),children:(0,q.jsx)(me,{"aria-hidden":`true`})})]}),k&&(0,q.jsxs)(`div`,{className:`settings-archive-error`,role:`alert`,children:[(0,q.jsx)(`span`,{children:n(k.stale?`archiveCursorStale`:`archiveLoadFailed`)}),(0,q.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>void A(k.stale?void 0:k.cursor),children:n(`retryAdmissionCheck`)})]}),y&&(0,q.jsx)(`div`,{className:`settings-archive-error`,role:`alert`,children:n(`restoreFailed`)}),h&&(0,q.jsx)(`p`,{role:`status`,className:`settings-archive-status`,children:n(`loadingArchives`)}),!h&&!k&&O?.sessions.length===0&&(0,q.jsxs)(`div`,{className:`settings-archive-empty`,children:[(0,q.jsx)(Go,{"aria-hidden":`true`}),(0,q.jsx)(`p`,{children:n(a.trim()||s?`noMatchingScannedArchives`:O.truncation.truncated?`noScannedArchives`:`noArchivedSessions`)})]}),(0,q.jsx)(`div`,{className:`settings-archive-groups`,children:[...M].map(([e,t])=>(0,q.jsxs)(`section`,{className:`settings-archive-group`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`settings-archive-group-heading`,"aria-label":n(`archiveProjectGroup`,{project:N(e),count:t.length}),"aria-expanded":!d.has(e),"aria-controls":`archive-group-${encodeURIComponent(e)}`,onClick:()=>f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),children:[d.has(e)?(0,q.jsx)(os,{"aria-hidden":`true`}):(0,q.jsx)(is,{"aria-hidden":`true`}),(0,q.jsx)(Vs,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{title:e,children:N(e)}),(0,q.jsx)(`small`,{children:t.length})]}),!d.has(e)&&(0,q.jsx)(`ul`,{id:`archive-group-${encodeURIComponent(e)}`,className:`settings-archive-list`,children:t.map(e=>{let t=e.name||e.firstMessage||n(`untitledSession`),i=new Date(l===`created`?e.created:e.modified);return(0,q.jsxs)(`li`,{className:`settings-archive-row`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{className:`settings-archive-chat-title`,title:t,children:t}),(0,q.jsx)(`time`,{dateTime:Number.isNaN(i.getTime())?void 0:i.toISOString(),children:Number.isNaN(i.getTime())?n(`unknownState`):new Intl.DateTimeFormat(r.language,{dateStyle:`medium`}).format(i)})]}),(0,q.jsxs)(`button`,{type:`button`,"aria-label":n(`restoreArchivedChat`,{title:t}),disabled:x.has(e.path),onClick:()=>void j(e.path),children:[(0,q.jsx)(Wo,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:n(x.has(e.path)?`restoringConversation`:`restoreConversation`)})]})]},e.path)})})]},e))}),!!O?.truncation.recordsUnscanned&&(0,q.jsx)(`p`,{className:`settings-archive-status`,children:n(`archiveScanBounded`,{count:O.truncation.recordsUnscanned})}),O?.nextCursor&&(0,q.jsx)(`button`,{type:`button`,className:`settings-archive-more`,disabled:h,onClick:()=>void A(O.nextCursor),children:n(`moreArchives`)})]})}var XW=[{id:`general`,group:`settingsPersonal`,label:`generalSettings`,Icon:Nc,terms:[`agentBehavior`,`resultDisplay`,`workflowLimits`,`runtimeIdentity`,`runtimeBackendVersion`,`runtimePackageRoot`,`runtimeStartedAt`,`runtimeGitRevision`,`runtimeGitState`,`runtimeFrontendVersion`,`runtimeFrontendBuild`,`runtimeStartupBuild`]},{id:`appearance`,group:`settingsPersonal`,label:`appearance`,Icon:zc,terms:[`appearanceTheme`,`appearanceAccent`,`appearanceFont`,`chatContentWidth`,`chatFontSize`]},{id:`archived-chats`,group:`settingsPersonal`,label:`settingsArchivedChats`,Icon:Go,terms:[`restoreConversation`]},{id:`configuration`,group:`settingsPersonal`,label:`configurationSettings`,Icon:Mc,terms:[`configurationApproval`,`configurationSandbox`,`configurationVerbosity`,`configurationSummary`,`configurationReasoningLevels`,`configurationDependencies`]},{id:`models`,group:`settingsAgent`,label:`modelSettings`,Icon:ws,terms:[`modelDefaultTitle`]},{id:`subagents`,group:`settingsAgent`,label:`subagentsSettings`,Icon:$o,terms:[]},{id:`web-search`,group:`settingsAgent`,label:`webSearchSettings`,Icon:Dc,terms:[]},{id:`skills`,group:`settingsIntegrations`,label:`skillsSettings`,Icon:Xs,terms:[]},{id:`plugins`,group:`settingsIntegrations`,label:`pluginsSettings`,Icon:Sc,terms:[]},{id:`browser`,group:`settingsIntegrations`,label:`browserSettings`,Icon:Es,terms:[]}];function ZW(e){return XW.find(({id:t})=>t===e)?.id}function QW({sessionId:e,sessionPath:t,cwd:n,entry:r=`general`,models:i,currentModel:a,thinkingLevel:o,theme:s,preferences:c,workspaces:l=[],onRestoreSession:u,capabilities:d,setupBusy:f,setupBlockedReason:p,plan:m,planSelectionPending:h=!1,onExitPlan:g,setupOutcome:_,onConfigureOpenPi:v,interaction:y,onPreferencesChanged:b,onSelectModel:x,onOpenRuntimeStatus:S,onClose:C}){let{t:w}=W(),T=f||!!p,E=(0,K.useRef)(null),D=(0,K.useRef)(null),[O,k]=(0,K.useState)(``),[A,j]=(0,K.useState)(r===`credentials`?`models`:r),[M,N]=(0,K.useState)(r===`credentials`||r===`models`),[P,F]=(0,K.useState)(!1),[I,ee]=(0,K.useState)(!1),[L,R]=(0,K.useState)(`general`),te=(0,K.useRef)(!1),z=(0,K.useRef)(!1),B=(0,K.useRef)(0),[ne,re]=(0,K.useState)(!1),V=(0,K.useRef)(!1),[ie,ae]=(0,K.useState)(!1),[oe,se]=(0,K.useState)(null),[ce,le]=(0,K.useState)(!1),[H,ue]=(0,K.useState)(!1),[fe,pe]=(0,K.useState)(null),me=H,he=(0,K.useRef)(void 0),ge=m!==void 0&&m!==`inactive`,_e=P||T||ge||h,ve=I&&L!==A||!I&&(A===`skills`||A===`plugins`||A===`web-search`)?void 0:!I||_?.requestId!==he.current?_:void 0,{catalog:ye,error:be,refresh:xe,updateSetup:Ce}=IW(e,a?`${a.provider}/${a.id}`:``,JSON.stringify(c)),we=ve!==void 0&&[`failed`,`cancelled`,`unconfirmed`].includes(ve.status);(0,K.useEffect)(()=>{E.current?.focus()},[]),(0,K.useEffect)(()=>{if(I){if(ve&&ve.status!==`pending`&&te.current){te.current=!1,z.current=!1,window.clearTimeout(B.current),xe(),b();return}if(T){z.current=!0;return}!z.current||!te.current||(te.current=!1,z.current=!1,window.clearTimeout(B.current),xe(),b())}},[b,xe,T,I,ve]),(0,K.useEffect)(()=>()=>window.clearTimeout(B.current),[]);let Te=async e=>{if(ae(!1),_e)return!1;he.current=_?.requestId,R(A),F(!0),ee(!1),te.current=!1,z.current=!1,window.clearTimeout(B.current),se(null);try{let t=await v(e);return t?(ee(!0),te.current=!0,B.current=window.setTimeout(()=>{!te.current||z.current||(te.current=!1,z.current=!1,xe(),b())},2e3)):se(w(`setupRequestFailed`)),t}catch(e){return F(!1),se(e instanceof Error?e.message:w(`setupRequestFailed`)),!1}finally{F(!1)}},Ee=async()=>{if(_e||!ye?.sessionPath)throw Error(w(`resourceReloadFailed`));F(!0);try{await new de().reloadSettingsResources(e,ye.sessionPath),xe(),b()}finally{F(!1)}},U=async e=>{if(V.current||!ye)return!1;V.current=!0,re(!0),ae(!1),se(null);try{let t=await new de().savePreferences(e);return Ce(t.setup),ae(!0),b(),!0}catch{return se(w(`settingsPreferencesSaveFailed`)),!1}finally{V.current=!1,re(!1)}},De=e=>{me||(j(e),k(``),e===`models`&&N(!0),se(null))};(0,K.useEffect)(()=>{let e=new URL(window.location.href);e.searchParams.set(`settings`,A),window.history.replaceState(window.history.state,``,e)},[A]);let Oe=XW.filter(({label:e,terms:t})=>[e,...t].some(e=>w(e).normalize(`NFKC`).toLocaleLowerCase().includes(O.trim().normalize(`NFKC`).toLocaleLowerCase()))),ke=(e,t=!1)=>{if(!me){if(ce&&!t){pe(e);return}pe(null),e.kind===`runtime`?S():C()}};return(0,q.jsxs)(Se,{isOpen:!0,purpose:`info`,padding:0,width:`calc(100vw - 32px)`,maxHeight:`calc(100dvh - 16px)`,className:`provider-settings-dialog`,"aria-label":w(`settings`),onOpenChange:e=>{!e&&!fe&&ke({kind:`close`})},children:[(0,q.jsxs)(`section`,{className:`provider-settings-surface`,children:[(0,q.jsxs)(`aside`,{className:`provider-settings-sidebar`,children:[(0,q.jsxs)(`header`,{className:`provider-settings-header`,children:[(0,q.jsx)(`strong`,{className:`provider-settings-title`,children:w(`settings`)}),(0,q.jsx)(`select`,{className:`provider-settings-mobile-picker`,"aria-label":w(`settingsNavigation`),disabled:me,value:A,onChange:e=>{let t=XW.find(({id:t})=>t===e.target.value);t&&De(t.id)},children:XW.map(({id:e,label:t})=>(0,q.jsx)(`option`,{value:e,children:w(t)},e))})]}),(0,q.jsxs)(`label`,{className:`provider-settings-search`,children:[(0,q.jsx)(Dc,{"aria-hidden":`true`}),(0,q.jsx)(`input`,{type:`search`,"aria-label":w(`settingsSearch`),placeholder:w(`settingsSearch`),value:O,onChange:e=>k(e.target.value),disabled:me}),O&&(0,q.jsx)(`button`,{type:`button`,"aria-label":w(`settingsClearSearch`),onClick:()=>k(``),children:(0,q.jsx)(je,{"aria-hidden":`true`})})]}),(0,q.jsxs)(`div`,{className:`provider-settings-navigation`,ref:D,"aria-label":w(`settingsNavigation`),role:`tablist`,"aria-orientation":`vertical`,children:[[`settingsPersonal`,`settingsAgent`,`settingsIntegrations`].map(e=>(0,q.jsxs)(`div`,{className:`provider-settings-nav-group`,children:[Oe.some(t=>t.group===e)&&(0,q.jsx)(`p`,{children:w(e)}),Oe.filter(t=>t.group===e).map(({id:e,label:t,Icon:n})=>(0,q.jsxs)(`button`,{type:`button`,role:`tab`,disabled:me,id:`settings-tab-${e}`,tabIndex:A===e||!Oe.some(e=>e.id===A)&&Oe[0]?.id===e?0:-1,"aria-selected":A===e,"aria-controls":`settings-panel-${e}`,className:`provider-settings-tab`,title:w(t),onClick:()=>De(e),onKeyDown:t=>{if(t.altKey||t.ctrlKey||t.metaKey||t.nativeEvent.isComposing)return;let n=Oe.findIndex(t=>t.id===e),r=t.key===`Home`?0:t.key===`End`?Oe.length-1:t.key===`ArrowDown`||t.key===`ArrowRight`?(n+1)%Oe.length:t.key===`ArrowUp`||t.key===`ArrowLeft`?(n+Oe.length-1)%Oe.length:void 0;if(r===void 0)return;t.preventDefault();let i=Oe[r].id;De(i),D.current?.querySelector(`#settings-tab-${i}`)?.focus()},children:[(0,q.jsx)(n,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:w(t)})]},e))]},e)),Oe.length===0&&(0,q.jsx)(`p`,{className:`provider-settings-no-results`,role:`status`,children:w(`settingsNoResults`)})]}),(0,q.jsx)(`button`,{ref:E,type:`button`,className:`icon-button provider-settings-close`,"aria-label":w(`close`),disabled:me,title:w(me?`savingSettings`:`close`),onClick:()=>ke({kind:`close`}),children:(0,q.jsx)(je,{})})]}),(0,q.jsxs)(`div`,{className:`provider-settings-body`,children:[ge&&A!==`browser`&&(0,q.jsxs)(`div`,{className:`settings-plan-notice`,role:`status`,children:[(0,q.jsx)(`span`,{children:w(T?`setupPlanBusy`:`setupPlanBlocked`)}),(0,q.jsx)(Br,{label:w(`planModeExit`),variant:`secondary`,size:`sm`,isDisabled:T||h||!g,onClick:()=>void g?.()})]}),(0,q.jsxs)(`div`,{className:`provider-settings-main`,children:[(0,q.jsx)(`div`,{id:`settings-panel-configuration`,"aria-labelledby":`settings-tab-configuration`,"aria-label":w(`configurationSettings`),role:`tabpanel`,hidden:A!==`configuration`,children:A===`configuration`&&(0,q.jsx)(Aj,{catalog:ye,error:be,pending:_e||I&&L===`configuration`&&(!ve||ve.status===`pending`),preferencePending:ne,onConfigure:Te,onUpdatePreferences:U,onRefresh:xe,onOpenRuntimeStatus:()=>ke({kind:`runtime`})})}),(0,q.jsx)(`div`,{id:`settings-panel-appearance`,"aria-labelledby":`settings-tab-appearance`,"aria-label":w(`appearance`),role:`tabpanel`,hidden:A!==`appearance`,children:(0,q.jsx)(JW,{catalog:ye,theme:s,pending:ne,error:be,onRefresh:xe,onUpdatePreferences:U})}),(0,q.jsx)(`div`,{id:`settings-panel-archived-chats`,"aria-labelledby":`settings-tab-archived-chats`,"aria-label":w(`settingsArchivedChats`),role:`tabpanel`,hidden:A!==`archived-chats`,children:A===`archived-chats`&&(0,q.jsx)(YW,{workspaces:l,onRestore:u??(async()=>!1)})}),(0,q.jsx)(`div`,{id:`settings-panel-web-search`,"aria-labelledby":`settings-tab-web-search`,"aria-label":w(`webSearchSettings`),role:`tabpanel`,hidden:A!==`web-search`,children:A===`web-search`&&(0,q.jsx)(jj,{catalog:ye,error:be,pending:_e,onConfigure:Te,onRefresh:xe})}),(0,q.jsx)(`div`,{id:`settings-panel-browser`,"aria-labelledby":`settings-tab-browser`,"aria-label":w(`browserSettings`),role:`tabpanel`,hidden:A!==`browser`,children:A===`browser`&&(0,q.jsx)(Oj,{onConfigure:Te,setupPending:_e})}),(0,q.jsx)(`div`,{id:`settings-panel-general`,"aria-labelledby":`settings-tab-general`,"aria-label":w(`generalSettings`),role:`tabpanel`,hidden:A!==`general`,children:(0,q.jsx)(TW,{catalog:ye,error:be,currentModel:a,thinkingLevel:o,cwd:n,setupPending:P||T,preferencePending:ne||!ye,setupBusy:T,setupBlockedReason:p,setupBlocked:ge||h,onConfigure:Te,onUpdatePreferences:U,onOpenRuntimeStatus:()=>ke({kind:`runtime`}),onRefresh:xe})}),(0,q.jsx)(`section`,{id:`settings-panel-models`,"aria-labelledby":`settings-tab-models`,"aria-label":w(`modelSettings`),className:`settings-models`,role:`tabpanel`,hidden:A!==`models`,children:M&&(0,q.jsx)(oW,{sessionId:e,sessionPath:t,models:i,currentModel:a,busy:T,focusCredentials:r===`credentials`,onSaved:async()=>(xe(),b()),onSelectModel:x,onDraftChange:le,onSavingChange:ue},e)}),(0,q.jsx)(`div`,{id:`settings-panel-skills`,"aria-labelledby":`settings-tab-skills`,"aria-label":w(`skillsSettings`),role:`tabpanel`,hidden:A!==`skills`,children:(0,q.jsx)(jW,{catalog:ye,error:be,onRefresh:xe,setupPending:_e,onConfigure:Te,onReload:Ee},e)}),(0,q.jsx)(`div`,{id:`settings-panel-subagents`,"aria-labelledby":`settings-tab-subagents`,"aria-label":w(`subagentsSettings`),role:`tabpanel`,hidden:A!==`subagents`,children:(0,q.jsx)(MW,{catalog:ye,error:be,currentModel:a,models:i,activity:d?.subagents,setupPending:P||T,setupBlocked:ge||h,onConfigure:Te,onRefresh:xe})}),(0,q.jsx)(`div`,{id:`settings-panel-plugins`,"aria-labelledby":`settings-tab-plugins`,"aria-label":w(`pluginsSettings`),role:`tabpanel`,hidden:A!==`plugins`,children:(0,q.jsx)(FW,{catalog:ye,error:be,onRefresh:xe,setupPending:_e,onConfigure:Te,onReload:Ee},e)})]}),y,oe&&(0,q.jsx)(`div`,{className:`settings-global-error`,role:`alert`,children:oe}),(ne||ie)&&!oe&&!we&&(0,q.jsx)(`div`,{className:`settings-global-status`,role:`status`,children:w(ne?`savingSettings`:`settingsPreferencesSaved`)}),!ne&&(!ie||we)&&(I&&L===A||ve)&&!oe&&(0,q.jsxs)(`div`,{className:ve?.status===`failed`?`settings-global-error`:`settings-global-status`,role:ve?.status===`failed`?`alert`:`status`,children:[w(ve?(A===`skills`||A===`plugins`||A===`web-search`)&&[`unconfirmed`,`saved`,`unchanged`].includes(ve.status)?`resourceRequestFinished`:`setupOutcome_${ve.status}`:T?`setupRequestRunning`:A===`skills`||A===`plugins`||A===`web-search`?`resourceRequestSubmitted`:`setupRequestAccepted`),ve?.error&&(0,q.jsx)(`p`,{children:ve.error})]})]})]}),fe&&(0,q.jsx)(uj,{isOpen:!0,onOpenChange:e=>{e||pe(null)},title:w(`unsavedSettingsTitle`),description:w(`unsavedSettingsDetail`),cancelLabel:w(`keepEditing`),actionLabel:w(`discardAndContinue`),onAction:()=>ke(fe,!0)})]})}function $W({identity:e}){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;let n=t%6;return(0,q.jsx)(`span`,{className:`subagent-avatar tone-${n}`,"aria-hidden":`true`,children:(0,q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,children:[(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,q.jsx)(`ellipse`,{cx:`12`,cy:`12`,rx:`4`,ry:`9`}),(0,q.jsx)(`path`,{d:`M3 12h18M5 6.5c4 3 10 3 14 0M5 17.5c4-3 10-3 14 0`})]},`sphere`),(0,q.jsx)(`g`,{children:(0,q.jsx)(`path`,{d:`M4 20V4a16 16 0 0 1 16 16H4ZM4 4l16 16M4 9l11 11M4 14l6 6M10 5l-6 15M16 10L4 20`})},`fan`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`path`,{d:`m12 2 3 6 7-1-4 5 4 5-7-1-3 6-3-6-7 1 4-5-4-5 7 1Z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`})]},`rosette`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,q.jsx)(`path`,{d:`M3 12h18M12 3a9 9 0 0 0 0 18M12 6a6 6 0 0 0 0 12M12 9a3 3 0 0 0 0 6M12 3v18`})]},`arcs`),(0,q.jsx)(`g`,{children:(0,q.jsx)(`path`,{d:`m12 2 9 5v10l-9 5-9-5V7Zm0 0v20M3 7l18 10M21 7 3 17M3 7l9 5 9-5M3 17l9-5 9 5`})},`prism`),(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`path`,{d:`M12 12V2c6 0 10 4 10 10H12Zm0 0v10C6 22 2 18 2 12h10ZM12 12H2C2 6 6 2 12 2v10Zm0 0h10c0 6-4 10-10 10V12Z`}),(0,q.jsx)(`circle`,{cx:`12`,cy:`12`,r:`2`,fill:`currentColor`})]},`windmill`)][n]})})}function eG(e,t,n,r){let i=(0,K.useMemo)(()=>new de,[]),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1),[d,f]=(0,K.useState)(0),p=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(!n)return;let r=new AbortController;return p.current=r,c(!0),u(!1),i.sessionSources(e,t,r.signal).then(n=>{!r.signal.aborted&&n.sessionId===e&&n.path===t&&o(n)}).catch(()=>{r.signal.aborted||u(!0)}).finally(()=>{r.signal.aborted||(c(!1),p.current=null)}),()=>{r.abort(),p.current?.abort(),p.current=null}},[i,e,t,n,r,d]),{page:a?.sessionId===e&&a.path===t?a:null,loading:s,error:l,loadMore:async()=>{if(p.current||!a||a.nextOffset===void 0)return;let n=new AbortController;p.current=n,c(!0),u(!1);try{let r=await i.sessionSources(e,t,n.signal,a.nextOffset,a.revision);!n.signal.aborted&&r.sessionId===e&&r.path===t&&r.revision===a.revision&&o({...r,sources:[...a.sources,...r.sources]})}catch{n.signal.aborted||u(!0)}finally{n.signal.aborted||(c(!1),p.current=null)}},refresh:()=>f(e=>e+1)}}function tG({sessionId:e,path:t,source:n,thumbnail:r=!1,active:i=!0}){let{t:a}=W(),o=(0,K.useRef)(null),[s,c]=(0,K.useState)(!1),l=JSON.stringify([e,t,n.entryId,n.partIndex]),[u,d]=(0,K.useState)(null);(0,K.useEffect)(()=>{if(!r||!o.current||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(([e])=>c(!!e?.isIntersecting));return e.observe(o.current),()=>e.disconnect()},[r]),(0,K.useEffect)(()=>{if(!i||r&&!s){d(null);return}let a=new AbortController,o;return d({identity:l}),new de().sourceImage(e,t,n.entryId,n.partIndex,a.signal).then(e=>{if(a.signal.aborted)return;if(![`image/png`,`image/jpeg`,`image/gif`,`image/webp`].includes(e.mimeType)||e.data.length>xe)throw Error(`Invalid image`);let t=atob(e.data);if(t.length>10485760||btoa(t)!==e.data)throw Error(`Invalid image`);let n=Uint8Array.from(t,e=>e.charCodeAt(0));o=URL.createObjectURL(new Blob([n],{type:e.mimeType})),d({identity:l,url:o})}).catch(()=>{a.signal.aborted||d({identity:l,failed:!0})}),()=>{a.abort(),o&&URL.revokeObjectURL(o)}},[e,t,n.entryId,n.partIndex,l,i,r,s]);let f=i&&(!r||s)&&u?.identity===l?u:null;return(0,q.jsx)(`span`,{ref:o,className:`session-source-image`,"data-thumbnail":r||void 0,children:f?.url&&!f.failed?(0,q.jsx)(`img`,{src:f.url,draggable:!1,alt:r?``:n.name||a(`attachedImage`),onError:()=>d({identity:l,failed:!0})}):r?(0,q.jsx)(qs,{"aria-hidden":`true`}):(0,q.jsx)(`p`,{role:f?.failed?`alert`:`status`,children:a(f?.failed?`imagePreviewFailed`:`readingFile`)})})}function nG({source:e,sessionId:t,path:n,onOpen:r,thumbnail:i=!0,detailed:a=!1}){let{t:o}=W();return(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row session-source-row${a?` source-detail-row`:``}`,title:e.reference||e.name||o(`attachedImage`),onClick:r,children:[(0,q.jsx)(`span`,{className:`session-source-icon`,children:e.kind===`image`?i?(0,q.jsx)(tG,{sessionId:t,path:n,source:e,thumbnail:!0}):(0,q.jsx)(qs,{"aria-hidden":`true`}):(0,q.jsx)(Fs,{"aria-hidden":`true`})}),a?(0,q.jsxs)(`span`,{className:`session-source-copy`,children:[(0,q.jsx)(`strong`,{children:e.name||o(`attachedImage`)}),e.reference&&(0,q.jsx)(`span`,{className:`source-detail-reference`,children:e.reference}),(0,q.jsx)(`span`,{className:`source-detail-status`,children:o(`sourceAttached`)})]}):(0,q.jsx)(`span`,{children:e.name||o(`attachedImage`)})]})}function rG({sessionId:e,path:t,data:n,onSelect:r}){let{t:i}=W(),a=be(),o=(0,K.useRef)(null),s=(0,K.useRef)(a?.sources?.scroll??0);return(0,K.useLayoutEffect)(()=>{n.page?.sources.length&&o.current&&(o.current.scrollTop=s.current)},[n.page?.sources.length]),(0,q.jsxs)(`div`,{className:`session-sources-list`,ref:o,onScroll:e=>{s.current=e.currentTarget.scrollTop,a&&(a.sources={scroll:s.current})},children:[!n.loading&&!n.error&&!n.page?.sources.length&&(0,q.jsx)(`p`,{children:i(`sourcesEmpty`)}),n.page?.sources.map(n=>(0,q.jsx)(nG,{source:n,sessionId:e,path:t,onOpen:()=>r(n),detailed:!0},n.id)),n.error&&(0,q.jsxs)(`p`,{role:`alert`,children:[i(`sourcesFailed`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:n.refresh,children:i(`gitReviewRetry`)})]}),n.loading&&(0,q.jsx)(`p`,{role:`status`,children:i(`readingFile`)}),n.page?.nextOffset!==void 0&&(0,q.jsx)(`button`,{className:`sources-load-more`,type:`button`,disabled:n.loading,onClick:()=>void n.loadMore(),children:i(`sourcesLoadMore`)}),n.page?.truncated&&(0,q.jsx)(`p`,{children:i(`sourcesPartial`)})]})}function iG({sessionId:e,path:t,revision:n}){let{t:r}=W(),i=eG(e,t,!0,n),a=(0,K.useRef)(null);(0,K.useEffect)(()=>{let e=requestAnimationFrame(()=>a.current?.focus({preventScroll:!0}));return()=>cancelAnimationFrame(e)},[]);let o=(0,K.useContext)($E),[s,c]=(0,K.useState)(null),l=e=>{e?.kind===`file`&&e.reference?o?.open(e.reference,void 0,document.activeElement instanceof HTMLElement?document.activeElement:void 0):c(e)};return(0,q.jsxs)(`section`,{className:`session-sources-panel`,ref:a,tabIndex:-1,"aria-label":r(`sessionSources`),children:[(0,q.jsx)(rG,{sessionId:e,path:t,data:i,onSelect:l}),(0,q.jsx)(aG,{sessionId:e,path:t,open:!!s,source:s,data:i,onSelect:l,onClose:()=>c(null)})]})}function aG({sessionId:e,path:t,open:n,source:r,data:i,onSelect:a,onClose:o}){let{t:s}=W(),[c,l]=(0,K.useState)(!1);return(0,K.useEffect)(()=>{r?.id,l(!1)},[e,t,r?.id]),(0,q.jsx)(Se,{isOpen:n,onOpenChange:e=>!e&&o(),purpose:`info`,width:800,maxHeight:`calc(100dvh - 32px)`,padding:0,"aria-label":s(`sessionSources`),children:n&&(0,q.jsxs)(`div`,{className:`session-sources-dialog draft-image-preview`,children:[(0,q.jsxs)(`header`,{children:[r&&i&&(0,q.jsx)(`button`,{type:`button`,"aria-label":s(`sourcesBack`),onClick:()=>a(null),children:(0,q.jsx)(Ko,{})}),(0,q.jsx)(`strong`,{title:r?.name,children:r?r.name||s(`attachedImage`):s(`sessionSources`)}),r&&(0,q.jsx)(`button`,{type:`button`,"aria-pressed":c,onClick:()=>l(e=>!e),children:s(c?`fitImage`:`originalImageSize`)}),(0,q.jsx)(`button`,{type:`button`,"data-autofocus":!0,"aria-label":s(`close`),onClick:o,children:(0,q.jsx)(je,{})})]}),r?(0,q.jsx)(lO,{original:c,children:(0,q.jsx)(tG,{sessionId:e,path:t,source:r,active:n},JSON.stringify([e,t,r.id]))},JSON.stringify([e,t,r.id])):i?(0,q.jsx)(rG,{sessionId:e,path:t,data:i,onSelect:a}):null]})})}function oG({sessionId:e,workspace:t,agents:n,omitted:r,omittedWorkflows:i=0,review:a,onSubagents:o,onReview:s,onSources:c,sessionPath:l,revision:u,onAddSources:d,reviewLoading:f=!1,reviewError:p}){let{t:m}=W(),[h,g]=(0,K.useState)(!1),_=(0,K.useRef)(null),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!0),S=(0,K.useId)(),[C,w]=(0,K.useState)(null),T=eG(e,l??``,!!(l&&(h||v)),u),E=(0,K.useContext)($E),D=a?.ok?a.snapshot.totals:void 0,O=e=>{!e&&c?(y(!1),w(null),P(c)):e?.kind===`file`&&e.reference?(y(!1),P(()=>E?.open(e.reference,void 0,_.current??void 0))):P(()=>{w(e),y(!0)})},k=n.filter(e=>e.state===`running`),A=n.filter(e=>e.state===`done`),j=n.length-k.length-A.length,M=[...k,...n.filter(e=>e.state!==`running`)].slice(0,4),N=[k.length?m(`subagentSummaryRunning`,{count:k.length}):``,A.length?m(`subagentSummaryDone`,{count:A.length}):``,j?m(`subagentSummaryOther`,{count:j}):``].filter(Boolean).join(` · `)||m(`subagentNoneYet`),P=e=>{g(!1),_.current?.focus(),e()};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Zu,{isOpen:h,onOpenChange:g,placement:`below`,alignment:`end`,width:`min(340px, calc(100vw - 24px))`,label:m(`sessionOverview`),closeButtonLabel:m(`close`),isModal:!1,content:(0,q.jsxs)(`div`,{className:`session-overview`,children:[(0,q.jsx)(`p`,{className:`session-overview-title`,children:t}),(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row`,title:m(`sessionOverviewChanges`),onClick:()=>P(s),children:[(0,q.jsx)(Ms,{"aria-hidden":`true`}),(0,q.jsx)(`span`,{children:m(`overviewChanges`)}),D&&!p?(0,q.jsxs)(`span`,{className:`session-overview-diff`,title:m(D.complete?`overviewLineTotals`:`overviewPartialTotals`),children:[(0,q.jsxs)(`span`,{className:`review-additions`,children:[`+`,D.additions.toLocaleString()]}),(0,q.jsxs)(`span`,{className:`review-deletions`,children:[`−`,D.deletions.toLocaleString()]}),!D.complete&&(0,q.jsx)(`span`,{className:`session-overview-note`,children:m(`gitReviewPartialLabel`)})]}):(0,q.jsx)(`span`,{className:`session-overview-note`,children:m(f?`overviewCounting`:a?.ok?`overviewCountsUnknown`:`overviewReviewUnavailable`)})]}),(0,q.jsxs)(`div`,{className:`session-overview-section`,children:[(0,q.jsx)(`p`,{children:m(`subagentDetails`)}),(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row session-overview-agents`,onClick:()=>P(o),"aria-label":`${m(`subagentDetails`)}: ${N}`,children:[M.length>0&&(0,q.jsx)(`span`,{className:`subagent-avatar-stack`,children:M.map(t=>(0,q.jsx)($W,{identity:`${e}:${t.id}`},t.id))}),(0,q.jsx)(`span`,{className:`session-overview-agent-counts`,children:N.split(` · `).map(e=>(0,q.jsx)(`span`,{children:e},e))}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),r>0&&(0,q.jsx)(`small`,{children:m(`subagentListTruncated`,{count:r})}),i>0&&(0,q.jsx)(`small`,{children:m(`subagentWorkflowsTruncated`,{count:i})})]}),l&&(0,q.jsxs)(`div`,{className:`session-overview-section`,children:[(0,q.jsxs)(`div`,{className:`session-overview-section-heading`,children:[(0,q.jsxs)(`button`,{type:`button`,className:`session-sources-toggle`,"aria-expanded":b,"aria-controls":S,onClick:()=>x(e=>!e),children:[(0,q.jsx)(`span`,{children:m(`sessionSources`)}),T.page&&(T.page.total!==void 0||T.page.nextOffset===void 0)&&(0,q.jsxs)(`span`,{children:[`· `,T.page.total??T.page.sources.length,T.page.truncated?`+`:``]}),(0,q.jsx)(os,{"aria-hidden":`true`})]}),d&&(0,q.jsx)(V,{content:m(`sourcesAdd`),placement:`below`,children:(0,q.jsx)(`button`,{type:`button`,"aria-label":m(`sourcesAdd`),onClick:()=>P(d),children:(0,q.jsx)(Ae,{})})})]}),(0,q.jsxs)(`div`,{id:S,hidden:!b,children:[T.page?.sources.slice(0,3).map(t=>(0,q.jsx)(nG,{source:t,sessionId:e,path:l,onOpen:()=>O(t)},t.id)),T.error?(0,q.jsxs)(`p`,{role:`alert`,children:[m(`sourcesFailed`),` `,(0,q.jsx)(`button`,{type:`button`,onClick:T.refresh,children:m(`gitReviewRetry`)})]}):!T.page?.sources.length&&(0,q.jsx)(`p`,{children:m(T.loading?`readingFile`:`sourcesEmpty`)}),!!(T.page&&(T.page.sources.length>3||T.page.nextOffset!==void 0))&&(0,q.jsxs)(`button`,{type:`button`,className:`session-overview-row sources-view-all`,onClick:()=>O(null),children:[(0,q.jsx)(Qs,{}),(0,q.jsx)(`span`,{children:m(`sourcesViewAll`)}),(0,q.jsx)(os,{})]})]})]})]}),children:e=>(0,q.jsx)(V,{content:m(`sessionOverview`),placement:`below`,children:(0,q.jsx)(`button`,{...e,ref:t=>{e.ref(t),_.current=t},type:`button`,className:`task-tools-trigger`,"aria-label":m(`sessionOverview`),children:(0,q.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,q.jsx)(`circle`,{cx:`5.5`,cy:`7`,r:`2.8`}),(0,q.jsx)(`circle`,{cx:`5.5`,cy:`17`,r:`2.8`}),(0,q.jsx)(`path`,{d:`M12 7h8M12 17h8`})]})})})}),l&&(0,q.jsx)(aG,{sessionId:e,path:l,open:v,source:C,data:T,onSelect:O,onClose:()=>{y(!1),w(null)}})]})}function sG(e){return e<1e3?Math.round(e).toString():e<1e4?`${(e/1e3).toFixed(1)}k`:e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1)}M`}function cG(e){if(!e)return;let{input:t,output:n,cacheRead:r,cacheWrite:i}=e;if(t===0&&n===0&&r===0&&i===0)return;let a=t+r+i,o=r>0?` (${sG(r)} cached)`:``;return`${sG(a)} in${o} · ${sG(n)} out`}function lG(e,t,n){if([`session_start`,`session_switched`,`session_created`].includes(t))return e.length===0?e:[];if([`agent_settled`,`turn_settled`].includes(t))return e.some(e=>e.state===`running`)?e.map(e=>e.state===`running`?{...e,state:`unknown`}:e):e;if(!t.startsWith(`tool_execution_`))return e;let r=n.toolCallId;if(typeof r!=`string`||r.length>500)return e;let i=e.find(e=>e.call.id===r);if(i&&i.state!==`running`&&(i.state!==`unknown`||t!==`tool_execution_end`))return e;let a=dd(n.call),o=a.type===`toolCall`&&typeof a.name==`string`&&typeof a.arguments==`string`?a:i?.call;if(!o||o.evidenceTruncated&&o.id?.includes(`[truncated]`))return e;let s=dd(n.result),c=typeof s.content==`string`?s:i?.result,l=typeof n.parentToolCallId==`string`&&n.parentToolCallId.length<=500?n.parentToolCallId:i?.parentToolCallId,u={call:o,result:c,...l?{parentToolCallId:l}:{},state:t===`tool_execution_end`?n.isError===!0?`failed`:`returned`:`running`},d=(i?e.map(e=>e.call.id===r?u:e):[...e,u]).slice(-32);for(;d.length>0&&new TextEncoder().encode(JSON.stringify(d)).byteLength>524288;)d.shift();return d}var uG={en:{translation:{quitOpenPI:`Quit OpenPI`,quittingOpenPI:`Quitting…`,quitConfirmHelp:`Quit this OpenPI Web application? All running tasks in this Web application will stop. Conversations are saved and will be available when you restart.`,quitTabHelp:`Closing this browser tab alone leaves OpenPI and its tasks running in the background.`,quitAccepted:`OpenPI is shutting down`,quitAcceptedHelp:`The quit request was accepted. Wait for the terminal to confirm that OpenPI has stopped, then you can close this tab.`,quitRestartHelp:`To restart, run openpi web in a terminal, or /web in Pi, then open the address it displays. Refreshing this page does not restart OpenPI.`,quitFailed:`Could not confirm shutdown. Check the terminal before trying again. You can also stop OpenPI with Ctrl+C in its terminal.`,promptPending:`Processing your request…`,commandFeedbackTruncated:`This is a limited command preview. Narrow the query or run it in the TUI for the full output.`,planMode_inactive:`Normal mode`,planMode_planning:`Planning · writes blocked`,planMode_ready:`Plan ready · awaiting review`,planMode_invalid:`Plan state invalid · writes blocked`,planModeEnter:`Plan`,promptPlanMessage:`This conversation uses Plan mode · discuss the plan; no implementation yet`,planModeUnconfirmed:`Could not confirm Plan mode. Refresh before continuing.`,planModeExit:`Exit planning`,planModeImplement:`Prepare implementation prompt`,planImplementationReplaceDraft:`Preparing this plan will replace the current draft and turn off Plan mode. The prompt will not be sent. Continue?`,commandSupport_plan:`Planning and same-session implementation prompts are available. Starting a fresh implementation session still requires the TUI.`,commandSupport_setup:`Configuration uses the active model; questions are answered in Web.`,handoffWaiting:`Manual action`,handoffDone:`Done`,handoffUnable:`Unable to complete`,handoffDoneHelp:`I performed the action. The agent still needs to verify it.`,handoffUnableHelp:`I could not finish. I can add a note about the blocker.`,handoffReview:`Review status`,handoffSubmit:`Submit status`,handoffSignal:`Expected result:`,handoffVerify:`Reporting Done lets the agent continue and verify; it is not proof of success.`,planCardLabel:`Development plan`,planCardReady:`Plan ready`,planCardResult:`Plan result`,planCardNotApproval:`This step produced a plan. It did not approve or start implementation.`,planCardCollapse:`Collapse`,planCardExpand:`Expand`,planCardCopy:`Copy plan`,planCardCopyPreview:`Copy visible preview`,planCardTruncated:`Only a bounded preview is displayed.`,planCardLoadFull:`Load full plan`,planCardLoadingFull:`Loading plan...`,planCardLoadFailed:`Could not load the full plan. Retry`,planCardEvidence:`Tool result · plan_ready`,questionWaiting:`Question`,questionPreview:`View preview`,questionSkip:`Skip`,questionProgress:`{{current}} of {{total}}`,questionReview:`Review answers`,questionReviewTitle:`Ready to send?`,questionReviewHelp:`Review your choices. Nothing is sent until you submit.`,questionEdit:`Edit answer: {{question}}`,questionDismiss:`Dismiss questions without answering`,questionCustom:`Or write your own reply`,questionCustomHelp:`Or leave it blank to ask for a clearer question.`,questionYourAnswer:`Your answer`,questionCustomPlaceholder:`Describe what you have in mind…`,questionNotes:`Additional context (optional)`,questionNotesPlaceholder:`Add a constraint or clarify your choice…`,questionRephrase:`Ask for a clearer or smaller question`,questionBack:`Back`,questionNext:`Next question`,questionSubmit:`Submit answers`,questionSubmitting:`Sending…`,questionRetry:`Check submission`,questionUncertain:`We could not confirm delivery. Your submitted answers are kept here. Check submission to recover the result without sending them twice.`,questionDisconnected:`Reconnecting… Your choices stay here; submitting is paused.`,questionLimit:`Keep each answer or note within {{count}} UTF-8 bytes.`,questionLoadFailed:`Could not check for questions awaiting your answer.`,questionDraftLimit:`Question drafts are full. Shorten or clear an existing answer before adding more text.`,questionRetryLoad:`Try again`,questionCloseReceipt:`Close question status`,questionState_dismissed:`Questions dismissed. No answers were submitted.`,questionState_cancelled:`Questions cancelled. No answers were submitted.`,questionState_expired:`Questions expired. No answers were submitted.`,questionState_stale:`This request is no longer active. Check the conversation for its result.`,conversationView:`Conversation view`,jumpToLatest:`Jump to latest`,historyLoading:`Loading history…`,historyOmitted:`{{count}} earlier entries · Scroll up to load automatically`,historyChanged:`The Session branch changed. History has been reset to the current branch.`,historyUnavailable:`Could not load history. Please retry.`,historyValidationUnavailable:`Could not verify the conversation history. Please retry.`,historyVerifying:`Checking conversation history…`,messageLoadFull:`Load full message`,messageLoadMore:`Load more`,messageLoadingFull:`Loading message…`,messageLoadFailed:`Could not load this message. Retry`,filePreview:`File preview`,changeEvidence:`Changes`,changeEvidenceScope:`Read-only Git snapshot of changes since this session started.`,turnLabel:`Turn {{number}}`,turnState_running:`Running`,turnState_complete:`Completed`,turnState_failed:`Failed`,turnState_interrupted:`Interrupted`,turnState_waiting:`Waiting for response`,turnState_forked:`Forked · Ready to continue`,turnChanges_one:`{{count}} file changed during this turn`,turnChanges_other:`{{count}} files changed during this turn`,turnChangesPartial:`At least {{count}} files changed during this turn`,turnChangesIncomplete:`This turn's change record is incomplete.`,turnChangesMore:`Show {{count}} more files`,turnChangesLess:`Show fewer files`,turnChangesReview:`Review turn changes`,turnChangesReviewButton:`Review`,turnChangesBack:`Back to turn changes`,turnChangesLoading:`Loading this turn's changes…`,turnChangesUnavailable:`This turn's saved diff is unavailable.`,messageCopyRequiresFull:`Load the full message before copying.`,filesChanged_one:`{{count}} file changed`,filesChanged_other:`{{count}} files changed`,reviewChanges:`Review changes`,workspaceChanges:`Workspace changes`,overviewChanges:`Changes`,overviewLineTotals:`Text lines added and removed across the current Git comparison`,overviewPartialTotals:`Known line counts only; some files could not be counted. Open Changes for details.`,overviewCounting:`Counting…`,overviewCountsUnknown:`Counts unavailable`,overviewReviewUnavailable:`Unavailable`,sessionSources:`Sources`,sourcesAdd:`Add source`,sourcesDescription:`Browse this conversation's attached images and files`,sourceAttached:`Attached to this conversation`,sourcesEmpty:`No sources yet`,sourcesFailed:`Could not load sources.`,sourcesViewAll:`View all`,sourcesLoadMore:`Load more sources`,sourcesBack:`Back to sources`,sourcesPartial:`This list has reached its display limit. Earlier sources remain in the conversation.`,turnChangesScope:`Saved workspace changes during this turn`,turnEdits_one:`Edited {{count}} file`,turnEdits_other:`Edited {{count}} files`,turnEditsPartial:`Recorded edits to {{count}} files`,turnEditsScope:`This turn's recorded file-tool writes · saved; shell and external edits are not included`,turnEditStatsUnknown:`Line counts unavailable`,turnEditReason_before_unavailable:`The write completed, but previous contents were not authorized for reading. A before/after diff is unavailable.`,turnEditReason_content_limit:`The write completed. Content exceeds the saved comparison limit, so exact line counts are unavailable.`,turnEditReason_concurrent_change:`The file changed between recorded operations. A reliable net diff for this turn is unavailable.`,gitReviewLoadedCount:`{{count}} files loaded`,gitReviewPartialLabel:`Partial`,gitReviewSearch:`Search file paths`,gitReviewExpand:`Expand review`,gitReviewSearchLoaded:`Search loaded files`,gitReviewMarkViewed:`Mark {{path}} as viewed`,gitReviewMarkCurrentViewed:`Mark current file {{path}} as viewed`,gitReviewViewedLabel:`Viewed`,gitReviewViewedProgress:`Viewed {{viewed}} / {{loaded}} loaded files`,gitReviewViewedLimit:`Up to {{count}} viewed marks are remembered for this comparison.`,gitReviewNoMatch:`No matching files.`,gitReviewNoLoadedMatch:`No matches in the loaded files.`,gitReviewLoadNext:`Load the next files`,gitReviewChanged:`The workspace changed. Refresh the list before loading more.`,gitReviewNewVersion:`New changes are available. You are reading the previous version.`,gitReviewShowLatest:`Show latest diff`,gitReviewBinary:`No text diff is available for this binary file.`,gitReviewBinaryShort:`Binary`,gitReviewPendingStats:`Not loaded`,gitReviewComparison:`{{current}} compared with {{base}}`,gitReviewWorkingTree:`Working tree compared with HEAD`,gitReviewSessionSnapshot:`Changes since this session started`,gitReviewDetached:`Detached HEAD`,gitReviewLoading:`Reading Git changes…`,gitReviewRetry:`Retry`,gitReviewRefresh:`Refresh changes`,gitReviewOlderResult:`Showing the previous result.`,gitReviewNotRepository:`This workspace is not a Git repository.`,gitReviewUnborn:`This repository has no readable HEAD yet.`,gitReviewFailed:`Git changes could not be read.`,gitReviewTruncated:`The change snapshot reached its file or diff size limit.`,gitReviewEmpty:`No changes in this comparison.`,gitReviewHiddenLines:`{{count}} more diff lines hidden.`,gitReviewDiffTruncated:`This file's diff was not loaded because the snapshot reached its size limit.`,gitReviewShowMore:`Show {{count}} more files`,gitReviewBackToFiles:`Back to changed files`,gitReviewFilePreview:`Diff for {{file}}`,gitReviewNoDiff:`No text diff is available for this file.`,changeDiff:`Change diff`,diffViewMode:`Diff view`,diffUnified:`Unified`,diffSplit:`Side by side`,diffBefore:`Before`,diffAfter:`After`,diffView:`Diff`,gitFileStatus_added:`Added`,gitFileStatus_modified:`Modified`,gitFileStatus_deleted:`Deleted`,gitFileStatus_renamed:`Renamed`,gitFileStatus_copied:`Copied`,gitFileStatus_untracked:`Untracked`,gitFileStatus_unknown:`Changed`,closePreview:`Close preview`,imageZoom:`Image zoom`,imageZoomHelp:`Zoom is relative to Fit. Use Ctrl + wheel to zoom, then drag to pan.`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,previousImage:`Previous image`,nextImage:`Next image`,imagePosition:`Image {{current}} of {{total}}`,artifactReadOnly:`Read-only`,artifactReferenceUnavailable:`File preview is unavailable in this view: {{path}}`,artifactSession:`Session {{sessionId}}`,copyFilePath:`Copy file path`,filePathCopied:`File path copied`,refreshFile:`Refresh file`,downloadFile:`Download file`,downloadingFile:`Downloading…`,artifactOlderPreview:`Showing an older preview. `,readingFile:`Reading file…`,artifactVersion:`Version`,artifactBytes:`{{count}} bytes`,artifactPreviewTruncated:`Preview truncated. Download the file for the complete content.`,artifactUnsupported:`This file type cannot be previewed. Use Download.`,filesLargeMarkdownSource:`This Markdown preview is large, so it is shown as source to keep scrolling responsive. All loaded text is included.`,chatView:`Chat`,trajectory:`Trajectory`,trajectoryScope:`Recorded Session messages in order, not execution durations or the complete model request.`,trajectoryRunning:`Work is active. This view updates as saved records arrive; in-flight text is available in Chat.`,trajectoryTruncated:`Loaded history is partial: {{entries}} entries omitted, {{parts}} parts omitted, {{messages}} messages truncated.`,trajectoryEmpty:`No saved records yet.`,trajectoryOrder:`Record order`,trajectoryOverview:`Overview`,trajectorySequenceHint:`Record order · widths are not elapsed time`,trajectoryClearRange:`Clear selection`,trajectoryContextLane:`Context`,trajectoryModelLane:`Model`,trajectoryToolLane:`Tools`,trajectorySelectRecord:`Select record {{number}}: {{name}}`,trajectoryTimingTab:`Timing`,trajectoryUsageTab:`Usage`,trajectoryDurationLabel:`Duration`,trajectoryTimingSource:`Source`,trajectoryTimingUnknown:`No execution duration was recorded. Record timestamps are not operation start times.`,trajectoryTimingNative:`Pi nested tool execution`,trajectoryTTFT:`Time to first output`,trajectoryGenerationTime:`Generation time`,trajectoryThroughput:`Output tokens / second`,trajectoryNotRecorded:`Not recorded`,trajectoryUsageUnknown:`This response has no reported token usage in the loaded records.`,trajectoryUsage_input:`Uncached input`,trajectoryUsage_cacheRead:`Cache read`,trajectoryUsage_cacheWrite:`Cache write`,trajectoryUsage_output:`Output`,trajectoryProvider:`Provider`,trajectoryModel:`Model`,trajectoryCode:`Code`,trajectoryWrap:`Wrap lines`,trajectoryCopy:`Copy source`,trajectoryCopied:`Copied`,trajectoryRawArguments:`Original JSON`,trajectoryFoldTurns:`Turns`,trajectoryFoldCalls:`Calls`,trajectoryMetrics:`Loaded execution summary`,trajectoryRequestCount:`{{count}} model responses`,trajectoryToolCount:`{{count}} tool calls`,trajectoryModelResponses:`Model responses`,trajectoryToolCalls:`Tool calls`,trajectoryLastTurn:`Latest recorded turn`,trajectoryEventColumn:`Event`,trajectoryContentColumn:`Content`,trajectoryTurn:`Turn {{number}}`,trajectoryLoadHistory:`Load earlier history`,trajectoryLatestRecords:`Jump to latest records`,trajectoryHistoryLoading:`Loading history…`,trajectoryNestedOutputMissing:`Pi recorded this nested call's status, but did not persist its result body. The outer script's output is separate.`,trajectoryRecordCount:`{{count}} records`,trajectoryMatches:`{{count}} matches`,trajectorySearch:`Search loaded records`,trajectoryNoMatches:`No matching records.`,trajectoryEarlierGroup:`Earlier context`,trajectoryEventCount:`{{count}} Session changes`,trajectorySummary:`Overview`,trajectoryInputTab:`Input`,trajectoryResultTab:`Result`,trajectoryConversationGroup:`Conversation`,trajectoryReasoningTitle:`Thinking`,trajectoryRecordNumber:`Record {{number}}`,trajectoryRecordInfo:`Record information`,trajectoryRecordId:`Record ID`,trajectoryCallId:`Tool call ID`,trajectoryEventType:`Event type`,trajectoryEvent_model_change:`Model changed`,trajectoryEvent_thinking_level_change:`Thinking level changed`,trajectoryEvent_compaction:`Context compacted`,trajectoryEvent_session_info:`Session information updated`,trajectoryEvent_custom:`Session record`,trajectoryEarlier:`Show earlier records ({{count}} remaining in loaded history)`,trajectoryDetails:`Record details`,trajectoryRecordedAt:`Record timestamp`,trajectoryEvidenceTruncated:`This evidence was truncated in the Session projection.`,trajectoryArguments:`Tool arguments`,trajectoryRecordedContent:`Recorded content`,trajectoryThinking:`Recorded model reasoning`,trajectoryOutput:`Tool result`,trajectoryMissingResult:`No unambiguous result is included in the loaded records. This does not imply the tool is still running.`,trajectoryStructured:`Structured result`,trajectoryEventOnly:`Only this event’s type and timestamp are available.`,trajectory_user:`User message`,trajectory_assistant:`Assistant`,trajectory_call:`Tool call`,trajectory_result:`Unpaired result`,trajectory_event:`Session event`,trajectoryRole_user:`User`,trajectoryRole_assistant:`Assistant`,trajectoryRole_call:`Tool`,trajectoryRole_result:`Result`,trajectoryRole_event:`Event`,trajectory_returned:`Tool returned a result.`,trajectory_error:`Tool returned an error`,trajectory_unknown:`Outcome not established`,runtimeStatus:`Runtime status`,runtimeIdentity:`OpenPI runtime information`,runtimeIdentityHint:`Backend information was captured at startup. It does not track later disk changes or Session reloads, and is not proof of every loaded module. Frontend identity describes this page build.`,runtimeIdentityFailed:`Could not read backend runtime information. Try again.`,runtimeBackendVersion:`Backend package version`,runtimePackageRoot:`Backend package directory`,runtimeStartedAt:`Process started`,runtimeGitRevision:`Git revision at startup`,runtimeGitState:`Working tree at startup`,runtimeGitDirty:`Local changes present`,runtimeGitClean:`Clean`,runtimeFrontendVersion:`Page package version`,runtimeFrontendBuild:`Page build ID`,runtimeStartupBuild:`Page build ID recorded at startup`,runtimeDevelopmentBuild:`Development server (no production build ID)`,runtimeBuildMismatch:`This page build differs from the build recorded when the backend started. Refresh the page or restart the service, then check again.`,refreshStatus:`Refresh status`,openTools:`Open tools`,openToolsUnavailable:`Select a chat to open tools`,sideConversation:`Side conversation`,sideConversationDescription:`Ask a focused question in a separate Pi session without interrupting the main task.`,workbarChangesDescription:`Inspect the current Git branch and working tree.`,terminal:`Terminal`,renameTerminal:`Rename terminal`,terminalName:`Terminal name`,workbarTerminalDescription:`Open an interactive shell for the current workspace.`,restartTerminal:`Restart terminal`,reconnectTerminal:`Reconnect terminal`,restartTerminalTitle:`Restart this terminal?`,restartTerminalDetail:`The current terminal will be closed. Running processes may be interrupted.`,terminalReconnecting:`Reconnecting terminal...`,terminalScrollToBottom:`Scroll to bottom`,terminalOutputResynced:`Terminal output resynchronized.`,terminalRestarting:`Restarting terminal...`,terminalConnecting:`Starting terminal…`,terminalExited:`Terminal exited.`,terminalExitCode:`Terminal exited with code {{code}}.`,terminalDisconnected:`Terminal connection ended unexpectedly.`,terminalError:`Terminal unavailable.`,terminalLoadError:`The terminal interface could not load. Refresh the page to try again.`,reloadPage:`Refresh page`,browser:`Browser`,sessionFileRecords:`Session file records`,gitReviewSource:`Changes`,gitReviewBaseBranch:`Compare against branch`,gitReviewChooseBase:`Choose comparison branch`,gitReviewSearchBranches:`Search branches`,gitReviewLocalBranch:`Local branch`,gitReviewRemoteBranch:`Remote branch`,gitReviewBranchesTruncated:`Showing a bounded list of branches. Some branches are omitted.`,gitReviewNoMatchingBranches:`No matching branches.`,gitReviewBaseUnavailable:`No default comparison branch is available. Choose a branch to review committed changes.`,gitReviewBaseInvalid:`The selected comparison branch is unavailable. Choose another branch.`,gitReviewUnstaged:`Unstaged changes`,gitReviewStaged:`Staged changes`,gitReviewBranch:`Branch changes`,gitReviewFileMissing:`This file no longer has changes in this view. Refresh the file list.`,artifactExternalAccess:`This file is in another working directory. You can authorize read-only access to this file for this session; other files remain inaccessible.`,artifactAuthorizeFile:`Open this file read-only`,sideConversationPending:`Preparing side conversation…`,resizeSidebar:`Resize sidebar`,resizePanes:`Resize panes`,resizeWorkbar:`Resize workbar`,browserPasteTooLarge:`Paste at most {{count}} characters at a time.`,browserInputTooLarge:`Enter at most {{count}} characters at a time.`,browserInputTargetChanged:`The input target changed or could not be confirmed. An input operation was not executed.`,workbarBrowserDescription:`Open and interact with a page inside the OpenPI workbar.`,browserReady:`Enter an address to start browsing`,browserStarting:`Starting the embedded browser…`,browserOpened:`Opened in the embedded browser`,browserOpenAgain:`Open again`,browserOpenFailed:`The embedded browser is unavailable.`,browserBack:`Back`,browserForward:`Forward`,browserReload:`Reload`,browserTabs:`Browser tabs`,browserNewTab:`New tab`,browserAddTab:`New browser tab`,browserCloseTab:`Close {{title}}`,browserTabLimit:`Up to {{count}} browser tabs`,browserPageTitle:`Web page: {{address}}`,browserEnteredAddress:`Last address opened from this toolbar`,browserAddressNotAllowed:`Enter an HTTP(S) address without embedded credentials, outside this application's origin.`,browserLocationUnknown:`This page navigated. Its new address is unavailable. Reload returns to the address you entered.`,browserDirectDescription:`Browse pages directly. Sites that refuse embedding can be opened in your external browser.`,browserDirectHint:`The address records toolbar navigation only. Page popups open in your external browser. Blank page? Use Open in external browser.`,browserEnhancedHint:`Browser enhancement is on: addresses sync and ordinary popup links open in these tabs. Some site policies, login popups and cross-site history still require an external browser.`,files:`Files`,filesExplorer:`Workspace files`,filesSearch:`Filter files…`,refreshFiles:`Refresh files`,filesWorkspaceActions:`Workspace file actions`,filesCreateMenu:`New`,filesImportMenu:`Import`,filesMoreMenu:`More`,filesNewFile:`New file`,filesNewDirectory:`New folder`,filesImport:`Import files`,filesImportFolder:`Import folder`,filesImportFolderChoose:`Choose a folder to import`,filesImportFolderLimit:`Import up to 2,000 files and folders at a time, with at most 64 nested levels.`,filesSelectMultiple:`Select multiple files`,filesSelectItem:`Select {{name}}`,filesSelectedCount:`{{count}} selected`,filesRename:`Rename`,filesNewName:`New name`,filesMove:`Move`,filesMoveDestination:`Destination folder (workspace relative path)`,filesTrashAction:`Move to trash`,filesTrash:`Workspace trash`,filesTrashDetail:`Removed files stay in this workspace and can be restored. Existing names are preserved.`,filesTrashEmpty:`No removed files`,filesTrashUnavailable:`{{count}} entries could not be verified. Their contents remain in .openpi-trash; automatic restore is unavailable.`,filesRestore:`Restore`,filesRestoreItem:`Restore {{name}}`,filesUndoTrash:`Undo removal`,filesOrganizationResults:`File operation results`,filesOperationDone:`Done`,filesRefreshBeforeOrganizing:`Refresh the file tree before organizing this item.`,filesImportChoose:`Choose files to import`,filesTargetDirectory:`Destination`,filesWorkspaceRoot:`Workspace root`,filesFileName:`File name`,filesDirectoryName:`Folder name`,filesCreate:`Create`,filesCreating:`Creating…`,filesCreated:`Created: {{path}}`,filesNameInvalid:`Enter one file or folder name without path separators.`,filesNameExists:`This name already exists. Choose a different name; the existing file was preserved.`,filesMutationFailed:`Could not write this file. Your input is preserved.`,filesWriteUnavailable:`Switch to this session to write workspace files.`,filesImportLimit:`Each file can be up to 50 MiB. Existing names are never overwritten.`,filesImportTooLarge:`This file exceeds the 50 MiB import limit.`,filesImportDirectoryUnsupported:`Folders cannot be imported. Choose the files inside the folder.`,filesImportResults:`File import results`,filesImportPending:`Waiting to import`,filesImporting:`Importing…`,filesImported:`Saved to the workspace`,filesImportedNoPreview:`Saved. Preview supports up to 20 MiB; copy the path to use this file in chat.`,filesClearImported:`Clear completed imports`,filesRetryImport:`Retry import`,filesPathActions:`Path actions for {{name}}`,filesCopyRelativePath:`Copy relative path`,filesCopyAbsolutePath:`Copy absolute path`,filesPathCopied:`Copied path: {{path}}`,filesReadFailed:`Unable to read files.`,filesRetryRead:`Try again`,filesErrorDetails:`Error details`,filesReadFailedDetail:`The file list could not be loaded. Check your connection and try again.`,filesReadDenied:`This session's workspace is currently unavailable or cannot be verified. Check the session and workspace, then try again.`,filesSymlink:`Symbolic link — not followed by the file browser`,filesTruncated:`The result is incomplete. Refine your search.`,filesNoMatches:`No matching files`,filesEmpty:`This folder is empty`,filesChoose:`Choose a file to preview`,filesChooseDetail:`Browse your workspace on the right. Files open here, keeping the explorer in place.`,filesHideTree:`Hide file tree`,filesShowTree:`Show file tree`,filesPreview:`Preview`,filesSource:`View source`,filesEdit:`Edit`,filesMode:`File view`,filesEditor:`File editor`,filesSave:`Save file`,filesSaving:`Saving…`,filesSaved:`Saved`,filesUnsaved:`Unsaved changes · draft kept in this window`,filesDiscard:`Discard draft`,filesDiscardConfirm:`Discard your unsaved changes to this file?`,filesSaveConflict:`The file changed on disk. Your draft is preserved. Refresh to inspect the current version, then reconcile your changes before saving.`,filesSaveFailed:`Could not save. Your draft is preserved; check the file and retry.`,filesEditLoadFirst:`Continue reading the complete file before editing.`,filesEditUnavailable:`Editing supports workspace UTF-8 text files up to 1 MiB. At most 16 unsaved drafts can be kept.`,filesOutline:`Document outline`,filesDiskVersion:`Inspect current disk version`,filesReconcile:`Reviewed · continue editing my draft against this version`,filesTable:`Table preview`,filesRow:`Row`,filesSheets:`Worksheets`,filesTableTruncated:`Showing a partial table preview. Download the original file for complete content.`,filesOfficeLayout:`Document content preview; pagination and typography may differ from Office.`,filesSlidesLayout:`Slide text and images; themes, charts and animations may differ from PowerPoint.`,filesPreviousPage:`Previous page`,filesNextPage:`Next page`,filesZoomOut:`Zoom out`,filesZoomIn:`Zoom in`,filesZoomReset:`Reset zoom`,filesPdfPage:`Page {{page}}`,filesDocumentLimit:`This document exceeds the preview limit. Download it to open locally.`,filesPreviewFailed:`Unable to preview this file. You can still download it.`,filesDiagram:`Mermaid diagram`,filesDiagramLoadError:`Unable to load diagram preview. The source is shown below. Refresh the page to try again.`,filesExpandDiagram:`Expand diagram`,filesFitImage:`Fit`,filesOriginalImage:`Original size`,filesLoadMore:`Load more`,filesLoaded:`{{count}} items loaded`,filesReadMore:`Continue reading`,filesContentChanged:`The file changed. Refresh when ready; your current reading position is preserved.`,workbarFilesDescription:`Browse workspace files with an inline preview and file tree.`,backToSideConversations:`Back to side conversations`,continueSideConversation:`Send a follow-up…`,startSideConversation:`Ask a side question…`,sideConversationModelInherited:`New side conversations use the main conversation’s model and thinking level.`,sideConversationModelFixed:`This is the model used by this side conversation.`,stop:`Stop`,start:`Start`,browserAddress:`Browser address`,browserGo:`Open address`,openExternalBrowser:`Open in external browser`,invalidBrowserAddress:`Enter a valid HTTP or HTTPS address.`,addImages:`Add images`,addFiles:`Add files`,fileAttachments:`File attachments`,previewFileAttachment:`Preview file`,fileAttachmentDescription:`Documents, spreadsheets, PDFs, text, code, and other files`,fileAttachmentCount:`Attach up to {{count}} items.`,fileAttachmentTooLarge:`Files must total 50 MB or less.`,fileAttachmentReadFailed:`Could not read this file. Check the format or whether it is password protected.`,fileAttachmentTextReady:`Text ready`,fileAttachmentTextTruncated:`Partial text · original retained`,fileAttachmentOriginalReady:`Original file ready`,fileAttachmentExtractionFailed:`Text unavailable · original retained`,fileAttachmentEncodingUnavailable:`The text encoding could not be read. The original bytes are preserved.`,fileAttachmentDocumentUnavailable:`Text could not be extracted. The document may be password protected or have an unsupported format. The original bytes are preserved.`,fileAttachmentNoText:`The original file will be attached for the agent to read with its tools. No text was extracted.`,fileAttachmentPreviewTruncated:`Preview shows the first 20,000 characters. The complete extracted text will be attached.`,fileAttachmentExtractedContent:`Extracted text`,fileAttachmentPromptLabel:`User-provided files:`,fileAttachmentPromptTooLong:`The message and file references exceed the input limit. Shorten the message or attach fewer files.`,imageAttachmentDescription:`PNG, JPEG, GIF, or WebP`,imageAttachments:`Image attachments`,imageAttachmentsLoading:`Preparing attachments…`,commandOpensPanel:`Open panel`,commandPanelArguments:`This command opens a panel and cannot include arguments or images. Remove them, or use the panel directly.`,commandPanelUnavailable:`The panel could not be opened. Your command is preserved.`,commandUnavailable_terminal_only:`Requires Pi's terminal interface.`,commandUnavailable_not_integrated:`This extension command is not connected to Web yet. Use it in Pi's terminal.`,artifactImagePreviewFailed:`Unable to preview this image. Refresh the file to retry, or download it.`,artifactFileDetails:`File details`,turnElapsedRunning:`Working for {{duration}}`,compactionElapsed:`Waiting {{duration}}`,compactionRunning:`Compacting context`,compactionCompleted:`Context automatically compacted`,compactionFailed:`Context compaction failed`,compactionInterrupted:`Compaction interrupted`,compactionUnchanged:`Compaction finished without a new summary`,compactionUnavailable:`Context compaction status unavailable`,compactionReconnectHelp:`Connection interrupted. The current status will be checked after reconnecting.`,compactionDraftHelp:`Compacting history. Messages you send will be queued.`,turnElapsedFinished:`Worked for {{duration}}`,composerAdd:`Add`,composerCommands:`Commands`,composerFile:`File`,composerPlan:`Plan`,composerCompact:`Compact`,composerModel:`Model`,composerBack:`Back`,composerPlanDescription:`Enter or leave Plan mode`,composerCompactDescription:`Summarize earlier conversation history`,composerModelDescription:`Select this Session's model`,compactionQueueWaiting:`Waiting for compaction to finish`,compactionQueueBlocked:`Messages retained. Retry when ready or clear the queue.`,clearPromptQueue:`Clear queue`,queueUpdateFailed:`Could not update the queue. Check the current session and try again.`,queueStatusUnconfirmed:`The request was received, but the latest queue state could not be verified. Refresh before trying again.`,turnElapsedOutcome_cancelled:`Stopped`,turnElapsedOutcome_failed:`Failed`,turnElapsedOutcome_uncertain:`Outcome unconfirmed`,settingsSetupBusyHint:`Agent configuration is available after this turn. Display settings can be changed now.`,resetChatContentWidth:`Reset chat content width`,resetChatFontSize:`Reset chat font size`,setupResolveAdmission:`Return to the conversation to resolve the pending message before applying settings.`,removeAttachment:`Remove attachment`,dropImagesHere:`Drop files or images here`,imageAttachmentCount:`Attach up to {{count}} images.`,imageAttachmentTooLarge:`Each image must be 10 MB or smaller.`,imageAttachmentTotalTooLarge:`The attached images must total 32 MB or less.`,imageAttachmentUnsupported:`Only valid PNG, JPEG, GIF, and WebP images are supported.`,imageAttachmentReadFailed:`Could not read this image. Add it again to retry; your message is preserved.`,attachedImage:`Attached image`,previewAttachment:`Preview image`,closeImagePreview:`Close image preview`,imagePreviewFailed:`Unable to display this image.`,fitImage:`Fit image`,originalImageSize:`Original size`,imageViewMode:`Image view`,sessionUsage:`Session token usage`,sessionInputTokens:`Input tokens`,sessionOutputTokens:`Output tokens`,sessionCacheTokens:`Cached tokens`,sessionContextUsage:`Context usage and context window`,usageContextLabel:`Context`,usageUnknown:`Unknown`,usageOpenDetails:`Input {{input}} · Output {{output}} · Context {{percent}} / {{capacity}} · View token usage`,usageContextHelp:`Estimated tokens in the current branch / model context limit.`,usageSessionTotals:`Session totals`,usageInputLabel:`Input`,usageOutputLabel:`Output`,usageCacheReadLabel:`Cache read`,usageCacheWriteLabel:`Cache write`,usageTotalLabel:`Total`,usageWorkspaceLabel:`Workspace`,usageSessionId:`Session ID`,usageTotalsHelp:`Session token totals include cache usage.`,subagentDetails:`Subagents`,sessionOverview:`Session overview`,sessionOverviewChanges:`Changes in the current review scope`,subagentSummaryRunning:`{{count}} running`,subagentSummaryDone:`{{count}} completed`,subagentSummaryOther:`{{count}} other`,subagentNoneYet:`No subagents yet`,subagentOtherGroup:`Failed / interrupted`,subagentShowMore:`Show {{count}} more`,backToSubagents:`Back to subagents`,subagentActiveGroup:`Active`,subagentFinishedGroup:`Completed`,subagentNoneRunning:`No subagents running.`,subagentNoneFinished:`Completed tasks will appear here.`,subagentProgress:`Subagents: {{running}} running · {{completed}} completed`,subagentSummaryUnknown:`{{count}} without confirmed status`,subagentTasks:`Subagent tasks`,inspectSubagent:`Open subagent: {{name}}`,subagentState_running:`Running`,subagentProcessing:`Working…`,subagentState_done:`Completed`,subagentState_error:`Failed`,subagentState_interrupted:`Interrupted`,subagentStarting:`Starting…`,subagentSpawnFailed:`Failed to start`,subagentStateUnavailable:`Started · state unavailable`,subagentSpawnReceipt:`Start receipt`,subagentSpawnReceiptHint:`This confirms the start request, not the subagent's final result.`,subagentTask:`Assigned task`,subagentTranscript:`Subagent conversation`,subagentResult:`Result`,subagentSpend:`Cumulative token spend`,subagentSaved:`Saved record`,subagentRecordedState:`Last recorded state`,subagentSavedHint:`From this parent session's saved receipts. A result may include other tasks from the same batch; this is not the child's full live conversation.`,subagentReadOnly:`Read-only view · closing this panel does not stop the task`,subagentUnavailable:`Live details are no longer available for this subagent in the current session. The start receipt is not evidence of completion.`,subagentStale:`Could not refresh. The details below are the last received snapshot.`,subagentNoMessages:`No messages received yet.`,subagentTranscriptUnavailable:`This view retains a task summary and cannot show the full child conversation.`,subagentWorkflowsTruncated:`{{count}} workflows are outside the loaded list; their task counts are unknown.`,subagentState_unknown:`Unconfirmed`,subagentUnconfirmedGroup:`Unconfirmed`,subagentTruncated:`Showing recent messages. {{count}} earlier messages are not included in this view.`,subagentTextTruncated:`Some long content is shown as an excerpt.`,subagentListTruncated:`{{count}} additional tasks are outside the loaded list.`,subagentThinkingRedacted:`Reasoning was redacted by the provider.`,inspectionChanged:`The active session changed. Reopen this panel.`,inspectionUnavailable:`Details are unavailable.`,inspectionLoading:`Loading status…`,thinkingUnavailable:`Thinking state is unavailable.`,trustUnavailable:`Project trust status is unavailable.`,copySetupCommand:`Copy setup command`,savedTrustDecision:`Saved decision`,activeSessionTrust:`Active Session trust`,trustDecision_trusted:`Trusted`,trustDecision_denied:`Denied`,trustDecision_undecided:`Undecided`,trustDecision_unknown:`Unknown`,trustActiveYes:`Trusted in this Session`,trustActiveNo:`Not trusted in this Session`,modelAndThinking:`Model and reasoning`,selectedModel:`Current model`,thinkingLevel:`Thinking level`,availableThinking:`Available levels`,unknownState:`Unknown`,projectTrust:`Project trust`,trust_trusted:`This session trusts the workspace.`,trust_untrusted:`Trust for this workspace has been denied.`,trust_restricted:`Project resources are restricted pending a trust decision.`,trust_unknown:`Trust state is not available.`,trustRefreshNeeded:`The saved decision and active session differ. Refresh the session through Pi to apply it.`,providerAvailability:`Provider credentials`,settings:`Settings`,settingsNavigation:`Settings navigation`,generalSettings:`General`,configurationSettings:`Configuration`,configurationIntro:`Permissions, web access and model responses.`,configurationReadFailure:`Configuration could not be read safely. Fix the settings file, then refresh.`,configurationUserScope:`User configuration`,configurationSetupHint:`Response and search changes use OpenPI setup`,configurationApproval:`Approval policy`,configurationApprovalDetail:`Tool approvals follow the installed Pi extensions.`,configurationPiPermissions:`Pi extensions`,configurationSandbox:`Sandbox`,configurationSandboxDetail:`Tools run with the host process permissions.`,configurationSandboxUnavailable:`No OS sandbox`,configurationSearchDetail:`Let the current Session model search the web when supported.`,configurationSearchOff:`Do not offer native search to the current model.`,configurationSearchOn:`Offer native search when the current connection supports it.`,configurationVerbosity:`Output verbosity`,configurationVerbosityDetail:`Choose how much detail the model includes in its response.`,configurationResponsesUnavailable:`The current connection does not use a supported Responses API.`,configurationVerbosity_default:`Model default`,configurationVerbosity_low:`Low`,configurationVerbosity_medium:`Medium`,configurationVerbosity_high:`High`,configurationVerbosityHelp_low:`Prefer short answers with fewer details.`,configurationVerbosityHelp_medium:`Include useful explanation and a moderate amount of detail.`,configurationVerbosityHelp_high:`Include more complete explanation and detail.`,configurationVerbosityRequest:`Set only response_verbosity to {{value}}; preserve the other OpenPI settings.`,configurationSummary:`Reasoning summary`,configurationSummaryDetail:`Choose the summary requested from a supported reasoning model.`,configurationSummaryUnavailable:`The current connection does not support reasoning summaries.`,configurationSummary_default:`Model default`,configurationSummary_auto:`Auto`,configurationSummary_concise:`Concise`,configurationSummary_detailed:`Detailed`,configurationSummary_none:`Off`,configurationSummaryHelp_auto:`Let the model choose the summary length.`,configurationSummaryHelp_concise:`Request a brief reasoning summary.`,configurationSummaryHelp_detailed:`Request a more detailed reasoning summary.`,configurationSummaryHelp_none:`Do not request a summary. Keep the current reasoning effort.`,configurationSummaryRequest:`Set only response_reasoning_summary to {{value}}; preserve the other OpenPI settings.`,configurationModelFeatures:`Model features`,configurationReasoningLevels:`Available reasoning efforts`,configurationReasoningDetail:`Choose which levels appear in model controls. Only levels supported by the current model are shown; the current level stays visible.`,configurationReasoningCount:`{{count}} selected`,configurationDependencies:`Workspace dependencies`,configurationEnvironment:`Local environment`,configurationEnvironmentDetail:`Node.js, Python and other tools come from your environment. OpenPI does not install a bundled workspace runtime.`,configurationRuntimeStatus:`Runtime status`,browserSettings:`Browser`,webSearchSettings:`Web search`,webSearchCurrentModel:`Current Session model`,webSearchNativeDetail:`Use your current model provider's native search with the existing connection and credentials.`,webSearchSupported:`This connection supports native search. When enabled, the model decides when to search.`,webSearchUnsupported:`Native search is unsupported or unconfirmed for this connection. No search tool is provided and no other provider is used.`,webSearchNativeRequest:`Enable native web search using the current Session model and existing Pi credentials. Do not switch model, connection protocol, or search provider. Unsupported or unknown connections must receive no search tool.`,webSearchIntro:`Let your model search current sources and read the original pages.`,webSearchPackageDetail:`Optional search, page reading, and PDF extraction through a Pi package.`,webSearchDefaultOff:`Off by default. This optional extension follows the current Session model; it needs no separate search key or plugin installation.`,webSearchLoaded:`Package loaded in this Session`,webSearchNotLoaded:`Package not loaded in this Session`,webSearchSource:`Review plugin source`,webSearchProfile:`Search setup`,webSearchExa:`Exa — no API key required`,webSearchExisting:`Keep my existing search preferences`,webSearchProfileHint:`Exa uses search queries with direct page reading. Existing preferences stay untouched. Other search services can be configured after installation.`,webSearchEnable:`Enable web search…`,webSearchDisable:`Disable web search…`,webSearchConfigure:`Change search service…`,webSearchExaRequest:`Enable optional web search with Pi Web Access and Exa, which needs no API key. Let me review the installation confirmation, preserve other preferences, and do not reload automatically.`,webSearchExistingRequest:`Enable optional web search with Pi Web Access and keep my existing search preferences unchanged. Let me review the installation confirmation, preserve other preferences, and do not reload automatically.`,webSearchDisableRequest:`Disable native web search. Preserve other settings and Session history.`,webSearchProviderRequest:`Help me change the search service for my installed Pi Web Access plugin. Explain available services and permissions, preserve unrelated preferences, keep credentials with the search plugin, and do not reload automatically.`,browserSettingsIntro:`Let OpenPI read pages, click, type and take screenshots.`,browserControl:`Browser control`,browserControlHint:`Requests a setup change. Access changes after the configuration is saved.`,browserDefault:`Default browser`,browserDefaultHint:`Requests a setup change for the browser used when none is named.`,browserEmbedded:`OpenPI browser`,browserAllowedTitle:`Allowed browsers`,browserOffHint:`Your choices take effect when browser control is on.`,browserConnected:`Connected`,browserNeedsSetup:`Extension setup needed`,browserNotFound:`Browser not detected`,browserUpdateNeeded:`Extension update needed`,browserBlocked:`Not allowed`,browserDefaultBlocked:`Your default browser is not allowed. Allow it or choose another default.`,browserSetUp:`Set up`,browserManage:`Manage`,browserSetupNamed:`Set up {{browser}}`,browserManageNamed:`Manage {{browser}}`,browserAllowNamed:`Allow {{browser}}`,browserMore:`More browsers`,browserSpeakHint:`Say “Use Chrome to…” to choose a different browser for a request.`,browserGuideTitle:`Connect {{browser}}`,browserGuideEyebrow:`One step at a time`,browserConnectionTitle:`Connection`,browserCloseGuide:`Close browser setup`,browserConnectionReady:`Connected. Choose whether OpenPI may use this browser.`,browserEmbeddedDetail:`Pages open inside OpenPI. Some websites require a regular browser to sign in or display correctly.`,browserExternalDetail:`OpenPI can use existing tabs and signed-in pages in your connected {{browser}} profile. Keep an OpenPI tab open in that profile.`,browserManageExtension:`Manage extension`,browserAllowUse:`Allow OpenPI to use it`,browserMakeDefault:`Use as default`,browserInstallIn:`Install in`,browserInstallTitle:`Install OpenPI Browser Bridge`,browserSetupSteps:`Setup steps`,browserGuidePopout:`Keep this guide in a separate window`,browserGuideDetached:`Your guide is open in a separate window. Follow it alongside the browser settings.`,browserShowGuide:`Show guide`,browserGuideInline:`Return guide here`,browserGuideBlocked:`The guide window could not open. Allow pop-ups and try again, or follow the steps here.`,browserSafariSettings:`Safari → Settings`,browserSafariDeveloper:`Developer settings`,browserSafariTemporary:`Add Temporary Extension…`,browserSafariOpenHint:`Open Safari, then choose Safari → Settings. Keep this guide alongside it. Requires Safari 26 or later on macOS.`,browserSafariDeveloperTitle:`Show Safari’s developer settings`,browserSafariDeveloperHint:`In Settings → Advanced, turn on Show features for web developers. Then select the Developer tab.`,browserSafariLoadHint:`In Developer, click Add Temporary Extension and select the folder below. Enable OpenPI Browser Bridge and allow the websites you want to control, including the local OpenPI page. Temporary extensions need reloading after Safari quits.`,browserFirefoxThis:`This Firefox`,browserFirefoxTemporary:`Load Temporary Add-on…`,browserFirefoxDeveloperTitle:`Select This Firefox`,browserFirefoxDeveloperHint:`On about:debugging, choose This Firefox in the left sidebar. Firefox does not need a Developer mode switch.`,browserFirefoxLoadHint:`Click Load Temporary Add-on and select manifest.json in the folder below. This development installation lasts until Firefox restarts; a permanent installation requires a Mozilla-signed package.`,browserFirefoxDone:`Selected. Next`,browserStepCount:`Step {{step}} of {{total}}`,browserStepLabel:`Step {{step}}: {{label}}`,browserStepOpen:`Open page`,browserStepAdd:`Add extension`,browserStepConnect:`Connect`,browserOpenManagerTitle:`Open {{browser}} extensions`,browserOpenManagerHint:`This opens {{browser}}. Complete the action on its extensions page, then return here to continue.`,browserOpenManager:`Open {{browser}} extensions`,browserReopenManager:`Open extensions page again`,browserAlreadyInstalled:`Already installed? Connect`,browserDeveloperMode:`Developer mode`,browserDeveloperTitle:`Turn on Developer mode`,browserDeveloperHint:`Turn on Developer mode on the extensions page. The {{loadLabel}} button will appear.`,browserDeveloperDone:`It’s on. Next`,browserIllustration:`Illustration · In {{browser}}`,browserExtensions:`Extensions`,browserLoadUnpacked:`Load unpacked`,browserLoadHint:`The extension is ready on this computer. Follow these steps in {{browser}} to load it.`,browserCopyLocation:`Copy the location below`,browserLocateTarget:`Find the extension on this computer`,browserRevealTarget:`Locate extension`,browserLocateManifest:`Find the extension’s manifest.json`,browserRevealManifest:`Locate manifest.json`,browserDragToBrowser:`Drag the folder onto {{browser}} extensions`,browserDragFolderHint:`Drag the entire {{folder}} folder from your file manager onto the extensions page, with Developer mode on.`,browserSelectLocatedTarget:`In the browser’s file picker, select the item located in the previous step.`,browserManualInstall:`Need another way? Select by path`,browserManualSelection:`Can’t find it? Select by path`,browserLoadInBrowser:`In {{browser}}, click “{{loadLabel}}”`,browserLoadAlternate:`The button appears when Developer mode is on.`,browserConfirmFolder:`Select`,browserConfirmFile:`Open`,browserSelectFolderHint:`Select this entire folder, not a .js file inside it.`,browserSelectManifestHint:`Select manifest.json, not one of the .js files.`,browserInstallCheckpoint:`Continue when OpenPI Browser Bridge appears in the extensions list.`,browserPathCopied:`Path copied`,browserCopyFailed:`Couldn’t copy. Select the path above and copy it manually.`,browserChooseFolderMac:`Press ⌘ ⇧ G, paste the copied path and press Return. Then click “{{confirm}}”.`,browserChooseFolderOther:`Paste the copied path into the location bar and press Enter. Then click “{{confirm}}”.`,browserInstalledConnect:`Added. Connect to OpenPI`,browserPreviousStep:`Back`,browserWaiting:`Waiting for OpenPI Browser Bridge… We’ll detect it automatically.`,browserInstallBrowserFirst:`Install {{browser}} first, or open this OpenPI address in your installed browser.`,browserConnectTitle:`Connect to OpenPI`,browserConnectHint:`Open OpenPI in {{browser}}. Use the profile where you installed the extension.`,browserOpenIn:`Open in {{browser}}`,browserAllowHint:`Once connected, you can allow OpenPI to use this browser. Installing the extension does not change your browser permissions.`,browserCheck:`Check connection`,browserNotConnectedYet:`No connection yet. Finish installation, refresh OpenPI in that browser and check again.`,browserHelp:`Setup help`,browserReloadHint:`Already installed? Reload OpenPI Browser Bridge in the extension manager and refresh OpenPI. Accept the browser’s permission prompt if shown.`,browserSupportedHint:`Chrome, Edge, Brave and Chromium 145+ support embedded and native pages. Safari 26+ on macOS and Firefox 128+ use the portable extension for native tabs; nested frames must be opened separately. Temporary Safari/Firefox installations need reloading after browser restart.`,browserCopyPath:`Copy path`,browserOpening:`Opening browser…`,browserLoading:`Checking browser connections…`,browserSaved:`Saved. Browser permissions take effect immediately.`,browserSaving:`Working…`,modelSettings:`Models`,skillsSettings:`Skills`,subagentsSettings:`Sub-agents`,pluginsSettings:`Plugins`,configureOpenPi:`Configure OpenPI`,setupRequestReviewAll:`review every OpenPI configuration area with me`,setupRequestSetTheme:`set only the OpenPI Web theme to {{value}} and preserve every other setting`,setupRequestSetChatWidth:`set only the OpenPI Web chat content width to {{value}}px and preserve every other setting`,setupRequestSetChatFontSize:`set only the OpenPI Web chat font size to {{value}}px and preserve every other setting`,setupRequestEnableExpandedThinking:`expand thinking blocks by default in OpenPI Web and preserve every other setting`,setupRequestDisableExpandedThinking:`collapse thinking blocks by default in OpenPI Web and preserve every other setting`,setupRequestSubagents:`review and configure Agent role models and workflow limits`,setupRequestFailed:`The OpenPI setup request was not accepted.`,setupRequestRunning:`Applying OpenPI settings…`,setupRequestAccepted:`Configuration request accepted.`,setupPlanBlocked:`Exit Plan mode before changing agent configuration. Display settings can be changed directly; exiting does not start implementation.`,setupPlanBusy:`Agent configuration requires an idle turn and leaving Plan mode. Display settings can be changed now.`,setupOutcome_pending:`Configuration request is awaiting a save receipt.`,toolCallArguments:`Tool arguments`,toolCallOutput:`Tool result`,setupOutcome_saved:`OpenPI configuration was saved and applied.`,setupOutcome_unchanged:`Configuration was saved; effective settings are unchanged.`,setupOutcome_failed:`The setup request failed. Review the error and current settings before retrying.`,setupOutcome_cancelled:`Setup was cancelled without a confirmed save.`,setupOutcome_unconfirmed:`No successful save was confirmed. Review current settings before retrying /openpi-setup.`,settingsUpdateFailed:`The Web preference could not be saved.`,settingsPreferencesSaved:`Preferences saved.`,settingsPreferencesSaveFailed:`Could not save display settings. Check configuration diagnostics and retry.`,settingsCatalogLoading:`Loading Pi resources…`,settingsCatalogFailed:`Could not load Pi settings resources.`,appearance:`Appearance`,settingsPersonal:`Personal`,settingsAgent:`Agent`,settingsIntegrations:`Integrations`,settingsArchivedChats:`Archived chats`,settingsSearch:`Search settings`,settingsClearSearch:`Clear search`,settingsNoResults:`No matching settings`,appearanceVisualStyle:`Visual style`,appearanceMode:`Mode`,appearanceTheme:`Theme`,appearanceAccent:`Accent color`,appearanceBackground:`Background`,appearanceForeground:`Foreground`,appearanceFont:`Font`,appearanceFont_codex:`Codex default`,appearanceFont_sans:`Sans serif`,appearanceFont_serif:`Serif`,appearanceFont_mono:`Monospace`,appearanceAccent0:`Default`,appearanceAccent1:`Blue`,appearanceAccent2:`Purple`,appearanceAccent3:`Pink`,appearanceAccent4:`Orange`,appearanceAccent5:`Green`,appearanceCustomAccent:`Custom accent color`,appearanceAdvanced:`Advanced`,appearanceReset:`Restore defaults`,appearanceResetAction:`Reset appearance`,appearanceImport:`Import theme`,appearanceCopy:`Copy theme`,appearanceCopied:`Theme copied`,appearanceCopyFailed:`Could not copy theme. Try again.`,appearanceThemeValue:`Theme data`,appearanceImportPlaceholder:`Paste an OpenPI theme…`,appearanceImportInvalid:`Enter valid OpenPI theme data.`,appearanceImportAction:`Import`,searchArchivedChats:`Search archived chats`,archiveProjectFilter:`Filter by project`,archiveAllProjects:`All projects`,archiveProjectGroup:`{{project}} · {{count}} archived chats`,archiveSort:`Sort archived chats`,archiveSortUpdated:`Last updated`,archiveSortCreated:`Date created`,restoreArchivedChat:`Restore {{title}}`,themeLight:`Light`,themeDark:`Dark`,themeMist:`Mist`,themeRose:`Rose`,themePine:`Pine`,themeSystem:`System`,conversationSettings:`Conversation`,expandThinkingByDefault:`Expand thinking by default`,chatContentWidth:`Chat content width`,chatFontSize:`Chat font size`,agentBehavior:`Agent behavior`,workflowLimits:`Workflow limits`,workflowConcurrency:`Workflow concurrency`,workflowCalls:`Total calls`,agentSettingsSetupHint:`Agent changes are applied through /openpi-setup in the current session.`,setupRequestLimits:`Set workflow concurrency to {{concurrency}} and total agent calls to {{calls}}. Preserve other settings.`,setupRequestEnableSuggestions:`Enable next-action suggestions. Help me choose a model if required; preserve other settings.`,setupRequestDisableSuggestions:`Disable next-action suggestions. Preserve other settings.`,setupRequestPostEdit:`Help me configure or disable the post-edit command. Show the current configuration and ask which command to use.`,configurePostEdit:`Configure post-edit command`,workflowLimitsValue:`{{concurrency}} concurrent · {{calls}} total calls`,nextActionSuggestions:`Next-action suggestions`,nextActionSuggestionsDetail:`Offer a few useful next actions when the current task finishes.`,enabled:`Enabled`,disabled:`Disabled`,configured:`Configured`,postEditCommand:`Post-edit command`,postEditCommandDetail:`Run a command after edits. Nothing runs while this is off.`,resultDisplay:`Default result display`,subagentResults:`Subagent results`,bashOperations:`Bash operations`,fileMutations:`Write / Edit operations`,footer:`Footer`,terminalFooter:`Pi terminal footer`,terminalFooterStyle:`Terminal footer style`,terminalFooterHint:`Applies to Pi's command-line interface. An already open Pi interface updates when restarted or when setup is applied.`,detailDisplay_full:`Full`,detailDisplay_compact:`Compact`,sessionSettings:`Session`,currentModel:`Current`,providerCurrentSessionModel:`This conversation uses {{model}}.`,useThisModel:`Use model`,model:`Model`,modelConnection:`Model connection`,provider:`Provider`,modelId:`Model ID`,providerStatusUnavailable:`This provider is not present in the bounded authentication snapshot.`,providerSettings:`Provider credentials`,providerSettingsIntro:`Inspect which Pi providers can authenticate the current Web session.`,openRuntimeDetails:`Open runtime details`,currentWorkspace:`Current workspace`,providerAuth_api_key:`API key`,providerAuth_oauth:`OAuth`,providerAuthUnknown:`Authentication method not reported`,authentication:`Authentication`,accessType:`Access`,providerAccessSubscription:`Subscription account`,providerAccessStandard:`Provider credentials`,configurationOwner:`Configuration owner`,providerLoading:`Loading provider status…`,providerLoadFailed:`Could not load provider status.`,providerReadOnly:`Managed by Pi`,selectProvider:`Select a provider`,gitReviewBaselineUnavailable:`No usable session baseline was retained (it may exceed the capture limit). Choose Unstaged, Staged or Branch to inspect Git changes, or open the session file records.`,modelsIntro:`Sign in with an account or add an API key. Your existing Pi connections are available here.`,modelConnectionsTitle:`Model connections`,modelConnectionsIntro:`Manage credentials and choose models for new and current chats.`,accountLoginMethod:`Connection method`,accountLoginTab:`Account`,accountLoginChatGPT:`ChatGPT account`,accountLoginClaude:`Claude account`,accountLoginKeyTab:`API key`,accountLoginConfigured:`Account signed in`,accountLoginIntro:`Continue in your browser. No API key needed.`,accountLoginExisting:`Your account credential is saved in Pi.`,accountLoginStart:`Sign in`,accountLoginAgain:`Sign in again`,accountLoginUnsaved:`Save or discard your other changes before signing in.`,accountLoginStarting:`Preparing sign-in…`,accountLoginWaiting:`Waiting for authorization`,accountLoginChoose:`Choose how to sign in`,accountLoginCancelling:`Cancelling sign-in…`,accountLoginBrowser:`Continue in browser`,accountLoginDevice:`Use a device code`,accountLoginBrowserOption:`Sign in on this computer. Returns here automatically.`,accountLoginDeviceOption:`For remote servers or when browser sign-in is unavailable.`,accountLoginBrowserHelp:`Open the sign-in page and approve access. This page updates automatically.`,accountLoginDeviceHelp:`Open the authorization page and enter this code. Keep this page open.`,accountLoginOpen:`Open sign-in page`,accountLoginCopyCode:`Copy device code`,accountLoginPaste:`Authorization code or callback URL`,accountLoginContinue:`Continue`,accountLoginFallback:`Signed in but still waiting?`,accountLoginRemoteHelp:`If automatic return does not work, copy the final callback URL from your browser and paste it here.`,accountLoginCancel:`Cancel sign-in`,accountLogin_failed:`Sign-in failed. Try again or choose another method.`,accountLogin_expired:`Sign-in expired. Start again to get a new authorization link.`,accountLogin_cancelled:`Sign-in cancelled.`,accountLoginRequestFailed:`The request did not complete. Refresh status before retrying.`,accountLoginStatusUnknown:`Cannot check sign-in status. Your authorization may still be in progress.`,accountLoginRefreshRequired:`The credential was saved, but Pi could not update its model list. Reload Pi before using this connection.`,accountLogout:`Sign out`,accountLogoutRefreshRequired:`The saved credential was removed, but Pi could not update its model list. Reload Pi to refresh the status.`,accountLogoutTitle:`Sign out of {{provider}}?`,accountLogoutDetail:`Removes this provider’s saved credential from Pi on this machine. Other Pi sessions using it will also need to sign in again. Environment credentials are unchanged.`,providerInputTypes:`Input types`,providerInputText:`Text`,providerInputImage:`Images`,providerCustomTag:`Custom`,providerEdit:`Edit`,providerRemove:`Delete`,providerSave:`Save`,editProvider:`Edit {{provider}}`,removeProvider:`Delete {{provider}}`,providerAdd:`Add model provider`,providerAddMode:`How to add`,providerAddCatalog:`Third-party providers`,providerAddCustom:`Custom model API`,providerAccountHint:`Use an existing account to connect. Choose a provider and continue in your browser.`,providerCatalogHint:`Choose a provider from the built-in catalog and enter its API key.`,providerCustomHint:`Connect a gateway or self-hosted service using an OpenAI or Anthropic compatible API.`,providerKeyKeep:`Leave blank to keep the existing key`,providerKeyOptional:`Enter an API key, or leave blank to use environment authentication`,providerDisplayName:`Provider name`,providerCustomSettings:`Custom settings`,providerSaved:`Saved {{provider}}.`,modelDefaultTitle:`Default for new chats`,modelDefaultChoose:`Choose model`,modelDefaultBadge:`Default`,modelCurrentBadge:`In use`,modelDefaultNotSet:`Not set · Pi chooses when a new chat starts`,modelDefaultHint:`Choose the model for future chats. Existing chats keep their own model. This also updates Pi's default.`,modelDefaultReadFailed:`Could not read the default model.`,modelDefaultProjectOverride:`This workspace has a Pi override: {{model}}.`,modelDefaultSave:`Save default`,modelMakeDefault:`Also make this the default for new chats`,modelDefaultSaveFailed:`The default was not confirmed. Refresh status and try again.`,modelDefaultPartial:`The chat model changed, but saving the default was not confirmed. Refresh status before retrying.`,modelConnectionNextHint:`Choose a model from this connection to use in the current chat.`,modelConnectionSearch:`Search models…`,modelConnectionChooseProvider:`Choose a model from {{provider}}`,modelConnectionUse:`Use in this chat`,modelConnectionUseFailed:`The model change was not confirmed. Refresh the model list and try again.`,modelConnectionLoadFailed:`Could not load models.`,modelConnectionNoModels:`No selectable models yet. Check the connection or add a model definition.`,modelConnectionNoMatch:`No matching models.`,modelConnectionMore:`{{count}} more models. Search to narrow the list.`,providerModelsEmpty:`No models yet. Fetch available models or add one manually.`,providerModelsInherited:`Uses the provider’s built-in model catalog.`,providerModelsReadOnly:`This provider contains model settings that must be edited in Pi’s configuration file.`,providerModelId:`Model {{number}} ID`,providerModelName:`Model {{number}} name`,providerModelDetails:`Model details: {{model}}`,providerRemoveModel:`Remove model: {{model}}`,providerIdInvalid:`Use a unique provider ID with letters, numbers, hyphens, dots or underscores.`,providerNativeAuth:`This provider uses Pi’s native sign-in.`,providerConfigurationFailed:`Could not save. Check the fields and retry when the session is idle.`,providerProfileSavedKeyFailed:`The provider was saved, but its API key was not. Retry saving the key.`,providerReload:`Discard draft and reload`,providerCurrentRemoval:`Select another model before removing the model currently in use.`,providerRemoveDetail:`Remove this provider’s configuration and custom models? Credentials managed by Pi are kept.`,providerPickerIntro:`Select the models you want to add from this provider.`,providerPickerSelected:`{{count}} selected`,providerApiKey:`API key`,providerKeyPlaceholder:`Paste a key to add or replace it`,saveProviderKey:`Save API key`,savingSettings:`Saving…`,keepEditing:`Keep editing`,discardAndContinue:`Discard and continue`,unsavedSettingsTitle:`Discard unsaved changes?`,unsavedSettingsDetail:`Unsaved model and credential changes will be lost.`,unsavedCredentialTitle:`Discard the unsaved credential?`,unsavedCredentialDetail:`The new key has not been saved and will be cleared.`,modelSelectionBusy:`This session is busy. Model changes are unavailable.`,providerKeySaved:`Saved to Pi credentials. Existing keys are never displayed.`,providerSaveFailed:`Credential save did not complete. Wait until the session is idle, refresh status and retry. Some providers need additional authentication settings.`,providerWriteDetail:`Save API keys here directly to Pi. Keys never enter a model conversation. For OAuth or additional provider fields, use Pi's native login.`,editModelConfiguration:`Add or edit a custom model`,modelConfigurationDetail:`Set up a provider connection, then choose available models or add one manually. Saving does not send a model request.`,configuredModels:`Custom model configuration`,addModel:`Add a model`,modelConfig_provider:`Provider ID`,modelConfig_id:`Model ID`,modelConfig_name:`Display name`,modelConfig_baseUrl:`API base URL`,modelConfig_api:`API format`,modelConfig_contextWindow:`Context window`,modelConfig_maxTokens:`Max output tokens`,providerCapacityLabel:`{{field}} {{number}}`,providerModelOptions:`Model options`,providerModelInvalid:`Model {{number}}: use a unique model ID and positive token counts, such as 128K or 1M. Leave capacities blank to use defaults.`,modelConfig_reasoning:`Supports reasoning`,saveModelConfiguration:`Save model`,reloadModelConfiguration:`Discard draft and load latest`,retryModelConfiguration:`Retry loading`,discardModelDraftTitle:`Discard this model draft?`,discardModelDraftDetail:`The latest configuration will replace this unsaved draft.`,discardAndReload:`Discard and reload`,modelConfigurationUnsaved:`Unsaved changes`,modelConfigurationConflict:`Model configuration changed elsewhere. Your draft is unchanged.`,modelConfigurationLoadFailed:`Could not load model configuration. Your draft is unchanged.`,modelConfigurationSaved:`Saved to Pi models.json. Configure the provider API key to make this model available.`,modelConfigurationFailed:`Model save did not complete. Your draft is unchanged.`,setupConfigurationRequest:`Configuration request`,configureViaSetup:`Apply via OpenPI setup`,setupFormDetail:`Uses /openpi-setup. Follow progress and any required confirmation in the conversation; submission does not mean the configuration is saved.`,setupSkillsPlaceholder:`Describe the skill to add or configure, including its source or local path`,setupPluginsPlaceholder:`Describe the Pi package to configure, including its exact package name or local path`,enableSkillInvocation:`Allow model invocation`,disableSkillInvocation:`Require explicit invocation`,setupSkillInvocationRequest:`Configure this Pi skill: {{path}}. Set its native disable-model-invocation field to {{disabled}}. Preserve other content and explain when the change takes effect.`,setupRoleFormRequest:`Configure the OpenPI {{role}} role to use {{model}} and set workflow concurrency to {{concurrency}}. Inherit parent thinking, validate the selection and preserve unrelated configuration.`,providerReadOnlyDetail:`This page is read-only and never receives credential values. Configure provider authentication through Pi, then refresh this status.`,openProviderSettings:`Open provider settings`,credentialConfigured:`Configured`,credentialMissing:`Not configured`,authNotVerified:`Configured credentials do not guarantee a successful model request.`,configurationViaPi:`Read-only status. Manage model credentials and trust through Pi; manage OpenPI options with /openpi-setup.`,noSkillsFound:`No skills are loaded for this Session.`,addSkill:`Add skill`,addPlugin:`Add plugin`,searchResources:`Search by name or source`,filterResourceScope:`Resource scope`,allResourceScopes:`All scopes`,noMatchingResources:`No matching resources`,resourceBulkTooLarge:`Filter the list further before submitting a bulk request.`,resourceManagement:`Pi resources`,resourceSourceAuto:`Pi automatic discovery`,resourceSourceLocal:`Local resource`,resourcePackageSource:`Package, repository or local path`,resourcePackageSourcePlaceholder:`npm:package@version · git:owner/repo · /path/to/skill`,resourceInstallIntro:`Choose a source and scope. OpenPI setup will review and apply the request in the conversation.`,resourceInstallReview:`Review the exact source and permissions in the conversation. Submitting this request does not mean it is installed or loaded.`,resourceRequestSubmitted:`Request submitted. Follow progress and confirmations in the conversation, then refresh this catalog.`,browseSkills:`Browse skills.sh`,resourceSessionState:`Apply to this Session`,resourcesReloadNote:`Refresh reads the catalog. Reload applies saved resources to this idle Session; changes are never reloaded automatically.`,reloadResources:`Reload resources`,resourceReloadReview:`Apply saved Pi skill and plugin configuration and restart extensions in the current Session? Wait for running work to finish first.`,resourceReloaded:`Resources reloaded. Review the refreshed catalog and diagnostics.`,resourceReloadFailed:`Could not reload resources. Wait for this Session to become idle and refresh before retrying.`,advancedResourceConfiguration:`Advanced configuration`,resourceDiagnostics:`Pi reports {{extensionErrors}} extension diagnostics and {{skillErrors}} skill diagnostics.`,resourceConfigurationDiagnostics:`{{count}} settings files could not be read. Review Pi configuration diagnostics.`,resourceCatalogTruncated:`This catalog is bounded; some resources are omitted.`,resourceTargetTruncated:`This source or path is truncated. Confirm the full target through Advanced configuration before making changes.`,updateResource:`Review update`,removeResource:`Review removal`,skillsEmptyTitle:`Add your first skill`,skillsEmptyIntro:`Skills give Pi reusable instructions. Add a package, repository or local skill; project skills follow Pi project trust.`,pluginsEmptyTitle:`Extend Pi with a plugin`,pluginsEmptyIntro:`Packages can include extensions, skills, prompts and themes. Add a source to review its installation through OpenPI setup.`,pluginCount:`{{count}} plugin sources`,installedVersion:`Installed version`,configuredVersion:`Configured version`,resourceVersionUnpinned:`Not pinned / local source`,pluginState_loaded:`Session resources loaded`,pluginState_installed:`Installed · not loaded`,pluginState_disabled:`Disabled in configuration`,pluginState_missing:`Package missing`,pluginState_error:`Load diagnostics`,pluginState_notLoaded:`Not loaded`,pluginLoadedResources:`{{count}} resources in this Session's catalog. Configuration changes require an explicit reload.`,pluginAction_enable:`Review enable`,pluginAction_disable:`Review disable`,pluginAction_update:`Review update`,pluginAction_remove:`Review removal`,enableVisibleSkills:`Allow model use ({{count}} shown)`,disableVisibleSkills:`Explicit use only ({{count}} shown)`,enableVisiblePlugins:`Enable {{count}} shown packages`,disableVisiblePlugins:`Disable {{count}} shown packages`,setupResourceInstallRequest:`Add these Pi {{kind}} from source {{source}} in scope {{scope}}. Inspect the source and resolve a fixed package identity, review required installation permissions with me using ask_user, then use Pi's native package/skill configuration. For a skill request, preserve unrelated extensions and other resources. Preserve existing preferences and project trust; do not reload this Session automatically. Report saved configuration and any remaining action separately. Do not change unrelated OpenPI settings.`,setupPluginOperationRequest:`Review Pi package action {{action}} for exactly configured source {{source}}, native root {{path}}, scope {{scope}}. Resolve relative sources against the native scope's settings directory. Use Pi's native package management. For updates, inspect available versions and review a fixed target identity and required permissions with me using ask_user before installing. Preserve resource filters and all unrelated preferences; if a toggle would destroy filters, stop and explain. Removal must not delete a local source directory. Do not reload automatically. Report persisted and active states separately; do not change unrelated OpenPI settings.`,setupSkillManageRequest:`Review Pi skill action {{action}} for exactly file {{path}}, source {{source}}, scope {{scope}}. Inspect native ownership first. Review the update/removal and required permissions with me using ask_user. Preserve unrelated skills and package resources; do not remove an entire shared package to remove one skill. Preserve project trust and do not reload automatically. Do not change unrelated OpenPI settings.`,setupSkillsBulkRequest:`For exactly these currently displayed Pi skill files {{paths}}, set native disable-model-invocation to {{disabled}}. Inspect ownership, preserve all other content and preferences, review necessary changes with me, and report any files that cannot be changed safely. Explicit /skill invocation remains available. Do not reload automatically or change unrelated OpenPI settings.`,setupPluginsBulkRequest:`For exactly these currently displayed Pi packages {{packages}}, set disabled to {{disabled}} through native Pi configuration. Preserve all other preferences and resource filters; skip and report entries whose filters cannot be preserved. Respect scope and project trust, review necessary changes with me, and do not reload automatically or change unrelated OpenPI settings.`,resourceRequestFinished:`The setup turn has ended. Refresh and inspect Pi's configuration and Session resources to confirm what changed.`,skillCount_one:`{{count}} skill`,skillCount_other:`{{count}} skills`,skill:`Skill`,copySkillInvocation:`Copy invocation`,source:`Source`,scope:`Scope`,invocation:`Invocation`,modelInvocation:`Model invocation`,resourceScope_user:`Global`,resourceScope_project:`Project`,resourceScope_temporary:`Temporary`,explicitOnly:`Explicit invocation only`,availableToModel:`Available to the model`,skillFile:`Skill file`,selectSkill:`Select a skill`,subagentConfiguration:`Pi-native subagent roles`,subagentConfigurationIntro:`Role models inherit from the parent unless OpenPI setup assigns an available model.`,subagentActiveCount_one:`{{count}} active`,subagentActiveCount_other:`{{count}} active`,subagentCompletedCount_one:`{{count}} recorded`,subagentCompletedCount_other:`{{count}} recorded`,subagentConcurrency:`Limit {{count}}`,builtInRoles:`Built-in roles`,subagentRole_explorer:`Explorer`,subagentRole_implementer:`Implementer`,subagentRole_reviewer:`Reviewer`,subagentRole_advisor:`Advisor`,subagentRoleShort_explorer:`Read-only investigation`,subagentRoleShort_implementer:`Focused implementation`,subagentRoleShort_reviewer:`Correctness review`,subagentRoleShort_advisor:`Technical analysis`,subagentRoleDescription_explorer:`Explores the codebase and reports evidence without modifying files.`,subagentRoleDescription_implementer:`Implements a bounded change and runs the relevant repository checks.`,subagentRoleDescription_reviewer:`Reviews correctness, safety, regressions, and missing validation.`,subagentRoleDescription_advisor:`Analyzes difficult technical questions and recommends a concrete next step.`,configureRoles:`Configure roles`,builtInRole:`Built-in role`,builtIn:`Built-in`,modelAssignment:`Model assignment`,inheritParentModel:`Inherit parent model`,effectiveModel:`Effective model`,workflowConcurrencyLabel:`Concurrent agents`,workflowCallLimit:`Total agent calls`,runtimeBoundaries:`Runtime boundaries`,subagentAuthorityNote:`Child authority is the fail-closed intersection of the parent Session and role capabilities.`,subagentModelNote:`No hardcoded provider is introduced; an unassigned role follows the parent model and thinking level.`,resourceCount_one:`{{count}} resource`,resourceCount_other:`{{count}} resources`,noPluginsFound:`No loaded plugin sources were reported.`,pluginCatalogTotals:`{{extensions}} ext · {{skills}} skills · {{prompts}} prompts · {{themes}} themes`,loaded:`Loaded`,resourceOrigin:`Origin`,resourceOrigin_package:`Package`,resourceOrigin_topLevel:`Top-level resource`,resources:`Resources`,baseDirectory:`Base directory`,notReported:`Not reported`,extensions:`Extensions`,extensionSurfaceCount:`{{tools}} tools · {{commands}} commands`,prompts:`Prompts`,themes:`Themes`,pluginResourceSummary:`{{extensions}} ext · {{skills}} skills · {{prompts}} prompts · {{themes}} themes`,pluginsManagedByPi:`These resources are loaded by Pi. Submit changes using the setup form above. Package changes follow native confirmation and take effect through Pi's reload lifecycle.`,selectPlugin:`Select a plugin source`,statusCaptured:`Snapshot at {{time}} · refresh for the latest state`,conversationViews:`Conversation views`,currentConversations:`Current`,archivedConversations:`Archived`,refreshArchives:`Refresh archived conversations`,loadingArchives:`Loading archived conversations...`,moreArchives:`Load more archived conversations`,retryArchives:`Retry archived conversations`,archiveLoadFailed:`Could not load archived conversations.`,archiveCursorStale:`Archived conversations changed. Refresh to continue.`,archiveScanBounded:`{{count}} older records have not been scanned.`,noArchivedSessions:`No archived conversations.`,noScannedArchives:`No archived conversations in the scanned history.`,noMatchingScannedArchives:`No matching archived conversations in the scanned history.`,draftLimit:`Draft storage is full. Send or clear an existing draft before adding more content.`,restoreConversation:`Restore conversation`,restoringConversation:`Restoring…`,loadedArchives:`Archived conversations in the loaded history`,loadedHistoryBounded:`{{sessions}} more sessions and {{workspaces}} workspace summaries are not loaded. Search covers the loaded list only.`,noLoadedArchives:`No archived conversations in this loaded list.`,restoreFailed:`Could not confirm restoration. Refresh and try again.`,execution_running:`Running`,execution_done:`Completed`,execution_killed:`Stopped`,execution_timed_out:`Timed out`,execution_failed:`Failed`,execution_uncertain:`Uncertain`,activeOnlyHint:`Only the active Web session accepts messages.`,acceptedHint:`Message accepted by OpenPI Web.`,promptAdmissionUnknown:`It is unclear whether the last message was received.`,promptAdmissionUnknownDetail:`Review the refreshed Session history and runtime status before deciding. Sending as a new message may create a duplicate message.`,promptAdmissionCheckingDetail:`Checking the latest Session history and runtime status before resend options are enabled.`,promptAdmissionVerificationFailedDetail:`Could not refresh the latest Session history and runtime status. Check again before sending as a new message.`,abandonAdmission:`Don't resend for now`,retryAdmissionCheck:`Check again`,retryOriginalAdmission:`Retry original message`,promptTooLong:`Message exceeds the send limit ({{count}} / {{limit}}).`,sendAsNew:`Send as new message`,sendingAsNew:`Sending…`,stopTurn:`Stop current turn`,stoppingTurn:`Stopping current turn…`,stoppedTurn:`Current turn stopped.`,pendingFollowUpsHint:`{{count}} messages queued`,sendNextTurn:`Send next turn`,followUpBehavior:`Follow-up behavior`,followUpBehaviorDetail:`While OpenPI is running, queue new messages for the next turn or guide the current turn. Press ⌘/Ctrl+Enter to use the other option once.`,followUpQueue:`Queue`,followUpQueueDetail:`Next turn`,followUpSteer:`Steer`,followUpSteerDetail:`Current turn`,steerCurrentTurn:`Steer current turn`,steeringHint:`Use this instruction after the current tool step finishes.`,pendingSteeringHint:`{{count}} instructions received; waiting for the current tool step`,steeringMessagesTitle:`Pending instructions for this turn`,steerStaleTurn:`That turn has ended or changed. Your draft is kept. Check the updated status and send again.`,sourceFeedbackNew:`{{path}} · new line {{line}}`,sourceFeedbackOld:`{{path}} · old line {{line}}`,forkMessage:`Fork from here`,forkMessageHint:`Create a new conversation from this message. Keep the original conversation; no message is sent.`,forkSessionPending:`Creating a fork…`,forkSessionCreated:`Fork created. The original conversation remains in the sidebar.`,forkSessionCancelled:`Fork cancelled. The original conversation is kept.`,forkSessionUncertain:`The fork could not be confirmed. Refresh and inspect your conversations before trying again.`,forkSessionUnavailable:`Switch to this conversation and let its current work and queued messages finish before forking.`,reviewQuoteLine:`Reference this line`,reviewSelectOldLine:`Select old line {{line}}`,reviewSelectNewLine:`Select new line {{line}}`,queuedMore:`{{count}} more queued`,queuedImage:`Image attachment`,queuedMessageExpand:`Expand queued message`,queuedMessageCollapse:`Collapse queued message`,backgroundSessionRunning:`This session is running in the background…`,observedSessionTools:`{{count}} active tools`,toolsRequireCurrentSession:`Switch to this session to use interactive tools.`,activateViewedSession:`Switch to this session`,activateViewedSessionHint:`Send a message to continue this conversation.`,addWorkspace:`Add workspace`,addWorkspaceMenu:`Add workspace...`,archiveConversation:`Archive conversation`,pinnedConversations:`Pinned`,sidebarOptions:`Sidebar options`,sidebarProjectOptions:`Project sidebar options`,sidebarRecentOptions:`Chat sidebar options`,sidebarActivityOptions:`Activity view options`,sidebarShow:`Show`,sidebarGroupBy:`Group conversations`,sidebarByProject:`By project`,sidebarFlatList:`All conversations`,sidebarChatSort:`Conversation order`,sidebarRecent:`Recent`,sidebarProjectsInRecents:`Show projects in Recent`,sidebarShowMore:`Show more`,sidebarShowLess:`Show less`,sidebarFilterList:`Filter this list`,sidebarSaveFailed:`Could not save the change. Please try again.`,pinWorkspace:`Pin project`,unpinWorkspace:`Unpin project`,markConversationRead:`Mark as read`,markConversationUnread:`Mark as unread`,sidebarState_unread:`Unread conversation`,sidebarActivity:`Activity`,sidebarViewActivity:`View activity`,sidebarViewChats:`View conversations`,sidebarPriority:`Priority`,sidebarActivityEmpty:`Nothing needs attention`,sidebarActivityEmptyHint:`Completed work and conversations needing your attention appear here.`,sidebarMarkAllRead:`Mark all as read`,sidebarClearRead:`Clear read chats from Priority`,sidebarReadFailed:`Could not update read status. Please try again.`,sidebarToday:`Today`,sidebarYesterday:`Yesterday`,sidebarEarlier:`Earlier`,sidebarActivityCompleted:`Completed`,sidebarActivityFailed:`Failed`,sidebarActivityRead:`Read`,modelAdvanced:`Advanced parameters`,providerConnectionHeading:`Provider connection`,providerFetchModels:`Get available models`,providerFetchHint:`Enter the provider and endpoint, then choose models in one step.`,providerPickerTitle:`Choose models to add`,providerPickerAccess:`Connection credentials`,providerPickerKey:`Access key (optional)`,providerPickerKeyHint:`Leave blank to use saved credentials for this endpoint. A key entered here is used for discovery only and is not saved.`,providerPickerSearch:`Search models`,providerPickerSelectAll:`Select all`,providerPickerClear:`Clear selection`,providerPickerLoading:`Reading available models…`,providerPickerAdded:`Added`,providerPickerNoMatch:`No matching models`,providerPickerEmpty:`No models returned. You can still add one manually.`,providerPickerBounded:`Showing the first 500 models. Add other IDs manually.`,providerPickerError_load:`Could not read the model list. Check the endpoint and credentials, then retry or add a model manually.`,providerPickerError_save:`Could not confirm the save. Your selection is kept; check the connection before retrying.`,providerPickerError_conflict:`Configuration changed elsewhere. Close this dialog and reload configuration before saving again.`,providerPickerDefaults:`New models use {{context}} context / {{output}} output tokens. You can adjust these per model after adding.`,providerPickerRetry:`Refresh list`,providerPickerCount:`{{count}} selected · up to 100`,providerPickerSave:`Add selected`,sidebarState_running:`Running`,sidebarState_compacting:`Organizing context`,sidebarState_waiting:`Waiting for your response`,sidebarState_completed:`Completed · unread result`,sidebarState_failed:`Failed · open conversation for details`,pinnedOptions:`Pinned options`,pinConversation:`Pin conversation`,unpinConversation:`Unpin conversation`,pinnedRecentlyUpdated:`Recently updated`,pinnedManualOrder:`Manual order`,movePinUp:`Move up`,movePinDown:`Move down`,pinSaveFailed:`Could not save pinned conversations. Please try again.`,cancel:`Cancel`,chooseWorkspaceHint:`Choose a workspace and describe the work`,close:`Close`,closeSearch:`Close search`,collapseSidebar:`Collapse sidebar`,confirmEdit:`Save and rerun`,editMessageHint:`Rerun from here in a new branch. Keep the original conversation, images and file references. Existing workspace changes are kept.`,regenerateMessage:`Regenerate response`,regenerateMessageHint:`Rerun this question in a new branch, keeping its original attachments and conversation.`,messageRerunStarted:`Rerun admitted in a new branch. The original conversation is kept.`,openOriginalConversation:`View original conversation`,messageRerunWorkspaceHint:`Existing workspace changes are kept.`,modelRequestRecovered:`Request recovered`,modelReconnecting:`Reconnecting`,modelReconnectUnknown:`Reconnection status unconfirmed`,modelEarlierAttempts:`Earlier request errors`,modelFailedAttempts:`Failed attempts ({{count}})`,draftStorageUnavailable:`Draft could not be saved on this device. Keep this page open or copy your message.`,draftStorageInvalid:`Some saved draft content could not be restored. Check your message and attachments.`,draftStorageRetry:`Retry saving draft`,workbarBackToChat:`Back to chat`,workbarCollapseTools:`Collapse tools`,workbarEndTerminal:`Close {{name}} and end its process`,workbarNewTerminal:`New terminal`,workbarContinueInChat:`Continue in chat`,transcriptSearch:`Search message contents`,transcriptSearchPlaceholder:`Search titles, projects, or messages…`,transcriptSearchRecent:`Recent conversations`,transcriptSearchSessions:`Conversations`,transcriptSearchMessages:`Message contents`,transcriptSearchSessionResult:`Open conversation {{session}}`,transcriptSearchSessionOpenFailed:`Could not open this conversation. Try again.`,transcriptSearchIncludeArchived:`Include archived conversations`,transcriptSearching:`Searching messages…`,transcriptSearchEmpty:`No matching messages found.`,transcriptSearchFailed:`Could not search messages. Try again.`,transcriptSearchRetry:`Retry search`,transcriptSearchPartial:`Some history could not be searched. Results may be incomplete.`,transcriptSearchOpenFailed:`This message could not be opened. It may have moved or belong to another branch.`,transcriptSearchResult:`Open message from {{source}} in {{session}}`,transcriptSearchSource_user:`you`,transcriptSearchSource_assistant:`assistant`,transcriptSearchSource_tool_call:`tool call`,transcriptSearchSource_tool_result:`tool output`,connected:`Connected`,connecting:`Connecting`,conversationName:`Conversation name`,conversationOptions:`Conversation options`,sidebarRename:`Rename`,sidebarPin:`Pin`,sidebarUnpin:`Unpin`,sidebarFork:`Fork`,sidebarForkLocal:`Fork chat`,sidebarForkSameWorktree:`Fork in same worktree`,archiveNoticeTitle:`Chat archived`,archiveNoticeView:`View`,archiveNoticeUndo:`Undo`,archiveNoticeFailed:`Could not complete this action. Try again.`,sidebarForkWorktree:`Fork chat in new worktree`,sidebarForkCancelling:`Requesting cancellation…`,sidebarForkFinishing:`Cancellation is no longer available. Confirming the result…`,sidebarForkCancelUnconfirmed:`Cancellation could not be confirmed. Waiting for the fork result.`,sidebarForkWorktreePreserved:`The worktree was kept at {{path}}. Inspect it before retrying.`,sidebarForkWorktreePending:`Creating a worktree and conversation…`,sidebarForkOptionsLoading:`Checking worktree availability…`,sidebarForkOptionsFailed:`Unable to check worktrees. Reopen menu to retry.`,sidebarForkUnavailable:`Send a message before forking this conversation.`,sidebarForkArchived:`Restore this conversation before forking.`,sidebarForkFailed:`Could not create the fork. The original conversation is unchanged.`,sidebarCopy:`Copy`,sidebarCopyLink:`Copy conversation link`,sidebarCopyMarkdown:`Copy as Markdown`,sidebarCopyCwd:`Copy working directory`,sidebarCopied:`Copied`,sidebarCopyFailed:`Could not copy. Try again.`,sidebarNewWindow:`Open in new window`,sidebarOpenIn:`Open in`,sidebarAppsLoading:`Loading available apps…`,sidebarAppsFailed:`Unable to load apps. Reopen menu to retry.`,sidebarOpenFailed:`Unable to open this project in the selected app.`,sidebarArchive:`Archive`,sidebarRestore:`Restore`,sidebarDelete:`Permanently delete`,managedWorktreeRecoveryFull:`Check earlier unfinished removal requests before starting another.`,managedWorktreesChanged:`The worktree list changed. Refresh it before reviewing a target.`,managedWorktreesRefresh:`Refresh worktrees`,managedWorktreesBack:`Back to worktrees`,managedWorktreesRetry:`Retry request`,managedWorktrees:`Retained worktrees`,managedWorktreesDescription:`Worktrees created by OpenPI are kept when a conversation is deleted. Review an exact path before requesting removal. Active, shared, changed or unverified worktrees stay in place.`,managedWorktreeConfirm:`Remove this managed worktree? The server rechecks ownership, active conversations and local changes before removal.`,managedWorktreeRemoved:`Worktree removed.`,managedWorktreePreserved:`Worktree kept:`,managedWorktreeUncertainTerminal:`Removal outcome is uncertain. Automatic removal cannot be repeated. Inspect the retained path before taking further action.`,managedWorktreeUncertain:`Removal outcome is unknown. Retry to check the original request.`,managedWorktreeRemoving:`Checking and removing…`,managedWorktreeRemove:`Remove worktree`,managedWorktreeReview:`Review removal`,managedWorktreesEmpty:`No managed worktrees were found on this page.`,managedWorktreesUnavailable:`{{count}} ownership records could not be verified.`,managedWorktreesLoadFailed:`Could not load retained worktrees. Retry without changing the target.`,managedWorktreesMore:`Load more worktrees`,managedWorktreeRetainedAfterDelete:`Conversation deleted. Worktree kept at {{path}}. Review retained worktrees in the project menu.`,sidebarDeleteTitle:`Delete conversation?`,sidebarDeleteDescription:`Permanently delete “{{name}}”? This cannot be undone.`,sidebarDeleteConfirm:`Delete`,sidebarDeleting:`Deleting…`,sidebarDeleteFailed:`Could not delete this conversation. Retry or cancel.`,sidebarActionRunning:`Let current work and queued messages finish first.`,sidebarActionDisconnected:`Reconnect before changing this conversation.`,sessionDeleteCancelled:`Deletion cancelled`,sessionDeleteUncertain:`Could not confirm whether the conversation was deleted. Refresh and try again.`,sessionDeleted:`Conversation permanently deleted`,sessionDeleteMetadataPending:`The conversation was deleted, but its sidebar records could not be fully cleared.`,sessionLinkUnavailable:`The linked conversation no longer exists or its identity has changed.`,sidebarDropPin:`Drop here to pin`,sidebarDropProjectLast:`Move project to the end`,conversationTurns:`Conversation turns`,conversationTurnPosition:`Go to turn {{position}}`,turnPreviewLoading:`Loading preview…`,turnPreviewUnavailable:`Preview unavailable. Try again.`,commands:`Slash commands`,addContext:`Add context`,fileReference:`Reference workspace file`,fileReferenceTitle:`Reference workspace file`,fileReferenceDetail:`Add a path reference to the prompt without uploading file contents.`,fileReferenceLabel:`Workspace file path`,fileReferencePlaceholder:`src/app.tsx`,fileReferenceValidatedHint:`The current Session verifies that this is a readable workspace file.`,fileReferenceDraftHint:`This path will be resolved by Pi after the new Session starts.`,fileReferenceChecking:`Checking…`,fileReferenceFailed:`Could not verify this file.`,fileReferenceDenied:`Choose a file inside the current Session workspace.`,fileReferenceMissing:`This workspace file no longer exists.`,fileReferenceUnsupported:`Only regular workspace files can be referenced.`,fileReferenceExpired:`The active Session changed. Reopen the file reference and try again.`,fileReferenceBusy:`File validation is busy. Try again shortly.`,insertReference:`Insert reference`,commandsSessionRequired:`Slash commands are available after the Session starts.`,commandsEmptyDraftOnly:`Slash commands can be inserted only into an empty draft.`,commandsLoading:`Loading commands...`,commandsUnavailable:`Commands are temporarily unavailable.`,commandsNoMatch:`No matching commands.`,commandsNoAvailable:`No discovered commands can run in Web. Type a command name to inspect its availability.`,commandsBounded:`{{count}} more commands are not shown.`,commandSessionRequired:`Commands require an active Web session.`,commandUnsupported:`Not adapted · manual commands still reach Pi`,commandAcceptsArguments:`Accepts arguments`,commandSource_extension:`Extension`,commandSource_prompt:`Prompt template`,commandSource_skill:`Skill`,copiedMessage:`Copied`,copyMessage:`Copy message`,copyFailed:`Copy failed. Please select and copy the message manually.`,copiedCode:`Code copied`,copyCode:`Copy code`,copyCodeFailed:`Could not copy this code. Select and copy it manually.`,codeBlock:`Code block`,wrapCode:`Wrap lines`,expandCode:`Show all {{count}} lines`,collapseCode:`Collapse code`,expandInput:`Expand input`,collapseInput:`Collapse input`,deleteWorkspace:`Delete workspace`,describeTask:`Describe a task`,editMessage:`Edit and rerun from here`,enterHint:`Enter to send, Shift+Enter for a new line.`,expandSidebar:`Expand sidebar`,importWorkspace:`Import workspace`,loadingModels:`Loading models...`,modelsTruncated:`Showing {{shown}} models. {{omitted}} more are available; search to find them.`,searchModels:`Search available models`,searchModelsPlaceholder:`Search provider, model name, or ID...`,searchingModels:`Searching models...`,noMatchingModels:`No matching models`,modelSearchFailed:`Could not search models. Try again.`,retryModelSearch:`Retry model search`,fileReferenceDraftChanged:`The draft changed. Reopen the file reference.`,modelSearchTruncated:`{{omitted}} matching models are not shown.`,modelPreparing:`Preparing task...`,modelRetrying:`Retrying model request...`,modelRunning:`Working…`,modelRequestFailed:`Model request failed`,modelRequestStopped:`Model request stopped`,modelFailureUnknown:`The provider did not return an error reason.`,retryPrompt:`Retry prompt`,retryingPrompt:`Retrying...`,newSession:`New session`,noConversations:`No conversations yet`,noMatching:`No matching conversations`,noMatchingLoaded:`No matching conversations in the loaded history`,noModels:`No models available`,noOutput:`no output`,noSessions:`No sessions`,openSidebar:`Open sidebar`,promptMessage:`Send a message or start a task, / for commands`,promptReadonly:`A non-active session cannot receive prompts`,promptStart:`Choose a workspace to begin.`,promptTask:`Describe what you want to build.`,queuedHint:`The message will be queued after the current turn.`,reconnecting:`Reconnecting`,removeWorkspace:`Remove from sidebar`,workspaceOptions:`Workspace options`,renameFailed:`Could not save the name. Your changes were kept.`,savingName:`Saving...`,workspaceRemoveFailed:`Could not remove the workspace. Try again.`,removingWorkspace:`Removing...`,renameConversation:`Rename conversation`,renameWorkspace:`Rename workspace`,save:`Save`,searchConversations:`Search conversations`,searchPlaceholder:`Filter titles and workspaces…`,selectModel:`Select model`,configureModels:`Configure models`,openModelSettings:`Model settings`,selectThinking:`Select thinking level`,thinkingAvailableLevels:`Available: {{levels}}`,resetThinking:`Restore the opening level ({{level}})`,modelThinkingNotEnabled:`Thinking is not enabled for this model. Enable reasoning support in model settings if your provider supports it.`,providerReasoningHint:`Enable only if the provider supports reasoning. Adjust the active level in the composer.`,providerThinkingLevels:`Supported thinking levels`,providerThinkingLevelsHint:`Choose the levels this model supports. Saving updates the conversation picker.`,providerThinkingAutomatic:`Automatic (Pi defaults)`,providerThinkingSelected_one:`{{count}} level selected`,providerThinkingSelected_other:`{{count}} levels selected`,providerThinkingReset:`Use Pi defaults`,providerImageHint:`When Image is unchecked, the model will not receive image attachments.`,selectWorkspace:`Select workspace`,send:`Send`,processDetails:`Execution details`,processRunning:`Working`,processThinkingCount_one:`{{count}} reasoning note`,processThinkingCount_other:`{{count}} reasoning notes`,processToolCount_one:`{{count}} tool call`,processToolCount_other:`{{count}} tool calls`,processFailureCount_one:`{{count}} failed`,processFailureCount_other:`{{count}} failed`,runtimeActivities:`Activity`,activityAgentProgress:`{{completed}}/{{total}} agents finished`,activityCapacity:`Concurrent tasks: {{running}}/{{limit}} · {{queued}} waiting`,composerQueuedCount:`Queued {{count}}`,composerSteeringCount:`Steering {{count}}`,runtimeActivityRunning_one:`{{count}} running`,runtimeActivityRunning_other:`{{count}} running`,runtimeActivityCount_one:`{{count}} activity`,runtimeActivityCount_other:`{{count}} activities`,processActivityCount_one:`{{count}} agent activity`,processActivityCount_other:`{{count}} agent activities`,switchingSession:`Switching session...`,thinkingActive:`Thinking...`,thinkingActiveLevel:`Thinking ({{level}})...`,thinkingDone:`Thinking`,thinkingLoadFull:`Load full thinking`,thinkingLoadingFull:`Loading thinking…`,thinkingLoadFailed:`Unable to load thinking. Retry`,thinkingPartialText:`Showing part of the saved thinking. More text can be loaded below.`,thinkingPreviewOnly:`Thinking preview reached its limit. The full saved text will be available when this message finishes.`,toolState_running:`Running`,toolState_returned:`Returned`,toolState_failed:`Failed`,toolState_cancelled:`Stopped`,toolState_timed_out:`Timed out`,toolState_unknown:`Unconfirmed`,toolSnapshotMissingResult:`No result at fork`,toolActivity_running:`{{action}}…`,toolActivity_failed:`{{action}} failed`,toolActivity_cancelled:`{{action}} stopped`,toolActivity_timed_out:`{{action}} timed out`,toolActivity_unknown:`{{action}}`,toolAction_read:`Read`,toolAction_write:`Write file`,toolAction_edit:`Edit file`,toolAction_command:`Run command`,toolAction_search:`Search`,toolAction_list:`List files`,toolAction_web:`Browse web`,toolAction_agent:`Agent activity`,subagentAction_spawn:`Start subagent`,subagentAction_send:`Send follow-up`,subagentAction_check:`Check subagent`,subagentAction_wait:`Wait for subagent`,subagentAction_cancel:`Stop subagent`,subagentActionDone_spawn:`Started subagent`,subagentActionDone_send:`Sent follow-up`,subagentActionDone_check:`Checked subagent`,subagentActionDone_wait:`Finished waiting`,subagentActionDone_cancel:`Stop request returned`,toolAction_workflow:`Workflow`,toolAction_plan:`Prepare plan`,toolAction_git:`Review changes`,toolAction_call:`Use tool`,toolActionDone_read:`Read`,toolActionDone_write:`Wrote file`,toolActionDone_edit:`Edited`,toolActionDone_command:`Ran command`,toolActionDone_search:`Searched`,toolActionDone_list:`Listed files`,toolActionDone_web:`Browsed web`,toolActionDone_agent:`Agent activity returned`,toolActionDone_workflow:`Workflow tool returned`,toolActionDone_plan:`Plan tool returned`,toolActionDone_git:`Reviewed changes`,toolActionDone_call:`Used tool`,toolActionGroup_read:`read files`,toolActionGroup_write:`write files`,toolActionGroup_edit:`edit files`,toolActionGroup_command:`run commands`,toolActionGroup_search:`search`,toolActionGroup_list:`list files`,toolActionGroup_web:`browse web`,toolActionGroup_agent:`agent activity`,toolActionGroup_workflow:`workflow activity`,toolActionGroup_plan:`planning`,toolActionGroup_git:`review changes`,toolActionGroup_call:`use tools`,toolGroup_done:`Activity · {{actions}}`,toolGroup_running:`Working · {{actions}}`,toolGroup_unknown:`Activity · {{actions}}`,toolGroupSeparator:`, `,toolSearchTarget:`“{{pattern}}” · {{path}}`,toolDiffStatsHelp:`Added and removed lines in the displayed diff`,toolRequestedFile:`File:`,toolWorkspace:`Workspace`,toolRawEvidence:`Arguments and original result`,toolCodemodeDetails:`Script and original result`,toolNestedOutputMissing:`This session records the call and its status, but not the nested tool output.`,toolNestedArgumentsMissing:`This session omits the full arguments and nested tool output.`,toolNestedIncomplete:`The nested-call record is incomplete; some calls, arguments or final states are unavailable.`,toolPartialEvidence:`Partial output: a byte, line or item limit was reached. The original result may also be truncated.`,toolFileChange_created:`File created`,toolFileChange_unchanged:`No content changes`,toolFileChange_overwritten:`File overwritten`,toolChangeUnavailable:`This result does not include a change comparison.`,toolTestResults:`Reported test results · {{format}}`,toolTestCounts:`{{tests}} tests · {{passed}} passed · {{failed}} failed · {{cancelled}} cancelled`,toolTestCountsHelp:`Counts come from command output. The execution status is shown separately.`,toolReadMore:`Read another range using the path and offset. The original result contains continuation details.`,toolFullOutputReference:`Full output:`,subagentBackgroundResult_one:`Background subagent result · {{count}}`,subagentBackgroundResult_other:`Background subagent results · {{count}}`,thinkingDraftHint:`Choose a workspace and create a session first.`,thinkingInactiveHint:`Only the active session can change its thinking level.`,thinkingLevelMismatch:`The confirmed thinking level is not offered by the current model. Choosing another level will correct it.`,thinkingLockedRunning:`Stop the current turn before changing the thinking level.`,thinkingModelPendingHint:`Wait for the model change to finish.`,thinkingNotConfirmed:`Thinking level was not confirmed. Please try again.`,thinkingPendingHint:`Applying the thinking level...`,thinkingUnsupported:`Thinking is unavailable`,thinkingUnsupportedHint:`No model is selected, or the current model does not support thinking.`,unavailable:`Unavailable`,ungrouped:`Ungrouped`,untitledSession:`New session`,workspaceDeleteConfirm:`The folder and conversation records will be kept. Its conversations will move to Ungrouped.`,workspaceName:`Workspace name`,workspaces:`Workspaces`,sidebarProjects:`Projects`}},zh:{translation:{quitOpenPI:`退出 OpenPI`,quittingOpenPI:`正在退出…`,quitConfirmHelp:`确定退出此 OpenPI Web 应用吗?此 Web 应用中所有正在运行的任务都会停止,对话会保存,重启后可继续查看。`,quitTabHelp:`仅关闭浏览器标签页会让 OpenPI 和任务继续在后台运行。`,quitAccepted:`OpenPI 正在关闭`,quitAcceptedHelp:`退出请求已接受。请等待终端确认 OpenPI 已停止,然后可以关闭此标签页。`,quitRestartHelp:`重新启动:在终端运行 openpi web,或在 Pi 中运行 /web,然后打开显示的地址。刷新此页面不会重启 OpenPI。`,quitFailed:`无法确认是否已关闭。请先检查终端,再重试。也可以在 OpenPI 所在终端按 Ctrl+C 停止应用。`,promptPending:`正在处理请求…`,commandFeedbackTruncated:`这里只显示部分命令结果。请缩小查询范围,或在 TUI 查看完整输出。`,planMode_inactive:`普通模式`,planMode_planning:`规划中 · 禁止写入`,planMode_ready:`计划就绪 · 等待审阅`,planMode_invalid:`计划状态异常 · 禁止写入`,planModeEnter:`进入规划`,promptPlanMessage:`本次对话使用 Plan 模式 · 继续讨论计划,暂不实施`,planModeUnconfirmed:`暂时无法确认 Plan 状态,请刷新后再继续。`,planModeExit:`退出规划`,planModeImplement:`准备实施提示`,planImplementationReplaceDraft:`准备实施会替换当前草稿并关闭规划模式,但不会发送提示词。是否继续?`,commandSupport_plan:`支持规划和准备当前会话的实施提示;新建实施会话仍需使用 TUI。`,commandSupport_setup:`通过当前模型配置,在 Web 回答问题。`,handoffWaiting:`需要你操作`,handoffDone:`已完成`,handoffUnable:`无法完成`,handoffDoneHelp:`已执行操作,接下来由模型验证结果。`,handoffUnableHelp:`未能完成,可以补充遇到的障碍。`,handoffReview:`复核状态`,handoffSubmit:`提交状态`,handoffSignal:`预期结果:`,handoffVerify:`提交完成后,模型仍需验证结果;你的反馈本身不代表验证成功。`,planCardLabel:`开发计划`,planCardReady:`计划已就绪`,planCardResult:`计划结果`,planCardNotApproval:`此步骤仅生成计划,不代表已批准或开始实施。`,planCardCollapse:`收起`,planCardExpand:`展开`,planCardCopy:`复制计划`,planCardCopyPreview:`复制可见预览`,planCardTruncated:`当前仅显示截断预览。`,planCardLoadFull:`加载完整计划`,planCardLoadingFull:`正在加载计划...`,planCardLoadFailed:`无法加载完整计划,重试`,planCardEvidence:`工具结果 · plan_ready`,questionWaiting:`问题`,questionPreview:`查看预览`,questionSkip:`跳过`,questionProgress:`{{current}} / {{total}}`,questionReview:`复核答案`,questionReviewTitle:`确认这些选择?`,questionReviewHelp:`可以返回修改,点击提交后才会发送给助手。`,questionEdit:`修改答案:{{question}}`,questionDismiss:`关闭提问,不提交答案`,questionCustom:`或自行撰写回复`,questionCustomHelp:`留空提交,表示希望助手把问题说清楚或拆小。`,questionYourAnswer:`你的答案`,questionCustomPlaceholder:`说说你的想法…`,questionNotes:`补充说明(选填)`,questionNotesPlaceholder:`补充限制条件,或解释你的选择…`,questionRephrase:`请助手把问题说清楚或拆小`,questionBack:`上一步`,questionNext:`下一题`,questionSubmit:`提交答案`,questionSubmitting:`正在提交…`,questionRetry:`核对提交结果`,questionUncertain:`暂时无法确认是否送达,已保留本次提交的答案。点击核对可恢复结果,不会重复提交。`,questionDisconnected:`正在重新连接… 已保留你的选择,暂时无法提交。`,questionLimit:`每项答案或补充说明不能超过 {{count}} 个 UTF-8 字节。`,questionLoadFailed:`暂时无法读取等待回答的问题。`,questionDraftLimit:`提问草稿已达上限,请缩短或清空已有答案后再添加内容。`,questionRetryLoad:`重试`,questionCloseReceipt:`关闭问答状态提示`,questionState_dismissed:`已关闭提问,没有提交答案。`,questionState_cancelled:`提问已取消,没有提交答案。`,questionState_expired:`提问已过期,没有提交答案。`,questionState_stale:`该提问已失效,请查看对话中的处理结果。`,conversationView:`会话视图`,jumpToLatest:`跳至最新`,historyLoading:`正在加载历史…`,historyOmitted:`还有 {{count}} 条较早记录 · 向上滚动自动加载`,historyChanged:`会话分支已更改,已切换到当前分支的历史。`,historyUnavailable:`历史记录加载失败,请重试。`,historyValidationUnavailable:`无法校验会话历史,请重试。`,historyVerifying:`正在校验会话历史…`,messageLoadFull:`加载完整消息`,messageLoadMore:`加载更多`,messageLoadingFull:`正在加载消息…`,messageLoadFailed:`无法加载这条消息,重试`,filePreview:`文件预览`,changeEvidence:`变更`,changeEvidenceScope:`按所选范围查看当前工作目录的只读 Git 变更。`,turnLabel:`第 {{number}} 轮`,turnState_running:`运行中`,turnState_complete:`已完成`,turnState_failed:`失败`,turnState_interrupted:`已中断`,turnState_waiting:`等待回复`,turnState_forked:`已分叉,可继续对话`,turnChanges:`本轮更改 {{count}} 个文件`,turnChangesPartial:`本轮已记录 {{count}} 个文件`,turnChangesIncomplete:`这一轮的变更记录不完整。`,turnChangesMore:`再显示 {{count}} 个文件`,turnChangesLess:`收起文件`,turnChangesReview:`审阅本轮变更`,turnChangesReviewButton:`审阅`,turnChangesBack:`返回本轮变更`,turnChangesLoading:`正在加载本轮变更…`,turnChangesUnavailable:`无法读取本轮保存的差异。`,messageCopyRequiresFull:`加载完整消息后才能复制。`,filesChanged:`{{count}} 个文件已更改`,reviewChanges:`查看变更`,workspaceChanges:`工作区更改`,overviewChanges:`变更`,overviewLineTotals:`当前 Git 比较范围内的文本新增与删除行数`,overviewPartialTotals:`仅展示已核实的行数,部分文件尚无法统计。点击变更查看详情。`,overviewCounting:`统计中…`,overviewCountsUnknown:`行数未知`,overviewReviewUnavailable:`暂不可用`,sessionSources:`来源`,sourcesAdd:`添加来源`,sourcesDescription:`查看此对话附加的图片与文件`,sourceAttached:`已附加到对话`,sourcesEmpty:`暂无来源`,sourcesFailed:`来源加载失败。`,sourcesViewAll:`查看全部`,sourcesLoadMore:`加载更多来源`,sourcesBack:`返回来源列表`,sourcesPartial:`已达到列表展示上限,更早的来源仍可在对话中查看。`,turnChangesScope:`该轮开始至结束的工作区差异 · 已保存`,turnEdits:`已编辑 {{count}} 个文件`,turnEditsPartial:`已记录 {{count}} 个文件的编辑`,turnEditsScope:`本轮文件工具写入记录 · 已保存;不含命令行与外部修改`,turnEditStatsUnknown:`行数未知`,turnEditReason_before_unavailable:`文件已写入,但该操作未授权读取旧内容,无法提供可靠的前后差异。`,turnEditReason_content_limit:`文件已写入,内容超过已保存对比的大小限制,无法提供准确行数。`,turnEditReason_concurrent_change:`文件在已记录的操作之间发生了变化,无法确认本轮净增删行数。`,gitReviewLoadedCount:`已载入 {{count}} 个文件`,gitReviewPartialLabel:`部分`,gitReviewSearch:`搜索文件路径`,gitReviewExpand:`展开审阅`,gitReviewSearchLoaded:`搜索已载入文件`,gitReviewMarkViewed:`标记 {{path}} 为已查看`,gitReviewMarkCurrentViewed:`标记当前文件 {{path}} 为已查看`,gitReviewViewedLabel:`已查看`,gitReviewViewedProgress:`已查看 {{viewed}} / 已加载 {{loaded}} 个文件`,gitReviewViewedLimit:`本次对比最多保留 {{count}} 个已查看标记。`,gitReviewNoMatch:`没有匹配的文件。`,gitReviewNoLoadedMatch:`已载入文件中没有匹配项。`,gitReviewLoadNext:`载入下一批文件`,gitReviewChanged:`工作区已有变化,请刷新清单后继续载入。`,gitReviewNewVersion:`有新的更改,当前仍显示你正在阅读的版本。`,gitReviewShowLatest:`查看最新差异`,gitReviewBinary:`此二进制文件无法显示文本差异。`,gitReviewBinaryShort:`二进制`,gitReviewPendingStats:`待读取`,gitReviewComparison:`{{current}} 对比 {{base}}`,gitReviewWorkingTree:`工作区对比 HEAD`,gitReviewSessionSnapshot:`自本会话开始后的变更`,gitReviewDetached:`游离 HEAD`,gitReviewLoading:`正在读取 Git 变更…`,gitReviewRetry:`重试`,gitReviewRefresh:`刷新变更`,gitReviewOlderResult:`当前显示上一次读取结果。`,gitReviewNotRepository:`此工作区不是 Git 仓库。`,gitReviewUnborn:`此仓库还没有可读取的 HEAD。`,gitReviewFailed:`无法读取 Git 变更。`,gitReviewTruncated:`结果不完整,部分文件或差异未载入。`,gitReviewEmpty:`当前范围内没有文件变更。`,gitReviewHiddenLines:`另有 {{count}} 行 diff 未显示。`,gitReviewDiffTruncated:`快照已达到大小上限,未加载此文件的 diff。`,gitReviewShowMore:`再显示 {{count}} 个文件`,gitReviewBackToFiles:`返回变更文件`,gitReviewFilePreview:`{{file}} 的差异`,gitReviewNoDiff:`此文件没有可显示的文本差异。`,changeDiff:`变更差异`,diffViewMode:`差异视图`,diffUnified:`统一`,diffSplit:`并排`,diffBefore:`修改前`,diffAfter:`修改后`,diffView:`差异`,gitFileStatus_added:`已新增`,gitFileStatus_modified:`已修改`,gitFileStatus_deleted:`已删除`,gitFileStatus_renamed:`已重命名`,gitFileStatus_copied:`已复制`,gitFileStatus_untracked:`未跟踪`,gitFileStatus_unknown:`已变更`,closePreview:`关闭预览`,imageZoom:`图片缩放`,imageZoomHelp:`缩放相对于适应窗口。Ctrl + 滚轮缩放,放大后可拖动查看。`,zoomIn:`放大图片`,zoomOut:`缩小图片`,previousImage:`上一张图片`,nextImage:`下一张图片`,imagePosition:`第 {{current}} 张,共 {{total}} 张图片`,artifactReadOnly:`只读`,artifactReferenceUnavailable:`此视图无法打开文件预览:{{path}}`,artifactSession:`所属会话 {{sessionId}}`,copyFilePath:`复制文件路径`,filePathCopied:`已复制文件路径`,refreshFile:`刷新文件`,downloadFile:`下载文件`,downloadingFile:`正在下载…`,artifactOlderPreview:`当前显示旧版预览。`,readingFile:`正在读取文件…`,artifactVersion:`版本`,artifactBytes:`{{count}} 字节`,artifactPreviewTruncated:`预览已截断;下载文件可获取完整内容。`,artifactUnsupported:`此类型无法预览,请下载文件。`,filesLargeMarkdownSource:`Markdown 预览较大,已显示为源码以保持滚动流畅。已加载的文字全部保留。`,chatView:`对话`,trajectory:`执行轨迹`,trajectoryScope:`按记录顺序展示会话消息,不表示执行耗时,也不是完整模型请求。`,trajectoryRunning:`任务仍在进行。已保存记录到达后自动更新;实时生成内容可在“对话”中查看。`,trajectoryTruncated:`当前历史不完整:省略 {{entries}} 条记录、{{parts}} 个内容片段,{{messages}} 条消息被截断。`,trajectoryEmpty:`尚无已保存记录。`,trajectoryOrder:`记录顺序`,trajectoryOverview:`总览`,trajectorySequenceHint:`按记录顺序排列 · 宽度不表示执行耗时`,trajectoryClearRange:`清除选区`,trajectoryContextLane:`上下文`,trajectoryModelLane:`模型`,trajectoryToolLane:`工具`,trajectorySelectRecord:`选择记录 {{number}}:{{name}}`,trajectoryTimingTab:`时间`,trajectoryUsageTab:`用量`,trajectoryDurationLabel:`耗时`,trajectoryTimingSource:`数据来源`,trajectoryTimingUnknown:`尚未记录执行耗时。保存时间不等于操作开始时间。`,trajectoryTimingNative:`Pi 嵌套工具执行记录`,trajectoryTTFT:`首段输出等待`,trajectoryGenerationTime:`生成时间`,trajectoryThroughput:`每秒输出 tokens`,trajectoryNotRecorded:`未记录`,trajectoryUsageUnknown:`已加载记录中没有此响应的 token 用量。`,trajectoryUsage_input:`未缓存输入`,trajectoryUsage_cacheRead:`缓存读取`,trajectoryUsage_cacheWrite:`缓存写入`,trajectoryUsage_output:`输出`,trajectoryProvider:`提供商`,trajectoryModel:`模型`,trajectoryCode:`代码`,trajectoryWrap:`自动换行`,trajectoryCopy:`复制原文`,trajectoryCopied:`已复制`,trajectoryRawArguments:`原始 JSON`,trajectoryFoldTurns:`回合`,trajectoryFoldCalls:`工具调用`,trajectoryMetrics:`已加载执行摘要`,trajectoryRequestCount:`{{count}} 次模型响应`,trajectoryToolCount:`{{count}} 次工具调用`,trajectoryModelResponses:`模型响应`,trajectoryToolCalls:`工具调用`,trajectoryLastTurn:`最近已记录回合`,trajectoryEventColumn:`事件`,trajectoryContentColumn:`内容`,trajectoryTurn:`回合 {{number}}`,trajectoryLoadHistory:`加载更早历史`,trajectoryLatestRecords:`回到最新记录`,trajectoryHistoryLoading:`正在加载历史…`,trajectoryNestedOutputMissing:`Pi 已记录此嵌套调用的状态,但未保存其结果正文。外层脚本输出单独保留。`,trajectoryRecordCount:`{{count}} 条记录`,trajectoryMatches:`{{count}} 条匹配`,trajectorySearch:`搜索已加载记录`,trajectoryNoMatches:`没有匹配的记录。`,trajectoryEarlierGroup:`较早上下文`,trajectoryEventCount:`{{count}} 条会话变更`,trajectorySummary:`概览`,trajectoryInputTab:`输入`,trajectoryResultTab:`结果`,trajectoryConversationGroup:`本轮对话`,trajectoryReasoningTitle:`思考`,trajectoryRecordNumber:`记录 {{number}}`,trajectoryRecordInfo:`记录信息`,trajectoryRecordId:`记录 ID`,trajectoryCallId:`工具调用 ID`,trajectoryEventType:`事件类型`,trajectoryEvent_model_change:`切换模型`,trajectoryEvent_thinking_level_change:`调整思考级别`,trajectoryEvent_compaction:`压缩上下文`,trajectoryEvent_session_info:`更新会话信息`,trajectoryEvent_custom:`会话记录`,trajectoryEarlier:`显示更早记录(已加载历史中还有 {{count}} 条)`,trajectoryDetails:`记录详情`,trajectoryRecordedAt:`记录时间`,trajectoryEvidenceTruncated:`此证据在会话投影中已被截断。`,trajectoryArguments:`工具参数`,trajectoryRecordedContent:`已记录内容`,trajectoryThinking:`模型返回的推理内容`,trajectoryOutput:`工具结果`,trajectoryMissingResult:`当前记录中没有可明确配对的结果。这不表示工具仍在运行。`,trajectoryStructured:`结构化结果`,trajectoryEventOnly:`当前仅提供此事件的类型和记录时间。`,trajectory_user:`用户消息`,trajectory_assistant:`助手回复`,trajectory_call:`工具调用`,trajectory_result:`未配对结果`,trajectory_event:`会话事件`,trajectoryRole_user:`用户`,trajectoryRole_assistant:`助手`,trajectoryRole_call:`工具`,trajectoryRole_result:`结果`,trajectoryRole_event:`事件`,trajectory_returned:`工具已返回结果。`,trajectory_error:`工具返回错误`,trajectory_unknown:`尚无法确定结果`,runtimeStatus:`运行状态`,runtimeIdentity:`OpenPI 运行信息`,runtimeIdentityHint:`后端信息在启动时采样,不随之后的磁盘改动或会话重新加载更新,也不证明所有模块的加载版本。前端标识对应当前页面构建。`,runtimeIdentityFailed:`无法读取后端运行信息,请重试。`,runtimeBackendVersion:`后端包版本`,runtimePackageRoot:`后端包目录`,runtimeStartedAt:`进程启动时间`,runtimeGitRevision:`启动时 Git 提交`,runtimeGitState:`启动时工作区状态`,runtimeGitDirty:`存在本地改动`,runtimeGitClean:`干净`,runtimeFrontendVersion:`页面包版本`,runtimeFrontendBuild:`页面构建标识`,runtimeStartupBuild:`后端启动时记录的页面构建标识`,runtimeDevelopmentBuild:`开发服务器(无生产构建标识)`,runtimeBuildMismatch:`当前页面构建与后端启动时记录的构建不同。请刷新页面或重启服务后重新检查。`,refreshStatus:`刷新状态`,openTools:`打开工具`,openToolsUnavailable:`选择会话后可打开工具`,sideConversation:`侧边对话`,sideConversationDescription:`在独立 Pi 会话中追问具体问题,不打断当前主任务。`,workbarChangesDescription:`查看当前目录的未暂存、已暂存、分支或会话变更。`,terminal:`终端`,renameTerminal:`重命名终端`,terminalName:`终端名称`,workbarTerminalDescription:`打开当前工作区的交互式终端。`,restartTerminal:`重新启动终端`,reconnectTerminal:`重新连接终端`,restartTerminalTitle:`重新启动此终端?`,restartTerminalDetail:`当前终端会被关闭,其中运行的进程可能被中断。`,terminalReconnecting:`正在重新连接终端...`,terminalScrollToBottom:`回到底部`,terminalOutputResynced:`终端输出已重新同步`,terminalRestarting:`正在重新启动终端...`,terminalConnecting:`正在启动终端…`,terminalExited:`终端已退出。`,terminalExitCode:`终端已退出,状态码 {{code}}。`,terminalDisconnected:`终端连接意外中断。`,terminalError:`终端不可用。`,terminalLoadError:`终端界面加载失败,请刷新页面后重试。`,reloadPage:`刷新页面`,browser:`浏览器`,sessionFileRecords:`本会话文件记录`,gitReviewSource:`变更范围`,gitReviewBaseBranch:`对比分支`,gitReviewChooseBase:`选择对比分支`,gitReviewSearchBranches:`搜索分支`,gitReviewLocalBranch:`本地分支`,gitReviewRemoteBranch:`远程分支`,gitReviewBranchesTruncated:`显示有数量限制的分支列表,部分分支已省略。`,gitReviewNoMatchingBranches:`没有匹配的分支。`,gitReviewBaseUnavailable:`没有可用的默认对比分支。请选择分支以审阅已提交的变更。`,gitReviewBaseInvalid:`所选对比分支已不可用,请选择其他分支。`,gitReviewUnstaged:`未暂存(含未跟踪)`,gitReviewStaged:`已暂存变更`,gitReviewBranch:`分支变更`,gitReviewFileMissing:`此文件在当前范围内已无变更,请刷新文件列表。`,artifactExternalAccess:`此文件位于其他工作目录。可为当前会话授权只读打开这一个文件,不会开放其他文件的访问。`,artifactAuthorizeFile:`只读打开此文件`,sideConversationPending:`正在准备侧边会话…`,resizeSidebar:`调整侧边栏宽度`,resizePanes:`调整面板宽度`,resizeWorkbar:`调整工具栏宽度`,browserPasteTooLarge:`每次最多粘贴 {{count}} 个字符。`,browserInputTooLarge:`每次最多输入 {{count}} 个字符。`,browserInputTargetChanged:`输入目标已变化或无法确认,有输入操作未执行。`,workbarBrowserDescription:`在 OpenPI 工作栏内打开并操作网页。`,browserReady:`输入地址开始浏览`,browserStarting:`正在启动内嵌浏览器…`,browserOpened:`已在内嵌浏览器中打开`,browserOpenAgain:`再次打开`,browserOpenFailed:`内嵌浏览器暂不可用。`,browserBack:`后退`,browserForward:`前进`,browserReload:`重新加载`,browserTabs:`网页标签页`,browserNewTab:`新标签页`,browserAddTab:`新建网页标签页`,browserCloseTab:`关闭 {{title}}`,browserTabLimit:`最多打开 {{count}} 个网页标签页`,browserPageTitle:`网页:{{address}}`,browserEnteredAddress:`最近从此地址栏打开的地址`,browserAddressNotAllowed:`请输入不含用户名或密码、且不属于 OpenPI 自身地址的 HTTP(S) 网址。`,browserLocationUnknown:`网页已跳转,新地址无法读取。重新加载会返回你输入的地址。`,browserDirectDescription:`直接浏览网页。不允许嵌入的网站可在外部浏览器打开。`,browserDirectHint:`地址栏仅记录手动打开的地址。网页弹窗在外部浏览器打开;遇到空白页,可点击外部打开。`,browserEnhancedHint:`浏览增强已开启:地址自动同步,普通弹窗链接在内部标签页打开。部分站点限制、登录弹窗和跨站历史仍需外部浏览器。`,files:`文件`,filesExplorer:`工作区文件`,filesSearch:`筛选文件…`,refreshFiles:`刷新文件`,filesWorkspaceActions:`工作区文件操作`,filesCreateMenu:`新建`,filesImportMenu:`导入`,filesMoreMenu:`更多`,filesNewFile:`新建文件`,filesNewDirectory:`新建文件夹`,filesImport:`导入文件`,filesImportFolder:`导入文件夹`,filesImportFolderChoose:`选择要导入的文件夹`,filesImportFolderLimit:`每次最多导入 2,000 个文件和文件夹,目录层级最多 64 层。`,filesSelectMultiple:`多选文件`,filesSelectItem:`选择 {{name}}`,filesSelectedCount:`已选 {{count}} 项`,filesRename:`重命名`,filesNewName:`新名称`,filesMove:`移动`,filesMoveDestination:`目标文件夹(工作区内相对路径)`,filesTrashAction:`移入回收站`,filesTrash:`工作区回收站`,filesTrashDetail:`移除的文件保留在当前工作区,可恢复;不会覆盖同名文件。`,filesTrashEmpty:`暂无已移除文件`,filesTrashUnavailable:`{{count}} 项记录无法核验,内容仍保留在 .openpi-trash 中,暂不能自动恢复。`,filesRestore:`恢复`,filesRestoreItem:`恢复 {{name}}`,filesUndoTrash:`撤销移除`,filesOrganizationResults:`文件操作结果`,filesOperationDone:`完成`,filesRefreshBeforeOrganizing:`请先刷新文件树,再整理这项文件。`,filesImportChoose:`选择要导入的文件`,filesTargetDirectory:`目标目录`,filesWorkspaceRoot:`工作区根目录`,filesFileName:`文件名称`,filesDirectoryName:`文件夹名称`,filesCreate:`创建`,filesCreating:`创建中…`,filesCreated:`已创建:{{path}}`,filesNameInvalid:`请输入单个文件或文件夹名称,不要包含路径分隔符。`,filesNameExists:`此名称已存在,请更换名称;原有文件已保留。`,filesMutationFailed:`写入失败,输入已保留。`,filesWriteUnavailable:`请先切换到此会话,再修改工作区文件。`,filesImportLimit:`每个文件最多 50 MiB,同名文件不会覆盖。`,filesImportTooLarge:`此文件超过 50 MiB 导入上限。`,filesImportDirectoryUnsupported:`不支持导入整个文件夹,请选择其中的文件。`,filesImportResults:`文件导入结果`,filesImportPending:`等待导入`,filesImporting:`导入中…`,filesImported:`已保存到工作区`,filesImportedNoPreview:`已保存。预览上限为 20 MiB;可复制路径,在对话中引用此文件。`,filesClearImported:`清除已完成的导入`,filesRetryImport:`重试导入`,filesPathActions:`{{name}} 的路径操作`,filesCopyRelativePath:`复制相对路径`,filesCopyAbsolutePath:`复制绝对路径`,filesPathCopied:`已复制路径:{{path}}`,filesReadFailed:`无法读取文件。`,filesRetryRead:`重试读取`,filesErrorDetails:`错误详情`,filesReadFailedDetail:`文件列表未能加载,请检查连接后重试。`,filesReadDenied:`当前会话的工作区暂不可访问,或无法确认目录身份。请确认会话与工作区后重试。`,filesSymlink:`符号链接,文件浏览器不会自动跟随`,filesTruncated:`结果不完整,请缩小搜索范围。`,filesNoMatches:`没有匹配的文件`,filesEmpty:`此文件夹为空`,filesChoose:`选择文件进行预览`,filesChooseDetail:`从右侧浏览工作区文件,在这里直接预览。`,filesHideTree:`收起文件树`,filesShowTree:`显示文件树`,filesPreview:`预览`,filesSource:`查看源代码`,filesEdit:`编辑`,filesMode:`文件视图`,filesEditor:`文件编辑器`,filesSave:`保存文件`,filesSaving:`保存中…`,filesSaved:`已保存`,filesUnsaved:`未保存的修改 · 草稿保留在当前窗口`,filesDiscard:`放弃草稿`,filesDiscardConfirm:`放弃此文件尚未保存的修改?`,filesSaveConflict:`磁盘上的文件已改变,编辑草稿已保留。请刷新查看最新内容,核对修改后再保存。`,filesSaveFailed:`保存失败,编辑草稿已保留。请检查文件后重试。`,filesEditLoadFirst:`请先继续读取完整文件,再编辑。`,filesEditUnavailable:`支持编辑工作区内不超过 1 MiB 的 UTF-8 文本,最多保留 16 份未保存草稿。`,filesOutline:`章节目录`,filesDiskVersion:`查看当前磁盘版本`,filesReconcile:`已核对,保留草稿并基于此版本继续编辑`,filesTable:`表格预览`,filesRow:`行`,filesSheets:`工作表`,filesTableTruncated:`当前仅显示部分表格内容;下载原文件可查看完整内容。`,filesOfficeLayout:`文档内容预览;分页和排版可能与 Office 不同。`,filesSlidesLayout:`幻灯片文字与图片预览;主题、图表和动画可能与 PowerPoint 不同。`,filesPreviousPage:`上一页`,filesNextPage:`下一页`,filesZoomOut:`缩小`,filesZoomIn:`放大`,filesZoomReset:`重置缩放`,filesPdfPage:`第 {{page}} 页`,filesDocumentLimit:`此文档超出预览处理范围,请下载后在本地打开。`,filesPreviewFailed:`无法预览此文件,仍可下载后打开。`,filesDiagram:`Mermaid 图表`,filesDiagramLoadError:`图表预览加载失败,已显示源码。刷新页面后可重试。`,filesExpandDiagram:`放大图表`,filesFitImage:`适应宽度`,filesOriginalImage:`原始尺寸`,filesLoadMore:`加载更多`,filesLoaded:`已加载 {{count}} 项`,filesReadMore:`继续读取`,filesContentChanged:`文件已更新。当前阅读内容已保留,可在准备好后刷新。`,workbarFilesDescription:`浏览工作区文件,在文件树旁直接预览。`,backToSideConversations:`返回侧边对话`,continueSideConversation:`继续追问…`,startSideConversation:`提出一个侧边问题…`,sideConversationModelInherited:`新侧边对话使用主会话的模型与思考等级。`,sideConversationModelFixed:`这是当前侧边对话使用的模型。`,stop:`停止`,start:`开始`,browserAddress:`浏览器地址`,browserGo:`打开地址`,openExternalBrowser:`在外部浏览器打开`,invalidBrowserAddress:`请输入有效的 HTTP 或 HTTPS 地址。`,addImages:`添加图片`,addFiles:`添加文件`,fileAttachments:`文件附件`,previewFileAttachment:`预览文件`,fileAttachmentDescription:`文档、表格、PDF、文本、代码及其他文件`,fileAttachmentCount:`最多可添加 {{count}} 个附件。`,fileAttachmentTooLarge:`文件总大小不能超过 50 MB。`,fileAttachmentReadFailed:`无法读取此文件,请检查格式或是否有密码保护。`,fileAttachmentTextReady:`文本已就绪`,fileAttachmentTextTruncated:`部分文本 · 保留原文件`,fileAttachmentOriginalReady:`原文件已就绪`,fileAttachmentExtractionFailed:`未提取文本 · 原文件保留`,fileAttachmentEncodingUnavailable:`无法读取文本编码,原文件字节已保留。`,fileAttachmentDocumentUnavailable:`无法提取文本。文件可能受密码保护或格式暂不支持,原文件字节已保留。`,fileAttachmentNoText:`发送后,代理可通过工具读取原文件;此文件未提取出文本。`,fileAttachmentPreviewTruncated:`预览显示前 20,000 个字符,发送时会附上全部已提取文本。`,fileAttachmentExtractedContent:`已提取文本`,fileAttachmentPromptLabel:`用户提供的文件:`,fileAttachmentPromptTooLong:`消息和文件引用超过输入限制,请缩短消息或减少附件。`,imageAttachmentDescription:`支持 PNG、JPEG、GIF 或 WebP`,imageAttachments:`图片附件`,imageAttachmentsLoading:`正在准备附件…`,commandOpensPanel:`打开面板`,commandPanelArguments:`此命令用于打开面板,不能携带参数或图片。请移除后重试,或直接使用对应面板。`,commandPanelUnavailable:`未能打开面板,已保留命令。`,commandUnavailable_terminal_only:`需要在 Pi 终端界面中使用。`,commandUnavailable_not_integrated:`此扩展命令尚未接入 Web,请在 Pi 终端中使用。`,artifactImagePreviewFailed:`图片预览失败。请刷新文件重试,或下载后查看。`,artifactFileDetails:`文件信息`,turnElapsedRunning:`正在处理 · {{duration}}`,compactionElapsed:`已等待 {{duration}}`,compactionRunning:`正在压缩上下文`,compactionCompleted:`上下文已自动压缩`,compactionFailed:`上下文压缩失败`,compactionInterrupted:`压缩已中断`,compactionUnchanged:`压缩已结束,未生成新的摘要`,compactionUnavailable:`上下文压缩状态暂不可用`,compactionReconnectHelp:`连接已中断,恢复连接后将核实当前状态。`,compactionDraftHelp:`正在压缩上下文,发送的消息会排队等待。`,turnElapsedFinished:`用时 {{duration}}`,composerAdd:`添加`,composerCommands:`指令`,composerFile:`文件`,composerPlan:`计划`,composerCompact:`压缩`,composerModel:`模型`,composerBack:`返回`,composerPlanDescription:`进入或退出计划模式`,composerCompactDescription:`整理之前的对话,释放上下文空间`,composerModelDescription:`选择本会话使用的模型`,compactionQueueWaiting:`等待压缩完成`,compactionQueueBlocked:`消息已保留,可重试或清空队列。`,clearPromptQueue:`取消排队`,queueUpdateFailed:`未能更新队列,请确认当前会话后重试。`,queueStatusUnconfirmed:`请求已接收,但暂时无法确认最新队列状态。请刷新后再操作。`,turnElapsedOutcome_cancelled:`已停止`,turnElapsedOutcome_failed:`失败`,turnElapsedOutcome_uncertain:`结果待确认`,settingsSetupBusyHint:`Agent 配置需等待当前轮次结束;显示设置可直接调整。`,resetChatContentWidth:`恢复默认聊天宽度`,resetChatFontSize:`恢复默认字体大小`,setupResolveAdmission:`请先返回对话,处理尚未确认的消息,再应用设置。`,removeAttachment:`移除附件`,dropImagesHere:`将文件或图片拖到这里`,imageAttachmentCount:`最多可添加 {{count}} 张图片。`,imageAttachmentTooLarge:`单张图片不能超过 10 MB。`,imageAttachmentTotalTooLarge:`图片总大小不能超过 32 MB。`,imageAttachmentUnsupported:`仅支持有效的 PNG、JPEG、GIF 和 WebP 图片。`,imageAttachmentReadFailed:`无法读取此图片,请重新添加重试;消息内容已保留。`,attachedImage:`已附加图片`,previewAttachment:`预览图片`,closeImagePreview:`关闭图片预览`,imagePreviewFailed:`无法显示这张图片。`,fitImage:`适应窗口`,originalImageSize:`原始尺寸`,imageViewMode:`图片查看`,sessionUsage:`会话 Token 用量`,sessionInputTokens:`输入 Token`,sessionOutputTokens:`输出 Token`,sessionCacheTokens:`缓存 Token`,sessionContextUsage:`上下文占用与窗口大小`,usageContextLabel:`上下文`,usageUnknown:`未知`,usageOpenDetails:`输入 {{input}} · 输出 {{output}} · 上下文 {{percent}} / {{capacity}} · 查看会话用量`,usageContextHelp:`当前分支的估算占用 / 模型上下文容量上限。`,usageSessionTotals:`累计用量`,usageInputLabel:`输入`,usageOutputLabel:`输出`,usageCacheReadLabel:`缓存读取`,usageCacheWriteLabel:`缓存写入`,usageTotalLabel:`总计`,usageWorkspaceLabel:`工作区`,usageSessionId:`会话 ID`,usageTotalsHelp:`本会话累计 Token 用量,包含缓存。`,subagentDetails:`子代理`,sessionOverview:`会话概览`,sessionOverviewChanges:`当前审阅范围的更改`,subagentSummaryRunning:`{{count}} 运行中`,subagentSummaryDone:`{{count}} 完成`,subagentSummaryOther:`{{count}} 其他记录`,subagentNoneYet:`暂无子代理`,subagentOtherGroup:`失败 / 已中断`,subagentShowMore:`再显示 {{count}} 个`,backToSubagents:`返回子代理列表`,subagentActiveGroup:`已开启`,subagentFinishedGroup:`完成`,subagentNoneRunning:`暂无正在运行的子代理。`,subagentNoneFinished:`任务结束后会显示在这里。`,subagentProgress:`子代理:{{running}} 运行中 · {{completed}} 已完成`,subagentSummaryUnknown:`{{count}} 个状态未确认`,subagentTasks:`子代理任务列表`,inspectSubagent:`打开子代理:{{name}}`,subagentState_running:`运行中`,subagentProcessing:`处理中`,subagentState_done:`已完成`,subagentState_error:`失败`,subagentState_interrupted:`已中断`,subagentStarting:`正在启动…`,subagentSpawnFailed:`启动失败`,subagentStateUnavailable:`已启动 · 状态未保留`,subagentSpawnReceipt:`启动回执`,subagentSpawnReceiptHint:`此回执仅确认启动请求,不表示子代理任务已完成。`,subagentTask:`分配的任务`,subagentTranscript:`子代理对话`,subagentResult:`执行结果`,subagentSpend:`累计 token 消耗`,subagentSaved:`已保存记录`,subagentRecordedState:`最后记录的状态`,subagentSavedHint:`来自当前父会话已保存的回执;结果可能包含同批其他任务,并非子代理的完整实时对话。`,subagentReadOnly:`只读查看 · 关闭此面板不会停止任务`,subagentUnavailable:`当前会话已无法提供此子代理的实时详情。启动回执不代表任务已完成。`,subagentStale:`刷新失败,下方保留的是上次收到的状态。`,subagentNoMessages:`暂未收到消息。`,subagentTranscriptUnavailable:`此视图仅保留任务摘要,无法显示完整子代理对话。`,subagentWorkflowsTruncated:`另有 {{count}} 个 workflow 未包含在当前列表中,其任务数量未知。`,subagentState_unknown:`未确认`,subagentUnconfirmedGroup:`未确认`,subagentTruncated:`当前显示最近的消息,另有 {{count}} 条较早消息未包含在此视图中。`,subagentTextTruncated:`部分较长内容仅显示节选。`,subagentListTruncated:`另有 {{count}} 个任务未包含在当前列表中。`,subagentThinkingRedacted:`服务商已隐藏此段思考内容。`,inspectionChanged:`当前会话已切换,请重新打开详情。`,inspectionUnavailable:`暂时无法读取详情。`,inspectionLoading:`正在读取状态…`,thinkingUnavailable:`暂时无法读取思考等级。`,trustUnavailable:`暂时无法读取项目信任状态。`,copySetupCommand:`复制配置命令`,savedTrustDecision:`已保存决定`,activeSessionTrust:`当前会话信任`,trustDecision_trusted:`已信任`,trustDecision_denied:`已拒绝`,trustDecision_undecided:`未决定`,trustDecision_unknown:`未知`,trustActiveYes:`当前会话已信任`,trustActiveNo:`当前会话未信任`,modelAndThinking:`模型与思考`,selectedModel:`当前模型`,thinkingLevel:`思考等级`,availableThinking:`支持的等级`,unknownState:`未知`,projectTrust:`项目信任`,trust_trusted:`当前会话信任此工作区。`,trust_untrusted:`此工作区的信任已被拒绝。`,trust_restricted:`项目资源受到限制,等待信任决定。`,trust_unknown:`尚无法确定信任状态。`,trustRefreshNeeded:`保存的信任决定与当前会话不同,请通过 Pi 刷新会话后生效。`,providerAvailability:`服务商凭据`,settings:`设置`,settingsNavigation:`设置导航`,generalSettings:`常规`,configurationSettings:`配置`,configurationIntro:`配置工具权限、网络访问与模型响应。`,configurationReadFailure:`无法安全读取配置。请修复设置文件后刷新。`,configurationUserScope:`用户配置`,configurationSetupHint:`响应与搜索选项通过 OpenPI setup 应用`,configurationApproval:`批准策略`,configurationApprovalDetail:`工具审批沿用已安装 Pi 扩展的权限机制。`,configurationPiPermissions:`由 Pi 扩展管理`,configurationSandbox:`沙箱设置`,configurationSandboxDetail:`工具使用宿主进程的权限运行。`,configurationSandboxUnavailable:`未提供 OS 沙箱`,configurationSearchDetail:`允许当前会话模型在支持时访问网络。`,configurationSearchOff:`不向当前模型提供原生搜索。`,configurationSearchOn:`在当前连接支持时允许原生搜索。`,configurationVerbosity:`输出详细程度`,configurationVerbosityDetail:`选择模型回复包含细节的详细程度。`,configurationResponsesUnavailable:`当前连接未使用支持的 Responses 接口。`,configurationVerbosity_default:`模型默认`,configurationVerbosity_low:`简短`,configurationVerbosity_medium:`适中`,configurationVerbosity_high:`详细`,configurationVerbosityHelp_low:`简短直接地回答,减少额外细节。`,configurationVerbosityHelp_medium:`给出必要解释与适量细节。`,configurationVerbosityHelp_high:`提供更完整的解释与细节。`,configurationVerbosityRequest:`只把 response_verbosity 设为 {{value}},保留其他 OpenPI 配置。`,configurationSummary:`推理摘要`,configurationSummaryDetail:`选择向支持的推理模型请求哪种摘要。`,configurationSummaryUnavailable:`当前连接不支持推理摘要。`,configurationSummary_default:`模型默认`,configurationSummary_auto:`自动`,configurationSummary_concise:`简洁`,configurationSummary_detailed:`详细`,configurationSummary_none:`关闭`,configurationSummaryHelp_auto:`由模型自动选择摘要长度。`,configurationSummaryHelp_concise:`请求简洁的推理摘要。`,configurationSummaryHelp_detailed:`请求较详细的推理摘要。`,configurationSummaryHelp_none:`不请求推理摘要;保留当前推理强度。`,configurationSummaryRequest:`只把 response_reasoning_summary 设为 {{value}},保留其他 OpenPI 配置。`,configurationModelFeatures:`模型功能`,configurationReasoningLevels:`可用推理强度`,configurationReasoningDetail:`选择在模型控件中显示哪些级别。控件只显示当前模型支持的档位,当前档位始终保留。`,configurationReasoningCount:`已选择 {{count}} 个`,configurationDependencies:`工作空间依赖项`,configurationEnvironment:`本地运行环境`,configurationEnvironmentDetail:`Node.js、Python 等工具由当前环境提供。OpenPI 不安装捆绑的工作空间运行时。`,configurationRuntimeStatus:`运行状态`,browserSettings:`浏览器`,webSearchSettings:`联网搜索`,webSearchCurrentModel:`当前会话模型`,webSearchNativeDetail:`调用当前模型供应商的原生搜索,复用现有连接和凭据。`,webSearchSupported:`当前连接支持原生搜索。开启后,由模型决定何时联网。`,webSearchUnsupported:`当前连接不支持或尚未确认支持原生搜索,不提供搜索工具,也不会切换到其他供应商。`,webSearchNativeRequest:`开启联网搜索,使用当前会话模型的原生搜索和已有 Pi 凭据。不要切换模型、连接协议或搜索供应商;当前连接不支持或支持情况未知时,不提供搜索工具。`,webSearchIntro:`让模型搜索最新资料,并打开原始网页核实。`,webSearchPackageDetail:`通过可选 Pi 插件提供搜索、网页读取和 PDF 提取。`,webSearchDefaultOff:`默认关闭。可选扩展跟随当前会话模型,无需另填搜索密钥或安装插件。`,webSearchLoaded:`本会话已加载插件`,webSearchNotLoaded:`本会话尚未加载插件`,webSearchSource:`查看插件源码`,webSearchProfile:`搜索设置`,webSearchExa:`Exa — 无需 API 密钥`,webSearchExisting:`保留我已有的搜索偏好`,webSearchProfileHint:`Exa 提供搜索,网页由本机直接读取。已有偏好会原样保留;安装后也可更换搜索服务。`,webSearchEnable:`启用联网搜索…`,webSearchDisable:`关闭联网搜索…`,webSearchConfigure:`更换搜索服务…`,webSearchExaRequest:`启用可选联网搜索,使用 Pi Web Access 和无需 API 密钥的 Exa。让我审阅插件安装确认,保留其他偏好,不要自动重新加载。`,webSearchExistingRequest:`启用可选联网搜索,使用 Pi Web Access,原样保留我已有的搜索偏好。让我审阅插件安装确认,保留其他偏好,不要自动重新加载。`,webSearchDisableRequest:`关闭原生联网搜索。保留其他设置和会话记录。`,webSearchProviderRequest:`帮我更换已安装 Pi Web Access 插件的搜索服务。介绍可用服务与权限,保留无关偏好,密钥留在搜索插件中,不要自动重新加载。`,browserSettingsIntro:`让 OpenPI 阅读网页、点击、输入和截图。`,browserControl:`浏览器控制`,browserControlHint:`提交设置变更请求,保存配置后生效。`,browserDefault:`默认浏览器`,browserDefaultHint:`提交设置变更请求,选择未指定浏览器时使用的默认项。`,browserEmbedded:`OpenPI 内置浏览器`,browserAllowedTitle:`允许使用的浏览器`,browserOffHint:`下方选择将在开启浏览器控制后生效。`,browserConnected:`已连接`,browserNeedsSetup:`需要连接浏览器扩展`,browserNotFound:`未检测到此浏览器`,browserUpdateNeeded:`需要更新扩展`,browserBlocked:`未授权`,browserDefaultBlocked:`当前默认浏览器未获授权,请允许使用或更换默认值。`,browserSetUp:`设置`,browserManage:`管理`,browserSetupNamed:`设置 {{browser}}`,browserManageNamed:`管理 {{browser}}`,browserAllowNamed:`允许使用 {{browser}}`,browserMore:`更多浏览器`,browserSpeakHint:`对话中说“使用 Chrome …”,即可指定这次使用的浏览器。`,browserGuideTitle:`连接 {{browser}}`,browserGuideEyebrow:`跟着做,一次一步`,browserConnectionTitle:`连接状态`,browserCloseGuide:`收起浏览器设置引导`,browserConnectionReady:`连接正常,可选择是否允许 OpenPI 使用。`,browserEmbeddedDetail:`网页在 OpenPI 内打开。部分网站需要使用普通浏览器才能登录或正常显示。`,browserExternalDetail:`OpenPI 可以使用已连接的 {{browser}} 配置中的现有标签和登录状态。请在该配置中保留一个 OpenPI 标签页。`,browserManageExtension:`管理扩展`,browserAllowUse:`允许 OpenPI 使用`,browserMakeDefault:`设为默认`,browserInstallIn:`安装到`,browserInstallTitle:`安装 OpenPI Browser Bridge`,browserSetupSteps:`设置步骤`,browserGuidePopout:`在独立窗口中跟随操作`,browserGuideDetached:`引导已在独立窗口打开,可以对照浏览器设置逐步完成。`,browserShowGuide:`显示引导窗口`,browserGuideInline:`把引导放回这里`,browserGuideBlocked:`未能打开引导窗口。可允许弹出式窗口后重试,也可继续查看这里的步骤。`,browserSafariSettings:`Safari → 设置`,browserSafariDeveloper:`开发者设置`,browserSafariTemporary:`添加临时扩展…`,browserSafariOpenHint:`打开 Safari 后,在菜单栏选择「Safari → 设置」,对照此引导操作。需要 macOS 上的 Safari 26 或更新版本。`,browserSafariDeveloperTitle:`显示 Safari 开发者设置`,browserSafariDeveloperHint:`在「设置 → 高级」中开启「显示网页开发者功能」,再进入「开发者」标签。`,browserSafariLoadHint:`在「开发者」中点击「添加临时扩展」,选择下方文件夹。启用 OpenPI Browser Bridge,允许访问要控制的网站及本地 OpenPI 页面。退出 Safari 后需重新加载临时扩展。`,browserFirefoxThis:`此 Firefox`,browserFirefoxTemporary:`临时载入附加组件…`,browserFirefoxDeveloperTitle:`选择「此 Firefox」`,browserFirefoxDeveloperHint:`在 about:debugging 左侧选择「此 Firefox」。Firefox 不需要开启「开发者模式」开关。`,browserFirefoxLoadHint:`点击「临时载入附加组件」,选择下方文件夹中的 manifest.json。此安装在 Firefox 重启后失效;永久安装需要经过 Mozilla 签名的扩展包。`,browserFirefoxDone:`已选中,下一步`,browserStepCount:`第 {{step}} 步,共 {{total}} 步`,browserStepLabel:`第 {{step}} 步:{{label}}`,browserStepOpen:`打开扩展页`,browserStepAdd:`添加扩展`,browserStepConnect:`连接`,browserOpenManagerTitle:`打开 {{browser}} 扩展页`,browserOpenManagerHint:`接下来会打开 {{browser}}。在扩展页完成操作后,回到这里继续。`,browserOpenManager:`打开 {{browser}} 扩展页`,browserReopenManager:`重新打开扩展页`,browserAlreadyInstalled:`已经安装?直接连接`,browserDeveloperMode:`开发者模式`,browserDeveloperTitle:`开启「开发者模式」`,browserDeveloperHint:`在扩展页开启「开发者模式」,页面会出现「{{loadLabel}}」按钮。`,browserDeveloperDone:`已开启,下一步`,browserIllustration:`操作示意 · 在 {{browser}} 中完成`,browserExtensions:`扩展程序`,browserLoadUnpacked:`加载未打包的扩展程序`,browserLoadHint:`扩展已准备在本机,按下面的顺序在 {{browser}} 中载入。`,browserCopyLocation:`复制下面的路径`,browserLocateTarget:`找到本机的扩展文件夹`,browserRevealTarget:`定位扩展文件夹`,browserLocateManifest:`找到扩展中的 manifest.json`,browserRevealManifest:`定位 manifest.json`,browserDragToBrowser:`把文件夹拖到 {{browser}} 扩展页`,browserDragFolderHint:`将文件管理器中的 {{folder}} 整个文件夹拖到扩展页,保持「开发者模式」开启。`,browserSelectLocatedTarget:`在浏览器弹出的选择窗口中,选择上一步定位的项目。`,browserManualInstall:`无法拖入?使用路径选择`,browserManualSelection:`找不到?使用路径选择`,browserLoadInBrowser:`在 {{browser}} 点击「{{loadLabel}}」`,browserLoadAlternate:`部分版本显示为「加载已解压的扩展程序」或 Load unpacked。`,browserConfirmFolder:`选择`,browserConfirmFile:`打开`,browserSelectFolderHint:`选择整个文件夹,不要选择里面的 .js 文件。`,browserSelectManifestHint:`只选择 manifest.json,不要选择 .js 文件。`,browserInstallCheckpoint:`在扩展列表看到 OpenPI Browser Bridge 卡片后,再继续连接。`,browserPathCopied:`已复制路径`,browserCopyFailed:`未能复制,请选中上方路径手动复制。`,browserChooseFolderMac:`按 ⌘ ⇧ G,粘贴刚复制的路径并按回车定位,再点击「{{confirm}}」。`,browserChooseFolderOther:`在选择窗口的地址栏粘贴刚复制的路径并回车,再点击「{{confirm}}」。`,browserInstalledConnect:`已添加,连接 OpenPI`,browserPreviousStep:`上一步`,browserWaiting:`等待 OpenPI Browser Bridge 连接,连接后会自动进入下一步。`,browserInstallBrowserFirst:`请先安装 {{browser}},或在已安装的浏览器中打开当前 OpenPI 地址。`,browserConnectTitle:`连接 OpenPI`,browserConnectHint:`在 {{browser}} 中打开 OpenPI,使用刚安装扩展的浏览器配置。`,browserOpenIn:`在 {{browser}} 中打开`,browserAllowHint:`连接成功后,可以允许 OpenPI 使用此浏览器。安装扩展不会自动开启浏览器控制。`,browserCheck:`检查连接`,browserNotConnectedYet:`还未连接。请完成安装,在该浏览器中刷新 OpenPI 后再次检查。`,browserHelp:`设置帮助`,browserReloadHint:`已安装旧版?在扩展页重新加载 OpenPI Browser Bridge,再刷新 OpenPI。如浏览器提示权限,请完成其原生确认。`,browserSupportedHint:`Chrome、Edge、Brave、Chromium 145+ 可控制内置页面及普通标签。macOS Safari 26+、Firefox 128+ 通过兼容扩展控制普通标签,嵌套框架需单独打开。Safari、Firefox 的临时安装需在浏览器重启后重新加载。`,browserCopyPath:`复制路径`,browserOpening:`正在打开浏览器…`,browserLoading:`正在检查浏览器连接…`,browserSaved:`已保存,浏览器权限立即生效。`,browserSaving:`正在处理…`,modelSettings:`模型`,skillsSettings:`技能`,subagentsSettings:`子代理`,pluginsSettings:`插件`,configureOpenPi:`配置 OpenPI`,setupRequestReviewAll:`和我一起检查全部 OpenPI 配置项`,setupRequestSetTheme:`仅将 OpenPI Web 主题设置为 {{value}},其他配置保持不变`,setupRequestSetChatWidth:`仅将 OpenPI Web 聊天内容宽度设置为 {{value}}px,其他配置保持不变`,setupRequestSetChatFontSize:`仅将 OpenPI Web 聊天字体大小设置为 {{value}}px,其他配置保持不变`,setupRequestEnableExpandedThinking:`仅将 OpenPI Web 的思考块改为默认展开,其他配置保持不变`,setupRequestDisableExpandedThinking:`仅将 OpenPI Web 的思考块改为默认折叠,其他配置保持不变`,setupRequestSubagents:`检查并配置 Agent 角色模型和工作流上限`,setupRequestFailed:`OpenPI 配置请求未被接收。`,setupRequestRunning:`正在应用 OpenPI 设置…`,setupRequestAccepted:`配置请求已接收。`,setupPlanBlocked:`Agent 配置需先退出 Plan 模式;显示设置可直接调整。退出不会开始实施计划。`,setupPlanBusy:`Agent 配置需等待当前回合结束并退出 Plan 模式;显示设置可直接调整。`,setupOutcome_pending:`配置请求正在处理,尚未收到保存回执。`,toolCallArguments:`工具参数`,toolCallOutput:`工具结果`,setupOutcome_saved:`OpenPI 配置已保存并应用。`,setupOutcome_unchanged:`配置已保存,实际设置没有变化。`,setupOutcome_failed:`配置请求失败,请查看错误和当前设置后再重试。`,setupOutcome_cancelled:`配置过程已取消,未确认成功保存。`,setupOutcome_unconfirmed:`本次未确认成功保存,请核对当前设置后再运行 /openpi-setup。`,settingsUpdateFailed:`无法保存 Web 显示设置。`,settingsPreferencesSaved:`偏好设置已保存。`,settingsPreferencesSaveFailed:`无法保存显示设置,请检查配置诊断后重试。`,settingsCatalogLoading:`正在加载 Pi 资源…`,settingsCatalogFailed:`无法加载 Pi 设置资源。`,appearance:`外观`,settingsPersonal:`个人`,settingsAgent:`Agent`,settingsIntegrations:`集成`,settingsArchivedChats:`已归档聊天`,settingsSearch:`搜索设置`,settingsClearSearch:`清除搜索`,settingsNoResults:`没有匹配的设置`,appearanceVisualStyle:`视觉风格`,appearanceMode:`模式`,appearanceTheme:`主题`,appearanceAccent:`强调色`,appearanceBackground:`背景`,appearanceForeground:`前景`,appearanceFont:`字体`,appearanceFont_codex:`Codex 默认`,appearanceFont_sans:`无衬线`,appearanceFont_serif:`衬线`,appearanceFont_mono:`等宽`,appearanceAccent0:`默认`,appearanceAccent1:`蓝色`,appearanceAccent2:`紫色`,appearanceAccent3:`粉色`,appearanceAccent4:`橙色`,appearanceAccent5:`绿色`,appearanceCustomAccent:`自定义强调色`,appearanceAdvanced:`高级`,appearanceReset:`恢复默认设置`,appearanceResetAction:`重置外观`,appearanceImport:`导入主题`,appearanceCopy:`复制主题`,appearanceCopied:`主题已复制`,appearanceCopyFailed:`无法复制主题,请重试。`,appearanceThemeValue:`主题数据`,appearanceImportPlaceholder:`粘贴 OpenPI 主题…`,appearanceImportInvalid:`请输入有效的 OpenPI 主题数据。`,appearanceImportAction:`导入`,searchArchivedChats:`搜索已归档聊天`,archiveProjectFilter:`按项目筛选`,archiveAllProjects:`所有项目`,archiveProjectGroup:`{{project}} · {{count}} 条归档聊天`,archiveSort:`归档聊天排序`,archiveSortUpdated:`最近更新`,archiveSortCreated:`创建时间`,restoreArchivedChat:`恢复 {{title}}`,themeLight:`浅色`,themeDark:`深色`,themeMist:`雾青`,themeRose:`蔷薇`,themePine:`松夜`,themeSystem:`跟随系统`,conversationSettings:`对话`,expandThinkingByDefault:`默认展开思考块`,chatContentWidth:`聊天内容宽度`,chatFontSize:`聊天字体大小`,agentBehavior:`Agent 行为`,workflowLimits:`工作流上限`,workflowConcurrency:`工作流并行上限`,workflowCalls:`总调用次数`,agentSettingsSetupHint:`Agent 设置通过当前会话中的 /openpi-setup 生效。`,setupRequestLimits:`将工作流并行上限设置为 {{concurrency}},总子代理调用上限设置为 {{calls}},保留其他配置。`,setupRequestEnableSuggestions:`启用下一步建议。如需模型配置,请帮助我选择模型,保留其他配置。`,setupRequestDisableSuggestions:`关闭下一步建议,保留其他配置。`,setupRequestPostEdit:`帮我配置或关闭编辑后命令。先展示当前配置,再询问要使用的命令。`,configurePostEdit:`配置编辑后命令`,workflowLimitsValue:`并行 {{concurrency}} · 总调用 {{calls}}`,nextActionSuggestions:`下一步建议`,nextActionSuggestionsDetail:`当前任务结束后,提供几个可选择的下一步操作。`,enabled:`已启用`,disabled:`已关闭`,configured:`已配置`,postEditCommand:`编辑后命令`,postEditCommandDetail:`编辑完成后运行一个命令;关闭时不会执行任何命令。`,resultDisplay:`默认结果显示`,subagentResults:`子代理结果`,bashOperations:`Bash 操作`,fileMutations:`Write / Edit 操作`,footer:`页脚`,terminalFooter:`Pi 终端页脚`,terminalFooterStyle:`终端页脚样式`,terminalFooterHint:`影响 Pi 命令行界面的页脚;已打开的 Pi 界面在下次启动或配置应用后更新。`,detailDisplay_full:`完整`,detailDisplay_compact:`紧凑`,sessionSettings:`会话`,currentModel:`当前`,providerCurrentSessionModel:`当前会话使用 {{model}}。`,useThisModel:`使用此模型`,model:`模型`,modelConnection:`模型连接`,provider:`服务商`,modelId:`模型 ID`,providerStatusUnavailable:`此服务商不在当前有界认证快照中。`,providerSettings:`服务商凭据`,providerSettingsIntro:`查看当前 Web 会话可通过哪些 Pi 服务商完成认证。`,openRuntimeDetails:`打开运行详情`,currentWorkspace:`当前工作区`,providerAuth_api_key:`API 密钥`,providerAuth_oauth:`OAuth`,providerAuthUnknown:`未报告认证方式`,authentication:`认证方式`,accessType:`访问方式`,providerAccessSubscription:`订阅账户`,providerAccessStandard:`服务商凭据`,configurationOwner:`配置归属`,providerLoading:`正在加载服务商状态…`,providerLoadFailed:`无法加载服务商状态。`,providerReadOnly:`由 Pi 管理`,selectProvider:`选择服务商`,gitReviewBaselineUnavailable:`未保留可用的会话基线,可能超出了捕获限额。请切换到未暂存、已暂存或分支查看 Git 变更,也可打开本会话文件记录。`,modelsIntro:`登录账户或添加 API 密钥。已有的 Pi 连接也会显示在这里。`,modelConnectionsTitle:`模型连接`,modelConnectionsIntro:`管理连接凭据,选择新会话和当前会话使用的模型。`,accountLoginMethod:`连接方式`,accountLoginTab:`账户登录`,accountLoginChatGPT:`ChatGPT 账户`,accountLoginClaude:`Claude 账户`,accountLoginKeyTab:`API 密钥`,accountLoginConfigured:`账户已登录`,accountLoginIntro:`在浏览器中完成授权,无需填写 API 密钥。`,accountLoginExisting:`账户凭据已保存在 Pi 中。`,accountLoginStart:`登录`,accountLoginAgain:`重新登录`,accountLoginUnsaved:`请先保存或放弃其他修改,再登录账户。`,accountLoginStarting:`正在准备登录…`,accountLoginWaiting:`等待账户授权`,accountLoginChoose:`选择登录方式`,accountLoginCancelling:`正在取消登录…`,accountLoginBrowser:`在浏览器中继续`,accountLoginDevice:`使用设备码登录`,accountLoginBrowserOption:`在当前电脑上登录,完成后自动返回。`,accountLoginDeviceOption:`适合远程服务器,或无法自动返回的情况。`,accountLoginBrowserHelp:`打开登录页并完成授权,这里会自动更新。`,accountLoginDeviceHelp:`打开授权页并输入下方代码,请保持此页面打开。`,accountLoginOpen:`打开登录页`,accountLoginCopyCode:`复制设备码`,accountLoginPaste:`授权码或回调地址`,accountLoginContinue:`继续`,accountLoginFallback:`已登录,但这里没有更新?`,accountLoginRemoteHelp:`如果无法自动返回,请复制浏览器最后的回调地址,并粘贴到下方。`,accountLoginCancel:`取消登录`,accountLogin_failed:`登录未完成,请重试或选择其他登录方式。`,accountLogin_expired:`登录已过期,请重新开始获取新的授权链接。`,accountLogin_cancelled:`已取消登录。`,accountLoginRequestFailed:`请求未完成,请先刷新状态再重试。`,accountLoginStatusUnknown:`暂时无法查询登录状态,账户授权可能仍在进行。`,accountLoginRefreshRequired:`凭据已保存,但 Pi 未能更新模型列表。请重载 Pi 后使用此连接。`,accountLogout:`退出登录`,accountLogoutRefreshRequired:`已移除保存的凭据,但 Pi 未能更新模型列表。请重载 Pi 刷新状态。`,accountLogoutTitle:`退出 {{provider}}?`,accountLogoutDetail:`将移除此电脑上 Pi 保存的该服务凭据,其他使用它的 Pi 会话也需要重新登录。环境凭据不受影响。`,providerInputTypes:`输入类型`,providerInputText:`文本`,providerInputImage:`图片`,providerCustomTag:`自定义`,providerEdit:`编辑`,providerRemove:`删除`,providerSave:`保存`,editProvider:`编辑 {{provider}}`,removeProvider:`删除 {{provider}}`,providerAdd:`添加模型提供商`,providerAddMode:`添加方式`,providerAddCatalog:`第三方模型提供商`,providerAddCustom:`自定义模型 API`,providerAccountHint:`使用已有账户连接模型,选择服务商后前往浏览器授权。`,providerCatalogHint:`从内置目录中选择提供商,填入其 API 密钥即可使用。`,providerCustomHint:`连接中转站、自部署服务或其他兼容 OpenAI / Anthropic 协议的接口,需填写 API 地址、协议和模型。`,providerKeyKeep:`已配置密钥,留空保持不变`,providerKeyOptional:`输入 API 密钥,或留空使用环境认证`,providerDisplayName:`提供商名称`,providerCustomSettings:`自定义设置`,providerSaved:`已保存 {{provider}}。`,modelDefaultTitle:`新会话默认模型`,modelDefaultChoose:`选择模型`,modelDefaultBadge:`默认`,modelCurrentBadge:`当前使用`,modelDefaultNotSet:`未设置 · 新会话启动时由 Pi 选择`,modelDefaultHint:`选择以后新会话使用的模型,已有会话保留自己的选择。此设置也会更新 Pi 的默认模型。`,modelDefaultReadFailed:`暂时无法读取默认模型。`,modelDefaultProjectOverride:`此工作区有 Pi 独立设置:{{model}}。`,modelDefaultSave:`保存默认模型`,modelMakeDefault:`同时设为新会话默认模型`,modelDefaultSaveFailed:`默认模型保存尚未确认,请刷新状态后重试。`,modelDefaultPartial:`当前模型已切换,但默认模型保存尚未确认,请刷新状态后再试。`,modelConnectionNextHint:`从此连接选择一个模型,用于当前会话。`,modelConnectionSearch:`搜索模型…`,modelConnectionChooseProvider:`选择 {{provider}} 的模型`,modelConnectionUse:`用于当前会话`,modelConnectionUseFailed:`模型切换尚未确认,请刷新模型列表后重试。`,modelConnectionLoadFailed:`暂时无法读取模型列表。`,modelConnectionNoModels:`暂无可选模型,请检查连接或添加模型定义。`,modelConnectionNoMatch:`没有匹配的模型。`,modelConnectionMore:`还有 {{count}} 个模型,可搜索缩小范围。`,providerModelsEmpty:`还没有模型,获取可用模型或手动添加。`,providerModelsInherited:`使用提供商的内置模型目录。`,providerModelsReadOnly:`此提供商包含当前页面未支持的模型设置,请在 Pi 配置文件中编辑。`,providerModelId:`模型 {{number}} ID`,providerModelName:`模型 {{number}} 名称`,providerModelDetails:`模型参数:{{model}}`,providerRemoveModel:`删除模型:{{model}}`,providerIdInvalid:`请使用未被占用的提供商 ID,仅包含字母、数字、连字符、点或下划线。`,providerNativeAuth:`此提供商使用 Pi 原生登录。`,providerConfigurationFailed:`保存失败,请检查填写内容,并在会话空闲时重试。`,providerProfileSavedKeyFailed:`提供商配置已保存,但密钥保存失败。重试将只保存密钥。`,providerReload:`放弃草稿并重新加载`,providerCurrentRemoval:`请先切换当前使用的模型,再删除。`,providerRemoveDetail:`删除此提供商的配置和自定义模型?由 Pi 管理的凭据将保留。`,providerPickerIntro:`以下是模型提供商的可用模型,勾选要添加的模型。`,providerPickerSelected:`已选 {{count}} 个`,providerApiKey:`API 密钥`,providerKeyPlaceholder:`粘贴密钥以添加或替换`,saveProviderKey:`保存密钥`,savingSettings:`正在保存…`,keepEditing:`继续编辑`,discardAndContinue:`放弃更改并继续`,unsavedSettingsTitle:`放弃未保存的更改?`,unsavedSettingsDetail:`未保存的模型和凭据修改将被丢弃。`,unsavedCredentialTitle:`放弃未保存的凭据?`,unsavedCredentialDetail:`新密钥尚未保存,继续后将清空。`,modelSelectionBusy:`当前会话忙碌,暂不能切换模型。`,providerKeySaved:`已保存到 Pi 凭据存储。已有密钥不会回显。`,providerSaveFailed:`密钥保存未完成。请等待会话空闲,刷新状态后重试;部分服务商需要额外认证信息。`,providerWriteDetail:`在这里直接保存到 Pi 凭据存储,密钥不会进入模型对话。OAuth 或需要额外字段的认证请使用 Pi 原生登录。`,editModelConfiguration:`添加或编辑自定义模型`,modelConfigurationDetail:`先设置提供商连接,再获取模型列表或手动添加。保存配置不会调用模型。`,configuredModels:`自定义模型配置`,addModel:`添加模型`,modelConfig_provider:`服务商 ID`,modelConfig_id:`模型 ID`,modelConfig_name:`显示名称`,modelConfig_baseUrl:`API 地址`,modelConfig_api:`API 格式`,modelConfig_contextWindow:`上下文窗口`,modelConfig_maxTokens:`最大输出 token 数`,providerCapacityLabel:`{{field}} {{number}}`,providerModelOptions:`模型选项`,providerModelInvalid:`模型 {{number}}:模型 ID 不能为空或重复;容量需为正数,例如 128K 或 1M,留空使用默认值。`,modelConfig_reasoning:`支持推理`,saveModelConfiguration:`保存模型`,reloadModelConfiguration:`放弃草稿并载入最新配置`,retryModelConfiguration:`重试读取`,discardModelDraftTitle:`放弃这份模型草稿?`,discardModelDraftDetail:`最新配置将替换这份未保存的草稿。`,discardAndReload:`放弃并重新载入`,modelConfigurationUnsaved:`未保存的更改`,modelConfigurationConflict:`模型配置已在别处更改,当前草稿已保留。`,modelConfigurationLoadFailed:`无法读取模型配置,草稿已保留。`,modelConfigurationSaved:`已保存到 Pi models.json。配置服务商密钥后即可选择此模型。`,modelConfigurationFailed:`模型保存未完成,草稿已保留。`,setupConfigurationRequest:`配置需求`,configureViaSetup:`通过 OpenPI setup 应用`,setupFormDetail:`统一走 /openpi-setup。请在对话中查看进度及必要的确认;提交成功不等于配置已保存。`,setupSkillsPlaceholder:`填写要添加或调整的技能,以及来源或本地路径`,setupPluginsPlaceholder:`填写要配置的 Pi 插件,以及准确的包名或本地路径`,enableSkillInvocation:`允许模型调用`,disableSkillInvocation:`改为仅显式调用`,setupSkillInvocationRequest:`配置这个 Pi 技能:{{path}}。将原生 disable-model-invocation 字段设为 {{disabled}},保留其余内容,并说明何时生效。`,setupRoleFormRequest:`将 OpenPI 的 {{role}} 角色配置为使用 {{model}},工作流并发设为 {{concurrency}}。推理级别继承父会话,校验选择有效性,并保留其他配置。`,providerReadOnlyDetail:`此页面只读且不会接收凭据内容。请通过 Pi 配置服务商认证,然后刷新此状态。`,openProviderSettings:`打开服务商设置`,credentialConfigured:`已配置`,credentialMissing:`未配置`,authNotVerified:`凭据已配置不代表模型请求一定成功。`,configurationViaPi:`此处为只读状态。模型凭据与信任由 Pi 管理,OpenPI 选项通过 /openpi-setup 配置。`,noSkillsFound:`当前会话没有加载技能。`,addSkill:`添加技能`,addPlugin:`添加插件`,searchResources:`搜索名称或来源`,filterResourceScope:`资源范围`,allResourceScopes:`全部范围`,noMatchingResources:`没有匹配的资源`,resourceBulkTooLarge:`请进一步筛选列表后,再提交批量配置请求。`,resourceManagement:`Pi 资源`,resourceSourceAuto:`Pi 自动发现`,resourceSourceLocal:`本地资源`,resourcePackageSource:`软件包、仓库或本地路径`,resourcePackageSourcePlaceholder:`npm:包名@版本 · git:owner/repo · /path/to/skill`,resourceInstallIntro:`选择来源和范围,在对话中通过 OpenPI setup 审查并应用。`,resourceInstallReview:`请在对话中确认准确来源和权限。提交请求不代表已安装或已加载。`,resourceRequestSubmitted:`请求已提交。请在对话中查看进度和确认,完成后刷新此目录。`,browseSkills:`浏览 skills.sh 技能`,resourceSessionState:`应用到当前会话`,resourcesReloadNote:`刷新只读取目录;重新加载才会将已保存的资源应用到空闲会话。配置变更不会自动重新加载。`,reloadResources:`重新加载资源`,resourceReloadReview:`将已保存的 Pi 技能与插件配置应用到当前会话,并重新启动扩展?请先等待运行中的工作结束。`,resourceReloaded:`资源已重新加载,请查看更新后的目录和诊断。`,resourceReloadFailed:`无法重新加载资源。请等待当前会话空闲,刷新后重试。`,advancedResourceConfiguration:`高级配置`,resourceDiagnostics:`Pi 报告了 {{extensionErrors}} 项扩展诊断与 {{skillErrors}} 项技能诊断。`,resourceConfigurationDiagnostics:`{{count}} 项设置读取失败,请检查 Pi 配置诊断。`,resourceCatalogTruncated:`此目录有数量上限,部分资源未展示。`,resourceTargetTruncated:`此来源或路径已截断,请通过高级配置确认完整目标后再进行管理。`,updateResource:`检查更新`,removeResource:`审查移除`,skillsEmptyTitle:`添加你的第一个技能`,skillsEmptyIntro:`技能为 Pi 提供可复用的指引。可以添加软件包、仓库或本地技能;项目技能遵循 Pi 的项目信任。`,pluginsEmptyTitle:`用插件扩展 Pi`,pluginsEmptyIntro:`软件包可以包含扩展、技能、提示词和主题。添加来源后,通过 OpenPI setup 审查安装。`,pluginCount:`{{count}} 个插件来源`,installedVersion:`已安装版本`,configuredVersion:`配置版本`,resourceVersionUnpinned:`未固定版本 / 本地来源`,pluginState_loaded:`本会话资源已加载`,pluginState_installed:`已安装 · 未加载`,pluginState_disabled:`配置已禁用`,pluginState_missing:`软件包缺失`,pluginState_error:`加载诊断`,pluginState_notLoaded:`未加载`,pluginLoadedResources:`当前会话目录包含 {{count}} 项资源。配置变更需要明确重新加载后才会应用。`,pluginAction_enable:`审查启用`,pluginAction_disable:`审查禁用`,pluginAction_update:`检查更新`,pluginAction_remove:`审查移除`,enableVisibleSkills:`允许模型使用(当前 {{count}} 项)`,disableVisibleSkills:`仅显式调用(当前 {{count}} 项)`,enableVisiblePlugins:`启用当前 {{count}} 个软件包`,disableVisiblePlugins:`禁用当前 {{count}} 个软件包`,setupResourceInstallRequest:`添加 Pi {{kind}},来源为 {{source}},范围为 {{scope}}。先检查来源并确定固定的软件包身份,通过 ask_user 与我确认安装权限,再使用 Pi 原生的软件包或技能配置。添加技能时保留其他扩展和资源。保留现有偏好与项目信任,不要自动重新加载当前会话。分别报告已保存的配置与仍需执行的操作,不要改动无关的 OpenPI 设置。`,setupPluginOperationRequest:`审查 Pi 软件包操作 {{action}},只针对配置来源 {{source}}、原生安装目录 {{path}}、范围 {{scope}}。相对来源应以该范围的原生设置目录解析。使用 Pi 原生包管理;更新时检查可用版本,通过 ask_user 与我确认固定的目标身份和安装权限。保留资源过滤器及所有无关偏好;如果切换会破坏过滤器,停止并说明。移除时不得删除本地来源目录。不要自动重新加载,分别报告已持久化与当前会话状态,不要改动无关的 OpenPI 设置。`,setupSkillManageRequest:`审查 Pi 技能操作 {{action}},只针对文件 {{path}}、来源 {{source}}、范围 {{scope}}。先检查原生资源归属,通过 ask_user 与我确认更新或移除及所需权限。保留无关技能与软件包资源,不要为了移除一个技能删除整个共享软件包。保留项目信任,不要自动重新加载,也不要改动无关的 OpenPI 设置。`,setupSkillsBulkRequest:`只针对当前展示的 Pi 技能文件 {{paths}},将原生 disable-model-invocation 设为 {{disabled}}。检查资源归属,保留其余内容和偏好,与我审查必要变更,报告无法安全修改的文件。显式 /skill 调用仍应可用。不要自动重新加载,也不要改动无关的 OpenPI 设置。`,setupPluginsBulkRequest:`只针对当前展示的 Pi 软件包 {{packages}},通过 Pi 原生配置将 disabled 设为 {{disabled}}。保留其他偏好与资源过滤器;无法保留过滤器的条目应跳过并报告。遵循范围与项目信任,与我审查必要变更,不要自动重新加载,也不要改动无关的 OpenPI 设置。`,resourceRequestFinished:`配置回合已结束。请刷新并查看 Pi 原生配置与会话资源,确认实际变更。`,skillCount_one:`{{count}} 个技能`,skillCount_other:`{{count}} 个技能`,skill:`技能`,copySkillInvocation:`复制调用命令`,source:`来源`,scope:`范围`,invocation:`调用方式`,modelInvocation:`模型调用`,resourceScope_user:`全局`,resourceScope_project:`项目`,resourceScope_temporary:`临时`,explicitOnly:`仅允许明确调用`,availableToModel:`模型可按需使用`,skillFile:`技能文件`,selectSkill:`选择一个技能`,subagentConfiguration:`Pi 原生子代理角色`,subagentConfigurationIntro:`未在 OpenPI 配置中指定模型时,角色继承父会话模型。`,subagentActiveCount_one:`{{count}} 个运行中`,subagentActiveCount_other:`{{count}} 个运行中`,subagentCompletedCount_one:`{{count}} 条记录`,subagentCompletedCount_other:`{{count}} 条记录`,subagentConcurrency:`上限 {{count}}`,builtInRoles:`内置角色`,subagentRole_explorer:`探索者`,subagentRole_implementer:`实现者`,subagentRole_reviewer:`审查者`,subagentRole_advisor:`顾问`,subagentRoleShort_explorer:`只读调查`,subagentRoleShort_implementer:`聚焦实现`,subagentRoleShort_reviewer:`正确性审查`,subagentRoleShort_advisor:`技术分析`,subagentRoleDescription_explorer:`调查代码库并报告证据,不修改文件。`,subagentRoleDescription_implementer:`实现边界明确的改动并运行相关仓库检查。`,subagentRoleDescription_reviewer:`审查正确性、安全性、回归风险和缺失验证。`,subagentRoleDescription_advisor:`分析困难技术问题并提出具体下一步建议。`,configureRoles:`配置角色`,builtInRole:`内置角色`,builtIn:`内置`,modelAssignment:`模型分配`,inheritParentModel:`继承父会话模型`,effectiveModel:`实际模型`,workflowConcurrencyLabel:`并行 Agent`,workflowCallLimit:`Agent 总调用数`,runtimeBoundaries:`运行时边界`,subagentAuthorityNote:`子会话权限是父会话与角色能力的故障关闭交集,不会静默扩大权限。`,subagentModelNote:`不会硬编码服务商;未分配的角色继承父会话模型和思考等级。`,resourceCount_one:`{{count}} 项资源`,resourceCount_other:`{{count}} 项资源`,noPluginsFound:`Pi 未报告已加载的插件来源。`,pluginCatalogTotals:`{{extensions}} 扩展 · {{skills}} 技能 · {{prompts}} 提示词 · {{themes}} 主题`,loaded:`已加载`,resourceOrigin:`来源类型`,resourceOrigin_package:`软件包`,resourceOrigin_topLevel:`顶层资源`,resources:`资源`,baseDirectory:`基础目录`,notReported:`未报告`,extensions:`扩展`,extensionSurfaceCount:`{{tools}} 个工具 · {{commands}} 个命令`,prompts:`提示词`,themes:`主题`,pluginResourceSummary:`{{extensions}} 扩展 · {{skills}} 技能 · {{prompts}} 提示词 · {{themes}} 主题`,pluginsManagedByPi:`这些资源由 Pi 加载。可通过上方 setup 表单提交变更;软件包操作沿用原生确认,并通过 Pi 的重新加载流程生效。`,selectPlugin:`选择一个插件来源`,statusCaptured:`采集于 {{time}} · 刷新查看最新状态`,conversationViews:`会话视图`,currentConversations:`当前`,archivedConversations:`已归档`,refreshArchives:`刷新归档会话`,loadingArchives:`正在加载归档会话...`,moreArchives:`加载更多归档会话`,retryArchives:`重试读取归档会话`,archiveLoadFailed:`无法加载归档会话。`,archiveCursorStale:`归档会话已变化,请刷新后继续。`,archiveScanBounded:`还有 {{count}} 条更早记录未扫描。`,noArchivedSessions:`没有归档会话。`,noScannedArchives:`已扫描历史中没有归档会话。`,noMatchingScannedArchives:`已扫描历史中没有匹配的归档会话。`,draftLimit:`草稿暂存已满,请先发送或清空已有草稿。`,restoreConversation:`恢复会话`,restoringConversation:`正在恢复…`,loadedArchives:`已加载历史中的归档会话`,loadedHistoryBounded:`另有 {{sessions}} 个会话和 {{workspaces}} 个工作区摘要未加载。搜索仅覆盖已加载列表。`,noLoadedArchives:`已加载列表中没有归档会话。`,restoreFailed:`暂时无法确认恢复结果,请刷新后重试。`,execution_running:`运行中`,execution_done:`已完成`,execution_killed:`已停止`,execution_timed_out:`已超时`,execution_failed:`失败`,execution_uncertain:`状态不确定`,activeOnlyHint:`只有当前 Web 会话可以接收消息。`,stopTurn:`停止当前轮次`,stoppingTurn:`正在停止当前轮次…`,stoppedTurn:`当前轮次已停止。`,pendingFollowUpsHint:`{{count}} 条消息正在排队`,sendNextTurn:`下一轮发送`,followUpBehavior:`跟进处理方式`,followUpBehaviorDetail:`OpenPI 运行时,将后续消息排队到下一轮,或引导当前轮次。按 ⌘/Ctrl+Enter 可仅对这条消息使用另一种方式。`,followUpQueue:`排队`,followUpQueueDetail:`下一轮发送`,followUpSteer:`引导`,followUpSteerDetail:`加入当前轮次`,steerCurrentTurn:`当前执行纠偏`,steeringHint:`在当前工具步骤结束后加入这条指示。`,pendingSteeringHint:`已接收 {{count}} 条纠偏指示,等待当前工具步骤结束`,steeringMessagesTitle:`当前轮次待处理的纠偏指示`,steerStaleTurn:`目标轮次已结束或变化。草稿已保留,请确认更新后的状态并重新发送。`,sourceFeedbackNew:`{{path}} · 新版本第 {{line}} 行`,sourceFeedbackOld:`{{path}} · 旧版本第 {{line}} 行`,forkMessage:`从此处分叉`,forkMessageHint:`从此消息创建新聊天,保留原聊天;不会自动发送消息。`,forkSessionPending:`正在创建分叉会话…`,forkSessionCreated:`已创建分叉会话,原会话保留在侧栏。`,forkSessionCancelled:`分叉已取消,原会话已保留。`,forkSessionUncertain:`无法确认分叉结果。请先刷新并检查会话列表,再决定是否重试。`,forkSessionUnavailable:`切换到此会话并等待当前执行和排队消息结束后,可以从这里创建新会话。`,reviewQuoteLine:`引用此行`,reviewSelectOldLine:`选择旧版本第 {{line}} 行`,reviewSelectNewLine:`选择新版本第 {{line}} 行`,queuedMore:`还有 {{count}} 条排队消息`,queuedImage:`图片附件`,queuedMessageExpand:`展开排队消息`,queuedMessageCollapse:`收起排队消息`,backgroundSessionRunning:`此会话正在后台运行…`,observedSessionTools:`{{count}} 个正在执行的工具`,toolsRequireCurrentSession:`切换到此会话后可使用交互工具。`,activateViewedSession:`切换到此会话`,activateViewedSessionHint:`发送消息即可继续此会话。`,acceptedHint:`OpenPI Web 已接收消息。`,promptAdmissionUnknown:`无法确认上次发送的消息是否已被接收。`,promptAdmissionUnknownDetail:`请先核对已刷新的会话历史和运行状态,再决定下一步。作为新消息发送可能产生重复消息。`,promptAdmissionCheckingDetail:`正在核对最新的会话历史和运行状态,核对完成前不能作为新消息发送。`,promptAdmissionVerificationFailedDetail:`暂时无法刷新最新的会话历史和运行状态。请重新核对后再决定是否作为新消息发送。`,abandonAdmission:`暂不重新发送`,retryAdmissionCheck:`重新核对`,retryOriginalAdmission:`重试原消息`,promptTooLong:`文本超出发送上限({{count}} / {{limit}})。`,sendAsNew:`作为新消息发送`,sendingAsNew:`正在发送…`,addWorkspace:`添加工作区`,addWorkspaceMenu:`添加工作区...`,archiveConversation:`归档会话`,pinnedConversations:`置顶`,sidebarOptions:`侧栏选项`,sidebarProjectOptions:`项目侧栏选项`,sidebarRecentOptions:`会话侧栏选项`,sidebarActivityOptions:`动态视图选项`,sidebarShow:`显示`,sidebarGroupBy:`会话分组`,sidebarByProject:`按项目分组`,sidebarFlatList:`所有会话`,sidebarChatSort:`会话排序`,sidebarRecent:`最近`,sidebarProjectsInRecents:`在最近列表显示项目会话`,sidebarShowMore:`展开显示`,sidebarShowLess:`收起显示`,sidebarFilterList:`筛选当前列表`,sidebarSaveFailed:`更改未能保存,请重试。`,pinWorkspace:`置顶项目`,unpinWorkspace:`取消置顶项目`,markConversationRead:`标记为已读`,markConversationUnread:`标记为未读`,sidebarState_unread:`未读会话`,sidebarActivity:`动态`,sidebarViewActivity:`查看动态`,sidebarViewChats:`查看会话`,sidebarPriority:`优先关注`,sidebarActivityEmpty:`没有需要关注的会话`,sidebarActivityEmptyHint:`已完成的工作和需要你处理的会话会显示在这里。`,sidebarMarkAllRead:`全部标记为已读`,sidebarClearRead:`清除优先关注中的已读会话`,sidebarReadFailed:`未能更新已读状态,请重试。`,sidebarToday:`今天`,sidebarYesterday:`昨天`,sidebarEarlier:`更早`,sidebarActivityCompleted:`已完成`,sidebarActivityFailed:`执行失败`,sidebarActivityRead:`已读`,modelAdvanced:`高级参数`,providerConnectionHeading:`提供商连接`,providerFetchModels:`获取可用模型`,providerFetchHint:`填写提供商和端点后,可一次选择多个模型。`,providerPickerTitle:`选择要添加的模型`,providerPickerAccess:`连接凭据`,providerPickerKey:`访问密钥(可选)`,providerPickerKeyHint:`留空使用此端点已保存的凭据。此处输入的密钥仅用于获取列表,不会保存。`,providerPickerSearch:`搜索模型`,providerPickerSelectAll:`全选`,providerPickerClear:`清空选择`,providerPickerLoading:`正在获取可用模型…`,providerPickerAdded:`已添加`,providerPickerNoMatch:`没有匹配的模型`,providerPickerEmpty:`提供商没有返回模型,仍可手动添加。`,providerPickerBounded:`当前显示前 500 个模型,其他模型可手动填写 ID。`,providerPickerError_load:`未能获取模型列表,请检查端点和凭据后重试,也可以手动添加。`,providerPickerError_save:`尚未确认保存成功。已保留你的选择,请检查连接后重试。`,providerPickerError_conflict:`配置已在其他地方更新,请关闭弹窗、重新读取配置后再保存。`,providerPickerDefaults:`新模型使用 {{context}} 上下文 / {{output}} 输出 token,添加后可逐个调整。`,providerPickerRetry:`刷新列表`,providerPickerCount:`已选 {{count}} 个 · 最多 100 个`,providerPickerSave:`添加所选`,sidebarState_running:`执行中`,sidebarState_compacting:`正在整理上下文`,sidebarState_waiting:`等待你的回复`,sidebarState_completed:`已完成 · 结果未读`,sidebarState_failed:`执行失败 · 打开会话查看详情`,pinnedOptions:`置顶选项`,pinConversation:`置顶会话`,unpinConversation:`取消置顶`,pinnedRecentlyUpdated:`最近更新`,pinnedManualOrder:`手动排序`,movePinUp:`上移`,movePinDown:`下移`,pinSaveFailed:`置顶设置未能保存,请重试。`,cancel:`取消`,chooseWorkspaceHint:`选择工作区并描述任务`,close:`关闭`,closeSearch:`关闭搜索`,collapseSidebar:`收起侧边栏`,confirmEdit:`保存并重新运行`,editMessageHint:`从这里创建新分支并重新运行;保留原对话、图片和文件引用。已有工作区改动会保留。`,regenerateMessage:`重新生成回答`,regenerateMessageHint:`在新分支重新运行这条问题,保留原附件和原对话。`,messageRerunStarted:`已在新分支接收重跑消息,原对话已保留。`,openOriginalConversation:`查看原对话`,messageRerunWorkspaceHint:`已有工作区改动会保留。`,modelRequestRecovered:`请求已恢复`,modelReconnecting:`正在重新连接`,modelReconnectUnknown:`重连状态待确认`,modelEarlierAttempts:`先前请求错误`,modelFailedAttempts:`失败尝试({{count}} 次)`,draftStorageUnavailable:`草稿未能保存到此设备,请保持页面打开或复制消息。`,draftStorageInvalid:`部分保存的草稿内容无法恢复,请检查消息和附件。`,draftStorageRetry:`重试保存草稿`,workbarBackToChat:`返回聊天`,workbarCollapseTools:`收起工具栏`,workbarEndTerminal:`关闭 {{name}} 并结束进程`,workbarNewTerminal:`新建终端`,workbarContinueInChat:`继续追问`,transcriptSearch:`搜索消息内容`,transcriptSearchPlaceholder:`搜索标题、项目或消息…`,transcriptSearchRecent:`最近会话`,transcriptSearchSessions:`会话`,transcriptSearchMessages:`消息内容`,transcriptSearchSessionResult:`打开会话 {{session}}`,transcriptSearchSessionOpenFailed:`暂时无法打开此会话,请重试。`,transcriptSearchIncludeArchived:`包含归档会话`,transcriptSearching:`正在搜索消息…`,transcriptSearchEmpty:`没有匹配的消息。`,transcriptSearchFailed:`暂时无法搜索消息,请重试。`,transcriptSearchRetry:`重试搜索`,transcriptSearchPartial:`部分历史未能搜索,结果可能不完整。`,transcriptSearchOpenFailed:`无法打开这条消息,它可能已移动或位于其他分支。`,transcriptSearchResult:`打开 {{session}} 中来自{{source}}的消息`,transcriptSearchSource_user:`你`,transcriptSearchSource_assistant:`助手`,transcriptSearchSource_tool_call:`工具调用`,transcriptSearchSource_tool_result:`工具结果`,connected:`已连接`,connecting:`正在连接`,conversationName:`会话名称`,conversationOptions:`会话选项`,sidebarRename:`重命名`,sidebarPin:`置顶`,sidebarUnpin:`取消置顶`,sidebarFork:`分叉`,sidebarForkLocal:`创建聊天分支`,sidebarForkSameWorktree:`在同一工作树中分叉`,archiveNoticeTitle:`聊天已归档`,archiveNoticeView:`查看`,archiveNoticeUndo:`撤销`,archiveNoticeFailed:`操作未完成,请重试。`,sidebarForkWorktree:`在新工作树中创建聊天分支`,sidebarForkCancelling:`正在请求取消…`,sidebarForkFinishing:`无法再取消,正在确认创建结果…`,sidebarForkCancelUnconfirmed:`无法确认取消,正在等待分叉结果。`,sidebarForkWorktreePreserved:`工作树已保留在 {{path}},请检查后再重试。`,sidebarForkWorktreePending:`正在创建工作树和聊天分支…`,sidebarForkOptionsLoading:`正在检查工作树是否可用…`,sidebarForkOptionsFailed:`无法检查工作树,请重新打开菜单重试。`,sidebarForkUnavailable:`发送消息后才能创建此聊天的分支。`,sidebarForkArchived:`请先恢复此会话,再创建分叉。`,sidebarForkFailed:`未能创建分叉,原会话已保留。`,sidebarCopy:`复制`,sidebarCopyLink:`复制会话链接`,sidebarCopyMarkdown:`复制为 Markdown`,sidebarCopyCwd:`复制工作目录`,sidebarCopied:`已复制`,sidebarCopyFailed:`复制失败,请重试。`,sidebarNewWindow:`在新窗口中打开`,sidebarOpenIn:`打开方式`,sidebarAppsLoading:`正在加载可用应用…`,sidebarAppsFailed:`无法加载应用,请重新打开菜单重试。`,sidebarOpenFailed:`无法在所选应用中打开此项目。`,sidebarArchive:`归档`,sidebarRestore:`恢复`,sidebarDelete:`永久删除`,managedWorktreeRecoveryFull:`请先核对先前未确认的移除请求,再开始新的请求。`,managedWorktreesChanged:`工作树列表已变化,请刷新后重新核对目标。`,managedWorktreesRefresh:`刷新工作树列表`,managedWorktreesBack:`返回工作树列表`,managedWorktreesRetry:`重试请求`,managedWorktrees:`保留的工作树`,managedWorktreesDescription:`删除会话会保留 OpenPI 创建的工作树。请核对准确路径后再请求移除。使用中、共享、有改动或无法确认归属的工作树会保留。`,managedWorktreeConfirm:`移除此工作树?服务端会重新核对归属、使用中的会话及本地改动后再操作。`,managedWorktreeRemoved:`工作树已移除。`,managedWorktreePreserved:`工作树已保留:`,managedWorktreeUncertainTerminal:`移除结果无法确认,不能自动重复移除。请先检查保留路径,再决定后续操作。`,managedWorktreeUncertain:`尚不能确认移除结果。重试会核对原请求。`,managedWorktreeRemoving:`正在核对并移除…`,managedWorktreeRemove:`移除工作树`,managedWorktreeReview:`核对移除`,managedWorktreesEmpty:`这一页没有找到托管工作树。`,managedWorktreesUnavailable:`有 {{count}} 条归属记录无法确认。`,managedWorktreesLoadFailed:`无法加载保留的工作树。请重试,目标不会改变。`,managedWorktreesMore:`加载更多工作树`,managedWorktreeRetainedAfterDelete:`会话已删除,工作树保留在 {{path}}。可从项目菜单核对保留的工作树。`,sidebarDeleteTitle:`删除会话?`,sidebarDeleteDescription:`确定永久删除“{{name}}”?此操作无法撤销。`,sidebarDeleteConfirm:`删除`,sidebarDeleting:`正在删除…`,sidebarDeleteFailed:`未能删除此会话,请重试或取消。`,sidebarActionRunning:`请等待当前工作和排队消息结束。`,sidebarActionDisconnected:`请先恢复连接,再修改此会话。`,sessionDeleteCancelled:`删除已取消`,sessionDeleteUncertain:`无法确认会话是否删除,请刷新后重试`,sessionDeleted:`会话已永久删除`,sessionDeleteMetadataPending:`会话已删除,但侧栏记录未清理完成`,sessionLinkUnavailable:`链接中的会话已不存在或身份已变化`,sidebarDropPin:`拖到此处置顶`,sidebarDropProjectLast:`将项目移到最后`,conversationTurns:`会话轮次`,conversationTurnPosition:`前往第 {{position}} 轮`,turnPreviewLoading:`正在加载预览…`,turnPreviewUnavailable:`暂时无法读取,请重试。`,commands:`斜杠命令`,addContext:`添加上下文`,fileReference:`引用工作区文件`,fileReferenceTitle:`引用工作区文件`,fileReferenceDetail:`将路径引用加入提示词,不上传文件内容。`,fileReferenceLabel:`工作区文件路径`,fileReferencePlaceholder:`src/app.tsx`,fileReferenceValidatedHint:`当前会话会验证该路径是可读取的工作区文件。`,fileReferenceDraftHint:`新会话启动后,Pi 会按其工具权限解析该路径。`,fileReferenceChecking:`正在检查…`,fileReferenceFailed:`无法验证该文件。`,fileReferenceDenied:`请选择当前会话工作区内的文件。`,fileReferenceMissing:`该工作区文件已不存在。`,fileReferenceUnsupported:`只能引用工作区中的普通文件。`,fileReferenceExpired:`活动会话已变化,请重新打开文件引用后再试。`,fileReferenceBusy:`文件校验正忙,请稍后重试。`,insertReference:`插入引用`,commandsSessionRequired:`会话启动后才能插入斜杠命令。`,commandsEmptyDraftOnly:`只能在空白草稿中插入斜杠命令。`,commandsLoading:`正在加载命令…`,commandsUnavailable:`暂时无法读取命令。`,commandsNoMatch:`没有匹配的命令。`,commandsNoAvailable:`已发现的命令均不能在 Web 中运行。输入具体命令名可查看其可用性。`,commandsBounded:`另有 {{count}} 个命令未显示。`,commandSessionRequired:`命令仅在已创建的 Web 会话中可用。`,commandUnsupported:`尚未适配 · 手动命令仍交给 Pi`,commandAcceptsArguments:`可输入参数`,commandSource_extension:`扩展命令`,commandSource_prompt:`提示词模板`,commandSource_skill:`技能`,copiedMessage:`已复制`,copyMessage:`复制消息`,copyFailed:`复制失败,请选中消息后手动复制。`,copiedCode:`代码已复制`,copyCode:`复制代码`,copyCodeFailed:`无法复制代码,请选中后手动复制。`,codeBlock:`代码块`,wrapCode:`自动换行`,expandCode:`展开全部 {{count}} 行`,collapseCode:`收起代码`,expandInput:`展开输入框`,collapseInput:`收起输入框`,deleteWorkspace:`删除工作区`,describeTask:`描述任务`,editMessage:`修改并从这里重跑`,enterHint:`按 Enter 发送,Shift+Enter 换行。`,expandSidebar:`展开侧边栏`,importWorkspace:`导入工作区`,loadingModels:`正在加载模型...`,modelsTruncated:`当前显示 {{shown}} 个模型,还有 {{omitted}} 个可用;搜索即可查找。`,searchModels:`搜索可用模型`,searchModelsPlaceholder:`搜索服务商、模型名称或 ID...`,searchingModels:`正在搜索模型...`,noMatchingModels:`没有匹配的模型`,modelSearchFailed:`模型搜索失败,请重试。`,retryModelSearch:`重试模型搜索`,fileReferenceDraftChanged:`草稿已变化,请重新打开文件引用。`,modelSearchTruncated:`还有 {{omitted}} 个匹配模型未显示。`,modelPreparing:`正在准备任务...`,modelRetrying:`模型请求重试中...`,modelRunning:`正在运行…`,modelRequestFailed:`模型请求失败`,modelRequestStopped:`模型请求已停止`,modelFailureUnknown:`服务商没有返回具体失败原因。`,retryPrompt:`重试消息`,retryingPrompt:`正在重试…`,newSession:`新建会话`,noConversations:`暂无对话`,noMatching:`没有匹配的会话`,noMatchingLoaded:`已加载历史中没有匹配的会话`,noModels:`没有可用模型`,noOutput:`无输出`,noSessions:`暂无会话`,openSidebar:`打开侧边栏`,promptMessage:`发消息或创建任务,/ 调用指令`,promptReadonly:`非当前会话不能接收消息`,promptStart:`选择一个工作区开始`,promptTask:`描述你想要构建的任务`,queuedHint:`当前回合结束后将发送消息。`,reconnecting:`正在重连`,removeWorkspace:`从侧边栏移除`,workspaceOptions:`工作区选项`,renameFailed:`无法保存名称,已保留你的修改。`,savingName:`正在保存...`,workspaceRemoveFailed:`无法移出工作区,请重试。`,removingWorkspace:`正在移出...`,renameConversation:`重命名会话`,renameWorkspace:`重命名工作区`,save:`保存`,searchConversations:`搜索会话`,searchPlaceholder:`筛选标题与工作目录…`,selectModel:`选择模型`,configureModels:`配置模型`,openModelSettings:`模型设置`,selectThinking:`选择思考等级`,thinkingAvailableLevels:`可选等级:{{levels}}`,resetThinking:`恢复打开时的等级({{level}})`,modelThinkingNotEnabled:`此模型未启用思考。如提供商支持,可在模型设置中开启「支持推理」。`,providerReasoningHint:`按提供商能力开启,在聊天输入框调节当前思考等级。`,providerThinkingLevels:`支持的思考等级`,providerThinkingLevelsHint:`选择此模型支持的等级,保存后同步到会话选择器。`,providerThinkingAutomatic:`自动(Pi 默认)`,providerThinkingSelected:`已选 {{count}} 项`,providerThinkingReset:`使用 Pi 默认等级`,providerImageHint:`未勾选图片时,模型不会收到图片附件。`,selectWorkspace:`选择工作区`,send:`发送`,processDetails:`执行过程`,processRunning:`正在执行`,processThinkingCount:`{{count}} 段思考`,processToolCount:`{{count}} 次工具调用`,processFailureCount:`{{count}} 次失败`,runtimeActivities:`执行活动`,activityAgentProgress:`{{completed}}/{{total}} 个子代理已结束`,activityCapacity:`并行任务:{{running}}/{{limit}} · {{queued}} 个等待中`,composerQueuedCount:`排队 {{count}}`,composerSteeringCount:`引导 {{count}}`,runtimeActivityRunning:`{{count}} 项进行中`,runtimeActivityCount:`{{count}} 项活动`,processActivityCount:`{{count}} 项 Agent 活动`,switchingSession:`正在切换会话...`,thinkingActive:`思考中...`,thinkingActiveLevel:`思考中({{level}})...`,thinkingDone:`思考过程`,thinkingLoadFull:`查看完整思考`,thinkingLoadingFull:`正在加载思考…`,thinkingLoadFailed:`思考加载失败,点击重试`,thinkingPartialText:`当前显示部分已保存的思考,可继续加载下方内容。`,thinkingPreviewOnly:`思考预览已达到显示上限,此消息保存后可查看完整内容。`,toolState_running:`执行中`,toolState_returned:`已返回`,toolState_failed:`失败`,toolState_cancelled:`已停止`,toolState_timed_out:`超时`,toolState_unknown:`未确认`,toolSnapshotMissingResult:`分叉时尚无结果`,toolActivity_running:`正在{{action}}`,toolActivity_failed:`{{action}}失败`,toolActivity_cancelled:`{{action}}已停止`,toolActivity_timed_out:`{{action}}超时`,toolActivity_unknown:`{{action}}`,toolAction_read:`读取`,toolAction_write:`写入文件`,toolAction_edit:`编辑文件`,toolAction_command:`运行`,toolAction_search:`搜索`,toolAction_list:`列出文件`,toolAction_web:`浏览网页`,toolAction_agent:`使用子代理`,subagentAction_spawn:`启动子代理`,subagentAction_send:`发送补充消息`,subagentAction_check:`查询子代理`,subagentAction_wait:`等待子代理`,subagentAction_cancel:`停止子代理`,subagentActionDone_spawn:`已启动子代理`,subagentActionDone_send:`已发送补充消息`,subagentActionDone_check:`已查询子代理`,subagentActionDone_wait:`已结束等待`,subagentActionDone_cancel:`停止请求已返回`,toolAction_workflow:`调用工作流`,toolAction_plan:`准备计划`,toolAction_git:`查看变更`,toolAction_call:`调用工具`,toolActionDone_read:`已读取`,toolActionDone_write:`已写入`,toolActionDone_edit:`已编辑`,toolActionDone_command:`已运行`,toolActionDone_search:`已搜索`,toolActionDone_list:`已列出的文件`,toolActionDone_web:`已浏览网页`,toolActionDone_agent:`子代理工具已返回`,toolActionDone_workflow:`工作流工具已返回`,toolActionDone_plan:`计划工具已返回`,toolActionDone_git:`已查看变更`,toolActionDone_call:`已调用工具`,toolActionGroup_read:`读取文件`,toolActionGroup_write:`写入文件`,toolActionGroup_edit:`编辑文件`,toolActionGroup_command:`运行命令`,toolActionGroup_search:`搜索`,toolActionGroup_list:`列出文件`,toolActionGroup_web:`浏览网页`,toolActionGroup_agent:`子代理活动`,toolActionGroup_workflow:`工作流活动`,toolActionGroup_plan:`准备计划`,toolActionGroup_git:`查看变更`,toolActionGroup_call:`调用工具`,toolGroup_done:`{{actions}}`,toolGroup_running:`正在{{actions}}`,toolGroup_unknown:`{{actions}}`,toolGroupSeparator:`、`,toolSearchTarget:`“{{pattern}}” · {{path}}`,toolDiffStatsHelp:`当前显示差异中的新增和删除行数`,toolRequestedFile:`文件:`,toolWorkspace:`工作区`,toolRawEvidence:`参数与原始结果`,toolCodemodeDetails:`脚本与原始结果`,toolNestedOutputMissing:`会话记录保留了调用和状态,未保存此子工具的输出。`,toolNestedArgumentsMissing:`会话记录未保留完整参数和此子工具的输出。`,toolNestedIncomplete:`子调用记录不完整,部分调用、参数或最终状态不可用。`,toolPartialEvidence:`输出未完整显示:已达到字节、行数或条目上限。原始结果也可能被截断。`,toolFileChange_created:`已创建文件`,toolFileChange_unchanged:`文件内容未改变`,toolFileChange_overwritten:`已覆盖文件`,toolChangeUnavailable:`此工具结果未提供修改对比。`,toolTestResults:`测试结果摘要 · {{format}}`,toolTestCounts:`{{tests}} 项测试 · {{passed}} 通过 · {{failed}} 失败 · {{cancelled}} 取消`,toolTestCountsHelp:`数量来自命令输出,执行状态单独显示。`,toolReadMore:`可使用文件路径和 offset 继续读取,具体方式见原始结果。`,toolFullOutputReference:`完整输出:`,subagentBackgroundResult:`后台子代理结果 · {{count}}`,thinkingDraftHint:`请先选择工作区并创建会话。`,thinkingInactiveHint:`只有当前会话可以更改思考等级。`,thinkingLevelMismatch:`当前确认的思考等级不在此模型支持范围内;选择其它等级即可修正。`,thinkingLockedRunning:`请先停止当前轮次,再更改思考等级。`,thinkingModelPendingHint:`请等待模型切换完成。`,thinkingNotConfirmed:`思考等级未获确认,请重试。`,thinkingPendingHint:`正在应用思考等级...`,thinkingUnsupported:`暂不支持思考`,thinkingUnsupportedHint:`尚未选择模型,或当前模型不支持思考。`,unavailable:`不可用`,ungrouped:`未分组`,untitledSession:`新会话`,workspaceDeleteConfirm:`文件夹与会话记录会保留,其中的会话会被放到“未分组”;再次打开此目录时将是一个干净的工作区。`,workspaceName:`工作区名称`,workspaces:`工作区`,sidebarProjects:`项目`}}},dG=navigator.language?.toLowerCase().startsWith(`zh`)?`zh`:`en`;Xl.use(Zl).init({fallbackLng:`en`,initAsync:!1,interpolation:{escapeValue:!1},lng:dG,resources:uG}),document.documentElement.lang=dG===`zh`?`zh-CN`:`en`;var fG=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},pG=10,mG=13,hG=32,gG=6;function _G(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{maxBufferSize:t,onComment:n,onError:r,onEvent:i,onId:a,onRetry:o}=e,s=[],c=0,l=!0,u,d=``,f=0,p,m=!1,h=!1,g=!1;function _(e){if(m)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l&&(l=!1,e.charCodeAt(0)===65279?e=e.slice(1):e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),(h||g)&&(e=v(e),!e))return;if(!s.length){let t=S(e);t!==``&&y(t),x();return}if(e.indexOf(` `)===-1&&e.indexOf(`\r`)===-1){if(c0&&i?.({id:u,event:p,data:d}),u=void 0,d=``,f=0,p=void 0,t=n+1,n=e.indexOf(` diff --git a/web/dist/build-info.json b/web/dist/build-info.json index 2484725b3..4b26bc2fe 100644 --- a/web/dist/build-info.json +++ b/web/dist/build-info.json @@ -1,5 +1,5 @@ { "version": "1.1.0", - "id": "0746de8f104151b57ab00e1b97ff31bc252ab81b2e22c6739aa61c0100ae4658", + "id": "909cb8acf6444fb32520b4a53840f089859193a9cfb17443769459fda862f66d", "mode": "production" }